signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Matrix3x2d { /** * Unproject the given window coordinates < code > ( winX , winY ) < / code > by < code > this < / code > matrix using the specified viewport .
* This method first converts the given window coordinates to normalized device coordinates in the range < code > [ - 1 . . 1 ] < / code >
* and then transforms those NDC coordinates by the inverse of < code > this < / code > matrix .
* As a necessary computation step for unprojecting , this method computes the inverse of < code > this < / code > matrix .
* In order to avoid computing the matrix inverse with every invocation , the inverse of < code > this < / code > matrix can be built
* once outside using { @ link # invert ( Matrix3x2d ) } and then the method { @ link # unprojectInv ( double , double , int [ ] , Vector2d ) unprojectInv ( ) } can be invoked on it .
* @ see # unprojectInv ( double , double , int [ ] , Vector2d )
* @ see # invert ( Matrix3x2d )
* @ param winX
* the x - coordinate in window coordinates ( pixels )
* @ param winY
* the y - coordinate in window coordinates ( pixels )
* @ param viewport
* the viewport described by < code > [ x , y , width , height ] < / code >
* @ param dest
* will hold the unprojected position
* @ return dest */
public Vector2d unproject ( double winX , double winY , int [ ] viewport , Vector2d dest ) { } } | double s = 1.0 / ( m00 * m11 - m01 * m10 ) ; double im00 = m11 * s ; double im01 = - m01 * s ; double im10 = - m10 * s ; double im11 = m00 * s ; double im20 = ( m10 * m21 - m20 * m11 ) * s ; double im21 = ( m20 * m01 - m00 * m21 ) * s ; double ndcX = ( winX - viewport [ 0 ] ) / viewport [ 2 ] * 2.0 - 1.0 ; double ndcY = ( winY - viewport [ 1 ] ) / viewport [ 3 ] * 2.0 - 1.0 ; dest . x = im00 * ndcX + im10 * ndcY + im20 ; dest . y = im01 * ndcX + im11 * ndcY + im21 ; return dest ; |
public class PlatformDescription { /** * The custom AMIs supported by the platform .
* @ param customAmiList
* The custom AMIs supported by the platform . */
public void setCustomAmiList ( java . util . Collection < CustomAmi > customAmiList ) { } } | if ( customAmiList == null ) { this . customAmiList = null ; return ; } this . customAmiList = new com . amazonaws . internal . SdkInternalList < CustomAmi > ( customAmiList ) ; |
public class AssignabilityTypesVisitor { /** * Check lower bounded wildcard cases . Method is not called if upper bounds are not assignable .
* When left is not lower bound - compatibility will be checked by type walker and when compatible always
* assignable . For example , String compatible ( and assignable ) with ? super String and Integer is not compatible
* with ? super Number ( and not assignable ) .
* Wen right is not lower bound , when left is then it will be never assignable . For example ,
* ? super String is not assignable to String .
* When both lower wildcards : lower bounds must be from one hierarchy and left type should be lower .
* For example , ? super Integer and ? super BigInteger are not assignable in spite of the fact that they
* share some common types . ? super Number is more specific then ? super Integer ( super inverse meaning ) .
* @ param one first type
* @ param two second type
* @ return true when left is assignable to right , false otherwise */
private boolean checkLowerBounds ( final Type one , final Type two ) { } } | final boolean res ; // ? super Object is impossible here due to types cleanup in tree walker
if ( notLowerBounded ( one ) ) { // walker will check compatibility , and compatible type is always assignable to lower bounded wildcard
// e . g . Number assignable to ? super Number , but Integer not assignable to ? super Number
res = true ; } else if ( notLowerBounded ( two ) ) { // lower bound could not be assigned to anything else ( only opposite way is possible )
// for example , List < ? super String > is not assignable to List < String > , but
// List < String > is assignable to List < ? super String > ( previous condition )
res = false ; } else { // left type ' s bound must be lower : not a mistake ! left ( super inversion ) !
res = TypeUtils . isMoreSpecific ( ( ( WildcardType ) two ) . getLowerBounds ( ) [ 0 ] , ( ( WildcardType ) one ) . getLowerBounds ( ) [ 0 ] ) ; } return res ; |
public class FSDatasetAsyncDiskService { /** * Gracefully shut down all ThreadPool . Will wait for all deletion
* tasks to finish . */
synchronized void shutdown ( ) { } } | if ( executors == null ) { LOG . warn ( "AsyncDiskService has already shut down." ) ; } else { LOG . info ( "Shutting down all async disk service threads..." ) ; for ( Map . Entry < File , ThreadPoolExecutor > e : executors . entrySet ( ) ) { e . getValue ( ) . shutdown ( ) ; } // clear the executor map so that calling execute again will fail .
executors = null ; LOG . info ( "All async disk service threads have been shut down." ) ; } |
public class XPathContext { /** * Get the current context node list .
* @ return An iterator for the current context list , as
* defined in XSLT . */
public final DTMIterator getContextNodes ( ) { } } | try { DTMIterator cnl = getContextNodeList ( ) ; if ( null != cnl ) return cnl . cloneWithReset ( ) ; else return null ; // for now . . . this might ought to be an empty iterator .
} catch ( CloneNotSupportedException cnse ) { return null ; // error reporting ?
} |
public class RtfDocument { /** * Writes the document
* @ param out The < code > OutputStream < / code > to write the RTF document to . */
public void writeDocument ( OutputStream out ) { } } | try { out . write ( OPEN_GROUP ) ; out . write ( RtfDocument . RTF_DOCUMENT ) ; this . documentHeader . writeContent ( out ) ; this . data . writeTo ( out ) ; out . write ( CLOSE_GROUP ) ; } catch ( IOException ioe ) { ioe . printStackTrace ( ) ; } |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EEnum getGEPROLRES ( ) { } } | if ( geprolresEEnum == null ) { geprolresEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 140 ) ; } return geprolresEEnum ; |
public class FdfsResponse { /** * 解析反馈结果 , head已经被解析过
* @ param head
* @ param in
* @ param charset
* @ return
* @ throws IOException */
public T decode ( ProtoHead head , InputStream in , Charset charset ) throws IOException { } } | this . head = head ; return decodeContent ( in , charset ) ; |
public class MultiCacheMissHandler { /** * Attempts a resource retrieval from each of the provided
* < code > CacheMissHandler < / code > s ; as soon as one succeeds , it returns it as
* an < code > InputStream < / code > .
* @ return
* the resource as an < code > InputStream < / code > , as soon as any of the
* < code > CacheMissHandler < / code > s succeeds , null otherwise . */
public InputStream getAsStream ( ) throws CacheException { } } | List < Exception > exceptions = new ArrayList < Exception > ( ) ; for ( CacheMissHandler handler : handlers ) { try { logger . debug ( "trying handler of class '{}'" , handler . getClass ( ) ) ; InputStream stream = handler . getAsStream ( ) ; if ( stream != null ) { logger . debug ( "success, returning stream" ) ; return stream ; } } catch ( Exception e ) { logger . error ( "error during resource retrieval" , e ) ; exceptions . add ( e ) ; } } if ( ! exceptions . isEmpty ( ) ) { logger . warn ( "failure, resource not found, and {} exceptions occurred" , exceptions . size ( ) ) ; throw new CacheException ( "Resource not found" , exceptions ) ; } logger . warn ( "failure, resource not found" ) ; return null ; |
public class Link { /** * Factory method to easily create { @ link Link } instances from RFC - 5988 compatible { @ link String } representations of a
* link .
* @ param element an RFC - 5899 compatible representation of a link .
* @ throws IllegalArgumentException if a { @ link String } was given that does not adhere to RFC - 5899.
* @ throws IllegalArgumentException if no { @ code rel } attribute could be found .
* @ return */
public static Link valueOf ( String element ) { } } | if ( ! StringUtils . hasText ( element ) ) { throw new IllegalArgumentException ( String . format ( "Given link header %s is not RFC5988 compliant!" , element ) ) ; } Matcher matcher = URI_AND_ATTRIBUTES_PATTERN . matcher ( element ) ; if ( matcher . find ( ) ) { Map < String , String > attributes = getAttributeMap ( matcher . group ( 2 ) ) ; if ( ! attributes . containsKey ( "rel" ) ) { throw new IllegalArgumentException ( "Link does not provide a rel attribute!" ) ; } Link link = new Link ( matcher . group ( 1 ) , attributes . get ( "rel" ) ) ; if ( attributes . containsKey ( "hreflang" ) ) { link = link . withHreflang ( attributes . get ( "hreflang" ) ) ; } if ( attributes . containsKey ( "media" ) ) { link = link . withMedia ( attributes . get ( "media" ) ) ; } if ( attributes . containsKey ( "title" ) ) { link = link . withTitle ( attributes . get ( "title" ) ) ; } if ( attributes . containsKey ( "type" ) ) { link = link . withType ( attributes . get ( "type" ) ) ; } if ( attributes . containsKey ( "deprecation" ) ) { link = link . withDeprecation ( attributes . get ( "deprecation" ) ) ; } if ( attributes . containsKey ( "profile" ) ) { link = link . withProfile ( attributes . get ( "profile" ) ) ; } if ( attributes . containsKey ( "name" ) ) { link = link . withName ( attributes . get ( "name" ) ) ; } return link ; } else { throw new IllegalArgumentException ( String . format ( "Given link header %s is not RFC5988 compliant!" , element ) ) ; } |
public class QYWeixinSupport { /** * 自定义的消息事件处理
* @ param event 事件
* @ return 响应结果 */
private QYBaseRespMsg processEventHandle ( QYBaseEvent event ) { } } | if ( CollectionUtil . isEmpty ( eventHandles ) ) { synchronized ( LOCK ) { eventHandles = this . initEventHandles ( ) ; } } if ( CollectionUtil . isNotEmpty ( eventHandles ) ) { for ( QYEventHandle eventHandle : eventHandles ) { QYBaseRespMsg resultMsg = null ; boolean result ; try { result = eventHandle . beforeHandle ( event ) ; } catch ( Exception e ) { result = false ; } if ( result ) { resultMsg = eventHandle . handle ( event ) ; } if ( BeanUtil . nonNull ( resultMsg ) ) { return resultMsg ; } } } return null ; |
public class RegisteredResources { /** * Log any prepared resources */
protected void logResources ( ) throws SystemException { } } | if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "logResources" , _resourcesLogged ) ; if ( ! _resourcesLogged ) { for ( int i = 0 ; i < _resourceObjects . size ( ) ; i ++ ) { final JTAResource resource = _resourceObjects . get ( i ) ; if ( resource . getResourceStatus ( ) == StatefulResource . PREPARED ) { recordLog ( resource ) ; } } _resourcesLogged = true ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "logResources" ) ; |
public class FacesConfigTypeImpl { /** * If not already created , a new < code > factory < / code > element will be created and returned .
* Otherwise , the first existing < code > factory < / code > element will be returned .
* @ return the instance defined for the element < code > factory < / code > */
public FacesConfigFactoryType < FacesConfigType < T > > getOrCreateFactory ( ) { } } | List < Node > nodeList = childNode . get ( "factory" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new FacesConfigFactoryTypeImpl < FacesConfigType < T > > ( this , "factory" , childNode , nodeList . get ( 0 ) ) ; } return createFactory ( ) ; |
public class JobProperty { /** * { @ link Action } s to be displayed in the job page .
* Returning actions from this method allows a job property to add them
* to the left navigation bar in the job page .
* { @ link Action } can implement additional marker interface to integrate
* with the UI in different ways .
* @ param job
* Always the same as { @ link # owner } but passed in anyway for backward compatibility ( I guess . )
* You really need not use this value at all .
* @ return
* can be empty but never null .
* @ since 1.341
* @ see ProminentProjectAction
* @ see PermalinkProjectAction */
@ Nonnull public Collection < ? extends Action > getJobActions ( J job ) { } } | // delegate to getJobAction ( singular ) for backward compatible behavior
Action a = getJobAction ( job ) ; if ( a == null ) return Collections . emptyList ( ) ; return Collections . singletonList ( a ) ; |
public class ClassPropertyFilterHelper { /** * Test the < code > ClassPropertyFilter < / code > . It means , that test the class - name ( Class . forName ) and
* test all properties with the properties of the class .
* @ param pvClassPropertyFilter The source for the tests .
* @ return < code > Null < / code > , than is the < code > ClassPropertyFilter < / code > ok , else the message with the fault . */
public static String validateClassPropertyFilter ( ClassPropertyFilter pvClassPropertyFilter ) { } } | String lvReturn = null ; if ( pvClassPropertyFilter != null ) { try { Class < ? > lvClass = pvClassPropertyFilter . getFilterClass ( ) ; Map < Object , Object > lvProperties = ReflectionMethodHelper . getAllGetterMethodWithCache ( lvClass , null ) ; Object lvAllProperties [ ] = pvClassPropertyFilter . getAllProperties ( ) ; for ( int i = 0 ; i < lvAllProperties . length ; i ++ ) { if ( lvProperties . containsKey ( lvAllProperties [ i ] ) == false ) { return lvAllProperties [ i ] + " is not a valid property name" ; } } } catch ( Exception e ) { lvReturn = pvClassPropertyFilter . getFilterClass ( ) + " is not a valid class name" ; } } return lvReturn ; |
public class FileConverter { /** * Return file instance for the given path string . */
@ Override public < T > T asObject ( String string , Class < T > valueType ) { } } | // at this point value type is guaranteed to be a File
return ( T ) new File ( string ) ; |
public class SimpleCycle { /** * Returns the sum of the weights of all edges in this cycle .
* @ return the sum of the weights of all edges in this cycle */
public double weight ( ) { } } | double result = 0 ; Iterator edgeIterator = edgeSet ( ) . iterator ( ) ; while ( edgeIterator . hasNext ( ) ) { result += ( ( Edge ) edgeIterator . next ( ) ) . getWeight ( ) ; } return result ; |
public class AbstractSAML2ResponseValidator { /** * Validate issuer format and value .
* @ param issuer the issuer
* @ param context the context */
protected final void validateIssuer ( final Issuer issuer , final SAML2MessageContext context ) { } } | if ( issuer . getFormat ( ) != null && ! issuer . getFormat ( ) . equals ( NameIDType . ENTITY ) ) { throw new SAMLIssuerException ( "Issuer type is not entity but " + issuer . getFormat ( ) ) ; } final String entityId = context . getSAMLPeerEntityContext ( ) . getEntityId ( ) ; if ( entityId == null || ! entityId . equals ( issuer . getValue ( ) ) ) { throw new SAMLIssuerException ( "Issuer " + issuer . getValue ( ) + " does not match idp entityId " + entityId ) ; } |
public class RegistrationsApi { /** * Confirm User
* This call updates the registration request issued earlier by associating it with an authenticated user and captures all additional information required to add a new device .
* @ param registrationInfo Device Registration information . ( required )
* @ return ApiResponse & lt ; DeviceRegConfirmUserResponseEnvelope & gt ;
* @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */
public ApiResponse < DeviceRegConfirmUserResponseEnvelope > confirmUserWithHttpInfo ( DeviceRegConfirmUserRequest registrationInfo ) throws ApiException { } } | com . squareup . okhttp . Call call = confirmUserValidateBeforeCall ( registrationInfo , null , null ) ; Type localVarReturnType = new TypeToken < DeviceRegConfirmUserResponseEnvelope > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ; |
public class ServiceDirectoryCache { /** * Put a service into cache .
* @ param serviceName
* the service name .
* @ param service
* the service . */
public void putService ( K serviceName , V service ) { } } | if ( cache . containsKey ( serviceName ) ) { cache . remove ( serviceName ) ; } cache . put ( serviceName , service ) ; |
public class RedisInner { /** * Export data from the redis cache to blobs in a container .
* @ param resourceGroupName The name of the resource group .
* @ param name The name of the Redis cache .
* @ param parameters Parameters for Redis export operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws CloudException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */
public void exportData ( String resourceGroupName , String name , ExportRDBParameters parameters ) { } } | exportDataWithServiceResponseAsync ( resourceGroupName , name , parameters ) . toBlocking ( ) . last ( ) . body ( ) ; |
public class CollectorManagerImpl { /** * OSGi runtime calls this to notify collector manager when a new source provider
* becomes available . This method will be used by the collector manager to bind sources .
* When a source is bound , handle all pending subscriptions for the source . */
public synchronized void setSource ( Source source ) { } } | String sourceId = CollectorManagerUtils . getSourceId ( source ) ; SourceManager srcMgr = null ; if ( ! sourceMgrs . containsKey ( sourceId ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Adding source to the list" , source . getClass ( ) ) ; } srcMgr = new SourceManager ( source ) ; sourceMgrs . put ( srcMgr . getSourceId ( ) , srcMgr ) ; /* * Obtain the conduit / bufferManager and put it in bufferManagerMap
* if the source being set is message / log or trace .
* This is to make up for the prior logic where conduit / bufferManager
* were created before the source was created and were set into the bufferManagerMap
* With the new logic concerning LogSource and TraceSource for JsonLogging , the LogSource
* and TraceSource and their respective Conduit / BufferManager were created outside of
* CollectorManager and OSGI serviceability . Thus , the following call to processInitializedConduits
* retrieves the conduits / bufferManagers that were created ' outside ' collectorManager ' s realm of
* control and places them into bufferManagerMap because the following logic expects the prior
* statement to be true .
* Alas , continue ' as normal ' afterwards . */
processInitializedConduits ( source ) ; // Passes BufferManager onto SourceManager which will then associate a Handler to it .
srcMgr . setBufferManager ( bufferManagerMap . get ( sourceId ) ) ; // Handle pending subscriptions for this source
for ( Entry < String , HandlerManager > entry : handlerMgrs . entrySet ( ) ) { HandlerManager hdlrMgr = entry . getValue ( ) ; // Check if source is in the pending subscription list for this handler
if ( hdlrMgr . getPendingSubscriptions ( ) . contains ( sourceId ) ) { List < String > sourceIds = new ArrayList < String > ( ) ; sourceIds . add ( sourceId ) ; try { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Handling pending subscription " + sourceId , hdlrMgr . getHandlerId ( ) ) ; } subscribe ( hdlrMgr . getHandler ( ) , sourceIds ) ; } catch ( Exception e ) { } } } } |
public class Scene { /** * { @ inheritDoc } */
@ Override public void setSpeedFactor ( @ FloatRange ( from = 0 ) final float speedFactor ) { } } | if ( speedFactor < 0 ) { throw new IllegalArgumentException ( "speedFactor must not be nagative" ) ; } if ( Float . compare ( speedFactor , Float . NaN ) == 0 ) { throw new IllegalArgumentException ( "speedFactor must be a valid float" ) ; } this . speedFactor = speedFactor ; |
public class Tracking { /** * Returns an Iterable to be traversed when matching issues . That means
* that the traversal does not fail if method { @ link # match ( Trackable , Trackable ) }
* is called . */
public Stream < RAW > getUnmatchedRaws ( ) { } } | return raws . stream ( ) . filter ( raw -> ! rawToBase . containsKey ( raw ) ) ; |
public class AbstractPlanNode { /** * Refer to the override implementation on NestLoopIndexJoin node .
* @ param tableName
* @ return whether this node has an inlined index scan node or not . */
public boolean hasInlinedIndexScanOfTable ( String tableName ) { } } | for ( int i = 0 ; i < getChildCount ( ) ; i ++ ) { AbstractPlanNode child = getChild ( i ) ; if ( child . hasInlinedIndexScanOfTable ( tableName ) == true ) { return true ; } } return false ; |
public class FindDialog { /** * This method initializes btnCancel
* @ return javax . swing . JButton */
private JButton getBtnCancel ( ) { } } | if ( btnCancel == null ) { btnCancel = new JButton ( ) ; btnCancel . setText ( Constant . messages . getString ( "edit.find.button.cancel" ) ) ; btnCancel . addActionListener ( new java . awt . event . ActionListener ( ) { @ Override public void actionPerformed ( java . awt . event . ActionEvent e ) { FindDialog . this . discard ( ) ; FindDialog . this . dispatchEvent ( new WindowEvent ( FindDialog . this , WindowEvent . WINDOW_CLOSING ) ) ; } } ) ; } return btnCancel ; |
public class Interval { /** * This method runs a runnable a specified number of times against an executor . The method is effectively
* asynchronous because it does not wait for all of the runnables to finish . */
public void run ( Runnable runnable , Executor executor ) { } } | if ( this . goForward ( ) ) { for ( int i = this . from ; i <= this . to ; i += this . step ) { executor . execute ( runnable ) ; } } else { for ( int i = this . from ; i >= this . to ; i += this . step ) { executor . execute ( runnable ) ; } } |
public class SameSizeKMeansAlgorithm { /** * Transfer a single element from one cluster to another .
* @ param metas Meta storage
* @ param meta Meta of current object
* @ param src Source cluster
* @ param dst Destination cluster
* @ param id Object ID
* @ param dstnum Destination cluster number */
protected void transfer ( final WritableDataStore < Meta > metas , Meta meta , ModifiableDBIDs src , ModifiableDBIDs dst , DBIDRef id , int dstnum ) { } } | src . remove ( id ) ; dst . add ( id ) ; meta . primary = dstnum ; metas . put ( id , meta ) ; // Make sure the storage is up to date . |
public class Cluster { /** * Gets all the available slots in the cluster . */
public List < WorkerSlot > getAvailableSlots ( ) { } } | List < WorkerSlot > slots = new ArrayList < > ( ) ; for ( SupervisorDetails supervisor : this . supervisors . values ( ) ) { slots . addAll ( this . getAvailableSlots ( supervisor ) ) ; } return slots ; |
public class JsJmsMessageImpl { /** * Set a Java object property value with the given name into the JMS Message .
* Javadoc description supplied by JsJmsMessage interface . */
@ Override public final void setObjectProperty ( String name , Object value ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setObjectProperty" , new Object [ ] { name , value } ) ; /* If the property is either JMSXUserID or JMSXAppID , we set it into the */
/* message regardless of whether it is null . We know the value is a */
/* String as the JMS API layer has vetted it . Moved code under d325186.1 */
if ( SIProperties . JMSXAppID . equals ( name ) ) { setJmsxAppId ( ( String ) value ) ; } else if ( SIProperties . JMSXUserID . equals ( name ) ) { setUserid ( ( String ) value ) ; } /* Ditto for JMS _ IBM _ ArmCorrelator & JMS _ TOG _ ARM _ Correlator */
else if ( SIProperties . JMS_IBM_ArmCorrelator . equals ( name ) ) { setARMCorrelator ( ( String ) value ) ; } else if ( SIProperties . JMS_TOG_ARM_Correlator . equals ( name ) ) { setARMCorrelator ( ( String ) value ) ; } /* else , if the value is not null , set the Property */
else if ( value != null ) { setNonNullProperty ( name , value ) ; } /* Otherwise , remove it */
else { /* Maelstrom ' s transportVersion has its own field - the rest are in the */
/* JmsPropertyMap */
if ( ! name . startsWith ( JMS_PREFIX ) ) { if ( name . equals ( MfpConstants . PRP_TRANSVER ) ) { clearTransportVersion ( ) ; } else { if ( mayHaveJmsUserProperties ( ) ) { getJmsUserPropertyMap ( ) . remove ( name ) ; } } } else { if ( name . startsWith ( JMS_IBM_MQMD_PREFIX ) ) { deleteMQMDProperty ( name ) ; } else { if ( mayHaveMappedJmsSystemProperties ( ) ) { getJmsSystemPropertyMap ( ) . remove ( name ) ; // 234893
} // JMS _ IBM _ Character _ Set and JMS _ IBM _ Encoding need to be cleared in the
// message itself too . d395685
if ( name . equals ( SIProperties . JMS_IBM_Character_Set ) ) { setCcsid ( null ) ; } else if ( name . equals ( SIProperties . JMS_IBM_Encoding ) ) { setEncoding ( null ) ; } } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setObjectProperty" ) ; |
public class BitsUtil { /** * Convert bitset to a string consisting of " 0 " and " 1 " , in low - endian order .
* @ param v Value to process
* @ return String representation */
public static String toStringLow ( long v ) { } } | final int mag = magnitude ( v ) ; if ( mag == 0 ) { return "0" ; } char [ ] digits = new char [ mag ] ; long f = 1L ; for ( int pos = 0 ; pos < mag ; ++ pos , f <<= 1 ) { digits [ pos ] = ( ( v & f ) == 0 ) ? '0' : '1' ; } return new String ( digits ) ; |
public class JerseyClient { @ Override public int enqueue ( JobRequest jd ) { } } | try { return target . path ( "ji" ) . request ( ) . post ( Entity . entity ( jd , MediaType . APPLICATION_XML ) , JobInstance . class ) . getId ( ) ; } catch ( BadRequestException e ) { throw new JqmInvalidRequestException ( e . getResponse ( ) . readEntity ( String . class ) , e ) ; } catch ( Exception e ) { throw new JqmClientException ( e ) ; } |
public class GA4GHPicardRunner { /** * Processes GA4GH based input , creates required API connections and data pump */
private Input processGA4GHInput ( String input ) throws IOException , GeneralSecurityException , URISyntaxException { } } | GA4GHUrl url = new GA4GHUrl ( input ) ; SAMFilePump pump ; if ( usingGrpc ) { factoryGrpc . configure ( url . getRootUrl ( ) , new Settings ( clientSecretsFilename , apiKey , noLocalServer ) ) ; pump = new ReadIteratorToSAMFilePump < com . google . genomics . v1 . Read , com . google . genomics . v1 . ReadGroupSet , com . google . genomics . v1 . Reference > ( factoryGrpc . get ( url . getRootUrl ( ) ) . getReads ( url ) ) ; } else { factoryRest . configure ( url . getRootUrl ( ) , new Settings ( clientSecretsFilename , apiKey , noLocalServer ) ) ; pump = new ReadIteratorToSAMFilePump < com . google . api . services . genomics . model . Read , com . google . api . services . genomics . model . ReadGroupSet , com . google . api . services . genomics . model . Reference > ( factoryRest . get ( url . getRootUrl ( ) ) . getReads ( url ) ) ; } return new Input ( input , STDIN_FILE_NAME , pump ) ; |
public class AmazonCloudDirectoryClient { /** * Updates the schema name with a new name . Only development schema names can be updated .
* @ param updateSchemaRequest
* @ return Result of the UpdateSchema operation returned by the service .
* @ throws InternalServiceException
* Indicates a problem that must be resolved by Amazon Web Services . This might be a transient error in
* which case you can retry your request until it succeeds . Otherwise , go to the < a
* href = " http : / / status . aws . amazon . com / " > AWS Service Health Dashboard < / a > site to see if there are any
* operational issues with the service .
* @ throws InvalidArnException
* Indicates that the provided ARN value is not valid .
* @ throws RetryableConflictException
* Occurs when a conflict with a previous successful write is detected . For example , if a write operation
* occurs on an object and then an attempt is made to read the object using “ SERIALIZABLE ” consistency , this
* exception may result . This generally occurs when the previous write did not have time to propagate to the
* host serving the current request . A retry ( with appropriate backoff logic ) is the recommended response to
* this exception .
* @ throws ValidationException
* Indicates that your request is malformed in some manner . See the exception message .
* @ throws LimitExceededException
* Indicates that limits are exceeded . See < a
* href = " https : / / docs . aws . amazon . com / clouddirectory / latest / developerguide / limits . html " > Limits < / a > for more
* information .
* @ throws AccessDeniedException
* Access denied . Check your permissions .
* @ throws ResourceNotFoundException
* The specified resource could not be found .
* @ sample AmazonCloudDirectory . UpdateSchema
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / clouddirectory - 2017-01-11 / UpdateSchema " target = " _ top " > AWS
* API Documentation < / a > */
@ Override public UpdateSchemaResult updateSchema ( UpdateSchemaRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeUpdateSchema ( request ) ; |
public class VirtualMachineExtensionsInner { /** * The operation to create or update the extension .
* @ param resourceGroupName The name of the resource group .
* @ param vmName The name of the virtual machine where the extension should be created or updated .
* @ param vmExtensionName The name of the virtual machine extension .
* @ param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation .
* @ 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 < VirtualMachineExtensionInner > beginCreateOrUpdateAsync ( String resourceGroupName , String vmName , String vmExtensionName , VirtualMachineExtensionInner extensionParameters , final ServiceCallback < VirtualMachineExtensionInner > serviceCallback ) { } } | return ServiceFuture . fromResponse ( beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , vmName , vmExtensionName , extensionParameters ) , serviceCallback ) ; |
public class PolicyIndexBase { /** * A private method that handles reading the policy and creates the correct
* kind of AbstractPolicy .
* Because this makes use of the policyFinder , it cannot be reused between finders .
* Consider moving to policyManager , which is not intended to be reused outside
* of a policyFinderModule , which is not intended to be reused amongst PolicyFinder instances . */
protected AbstractPolicy handleDocument ( Document doc , PolicyFinder policyFinder ) throws ParsingException { } } | // handle the policy , if it ' s a known type
Element root = doc . getDocumentElement ( ) ; String name = root . getTagName ( ) ; // see what type of policy this is
if ( name . equals ( "Policy" ) ) { return Policy . getInstance ( root ) ; } else if ( name . equals ( "PolicySet" ) ) { return PolicySet . getInstance ( root , policyFinder ) ; } else { // this isn ' t a root type that we know how to handle
throw new ParsingException ( "Unknown root document type: " + name ) ; } |
public class AmazonMTurkClient { /** * The < code > ListHITsForQualificationType < / code > operation returns the HITs that use the given Qualification type
* for a Qualification requirement . The operation returns HITs of any status , except for HITs that have been deleted
* with the < code > DeleteHIT < / code > operation or that have been auto - deleted .
* @ param listHITsForQualificationTypeRequest
* @ return Result of the ListHITsForQualificationType operation returned by the service .
* @ throws ServiceException
* Amazon Mechanical Turk is temporarily unable to process your request . Try your call again .
* @ throws RequestErrorException
* Your request is invalid .
* @ sample AmazonMTurk . ListHITsForQualificationType
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / mturk - requester - 2017-01-17 / ListHITsForQualificationType "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public ListHITsForQualificationTypeResult listHITsForQualificationType ( ListHITsForQualificationTypeRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeListHITsForQualificationType ( request ) ; |
public class Util { /** * Find the index among siblings of the same tag name */
private static final int siblingIndex ( Element element ) { } } | // The document element has index 0
if ( element . getParentNode ( ) == element . getOwnerDocument ( ) ) return 0 ; // All other elements are compared with siblings with the same name
// TODO : How to deal with namespaces here ? Omit or keep ?
else return $ ( element ) . parent ( ) . children ( JOOX . tag ( element . getTagName ( ) , false ) ) . get ( ) . indexOf ( element ) ; |
public class InternalRedirectCreative { /** * Sets the assetSize value for this InternalRedirectCreative .
* @ param assetSize * The asset size of an internal redirect creative .
* Note that this may differ from { @ code size } if
* users set { @ code overrideSize } to true .
* This attribute is read - only and is populated
* by Google . */
public void setAssetSize ( com . google . api . ads . admanager . axis . v201811 . Size assetSize ) { } } | this . assetSize = assetSize ; |
public class AttributeInfoEx { public AttributeConfig_3 get_attribute_config_obj_3 ( ) { } } | return new AttributeConfig_3 ( name , writable , data_format , data_type , max_dim_x , max_dim_y , description , label , unit , standard_unit , display_unit , format , min_value , max_value , writable_attr_name , level , alarms . getTangoObj ( ) , events . getTangoObj ( ) , extensions , sys_extensions ) ; |
public class DateParser { /** * Returns the { @ link Date } represented by the specified { @ link Object } , or { @ code null } if the specified { @ link
* Object } is { @ code null } .
* @ param value the { @ link Object } to be parsed
* @ param < K > the type of the value to be parsed
* @ return the parsed { @ link Date } */
public final < K > Date parse ( K value ) { } } | if ( value == null ) { return null ; } try { if ( value instanceof Date ) { Date date = ( Date ) value ; if ( date . getTime ( ) == Long . MAX_VALUE || date . getTime ( ) == Long . MIN_VALUE ) { return date ; } else { String string = formatter . get ( ) . format ( date ) ; return formatter . get ( ) . parse ( string ) ; } } else if ( value instanceof UUID ) { long timestamp = UUIDGen . unixTimestamp ( ( UUID ) value ) ; Date date = new Date ( timestamp ) ; return formatter . get ( ) . parse ( formatter . get ( ) . format ( date ) ) ; } else if ( Number . class . isAssignableFrom ( value . getClass ( ) ) ) { Long number = ( ( Number ) value ) . longValue ( ) ; return formatter . get ( ) . parse ( number . toString ( ) ) ; } else { return formatter . get ( ) . parse ( value . toString ( ) ) ; } } catch ( Exception e ) { throw new IndexException ( e , "Error parsing {} with value '{}' using date pattern {}" , value . getClass ( ) . getSimpleName ( ) , value , pattern ) ; } |
public class Output { /** * Write a Vector & lt ; Number & gt ; .
* @ param vector
* vector */
@ Override public void writeVectorNumber ( Vector < Double > vector ) { } } | log . debug ( "writeVectorNumber: {}" , vector ) ; buf . put ( AMF3 . TYPE_VECTOR_NUMBER ) ; if ( hasReference ( vector ) ) { putInteger ( getReferenceId ( vector ) << 1 ) ; return ; } storeReference ( vector ) ; putInteger ( vector . size ( ) << 1 | 1 ) ; putInteger ( 0 ) ; buf . put ( ( byte ) 0x00 ) ; for ( Double v : vector ) { buf . putDouble ( v ) ; } |
public class RadicalSiteHrDeltaReaction { /** * Initiate process .
* It is needed to call the addExplicitHydrogensToSatisfyValency
* from the class tools . HydrogenAdder .
* @ exception CDKException Description of the Exception
* @ param reactants reactants of the reaction .
* @ param agents agents of the reaction ( Must be in this case null ) . */
@ Override public IReactionSet initiate ( IAtomContainerSet reactants , IAtomContainerSet agents ) throws CDKException { } } | logger . debug ( "initiate reaction: RadicalSiteHrDeltaReaction" ) ; if ( reactants . getAtomContainerCount ( ) != 1 ) { throw new CDKException ( "RadicalSiteHrDeltaReaction only expects one reactant" ) ; } if ( agents != null ) { throw new CDKException ( "RadicalSiteHrDeltaReaction don't expects agents" ) ; } IReactionSet setOfReactions = reactants . getBuilder ( ) . newInstance ( IReactionSet . class ) ; IAtomContainer reactant = reactants . getAtomContainer ( 0 ) ; AtomContainerManipulator . percieveAtomTypesAndConfigureAtoms ( reactant ) ; Aromaticity . cdkLegacy ( ) . apply ( reactant ) ; AllRingsFinder arf = new AllRingsFinder ( ) ; IRingSet ringSet = arf . findAllRings ( reactant ) ; for ( int ir = 0 ; ir < ringSet . getAtomContainerCount ( ) ; ir ++ ) { IRing ring = ( IRing ) ringSet . getAtomContainer ( ir ) ; for ( int jr = 0 ; jr < ring . getAtomCount ( ) ; jr ++ ) { IAtom aring = ring . getAtom ( jr ) ; aring . setFlag ( CDKConstants . ISINRING , true ) ; } } /* * if the parameter hasActiveCenter is not fixed yet , set the active
* centers */
IParameterReact ipr = super . getParameterClass ( SetReactionCenter . class ) ; if ( ipr != null && ! ipr . isSetParameter ( ) ) setActiveCenters ( reactant ) ; HOSECodeGenerator hcg = new HOSECodeGenerator ( ) ; Iterator < IAtom > atomis = reactant . atoms ( ) . iterator ( ) ; while ( atomis . hasNext ( ) ) { IAtom atomi = atomis . next ( ) ; if ( atomi . getFlag ( CDKConstants . REACTIVE_CENTER ) && reactant . getConnectedSingleElectronsCount ( atomi ) == 1 ) { hcg . getSpheres ( reactant , atomi , 5 , true ) ; Iterator < IAtom > atomls = hcg . getNodesInSphere ( 5 ) . iterator ( ) ; while ( atomls . hasNext ( ) ) { IAtom atoml = atomls . next ( ) ; if ( atoml != null && atoml . getFlag ( CDKConstants . REACTIVE_CENTER ) && ! atoml . getFlag ( CDKConstants . ISINRING ) && ( atoml . getFormalCharge ( ) == CDKConstants . UNSET ? 0 : atoml . getFormalCharge ( ) ) == 0 && ! atoml . getSymbol ( ) . equals ( "H" ) && reactant . getMaximumBondOrder ( atoml ) == IBond . Order . SINGLE ) { Iterator < IAtom > atomhs = reactant . getConnectedAtomsList ( atoml ) . iterator ( ) ; while ( atomhs . hasNext ( ) ) { IAtom atomh = atomhs . next ( ) ; if ( reactant . getBond ( atomh , atoml ) . getFlag ( CDKConstants . REACTIVE_CENTER ) && atomh . getFlag ( CDKConstants . REACTIVE_CENTER ) && atomh . getSymbol ( ) . equals ( "H" ) ) { ArrayList < IAtom > atomList = new ArrayList < IAtom > ( ) ; atomList . add ( atomh ) ; atomList . add ( atomi ) ; atomList . add ( atoml ) ; ArrayList < IBond > bondList = new ArrayList < IBond > ( ) ; bondList . add ( reactant . getBond ( atomh , atoml ) ) ; IAtomContainerSet moleculeSet = reactant . getBuilder ( ) . newInstance ( IAtomContainerSet . class ) ; moleculeSet . addAtomContainer ( reactant ) ; IReaction reaction = mechanism . initiate ( moleculeSet , atomList , bondList ) ; if ( reaction == null ) continue ; else setOfReactions . addReaction ( reaction ) ; } } } } } } return setOfReactions ; |
public class SharedObject { /** * { @ inheritDoc } */
@ SuppressWarnings ( { } } | "unchecked" , "rawtypes" } ) public void deserialize ( Input input ) throws IOException { log . debug ( "deserialize" ) ; name = Deserializer . deserialize ( input , String . class ) ; log . trace ( "Name: {}" , name ) ; persistent = true ; Map < String , Object > map = Deserializer . < Map > deserialize ( input , Map . class ) ; if ( log . isTraceEnabled ( ) ) { log . trace ( "Attributes: {}" , map ) ; } super . setAttributes ( map ) ; ownerMessage . setName ( name ) ; ownerMessage . setPersistent ( persistent ) ; |
public class JMessageClient { /** * Add or remove group members from a given group id .
* @ param gid Necessary , target group id .
* @ param groups Necessary
* @ return No content
* @ throws APIConnectionException connect exception
* @ throws APIRequestException request exception */
public ResponseWrapper addOrRemoveCrossGroupMember ( long gid , CrossGroup [ ] groups ) throws APIConnectionException , APIRequestException { } } | return _crossAppClient . addOrRemoveCrossGroupMembers ( gid , groups ) ; |
public class NodeIdRepresentation { /** * This method is responsible to deliver the whole XML resource addressed by
* a unique node id .
* @ param resourceName
* The name of the database , where the node id belongs .
* @ param nodeId
* The unique node id of the requested resource .
* @ param queryParams
* The optional query parameters .
* @ return The whole XML resource addressed by a unique node id .
* @ throws JaxRxException
* The exception occurred . */
public StreamingOutput getResource ( final String resourceName , final long nodeId , final Map < QueryParameter , String > queryParams ) throws JaxRxException { } } | final StreamingOutput sOutput = new StreamingOutput ( ) { @ Override public void write ( final OutputStream output ) throws IOException , JaxRxException { // final String xPath = queryParams . get ( QueryParameter . QUERY ) ;
final String revision = queryParams . get ( QueryParameter . REVISION ) ; final String wrap = queryParams . get ( QueryParameter . WRAP ) ; final String doNodeId = queryParams . get ( QueryParameter . OUTPUT ) ; final boolean wrapResult = ( wrap == null ) ? false : wrap . equalsIgnoreCase ( YESSTRING ) ; final boolean nodeid = ( doNodeId == null ) ? false : doNodeId . equalsIgnoreCase ( YESSTRING ) ; final Long rev = revision == null ? null : Long . valueOf ( revision ) ; serialize ( resourceName , nodeId , rev , nodeid , output , wrapResult ) ; } } ; return sOutput ; |
public class JemmyDSL { /** * Returns a list of all visible components which are instances of the given class . If one needs
* a find that returns an invisible component should add a parameter here . But the default
* behavior must be returning only visible components as it is the most common operation and
* required for compatibility with scripts converted from jfcunit . see # 15790.
* @ param container
* @ param componentClass
* @ return */
private static List < java . awt . Component > findComponents ( java . awt . Container container , Class < ? extends java . awt . Component > componentClass ) { } } | List < java . awt . Component > list = new ArrayList < java . awt . Component > ( ) ; for ( java . awt . Component component : container . getComponents ( ) ) { if ( component . isVisible ( ) && componentClass . isAssignableFrom ( component . getClass ( ) ) ) { list . add ( component ) ; } if ( component instanceof java . awt . Container ) { List < java . awt . Component > children = findComponents ( ( java . awt . Container ) component , componentClass ) ; list . addAll ( children ) ; } } return list ; |
public class ConsumerDispatcher { /** * Put a message on this ConsumerDispatcher for delivery to consumers .
* @ param msg The message to be delivered
* @ param tran The transaction to be used ( must at least have an autocommit transaction )
* @ param inputHandlerStore The input handler putting this message
* @ param storedByIH true if the message has already been stored in the IH
* @ return true if the message was stored in the IH ( either before or during this call )
* @ throws SIStoreException thrown if there is a problem in the message store */
@ Override public boolean put ( SIMPMessage msg , TransactionCommon tran , InputHandlerStore inputHandlerStore , boolean storedByIH ) throws SIDiscriminatorSyntaxException , SIResourceException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "put" , new Object [ ] { msg , tran , inputHandlerStore , Boolean . valueOf ( storedByIH ) } ) ; // Set a unique id in the message if explicitly told to or
// if one has not already been set
JsMessage jsMsg = msg . getMessage ( ) ; if ( msg . getRequiresNewId ( ) || jsMsg . getSystemMessageId ( ) == null ) { jsMsg . setSystemMessageSourceUuid ( _messageProcessor . getMessagingEngineUuid ( ) ) ; jsMsg . setSystemMessageValue ( _messageProcessor . nextTick ( ) ) ; msg . setRequiresNewId ( false ) ; } // If COA Report messages are required , this is when we need to create and
// send them .
if ( msg . getMessage ( ) . getReportCOA ( ) != null ) { // PM81457 . dev : If the target destination for the message is WMQ , WMQ would produce the report
// message and put it in to the reply queue ( set in reverse routing path for the message ) .
// So we should avoid SIB to produce report message for the below reasons .
// (1 ) There will be a duplicate report message and hence applications are mandated to consume
// both report messages , otherwise second report message would stay in the reply queue forever .
// (2 ) When application consumes the SIBus report , it might think that the report message is
// from WMQand the message flow ends . But it possible that there could be a failure from
// WMQ side and it would never send a report message .
if ( ! _baseDestHandler . isMQLink ( ) ) { // Create the ReportHandler object if not already created
if ( reportHandler == null ) reportHandler = new ReportHandler ( _messageProcessor ) ; try { reportHandler . handleMessage ( msg , tran , SIApiConstants . REPORT_COA ) ; } catch ( Exception e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.ConsumerDispatcher.put" , "1:912:1.280.5.25" , this ) ; SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "put" , "SIResourceException" ) ; throw new SIResourceException ( e ) ; } } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Ignored report message generation for the request message targeted for MQ destination (via MQLink)" , _baseDestHandler . getName ( ) ) ; } } // TODO : Can we do a seperate early check for noLocal on non - durable subs here ?
// 174000
// If pt - to - pt and the put was transacted then we know we need to store the message
// The message will then be dispatched as part of the postCommit callback .
// If pubsub , we delay the store until we know whether noLocal is set and any
// consumers actually need the message .
if ( msg . isTransacted ( ) && ! _isPubSub ) { final boolean retVal = storeMessage ( ( MessageItem ) msg , tran , inputHandlerStore , storedByIH ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "put" , Boolean . valueOf ( retVal ) ) ; return retVal ; } final boolean retVal = internalPut ( msg , tran , inputHandlerStore , storedByIH , false , true ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "put" , Boolean . valueOf ( retVal ) ) ; return retVal ; |
public class HtmlBuilder { /** * Build a HTML TableRow with given CSS style attributes for a string .
* Use this method if given content contains HTML snippets , prepared with { @ link HtmlBuilder # htmlEncode ( String ) } .
* @ param style style for tr element
* @ param content content string
* @ return HTML tr element as string */
public static String trStyleHtmlContent ( String style , String ... content ) { } } | return tagStyleHtmlContent ( Html . Tag . TR , style , content ) ; |
public class KubernetesNames { /** * Lets convert the string to btw a valid kubernetes resource name
* @ param text the text to convert
* @ param allowDots whether or not to allow dots in the name
* @ return the converted name */
public static String convertToKubernetesName ( String text , boolean allowDots ) { } } | String lower = text . toLowerCase ( ) ; StringBuilder builder = new StringBuilder ( ) ; boolean started = false ; char lastCh = ' ' ; for ( int i = 0 , last = lower . length ( ) - 1 ; i <= last ; i ++ ) { char ch = lower . charAt ( i ) ; boolean digit = ch >= '0' && ch <= '9' ; // names cannot start with a digit so lets add a prefix
if ( digit && builder . length ( ) == 0 ) { builder . append ( DIGIT_PREFIX ) ; } if ( ! ( ch >= 'a' && ch <= 'z' ) && ! digit ) { if ( ch == '/' ) { ch = '.' ; } else if ( ch != '.' && ch != '-' ) { ch = '-' ; } if ( ! allowDots && ch == '.' ) { ch = '-' ; } if ( ! started || lastCh == '-' || lastCh == '.' || i == last ) { continue ; } } builder . append ( ch ) ; started = true ; lastCh = ch ; } return builder . toString ( ) ; |
public class DoubleUtils { /** * Returns the index of the first maximal element of the array . That is , if there is a unique
* maximum , its index is returned . If there are multiple values tied for largest , the index of the
* first is returned . If the supplied array is empty , an { @ link IllegalArgumentException } is
* thrown . */
public static int argMax ( final double [ ] x ) { } } | checkArgument ( x . length > 0 ) ; double maxValue = Double . MIN_VALUE ; int maxIndex = 0 ; for ( int i = 0 ; i < x . length ; ++ i ) { final double val = x [ i ] ; if ( val > maxValue ) { maxIndex = i ; maxValue = val ; } } return maxIndex ; |
public class CCEncoder { /** * Encodes a cardinality constraint and returns its CNF encoding .
* @ param cc the cardinality constraint
* @ return the CNF encoding of the cardinality constraint */
public ImmutableFormulaList encode ( final PBConstraint cc ) { } } | final EncodingResult result = EncodingResult . resultForFormula ( f ) ; this . encodeConstraint ( cc , result ) ; return new ImmutableFormulaList ( FType . AND , result . result ( ) ) ; |
public class TrafficRoute { /** * The ARN of one listener . The listener identifies the route between a target group and a load balancer . This is an
* array of strings with a maximum size of one .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setListenerArns ( java . util . Collection ) } or { @ link # withListenerArns ( java . util . Collection ) } if you want to
* override the existing values .
* @ param listenerArns
* The ARN of one listener . The listener identifies the route between a target group and a load balancer .
* This is an array of strings with a maximum size of one .
* @ return Returns a reference to this object so that method calls can be chained together . */
public TrafficRoute withListenerArns ( String ... listenerArns ) { } } | if ( this . listenerArns == null ) { setListenerArns ( new com . amazonaws . internal . SdkInternalList < String > ( listenerArns . length ) ) ; } for ( String ele : listenerArns ) { this . listenerArns . add ( ele ) ; } return this ; |
public class RunbooksInner { /** * Update the runbook identified by runbook name .
* @ param resourceGroupName Name of an Azure Resource group .
* @ param automationAccountName The name of the automation account .
* @ param runbookName The runbook name .
* @ param parameters The update parameters for runbook .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the RunbookInner object */
public Observable < RunbookInner > updateAsync ( String resourceGroupName , String automationAccountName , String runbookName , RunbookUpdateParameters parameters ) { } } | return updateWithServiceResponseAsync ( resourceGroupName , automationAccountName , runbookName , parameters ) . map ( new Func1 < ServiceResponse < RunbookInner > , RunbookInner > ( ) { @ Override public RunbookInner call ( ServiceResponse < RunbookInner > response ) { return response . body ( ) ; } } ) ; |
public class GroupElement { /** * Converts the group element to the CACHED representation .
* @ return The group element in the CACHED representation . */
public org . mariadb . jdbc . internal . com . send . authentication . ed25519 . math . GroupElement toCached ( ) { } } | return toRep ( Representation . CACHED ) ; |
public class MeterImpl { /** * Mark the occurrence of a given number of events .
* @ param n the number of events */
@ Override public void mark ( long n ) { } } | tickIfNecessary ( ) ; count . add ( n ) ; m1Rate . update ( n ) ; m5Rate . update ( n ) ; m15Rate . update ( n ) ; |
public class AipBodyAnalysis { /** * 针对人像分割接口 , 将返回的二值图转化为灰度图 , 存储为jpg格式
* @ param labelmapBase64 人像分割接口返回的二值图base64
* @ param realWidth 图片原始宽度
* @ param realHeight 图片原始高度
* @ param outPath 灰度图输出路径 */
public static void convert ( String labelmapBase64 , int realWidth , int realHeight , String outPath ) { } } | try { byte [ ] bytes = Base64Util . decode ( labelmapBase64 ) ; InputStream is = new ByteArrayInputStream ( bytes ) ; BufferedImage image = ImageIO . read ( is ) ; BufferedImage newImage = resize ( image , realWidth , realHeight ) ; BufferedImage grayImage = new BufferedImage ( realWidth , realHeight , BufferedImage . TYPE_BYTE_GRAY ) ; for ( int i = 0 ; i < realWidth ; i ++ ) { for ( int j = 0 ; j < realHeight ; j ++ ) { int rgb = newImage . getRGB ( i , j ) ; grayImage . setRGB ( i , j , rgb * 255 ) ; // 将像素存入缓冲区
} } File newFile = new File ( outPath ) ; ImageIO . write ( grayImage , "jpg" , newFile ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } |
public class PlanAssembler { /** * This is a UNION specific method . Generate a unique and correct plan
* for the current SQL UNION statement by building the best plans for each individual statements
* within the UNION .
* @ return A union plan or null . */
private CompiledPlan getNextUnionPlan ( ) { } } | String isContentDeterministic = null ; // Since only the one " best " plan is considered ,
// this method should be called only once .
if ( m_bestAndOnlyPlanWasGenerated ) { return null ; } m_bestAndOnlyPlanWasGenerated = true ; // Simply return an union plan node with a corresponding union type set
AbstractPlanNode subUnionRoot = new UnionPlanNode ( m_parsedUnion . m_unionType ) ; m_recentErrorMsg = null ; ArrayList < CompiledPlan > childrenPlans = new ArrayList < > ( ) ; StatementPartitioning commonPartitioning = null ; // Build best plans for the children first
int planId = 0 ; for ( AbstractParsedStmt parsedChildStmt : m_parsedUnion . m_children ) { StatementPartitioning partitioning = ( StatementPartitioning ) m_partitioning . clone ( ) ; PlanSelector planSelector = ( PlanSelector ) m_planSelector . clone ( ) ; planSelector . m_planId = planId ; PlanAssembler assembler = new PlanAssembler ( m_catalogDb , partitioning , planSelector , m_isLargeQuery ) ; CompiledPlan bestChildPlan = assembler . getBestCostPlan ( parsedChildStmt ) ; partitioning = assembler . m_partitioning ; // make sure we got a winner
if ( bestChildPlan == null ) { m_recentErrorMsg = assembler . getErrorMessage ( ) ; if ( m_recentErrorMsg == null ) { m_recentErrorMsg = "Unable to plan for statement. Error unknown." ; } return null ; } childrenPlans . add ( bestChildPlan ) ; // Remember the content non - determinism message for the
// first non - deterministic children we find .
if ( isContentDeterministic != null ) { isContentDeterministic = bestChildPlan . nondeterminismDetail ( ) ; } // Make sure that next child ' s plans won ' t override current ones .
planId = planSelector . m_planId ; // Decide whether child statements ' partitioning is compatible .
if ( commonPartitioning == null ) { commonPartitioning = partitioning ; continue ; } AbstractExpression statementPartitionExpression = partitioning . singlePartitioningExpression ( ) ; if ( commonPartitioning . requiresTwoFragments ( ) ) { if ( partitioning . requiresTwoFragments ( ) || statementPartitionExpression != null ) { // If two child statements need to use a second fragment ,
// it can ' t currently be a two - fragment plan .
// The coordinator expects a single - table result from each partition .
// Also , currently the coordinator of a two - fragment plan is not allowed to
// target a particular partition , so neither can the union of the coordinator
// and a statement that wants to run single - partition .
throw new PlanningErrorException ( "Statements are too complex in set operation using multiple partitioned tables." ) ; } // the new statement is apparently a replicated read and has no effect on partitioning
continue ; } AbstractExpression commonPartitionExpression = commonPartitioning . singlePartitioningExpression ( ) ; if ( commonPartitionExpression == null ) { // the prior statement ( s ) were apparently replicated reads
// and have no effect on partitioning
commonPartitioning = partitioning ; continue ; } if ( partitioning . requiresTwoFragments ( ) ) { // Again , currently the coordinator of a two - fragment plan is not allowed to
// target a particular partition , so neither can the union of the coordinator
// and a statement that wants to run single - partition .
throw new PlanningErrorException ( "Statements are too complex in set operation using multiple partitioned tables." ) ; } if ( statementPartitionExpression == null ) { // the new statement is apparently a replicated read and has no effect on partitioning
continue ; } if ( ! commonPartitionExpression . equals ( statementPartitionExpression ) ) { throw new PlanningErrorException ( "Statements use conflicting partitioned table filters in set operation or sub-query." ) ; } } if ( commonPartitioning != null ) { m_partitioning = commonPartitioning ; } // need to reset plan id for the entire UNION
m_planSelector . m_planId = planId ; // Add and link children plans
for ( CompiledPlan selectPlan : childrenPlans ) { subUnionRoot . addAndLinkChild ( selectPlan . rootPlanGraph ) ; } // order by
if ( m_parsedUnion . hasOrderByColumns ( ) ) { subUnionRoot = handleOrderBy ( m_parsedUnion , subUnionRoot ) ; } // limit / offset
if ( m_parsedUnion . hasLimitOrOffset ( ) ) { subUnionRoot = handleUnionLimitOperator ( subUnionRoot ) ; } CompiledPlan retval = new CompiledPlan ( m_isLargeQuery ) ; retval . rootPlanGraph = subUnionRoot ; retval . setReadOnly ( true ) ; retval . sql = m_planSelector . m_sql ; boolean orderIsDeterministic = m_parsedUnion . isOrderDeterministic ( ) ; boolean hasLimitOrOffset = m_parsedUnion . hasLimitOrOffset ( ) ; retval . statementGuaranteesDeterminism ( hasLimitOrOffset , orderIsDeterministic , isContentDeterministic ) ; // compute the cost - total of all children
retval . cost = 0.0 ; for ( CompiledPlan bestChildPlan : childrenPlans ) { retval . cost += bestChildPlan . cost ; } return retval ; |
public class DisconfFileCoreProcessorImpl { /** * 更新消息 : 某个配置文件 */
private void updateOneConf ( String fileName ) throws Exception { } } | DisconfCenterFile disconfCenterFile = ( DisconfCenterFile ) disconfStoreProcessor . getConfData ( fileName ) ; if ( disconfCenterFile != null ) { // 更新仓库
updateOneConfFile ( fileName , disconfCenterFile ) ; // 更新实例
inject2OneConf ( fileName , disconfCenterFile ) ; } |
public class TopoGraph { /** * + Inf is returned for the universe chain . */
double getChainArea ( int chain ) { } } | int chainIndex = getChainIndex_ ( chain ) ; double v = m_chainAreas . read ( chainIndex ) ; if ( NumberUtils . isNaN ( v ) ) { updateChainAreaAndPerimeter_ ( chain ) ; v = m_chainAreas . read ( chainIndex ) ; } return v ; |
public class BatchDeleteTableVersionRequest { /** * A list of the IDs of versions to be deleted . A < code > VersionId < / code > is a string representation of an integer .
* Each version is incremented by 1.
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setVersionIds ( java . util . Collection ) } or { @ link # withVersionIds ( java . util . Collection ) } if you want to
* override the existing values .
* @ param versionIds
* A list of the IDs of versions to be deleted . A < code > VersionId < / code > is a string representation of an
* integer . Each version is incremented by 1.
* @ return Returns a reference to this object so that method calls can be chained together . */
public BatchDeleteTableVersionRequest withVersionIds ( String ... versionIds ) { } } | if ( this . versionIds == null ) { setVersionIds ( new java . util . ArrayList < String > ( versionIds . length ) ) ; } for ( String ele : versionIds ) { this . versionIds . add ( ele ) ; } return this ; |
public class ApiOvhEmailexchange { /** * Alter this object properties
* REST : PUT / email / exchange / { organizationName } / service / { exchangeService }
* @ param body [ required ] New object properties
* @ param organizationName [ required ] The internal name of your exchange organization
* @ param exchangeService [ required ] The internal name of your exchange service */
public void organizationName_service_exchangeService_PUT ( String organizationName , String exchangeService , OvhExchangeService body ) throws IOException { } } | String qPath = "/email/exchange/{organizationName}/service/{exchangeService}" ; StringBuilder sb = path ( qPath , organizationName , exchangeService ) ; exec ( qPath , "PUT" , sb . toString ( ) , body ) ; |
public class Multiplexing { /** * Demultiplexes elements from the source array into an iterator of channels .
* < code >
* unchain ( 2 , [ 1,2,3,4,5 ] ) - > [ [ 1,2 ] , [ 3,4 ] , [ 5 ] ]
* < / code >
* @ param < C > the channel collection type
* @ param < E > the element type
* @ param channelSize maximum size of the channel
* @ param array the source array
* @ param channelProvider the supplier used to create channels
* @ return an iterator of channels */
public static < C extends Collection < E > , E > Iterator < C > unchain ( int channelSize , Supplier < C > channelProvider , E ... array ) { } } | return new UnchainIterator < C , E > ( channelSize , new ArrayIterator < E > ( array ) , channelProvider ) ; |
public class ComparatorCompat { /** * Adds the comparator , that uses a function for extract
* an { @ code int } sort key , to the chain .
* @ param keyExtractor the function that extracts the sort key
* @ return the new { @ code ComparatorCompat } instance */
@ NotNull public ComparatorCompat < T > thenComparingInt ( @ NotNull ToIntFunction < ? super T > keyExtractor ) { } } | return thenComparing ( comparingInt ( keyExtractor ) ) ; |
public class JDBCResultSet { /** * # ifdef JAVA4 */
public void updateArray ( String columnLabel , java . sql . Array x ) throws SQLException { } } | throw Util . notSupported ( ) ; |
public class RtfCell { /** * Write the cell definition part of this RtfCell */
public void writeDefinition ( final OutputStream result ) throws IOException { } } | if ( this . mergeType == MERGE_VERT_PARENT ) { result . write ( DocWriter . getISOBytes ( "\\clvmgf" ) ) ; } else if ( this . mergeType == MERGE_VERT_CHILD ) { result . write ( DocWriter . getISOBytes ( "\\clvmrg" ) ) ; } switch ( verticalAlignment ) { case Element . ALIGN_BOTTOM : result . write ( DocWriter . getISOBytes ( "\\clvertalb" ) ) ; break ; case Element . ALIGN_CENTER : case Element . ALIGN_MIDDLE : result . write ( DocWriter . getISOBytes ( "\\clvertalc" ) ) ; break ; case Element . ALIGN_TOP : result . write ( DocWriter . getISOBytes ( "\\clvertalt" ) ) ; break ; } this . borders . writeContent ( result ) ; if ( this . backgroundColor != null ) { result . write ( DocWriter . getISOBytes ( "\\clcbpat" ) ) ; result . write ( intToByteArray ( this . backgroundColor . getColorNumber ( ) ) ) ; } this . document . outputDebugLinebreak ( result ) ; result . write ( DocWriter . getISOBytes ( "\\clftsWidth3" ) ) ; this . document . outputDebugLinebreak ( result ) ; result . write ( DocWriter . getISOBytes ( "\\clwWidth" ) ) ; result . write ( intToByteArray ( this . cellWidth ) ) ; this . document . outputDebugLinebreak ( result ) ; if ( this . cellPadding > 0 ) { result . write ( DocWriter . getISOBytes ( "\\clpadl" ) ) ; result . write ( intToByteArray ( this . cellPadding / 2 ) ) ; result . write ( DocWriter . getISOBytes ( "\\clpadt" ) ) ; result . write ( intToByteArray ( this . cellPadding / 2 ) ) ; result . write ( DocWriter . getISOBytes ( "\\clpadr" ) ) ; result . write ( intToByteArray ( this . cellPadding / 2 ) ) ; result . write ( DocWriter . getISOBytes ( "\\clpadb" ) ) ; result . write ( intToByteArray ( this . cellPadding / 2 ) ) ; result . write ( DocWriter . getISOBytes ( "\\clpadfl3" ) ) ; result . write ( DocWriter . getISOBytes ( "\\clpadft3" ) ) ; result . write ( DocWriter . getISOBytes ( "\\clpadfr3" ) ) ; result . write ( DocWriter . getISOBytes ( "\\clpadfb3" ) ) ; } result . write ( DocWriter . getISOBytes ( "\\cellx" ) ) ; result . write ( intToByteArray ( this . cellRight ) ) ; |
public class PdfLine { /** * Gets the difference between the " normal " leading and the maximum
* size ( for instance when there are images in the chunk ) .
* @ returnan extra leading for images
* @ since2.1.5 */
float [ ] getMaxSize ( ) { } } | float normal_leading = 0 ; float image_leading = - 10000 ; PdfChunk chunk ; for ( int k = 0 ; k < line . size ( ) ; ++ k ) { chunk = ( PdfChunk ) line . get ( k ) ; if ( ! chunk . isImage ( ) ) { normal_leading = Math . max ( chunk . font ( ) . size ( ) , normal_leading ) ; } else { image_leading = Math . max ( chunk . getImage ( ) . getScaledHeight ( ) + chunk . getImageOffsetY ( ) , image_leading ) ; } } return new float [ ] { normal_leading , image_leading } ; |
public class ShanksSimulation2DGUI { /** * Remove a time chart to the simulation
* @ param chartID
* @ throws ScenarioNotFoundException
* @ throws DuplicatedPortrayalIDException */
public void removeTimeChart ( String chartID ) throws ShanksException { } } | Scenario2DPortrayal scenarioPortrayal = ( Scenario2DPortrayal ) this . getSimulation ( ) . getScenarioPortrayal ( ) ; scenarioPortrayal . removeTimeChart ( chartID ) ; |
public class LoadBalancer { /** * An array of LoadBalancerTlsCertificateSummary objects that provide additional information about the SSL / TLS
* certificates . For example , if < code > true < / code > , the certificate is attached to the load balancer .
* @ param tlsCertificateSummaries
* An array of LoadBalancerTlsCertificateSummary objects that provide additional information about the
* SSL / TLS certificates . For example , if < code > true < / code > , the certificate is attached to the load balancer . */
public void setTlsCertificateSummaries ( java . util . Collection < LoadBalancerTlsCertificateSummary > tlsCertificateSummaries ) { } } | if ( tlsCertificateSummaries == null ) { this . tlsCertificateSummaries = null ; return ; } this . tlsCertificateSummaries = new java . util . ArrayList < LoadBalancerTlsCertificateSummary > ( tlsCertificateSummaries ) ; |
public class PhysicalDatabaseParent { /** * Free the objects .
* There is no need to call this , as the raw tables will automatically be removed
* when their physical tables are freed . */
public void free ( ) { } } | this . setCacheMinutes ( 0 ) ; // Turn off the cache
Object [ ] keys = m_htDBList . keySet ( ) . toArray ( ) ; for ( int i = 0 ; i < keys . length ; i ++ ) { Object key = keys [ i ] ; PDatabase pDatabase = ( PDatabase ) m_htDBList . get ( key ) ; pDatabase . free ( ) ; } m_htDBList . clear ( ) ; m_htDBList = null ; |
public class PolicyTypeDescription { /** * The description of the policy attributes associated with the policies defined by Elastic Load Balancing .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setPolicyAttributeTypeDescriptions ( java . util . Collection ) } or
* { @ link # withPolicyAttributeTypeDescriptions ( java . util . Collection ) } if you want to override the existing values .
* @ param policyAttributeTypeDescriptions
* The description of the policy attributes associated with the policies defined by Elastic Load Balancing .
* @ return Returns a reference to this object so that method calls can be chained together . */
public PolicyTypeDescription withPolicyAttributeTypeDescriptions ( PolicyAttributeTypeDescription ... policyAttributeTypeDescriptions ) { } } | if ( this . policyAttributeTypeDescriptions == null ) { setPolicyAttributeTypeDescriptions ( new com . amazonaws . internal . SdkInternalList < PolicyAttributeTypeDescription > ( policyAttributeTypeDescriptions . length ) ) ; } for ( PolicyAttributeTypeDescription ele : policyAttributeTypeDescriptions ) { this . policyAttributeTypeDescriptions . add ( ele ) ; } return this ; |
public class CeQueueDao { /** * Ordered by ascending id : oldest to newest */
public List < CeQueueDto > selectByMainComponentUuid ( DbSession session , String projectUuid ) { } } | return mapper ( session ) . selectByMainComponentUuid ( projectUuid ) ; |
public class ItemChooserActivity { @ Override protected void onListItemClick ( ListView l , View v , int position , long id ) { } } | Product selectedItem = adapter . getItem ( position ) ; Intent res = new Intent ( ) ; res . putExtra ( RES_SELECTED_PRODUCT , selectedItem ) ; setResult ( Activity . RESULT_OK , res ) ; finish ( ) ; |
public class UINotification { /** * Display error type of notification message .
* @ param message
* as message . */
public void displayValidationError ( final String message ) { } } | final StringBuilder updatedMsg = new StringBuilder ( FontAwesome . EXCLAMATION_TRIANGLE . getHtml ( ) ) ; updatedMsg . append ( ' ' ) ; updatedMsg . append ( message ) ; notificationMessage . showNotification ( SPUIStyleDefinitions . SP_NOTIFICATION_ERROR_MESSAGE_STYLE , null , updatedMsg . toString ( ) , true ) ; |
public class BinLogFileQueue { /** * 根据前一个文件 , 获取符合条件的下一个binlog文件
* @ param pre
* @ return
* @ throws InterruptedException */
public File waitForNextFile ( File pre ) throws InterruptedException { } } | try { lock . lockInterruptibly ( ) ; if ( binlogs . size ( ) == 0 ) { nextCondition . await ( ) ; // 等待新文件
} if ( exception != null ) { throw exception ; } if ( pre == null ) { // 第一次
return binlogs . get ( 0 ) ; } else { int index = seek ( pre ) ; if ( index < binlogs . size ( ) - 1 ) { return binlogs . get ( index + 1 ) ; } else { nextCondition . await ( ) ; // 等待新文件
return waitForNextFile ( pre ) ; // 唤醒之后递归调用一下
} } } finally { lock . unlock ( ) ; } |
public class TimeZoneFormat { /** * Returns the ISO 8601 extended time zone string for the given offset .
* For example , " - 08:00 " , " - 08:30 " and " Z "
* @ param offset the offset from GMT ( UTC ) in milliseconds .
* @ param useUtcIndicator true if ISO 8601 UTC indicator " Z " is used when the offset is 0.
* @ param isShort true if shortest form is used .
* @ param ignoreSeconds true if non - zero offset seconds is appended .
* @ return the ISO 8601 extended format .
* @ throws IllegalArgumentException if the specified offset is out of supported range
* ( - 24 hours & lt ; offset & lt ; + 24 hours ) .
* @ see # formatOffsetISO8601Basic ( int , boolean , boolean , boolean )
* @ see # parseOffsetISO8601 ( String , ParsePosition ) */
public final String formatOffsetISO8601Extended ( int offset , boolean useUtcIndicator , boolean isShort , boolean ignoreSeconds ) { } } | return formatOffsetISO8601 ( offset , false , useUtcIndicator , isShort , ignoreSeconds ) ; |
public class InstanceGroupModifyConfig { /** * The EC2 InstanceIds to terminate . After you terminate the instances , the instance group will not return to its
* original requested size .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setEC2InstanceIdsToTerminate ( java . util . Collection ) } or
* { @ link # withEC2InstanceIdsToTerminate ( java . util . Collection ) } if you want to override the existing values .
* @ param eC2InstanceIdsToTerminate
* The EC2 InstanceIds to terminate . After you terminate the instances , the instance group will not return to
* its original requested size .
* @ return Returns a reference to this object so that method calls can be chained together . */
public InstanceGroupModifyConfig withEC2InstanceIdsToTerminate ( String ... eC2InstanceIdsToTerminate ) { } } | if ( this . eC2InstanceIdsToTerminate == null ) { setEC2InstanceIdsToTerminate ( new com . amazonaws . internal . SdkInternalList < String > ( eC2InstanceIdsToTerminate . length ) ) ; } for ( String ele : eC2InstanceIdsToTerminate ) { this . eC2InstanceIdsToTerminate . add ( ele ) ; } return this ; |
public class WebSocketExtension { /** * Creates an { @ link WebSocketExtensionParamter } of the specified type .
* @ param < T > generic parameter type
* @ param parameterName name of the parameter
* @ param parameterType Class object representing the parameter type
* @ param parameterMetadata characteristics of the parameter
* @ return Parameter of the specified type */
protected < T > Parameter < T > createParameter ( String parameterName , Class < T > parameterType , EnumSet < Metadata > parameterMetadata ) { } } | if ( ( parameterName == null ) || ( parameterName . trim ( ) . length ( ) == 0 ) ) { String s = "Parameter name cannot be null or empty" ; throw new IllegalArgumentException ( s ) ; } if ( parameterType == null ) { String s = String . format ( "Null type specified for parameter '%s'" , parameterName ) ; throw new IllegalArgumentException ( s ) ; } Parameter < T > parameter = new Parameter < T > ( this , parameterName , parameterType , parameterMetadata ) ; _parameters . add ( parameter ) ; return parameter ; |
public class TranStrategy { /** * Base implementation of postInvoke ; commits any local or global
* transaction which was started during preInvoke , unless
* setRollbackOnly ( ) was called . If setRollback was called , the
* transaction is rolled back now . */
void postInvoke ( EJBKey key , TxCookieImpl cookie , EJBMethodInfoImpl methodInfo ) throws CSIException { } } | final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { // d173022.3
Tr . entry ( tc , "postInvoke" ) ; } // Any local transaction which exists now was started in preInvoke
if ( cookie . beginner ) { if ( txCtrl . getRollbackOnly ( ) ) { // Before rolling back , first determine if the rollback was the
// result of the transaction timing out . If it did time out , then
// and exception needs to be thrown . PM63801
CSITransactionRolledbackException timeoutEx = null ; try { txCtrl . completeTxTimeout ( ) ; } catch ( CSITransactionRolledbackException ex ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "tran timed out; will throw ex after rollback" ) ; timeoutEx = ex ; } rollback ( true , key , methodInfo ) ; // Because of the asynchronous nature of timeouts , if the tran
// did timeout , then the timeout exception needs to be thrown
// regardless of the bean type or setRollbackOnly behavior
// setting . If the beginner did call setRollbackOnly ( ) , then
// this exception may still be discarded later . PM63801
if ( timeoutEx != null ) { if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "postInvoke : " + timeoutEx ) ; throw timeoutEx ; } MethodInterface methodType = methodInfo . getInterfaceType ( ) ; // Transaction has been marked rollbackonly ( due to either a
// timeout or call to setRollbackOnly ) , and has now been rolled
// back . . . so throw an exception to notify the client .
// Note : this will be caught and discarded if bean called
// setRollbackOnly ( ) . d159491
// Note : Beginning with EJB 3.0 ( CTS ) it is required that the
// bean method return normally regardless of how the tx was
// marked for rollback , so don ' t throw the exception . d461917
// Also , the exception needs to be thrown for MDBs and timer
// methods to let the messaging and scheduler services know
// that the method failed / rolledback . d470213
// Note : We will now allow EJB 3.0 modules to have the old
// 2 . x SetRollbackOnly behavior , and we will allow EJB 2 . x
// modules to have the new 3.0 SetRollbackOnly behavior .
// EJB 3 . x modules will exhibit the 2 . x behavior if the
// application is listed in the com . ibm . websphere . ejbcontainer .
// limitSetRollbackOnlyBehaviorToInstanceFor property .
// Likewise , the EJB 2 . x modules will exhibit the 3 . x
// SetRollbackOnly behavior if the application is listed
// in the com . ibm . websphere . ejbcontainer .
// extendSetRollbackOnlyBehaviorBeyondInstanceFor property .
// These properties were analyzed when the EJBModuleMetaData
// was created and the " ivUseExtendedSetRollbackOnlyBehavior "
// was set . / / d461917.1
BeanMetaData bmd = methodInfo . getBeanMetaData ( ) ; EJBModuleMetaDataImpl mmd = bmd . _moduleMetaData ; if ( isTraceOn && tc . isDebugEnabled ( ) ) // d461917.1
{ Tr . debug ( tc , "EJBModuleMetaDataImpl.ivUseExtendedSetRollbackOnlyBehavior = " + mmd . ivUseExtendedSetRollbackOnlyBehavior ) ; } if ( ! mmd . ivUseExtendedSetRollbackOnlyBehavior || methodType == MESSAGE_LISTENER || methodType == TIMED_OBJECT ) { if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "postInvoke : Transaction marked rollbackonly" ) ; throw new CSITransactionRolledbackException ( "Transaction marked rollbackonly" ) ; // LIDB1673.2.1.5
} } else { commit ( key , methodInfo ) ; } } else // LIDB1673.2.1.5
{ // LIDB1673.2.1.5
// Control point on application thread for effecting / / LIDB1673.2.1.5
// rollback in the case of timeout / / LIDB1673.2.1.5 / / d171654
// conditions / / LIDB1673.2.1.5
txCtrl . completeTxTimeout ( ) ; // LIDB1673.2.1.5
} // LIDB1673.2.1.5
if ( isTraceOn && tc . isEntryEnabled ( ) ) { // d173022.3
Tr . exit ( tc , "postInvoke" ) ; } |
public class GroupOf { /** * Sets this group ' s offset , at the given x and y coordinates .
* @ param x
* @ param y
* @ return Group this Group */
@ Override public C setOffset ( final double x , final double y ) { } } | getAttributes ( ) . setOffset ( x , y ) ; return cast ( ) ; |
public class HttpParser { /** * / * Parse a request or response line */
private boolean parseLine ( ByteBuffer buffer ) { } } | boolean handle = false ; // Process headers
while ( _state . ordinal ( ) < State . HEADER . ordinal ( ) && buffer . hasRemaining ( ) && ! handle ) { // process each character
HttpTokens . Token t = next ( buffer ) ; if ( t == null ) break ; if ( _maxHeaderBytes > 0 && ++ _headerBytes > _maxHeaderBytes ) { if ( _state == State . URI ) { LOG . warn ( "URI is too large >" + _maxHeaderBytes ) ; throw new BadMessageException ( HttpStatus . URI_TOO_LONG_414 ) ; } else { if ( _requestHandler != null ) LOG . warn ( "request is too large >" + _maxHeaderBytes ) ; else LOG . warn ( "response is too large >" + _maxHeaderBytes ) ; throw new BadMessageException ( HttpStatus . REQUEST_HEADER_FIELDS_TOO_LARGE_431 ) ; } } switch ( _state ) { case METHOD : switch ( t . getType ( ) ) { case SPACE : _length = _string . length ( ) ; _methodString = takeString ( ) ; if ( _compliances . contains ( HttpComplianceSection . METHOD_CASE_SENSITIVE ) ) { HttpMethod method = HttpMethod . CACHE . get ( _methodString ) ; if ( method != null ) _methodString = method . asString ( ) ; } else { HttpMethod method = HttpMethod . INSENSITIVE_CACHE . get ( _methodString ) ; if ( method != null ) { if ( ! method . asString ( ) . equals ( _methodString ) ) handleViolation ( HttpComplianceSection . METHOD_CASE_SENSITIVE , _methodString ) ; _methodString = method . asString ( ) ; } } setState ( State . SPACE1 ) ; break ; case LF : throw new BadMessageException ( "No URI" ) ; case ALPHA : case DIGIT : case TCHAR : _string . append ( t . getChar ( ) ) ; break ; default : throw new IllegalCharacterException ( _state , t , buffer ) ; } break ; case RESPONSE_VERSION : switch ( t . getType ( ) ) { case SPACE : _length = _string . length ( ) ; String version = takeString ( ) ; _version = HttpVersion . CACHE . get ( version ) ; checkVersion ( ) ; setState ( State . SPACE1 ) ; break ; case ALPHA : case DIGIT : case TCHAR : case VCHAR : case COLON : _string . append ( t . getChar ( ) ) ; break ; default : throw new IllegalCharacterException ( _state , t , buffer ) ; } break ; case SPACE1 : switch ( t . getType ( ) ) { case SPACE : break ; case ALPHA : case DIGIT : case TCHAR : case VCHAR : case COLON : if ( _responseHandler != null ) { if ( t . getType ( ) != HttpTokens . Type . DIGIT ) throw new IllegalCharacterException ( _state , t , buffer ) ; setState ( State . STATUS ) ; setResponseStatus ( t . getByte ( ) - '0' ) ; } else { _uri . reset ( ) ; setState ( State . URI ) ; // quick scan for space or EoBuffer
if ( buffer . hasArray ( ) ) { byte [ ] array = buffer . array ( ) ; int p = buffer . arrayOffset ( ) + buffer . position ( ) ; int l = buffer . arrayOffset ( ) + buffer . limit ( ) ; int i = p ; while ( i < l && array [ i ] > HttpTokens . SPACE ) i ++ ; int len = i - p ; _headerBytes += len ; if ( _maxHeaderBytes > 0 && ++ _headerBytes > _maxHeaderBytes ) { LOG . warn ( "URI is too large >" + _maxHeaderBytes ) ; throw new BadMessageException ( HttpStatus . URI_TOO_LONG_414 ) ; } _uri . append ( array , p - 1 , len + 1 ) ; buffer . position ( i - buffer . arrayOffset ( ) ) ; } else _uri . append ( t . getByte ( ) ) ; } break ; default : throw new BadMessageException ( HttpStatus . BAD_REQUEST_400 , _requestHandler != null ? "No URI" : "No Status" ) ; } break ; case STATUS : switch ( t . getType ( ) ) { case SPACE : setState ( State . SPACE2 ) ; break ; case DIGIT : _responseStatus = _responseStatus * 10 + ( t . getByte ( ) - '0' ) ; if ( _responseStatus >= 1000 ) throw new BadMessageException ( "Bad status" ) ; break ; case LF : setState ( State . HEADER ) ; handle = _responseHandler . startResponse ( _version , _responseStatus , null ) || handle ; break ; default : throw new IllegalCharacterException ( _state , t , buffer ) ; } break ; case URI : switch ( t . getType ( ) ) { case SPACE : setState ( State . SPACE2 ) ; break ; case LF : // HTTP / 0.9
if ( complianceViolation ( HttpComplianceSection . NO_HTTP_0_9 , "No request version" ) ) throw new BadMessageException ( "HTTP/0.9 not supported" ) ; handle = _requestHandler . startRequest ( _methodString , _uri . toString ( ) , HttpVersion . HTTP_0_9 ) ; setState ( State . END ) ; BufferUtils . clear ( buffer ) ; handle = handleHeaderContentMessage ( ) || handle ; break ; case ALPHA : case DIGIT : case TCHAR : case VCHAR : case COLON : case OTEXT : _uri . append ( t . getByte ( ) ) ; break ; default : throw new IllegalCharacterException ( _state , t , buffer ) ; } break ; case SPACE2 : switch ( t . getType ( ) ) { case SPACE : break ; case ALPHA : case DIGIT : case TCHAR : case VCHAR : case COLON : _string . setLength ( 0 ) ; _string . append ( t . getChar ( ) ) ; if ( _responseHandler != null ) { _length = 1 ; setState ( State . REASON ) ; } else { setState ( State . REQUEST_VERSION ) ; // try quick look ahead for HTTP Version
HttpVersion version ; if ( buffer . position ( ) > 0 && buffer . hasArray ( ) ) version = HttpVersion . lookAheadGet ( buffer . array ( ) , buffer . arrayOffset ( ) + buffer . position ( ) - 1 , buffer . arrayOffset ( ) + buffer . limit ( ) ) ; else version = HttpVersion . CACHE . getBest ( buffer , 0 , buffer . remaining ( ) ) ; if ( version != null ) { int pos = buffer . position ( ) + version . asString ( ) . length ( ) - 1 ; if ( pos < buffer . limit ( ) ) { byte n = buffer . get ( pos ) ; if ( n == HttpTokens . CARRIAGE_RETURN ) { _cr = true ; _version = version ; checkVersion ( ) ; _string . setLength ( 0 ) ; buffer . position ( pos + 1 ) ; } else if ( n == HttpTokens . LINE_FEED ) { _version = version ; checkVersion ( ) ; _string . setLength ( 0 ) ; buffer . position ( pos ) ; } } } } break ; case LF : if ( _responseHandler != null ) { setState ( State . HEADER ) ; handle = _responseHandler . startResponse ( _version , _responseStatus , null ) || handle ; } else { // HTTP / 0.9
if ( complianceViolation ( HttpComplianceSection . NO_HTTP_0_9 , "No request version" ) ) throw new BadMessageException ( "HTTP/0.9 not supported" ) ; handle = _requestHandler . startRequest ( _methodString , _uri . toString ( ) , HttpVersion . HTTP_0_9 ) ; setState ( State . END ) ; BufferUtils . clear ( buffer ) ; handle = handleHeaderContentMessage ( ) || handle ; } break ; default : throw new IllegalCharacterException ( _state , t , buffer ) ; } break ; case REQUEST_VERSION : switch ( t . getType ( ) ) { case LF : if ( _version == null ) { _length = _string . length ( ) ; _version = HttpVersion . CACHE . get ( takeString ( ) ) ; } checkVersion ( ) ; // Should we try to cache header fields ?
if ( _fieldCache == null && _version . getVersion ( ) >= HttpVersion . HTTP_1_1 . getVersion ( ) && _handler . getHeaderCacheSize ( ) > 0 ) { int header_cache = _handler . getHeaderCacheSize ( ) ; _fieldCache = new ArrayTernaryTrie < > ( header_cache ) ; } setState ( State . HEADER ) ; handle = _requestHandler . startRequest ( _methodString , _uri . toString ( ) , _version ) || handle ; continue ; case ALPHA : case DIGIT : case TCHAR : case VCHAR : case COLON : _string . append ( t . getChar ( ) ) ; break ; default : throw new IllegalCharacterException ( _state , t , buffer ) ; } break ; case REASON : switch ( t . getType ( ) ) { case LF : String reason = takeString ( ) ; setState ( State . HEADER ) ; handle = _responseHandler . startResponse ( _version , _responseStatus , reason ) || handle ; continue ; case ALPHA : case DIGIT : case TCHAR : case VCHAR : case COLON : case OTEXT : // TODO should this be UTF8
_string . append ( t . getChar ( ) ) ; _length = _string . length ( ) ; break ; case SPACE : case HTAB : _string . append ( t . getChar ( ) ) ; break ; default : throw new IllegalCharacterException ( _state , t , buffer ) ; } break ; default : throw new IllegalStateException ( _state . toString ( ) ) ; } } return handle ; |
public class TableFactoryService { /** * Prepares the supported properties of a factory to be used for match operations . */
private static Tuple2 < List < String > , List < String > > normalizeSupportedProperties ( TableFactory factory ) { } } | List < String > supportedProperties = factory . supportedProperties ( ) ; if ( supportedProperties == null ) { throw new TableException ( String . format ( "Supported properties of factory '%s' must not be null." , factory . getClass ( ) . getName ( ) ) ) ; } List < String > supportedKeys = supportedProperties . stream ( ) . map ( p -> p . toLowerCase ( ) ) . collect ( Collectors . toList ( ) ) ; // extract wildcard prefixes
List < String > wildcards = extractWildcardPrefixes ( supportedKeys ) ; return Tuple2 . of ( supportedKeys , wildcards ) ; |
public class JIT_Stub { /** * Core method for generating the Stub class bytes . Intended for
* use by JITDeploy only ( should not be called directly ) . < p >
* Although the ' methods ' parameter could be obtained from the
* specified remote interface , the ' methods ' and ' idlNames '
* parameters are requested to improve performance . . . allowing
* the two arrays to be obtained once and shared by the code
* that generates the corresponding Tie class . < p >
* @ param stubClassName name of the Stub class to be generated .
* @ param remoteInterface Interface implemented by the generated Stub ;
* not required to implement java . rmi . Remote .
* @ param remoteMethods Methods from the specified remote interface ;
* passed for improved performance .
* @ param idlNames OMG IDL names corresponding to the
* remoteMethods parameter .
* @ param rmicCompatible rmic compatibility flags */
static byte [ ] generateClassBytes ( String stubClassName , Class < ? > remoteInterface , Method [ ] remoteMethods , String [ ] idlNames , int rmicCompatible ) throws EJBConfigurationException { } } | String [ ] remoteInterfaceNames ; int numMethods = remoteMethods . length ; // ASM uses ' internal ' java class names ( like JNI ) where ' / ' is
// used instead of ' . ' , so convert the parameters to ' internal ' format .
String internalStubClassName = convertClassName ( stubClassName ) ; String internalInterfaceName = convertClassName ( remoteInterface . getName ( ) ) ; // Stubs may only be generated for interfaces . d458392
if ( ! Modifier . isInterface ( remoteInterface . getModifiers ( ) ) ) { throw new EJBConfigurationException ( "The " + remoteInterface . getName ( ) + " class is not an interface class. " + "Stubs may only be generated for interface classes." ) ; } // Remote Business interfaces may or may not extend java . rmi . Remote
boolean isRmiRemote = ( Remote . class ) . isAssignableFrom ( remoteInterface ) ; boolean isAbstractInterface = isRmiRemote || CORBA_Utils . isAbstractInterface ( remoteInterface , rmicCompatible ) ; // The ORB requires that all stubs implement java . rmi . Remote , so add
// that in for those EJB ' business ' remote interfaces that do not .
// The methods will NOT throw RemoteException , but the generated
// stub implementation will handle that . d413752.1
if ( isRmiRemote ) remoteInterfaceNames = new String [ ] { internalInterfaceName } ; else remoteInterfaceNames = new String [ ] { internalInterfaceName , "java/rmi/Remote" } ; // The set of classes that are used as constants . Support for the
// CONSTANT _ Class type for the " ldc " opcode was not added to the class
// file format until 1.5 . Prior to that , class files must generate
// synthetic fields for each class constant , and then invoke a synthetic
// class $ ( ) method that calls Class . forName . d676434
Set < String > classConstantFieldNames = new LinkedHashSet < String > ( ) ; Class < ? > [ ] [ ] checkedExceptions = new Class < ? > [ numMethods ] [ ] ; for ( int i = 0 ; i < numMethods ; ++ i ) { checkedExceptions [ i ] = DeploymentUtil . getCheckedExceptions ( remoteMethods [ i ] , isRmiRemote , DeploymentUtil . DeploymentTarget . STUB ) ; // d660332
} if ( TraceComponent . isAnyTracingEnabled ( ) ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "generateClassBytes" ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , INDENT + "className = " + internalStubClassName ) ; Tr . debug ( tc , INDENT + "interface = " + internalInterfaceName ) ; if ( isRmiRemote ) Tr . debug ( tc , INDENT + "implements java.rmi.Remote" ) ; } } // Create the ASM Class Writer to write out a Stub
ClassWriter cw = new ClassWriter ( ClassWriter . COMPUTE_MAXS ) ; // F743-11995
// Define the Stub Class object
cw . visit ( V1_2 , ACC_PUBLIC + ACC_SUPER , internalStubClassName , null , isAbstractInterface ? "javax/rmi/CORBA/Stub" : "com/ibm/ejs/container/SerializableStub" , // PM46698
remoteInterfaceNames ) ; // Define the source code file and debug settings
String sourceFileName = stubClassName . substring ( stubClassName . lastIndexOf ( "." ) + 1 ) + ".java" ; cw . visitSource ( sourceFileName , null ) ; // Add the static and instance variables common to all Stubs .
addFields ( cw ) ; // Initialize the static fields common to all Stubs .
initializeStaticFields ( cw , internalStubClassName , remoteInterface ) ; // Add the public no parameter Stub constructor
addCtor ( cw , internalStubClassName , classConstantFieldNames , // RTC111522
remoteInterface , isAbstractInterface ) ; // Add the methods common to all Stub classes .
addCommonStubMethods ( cw , internalStubClassName ) ; // Add all of the methods to the Stub , based on the reflected
// Method objects from the interface .
for ( int i = 0 ; i < numMethods ; ++ i ) { addStubMethod ( cw , internalStubClassName , classConstantFieldNames , // RTC111522
remoteMethods [ i ] , checkedExceptions [ i ] , // d676434
idlNames [ i ] , isRmiRemote , rmicCompatible ) ; } // Add class constants fields and methods . RTC111522
JITUtils . addClassConstantMembers ( cw , classConstantFieldNames ) ; // Mark the end of the generated wrapper class
cw . visitEnd ( ) ; // Dump the class bytes out to a byte array .
byte [ ] classBytes = cw . toByteArray ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) writeToClassFile ( internalStubClassName , classBytes ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "generateClassBytes: " + classBytes . length + " bytes" ) ; return classBytes ; |
public class DisplayAFP { /** * TODO : same as getEqrPos ? ? ? ! ! ! */
public static final List < Integer > getEQRAlignmentPos ( AFPChain afpChain ) { } } | List < Integer > lst = new ArrayList < Integer > ( ) ; char [ ] s1 = afpChain . getAlnseq1 ( ) ; char [ ] s2 = afpChain . getAlnseq2 ( ) ; char [ ] symb = afpChain . getAlnsymb ( ) ; boolean isFatCat = afpChain . getAlgorithmName ( ) . startsWith ( "jFatCat" ) ; for ( int i = 0 ; i < s1 . length ; i ++ ) { char c1 = s1 [ i ] ; char c2 = s2 [ i ] ; if ( isAlignedPosition ( i , c1 , c2 , isFatCat , symb ) ) { lst . add ( i ) ; } } return lst ; |
public class HtmlEscapeUtil { /** * Perform an escape operation , based on String , according to the specified level and type . */
static String escape ( final String text , final HtmlEscapeType escapeType , final HtmlEscapeLevel escapeLevel ) { } } | if ( text == null ) { return null ; } final int level = escapeLevel . getEscapeLevel ( ) ; final boolean useHtml5 = escapeType . getUseHtml5 ( ) ; final boolean useNCRs = escapeType . getUseNCRs ( ) ; final boolean useHexa = escapeType . getUseHexa ( ) ; final HtmlEscapeSymbols symbols = ( useHtml5 ? HtmlEscapeSymbols . HTML5_SYMBOLS : HtmlEscapeSymbols . HTML4_SYMBOLS ) ; StringBuilder strBuilder = null ; final int offset = 0 ; final int max = text . length ( ) ; int readOffset = offset ; for ( int i = offset ; i < max ; i ++ ) { final char c = text . charAt ( i ) ; /* * Shortcut : most characters will be ASCII / Alphanumeric , and we won ' t need to do anything at
* all for them */
if ( c <= HtmlEscapeSymbols . MAX_ASCII_CHAR && level < symbols . ESCAPE_LEVELS [ c ] ) { continue ; } /* * Shortcut : we might not want to escape non - ASCII chars at all either . */
if ( c > HtmlEscapeSymbols . MAX_ASCII_CHAR && level < symbols . ESCAPE_LEVELS [ HtmlEscapeSymbols . MAX_ASCII_CHAR + 1 ] ) { continue ; } /* * Compute the codepoint . This will be used instead of the char for the rest of the process . */
final int codepoint = Character . codePointAt ( text , i ) ; /* * At this point we know for sure we will need some kind of escape , so we
* can increase the offset and initialize the string builder if needed , along with
* copying to it all the contents pending up to this point . */
if ( strBuilder == null ) { strBuilder = new StringBuilder ( max + 20 ) ; } if ( i - readOffset > 0 ) { strBuilder . append ( text , readOffset , i ) ; } if ( Character . charCount ( codepoint ) > 1 ) { // This is to compensate that we are actually escaping two char [ ] positions with a single codepoint .
i ++ ; } readOffset = i + 1 ; /* * Perform the real escape , attending the different combinations of NCR , DCR and HCR needs . */
if ( useNCRs ) { // We will try to use an NCR
if ( codepoint < symbols . NCRS_BY_CODEPOINT_LEN ) { // codepoint < 0x2fff - all HTML4 , most HTML5
final short ncrIndex = symbols . NCRS_BY_CODEPOINT [ codepoint ] ; if ( ncrIndex != symbols . NO_NCR ) { // There is an NCR for this codepoint !
strBuilder . append ( symbols . SORTED_NCRS [ ncrIndex ] ) ; continue ; } // else , just let it exit the block and let decimal / hexa escape do its job
} else if ( symbols . NCRS_BY_CODEPOINT_OVERFLOW != null ) { // codepoint > = 0x2fff . NCR , if exists , will live at the overflow map ( if there is one ) .
final Short ncrIndex = symbols . NCRS_BY_CODEPOINT_OVERFLOW . get ( Integer . valueOf ( codepoint ) ) ; if ( ncrIndex != null ) { strBuilder . append ( symbols . SORTED_NCRS [ ncrIndex . shortValue ( ) ] ) ; continue ; } // else , just let it exit the block and let decimal / hexa escape do its job
} } /* * No NCR - escape was possible ( or allowed ) , so we need decimal / hexa escape . */
if ( useHexa ) { strBuilder . append ( REFERENCE_HEXA_PREFIX ) ; strBuilder . append ( Integer . toHexString ( codepoint ) ) ; } else { strBuilder . append ( REFERENCE_DECIMAL_PREFIX ) ; strBuilder . append ( String . valueOf ( codepoint ) ) ; } strBuilder . append ( REFERENCE_SUFFIX ) ; } /* * Final cleaning : return the original String object if no escape was actually needed . Otherwise
* append the remaining unescaped text to the string builder and return . */
if ( strBuilder == null ) { return text ; } if ( max - readOffset > 0 ) { strBuilder . append ( text , readOffset , max ) ; } return strBuilder . toString ( ) ; |
public class FrameworkMethodRunner { /** * Returns a { @ link Statement } that invokes { @ code method } on { @ code test } */
protected Statement methodInvoker ( FrameworkMethod method , Object test ) { } } | return new ParameterizedInvokeMethod ( method , test , methodArgs ) ; |
public class FastSet { /** * { @ inheritDoc } */
@ Override public int indexOf ( int e ) { } } | if ( e < 0 ) { throw new IllegalArgumentException ( "positive integer expected: " + Integer . toString ( e ) ) ; } if ( isEmpty ( ) ) { return - 1 ; } int index = wordIndex ( e ) ; if ( index >= firstEmptyWord || ( words [ index ] & ( 1 << e ) ) == 0 ) { return - 1 ; } int count = BitCount . count ( words , index ) ; count += Integer . bitCount ( words [ index ] & ~ ( ALL_ONES_WORD << e ) ) ; return count ; |
public class RRSF424BaseGenerator { /** * This method tests whether a document ' s sponsor is in a given sponsor hierarchy . */
public boolean isSponsorInHierarchy ( DevelopmentProposalContract sponsorable , String sponsorHierarchy , String level1 ) { } } | return sponsorHierarchyService . isSponsorInHierarchy ( sponsorable . getSponsor ( ) . getSponsorCode ( ) , sponsorHierarchy , 1 , level1 ) ; |
public class DescribeTrustsResult { /** * The list of Trust objects that were retrieved .
* It is possible that this list contains less than the number of items specified in the < i > Limit < / i > member of the
* request . This occurs if there are less than the requested number of items left to retrieve , or if the limitations
* of the operation have been exceeded .
* @ param trusts
* The list of Trust objects that were retrieved . < / p >
* It is possible that this list contains less than the number of items specified in the < i > Limit < / i > member
* of the request . This occurs if there are less than the requested number of items left to retrieve , or if
* the limitations of the operation have been exceeded . */
public void setTrusts ( java . util . Collection < Trust > trusts ) { } } | if ( trusts == null ) { this . trusts = null ; return ; } this . trusts = new com . amazonaws . internal . SdkInternalList < Trust > ( trusts ) ; |
public class JobStatusCalculator { /** * Builds a JobStatusCalculator that is reporting { @ link Status # WARNING } if the last job failed .
* @ param key key of the calculator
* @ param jobRepository the repository
* @ param jobMetaRepository meta data to indentify disabled jobs
* @ param managementContextPath base path to link to job directly
* @ return JobStatusCalculator */
public static JobStatusCalculator warningOnLastJobFailed ( final String key , final JobRepository jobRepository , final JobMetaRepository jobMetaRepository , final String managementContextPath ) { } } | return new JobStatusCalculator ( key , 1 , 1 , jobRepository , jobMetaRepository , managementContextPath ) ; |
public class StandardDdlParser { /** * Returns a list of data type start words which can be used to help identify a column definition sub - statement .
* @ return list of data type start words */
protected List < String > getDataTypeStartWords ( ) { } } | if ( allDataTypeStartWords == null ) { allDataTypeStartWords = new ArrayList < String > ( ) ; allDataTypeStartWords . addAll ( DataTypes . DATATYPE_START_WORDS ) ; allDataTypeStartWords . addAll ( getCustomDataTypeStartWords ( ) ) ; } return allDataTypeStartWords ; |
public class IabHelper { /** * Workaround to bug where sometimes response codes come as Long instead of Integer */
int getResponseCodeFromIntent ( Intent i ) { } } | Object o = i . getExtras ( ) . get ( RESPONSE_CODE ) ; if ( o == null ) { logError ( "Intent with no response code, assuming OK (known issue)" ) ; return BILLING_RESPONSE_RESULT_OK ; } else if ( o instanceof Integer ) return ( ( Integer ) o ) . intValue ( ) ; else if ( o instanceof Long ) return ( int ) ( ( Long ) o ) . longValue ( ) ; else { logError ( "Unexpected type for intent response code." ) ; logError ( o . getClass ( ) . getName ( ) ) ; throw new RuntimeException ( "Unexpected type for intent response code: " + o . getClass ( ) . getName ( ) ) ; } |
public class DdosProtectionPlansInner { /** * Creates or updates a DDoS protection plan .
* @ param resourceGroupName The name of the resource group .
* @ param ddosProtectionPlanName The name of the DDoS protection plan .
* @ param parameters Parameters supplied to the create or update operation .
* @ 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 < DdosProtectionPlanInner > createOrUpdateAsync ( String resourceGroupName , String ddosProtectionPlanName , DdosProtectionPlanInner parameters , final ServiceCallback < DdosProtectionPlanInner > serviceCallback ) { } } | return ServiceFuture . fromResponse ( createOrUpdateWithServiceResponseAsync ( resourceGroupName , ddosProtectionPlanName , parameters ) , serviceCallback ) ; |
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public String convertColorFidelityStpCoExToString ( EDataType eDataType , Object instanceValue ) { } } | return instanceValue == null ? null : instanceValue . toString ( ) ; |
public class PlayerImpl { /** * Player methods */
@ SuppressWarnings ( "static-access" ) public void play ( URI [ ] uris , RTC [ ] rtc , Parameters params ) throws MsControlException { } } | if ( rtc != null ) { verifyRTC ( rtc ) ; } this . checkURI ( uris ) ; PlayTask task = new PlayTask ( uris , rtc , params ) ; // user calls play during the current work ?
if ( fsm . getState ( ) . getName ( ) . equals ( STATE_IDLE ) ) { playList . offer ( task ) ; } else { // no specific behaviour ?
if ( params == null ) { throw new MsControlException ( "Busy now: state=" + fsm . getState ( ) ) ; } Value behaviour = ( Value ) params . get ( Player . BEHAVIOUR_IF_BUSY ) ; playList . offer ( task ) ; if ( Player . FAIL_IF_BUSY . equals ( behaviour ) ) { // queue task and send stop
throw new MsControlException ( "Busy now" ) ; } if ( Player . STOP_IF_BUSY . equals ( behaviour ) ) { // queue task and send stop
try { fsm . signal ( SIGNAL_STOP ) ; } catch ( UnknownTransitionException e ) { } } } new Thread ( new Starter ( ) ) . start ( ) ; lock . lock ( ) ; try { try { started . await ( ) ; } catch ( InterruptedException e ) { } } finally { lock . unlock ( ) ; } |
public class AbstractRemoteTransport { /** * localUpdateShortRunningFree
* @ param logicalAddress the logical address
* @ param freeCount the free count */
public void localUpdateShortRunningFree ( Address logicalAddress , Long freeCount ) { } } | if ( trace ) log . tracef ( "LOCAL_UPDATE_SHORTRUNNING_FREE(%s, %d)" , logicalAddress , freeCount ) ; DistributedWorkManager dwm = workManagerCoordinator . resolveDistributedWorkManager ( logicalAddress ) ; if ( dwm != null ) { Collection < NotificationListener > copy = new ArrayList < NotificationListener > ( dwm . getNotificationListeners ( ) ) ; for ( NotificationListener nl : copy ) { nl . updateShortRunningFree ( logicalAddress , freeCount ) ; } } else { WorkManagerEventQueue wmeq = WorkManagerEventQueue . getInstance ( ) ; wmeq . addEvent ( new WorkManagerEvent ( WorkManagerEvent . TYPE_UPDATE_SHORT_RUNNING , logicalAddress , freeCount ) ) ; } |
public class JaroDistanceTextSimilarity { /** * 计算相似度分值
* @ param words1 词列表1
* @ param words2 词列表2
* @ return 相似度分值 */
@ Override protected double scoreImpl ( List < Word > words1 , List < Word > words2 ) { } } | // 文本1
StringBuilder text1 = new StringBuilder ( ) ; words1 . forEach ( word -> text1 . append ( word . getText ( ) ) ) ; // 文本2
StringBuilder text2 = new StringBuilder ( ) ; words2 . forEach ( word -> text2 . append ( word . getText ( ) ) ) ; // 计算文本1和文本2的Jaro距离
// Jaro距离也就是相似度分值
double score = jaroDistance ( text1 . toString ( ) , text2 . toString ( ) ) ; if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "文本1:" + text1 . toString ( ) ) ; LOGGER . debug ( "文本2:" + text2 . toString ( ) ) ; LOGGER . debug ( "文本1和文本2的相似度分值:" + score ) ; } return score ; |
public class TextUtils { /** * Exception - and warning - free URL - escaping utility method .
* @ param s String to escape
* @ return URL - escaped string */
@ SuppressWarnings ( "deprecation" ) public static String urlEscape ( String s ) { } } | try { return URLEncoder . encode ( s , "UTF8" ) ; } catch ( UnsupportedEncodingException e ) { // should be impossible ; all JVMs must support UTF8
// but have a fallback just in case
return URLEncoder . encode ( s ) ; } |
public class RepositoryTypeClass { /** * < p > newInstance . < / p >
* @ param repositoryType a { @ link com . greenpepper . server . domain . RepositoryType } object .
* @ param envType a { @ link com . greenpepper . server . domain . EnvironmentType } object .
* @ param className a { @ link java . lang . String } object .
* @ return a { @ link com . greenpepper . server . domain . RepositoryTypeClass } object . */
public static RepositoryTypeClass newInstance ( RepositoryType repositoryType , EnvironmentType envType , String className ) { } } | RepositoryTypeClass repoTypeClass = new RepositoryTypeClass ( ) ; repoTypeClass . setRepositoryType ( repositoryType ) ; repoTypeClass . setEnvType ( envType ) ; repoTypeClass . setClassName ( className ) ; return repoTypeClass ; |
public class MemorySegment { /** * Writes the given character ( 16 bit , 2 bytes ) to the given position in little - endian
* byte order . This method ' s speed depends on the system ' s native byte order , and it
* is possibly slower than { @ link # putChar ( int , char ) } . For most cases ( such as
* transient storage in memory or serialization for I / O and network ) ,
* it suffices to know that the byte order in which the value is written is the same as the
* one in which it is read , and { @ link # putChar ( int , char ) } is the preferable choice .
* @ param index The position at which the value will be written .
* @ param value The char value to be written .
* @ throws IndexOutOfBoundsException Thrown , if the index is negative , or larger than the segment size minus 2. */
public final void putCharLittleEndian ( int index , char value ) { } } | if ( LITTLE_ENDIAN ) { putChar ( index , value ) ; } else { putChar ( index , Character . reverseBytes ( value ) ) ; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.