signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class ObservableDataBuilder { /** * Each emission of this observable appends to the elements of the data . */
@ NonNull public ObservableDataBuilder < T > appends ( @ Nullable Observable < ? extends Collection < ? extends T > > appends ) { } } | mAppends = appends ; return this ; |
public class Matrix4x3d { /** * Set this matrix to a model transformation for a right - handed coordinate system ,
* that aligns the local < code > - z < / code > axis with < code > dir < / code > .
* In order to apply the rotation transformation to a previous existing transformation ,
* use { @ link # rotateTowards ( double , double , double , double , double , double ) rotateTowards } .
* This method is equivalent to calling : < code > setLookAt ( new Vector3d ( ) , new Vector3d ( dir ) . negate ( ) , up ) . invert ( ) < / code >
* @ see # rotationTowards ( Vector3dc , Vector3dc )
* @ see # rotateTowards ( double , double , double , double , double , double )
* @ param dir
* the direction to orient the local - z axis towards
* @ param up
* the up vector
* @ return this */
public Matrix4x3d rotationTowards ( Vector3dc dir , Vector3dc up ) { } } | return rotationTowards ( dir . x ( ) , dir . y ( ) , dir . z ( ) , up . x ( ) , up . y ( ) , up . z ( ) ) ; |
public class AbstractService { /** * test node existence at path
* @ param session the session
* @ param path the path
* @ return whether T exists at the given path */
public boolean exists ( final FedoraSession session , final String path ) { } } | final Session jcrSession = getJcrSession ( session ) ; try { return jcrSession . nodeExists ( path ) ; } catch ( final RepositoryException e ) { throw new RepositoryRuntimeException ( e ) ; } |
public class MOEADD { /** * find the index of the solution ' indiv ' in the population */
public int findPosition ( S indiv ) { } } | for ( int i = 0 ; i < populationSize ; i ++ ) { if ( indiv . equals ( population . get ( i ) ) ) { return i ; } } return - 1 ; |
public class BasicWriter { /** * { @ inheritDoc } */
@ SuppressWarnings ( "unchecked" ) @ Override public void write ( Record record ) throws IOException , InterruptedException { } } | if ( record . isKeyEmpty ( ) ) { defaultRecord . getKey ( ) . getSort ( ) . clear ( ) ; record . setKey ( defaultRecord . getKey ( ) ) ; } else { if ( record . getKey ( ) . isGroupingEmpty ( ) && ! record . getKey ( ) . isSortEmpty ( ) ) { record . getKey ( ) . setGrouping ( defaultRecord . getKey ( ) . getGrouping ( ) ) ; } } if ( record . isValueEmpty ( ) ) { record . setValue ( defaultRecord . getValue ( ) ) ; } if ( ! label ) { for ( ValueWritable vw : record . getKey ( ) . getGrouping ( ) ) { vw . getLabel ( ) . clear ( ) ; } for ( ValueWritable vw : record . getValue ( ) . getValues ( ) ) { vw . getLabel ( ) . clear ( ) ; } } context . write ( record . isGroupingNothing ( ) ? NullWritable . get ( ) : record . getKey ( ) , record . isValueNothing ( ) ? NullWritable . get ( ) : record . getValue ( ) ) ; |
public class CacheHandler { /** * 生成缓存KeyTO
* @ param target 类名
* @ param methodName 方法名
* @ param arguments 参数
* @ param keyExpression key表达式
* @ param hfieldExpression hfield表达式
* @ param result 执行实际方法的返回值
* @ return CacheKeyTO */
public CacheKeyTO getCacheKey ( Object target , String methodName , Object [ ] arguments , String keyExpression , String hfieldExpression , Object result , boolean hasRetVal ) { } } | String key = null ; String hfield = null ; if ( null != keyExpression && keyExpression . trim ( ) . length ( ) > 0 ) { try { key = scriptParser . getDefinedCacheKey ( keyExpression , target , arguments , result , hasRetVal ) ; if ( null != hfieldExpression && hfieldExpression . trim ( ) . length ( ) > 0 ) { hfield = scriptParser . getDefinedCacheKey ( hfieldExpression , target , arguments , result , hasRetVal ) ; } } catch ( Exception ex ) { log . error ( ex . getMessage ( ) , ex ) ; } } else { key = CacheUtil . getDefaultCacheKey ( target . getClass ( ) . getName ( ) , methodName , arguments ) ; } if ( null == key || key . trim ( ) . isEmpty ( ) ) { throw new IllegalArgumentException ( "cache key for " + target . getClass ( ) . getName ( ) + "." + methodName + " is empty" ) ; } return new CacheKeyTO ( config . getNamespace ( ) , key , hfield ) ; |
public class LFltIntConsumerBuilder { /** * One of ways of creating builder . This is possibly the least verbose way where compiler should be able to guess the generic parameters . */
@ Nonnull public static LFltIntConsumer fltIntConsumerFrom ( Consumer < LFltIntConsumerBuilder > buildingFunction ) { } } | LFltIntConsumerBuilder builder = new LFltIntConsumerBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ; |
public class NioSocketConnectorEx { /** * { @ inheritDoc } */
@ Override protected NioSessionEx newSession ( IoProcessor < NioSessionEx > processor , SocketChannel handle ) { } } | final NioSocketSessionEx nioSocketSession = new NioSocketSessionEx ( this , processor , handle ) ; // NB : We do not catch the RuntimeIoException for this
// call because catching one and returning null leads to NPE .
nioSocketSession . initSessionConfig ( ) ; return nioSocketSession ; |
public class Utilities { /** * Unescapes an URL . All the " % xx " are replaced by the ' xx ' hex char value .
* @ param src the url to unescape
* @ return the unescaped value */
public static String unEscapeURL ( String src ) { } } | StringBuffer bf = new StringBuffer ( ) ; char [ ] s = src . toCharArray ( ) ; for ( int k = 0 ; k < s . length ; ++ k ) { char c = s [ k ] ; if ( c == '%' ) { if ( k + 2 >= s . length ) { bf . append ( c ) ; continue ; } int a0 = PRTokeniser . getHex ( s [ k + 1 ] ) ; int a1 = PRTokeniser . getHex ( s [ k + 2 ] ) ; if ( a0 < 0 || a1 < 0 ) { bf . append ( c ) ; continue ; } bf . append ( ( char ) ( a0 * 16 + a1 ) ) ; k += 2 ; } else bf . append ( c ) ; } return bf . toString ( ) ; |
public class AsteriskQueueImpl { /** * Notifies all registered listener that an entry joins the queue .
* @ param entry that joins the queue */
void fireNewEntry ( AsteriskQueueEntryImpl entry ) { } } | synchronized ( listeners ) { for ( AsteriskQueueListener listener : listeners ) { try { listener . onNewEntry ( entry ) ; } catch ( Exception e ) { logger . warn ( "Exception in onNewEntry()" , e ) ; } } } |
public class ArrayDeque { /** * Inserts the specified element at the front of this deque .
* @ param e the element to add
* @ throws NullPointerException if the specified element is null */
public void addFirst ( E e ) { } } | if ( e == null ) throw new NullPointerException ( ) ; elements [ head = ( head - 1 ) & ( elements . length - 1 ) ] = e ; if ( head == tail ) doubleCapacity ( ) ; |
public class BooleanOperation { /** * < div color = ' red ' style = " font - size : 24px ; color : red " > < b > < i > < u > JCYPHER < / u > < / i > < / b > < / div >
* < div color = ' red ' style = " font - size : 18px ; color : red " > < i > less than or equal < / i > < / div >
* < br / > */
public < E > TerminalResult LTE ( E value ) { } } | getPredicateExpression ( ) . setOperator ( Operator . LTE ) ; getPredicateExpression ( ) . setValue_2 ( value ) ; TerminalResult ret = APIAccess . createTerminalResult ( this . getPredicateExpression ( ) ) ; QueryRecorder . recordInvocation ( this , "LTE" , ret , QueryRecorder . placeHolder ( value ) ) ; return ret ; |
public class MarkLogicRepositoryConnection { /** * overload for prepareUpdate
* @ param queryString
* @ param baseURI
* @ return MarkLogicUpdateQuery
* @ throws RepositoryException
* @ throws MalformedQueryException */
@ Override public MarkLogicUpdateQuery prepareUpdate ( String queryString , String baseURI ) throws RepositoryException , MalformedQueryException { } } | return prepareUpdate ( QueryLanguage . SPARQL , queryString , baseURI ) ; |
public class QValueParser { /** * Parses a set of headers that take q values to determine the most preferred one .
* It returns the result in the form of a sorted list of list , with every element in
* the list having the same q value . This means the highest priority items are at the
* front of the list . The container should use its own internal preferred ordering
* to determinately pick the correct item to use
* @ param headers The headers
* @ return The q value results */
public static List < List < QValueResult > > parse ( List < String > headers ) { } } | final List < QValueResult > found = new ArrayList < > ( ) ; QValueResult current = null ; for ( final String header : headers ) { final int l = header . length ( ) ; // we do not use a string builder
// we just keep track of where the current string starts and call substring ( )
int stringStart = 0 ; for ( int i = 0 ; i < l ; ++ i ) { char c = header . charAt ( i ) ; switch ( c ) { case ',' : { if ( current != null && ( i - stringStart > 2 && header . charAt ( stringStart ) == 'q' && header . charAt ( stringStart + 1 ) == '=' ) ) { // if this is a valid qvalue
current . qvalue = header . substring ( stringStart + 2 , i ) ; current = null ; } else if ( stringStart != i ) { current = handleNewEncoding ( found , header , stringStart , i ) ; } stringStart = i + 1 ; break ; } case ';' : { if ( stringStart != i ) { current = handleNewEncoding ( found , header , stringStart , i ) ; stringStart = i + 1 ; } break ; } case ' ' : { if ( stringStart != i ) { if ( current != null && ( i - stringStart > 2 && header . charAt ( stringStart ) == 'q' && header . charAt ( stringStart + 1 ) == '=' ) ) { // if this is a valid qvalue
current . qvalue = header . substring ( stringStart + 2 , i ) ; } else { current = handleNewEncoding ( found , header , stringStart , i ) ; } } stringStart = i + 1 ; } } } if ( stringStart != l ) { if ( current != null && ( l - stringStart > 2 && header . charAt ( stringStart ) == 'q' && header . charAt ( stringStart + 1 ) == '=' ) ) { // if this is a valid qvalue
current . qvalue = header . substring ( stringStart + 2 , l ) ; } else { current = handleNewEncoding ( found , header , stringStart , l ) ; } } } Collections . sort ( found , Collections . reverseOrder ( ) ) ; String currentQValue = null ; List < List < QValueResult > > values = new ArrayList < > ( ) ; List < QValueResult > currentSet = null ; for ( QValueResult val : found ) { if ( ! val . qvalue . equals ( currentQValue ) ) { currentQValue = val . qvalue ; currentSet = new ArrayList < > ( ) ; values . add ( currentSet ) ; } currentSet . add ( val ) ; } return values ; |
public class StringUtil { /** * Replaces each substring of this string that matches the given
* regular expression with the given pReplacement .
* An invocation of this method of the form
* < tt > replaceAll ( < i > str < / i > , < i > pRegex < / i > , < i > repl < / i > < ) < / tt >
* yields exactly the same result as the expression
* < blockquote > < tt >
* { @ link Pattern } . { @ link Pattern # compile compile } ( < i > pRegex < / i > ) .
* { @ link Pattern # matcher matcher } ( < / tt > < i > str < / i > { @ code ) .
* { @ link java . util . regex . Matcher # replaceAll replaceAll } ( } < i > repl < / i > { @ code ) } < / blockquote >
* @ param pString the string
* @ param pRegex the regular expression to which this string is to be matched
* @ param pReplacement the replacement string
* @ return The resulting { @ code String }
* @ throws PatternSyntaxException if the regular expression ' s syntax is invalid
* @ see Pattern
* @ see String # replaceAll ( String , String ) */
public String replaceAll ( String pString , String pRegex , String pReplacement ) { } } | return Pattern . compile ( pRegex ) . matcher ( pString ) . replaceAll ( pReplacement ) ; |
public class Attributes { /** * Get the HTML representation of these attributes .
* @ return HTML
* @ throws SerializationException if the HTML representation of the attributes cannot be constructed . */
public String html ( ) { } } | StringBuilder sb = StringUtil . borrowBuilder ( ) ; try { html ( sb , ( new Document ( "" ) ) . outputSettings ( ) ) ; // output settings a bit funky , but this html ( ) seldom used
} catch ( IOException e ) { // ought never happen
throw new SerializationException ( e ) ; } return StringUtil . releaseBuilder ( sb ) ; |
public class AsyncContextImpl { /** * End : PM90834 */
@ Override public synchronized Collection < WrapperRunnable > getAndClearStartRunnables ( ) { } } | if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINEST ) ) { logger . entering ( CLASS_NAME , "getAndClearStartRunnables" , this ) ; } // set the pointer to null so that the remove cannot remove an Runnable
// in the middle of traversing over the list .
Collection < WrapperRunnable > tempStartRunnables = startRunnables ; this . startRunnables = null ; if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINEST ) ) { logger . exiting ( CLASS_NAME , "getAndClearStartRunnables" , this ) ; } return tempStartRunnables ; |
public class CmsVfsSitemapService { /** * Un - deletes a resource according to the change data . < p >
* @ param change the change data
* @ return the changed entry or < code > null < / code >
* @ throws CmsException if something goes wrong */
private CmsSitemapChange undelete ( CmsSitemapChange change ) throws CmsException { } } | CmsObject cms = getCmsObject ( ) ; CmsResource deleted = cms . readResource ( change . getEntryId ( ) , CmsResourceFilter . ALL ) ; if ( deleted . getState ( ) . isDeleted ( ) ) { ensureLock ( deleted ) ; cms . undeleteResource ( getCmsObject ( ) . getSitePath ( deleted ) , true ) ; tryUnlock ( deleted ) ; } String parentPath = CmsResource . getParentFolder ( cms . getSitePath ( deleted ) ) ; CmsJspNavElement navElement = getNavBuilder ( ) . getNavigationForResource ( parentPath , CmsResourceFilter . ONLY_VISIBLE_NO_DELETED ) ; CmsClientSitemapEntry entry = toClientEntry ( navElement , navElement . isInNavigation ( ) ) ; entry . setSubEntries ( getChildren ( parentPath , 2 , null ) , null ) ; change . setUpdatedEntry ( entry ) ; change . setParentId ( cms . readParentFolder ( deleted . getStructureId ( ) ) . getStructureId ( ) ) ; return change ; |
public class SparseIntArray { /** * Sets the value of the index to the value using the Java primitives
* without auto - boxing . if { @ code value } is 0 , and the value at { @ code
* index } is already zero , this will be a no - op . */
public void setPrimitive ( int index , int value ) { } } | int pos = Arrays . binarySearch ( indices , index ) ; if ( value != 0 ) { // need to make room in the indices array
if ( pos < 0 ) { int newPos = 0 - ( pos + 1 ) ; int [ ] newIndices = new int [ indices . length + 1 ] ; int [ ] newValues = new int [ values . length + 1 ] ; // copy the existing array contents that are valid in their
// current positions
for ( int i = 0 ; i < newPos ; ++ i ) { newValues [ i ] = values [ i ] ; newIndices [ i ] = indices [ i ] ; } // shift the elements down by one to make room
for ( int i = newPos ; i < values . length ; ++ i ) { newValues [ i + 1 ] = values [ i ] ; newIndices [ i + 1 ] = indices [ i ] ; } // swap the arrays
indices = newIndices ; values = newValues ; pos = newPos ; // update the position of the pos in the values array
indices [ pos ] = index ; } values [ pos ] = value ; } // The value is zero but previously held a spot in the matrix , so
// remove its position and shift everything over
else if ( value == 0 && pos >= 0 ) { int newLength = indices . length - 1 ; int [ ] newIndices = new int [ newLength ] ; int [ ] newValues = new int [ newLength ] ; for ( int i = 0 , j = 0 ; i < indices . length ; ++ i ) { if ( i != pos ) { newIndices [ j ] = indices [ i ] ; newValues [ j ] = values [ i ] ; j ++ ; } } // swap the arrays
indices = newIndices ; values = newValues ; } |
public class Grid { /** * / * package */
synchronized Key < Model > putModel ( long checksum , Key < Model > modelKey ) { } } | return _models . put ( IcedLong . valueOf ( checksum ) , modelKey ) ; |
public class AWSCodePipelineClient { /** * Gets a summary of the most recent executions for a pipeline .
* @ param listPipelineExecutionsRequest
* Represents the input of a ListPipelineExecutions action .
* @ return Result of the ListPipelineExecutions operation returned by the service .
* @ throws ValidationException
* The validation was specified in an invalid format .
* @ throws PipelineNotFoundException
* The specified pipeline was specified in an invalid format or cannot be found .
* @ throws InvalidNextTokenException
* The next token was specified in an invalid format . Make sure that the next token you provided is the
* token returned by a previous call .
* @ sample AWSCodePipeline . ListPipelineExecutions
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / codepipeline - 2015-07-09 / ListPipelineExecutions "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public ListPipelineExecutionsResult listPipelineExecutions ( ListPipelineExecutionsRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeListPipelineExecutions ( request ) ; |
public class CertificatesImpl { /** * Gets information about the specified certificate .
* @ param thumbprintAlgorithm The algorithm used to derive the thumbprint parameter . This must be sha1.
* @ param thumbprint The thumbprint of the certificate to get .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the Certificate object */
public Observable < Certificate > getAsync ( String thumbprintAlgorithm , String thumbprint ) { } } | return getWithServiceResponseAsync ( thumbprintAlgorithm , thumbprint ) . map ( new Func1 < ServiceResponseWithHeaders < Certificate , CertificateGetHeaders > , Certificate > ( ) { @ Override public Certificate call ( ServiceResponseWithHeaders < Certificate , CertificateGetHeaders > response ) { return response . body ( ) ; } } ) ; |
public class Xsd2AvroTranslatorMain { /** * Make sure mandatory parameters have default values . */
private void setDefaults ( ) { } } | if ( xsdInput == null ) { setXsdInput ( DEFAULT_INPUT_FOLDER_PATH ) ; } if ( output == null ) { setOutput ( DEFAULT_OUTPUT_FOLDER_PATH ) ; } if ( avroNamespacePrefix == null ) { setAvroNamespacePrefix ( DEFAULT_AVRO_NAMESPACE_PREFIX ) ; } |
public class LinearGeometry { /** * Returns the points composing this Geometry .
* @ return { @ code Iterable < Point > } a Guava lazy Iterable . */
public List < Point > points ( ) { } } | return positions ( ) . children ( ) . stream ( ) . map ( Point :: new ) . collect ( Collectors . toList ( ) ) ; |
public class ByteArrayList { /** * Adds the specified { @ link ByteArray } to
* the beginning of the list
* @ param ba
* The ByteArray to be added to the list */
public void addFirst ( ByteArray ba ) { } } | addNode ( new Node ( ba ) , header . next ) ; firstByte -= ba . last ( ) ; |
public class TypeLexer { /** * $ ANTLR start " ENDTYPEPARAM " */
public final void mENDTYPEPARAM ( ) throws RecognitionException { } } | try { int _type = ENDTYPEPARAM ; int _channel = DEFAULT_TOKEN_CHANNEL ; // org / javaruntype / type / parser / Type . g : 33:14 : ( ' > ' )
// org / javaruntype / type / parser / Type . g : 33:16 : ' > '
{ match ( '>' ) ; } state . type = _type ; state . channel = _channel ; } finally { } |
public class Ingest { /** * Print error message and show usage for command - line interface . */
public static void badArgs ( String msg ) { } } | System . err . println ( "Command: fedora-ingest" ) ; System . err . println ( ) ; System . err . println ( "Summary: Ingests one or more objects into a Fedora repository, from either" ) ; System . err . println ( " the local filesystem or another Fedora repository." ) ; System . err . println ( ) ; System . err . println ( "Syntax:" ) ; System . err . println ( " fedora-ingest f[ile] path format targetHost:targetPort targetUser targetPassword targetProtocol [log] [context]" ) ; System . err . println ( " fedora-ingest d[ir] path format targetHost:targetPort targetUser targetPassword targetProtocol [log] [context]" ) ; System . err . println ( " fedora-ingest r[epos] sourceHost:sourcePort sourceUser sourcePassword pid|* targetHost:targetPort targetUser targetPassword sourceProtocol targetProtocol [log] [context]" ) ; System . err . println ( ) ; System . err . println ( "Where:" ) ; System . err . println ( " path is the local file or directory name that is ingest source." ) ; System . err . println ( " format is a string value which indicates the XML format of the ingest file(s)" ) ; System . err . println ( " ('" + FOXML1_1 . uri + "'," ) ; System . err . println ( " '" + FOXML1_0 . uri + "'," ) ; System . err . println ( " '" + METS_EXT1_1 . uri + "'," ) ; System . err . println ( " '" + METS_EXT1_0 . uri + "'," ) ; System . err . println ( " '" + ATOM1_1 . uri + "'," ) ; System . err . println ( " or '" + ATOM_ZIP1_1 . uri + "')" ) ; System . err . println ( " pid | * is the id of the object to ingest from the source repository OR * in case of all objects from the source repository." ) ; System . err . println ( " sourceHost/targetHost is the source or target repository's hostname." ) ; System . err . println ( " sourcePort/targetPort is the source or target repository's port number." ) ; System . err . println ( " sourceUser/targetUser is the id of the source or target repository user." ) ; System . err . println ( " sourcePassword/targetPassword is the password of the source or target repository user." ) ; System . err . println ( " sourceProtocol is the protocol to communicate with source repository (http or https)" ) ; System . err . println ( " targetProtocol is the protocol to communicate with target repository (http or https)" ) ; System . err . println ( " log is the optional log message. If unspecified, the log message" ) ; System . err . println ( " will indicate the source filename or repository of the object(s)." ) ; System . err . println ( " context is the optional parameter for specifying the context name under which " ) ; System . err . println ( " the Fedora server is deployed. The default is fedora." ) ; System . err . println ( ) ; System . err . println ( "Examples:" ) ; System . err . println ( "fedora-ingest f obj1.xml " + FOXML1_1 . uri + " myrepo.com:8443 jane jpw https" ) ; System . err . println ( ) ; System . err . println ( " Ingests obj1.xml (encoded in FOXML 1.1 format) from the" ) ; System . err . println ( " current directory into the repository at myrepo.com:80" ) ; System . err . println ( " as user 'jane' with password 'jpw' using the secure https protocol (SSL)." ) ; System . err . println ( " The logmessage will be system-generated, indicating" ) ; System . err . println ( " the source path+filename." ) ; System . err . println ( ) ; System . err . println ( "fedora-ingest d c:\\archive " + FOXML1_1 . uri + " myrepo.com:80 jane janepw http \"\"" ) ; System . err . println ( ) ; System . err . println ( " Traverses entire directory structure of c:\\archive, and ingests any file." ) ; System . err . println ( " It assumes all files will be in the FOXML 1.1 format" ) ; System . err . println ( " and will fail on ingests of files that are not of this format." ) ; System . err . println ( " All log messages will be the quoted string." ) ; System . err . println ( ) ; System . err . println ( "fedora-ingest d c:\\archive " + FOXML1_1 . uri + " myrepo.com:80 jane janepw http \"\" my-fedora" ) ; System . err . println ( " Traverses entire directory structure of c:\\archive, and ingests any file." ) ; System . err . println ( " It assumes all files will be in the FOXML 1.1 format" ) ; System . err . println ( " and will fail on ingests of files that are not of this format." ) ; System . err . println ( " All log messages will be the quoted string." ) ; System . err . println ( " Additionally the Fedora server is assumed to be running under the context name " ) ; System . err . println ( " http://myrepo:80/my-fedora instead of http://myrepo:80/fedora " ) ; System . err . println ( ) ; System . err . println ( "fedora-ingest r jrepo.com:8081 mike mpw demo:1 myrepo.com:8443 jane jpw http https \"\"" ) ; System . err . println ( ) ; System . err . println ( " Ingests the object whose pid is 'demo:1' from the source repository" ) ; System . err . println ( " 'srcrepo.com:8081' into the target repository 'myrepo.com:80'." ) ; System . err . println ( " The object will be exported from the source repository in the default" ) ; System . err . println ( " export format configured at the source." ) ; System . err . println ( " All log messages will be empty." ) ; System . err . println ( ) ; System . err . println ( "fedora-ingest r jrepo.com:8081 mike mpw O myrepo.com:8443 jane jpw http https \"\"" ) ; System . err . println ( ) ; System . err . println ( " Same as above, but ingests all data objects (type O)." ) ; System . err . println ( ) ; System . err . println ( "ERROR : " + msg ) ; System . exit ( 1 ) ; |
public class NonObservingFSJobCatalog { /** * Allow user to programmatically add a new JobSpec .
* The method will materialized the jobSpec into real file .
* @ param jobSpec The target JobSpec Object to be materialized .
* Noted that the URI return by getUri is a relative path . */
@ Override public synchronized void put ( JobSpec jobSpec ) { } } | Preconditions . checkState ( state ( ) == State . RUNNING , String . format ( "%s is not running." , this . getClass ( ) . getName ( ) ) ) ; Preconditions . checkNotNull ( jobSpec ) ; try { long startTime = System . currentTimeMillis ( ) ; Path jobSpecPath = getPathForURI ( this . jobConfDirPath , jobSpec . getUri ( ) ) ; boolean isUpdate = fs . exists ( jobSpecPath ) ; materializedJobSpec ( jobSpecPath , jobSpec , this . fs ) ; this . mutableMetrics . updatePutJobTime ( startTime ) ; if ( isUpdate ) { this . listeners . onUpdateJob ( jobSpec ) ; } else { this . listeners . onAddJob ( jobSpec ) ; } } catch ( IOException e ) { throw new RuntimeException ( "When persisting a new JobSpec, unexpected issues happen:" + e . getMessage ( ) ) ; } catch ( JobSpecNotFoundException e ) { throw new RuntimeException ( "When replacing a existed JobSpec, unexpected issue happen:" + e . getMessage ( ) ) ; } |
public class ToggleCommand { /** * Set the selection state of the command . */
public final void setSelected ( boolean selected ) { } } | if ( isExclusiveGroupMember ( ) ) { boolean oldState = isSelected ( ) ; exclusiveController . handleSelectionRequest ( this , selected ) ; // set back button state if controller didn ' t change this command ;
// needed b / c of natural button check box toggling in swing
if ( oldState == isSelected ( ) ) { Iterator iter = buttonIterator ( ) ; while ( iter . hasNext ( ) ) { AbstractButton button = ( AbstractButton ) iter . next ( ) ; button . setSelected ( isSelected ( ) ) ; } } } else { requestSetSelection ( selected ) ; } |
public class ManagedInstancesInner { /** * Creates or updates a managed instance .
* @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal .
* @ param managedInstanceName The name of the managed instance .
* @ param parameters The requested managed instance resource state .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable for the request */
public Observable < ManagedInstanceInner > createOrUpdateAsync ( String resourceGroupName , String managedInstanceName , ManagedInstanceInner parameters ) { } } | return createOrUpdateWithServiceResponseAsync ( resourceGroupName , managedInstanceName , parameters ) . map ( new Func1 < ServiceResponse < ManagedInstanceInner > , ManagedInstanceInner > ( ) { @ Override public ManagedInstanceInner call ( ServiceResponse < ManagedInstanceInner > response ) { return response . body ( ) ; } } ) ; |
public class AWSElasticBeanstalkClient { /** * Updates the specified configuration template to have the specified properties or configuration option values .
* < note >
* If a property ( for example , < code > ApplicationName < / code > ) is not provided , its value remains unchanged . To clear
* such properties , specify an empty string .
* < / note >
* Related Topics
* < ul >
* < li >
* < a > DescribeConfigurationOptions < / a >
* < / li >
* < / ul >
* @ param updateConfigurationTemplateRequest
* The result message containing the options for the specified solution stack .
* @ return Result of the UpdateConfigurationTemplate operation returned by the service .
* @ throws InsufficientPrivilegesException
* The specified account does not have sufficient privileges for one or more AWS services .
* @ throws TooManyBucketsException
* The specified account has reached its limit of Amazon S3 buckets .
* @ sample AWSElasticBeanstalk . UpdateConfigurationTemplate
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / elasticbeanstalk - 2010-12-01 / UpdateConfigurationTemplate "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public UpdateConfigurationTemplateResult updateConfigurationTemplate ( UpdateConfigurationTemplateRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeUpdateConfigurationTemplate ( request ) ; |
public class QueueReferenceMarshaller { /** * Marshall the given parameter object . */
public void marshall ( QueueReference queueReference , ProtocolMarshaller protocolMarshaller ) { } } | if ( queueReference == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( queueReference . getId ( ) , ID_BINDING ) ; protocolMarshaller . marshall ( queueReference . getArn ( ) , ARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class SearchExpression { /** * A list of nested filter objects .
* @ param nestedFilters
* A list of nested filter objects . */
public void setNestedFilters ( java . util . Collection < NestedFilters > nestedFilters ) { } } | if ( nestedFilters == null ) { this . nestedFilters = null ; return ; } this . nestedFilters = new java . util . ArrayList < NestedFilters > ( nestedFilters ) ; |
public class Value { /** * Tests if this value is older than the specified SetElement .
* @ param other the value to be compared
* @ return true if this value is older than other */
public boolean isOlderThan ( Value other ) { } } | if ( other == null ) { return true ; } return this . timestamp . isOlderThan ( other . timestamp ) ; |
public class DocBookUtilities { /** * Finds the first title element in a DocBook XML file .
* @ param doc The docbook xml transformed into a DOM Document to find the title from .
* @ return The first title found in the xml . */
public static String findTitle ( final Document doc ) { } } | if ( doc == null ) return null ; // loop through the child nodes until the title element is found
final NodeList childNodes = doc . getDocumentElement ( ) . getChildNodes ( ) ; for ( int i = 0 ; i < childNodes . getLength ( ) ; i ++ ) { Node node = childNodes . item ( i ) ; // check if the node is the title and if its parent is the document root element
if ( node . getNodeName ( ) . equals ( TOPIC_ROOT_TITLE_NODE_NAME ) && node . getParentNode ( ) . equals ( doc . getDocumentElement ( ) ) ) { return XMLUtilities . convertNodeToString ( node , false ) ; } } return null ; |
public class GlobusPathMatchingResourcePatternResolver { /** * Returns a substring of the locationPattern from the beginning
* to the first occurrence of * or ?
* If this is unsuccessful , start at current directory . /
* @ param locationPatternString The Ant - Style location pattern .
* @ return A substring of the locationPatternString from the beginning to the first occurrence of a wildcard character */
private String getPathUntilWildcard ( String locationPatternString , boolean defaultToLocaldir ) { } } | String currentLocationPatternString ; int locationPatternStringLength = locationPatternString . length ( ) ; // Find the first occurrence of * or ? , if none , set idx to locationPatternLength
int startIndex , questionMarkIndex ; if ( ( startIndex = locationPatternString . indexOf ( '*' ) ) == - 1 ) startIndex = locationPatternStringLength ; if ( ( questionMarkIndex = locationPatternString . indexOf ( '?' ) ) == - 1 ) questionMarkIndex = locationPatternStringLength ; currentLocationPatternString = locationPatternString . substring ( 0 , Math . min ( startIndex , questionMarkIndex ) ) ; if ( defaultToLocaldir && ! ( new File ( currentLocationPatternString ) . canRead ( ) ) ) currentLocationPatternString = "./" ; return currentLocationPatternString ; |
public class QuerySqlTranslator { /** * Checks for the existence of an operator in a query clause list */
protected static boolean isOperatorFoundInClause ( String operator , List < Object > clause ) { } } | boolean found = false ; // first check for the existence of $ not so that we can find negated operators :
// if we find $ not then recurse with the value associated with it in the query map
for ( Object rawTerm : clause ) { if ( rawTerm instanceof Map ) { Map term = ( Map ) rawTerm ; if ( term . size ( ) == 1 && term . values ( ) . toArray ( ) [ 0 ] instanceof Map ) { Map predicate = ( Map ) term . values ( ) . toArray ( ) [ 0 ] ; if ( predicate . get ( NOT ) != null && predicate . get ( NOT ) instanceof Map ) { return isOperatorFoundInClause ( operator , Collections . < Object > singletonList ( predicate ) ) ; } } } } // if we didn ' t find $ not then look directly for the operator
for ( Object rawTerm : clause ) { if ( rawTerm instanceof Map ) { Map term = ( Map ) rawTerm ; if ( term . size ( ) == 1 && term . values ( ) . toArray ( ) [ 0 ] instanceof Map ) { Map predicate = ( Map ) term . values ( ) . toArray ( ) [ 0 ] ; if ( predicate . get ( operator ) != null ) { found = true ; break ; } } } } return found ; |
public class CmsTool { /** * Returns the necessary html code for a link to this tool . < p >
* @ param wp the jsp page to write the code to
* @ return html code */
public String buttonHtml ( CmsWorkplace wp ) { } } | if ( ! m_handler . isVisible ( wp ) ) { return "" ; } String link = CmsToolManager . linkForToolPath ( wp . getJsp ( ) , getHandler ( ) . getPath ( ) , getHandler ( ) . getParameters ( wp ) ) ; String onClic = "openPage('" + link + "');" ; return A_CmsHtmlIconButton . defaultButtonHtml ( CmsHtmlIconButtonStyleEnum . BIG_ICON_TEXT , getId ( ) , m_handler . getShortName ( ) , m_handler . isEnabled ( wp ) ? m_handler . getHelpText ( ) : m_handler . getDisabledHelpText ( ) , m_handler . isEnabled ( wp ) , m_handler . getIconPath ( ) , m_handler . getConfirmationMessage ( ) , onClic ) ; |
public class BootstrapMojo { /** * Interactively ask the user which sql conf should be used . */
private void chooseSampleSqlAndConf ( BufferedReader br ) throws IOException { } } | while ( true ) { printInstruction ( "Which sample SQL schema would you like to use?" ) ; for ( int i = 0 ; i < getSqlConfInfos ( ) . size ( ) ; i ++ ) { System . out . println ( " " + ( i + 1 ) + ") " + getSqlConfInfos ( ) . get ( i ) . getName ( ) ) ; System . out . println ( " " + getSqlConfInfos ( ) . get ( i ) . getDescription ( ) ) ; if ( getSqlConfInfos ( ) . get ( i ) . getDescription2 ( ) != null ) { System . out . println ( " " + getSqlConfInfos ( ) . get ( i ) . getDescription2 ( ) ) ; } System . out . println ( "" ) ; } String choice = br . readLine ( ) ; if ( isBlank ( choice ) ) { continue ; } else { try { sqlConfName = getSqlConfInfos ( ) . get ( Integer . parseInt ( choice ) - 1 ) . getName ( ) ; System . out . println ( "OK, using: " + sqlConfName ) ; } catch ( Exception e ) { System . out . println ( "" ) ; continue ; } } break ; } |
public class ArchiveBase { /** * { @ inheritDoc }
* @ see org . jboss . shrinkwrap . api . Archive # add ( java . lang . String , org . jboss . shrinkwrap . api . asset . Asset ) */
@ Override public T add ( final Asset asset , final String target ) throws IllegalArgumentException { } } | // Precondition checks
Validate . notNullOrEmpty ( target , "target must be specified" ) ; Validate . notNull ( asset , "asset must be specified" ) ; // Make a Path from the target
final ArchivePath path = new BasicPath ( target ) ; // Delegate
return this . add ( asset , path ) ; |
public class LifecycleEventHandlers { /** * 懒加载 , 并发安全的 */
public static void loadLifecycleHandlers ( ) { } } | if ( ! loadedLock . get ( ) ) { synchronized ( loadedLock ) { if ( ! loadedLock . get ( ) ) { Set < Class < ? extends LifecycleHandler > > subClasses = Reflection . getNonAbstractSubclasses ( LifecycleHandler . class ) ; for ( Class < ? extends LifecycleHandler > clazz : subClasses ) { if ( clazz . isAnnotationPresent ( OnRequest . class ) ) { private_requestEventHandlers . add ( clazz ) ; LOG . info ( String . format ( "preIssueTokenHandler added {%s}" , clazz ) ) ; } if ( clazz . isAnnotationPresent ( OnResponse . class ) ) { private_responseEventHandlers . add ( clazz ) ; LOG . info ( String . format ( "postIssueTokenHandler added {%s}" , clazz ) ) ; } } Set < Class < ? extends ExceptionEventHandler > > exceptionHandlerClasses = Reflection . getNonAbstractSubclasses ( ExceptionEventHandler . class ) ; for ( Class < ? extends ExceptionEventHandler > clazz : exceptionHandlerClasses ) { if ( clazz . isAnnotationPresent ( OnException . class ) ) { private_exceptionHandlers . add ( clazz ) ; LOG . info ( String . format ( "exceptionHandlers added {%s}" , clazz ) ) ; } } loadedLock . set ( true ) ; } } } |
public class VelocityEngineFactory { /** * Prepare the VelocityEngine instance and return it .
* @ return the VelocityEngine instance
* @ throws IOException if the config file wasn ' t found
* @ throws VelocityException on Velocity initialization failure */
public VelocityEngine createVelocityEngine ( ) throws IOException , VelocityException { } } | VelocityEngine velocityEngine = newVelocityEngine ( ) ; Map < String , Object > props = new HashMap < String , Object > ( ) ; // Load config file if set .
if ( this . configLocation != null ) { if ( logger . isInfoEnabled ( ) ) { logger . info ( "Loading Velocity config from [" + this . configLocation + "]" ) ; } CollectionUtils . mergePropertiesIntoMap ( PropertiesLoaderUtils . loadProperties ( this . configLocation ) , props ) ; } // Merge local properties if set .
if ( ! this . velocityProperties . isEmpty ( ) ) { props . putAll ( this . velocityProperties ) ; } // Set a resource loader path , if required .
if ( this . resourceLoaderPath != null ) { initVelocityResourceLoader ( velocityEngine , this . resourceLoaderPath ) ; } // Log via Commons Logging ?
if ( this . overrideLogging ) { velocityEngine . setProperty ( RuntimeConstants . RUNTIME_LOG_LOGSYSTEM , new CommonsLogLogChute ( ) ) ; } // Apply properties to VelocityEngine .
for ( Map . Entry < String , Object > entry : props . entrySet ( ) ) { velocityEngine . setProperty ( entry . getKey ( ) , entry . getValue ( ) ) ; } postProcessVelocityEngine ( velocityEngine ) ; // Perform actual initialization .
velocityEngine . init ( ) ; return velocityEngine ; |
public class ModeSDecoder { /** * Clean state by removing decoders not used for more than an hour . This happens automatically
* every 1 Mio messages if more than 50000 aircraft are tracked . */
public void gc ( ) { } } | List < Integer > toRemove = new ArrayList < Integer > ( ) ; for ( Integer transponder : decoderData . keySet ( ) ) if ( decoderData . get ( transponder ) . posDec . getLastUsedTime ( ) < latestTimestamp - 3600000 ) toRemove . add ( transponder ) ; for ( Integer transponder : toRemove ) decoderData . remove ( transponder ) ; |
public class ReferenceIndividualGroupService { /** * Returns an < code > IGroupMember < / code > representing either a group or a portal entity , based on
* the < code > EntityIdentifier < / code > , which refers to the UNDERLYING entity for the < code >
* IGroupMember < / code > . */
@ Override public IGroupMember getGroupMember ( EntityIdentifier underlyingEntityIdentifier ) throws GroupsException { } } | return getGroupMember ( underlyingEntityIdentifier . getKey ( ) , underlyingEntityIdentifier . getType ( ) ) ; |
public class Scope { /** * Return the server instance connected to this scope .
* @ return the server instance */
public IServer getServer ( ) { } } | if ( hasParent ( ) ) { final IScope parent = getParent ( ) ; if ( parent instanceof Scope ) { return ( ( Scope ) parent ) . getServer ( ) ; } else if ( parent instanceof IGlobalScope ) { return ( ( IGlobalScope ) parent ) . getServer ( ) ; } } return null ; |
public class AWSGlueClient { /** * Retrieves a list of connection definitions from the Data Catalog .
* @ param getConnectionsRequest
* @ return Result of the GetConnections operation returned by the service .
* @ throws EntityNotFoundException
* A specified entity does not exist
* @ throws OperationTimeoutException
* The operation timed out .
* @ throws InvalidInputException
* The input provided was not valid .
* @ throws GlueEncryptionException
* An encryption operation failed .
* @ sample AWSGlue . GetConnections
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / glue - 2017-03-31 / GetConnections " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public GetConnectionsResult getConnections ( GetConnectionsRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeGetConnections ( request ) ; |
public class Interface { /** * Use this API to update Interface resources . */
public static base_responses update ( nitro_service client , Interface resources [ ] ) throws Exception { } } | base_responses result = null ; if ( resources != null && resources . length > 0 ) { Interface updateresources [ ] = new Interface [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { updateresources [ i ] = new Interface ( ) ; updateresources [ i ] . id = resources [ i ] . id ; updateresources [ i ] . speed = resources [ i ] . speed ; updateresources [ i ] . duplex = resources [ i ] . duplex ; updateresources [ i ] . flowctl = resources [ i ] . flowctl ; updateresources [ i ] . autoneg = resources [ i ] . autoneg ; updateresources [ i ] . hamonitor = resources [ i ] . hamonitor ; updateresources [ i ] . tagall = resources [ i ] . tagall ; updateresources [ i ] . trunk = resources [ i ] . trunk ; updateresources [ i ] . lacpmode = resources [ i ] . lacpmode ; updateresources [ i ] . lacpkey = resources [ i ] . lacpkey ; updateresources [ i ] . lagtype = resources [ i ] . lagtype ; updateresources [ i ] . lacppriority = resources [ i ] . lacppriority ; updateresources [ i ] . lacptimeout = resources [ i ] . lacptimeout ; updateresources [ i ] . ifalias = resources [ i ] . ifalias ; updateresources [ i ] . throughput = resources [ i ] . throughput ; updateresources [ i ] . bandwidthhigh = resources [ i ] . bandwidthhigh ; updateresources [ i ] . bandwidthnormal = resources [ i ] . bandwidthnormal ; } result = update_bulk_request ( client , updateresources ) ; } return result ; |
public class KAMStoreImpl { /** * { @ inheritDoc } */
@ Override public int coalesceKamEdges ( KamInfo info ) { } } | try { KAMUpdateDao updateDao = kamUpdateDao ( info ) ; return updateDao . coalesceKamEdges ( ) ; } catch ( SQLException e ) { final String msg = "error coalescing edges" ; throw new KAMStoreException ( msg , e ) ; } |
public class TagCrawler { /** * Method to get { @ link TagHandler } by tag , can be overridden to change the logic of handler searching
* @ param tag
* - tag to be handled
* @ return - this for chaining */
public TagHandler getHandler ( Tag tag ) { } } | if ( handlers . containsKey ( tag . getName ( ) ) ) { return handlers . get ( tag . getName ( ) ) ; } return null ; |
public class JsApiHdrsImpl { /** * Get the contents of the ApiMessageId field from the message header .
* Javadoc description supplied by JsApiMessage interface . */
public final String getApiMessageId ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getApiMessageId" ) ; String value = null ; /* The ApiMessageId is held as hexBinary & so we need to convert to an */
/* ID : xxxx format . */
byte [ ] binValue = ( byte [ ] ) getApi ( ) . getField ( JsApiAccess . MESSAGEID ) ; if ( binValue != null ) { /* It ' ll be more economical to get the length right immediately */
StringBuffer sbuf = new StringBuffer ( ( binValue . length * 2 ) + 3 ) ; /* Insert the ID : then add on the binary value as a hex string */
sbuf . append ( ID_STRING ) ; HexString . binToHex ( binValue , 0 , binValue . length , sbuf ) ; /* Return the String representation */
value = sbuf . toString ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getApiMessageId" , value ) ; return value ; |
public class VodClient { /** * get media source download url .
* @ param mediaId The unique ID for each media resource
* @ param expiredInSeconds The expire time
* @ return */
public GetMediaSourceDownloadResponse getMediaSourceDownload ( String mediaId , long expiredInSeconds ) { } } | GetMediaSourceDownloadRequest request = new GetMediaSourceDownloadRequest ( ) . withMediaId ( mediaId ) . withExpiredInSeconds ( expiredInSeconds ) ; return getMediaSourceDownload ( request ) ; |
public class PlainTimestamp { /** * / * [ deutsch ]
* < p > Definiert eine nat & uuml ; rliche Ordnung , die auf der zeitlichen
* Position basiert . < / p >
* < p > Der Vergleich ist konsistent mit { @ code equals ( ) } . < / p >
* @ see # isBefore ( PlainTimestamp )
* @ see # isAfter ( PlainTimestamp ) */
@ Override public int compareTo ( PlainTimestamp timestamp ) { } } | if ( this . date . isAfter ( timestamp . date ) ) { return 1 ; } else if ( this . date . isBefore ( timestamp . date ) ) { return - 1 ; } return this . time . compareTo ( timestamp . time ) ; |
public class CryptoUtils { /** * Returns true if it ' s a password match , that is , if the hashed clear password equals the given hash .
* @ param hashedPswdAndSalt the hashed password + { @ link # PASSWORD _ SEP } + salt , as returned by
* { @ link # hashPassword ( String ) }
* @ param clearPswd the password that we ' re trying to match , in clear
* @ return if the password matches */
public static boolean matchPassword ( String hashedPswdAndSalt , String clearPswd ) { } } | if ( StringUtils . isNotEmpty ( hashedPswdAndSalt ) && StringUtils . isNotEmpty ( clearPswd ) ) { int idxOfSep = hashedPswdAndSalt . indexOf ( PASSWORD_SEP ) ; String storedHash = hashedPswdAndSalt . substring ( 0 , idxOfSep ) ; String salt = hashedPswdAndSalt . substring ( idxOfSep + 1 ) ; SimpleDigest digest = new SimpleDigest ( ) ; digest . setBase64Salt ( salt ) ; return storedHash . equals ( digest . digestBase64 ( clearPswd ) ) ; } else if ( hashedPswdAndSalt == null && clearPswd == null ) { return true ; } else if ( hashedPswdAndSalt . isEmpty ( ) && clearPswd . isEmpty ( ) ) { return true ; } else { return false ; } |
public class FastAdapterDiffUtil { /** * This method will compute a { @ link androidx . recyclerview . widget . DiffUtil . DiffResult } based on the given adapter , and the list of new items .
* It automatically collapses all expandables ( if enabled ) as they are not supported by the diff util ,
* pre sort the items based on the comparator if available ,
* map the new item types for the FastAdapter then calculates the { @ link androidx . recyclerview . widget . DiffUtil . DiffResult } using the { @ link DiffUtil } .
* As the last step it will replace the items inside the adapter with the new set of items provided .
* @ param adapter the adapter containing the current items .
* @ param items the new set of items we want to put into the adapter
* @ param callback the callback used to implement the required checks to identify changes of items .
* @ param detectMoves configuration for the { @ link DiffUtil # calculateDiff ( DiffUtil . Callback , boolean ) } method
* @ param < A > The adapter type , whereas A extends { @ link ModelAdapter }
* @ param < Model > The model type we work with
* @ param < Item > The item type kept in the adapter
* @ return the { @ link androidx . recyclerview . widget . DiffUtil . DiffResult } computed . */
public static < A extends ModelAdapter < Model , Item > , Model , Item extends IItem > DiffUtil . DiffResult calculateDiff ( final A adapter , final List < Item > items , final DiffCallback < Item > callback , final boolean detectMoves ) { } } | if ( adapter . isUseIdDistributor ( ) ) { adapter . getIdDistributor ( ) . checkIds ( items ) ; } // The FastAdapterDiffUtil does not handle expanded items . Call collapse if possible
collapseIfPossible ( adapter . getFastAdapter ( ) ) ; // if we have a comparator then sort
if ( adapter . getItemList ( ) instanceof ComparableItemListImpl ) { Collections . sort ( items , ( ( ComparableItemListImpl ) adapter . getItemList ( ) ) . getComparator ( ) ) ; } // map the types
adapter . mapPossibleTypes ( items ) ; // remember the old items
final List < Item > adapterItems = adapter . getAdapterItems ( ) ; final List < Item > oldItems = new ArrayList < > ( adapterItems ) ; // pass in the oldItem list copy as we will update the one in the adapter itself
DiffUtil . DiffResult result = DiffUtil . calculateDiff ( new FastAdapterCallback < > ( oldItems , items , callback ) , detectMoves ) ; // make sure the new items list is not a reference of the already mItems list
if ( items != adapterItems ) { // remove all previous items
if ( ! adapterItems . isEmpty ( ) ) { adapterItems . clear ( ) ; } // add all new items to the list
adapterItems . addAll ( items ) ; } return result ; |
public class ListBackupSelectionsResult { /** * An array of backup selection list items containing metadata about each resource in the list .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setBackupSelectionsList ( java . util . Collection ) } or { @ link # withBackupSelectionsList ( java . util . Collection ) }
* if you want to override the existing values .
* @ param backupSelectionsList
* An array of backup selection list items containing metadata about each resource in the list .
* @ return Returns a reference to this object so that method calls can be chained together . */
public ListBackupSelectionsResult withBackupSelectionsList ( BackupSelectionsListMember ... backupSelectionsList ) { } } | if ( this . backupSelectionsList == null ) { setBackupSelectionsList ( new java . util . ArrayList < BackupSelectionsListMember > ( backupSelectionsList . length ) ) ; } for ( BackupSelectionsListMember ele : backupSelectionsList ) { this . backupSelectionsList . add ( ele ) ; } return this ; |
public class InternalService { /** * Returns observable to add a list of participants to a conversation .
* @ param conversationId ID of a conversation to update .
* @ param participants New conversation participants details .
* @ return Observable to add participants to a conversation . */
public Observable < ComapiResult < Void > > addParticipants ( @ NonNull final String conversationId , @ NonNull final List < Participant > participants ) { } } | final String token = getToken ( ) ; if ( sessionController . isCreatingSession ( ) ) { return getTaskQueue ( ) . queueAddParticipants ( conversationId , participants ) ; } else if ( TextUtils . isEmpty ( token ) ) { return Observable . error ( getSessionStateErrorDescription ( ) ) ; } else { return doAddParticipants ( token , conversationId , participants ) ; } |
public class Resty { /** * Create a content object from a JSON object . Use this to POST the content to a URL .
* @ param someJson
* the JSON object to use
* @ return the content to send */
public static Content content ( JSONObject someJson ) { } } | Content c = null ; try { c = new Content ( "application/json; charset=UTF-8" , someJson . toString ( ) . getBytes ( "UTF-8" ) ) ; } catch ( UnsupportedEncodingException e ) { /* UTF - 8 is never unsupported */
} return c ; |
public class Rule { /** * Gets the ruleType value for this Rule .
* @ return ruleType * Rule type is used to determine how to group rule item groups
* and rule items inside rule item
* group . Currently , conjunctive normal form ( AND of
* ORs ) is only supported for
* ExpressionRuleUserList . If no ruleType is specified ,
* it will be treated as disjunctive normal
* form ( OR of ANDs ) , namely rule item groups are ORed
* together and inside each rule item group ,
* rule items are ANDed together . */
public com . google . api . ads . adwords . axis . v201809 . rm . UserListRuleTypeEnumsEnum getRuleType ( ) { } } | return ruleType ; |
public class Matrix { /** * Alters the matrix < i > A < / i > so that it contains the result of < i > A < / i >
* times a sparse matrix represented by only its diagonal values or
* < i > A = A * diag ( < b > b < / b > ) < / i > . This is equivalent to the code
* < code >
* A = A { @ link # multiply ( jsat . linear . Matrix ) . multiply }
* ( { @ link # diag ( jsat . linear . Vec ) diag } ( b ) )
* < / code >
* @ param A the square matrix to update
* @ param b the diagonal value vector */
public static void diagMult ( Matrix A , Vec b ) { } } | if ( A . cols ( ) != b . length ( ) ) throw new ArithmeticException ( "Could not multiply, matrix dimensions must agree" ) ; for ( int i = 0 ; i < A . rows ( ) ; i ++ ) RowColumnOps . multRow ( A , i , b ) ; |
public class ProjectApi { /** * Get a Stream of projects that were forked from the specified project .
* < pre > < code > GET / projects / : id / forks < / code > < / pre >
* @ param projectIdOrPath projectIdOrPath the project in the form of an Integer ( ID ) , String ( path ) , or Project instance , required
* @ return a Stream of forked projects
* @ throws GitLabApiException if any exception occurs */
public Stream < Project > getForksStream ( Object projectIdOrPath ) throws GitLabApiException { } } | return ( getForks ( projectIdOrPath , getDefaultPerPage ( ) ) . stream ( ) ) ; |
public class Jenkins { /** * Reloads the configuration . */
@ RequirePOST public synchronized HttpResponse doReload ( ) throws IOException { } } | checkPermission ( ADMINISTER ) ; LOGGER . log ( Level . WARNING , "Reloading Jenkins as requested by {0}" , getAuthentication ( ) . getName ( ) ) ; // engage " loading . . . " UI and then run the actual task in a separate thread
WebApp . get ( servletContext ) . setApp ( new HudsonIsLoading ( ) ) ; new Thread ( "Jenkins config reload thread" ) { @ Override public void run ( ) { try { ACL . impersonate ( ACL . SYSTEM ) ; reload ( ) ; } catch ( Exception e ) { LOGGER . log ( SEVERE , "Failed to reload Jenkins config" , e ) ; new JenkinsReloadFailed ( e ) . publish ( servletContext , root ) ; } } } . start ( ) ; return HttpResponses . redirectViaContextPath ( "/" ) ; |
public class DataStream { /** * Extracts a timestamp from an element and assigns it as the internal timestamp of that element .
* The internal timestamps are , for example , used to to event - time window operations .
* < p > If you know that the timestamps are strictly increasing you can use an
* { @ link AscendingTimestampExtractor } . Otherwise ,
* you should provide a { @ link TimestampExtractor } that also implements
* { @ link TimestampExtractor # getCurrentWatermark ( ) } to keep track of watermarks .
* @ param extractor The TimestampExtractor that is called for each element of the DataStream .
* @ deprecated Please use { @ link # assignTimestampsAndWatermarks ( AssignerWithPeriodicWatermarks ) }
* of { @ link # assignTimestampsAndWatermarks ( AssignerWithPunctuatedWatermarks ) }
* instead .
* @ see # assignTimestampsAndWatermarks ( AssignerWithPeriodicWatermarks )
* @ see # assignTimestampsAndWatermarks ( AssignerWithPunctuatedWatermarks ) */
@ Deprecated public SingleOutputStreamOperator < T > assignTimestamps ( TimestampExtractor < T > extractor ) { } } | // match parallelism to input , otherwise dop = 1 sources could lead to some strange
// behaviour : the watermark will creep along very slowly because the elements
// from the source go to each extraction operator round robin .
int inputParallelism = getTransformation ( ) . getParallelism ( ) ; ExtractTimestampsOperator < T > operator = new ExtractTimestampsOperator < > ( clean ( extractor ) ) ; return transform ( "ExtractTimestamps" , getTransformation ( ) . getOutputType ( ) , operator ) . setParallelism ( inputParallelism ) ; |
public class StringFieldBuilder { /** * Add a sub - field . A { @ code SortedMap } is required for consistency of the index settings hash . */
private T addSubField ( String fieldName , SortedMap < String , String > fieldDefinition ) { } } | subFields . put ( fieldName , fieldDefinition ) ; return castThis ( ) ; |
public class PathNormalizer { /** * converts a generation path ( such as jar : / some / path / file ) into a request
* path that the request handler can understand and process .
* @ param path
* the path
* @ param registry
* the generator registry
* @ param randomParam
* the random parameter
* @ return the generation path */
public static String createGenerationPath ( String path , GeneratorRegistry registry , String randomParam ) { } } | String requestPath = null ; try { requestPath = registry . getDebugModeGenerationPath ( path ) ; if ( randomParam != null ) { requestPath += "?" + randomParam + "&" ; } else { requestPath += "?" ; } requestPath += JawrRequestHandler . GENERATION_PARAM + "=" + URLEncoder . encode ( path , "UTF-8" ) ; } catch ( UnsupportedEncodingException neverHappens ) { /* URLEncoder : how not to use checked exceptions . . . */
throw new JawrLinkRenderingException ( "Something went unexpectedly wrong while encoding a URL for a generator. " , neverHappens ) ; } return requestPath ; |
public class CodeBuilderUtil { /** * Defines a Storable prepare method , which assumes that a support field
* exists and a single - argument constructor exists which accepts a support
* instance .
* @ param cf file to which to add the prepare method
* @ since 1.2 */
public static void definePrepareMethod ( ClassFile cf , Class storableClass , TypeDesc supportCtorType ) { } } | definePrepareMethod ( cf , storableClass , supportCtorType , StorableGenerator . SUPPORT_FIELD_NAME , TypeDesc . forClass ( TriggerSupport . class ) ) ; |
public class LanguageResourceService { /** * Merges the given JSON objects . Any leaf node in overlay will overwrite
* the corresponding path in original .
* @ param original
* The original JSON object to which changes should be applied .
* @ param overlay
* The JSON object containing changes that should be applied .
* @ return
* The newly constructed JSON object that is the result of merging
* original and overlay . */
private JsonNode mergeTranslations ( JsonNode original , JsonNode overlay ) { } } | // If we are at a leaf node , the result of merging is simply the overlay
if ( ! overlay . isObject ( ) || original == null ) return overlay ; // Create mutable copy of original
ObjectNode newNode = JsonNodeFactory . instance . objectNode ( ) ; Iterator < String > fieldNames = original . getFieldNames ( ) ; while ( fieldNames . hasNext ( ) ) { String fieldName = fieldNames . next ( ) ; newNode . put ( fieldName , original . get ( fieldName ) ) ; } // Merge each field
fieldNames = overlay . getFieldNames ( ) ; while ( fieldNames . hasNext ( ) ) { String fieldName = fieldNames . next ( ) ; newNode . put ( fieldName , mergeTranslations ( original . get ( fieldName ) , overlay . get ( fieldName ) ) ) ; } return newNode ; |
public class QueryParserKraken { /** * Parses the references clause . */
public void parseReferences ( ArrayList < String > name ) { } } | String foreignTable = parseIdentifier ( ) ; Token token = scanToken ( ) ; ArrayList < String > foreignColumns = new ArrayList < String > ( ) ; if ( token == Token . LPAREN ) { _token = token ; foreignColumns = parseColumnNames ( ) ; } else { _token = token ; } |
public class CreateDirectoryConfigRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CreateDirectoryConfigRequest createDirectoryConfigRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( createDirectoryConfigRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createDirectoryConfigRequest . getDirectoryName ( ) , DIRECTORYNAME_BINDING ) ; protocolMarshaller . marshall ( createDirectoryConfigRequest . getOrganizationalUnitDistinguishedNames ( ) , ORGANIZATIONALUNITDISTINGUISHEDNAMES_BINDING ) ; protocolMarshaller . marshall ( createDirectoryConfigRequest . getServiceAccountCredentials ( ) , SERVICEACCOUNTCREDENTIALS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class ExcelUtils { /** * 基于模板 、 注解导出 { @ code Map [ String , List [ ? ] ] } 类型数据
* 模板定制详见定制说明
* @ param templatePath Excel模板路径
* @ param data 待导出的 { @ code Map < String , List < ? > > } 类型数据
* @ param extendMap 扩展内容Map数据 ( 具体就是key匹配替换模板 # key内容 , 详情请查阅Excel模板定制方法 )
* @ param clazz 映射对象Class
* @ param targetPath 生成的Excel输出全路径
* @ throws Excel4JException 异常
* @ author Crab2Died */
public void exportMap2Excel ( String templatePath , Map < String , List < ? > > data , Map < String , String > extendMap , Class clazz , String targetPath ) throws Excel4JException { } } | try ( SheetTemplate sheetTemplate = exportExcelByMapHandler ( templatePath , 0 , data , extendMap , clazz , true ) ) { sheetTemplate . write2File ( targetPath ) ; } catch ( IOException e ) { throw new Excel4JException ( e ) ; } |
public class Collectors { /** * Returns a { @ code Collector } that produces the maximal element according
* to a given { @ code Comparator } , described as an { @ code Optional < T > } .
* @ implSpec
* This produces a result equivalent to :
* < pre > { @ code
* reducing ( BinaryOperator . maxBy ( comparator ) )
* } < / pre >
* @ param < T > the type of the input elements
* @ param comparator a { @ code Comparator } for comparing elements
* @ return a { @ code Collector } that produces the maximal value */
public static < T > Collector < T , ? , Optional < T > > maxBy ( Comparator < ? super T > comparator ) { } } | return reducing ( BinaryOperator . maxBy ( comparator ) ) ; |
public class MutableArray { /** * Adds an object to the end of the array .
* @ param value the object
* @ return The self object */
@ NonNull @ Override public MutableArray addValue ( Object value ) { } } | synchronized ( lock ) { internalArray . append ( Fleece . toCBLObject ( value ) ) ; return this ; } |
public class ISUPMessageImpl { public void addParameter ( ISUPParameter param ) throws ParameterException { } } | if ( param == null ) { throw new IllegalArgumentException ( "Argument must not be null" ) ; } int paramCode = param . getCode ( ) ; if ( this . mandatoryCodes . contains ( paramCode ) ) { int index = this . mandatoryCodeToIndex . get ( paramCode ) ; this . f_Parameters . put ( index , ( AbstractISUPParameter ) param ) ; return ; } if ( this . mandatoryVariableCodes . contains ( paramCode ) ) { int index = this . mandatoryVariableCodeToIndex . get ( paramCode ) ; this . v_Parameters . put ( index , ( AbstractISUPParameter ) param ) ; return ; } if ( this . optionalCodes . contains ( paramCode ) ) { int index = this . optionalCodeToIndex . get ( paramCode ) ; this . o_Parameters . put ( index , ( AbstractISUPParameter ) param ) ; return ; } throw new ParameterException ( "Parameter with code: " + paramCode + " is not defined in any type: mandatory, mandatory variable or optional" ) ; |
public class HttpResponse { /** * Returns the _ first _ cookie matching < tt > cookieName < / tt > . Objects returned
* by this method are of the class burp . impl . Cookie which implements the
* burp . ICookie interface .
* @ param cookieName The name of the cookie to return
* @ return The cookie , or null if there is no cookie by that name in the response . */
public ICookie getCookie ( String cookieName ) { } } | for ( ICookie cookie : cookies ) { if ( cookie . getName ( ) . equals ( cookieName ) ) { return cookie ; } } return null ; |
public class RSAUtils { /** * Generate a random RSA keypair .
* @ param numBits
* key ' s length in bits , should be power of 2)
* @ return
* @ throws NoSuchAlgorithmException */
public static KeyPair generateKeys ( int numBits ) throws NoSuchAlgorithmException { } } | int numBitsPow2 = 1 ; while ( numBitsPow2 < numBits ) { numBitsPow2 <<= 1 ; } KeyPairGenerator kpg = KeyPairGenerator . getInstance ( CIPHER_ALGORITHM ) ; kpg . initialize ( numBitsPow2 , SECURE_RNG ) ; KeyPair keyPair = kpg . generateKeyPair ( ) ; return keyPair ; |
public class AzureAffinityGroupSupport { /** * Lists all of the affinity groups visible to the current account
* @ param options Filtering options for the list
* @ return All the affinity groups visible to current account
* @ throws org . dasein . cloud . InternalException an error occurred within the Dasein Cloud implementation listing the affinity groups
* @ throws org . dasein . cloud . CloudException an error occurred within the service provider listing the affinity groups */
@ Nonnull @ Override public Iterable < AffinityGroup > list ( @ Nonnull AffinityGroupFilterOptions options ) throws InternalException , CloudException { } } | AzureMethod method = new AzureMethod ( this . provider ) ; final AffinityGroupsModel affinityGroupsModel = method . get ( AffinityGroupsModel . class , RESOURCE_AFFINITYGROUPS ) ; ArrayList < AffinityGroup > affinityGroups = new ArrayList < AffinityGroup > ( ) ; for ( AffinityGroupModel affinityGroupModel : affinityGroupsModel . getAffinityGroups ( ) ) { // TODO see if name is enough to be used as an id
AffinityGroup affinityGroup = AffinityGroup . getInstance ( affinityGroupModel . getName ( ) , affinityGroupModel . getName ( ) , affinityGroupModel . getDescription ( ) , affinityGroupModel . getLocation ( ) , null ) ; if ( options != null && options . matches ( affinityGroup ) ) affinityGroups . add ( affinityGroup ) ; } return affinityGroups ; |
public class AutoClientBundleGenerator { /** * Filter file set , preferring * . mp3 files where alternatives exist . */
private HashSet < Resource > preferMp3 ( HashSet < Resource > files ) { } } | HashMap < String , Resource > map = new HashMap < String , Resource > ( ) ; for ( Resource file : files ) { String path = stripExtension ( file . getPath ( ) ) ; if ( file . getPath ( ) . endsWith ( ".mp3" ) || ! map . containsKey ( path ) ) { map . put ( path , file ) ; } } return new HashSet < Resource > ( map . values ( ) ) ; |
public class BinaryType { /** * Get the binary type for the given value type .
* @ param type The type to check .
* @ return The binary type ID . */
public static byte forType ( @ Nonnull PType type ) { } } | switch ( type ) { case VOID : return VOID ; case BOOL : return BOOL ; case BYTE : return BYTE ; case I16 : return I16 ; case I32 : return I32 ; case I64 : return I64 ; case DOUBLE : return DOUBLE ; case STRING : return STRING ; case BINARY : return STRING ; case ENUM : return I32 ; case MAP : return MAP ; case SET : return SET ; case LIST : return LIST ; case MESSAGE : return STRUCT ; default : throw new IllegalArgumentException ( "Unknown binary type for " + type . toString ( ) ) ; } |
public class DefaultCommunicationClientImpl { /** * 直接提交一个异步任务 */
public Future submit ( Callable call ) { } } | Assert . notNull ( this . factory , "No factory specified" ) ; return executor . submit ( call ) ; |
public class VerificationConditionGenerator { /** * Translate a WhileyFile into a WyalFile which contains the verification
* conditions necessary to establish that all functions and methods in the
* WhileyFile meet their specifications , and that no array - out - of - bounds or
* division - by - zero exceptions are possible ( amongst other things ) .
* @ param wyilFile
* The input file to be translated
* @ return */
public WyalFile translate ( WyilFile wyilFile ) { } } | for ( WyilFile . Decl . Unit unit : wyilFile . getModule ( ) . getUnits ( ) ) { translate ( unit ) ; } for ( WyilFile . Decl . Unit unit : wyilFile . getModule ( ) . getExterns ( ) ) { translate ( unit ) ; } return wyalFile ; |
public class FragmentBuilder { /** * This method determines if the fragment is complete
* with the exception of ignored nodes .
* @ return Whether the fragment is complete with the exception of
* ignored nodes */
public boolean isCompleteExceptIgnoredNodes ( ) { } } | synchronized ( nodeStack ) { if ( nodeStack . isEmpty ( ) && retainedNodes . isEmpty ( ) ) { return true ; } else { // Check that remaining nodes can be ignored
for ( int i = 0 ; i < nodeStack . size ( ) ; i ++ ) { if ( ! ignoredNodes . contains ( nodeStack . get ( i ) ) ) { return false ; } } for ( int i = 0 ; i < retainedNodes . size ( ) ; i ++ ) { if ( ! ignoredNodes . contains ( retainedNodes . get ( i ) ) ) { return false ; } } return true ; } } |
public class AliasedDiscoveryConfigUtils { /** * Checks whether all aliased discovery configs have the tag { @ literal < use - public - ip > true < / use - public - ip } .
* Note that if no config is enabled , then the method returns { @ literal false } . */
public static boolean allUsePublicAddress ( List < AliasedDiscoveryConfig < ? > > configs ) { } } | boolean atLeastOneEnabled = false ; for ( AliasedDiscoveryConfig config : configs ) { if ( config . isEnabled ( ) ) { atLeastOneEnabled = true ; if ( ! config . isUsePublicIp ( ) ) { return false ; } } } return atLeastOneEnabled ; |
public class Node { /** * uses default excludes */
public List < T > find ( String ... includes ) throws IOException { } } | return find ( getWorld ( ) . filter ( ) . include ( includes ) ) ; |
public class Util { /** * Returns the total item capacity of an updatable , non - compact combined buffer
* given < i > k < / i > and < i > n < / i > . If total levels = 0 , this returns the ceiling power of 2
* size for the base buffer or the MIN _ BASE _ BUF _ SIZE , whichever is larger .
* @ param k sketch parameter . This determines the accuracy of the sketch and the
* size of the updatable data structure , which is a function of < i > k < / i > and < i > n < / i > .
* @ param n The number of items in the input stream
* @ return the current item capacity of the combined buffer */
static int computeCombinedBufferItemCapacity ( final int k , final long n ) { } } | final int totLevels = computeNumLevelsNeeded ( k , n ) ; if ( totLevels == 0 ) { final int bbItems = computeBaseBufferItems ( k , n ) ; return Math . max ( 2 * DoublesSketch . MIN_K , ceilingPowerOf2 ( bbItems ) ) ; } return ( 2 + totLevels ) * k ; |
public class QrPose3DUtils { /** * Specifies PNP parameters for a single feature
* @ param which Landmark ' s index
* @ param row row in the QR code ' s grid coordinate system
* @ param col column in the QR code ' s grid coordinate system
* @ param N width of grid
* @ param pixel observed pixel coordinate of feature */
private void setPair ( int which , int row , int col , int N , Point2D_F64 pixel ) { } } | set3D ( row , col , N , point23 . get ( which ) . location ) ; pixelToNorm . compute ( pixel . x , pixel . y , point23 . get ( which ) . observation ) ; |
public class JsonRuntimeReporterHelper { /** * Provides a JSON object representing the counts of tests passed , failed , skipped and running .
* @ param testObjects
* Array of the current tests as a { @ link JsonArray } .
* @ return A { @ link JsonObject } with counts for various test results . */
private JsonObject getReportSummaryCounts ( JsonArray testObjects ) { } } | logger . entering ( testObjects ) ; int runningCount = 0 ; int skippedCount = 0 ; int passedCount = 0 ; int failedCount = 0 ; String result ; for ( JsonElement test : testObjects ) { result = test . getAsJsonObject ( ) . get ( "status" ) . getAsString ( ) ; switch ( result ) { case "Running" : runningCount += 1 ; break ; case "Passed" : passedCount += 1 ; break ; case "Failed" : failedCount += 1 ; break ; case "Skipped" : skippedCount += 1 ; break ; default : logger . warning ( "Found invalid status of the test being run. Status: " + result ) ; } } JsonObject testSummary = new JsonObject ( ) ; if ( 0 < runningCount ) { testSummary . addProperty ( "running" , runningCount ) ; } testSummary . addProperty ( "passed" , passedCount ) ; testSummary . addProperty ( "failed" , failedCount ) ; testSummary . addProperty ( "skipped" , skippedCount ) ; logger . exiting ( testSummary ) ; return testSummary ; |
public class QueryExecutor { /** * Parse query and return a string query that will be passed to prepared
* statement ( substitute parameter with ' ? ' char ) . */
private String createQueryString ( ) { } } | QueryChunk [ ] chunks = query . getChunks ( ) ; if ( ( chunks == null ) || ( chunks . length == 0 ) ) { // no query chunks
return "" ; } StringBuffer sb = new StringBuffer ( ) ; QueryChunk chunk = null ; int position = 1 ; for ( int i = 0 ; i < chunks . length ; i ++ ) { chunk = chunks [ i ] ; // System . out . println ( " chunk = " + chunk ) ;
switch ( chunk . getType ( ) ) { case QueryChunk . PARAMETER_TYPE : { position ++ ; String paramName = chunk . getText ( ) ; QueryParameter param = parameters . get ( paramName ) ; if ( QueryParameter . MULTIPLE_SELECTION . equals ( param . getSelection ( ) ) ) { if ( QueryUtil . isProcedureCall ( query . getText ( ) ) ) { sb . append ( "?" ) ; } else { Object [ ] paramValue = ( Object [ ] ) parameterValues . get ( paramName ) ; sb . append ( '(' ) ; for ( int j = 0 ; j < paramValue . length ; j ++ ) { if ( j > 0 ) { sb . append ( ',' ) ; } sb . append ( '?' ) ; } sb . append ( ')' ) ; } } else { sb . append ( "?" ) ; } break ; } case QueryChunk . TEXT_TYPE : if ( chunk . getText ( ) . contains ( "?" ) ) { outputParameterPosition = position ; } default : { sb . append ( chunk . getText ( ) ) ; break ; } } } return sb . toString ( ) ; |
public class AWSIotClient { /** * Updates supported fields of the specified job .
* @ param updateJobRequest
* @ return Result of the UpdateJob operation returned by the service .
* @ throws InvalidRequestException
* The request is not valid .
* @ throws ResourceNotFoundException
* The specified resource does not exist .
* @ throws ThrottlingException
* The rate exceeds the limit .
* @ throws ServiceUnavailableException
* The service is temporarily unavailable .
* @ sample AWSIot . UpdateJob */
@ Override public UpdateJobResult updateJob ( UpdateJobRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeUpdateJob ( request ) ; |
public class RolesInner { /** * Create or update a role .
* @ param deviceName The device name .
* @ param name The role name .
* @ param resourceGroupName The resource group name .
* @ param role The role properties .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the RoleInner object */
public Observable < RoleInner > beginCreateOrUpdateAsync ( String deviceName , String name , String resourceGroupName , RoleInner role ) { } } | return beginCreateOrUpdateWithServiceResponseAsync ( deviceName , name , resourceGroupName , role ) . map ( new Func1 < ServiceResponse < RoleInner > , RoleInner > ( ) { @ Override public RoleInner call ( ServiceResponse < RoleInner > response ) { return response . body ( ) ; } } ) ; |
public class BELScriptWalker { /** * BELScriptWalker . g : 121:1 : set _ document : ( ' SET ' dkt = DOCUMENT _ KEYWORD ) prop = document _ property ' = ' ( qv = QUOTED _ VALUE | oi = OBJECT _ IDENT ) ; */
public final BELScriptWalker . set_document_return set_document ( ) throws RecognitionException { } } | BELScriptWalker . set_document_return retval = new BELScriptWalker . set_document_return ( ) ; retval . start = input . LT ( 1 ) ; CommonTree root_0 = null ; CommonTree _first_0 = null ; CommonTree _last = null ; CommonTree dkt = null ; CommonTree qv = null ; CommonTree oi = null ; CommonTree string_literal13 = null ; CommonTree char_literal14 = null ; BELScriptWalker . document_property_return prop = null ; CommonTree dkt_tree = null ; CommonTree qv_tree = null ; CommonTree oi_tree = null ; CommonTree string_literal13_tree = null ; CommonTree char_literal14_tree = null ; try { // BELScriptWalker . g : 121:13 : ( ( ' SET ' dkt = DOCUMENT _ KEYWORD ) prop = document _ property ' = ' ( qv = QUOTED _ VALUE | oi = OBJECT _ IDENT ) )
// BELScriptWalker . g : 122:5 : ( ' SET ' dkt = DOCUMENT _ KEYWORD ) prop = document _ property ' = ' ( qv = QUOTED _ VALUE | oi = OBJECT _ IDENT )
{ root_0 = ( CommonTree ) adaptor . nil ( ) ; // BELScriptWalker . g : 122:5 : ( ' SET ' dkt = DOCUMENT _ KEYWORD )
// BELScriptWalker . g : 122:6 : ' SET ' dkt = DOCUMENT _ KEYWORD
{ _last = ( CommonTree ) input . LT ( 1 ) ; string_literal13 = ( CommonTree ) match ( input , 24 , FOLLOW_24_in_set_document144 ) ; string_literal13_tree = ( CommonTree ) adaptor . dupNode ( string_literal13 ) ; adaptor . addChild ( root_0 , string_literal13_tree ) ; _last = ( CommonTree ) input . LT ( 1 ) ; dkt = ( CommonTree ) match ( input , DOCUMENT_KEYWORD , FOLLOW_DOCUMENT_KEYWORD_in_set_document148 ) ; dkt_tree = ( CommonTree ) adaptor . dupNode ( dkt ) ; adaptor . addChild ( root_0 , dkt_tree ) ; } _last = ( CommonTree ) input . LT ( 1 ) ; pushFollow ( FOLLOW_document_property_in_set_document153 ) ; prop = document_property ( ) ; state . _fsp -- ; adaptor . addChild ( root_0 , prop . getTree ( ) ) ; _last = ( CommonTree ) input . LT ( 1 ) ; char_literal14 = ( CommonTree ) match ( input , 25 , FOLLOW_25_in_set_document155 ) ; char_literal14_tree = ( CommonTree ) adaptor . dupNode ( char_literal14 ) ; adaptor . addChild ( root_0 , char_literal14_tree ) ; // BELScriptWalker . g : 122:61 : ( qv = QUOTED _ VALUE | oi = OBJECT _ IDENT )
int alt3 = 2 ; int LA3_0 = input . LA ( 1 ) ; if ( ( LA3_0 == QUOTED_VALUE ) ) { alt3 = 1 ; } else if ( ( LA3_0 == OBJECT_IDENT ) ) { alt3 = 2 ; } else { NoViableAltException nvae = new NoViableAltException ( "" , 3 , 0 , input ) ; throw nvae ; } switch ( alt3 ) { case 1 : // BELScriptWalker . g : 122:62 : qv = QUOTED _ VALUE
{ _last = ( CommonTree ) input . LT ( 1 ) ; qv = ( CommonTree ) match ( input , QUOTED_VALUE , FOLLOW_QUOTED_VALUE_in_set_document160 ) ; qv_tree = ( CommonTree ) adaptor . dupNode ( qv ) ; adaptor . addChild ( root_0 , qv_tree ) ; } break ; case 2 : // BELScriptWalker . g : 122:80 : oi = OBJECT _ IDENT
{ _last = ( CommonTree ) input . LT ( 1 ) ; oi = ( CommonTree ) match ( input , OBJECT_IDENT , FOLLOW_OBJECT_IDENT_in_set_document166 ) ; oi_tree = ( CommonTree ) adaptor . dupNode ( oi ) ; adaptor . addChild ( root_0 , oi_tree ) ; } break ; } if ( ! annotationContext . isEmpty ( ) || ! stmtlist . isEmpty ( ) ) { addError ( new SetDocumentPropertiesFirstException ( dkt . getLine ( ) , dkt . getCharPositionInLine ( ) ) ) ; } final String keywordValue ; if ( qv != null ) { keywordValue = qv . toString ( ) ; } else if ( oi != null ) { keywordValue = oi . toString ( ) ; } else { throw new IllegalStateException ( "Did not understand document keyword value, expecting quoted value or object identifier." ) ; } docprop . put ( prop . r , keywordValue ) ; lastDocumentPropertyLocation = dkt . getLine ( ) ; } retval . tree = ( CommonTree ) adaptor . rulePostProcessing ( root_0 ) ; } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; } finally { } return retval ; |
public class SpatialDirectoryEntry { /** * Calls the super method and reads the MBR object of this entry from the
* specified input stream .
* @ param in the stream to read data from in order to restore the object
* @ throws java . io . IOException if I / O errors occur
* @ throws ClassNotFoundException If the class for an object being restored
* cannot be found . */
@ Override public void readExternal ( ObjectInput in ) throws IOException , ClassNotFoundException { } } | this . id = in . readInt ( ) ; this . mbr = new ModifiableHyperBoundingBox ( ) ; this . mbr . readExternal ( in ) ; |
public class ClassUtils { /** * This will return a class of the type T [ ] from a given class . When we read
* from the AG pipe , Java needs a reference to a generic array type .
* @ param klass a class to turn into an array class
* @ param < T > the type of the class .
* @ return an array of klass with a length of 1 */
public static < T > Class < T [ ] > asArrayClass ( Class < T > klass ) { } } | return ( Class < T [ ] > ) Array . newInstance ( klass , 1 ) . getClass ( ) ; |
public class AuthenticationProcessingFilter2 { /** * Leave the information about login failure .
* Otherwise it seems like Acegi doesn ' t really leave the detail of the failure anywhere . */
@ Override protected void onUnsuccessfulAuthentication ( HttpServletRequest request , HttpServletResponse response , AuthenticationException failed ) throws IOException { } } | super . onUnsuccessfulAuthentication ( request , response , failed ) ; LOGGER . log ( Level . FINE , "Login attempt failed" , failed ) ; Authentication auth = failed . getAuthentication ( ) ; if ( auth != null ) { SecurityListener . fireFailedToLogIn ( auth . getName ( ) ) ; } |
public class ReportedData { /** * Returns a new ReportedData if the stanza is used for reporting data and includes an
* extension that matches the elementName and namespace " x " , " jabber : x : data " .
* @ param packet the stanza used for reporting data .
* @ return ReportedData from the packet if present , otherwise null . */
public static ReportedData getReportedDataFrom ( Stanza packet ) { } } | // Check if the packet includes the DataForm extension
DataForm dataForm = DataForm . from ( packet ) ; if ( dataForm != null ) { if ( dataForm . getReportedData ( ) != null ) return new ReportedData ( dataForm ) ; } // Otherwise return null
return null ; |
public class Policy { /** * buildRoleLinks initializes the roles in RBAC .
* @ param rm the role manager . */
public void buildRoleLinks ( RoleManager rm ) { } } | if ( model . containsKey ( "g" ) ) { for ( Assertion ast : model . get ( "g" ) . values ( ) ) { ast . buildRoleLinks ( rm ) ; } } |
public class XMLSystemProperties { /** * Limit the number of content model nodes that may be created when building a
* grammar for a W3C XML Schema that contains maxOccurs attributes with values
* other than " unbounded " . < br >
* This setting only takes effect if a parser with < b > explicitly < / b > disabled
* " Secure processing " feature is used . Otherwise this setting has no effect !
* @ param sMaxOccur
* A positive integer . Values & le ; 0 are treated as no limit .
* < code > null < / code > means the property is deleted .
* @ since 8.6.2 */
public static void setXMLMaxOccur ( @ Nullable final String sMaxOccur ) { } } | SystemProperties . setPropertyValue ( SYSTEM_PROPERTY_MAX_OCCUR , sMaxOccur ) ; SystemProperties . setPropertyValue ( SYSTEM_PROPERTY_JDX_XML_MAX_OCCUR , sMaxOccur ) ; _onSystemPropertyChange ( ) ; |
public class LittleEndian { /** * Sets a 16 - bit integer in the given byte array at the given offset . */
public static void setInt16 ( byte [ ] dst , int offset , int value ) { } } | assert ( value & 0xffff ) == value : "value out of range" ; dst [ offset + 0 ] = ( byte ) ( value & 0xFF ) ; dst [ offset + 1 ] = ( byte ) ( ( value >>> 8 ) & 0xFF ) ; |
public class ValueList { /** * Add Text to the Tokens .
* @ param _ text Text to be added */
public void addText ( final String _text ) { } } | this . tokens . add ( new Token ( ValueList . TokenType . TEXT , _text ) ) ; |
public class JSONArray { /** * Get an optional { @ link Number } value associated with a key , or the default if there
* is no such key or if the value is not a number . If the value is a string ,
* an attempt will be made to evaluate it as a number ( { @ link BigDecimal } ) . This method
* would be used in cases where type coercion of the number value is unwanted .
* @ param index
* The index must be between 0 and length ( ) - 1.
* @ param defaultValue
* The default .
* @ return An object which is the value . */
public Number optNumber ( int index , Number defaultValue ) { } } | Object val = this . opt ( index ) ; if ( JSONObject . NULL . equals ( val ) ) { return defaultValue ; } if ( val instanceof Number ) { return ( Number ) val ; } if ( val instanceof String ) { try { return JSONObject . stringToNumber ( ( String ) val ) ; } catch ( Exception e ) { return defaultValue ; } } return defaultValue ; |
public class LinePath { /** * Return a copy of the path , translated by the specified amounts . */
public Path getTranslatedInstance ( int x , int y ) { } } | if ( _source == null ) { return new LinePath ( null , new Point ( _dest . x + x , _dest . y + y ) , _duration ) ; } else { return new LinePath ( _source . x + x , _source . y + y , _dest . x + x , _dest . y + y , _duration ) ; } |
public class BeanIntrospector { /** * Returns a Map of all the available properties on a given class including
* write - only and indexed properties .
* @ return Map < String , BeanProperty > an unmodifiable mapping of property
* names ( Strings ) to BeanProperty objects . */
public static Map < String , BeanProperty > getAllProperties ( Class clazz ) { } } | synchronized ( cPropertiesCache ) { Map < String , BeanProperty > properties ; SoftReference < Map < String , BeanProperty > > ref = cPropertiesCache . get ( clazz ) ; if ( ref != null ) { properties = ref . get ( ) ; if ( properties != null ) { return properties ; } } properties = createProperties ( clazz ) ; cPropertiesCache . put ( clazz , new SoftReference < Map < String , BeanProperty > > ( properties ) ) ; return properties ; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.