signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class SARLEclipsePlugin { /** * Logs an internal error with the specified message . * @ param message the error message to log */ public void logErrorMessage ( String message ) { } }
getILog ( ) . log ( new Status ( IStatus . ERROR , PLUGIN_ID , message , null ) ) ;
public class Value { /** * Load some or all of completely persisted Values */ byte [ ] loadPersist ( ) { } }
// 00 assert : not written yet // 01 assert : load - after - delete // 10 expected ; read // 11 assert : load - after - delete assert isPersisted ( ) ; try { byte [ ] res = H2O . getPM ( ) . load ( backend ( ) , this ) ; assert ! isDeleted ( ) ; // Race in user - land : load - after - delete return res ; } catch ( IOException ioe ) { throw Log . throwErr ( ioe ) ; }
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertIfcSectionTypeEnumToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class Predicates { /** * Create a predicate which is a logical or of two existing predicate . * @ param first first predicate . * @ param second second predicate . * @ param < T > type of the predicates * @ return resultant predicate * @ since 1.5 */ public static < T > Predicate < T > or ( final Predicate < ? super T > first , final Predicate < ? super T > second ) { } }
// NOPMD return new Predicate < T > ( ) { @ Override public boolean test ( final T testValue ) { return first . test ( testValue ) || second . test ( testValue ) ; } } ;
public class RmiEndpointUtils { /** * Extract host name from resource path . * @ param resourcePath * @ return */ public static String getHost ( String resourcePath ) { } }
String hostSpec ; if ( resourcePath . contains ( ":" ) ) { hostSpec = resourcePath . split ( ":" ) [ 0 ] ; } else { hostSpec = resourcePath ; } if ( hostSpec . contains ( "/" ) ) { hostSpec = hostSpec . substring ( 0 , hostSpec . indexOf ( '/' ) ) ; } return hostSpec ;
public class HttpContextImpl { /** * This method is called when the template outputs data . This * implementation calls this . toString ( Object ) on the object and then * appends the result to the internal CharToByteBuffer . * @ param obj the object to output * @ hidden */ public final void print ( Object obj ) throws Exception { } }
if ( ( mOutputOverridePermitted || mBuffer == null ) && mOutputReceiver != null ) { mOutputReceiver . print ( obj ) ; } else if ( mBuffer != null ) { mBuffer . append ( toString ( obj ) ) ; }
public class SessionForRequest { /** * Creates a session and stores it in the request attributes . * @ param sessionStore the session store * @ param request the Http Request * @ return A new session stored in the request attributes */ public static Session create ( SessionStore sessionStore , HttpRequest < ? > request ) { } }
Session session = sessionStore . newSession ( ) ; request . getAttributes ( ) . put ( HttpSessionFilter . SESSION_ATTRIBUTE , session ) ; return session ;
public class FlowTypeCheck { public void checkDeclaration ( Decl decl ) { } }
if ( decl instanceof Decl . Unit ) { checkUnit ( ( Decl . Unit ) decl ) ; } else if ( decl instanceof Decl . Import ) { // Can ignore } else if ( decl instanceof Decl . StaticVariable ) { checkStaticVariableDeclaration ( ( Decl . StaticVariable ) decl ) ; } else if ( decl instanceof Decl . Type ) { checkTypeDeclaration ( ( Decl . Type ) decl ) ; } else if ( decl instanceof Decl . FunctionOrMethod ) { checkFunctionOrMethodDeclaration ( ( Decl . FunctionOrMethod ) decl ) ; } else { checkPropertyDeclaration ( ( Decl . Property ) decl ) ; }
public class CacheKey { /** * region Overrides */ @ Override public byte [ ] serialize ( ) { } }
byte [ ] result = new byte [ SERIALIZATION_LENGTH ] ; BitConverter . writeLong ( result , 0 , this . segmentId ) ; BitConverter . writeLong ( result , Long . BYTES , this . offset ) ; return result ;
public class AuditManager { /** * Gets the single instance of AuditHelper . * @ return single instance of AuditHelper */ public static IAuditManager getInstance ( ) { } }
IAuditManager result = auditManager ; if ( result == null ) { synchronized ( AuditManager . class ) { result = auditManager ; if ( result == null ) { Context . init ( ) ; auditManager = result = new AuditManager ( ) ; } } } return result ;
public class Analyser { /** * Get a suffix from the children which exists in staticSuffixList . An * option is provided to check recursively . Note that the immediate children * are always checked first before further recursive check is done . * @ paramnode the node used to obtain the suffix * @ paramperformRecursiveCheckTrue = get recursively the suffix from all * the children . * @ returnThe suffix " . xxx " is returned . If there is no suffix found , an * empty string is returned . */ private String getChildSuffix ( StructuralNode node , boolean performRecursiveCheck ) { } }
String resultSuffix = "" ; String suffix = null ; StructuralNode child = null ; try { for ( int i = 0 ; i < staticSuffixList . length ; i ++ ) { suffix = staticSuffixList [ i ] ; Iterator < StructuralNode > iter = node . getChildIterator ( ) ; while ( iter . hasNext ( ) ) { child = iter . next ( ) ; try { if ( child . getURI ( ) . getPath ( ) . endsWith ( suffix ) ) { return suffix ; } } catch ( Exception e ) { } } } if ( performRecursiveCheck ) { Iterator < StructuralNode > iter = node . getChildIterator ( ) ; while ( iter . hasNext ( ) ) { child = iter . next ( ) ; resultSuffix = getChildSuffix ( child , performRecursiveCheck ) ; if ( ! resultSuffix . equals ( "" ) ) { return resultSuffix ; } } } } catch ( Exception e ) { } return resultSuffix ;
public class DeploymentJBossASClient { /** * Uploads the content to the app server ' s content repository and then deploys the content . * If this is to be used for app servers in " domain " mode you have to pass in one or more * server groups . If this is to be used to deploy an app in a standalone server , the * server groups should be empty . * @ param deploymentName name that the content will be known as * @ param content stream containing the actual content data * @ param enabled if true , the content will be uploaded and actually deployed ; * if false , content will be uploaded to the server , but it won ' t be deployed in the server runtime * @ param serverGroups the server groups where the application will be deployed if in domain mode * @ param forceDeploy if true the deployment content is uploaded even if that deployment name already has content * ( in other words , the new content will overwrite the old ) . If false , an error will occur if * there is already content associated with the deployment name . */ public void deploy ( String deploymentName , InputStream content , boolean enabled , Set < String > serverGroups , boolean forceDeploy ) { } }
if ( serverGroups == null ) { serverGroups = Collections . emptySet ( ) ; } DeploymentResult result = null ; try { DeploymentManager dm = DeploymentManager . Factory . create ( getModelControllerClient ( ) ) ; Deployment deployment = Deployment . of ( content , deploymentName ) . addServerGroups ( serverGroups ) . setEnabled ( enabled ) ; if ( forceDeploy ) { result = dm . forceDeploy ( deployment ) ; } else { result = dm . deploy ( deployment ) ; } } catch ( Exception e ) { String errMsg ; if ( serverGroups . isEmpty ( ) ) { errMsg = String . format ( "Failed to deploy [%s] (standalone mode)" , deploymentName ) ; } else { errMsg = String . format ( "Failed to deploy [%s] to server groups: %s" , deploymentName , serverGroups ) ; } throw new FailureException ( errMsg , e ) ; } if ( ! result . successful ( ) ) { String errMsg ; if ( serverGroups . isEmpty ( ) ) { errMsg = String . format ( "Failed to deploy [%s] (standalone mode)" , deploymentName ) ; } else { errMsg = String . format ( "Failed to deploy [%s] to server groups [%s]" , deploymentName , serverGroups ) ; } throw new FailureException ( errMsg + ": " + result . getFailureMessage ( ) ) ; } return ; // everything is OK
public class CalculateDateExtensions { /** * Adds months to the given Date object and returns it . Note : you can add negative values too * for get date in past . * @ param date * The Date object to add the years . * @ param addMonths * The months to add . * @ return The resulted Date object . */ public static Date addMonths ( final Date date , final int addMonths ) { } }
final Calendar dateOnCalendar = Calendar . getInstance ( ) ; dateOnCalendar . setTime ( date ) ; dateOnCalendar . add ( Calendar . MONTH , addMonths ) ; return dateOnCalendar . getTime ( ) ;
public class QuerySyntaxExceptionMapper { /** * { @ inheritDoc } */ @ Override public Response toResponse ( QuerySyntaxException exception ) { } }
return providers . getExceptionMapper ( Throwable . class ) . toResponse ( new UnprocessableEntityException ( exception . getMessage ( ) , exception ) ) ;
public class HttpResponseDecoderSpec { /** * Build a { @ link Function } that applies the http response decoder configuration to a * { @ link TcpClient } by enriching its attributes . */ Function < TcpClient , TcpClient > build ( ) { } }
HttpResponseDecoderSpec decoder = new HttpResponseDecoderSpec ( ) ; decoder . initialBufferSize = initialBufferSize ; decoder . maxChunkSize = maxChunkSize ; decoder . maxHeaderSize = maxHeaderSize ; decoder . maxInitialLineLength = maxInitialLineLength ; decoder . validateHeaders = validateHeaders ; decoder . failOnMissingResponse = failOnMissingResponse ; decoder . parseHttpAfterConnectRequest = parseHttpAfterConnectRequest ; return tcp -> tcp . bootstrap ( b -> HttpClientConfiguration . decoder ( b , decoder ) ) ;
public class URLDecoder { /** * Decodes a { @ code application / x - www - form - urlencoded } string using a specific * encoding scheme . * The supplied encoding is used to determine * what characters are represented by any consecutive sequences of the * form " < i > { @ code % xy } < / i > " . * < em > < strong > Note : < / strong > The < a href = * " http : / / www . w3 . org / TR / html40 / appendix / notes . html # non - ascii - chars " > * World Wide Web Consortium Recommendation < / a > states that * UTF - 8 should be used . Not doing so may introduce * incompatibilities . < / em > * @ param s the { @ code String } to decode * @ param enc The name of a supported * < a href = " . . / lang / package - summary . html # charenc " > character * encoding < / a > . * @ return the newly decoded { @ code String } * @ exception UnsupportedEncodingException * If character encoding needs to be consulted , but * named character encoding is not supported * @ see URLEncoder # encode ( java . lang . String , java . lang . String ) * @ since 1.4 */ public static String decode ( String s , String enc ) throws UnsupportedEncodingException { } }
boolean needToChange = false ; int numChars = s . length ( ) ; StringBuffer sb = new StringBuffer ( numChars > 500 ? numChars / 2 : numChars ) ; int i = 0 ; if ( enc . length ( ) == 0 ) { throw new UnsupportedEncodingException ( "URLDecoder: empty string enc parameter" ) ; } char c ; byte [ ] bytes = null ; while ( i < numChars ) { c = s . charAt ( i ) ; switch ( c ) { case '+' : sb . append ( ' ' ) ; i ++ ; needToChange = true ; break ; case '%' : /* * Starting with this instance of % , process all * consecutive substrings of the form % xy . Each * substring % xy will yield a byte . Convert all * consecutive bytes obtained this way to whatever * character ( s ) they represent in the provided * encoding . */ try { // ( numChars - i ) / 3 is an upper bound for the number // of remaining bytes if ( bytes == null ) bytes = new byte [ ( numChars - i ) / 3 ] ; int pos = 0 ; while ( ( ( i + 2 ) < numChars ) && ( c == '%' ) ) { // BEGIN Android - changed if ( ! isValidHexChar ( s . charAt ( i + 1 ) ) || ! isValidHexChar ( s . charAt ( i + 2 ) ) ) { throw new IllegalArgumentException ( "URLDecoder: Illegal hex characters in escape (%) pattern : " + s . substring ( i , i + 3 ) ) ; } // END Android - changed int v = Integer . parseInt ( s . substring ( i + 1 , i + 3 ) , 16 ) ; if ( v < 0 ) throw new IllegalArgumentException ( "URLDecoder: Illegal hex characters in escape (%) pattern - negative value : " + s . substring ( i , i + 3 ) ) ; bytes [ pos ++ ] = ( byte ) v ; i += 3 ; if ( i < numChars ) c = s . charAt ( i ) ; } // A trailing , incomplete byte encoding such as // " % x " will cause an exception to be thrown if ( ( i < numChars ) && ( c == '%' ) ) throw new IllegalArgumentException ( "URLDecoder: Incomplete trailing escape (%) pattern" ) ; sb . append ( new String ( bytes , 0 , pos , enc ) ) ; } catch ( NumberFormatException e ) { throw new IllegalArgumentException ( "URLDecoder: Illegal hex characters in escape (%) pattern - " + e . getMessage ( ) ) ; } needToChange = true ; break ; default : sb . append ( c ) ; i ++ ; break ; } } return ( needToChange ? sb . toString ( ) : s ) ;
public class Strings { /** * Unquotes text and unescapes non surrounding quotes . { @ code String . replace ( ) } is a bit too * inefficient ( see JAVA - 67 , JAVA - 1262 ) . * @ param text The text * @ param quoteChar The character to use as a quote . * @ return The text with surrounding quotes removed and non surrounding quotes unescaped ( i . e . ' ' * becomes ' ) */ private static String unquote ( String text , char quoteChar ) { } }
if ( ! isQuoted ( text , quoteChar ) ) return text ; if ( text . length ( ) == 2 ) return "" ; String search = emptyQuoted ( quoteChar ) ; int nbMatch = 0 ; int start = - 1 ; do { start = text . indexOf ( search , start + 2 ) ; // ignore the second to last character occurrence , as the last character is a quote . if ( start != - 1 && start != text . length ( ) - 2 ) ++ nbMatch ; } while ( start != - 1 ) ; // no escaped quotes found , simply remove surrounding quotes and return . if ( nbMatch == 0 ) return text . substring ( 1 , text . length ( ) - 1 ) ; // length of the new string will be its current length - the number of occurrences . int newLength = text . length ( ) - nbMatch - 2 ; char [ ] result = new char [ newLength ] ; int newIdx = 0 ; // track whenever a quoteChar is encountered and the previous character is not a quoteChar . boolean firstFound = false ; for ( int i = 1 ; i < text . length ( ) - 1 ; i ++ ) { char c = text . charAt ( i ) ; if ( c == quoteChar ) { if ( firstFound ) { // The previous character was a quoteChar , don ' t add this to result , this action in // effect removes consecutive quotes . firstFound = false ; } else { // found a quoteChar and the previous character was not a quoteChar , include in result . firstFound = true ; result [ newIdx ++ ] = c ; } } else { // non quoteChar encountered , include in result . result [ newIdx ++ ] = c ; firstFound = false ; } } return new String ( result ) ;
public class UNode { /** * Create a new MAP node with the given name and tag name add it as a child of this * node . This node must be a MAP or ARRAY . This is a convenience method that calls * { @ link UNode # createMapNode ( String , String ) } and then { @ link # addChildNode ( UNode ) } . * @ param name Name of new MAP node . * @ param tagName Tag name of new MAP node ( for XML ) . * @ return New MAP node , added as a child of this node . */ public UNode addMapNode ( String name , String tagName ) { } }
return addChildNode ( UNode . createMapNode ( name , tagName ) ) ;
public class ItemStream { /** * Find the item that has been known to the stream for longest . The item returned * may be in any of the states defined in the state model . The caller should not * assume that the item can be used for any particular purpose . * @ return Item may be null . * @ throws { @ link MessageStoreException } if the item was spilled and could not * be unspilled . Or if item not found in backing store . */ public final Item findOldestItem ( ) throws MessageStoreException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "findOldestItem" ) ; ItemCollection ic = ( ( ItemCollection ) _getMembership ( ) ) ; if ( null == ic ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "findOldestItem" ) ; throw new NotInMessageStore ( ) ; } Item item = null ; if ( ic != null ) { item = ( Item ) ic . findOldestItem ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "findOldestItem" , item ) ; return item ;
public class WebSecurityScannerClient { /** * Deletes an existing ScanConfig and its child resources . * < p > Sample code : * < pre > < code > * try ( WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient . create ( ) ) { * ScanConfigName name = ScanConfigName . of ( " [ PROJECT ] " , " [ SCAN _ CONFIG ] " ) ; * webSecurityScannerClient . deleteScanConfig ( name . toString ( ) ) ; * < / code > < / pre > * @ param name Required . The resource name of the ScanConfig to be deleted . The name follows the * format of ' projects / { projectId } / scanConfigs / { scanConfigId } ' . * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ public final void deleteScanConfig ( String name ) { } }
DeleteScanConfigRequest request = DeleteScanConfigRequest . newBuilder ( ) . setName ( name ) . build ( ) ; deleteScanConfig ( request ) ;
public class StreamGraph { /** * Adds a new virtual node that is used to connect a downstream vertex to an input with a * certain partitioning . * < p > When adding an edge from the virtual node to a downstream node the connection will be made * to the original node , but with the partitioning given here . * @ param originalId ID of the node that should be connected to . * @ param virtualId ID of the virtual node . * @ param partitioner The partitioner */ public void addVirtualPartitionNode ( Integer originalId , Integer virtualId , StreamPartitioner < ? > partitioner ) { } }
if ( virtualPartitionNodes . containsKey ( virtualId ) ) { throw new IllegalStateException ( "Already has virtual partition node with id " + virtualId ) ; } virtualPartitionNodes . put ( virtualId , new Tuple2 < Integer , StreamPartitioner < ? > > ( originalId , partitioner ) ) ;
public class HostAccessManager { /** * Update the access mode for a user or group . * If the host is in lockdown mode , this operation is allowed only on users in the exceptions list - see * { @ link com . vmware . vim25 . mo . HostAccessManager # queryLockdownExceptions QueryLockdownExceptions } , and trying to * change the access mode of other users or groups will fail with SecurityError . * @ param principal The affected user or group . * @ param isGroup True if principal refers to a group account , false otherwise . * @ param accessMode AccessMode to be granted . AccessMode # accessOther is meaningless and will result in InvalidArgument exception . * @ throws AuthMinimumAdminPermission * @ throws InvalidArgument * @ throws RuntimeFault * @ throws SecurityError * @ throws UserNotFound * @ throws RemoteException */ public void changeAccessMode ( String principal , boolean isGroup , HostAccessMode accessMode ) throws AuthMinimumAdminPermission , InvalidArgument , RuntimeFault , SecurityError , UserNotFound , RemoteException { } }
getVimService ( ) . changeAccessMode ( getMOR ( ) , principal , isGroup , accessMode ) ;
public class PerformanceTarget { /** * Gets the volumeGoalType value for this PerformanceTarget . * @ return volumeGoalType * The volume goal of the performance target . This property defines * the way stats data will be * reported for the time period specified . * < span class = " constraint Selectable " > This field can * be selected using the value " VolumeGoalType " . < / span > < span class = " constraint * Filterable " > This field can be filtered on . < / span > * < span class = " constraint Required " > This field is required * and should not be { @ code null } when it is contained within { @ link * Operator } s : ADD . < / span > */ public com . google . api . ads . adwords . axis . v201809 . cm . VolumeGoalType getVolumeGoalType ( ) { } }
return volumeGoalType ;
public class MvcGraph { /** * Register { @ link Provider . DereferenceListener } which will be called when the provider * @ param onProviderFreedListener The listener */ public void registerDereferencedListener ( final Provider . DereferenceListener onProviderFreedListener ) { } }
if ( uiThreadRunner . isOnUiThread ( ) ) { graph . registerDereferencedListener ( onProviderFreedListener ) ; } else { uiThreadRunner . post ( new Runnable ( ) { @ Override public void run ( ) { graph . registerDereferencedListener ( onProviderFreedListener ) ; } } ) ; }
public class ScriptPattern { /** * Returns whether this script is using OP _ RETURN to store arbitrary data . */ public static boolean isOpReturn ( Script script ) { } }
List < ScriptChunk > chunks = script . chunks ; return chunks . size ( ) > 0 && chunks . get ( 0 ) . equalsOpCode ( ScriptOpCodes . OP_RETURN ) ;
public class ListDeploymentInstancesRequest { /** * The set of instances in a blue / green deployment , either those in the original environment ( " BLUE " ) or those in * the replacement environment ( " GREEN " ) , for which you want to view instance information . * @ param instanceTypeFilter * The set of instances in a blue / green deployment , either those in the original environment ( " BLUE " ) or * those in the replacement environment ( " GREEN " ) , for which you want to view instance information . * @ see InstanceType */ public void setInstanceTypeFilter ( java . util . Collection < String > instanceTypeFilter ) { } }
if ( instanceTypeFilter == null ) { this . instanceTypeFilter = null ; return ; } this . instanceTypeFilter = new com . amazonaws . internal . SdkInternalList < String > ( instanceTypeFilter ) ;
public class HttpSessionsParam { /** * Sets the default tokens . * @ param tokens the new default tokens */ public void setDefaultTokens ( final List < HttpSessionToken > tokens ) { } }
this . defaultTokens = tokens ; saveDefaultTokens ( ) ; this . defaultTokensEnabled = defaultTokens . stream ( ) . filter ( HttpSessionToken :: isEnabled ) . map ( HttpSessionToken :: getName ) . collect ( Collectors . toList ( ) ) ;
public class AtomicMapLookup { /** * Removes the atomic map associated with the given key from the underlying cache . * @ param cache underlying cache * @ param key key under which the atomic map exists * @ param < MK > key param of the cache */ public static < MK > void removeAtomicMap ( Cache < MK , ? > cache , MK key ) { } }
// This removes any entry from the cache but includes special handling for fine - grained maps FineGrainedAtomicMapProxyImpl . removeMap ( ( Cache < Object , Object > ) cache , key ) ;
public class PropertyTypeRegistry { /** * Add built - in property types . */ private void init ( ) { } }
add ( "text" , PropertySerializer . STRING , PropertyEditorText . class ) ; add ( "color" , PropertySerializer . STRING , PropertyEditorColor . class ) ; add ( "choice" , PropertySerializer . STRING , PropertyEditorChoiceList . class ) ; add ( "action" , PropertySerializer . STRING , PropertyEditorAction . class ) ; add ( "icon" , PropertySerializer . STRING , PropertyEditorIcon . class ) ; add ( "integer" , PropertySerializer . INTEGER , PropertyEditorInteger . class ) ; add ( "double" , PropertySerializer . DOUBLE , PropertyEditorDouble . class ) ; add ( "boolean" , PropertySerializer . BOOLEAN , PropertyEditorBoolean . class ) ; add ( "date" , PropertySerializer . DATE , PropertyEditorDate . class ) ;
public class mps_ssl_certkey { /** * < pre > * Performs generic data validation for the operation to be performed * < / pre > */ protected void validate ( String operationType ) throws Exception { } }
super . validate ( operationType ) ; MPSString ssl_certificate_validator = new MPSString ( ) ; ssl_certificate_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 128 ) ; ssl_certificate_validator . setConstraintMinStrLen ( MPSConstants . GENERIC_CONSTRAINT , 1 ) ; ssl_certificate_validator . setConstraintIsReq ( MPSConstants . ADD_CONSTRAINT , true ) ; ssl_certificate_validator . setConstraintIsReq ( MPSConstants . MODIFY_CONSTRAINT , true ) ; ssl_certificate_validator . validate ( operationType , ssl_certificate , "\"ssl_certificate\"" ) ; MPSString ssl_key_validator = new MPSString ( ) ; ssl_key_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 128 ) ; ssl_key_validator . setConstraintMinStrLen ( MPSConstants . GENERIC_CONSTRAINT , 1 ) ; ssl_key_validator . validate ( operationType , ssl_key , "\"ssl_key\"" ) ; MPSString password_validator = new MPSString ( ) ; password_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 32 ) ; password_validator . validate ( operationType , password , "\"password\"" ) ; MPSBoolean reboot_validator = new MPSBoolean ( ) ; reboot_validator . validate ( operationType , reboot , "\"reboot\"" ) ; MPSString cert_format_validator = new MPSString ( ) ; cert_format_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 64 ) ; cert_format_validator . validate ( operationType , cert_format , "\"cert_format\"" ) ; MPSInt days_to_expiry_validator = new MPSInt ( ) ; days_to_expiry_validator . setConstraintMinValue ( MPSConstants . GENERIC_CONSTRAINT , 0 ) ; days_to_expiry_validator . validate ( operationType , days_to_expiry , "\"days_to_expiry\"" ) ; MPSString status_validator = new MPSString ( ) ; status_validator . validate ( operationType , status , "\"status\"" ) ; MPSString version_validator = new MPSString ( ) ; version_validator . validate ( operationType , version , "\"version\"" ) ; MPSInt serial_number_validator = new MPSInt ( ) ; serial_number_validator . validate ( operationType , serial_number , "\"serial_number\"" ) ; MPSString signature_algorithm_validator = new MPSString ( ) ; signature_algorithm_validator . validate ( operationType , signature_algorithm , "\"signature_algorithm\"" ) ; MPSString issuer_validator = new MPSString ( ) ; issuer_validator . validate ( operationType , issuer , "\"issuer\"" ) ; MPSString valid_from_validator = new MPSString ( ) ; valid_from_validator . validate ( operationType , valid_from , "\"valid_from\"" ) ; MPSString valid_to_validator = new MPSString ( ) ; valid_to_validator . validate ( operationType , valid_to , "\"valid_to\"" ) ; MPSString subject_validator = new MPSString ( ) ; subject_validator . validate ( operationType , subject , "\"subject\"" ) ; MPSString public_key_algorithm_validator = new MPSString ( ) ; public_key_algorithm_validator . validate ( operationType , public_key_algorithm , "\"public_key_algorithm\"" ) ; MPSInt public_key_size_validator = new MPSInt ( ) ; public_key_size_validator . validate ( operationType , public_key_size , "\"public_key_size\"" ) ;
public class CacheableWorkspaceDataManager { /** * { @ inheritDoc } */ @ Override public List < PropertyData > listChildPropertiesData ( NodeData nodeData ) throws RepositoryException { } }
return listChildPropertiesData ( nodeData , false ) ;
public class EmailExtensions { /** * Creates an Address from the given the address and personal name . * @ param address * The address in RFC822 format . * @ param personal * The personal name . * @ param charset * MIME charset to be used to encode the name as per RFC 2047. * @ return The created InternetAddress - object from the given address and personal name . * @ throws AddressException * is thrown if the parse failed * @ throws UnsupportedEncodingException * is thrown if the encoding not supported */ public static Address newAddress ( final String address , String personal , final String charset ) throws AddressException , UnsupportedEncodingException { } }
if ( personal . isNullOrEmpty ( ) ) { personal = address ; } final InternetAddress internetAdress = new InternetAddress ( address ) ; if ( charset . isNullOrEmpty ( ) ) { internetAdress . setPersonal ( personal ) ; } else { internetAdress . setPersonal ( personal , charset ) ; } return internetAdress ;
public class FileUtils { /** * Copia el contenido de un fichero a otro en caso de error lanza una excepcion . * @ param source * @ param dest * @ throws IOException */ public static void append ( File source , File dest ) throws IOException { } }
try { FileInputStream in = new FileInputStream ( source ) ; RandomAccessFile out = new RandomAccessFile ( dest , "rwd" ) ; try { FileChannel canalFuente = in . getChannel ( ) ; FileChannel canalDestino = out . getChannel ( ) ; long count = canalDestino . transferFrom ( canalFuente , canalDestino . size ( ) , canalFuente . size ( ) ) ; canalDestino . force ( true ) ; } catch ( IOException e ) { throw new IOException ( "copiando ficheros orig:'" + source . getAbsolutePath ( ) + "' destino:'" + dest . getAbsolutePath ( ) + "'" , e ) ; } finally { IOUtils . closeQuietly ( in ) ; out . close ( ) ; } } catch ( FileNotFoundException e ) { throw new IOException ( "copiando ficheros orig:'" + source . getAbsolutePath ( ) + "' destino:'" + dest . getAbsolutePath ( ) + "'" , e ) ; }
public class Environment { /** * Replaces any previously set module directories with the collection of module directories . * The default module directory will < i > NOT < / i > be used if this method is invoked . * @ param moduleDirs the collection of module directories to use * @ throws java . lang . IllegalArgumentException if any of the module paths are invalid or { @ code null } */ public void setModuleDirs ( final Iterable < String > moduleDirs ) { } }
this . modulesDirs . clear ( ) ; // Process each module directory for ( String path : moduleDirs ) { addModuleDir ( path ) ; } addDefaultModuleDir = false ;
public class FieldProcessorRegistry { /** * アノテーションに対する { @ link FieldProcessor } を取得する 。 * @ param annoClass 取得対象のアノテーションのクラスタイプ 。 * @ return 見つからない場合はnullを返す 。 * @ throws NullPointerException { @ literal annoClass } */ @ SuppressWarnings ( "unchecked" ) public < A extends Annotation > FieldProcessor < A > getProcessor ( final Class < A > annoClass ) { } }
ArgUtils . notNull ( annoClass , "annoClass" ) ; return ( FieldProcessor < A > ) pocessorMap . get ( annoClass ) ;
public class Uris { /** * Perform am URI query parameter ( name or value ) < strong > escape < / strong > operation * on a { @ code String } input . * This method simply calls the equivalent method in the { @ code UriEscape } class from the * < a href = " http : / / www . unbescape . org " > Unbescape < / a > library . * The following are the only allowed chars in an URI query parameter ( will not be escaped ) : * < ul > * < li > { @ code A - Z a - z 0-9 } < / li > * < li > { @ code - . _ ~ } < / li > * < li > { @ code ! $ ' ( ) * , ; } < / li > * < li > { @ code : @ } < / li > * < li > { @ code / ? } < / li > * < / ul > * All other chars will be escaped by converting them to the sequence of bytes that * represents them in the specified < em > encoding < / em > and then representing each byte * in { @ code % HH } syntax , being { @ code HH } the hexadecimal representation of the byte . * This method is < strong > thread - safe < / strong > . * @ param text the { @ code String } to be escaped . * @ param encoding the encoding to be used for escaping . * @ return The escaped result { @ code String } . As a memory - performance improvement , will return the exact * same object as the { @ code text } input argument if no escaping modifications were required ( and * no additional { @ code String } objects will be created during processing ) . Will * return { @ code null } if { @ code text } is { @ code null } . */ public String escapeQueryParam ( final String text , final String encoding ) { } }
return UriEscape . escapeUriQueryParam ( text , encoding ) ;
public class CathFactory { /** * Returns a CATH database of the specified version . * @ param version For example , " 3.5.0" */ public static CathDatabase getCathDatabase ( String version ) { } }
if ( version == null ) version = DEFAULT_VERSION ; CathDatabase cath = versions . get ( version ) ; if ( cath == null ) { CathInstallation newCath = new CathInstallation ( ) ; newCath . setCathVersion ( version ) ; cath = newCath ; } return cath ;
public class HelpCommand { /** * Get a format string for a help line . * This creates a string formattable to two columns , where the column * widths are dictated by the column width ( calculated above as max * command name / description sizes ) . The columns are separated by two tabs * with a colon in the middle . * @ param commandName The command name . * @ param description The command description . * @ param nameColWidth The column width for the name column . * @ param descColWidth The column width for the description column . * @ return */ private String getOutputString ( String commandName , String description , int nameColWidth , int descColWidth ) { } }
return new StringBuilder ( ) . append ( "%1$-" ) . append ( nameColWidth ) . append ( "s\t:\t%2$-" ) . append ( descColWidth ) . append ( "s" ) . toString ( ) ;
public class RegionOperationClient { /** * Deletes the specified region - specific Operations resource . * < p > Sample code : * < pre > < code > * try ( RegionOperationClient regionOperationClient = RegionOperationClient . create ( ) ) { * ProjectRegionOperationName operation = ProjectRegionOperationName . of ( " [ PROJECT ] " , " [ REGION ] " , " [ OPERATION ] " ) ; * regionOperationClient . deleteRegionOperation ( operation ) ; * < / code > < / pre > * @ param operation Name of the Operations resource to delete . * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ @ BetaApi public final void deleteRegionOperation ( ProjectRegionOperationName operation ) { } }
DeleteRegionOperationHttpRequest request = DeleteRegionOperationHttpRequest . newBuilder ( ) . setOperation ( operation == null ? null : operation . toString ( ) ) . build ( ) ; deleteRegionOperation ( request ) ;
public class DVWordsiMain { /** * Adds { @ link DependencyFileDocumentIterator } s for each file name provided . */ protected void addDocIterators ( Collection < Iterator < Document > > docIters , String [ ] fileNames ) throws IOException { } }
// All the documents are listed in one file , with one document per line for ( String s : fileNames ) docIters . add ( new DependencyFileDocumentIterator ( s ) ) ;
public class SequenceMixin { /** * For the given { @ link Sequence } this will return a { @ link List } filled with * the Compounds of that { @ link Sequence } . */ public static < C extends Compound > List < C > toList ( Sequence < C > sequence ) { } }
List < C > list = new ArrayList < C > ( sequence . getLength ( ) ) ; for ( C compound : sequence ) { list . add ( compound ) ; } return list ;
public class FNCImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setFNNDCnt ( Integer newFNNDCnt ) { } }
Integer oldFNNDCnt = fnndCnt ; fnndCnt = newFNNDCnt ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . FNC__FNND_CNT , oldFNNDCnt , fnndCnt ) ) ;
public class Capacitor { /** * Put an array of data into Capacitor * @ param array * @ param offset * @ param length */ public void put ( byte [ ] array , int offset , int length ) { } }
if ( curr == null || curr . remaining ( ) == 0 ) { curr = ringGet ( ) ; bbs . add ( curr ) ; } int len ; while ( length > 0 ) { if ( ( len = curr . remaining ( ) ) > length ) { curr . put ( array , offset , length ) ; length = 0 ; } else { // System . out . println ( new String ( array ) ) ; curr . put ( array , offset , len ) ; length -= len ; offset += len ; curr = ringGet ( ) ; bbs . add ( curr ) ; } }
public class JmsJcaManagedConnection { /** * Called by a session to indicate that it has been closed . Removes the * session from the set held by this managed connection and notifies the * connection event listeners ( which includes the connection manager ) . * @ param session * the session that has been closed */ final void sessionClosed ( final JmsJcaSessionImpl session ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , "sessionClosed" , session ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( this , TRACE , "Sending connection closed events to the " + _connectionListeners . size ( ) + " listeners" ) ; } final ConnectionEvent event = new ConnectionEvent ( this , ConnectionEvent . CONNECTION_CLOSED ) ; event . setConnectionHandle ( session ) ; // Copy list to protect against concurrent modification by listener final List < ConnectionEventListener > copy ; synchronized ( _connectionListeners ) { copy = new ArrayList < ConnectionEventListener > ( _connectionListeners ) ; } for ( final Iterator iterator = copy . iterator ( ) ; iterator . hasNext ( ) ; ) { final Object object = iterator . next ( ) ; if ( object instanceof ConnectionEventListener ) { ( ( ConnectionEventListener ) object ) . connectionClosed ( event ) ; } } _sessions . remove ( session ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , "sessionClosed" ) ; }
public class QueryEngine { /** * inserts a record with a time to live . If the record exists , and exception will be thrown . * @ param namespace Namespace to store the record * @ param set Set to store the record * @ param key Key of the record * @ param bins A list of Bins to insert * @ param ttl The record time to live in seconds */ public void insert ( String namespace , String set , Key key , List < Bin > bins , int ttl ) { } }
this . client . put ( this . insertPolicy , key , bins . toArray ( new Bin [ 0 ] ) ) ;
public class Counters { /** * Removes all entries from c except for the top < code > num < / code > */ public static < E > void retainTop ( Counter < E > c , int num ) { } }
int numToPurge = c . size ( ) - num ; if ( numToPurge <= 0 ) { return ; } List < E > l = Counters . toSortedList ( c ) ; Collections . reverse ( l ) ; for ( int i = 0 ; i < numToPurge ; i ++ ) { c . remove ( l . get ( i ) ) ; }
public class HttpResponse { /** * Returns the CRC32 checksum calculated by the underlying CRC32ChecksumCalculatingInputStream . * @ return The CRC32 checksum . */ public long getCRC32Checksum ( ) { } }
if ( context == null ) { return 0L ; } CRC32ChecksumCalculatingInputStream crc32ChecksumInputStream = ( CRC32ChecksumCalculatingInputStream ) context . getAttribute ( CRC32ChecksumCalculatingInputStream . class . getName ( ) ) ; return crc32ChecksumInputStream == null ? 0L : crc32ChecksumInputStream . getCRC32Checksum ( ) ;
public class DescribeCacheClustersResult { /** * A list of clusters . Each item in the list contains detailed information about one cluster . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setCacheClusters ( java . util . Collection ) } or { @ link # withCacheClusters ( java . util . Collection ) } if you want * to override the existing values . * @ param cacheClusters * A list of clusters . Each item in the list contains detailed information about one cluster . * @ return Returns a reference to this object so that method calls can be chained together . */ public DescribeCacheClustersResult withCacheClusters ( CacheCluster ... cacheClusters ) { } }
if ( this . cacheClusters == null ) { setCacheClusters ( new com . amazonaws . internal . SdkInternalList < CacheCluster > ( cacheClusters . length ) ) ; } for ( CacheCluster ele : cacheClusters ) { this . cacheClusters . add ( ele ) ; } return this ;
public class OrmElf { /** * Gets the column name defined for the given property for the given type . * @ param clazz The type . * @ param propertyName The object property name . * @ return The database column name . */ public static String getColumnFromProperty ( Class < ? > clazz , String propertyName ) { } }
return Introspector . getIntrospected ( clazz ) . getColumnNameForProperty ( propertyName ) ;
public class AdHocBase { /** * Call from derived class run ( ) method for implementation . * @ param ctx * @ param aggregatorFragments * @ param collectorFragments * @ param sqlStatements * @ param replicatedTableDMLFlags * @ return */ public VoltTable [ ] runAdHoc ( SystemProcedureExecutionContext ctx , byte [ ] serializedBatchData ) { } }
Pair < Object [ ] , AdHocPlannedStatement [ ] > data = decodeSerializedBatchData ( serializedBatchData ) ; Object [ ] userparams = data . getFirst ( ) ; AdHocPlannedStatement [ ] statements = data . getSecond ( ) ; if ( statements . length == 0 ) { return new VoltTable [ ] { } ; } for ( AdHocPlannedStatement statement : statements ) { if ( ! statement . core . wasPlannedAgainstHash ( ctx . getCatalogHash ( ) ) ) { @ SuppressWarnings ( "deprecation" ) String msg = String . format ( "AdHoc transaction %d wasn't planned " + "against the current catalog version. Statement: %s" , DeprecatedProcedureAPIAccess . getVoltPrivateRealTransactionId ( this ) , new String ( statement . sql , Constants . UTF8ENCODING ) ) ; throw new VoltAbortException ( msg ) ; } // Don ' t cache the statement text , since ad hoc statements // that differ only by constants reuse the same plan , statement text may change . long aggFragId = ActivePlanRepository . loadOrAddRefPlanFragment ( statement . core . aggregatorHash , statement . core . aggregatorFragment , null ) ; long collectorFragId = 0 ; if ( statement . core . collectorFragment != null ) { collectorFragId = ActivePlanRepository . loadOrAddRefPlanFragment ( statement . core . collectorHash , statement . core . collectorFragment , null ) ; } SQLStmt stmt = SQLStmtAdHocHelper . createWithPlan ( statement . sql , aggFragId , statement . core . aggregatorHash , true , collectorFragId , statement . core . collectorHash , true , statement . core . isReplicatedTableDML , statement . core . readOnly , statement . core . parameterTypes , m_site ) ; Object [ ] params = paramsForStatement ( statement , userparams ) ; voltQueueSQL ( stmt , params ) ; } return voltExecuteSQL ( true ) ;
public class Cookies { /** * Adds all cookies by actually cloning them . */ public void addAllCloned ( List < Cookie > cookies ) { } }
for ( Cookie cookie : cookies ) { Cookie clone = new Cookie ( cookie ) ; getStore ( ) . addCookie ( clone . getHttpCookie ( ) ) ; }
public class Calendars { /** * Wraps a component in a calendar . * @ param component the component to wrap with a calendar * @ return a calendar containing the specified component */ public static Calendar wrap ( final CalendarComponent ... component ) { } }
final ComponentList < CalendarComponent > components = new ComponentList < > ( Arrays . asList ( component ) ) ; return new Calendar ( components ) ;
public class ConnectionFactory { /** * Cleans up resources and unloads any registered database drivers . This * needs to be called to ensure the driver is unregistered prior to the * finalize method being called as during shutdown the class loader used to * load the driver may be unloaded prior to the driver being de - registered . */ public synchronized void cleanup ( ) { } }
if ( driver != null ) { DriverLoader . cleanup ( driver ) ; driver = null ; } connectionString = null ; userName = null ; password = null ;
public class CRFClassifier { @ Override public synchronized List < Pair < String , Double > > predict ( SequenceTuple sequenceTuple ) { } }
if ( tagger == null ) { loadModel ( null ) ; } List < Pair < String , Double > > taggedSentences = new ArrayList < > ( ) ; tagger . set ( getXseqForOneSeqTuple ( sequenceTuple ) ) ; StringList labels = tagger . viterbi ( ) ; for ( int i = 0 ; i < labels . size ( ) ; i ++ ) { String label = labels . get ( i ) ; taggedSentences . add ( new ImmutablePair < > ( label , tagger . marginal ( label , i ) ) ) ; } return taggedSentences ;
public class BooleanParameterTypeImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setValue ( boolean newValue ) { } }
boolean oldValue = value ; value = newValue ; boolean oldValueESet = valueESet ; valueESet = true ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , BpsimPackage . BOOLEAN_PARAMETER_TYPE__VALUE , oldValue , value , ! oldValueESet ) ) ;
public class CartItemUrl { /** * Get Resource Url for RemoveAllCartItems * @ return String Resource Url */ public static MozuUrl removeAllCartItemsUrl ( ) { } }
UrlFormatter formatter = new UrlFormatter ( "/api/commerce/carts/current/items" ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ;
public class BitmapLruPool { /** * Return the byte usage per pixel of a bitmap based on its configuration . * @ param config The bitmap configuration . * @ return The byte usage per pixel . */ protected static int getBytesPerPixel ( Bitmap . Config config ) { } }
if ( config == Bitmap . Config . ARGB_8888 ) { return 4 ; } else if ( config == Bitmap . Config . RGB_565 ) { return 2 ; } else if ( config == Bitmap . Config . ARGB_4444 ) { return 2 ; } else if ( config == Bitmap . Config . ALPHA_8 ) { return 1 ; } return 1 ;
public class DeviceSelectionConfigurationMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeviceSelectionConfiguration deviceSelectionConfiguration , ProtocolMarshaller protocolMarshaller ) { } }
if ( deviceSelectionConfiguration == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deviceSelectionConfiguration . getFilters ( ) , FILTERS_BINDING ) ; protocolMarshaller . marshall ( deviceSelectionConfiguration . getMaxDevices ( ) , MAXDEVICES_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class DOMDifferenceEngine { /** * Matches nodes of two node lists and invokes compareNode on each pair . * < p > Also performs CHILD _ LOOKUP comparisons for each node that * couldn ' t be matched to one of the " other " list . < / p > */ private ComparisonState compareNodeLists ( Iterable < Node > controlSeq , final XPathContext controlContext , Iterable < Node > testSeq , final XPathContext testContext ) { } }
ComparisonState chain = new OngoingComparisonState ( ) ; Iterable < Map . Entry < Node , Node > > matches = getNodeMatcher ( ) . match ( controlSeq , testSeq ) ; List < Node > controlList = Linqy . asList ( controlSeq ) ; List < Node > testList = Linqy . asList ( testSeq ) ; Set < Node > seen = new HashSet < Node > ( ) ; for ( Map . Entry < Node , Node > pair : matches ) { final Node control = pair . getKey ( ) ; seen . add ( control ) ; final Node test = pair . getValue ( ) ; seen . add ( test ) ; int controlIndex = controlList . indexOf ( control ) ; int testIndex = testList . indexOf ( test ) ; controlContext . navigateToChild ( controlIndex ) ; testContext . navigateToChild ( testIndex ) ; try { chain = chain . andThen ( new Comparison ( ComparisonType . CHILD_NODELIST_SEQUENCE , control , getXPath ( controlContext ) , Integer . valueOf ( controlIndex ) , getParentXPath ( controlContext ) , test , getXPath ( testContext ) , Integer . valueOf ( testIndex ) , getParentXPath ( testContext ) ) ) . andThen ( new DeferredComparison ( ) { @ Override public ComparisonState apply ( ) { return compareNodes ( control , controlContext , test , testContext ) ; } } ) ; } finally { testContext . navigateToParent ( ) ; controlContext . navigateToParent ( ) ; } } return chain . andThen ( new UnmatchedControlNodes ( controlList , controlContext , seen , testContext ) ) . andThen ( new UnmatchedTestNodes ( testList , testContext , seen , controlContext ) ) ;
public class Cell { /** * Sets the minWidth , prefWidth , maxWidth , minHeight , prefHeight , and maxHeight to the specified value . */ public Cell < C , T > size ( Value < C , T > size ) { } }
minWidth = size ; minHeight = size ; prefWidth = size ; prefHeight = size ; maxWidth = size ; maxHeight = size ; return this ;
public class IPv6Address { /** * note this string is used by hashCode */ @ Override public String toNormalizedWildcardString ( ) { } }
String result ; if ( hasNoStringCache ( ) || ( result = stringCache . normalizedWildcardString ) == null ) { if ( hasZone ( ) ) { stringCache . normalizedWildcardString = result = toNormalizedString ( IPv6StringCache . wildcardNormalizedParams ) ; } else { result = getSection ( ) . toNormalizedWildcardString ( ) ; // the cache is shared so no need to update it here } } return result ;
public class Predicate { /** * Returns true if this predicate evaluates to true with respect to the * specified record . * @ param rec * the record * @ return true if the predicate evaluates to true */ public boolean isSatisfied ( Record rec ) { } }
for ( Term t : terms ) if ( ! t . isSatisfied ( rec ) ) return false ; return true ;
public class Wills { /** * Creates chain from provided Wills * @ param wills Wills to be chained * @ param < A > Type of Wills * @ return Chained Will */ public static < A > Will < List < A > > when ( Will < ? extends A > ... wills ) { } }
return when ( asList ( wills ) ) ;
public class CharOperation { /** * Answers the concatenation of the given array parts using the given separator between each part and appending the * given name at the end . < br > * < br > * For example : < br > * < ol > * < li > * < pre > * name = { ' c ' } * array = { { ' a ' } , { ' b ' } } * separator = ' . ' * = & gt ; result = { ' a ' , ' . ' , ' b ' , ' . ' , ' c ' } * < / pre > * < / li > * < li > * < pre > * name = null * array = { { ' a ' } , { ' b ' } } * separator = ' . ' * = & gt ; result = { ' a ' , ' . ' , ' b ' } * < / pre > * < / li > * < li > * < pre > * name = { ' c ' } * array = null * separator = ' . ' * = & gt ; result = { ' c ' } * < / pre > * < / li > * < / ol > * @ param name * the given name * @ param array * the given array * @ param separator * the given separator * @ return the concatenation of the given array parts using the given separator between each part and appending the * given name at the end */ public static final char [ ] concatWith ( char [ ] name , char [ ] [ ] array , char separator ) { } }
int nameLength = name == null ? 0 : name . length ; if ( nameLength == 0 ) { return concatWith ( array , separator ) ; } int length = array == null ? 0 : array . length ; if ( length == 0 ) { return name ; } int size = nameLength ; int index = length ; while ( -- index >= 0 ) { if ( array [ index ] . length > 0 ) { size += array [ index ] . length + 1 ; } } char [ ] result = new char [ size ] ; index = size ; for ( int i = length - 1 ; i >= 0 ; i -- ) { int subLength = array [ i ] . length ; if ( subLength > 0 ) { index -= subLength ; System . arraycopy ( array [ i ] , 0 , result , index , subLength ) ; result [ -- index ] = separator ; } } System . arraycopy ( name , 0 , result , 0 , nameLength ) ; return result ;
public class LineBox { /** * Updates the line box sizes according to a new inline box . * @ param box the new box */ public void considerBox ( Inline box ) { } }
if ( ( ( Box ) box ) . isDisplayed ( ) && ! box . collapsedCompletely ( ) ) { int a = box . getBaselineOffset ( ) ; int b = box . getBelowBaseline ( ) ; if ( box instanceof InlineElement ) { VerticalAlign va = ( ( InlineElement ) box ) . getVerticalAlign ( ) ; if ( va != VerticalAlign . TOP && va != VerticalAlign . BOTTOM ) // the box influences ' a ' and ' b ' { int dif = computeBaselineDifference ( ( InlineElement ) box ) ; a -= dif ; // what from the box is above our baseline b += dif ; // what from the box is below above = Math . max ( above , a ) ; below = Math . max ( below , b ) ; maxAlignedHeight = Math . max ( maxAlignedHeight , box . getMaxLineHeight ( ) ) ; } else if ( va == VerticalAlign . BOTTOM ) heightFromBottom = Math . max ( heightFromBottom , box . getMaxLineHeight ( ) ) ; } else { above = Math . max ( above , a ) ; below = Math . max ( below , b ) ; maxAlignedHeight = Math . max ( maxAlignedHeight , box . getMaxLineHeight ( ) ) ; } maxBoxHeight = Math . max ( maxBoxHeight , box . getMaxLineHeight ( ) ) ; }
public class EscapedFunctions2 { /** * char to chr translation * @ param buf The buffer to append into * @ param parsedArgs arguments * @ throws SQLException if something wrong happens */ public static void sqlchar ( StringBuilder buf , List < ? extends CharSequence > parsedArgs ) throws SQLException { } }
singleArgumentFunctionCall ( buf , "chr(" , "char" , parsedArgs ) ;
public class PosixHelp { /** * Throws IllegalArgumentException if perms length ! = 10 or files type doesn ' t * match with permission . * @ param path * @ param perms */ public static final void checkFileType ( Path path , String perms ) { } }
if ( perms . length ( ) != 10 ) { throw new IllegalArgumentException ( perms + " not permission. E.g. -rwxr--r--" ) ; } switch ( perms . charAt ( 0 ) ) { case '-' : if ( ! Files . isRegularFile ( path ) ) { throw new IllegalArgumentException ( "file is not regular file" ) ; } break ; case 'd' : if ( ! Files . isDirectory ( path ) ) { throw new IllegalArgumentException ( "file is not directory" ) ; } break ; case 'l' : if ( ! Files . isSymbolicLink ( path ) ) { throw new IllegalArgumentException ( "file is not symbolic link" ) ; } break ; default : throw new UnsupportedOperationException ( perms + " not supported" ) ; }
public class ConfigurationAssert { /** * TODO a lot ! */ public static String uiModeTypeToString ( @ ConfigurationUiModeType int mode ) { } }
return buildNamedValueString ( mode ) . value ( UI_MODE_TYPE_NORMAL , "normal" ) . value ( UI_MODE_TYPE_APPLIANCE , "appliance" ) . value ( UI_MODE_TYPE_CAR , "car" ) . value ( UI_MODE_TYPE_DESK , "desk" ) . value ( UI_MODE_TYPE_TELEVISION , "television" ) . value ( UI_MODE_TYPE_UNDEFINED , "undefined" ) . value ( UI_MODE_TYPE_WATCH , "watch" ) . get ( ) ;
public class JPAGenericDAORulesBasedImpl { /** * Méthode d ' ajout de parametres à la requete * @ param queryRequete * @ param parametersMap des parametres */ protected void addQueryParameters ( Query query , Map < String , Object > parameters ) { } }
// Si la MAP est nulle if ( parameters == null || parameters . size ( ) == 0 ) return ; // Parcours for ( Entry < String , Object > entry : parameters . entrySet ( ) ) { // Ajout query . setParameter ( entry . getKey ( ) , entry . getValue ( ) ) ; }
public class SecurityFileMonitor { /** * Registers this file monitor to start monitoring the specified files either by mbean * notification or polling rate . * @ param id of the config element * @ param paths the paths of the files to monitor . * @ param pollingRate the rate to pole he file for a change . * @ param trigger what trigger the file update notification mbean or poll * @ return The < code > FileMonitor < / code > service registration . */ public ServiceRegistration < FileMonitor > monitorFiles ( String ID , Collection < String > paths , long pollingRate , String trigger ) { } }
BundleContext bundleContext = actionable . getBundleContext ( ) ; final Hashtable < String , Object > fileMonitorProps = new Hashtable < String , Object > ( ) ; fileMonitorProps . put ( FileMonitor . MONITOR_FILES , paths ) ; // Adding INTERNAL parameter MONITOR _ IDENTIFICATION _ NAME to identify this monitor . fileMonitorProps . put ( com . ibm . ws . kernel . filemonitor . FileMonitor . MONITOR_IDENTIFICATION_NAME , com . ibm . ws . kernel . filemonitor . FileMonitor . SECURITY_MONITOR_IDENTIFICATION_VALUE ) ; // Adding parameter MONITOR _ IDENTIFICATION _ CONFIG _ ID to identify this monitor by the ID . fileMonitorProps . put ( com . ibm . ws . kernel . filemonitor . FileMonitor . MONITOR_KEYSTORE_CONFIG_ID , ID ) ; if ( ! ( trigger . equalsIgnoreCase ( "disabled" ) ) ) { if ( trigger . equals ( "mbean" ) ) { fileMonitorProps . put ( FileMonitor . MONITOR_TYPE , FileMonitor . MONITOR_TYPE_EXTERNAL ) ; } else { fileMonitorProps . put ( FileMonitor . MONITOR_TYPE , FileMonitor . MONITOR_TYPE_TIMED ) ; fileMonitorProps . put ( FileMonitor . MONITOR_INTERVAL , pollingRate ) ; } } // Don ' t attempt to register the file monitor if the server is stopping if ( FrameworkState . isStopping ( ) ) return null ; return bundleContext . registerService ( FileMonitor . class , this , fileMonitorProps ) ;
public class DescribeConditionalForwardersRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeConditionalForwardersRequest describeConditionalForwardersRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeConditionalForwardersRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeConditionalForwardersRequest . getDirectoryId ( ) , DIRECTORYID_BINDING ) ; protocolMarshaller . marshall ( describeConditionalForwardersRequest . getRemoteDomainNames ( ) , REMOTEDOMAINNAMES_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ResourceLoader { /** * Get the loaded resources . Can be called safely after { @ link # await ( ) } . Else ensure all resources has been loaded . * @ return The loaded resources as read only . * @ throws LionEngineException If resources are not fully loaded . */ public synchronized Map < T , Resource > get ( ) { } }
if ( ! done . get ( ) ) { throw new LionEngineException ( ERROR_NOT_FINISHED ) ; } return Collections . unmodifiableMap ( resources ) ;
public class VisOdomQuadPnP { /** * Computes image features and stores the results in info */ private void describeImage ( T left , ImageInfo < TD > info ) { } }
detector . process ( left ) ; for ( int i = 0 ; i < detector . getNumberOfSets ( ) ; i ++ ) { PointDescSet < TD > set = detector . getFeatureSet ( i ) ; FastQueue < Point2D_F64 > l = info . location [ i ] ; FastQueue < TD > d = info . description [ i ] ; for ( int j = 0 ; j < set . getNumberOfFeatures ( ) ; j ++ ) { l . grow ( ) . set ( set . getLocation ( j ) ) ; d . grow ( ) . setTo ( set . getDescription ( j ) ) ; } }
public class MDAG { /** * Determines if a child node object is accepting . * @ param nodeObj an Object * @ return if { @ code nodeObj } is either an MDAGNode or a SimplifiedMDAGNode , * true if the node is accepting , false otherwise * throws IllegalArgumentException if { @ code nodeObj } is not an MDAGNode or SimplifiedMDAGNode */ private static boolean isAcceptNode ( Object nodeObj ) { } }
if ( nodeObj != null ) { Class nodeObjClass = nodeObj . getClass ( ) ; if ( nodeObjClass . equals ( MDAGNode . class ) ) return ( ( MDAGNode ) nodeObj ) . isAcceptNode ( ) ; else if ( nodeObjClass . equals ( SimpleMDAGNode . class ) ) return ( ( SimpleMDAGNode ) nodeObj ) . isAcceptNode ( ) ; } throw new IllegalArgumentException ( "Argument is not an MDAGNode or SimpleMDAGNode" ) ;
public class InsnList { /** * Replaces an instruction of this list with another instruction . * @ param location * an instruction < i > of this list < / i > . * @ param insn * another instruction , < i > which must not belong to any * { @ link InsnList } < / i > . */ public void set ( final AbstractInsnNode location , final AbstractInsnNode insn ) { } }
AbstractInsnNode next = location . next ; insn . next = next ; if ( next != null ) { next . prev = insn ; } else { last = insn ; } AbstractInsnNode prev = location . prev ; insn . prev = prev ; if ( prev != null ) { prev . next = insn ; } else { first = insn ; } if ( cache != null ) { int index = location . index ; cache [ index ] = insn ; insn . index = index ; } else { insn . index = 0 ; // insn now belongs to an InsnList } location . index = - 1 ; // i no longer belongs to an InsnList location . prev = null ; location . next = null ;
public class SVGPlot { /** * Create a SVG text element . * @ param x first point x * @ param y first point y * @ param text Content of text element . * @ return New text element . */ public Element svgText ( double x , double y , String text ) { } }
return SVGUtil . svgText ( document , x , y , text ) ;
public class MaskFormat { /** * ( non - Javadoc ) * @ see java . text . Format # parseObject ( java . lang . String ) */ public Object parseObject ( String source ) throws ParseException { } }
ParsePosition pos = new ParsePosition ( 0 ) ; Object result = parseObject ( source , pos ) ; if ( pos . getErrorIndex ( ) >= 0 ) { throw new ParseException ( "Format.parseObject(String) failed" , pos . getErrorIndex ( ) ) ; } return result ;
public class ClassUtil { /** * 设置方法为可访问 * @ param method 方法 * @ return 方法 */ public static Method setAccessible ( Method method ) { } }
if ( null != method && false == method . isAccessible ( ) ) { method . setAccessible ( true ) ; } return method ;
public class AnnotationFunctionImportFactory { /** * Returns fully qualified function import name by function import annotation and class . * @ param functionImportAnnotation function import annotation * @ param functionImportClass function import class * @ return fully qualified function import name */ public static String getFullyQualifiedFunctionImportName ( EdmFunctionImport functionImportAnnotation , Class < ? > functionImportClass ) { } }
String name = getTypeName ( functionImportAnnotation , functionImportClass ) ; String namespace = getNamespace ( functionImportAnnotation , functionImportClass ) ; return namespace + "." + name ;
public class SendEmail { /** * On load properties . * @ throws IOException * Signals that an I / O exception has occurred . */ private void loadPropertiesQueitly ( ) { } }
try { properties = PropertiesFileExtensions . loadProperties ( this , EmailConstants . PROPERTIES_FILENAME ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; }
public class AbstractSimpleDAO { /** * Call this method inside the constructor to read the file contents directly . * This method is write locked ! * @ throws DAOException * in case initialization or reading failed ! */ @ MustBeLocked ( ELockType . WRITE ) protected final void initialRead ( ) throws DAOException { } }
File aFile = null ; final String sFilename = m_aFilenameProvider . get ( ) ; if ( sFilename == null ) { // required for testing if ( ! isSilentMode ( ) ) if ( LOGGER . isWarnEnabled ( ) ) LOGGER . warn ( "This DAO of class " + getClass ( ) . getName ( ) + " will not be able to read from a file" ) ; // do not return - run initialization anyway } else { // Check consistency aFile = getSafeFile ( sFilename , EMode . READ ) ; } final File aFinalFile = aFile ; m_aRWLock . writeLockedThrowing ( ( ) -> { final boolean bIsInitialization = aFinalFile == null || ! aFinalFile . exists ( ) ; try { ESuccess eWriteSuccess = ESuccess . SUCCESS ; if ( bIsInitialization ) { // initial setup for non - existing file if ( isDebugLogging ( ) ) if ( LOGGER . isInfoEnabled ( ) ) LOGGER . info ( "Trying to initialize DAO XML file '" + aFinalFile + "'" ) ; beginWithoutAutoSave ( ) ; try { m_aStatsCounterInitTotal . increment ( ) ; final StopWatch aSW = StopWatch . createdStarted ( ) ; if ( onInit ( ) . isChanged ( ) ) if ( aFinalFile != null ) eWriteSuccess = _writeToFile ( ) ; m_aStatsCounterInitTimer . addTime ( aSW . stopAndGetMillis ( ) ) ; m_aStatsCounterInitSuccess . increment ( ) ; m_nInitCount ++ ; m_aLastInitDT = PDTFactory . getCurrentLocalDateTime ( ) ; } finally { endWithoutAutoSave ( ) ; // reset any pending changes , because the initialization should // be read - only . If the implementing class changed something , // the return value of onInit ( ) is what counts internalSetPendingChanges ( false ) ; } } else { // Read existing file if ( isDebugLogging ( ) ) if ( LOGGER . isInfoEnabled ( ) ) LOGGER . info ( "Trying to read DAO XML file '" + aFinalFile + "'" ) ; m_aStatsCounterReadTotal . increment ( ) ; final IMicroDocument aDoc = MicroReader . readMicroXML ( aFinalFile ) ; if ( aDoc == null ) { if ( LOGGER . isErrorEnabled ( ) ) LOGGER . error ( "Failed to read XML document from file '" + aFinalFile + "'" ) ; } else { // Valid XML - start interpreting beginWithoutAutoSave ( ) ; try { final StopWatch aSW = StopWatch . createdStarted ( ) ; if ( onRead ( aDoc ) . isChanged ( ) ) eWriteSuccess = _writeToFile ( ) ; m_aStatsCounterReadTimer . addTime ( aSW . stopAndGetMillis ( ) ) ; m_aStatsCounterReadSuccess . increment ( ) ; m_nReadCount ++ ; m_aLastReadDT = PDTFactory . getCurrentLocalDateTime ( ) ; } finally { endWithoutAutoSave ( ) ; // reset any pending changes , because the initialization should // be read - only . If the implementing class changed something , // the return value of onRead ( ) is what counts internalSetPendingChanges ( false ) ; } } } // Check if writing was successful on any of the 2 branches if ( eWriteSuccess . isSuccess ( ) ) internalSetPendingChanges ( false ) ; else { if ( LOGGER . isWarnEnabled ( ) ) LOGGER . warn ( "File '" + aFinalFile + "' has pending changes after initialRead!" ) ; } } catch ( final Exception ex ) { triggerExceptionHandlersRead ( ex , bIsInitialization , aFinalFile ) ; throw new DAOException ( "Error " + ( bIsInitialization ? "initializing" : "reading" ) + " the file '" + aFinalFile + "'" , ex ) ; } } ) ;
public class QrCode { /** * / * Adds format information to grid . */ private static void addFormatInfo ( byte [ ] grid , int size , EccLevel ecc_level , int pattern ) { } }
int format = pattern ; int seq ; int i ; switch ( ecc_level ) { case L : format += 0x08 ; break ; case Q : format += 0x18 ; break ; case H : format += 0x10 ; break ; } seq = QR_ANNEX_C [ format ] ; for ( i = 0 ; i < 6 ; i ++ ) { grid [ ( i * size ) + 8 ] += ( seq >> i ) & 0x01 ; } for ( i = 0 ; i < 8 ; i ++ ) { grid [ ( 8 * size ) + ( size - i - 1 ) ] += ( seq >> i ) & 0x01 ; } for ( i = 0 ; i < 6 ; i ++ ) { grid [ ( 8 * size ) + ( 5 - i ) ] += ( seq >> ( i + 9 ) ) & 0x01 ; } for ( i = 0 ; i < 7 ; i ++ ) { grid [ ( ( ( size - 7 ) + i ) * size ) + 8 ] += ( seq >> ( i + 8 ) ) & 0x01 ; } grid [ ( 7 * size ) + 8 ] += ( seq >> 6 ) & 0x01 ; grid [ ( 8 * size ) + 8 ] += ( seq >> 7 ) & 0x01 ; grid [ ( 8 * size ) + 7 ] += ( seq >> 8 ) & 0x01 ;
public class RowMaskedMatrix { /** * { @ inheritDoc } */ public void setColumn ( int column , DoubleVector values ) { } }
if ( values . length ( ) != rows ) throw new IllegalArgumentException ( "cannot set a column " + "whose dimensions are different than the matrix" ) ; if ( values instanceof SparseVector ) { SparseVector sv = ( SparseVector ) values ; for ( int nz : sv . getNonZeroIndices ( ) ) backingMatrix . set ( getRealRow ( nz ) , nz , values . get ( nz ) ) ; } else { for ( int i = 0 ; i < rowToReal . length ; ++ i ) backingMatrix . set ( rowToReal [ i ] , i , values . get ( i ) ) ; }
public class CmsCalendarWidget { /** * Creates the HTML JavaScript and stylesheet includes required by the calendar for the head of the page . < p > * @ param locale the locale to use for the calendar * @ param style the name of the used calendar style , e . g . " system " , " blue " * @ return the necessary HTML code for the js and stylesheet includes */ public static String calendarIncludes ( Locale locale , String style ) { } }
StringBuffer result = new StringBuffer ( 512 ) ; String calendarPath = CmsWorkplace . getSkinUri ( ) + "components/js_calendar/" ; if ( CmsStringUtil . isEmpty ( style ) ) { style = "system" ; } result . append ( "<link rel=\"stylesheet\" type=\"text/css\" href=\"" ) ; result . append ( calendarPath ) ; result . append ( "calendar-" ) ; result . append ( style ) ; result . append ( ".css\">\n" ) ; result . append ( "<script type=\"text/javascript\" src=\"" ) ; result . append ( calendarPath ) ; result . append ( "calendar.js\"></script>\n" ) ; result . append ( "<script type=\"text/javascript\" src=\"" ) ; result . append ( calendarPath ) ; result . append ( "lang/calendar-" ) ; result . append ( getLanguageSuffix ( locale . getLanguage ( ) ) ) ; result . append ( ".js\"></script>\n" ) ; result . append ( "<script type=\"text/javascript\" src=\"" ) ; result . append ( calendarPath ) ; result . append ( "calendar-setup.js\"></script>\n" ) ; return result . toString ( ) ;
public class QName { /** * # / string _ id _ map # */ @ Override protected String getInstanceIdName ( int id ) { } }
switch ( id - super . getMaxInstanceId ( ) ) { case Id_localName : return "localName" ; case Id_uri : return "uri" ; } return super . getInstanceIdName ( id ) ;
public class CustomTileSkin { /** * * * * * * Initialization * * * * * */ @ Override protected void initGraphics ( ) { } }
super . initGraphics ( ) ; graphicListener = ( o , ov , nv ) -> { if ( nv != null ) { graphicContainer . getChildren ( ) . setAll ( tile . getGraphic ( ) ) ; } } ; titleText = new Text ( ) ; titleText . setFill ( tile . getTitleColor ( ) ) ; Helper . enableNode ( titleText , ! tile . getTitle ( ) . isEmpty ( ) ) ; text = new Text ( tile . getText ( ) ) ; text . setFill ( tile . getTextColor ( ) ) ; Helper . enableNode ( text , tile . isTextVisible ( ) ) ; graphicContainer = new StackPane ( ) ; graphicContainer . setMinSize ( size * 0.9 , tile . isTextVisible ( ) ? size * 0.72 : size * 0.795 ) ; graphicContainer . setMaxSize ( size * 0.9 , tile . isTextVisible ( ) ? size * 0.72 : size * 0.795 ) ; graphicContainer . setPrefSize ( size * 0.9 , tile . isTextVisible ( ) ? size * 0.72 : size * 0.795 ) ; if ( null != tile . getGraphic ( ) ) graphicContainer . getChildren ( ) . setAll ( tile . getGraphic ( ) ) ; getPane ( ) . getChildren ( ) . addAll ( titleText , graphicContainer , text ) ;
public class SqlLoaderImpl { /** * ファイル読み込み < br > * 以下2種類に対応 * < ol > * < li > キャッシュ時のディレクトリからFileの読み込む場合 < / li > * < li > キャッシュなしで クラスパス内のリソース ( jarファイル内も含む ) を読み込む場合 < / li > * < / ol > * @ param reader リーダ * @ return SQL文を読み込み 文末のSQLコマンド分割文字 ( ; または / ) を除いた文字列を返す * @ throws IOException */ private String read ( final BufferedReader reader ) throws IOException { } }
StringBuilder sqlBuilder = new StringBuilder ( ) ; try { for ( String line : reader . lines ( ) . toArray ( String [ ] :: new ) ) { sqlBuilder . append ( line ) . append ( System . lineSeparator ( ) ) ; } } finally { if ( reader != null ) { reader . close ( ) ; } } return sqlBuilder . toString ( ) ;
public class MapConverter { /** * sub . * @ param data a { @ link java . util . Map } object . * @ param prefix a { @ link java . lang . String } object . * @ return a { @ link java . util . Map } object . */ public Map < String , Object > sub ( Map < String , Object > data , String prefix ) { } }
return sub ( data , prefix , null , true ) ;
public class SibRaListener { /** * Stop the session if it has been requested . It ' s only valid to do this * if * you ' re a thread * which already has the processor AsynchConsumerBusy lock * @ throws SIException */ protected void stopIfRequired ( ) throws SIException { } }
final String methodName = "stopIfRequired" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName , new Object [ ] { this } ) ; } if ( TRACE . isDebugEnabled ( ) ) { SibTr . debug ( TRACE , methodName , "sibPacingSessionStarted: " + sibPacingSessionStarted + "\nmpcPacingSessionStarted: " + mpcPacingSessionStarted + "\nsessionStarted: " + sessionStarted ) ; } if ( ! sibPacingSessionStarted || ! mpcPacingSessionStarted || ! sessionStarted ) { _session . stop ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName ) ; }
public class CommitsApi { /** * Get a Pager of repository commits in a project . * < pre > < code > GitLab Endpoint : GET / projects / : id / repository / commits < / code > < / pre > * @ param projectIdOrPath the project in the form of an Integer ( ID ) , String ( path ) , or Project instance * @ param ref the name of a repository branch or tag or if not given the default branch * @ param since only commits after or on this date will be returned * @ param until only commits before or on this date will be returned * @ param itemsPerPage the number of Commit instances that will be fetched per page * @ return a Pager containing the commits for the specified project ID * @ throws GitLabApiException GitLabApiException if any exception occurs during execution */ public Pager < Commit > getCommits ( Object projectIdOrPath , String ref , Date since , Date until , int itemsPerPage ) throws GitLabApiException { } }
return getCommits ( projectIdOrPath , ref , since , until , null , itemsPerPage ) ;
public class BeanUtils { /** * 将一个Bean的数据装换到另外一个 ( 需实现setter和getter ) * @ param object 一个Bean * @ param clazz 另外一个Bean类 * @ param another 另一个Bean对象 * @ param < T > 另外Bean类型 * @ return { @ link T } * @ throws IllegalAccessException 异常 * @ throws InvocationTargetException 异常 * @ since 1.1.1 */ private static < T > T bean2Another ( Object object , Class < ? > clazz , T another ) throws InvocationTargetException , IllegalAccessException { } }
Method [ ] methods = object . getClass ( ) . getMethods ( ) ; Map < String , Method > clazzMethods = ReflectUtils . getMethodMap ( clazz , "set" ) ; for ( Method method : methods ) { String name = method . getName ( ) ; if ( name . startsWith ( "get" ) && ! "getClass" . equals ( name ) ) { String clazzMethod = "s" + name . substring ( 1 ) ; if ( clazzMethods . containsKey ( clazzMethod ) ) { Object value = method . invoke ( object ) ; if ( Checker . isNotNull ( value ) ) { clazzMethods . get ( clazzMethod ) . invoke ( another , value ) ; } } } } return another ;
public class Waiter { /** * Waits for a view to be shown . * @ param viewClass the { @ code View } class to wait for * @ param index the index of the view that is expected to be shown . * @ param timeout the amount of time in milliseconds to wait * @ param scroll { @ code true } if scrolling should be performed * @ return { @ code true } if view is shown and { @ code false } if it is not shown before the timeout */ public < T extends View > boolean waitForView ( final Class < T > viewClass , final int index , final int timeout , final boolean scroll ) { } }
Set < T > uniqueViews = new HashSet < T > ( ) ; final long endTime = SystemClock . uptimeMillis ( ) + timeout ; boolean foundMatchingView ; while ( SystemClock . uptimeMillis ( ) < endTime ) { sleeper . sleep ( ) ; foundMatchingView = searcher . searchFor ( uniqueViews , viewClass , index ) ; if ( foundMatchingView ) return true ; if ( scroll ) scroller . scrollDown ( ) ; } return false ;
public class NumberUtilities { /** * If the long integer string is null or empty , it returns the defaultLong otherwise it returns the long integer value ( see toLong ) * @ param longStr the long integer to convert * @ param defaultLong the default value if the longStr is null or the empty string * @ return the long integer value of the string or the defaultLong if the long integer string is empty * @ throws IllegalArgumentException if the passed long integer string is not a valid long integer */ public static long toLong ( @ Nullable final String longStr , final long defaultLong ) { } }
return StringUtils . isNoneEmpty ( longStr ) ? toLong ( longStr ) : defaultLong ;
public class CPDisplayLayoutPersistenceImpl { /** * Returns the cp display layout where uuid = & # 63 ; and groupId = & # 63 ; or throws a { @ link NoSuchCPDisplayLayoutException } if it could not be found . * @ param uuid the uuid * @ param groupId the group ID * @ return the matching cp display layout * @ throws NoSuchCPDisplayLayoutException if a matching cp display layout could not be found */ @ Override public CPDisplayLayout findByUUID_G ( String uuid , long groupId ) throws NoSuchCPDisplayLayoutException { } }
CPDisplayLayout cpDisplayLayout = fetchByUUID_G ( uuid , groupId ) ; if ( cpDisplayLayout == null ) { StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "uuid=" ) ; msg . append ( uuid ) ; msg . append ( ", groupId=" ) ; msg . append ( groupId ) ; msg . append ( "}" ) ; if ( _log . isDebugEnabled ( ) ) { _log . debug ( msg . toString ( ) ) ; } throw new NoSuchCPDisplayLayoutException ( msg . toString ( ) ) ; } return cpDisplayLayout ;
public class TaskExecutionListEntryMarshaller { /** * Marshall the given parameter object . */ public void marshall ( TaskExecutionListEntry taskExecutionListEntry , ProtocolMarshaller protocolMarshaller ) { } }
if ( taskExecutionListEntry == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( taskExecutionListEntry . getTaskExecutionArn ( ) , TASKEXECUTIONARN_BINDING ) ; protocolMarshaller . marshall ( taskExecutionListEntry . getStatus ( ) , STATUS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class EnhancedDebugger { /** * Adds the sent stanza detail to the messages table . * @ param dateFormatter the SimpleDateFormat to use to format Dates * @ param packet the sent stanza to add to the table */ private void addSentPacketToTable ( final SimpleDateFormat dateFormatter , final TopLevelStreamElement packet ) { } }
SwingUtilities . invokeLater ( new Runnable ( ) { @ Override public void run ( ) { String messageType ; Jid to ; String stanzaId ; if ( packet instanceof Stanza ) { Stanza stanza = ( Stanza ) packet ; to = stanza . getTo ( ) ; stanzaId = stanza . getStanzaId ( ) ; } else { to = null ; stanzaId = "(Nonza)" ; } String type = "" ; Icon packetTypeIcon ; sentPackets ++ ; if ( packet instanceof IQ ) { packetTypeIcon = iqPacketIcon ; messageType = "IQ Sent (class=" + packet . getClass ( ) . getName ( ) + ")" ; type = ( ( IQ ) packet ) . getType ( ) . toString ( ) ; sentIQPackets ++ ; } else if ( packet instanceof Message ) { packetTypeIcon = messagePacketIcon ; messageType = "Message Sent" ; type = ( ( Message ) packet ) . getType ( ) . toString ( ) ; sentMessagePackets ++ ; } else if ( packet instanceof Presence ) { packetTypeIcon = presencePacketIcon ; messageType = "Presence Sent" ; type = ( ( Presence ) packet ) . getType ( ) . toString ( ) ; sentPresencePackets ++ ; } else { packetTypeIcon = unknownPacketTypeIcon ; messageType = packet . getClass ( ) . getName ( ) + " Sent" ; sentOtherPackets ++ ; } // Check if we need to remove old rows from the table to keep memory consumption low if ( EnhancedDebuggerWindow . MAX_TABLE_ROWS > 0 && messagesTable . getRowCount ( ) >= EnhancedDebuggerWindow . MAX_TABLE_ROWS ) { messagesTable . removeRow ( 0 ) ; } messagesTable . addRow ( new Object [ ] { XmlUtil . prettyFormatXml ( packet . toXML ( ) . toString ( ) ) , dateFormatter . format ( new Date ( ) ) , packetSentIcon , packetTypeIcon , messageType , stanzaId , type , to , "" } ) ; // Update the statistics table updateStatistics ( ) ; } } ) ;
public class SuffixArrays { /** * Create a suffix array and an LCP array for a given generic array and a * custom suffix array building strategy , using the given T object * comparator . */ public static < T > SuffixData createWithLCP ( T [ ] input , ISuffixArrayBuilder builder , Comparator < ? super T > comparator ) { } }
final GenericArrayAdapter adapter = new GenericArrayAdapter ( builder , comparator ) ; final int [ ] sa = adapter . buildSuffixArray ( input ) ; final int [ ] lcp = computeLCP ( adapter . input , 0 , input . length , sa ) ; return new SuffixData ( sa , lcp ) ;
public class FnMutableDateTime { /** * It converts a { @ link Calendar } into a { @ link MutableDateTime } in the given { @ link DateTimeZone } * @ param dateTimeZone the the time zone ( { @ link DateTimeZone } ) to be used * @ return the { @ link MutableDateTime } created from the input and arguments */ public static final < T extends Calendar > Function < T , MutableDateTime > calendarToMutableDateTime ( DateTimeZone dateTimeZone ) { } }
return new CalendarToMutableDateTime < T > ( dateTimeZone ) ;
public class IpPermission { /** * [ VPC only ] The IPv6 ranges . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setIpv6Ranges ( java . util . Collection ) } or { @ link # withIpv6Ranges ( java . util . Collection ) } if you want to * override the existing values . * @ param ipv6Ranges * [ VPC only ] The IPv6 ranges . * @ return Returns a reference to this object so that method calls can be chained together . */ public IpPermission withIpv6Ranges ( Ipv6Range ... ipv6Ranges ) { } }
if ( this . ipv6Ranges == null ) { setIpv6Ranges ( new com . amazonaws . internal . SdkInternalList < Ipv6Range > ( ipv6Ranges . length ) ) ; } for ( Ipv6Range ele : ipv6Ranges ) { this . ipv6Ranges . add ( ele ) ; } return this ;
public class DefaultProperty { /** * Reads the value of this Property from the given object . It uses * reflection and looks for a method starting with " is " or " get " followed by * the capitalized Property name . * @ param object */ @ Override public void readFromObject ( Object object ) { } }
try { Method method = BeanUtils . getReadMethod ( object . getClass ( ) , getName ( ) ) ; if ( method != null ) { Object value = method . invoke ( object ) ; initializeValue ( value ) ; // avoid updating parent or firing property change if ( value != null ) { for ( Property subProperty : subProperties ) { subProperty . readFromObject ( value ) ; } } } } catch ( IllegalAccessException e ) { throw new RuntimeException ( e ) ; } catch ( IllegalArgumentException e ) { throw new RuntimeException ( e ) ; } catch ( InvocationTargetException e ) { throw new RuntimeException ( e ) ; }