signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Quicksort { /** * Sort routine that recursively calls itself after the partition algorithm sorted the elements
* in order . This routine is used for both the ascending and descending algorithms . The only
* difference is the call to the partition algorithm .
* @ param < E > the type of elements in th... | if ( start >= end ) { return ; } int pivot = 0 ; if ( descending ) { pivot = Quicksort . partitionDescending ( list , start , end ) ; } else { pivot = Quicksort . partition ( list , start , end ) ; } Quicksort . sort ( list , start , pivot - 1 , descending ) ; Quicksort . sort ( list , pivot + 1 , end , descending ) ; |
public class ServerRequestContext { /** * Retrieve the current server request context .
* @ param < T > The body type
* @ return The request context if it is present */
@ SuppressWarnings ( "unchecked" ) public static < T > Optional < HttpRequest < T > > currentRequest ( ) { } } | return Optional . ofNullable ( REQUEST . get ( ) ) ; |
public class ByteBufQueue { /** * Returns the first ByteBuf of this queue if the queue is not empty .
* Otherwise returns null .
* @ return the first ByteBuf of the queue or { @ code null } */
@ Nullable @ Contract ( pure = true ) public ByteBuf peekBuf ( ) { } } | return hasRemaining ( ) ? bufs [ first ] : null ; |
public class AttachableURLFactory { /** * documentation inherited from interface URLStreamHandlerFactory */
public URLStreamHandler createURLStreamHandler ( String protocol ) { } } | Class < ? extends URLStreamHandler > handler = _handlers . get ( protocol . toLowerCase ( ) ) ; if ( handler != null ) { try { return handler . newInstance ( ) ; } catch ( Exception e ) { log . warning ( "Unable to instantiate URLStreamHandler" , "protocol" , protocol , "cause" , e ) ; } } return null ; |
public class DISCARD { /** * Checks if a message should be passed up , or not */
protected boolean shouldDropUpMessage ( @ SuppressWarnings ( "UnusedParameters" ) Message msg , Address sender ) { } } | if ( discard_all && ! sender . equals ( localAddress ( ) ) ) return true ; if ( ignoredMembers . contains ( sender ) ) { if ( log . isTraceEnabled ( ) ) log . trace ( localAddress + ": dropping message from " + sender ) ; num_up ++ ; return true ; } if ( up > 0 ) { double r = Math . random ( ) ; if ( r < up ) { if ( ex... |
public class DescribeDirectConnectGatewayAttachmentsResult { /** * The attachments .
* @ param directConnectGatewayAttachments
* The attachments . */
public void setDirectConnectGatewayAttachments ( java . util . Collection < DirectConnectGatewayAttachment > directConnectGatewayAttachments ) { } } | if ( directConnectGatewayAttachments == null ) { this . directConnectGatewayAttachments = null ; return ; } this . directConnectGatewayAttachments = new com . amazonaws . internal . SdkInternalList < DirectConnectGatewayAttachment > ( directConnectGatewayAttachments ) ; |
public class Channel { /** * query this channel for chain information .
* The request is sent to a random peer in the channel
* @ param userContext the user context to use .
* @ return a { @ link BlockchainInfo } object containing the chain info requested
* @ throws InvalidArgumentException
* @ throws Proposa... | return queryBlockchainInfo ( getShuffledPeers ( EnumSet . of ( PeerRole . LEDGER_QUERY ) ) , userContext ) ; |
public class AbstractValidate { /** * < p > Validate that the specified argument map is neither { @ code null } nor a size of zero ( no elements ) ; otherwise throwing an exception with the specified message . < / p >
* < pre > Validate . notEmpty ( myMap , " The map must not be empty " ) ; < / pre >
* @ param < T ... | if ( map == null ) { failNull ( String . format ( message , values ) ) ; } if ( map . isEmpty ( ) ) { fail ( String . format ( message , values ) ) ; } return map ; |
public class CmsPublishList { /** * Checks if the publish list contains a resource . < p >
* @ param res the resource
* @ return true if the publish list contains a resource */
protected boolean containsResource ( CmsResource res ) { } } | return m_deletedFolderList . contains ( res ) || m_folderList . contains ( res ) || m_fileList . contains ( res ) ; |
public class Frame { /** * Encodes samples into the appropriate compressed format , saving the
* result in the given “ data ” EncodedElement list . Encodes ' count ' samples ,
* from index ' start ' , to index ' start ' times ' skip ' , where “ skip ” is the
* format that samples may be packed in an array . For e... | // System . err . println ( " FRAME : : encodeSamples : frame # : " + frameNumber ) ;
if ( DEBUG_LEV > 0 ) { System . err . println ( "FRAME::encodeSamplesNew(...)" ) ; if ( DEBUG_LEV > 10 ) { System . err . println ( "\tsamples.length:" + samples . length + ":count:" + count + ":start:" + start + ":skip:" + skip + ":f... |
public class GCFLTImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public boolean eIsSet ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . GCFLT__RG : return rg != null && ! rg . isEmpty ( ) ; } return super . eIsSet ( featureID ) ; |
public class DenseGrid { /** * Creates a { @ code DenseGrid } copying from another grid .
* @ param < V > the type of the value
* @ param grid the grid to copy , not null
* @ return the mutable grid , not null */
@ SuppressWarnings ( "unchecked" ) public static < V > DenseGrid < V > create ( Grid < ? extends V > ... | if ( grid == null ) { throw new IllegalArgumentException ( "Grid must not be null" ) ; } if ( grid instanceof DenseImmutableGrid ) { return new DenseGrid < V > ( ( DenseImmutableGrid < V > ) grid ) ; } DenseGrid < V > created = DenseGrid . create ( grid . rowCount ( ) , grid . columnCount ( ) ) ; created . putAll ( gri... |
public class VertxCompletableFuture { /** * Creates a new { @ link VertxCompletableFuture } using the current context . This method is used to switch between
* Vert . x contexts .
* @ return the created { @ link VertxCompletableFuture } */
public VertxCompletableFuture < T > withContext ( ) { } } | Context context = Objects . requireNonNull ( Vertx . currentContext ( ) ) ; return withContext ( context ) ; |
public class SecurityPolicySettings { /** * Gets the securityPolicyType value for this SecurityPolicySettings .
* @ return securityPolicyType * Type of security policy . This determines which other fields
* should be populated . This value is
* required for a valid security policy . */
public com . google . api .... | return securityPolicyType ; |
public class FeatureAttributeEditor { /** * Return the feature , with the current values in the " editable " form . This feature will not necessarily contain
* validated attribute values , so it is recommended to call the < code > validate < / code > method first .
* @ return */
public Feature getFeature ( ) { } } | for ( AttributeInfo info : layer . getLayerInfo ( ) . getFeatureInfo ( ) . getAttributes ( ) ) { featureForm . fromForm ( info . getName ( ) , feature . getAttributes ( ) . get ( info . getName ( ) ) ) ; } return feature ; |
public class DumbMetaEntryFactory { /** * { @ inheritDoc } */
@ Override public IMetaEntry deserializeEntry ( DataInput pData ) throws TTIOException { } } | try { final int kind = pData . readInt ( ) ; switch ( kind ) { case KEY : return new DumbKey ( pData . readLong ( ) ) ; case VALUE : return new DumbValue ( pData . readLong ( ) ) ; default : throw new IllegalStateException ( "Kind not defined." ) ; } } catch ( final IOException exc ) { throw new TTIOException ( exc ) ;... |
public class AppServiceEnvironmentsInner { /** * Get metric definitions for a specific instance of a worker pool of an App Service Environment .
* Get metric definitions for a specific instance of a worker pool of an App Service Environment .
* @ param resourceGroupName Name of the resource group to which the resou... | return listWorkerPoolInstanceMetricDefinitionsSinglePageAsync ( resourceGroupName , name , workerPoolName , instance ) . concatMap ( new Func1 < ServiceResponse < Page < ResourceMetricDefinitionInner > > , Observable < ServiceResponse < Page < ResourceMetricDefinitionInner > > > > ( ) { @ Override public Observable < S... |
public class AntClassLoader { /** * Returns the classpath this classloader will consult .
* @ return the classpath used for this classloader , with elements
* separated by the path separator for the system . */
public String getClasspath ( ) { } } | StringBuilder sb = new StringBuilder ( ) ; boolean firstPass = true ; Enumeration componentEnum = pathComponents . elements ( ) ; while ( componentEnum . hasMoreElements ( ) ) { if ( ! firstPass ) { sb . append ( System . getProperty ( "path.separator" ) ) ; } else { firstPass = false ; } sb . append ( ( ( File ) compo... |
public class CommerceShippingFixedOptionLocalServiceWrapper { /** * Creates a new commerce shipping fixed option with the primary key . Does not add the commerce shipping fixed option to the database .
* @ param commerceShippingFixedOptionId the primary key for the new commerce shipping fixed option
* @ return the ... | return _commerceShippingFixedOptionLocalService . createCommerceShippingFixedOption ( commerceShippingFixedOptionId ) ; |
public class RxFile { /** * Get a thumbnail from the provided Image or Video Uri . */
public static Observable < Bitmap > getThumbnail ( Context context , Uri uri ) { } } | return getThumbnailFromUri ( context , uri ) ; |
public class LoggingEndpointInterceptor { /** * Write response message to logger . */
public boolean handleResponse ( MessageContext messageContext , Object endpoint ) throws Exception { } } | logResponse ( "Sending SOAP response" , messageContext , false ) ; return true ; |
public class RestoreDBInstanceFromS3Request { /** * The list of logs that the restored DB instance is to export to CloudWatch Logs . The values in the list depend on
* the DB engine being used . For more information , see < a href =
* " https : / / docs . aws . amazon . com / AmazonRDS / latest / UserGuide / USER _... | if ( this . enableCloudwatchLogsExports == null ) { setEnableCloudwatchLogsExports ( new com . amazonaws . internal . SdkInternalList < String > ( enableCloudwatchLogsExports . length ) ) ; } for ( String ele : enableCloudwatchLogsExports ) { this . enableCloudwatchLogsExports . add ( ele ) ; } return this ; |
public class LinearSearch { /** * Search for the minimum element in the array .
* @ param doubleArray array that we are searching in .
* @ return the minimum element in the array . */
public static double searchMin ( double [ ] doubleArray ) { } } | if ( doubleArray . length == 0 ) { throw new IllegalArgumentException ( "The array you provided does not have any elements" ) ; } double min = doubleArray [ 0 ] ; for ( int i = 1 ; i < doubleArray . length ; i ++ ) { if ( doubleArray [ i ] < min ) { min = doubleArray [ i ] ; } } return min ; |
public class SAXProcessor { /** * Computes the distance between approximated values and the real TS .
* @ param ts the timeseries .
* @ param winSize SAX window size .
* @ param paaSize SAX PAA size .
* @ param alphabetSize SAX alphabet size .
* @ param normThreshold the normalization threshold .
* @ return... | double resDistance = 0d ; int windowCounter = 0 ; double [ ] centralLines = na . getCentralCuts ( alphabetSize ) ; double [ ] cuts = na . getCuts ( alphabetSize ) ; for ( int i = 0 ; i < ts . length - winSize + 1 ; i ++ ) { double [ ] subseries = Arrays . copyOfRange ( ts , i , i + winSize ) ; double subsequenceDistanc... |
public class CoreOptions { /** * Creates a composite option of { @ link VMOption } s .
* @ param vmOptions
* virtual machine options ( cannot be null or containing null entries )
* @ return composite option of virtual machine options
* @ throws IllegalArgumentException
* - If urls array is null or contains nu... | validateNotEmptyContent ( vmOptions , true , "VM options" ) ; final List < VMOption > options = new ArrayList < VMOption > ( ) ; for ( String vmOption : vmOptions ) { options . add ( vmOption ( vmOption ) ) ; } return vmOptions ( options . toArray ( new VMOption [ options . size ( ) ] ) ) ; |
public class CassandraSchemaMgr { /** * Delete the keyspace with the given name . This method can use any DB connection .
* @ param dbConn Database connection to use .
* @ param keyspace Name of keyspace to drop . */
public void dropKeyspace ( DBConn dbConn , String keyspace ) { } } | m_logger . info ( "Deleting Keyspace '{}'" , keyspace ) ; try { dbConn . getClientSession ( ) . system_drop_keyspace ( keyspace ) ; waitForSchemaPropagation ( dbConn ) ; } catch ( Exception ex ) { String errMsg = "Failed to delete Keyspace '" + keyspace + "'" ; m_logger . error ( errMsg , ex ) ; throw new RuntimeExcept... |
public class GuardRail { /** * Release acquired permits with known result . Since there is a known result the result
* count object and latency will be updated .
* @ param context context of the task execution
* @ param result of the execution */
public void releasePermits ( ExecutionContext context , Result resu... | releasePermits ( context . permitCount ( ) , result , context . startNanos ( ) , clock . nanoTime ( ) ) ; |
public class NS { /** * Returns a < a href =
* " http : / / docs . aws . amazon . com / amazondynamodb / latest / developerguide / Expressions . SpecifyingConditions . html # ConditionExpressionReference . Functions "
* > comparator condition < / a > ( that evaluates to true if the attribute value
* referred to b... | return new ComparatorCondition ( "<>" , this , new LiteralOperand ( value ) ) ; |
public class OidcAuthenticator { /** * The preferred { @ link ClientAuthenticationMethod } specified in the given
* { @ link OidcConfiguration } , or < code > null < / code > meaning that the a
* provider - supported method should be chosen . */
private static ClientAuthenticationMethod getPreferredAuthenticationMe... | final ClientAuthenticationMethod configurationMethod = config . getClientAuthenticationMethod ( ) ; if ( configurationMethod == null ) { return null ; } if ( ! SUPPORTED_METHODS . contains ( configurationMethod ) ) { throw new TechnicalException ( "Configured authentication method (" + configurationMethod + ") is not s... |
public class ASN1Set { /** * return an ASN1Set from the given object .
* @ param obj the object we want converted .
* @ exception IllegalArgumentException if the object cannot be converted . */
public static ASN1Set getInstance ( Object obj ) { } } | if ( obj == null || obj instanceof ASN1Set ) { return ( ASN1Set ) obj ; } throw new IllegalArgumentException ( "unknown object in getInstance" ) ; |
public class BoxRetentionPolicy { /** * Returns iterable with all enterprise assignments of this retention policy .
* @ param limit the limit of entries per response . The default value is 100.
* @ param fields the fields to retrieve .
* @ return an iterable containing all enterprise assignments . */
public Itera... | return this . getAssignments ( BoxRetentionPolicyAssignment . TYPE_ENTERPRISE , limit , fields ) ; |
public class ReplicationTaskAssessmentResultMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ReplicationTaskAssessmentResult replicationTaskAssessmentResult , ProtocolMarshaller protocolMarshaller ) { } } | if ( replicationTaskAssessmentResult == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( replicationTaskAssessmentResult . getReplicationTaskIdentifier ( ) , REPLICATIONTASKIDENTIFIER_BINDING ) ; protocolMarshaller . marshall ( replicationTas... |
public class GlobalUsersInner { /** * List labs for the user .
* @ param userName The name of the user .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the ListLabsResponseInner object */
public Observable < ListLabsResponseInner > listLabsAsync ( String ... | return listLabsWithServiceResponseAsync ( userName ) . map ( new Func1 < ServiceResponse < ListLabsResponseInner > , ListLabsResponseInner > ( ) { @ Override public ListLabsResponseInner call ( ServiceResponse < ListLabsResponseInner > response ) { return response . body ( ) ; } } ) ; |
public class FunctionVersionReader { /** * Make the request to the Twilio API to perform the read .
* @ param client TwilioRestClient with which to make the request
* @ return FunctionVersion ResourceSet */
@ Override public ResourceSet < FunctionVersion > read ( final TwilioRestClient client ) { } } | return new ResourceSet < > ( this , client , firstPage ( client ) ) ; |
public class Group { /** * Adds devices matching pattern
* to the group
* @ throws DevFailed */
public void add ( final String p ) throws DevFailed { } } | synchronized ( this ) { final Vector v = factory . instanciate ( p ) ; final Iterator it = v . iterator ( ) ; while ( it . hasNext ( ) ) { add_i ( ( GroupElement ) it . next ( ) ) ; } } |
public class AnnotatedHttpServiceFactory { /** * Returns the list of { @ link AnnotatedHttpService } defined by { @ link Path } and HTTP method annotations
* from the specified { @ code object } . */
public static List < AnnotatedHttpServiceElement > find ( String pathPrefix , Object object , Iterable < ? > exception... | Builder < ExceptionHandlerFunction > exceptionHandlers = null ; Builder < RequestConverterFunction > requestConverters = null ; Builder < ResponseConverterFunction > responseConverters = null ; for ( final Object o : exceptionHandlersAndConverters ) { boolean added = false ; if ( o instanceof ExceptionHandlerFunction )... |
public class GetUtterancesViewRequest { /** * An array of bot versions for which utterance information should be returned . The limit is 5 versions per request .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setBotVersions ( java . util . Collection ) } or ... | if ( this . botVersions == null ) { setBotVersions ( new java . util . ArrayList < String > ( botVersions . length ) ) ; } for ( String ele : botVersions ) { this . botVersions . add ( ele ) ; } return this ; |
public class ChainedResourceLoader { /** * Returns { @ code true } , if any of the delegate loaders returns { @ true } from
* { @ link # exists ( String ) } for the given path . */
@ Override public boolean exists ( String resource , String [ ] paths ) throws IOException { } } | for ( ResourceLoader loader : loaders ) { if ( loader . exists ( resource , paths ) ) { return true ; } } return false ; |
public class VertexData { /** * Replaces the contents of this vertex data by the provided one . This is a deep copy . The vertex attribute are each individually cloned .
* @ param data The data to copy . */
public void copy ( VertexData data ) { } } | clear ( ) ; indices . addAll ( data . indices ) ; final TIntObjectIterator < VertexAttribute > iterator = data . attributes . iterator ( ) ; while ( iterator . hasNext ( ) ) { iterator . advance ( ) ; attributes . put ( iterator . key ( ) , iterator . value ( ) . clone ( ) ) ; } nameToIndex . putAll ( data . nameToInde... |
public class MatchResultPredicates { /** * Generates a Predicate that only accepts the Match Results within a range . The range may be closed or open at each
* of the boundaries . { @ code BoundType . CLOSED } means that the boundary should also be accepted . { @ code BoundType . OPEN }
* on the other indicates tha... | Predicate < T > lowerPredicate ; Predicate < T > upperPredicate ; if ( minBound . equals ( BoundType . CLOSED ) ) { lowerPredicate = greaterOrEqualTo ( minMatchType ) ; } else { lowerPredicate = greaterThan ( minMatchType ) ; } if ( maxBound . equals ( BoundType . CLOSED ) ) { upperPredicate = lowerOrEqualTo ( maxMatch... |
public class LookupFriendships { /** * Usage : java twitter4j . examples . user . LookupFriendships [ screen name [ , screen name . . ] ]
* @ param args message */
public static void main ( String [ ] args ) { } } | if ( args . length < 1 ) { System . out . println ( "Usage: java twitter4j.examples.user.LookupFriendships [screen name[,screen name..]]" ) ; System . exit ( - 1 ) ; } try { Twitter twitter = new TwitterFactory ( ) . getInstance ( ) ; ResponseList < Friendship > friendships = twitter . lookupFriendships ( args [ 0 ] . ... |
public class AbstractItemLink { /** * Gets a reference to the item , which is asserted to be obtained from the
* strong reference . We use this when we know that the state of the item
* tells us that there is a strong reference .
* @ throws SevereMessageStoreException */
private final AbstractItem _getAndAssertIt... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "_getAndAssertItem" ) ; AbstractItem item = null ; synchronized ( this ) { item = _strongReferenceToItem ; } // Defect 601995
if ( item == NULL_STRONG_REF ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnab... |
public class GetResourcePoliciesResult { /** * A key policy document , in JSON format .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setPolicies ( java . util . Collection ) } or { @ link # withPolicies ( java . util . Collection ) } if you want to overrid... | if ( this . policies == null ) { setPolicies ( new java . util . ArrayList < String > ( policies . length ) ) ; } for ( String ele : policies ) { this . policies . add ( ele ) ; } return this ; |
public class MolecularFormulaManipulator { /** * Correct the mass according the charge of the IMmoleculeFormula .
* Negative charge will add the mass of one electron to the mass .
* @ param mass The mass to correct
* @ param charge The charge
* @ return The mass with the correction */
private static double corr... | if ( charge == null ) return mass ; double massE = 0.00054857990927 ; if ( charge > 0 ) mass -= massE * charge ; else if ( charge < 0 ) mass += massE * Math . abs ( charge ) ; return mass ; |
public class ConnectivityChecker { /** * Partitions the atoms in an AtomContainer into covalently connected components .
* @ param container The AtomContainer to be partitioned into connected components , i . e . molecules
* @ return A MoleculeSet .
* @ cdk . dictref blue - obelisk : graphPartitioning */
public s... | ConnectedComponents cc = new ConnectedComponents ( GraphUtil . toAdjList ( container ) ) ; return partitionIntoMolecules ( container , cc . components ( ) ) ; |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getTLE ( ) { } } | if ( tleEClass == null ) { tleEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 320 ) ; } return tleEClass ; |
public class AssociationValue { /** * Sets the specified date attribute to the specified value .
* @ param name name of the attribute
* @ param value value of the attribute
* @ since 1.9.0 */
public void setDateAttribute ( String name , Date value ) { } } | ensureAttributes ( ) ; Attribute attribute = new DateAttribute ( value ) ; attribute . setEditable ( isEditable ( name ) ) ; getAllAttributes ( ) . put ( name , attribute ) ; |
public class WSRdbManagedConnectionImpl { /** * Adds a connection event listener to the ManagedConnection instance .
* The registered ConnectionEventListener instances are notified of connection
* close and error events , also of local transaction related events on the
* Managed Connection .
* @ param listener ... | final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "addConnectionEventListener" , listener ) ; if ( listener == null ) throw new NullPointerException ( "Cannot add null ConnectionEventListener." ) ; // Not synchronized because of the... |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcReference ( ) { } } | if ( ifcReferenceEClass == null ) { ifcReferenceEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 507 ) ; } return ifcReferenceEClass ; |
public class FeedCommProcessor { /** * Sends a message to the server asynchronously . This method returns immediately ; the message may not go out until
* some time in the future .
* @ param messageWithData the message to send */
public void sendAsync ( BasicMessageWithExtraData < ? extends BasicMessage > messageWi... | if ( ! isConnected ( ) ) { throw new IllegalStateException ( "WebSocket connection was closed. Cannot send any messages" ) ; } BasicMessage message = messageWithData . getBasicMessage ( ) ; configurationAuthentication ( message ) ; sendExecutor . execute ( new Runnable ( ) { @ Override public void run ( ) { try { if ( ... |
public class Logging { /** * Log a message at the ' fine ' debugging level .
* You should check isDebugging ( ) before building the message .
* @ param message Informational log message .
* @ param e Exception */
public void fine ( CharSequence message , Throwable e ) { } } | log ( Level . FINE , message , e ) ; |
public class CommandReader { /** * Set a breakpoint at the given function or operation name with a condition .
* @ param name
* The function or operation name .
* @ param condition
* Any condition for the breakpoint , or null .
* @ throws Exception
* Problems parsing condition . */
private void setBreakpoin... | LexTokenReader ltr = new LexTokenReader ( name , Dialect . VDM_SL ) ; LexToken token = ltr . nextToken ( ) ; ltr . close ( ) ; Value v = null ; if ( token . is ( VDMToken . IDENTIFIER ) ) { LexIdentifierToken id = ( LexIdentifierToken ) token ; LexNameToken lnt = new LexNameToken ( interpreter . getDefaultName ( ) , id... |
public class BaseDataAdaptiveTableLayoutAdapter { /** * Switch 2 columns with data
* @ param columnIndex column from
* @ param columnToIndex column to */
void switchTwoColumns ( int columnIndex , int columnToIndex ) { } } | for ( int i = 0 ; i < getRowCount ( ) - 1 ; i ++ ) { Object cellData = getItems ( ) [ i ] [ columnToIndex ] ; getItems ( ) [ i ] [ columnToIndex ] = getItems ( ) [ i ] [ columnIndex ] ; getItems ( ) [ i ] [ columnIndex ] = cellData ; } |
public class Interpreter { /** * Set an expression tracepoint . A tracepoint does not stop execution , but evaluates an expression before
* continuing .
* @ param exp
* The expression to trace .
* @ param trace
* The expression to evaluate .
* @ return The Breakpoint object created .
* @ throws LexExcepti... | BreakpointManager . setBreakpoint ( exp , new Tracepoint ( exp . getLocation ( ) , ++ nextbreakpoint , trace ) ) ; breakpoints . put ( nextbreakpoint , BreakpointManager . getBreakpoint ( exp ) ) ; return BreakpointManager . getBreakpoint ( exp ) ; |
public class GVRBone { /** * Sets the final transform of the bone during animation .
* @ param finalTransform The transform matrix representing
* the bone ' s pose after computing the skeleton . */
public void setFinalTransformMatrix ( Matrix4f finalTransform ) { } } | float [ ] mat = new float [ 16 ] ; finalTransform . get ( mat ) ; NativeBone . setFinalTransformMatrix ( getNative ( ) , mat ) ; |
public class CommerceWarehouseUtil { /** * Returns all the commerce warehouses where groupId = & # 63 ; and active = & # 63 ; and primary = & # 63 ; .
* @ param groupId the group ID
* @ param active the active
* @ param primary the primary
* @ return the matching commerce warehouses */
public static List < Comm... | return getPersistence ( ) . findByG_A_P ( groupId , active , primary ) ; |
public class WritableComparator { /** * Parse an integer from a byte array . */
public static int readInt ( byte [ ] bytes , int start ) { } } | return ( ( ( bytes [ start ] & 0xff ) << 24 ) + ( ( bytes [ start + 1 ] & 0xff ) << 16 ) + ( ( bytes [ start + 2 ] & 0xff ) << 8 ) + ( ( bytes [ start + 3 ] & 0xff ) ) ) ; |
public class IPAddressDivision { /** * If this is equivalent to the mask for a CIDR prefix length block or subnet class , it returns the prefix length .
* Otherwise , it returns null .
* A CIDR network mask is an address with all 1s in the network section ( the upper bits ) and then all 0s in the host section .
*... | int hostLength = getTrailingBitCount ( network ) ; long shifted ; if ( network ) { shifted = ( ~ getDivisionValue ( ) & getMaxValue ( ) ) >>> hostLength ; } else { shifted = getDivisionValue ( ) >>> hostLength ; } return shifted == 0 ? getBitCount ( ) - hostLength : null ; |
public class SibRaConnection { /** * Creates a producer session . Checks that the connection is valid and then
* delegates . Wraps the < code > ProducerSession < / code > returned from the
* delegate in a < code > SibRaProducerSession < / code > .
* @ param destAddr
* the address of the destination
* @ param ... | checkValid ( ) ; final ProducerSession session = _delegateConnection . createProducerSession ( destAddr , destType , orderingContext , alternateUser ) ; return new SibRaProducerSession ( this , session ) ; |
public class InstantiationUtil { /** * Loads a class by name from the given input stream and reflectively instantiates it .
* < p > This method will use { @ link DataInputView # readUTF ( ) } to read the class name , and
* then attempt to load the class from the given ClassLoader .
* < p > The resolved class is c... | final String className = in . readUTF ( ) ; final Class < ? > rawClazz ; try { rawClazz = Class . forName ( className , false , cl ) ; } catch ( ClassNotFoundException e ) { throw new IOException ( "Could not find class '" + className + "' in classpath." , e ) ; } if ( ! supertype . isAssignableFrom ( rawClazz ) ) { th... |
public class ParserUtil { /** * Parse a BELScript list expression into a { @ code String [ ] array } .
* @ param line the list expression , which should not be { @ code null }
* @ return the parsed tokens in the list , or { @ code null } if { @ code line }
* is { @ code null } */
public static String [ ] parseLis... | // return null if line is blank
if ( noLength ( line ) ) { return null ; } // trim away leading / trailing whitespace from list record
line = line . trim ( ) ; // remove list boundaries
if ( line . startsWith ( "{" ) ) { line = line . substring ( 1 ) ; } if ( line . endsWith ( "}" ) ) { line = line . substring ( 0 , li... |
public class StatsInterface { /** * Get a list of referring domains for a collection .
* @ param date
* ( Required ) Stats will be returned for this date . A day according to Flickr Stats starts at midnight GMT for all users , and timestamps will
* automatically be rounded down to the start of the day .
* @ par... | return getDomains ( METHOD_GET_COLLECTION_DOMAINS , "collection_id" , collectionId , date , perPage , page ) ; |
public class ImportExportController { /** * Delete an uPortal database object . This method provides a REST interface for uPortal database
* object deletion .
* < p > The path for this method is / entity / type / identifier . The identifier generally a string
* that may be used as a unique identifier , but is dep... | final IPerson person = personManager . getPerson ( request ) ; final EntityIdentifier ei = person . getEntityIdentifier ( ) ; final IAuthorizationPrincipal ap = AuthorizationServiceFacade . instance ( ) . newPrincipal ( ei . getKey ( ) , ei . getType ( ) ) ; if ( ! ap . hasPermission ( IPermission . PORTAL_SYSTEM , IPe... |
public class V2ManifestModel { /** * { @ inheritDoc } */
@ Override public ManifestModel setRemote ( RemoteModel remote ) { } } | Configuration config = getModelConfiguration ( ) ; config . removeChildren ( _jmsRemoteQName ) ; config . removeChildren ( _restRemoteQName ) ; setChildModel ( remote ) ; _remote = remote ; return this ; |
public class Pipe { /** * Dimensiona il tubo adottando una pendenza pari a quella del terreno
* Sostanzialmente uguale alla get _ height _ 2 . L ' unica differenza e che
* dimensiona iltubo adottando una pendenza pari a quella del terreno .
* @ param slope
* [ % ] Pendenza del tratto da dimensionare , che e ' p... | /* B Pari a A * ( Rh ^ 1/6 ) . */
double B ; /* * oldD [ cm ] Altezza della sezione trapezoidale calcolato imponendo una
* pendenza pari a quella del terreno . */
double oldD ; /* D [ cm ] Altezza della sezione trapezoidale . */
double D ; /* oldb [ cm ] Base della sezione trapezoidale . */
double oldb ; /* b [ cm ] ... |
public class LogBuffer { /** * Return next 16 - bit unsigned int from buffer . ( big - endian )
* @ see mysql - 5.6.10 / include / myisampack . h - mi _ usint2korr */
public final int getBeUint16 ( ) { } } | if ( position + 1 >= origin + limit ) throw new IllegalArgumentException ( "limit excceed: " + ( position - origin + 1 ) ) ; byte [ ] buf = buffer ; return ( ( 0xff & buf [ position ++ ] ) << 8 ) | ( 0xff & buf [ position ++ ] ) ; |
public class RectangularPrism { /** * Returns the radius of a circumscribed sphere ( length of diagonal of
* rectangular prism / 2 , that goes through at least four vertices
* @ return the cirumscribedRadius */
@ Override public double getCirumscribedRadius ( ) { } } | return 0.5 * Math . sqrt ( width * width + height * height + length * length ) ; |
public class BinaryHeapQueue { /** * Returns the Queueable on top of heap and remove it .
* @ return the Queueable at top of heap
* @ throws NoSuchElementException if < code > isEmpty ( ) = = true < / code > */
public Activation dequeue ( ) throws NoSuchElementException { } } | if ( isEmpty ( ) ) { return null ; } final Activation result = this . elements [ 1 ] ; dequeue ( result . getQueueIndex ( ) ) ; return result ; |
public class DescribeEnvironmentManagedActionHistoryResult { /** * A list of completed and failed managed actions .
* @ param managedActionHistoryItems
* A list of completed and failed managed actions . */
public void setManagedActionHistoryItems ( java . util . Collection < ManagedActionHistoryItem > managedAction... | if ( managedActionHistoryItems == null ) { this . managedActionHistoryItems = null ; return ; } this . managedActionHistoryItems = new com . amazonaws . internal . SdkInternalList < ManagedActionHistoryItem > ( managedActionHistoryItems ) ; |
public class ConfigValueFactory { /** * See the fromAnyRef ( ) documentation for details . This is a typesafe
* wrapper that only works on { @ link java . util . Map } and returns
* { @ link ConfigObject } rather than { @ link ConfigValue } .
* If your Map has a key " foo . bar " then you will lookup one object w... | return ( ConfigObject ) fromAnyRef ( values , originDescription ) ; |
public class JPAComponentImpl { /** * Locates and processes all persistence . xml file in a WAR module . < p >
* @ param applInfo the application archive information
* @ param module the WAR module archive information */
private void processWebModulePersistenceXml ( JPAApplInfo applInfo , ContainerInfo warContainer... | final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "processWebModulePersistenceXml : " + applInfo . getApplName ( ) + "#" + warContainerInfo ) ; } String archiveName = warContainerInfo . getName ( ) ; Container warContainer = warContainer... |
public class Coref { /** * setter for corefType - sets
* @ generated
* @ param v value to set into the feature */
public void setCorefType ( String v ) { } } | if ( Coref_Type . featOkTst && ( ( Coref_Type ) jcasType ) . casFeat_corefType == null ) jcasType . jcas . throwFeatMissing ( "corefType" , "de.julielab.jules.types.muc7.Coref" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Coref_Type ) jcasType ) . casFeatCode_corefType , v ) ; |
public class FnBigInteger { /** * Determines whether the target object and the specified object are NOT equal
* by calling the < tt > equals < / tt > method on the target object .
* @ param object the { @ link BigInteger } to compare to the target
* @ return false if both objects are equal , true if not . */
publ... | return ( Function < BigInteger , Boolean > ) ( ( Function ) FnObject . notEq ( object ) ) ; |
public class AbstractDoclet { /** * Iterate through all classes and construct documentation for them .
* @ param root the RootDoc of source to document .
* @ param classtree the data structure representing the class tree . */
protected void generateClassFiles ( RootDoc root , ClassTree classtree ) { } } | generateClassFiles ( classtree ) ; PackageDoc [ ] packages = root . specifiedPackages ( ) ; for ( PackageDoc pkg : packages ) { generateClassFiles ( pkg . allClasses ( ) , classtree ) ; } |
public class AzkabanExecutorServer { /** * Get the hostname
* @ return hostname */
public String getHost ( ) { } } | if ( this . props . containsKey ( ConfigurationKeys . AZKABAN_SERVER_HOST_NAME ) ) { final String hostName = this . props . getString ( Constants . ConfigurationKeys . AZKABAN_SERVER_HOST_NAME ) ; if ( ! StringUtils . isEmpty ( hostName ) ) { return hostName ; } } String host = "unkownHost" ; try { host = InetAddress .... |
public class KeyGroupRangeAssignment { /** * Computes the range of key - groups that are assigned to a given operator under the given parallelism and maximum
* parallelism .
* IMPORTANT : maxParallelism must be < = Short . MAX _ VALUE to avoid rounding problems in this method . If we ever want
* to go beyond this... | checkParallelismPreconditions ( parallelism ) ; checkParallelismPreconditions ( maxParallelism ) ; Preconditions . checkArgument ( maxParallelism >= parallelism , "Maximum parallelism must not be smaller than parallelism." ) ; int start = ( ( operatorIndex * maxParallelism + parallelism - 1 ) / parallelism ) ; int end ... |
public class MessageStoreImpl { /** * ( non - Javadoc )
* @ see com . ibm . ws . sib . msgstore . MessageStore # findById ( long ) */
@ Override public AbstractItem findById ( long itemID ) throws MessageStoreException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "findById" , Long . valueOf ( itemID ) ) ; AbstractItem item = _findById ( itemID ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "findById" , item ) ; return ... |
public class HttpOutputStream { public void destroy ( ) { } } | if ( _bufferedOut != null ) _bufferedOut . destroy ( ) ; _bufferedOut = null ; if ( _iso8859writer != null ) _iso8859writer . destroy ( ) ; _iso8859writer = null ; if ( _utf8writer != null ) _utf8writer . destroy ( ) ; _utf8writer = null ; if ( _asciiwriter != null ) _asciiwriter . destroy ( ) ; _asciiwriter = null ; |
public class CommerceVirtualOrderItemLocalServiceBaseImpl { /** * Deletes the commerce virtual order item from the database . Also notifies the appropriate model listeners .
* @ param commerceVirtualOrderItem the commerce virtual order item
* @ return the commerce virtual order item that was removed */
@ Indexable ... | return commerceVirtualOrderItemPersistence . remove ( commerceVirtualOrderItem ) ; |
public class JDBCPersistenceManagerImpl { /** * Obviously would be nice if the code writing this special format were in the same place as this
* code reading it .
* Assumes format like :
* JOBINSTANCEDATA
* ( jobinstanceid name , . . . )
* 1197 , " partitionMetrics " , " NOTSET "
* 1198 , " : 1197 : step1:0... | StringBuilder sb = new StringBuilder ( ":" ) ; sb . append ( Long . toString ( rootJobInstanceId ) ) ; sb . append ( ":" ) ; sb . append ( stepName ) ; sb . append ( ":%" ) ; return sb . toString ( ) ; |
public class JsUtils { /** * Set a property to a javascript object . */
public static void prop ( JavaScriptObject o , Object id , Object val ) { } } | if ( o != null ) { o . < JsCache > cast ( ) . put ( id , val ) ; } |
public class SequenceRecordReaderDataSetIterator { /** * Load a multiple sequence examples to a DataSet , using the provided RecordMetaData instances .
* @ param list List of RecordMetaData instances to load from . Should have been produced by the record reader provided
* to the SequenceRecordReaderDataSetIterator ... | if ( underlying == null ) { SequenceRecord r = recordReader . loadSequenceFromMetaData ( list . get ( 0 ) ) ; initializeUnderlying ( r ) ; } // Two cases : single vs . multiple reader . . .
List < RecordMetaData > l = new ArrayList < > ( list . size ( ) ) ; if ( singleSequenceReaderMode ) { for ( RecordMetaData m : lis... |
public class KafkaCanalConnector { /** * 订阅topic */
@ Override public void subscribe ( ) { } } | waitClientRunning ( ) ; if ( ! running ) { return ; } if ( partition == null ) { if ( kafkaConsumer != null ) { kafkaConsumer . subscribe ( Collections . singletonList ( topic ) ) ; } if ( kafkaConsumer2 != null ) { kafkaConsumer2 . subscribe ( Collections . singletonList ( topic ) ) ; } } else { TopicPartition topicPa... |
public class EvernoteUtil { /** * Returns an Intent to query the bootstrap profile name from the main Evernote app . This is useful
* if you want to use the main app to authenticate the user and he is already signed in .
* @ param context The { @ link Context } starting the { @ link Intent } .
* @ param evernoteS... | if ( evernoteSession . isForceAuthenticationInThirdPartyApp ( ) ) { // we don ' t want to use the main app , return null
return null ; } EvernoteUtil . EvernoteInstallStatus installStatus = EvernoteUtil . getEvernoteInstallStatus ( context , EvernoteUtil . ACTION_GET_BOOTSTRAP_PROFILE_NAME ) ; if ( ! EvernoteUtil . Eve... |
public class ProcessingConfigurationMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ProcessingConfiguration processingConfiguration , ProtocolMarshaller protocolMarshaller ) { } } | if ( processingConfiguration == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( processingConfiguration . getEnabled ( ) , ENABLED_BINDING ) ; protocolMarshaller . marshall ( processingConfiguration . getProcessors ( ) , PROCESSORS_BINDING )... |
public class ConnectionService { /** * Returns a list of connection records objects which are backed by the
* models in the given list .
* @ param models
* The model objects to use to back the connection record objects
* within the returned list .
* @ return
* A list of connection record objects which are b... | // Create new list of records by manually converting each model
List < ConnectionRecord > objects = new ArrayList < ConnectionRecord > ( models . size ( ) ) ; for ( ConnectionRecordModel model : models ) objects . add ( getObjectInstance ( model ) ) ; return objects ; |
public class TextProcessUtility { /** * 预处理 , 去除标点 , 空格和停用词
* @ param text
* @ return */
public static String preprocess ( String text ) { } } | return text . replaceAll ( "\\p{P}" , " " ) . replaceAll ( "\\s+" , " " ) . toLowerCase ( Locale . getDefault ( ) ) ; |
public class RatePlanReader { /** * Make the request to the Twilio API to perform the read .
* @ param client TwilioRestClient with which to make the request
* @ return RatePlan ResourceSet */
@ Override public ResourceSet < RatePlan > read ( final TwilioRestClient client ) { } } | return new ResourceSet < > ( this , client , firstPage ( client ) ) ; |
public class OWLSubAnnotationPropertyOfAxiomImpl_CustomFieldSerializer { /** * Serializes the content of the object into the
* { @ link com . google . gwt . user . client . rpc . SerializationStreamWriter } .
* @ param streamWriter the { @ link com . google . gwt . user . client . rpc . SerializationStreamWriter } ... | serialize ( streamWriter , instance ) ; |
public class WebDriverHelper { /** * Returns a DesiredCapabilities object specific to the { @ code browser }
* being sent as parameter . If the browser does not exists if default to
* firefox .
* @ param browser
* the browser name
* @ return a specific DesiredCapabilities object corresponding to the
* suppl... | DesiredCapabilities capabilities = null ; Method [ ] methods = DesiredCapabilities . class . getDeclaredMethods ( ) ; for ( Method m : methods ) { if ( m . getName ( ) . equalsIgnoreCase ( browser ) ) { try { capabilities = ( DesiredCapabilities ) m . invoke ( null , ( Object [ ] ) null ) ; } catch ( Exception e ) { e ... |
public class SampledHTTPRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( SampledHTTPRequest sampledHTTPRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( sampledHTTPRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( sampledHTTPRequest . getRequest ( ) , REQUEST_BINDING ) ; protocolMarshaller . marshall ( sampledHTTPRequest . getWeight ( ) , WEIGHT_BINDING ) ; protocolMarshaller .... |
public class TokenApprovalStore { /** * Extract the implied approvals from any tokens associated with the user and client id supplied .
* @ see org . springframework . security . oauth2 . provider . approval . ApprovalStore # getApprovals ( java . lang . String ,
* java . lang . String ) */
@ Override public Collec... | Collection < Approval > result = new HashSet < Approval > ( ) ; Collection < OAuth2AccessToken > tokens = store . findTokensByClientIdAndUserName ( clientId , userId ) ; for ( OAuth2AccessToken token : tokens ) { OAuth2Authentication authentication = store . readAuthentication ( token ) ; if ( authentication != null ) ... |
public class JpaBaseRepository { /** * { @ inheritDoc } */
@ Override public void remove ( ID entityId ) { } } | T entity = getEntityManager ( ) . find ( getEntityClass ( ) , entityId ) ; // Case of attached entity - simply remove it
if ( getEntityManager ( ) . contains ( entity ) ) { getEntityManager ( ) . remove ( entity ) ; } // Case of unattached entity , first it is necessary to perform
// a merge , before doing the remove
e... |
public class ResilientOperation { /** * Returns a { @ link CheckedCallable } that encompasses a { @ link AbstractGoogleClientRequest } and
* can be used to retry the execution for an AbstractGoogleClientRequest .
* @ param request The AbstractGoogleClientRequest to turn into a { @ link CheckedCallable } .
* @ ret... | return new AbstractGoogleClientRequestExecutor < > ( request ) ; |
public class FuncNormalizeSpace { /** * Execute an expression in the XPath runtime context , and return the
* result of the expression .
* @ param xctxt The XPath runtime context .
* @ return The result of the expression in the form of a < code > XObject < / code > .
* @ throws javax . xml . transform . Transfo... | if ( Arg0IsNodesetExpr ( ) ) { int node = getArg0AsNode ( xctxt ) ; if ( DTM . NULL != node ) { DTM dtm = xctxt . getDTM ( node ) ; dtm . dispatchCharactersEvents ( node , handler , true ) ; } } else { XObject obj = execute ( xctxt ) ; obj . dispatchCharactersEvents ( handler ) ; } |
public class UploadPhoto { /** * The assumption here is that for a given set only unique file - names will be loaded and the title field can be used . Later change to use the tags field (
* OrigFileName ) and strip off the suffix .
* @ param filename
* @ return */
private boolean checkIfLoaded ( String filename )... | String title ; if ( basefilename . lastIndexOf ( '.' ) > 0 ) title = basefilename . substring ( 0 , basefilename . lastIndexOf ( '.' ) ) ; else return false ; if ( filePhotos . containsKey ( title ) ) return true ; return false ; |
public class FileProperties { /** * This class will try to find the current value " name " into the System
* Properties or into the default file . If it can ' t be found it will use the
* mother class La propiededd tien eque ser de la fdorma siguiente
* es . nombre . Clase . nombrePropiedad */
private String getV... | if ( section == null || name == null ) { log . warn ( "Section or name is null, Section:'" + section + "' name:'" + name + "'" ) ; return null ; } if ( fildes != null && lastModified != fildes . lastModified ( ) ) { getFileProperties ( filePath ) ; } // Getting the full name
String propertyName = getPropertyName ( sect... |
public class ConcurrentTokenizer { /** * Initializes the type system . */
public void typeSystemInit ( TypeSystem typeSystem ) throws AnalysisEngineProcessException { } } | super . typeSystemInit ( typeSystem ) ; probabilityFeature = AnnotatorUtil . getOptionalFeatureParameter ( context , tokenType , UimaUtil . PROBABILITY_FEATURE_PARAMETER , CAS . TYPE_NAME_DOUBLE ) ; |
public class BoundedBuffer { /** * @ awisniew - ADDED
* ( non - Javadoc )
* @ see java . util . Queue # poll ( ) */
@ Override public T poll ( ) { } } | T old = null ; boolean expedited = false ; synchronized ( this ) { if ( numberOfUsedExpeditedSlots . get ( ) > 0 ) { old = expeditedExtract ( ) ; numberOfUsedExpeditedSlots . getAndDecrement ( ) ; expedited = true ; } else if ( numberOfUsedSlots . get ( ) > 0 ) { old = extract ( ) ; numberOfUsedSlots . getAndDecrement ... |
public class ConfigurationUtils { /** * Loads cluster default values from the meta master .
* Only client scope properties will be loaded .
* If cluster level configuration has been loaded or the feature of loading configuration from
* meta master is disabled , no RPC will be issued .
* @ param address the mast... | if ( shouldLoadClusterConfiguration ( conf ) ) { GetConfigurationPResponse response = loadConfiguration ( address , conf ) ; conf = loadClusterConfiguration ( response , conf ) ; } return conf ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.