signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class FDistort { /** * Sets the border by type . */ public FDistort border ( BorderType type ) { } }
if ( borderType == type ) return this ; borderType = type ; return border ( FactoryImageBorder . generic ( type , inputType ) ) ;
public class Cache { /** * Checks the passed in collection and determines if all elements * of that collection are contained within this cache . Care should * be taken in reading too much into a failure . If one of the elements * was once in this cache but has expired due to inactivity , this * method will return false . * @ param coll the collection to test * @ return true if all elements of the tested collection are in the cache */ public boolean containsAll ( Collection < ? > coll ) { } }
for ( Object item : coll ) { if ( ! contains ( item ) ) { return false ; } } return true ;
public class LRUHashMap { /** * is returned to the caller . */ public synchronized Object put ( Object key , Object value ) { } }
if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_CORE . isLoggable ( Level . FINER ) ) { // PM16861 Modified trace statement by removing toString of session object to avoid deadlock StringBuffer sb = new StringBuffer ( "key=" ) . append ( key ) ; LoggingUtil . SESSION_LOGGER_CORE . entering ( methodClassName , methodNames [ PUT ] , sb . toString ( ) ) ; } if ( maxSize == 0 ) return null ; CacheEntryWrapper currEntry ; CacheEntryWrapper oldestEntry = null ; // See if entry exists currEntry = ( CacheEntryWrapper ) super . get ( key ) ; if ( currEntry == null ) { // need new entry if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_CORE . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_CORE . logp ( Level . FINE , methodClassName , methodNames [ PUT ] , "Doesn't exist in HashMap" ) ; } currentSize ++ ; if ( _iStoreCallback != null ) { _iStoreCallback . sessionLiveCountInc ( value ) ; } if ( currentSize > maxSize ) { // too many entries , remove the oldest if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_CORE . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_CORE . logp ( Level . FINE , methodClassName , methodNames [ PUT ] , "Too Many Entries.. Remove the oldest entry: " + lru . key ) ; } oldestEntry = ( CacheEntryWrapper ) removeGuts ( lru . key ) ; if ( _iStoreCallback != null ) { _iStoreCallback . sessionCacheDiscard ( oldestEntry . value ) ; } } currEntry = new CacheEntryWrapper ( ) ; currEntry . key = key ; currEntry . value = value ; currEntry . next = mru ; if ( mru != null ) mru . prev = currEntry ; else lru = currEntry ; mru = currEntry ; if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_CORE . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_CORE . logp ( Level . FINE , methodClassName , methodNames [ PUT ] , "Adding new entry to the map" ) ; } } else { // found entry if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_CORE . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_CORE . logp ( Level . FINE , methodClassName , methodNames [ PUT ] , "Key already in use .. Reuse the entry" ) ; } updateCacheList ( key ) ; currEntry . value = value ; } Object replacedEntry = super . put ( key , currEntry ) ; if ( oldestEntry != null ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_CORE . isLoggable ( Level . FINE ) ) { // PM16861 LoggingUtil . SESSION_LOGGER_CORE . exiting ( methodClassName , methodNames [ PUT ] , "Returning object associated with this key: " + oldestEntry . key ) ; } return oldestEntry . value ; } if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_CORE . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_CORE . exiting ( methodClassName , methodNames [ PUT ] , null ) ; } return null ;
public class AmazonRekognitionClient { /** * Deletes faces from a collection . You specify a collection ID and an array of face IDs to remove from the * collection . * This operation requires permissions to perform the < code > rekognition : DeleteFaces < / code > action . * @ param deleteFacesRequest * @ return Result of the DeleteFaces operation returned by the service . * @ throws InvalidParameterException * Input parameter violated a constraint . Validate your parameter before calling the API operation again . * @ throws AccessDeniedException * You are not authorized to perform the action . * @ throws InternalServerErrorException * Amazon Rekognition experienced a service issue . Try your call again . * @ throws ThrottlingException * Amazon Rekognition is temporarily unable to process the request . Try your call again . * @ throws ProvisionedThroughputExceededException * The number of requests exceeded your throughput limit . If you want to increase this limit , contact Amazon * Rekognition . * @ throws ResourceNotFoundException * The collection specified in the request cannot be found . * @ sample AmazonRekognition . DeleteFaces */ @ Override public DeleteFacesResult deleteFaces ( DeleteFacesRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeDeleteFaces ( request ) ;
public class Schedulable { /** * Distribute the total share among the list of schedulables according to the * FAIR model . * Finds a way to distribute the share in such a way that all the * min and max reservations of the schedulables are satisfied * @ param total the share to be distributed * @ param schedulables the list of schedulables */ private static void distributeShareFair ( double total , final Collection < ? extends Schedulable > schedulables ) { } }
BinarySearcher searcher = new BinarySearcher ( ) { @ Override protected double targetFunction ( double x ) { return totalShareWithRatio ( schedulables , x ) ; } } ; double ratio = searcher . getSolution ( total ) ; for ( Schedulable schedulable : schedulables ) { schedulable . share = shareWithRatio ( schedulable , ratio ) ; }
public class OrganisasjonsnummerValidator { /** * Returns an object that represents a Organisasjonsnummer . The checksum of * the supplied organisasjonsnummer is changed to a valid checksum if the * original organisasjonsnummer has an invalid checksum . * @ param organisasjonsnummer * A String containing a Organisasjonsnummer * @ return A Organisasjonsnummer instance * @ throws IllegalArgumentException * thrown if String contains an invalid Organisasjonsnummer , ie . * a number which for one cannot calculate a valid checksum . */ public static Organisasjonsnummer getAndForceValidOrganisasjonsnummer ( String organisasjonsnummer ) { } }
validateSyntax ( organisasjonsnummer ) ; try { validateChecksum ( organisasjonsnummer ) ; } catch ( IllegalArgumentException iae ) { Organisasjonsnummer onr = new Organisasjonsnummer ( organisasjonsnummer ) ; int checksum = calculateMod11CheckSum ( getMod11Weights ( onr ) , onr ) ; organisasjonsnummer = organisasjonsnummer . substring ( 0 , LENGTH - 1 ) + checksum ; } return new Organisasjonsnummer ( organisasjonsnummer ) ;
public class SipPhone { /** * This method performs the SIP unregistration process . It returns true if unregistration was * successful or no unregistration was needed , and false otherwise . Any authorization headers * required for the last registration are cleared out . If there was no previous registration , this * method does not send any messages . * If the contact parameter is null , user @ hostname is unregistered where hostname is obtained by * calling InetAddr . getLocalHost ( ) . Otherwise , the contact parameter value is used in the * unregistration message sent to the server . * @ param contact The contact URI ( ex : sip : bob @ 192.0.2.4 ) to unregister or " * " . * @ param timeout The maximum amount of time to wait for a response , in milliseconds . Use a value * of 0 to wait indefinitely . * @ return true if the unregistration succeeded or no unregistration was needed , false otherwise . */ public boolean unregister ( String contact , long timeout ) { } }
initErrorInfo ( ) ; // TODO - need to support multiple server ( s ) / registrations // simultaneously ? // then return registration ( ) object to user ( w / lastregrequest ) and // receive // it here , get rid of lastRegistrationRequest if ( lastRegistrationRequest == null ) { return true ; } Request msg = ( Request ) lastRegistrationRequest . clone ( ) ; try { ExpiresHeader expires = parent . getHeaderFactory ( ) . createExpiresHeader ( 0 ) ; msg . setExpires ( expires ) ; cseq . setSeqNumber ( cseq . getSeqNumber ( ) + 1 ) ; cseq . setMethod ( Request . REGISTER ) ; msg . setHeader ( cseq ) ; // set contact header if ( contact != null ) { ContactHeader contact_hdr ; if ( ! contact . equals ( "*" ) ) { URI contact_uri = parent . getAddressFactory ( ) . createURI ( contact ) ; Address contact_address = parent . getAddressFactory ( ) . createAddress ( contact_uri ) ; contact_hdr = parent . getHeaderFactory ( ) . createContactHeader ( contact_address ) ; } else { contact_hdr = parent . getHeaderFactory ( ) . createContactHeader ( ) ; } msg . setHeader ( contact_hdr ) ; } // send the REGISTRATION request and get the response Response response = sendRegistrationMessage ( msg , null , null , 30000 ) ; if ( response == null ) { return false ; } // clear out authorizations accumulated for this Call - ID clearAuthorizations ( myRegistrationId ) ; // should we drop any calls in progress ? lastRegistrationRequest = null ; return true ; } catch ( Exception ex ) { setReturnCode ( EXCEPTION_ENCOUNTERED ) ; setErrorMessage ( "Exception: " + ex . getClass ( ) . getName ( ) + ": " + ex . getMessage ( ) ) ; return false ; }
public class StatementDocumentImpl { /** * Removes statement ids from a collection of statement groups . * @ param statementIds * @ param claims * @ return */ protected static Map < String , List < Statement > > removeStatements ( Set < String > statementIds , Map < String , List < Statement > > claims ) { } }
Map < String , List < Statement > > newClaims = new HashMap < > ( claims . size ( ) ) ; for ( Entry < String , List < Statement > > entry : claims . entrySet ( ) ) { List < Statement > filteredStatements = new ArrayList < > ( ) ; for ( Statement s : entry . getValue ( ) ) { if ( ! statementIds . contains ( s . getStatementId ( ) ) ) { filteredStatements . add ( s ) ; } } if ( ! filteredStatements . isEmpty ( ) ) { newClaims . put ( entry . getKey ( ) , filteredStatements ) ; } } return newClaims ;
public class MutableDateTime { /** * Set the date from another instant . * The time part of this object will be unaffected . * If the input is a { @ code ReadableDateTime } then it is converted to the * same time - zone as this object before using the instant millis . * @ param instant an instant to copy the date from , time part ignored * @ throws IllegalArgumentException if the object is invalid */ public void setDate ( final ReadableInstant instant ) { } }
long instantMillis = DateTimeUtils . getInstantMillis ( instant ) ; if ( instant instanceof ReadableDateTime ) { ReadableDateTime rdt = ( ReadableDateTime ) instant ; Chronology instantChrono = DateTimeUtils . getChronology ( rdt . getChronology ( ) ) ; DateTimeZone zone = instantChrono . getZone ( ) ; if ( zone != null ) { instantMillis = zone . getMillisKeepLocal ( getZone ( ) , instantMillis ) ; } } setDate ( instantMillis ) ;
public class StatementUtil { /** * 获得自增键的值 < br > * 此方法对于Oracle无效 * @ param ps PreparedStatement * @ return 自增键的值 * @ throws SQLException SQL执行异常 */ public static Long getGeneratedKeyOfLong ( PreparedStatement ps ) throws SQLException { } }
ResultSet rs = null ; try { rs = ps . getGeneratedKeys ( ) ; Long generatedKey = null ; if ( rs != null && rs . next ( ) ) { try { generatedKey = rs . getLong ( 1 ) ; } catch ( SQLException e ) { // 自增主键不为数字或者为Oracle的rowid , 跳过 } } return generatedKey ; } catch ( SQLException e ) { throw e ; } finally { DbUtil . close ( rs ) ; }
public class HandlerHolder { /** * Get the resolved < code > EventHandler < / code > service instance . * @ return the resolved < code > EventHandler < / code > service instance */ EventHandler getService ( ) { } }
if ( target != null ) { return target ; } // Look for the handler ComponentContext context = eventEngine . getComponentContext ( ) ; if ( context == null ) { return null ; } Object svc = context . locateService ( referenceName , serviceReference ) ; if ( svc instanceof EventHandler ) { // it was a websphere handler target = ( EventHandler ) svc ; } else if ( svc instanceof org . osgi . service . event . EventHandler ) { target = new OSGiHandlerAdapter ( ( org . osgi . service . event . EventHandler ) svc ) ; } // if svc = = null target remains null return target ;
public class EvaluatePrecomputedOutlierScores { /** * Check for NaN values . * @ param vec Vector * @ return { @ code true } if NaN values are present . */ private boolean checkForNaNs ( NumberVector vec ) { } }
for ( int i = 0 , d = vec . getDimensionality ( ) ; i < d ; i ++ ) { double v = vec . doubleValue ( i ) ; if ( v != v ) { // NaN ! return true ; } } return false ;
public class EurekaServerBootstrap { /** * Server context shutdown hook . Override for custom logic * @ throws Exception - calling { @ link AwsBinder # shutdown ( ) } or * { @ link EurekaServerContext # shutdown ( ) } may result in an exception */ protected void destroyEurekaServerContext ( ) throws Exception { } }
EurekaMonitors . shutdown ( ) ; if ( this . awsBinder != null ) { this . awsBinder . shutdown ( ) ; } if ( this . serverContext != null ) { this . serverContext . shutdown ( ) ; }
public class CmsContainerpageController { /** * Checks whether GWT widgets are available for all fields of a content . < p > * @ param structureId the structure id of the content * @ param resultCallback the callback for the result */ public void checkNewWidgetsAvailable ( final CmsUUID structureId , final AsyncCallback < Boolean > resultCallback ) { } }
CmsRpcAction < Boolean > action = new CmsRpcAction < Boolean > ( ) { @ Override public void execute ( ) { start ( 200 , false ) ; getContainerpageService ( ) . checkNewWidgetsAvailable ( structureId , this ) ; } @ Override protected void onResponse ( Boolean result ) { stop ( false ) ; resultCallback . onSuccess ( result ) ; } // empty } ; action . execute ( ) ;
public class KeyVaultClientBaseImpl { /** * Creates a new certificate . * If this is the first version , the certificate resource is created . This operation requires the certificates / create permission . * @ param vaultBaseUrl The vault name , for example https : / / myvault . vault . azure . net . * @ param certificateName The name of the certificate . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < CertificateOperation > createCertificateAsync ( String vaultBaseUrl , String certificateName , final ServiceCallback < CertificateOperation > serviceCallback ) { } }
return ServiceFuture . fromResponse ( createCertificateWithServiceResponseAsync ( vaultBaseUrl , certificateName ) , serviceCallback ) ;
public class ZWaveDeviceClass { /** * Set the specific device class of the node . * @ param specificDeviceClass the specificDeviceClass to set * @ exception IllegalArgumentException thrown when the specific device class does not match * the generic device class . */ public void setSpecificDeviceClass ( Specific specificDeviceClass ) throws IllegalArgumentException { } }
// The specific Device class does not match the generic device class . if ( specificDeviceClass . genericDeviceClass != Generic . NOT_KNOWN && specificDeviceClass . genericDeviceClass != this . genericDeviceClass ) throw new IllegalArgumentException ( "specificDeviceClass" ) ; this . specificDeviceClass = specificDeviceClass ;
public class Statement { /** * Returns a list of all terms contained by this statement ' s subject and * object . * @ return List of terms */ public List < Term > getAllTerms ( ) { } }
List < Term > ret = new ArrayList < Term > ( ) ; ret . add ( subject ) ; List < Term > subjectTerms = subject . getTerms ( ) ; if ( subjectTerms != null ) { ret . addAll ( subjectTerms ) ; for ( final Term term : subjectTerms ) { ret . addAll ( term . getAllTerms ( ) ) ; } } if ( object != null ) { ret . addAll ( object . getAllTerms ( ) ) ; } return ret ;
public class Operation { /** * Blocks until this operation completes its execution , either failing or succeeding . This method * returns current operation ' s latest information . If the operation no longer exists , this method * returns { @ code null } . By default , the operation status is checked using jittered exponential * backoff with 1 second as an initial delay , 2.0 as a backoff factor , 1 minute as maximum delay * between polls , 12 hours as a total timeout and unlimited number of attempts . * < p > Example usage of { @ code waitFor ( ) } : * < pre > { @ code * Operation completedOperation = operation . waitFor ( ) ; * if ( completedOperation = = null ) { * / / operation no longer exists * } else if ( completedOperation . errors ( ) ! = null ) { * / / operation failed , handle error * } else { * / / operation completed successfully * } < / pre > * < p > Example usage of { @ code waitFor ( ) } with checking period and timeout : * < pre > { @ code * Operation completedOperation = * operation . waitFor ( * RetryOption . maxRetryDelay ( Duration . ofSeconds ( 30 ) ) , * RetryOption . totalTimeout ( Duration . ofMinutes ( 1 ) ) , * RetryOption . jittered ( false ) ) ; * if ( completedOperation = = null ) { * / / operation no longer exists * } else if ( completedOperation . errors ( ) ! = null ) { * / / operation failed , handle error * } else { * / / operation completed successfully * } < / pre > * @ param waitOptions options to configure checking period and timeout * @ throws ComputeException upon failure , check { @ link ComputeException # getCause ( ) } for details * @ throws InterruptedException if the current thread gets interrupted while waiting for the * operation to complete */ public Operation waitFor ( RetryOption ... waitOptions ) throws InterruptedException { } }
RetrySettings waitSettings = RetryOption . mergeToSettings ( DEFAULT_OPERATION_WAIT_SETTINGS , waitOptions ) ; try { Operation operation = RetryHelper . poll ( new Callable < Operation > ( ) { @ Override public Operation call ( ) throws Exception { return compute . getOperation ( operationId , OperationOption . fields ( Compute . OperationField . STATUS ) ) ; } } , waitSettings , new BasicResultRetryAlgorithm < Operation > ( ) { @ Override public boolean shouldRetry ( Throwable prevThrowable , Operation prevResponse ) { return prevResponse != null && prevResponse . getStatus ( ) != Status . DONE ; } } , options . getClock ( ) ) ; return operation == null ? null : reload ( ) ; } catch ( ExecutionException e ) { throw ComputeException . translateAndThrow ( e ) ; }
public class SubscriptionClientChildSbb { public void onNotify ( RequestEvent event , ActivityContextInterface aci ) { } }
if ( tracer . isFineEnabled ( ) ) tracer . fine ( "Received Notify, on activity: " + aci . getActivity ( ) + "\nRequest:\n" + event . getRequest ( ) ) ; Request request = event . getRequest ( ) ; SubscriptionData subscriptionData = getSubscriptionDataCMP ( ) ; EventHeader eventHeader = ( EventHeader ) request . getHeader ( EventHeader . NAME ) ; if ( eventHeader == null || ! eventHeader . getEventType ( ) . equals ( subscriptionData . getEventPackage ( ) ) ) { try { Response badEventResponse = this . messageFactory . createResponse ( Response . BAD_EVENT , request ) ; event . getServerTransaction ( ) . sendResponse ( badEventResponse ) ; // TODO : terminate dialog ? } catch ( Exception e ) { if ( tracer . isSevereEnabled ( ) ) { tracer . severe ( "Failed to create 489 answer to NOTIFY" , e ) ; } } return ; } else { try { Response okResponse = this . messageFactory . createResponse ( Response . OK , request ) ; event . getServerTransaction ( ) . sendResponse ( okResponse ) ; } catch ( Exception e ) { if ( tracer . isSevereEnabled ( ) ) { tracer . severe ( "Failed to create 200 answer to NOTIFY" , e ) ; } return ; } } // lets create Notify Notify notify = new Notify ( ) ; notify . setSubscriber ( subscriptionData . getSubscriberURI ( ) ) ; ContentTypeHeader contentType = ( ContentTypeHeader ) request . getHeader ( ContentTypeHeader . NAME ) ; if ( contentType != null ) { // use CT Header ? notify . setContentType ( contentType . getContentType ( ) ) ; notify . setContentSubType ( contentType . getContentSubType ( ) ) ; notify . setContent ( new String ( request . getRawContent ( ) ) ) ; } notify . setNotifier ( subscriptionData . getNotifierURI ( ) ) ; // check , whats in header . SubscriptionStateHeader subscriptionStateHeader = ( SubscriptionStateHeader ) request . getHeader ( SubscriptionStateHeader . NAME ) ; SubscriptionStatus state = SubscriptionStatus . fromString ( subscriptionStateHeader . getState ( ) ) ; notify . setStatus ( state ) ; // do magic switch ( state ) { case active : case pending : // check for exp if ( subscriptionStateHeader . getExpires ( ) != Notify . NO_TIMEOUT ) { notify . setExpires ( subscriptionStateHeader . getExpires ( ) ) ; // set timer if needed SubscribeRequestType subscribeRequestType = getSubscribeRequestTypeCMP ( ) ; if ( subscribeRequestType == SubscribeRequestType . NEW || subscribeRequestType == SubscribeRequestType . REFRESH ) { startExpiresTimer ( aci , subscriptionStateHeader . getExpires ( ) ) ; setSubscribeRequestTypeCMP ( null ) ; } } break ; case waiting : // nothing . . . break ; case extension : notify . setStatusExtension ( subscriptionStateHeader . getState ( ) ) ; case terminated : // check reason String reasonString = subscriptionStateHeader . getReasonCode ( ) ; TerminationReason reason = TerminationReason . fromString ( reasonString ) ; notify . setTerminationReason ( reason ) ; if ( reason != null ) { switch ( reason ) { case rejected : case noresource : case deactivated : case timeout : break ; case probation : case giveup : if ( subscriptionStateHeader . getRetryAfter ( ) != Notify . NO_TIMEOUT ) { notify . setRetryAfter ( subscriptionStateHeader . getRetryAfter ( ) ) ; } break ; case extension : notify . setTerminationReasonExtension ( reasonString ) ; break ; } } break ; } // deliver to parent try { SbbLocalObjectExt sbbLocalObjectExt = sbbContext . getSbbLocalObject ( ) ; if ( state == SubscriptionStatus . terminated ) { cancelExpiresTimer ( aci ) ; aci . detach ( sbbLocalObjectExt ) ; event . getDialog ( ) . delete ( ) ; } ( ( SubscriptionClientParentSbbLocalObject ) sbbLocalObjectExt . getParent ( ) ) . onNotify ( notify , ( SubscriptionClientChildSbbLocalObject ) sbbLocalObjectExt ) ; } catch ( Exception e ) { if ( tracer . isSevereEnabled ( ) ) { tracer . severe ( "Received exception from parent on notify callback" , e ) ; } }
public class JDBCPersistenceManagerImpl { /** * Set the default schema JBATCH or the schema defined in batch - config on the connection object . * @ param connection * @ throws SQLException */ private void setSchemaOnConnection ( Connection connection ) throws SQLException { } }
logger . finest ( "Entering " + CLASSNAME + ".setSchemaOnConnection()" ) ; String dbProductName = connection . getMetaData ( ) . getDatabaseProductName ( ) ; if ( ! "Oracle" . equals ( dbProductName ) && ! "Microsoft SQL Server" . equals ( dbProductName ) ) { PreparedStatement ps = null ; if ( "MySQL" . equals ( dbProductName ) ) { ps = connection . prepareStatement ( "USE " + schema ) ; } else { ps = connection . prepareStatement ( "SET SCHEMA ?" ) ; ps . setString ( 1 , schema ) ; } ps . executeUpdate ( ) ; ps . close ( ) ; } logger . finest ( "Exiting " + CLASSNAME + ".setSchemaOnConnection()" ) ;
public class SslCodec { /** * Creates a new downstream connection as { @ link LinkedIOSubchannel } * of the network connection together with an { @ link SSLEngine } . * @ param event * the accepted event */ @ Handler ( channels = EncryptedChannel . class ) public void onAccepted ( Accepted event , IOSubchannel encryptedChannel ) { } }
new PlainChannel ( event , encryptedChannel ) ;
public class RpcManager { /** * Collect stats on the shared instance of { @ link RpcManager } . */ static void collectStats ( final StatsCollector collector ) { } }
final RpcManager manager = INSTANCE . get ( ) ; if ( manager != null ) { if ( manager . rpc_plugins != null ) { try { collector . addExtraTag ( "plugin" , "rpc" ) ; for ( final RpcPlugin rpc : manager . rpc_plugins ) { rpc . collectStats ( collector ) ; } } finally { collector . clearExtraTag ( "plugin" ) ; } } if ( manager . http_plugin_commands != null ) { try { collector . addExtraTag ( "plugin" , "httprpc" ) ; for ( final Map . Entry < String , HttpRpcPlugin > entry : manager . http_plugin_commands . entrySet ( ) ) { entry . getValue ( ) . collectStats ( collector ) ; } } finally { collector . clearExtraTag ( "plugin" ) ; } } }
public class BeanContextServicesSupport { /** * Deserializes all serializable services and their providers before the children of this context is deserialized . * First a < code > int < / code > is read , indicating the number of services to read . Then pairs of service class and service provider are read one by one . * @ see com . googlecode . openbeans . beancontext . BeanContextSupport # bcsPreDeserializationHook ( java . io . ObjectInputStream ) */ @ SuppressWarnings ( "unchecked" ) protected void bcsPreDeserializationHook ( ObjectInputStream ois ) throws IOException , ClassNotFoundException { } }
super . bcsPreDeserializationHook ( ois ) ; // deserialize services synchronized ( services ) { serializable = ois . readInt ( ) ; for ( int i = 0 ; i < serializable ; i ++ ) { Object serviceClass = ois . readObject ( ) ; Object bcssProvider = ois . readObject ( ) ; services . put ( ( Class ) serviceClass , ( BCSSServiceProvider ) bcssProvider ) ; } }
public class JDBDT { /** * Drop tables . * @ param db Database . * @ param tableNames Table names . * @ see # drop ( Table ) * @ see # drop ( Table . . . ) * @ see # assertTableExists ( DB , String ) * @ see # assertTableDoesNotExist ( DB , String ) * @ since 1.2 */ @ SafeVarargs public static void drop ( DB db , String ... tableNames ) { } }
foreach ( tableNames , ( callInfo , tableName ) -> DBSetup . drop ( callInfo , db , tableName ) , CallInfo . create ( ) ) ;
public class ListStacksResult { /** * A list of < code > StackSummary < / code > structures containing information about the specified stacks . * @ param stackSummaries * A list of < code > StackSummary < / code > structures containing information about the specified stacks . */ public void setStackSummaries ( java . util . Collection < StackSummary > stackSummaries ) { } }
if ( stackSummaries == null ) { this . stackSummaries = null ; return ; } this . stackSummaries = new com . amazonaws . internal . SdkInternalList < StackSummary > ( stackSummaries ) ;
public class Main { /** * Verify that a source file name is valid . */ private static void checkFilePattern ( String s ) throws ProblemException { } }
// File names like foo / bar / gamma / Bar . java are allowed , // as well as / bar / jndi . properties as well as , // * / bar / Foo . java Pattern p = null ; if ( File . separatorChar == '\\' ) { p = Pattern . compile ( "\\*?(.+\\\\)*.+" ) ; } else if ( File . separatorChar == '/' ) { p = Pattern . compile ( "\\*?(.+/)*.+" ) ; } else { throw new ProblemException ( "This platform uses the unsupported " + File . separatorChar + " as file separator character. Please add support for it!" ) ; } Matcher m = p . matcher ( s ) ; if ( ! m . matches ( ) ) { throw new ProblemException ( "The string \"" + s + "\" is not a proper file name." ) ; }
public class SimpleSkin { /** * * * * * * Methods * * * * * */ @ Override protected void handleEvents ( final String EVENT_TYPE ) { } }
super . handleEvents ( EVENT_TYPE ) ; if ( "FINISHED" . equals ( EVENT_TYPE ) ) { if ( gauge . getCheckSectionsForValue ( ) ) { double currentValue = gauge . getCurrentValue ( ) ; int listSize = sections . size ( ) ; for ( int i = 0 ; i < listSize ; i ++ ) { sections . get ( i ) . checkForValue ( currentValue ) ; } } // Highlight Sections if enabled if ( highlightSections ) { drawSections ( ) ; } } else if ( "RECALC" . equals ( EVENT_TYPE ) ) { minValue = gauge . getMinValue ( ) ; maxValue = gauge . getMaxValue ( ) ; angleStep = ANGLE_RANGE / gauge . getRange ( ) ; needleRotate . setAngle ( ( 180 - START_ANGLE ) + ( gauge . getValue ( ) - gauge . getMinValue ( ) ) * angleStep ) ; resize ( ) ; rotateNeedle ( gauge . getCurrentValue ( ) ) ; } else if ( "SECTION" . equals ( EVENT_TYPE ) ) { sections = gauge . getSections ( ) ; highlightSections = gauge . isHighlightSections ( ) ; resize ( ) ; redraw ( ) ; } else if ( "VISIBILITY" . equals ( EVENT_TYPE ) ) { enableNode ( valueText , gauge . isValueVisible ( ) ) ; enableNode ( titleText , ! gauge . getTitle ( ) . isEmpty ( ) ) ; enableNode ( subTitleText , ! gauge . getSubTitle ( ) . isEmpty ( ) ) ; }
public class StopUserImportJobRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( StopUserImportJobRequest stopUserImportJobRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( stopUserImportJobRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( stopUserImportJobRequest . getUserPoolId ( ) , USERPOOLID_BINDING ) ; protocolMarshaller . marshall ( stopUserImportJobRequest . getJobId ( ) , JOBID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class FacesMessages { /** * slightly simplified version of the corresponding method of the JSF API ( because the original method is not * publicly visible ) * @ param messageId * The id of the error message in the message bundle * @ param label * The label of the input field */ public static void createErrorMessageFromResourceBundle ( String clientId , String messageId , String label ) { } }
String summary = null ; String detail = null ; ResourceBundle bundle ; String bundleName ; // see if we have a user - provided bundle Application app = FacesContext . getCurrentInstance ( ) . getApplication ( ) ; Class < ? > appClass = app . getClass ( ) ; Locale locale = FacesContext . getCurrentInstance ( ) . getViewRoot ( ) . getLocale ( ) ; if ( null != ( bundleName = app . getMessageBundle ( ) ) ) { if ( null != ( bundle = ResourceBundle . getBundle ( bundleName , locale , getCurrentLoader ( appClass ) ) ) ) { // see if we have a hit try { summary = bundle . getString ( messageId ) ; detail = bundle . getString ( messageId + "_detail" ) ; } catch ( MissingResourceException e ) { // ignore } } } // we couldn ' t find a summary in the user - provided bundle if ( null == summary ) { // see if we have a summary in the app provided bundle bundle = ResourceBundle . getBundle ( FacesMessage . FACES_MESSAGES , locale , getCurrentLoader ( appClass ) ) ; if ( null == bundle ) { throw new NullPointerException ( ) ; } // see if we have a hit try { summary = bundle . getString ( messageId ) ; detail = bundle . getString ( messageId + "_detail" ) ; } catch ( MissingResourceException e ) { // ignore } } summary = summary != null ? summary . replace ( "{0}" , label ) : "" ; detail = detail != null ? detail . replace ( "{0}" , label ) : "" ; // At this point , we have a summary and a bundle . FacesMessages . error ( clientId , summary , detail ) ;
public class DeleteDatastoreRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteDatastoreRequest deleteDatastoreRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteDatastoreRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteDatastoreRequest . getDatastoreName ( ) , DATASTORENAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class BehaviorTree { /** * This method should be called when game entity needs to make decisions : call this in game loop or after a fixed time slice if * the game is real - time , or on entity ' s turn if the game is turn - based */ public void step ( ) { } }
if ( rootTask . status == Status . RUNNING ) { rootTask . run ( ) ; } else { rootTask . setControl ( this ) ; rootTask . start ( ) ; if ( rootTask . checkGuard ( this ) ) rootTask . run ( ) ; else rootTask . fail ( ) ; }
public class AbstractQueryBuilder { /** * Sets the target implementation type required . This can be used to explicitly acquire a specific * implementation * type and use a query to configure the instance or factory to be returned . * @ param type the target implementation type , not null . * @ return this query builder for chaining . */ @ SuppressWarnings ( "unchecked" ) public B setTargetType ( Class < ? > type ) { } }
Objects . requireNonNull ( type ) ; set ( AbstractQuery . KEY_QUERY_TARGET_TYPE , type ) ; return ( B ) this ;
public class Mapping { /** * Returns true if this entity ' s primary key is not null , and for numeric * fields , is non - zero . */ private boolean hasPrimaryKey ( T entity ) { } }
Object pk = getPrimaryKey ( entity ) ; if ( pk == null ) { return false ; } else { if ( pk instanceof Number && ( ( Number ) pk ) . longValue ( ) == 0 ) { return false ; } } return true ;
public class AmfWriter { /** * < editor - fold desc = " Amf3 " > */ public < T > void registerAmf3Serializer ( @ NonNull Class < T > targetClass , AmfSerializer < T > serializer ) { } }
this . amf3Serializers . put ( targetClass , serializer ) ;
public class ControllerScanner { /** * Sort the methods by their preferred order , if specified . * @ param methods * @ return a sorted list of methods */ protected Collection < Method > sortMethods ( Collection < Method > methods ) { } }
List < Method > list = new ArrayList < > ( methods ) ; Collections . sort ( list , ( m1 , m2 ) -> { int o1 = Integer . MAX_VALUE ; Order order1 = ClassUtil . getAnnotation ( m1 , Order . class ) ; if ( order1 != null ) { o1 = order1 . value ( ) ; } int o2 = Integer . MAX_VALUE ; Order order2 = ClassUtil . getAnnotation ( m2 , Order . class ) ; if ( order2 != null ) { o2 = order2 . value ( ) ; } if ( o1 == o2 ) { // same or unsorted , compare controller + method String s1 = Util . toString ( m1 ) ; String s2 = Util . toString ( m2 ) ; return s1 . compareTo ( s2 ) ; } if ( o1 < o2 ) { return - 1 ; } else { return 1 ; } } ) ; return list ;
public class DefaultTraceManager { /** * { @ inheritDoc } */ @ Override public void associateTrace ( Trace < E > trace , Thread thread ) { } }
threadMap . put ( thread , trace ) ;
public class ProductPartitionNode { /** * Performs a < em > shallow < / em > copy of properties from { @ code fromNode } to { @ code toNode } . Does * < em > not < / em > change the parent node of { @ code toNode } . * @ param fromNode the node to copy from . * @ param toNode the node to copy to . * @ return { @ code toNode } , with its properties updated . */ static ProductPartitionNode copyProperties ( ProductPartitionNode fromNode , ProductPartitionNode toNode ) { } }
switch ( fromNode . nodeState . getNodeType ( ) ) { case BIDDABLE_UNIT : toNode = toNode . asBiddableUnit ( ) ; toNode . setBid ( fromNode . getBid ( ) ) ; toNode . setTrackingUrlTemplate ( fromNode . getTrackingUrlTemplate ( ) ) ; // Clone the CustomParameters from fromNode so that changes on the toNode won ' t be // reflected in the fromNode . for ( Entry < String , String > customParamEntry : fromNode . nodeState . getCustomParams ( ) . entrySet ( ) ) { toNode . putCustomParameter ( customParamEntry . getKey ( ) , customParamEntry . getValue ( ) ) ; } break ; case EXCLUDED_UNIT : toNode = toNode . asExcludedUnit ( ) ; break ; case SUBDIVISION : toNode = toNode . asSubdivision ( ) ; break ; default : throw new IllegalStateException ( "Unrecognized node state: " + fromNode . nodeState . getNodeType ( ) ) ; } return toNode . setProductPartitionId ( fromNode . getProductPartitionId ( ) ) ;
public class SimpleBox { /** * Decrypt the ciphertext with the given key . * @ param ciphertext an encrypted message * @ return an { @ link Optional } of the original plaintext , or if either the key , nonce , or * ciphertext was modified , an empty { @ link Optional } */ public Optional < byte [ ] > open ( byte [ ] ciphertext ) { } }
if ( ciphertext . length < SecretBox . NONCE_SIZE ) { return Optional . empty ( ) ; } final byte [ ] nonce = Arrays . copyOfRange ( ciphertext , 0 , SecretBox . NONCE_SIZE ) ; final byte [ ] x = Arrays . copyOfRange ( ciphertext , SecretBox . NONCE_SIZE , ciphertext . length ) ; return box . open ( nonce , x ) ;
public class ZaurusTableForm { /** * answer the index of the column named name in the actual table */ private int getColIndex ( String name ) { } }
for ( int i = 0 ; i < columns . length ; i ++ ) { if ( name . equals ( columns [ i ] ) ) { return i ; } // end of if ( name . equals ( columns [ i ] ) ) } // end of for ( int i = 0 ; i < columns . length ; i + + ) return - 1 ;
public class RoleUpdater { /** * Add the requested post parameters to the Request . * @ param request Request to add post params to */ private void addPostParams ( final Request request ) { } }
if ( permission != null ) { for ( String prop : permission ) { request . addPostParam ( "Permission" , prop ) ; } }
public class InstanceCountLimitsMarshaller { /** * Marshall the given parameter object . */ public void marshall ( InstanceCountLimits instanceCountLimits , ProtocolMarshaller protocolMarshaller ) { } }
if ( instanceCountLimits == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( instanceCountLimits . getMinimumInstanceCount ( ) , MINIMUMINSTANCECOUNT_BINDING ) ; protocolMarshaller . marshall ( instanceCountLimits . getMaximumInstanceCount ( ) , MAXIMUMINSTANCECOUNT_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class LWJGL3TypeConversions { /** * Convert face winding orders to GL constants . * @ param f The face winding order . * @ return The resulting GL constant . */ public static int faceWindingOrderToGL ( final JCGLFaceWindingOrder f ) { } }
switch ( f ) { case FRONT_FACE_CLOCKWISE : return GL11 . GL_CW ; case FRONT_FACE_COUNTER_CLOCKWISE : return GL11 . GL_CCW ; } throw new UnreachableCodeException ( ) ;
public class CmsWorkplaceManager { /** * Returns true if the session should be kept alive . < p > * @ param useDefault if true , the default value will be returned if the " keep alive " setting is not explicitly configured * @ return True if the " keep alive " mode is active */ public Boolean isKeepAlive ( boolean useDefault ) { } }
if ( m_keepAlive != null ) { return m_keepAlive ; } if ( useDefault ) { return Boolean . TRUE ; } else { return null ; }
public class NetUtils { /** * 遍历本地网卡 , 返回第一个合理的IP , 保存到缓存中 * @ return 本地网卡IP */ public static InetAddress getLocalAddress ( ) { } }
InetAddress localAddress = null ; try { localAddress = InetAddress . getLocalHost ( ) ; if ( isValidAddress ( localAddress ) ) { return localAddress ; } } catch ( Throwable e ) { if ( LOGGER . isWarnEnabled ( ) ) { LOGGER . warn ( "Error when retrieving ip address: " + e . getMessage ( ) , e ) ; } } try { Enumeration < NetworkInterface > interfaces = NetworkInterface . getNetworkInterfaces ( ) ; if ( interfaces != null ) { while ( interfaces . hasMoreElements ( ) ) { try { NetworkInterface network = interfaces . nextElement ( ) ; Enumeration < InetAddress > addresses = network . getInetAddresses ( ) ; while ( addresses . hasMoreElements ( ) ) { try { InetAddress address = addresses . nextElement ( ) ; if ( isValidAddress ( address ) ) { return address ; } } catch ( Throwable e ) { if ( LOGGER . isWarnEnabled ( ) ) { LOGGER . warn ( "Error when retrieving ip address: " + e . getMessage ( ) , e ) ; } } } } catch ( Throwable e ) { if ( LOGGER . isWarnEnabled ( ) ) { LOGGER . warn ( "Error when retrieving ip address: " + e . getMessage ( ) , e ) ; } } } } } catch ( Throwable e ) { if ( LOGGER . isWarnEnabled ( ) ) { LOGGER . warn ( "Error when retrieving ip address: " + e . getMessage ( ) , e ) ; } } if ( LOGGER . isErrorEnabled ( ) ) { LOGGER . error ( "Can't get valid host, will use 127.0.0.1 instead." ) ; } return localAddress ;
public class CorsRule { /** * One or more headers in the response that you want users to be able to access from their applications ( for * example , from a JavaScript < code > XMLHttpRequest < / code > object ) . * This element is optional for each rule . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setExposeHeaders ( java . util . Collection ) } or { @ link # withExposeHeaders ( java . util . Collection ) } if you want * to override the existing values . * @ param exposeHeaders * One or more headers in the response that you want users to be able to access from their applications ( for * example , from a JavaScript < code > XMLHttpRequest < / code > object ) . < / p > * This element is optional for each rule . * @ return Returns a reference to this object so that method calls can be chained together . */ public CorsRule withExposeHeaders ( String ... exposeHeaders ) { } }
if ( this . exposeHeaders == null ) { setExposeHeaders ( new java . util . ArrayList < String > ( exposeHeaders . length ) ) ; } for ( String ele : exposeHeaders ) { this . exposeHeaders . add ( ele ) ; } return this ;
public class Utils { /** * Appends the given mailto link using obfuscation . * @ param out * The StringBuilder to write to . * @ param in * Input String . * @ param start * Input String starting position . * @ param end * Input String end position . */ public final static void appendMailto ( final StringBuilder out , final String in , final int start , final int end ) { } }
for ( int i = start ; i < end ; i ++ ) { final char c ; final int r = rnd ( ) ; switch ( c = in . charAt ( i ) ) { case '&' : case '<' : case '>' : case '"' : case '\'' : case '@' : if ( r < 512 ) { appendDecEntity ( out , c ) ; } else { appendHexEntity ( out , c ) ; } break ; default : if ( r < 32 ) { out . append ( c ) ; } else if ( r < 520 ) { appendDecEntity ( out , c ) ; } else { appendHexEntity ( out , c ) ; } break ; } }
public class Project { /** * Create a new Goal in this Project . * @ param name The initial name of the Goal . * @ param attributes additional attributes for the Goal . * @ return A new Goal . */ public Goal createGoal ( String name , Map < String , Object > attributes ) { } }
return getInstance ( ) . create ( ) . goal ( name , this , attributes ) ;
public class RtfParser { /** * Initialize the statistics values . * @ since 2.1.3 */ protected void init_stats ( ) { } }
byteCount = 0 ; ctrlWordCount = 0 ; openGroupCount = 0 ; closeGroupCount = 0 ; characterCount = 0 ; ctrlWordHandledCount = 0 ; ctrlWordNotHandledCount = 0 ; ctrlWordSkippedCount = 0 ; groupSkippedCount = 0 ;
public class CmsExplorerTypeSettings { /** * Adds a new icon rule to this explorer type . < p > * @ param extension the extension for the icon rule * @ param icon the small icon * @ param bigIcon the big icon * @ param smallIconStyle the small icon CSS style class * @ param bigIconStyle the big icon CSS style class */ public void addIconRule ( String extension , String icon , String bigIcon , String smallIconStyle , String bigIconStyle ) { } }
CmsIconRule rule = new CmsIconRule ( extension , icon , bigIcon , smallIconStyle , bigIconStyle ) ; m_iconRules . put ( extension , rule ) ;
public class PatchDelegate { /** * Returns a string containing the signature of a method that appears ( erased ) at least twice in the list . * If no duplicates are present , { @ code null } is returned . */ private static String containsDuplicates ( List < BindingTuple > tuples ) { } }
Set < String > sigs = new HashSet < String > ( ) ; for ( BindingTuple tuple : tuples ) { if ( ! sigs . add ( printSig ( tuple . parameterized ) ) ) return printSig ( tuple . parameterized ) ; } return null ;
public class ValidationResult { /** * Counts validation messages by its severity . * @ param severity a severity of the message which should be counted * @ return a number of validation messages with provided severity */ public int count ( Severity severity ) { } }
int result = 0 ; if ( severity == null ) { return result ; } for ( ValidationMessage < Origin > message : messages ) { if ( severity . equals ( message . getSeverity ( ) ) ) { result ++ ; } } return result ;
public class InvocationDirector { /** * Initializes the invocation director . This is called when the client establishes a connection * with the server . * @ param omgr the distributed object manager via which the invocation manager will send and * receive events . * @ param cloid the oid of the object on which invocation notifications as well as invocation * responses will be received . * @ param client a reference to the client for whom we ' re doing our business . */ public void init ( DObjectManager omgr , final int cloid , Client client ) { } }
// sanity check if ( _clobj != null ) { log . warning ( "Zoiks, client object around during invmgr init!" ) ; cleanup ( ) ; } // keep these for later _omgr = omgr ; _client = client ; // add ourselves as a subscriber to the client object _omgr . subscribeToObject ( cloid , new Subscriber < ClientObject > ( ) { public void objectAvailable ( ClientObject clobj ) { // add ourselves as an event listener clobj . addListener ( InvocationDirector . this ) ; // keep a handle on this bad boy _clobj = clobj ; // assign a mapping to already registered receivers assignReceiverIds ( ) ; // let the client know that we ' re ready to go now that we ' ve got our subscription // to the client object _client . gotClientObject ( _clobj ) ; } public void requestFailed ( int oid , ObjectAccessException cause ) { // aiya ! we were unable to subscribe to the client object . we ' re hosed ! log . warning ( "Invocation director unable to subscribe to client object" , "cloid" , cloid , "cause" , cause + "]!" ) ; _client . getClientObjectFailed ( cause ) ; } } ) ;
public class DTMManager { /** * Obtain a new instance of a < code > DTMManager < / code > . * This static method creates a new factory instance * This method uses the following ordered lookup procedure to determine * the < code > DTMManager < / code > implementation class to * load : * < ul > * < li > * Use the < code > org . apache . xml . dtm . DTMManager < / code > system * property . * < / li > * < li > * Use the JAVA _ HOME ( the parent directory where jdk is * installed ) / lib / xalan . properties for a property file that contains the * name of the implementation class keyed on the same value as the * system property defined above . * < / li > * < li > * Use the Services API ( as detailed in the JAR specification ) , if * available , to determine the classname . The Services API will look * for a classname in the file * < code > META - INF / services / org . apache . xml . dtm . DTMManager < / code > * in jars available to the runtime . * < / li > * < li > * Use the default < code > DTMManager < / code > classname , which is * < code > org . apache . xml . dtm . ref . DTMManagerDefault < / code > . * < / li > * < / ul > * Once an application has obtained a reference to a < code > * DTMManager < / code > it can use the factory to configure * and obtain parser instances . * @ return new DTMManager instance , never null . * @ throws DTMConfigurationException * if the implementation is not available or cannot be instantiated . */ public static DTMManager newInstance ( XMLStringFactory xsf ) throws DTMConfigurationException { } }
DTMManager factoryImpl = null ; try { factoryImpl = ( DTMManager ) ObjectFactory . createObject ( defaultPropName , defaultClassName ) ; } catch ( ObjectFactory . ConfigurationError e ) { throw new DTMConfigurationException ( XMLMessages . createXMLMessage ( XMLErrorResources . ER_NO_DEFAULT_IMPL , null ) , e . getException ( ) ) ; // " No default implementation found " ) ; } if ( factoryImpl == null ) { throw new DTMConfigurationException ( XMLMessages . createXMLMessage ( XMLErrorResources . ER_NO_DEFAULT_IMPL , null ) ) ; // " No default implementation found " ) ; } factoryImpl . setXMLStringFactory ( xsf ) ; return factoryImpl ;
public class OperaOptions { /** * Adds a new Opera extension to install on browser startup . Each path should * specify a packed Opera extension ( CRX file ) . * @ param paths Paths to the extensions to install . */ public OperaOptions addExtensions ( List < File > paths ) { } }
for ( File path : paths ) { checkNotNull ( path ) ; checkArgument ( path . exists ( ) , "%s does not exist" , path . getAbsolutePath ( ) ) ; checkArgument ( ! path . isDirectory ( ) , "%s is a directory" , path . getAbsolutePath ( ) ) ; } extensionFiles . addAll ( paths ) ; return this ;
public class TimedObject { /** * / * ( non - Javadoc ) * @ see com . ibm . wsspi . asynchttp . queue . IAsyncEntry # getTimerTask ( ) */ public TimerTask getTimerTask ( ) { } }
if ( logger . isLoggable ( Level . FINEST ) ) { logger . entering ( CLASS_NAME , "getTimerTask" ) ; logger . exiting ( CLASS_NAME , "getTimerTask" ) ; } if ( task == null ) task = new EntryTimer ( ) ; return task ;
public class FilterableTableExample { /** * Set the filter case sensitivity . * @ param caseInsensitive If true the filter will not be case sensitive so , for example , " Smith " and " smith " will be * equivalent . */ public void setCaseSensitiveMatch ( final Boolean caseInsensitive ) { } }
FilterableBeanBoundDataModel model = getFilterableTableModel ( ) ; if ( model != null ) { model . setCaseSensitiveMatch ( caseInsensitive ) ; }
public class HttpStream { /** * Creates a new HTTP stream . If there is a saved connection to * the same host , use it . * @ param path the URL for the stream * @ return the opened stream */ static private HttpStream createStream ( HttpPath path ) throws IOException { } }
String host = path . getHost ( ) ; int port = path . getPort ( ) ; HttpStream stream = null ; long streamTime = 0 ; synchronized ( LOCK ) { if ( _savedStream != null && host . equals ( _savedStream . getHost ( ) ) && port == _savedStream . getPort ( ) ) { stream = _savedStream ; streamTime = _saveTime ; _savedStream = null ; } } if ( stream != null ) { long now ; now = CurrentTime . currentTime ( ) ; if ( now < streamTime + 5000 ) { // if the stream is still valid , use it stream . init ( path ) ; return stream ; } else { // if the stream has timed out , close it try { stream . _isKeepalive = false ; stream . close ( ) ; } catch ( IOException e ) { log . log ( Level . FINE , e . toString ( ) , e ) ; } } } Socket s ; try { s = new Socket ( host , port ) ; if ( path instanceof HttpsPath ) { SSLContext context = SSLContext . getInstance ( "TLS" ) ; javax . net . ssl . TrustManager tm = new javax . net . ssl . X509TrustManager ( ) { public java . security . cert . X509Certificate [ ] getAcceptedIssuers ( ) { return null ; } public void checkClientTrusted ( java . security . cert . X509Certificate [ ] cert , String foo ) { } public void checkServerTrusted ( java . security . cert . X509Certificate [ ] cert , String foo ) { } } ; context . init ( null , new javax . net . ssl . TrustManager [ ] { tm } , null ) ; SSLSocketFactory factory = context . getSocketFactory ( ) ; s = factory . createSocket ( s , host , port , true ) ; } } catch ( ConnectException e ) { throw new ConnectException ( path . getURL ( ) + ": " + e . getMessage ( ) ) ; } catch ( Exception e ) { throw new ConnectException ( path . getURL ( ) + ": " + e . toString ( ) ) ; } int socketTimeout = 300 * 1000 ; try { s . setSoTimeout ( socketTimeout ) ; } catch ( Exception e ) { } return new HttpStream ( path , host , port , s ) ;
public class KeyVaultClientBaseImpl { /** * Wraps a symmetric key using a specified key . * The WRAP operation supports encryption of a symmetric key using a key encryption key that has previously been stored in an Azure Key Vault . The WRAP operation is only strictly necessary for symmetric keys stored in Azure Key Vault since protection with an asymmetric key can be performed using the public portion of the key . This operation is supported for asymmetric keys as a convenience for callers that have a key - reference but do not have access to the public key material . This operation requires the keys / wrapKey permission . * @ param vaultBaseUrl The vault name , for example https : / / myvault . vault . azure . net . * @ param keyName The name of the key . * @ param keyVersion The version of the key . * @ param algorithm algorithm identifier . Possible values include : ' RSA - OAEP ' , ' RSA - OAEP - 256 ' , ' RSA1_5' * @ param value the Base64Url value * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws KeyVaultErrorException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the KeyOperationResult object if successful . */ public KeyOperationResult wrapKey ( String vaultBaseUrl , String keyName , String keyVersion , JsonWebKeyEncryptionAlgorithm algorithm , byte [ ] value ) { } }
return wrapKeyWithServiceResponseAsync ( vaultBaseUrl , keyName , keyVersion , algorithm , value ) . toBlocking ( ) . single ( ) . body ( ) ;
public class JSONUtil { /** * 将map转化为json * @ param map * @ return */ public String formatMap2JSON ( Map < String , Object > map ) { } }
StringWriter stringWriter = new StringWriter ( ) ; String json = "" ; try { JsonGenerator gen = new JsonFactory ( ) . createJsonGenerator ( stringWriter ) ; MAPPER . writeValue ( gen , map ) ; gen . close ( ) ; json = stringWriter . toString ( ) ; } catch ( Exception e ) { LOGGER . error ( "" , e ) ; } return json ;
public class PublicIPAddressesInner { /** * Updates public IP address tags . * @ param resourceGroupName The name of the resource group . * @ param publicIpAddressName The name of the public IP address . * @ param tags Resource tags . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < PublicIPAddressInner > updateTagsAsync ( String resourceGroupName , String publicIpAddressName , Map < String , String > tags , final ServiceCallback < PublicIPAddressInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( updateTagsWithServiceResponseAsync ( resourceGroupName , publicIpAddressName , tags ) , serviceCallback ) ;
public class StackUtils { /** * スタックの先頭の要素 ( 一番上の要素 ) が引数で指定した文字列の何れかと等しいかどうか比較する 。 * @ param stack * @ param strs 比較する文字列の配列 * @ return */ public static boolean equalsAnyTopElement ( final LinkedList < String > stack , final String [ ] strs ) { } }
ArgUtils . notNull ( stack , "stack" ) ; ArgUtils . notEmpty ( strs , "strs" ) ; if ( stack . isEmpty ( ) ) { return false ; } final String top = stack . peekFirst ( ) ; for ( String str : strs ) { if ( str . equals ( top ) ) { return true ; } } return false ;
public class WindowTinyLfuPolicy { /** * Moves the entry to the MRU position in the admission window . */ private void onWindowHit ( Node node ) { } }
admittor . record ( node . key ) ; node . moveToTail ( headWindow ) ;
public class CPDAvailabilityEstimateLocalServiceUtil { /** * Returns all the cpd availability estimates matching the UUID and company . * @ param uuid the UUID of the cpd availability estimates * @ param companyId the primary key of the company * @ return the matching cpd availability estimates , or an empty list if no matches were found */ public static java . util . List < com . liferay . commerce . model . CPDAvailabilityEstimate > getCPDAvailabilityEstimatesByUuidAndCompanyId ( String uuid , long companyId ) { } }
return getService ( ) . getCPDAvailabilityEstimatesByUuidAndCompanyId ( uuid , companyId ) ;
public class SuppressionParser { /** * Parses the given XML stream and returns a list of the suppression rules * contained . * @ param inputStream an InputStream containing suppression rules * @ return a list of suppression rules * @ throws SuppressionParseException thrown if the XML cannot be parsed * @ throws SAXException thrown if the XML cannot be parsed */ public List < SuppressionRule > parseSuppressionRules ( InputStream inputStream ) throws SuppressionParseException , SAXException { } }
try ( InputStream schemaStream12 = FileUtils . getResourceAsStream ( SUPPRESSION_SCHEMA_1_2 ) ; InputStream schemaStream11 = FileUtils . getResourceAsStream ( SUPPRESSION_SCHEMA_1_1 ) ; InputStream schemaStream10 = FileUtils . getResourceAsStream ( SUPPRESSION_SCHEMA_1_0 ) ; ) { final SuppressionHandler handler = new SuppressionHandler ( ) ; final SAXParser saxParser = XmlUtils . buildSecureSaxParser ( schemaStream12 , schemaStream11 , schemaStream10 ) ; final XMLReader xmlReader = saxParser . getXMLReader ( ) ; xmlReader . setErrorHandler ( new SuppressionErrorHandler ( ) ) ; xmlReader . setContentHandler ( handler ) ; try ( Reader reader = new InputStreamReader ( inputStream , StandardCharsets . UTF_8 ) ) { final InputSource in = new InputSource ( reader ) ; xmlReader . parse ( in ) ; return handler . getSuppressionRules ( ) ; } } catch ( ParserConfigurationException | FileNotFoundException ex ) { LOGGER . debug ( "" , ex ) ; throw new SuppressionParseException ( ex ) ; } catch ( SAXException ex ) { if ( ex . getMessage ( ) . contains ( "Cannot find the declaration of element 'suppressions'." ) ) { throw ex ; } else { LOGGER . debug ( "" , ex ) ; throw new SuppressionParseException ( ex ) ; } } catch ( IOException ex ) { LOGGER . debug ( "" , ex ) ; throw new SuppressionParseException ( ex ) ; }
public class TextBox { /** * Sets a pattern on which the content of the text box is to be validated . For multi - line TextBox : s , the pattern is * checked against each line individually , not the content as a whole . Partial matchings will not be allowed , the * whole pattern must match , however , empty lines will always be allowed . When the user tried to modify the content * of the TextBox in a way that does not match the pattern , the operation will be silently ignored . If you set this * pattern to { @ code null } , all validation is turned off . * @ param validationPattern Pattern to validate the lines in this TextBox against , or { @ code null } to disable * @ return itself */ public synchronized TextBox setValidationPattern ( Pattern validationPattern ) { } }
if ( validationPattern != null ) { for ( String line : lines ) { if ( ! validated ( line ) ) { throw new IllegalStateException ( "TextBox validation pattern " + validationPattern + " does not match existing content" ) ; } } } this . validationPattern = validationPattern ; return this ;
public class BaseDAO { /** * Clear entry . * @ param key Key for internal preference entry . * @ return Returns true if the new values were successfully written */ boolean clear ( String key ) { } }
SharedPreferences . Editor editor = sharedPreferences . edit ( ) ; editor . remove ( key ) ; return editor . commit ( ) ;
public class OffsetDateTime { /** * Obtains the current date - time from the specified clock . * This will query the specified clock to obtain the current date - time . * The offset will be calculated from the time - zone in the clock . * Using this method allows the use of an alternate clock for testing . * The alternate clock may be introduced using { @ link Clock dependency injection } . * @ param clock the clock to use , not null * @ return the current date - time , not null */ public static OffsetDateTime now ( Clock clock ) { } }
Objects . requireNonNull ( clock , "clock" ) ; final Instant now = clock . instant ( ) ; // called once return ofInstant ( now , clock . getZone ( ) . getRules ( ) . getOffset ( now ) ) ;
public class DB2Helper { /** * Determine if the top level exception is an authorization exception . * Chained exceptions are not checked . * Look for the JDBC 4.0 exception subclass * or the 28000 SQLState ( Invalid authorization specification ) * or a DB2 error code in ( - 1403 , - 4214 , - 30082) * or an exception message containing the text [ 2013] * @ param x the exception to check . * @ return true or false to indicate if the exception is an authorization error . * @ throws NullPointerException if a NULL exception parameter is supplied . */ boolean isAuthException ( SQLException x ) { } }
int ec = x . getErrorCode ( ) ; return x instanceof SQLInvalidAuthorizationSpecException || "28000" . equals ( x . getSQLState ( ) ) // Authorization name is invalid || - 1403 == ec // The username and / or password supplied is incorrect . || - 4214 == ec || - 30082 == ec // CONNECTION FAILED FOR SECURITY REASON // [ ibm ] [ db2 ] [ jcc ] [ t4 ] [ 2013 ] [ 11249 ] Connection authorization failure occurred . Reason : User ID or Password invalid . || x . getMessage ( ) != null && x . getMessage ( ) . indexOf ( "[2013]" ) > 0 ;
public class WebApplicationHandler { public synchronized void removeContextAttribute ( String name ) { } }
Object old = super . getContextAttribute ( name ) ; super . removeContextAttribute ( name ) ; if ( old != null && _contextAttributeListeners != null ) { ServletContextAttributeEvent event = new ServletContextAttributeEvent ( getServletContext ( ) , name , old ) ; for ( int i = 0 ; i < LazyList . size ( _contextAttributeListeners ) ; i ++ ) { ServletContextAttributeListener l = ( ServletContextAttributeListener ) LazyList . get ( _contextAttributeListeners , i ) ; l . attributeRemoved ( event ) ; } }
public class ConnectResponse { /** * Returns a textual representation of the status code . * @ return short description of status as string */ public String getStatusString ( ) { } }
switch ( status ) { case ErrorCodes . NO_ERROR : return "the connection was established successfully" ; case ErrorCodes . CONNECTION_TYPE : return "the requested connection type is not supported" ; case ErrorCodes . CONNECTION_OPTION : return "one or more connection options are not supported" ; case ErrorCodes . NO_MORE_CONNECTIONS : return "could not accept new connection (maximum reached)" ; case NoMoreUniqueConnections : return "KNXnet/IP tunneling address for connection is not unique" ; case ErrorCodes . KNX_CONNECTION : return "server detected error concerning KNX subsystem connection" ; case ErrorCodes . TUNNELING_LAYER : return "the requested tunneling layer is not supported" ; case AuthError : return "authorization error" ; case NoTunnelingAddress : return "requested address is not a tunneling address" ; case ConnectionInUse : return "requested address is in use" ; case Error : return "undefined error" ; default : return "unknown status" ; }
public class Transport { /** * Returns the shared instance with the specified parameters . */ public static Transport getInstance ( Type type , int channel ) { } }
// were there more parameters in transport objects , it would be better to have a single map // of instances and use Transport objects as keys ( as in examples of the flyweight // pattern ) . however , doing it this way avoids the need to create a new object on lookup if ( _unordered == null ) { int length = Type . values ( ) . length ; _unordered = new Transport [ length ] ; @ SuppressWarnings ( { "unchecked" } ) HashIntMap < Transport > [ ] ordered = ( HashIntMap < Transport > [ ] ) new HashIntMap < ? > [ length ] ; _ordered = ordered ; } // for unordered transport , we map on the type alone int idx = type . ordinal ( ) ; if ( ! type . isOrdered ( ) ) { Transport instance = _unordered [ idx ] ; if ( instance == null ) { _unordered [ idx ] = instance = new Transport ( type ) ; } return instance ; } // for ordered transport , we map on the type and channel HashIntMap < Transport > instances = _ordered [ idx ] ; if ( instances == null ) { _ordered [ idx ] = instances = new HashIntMap < Transport > ( ) ; } Transport instance = instances . get ( channel ) ; if ( instance == null ) { instances . put ( channel , instance = new Transport ( type , channel ) ) ; } return instance ;
public class Request { /** * Returns an object attribute from a given key * @ param key The key the attribute is stored * @ return Object the value from the attribues map */ public Object getAttribute ( String key ) { } }
Objects . requireNonNull ( key , Required . KEY . toString ( ) ) ; return this . attributes . get ( key ) ;
public class SlimSkin { /** * * * * * * Initialization * * * * * */ private void initGraphics ( ) { } }
// Set initial size if ( Double . compare ( gauge . getPrefWidth ( ) , 0.0 ) <= 0 || Double . compare ( gauge . getPrefHeight ( ) , 0.0 ) <= 0 || Double . compare ( gauge . getWidth ( ) , 0.0 ) <= 0 || Double . compare ( gauge . getHeight ( ) , 0.0 ) <= 0 ) { if ( gauge . getPrefWidth ( ) > 0 && gauge . getPrefHeight ( ) > 0 ) { gauge . setPrefSize ( gauge . getPrefWidth ( ) , gauge . getPrefHeight ( ) ) ; } else { gauge . setPrefSize ( PREFERRED_WIDTH , PREFERRED_HEIGHT ) ; } } barBackground = new Arc ( PREFERRED_WIDTH * 0.5 , PREFERRED_HEIGHT * 0.5 , PREFERRED_WIDTH * 0.48590226 , PREFERRED_HEIGHT * 0.48590226 , 90 , 360 ) ; barBackground . setType ( ArcType . OPEN ) ; barBackground . setStroke ( gauge . getBarBackgroundColor ( ) ) ; barBackground . setStrokeWidth ( PREFERRED_WIDTH * 0.02819549 * 2 ) ; barBackground . setStrokeLineCap ( StrokeLineCap . ROUND ) ; barBackground . setFill ( null ) ; bar = new Arc ( PREFERRED_WIDTH * 0.5 , PREFERRED_HEIGHT * 0.5 , PREFERRED_WIDTH * 0.48590226 , PREFERRED_HEIGHT * 0.48590226 , 90 , 0 ) ; bar . setType ( ArcType . OPEN ) ; bar . setStroke ( gauge . getBarColor ( ) ) ; bar . setStrokeWidth ( PREFERRED_WIDTH * 0.02819549 * 2 ) ; bar . setStrokeLineCap ( StrokeLineCap . ROUND ) ; bar . setFill ( null ) ; titleText = new Text ( gauge . getTitle ( ) ) ; titleText . setFill ( gauge . getTitleColor ( ) ) ; Helper . enableNode ( titleText , ! gauge . getTitle ( ) . isEmpty ( ) ) ; valueText = new Text ( formatNumber ( gauge . getLocale ( ) , gauge . getFormatString ( ) , gauge . getDecimals ( ) , gauge . getCurrentValue ( ) ) ) ; valueText . setFill ( gauge . getValueColor ( ) ) ; Helper . enableNode ( valueText , gauge . isValueVisible ( ) ) ; unitText = new Text ( gauge . getUnit ( ) ) ; unitText . setFill ( gauge . getUnitColor ( ) ) ; Helper . enableNode ( unitText , ! gauge . getUnit ( ) . isEmpty ( ) ) ; pane = new Pane ( barBackground , bar , titleText , valueText , unitText ) ; pane . setBorder ( new Border ( new BorderStroke ( gauge . getBorderPaint ( ) , BorderStrokeStyle . SOLID , new CornerRadii ( 1024 ) , new BorderWidths ( gauge . getBorderWidth ( ) ) ) ) ) ; pane . setBackground ( new Background ( new BackgroundFill ( gauge . getBackgroundPaint ( ) , new CornerRadii ( 1024 ) , Insets . EMPTY ) ) ) ; getChildren ( ) . setAll ( pane ) ;
public class Common { /** * Get a file to read the raw contents of the given resource : ) */ public static File getResourceAsFile ( Class < ? > clazz , String fn ) throws IOException { } }
URL url = clazz . getResource ( fn ) ; if ( url == null || url . getFile ( ) == null ) { throw new IOException ( "resource \"" + fn + "\" relative to " + clazz + " not found." ) ; } return new File ( url . getFile ( ) ) ;
public class PageFlowActionFormBean { /** * Create and return an < code > ActionForm < / code > instance appropriate * to the information in this < code > FormBeanConfig < / code > . * This is different than the base implementation in that it uses our ReloadableClassHandler * to load the form bean class . * @ param servlet The action servlet * @ return ActionForm instance * @ exception IllegalAccessException if the Class or the appropriate * constructor is not accessible * @ exception InstantiationException if this Class represents an abstract * class , an array class , a primitive type , or void ; or if instantiation * fails for some other reason */ public ActionForm createActionForm ( ActionServlet servlet ) throws IllegalAccessException , InstantiationException { } }
// Create a new form bean instance if ( getDynamic ( ) ) { return super . createActionForm ( servlet ) ; } try { ReloadableClassHandler rch = Handlers . get ( servlet . getServletContext ( ) ) . getReloadableClassHandler ( ) ; Object obj = rch . newInstance ( getType ( ) ) ; assert obj instanceof ActionForm : obj . getClass ( ) . getName ( ) ; ActionForm form = ( ActionForm ) obj ; form . setServlet ( servlet ) ; return form ; } catch ( ClassNotFoundException e ) { _log . error ( "Could not find form bean class " + getType ( ) , e ) ; return null ; }
public class AppClassLoader { /** * Scan libraries to find classes . */ public void scanLibraries ( String rootPackage , boolean includeSubPackages , Filter < String > packageFilter , Filter < String > classFilter , Listener < Class < ? > > classScanner ) { } }
for ( AbstractClassLoader cl : libs ) cl . scan ( rootPackage , includeSubPackages , packageFilter , classFilter , classScanner ) ;
public class CPDefinitionOptionRelPersistenceImpl { /** * Returns the cp definition option rels before and after the current cp definition option rel in the ordered set where groupId = & # 63 ; . * @ param CPDefinitionOptionRelId the primary key of the current cp definition option rel * @ param groupId the group ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the previous , current , and next cp definition option rel * @ throws NoSuchCPDefinitionOptionRelException if a cp definition option rel with the primary key could not be found */ @ Override public CPDefinitionOptionRel [ ] findByGroupId_PrevAndNext ( long CPDefinitionOptionRelId , long groupId , OrderByComparator < CPDefinitionOptionRel > orderByComparator ) throws NoSuchCPDefinitionOptionRelException { } }
CPDefinitionOptionRel cpDefinitionOptionRel = findByPrimaryKey ( CPDefinitionOptionRelId ) ; Session session = null ; try { session = openSession ( ) ; CPDefinitionOptionRel [ ] array = new CPDefinitionOptionRelImpl [ 3 ] ; array [ 0 ] = getByGroupId_PrevAndNext ( session , cpDefinitionOptionRel , groupId , orderByComparator , true ) ; array [ 1 ] = cpDefinitionOptionRel ; array [ 2 ] = getByGroupId_PrevAndNext ( session , cpDefinitionOptionRel , groupId , orderByComparator , false ) ; return array ; } catch ( Exception e ) { throw processException ( e ) ; } finally { closeSession ( session ) ; }
public class JKJdbcUtil { public static byte [ ] getBinaryStream ( final ResultSet rs , final String name ) throws SQLException { } }
final InputStream in = rs . getBinaryStream ( name ) ; if ( in == null ) { return null ; } return JKIOUtil . readStream ( in ) ;
public class FeedCommProcessor { /** * Connects to the websocket endpoint . This first attempts to disconnect to any existing connection . * If this object has previously been { @ link # destroy ( ) destroyed } , then the connect request is ignored . * @ throws Exception on failure */ public void connect ( ) throws Exception { } }
disconnect ( ) ; // disconnect from any old connection we had if ( destroyed ) { return ; } log . debugf ( "About to connect a feed WebSocket client to endpoint [%s]" , feedcommUrl ) ; webSocketCall = webSocketClientBuilder . createWebSocketCall ( feedcommUrl , null ) ; webSocketCall . enqueue ( this ) ;
public class OLevel2RecordCache { /** * Push record to cache . Identifier of record used as access key * @ param fresh * new record that should be cached */ public void updateRecord ( final ORecordInternal < ? > fresh ) { } }
if ( ! isEnabled ( ) || fresh == null || fresh . isDirty ( ) || fresh . getIdentity ( ) . isNew ( ) || ! fresh . getIdentity ( ) . isValid ( ) || fresh . getIdentity ( ) . getClusterId ( ) == excludedCluster ) return ; if ( fresh . isPinned ( ) == null || fresh . isPinned ( ) ) { underlying . lock ( fresh . getIdentity ( ) ) ; try { final ORecordInternal < ? > current = underlying . get ( fresh . getIdentity ( ) ) ; if ( current != null && current . getVersion ( ) >= fresh . getVersion ( ) ) return ; if ( ODatabaseRecordThreadLocal . INSTANCE . isDefined ( ) && ! ODatabaseRecordThreadLocal . INSTANCE . get ( ) . isClosed ( ) ) // CACHE A COPY underlying . put ( ( ORecordInternal < ? > ) fresh . flatCopy ( ) ) ; else { // CACHE THE DETACHED RECORD fresh . detach ( ) ; underlying . put ( fresh ) ; } } finally { underlying . unlock ( fresh . getIdentity ( ) ) ; } } else underlying . remove ( fresh . getIdentity ( ) ) ;
public class AbstractConsumerKey { /** * Returns the consumerSet . * @ return consumerSet */ public JSConsumerSet getConsumerSet ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getConsumerSet" ) ; SibTr . exit ( tc , "getConsumerSet" , consumerSet ) ; } return consumerSet ;
public class ImageUtils { /** * A convenience method for getting ARGB pixels from an image . This tries to avoid the performance * penalty of BufferedImage . getRGB unmanaging the image . * @ param image a BufferedImage object * @ param x the left edge of the pixel block * @ param y the right edge of the pixel block * @ param width the width of the pixel arry * @ param height the height of the pixel arry * @ param pixels the array to hold the returned pixels . May be null . * @ return the pixels * @ see # setRGB */ public static int [ ] getRGB ( BufferedImage image , int x , int y , int width , int height , int [ ] pixels ) { } }
int type = image . getType ( ) ; if ( type == BufferedImage . TYPE_INT_ARGB || type == BufferedImage . TYPE_INT_RGB ) return ( int [ ] ) image . getRaster ( ) . getDataElements ( x , y , width , height , pixels ) ; return image . getRGB ( x , y , width , height , pixels , 0 , width ) ;
public class TrainingsImpl { /** * Delete a tag from the project . * @ param projectId The project id * @ param tagId Id of the tag to be deleted * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceResponse } object if successful . */ public Observable < ServiceResponse < Void > > deleteTagWithServiceResponseAsync ( UUID projectId , UUID tagId ) { } }
if ( projectId == null ) { throw new IllegalArgumentException ( "Parameter projectId is required and cannot be null." ) ; } if ( tagId == null ) { throw new IllegalArgumentException ( "Parameter tagId is required and cannot be null." ) ; } if ( this . client . apiKey ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiKey() is required and cannot be null." ) ; } return service . deleteTag ( projectId , tagId , this . client . apiKey ( ) , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < Void > > > ( ) { @ Override public Observable < ServiceResponse < Void > > call ( Response < ResponseBody > response ) { try { ServiceResponse < Void > clientResponse = deleteTagDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class RequireReleaseDeps { /** * Filter the dependency artifacts according to the includes and excludes * If includes and excludes are both null , the original set is returned . * @ param dependencies the list of dependencies to filter * @ return the resulting set of dependencies */ public Set < Artifact > filterArtifacts ( Set < Artifact > dependencies ) { } }
if ( includes == null && excludes == null ) { return dependencies ; } AndArtifactFilter filter = new AndArtifactFilter ( ) ; if ( includes != null ) { filter . add ( new StrictPatternIncludesArtifactFilter ( includes ) ) ; } if ( excludes != null ) { filter . add ( new StrictPatternExcludesArtifactFilter ( excludes ) ) ; } Set < Artifact > result = new HashSet < Artifact > ( ) ; for ( Artifact artifact : dependencies ) { if ( filter . include ( artifact ) ) { result . add ( artifact ) ; } } return result ;
public class SequenceFileInputFilter { /** * set the filter class * @ param conf application configuration * @ param filterClass filter class */ public static void setFilterClass ( Configuration conf , Class filterClass ) { } }
conf . set ( FILTER_CLASS , filterClass . getName ( ) ) ;
public class ParameterMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Parameter parameter , ProtocolMarshaller protocolMarshaller ) { } }
if ( parameter == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( parameter . getParameterName ( ) , PARAMETERNAME_BINDING ) ; protocolMarshaller . marshall ( parameter . getParameterType ( ) , PARAMETERTYPE_BINDING ) ; protocolMarshaller . marshall ( parameter . getParameterValue ( ) , PARAMETERVALUE_BINDING ) ; protocolMarshaller . marshall ( parameter . getNodeTypeSpecificValues ( ) , NODETYPESPECIFICVALUES_BINDING ) ; protocolMarshaller . marshall ( parameter . getDescription ( ) , DESCRIPTION_BINDING ) ; protocolMarshaller . marshall ( parameter . getSource ( ) , SOURCE_BINDING ) ; protocolMarshaller . marshall ( parameter . getDataType ( ) , DATATYPE_BINDING ) ; protocolMarshaller . marshall ( parameter . getAllowedValues ( ) , ALLOWEDVALUES_BINDING ) ; protocolMarshaller . marshall ( parameter . getIsModifiable ( ) , ISMODIFIABLE_BINDING ) ; protocolMarshaller . marshall ( parameter . getChangeType ( ) , CHANGETYPE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class RowMapper { /** * @ param rs * @ param columnName * @ return * @ throws java . sql . SQLException */ public final Element mapRow ( final ResultSet rs , final String columnName ) throws SQLException { } }
final Element element = new Element ( ) ; List < String > l ; try { l = ParseUtils . postgresROW2StringList ( rs . getString ( columnName ) ) ; } catch ( RowParserException e ) { throw new SQLException ( e ) ; } element . setRowList ( l ) ; return element ;
public class NotificationManager { /** * Sends a notification to system administrators through all configured * notifiers of a given type . * @ param type of notification to be sent * @ param subject of the notification * @ param message of the notification */ public void sendAdminNotification ( NotificationType type , String subject , String message ) { } }
for ( Notifier notifier : notifiers ) { if ( notifier . getNotificationType ( ) . equals ( type ) ) { notifier . notifyAdmins ( subject , message ) ; } }
public class RetrieveDomainAuthCodeRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( RetrieveDomainAuthCodeRequest retrieveDomainAuthCodeRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( retrieveDomainAuthCodeRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( retrieveDomainAuthCodeRequest . getDomainName ( ) , DOMAINNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class DatabaseSession { /** * Get the database properties . * @ return The database properties object ( Always non - null ) . */ synchronized public void setDBProperties ( Map < String , Object > properties ) throws DBException , RemoteException { } }
m_database . setProperties ( properties ) ;
public class EJSHome { /** * Get a wrapper for the given BeanId < p > */ @ Override public final EJSWrapperCommon getWrapper ( BeanId id ) // f111627 throws CSIException , RemoteException { } }
homeEnabled ( ) ; return wrapperManager . getWrapper ( id ) ; // d156807.1
public class ListOperationCallback { /** * This method is called by the client to load the most recent list of resources . * This method should only be called by the service client . * @ param result the most recent list of resources . */ public void load ( List < E > result ) { } }
++ pageCount ; if ( this . result == null || this . result . isEmpty ( ) ) { this . result = result ; } else { this . result . addAll ( result ) ; }
public class JsonSerializer { /** * Returns the object of the specified class represented by the specified JSON { @ code String } . * @ param value the JSON { @ code String } to be parsed * @ param valueType the class of the object to be parsed * @ param < T > the type of the object to be parsed * @ return an object of the specified class represented by { @ code value } * @ throws IOException if there are parsing problems */ public static < T > T fromString ( String value , Class < T > valueType ) throws IOException { } }
return INSTANCE . mapper . readValue ( value , valueType ) ;
public class UnitQuaternions { /** * The angle of the relative orientation of the two sets of points in 3D . * Equivalent to { @ link # angle ( Quat4d ) } of the unit quaternion obtained by * { @ link # relativeOrientation ( Point3d [ ] , Point3d [ ] ) } . * @ param fixed * array of Point3d . Original coordinates will not be modified . * @ param moved * array of Point3d . Original coordinates will not be modified . * @ param centered * true if the points are already centered at the origin * @ return the angle in radians of the relative orientation of the points , * angle to rotate moved to bring it to the same orientation as * fixed . */ public static double orientationAngle ( Point3d [ ] fixed , Point3d [ ] moved , boolean centered ) { } }
if ( ! centered ) { fixed = CalcPoint . clonePoint3dArray ( fixed ) ; moved = CalcPoint . clonePoint3dArray ( moved ) ; CalcPoint . center ( fixed ) ; CalcPoint . center ( moved ) ; } return orientationAngle ( fixed , moved ) ;
public class TrajectoryValidIndexTimelagIterator { /** * Give next index i where i and i + timelag is valid */ public Integer next ( ) { } }
for ( int i = currentIndex ; i < t . size ( ) ; i ++ ) { if ( i + timelag >= t . size ( ) ) { return null ; } if ( ( t . get ( i ) != null ) && ( t . get ( i + timelag ) != null ) ) { if ( overlap ) { currentIndex = i + 1 ; } else { currentIndex = i + timelag ; } return i ; } } return null ;
public class LenientDeserializer { @ Override public MetaProperty < ? > findMetaProperty ( Class < ? > beanType , MetaBean metaBean , String propertyName ) { } }
// dynamic beans force code by exception try { return metaBean . metaProperty ( propertyName ) ; } catch ( NoSuchElementException ex ) { return null ; }
public class StartSearchFilter { /** * Constructor . * NOTE : I use the same exact init params as super since this is a client / server filter . * @ param record My owner ( usually passed as null , and set on addListener in setOwner ( ) ) . * @ param pfldToCompare The field to compare . */ public void init ( Record record , String strToCompare , String strSeekSign , Converter pconvFlag , boolean bDontFilterIfNullCompare , BaseField fldToCheck , BaseField fldToCompare ) { } }
m_fldFakeDate = null ; super . init ( record , null , strToCompare , null , pconvFlag , bDontFilterIfNullCompare , fldToCheck , fldToCompare ) ; if ( strSeekSign == null ) m_strSeekSign = DBConstants . BLANK ; // I Must do this here because I don ' t want the default value
public class CSSCompressMojo { /** * Check if the passed file is already compressed . The check is only done * using the file extension of the file name . * @ param sFilename * The filename to be checked . * @ return < code > true < / code > if the file is already compressed . */ private static boolean _isAlreadyCompressed ( final String sFilename ) { } }
for ( final String sExt : EXTENSIONS_CSS_COMPRESSED ) if ( sFilename . endsWith ( sExt ) ) return true ; return false ;
public class DRL5Expressions { /** * src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 630:1 : arrayInitializer : LEFT _ CURLY ( variableInitializer ( COMMA variableInitializer ) * ( COMMA ) ? ) ? RIGHT _ CURLY ; */ public final void arrayInitializer ( ) throws RecognitionException { } }
try { // src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 631:5 : ( LEFT _ CURLY ( variableInitializer ( COMMA variableInitializer ) * ( COMMA ) ? ) ? RIGHT _ CURLY ) // src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 631:7 : LEFT _ CURLY ( variableInitializer ( COMMA variableInitializer ) * ( COMMA ) ? ) ? RIGHT _ CURLY { match ( input , LEFT_CURLY , FOLLOW_LEFT_CURLY_in_arrayInitializer3669 ) ; if ( state . failed ) return ; // src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 631:18 : ( variableInitializer ( COMMA variableInitializer ) * ( COMMA ) ? ) ? int alt79 = 2 ; int LA79_0 = input . LA ( 1 ) ; if ( ( LA79_0 == BOOL || ( LA79_0 >= DECIMAL && LA79_0 <= DECR ) || LA79_0 == FLOAT || LA79_0 == HEX || ( LA79_0 >= ID && LA79_0 <= INCR ) || ( LA79_0 >= LEFT_CURLY && LA79_0 <= LESS ) || LA79_0 == MINUS || LA79_0 == NEGATION || LA79_0 == NULL || LA79_0 == PLUS || ( LA79_0 >= STAR && LA79_0 <= TIME_INTERVAL ) ) ) { alt79 = 1 ; } switch ( alt79 ) { case 1 : // src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 631:19 : variableInitializer ( COMMA variableInitializer ) * ( COMMA ) ? { pushFollow ( FOLLOW_variableInitializer_in_arrayInitializer3672 ) ; variableInitializer ( ) ; state . _fsp -- ; if ( state . failed ) return ; // src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 631:39 : ( COMMA variableInitializer ) * loop77 : while ( true ) { int alt77 = 2 ; int LA77_0 = input . LA ( 1 ) ; if ( ( LA77_0 == COMMA ) ) { int LA77_1 = input . LA ( 2 ) ; if ( ( LA77_1 == BOOL || ( LA77_1 >= DECIMAL && LA77_1 <= DECR ) || LA77_1 == FLOAT || LA77_1 == HEX || ( LA77_1 >= ID && LA77_1 <= INCR ) || ( LA77_1 >= LEFT_CURLY && LA77_1 <= LESS ) || LA77_1 == MINUS || LA77_1 == NEGATION || LA77_1 == NULL || LA77_1 == PLUS || ( LA77_1 >= STAR && LA77_1 <= TIME_INTERVAL ) ) ) { alt77 = 1 ; } } switch ( alt77 ) { case 1 : // src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 631:40 : COMMA variableInitializer { match ( input , COMMA , FOLLOW_COMMA_in_arrayInitializer3675 ) ; if ( state . failed ) return ; pushFollow ( FOLLOW_variableInitializer_in_arrayInitializer3677 ) ; variableInitializer ( ) ; state . _fsp -- ; if ( state . failed ) return ; } break ; default : break loop77 ; } } // src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 631:68 : ( COMMA ) ? int alt78 = 2 ; int LA78_0 = input . LA ( 1 ) ; if ( ( LA78_0 == COMMA ) ) { alt78 = 1 ; } switch ( alt78 ) { case 1 : // src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 631:69 : COMMA { match ( input , COMMA , FOLLOW_COMMA_in_arrayInitializer3682 ) ; if ( state . failed ) return ; } break ; } } break ; } match ( input , RIGHT_CURLY , FOLLOW_RIGHT_CURLY_in_arrayInitializer3689 ) ; if ( state . failed ) return ; } } catch ( RecognitionException re ) { throw re ; } finally { // do for sure before leaving }
public class ValueTaglet { /** * { @ inheritDoc } */ public Content getTagletOutput ( Tag tag , TagletWriter writer ) { } }
FieldDoc field = getFieldDoc ( writer . configuration ( ) , tag , tag . text ( ) ) ; if ( field == null ) { if ( tag . text ( ) . isEmpty ( ) ) { // Invalid use of @ value writer . getMsgRetriever ( ) . warning ( tag . holder ( ) . position ( ) , "doclet.value_tag_invalid_use" ) ; } else { // Reference is unknown . writer . getMsgRetriever ( ) . warning ( tag . holder ( ) . position ( ) , "doclet.value_tag_invalid_reference" , tag . text ( ) ) ; } } else if ( field . constantValue ( ) != null ) { return writer . valueTagOutput ( field , field . constantValueExpression ( ) , ! field . equals ( tag . holder ( ) ) ) ; } else { // Referenced field is not a constant . writer . getMsgRetriever ( ) . warning ( tag . holder ( ) . position ( ) , "doclet.value_tag_invalid_constant" , field . name ( ) ) ; } return writer . getOutputInstance ( ) ;