signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class ServiceEndpointPoliciesInner { /** * Gets the specified service Endpoint Policies in a specified resource group .
* @ param resourceGroupName The name of the resource group .
* @ param serviceEndpointPolicyName The name of the service endpoint policy .
* @ param expand Expands referenced resources .
* @ 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 < ServiceEndpointPolicyInner > getByResourceGroupAsync ( String resourceGroupName , String serviceEndpointPolicyName , String expand , final ServiceCallback < ServiceEndpointPolicyInner > serviceCallback ) { } } | return ServiceFuture . fromResponse ( getByResourceGroupWithServiceResponseAsync ( resourceGroupName , serviceEndpointPolicyName , expand ) , serviceCallback ) ; |
public class SubTool { /** * A case insensitive test of whether any of the supplied tokens
* begins with ' sub ' .
* @ param tokens a list of strings to test
* @ return { @ code true } if any token begins with ' sub ' regardless of case */
public static boolean hasSubPrefix ( List < String > tokens ) { } } | return tokens . stream ( ) . anyMatch ( token -> token . toLowerCase ( ) . startsWith ( "sub" ) ) ; |
public class GitService { /** * Checks in content from a source directory into the current git repository .
* @ param sourceDirectory The directory to pull content in from .
* @ param message The commit message to use .
* @ return The new SHA revision .
* @ throws Exception */
public String checkinNewContent ( String sourceDirectory , String message ) throws Exception { } } | RmCommand remove = git . rm ( ) ; boolean hasFiles = false ; for ( String filename : new File ( getBaseDirectory ( ) ) . list ( ) ) { if ( ! filename . equals ( ".git" ) ) { remove . addFilepattern ( filename ) ; hasFiles = true ; } } if ( hasFiles ) { log . info ( "Removing old content." ) ; remove . call ( ) ; } log . info ( "Copying in new content." ) ; FileSystemManager . copyAllContent ( sourceDirectory , getBaseDirectory ( ) , true ) ; log . info ( "Adding new content." ) ; AddCommand add = git . add ( ) ; for ( String filename : new File ( getBaseDirectory ( ) ) . list ( ) ) { if ( ! filename . equals ( ".git" ) ) { add . addFilepattern ( filename ) ; } } add . call ( ) ; log . info ( "Committing new content." ) ; git . commit ( ) . setMessage ( message ) . call ( ) ; return getCurrentRevision ( ) ; |
public class Database { /** * Executes a query and processes the results with given { @ link ResultSetProcessor } .
* All other findXXX - methods are just convenience methods for this one . */
public < T > T executeQuery ( @ NotNull ResultSetProcessor < T > processor , @ NotNull SqlQuery query ) { } } | return withCurrentTransaction ( query , tx -> { logQuery ( query ) ; try ( PreparedStatement ps = tx . getConnection ( ) . prepareStatement ( query . getSql ( ) ) ) { prepareStatementFromQuery ( ps , query ) ; long startTime = currentTimeMillis ( ) ; try ( ResultSet resultSet = ps . executeQuery ( ) ) { logQueryExecution ( query , currentTimeMillis ( ) - startTime ) ; return processor . process ( resultSet ) ; } } } ) ; |
public class TypeInformation { /** * Creates a TypeInformation for the type described by the given class .
* < p > This method only works for non - generic types . For generic types , use the
* { @ link # of ( TypeHint ) } method .
* @ param typeClass The class of the type .
* @ param < T > The generic type .
* @ return The TypeInformation object for the type described by the hint . */
public static < T > TypeInformation < T > of ( Class < T > typeClass ) { } } | try { return TypeExtractor . createTypeInfo ( typeClass ) ; } catch ( InvalidTypesException e ) { throw new FlinkRuntimeException ( "Cannot extract TypeInformation from Class alone, because generic parameters are missing. " + "Please use TypeInformation.of(TypeHint) instead, or another equivalent method in the API that " + "accepts a TypeHint instead of a Class. " + "For example for a Tuple2<Long, String> pass a 'new TypeHint<Tuple2<Long, String>>(){}'." ) ; } |
public class MergeRequestApi { /** * Get list containing all the issues that would be closed by merging the provided merge request .
* < pre > < code > GitLab Endpoint : GET / projects / : id / merge _ requests / : merge _ request _ iid / closes _ issues < / code > < / pre >
* @ param projectIdOrPath id , path of the project , or a Project instance holding the project ID or path
* @ param mergeRequestIid the IID of the merge request to get the closes issues for
* @ return a List containing all the issues that would be closed by merging the provided merge request
* @ throws GitLabApiException if any exception occurs */
public List < Issue > getClosesIssues ( Object projectIdOrPath , Integer mergeRequestIid ) throws GitLabApiException { } } | return ( getClosesIssues ( projectIdOrPath , mergeRequestIid , getDefaultPerPage ( ) ) . all ( ) ) ; |
public class Messages { /** * Retrieves a message which takes 1 integer argument .
* @ param msg
* String the key to look up .
* @ param arg
* int the integer to insert in the formatted output .
* @ return String the message for that key in the system message bundle . */
static public String getString ( String msg , int arg ) { } } | return getString ( msg , new Object [ ] { Integer . toString ( arg ) } ) ; |
public class SynchronizationActivity { /** * Replaces space characters in the activity name with underscores .
* @ param rawActivityName
* @ return the escaped activity name */
private String escape ( String rawActivityName ) { } } | boolean lastIsUnderScore = false ; StringBuffer sb = new StringBuffer ( ) ; for ( int i = 0 ; i < rawActivityName . length ( ) ; i ++ ) { char ch = rawActivityName . charAt ( i ) ; if ( Character . isLetterOrDigit ( ch ) ) { sb . append ( ch ) ; lastIsUnderScore = false ; } else if ( ! lastIsUnderScore ) { sb . append ( UNDERSCORE ) ; lastIsUnderScore = true ; } } return sb . toString ( ) ; |
public class MouseHijacker { /** * Hijack the component ' s mouse listeners . */
public void hijack ( ) { } } | _mls = _comp . getMouseListeners ( ) ; for ( int ii = 0 ; ii < _mls . length ; ii ++ ) { _comp . removeMouseListener ( _mls [ ii ] ) ; } _mmls = _comp . getMouseMotionListeners ( ) ; for ( int ii = 0 ; ii < _mmls . length ; ii ++ ) { _comp . removeMouseMotionListener ( _mmls [ ii ] ) ; } _comp . addMouseMotionListener ( _motionCatcher ) ; |
public class RuleSheetParserUtil { /** * Convert spreadsheet row , column numbers to a cell name .
* @ param row row number
* @ param col the column number . Start with zero .
* @ return The spreadsheet name for this cell , " A " to " ZZZ " . */
public static String rc2name ( int row , int col ) { } } | StringBuilder sb = new StringBuilder ( ) ; int b = 26 ; int p = 1 ; if ( col >= b ) { col -= b ; p *= b ; } if ( col >= b * b ) { col -= b * b ; p *= b ; } while ( p > 0 ) { sb . append ( ( char ) ( col / p + ( int ) 'A' ) ) ; col %= p ; p /= b ; } sb . append ( row + 1 ) ; return sb . toString ( ) ; |
public class JDBCStorageConnection { /** * { @ inheritDoc } */
public void delete ( PropertyData data , ChangedSizeHandler sizeHandler ) throws RepositoryException , UnsupportedOperationException , InvalidItemStateException , IllegalStateException { } } | checkIfOpened ( ) ; final String cid = getInternalId ( data . getIdentifier ( ) ) ; try { deleteValues ( cid , data , false , sizeHandler ) ; // delete references
deleteReference ( cid ) ; // delete item
int nc = deleteItemByIdentifier ( cid ) ; if ( nc <= 0 ) { throw new JCRInvalidItemStateException ( "(delete) Property not found " + data . getQPath ( ) . getAsString ( ) + " " + data . getIdentifier ( ) + ". Probably was deleted by another session " , data . getIdentifier ( ) , ItemState . DELETED ) ; } if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Property deleted " + data . getQPath ( ) . getAsString ( ) + ", " + data . getIdentifier ( ) + ( ( data ) . getValues ( ) != null ? ", values count: " + ( data ) . getValues ( ) . size ( ) : ", NULL data" ) ) ; } } catch ( IOException e ) { if ( LOG . isDebugEnabled ( ) ) { LOG . error ( "Property remove. IO error: " + e , e ) ; } throw new RepositoryException ( "Error of Property Value delete " + e , e ) ; } catch ( SQLException e ) { if ( LOG . isDebugEnabled ( ) ) { LOG . error ( "Property remove. Database error: " + e , e ) ; } exceptionHandler . handleDeleteException ( e , data ) ; } |
public class RDBMUserLayoutStore { /** * Add a user profile */
@ Override public UserProfile addUserProfile ( final IPerson person , final IUserProfile profile ) { } } | final int userId = person . getID ( ) ; final int layoutId = getLayoutId ( person , profile ) ; // generate an id for this profile
return jdbcOperations . execute ( ( ConnectionCallback < UserProfile > ) con -> { String sQuery ; PreparedStatement pstmt = con . prepareStatement ( "INSERT INTO UP_USER_PROFILE " + "(USER_ID, PROFILE_ID, PROFILE_FNAME, PROFILE_NAME, STRUCTURE_SS_ID, THEME_SS_ID," + "DESCRIPTION, LAYOUT_ID) VALUES (?,?,?,?,?,?,?,?)" ) ; int profileId = getNextKey ( ) ; pstmt . setInt ( 1 , userId ) ; pstmt . setInt ( 2 , profileId ) ; pstmt . setString ( 3 , profile . getProfileFname ( ) ) ; pstmt . setString ( 4 , profile . getProfileName ( ) ) ; pstmt . setInt ( 5 , profile . getStructureStylesheetId ( ) ) ; pstmt . setInt ( 6 , profile . getThemeStylesheetId ( ) ) ; pstmt . setString ( 7 , profile . getProfileDescription ( ) ) ; pstmt . setInt ( 8 , layoutId ) ; sQuery = "INSERT INTO UP_USER_PROFILE (USER_ID, PROFILE_ID, PROFILE_FNAME, PROFILE_NAME, STRUCTURE_SS_ID, THEME_SS_ID, DESCRIPTION, LAYOUT_ID) VALUES (" + userId + ",'" + profileId + ",'" + profile . getProfileFname ( ) + "','" + profile . getProfileName ( ) + "'," + profile . getStructureStylesheetId ( ) + "," + profile . getThemeStylesheetId ( ) + ",'" + profile . getProfileDescription ( ) + "', " + profile . getLayoutId ( ) + ")" ; logger . debug ( "addUserProfile(): {}" , sQuery ) ; try { pstmt . executeUpdate ( ) ; UserProfile newProfile = new UserProfile ( ) ; newProfile . setProfileId ( profileId ) ; newProfile . setLayoutId ( layoutId ) ; newProfile . setLocaleManager ( profile . getLocaleManager ( ) ) ; newProfile . setProfileDescription ( profile . getProfileDescription ( ) ) ; newProfile . setProfileFname ( profile . getProfileFname ( ) ) ; newProfile . setProfileName ( profile . getProfileName ( ) ) ; newProfile . setStructureStylesheetId ( profile . getStructureStylesheetId ( ) ) ; newProfile . setSystemProfile ( false ) ; newProfile . setThemeStylesheetId ( profile . getThemeStylesheetId ( ) ) ; return newProfile ; } finally { pstmt . close ( ) ; } } ) ; |
public class TileMapInfo100 { @ Override protected void parse ( Node node ) { } } | NamedNodeMap attributes = node . getAttributes ( ) ; version = getValueRecursive ( attributes . getNamedItem ( "version" ) ) ; tilemapservice = getValueRecursive ( attributes . getNamedItem ( "tilemapservice" ) ) ; NodeList childNodes = node . getChildNodes ( ) ; for ( int i = 0 ; i < childNodes . getLength ( ) ; i ++ ) { Node child = childNodes . item ( i ) ; String nodeName = child . getNodeName ( ) ; if ( "Title" . equalsIgnoreCase ( nodeName ) ) { title = getValueRecursive ( child ) ; } else if ( "Abstract" . equalsIgnoreCase ( nodeName ) ) { abstractt = getValueRecursive ( child ) ; } else if ( "SRS" . equalsIgnoreCase ( nodeName ) ) { srs = getValueRecursive ( child ) ; } else if ( "BoundingBox" . equalsIgnoreCase ( nodeName ) ) { boundingBox = getBoundingBox ( child ) ; } else if ( "Origin" . equalsIgnoreCase ( nodeName ) ) { origin = getCoordinate ( child ) ; } else if ( "TileFormat" . equalsIgnoreCase ( nodeName ) ) { tileFormat = new TileFormatInfo100 ( child ) ; } else if ( "TileSets" . equalsIgnoreCase ( nodeName ) ) { addTileSets ( child ) ; } } if ( title == null ) { throw new IllegalArgumentException ( "Cannot parse XML into a TileMapInfo object." ) ; } setParsed ( true ) ; |
public class AbstractCompositeServiceBuilder { /** * Binds the specified { @ link CompositeServiceEntry } . */
protected T service ( CompositeServiceEntry < I , O > entry ) { } } | requireNonNull ( entry , "entry" ) ; services . add ( entry ) ; return self ( ) ; |
public class PippoSettings { /** * Returns the long value for the specified name . If the name does not
* exist or the value for the name can not be interpreted as an long , the
* defaultValue is returned .
* @ param name
* @ param defaultValue
* @ return name value or defaultValue */
public long getLong ( String name , long defaultValue ) { } } | try { String value = getString ( name , null ) ; if ( ! StringUtils . isNullOrEmpty ( value ) ) { return Long . parseLong ( value . trim ( ) ) ; } } catch ( NumberFormatException e ) { log . warn ( "Failed to parse long for " + name + USING_DEFAULT_OF + defaultValue ) ; } return defaultValue ; |
public class RoundRobinOperatorStateRepartitioner { /** * Repartition SPLIT _ DISTRIBUTE state . */
private void repartitionSplitState ( Map < String , List < Tuple2 < StreamStateHandle , OperatorStateHandle . StateMetaInfo > > > nameToDistributeState , int newParallelism , List < Map < StreamStateHandle , OperatorStateHandle > > mergeMapList ) { } } | int startParallelOp = 0 ; // Iterate all named states and repartition one named state at a time per iteration
for ( Map . Entry < String , List < Tuple2 < StreamStateHandle , OperatorStateHandle . StateMetaInfo > > > e : nameToDistributeState . entrySet ( ) ) { List < Tuple2 < StreamStateHandle , OperatorStateHandle . StateMetaInfo > > current = e . getValue ( ) ; // Determine actual number of partitions for this named state
int totalPartitions = 0 ; for ( Tuple2 < StreamStateHandle , OperatorStateHandle . StateMetaInfo > offsets : current ) { totalPartitions += offsets . f1 . getOffsets ( ) . length ; } // Repartition the state across the parallel operator instances
int lstIdx = 0 ; int offsetIdx = 0 ; int baseFraction = totalPartitions / newParallelism ; int remainder = totalPartitions % newParallelism ; int newStartParallelOp = startParallelOp ; for ( int i = 0 ; i < newParallelism ; ++ i ) { // Preparation : calculate the actual index considering wrap around
int parallelOpIdx = ( i + startParallelOp ) % newParallelism ; // Now calculate the number of partitions we will assign to the parallel instance in this round . . .
int numberOfPartitionsToAssign = baseFraction ; // . . . and distribute odd partitions while we still have some , one at a time
if ( remainder > 0 ) { ++ numberOfPartitionsToAssign ; -- remainder ; } else if ( remainder == 0 ) { // We are out of odd partitions now and begin our next redistribution round with the current
// parallel operator to ensure fair load balance
newStartParallelOp = parallelOpIdx ; -- remainder ; } // Now start collection the partitions for the parallel instance into this list
while ( numberOfPartitionsToAssign > 0 ) { Tuple2 < StreamStateHandle , OperatorStateHandle . StateMetaInfo > handleWithOffsets = current . get ( lstIdx ) ; long [ ] offsets = handleWithOffsets . f1 . getOffsets ( ) ; int remaining = offsets . length - offsetIdx ; // Repartition offsets
long [ ] offs ; if ( remaining > numberOfPartitionsToAssign ) { offs = Arrays . copyOfRange ( offsets , offsetIdx , offsetIdx + numberOfPartitionsToAssign ) ; offsetIdx += numberOfPartitionsToAssign ; } else { if ( OPTIMIZE_MEMORY_USE ) { handleWithOffsets . f1 = null ; // GC
} offs = Arrays . copyOfRange ( offsets , offsetIdx , offsets . length ) ; offsetIdx = 0 ; ++ lstIdx ; } numberOfPartitionsToAssign -= remaining ; // As a last step we merge partitions that use the same StreamStateHandle in a single
// OperatorStateHandle
Map < StreamStateHandle , OperatorStateHandle > mergeMap = mergeMapList . get ( parallelOpIdx ) ; OperatorStateHandle operatorStateHandle = mergeMap . get ( handleWithOffsets . f0 ) ; if ( operatorStateHandle == null ) { operatorStateHandle = new OperatorStreamStateHandle ( new HashMap < > ( nameToDistributeState . size ( ) ) , handleWithOffsets . f0 ) ; mergeMap . put ( handleWithOffsets . f0 , operatorStateHandle ) ; } operatorStateHandle . getStateNameToPartitionOffsets ( ) . put ( e . getKey ( ) , new OperatorStateHandle . StateMetaInfo ( offs , OperatorStateHandle . Mode . SPLIT_DISTRIBUTE ) ) ; } } startParallelOp = newStartParallelOp ; e . setValue ( null ) ; } |
public class Parser { /** * move to the next token returned by the scanner */
private void next ( ) throws ScanException { } } | token = scanner . next ( ) ; while ( token == Token . WS ) { token = scanner . next ( ) ; } text = scanner . text ( ) ; |
public class StorePackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EEnum getSmtpProtocol ( ) { } } | if ( smtpProtocolEEnum == null ) { smtpProtocolEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( StorePackage . eNS_URI ) . getEClassifiers ( ) . get ( 98 ) ; } return smtpProtocolEEnum ; |
public class SkeletonFishead { /** * Sets the ISO - 8601 UTC time of the file , which
* must be YYYYMMDDTHHMMSS . sssZ or null */
public void setUtc ( String utc ) { } } | if ( utc == null ) { this . utc = null ; } else { if ( utc . length ( ) != 20 ) { throw new IllegalArgumentException ( "Must be of the form YYYYMMDDTHHMMSS.sssZ" ) ; } } |
public class ByteArray { /** * Sets a range of elements of this array .
* @ param index
* The index of the first element to set .
* @ param items
* The values to set .
* @ throws IndexOutOfBoundsException
* if
* < code > index & lt ; 0 | | index + items . size ( ) & gt ; size ( ) < / code > . */
public void setAll ( int index , Collection < ? extends Byte > items ) { } } | rangeCheck ( index , index + items . size ( ) ) ; for ( byte e : items ) { elements [ index ++ ] = e ; } |
public class RROtherProjectInfoV1_2Generator { /** * This method will set the values to human subject supplement and
* vertebrate animals supplement */
private void setHumanSubjAndVertebrateAnimals ( RROtherProjectInfo12Document . RROtherProjectInfo12 rrOtherProjectInfo , OrganizationContract organization ) { } } | rrOtherProjectInfo . setHumanSubjectsIndicator ( YesNoDataType . N_NO ) ; rrOtherProjectInfo . setVertebrateAnimalsIndicator ( YesNoDataType . N_NO ) ; for ( ProposalSpecialReviewContract proposalSpecialReview : pdDoc . getDevelopmentProposal ( ) . getPropSpecialReviews ( ) ) { if ( proposalSpecialReview . getSpecialReviewType ( ) != null ) { if ( Integer . valueOf ( proposalSpecialReview . getSpecialReviewType ( ) . getCode ( ) ) == HUMAN_SUBJECT_SUPPLEMENT ) { setHumaSubjectSupplementDetails ( rrOtherProjectInfo , organization , proposalSpecialReview ) ; } else if ( Integer . valueOf ( proposalSpecialReview . getSpecialReviewType ( ) . getCode ( ) ) == VERTEBRATE_ANIMALS_SUPPLEMENT ) { setVertebrateAnimalsSupplementDetails ( rrOtherProjectInfo , organization , proposalSpecialReview ) ; } } } |
public class LBufferAPI { /** * Fill the buffer of the specified range with a given value
* @ param offset
* @ param length
* @ param value */
public void fill ( long offset , long length , byte value ) { } } | unsafe . setMemory ( address ( ) + offset , length , value ) ; |
public class LaunchPermissionModifications { /** * The AWS account ID to add to the list of launch permissions for the AMI .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setAdd ( java . util . Collection ) } or { @ link # withAdd ( java . util . Collection ) } if you want to override the
* existing values .
* @ param add
* The AWS account ID to add to the list of launch permissions for the AMI .
* @ return Returns a reference to this object so that method calls can be chained together . */
public LaunchPermissionModifications withAdd ( LaunchPermission ... add ) { } } | if ( this . add == null ) { setAdd ( new com . amazonaws . internal . SdkInternalList < LaunchPermission > ( add . length ) ) ; } for ( LaunchPermission ele : add ) { this . add . add ( ele ) ; } return this ; |
public class BaseStoreRoutingPlan { /** * TODO : add unit test . */
public int getNodeIdForZoneNary ( int zoneId , int zoneNary , byte [ ] key ) { } } | List < Node > replicatingNodes = this . routingStrategy . routeRequest ( key ) ; int zoneNAry = - 1 ; for ( Node node : replicatingNodes ) { // bump up the counter if we encounter a replica in the given zone ;
// return current node if counter now matches requested
if ( node . getZoneId ( ) == zoneId ) { zoneNAry ++ ; if ( zoneNAry == zoneNary ) { return node . getId ( ) ; } } } if ( zoneNAry == - 1 ) { throw new VoldemortException ( "Could not find any replicas for the key " + ByteUtils . toHexString ( key ) + " in given zone " + zoneId ) ; } else { throw new VoldemortException ( "Could not find " + ( zoneNary + 1 ) + " replicas for the key " + ByteUtils . toHexString ( key ) + " in given zone " + zoneId + ". Only found " + ( zoneNAry + 1 ) ) ; } |
public class ClassConverter { /** * Return the Java class instance for given canonical name . If given string is empty returns null . If class not found warn
* to logger and also returns null . */
@ Override public < T > T asObject ( String string , Class < T > valueType ) { } } | // at this point value type is a class
if ( string . isEmpty ( ) ) return null ; // uses this library Classes # forName instead of Java standard Class # forName
// first uses current thread context loader whereas the second uses library loader
// as a consequence classes defined by web app could not be found if use Java standard Class # forName
try { return ( T ) Classes . forName ( string ) ; } catch ( NoSuchBeingException e ) { log . warn ( "Class |%s| not found. Class converter force return value to null." , string ) ; return null ; } |
public class AWSMediaConvertClient { /** * Associates an AWS Certificate Manager ( ACM ) Amazon Resource Name ( ARN ) with AWS Elemental MediaConvert .
* @ param associateCertificateRequest
* @ return Result of the AssociateCertificate operation returned by the service .
* @ throws BadRequestException
* The service can ' t process your request because of a problem in the request . Please check your request
* form and syntax .
* @ throws InternalServerErrorException
* The service encountered an unexpected condition and cannot fulfill your request .
* @ throws ForbiddenException
* You don ' t have permissions for this action with the credentials you sent .
* @ throws NotFoundException
* The resource you requested does not exist .
* @ throws TooManyRequestsException
* Too many requests have been sent in too short of a time . The service limits the rate at which it will
* accept requests .
* @ throws ConflictException
* The service could not complete your request because there is a conflict with the current state of the
* resource .
* @ sample AWSMediaConvert . AssociateCertificate
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / mediaconvert - 2017-08-29 / AssociateCertificate "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public AssociateCertificateResult associateCertificate ( AssociateCertificateRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeAssociateCertificate ( request ) ; |
public class ContentSpec { /** * Set the JIRA Version to be applied during building .
* @ param jiraVersion The version of the project in jira . */
public void setJIRAVersion ( final String jiraVersion ) { } } | if ( jiraVersion == null && this . jiraVersion == null ) { return ; } else if ( jiraVersion == null ) { removeChild ( this . jiraVersion ) ; this . jiraVersion = null ; } else if ( this . jiraVersion == null ) { this . jiraVersion = new KeyValueNode < String > ( CommonConstants . CS_JIRA_VERSION_TITLE , jiraVersion ) ; appendChild ( this . jiraVersion , false ) ; } else { this . jiraVersion . setValue ( jiraVersion ) ; } |
public class VTensor { /** * Divide a factor elementwise from this one .
* @ param other The divisor .
* @ throws IllegalArgumentException If the two tensors have different sizes . */
public void elemDivide ( VTensor other ) { } } | checkEqualSize ( this , other ) ; for ( int c = 0 ; c < this . size ( ) ; c ++ ) { divideValue ( c , other . getValue ( c ) ) ; } |
public class HeartbeatMembershipProtocol { /** * Handles a heartbeat message . */
private byte [ ] handleHeartbeat ( Address address , byte [ ] message ) { } } | GossipMember remoteMember = SERIALIZER . decode ( message ) ; LOGGER . trace ( "{} - Received heartbeat: {}" , localMember . id ( ) , remoteMember ) ; failureDetectors . computeIfAbsent ( remoteMember . id ( ) , n -> new PhiAccrualFailureDetector ( ) ) . report ( ) ; updateMember ( remoteMember , true ) ; // Return only reachable members to avoid populating removed members on remote nodes from unreachable members .
return SERIALIZER . encode ( Lists . newArrayList ( members . values ( ) . stream ( ) . filter ( member -> member . isReachable ( ) ) . collect ( Collectors . toList ( ) ) ) ) ; |
public class Level { /** * Checks to see if a SpecNode exists within this level or its children .
* @ param targetId The Target ID of the level / topic to see if it exists .
* @ return True if the level / topic exists within this level or its children otherwise false . */
public boolean isSpecNodeInLevelByTargetID ( final String targetId ) { } } | final SpecNode foundTopic = getClosestSpecNodeByTargetId ( targetId , false ) ; return foundTopic != null ; |
public class Security { /** * Verifies that the signature from the server matches the computed signature on the data .
* Returns true if the data is correctly signed .
* @ param publicKey public key associated with the developer account
* @ param signedData signed data from server
* @ param signature server signature
* @ return true if the data and signature match */
public static boolean verify ( PublicKey publicKey , String signedData , String signature ) { } } | byte [ ] signatureBytes ; try { signatureBytes = Base64 . decode ( signature , Base64 . DEFAULT ) ; } catch ( IllegalArgumentException e ) { LOGGER . error ( "Base64 decoding failed." ) ; return false ; } try { Signature sig = Signature . getInstance ( SIGNATURE_ALGORITHM ) ; sig . initVerify ( publicKey ) ; sig . update ( signedData . getBytes ( ) ) ; if ( ! sig . verify ( signatureBytes ) ) { LOGGER . error ( "Signature verification failed." ) ; return false ; } return true ; } catch ( NoSuchAlgorithmException e ) { LOGGER . error ( "NoSuchAlgorithmException." ) ; } catch ( InvalidKeyException e ) { LOGGER . error ( "Invalid key specification." ) ; } catch ( SignatureException e ) { LOGGER . error ( "Signature exception." ) ; } return false ; |
public class KVStore { /** * Put a simple data into the store with a key . The type of simple data
* should be allowed by { @ link ValueObject }
* @ param key the key
* @ param val the value
* @ return this store instance after the put operation finished
* @ see ValueObject */
@ Override public KVStore putValue ( String key , Object val ) { } } | put ( key , ValueObject . of ( val ) ) ; return this ; |
public class AWSCodePipelineClient { /** * Configures a connection between the webhook that was created and the external tool with events to be detected .
* @ param registerWebhookWithThirdPartyRequest
* @ return Result of the RegisterWebhookWithThirdParty operation returned by the service .
* @ throws ValidationException
* The validation was specified in an invalid format .
* @ throws WebhookNotFoundException
* The specified webhook was entered in an invalid format or cannot be found .
* @ sample AWSCodePipeline . RegisterWebhookWithThirdParty
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / codepipeline - 2015-07-09 / RegisterWebhookWithThirdParty "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public RegisterWebhookWithThirdPartyResult registerWebhookWithThirdParty ( RegisterWebhookWithThirdPartyRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeRegisterWebhookWithThirdParty ( request ) ; |
public class BindingsHelper { /** * Removes all of the EJB bindings for this EJB from the bean specific
* and sever wide maps . */
public void removeEjbBindings ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "removeEjbBindings called" ) ; // Just loop through the values , not the keys , as the simple - binding - name
// key may have a # in front of it when the bean was not simple , and that
// won ' t match what is in the ServerContextBindingMap . d457053.1
for ( String bindingName : ivEjbContextBindingMap . values ( ) ) { removeFromServerContextBindingMap ( bindingName , true ) ; } ivEjbContextBindingMap . clear ( ) ; |
public class ResponseHelper { /** * Get a complete response header map as a copy .
* @ param aHttpResponse
* The source HTTP response . May not be < code > null < / code > .
* @ return Never < code > null < / code > .
* @ since 8.7.3 */
@ Nonnull @ ReturnsMutableCopy public static HttpHeaderMap getResponseHeaderMap ( @ Nonnull final HttpServletResponse aHttpResponse ) { } } | ValueEnforcer . notNull ( aHttpResponse , "HttpResponse" ) ; final HttpHeaderMap ret = new HttpHeaderMap ( ) ; for ( final String sName : aHttpResponse . getHeaderNames ( ) ) for ( final String sValue : aHttpResponse . getHeaders ( sName ) ) ret . addHeader ( sName , sValue ) ; return ret ; |
public class Main { /** * Option is followed by path . */
private static boolean shouldBeFollowedByPath ( String o ) { } } | return o . equals ( "-s" ) || o . equals ( "-h" ) || o . equals ( "-d" ) || o . equals ( "-sourcepath" ) || o . equals ( "-classpath" ) || o . equals ( "-cp" ) || o . equals ( "-bootclasspath" ) || o . equals ( "-src" ) ; |
public class RestController { /** * Updates an entity from a html form post .
* < p > Tunnels PUT through POST
* < p > Example url : / api / v1 / person / 99 ? _ method = PUT */
@ Transactional @ PostMapping ( value = "/{entityTypeId}/{id}" , params = "_method=PUT" , headers = "Content-Type=multipart/form-data" ) @ ResponseStatus ( NO_CONTENT ) public void updateFromFormPostMultiPart ( @ PathVariable ( "entityTypeId" ) String entityTypeId , @ PathVariable ( "id" ) String untypedId , MultipartHttpServletRequest request ) { } } | Map < String , Object > paramMap = new HashMap < > ( ) ; for ( String param : request . getParameterMap ( ) . keySet ( ) ) { String [ ] values = request . getParameterValues ( param ) ; String value = values != null ? StringUtils . join ( values , ',' ) : null ; paramMap . put ( param , value ) ; } // add files to param map
for ( Entry < String , List < MultipartFile > > entry : request . getMultiFileMap ( ) . entrySet ( ) ) { String param = entry . getKey ( ) ; List < MultipartFile > files = entry . getValue ( ) ; if ( files != null && files . size ( ) > 1 ) { throw new IllegalArgumentException ( "Multiple file input not supported" ) ; } paramMap . put ( param , files != null && ! files . isEmpty ( ) ? files . get ( 0 ) : null ) ; } updateInternal ( entityTypeId , untypedId , paramMap ) ; |
public class Record { /** * Get the code key area .
* @ return The code key area ( or 0 if not found ) . */
public int getCodeKeyArea ( ) { } } | int iTargetKeyArea = 0 ; // Key 0 cannot be the code key
for ( int i = this . getKeyAreaCount ( ) - 1 ; i >= 0 ; i -- ) { KeyArea keyArea = this . getKeyArea ( i ) ; if ( keyArea . getUniqueKeyCode ( ) == DBConstants . SECONDARY_KEY ) iTargetKeyArea = i ; if ( iTargetKeyArea == 0 ) if ( keyArea . getUniqueKeyCode ( ) == DBConstants . NOT_UNIQUE ) if ( keyArea . getField ( 0 ) . getDataClass ( ) == String . class ) iTargetKeyArea = i ; // Best guess if no secondary
} return iTargetKeyArea ; |
public class CxDxSessionFactoryImpl { /** * ( non - Javadoc )
* @ see org . jdiameter . api . cxdx . ServerCxDxSessionListener # doMultimediaAuthRequest (
* org . jdiameter . api . cxdx . ServerCxDxSession , org . jdiameter . api . cxdx . events . JMultimediaAuthRequest ) */
@ Override public void doMultimediaAuthRequest ( ServerCxDxSession appSession , JMultimediaAuthRequest request ) throws InternalException , IllegalDiameterStateException , RouteException , OverloadException { } } | logger . info ( "Diameter Cx/Dx Session Factory :: doMultimediaAuthRequest :: appSession[{}], Request[{}]" , appSession , request ) ; |
public class PurgeJmsQueuesAction { /** * Create queue connection .
* @ return
* @ throws JMSException */
protected Connection createConnection ( ) throws JMSException { } } | if ( connectionFactory instanceof QueueConnectionFactory ) { return ( ( QueueConnectionFactory ) connectionFactory ) . createQueueConnection ( ) ; } return connectionFactory . createConnection ( ) ; |
public class GoogleCloudStorageFileSystem { /** * For each listed modified object , attempt to update the modification time of the parent
* directory .
* < p > This method will log & swallow exceptions thrown by the GCSIO layer .
* @ param modifiedObjects The objects that have been modified
* @ param excludedParents A list of parent directories that we shouldn ' t attempt to update . */
protected void tryUpdateTimestampsForParentDirectories ( final List < URI > modifiedObjects , final List < URI > excludedParents ) { } } | logger . atFine ( ) . log ( "tryUpdateTimestampsForParentDirectories(%s, %s)" , modifiedObjects , excludedParents ) ; // If we ' re calling tryUpdateTimestamps , we don ' t actually care about the results . Submit
// these requests via a background thread and continue on .
try { @ SuppressWarnings ( "unused" ) // go / futurereturn - lsc
Future < ? > possiblyIgnoredError = updateTimestampsExecutor . submit ( ( ) -> { try { updateTimestampsForParentDirectories ( modifiedObjects , excludedParents ) ; } catch ( IOException ioe ) { logger . atFine ( ) . withCause ( ioe ) . log ( "Exception caught when trying to update parent directory timestamps." ) ; } } ) ; } catch ( RejectedExecutionException ree ) { logger . atFine ( ) . withCause ( ree ) . log ( "Exhausted thread pool and queue space while updating parent timestamps" ) ; } |
public class AVIMBinaryMessage { /** * create binary instance by copying AVIMMessage instance ( except content field ) .
* @ param other
* @ return */
public static AVIMBinaryMessage createInstanceFromMessage ( AVIMMessage other ) { } } | if ( null == other ) { return null ; } AVIMBinaryMessage msg = new AVIMBinaryMessage ( ) ; msg . conversationId = other . conversationId ; msg . currentClient = other . currentClient ; msg . from = other . from ; msg . ioType = other . ioType ; msg . mentionList = other . mentionList ; msg . mentionAll = other . mentionAll ; msg . messageId = other . messageId ; msg . uniqueToken = other . uniqueToken ; msg . status = other . status ; msg . deliveredAt = other . deliveredAt ; msg . readAt = other . readAt ; msg . timestamp = other . timestamp ; msg . updateAt = other . updateAt ; return msg ; |
public class ExponentialHistogram { /** * Merge the supplied ExponentialHistogram in to this one .
* @ param b histogram to merge
* @ throws IllegalArgumentException if the two merge - thresholds are not equals */
public void merge ( ExponentialHistogram b ) { } } | if ( b . mergeThreshold != mergeThreshold ) { throw new IllegalArgumentException ( ) ; } merge ( b . boxes , b . total ) ; |
public class Location { /** * The available port speeds for the location .
* @ param availablePortSpeeds
* The available port speeds for the location . */
public void setAvailablePortSpeeds ( java . util . Collection < String > availablePortSpeeds ) { } } | if ( availablePortSpeeds == null ) { this . availablePortSpeeds = null ; return ; } this . availablePortSpeeds = new com . amazonaws . internal . SdkInternalList < String > ( availablePortSpeeds ) ; |
public class RandomDateUtils { /** * Returns a random { @ link Year } that is after the given { @ link Year } .
* @ param after the value that returned { @ link Year } must be after
* @ return the random { @ link Year }
* @ throws IllegalArgumentException if after greater than or equal to { @ link
* RandomDateUtils # MAX _ INSTANT } */
public static Year randomYearAfter ( int after ) { } } | checkArgument ( after < MAX_YEAR , "After must be before %s" , MAX_YEAR ) ; return Year . of ( RandomUtils . nextInt ( after + 1 , MAX_YEAR ) ) ; |
public class IdempotentHelper { /** * get execute result from database
* @ param filterChain
* @ param reqest
* @ return */
public IdempotentPo getIdempotentPo ( EasyTransFilterChain filterChain , Map < String , Object > header , EasyTransRequest < ? , ? > reqest ) { } } | BusinessIdentifer businessType = ReflectUtil . getBusinessIdentifer ( reqest . getClass ( ) ) ; Object trxIdObj = header . get ( EasytransConstant . CallHeadKeys . PARENT_TRX_ID_KEY ) ; TransactionId transactionId = ( TransactionId ) trxIdObj ; Integer callSeq = Integer . parseInt ( header . get ( EasytransConstant . CallHeadKeys . CALL_SEQ ) . toString ( ) ) ; JdbcTemplate jdbcTemplate = getJdbcTemplate ( filterChain , reqest ) ; List < IdempotentPo > listQuery = jdbcTemplate . query ( selectSql , new Object [ ] { stringCodecer . findId ( APP_ID , transactionId . getAppId ( ) ) , stringCodecer . findId ( BUSINESS_CODE , transactionId . getBusCode ( ) ) , transactionId . getTrxId ( ) , stringCodecer . findId ( APP_ID , businessType . appId ( ) ) , stringCodecer . findId ( BUSINESS_CODE , businessType . busCode ( ) ) , callSeq , stringCodecer . findId ( APP_ID , appId ) } , beanPropertyRowMapper ) ; if ( listQuery . size ( ) == 1 ) { return listQuery . get ( 0 ) ; } else if ( listQuery . size ( ) == 0 ) { return null ; } else { throw new RuntimeException ( "Unkonw Error!" + listQuery ) ; } |
public class TouchManager { /** * Makes the scene object touchable and associates the { @ link OnTouch handler } with it .
* The TouchManager will not hold strong references to sceneObject and handler .
* @ param sceneObject
* @ param handler */
public void makeTouchable ( GVRSceneObject sceneObject , OnTouch handler ) { } } | if ( handler != null ) { if ( sceneObject . getRenderData ( ) != null ) { if ( ! touchHandlers . containsKey ( sceneObject ) ) { makePickable ( sceneObject ) ; touchHandlers . put ( sceneObject , new WeakReference < > ( handler ) ) ; } } else if ( sceneObject . getChildrenCount ( ) > 0 ) { for ( GVRSceneObject child : sceneObject . getChildren ( ) ) { makeTouchable ( child , handler ) ; } } } |
public class WriteValue { /** * { @ inheritDoc } */
public void rollback ( ) throws IOException { } } | if ( fileLock != null ) { try { if ( file . exists ( ) && ! file . delete ( ) ) { cleaner . addFile ( file ) ; } } finally { fileLock . unlock ( ) ; } } |
public class SourceWriteUtil { /** * Generates all the required injector methods to inject members of the given
* type , and a standard member - inject method that invokes them .
* @ param type type for which the injection is performed
* @ param nameGenerator the name generator used to create method names
* @ param methodsOutput a list to which the new injection method and all its
* helpers are added
* @ return name of the method created */
public String createMemberInjection ( TypeLiteral < ? > type , NameGenerator nameGenerator , List < InjectorMethod > methodsOutput ) throws NoSourceNameException { } } | String memberInjectMethodName = nameGenerator . getMemberInjectMethodName ( type ) ; String memberInjectMethodSignature = "public void " + memberInjectMethodName + "(" + ReflectUtil . getSourceName ( type ) + " injectee)" ; SourceSnippetBuilder sb = new SourceSnippetBuilder ( ) ; sb . append ( createFieldInjections ( getFieldsToInject ( type ) , "injectee" , nameGenerator , methodsOutput ) ) ; sb . append ( createMethodInjections ( getMethodsToInject ( type ) , "injectee" , nameGenerator , methodsOutput ) ) ; // Generate the top - level member inject method in the package containing the
// type we ' re injecting :
methodsOutput . add ( SourceSnippets . asMethod ( false , memberInjectMethodSignature , ReflectUtil . getUserPackageName ( type ) , sb . build ( ) ) ) ; return memberInjectMethodName ; |
public class IOUtils { /** * Loads keystore
* @ param keyStore Keystore InputStream
* @ param password Keystore password
* @ return Loaded Keystore
* @ throws CertificateException In case of Certificate error
* @ throws NoSuchAlgorithmException If no such algorithm present
* @ throws IOException In case if some IO errors
* @ throws KeyStoreException If there is some error with KeyStore */
public static KeyStore loadKeyStore ( InputStream keyStore , String password ) throws CertificateException , NoSuchAlgorithmException , IOException , KeyStoreException { } } | try { KeyStore trustStore = KeyStore . getInstance ( "JKS" ) ; trustStore . load ( keyStore , password . toCharArray ( ) ) ; return trustStore ; } finally { IOUtils . closeQuietly ( keyStore ) ; } |
public class LOF { /** * Compute a single local reachability distance .
* @ param knnq kNN Query
* @ param curr Current object
* @ return Local Reachability Density */
protected double computeLRD ( KNNQuery < O > knnq , DBIDIter curr ) { } } | final KNNList neighbors = knnq . getKNNForDBID ( curr , k ) ; double sum = 0.0 ; int count = 0 ; for ( DoubleDBIDListIter neighbor = neighbors . iter ( ) ; neighbor . valid ( ) ; neighbor . advance ( ) ) { if ( DBIDUtil . equal ( curr , neighbor ) ) { continue ; } KNNList neighborsNeighbors = knnq . getKNNForDBID ( neighbor , k ) ; sum += MathUtil . max ( neighbor . doubleValue ( ) , neighborsNeighbors . getKNNDistance ( ) ) ; count ++ ; } // Avoid division by 0
return ( sum > 0 ) ? ( count / sum ) : Double . POSITIVE_INFINITY ; |
public class TextColumn { /** * Add all the strings in the list to this column
* @ param stringValues a list of values */
public TextColumn addAll ( List < String > stringValues ) { } } | for ( String stringValue : stringValues ) { append ( stringValue ) ; } return this ; |
public class FineUploader5Validation { /** * Used by the file selection dialog . Restrict the valid file types that
* appear in the selection dialog by listing valid content - type specifiers
* here . See docs on the accept attribute of the & lt ; input & gt ; element
* @ param aAcceptFiles
* The MIME types to be added .
* @ return this for chaining */
@ Nonnull public FineUploader5Validation addAcceptFiles ( @ Nullable final Collection < ? extends IMimeType > aAcceptFiles ) { } } | if ( aAcceptFiles != null ) m_aValidationAcceptFiles . addAll ( aAcceptFiles ) ; return this ; |
public class SourceFile { /** * setter for uri - sets
* @ generated
* @ param v value to set into the feature */
public void setUri ( String v ) { } } | if ( SourceFile_Type . featOkTst && ( ( SourceFile_Type ) jcasType ) . casFeat_uri == null ) jcasType . jcas . throwFeatMissing ( "uri" , "de.julielab.jules.types.ace.SourceFile" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( SourceFile_Type ) jcasType ) . casFeatCode_uri , v ) ; |
public class RouteFiltersInner { /** * Deletes the specified route filter .
* @ param resourceGroupName The name of the resource group .
* @ param routeFilterName The name of the route filter .
* @ 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 beginDelete ( String resourceGroupName , String routeFilterName ) { } } | beginDeleteWithServiceResponseAsync ( resourceGroupName , routeFilterName ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class AbstractFieldProcessor { /** * 該当するタイプのConverterが見つからないときの例外のインスタンスを作成する 。
* @ param targetType クラスタイプ
* @ return { @ link ConversionException } のインスタンス */
protected ConversionException newNotFoundCellConverterExpcetion ( final Class < ? > targetType ) { } } | return new ConversionException ( MessageBuilder . create ( "cellConverter.notFound" ) . varWithClass ( "classType" , targetType ) . format ( ) , targetType ) ; |
public class IStringBuffer { /** * append parts of the chars to the buffer
* @ param chars
* @ param start the start index
* @ param length length of chars to append to */
public IStringBuffer append ( char [ ] chars , int start , int length ) { } } | if ( chars == null ) throw new NullPointerException ( ) ; if ( start < 0 ) throw new IndexOutOfBoundsException ( ) ; if ( length <= 0 ) throw new IndexOutOfBoundsException ( ) ; if ( start + length > chars . length ) throw new IndexOutOfBoundsException ( ) ; // check the necessary to resize the buffer .
if ( count + length > buff . length ) { resizeTo ( ( count + length ) * 2 + 1 ) ; } for ( int j = 0 ; j < length ; j ++ ) { buff [ count ++ ] = chars [ start + j ] ; } return this ; |
public class AnnotationActionFactory { /** * Builds an action instance from given class .
* @ param cls action class .
* @ return instance of action . */
public Action build ( Class < ? > cls ) { } } | EdmAction edmAction = cls . getAnnotation ( EdmAction . class ) ; EdmReturnType edmReturnType = cls . getAnnotation ( EdmReturnType . class ) ; Set < Parameter > parameters = new HashSet < > ( ) ; for ( Field field : cls . getDeclaredFields ( ) ) { EdmParameter parameterAnnotation = field . getAnnotation ( EdmParameter . class ) ; if ( parameterAnnotation != null ) { String parameterName = isNullOrEmpty ( parameterAnnotation . name ( ) ) ? field . getName ( ) : parameterAnnotation . name ( ) ; String parameterType = isNullOrEmpty ( parameterAnnotation . type ( ) ) ? field . getType ( ) . getSimpleName ( ) : parameterAnnotation . type ( ) ; parameters . add ( new ParameterImpl . Builder ( ) . setMaxLength ( parameterAnnotation . maxLength ( ) ) . setName ( parameterName ) . setNullable ( parameterAnnotation . nullable ( ) ) . setPrecision ( parameterAnnotation . precision ( ) ) . setScale ( parameterAnnotation . scale ( ) ) . setSRID ( parameterAnnotation . srid ( ) ) . setType ( parameterType ) . setUnicode ( parameterAnnotation . unicode ( ) ) . setJavaField ( field ) . build ( ) ) ; } } return new ActionImpl . Builder ( ) . setName ( getTypeName ( edmAction , cls ) ) . setNamespace ( getNamespace ( edmAction , cls ) ) . setBound ( edmAction . isBound ( ) ) . setEntitySetPath ( edmAction . entitySetPath ( ) ) . setParameters ( parameters ) . setReturnType ( edmReturnType . type ( ) ) . setJavaClass ( cls ) . build ( ) ; |
public class NetworkConfig { /** * Sets the port the Hazelcast member will try to bind on .
* A valid port value is between 0 and 65535.
* A port number of 0 will let the system pick up an ephemeral port .
* @ param port the port the Hazelcast member will try to bind on
* @ return NetworkConfig the updated NetworkConfig
* @ see # getPort ( )
* @ see # setPortAutoIncrement ( boolean ) for more information */
public NetworkConfig setPort ( int port ) { } } | if ( port < 0 || port > PORT_MAX ) { throw new IllegalArgumentException ( "Port out of range: " + port + ". Allowed range [0,65535]" ) ; } this . port = port ; return this ; |
public class Types { /** * A polymorphic signature method ( JLS 15.12.3 ) is a method that
* ( i ) is declared in the java . lang . invoke . MethodHandle / VarHandle classes ;
* ( ii ) takes a single variable arity parameter ;
* ( iii ) whose declared type is Object [ ] ;
* ( iv ) has any return type , Object signifying a polymorphic return type ; and
* ( v ) is native . */
public boolean isSignaturePolymorphic ( MethodSymbol msym ) { } } | List < Type > argtypes = msym . type . getParameterTypes ( ) ; return ( msym . flags_field & NATIVE ) != 0 && ( msym . owner == syms . methodHandleType . tsym || msym . owner == syms . varHandleType . tsym ) && argtypes . length ( ) == 1 && argtypes . head . hasTag ( TypeTag . ARRAY ) && ( ( ArrayType ) argtypes . head ) . elemtype . tsym == syms . objectType . tsym ; |
public class FulltextIndex { /** * CALL apoc . index . addNode ( joe , [ ' name ' , ' age ' , ' city ' ] ) */
@ Procedure ( mode = Mode . WRITE ) @ Description ( "apoc.index.addNode(node,['prop1',...]) add node to an index for each label it has" ) public void addNode ( @ Name ( "node" ) Node node , @ Name ( "properties" ) List < String > propKeys ) { } } | for ( Label label : node . getLabels ( ) ) { addNodeByLabel ( label . name ( ) , node , propKeys ) ; } |
public class TedDriver { /** * create task and immediately execute it ( will wait until execution finish ) */
public Long createAndExecuteTask ( String taskName , String data , String key1 , String key2 ) { } } | return tedDriverImpl . createAndExecuteTask ( taskName , data , key1 , key2 , false ) ; |
public class JobLauncherExecutionDriver { /** * Creates a new JobExecutionDriver which acts as an adapter to the legacy { @ link JobLauncher } API .
* @ param sysConfig the system / environment config
* @ param jobSpec the JobSpec to be executed
* @ param jobLauncherType an optional jobLauncher type ; the value follows the convention of
* { @ link JobLauncherFactory # newJobLauncher ( Properties , Properties ) } .
* If absent , { @ link JobLauncherFactory # newJobLauncher ( java . util . Properties , java . util . Properties ) }
* will be used which looks for the { @ link ConfigurationKeys # JOB _ LAUNCHER _ TYPE _ KEY }
* in the system configuration .
* @ param log an optional logger to be used ; if none is specified , a default one
* will be instantiated .
* @ param instrumentationEnabled a flag to control if metrics should be enabled .
* @ param launcherMetrics an object to contain metrics related to jobLauncher .
* @ param instanceBroker a broker to create difference resources from the same instance scope . */
public static JobLauncherExecutionDriver create ( Configurable sysConfig , JobSpec jobSpec , Optional < JobLauncherFactory . JobLauncherType > jobLauncherType , Optional < Logger > log , boolean instrumentationEnabled , JobExecutionLauncher . StandardMetrics launcherMetrics , SharedResourcesBroker < GobblinScopeTypes > instanceBroker ) { } } | Logger actualLog = log . isPresent ( ) ? log . get ( ) : LoggerFactory . getLogger ( JobLauncherExecutionDriver . class ) ; JobExecutionStateListeners callbackDispatcher = new JobExecutionStateListeners ( actualLog ) ; JobExecutionUpdatable jobExec = JobExecutionUpdatable . createFromJobSpec ( jobSpec ) ; JobExecutionState jobState = new JobExecutionState ( jobSpec , jobExec , Optional . < JobExecutionStateListener > of ( callbackDispatcher ) ) ; JobLauncher jobLauncher = createLauncher ( sysConfig , jobSpec , actualLog , jobLauncherType . isPresent ( ) ? Optional . of ( jobLauncherType . get ( ) . toString ( ) ) : Optional . < String > absent ( ) , instanceBroker ) ; JobListenerToJobStateBridge bridge = new JobListenerToJobStateBridge ( actualLog , jobState , instrumentationEnabled , launcherMetrics ) ; DriverRunnable runnable = new DriverRunnable ( jobLauncher , bridge , jobState , callbackDispatcher , jobExec ) ; return new JobLauncherExecutionDriver ( jobSpec , actualLog , runnable ) ; |
public class FlatFilter { /** * A simple filter that scans only the direct children of some element .
* @ param filter the function to determine if the filter { @ link Filter # applies ( Object ) }
* @ param < T > the type of the element to accept
* @ return a filter implementation that does not descend into any element */
public static < T > Filter < T > by ( Function < T , Boolean > filter ) { } } | return new Filter < T > ( ) { @ Override public boolean applies ( @ Nullable T element ) { return filter . apply ( element ) ; } @ Override public boolean shouldDescendInto ( @ Nullable Object element ) { return false ; } } ; |
public class DraggableView { /** * Slide the view based on scroll of the nav drawer .
* " setEnableTouch " user prevents click to expand while the drawer is moving , it will be
* set to false when the @ slideOffset is bigger than MIN _ SLIDE _ OFFSET .
* When the slideOffset is bigger than 0.1 and dragView isn ' t close , set the dragView
* to minimized .
* It ' s only possible to maximize the view when @ slideOffset is equals to 0.0,
* in other words , closed .
* @ param slideOffset Value between 0 and 1 , represent the value of slide :
* 0.0 is equal to close drawer and 1.0 equals open drawer .
* @ param drawerPosition Represent the position of nav drawer on X axis .
* @ param width Width of nav drawer */
public void slideHorizontally ( float slideOffset , float drawerPosition , int width ) { } } | if ( slideOffset > MIN_SLIDE_OFFSET && ! isClosed ( ) && isMaximized ( ) ) { minimize ( ) ; } setTouchEnabled ( slideOffset <= MIN_SLIDE_OFFSET ) ; ViewHelper . setX ( this , width - Math . abs ( drawerPosition ) ) ; |
public class EqualsBuilder { /** * < p > Test if two < code > Object < / code > s are equal using their
* < code > equals < / code > method . < / p >
* @ param lhs the left hand object
* @ param rhs the right hand object
* @ return EqualsBuilder - used to chain calls . */
public EqualsBuilder append ( Object lhs , Object rhs ) { } } | if ( ! isEquals ) { return this ; } if ( lhs == rhs ) { return this ; } if ( lhs == null || rhs == null ) { this . setEquals ( false ) ; return this ; } Class < ? > lhsClass = lhs . getClass ( ) ; if ( ! lhsClass . isArray ( ) ) { if ( lhs instanceof java . math . BigDecimal && rhs instanceof java . math . BigDecimal ) { isEquals = ( ( ( java . math . BigDecimal ) lhs ) . compareTo ( ( java . math . BigDecimal ) rhs ) == 0 ) ; } else { // The simple case , not an array , just test the element
isEquals = lhs . equals ( rhs ) ; } } else if ( lhs . getClass ( ) != rhs . getClass ( ) ) { // Here when we compare different dimensions , for example : a boolean [ ] [ ] to a boolean [ ]
this . setEquals ( false ) ; // ' Switch ' on type of array , to dispatch to the correct handler
// This handles multi dimensional arrays of the same depth
} else if ( lhs instanceof long [ ] ) { append ( ( long [ ] ) lhs , ( long [ ] ) rhs ) ; |
public class NodeTypeDataBuilder { /** * Creates instance of NodeTypeData using parameters stored in this object .
* @ return NodeTypeData */
public NodeTypeData build ( ) { } } | if ( nodeDefinitionDataBuilders . size ( ) > 0 ) { childNodeDefinitions = new NodeDefinitionData [ nodeDefinitionDataBuilders . size ( ) ] ; for ( int i = 0 ; i < childNodeDefinitions . length ; i ++ ) { childNodeDefinitions [ i ] = nodeDefinitionDataBuilders . get ( i ) . build ( ) ; } } if ( propertyDefinitionDataBuilders . size ( ) > 0 ) { propertyDefinitions = new PropertyDefinitionData [ propertyDefinitionDataBuilders . size ( ) ] ; for ( int i = 0 ; i < propertyDefinitions . length ; i ++ ) { propertyDefinitions [ i ] = propertyDefinitionDataBuilders . get ( i ) . build ( ) ; } } return new NodeTypeDataImpl ( name , primaryItemName , isMixin , isOrderable , supertypes , propertyDefinitions , childNodeDefinitions ) ; |
public class WorkspaceCreator { /** * Add the requested post parameters to the Request .
* @ param request Request to add post params to */
private void addPostParams ( final Request request ) { } } | if ( friendlyName != null ) { request . addPostParam ( "FriendlyName" , friendlyName ) ; } if ( eventCallbackUrl != null ) { request . addPostParam ( "EventCallbackUrl" , eventCallbackUrl . toString ( ) ) ; } if ( eventsFilter != null ) { request . addPostParam ( "EventsFilter" , eventsFilter ) ; } if ( multiTaskEnabled != null ) { request . addPostParam ( "MultiTaskEnabled" , multiTaskEnabled . toString ( ) ) ; } if ( template != null ) { request . addPostParam ( "Template" , template ) ; } if ( prioritizeQueueOrder != null ) { request . addPostParam ( "PrioritizeQueueOrder" , prioritizeQueueOrder . toString ( ) ) ; } |
public class CommerceCurrencyUtil { /** * Returns a range of all the commerce currencies where groupId = & # 63 ; .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result set . Thus , < code > 0 < / code > refers to the first result in the set . Setting both < code > start < / code > and < code > end < / code > to { @ link QueryUtil # ALL _ POS } will return the full result set . If < code > orderByComparator < / code > is specified , then the query will include the given ORDER BY logic . If < code > orderByComparator < / code > is absent and pagination is required ( < code > start < / code > and < code > end < / code > are not { @ link QueryUtil # ALL _ POS } ) , then the query will include the default ORDER BY logic from { @ link CommerceCurrencyModelImpl } . If both < code > orderByComparator < / code > and pagination are absent , for performance reasons , the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order .
* @ param groupId the group ID
* @ param start the lower bound of the range of commerce currencies
* @ param end the upper bound of the range of commerce currencies ( not inclusive )
* @ return the range of matching commerce currencies */
public static List < CommerceCurrency > findByGroupId ( long groupId , int start , int end ) { } } | return getPersistence ( ) . findByGroupId ( groupId , start , end ) ; |
public class VpcEndpoint { /** * ( Interface endpoint ) The DNS entries for the endpoint .
* @ param dnsEntries
* ( Interface endpoint ) The DNS entries for the endpoint . */
public void setDnsEntries ( java . util . Collection < DnsEntry > dnsEntries ) { } } | if ( dnsEntries == null ) { this . dnsEntries = null ; return ; } this . dnsEntries = new com . amazonaws . internal . SdkInternalList < DnsEntry > ( dnsEntries ) ; |
public class TransactionConfigurationBuilder { /** * Configure Transaction manager lookup directly using an instance of TransactionManagerLookup .
* Calling this method marks the cache as transactional . */
public TransactionConfigurationBuilder transactionManagerLookup ( TransactionManagerLookup tml ) { } } | attributes . attribute ( TRANSACTION_MANAGER_LOOKUP ) . set ( tml ) ; if ( tml != null ) { this . transactionMode ( TransactionMode . TRANSACTIONAL ) ; } return this ; |
public class Notifies { /** * 退款通知 */
@ RequestMapping ( "/refund" ) public String refund ( HttpServletRequest request ) { } } | Map < String , String > receives = new HashMap < > ( ) ; // TODO 这里还是建议直接从request中获取map参数 , 兼容支付宝修改或增减参数
for ( AlipayField f : AlipayFields . REFUND_NOTIFY ) { receives . put ( f . field ( ) , request . getParameter ( f . field ( ) ) ) ; } logger . info ( "refund notify params: {}" , receives ) ; if ( ! alipayService . notifyVerifyMd5 ( receives ) ) { System . out . println ( "refund sign verify failed" ) ; return "FAIL" ; } // TODO business logic
logger . info ( "refund notify success" ) ; return "SUCCESS" ; |
public class ZipUtils { /** * Zips a collection of files to a destination zip file .
* @ param files A collection of files and directories
* @ param zipFile The path of the destination zip file
* @ throws FileNotFoundException
* @ throws IOException */
public static void zipFiles ( List < File > files , File zipFile ) throws IOException { } } | OutputStream os = new BufferedOutputStream ( new FileOutputStream ( zipFile ) ) ; try { zipFiles ( files , os ) ; } finally { IOUtils . closeQuietly ( os ) ; } |
public class Selection { /** * Sort the long array in descending order using this algorithm .
* @ param longArray the array of longs that we want to sort */
public static void sortDescending ( long [ ] longArray ) { } } | int index = 0 ; long value = 0 ; for ( int i = 1 ; i < longArray . length ; i ++ ) { index = i ; value = longArray [ index ] ; while ( index > 0 && value > longArray [ index - 1 ] ) { longArray [ index ] = longArray [ index - 1 ] ; index -- ; } longArray [ index ] = value ; } |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcRelDefinesByProperties ( ) { } } | if ( ifcRelDefinesByPropertiesEClass == null ) { ifcRelDefinesByPropertiesEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 549 ) ; } return ifcRelDefinesByPropertiesEClass ; |
public class QuickStartSecurity { /** * Build the UserRegistryConfiguration properties based on the current
* user and password .
* @ return UserRegistryConfiguration properties */
private Dictionary < String , Object > buildUserRegistryConfigProps ( ) { } } | Hashtable < String , Object > properties = new Hashtable < String , Object > ( ) ; properties . put ( "config.id" , QUICK_START_SECURITY_REGISTRY_ID ) ; properties . put ( "id" , QUICK_START_SECURITY_REGISTRY_ID ) ; properties . put ( UserRegistryService . REGISTRY_TYPE , QUICK_START_SECURITY_REGISTRY_TYPE ) ; properties . put ( CFG_KEY_USER , config . userName ( ) ) ; properties . put ( "service.vendor" , "IBM" ) ; return properties ; |
public class PerspectivePluginManager { /** * Sync up both the internals plugin & widget registry */
public void onPlugInAdded ( @ Observes final PluginAdded event ) { } } | Plugin plugin = event . getPlugin ( ) ; if ( isRuntimePerspective ( plugin ) ) { pluginMap . put ( plugin . getName ( ) , plugin ) ; perspectivesChangedEvent . fire ( new PerspectivePluginsChangedEvent ( ) ) ; } |
public class AttachmentMessageBuilder { /** * Adds a { @ link QuickReply } to the current object .
* @ param reply
* a quick reply object .
* @ return this builder .
* @ see < a href =
* " https : / / developers . facebook . com / docs / messenger - platform / send - api - reference / quick - replies "
* > Facebook ' s Messenger Platform Quick Replies Documentation < / a > */
public AttachmentMessageBuilder addQuickReply ( QuickReply reply ) { } } | if ( this . quickReplies == null ) { this . quickReplies = new ArrayList < QuickReply > ( ) ; } this . quickReplies . add ( reply ) ; return this ; |
public class ContextUtils { /** * Get the file points to an external notifications directory .
* @ param context the context .
* @ return the { @ link java . io . File } . */
@ TargetApi ( Build . VERSION_CODES . FROYO ) public static File getExternalFilesDirForNotifications ( Context context ) { } } | return context . getExternalFilesDir ( Environment . DIRECTORY_NOTIFICATIONS ) ; |
public class FileFilterBuilder { /** * Add to the set of file extensions to accept for analysis . Case - insensitivity is assumed .
* @ param extensions one or more file extensions to accept for analysis
* @ return this builder */
public FileFilterBuilder addExtensions ( Iterable < String > extensions ) { } } | for ( String extension : extensions ) { // Ultimately , SuffixFileFilter will be used , and the " . " needs to be explicit .
this . extensions . add ( extension . startsWith ( "." ) ? extension : "." + extension ) ; } return this ; |
public class SocketChannelWrapperBar { /** * Initialize the ssl */
@ Override public void ssl ( SSLFactory sslFactory ) { } } | try { Objects . requireNonNull ( sslFactory ) ; SocketChannel channel = _channel ; Objects . requireNonNull ( channel ) ; _sslSocket = sslFactory . ssl ( channel ) ; _sslSocket . startHandshake ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; throw new RuntimeException ( e ) ; } |
public class DescribeSpotPriceHistoryRequest { /** * Filters the results by the specified instance types .
* @ param instanceTypes
* Filters the results by the specified instance types .
* @ return Returns a reference to this object so that method calls can be chained together .
* @ see InstanceType */
public DescribeSpotPriceHistoryRequest withInstanceTypes ( InstanceType ... instanceTypes ) { } } | com . amazonaws . internal . SdkInternalList < String > instanceTypesCopy = new com . amazonaws . internal . SdkInternalList < String > ( instanceTypes . length ) ; for ( InstanceType value : instanceTypes ) { instanceTypesCopy . add ( value . toString ( ) ) ; } if ( getInstanceTypes ( ) == null ) { setInstanceTypes ( instanceTypesCopy ) ; } else { getInstanceTypes ( ) . addAll ( instanceTypesCopy ) ; } return this ; |
public class StampoGlobalConfiguration { /** * http : / / docs . oracle . com / javase / 7 / docs / api / java / nio / file / FileSystem . html # getPathMatcher % 28java . lang . String % 29 */
@ SuppressWarnings ( "unchecked" ) private Set < String > extractIgnorePatterns ( Map < String , Object > configuration ) { } } | List < String > patterns = asList ( "glob:.*" , // hidden files
"glob:*~" , "glob:#*#" , "glob:.#*" , // emacs
"glob:*~" , "glob:[._]*.s[a-w][a-z]" , "glob:[._]s[a-w][a-z]" , "glob:*.un~" // vim
) ; Set < String > s = new HashSet < > ( ( List < String > ) configuration . getOrDefault ( "ignore-patterns" , patterns ) ) ; s . addAll ( patterns ) ; return unmodifiableSet ( s ) ; |
public class NodeRule { /** * Creates a mutator to the variable . */
protected final MethodSpec newSetter ( TypeName varType , String varName , Visibility visibility ) { } } | String methodName = "set" + Character . toUpperCase ( varName . charAt ( 0 ) ) + varName . substring ( 1 ) ; String type ; if ( varType . isPrimitive ( ) ) { type = varType . equals ( TypeName . INT ) ? "Int" : "Long" ; } else { type = "Object" ; } MethodSpec . Builder setter = MethodSpec . methodBuilder ( methodName ) . addModifiers ( context . publicFinalModifiers ( ) ) . addParameter ( varType , varName ) ; if ( visibility . isRelaxed ) { setter . addStatement ( "$T.UNSAFE.put$L(this, $N, $N)" , UNSAFE_ACCESS , type , offsetName ( varName ) , varName ) ; } else { setter . addStatement ( "this.$N = $N" , varName , varName ) ; } return setter . build ( ) ; |
public class StreamT { /** * / * ( non - Javadoc )
* @ see cyclops2 . monads . transformers . values . ListT # takeRight ( int ) */
@ Override public StreamT < W , T > takeRight ( final int num ) { } } | return ( StreamT < W , T > ) FoldableTransformerSeq . super . takeRight ( num ) ; |
public class MPXJFormats { /** * Generate a set of datetime patterns to accommodate variations in MPX files .
* @ param datePattern date pattern element
* @ param timePatterns time patterns
* @ return datetime patterns */
private List < String > generateDateTimePatterns ( String datePattern , String [ ] timePatterns ) { } } | List < String > patterns = new ArrayList < String > ( ) ; for ( String timePattern : timePatterns ) { patterns . add ( datePattern + " " + timePattern ) ; } // Always fall back on the date - only pattern
patterns . add ( datePattern ) ; return patterns ; |
public class ApptentiveViewActivity { /** * region ApptentiveNotificationObserver */
@ Override public void onReceiveNotification ( ApptentiveNotification notification ) { } } | checkConversationQueue ( ) ; if ( notification . hasName ( NOTIFICATION_INTERACTIONS_SHOULD_DISMISS ) ) { dispatchOnMainQueue ( new DispatchTask ( ) { @ Override protected void execute ( ) { dismissActivity ( ) ; } } ) ; } else if ( notification . hasName ( NOTIFICATION_CONVERSATION_STATE_DID_CHANGE ) ) { final Conversation conversation = notification . getUserInfo ( NOTIFICATION_KEY_CONVERSATION , Conversation . class ) ; Assert . assertNotNull ( conversation , "Conversation expected to be not null" ) ; if ( conversation != null && ! conversation . hasActiveState ( ) ) { dispatchOnMainQueue ( new DispatchTask ( ) { @ Override protected void execute ( ) { dismissActivity ( ) ; } } ) ; } } |
public class ApiOvhDomain { /** * Alter this object properties
* REST : PUT / domain / zone / { zoneName } / soa
* @ param body [ required ] New object properties
* @ param zoneName [ required ] The internal name of your zone */
public void zone_zoneName_soa_PUT ( String zoneName , OvhSoa body ) throws IOException { } } | String qPath = "/domain/zone/{zoneName}/soa" ; StringBuilder sb = path ( qPath , zoneName ) ; exec ( qPath , "PUT" , sb . toString ( ) , body ) ; |
public class AccessibilityFeature { /** * Active inverter colors */
private void startInvertedColors ( ) { } } | if ( managerFeatures . getInvertedColors ( ) . isInverted ( ) ) { managerFeatures . getInvertedColors ( ) . turnOff ( mGvrContext . getMainScene ( ) ) ; } else { managerFeatures . getInvertedColors ( ) . turnOn ( mGvrContext . getMainScene ( ) ) ; } |
public class AtomicDouble { /** * Atomically updates the current value with the results of
* applying the given function to the current and given values ,
* returning the previous value . The function should be
* side - effect - free , since it may be re - applied when attempted
* updates fail due to contention among threads . The function
* is applied with the current value as its first argument ,
* and the given update as the second argument .
* @ param x the update value
* @ param accumulatorFunction a side - effect - free function of two arguments
* @ return the previous value */
public final double getAndAccumulate ( double x , DoubleBinaryOperator accumulatorFunction ) { } } | double prev , next ; do { prev = get ( ) ; next = accumulatorFunction . applyAsDouble ( prev , x ) ; } while ( ! compareAndSet ( prev , next ) ) ; return prev ; |
public class Money { /** * ( non - Javadoc )
* @ see javax . money . MonetaryAmount # stripTrailingZeros ( ) */
@ Override public Money stripTrailingZeros ( ) { } } | if ( isZero ( ) ) { return new Money ( BigDecimal . ZERO , getCurrency ( ) ) ; } return new Money ( this . number . stripTrailingZeros ( ) , getCurrency ( ) , monetaryContext ) ; |
public class Matrix4x3f { /** * Set this matrix to be a simple translation matrix .
* The resulting matrix can be multiplied against another transformation
* matrix to obtain an additional translation .
* In order to post - multiply a translation transformation directly to a
* matrix , use { @ link # translate ( float , float , float ) translate ( ) } instead .
* @ see # translate ( float , float , float )
* @ param x
* the offset to translate in x
* @ param y
* the offset to translate in y
* @ param z
* the offset to translate in z
* @ return this */
public Matrix4x3f translation ( float x , float y , float z ) { } } | if ( ( properties & PROPERTY_IDENTITY ) == 0 ) MemUtil . INSTANCE . identity ( this ) ; m30 = x ; m31 = y ; m32 = z ; properties = PROPERTY_TRANSLATION | PROPERTY_ORTHONORMAL ; return this ; |
public class CmsXmlContentDefinition { /** * Factory method to unmarshal ( read ) a XML content definition instance from a XML InputSource . < p >
* @ param source the XML InputSource to use
* @ param schemaLocation the location from which the XML schema was read ( system id )
* @ param resolver the XML entity resolver to use
* @ return a XML content definition instance unmarshalled from the InputSource
* @ throws CmsXmlException if something goes wrong */
public static CmsXmlContentDefinition unmarshal ( InputSource source , String schemaLocation , EntityResolver resolver ) throws CmsXmlException { } } | schemaLocation = translateSchema ( schemaLocation ) ; CmsXmlContentDefinition result = getCachedContentDefinition ( schemaLocation , resolver ) ; if ( result == null ) { // content definition was not found in the cache , unmarshal the XML document
if ( null == source ) { throw new CmsXmlException ( Messages . get ( ) . container ( Messages . ERR_UNMARSHALLING_XML_DOC_1 , String . format ( "schemaLocation: '%s'. source: null!" , schemaLocation ) ) ) ; } Document doc = CmsXmlUtils . unmarshalHelper ( source , resolver ) ; result = unmarshalInternal ( doc , schemaLocation , resolver ) ; } return result ; |
public class SeaGlassButtonUI { /** * DOCUMENT ME !
* @ param b DOCUMENT ME !
* @ param defaultIcon DOCUMENT ME !
* @ return DOCUMENT ME ! */
private Icon getSynthDisabledIcon ( AbstractButton b , Icon defaultIcon ) { } } | ButtonModel model = b . getModel ( ) ; Icon icon ; if ( model . isSelected ( ) ) { icon = getIcon ( b , b . getDisabledSelectedIcon ( ) , defaultIcon , SynthConstants . DISABLED | SynthConstants . SELECTED ) ; } else { icon = getIcon ( b , b . getDisabledIcon ( ) , defaultIcon , SynthConstants . DISABLED ) ; } return icon ; |
public class Popups { /** * Creates and returns a new popup with the specified style name and contents . */
public static PopupPanel newPopup ( String styleName , Widget contents ) { } } | PopupPanel panel = new PopupPanel ( ) ; panel . setStyleName ( styleName ) ; panel . setWidget ( contents ) ; return panel ; |
public class AnnotationClassRef { /** * Loads the referenced class , returning a { @ code Class < ? > } reference for the referenced class .
* @ param ignoreExceptions
* if true , ignore exceptions and instead return null if the class could not be loaded .
* @ return The { @ code Class < ? > } reference for the referenced class .
* @ throws IllegalArgumentException
* if the class could not be loaded and ignoreExceptions was false . */
@ Override public Class < ? > loadClass ( final boolean ignoreExceptions ) { } } | getTypeSignature ( ) ; if ( typeSignature instanceof BaseTypeSignature ) { return ( ( BaseTypeSignature ) typeSignature ) . getType ( ) ; } else if ( typeSignature instanceof ClassRefTypeSignature ) { return ( ( ClassRefTypeSignature ) typeSignature ) . loadClass ( ignoreExceptions ) ; } else { throw new IllegalArgumentException ( "Got unexpected type " + typeSignature . getClass ( ) . getName ( ) + " for ref type signature: " + typeDescriptorStr ) ; } |
public class JdbcTable { /** * Delete this record ( Always called from the record class ) .
* Do a SQL delete .
* @ exception DBException INVALID _ RECORD - Attempt to delete a record that is not current . */
public void doRemove ( ) throws DBException { } } | Object bookmark = this . getRecord ( ) . getHandle ( DBConstants . BOOKMARK_HANDLE ) ; String strRecordset = this . getRecord ( ) . getSQLDelete ( SQLParams . USE_INSERT_UPDATE_LITERALS ) ; this . executeUpdate ( strRecordset , DBConstants . SQL_DELETE_TYPE ) ; if ( m_iRow != - 1 ) m_iRow -- ; // Just in case I ' m in an active query this will keep requeries correct
if ( this . lockOnDBTrxType ( null , DBConstants . AFTER_DELETE_TYPE , false ) ) // Should I do the unlock in my code ?
this . unlockIfLocked ( this . getRecord ( ) , bookmark ) ; |
public class ThrottleWriter { /** * Compute rate limit per executor .
* Rate limit = Total rate limit / # of parallelism
* # of parallelism :
* - if LOCAL job type Min ( # of source partition , thread pool size )
* - else Min ( # of source partition , # of max mappers )
* @ param state
* @ return */
private int computeRateLimit ( State state ) { } } | String jobLauncherType = state . getProp ( ConfigurationKeys . JOB_LAUNCHER_TYPE_KEY , "LOCAL" ) ; int parallelism = 1 ; if ( LOCAL_JOB_LAUNCHER_TYPE . equals ( jobLauncherType ) ) { parallelism = state . getPropAsInt ( ConfigurationKeys . TASK_EXECUTOR_THREADPOOL_SIZE_KEY , ConfigurationKeys . DEFAULT_TASK_EXECUTOR_THREADPOOL_SIZE ) ; } else { parallelism = state . getPropAsInt ( ConfigurationKeys . MR_JOB_MAX_MAPPERS_KEY , ConfigurationKeys . DEFAULT_MR_JOB_MAX_MAPPERS ) ; } parallelism = Math . min ( parallelism , state . getPropAsInt ( ConfigurationKeys . SOURCE_MAX_NUMBER_OF_PARTITIONS , ConfigurationKeys . DEFAULT_MAX_NUMBER_OF_PARTITIONS ) ) ; parallelism = Math . max ( parallelism , 1 ) ; int rateLimit = state . getPropAsInt ( WRITER_LIMIT_RATE_LIMIT_KEY ) / parallelism ; rateLimit = Math . max ( rateLimit , 1 ) ; return rateLimit ; |
public class Tracer { /** * Initialize the trace associated with the current thread by clearing
* out any existing trace . There shouldn ' t be a trace so if one is
* found we log it as an error . */
static void initCurrentThreadTrace ( ) { } } | ThreadTrace events = getThreadTrace ( ) ; if ( ! events . isEmpty ( ) ) { logger . log ( Level . WARNING , "Non-empty timer log:\n" + events , new Throwable ( ) ) ; clearThreadTrace ( ) ; // Grab a new thread trace if we find a previous non - empty ThreadTrace .
events = getThreadTrace ( ) ; } // Mark the thread trace as initialized .
events . init ( ) ; |
public class RedisSortSet { /** * 新增元素
* @ param score 权重
* @ param value 元素
* @ return */
public long add ( double score , Object value ) { } } | try { long result = 0 ; if ( isCluster ( groupName ) ) { result = getBinaryJedisClusterCommands ( groupName ) . zadd ( keyBytes , score , valueSerialize ( value ) ) ; } else { result = getBinaryJedisCommands ( groupName ) . zadd ( keyBytes , score , valueSerialize ( value ) ) ; } // 设置超时时间
if ( result > 0 ) setExpireIfNot ( expireTime ) ; return result ; } finally { getJedisProvider ( groupName ) . release ( ) ; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.