signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ClassFile { /** * Returns the constant map index to field * @ param declaringClass * @ param name * @ param type * @ return */ int getFieldIndex ( TypeElement declaringClass , String name , TypeMirror type ) { } }
return getFieldIndex ( declaringClass , name , Descriptor . getFieldDesriptor ( type ) ) ;
public class Timestamp { /** * clean up timestamp argument assuming latest possible values for missing * or bogus digits . * @ param timestamp String * @ return String */ public static String padEndDateStr ( String timestamp ) { } }
return boundTimestamp ( padDigits ( timestamp , LOWER_TIMESTAMP_LIMIT , UPPER_TIMESTAMP_LIMIT , UPPER_TIMESTAMP_LIMIT ) ) ;
public class GuildWars2Utility { /** * This method come from < a href = " https : / / github . com / karlroberts / base64 " > this < / a > library < br / > * Which is released under < a href = " https : / / github . com / karlroberts / base64 / blob / master / LICENSE " > BSD 3 - clause " New " or " Revised " License...
/* If we received a null argument , exit this method . */ if ( byteData == null ) { throw new IllegalArgumentException ( "byteData cannot be null" ) ; } /* * Declare working variables including an array of bytes that will * contain the decoded data to be returned to the caller . Note that the * decoded array is abo...
public class CollectionErasureMatcher { /** * { @ inheritDoc } */ public boolean matches ( T target ) { } }
List < TypeDescription > typeDescriptions = new ArrayList < TypeDescription > ( ) ; for ( TypeDefinition typeDefinition : target ) { typeDescriptions . add ( typeDefinition . asErasure ( ) ) ; } return matcher . matches ( typeDescriptions ) ;
public class CBLVersion { /** * This is information about the system on which we are running . */ public static String getSysInfo ( ) { } }
String info = sysInfo . get ( ) ; if ( info == null ) { info = String . format ( Locale . ENGLISH , SYS_INFO , System . getProperty ( "os.name" , "unknown" ) ) ; sysInfo . compareAndSet ( null , info ) ; } return info ;
public class ParamChecker { /** * Check that a string is not empty if its not null . * @ param value value . * @ param name parameter name for the exception message . * @ return the given value . */ public static String notEmptyIfNotNull ( String value , String name , String info ) { } }
if ( value == null ) { return value ; } if ( value . trim ( ) . length ( ) == 0 ) { throw new IllegalArgumentException ( name + " cannot be empty" + ( info == null ? "" : ", " + info ) ) ; } return value . trim ( ) ;
public class Property { /** * Returns the property value which this metamodel property instance * represents from the specified entity instance . * @ param entity The entity instance from which you attempt to get the * property value . < b > The specified entity have to make sure to be JavaBeans * to get proper...
Object value = entity ; for ( String name : path ( ) ) { try { Field field = value . getClass ( ) . getDeclaredField ( name ) ; field . setAccessible ( true ) ; value = field . get ( value ) ; } catch ( Exception e ) { throw new UncheckedException ( e ) ; } } return ( T ) value ;
public class CommerceOrderNoteUtil { /** * Returns an ordered range of all the commerce order notes where commerceOrderId = & # 63 ; and restricted = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are...
return getPersistence ( ) . findByC_R ( commerceOrderId , restricted , start , end , orderByComparator , retrieveFromCache ) ;
public class OpenAPIFilter { /** * { @ inheritDoc } */ @ Override public Server visitServer ( Context context , Server server ) { } }
return filter . filterServer ( server ) ;
public class NumberUtil { /** * 将16进制的String转化为Integer . * 当str为空或非数字字符串时抛NumberFormatException */ public static Integer hexToIntObject ( @ NotNull String str ) { } }
// 统一行为 , 不要有时候抛NPE , 有时候抛NumberFormatException if ( str == null ) { throw new NumberFormatException ( "null" ) ; } return Integer . decode ( str ) ;
public class ViewFetcher { /** * Extracts all { @ code View } s located in the currently active { @ code Activity } , recursively . * @ param parent the { @ code View } whose children should be returned , or { @ code null } for all * @ param onlySufficientlyVisible if only sufficiently visible views should be retur...
final ArrayList < View > views = new ArrayList < View > ( ) ; final View parentToUse ; if ( parent == null ) { return getAllViews ( onlySufficientlyVisible ) ; } else { parentToUse = parent ; views . add ( parentToUse ) ; if ( parentToUse instanceof ViewGroup ) { addChildren ( views , ( ViewGroup ) parentToUse , onlySu...
public class StyleHandler { /** * Turns input into a Reader . * @ param input A { @ link Reader } , { @ link java . io . InputStream } , { @ link File } , or { @ link * Resource } . */ protected Reader toReader ( Object input ) throws IOException { } }
if ( input instanceof Reader ) { return ( Reader ) input ; } if ( input instanceof InputStream ) { return new InputStreamReader ( ( InputStream ) input ) ; } if ( input instanceof String ) { return new StringReader ( ( String ) input ) ; } if ( input instanceof URL ) { return new InputStreamReader ( ( ( URL ) input ) ....
public class DiscoveryService { /** * Returns the schema records matching the specified criteria . At least one field matching expression must be supplied . * @ param namespaceRegex The regular expression on which to match the name space field . May be null . * @ param scopeRegex The regular expression on which to ...
StringBuilder urlBuilder = _buildBaseUrl ( namespaceRegex , scopeRegex , metricRegex , tagKeyRegex , tagValueRegex , limit ) ; String requestUrl = urlBuilder . toString ( ) ; ArgusResponse response = getClient ( ) . executeHttpRequest ( ArgusHttpClient . RequestType . GET , requestUrl , null ) ; assertValidResponse ( r...
public class ID3v2Tag { /** * Saves all the information in the tag to the file passed to the * constructor . If a tag doesn ' t exist , a tag is prepended to the file . * If the padding has not changed since the creation of this object and * the size is less than the original size + the original padding , then ...
int curSize = getSize ( ) ; origPadding = padding ; padding = getUpdatedPadding ( ) ; // This means that the file does not need to change size if ( ( padding > origPadding ) || ( ( padding == origPadding ) && ( curSize == origSize ) ) ) { byte [ ] out = getBytes ( ) ; raf . seek ( 0 ) ; raf . write ( out ) ; } else { /...
public class SimpleDocumentDbRepository { /** * FindQuerySpecGenerator * Returns a Page of entities meeting the paging restriction provided in the Pageable object . * @ param pageable * @ return a page of entities */ @ Override public Page < T > findAll ( Pageable pageable ) { } }
Assert . notNull ( pageable , "pageable should not be null" ) ; return operation . findAll ( pageable , information . getJavaType ( ) , information . getCollectionName ( ) ) ;
public class JerseyClientBuilder { /** * Builds the { @ link Client } instance with a custom reactive client provider . * @ return a fully - configured { @ link Client } */ public < RX extends RxInvokerProvider < ? > > Client buildRx ( String name , Class < RX > invokerType ) { } }
return build ( name ) . register ( invokerType ) ;
public class GeneralPurposeFFT_F32_1D { /** * Computes 1D forward DFT of real data leaving the result in < code > a < / code > * . This method computes the full real forward transform , i . e . you will get * the same result as from < code > complexForward < / code > called with all * imaginary part equal 0 . Bec...
final int twon = 2 * n ; switch ( plan ) { case SPLIT_RADIX : { realForward ( a , offa ) ; int idx1 , idx2 ; for ( int k = 0 ; k < n / 2 ; k ++ ) { idx1 = 2 * k ; idx2 = offa + ( ( twon - idx1 ) % twon ) ; a [ idx2 ] = a [ offa + idx1 ] ; a [ idx2 + 1 ] = - a [ offa + idx1 + 1 ] ; } a [ offa + n ] = - a [ offa + 1 ] ; ...
public class ContentKey { /** * Create an operation that will list all the content keys at the given * link . * @ param link * Link to request content keys from . * @ return The list operation . */ public static DefaultListOperation < ContentKeyInfo > list ( LinkInfo < ContentKeyInfo > link ) { } }
return new DefaultListOperation < ContentKeyInfo > ( link . getHref ( ) , new GenericType < ListResult < ContentKeyInfo > > ( ) { } ) ;
public class AnnotatedLargeText { /** * Strips annotations using a { @ link PlainTextConsoleOutputStream } . * { @ inheritDoc } */ @ CheckReturnValue @ Override public long writeLogTo ( long start , OutputStream out ) throws IOException { } }
return super . writeLogTo ( start , new PlainTextConsoleOutputStream ( out ) ) ;
public class TriplestoreResource { /** * This code is equivalent to the SPARQL query below . * < p > < pre > < code > * SELECT ? object * WHERE { * GRAPH trellis : PreferServerManaged { ? object dc : isPartOf IDENTIFIER } * < / code > < / pre > */ private Stream < Quad > fetchContainmentQuads ( ) { } }
if ( getInteractionModel ( ) . getIRIString ( ) . endsWith ( "Container" ) ) { final Query q = new Query ( ) ; q . setQuerySelectType ( ) ; q . addResultVar ( OBJECT ) ; final ElementPathBlock epb = new ElementPathBlock ( ) ; epb . addTriple ( create ( OBJECT , rdf . asJenaNode ( DC . isPartOf ) , rdf . asJenaNode ( id...
public class ClientTypeSignature { /** * This field is deprecated and clients should switch to { @ link # getArguments ( ) } */ @ Deprecated @ JsonProperty public List < Object > getLiteralArguments ( ) { } }
List < Object > result = new ArrayList < > ( ) ; for ( ClientTypeSignatureParameter argument : arguments ) { switch ( argument . getKind ( ) ) { case NAMED_TYPE : result . add ( argument . getNamedTypeSignature ( ) . getName ( ) ) ; break ; default : return new ArrayList < > ( ) ; } } return result ;
public class StreamMessage { /** * Get field from message body . * @ param key key * @ return field mapped key */ @ SuppressWarnings ( "rawtypes" ) public Object getField ( String key ) { } }
if ( this . body == null || Map . class . isAssignableFrom ( this . body . getClass ( ) ) == false ) { return null ; } return ( ( Map ) this . body ) . get ( key ) ;
public class StorageUtil { /** * sets a file value to a XML Element * @ param el Element to set value on it * @ param key key to set * @ param value value to set */ public void setFile ( Element el , String key , Resource value ) { } }
if ( value != null && value . toString ( ) . length ( ) > 0 ) el . setAttribute ( key , value . getAbsolutePath ( ) ) ;
public class Maven3Builder { /** * Used by Pipeline jobs only */ public boolean perform ( Run < ? , ? > build , Launcher launcher , TaskListener listener , EnvVars env , FilePath workDir , FilePath tempDir ) throws InterruptedException , IOException { } }
listener . getLogger ( ) . println ( "Jenkins Artifactory Plugin version: " + ActionableHelper . getArtifactoryPluginVersion ( ) ) ; FilePath mavenHome = getMavenHome ( listener , env , launcher ) ; if ( ! mavenHome . exists ( ) ) { listener . getLogger ( ) . println ( "Couldn't find Maven home at " + mavenHome . getRe...
public class FoxHttpClientBuilder { /** * Define a map of FoxHttpInterceptors * < i > This will override the existing map of interceptors < / i > * @ param foxHttpInterceptors Map of interceptors * @ return FoxHttpClientBuilder ( this ) */ public FoxHttpClientBuilder setFoxHttpInterceptors ( Map < FoxHttpIntercep...
foxHttpClient . setFoxHttpInterceptors ( foxHttpInterceptors ) ; return this ;
public class CmsDefaultPageEditor { /** * Returns the list of active elements of the page . < p > * @ return the list of active elements of the page */ protected List < CmsDialogElement > getElementList ( ) { } }
if ( m_elementList == null ) { m_elementList = CmsDialogElements . computeElements ( getCms ( ) , m_page , getParamTempfile ( ) , getElementLocale ( ) ) ; } return m_elementList ;
public class QuaternionEulerTransform { /** * Conversion from quaternion to Euler rotation . * The x value fr * @ param quat4d the quaternion from which the euler rotation is computed . * @ return a vector with the mapping : x = roll , y = pitch , z = yaw */ public static Vector3d transform ( final Quat4d quat4d ...
Vector3d result = new Vector3d ( ) ; double test = quat4d . x * quat4d . z + quat4d . y * quat4d . w ; if ( test >= 0.5 ) { // singularity at north pole result . x = 0 ; result . y = Math . PI / 2 ; result . z = 2 * Math . atan2 ( quat4d . x , quat4d . w ) ; return result ; } if ( test <= - 0.5 ) { // singularity at so...
public class MP3FileID3Controller { /** * Set the composer of this mp3 ( id3v2 only ) . * @ param composer the composer of this mp3 */ public void setComposer ( String composer ) { } }
if ( allow ( ID3V2 ) ) { id3v2 . setTextFrame ( ID3v2Frames . COMPOSER , composer ) ; }
public class ForkJoinPool { /** * Helps and / or blocks until the given task is done or timeout . * @ param w caller * @ param task the task * @ param deadline for timed waits , if nonzero * @ return task status on exit */ final int awaitJoin ( WorkQueue w , ForkJoinTask < ? > task , long deadline ) { } }
int s = 0 ; if ( w != null ) { ForkJoinTask < ? > prevJoin = w . currentJoin ; if ( task != null && ( s = task . status ) >= 0 ) { w . currentJoin = task ; CountedCompleter < ? > cc = ( task instanceof CountedCompleter ) ? ( CountedCompleter < ? > ) task : null ; for ( ; ; ) { if ( cc != null ) helpComplete ( w , cc , ...
public class Inode { /** * Wraps an InodeView , providing read - only access . Modifications to the underlying inode will * affect the created read - only inode . * @ param delegate the delegate to wrap * @ return the created read - only inode */ public static Inode wrap ( InodeView delegate ) { } }
if ( delegate instanceof Inode ) { return ( Inode ) delegate ; } if ( delegate . isFile ( ) ) { Preconditions . checkState ( delegate instanceof InodeFileView ) ; return new InodeFile ( ( InodeFileView ) delegate ) ; } else { Preconditions . checkState ( delegate instanceof InodeDirectoryView ) ; return new InodeDirect...
public class ipsecprofile { /** * Use this API to add ipsecprofile resources . */ public static base_responses add ( nitro_service client , ipsecprofile resources [ ] ) throws Exception { } }
base_responses result = null ; if ( resources != null && resources . length > 0 ) { ipsecprofile addresources [ ] = new ipsecprofile [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { addresources [ i ] = new ipsecprofile ( ) ; addresources [ i ] . name = resources [ i ] . name ; addresources ...
public class IDNA { /** * IDNA2003 : Convenience function that implements the IDNToUnicode operation as defined in the IDNA RFC . * This operation is done on complete domain names , e . g : " www . example . com " . * < b > Note : < / b > IDNA RFC specifies that a conformant application should divide a domain name ...
return convertIDNToUnicode ( src . getText ( ) , options ) ;
public class DateTimeField { /** * Get the Value of this field as a double . * Converts the time from getTime ( ) to a double ( may lose some precision ) . * @ return The value of this field . */ public double getValue ( ) { } }
// Get this field ' s value java . util . Date dateValue = ( java . util . Date ) this . getData ( ) ; // Get the physical data if ( dateValue == null ) return 0 ; return ( double ) dateValue . getTime ( ) ;
public class TransmissionData { /** * Returns the size of the data associated with this transmission * ( in bytes ) * @ return Returns the size of the data associated with this transmission */ protected int getSize ( ) { } }
if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getSize" ) ; int headerSize = 0 ; if ( layout == JFapChannelConstants . XMIT_PRIMARY_ONLY ) headerSize = JFapChannelConstants . SIZEOF_PRIMARY_HEADER ; else if ( layout == JFapChannelConstants . XMIT_CONVERSATION ) headerSize = JFapChannelConstants . SIZEOF_PR...
public class ClasspathElement { /** * Called by scanPaths ( ) after scan completion . * @ param log * the log */ protected void finishScanPaths ( final LogNode log ) { } }
if ( log != null ) { if ( whitelistedResources . isEmpty ( ) && whitelistedClassfileResources . isEmpty ( ) ) { log . log ( scanSpec . enableClassInfo ? "No whitelisted classfiles or resources found" : "Classfile scanning is disabled, and no whitelisted resources found" ) ; } else if ( whitelistedResources . isEmpty ( ...
public class MtasSolrComponentList { /** * ( non - Javadoc ) * @ see * mtas . solr . handler . component . util . MtasSolrComponent # distributedProcess ( org . * apache . solr . handler . component . ResponseBuilder , * mtas . codec . util . CodecComponent . ComponentFields ) */ @ SuppressWarnings ( "unchecked...
if ( mtasFields . doList ) { // compute total from shards HashMap < String , HashMap < String , Integer > > listShardTotals = new HashMap < > ( ) ; for ( ShardRequest sreq : rb . finished ) { if ( sreq . params . getBool ( MtasSolrSearchComponent . PARAM_MTAS , false ) && sreq . params . getBool ( PARAM_MTAS_LIST , fal...
public class Phaser { /** * Resolves lagged phase propagation from root if necessary . * Reconciliation normally occurs when root has advanced but * subphasers have not yet done so , in which case they must finish * their own advance by setting unarrived to parties ( or if * parties is zero , resetting to unreg...
final Phaser root = this . root ; long s = state ; if ( root != this ) { int phase , p ; // CAS to root phase with current parties , tripping unarrived while ( ( phase = ( int ) ( root . state >>> PHASE_SHIFT ) ) != ( int ) ( s >>> PHASE_SHIFT ) && ! U . compareAndSwapLong ( this , STATE , s , s = ( ( ( long ) phase <<...
public class WebFragmentTypeImpl { /** * If not already created , a new < code > pre - destroy < / code > element will be created and returned . * Otherwise , the first existing < code > pre - destroy < / code > element will be returned . * @ return the instance defined for the element < code > pre - destroy < / co...
List < Node > nodeList = childNode . get ( "pre-destroy" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new LifecycleCallbackTypeImpl < WebFragmentType < T > > ( this , "pre-destroy" , childNode , nodeList . get ( 0 ) ) ; } return createPreDestroy ( ) ;
public class FiducialDetectorPnP { /** * Create the list of observed points in 2D3D */ private void createDetectedList ( int which , List < PointIndex2D_F64 > pixels ) { } }
detected2D3D . clear ( ) ; List < Point2D3D > all = getControl3D ( which ) ; for ( int i = 0 ; i < pixels . size ( ) ; i ++ ) { PointIndex2D_F64 a = pixels . get ( i ) ; Point2D3D b = all . get ( i ) ; pixelToNorm . compute ( a . x , a . y , b . observation ) ; detected2D3D . add ( b ) ; }
public class StorableIndex { /** * Returns a StorableIndex instance which is clustered or not . */ public StorableIndex < S > clustered ( boolean clustered ) { } }
if ( clustered == mClustered ) { return this ; } return new StorableIndex < S > ( mProperties , mDirections , mUnique , clustered , false ) ;
public class CacheElement { private static final void auditNamedValues ( String m , Map < String , ? > namedValues ) { } }
if ( logger . isDebugEnabled ( ) ) { assert namedValues != null ; for ( Iterator < String > outer = namedValues . keySet ( ) . iterator ( ) ; outer . hasNext ( ) ; ) { Object name = outer . next ( ) ; assert name instanceof String : "not a string, name==" + name ; StringBuffer sb = new StringBuffer ( m + name + "==" ) ...
public class Option { /** * Returns the sub - text of the option . * @ return */ public String getSubtext ( ) { } }
String subtext = attrMixin . getAttribute ( SUBTEXT ) ; return subtext . isEmpty ( ) ? null : subtext ;
public class Classes { /** * Get class by name with checked exception . The same as { @ link # forName ( String ) } but throws checked exception in the * event requested class is not found . * @ param className requested class name , not null . * @ param < T > class to auto - cast named class . * @ return class...
ClassLoader loader = Thread . currentThread ( ) . getContextClassLoader ( ) ; ClassNotFoundException classNotFoundException = null ; if ( loader != null ) { try { return ( Class < T > ) Class . forName ( className , true , loader ) ; } catch ( ClassNotFoundException expected ) { classNotFoundException = expected ; } } ...
public class Animation { /** * Draw the animation * @ param x The x position to draw the animation at * @ param y The y position to draw the animation at * @ param width The width to draw the animation at * @ param height The height to draw the animation at * @ param col The colour for the flash */ public voi...
if ( frames . size ( ) == 0 ) { return ; } if ( autoUpdate ) { long now = getTime ( ) ; long delta = now - lastUpdate ; if ( firstUpdate ) { delta = 0 ; firstUpdate = false ; } lastUpdate = now ; nextFrame ( delta ) ; } Frame frame = ( Frame ) frames . get ( currentFrame ) ; frame . image . drawFlash ( x , y , width , ...
public class XString { /** * Cast result object to a result tree fragment . * @ param support Xpath context to use for the conversion * @ return A document fragment with this string as a child node */ public int rtf ( XPathContext support ) { } }
DTM frag = support . createDocumentFragment ( ) ; frag . appendTextChild ( str ( ) ) ; return frag . getDocument ( ) ;
public class FileTrainingCorpus { /** * there is exactly one document per line */ public void addDocument ( Document doc ) throws IOException { } }
// needs to differenciate SimpleDocuments from MultiField ones // each class has its own way of serializing String serial = doc . getStringSerialization ( ) ; raw_file_buffer . write ( serial ) ;
public class Query { /** * Resolves the projection used in this { @ link Query } by validating the { @ link List } of { @ literal selected } * { @ link Column Columns } against the { @ link Column Columns } contained in the { @ link View } . * @ param from { @ link View } to query . * @ return the { @ link List }...
List < Column > projection = getProjection ( ) ; Assert . isTrue ( projection . stream ( ) . allMatch ( from :: contains ) , ( ) -> String . format ( "The View of Columns %1$s does not contain all the selected, or projected Columns %2$s" , from . columns ( ) , projection ) ) ; return projection ;
public class GetFacetRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetFacetRequest getFacetRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getFacetRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getFacetRequest . getSchemaArn ( ) , SCHEMAARN_BINDING ) ; protocolMarshaller . marshall ( getFacetRequest . getName ( ) , NAME_BINDING ) ; } catch ( Exception e ) { thr...
public class CASableSimpleFileIOChannel { /** * { @ inheritDoc } */ @ Override public void write ( String propertyId , ValueData value , ChangedSizeHandler sizeHandler ) throws IOException { } }
CASableWriteValue o = new CASableWriteValue ( value , resources , cleaner , tempDir , propertyId , vcas , cas , sizeHandler ) ; o . execute ( ) ; changes . add ( o ) ;
public class SMailHonestPostie { protected Address verifyFilteredFromAddress ( CardView view , Address filteredFrom ) { } }
if ( filteredFrom == null ) { String msg = "The filtered from-address should not be null: postcard=" + view ; throw new SMailIllegalStateException ( msg ) ; } return filteredFrom ;
public class ClusterConfigurationsInner { /** * Set the configuration object for the specified configuration for the specified cluster . * @ param configurations the configurations value to set * @ return the ClusterConfigurationsInner object itself . */ public ClusterConfigurationsInner withConfigurations ( Map < ...
this . configurations = configurations ; return this ;
public class TRNImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . TRN__TRNDATA : setTRNDATA ( TRNDATA_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ;
public class ServerAzureADAdministratorsInner { /** * Creates a new Server Active Directory Administrator or updates an existing server Active Directory Administrator . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API...
return beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , serverName , properties ) . map ( new Func1 < ServiceResponse < ServerAzureADAdministratorInner > , ServerAzureADAdministratorInner > ( ) { @ Override public ServerAzureADAdministratorInner call ( ServiceResponse < ServerAzureADAdministratorInner ...
public class FaultMgr { public void constructFault ( FaultException faultException , Object argument ) { } }
// check argument if ( argument != null && faultException . getArgument ( ) == null ) faultException . setArgument ( argument ) ; StackTraceElement stackTraceElement = null ; if ( faultException . getModule ( ) == null ) { if ( this . defaultModule != null && this . defaultModule . length ( ) > 0 ) faultException . set...
public class InstanceFailoverGroupsInner { /** * Creates or updates a failover group . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param locationName The name of the region where the resourc...
return beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , locationName , failoverGroupName , parameters ) . map ( new Func1 < ServiceResponse < InstanceFailoverGroupInner > , InstanceFailoverGroupInner > ( ) { @ Override public InstanceFailoverGroupInner call ( ServiceResponse < InstanceFailoverGroupInne...
public class Dataframe { /** * Updates the meta data of the Dataframe using the provided Record . * The Meta - data include the supported columns and their DataTypes . * @ param r */ private void updateMeta ( Record r ) { } }
for ( Map . Entry < Object , Object > entry : r . getX ( ) . entrySet ( ) ) { Object column = entry . getKey ( ) ; Object value = entry . getValue ( ) ; if ( value != null ) { data . xDataTypes . putIfAbsent ( column , TypeInference . getDataType ( value ) ) ; } } if ( data . yDataType == null ) { Object value = r . ge...
public class DTMNodeList { /** * Returns the < code > index < / code > th item in the collection . If * < code > index < / code > is greater than or equal to the number of nodes in * the list , this returns < code > null < / code > . * @ param index Index into the collection . * @ return The node at the < code ...
if ( m_iter != null ) { int handle = m_iter . item ( index ) ; if ( handle == DTM . NULL ) { return null ; } return m_iter . getDTM ( handle ) . getNode ( handle ) ; } else { return null ; }
public class JaxRsFactoryImplicitBeanCDICustomizer { /** * ( non - Javadoc ) * @ see com . ibm . ws . jaxrs20 . api . JaxRsFactoryBeanCustomizer # afterServiceInvoke ( java . lang . Object , boolean , java . lang . Object ) */ @ Override public void afterServiceInvoke ( Object serviceObject , boolean isSingleton , Ob...
@ SuppressWarnings ( "unchecked" ) Map < Class < ? > , ManagedObject < ? > > newContext = ( Map < Class < ? > , ManagedObject < ? > > ) ( context ) ; ManagedObject < ? > mo = newContext . get ( serviceObject . getClass ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc ...
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getTextOrientation ( ) { } }
if ( textOrientationEClass == null ) { textOrientationEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 376 ) ; } return textOrientationEClass ;
public class GeoQuery { /** * Sets the center and radius ( in kilometers ) of this query , and triggers new events if necessary . * @ param center The new center * @ param radius The radius of the query , in kilometers . The maximum radius that is * supported is about 8587km . If a radius bigger than this is pass...
this . center = center ; // convert radius to meters this . radius = capRadius ( radius ) * KILOMETER_TO_METER ; if ( this . hasListeners ( ) ) { this . setupQueries ( ) ; }
public class SourceNameResolver { /** * Return the id of the resource pointed by the url without extension * E . g . http : / / example . com / resource . tar return resource * @ param url * @ return */ public static String getIdOfTarballFromUrl ( String url ) { } }
String nameOfTarballResource = getTarballResourceNameFromUrl ( url ) ; return nameOfTarballResource . substring ( 0 , nameOfTarballResource . lastIndexOf ( "." ) ) ;
public class ValidationConfigurator { /** * Internal method to set up the object ' s data */ private void setupData ( ValidationConfig config , ClassLoader classLoader ) { } }
// A config object is always used to use a common code path , so the parsed // ValidationConfig may be null if a validation . xml wasn ' t found . if ( config != null ) { versionID = config . getVersionID ( ) ; defaultProvider = config . getDefaultProvider ( ) ; defaultProvider = defaultProvider != null ? defaultProvid...
public class AbstractColorPickerPreference { /** * Obtains the background of the preview of the preference ' s color from a specific typed array . * @ param typedArray * The typed array , the background should be obtained from , as an instance of the class * { @ link TypedArray } . The typed array may not be null...
int backgroundColor = typedArray . getColor ( R . styleable . AbstractColorPickerPreference_previewBackground , - 1 ) ; if ( backgroundColor != - 1 ) { setPreviewBackgroundColor ( backgroundColor ) ; } else { int resourceId = typedArray . getResourceId ( R . styleable . AbstractColorPickerPreference_previewBackground ,...
public class PHPDriver { /** * < p > close . < / p > * @ throws java . io . IOException if any . */ public void close ( ) throws IOException { } }
out . close ( ) ; in . close ( ) ; if ( server != null ) { server . close ( ) ; } if ( client != null ) { client . close ( ) ; }
public class CDIContainerImpl { /** * Create BDAs for either the EJB , Web or Client modules and any libraries they reference on their classpath . */ private void processModules ( WebSphereCDIDeployment applicationContext , DiscoveredBdas discoveredBdas , Collection < CDIArchive > moduleArchives ) throws CDIException {...
List < WebSphereBeanDeploymentArchive > moduleBDAs = new ArrayList < WebSphereBeanDeploymentArchive > ( ) ; for ( CDIArchive archive : moduleArchives ) { if ( cdiRuntime . isClientProcess ( ) ) { // when on a client process , we only process client modules and ignore the others if ( ArchiveType . CLIENT_MODULE != archi...
public class GpioControllerImpl { /** * This method can be called to forcefully shutdown all GPIO controller * monitoring , listening , and task threads / executors . */ @ Override public synchronized void shutdown ( ) { } }
// prevent reentrant invocation if ( isShutdown ( ) ) return ; // create a temporary set of providers to shutdown after completing all the pin instance shutdowns Set < GpioProvider > gpioProvidersToShutdown = new HashSet < > ( ) ; // shutdown explicit configured GPIO pins for ( GpioPin pin : pins ) { // add each GPIO p...
public class SegmentedJournal { /** * Loads a segment . */ private JournalSegment < E > loadSegment ( long segmentId ) { } }
File segmentFile = JournalSegmentFile . createSegmentFile ( name , directory , segmentId ) ; ByteBuffer buffer = ByteBuffer . allocate ( JournalSegmentDescriptor . BYTES ) ; try ( FileChannel channel = openChannel ( segmentFile ) ) { channel . read ( buffer ) ; buffer . flip ( ) ; JournalSegmentDescriptor descriptor = ...
public class XidParticipant { public synchronized void addWork ( WorkItem item ) throws ProtocolException , TransactionException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "addWork" , "WorkItem=" + item ) ; // Check the current transaction state ( use state lock to ensure we see the latest value ) synchronized ( _stateLock ) { if ( ( _state != TransactionState . STATE_ACTIVE ) && ! _ind...
public class Vector4i { /** * Set all components to zero . * @ return a vector holding the result */ public Vector4i zero ( ) { } }
Vector4i dest = thisOrNew ( ) ; MemUtil . INSTANCE . zero ( dest ) ; return dest ;
public class MessageFormat { /** * Format the current stream , with the optional substitution argument , replacing ' # ' . */ private void format ( Stream outer , String arg ) { } }
// Iterate over text and tags , alternately . int prev = outer . pos ; int length = outer . end ; int next = - 1 ; // Anchor to the starting ' { ' . while ( ( next = outer . find ( '{' ) ) != - 1 ) { // Emit characters before the tag ' s opening ' { ' if ( next > prev ) { emit ( prev , next , arg ) ; prev = next ; } //...
public class XData { /** * actually serializes the data * @ param marshallerMap * @ param dOut * @ param primaryNode * @ param progressListener * @ throws IOException */ private static void serialize ( Map < String , AbstractDataMarshaller < ? > > marshallerMap , DataOutputStream dOut , DataNode primaryNode ,...
// a map containing all serialized objects . This is used // to make sure that we store each deSerializedObject only once . final Map < SerializedObject , SerializedObject > serializedObjects = new HashMap < > ( ) ; final Deque < SerializationFrame > stack = new LinkedList < > ( ) ; final DataNodeSerializationFrame pri...
public class AWSDeviceFarmClient { /** * Gets information about uploads , given an AWS Device Farm project ARN . * @ param listUploadsRequest * Represents a request to the list uploads operation . * @ return Result of the ListUploads operation returned by the service . * @ throws ArgumentException * An invali...
request = beforeClientExecution ( request ) ; return executeListUploads ( request ) ;
public class EntityInfo { /** * 根据主键值获取Entity的表名 * @ param primary Entity主键值 * @ return String */ public String getTable ( Serializable primary ) { } }
if ( tableStrategy == null ) return table ; String t = tableStrategy . getTable ( table , primary ) ; return t == null || t . isEmpty ( ) ? table : t ;
public class SimpleDateFormat { /** * Applies the given localized pattern string to this date format . * @ param pattern a String to be mapped to the new date and time format * pattern for this format * @ exception NullPointerException if the given pattern is null * @ exception IllegalArgumentException if the g...
String p = translatePattern ( pattern , formatData . getLocalPatternChars ( ) , DateFormatSymbols . patternChars ) ; compiledPattern = compile ( p ) ; this . pattern = p ;
public class ApiModule { /** * Changing endpoint */ public void changeEndpoint ( String endpoint ) throws ConnectionEndpointArray . UnknownSchemeException { } }
changeEndpoints ( new Endpoints ( new ConnectionEndpointArray ( ) . addEndpoint ( endpoint ) . toArray ( new ConnectionEndpoint [ 1 ] ) , new TrustedKey [ 0 ] ) ) ;
public class FbBotMillMockMediator { /** * Utility method that instantiates a { @ link BotDefinition } class . * @ param klass * the class to instantiate . * @ return a { @ link BotDefinition } . */ private static BotDefinition instantiateClass ( Class < ? extends BotDefinition > klass ) { } }
BotDefinition definition = null ; try { definition = klass . newInstance ( ) ; } catch ( InstantiationException e ) { e . printStackTrace ( ) ; } catch ( IllegalAccessException e ) { e . printStackTrace ( ) ; } return definition ;
public class CmsPreferences { /** * Builds the html for the editor button style select box . < p > * @ param htmlAttributes optional html attributes for the & lgt ; select & gt ; tag * @ return the html for the editor button style select box */ public String buildSelectEditorButtonStyle ( String htmlAttributes ) { ...
int selectedIndex = Integer . parseInt ( getParamTabEdButtonStyle ( ) ) ; return buildSelectButtonStyle ( htmlAttributes , selectedIndex ) ;
public class OccupantDirector { /** * Returns the occupant info for the user in question if it exists in * the currently occupied place . Returns null if no occupant info * exists for the specified body . */ public OccupantInfo getOccupantInfo ( int bodyOid ) { } }
// make sure we ' re somewhere return ( _place == null ) ? null : _place . occupantInfo . get ( Integer . valueOf ( bodyOid ) ) ;
public class HttpBalancerService { /** * Converts a collection of WS URIs to their equivalent WSN balancer URIs . * @ param uris * the URIs to convert * @ return the converted URIs * @ throws Exception */ private static Collection < String > toWsBalancerURIs ( Collection < String > uris , AcceptOptionsContext a...
List < String > httpURIs = new ArrayList < > ( uris . size ( ) ) ; for ( String uri : uris ) { String schemeFromAcceptURI = uri . substring ( 0 , uri . indexOf ( ':' ) ) ; Protocol protocol = transportFactory . getProtocol ( schemeFromAcceptURI ) ; if ( WsProtocol . WS . equals ( protocol ) || WsProtocol . WSS . equals...
public class DefaultGroovyMethods { /** * Create a List composed of the elements of this Iterable , repeated * a certain number of times . Note that for non - primitive * elements , multiple references to the same instance will be added . * < pre class = " groovyTestCase " > assert [ 1,2,3,1,2,3 ] = = [ 1,2,3 ] *...
return ( List < T > ) multiply ( ( Iterable < T > ) self , factor ) ;
public class RadialBargraph { /** * < editor - fold defaultstate = " collapsed " desc = " Visualization " > */ @ Override protected void paintComponent ( Graphics g ) { } }
if ( ! isInitialized ( ) ) { return ; } final Graphics2D G2 = ( Graphics2D ) g . create ( ) ; G2 . setRenderingHint ( RenderingHints . KEY_ANTIALIASING , RenderingHints . VALUE_ANTIALIAS_ON ) ; G2 . setRenderingHint ( RenderingHints . KEY_RENDERING , RenderingHints . VALUE_RENDER_QUALITY ) ; G2 . setRenderingHint ( Ren...
public class TransactionLogger { /** * Pause component timer for current instance * @ param type - of component */ public static void pauseTimer ( final String type ) { } }
TransactionLogger instance = getInstance ( ) ; if ( instance == null ) { return ; } instance . components . get ( type ) . pauseTimer ( ) ;
public class ExpressRouteCircuitAuthorizationsInner { /** * Creates or updates an authorization in the specified express route circuit . * @ param resourceGroupName The name of the resource group . * @ param circuitName The name of the express route circuit . * @ param authorizationName The name of the authorizat...
return beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , circuitName , authorizationName , authorizationParameters ) . toBlocking ( ) . single ( ) . body ( ) ;
public class NavMeshQuery { /** * / @ returns The status flags for the query . */ public Result < FindNearestPolyResult > findNearestPoly ( float [ ] center , float [ ] halfExtents , QueryFilter filter ) { } }
float [ ] nearestPt = new float [ ] { center [ 0 ] , center [ 1 ] , center [ 2 ] } ; // Get nearby polygons from proximity grid . Result < List < Long > > polysResult = queryPolygons ( center , halfExtents , filter ) ; if ( polysResult . failed ( ) ) { return Result . of ( polysResult . status , polysResult . message )...
public class BasicTagList { /** * Returns a tag list containing the union of { @ code t1 } and { @ code t2 } . * If there is a conflict with tag keys , the tag from { @ code t2 } will be * used . */ public static BasicTagList concat ( TagList t1 , TagList t2 ) { } }
return new BasicTagList ( Iterables . concat ( t1 , t2 ) ) ;
public class Functions { /** * A { @ code Function } that always ignores its argument and throws an { @ link AssertionError } . * @ return a { @ code Function } that always ignores its argument and throws an { @ code * AssertionError } . * @ since 0.6 */ public static < T > Function < Object , T > throwAssertionE...
// It is safe to cast this function to have any return type , since it never returns a result . @ SuppressWarnings ( "unchecked" ) Function < Object , T > function = ( Function < Object , T > ) THROW_ASSERTION_ERROR ; return function ;
public class DSUtil { /** * Similar to < code > mapColl < / code > , but filters out all * < code > null < / code > elements produced by < code > func < / code > . * @ see # mapColl ( Iterable , Function , Collection ) */ public static < E1 , E2 > Collection < E2 > mapColl2 ( Iterable < E1 > coll , Function < E1 , ...
for ( E1 elem : coll ) { E2 img = func . f ( elem ) ; if ( img != null ) newColl . add ( img ) ; } return newColl ;
public class SerializationChecker { /** * Adapted from { @ link java . io . ObjectStreamClass # computeDefaultSUID ( java . lang . Class ) } method . */ public static long computeSerialVersionUID ( TypeElement type , TypeEnvironment environment ) { } }
TypeElement javaIoSerializable = environment . getElementUtils ( ) . getTypeElement ( "java.io.Serializable" ) ; if ( ! environment . getTypeUtils ( ) . isAssignable ( type . asType ( ) , javaIoSerializable . asType ( ) ) ) { return 0L ; } // if ( ! Serializable . class . isAssignableFrom ( cl ) | | Proxy . isProxyClas...
public class SgVariable { /** * Adds a list of annotations . The internal list will not be cleared ! The * annotations will simply be added with < code > addAll ( . . ) < / code > . * @ param annotations * Annotations to add - Cannot be null . */ public final void addAnnotations ( final List < SgAnnotation > anno...
if ( annotations == null ) { throw new IllegalArgumentException ( "The argument 'annotations' cannot be NULL!" ) ; } this . annotations . addAll ( annotations ) ;
public class QueryExecutor { /** * Return SQL to get ordered list of docIds . * Method assumes ` sortDocument ` is valid . * @ param docIdSet The original set of document IDs * @ param sortDocument Array of ordering definitions * [ { " fieldName " : " asc " } , { " fieldName2 " , " desc " } ] * @ param indexe...
String chosenIndex = chooseIndexForSort ( sortDocument , indexes ) ; if ( chosenIndex == null ) { String msg = String . format ( Locale . ENGLISH , "No single index can satisfy order %s" , sortDocument ) ; logger . log ( Level . SEVERE , msg ) ; throw new QueryException ( msg ) ; } String indexTable = QueryImpl . table...
public class LDAPRule { /** * { @ inheritDoc } */ @ Override public Statement apply ( final Statement statement , FrameworkMethod method , Object target ) { } }
LDAP ldap = method . getAnnotation ( LDAP . class ) ; if ( ldap != null ) { try { port = ldap . port ( ) ; baseDN = ldap . baseDN ( ) ; additionalBindDN = ldap . additionalBindDN ( ) ; additionalBindPassword = ldap . additionalBindPassword ( ) ; directoryServer = createDirectoryServer ( ) ; importLdif ( ldap . ldif ( )...
public class PermutationGenerator { /** * Generate the next permutation and return a list containing * the elements in the appropriate order . This overloaded method * allows the caller to provide a list that will be used and returned . * The purpose of this is to improve performance when iterating over * permu...
generateNextPermutationIndices ( ) ; // Generate actual permutation . destination . clear ( ) ; for ( int i : permutationIndices ) { destination . add ( elements [ i ] ) ; } return destination ;
public class DebugUtil { /** * Builds a prefix message to be used in front of < i > info < / i > messages for identification purposes . * The message format is : * < pre > * * * * * external info : [ timestamp ] [ class name ] : * < / pre > * @ param pObject the { @ code java . lang . Object } to be debugged ...
StringBuilder buffer = new StringBuilder ( ) ; buffer . append ( INFO ) ; buffer . append ( getTimestamp ( ) ) ; buffer . append ( " " ) ; if ( pObject == null ) { buffer . append ( "[unknown class]" ) ; } else { if ( pObject instanceof String ) { buffer . append ( ( String ) pObject ) ; } else { buffer . append ( getC...
public class AgentFilter { /** * The current health state of the agent . Values can be set to < b > HEALTHY < / b > or < b > UNHEALTHY < / b > . * @ param agentHealths * The current health state of the agent . Values can be set to < b > HEALTHY < / b > or < b > UNHEALTHY < / b > . * @ return Returns a reference t...
java . util . ArrayList < String > agentHealthsCopy = new java . util . ArrayList < String > ( agentHealths . length ) ; for ( AgentHealth value : agentHealths ) { agentHealthsCopy . add ( value . toString ( ) ) ; } if ( getAgentHealths ( ) == null ) { setAgentHealths ( agentHealthsCopy ) ; } else { getAgentHealths ( )...
public class MwSitesDumpFileProcessor { /** * Extract the individual fields for one row in the sites table . The entries * are encoded by position , with the following meaning : 0 : site _ id , 1: * site _ global _ key , 2 : site _ type , 3 : site _ group , 4 : site _ source 5: * site _ language , 6 : site _ prot...
String [ ] siteRowFields = new String [ 11 ] ; Matcher matcher = Pattern . compile ( "[(,](['][^']*[']|[^'][^),]*)" ) . matcher ( siteRow ) ; int columnIndex = 0 ; while ( matcher . find ( ) ) { String field = matcher . group ( ) . substring ( 1 ) ; if ( field . charAt ( 0 ) == '\'' ) { field = field . substring ( 1 , ...
public class LogAction { /** * 显示角色某时间段的登陆记录 */ @ SuppressWarnings ( { } }
"unchecked" , "rawtypes" } ) public String timeIntervalStat ( ) { OqlBuilder < SessioninfoLogBean > query = OqlBuilder . from ( SessioninfoLogBean . class , "sessioninfoLog" ) ; addConditions ( query ) ; query . select ( "hour(sessioninfoLog.loginAt),count(*)" ) . groupBy ( "hour(sessioninfoLog.loginAt)" ) ; List rs = ...
public class MolgenisWebAppConfig { /** * Configure freemarker . All freemarker templates should be on the classpath in a package called * ' freemarker ' */ @ Bean public FreeMarkerConfigurer freeMarkerConfigurer ( ) { } }
FreeMarkerConfigurer result = new FreeMarkerConfigurer ( ) { @ Override protected void postProcessConfiguration ( Configuration config ) { config . setObjectWrapper ( new MolgenisFreemarkerObjectWrapper ( VERSION_2_3_23 ) ) ; } @ Override protected void postProcessTemplateLoaders ( List < TemplateLoader > templateLoade...
public class FileExtractor { /** * Unzip a downloaded zip file ( this will implicitly overwrite any existing files ) * @ param downloadedCompressedFile The downloaded zip file * @ param extractedToFilePath Path to extracted file * @ param possibleFilenames Names of the files we want to extract * @ return boolea...
LOG . debug ( "Attempting to extract binary from .zip file..." ) ; ArrayList < String > filenamesWeAreSearchingFor = new ArrayList < String > ( possibleFilenames . getBinaryFilenames ( ) ) ; ZipFile zip = new ZipFile ( downloadedCompressedFile ) ; try { Enumeration < ZipArchiveEntry > zipFile = zip . getEntries ( ) ; i...
public class DRL5Lexer { /** * $ ANTLR start " LEFT _ PAREN " */ public final void mLEFT_PAREN ( ) throws RecognitionException { } }
try { int _type = LEFT_PAREN ; int _channel = DEFAULT_TOKEN_CHANNEL ; // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 238:9 : ( ' ( ' ) // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 238:11 : ' ( ' { match ( '(' ) ; if ( state . failed ) return ; } state . type...
public class AllocateHostsRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional * parameters to enable operation dry - run . */ @ Override public Request < AllocateHostsRequest > getDryRunRequest ( ) { } }
Request < AllocateHostsRequest > request = new AllocateHostsRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ;