signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class PlanNode { /** * Find the first node with the specified type that are at or below this node . * @ param order the order to traverse ; may not be null * @ param typeToFind the type of node to find ; may not be null * @ return the first node that is at or below this node that has the supplied type ; or...
return findAtOrBelow ( order , EnumSet . of ( typeToFind ) ) ;
public class PkcsPkiEnvelopeDecoder { /** * Decrypts the provided < tt > pkcsPkiEnvelope < / tt > , and extracts the content . * @ param pkcsPkiEnvelope * the envelope to decrypt and open . * @ return the content of the < tt > pkcsPkiEnvelope < / tt > , the SCEP * < tt > messageData < / tt > . * @ throws Mess...
LOGGER . debug ( "Decoding pkcsPkiEnvelope" ) ; validate ( pkcsPkiEnvelope ) ; LOGGER . debug ( "Decrypting pkcsPkiEnvelope using key belonging to [dn={}; serial={}]" , recipient . getSubjectDN ( ) , recipient . getSerialNumber ( ) ) ; final RecipientInformationStore recipientInfos = pkcsPkiEnvelope . getRecipientInfos...
public class Transport { /** * Downloads redmine content . * @ param uri * target uri . * @ param handler * content handler . * @ return handler result . * @ throws RedmineException * if something goes wrong . */ public < R > R download ( String uri , ContentHandler < BasicHttpResponse , R > handler ) thr...
final URI requestUri = configurator . addAPIKey ( uri ) ; final HttpGet request = new HttpGet ( requestUri ) ; if ( onBehalfOfUser != null ) { request . addHeader ( "X-Redmine-Switch-User" , onBehalfOfUser ) ; } return errorCheckingCommunicator . sendRequest ( request , handler ) ;
public class clusterinstance_clusternode_binding { /** * Use this API to fetch filtered set of clusterinstance _ clusternode _ binding resources . * filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */ public static clusterinstance_clusternode_binding [ ] get_filtered ( nitro_service ...
clusterinstance_clusternode_binding obj = new clusterinstance_clusternode_binding ( ) ; obj . set_clid ( clid ) ; options option = new options ( ) ; option . set_filter ( filter ) ; clusterinstance_clusternode_binding [ ] response = ( clusterinstance_clusternode_binding [ ] ) obj . getfiltered ( service , option ) ; re...
public class Dictionary { /** * 从文件中读取 * @ param path 文件路径 * @ param tag 词典名 * @ throws IOException */ public void load ( String path , String tag ) throws IOException { } }
if ( path == null ) return ; dict = MyCollection . loadTSet ( path ) ; maxLen = 0 ; TObjectHashIterator < String > it = dict . iterator ( ) ; while ( it . hasNext ( ) ) { String k = it . next ( ) ; if ( k . length ( ) > maxLen ) { maxLen = k . length ( ) ; } } name = tag ;
public class XPathCheckResult { /** * Parse method to allow Fitnesse to determine expected values . * @ param value expected value from cell . * @ return object with supplied value as result . */ public static XPathCheckResult parse ( String value ) { } }
XPathCheckResult parsed = new XPathCheckResult ( ) ; parsed . result = value ; return parsed ;
public class URLConnectionTools { /** * Do a POST to a URL and return the response stream for further processing elsewhere . * The caller is responsible to close the returned InputStream not to cause * resource leaks . * @ param url the input URL to be read * @ param data the post data * @ return an { @ link ...
return doPOST ( url , data , DEFAULT_CONNECTION_TIMEOUT ) ;
public class RollbackBean { /** * We use several OJB services , start to iterate a query result and do * an odmg - tx . abort call . * @ ejb : interface - method */ public void rollbackBreakIteration ( List objectsToStore ) { } }
// now we mix up different api ' s and use PB - api too log . info ( "rollbackBreakIteration" ) ; /* store list of objects , then get these objects with Iterator , start iteration , then break */ storeObjects ( objectsToStore ) ; Class searchClass = objectsToStore . get ( 0 ) . getClass ( ) ; PersistenceBroker broker...
public class ContextUtil { /** * Sets up the Subject section of the request . Takes a list of Maps of * URI / AttributeValue pairs . Each list element represents one subject which * contains a map of URI / AttributeValues . * @ return a Set of Subject instances for inclusion in a Request */ public List < Subject ...
if ( subjs == null || subjs . size ( ) == 0 ) { return Collections . singletonList ( new Subject ( new ArrayList < Attribute > ( ) ) ) ; } List < Subject > subjects = new ArrayList < Subject > ( subjs . size ( ) ) ; // Go through each of the subjects for ( Map < URI , List < AttributeValue > > s : subjs ) { List < Attr...
public class PerformanceTarget { /** * Gets the forecastStatus value for this PerformanceTarget . * @ return forecastStatus * The forecast status specifies how well the campaigns of a performance * targets are doing or have * done in the past in relation to the targets set on * the performance target . * < sp...
return forecastStatus ;
public class CommerceAccountOrganizationRelPersistenceImpl { /** * Returns a range of all the commerce account organization rels where commerceAccountId = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code ...
return findByCommerceAccountId ( commerceAccountId , start , end , null ) ;
public class CancelRequestDispatcher { /** * { @ inheritDoc } */ public void dispatchMessage ( final SipProvider sipProvider , SipServletMessageImpl sipServletMessage ) throws DispatcherException { } }
// final SipNetworkInterfaceManager sipNetworkInterfaceManager = sipApplicationDispatcher . getSipNetworkInterfaceManager ( ) ; final SipServletRequestImpl sipServletRequest = ( SipServletRequestImpl ) sipServletMessage ; if ( logger . isInfoEnabled ( ) ) { logger . info ( "Routing of Cancel Request " + sipServletReque...
public class Buffer { /** * Returns a new { @ link ByteBuffer } which has the same { @ link ByteOrder } as the native order of the machine . */ public static ByteBuffer allocateDirectWithNativeOrder ( int capacity ) { } }
return ByteBuffer . allocateDirect ( capacity ) . order ( PlatformDependent . BIG_ENDIAN_NATIVE_ORDER ? ByteOrder . BIG_ENDIAN : ByteOrder . LITTLE_ENDIAN ) ;
public class PartitionReplicaSyncRequest { /** * Send a synchronization response to the caller replica containing the replication operations to be executed */ private void sendResponse ( Collection < Operation > operations , ServiceNamespace ns ) { } }
NodeEngine nodeEngine = getNodeEngine ( ) ; PartitionReplicaSyncResponse syncResponse = createResponse ( operations , ns ) ; Address target = getCallerAddress ( ) ; ILogger logger = getLogger ( ) ; if ( logger . isFinestEnabled ( ) ) { logger . finest ( "Sending sync response to -> " + target + " for partitionId=" + ge...
public class TransferFsImage { /** * Print progress when downloading files . */ private static int printProgress ( String str , long received , long advertisedSize , int lastPrinted ) { } }
if ( advertisedSize == 0 ) return 0 ; int currentPercent = ( int ) ( ( received * 100 ) / advertisedSize ) ; if ( currentPercent != lastPrinted ) FLOG . info ( "Downloading: " + str + ", completed: " + currentPercent ) ; return currentPercent ;
public class AbstractClassFileWriter { /** * Converts a parameters to type arguments . * @ param parameters The parameters * @ return The type arguments */ @ NotNull protected Map < String , Object > toParameterTypes ( ParameterElement ... parameters ) { } }
final LinkedHashMap < String , Object > map = new LinkedHashMap < > ( parameters . length ) ; for ( ParameterElement ce : parameters ) { final ClassElement type = ce . getType ( ) ; if ( type == null ) { continue ; } final Type typeReference = getTypeForElement ( type ) ; map . put ( ce . getName ( ) , typeReference ) ...
public class Logging { /** * Returns a builder for which the { @ link Logger } is based on the given name * ( using { @ link LoggerFactory # getLogger ( String ) } . * @ param name * logger name * @ return builder */ public static < T > Parameters . Builder < T > logger ( String name ) { } }
return Parameters . < T > builder ( ) . name ( name ) ;
public class DocClient { /** * get a Document . * @ param request The request object containing a docId . * @ return A GetDocumentResponse object containing the information returned by Document . */ public GetDocumentResponse getDocument ( GetDocumentRequest request ) { } }
checkNotNull ( request , "request should not be null." ) ; checkNotNull ( request . getDocumentId ( ) , "documentId should not be null." ) ; InternalRequest internalRequest = this . createRequest ( HttpMethodName . GET , request , DOC , request . getDocumentId ( ) ) ; GetDocumentResponse response ; try { response = thi...
public class GetSlotTypeRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetSlotTypeRequest getSlotTypeRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getSlotTypeRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getSlotTypeRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( getSlotTypeRequest . getVersion ( ) , VERSION_BINDING ) ; } catch ( Exception e ) ...
public class CodedOutputStream { /** * Write an { @ code sint64 } field , including tag , to the stream . */ public void writeSInt64 ( final int fieldNumber , final long value ) throws IOException { } }
writeTag ( fieldNumber , WireFormat . WIRETYPE_VARINT ) ; writeSInt64NoTag ( value ) ;
public class GenericMonitoringWrapper { /** * Wraps the given object and returns the reporting proxy . Uses the * { @ link InApplicationMonitorTimingReporter } to report the timings . * @ param < E > * the type of the public interface of the wrapped object * @ param clazz * the class object to the interface ...
return wrapObject ( clazz , target , new InApplicationMonitorTimingReporter ( ) ) ;
public class Matrix4x3d { /** * Apply an orthographic projection transformation for a right - handed coordinate system * using the given NDC z range to this matrix and store the result in < code > dest < / code > . * If < code > M < / code > is < code > this < / code > matrix and < code > O < / code > the orthograp...
// calculate right matrix elements double rm00 = 2.0 / ( right - left ) ; double rm11 = 2.0 / ( top - bottom ) ; double rm22 = ( zZeroToOne ? 1.0 : 2.0 ) / ( zNear - zFar ) ; double rm30 = ( left + right ) / ( left - right ) ; double rm31 = ( top + bottom ) / ( bottom - top ) ; double rm32 = ( zZeroToOne ? zNear : ( zF...
public class RedisClusterClient { /** * Create a new client that connects to the supplied { @ link RedisURI uri } with shared { @ link ClientResources } . You need to * shut down the { @ link ClientResources } upon shutting down your application . You can connect to different Redis servers but * you must supply a {...
assertNotNull ( clientResources ) ; assertNotEmpty ( redisURIs ) ; assertSameOptions ( redisURIs ) ; return new RedisClusterClient ( clientResources , redisURIs ) ;
public class Matrix4d { /** * / * ( non - Javadoc ) * @ see org . joml . Matrix4dc # transformAffine ( double , double , double , double , org . joml . Vector4d ) */ public Vector4d transformAffine ( double x , double y , double z , double w , Vector4d dest ) { } }
double rx = m00 * x + m10 * y + m20 * z + m30 * w ; double ry = m01 * x + m11 * y + m21 * z + m31 * w ; double rz = m02 * x + m12 * y + m22 * z + m32 * w ; dest . x = rx ; dest . y = ry ; dest . z = rz ; dest . w = w ; return dest ;
public class StackdriverExportUtils { /** * Convert a OpenCensus MetricDescriptor to a StackDriver MetricDescriptor */ static MetricDescriptor createMetricDescriptor ( io . opencensus . metrics . export . MetricDescriptor metricDescriptor , String projectId , String domain , String displayNamePrefix , Map < LabelKey , ...
MetricDescriptor . Builder builder = MetricDescriptor . newBuilder ( ) ; String type = generateType ( metricDescriptor . getName ( ) , domain ) ; // Name format refers to // cloud . google . com / monitoring / api / ref _ v3 / rest / v3 / projects . metricDescriptors / create builder . setName ( "projects/" + projectId...
public class SourceAdapterHttp { /** * Sometimes a remote source is self - signed or not otherwise trusted */ public static void trustAllHosts ( ) { } }
// Create a trust manager that does not validate certificate chains TrustManager [ ] trustAllCerts = new TrustManager [ ] { new X509TrustManager ( ) { public X509Certificate [ ] getAcceptedIssuers ( ) { return new X509Certificate [ ] { } ; } public void checkClientTrusted ( X509Certificate [ ] chain , String authType )...
public class ResourceValues { /** * Returns new instance of OptionalValue with given key and value * @ param key resource key of the created value * @ param value wrapped object * @ param < T > type of the wrapped object * @ return given object wrapped in OptionalValue with given key */ public static < T > Opti...
return new GenericOptionalValue < T > ( RUNTIME_SOURCE , key , value ) ;
public class InvocationManager { /** * Returns the invocations . */ public ArrayList < I > getInvocations ( ) { } }
LruCache < Object , I > invocationCache = _invocationCache ; ArrayList < I > invocationList = new ArrayList < > ( ) ; synchronized ( invocationCache ) { Iterator < I > iter ; iter = invocationCache . values ( ) ; while ( iter . hasNext ( ) ) { invocationList . add ( iter . next ( ) ) ; } } return invocationList ;
public class RandomVariableLowMemory { /** * / * ( non - Javadoc ) * @ see net . finmath . stochastic . RandomVariableInterface # getVariance ( ) */ @ Override public double getVariance ( ) { } }
if ( isDeterministic ( ) ) { return 0.0 ; } if ( size ( ) == 0 ) { return Double . NaN ; } double sum = 0.0 ; double sumOfSquared = 0.0 ; double errorOfSum = 0.0 ; double errorOfSumSquared = 0.0 ; for ( int i = 0 ; i < realizations . length ; i ++ ) { double value = realizations [ i ] - errorOfSum ; double newSum = sum...
public class LogFileWriter { /** * Write marker for final static data * @ return * @ throws IOException */ public long writeFinishStaticMarker ( ) throws IOException { } }
Preconditions . checkState ( endStaticInfoOffset < 0 , "Wrote final static already information already" ) ; Pair < Integer , FlatBufferBuilder > encoded = encodeStaticHeader ( UIInfoType . START_EVENTS ) ; long out = append ( encoded . getSecond ( ) , null ) ; endStaticInfoOffset = file . length ( ) ; return out ;
public class CmsContainerpageHandler { /** * Leaves the current page and opens the site - map . < p > */ public void gotoSitemap ( ) { } }
final String sitemapUri = CmsCoreProvider . get ( ) . link ( m_controller . getData ( ) . getSitemapUri ( ) ) ; if ( sitemapUri . equals ( "" ) ) { return ; // normally , we shouldn ' t even get to this point because the sitemap button should be disabled } Command leaveCommand = new Command ( ) { public void execute ( ...
public class FileUtil { /** * Takes an input dir and returns the du on that local directory . Very basic * implementation . * @ param dir * The input dir to get the disk space of this local dir * @ return The total disk space of the input local directory */ public static long getDU ( File dir ) { } }
long size = 0 ; if ( ! dir . exists ( ) ) return 0 ; if ( ! dir . isDirectory ( ) ) { return dir . length ( ) ; } else { size = dir . length ( ) ; File [ ] allFiles = dir . listFiles ( ) ; for ( int i = 0 ; i < allFiles . length ; i ++ ) { size = size + getDU ( allFiles [ i ] ) ; } return size ; }
public class Bidi { /** * / * PDI */ private void bracketProcessPDI ( BracketData bd ) { } }
IsoRun pLastIsoRun ; bd . isoRunLast -- ; pLastIsoRun = bd . isoRuns [ bd . isoRunLast ] ; pLastIsoRun . lastBase = ON ;
public class RaftServiceContext { /** * Loads and returns a cached command result according to the sequence number . */ private OperationResult sequenceCommand ( long index , long sequence , RaftSession session ) { } }
OperationResult result = session . getResult ( sequence ) ; if ( result == null ) { log . debug ( "Missing command result at index {}" , index ) ; } return result ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcElectricApplianceType ( ) { } }
if ( ifcElectricApplianceTypeEClass == null ) { ifcElectricApplianceTypeEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 210 ) ; } return ifcElectricApplianceTypeEClass ;
public class SipSessionsUtilImpl { /** * Add a mapping between a new session and a corresponding sipSession related to a headerName . See Also getCorrespondingSipSession method . * @ param newSession the new session * @ param correspondingSipSession the corresponding sip session to add * @ param headerName the he...
if ( JoinHeader . NAME . equalsIgnoreCase ( headerName ) ) { joinSession . putIfAbsent ( newSession . getKey ( ) , correspondingSipSession ) ; } else if ( ReplacesHeader . NAME . equalsIgnoreCase ( headerName ) ) { replacesSession . putIfAbsent ( newSession . getKey ( ) , correspondingSipSession ) ; } else { throw new ...
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertGEPROLRESToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class JMessage { /** * If the message has a ' string ' field named ' message ' , which can be used as the ' message ' for exceptions . * @ return Optional message field . */ public Optional < JField > exceptionMessageField ( ) { } }
String fieldName = getExceptionMessageFieldName ( ) ; return numericalOrderFields ( ) . stream ( ) . filter ( f -> f . name ( ) . equals ( fieldName ) && f . type ( ) == PType . STRING ) . findFirst ( ) ;
public class FileUtils { /** * Gets the value from the resource bundles corresponding to the supplied * key . < br / > * If the property exists in multiple bundles only the first occurrence will * be returned * @ param key * the key to search for * @ return { @ code Boolean . FALSE } if the property is not ...
LOG . info ( "Getting value for key: " + key ) ; for ( ResourceBundle bundle : bundles . values ( ) ) { try { return Boolean . valueOf ( bundle . getString ( key ) ) ; } catch ( MissingResourceException e ) { LOG . info ( "Resource: " + key + " not found!" ) ; } } return Boolean . FALSE ;
public class DistributedCache { /** * Added for back compatibility . */ public static Path getLocalCache ( URI cache , Configuration conf , Path subdir , FileStatus fileStatus , boolean isArchive , long confFileStamp , Path currentWorkDir , boolean honorSymLinkConf , MRAsyncDiskService asyncDiskService , LocalDirAlloca...
return getLocalCache ( cache , conf , subdir , fileStatus , isArchive , confFileStamp , fileStatus . getLen ( ) , currentWorkDir , honorSymLinkConf , asyncDiskService , lDirAllocator ) ;
public class ImmutableCollections { /** * If the existing map has an entry with the new key , that old entry will be removed , but the new * entry will appear last in the iteration order of the resulting map . Example : * < pre > { @ code * append ( { a = > 1 , b = > 2 , c = > 3 } , a , 4 ) = = { b = > 2 , c = > ...
ImmutableMap . Builder < K , V > builder = ImmutableMap . builder ( ) ; for ( Map . Entry < K , V > entry : map . entrySet ( ) ) { if ( ! entry . getKey ( ) . equals ( newKey ) ) { builder . put ( entry ) ; } } builder . put ( newKey , newValue ) ; return builder . build ( ) ;
public class RespokeDirectConnection { /** * Accept the direct connection and start the process of obtaining media . * @ param context An application context with which to access system resources */ public void accept ( Context context ) { } }
if ( null != callReference ) { RespokeCall call = callReference . get ( ) ; if ( null != call ) { call . directConnectionDidAccept ( context ) ; } }
public class AbstractMultipleOrderedOptionsBaseTableModel { /** * Moves the element at the given { @ code row } to the bottom of the elements , thus occupying the last position . * The order of all elements is updated and all listeners notified . * @ param row the row of the element that should be moved to the bott...
E entry = getElement ( row ) ; getElements ( ) . remove ( row ) ; getElements ( ) . add ( entry ) ; updateOrdersAndFireNotification ( row ) ;
public class SmbFile { /** * It is not necessary to call this method directly . This is the * < tt > URLConnection < / tt > implementation of < tt > connect ( ) < / tt > . */ public void connect ( ) throws IOException { } }
if ( isConnected ( ) && tree . session . transport . tconHostName == null ) { /* Tree thinks it is connected but transport disconnected * under it , reset tree to reflect the truth . */ tree . treeDisconnect ( true ) ; } if ( isConnected ( ) ) { return ; } getUncPath0 ( ) ; getFirstAddress ( ) ; for ( ; ; ) { try { d...
public class EventNotificationManager { /** * Delivers a event to all of the registered subscribers . * @ param event The event to deliver . */ public void deliverEvent ( AbstractTaskEvent event ) { } }
synchronized ( this . subscriptions ) { List < EventListener > subscribers = this . subscriptions . get ( event . getClass ( ) ) ; if ( subscribers == null ) { return ; } final Iterator < EventListener > it = subscribers . iterator ( ) ; while ( it . hasNext ( ) ) { it . next ( ) . eventOccurred ( event ) ; } }
public class TaskReport { public void write ( DataOutput out ) throws IOException { } }
taskid . write ( out ) ; out . writeFloat ( progress ) ; Text . writeString ( out , state ) ; out . writeLong ( startTime ) ; out . writeLong ( finishTime ) ; WritableUtils . writeStringArray ( out , diagnostics ) ; counters . write ( out ) ; WritableUtils . writeEnum ( out , currentStatus ) ; if ( currentStatus == TIP...
public class MappingServiceController { /** * Adds a new { @ link EntityMapping } to an existing { @ link MappingTarget } * @ param target the name of the { @ link MappingTarget } ' s entity to add a source entity to * @ param source the name of the source entity of the newly added { @ link EntityMapping } * @ pa...
EntityType sourceEntityType = dataService . getEntityType ( source ) ; EntityType targetEntityType = dataService . getEntityType ( target ) ; MappingProject project = mappingService . getMappingProject ( mappingProjectId ) ; EntityMapping mapping = project . getMappingTarget ( target ) . addSource ( sourceEntityType ) ...
public class VerifySoftwareTokenRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( VerifySoftwareTokenRequest verifySoftwareTokenRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( verifySoftwareTokenRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( verifySoftwareTokenRequest . getAccessToken ( ) , ACCESSTOKEN_BINDING ) ; protocolMarshaller . marshall ( verifySoftwareTokenRequest . getSession ( ) , SESSIO...
public class Hud { /** * Generate sub menu creation if menu contains sub menu . * @ param parents The parents menu . * @ param action The current action . * @ param menu The current menu to check . */ private void generateSubMenu ( final Collection < ActionRef > parents , final ActionRef action , Featurable menu ...
menu . getFeature ( Actionable . class ) . setAction ( ( ) -> { clearMenus ( ) ; createMenus ( parents , action . getRefs ( ) ) ; } ) ;
public class FunctionType { /** * Returns a list of template types present on the constructor but not on the instance . */ public final ImmutableList < TemplateType > getConstructorOnlyTemplateParameters ( ) { } }
TemplateTypeMap ctorMap = getTemplateTypeMap ( ) ; TemplateTypeMap instanceMap = getInstanceType ( ) . getTemplateTypeMap ( ) ; if ( ctorMap == instanceMap ) { return ImmutableList . of ( ) ; } ImmutableList . Builder < TemplateType > ctorKeys = ImmutableList . builder ( ) ; Set < TemplateType > instanceKeys = Immutabl...
public class CmsContentCheckReport { /** * Stores the given object as " dialog object " for this widget dialog in the current users session . < p > * @ param dialogObject the object to store */ public void setDialogObject ( Object dialogObject ) { } }
m_dialogObject = dialogObject ; if ( dialogObject == null ) { // null object : remove the entry from the map getDialogObjectMap ( ) . remove ( getClass ( ) . getName ( ) ) ; } else { getDialogObjectMap ( ) . put ( getClass ( ) . getName ( ) , dialogObject ) ; }
public class ArrayUtils { /** * < p > Adds all the elements of the given arrays into a new array . < / p > * < p > The new array contains all of the element of < code > array1 < / code > followed * by all of the elements < code > array2 < / code > . When an array is returned , it is always * a new array . < / p >...
if ( array1 == null ) { return clone ( array2 ) ; } else if ( array2 == null ) { return clone ( array1 ) ; } byte [ ] joinedArray = new byte [ array1 . length + array2 . length ] ; System . arraycopy ( array1 , 0 , joinedArray , 0 , array1 . length ) ; System . arraycopy ( array2 , 0 , joinedArray , array1 . length , a...
public class DescribeTargetGroupsRequest { /** * The Amazon Resource Names ( ARN ) of the target groups . * @ param targetGroupArns * The Amazon Resource Names ( ARN ) of the target groups . */ public void setTargetGroupArns ( java . util . Collection < String > targetGroupArns ) { } }
if ( targetGroupArns == null ) { this . targetGroupArns = null ; return ; } this . targetGroupArns = new java . util . ArrayList < String > ( targetGroupArns ) ;
public class DiscountCurve { /** * Create a discount curve from given times and given discount factors using default interpolation and extrapolation methods . * @ param name The name of this discount curve . * @ param times Array of times as doubles . * @ param givenDiscountFactors Array of corresponding discount...
DiscountCurve discountFactors = new DiscountCurve ( name ) ; for ( int timeIndex = 0 ; timeIndex < times . length ; timeIndex ++ ) { discountFactors . addDiscountFactor ( times [ timeIndex ] , givenDiscountFactors [ timeIndex ] , times [ timeIndex ] > 0 ) ; } return discountFactors ;
public class AbstractSimpleExpressionsRuntimeModule { /** * contributed by org . eclipse . xtext . generator . grammarAccess . GrammarAccessFragment */ public Class < ? extends org . eclipse . xtext . IGrammarAccess > bindIGrammarAccess ( ) { } }
return org . eclipse . xtext . xtext . generator . parser . antlr . splitting . services . SimpleExpressionsGrammarAccess . class ;
public class ExecutionVertex { /** * Checks if another thread requested the vertex to cancel while it was in state STARTING . If so , the method clears * the respective flag and repeats the cancel request . */ private void checkCancelRequestedFlag ( ) { } }
if ( this . cancelRequested . compareAndSet ( true , false ) ) { final TaskCancelResult tsr = cancelTask ( ) ; if ( tsr . getReturnCode ( ) != AbstractTaskResult . ReturnCode . SUCCESS && tsr . getReturnCode ( ) != AbstractTaskResult . ReturnCode . TASK_NOT_FOUND ) { LOG . error ( "Unable to cancel vertex " + this + ":...
public class Ellipse { /** * Draws this ellipse . * @ param context the { @ link Context2D } used to draw this ellipse . */ @ Override protected boolean prepare ( final Context2D context , final Attributes attr , final double alpha ) { } }
final double w = attr . getWidth ( ) ; final double h = attr . getHeight ( ) ; if ( ( w > 0 ) && ( h > 0 ) ) { context . beginPath ( ) ; context . ellipse ( 0 , 0 , w / 2 , h / 2 , 0 , 0 , Math . PI * 2 , true ) ; context . closePath ( ) ; return true ; } return false ;
public class Utils { /** * Convert the given string to a byte [ ] in using the { @ link # UTF8 _ CHARSET } encoder . * This is the inverse of { @ link # toString ( byte [ ] ) } . A null value is allowed , which * begets a null result . * @ param str String value to be converted . * @ return Lossless , encoded v...
if ( str == null ) { return null ; } // optimization for ascii strings byte [ ] ascii = toAsciiBytes ( str ) ; if ( ascii != null ) return ascii ; ByteBuffer bb = UTF8_CHARSET . encode ( str ) ; return getBytes ( bb ) ;
public class BaseBigtableTableAdminClient { /** * Gets metadata information about the specified snapshot . * < p > Note : This is a private alpha release of Cloud Bigtable snapshots . This feature is not * currently available to most Cloud Bigtable customers . This feature might be changed in * backward - incompa...
GetSnapshotRequest request = GetSnapshotRequest . newBuilder ( ) . setName ( name == null ? null : name . toString ( ) ) . build ( ) ; return getSnapshot ( request ) ;
public class CsvReader { /** * Configures which fields of the CSV file should be included and which should be skipped . The * bits in the value ( read from least significant to most significant ) define whether the field at * the corresponding position in the CSV schema should be included . * parser will look at ...
if ( mask == 0 ) { throw new IllegalArgumentException ( "The description of fields to parse excluded all fields. At least one fields must be included." ) ; } ArrayList < Boolean > fields = new ArrayList < Boolean > ( ) ; while ( mask != 0 ) { fields . add ( ( mask & 0x1L ) != 0 ) ; mask >>>= 1 ; } boolean [ ] fieldsArr...
public class M2tsSettings { /** * Specify the packet identifiers ( PIDs ) for DVB subtitle data included in this output . Specify multiple PIDs as a * JSON array . Default is the range 460-479. * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setDvbSubPids (...
if ( this . dvbSubPids == null ) { setDvbSubPids ( new java . util . ArrayList < Integer > ( dvbSubPids . length ) ) ; } for ( Integer ele : dvbSubPids ) { this . dvbSubPids . add ( ele ) ; } return this ;
public class lbmetrictable { /** * Use this API to delete lbmetrictable resources of given names . */ public static base_responses delete ( nitro_service client , String metrictable [ ] ) throws Exception { } }
base_responses result = null ; if ( metrictable != null && metrictable . length > 0 ) { lbmetrictable deleteresources [ ] = new lbmetrictable [ metrictable . length ] ; for ( int i = 0 ; i < metrictable . length ; i ++ ) { deleteresources [ i ] = new lbmetrictable ( ) ; deleteresources [ i ] . metrictable = metrictable...
public class BaseFileManager { /** * Set the context for JavacPathFileManager . * @ param context the context containing items to be associated with the file manager */ public void setContext ( Context context ) { } }
log = Log . instance ( context ) ; options = Options . instance ( context ) ; classLoaderClass = options . get ( "procloader" ) ; // Avoid initializing Lint boolean warn = options . isLintSet ( "path" ) ; locations . update ( log , warn , FSInfo . instance ( context ) ) ; // Setting this option is an indication that cl...
public class CreateProductTemplateBaseRates { /** * Runs the example . * @ param adManagerServices the services factory . * @ param session the session . * @ param rateCardId the rate card ID to add the base rate to . * @ param productTemplateId the product template to apply this base rate to . * @ throws Api...
// Get the BaseRateService . BaseRateServiceInterface baseRateService = adManagerServices . get ( session , BaseRateServiceInterface . class ) ; // Create a base rate for a product template . ProductTemplateBaseRate productTemplateBaseRate = new ProductTemplateBaseRate ( ) ; // Set the rate card ID that the product tem...
public class MoreCollectors { /** * Returns a { @ code Collector } which finds the index of the maximal stream * element according to the elements natural order . If there are several * maximal elements , the index of the first one is returned . * @ param < T > the type of the input elements * @ return a { @ co...
return minIndex ( Comparator . reverseOrder ( ) ) ;
public class SnackbarWrapper { /** * Append text to the Snackbar message . * @ param message The string resource of the text to append . * @ return This instance . */ @ NonNull @ SuppressWarnings ( "WeakerAccess" ) public SnackbarWrapper appendMessage ( @ StringRes int message ) { } }
return appendMessage ( context . getString ( message ) ) ;
public class LTSminVersion { /** * Checks whether { @ code this } version supports the given required version . * @ param required * the required version that needs to be supported * @ return { @ code true } , if { @ code this } version supports the given required version , { @ code false } otherwise . */ public ...
if ( major > required . major ) { return true ; } else if ( major == required . major ) { if ( minor > required . minor ) { return true ; } else if ( minor == required . minor ) { return patch >= required . patch ; } } return false ;
public class AtomContainerManipulator { /** * Count explicit hydrogens . * @ param atomContainer the atom container to consider * @ return The number of explicit hydrogens on the given IAtom . * @ throws IllegalArgumentException if either the container or atom were null */ public static int countExplicitHydrogens...
if ( atomContainer == null || atom == null ) throw new IllegalArgumentException ( "null container or atom provided" ) ; int hCount = 0 ; for ( IAtom connected : atomContainer . getConnectedAtomsList ( atom ) ) { if ( Elements . HYDROGEN . getSymbol ( ) . equals ( connected . getSymbol ( ) ) ) { hCount ++ ; } } return h...
public class SelfCalibrationLinearRotationSingle { /** * Scales all homographies so that their determinants are equal to one * @ param homography0toI */ public static void ensureDeterminantOfOne ( List < Homography2D_F64 > homography0toI ) { } }
int N = homography0toI . size ( ) ; for ( int i = 0 ; i < N ; i ++ ) { Homography2D_F64 H = homography0toI . get ( i ) ; double d = CommonOps_DDF3 . det ( H ) ; // System . out . println ( " Before = " + d ) ; if ( d < 0 ) CommonOps_DDF3 . divide ( H , - Math . pow ( - d , 1.0 / 3 ) ) ; else CommonOps_DDF3 . divide ( H...
public class NumericSummaryAggregator { /** * combine two aggregations . */ @ Override public void combine ( Aggregator < T , NumericColumnSummary < T > > otherSameType ) { } }
NumericSummaryAggregator < T > other = ( NumericSummaryAggregator < T > ) otherSameType ; nullCount += other . nullCount ; nanCount += other . nanCount ; infinityCount += other . infinityCount ; if ( nonMissingCount == 0 ) { nonMissingCount = other . nonMissingCount ; min = other . min ; max = other . max ; sum = other...
public class HighlightOptions { /** * Add parameter * @ param parameter must not be null * @ return */ public HighlightOptions addHighlightParameter ( HighlightParameter parameter ) { } }
Assert . notNull ( parameter , "Parameter must not be null!" ) ; this . parameterHolder . add ( parameter ) ; return this ;
public class VisitorState { /** * Returns the { @ link TreePath } to the nearest tree node of one of the given types . To instead * retrieve the element directly , use { @ link # findEnclosing ( Class . . . ) } . * @ return the path , or { @ code null } if there is no match */ @ Nullable @ SafeVarargs public final ...
TreePath enclosingPath = getPath ( ) ; while ( enclosingPath != null ) { for ( Class < ? extends Tree > clazz : classes ) { if ( clazz . isInstance ( enclosingPath . getLeaf ( ) ) ) { return enclosingPath ; } } enclosingPath = enclosingPath . getParentPath ( ) ; } return null ;
public class LazyLinkingResource { /** * If the given { @ code crossRef } may hold lazy linking proxies , they are attempted to be resolved . * @ since 2.4 * @ see # isPotentialLazyCrossReference ( EStructuralFeature ) * @ see # doResolveLazyCrossReference ( InternalEObject , EStructuralFeature ) */ protected voi...
if ( isPotentialLazyCrossReference ( crossRef ) ) { doResolveLazyCrossReference ( source , crossRef ) ; }
public class Unchecked { /** * Wrap a { @ link CheckedDoublePredicate } in a { @ link DoublePredicate } with a custom handler for checked exceptions . * Example : * < code > < pre > * DoubleStream . of ( 1.0 , 2.0 , 3.0 ) . filter ( Unchecked . doublePredicate ( * if ( d & lt ; 0.0) * throw new Exception ( " ...
return d -> { try { return function . test ( d ) ; } catch ( Throwable e ) { handler . accept ( e ) ; throw new IllegalStateException ( "Exception handler must throw a RuntimeException" , e ) ; } } ;
public class AxisAngle4d { /** * Set this { @ link AxisAngle4d } to be equivalent to the given * { @ link Quaterniondc } . * @ param q * the quaternion to set this AngleAxis4d from * @ return this */ public AxisAngle4d set ( Quaterniondc q ) { } }
double acos = safeAcos ( q . w ( ) ) ; double invSqrt = 1.0 / Math . sqrt ( 1.0 - q . w ( ) * q . w ( ) ) ; this . x = q . x ( ) * invSqrt ; this . y = q . y ( ) * invSqrt ; this . z = q . z ( ) * invSqrt ; this . angle = acos + acos ; return this ;
public class AbstractDataBinder { /** * Notifies all listeners , that the data binder has been canceled . */ private void notifyOnCanceled ( ) { } }
for ( Listener < DataType , KeyType , ViewType , ParamType > listener : listeners ) { listener . onCanceled ( this ) ; }
public class ArrayOfDoublesSketchBuildBufferAggregator { /** * This method uses locks because it can be used during indexing , * and Druid can call aggregate ( ) and get ( ) concurrently * https : / / github . com / apache / incubator - druid / pull / 3956 */ @ Override public void aggregate ( final ByteBuffer buf ...
for ( int i = 0 ; i < valueSelectors . length ; i ++ ) { values [ i ] = valueSelectors [ i ] . getDouble ( ) ; } final IndexedInts keys = keySelector . getRow ( ) ; // Wrapping memory and ArrayOfDoublesSketch is inexpensive compared to sketch operations . // Maintaining a cache of wrapped objects per buffer position li...
public class ns_save_config { /** * < pre > * Use this operation to save configuration on NS Instance ( s ) . * < / pre > */ public static ns_save_config add ( nitro_service client , ns_save_config resource ) throws Exception { } }
resource . validate ( "add" ) ; return ( ( ns_save_config [ ] ) resource . perform_operation ( client , "add" ) ) [ 0 ] ;
public class ScheduledInstanceRecurrence { /** * The days . For a monthly schedule , this is one or more days of the month ( 1-31 ) . For a weekly schedule , this is * one or more days of the week ( 1-7 , where 1 is Sunday ) . * @ param occurrenceDaySet * The days . For a monthly schedule , this is one or more da...
if ( occurrenceDaySet == null ) { this . occurrenceDaySet = null ; return ; } this . occurrenceDaySet = new com . amazonaws . internal . SdkInternalList < Integer > ( occurrenceDaySet ) ;
public class MainActivity { /** * Makes sure the view ( and any children ) get the enabled state changed . */ public static void setEnabledStateOnViews ( View v , boolean enabled ) { } }
v . setEnabled ( enabled ) ; if ( v instanceof ViewGroup ) { final ViewGroup vg = ( ViewGroup ) v ; for ( int i = vg . getChildCount ( ) - 1 ; i >= 0 ; i -- ) { setEnabledStateOnViews ( vg . getChildAt ( i ) , enabled ) ; } }
public class NodeUtil { /** * Creates a new node representing an * existing * name , copying over the source * location information from the basis node and assigning the given original * name to the node . * @ param name The name for the new NAME node . * @ param basisNode The node that represents the name as c...
Node nameNode = newName ( compiler , name , basisNode ) ; nameNode . setOriginalName ( originalName ) ; return nameNode ;
public class HttpHeaders { /** * Serializes headers to an { @ link Writer } for Multi - part requests . * @ param headers HTTP headers * @ param logbuf log buffer or { @ code null } for none * @ param logger logger or { @ code null } for none . Logger must be specified if log buffer is * specified * @ param w...
serializeHeaders ( headers , logbuf , null , logger , null , writer ) ;
public class ExtendedColorPicker { /** * Updates picker from H , S and V bars */ @ Override protected void updateValuesFromHSVFields ( ) { } }
int [ ] hsv = ColorUtils . RGBtoHSV ( color ) ; int h = hsv [ 0 ] ; int s = hsv [ 1 ] ; int v = hsv [ 2 ] ; if ( hBar . isInputValid ( ) ) h = hBar . getValue ( ) ; if ( sBar . isInputValid ( ) ) s = sBar . getValue ( ) ; if ( vBar . isInputValid ( ) ) v = vBar . getValue ( ) ; color = ColorUtils . HSVtoRGB ( h , s , v...
public class CompositeEntityIdentifier { /** * If the composite key is either empty or has a single node , there is no service name . * @ return javax . naming . Name */ public synchronized Name getServiceName ( ) { } }
if ( size ( ) < 2 ) { return null ; } if ( cachedServiceName == null ) { cachedServiceName = getCompositeKey ( ) . getPrefix ( size ( ) - 1 ) ; } return cachedServiceName ;
public class VimGenerator2 { /** * Generate the script for detecting the SARL files . * @ param basename the name of the file to create . * @ see # getFileTypeDetectionScript ( ) */ protected void generateFileTypeDetectionScript ( String basename ) { } }
final CharSequence scriptContent = getFileTypeDetectionScript ( ) ; if ( scriptContent != null ) { final String textualContent = scriptContent . toString ( ) ; if ( ! Strings . isEmpty ( textualContent ) ) { final byte [ ] bytes = textualContent . getBytes ( ) ; for ( final String output : getOutputs ( ) ) { final File...
public class AutoSizingBase { /** * style manipulation */ public void matchStyles ( String name ) { } }
String value = MiscUtils . getComputedStyle ( box . getElement ( ) , name ) ; if ( value != null ) { try { // we might have a bogus value ( e . g . width : - 10px ) . we // just let it fail quietly . shadow . getElement ( ) . getStyle ( ) . setProperty ( name , value ) ; } catch ( Exception e ) { GWT . log ( "Exception...
public class URI { /** * Normalize the given hier path part . * < p > Algorithm taken from URI reference parser at * http : / / www . apache . org / ~ fielding / uri / rev - 2002 / issues . html . * @ param path the path to normalize * @ return the normalized path * @ throws URIException no more higher path l...
if ( path == null ) { return null ; } String normalized = new String ( path ) ; // If the buffer begins with " . / " or " . . / " , the " . " or " . . " is removed . if ( normalized . startsWith ( "./" ) ) { normalized = normalized . substring ( 1 ) ; } else if ( normalized . startsWith ( "../" ) ) { normalized = norma...
public class ThingTypeMetadataMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ThingTypeMetadata thingTypeMetadata , ProtocolMarshaller protocolMarshaller ) { } }
if ( thingTypeMetadata == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( thingTypeMetadata . getDeprecated ( ) , DEPRECATED_BINDING ) ; protocolMarshaller . marshall ( thingTypeMetadata . getDeprecationDate ( ) , DEPRECATIONDATE_BINDING ) ;...
public class DataFactory { /** * Method to read and object from the bytes tab * @ param pAnnotation * all information data * @ param pBit * bytes tab * @ return an object */ public static Object getObject ( final AnnotationData pAnnotation , final BitUtils pBit ) { } }
Object obj = null ; Class < ? > clazz = pAnnotation . getField ( ) . getType ( ) ; if ( clazz . equals ( Integer . class ) ) { obj = getInteger ( pAnnotation , pBit ) ; } else if ( clazz . equals ( Float . class ) ) { obj = getFloat ( pAnnotation , pBit ) ; } else if ( clazz . equals ( String . class ) ) { obj = getStr...
public class JDABuilder { /** * Removes all provided listeners from the list of listeners . * @ param listeners * The listener ( s ) to remove from the list . * @ throws java . lang . IllegalArgumentException * If either listeners or one of it ' s objects is { @ code null } . * @ return The JDABuilder instanc...
Checks . noneNull ( listeners , "listeners" ) ; this . listeners . removeAll ( Arrays . asList ( listeners ) ) ; return this ;
public class Expression { /** * Creates a code chunk representing the { @ code new } operator applied to the given constructor . If * you need to call the constructor with arguments , call { @ link Expression # call } on the returned * chunk . */ public static Expression construct ( Expression ctor , Expression ......
return New . create ( ctor ) . call ( args ) ;
public class AWSGreengrassClient { /** * Deletes a subscription definition . * @ param deleteSubscriptionDefinitionRequest * @ return Result of the DeleteSubscriptionDefinition operation returned by the service . * @ throws BadRequestException * invalid request * @ sample AWSGreengrass . DeleteSubscriptionDef...
request = beforeClientExecution ( request ) ; return executeDeleteSubscriptionDefinition ( request ) ;
public class CollectionUtils { /** * Returns a new Multiset resulting from transforming each element of the input Multiset by a * function . If two or more elements are mapped to the same value by the function , their counts * will be summed in the new Multiset . */ public static < A , B > ImmutableMultiset < B > t...
final ImmutableMultiset . Builder < B > ret = ImmutableMultiset . builder ( ) ; for ( final Multiset . Entry < A > entry : ms . entrySet ( ) ) { final B transformedElement = func . apply ( entry . getElement ( ) ) ; ret . addCopies ( transformedElement , entry . getCount ( ) ) ; } return ret . build ( ) ;
public class ElementFactory { /** * - - - - - Building Rules - - - - - */ public RuleImpl buildRule ( VertexElement vertex , Rule type , Pattern when , Pattern then ) { } }
return getOrBuildConcept ( vertex , ( v ) -> RuleImpl . create ( v , type , when , then ) ) ;
public class JsonRpcBasicServer { /** * Creates a success response . * @ param jsonRpc the version string * @ param id the id of the request * @ param result the result object * @ return the response object */ private ObjectNode createResponseSuccess ( String jsonRpc , Object id , JsonNode result ) { } }
ObjectNode response = mapper . createObjectNode ( ) ; response . put ( JSONRPC , jsonRpc ) ; if ( Integer . class . isInstance ( id ) ) { response . put ( ID , Integer . class . cast ( id ) . intValue ( ) ) ; } else if ( Long . class . isInstance ( id ) ) { response . put ( ID , Long . class . cast ( id ) . longValue (...
public class DataContextUtils { /** * Replace the embedded properties of the form ' $ { key . name } ' in the input Strings with the value from the data * context * @ param input input string * @ param data data context map * @ param converter converter to encode / convert the expanded values * @ param failOn...
if ( null == data || null == input ) { return input ; } final Matcher m = SharedDataContextUtils . PROPERTY_REF_PATTERN . matcher ( input ) ; final StringBuffer sb = new StringBuffer ( ) ; while ( m . find ( ) ) { final String key = m . group ( 1 ) ; final String nm = m . group ( 2 ) ; if ( null != key && null != nm &&...
public class PatternsImpl { /** * Adds a batch of patterns to the specified application . * @ param appId The application ID . * @ param versionId The version ID . * @ param patterns A JSON array containing patterns . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses ...
return ServiceFuture . fromResponse ( batchAddPatternsWithServiceResponseAsync ( appId , versionId , patterns ) , serviceCallback ) ;
public class DexParser { /** * read string pool for dex file . * dex file string pool diff a bit with binary xml file or resource table . * @ param offsets * @ return * @ throws IOException */ private StringPool readStrings ( long [ ] offsets ) { } }
// read strings . // buffer some apk , the strings ' offsets may not well ordered . we sort it first StringPoolEntry [ ] entries = new StringPoolEntry [ offsets . length ] ; for ( int i = 0 ; i < offsets . length ; i ++ ) { entries [ i ] = new StringPoolEntry ( i , offsets [ i ] ) ; } String lastStr = null ; long lastO...
public class ConfigDrivenEngineFactory { /** * Creates a new instance of the given type , passing the given config * map if possible ( if the class has a Map constructor ) . * @ param type the type to create * @ param config config to pass * @ return a new instance of ' type ' */ protected < T > T create ( Clas...
// Use # doInstantiate so inheriting classes can override it , as # instantiate is static final . T instance = doInstantiate ( type , config ) ; if ( instance instanceof AsyncInitialize ) { asyncInitializeAwaiting . incrementAndGet ( ) ; ( ( AsyncInitialize ) instance ) . initialize ( initResult -> { asyncInitializeAwa...
public class PropertiesUtil { /** * Gets the named property as a String . * @ param name the name of the property to look up * @ return the String value of the property or { @ code null } if undefined . */ public String getStringProperty ( final String name ) { } }
String prop = null ; try { prop = System . getProperty ( name ) ; } catch ( final SecurityException ignored ) { // Ignore } return prop == null ? props . getProperty ( name ) : prop ;