signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class PerSessionLogHandler { /** * Returns the server log for the given session id .
* @ param sessionId The session id .
* @ return The available server log entries for the session .
* @ throws IOException If there was a problem reading from file . */
public synchronized LogEntries getSessionLog ( SessionId sessionId ) throws IOException { } } | List < LogEntry > entries = new ArrayList < > ( ) ; for ( LogRecord record : records ( sessionId ) ) { if ( record . getLevel ( ) . intValue ( ) >= serverLogLevel . intValue ( ) ) entries . add ( new LogEntry ( record . getLevel ( ) , record . getMillis ( ) , record . getMessage ( ) ) ) ; } return new LogEntries ( entries ) ; |
public class AbstractPlugin { /** * Converts this plugin to a json object ( plugin description ) .
* @ return a json object , for example ,
* < pre >
* " oId " : " " ,
* " name " : " " ,
* " version " : " " ,
* " author " : " " ,
* " status " : " " / / Enumeration name of { @ link PluginStatus }
* < / pre >
* @ throws JSONException if can not convert */
public JSONObject toJSONObject ( ) throws JSONException { } } | final JSONObject ret = new JSONObject ( ) ; ret . put ( Keys . OBJECT_ID , getId ( ) ) ; ret . put ( Plugin . PLUGIN_NAME , getName ( ) ) ; ret . put ( Plugin . PLUGIN_VERSION , getVersion ( ) ) ; ret . put ( Plugin . PLUGIN_AUTHOR , getAuthor ( ) ) ; ret . put ( Plugin . PLUGIN_STATUS , getStatus ( ) . name ( ) ) ; ret . put ( Plugin . PLUGIN_SETTING , getSetting ( ) . toString ( ) ) ; return ret ; |
public class ImgUtil { /** * 给图片添加图片水印 < br >
* 此方法并不关闭流
* @ param srcStream 源图像流
* @ param destStream 目标图像流
* @ param pressImg 水印图片 , 可以使用 { @ link ImageIO # read ( File ) } 方法读取文件
* @ param x 修正值 。 默认在中间 , 偏移量相对于中间偏移
* @ param y 修正值 。 默认在中间 , 偏移量相对于中间偏移
* @ param alpha 透明度 : alpha 必须是范围 [ 0.0 , 1.0 ] 之内 ( 包含边界值 ) 的一个浮点数字
* @ throws IORuntimeException IO异常 */
public static void pressImage ( ImageInputStream srcStream , ImageOutputStream destStream , Image pressImg , int x , int y , float alpha ) throws IORuntimeException { } } | pressImage ( read ( srcStream ) , destStream , pressImg , x , y , alpha ) ; |
public class DefaultMonetaryRoundingsSingletonSpi { /** * Query all roundings matching the given { @ link RoundingQuery } .
* @ param query the rounding query , not null .
* @ return the collection found , not null . */
@ Override public Collection < MonetaryRounding > getRoundings ( RoundingQuery query ) { } } | List < MonetaryRounding > result = new ArrayList < > ( ) ; Collection < String > providerNames = query . getProviderNames ( ) ; if ( providerNames == null || providerNames . isEmpty ( ) ) { providerNames = getDefaultProviderChain ( ) ; } for ( String providerName : providerNames ) { Bootstrap . getServices ( RoundingProviderSpi . class ) . stream ( ) . filter ( prov -> providerName . equals ( prov . getProviderName ( ) ) ) . forEach ( prov -> { try { MonetaryRounding r = prov . getRounding ( query ) ; if ( r != null ) { result . add ( r ) ; } } catch ( Exception e ) { Logger . getLogger ( DefaultMonetaryRoundingsSingletonSpi . class . getName ( ) ) . log ( Level . SEVERE , "Error loading RoundingProviderSpi from provider: " + prov , e ) ; } } ) ; } return result ; |
public class UnindexedFace { /** * An array of reasons that specify why a face wasn ' t indexed .
* < ul >
* < li >
* EXTREME _ POSE - The face is at a pose that can ' t be detected . For example , the head is turned too far away from
* the camera .
* < / li >
* < li >
* EXCEEDS _ MAX _ FACES - The number of faces detected is already higher than that specified by the
* < code > MaxFaces < / code > input parameter for < code > IndexFaces < / code > .
* < / li >
* < li >
* LOW _ BRIGHTNESS - The image is too dark .
* < / li >
* < li >
* LOW _ SHARPNESS - The image is too blurry .
* < / li >
* < li >
* LOW _ CONFIDENCE - The face was detected with a low confidence .
* < / li >
* < li >
* SMALL _ BOUNDING _ BOX - The bounding box around the face is too small .
* < / li >
* < / ul >
* @ param reasons
* An array of reasons that specify why a face wasn ' t indexed . < / p >
* < ul >
* < li >
* EXTREME _ POSE - The face is at a pose that can ' t be detected . For example , the head is turned too far away
* from the camera .
* < / li >
* < li >
* EXCEEDS _ MAX _ FACES - The number of faces detected is already higher than that specified by the
* < code > MaxFaces < / code > input parameter for < code > IndexFaces < / code > .
* < / li >
* < li >
* LOW _ BRIGHTNESS - The image is too dark .
* < / li >
* < li >
* LOW _ SHARPNESS - The image is too blurry .
* < / li >
* < li >
* LOW _ CONFIDENCE - The face was detected with a low confidence .
* < / li >
* < li >
* SMALL _ BOUNDING _ BOX - The bounding box around the face is too small .
* < / li >
* @ return Returns a reference to this object so that method calls can be chained together .
* @ see Reason */
public UnindexedFace withReasons ( Reason ... reasons ) { } } | java . util . ArrayList < String > reasonsCopy = new java . util . ArrayList < String > ( reasons . length ) ; for ( Reason value : reasons ) { reasonsCopy . add ( value . toString ( ) ) ; } if ( getReasons ( ) == null ) { setReasons ( reasonsCopy ) ; } else { getReasons ( ) . addAll ( reasonsCopy ) ; } return this ; |
public class ProcessEngines { /** * Initializes all process engines that can be found on the classpath for
* resources < code > camunda . cfg . xml < / code > ( plain Activiti style configuration )
* and for resources < code > activiti - context . xml < / code > ( Spring style configuration ) . */
public synchronized static void init ( boolean forceCreate ) { } } | if ( ! isInitialized ) { if ( processEngines == null ) { // Create new map to store process - engines if current map is null
processEngines = new HashMap < String , ProcessEngine > ( ) ; } ClassLoader classLoader = ReflectUtil . getClassLoader ( ) ; Enumeration < URL > resources = null ; try { resources = classLoader . getResources ( "camunda.cfg.xml" ) ; } catch ( IOException e ) { try { resources = classLoader . getResources ( "activiti.cfg.xml" ) ; } catch ( IOException ex ) { if ( forceCreate ) { throw new ProcessEngineException ( "problem retrieving camunda.cfg.xml and activiti.cfg.xml resources on the classpath: " + System . getProperty ( "java.class.path" ) , ex ) ; } else { return ; } } } // Remove duplicated configuration URL ' s using set . Some classloaders may return identical URL ' s twice , causing duplicate startups
Set < URL > configUrls = new HashSet < URL > ( ) ; while ( resources . hasMoreElements ( ) ) { configUrls . add ( resources . nextElement ( ) ) ; } for ( Iterator < URL > iterator = configUrls . iterator ( ) ; iterator . hasNext ( ) ; ) { URL resource = iterator . next ( ) ; initProcessEngineFromResource ( resource ) ; } try { resources = classLoader . getResources ( "activiti-context.xml" ) ; } catch ( IOException e ) { if ( forceCreate ) { throw new ProcessEngineException ( "problem retrieving activiti-context.xml resources on the classpath: " + System . getProperty ( "java.class.path" ) , e ) ; } else { return ; } } while ( resources . hasMoreElements ( ) ) { URL resource = resources . nextElement ( ) ; initProcessEngineFromSpringResource ( resource ) ; } isInitialized = true ; } else { LOG . processEngineAlreadyInitialized ( ) ; } |
public class RslAttributes { /** * Returns a list of strings for a specified attribute .
* For example for ' arguments ' attribute .
* @ param attribute the rsl attribute to return the values of .
* @ return the list of values of the relation . Each value is
* a string . Null is returned if there is no such
* attribute or the attribute / values relation is not
* an equality relation . */
public List getMulti ( String attribute ) { } } | NameOpValue nv = rslTree . getParam ( attribute ) ; if ( nv == null || nv . getOperator ( ) != NameOpValue . EQ ) return null ; List values = nv . getValues ( ) ; List list = new LinkedList ( ) ; Iterator iter = values . iterator ( ) ; Object obj ; while ( iter . hasNext ( ) ) { obj = iter . next ( ) ; if ( obj instanceof Value ) { list . add ( ( ( Value ) obj ) . getCompleteValue ( ) ) ; } } return list ; |
public class AbstractValidate { /** * Validate that the specified primitive value falls between the two inclusive values specified ; otherwise , throws an exception with the specified message .
* < pre > Validate . inclusiveBetween ( 0 , 2 , 1 , " Not in range " ) ; < / pre >
* @ param start
* the inclusive start value
* @ param end
* the inclusive end value
* @ param value
* the value to validate
* @ param message
* the exception message if invalid , not null
* @ return the value
* @ throws IllegalArgumentValidationException
* if the value falls outside the boundaries */
public long inclusiveBetween ( long start , long end , long value , String message ) { } } | if ( value < start || value > end ) { fail ( message ) ; } return value ; |
public class PhaseTwoApplication { /** * Stage three statement equivalencing .
* @ param network the { @ link ProtoNetwork network } to equivalence
* @ param pct the parameter equivalencing count to control output */
private void stage3Statement ( final ProtoNetwork network , int pct ) { } } | stageOutput ( "Equivalencing statements" ) ; int sct = p2 . stage3EquivalenceStatements ( network ) ; stageOutput ( "(" + sct + " equivalences)" ) ; |
public class SoundStore { /** * Inidicate whether music should be playing
* @ param music True if music should be played */
public void setMusicOn ( boolean music ) { } } | if ( soundWorks ) { this . music = music ; if ( music ) { restartLoop ( ) ; setMusicVolume ( musicVolume ) ; } else { pauseLoop ( ) ; } } |
public class ApiOvhDedicatedCloud { /** * Get this object properties
* REST : GET / dedicatedCloud / { serviceName } / allowedNetwork / { networkAccessId }
* @ param serviceName [ required ] Domain of the service
* @ param networkAccessId [ required ] */
public OvhAllowedNetwork serviceName_allowedNetwork_networkAccessId_GET ( String serviceName , Long networkAccessId ) throws IOException { } } | String qPath = "/dedicatedCloud/{serviceName}/allowedNetwork/{networkAccessId}" ; StringBuilder sb = path ( qPath , serviceName , networkAccessId ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhAllowedNetwork . class ) ; |
public class AbstractWSingleSelectList { /** * { @ inheritDoc } */
@ Override public void setData ( final Object data ) { } } | List < ? > options = getOptions ( ) ; if ( ! ( isEditable ( ) && data instanceof String ) && ( options == null || options . isEmpty ( ) ) ) { throw new IllegalStateException ( "Should not set a selection on a list component with no options." ) ; } Object validOption = findValidOption ( options , data , false ) ; super . setData ( validOption ) ; |
public class GridBagLayoutFormBuilder { /** * Appends a label and field to the end of the current line .
* The label will be to the left of the field , and be right - justified .
* < br / >
* The field will " grow " horizontally as space allows .
* @ param propertyName the name of the property to create the controls for
* @ param colSpan the number of columns the field should span
* @ return " this " to make it easier to string together append calls */
public GridBagLayoutFormBuilder appendLabeledField ( String propertyName , int colSpan ) { } } | return appendLabeledField ( propertyName , LabelOrientation . LEFT , colSpan ) ; |
public class MessageItem { /** * Note the existence of a persistent reference */
public void addPersistentRef ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "addPersistentRef" ) ; // We have at least one durable reference so the message
// must maintain its level of persistence
maintainPersistence = 1 ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "addPersistentRef" ) ; |
public class event { /** * Use this API to fetch filtered set of event resources .
* filter string should be in JSON format . eg : " vm _ state : DOWN , name : [ a - z ] + " */
public static event [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } } | event obj = new event ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; event [ ] response = ( event [ ] ) obj . getfiltered ( service , option ) ; return response ; |
public class AttachedRemoteSubscriberControl { /** * / * ( non - Javadoc )
* @ see com . ibm . ws . sib . processor . runtime . ControlAdapter # runtimeEventOccurred ( com . ibm . ws . sib . admin . RuntimeEvent ) */
public void runtimeEventOccurred ( RuntimeEvent event ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "runtimeEventOccurred" , event ) ; |
public class GrailsWebRequest { /** * Looks up the GrailsWebRequest from the current request .
* @ param request The current request
* @ return The GrailsWebRequest */
public static @ Nullable GrailsWebRequest lookup ( HttpServletRequest request ) { } } | GrailsWebRequest webRequest = ( GrailsWebRequest ) request . getAttribute ( GrailsApplicationAttributes . WEB_REQUEST ) ; return webRequest == null ? lookup ( ) : webRequest ; |
public class OptionSet { /** * Add a non - value option with the given key and multiplicity , and the default prefix
* @ param key The key for the option
* @ param multiplicity The multiplicity for the option
* @ return The set instance itself ( to support invocation chaining for < code > addOption ( ) < / code > methods )
* @ throws IllegalArgumentException If the < code > key < / code > is < code > null < / code > or a key with this name has already been defined
* or if < code > multiplicity < / code > is < code > null < / code > */
public OptionSet addOption ( String key , Options . Multiplicity multiplicity ) { } } | return addOption ( key , false , Options . Separator . NONE , false , multiplicity ) ; |
public class StatefulKnowledgeSessionImpl { /** * ( This shall NOT be exposed on public API ) */
public QueryResultsImpl getQueryResultsFromRHS ( String queryName , Object ... arguments ) { } } | return internalGetQueryResult ( true , queryName , arguments ) ; |
public class BulkCommandInstructions { /** * ( non - Javadoc )
* @ see net . roboconf . core . commands . AbstractCommandInstruction # doValidate ( ) */
@ Override public List < ParsingError > doValidate ( ) { } } | List < ParsingError > result = new ArrayList < > ( ) ; if ( this . changeStateInstruction == null ) result . add ( error ( ErrorCode . CMD_UNRECOGNIZED_INSTRUCTION ) ) ; if ( this . instancePath != null && ! this . context . instanceExists ( this . instancePath ) ) result . add ( error ( ErrorCode . CMD_NO_MATCHING_INSTANCE , instance ( this . instancePath ) ) ) ; if ( this . componentName != null && ComponentHelpers . findComponent ( this . context . getApp ( ) , this . componentName ) == null ) result . add ( error ( ErrorCode . CMD_INEXISTING_COMPONENT , instance ( this . instancePath ) ) ) ; return result ; |
public class CheckAccessControls { /** * Determines whether a deprecation warning should be emitted . */
private boolean shouldEmitDeprecationWarning ( NodeTraversal t , PropertyReference propRef ) { } } | // In the global scope , there are only two kinds of accesses that should
// be flagged for warnings :
// 1 ) Calls of deprecated functions and methods .
// 2 ) Instantiations of deprecated classes .
// For now , we just let everything else by .
if ( t . inGlobalScope ( ) ) { if ( ! NodeUtil . isInvocationTarget ( propRef . getSourceNode ( ) ) ) { return false ; } } // We can always assign to a deprecated property , to keep it up to date .
if ( propRef . isMutation ( ) ) { return false ; } // Don ' t warn if the node is just declaring the property , not reading it .
JSDocInfo jsdoc = propRef . getJSDocInfo ( ) ; if ( propRef . isDeclaration ( ) && ( jsdoc != null ) && jsdoc . isDeprecated ( ) ) { return false ; } return ! canAccessDeprecatedTypes ( t ) ; |
public class TaskResult { /** * Adds output
* @ param key output field
* @ param value value
* @ return current instance */
public TaskResult addOutputData ( String key , Object value ) { } } | this . outputData . put ( key , value ) ; return this ; |
public class MaterializedViewProcessor { /** * This function is mostly re - written for the fix of ENG - 6511 . - - yzhang */
private static Index findBestMatchIndexForMatviewMinOrMax ( MaterializedViewInfo matviewinfo , Table srcTable , List < AbstractExpression > groupbyExprs , AbstractExpression minMaxAggExpr ) { } } | CatalogMap < Index > allIndexes = srcTable . getIndexes ( ) ; StmtTableScan tableScan = new StmtTargetTableScan ( srcTable ) ; // Candidate index . If we can find an index covering both group - by columns and aggExpr ( optimal ) then we will
// return immediately .
// If the index found covers only group - by columns ( sub - optimal ) , we will first cache it here .
Index candidate = null ; for ( Index index : allIndexes ) { // indexOptimalForMinMax = = true if the index covered both the group - by columns and the min / max aggExpr .
boolean indexOptimalForMinMax = false ; // If minMaxAggExpr is not null , the diff can be zero or one .
// Otherwise , for a usable index , its number of columns must agree with that of the group - by columns .
final int diffAllowance = minMaxAggExpr == null ? 0 : 1 ; // Get all indexed exprs if there is any .
String expressionjson = index . getExpressionsjson ( ) ; List < AbstractExpression > indexedExprs = null ; if ( ! expressionjson . isEmpty ( ) ) { try { indexedExprs = AbstractExpression . fromJSONArrayString ( expressionjson , tableScan ) ; } catch ( JSONException e ) { e . printStackTrace ( ) ; assert ( false ) ; return null ; } } // Get source table columns .
List < Column > srcColumnArray = CatalogUtil . getSortedCatalogItems ( srcTable . getColumns ( ) , "index" ) ; MatViewIndexMatchingGroupby matchingCase = null ; if ( groupbyExprs == null ) { // This means group - by columns are all simple columns .
// It also means we can only access the group - by columns by colref .
List < ColumnRef > groupbyColRefs = CatalogUtil . getSortedCatalogItems ( matviewinfo . getGroupbycols ( ) , "index" ) ; if ( indexedExprs == null ) { matchingCase = MatViewIndexMatchingGroupby . GB_COL_IDX_COL ; // All the columns in the index are also simple columns , EASY ! colref vs . colref
List < ColumnRef > indexedColRefs = CatalogUtil . getSortedCatalogItems ( index . getColumns ( ) , "index" ) ; // The number of columns in index can never be less than that in the group - by column list .
// If minMaxAggExpr = = null , they must be equal ( diffAllowance = = 0)
// Otherwise they may be equal ( sub - optimal ) or
// indexedColRefs . size ( ) = = groupbyColRefs . size ( ) + 1 ( optimal , diffAllowance = = 1)
if ( isInvalidIndexCandidate ( indexedColRefs . size ( ) , groupbyColRefs . size ( ) , diffAllowance ) ) { continue ; } if ( ! isGroupbyMatchingIndex ( matchingCase , groupbyColRefs , null , indexedColRefs , null , null ) ) { continue ; } if ( isValidIndexCandidateForMinMax ( indexedColRefs . size ( ) , groupbyColRefs . size ( ) , diffAllowance ) ) { if ( ! isIndexOptimalForMinMax ( matchingCase , minMaxAggExpr , indexedColRefs , null , srcColumnArray ) ) { continue ; } indexOptimalForMinMax = true ; } } else { matchingCase = MatViewIndexMatchingGroupby . GB_COL_IDX_EXP ; // In this branch , group - by columns are simple columns , but the index contains complex columns .
// So it ' s only safe to access the index columns from indexedExprs .
// You can still get something from indexedColRefs , but they will be inaccurate .
// e . g . : ONE index column ( a + b ) will get you TWO separate entries { a , b } in indexedColRefs .
// In order to compare columns : for group - by columns : convert colref = > col
// for index columns : convert tve = > col
if ( isInvalidIndexCandidate ( indexedExprs . size ( ) , groupbyColRefs . size ( ) , diffAllowance ) ) { continue ; } if ( ! isGroupbyMatchingIndex ( matchingCase , groupbyColRefs , null , null , indexedExprs , srcColumnArray ) ) { continue ; } if ( isValidIndexCandidateForMinMax ( indexedExprs . size ( ) , groupbyColRefs . size ( ) , diffAllowance ) ) { if ( ! isIndexOptimalForMinMax ( matchingCase , minMaxAggExpr , null , indexedExprs , null ) ) { continue ; } indexOptimalForMinMax = true ; } } } else { matchingCase = MatViewIndexMatchingGroupby . GB_EXP_IDX_EXP ; // This means group - by columns have complex columns .
// It ' s only safe to access the group - by columns from groupbyExprs .
// AND , indexedExprs must not be null in this case . ( yeah ! )
if ( indexedExprs == null ) { continue ; } if ( isInvalidIndexCandidate ( indexedExprs . size ( ) , groupbyExprs . size ( ) , diffAllowance ) ) { continue ; } if ( ! isGroupbyMatchingIndex ( matchingCase , null , groupbyExprs , null , indexedExprs , null ) ) { continue ; } if ( isValidIndexCandidateForMinMax ( indexedExprs . size ( ) , groupbyExprs . size ( ) , diffAllowance ) ) { if ( ! isIndexOptimalForMinMax ( matchingCase , minMaxAggExpr , null , indexedExprs , null ) ) { continue ; } indexOptimalForMinMax = true ; } } // NOW index at least covered all group - by columns ( sub - optimal candidate )
if ( ! index . getPredicatejson ( ) . isEmpty ( ) ) { // Additional check for partial indexes to make sure matview WHERE clause
// covers the partial index predicate
List < AbstractExpression > coveringExprs = new ArrayList < > ( ) ; List < AbstractExpression > exactMatchCoveringExprs = new ArrayList < > ( ) ; try { String encodedPredicate = matviewinfo . getPredicate ( ) ; if ( ! encodedPredicate . isEmpty ( ) ) { String predicate = Encoder . hexDecodeToString ( encodedPredicate ) ; AbstractExpression matViewPredicate = AbstractExpression . fromJSONString ( predicate , tableScan ) ; coveringExprs . addAll ( ExpressionUtil . uncombineAny ( matViewPredicate ) ) ; } } catch ( JSONException e ) { e . printStackTrace ( ) ; assert ( false ) ; return null ; } String predicatejson = index . getPredicatejson ( ) ; if ( ! predicatejson . isEmpty ( ) && ! SubPlanAssembler . isPartialIndexPredicateCovered ( tableScan , coveringExprs , predicatejson , exactMatchCoveringExprs ) ) { // the partial index predicate does not match the MatView ' s
// where clause - - give up on this index
continue ; } } // if the index already covered group by columns and the aggCol / aggExpr ,
// it is already the best index we can get , return immediately .
if ( indexOptimalForMinMax ) { return index ; } // otherwise wait to see if we can find something better !
candidate = index ; } return candidate ; |
public class UtilityExtensions { /** * For debugging purposes ; format the given text in the form
* aaa { bbb | ccc | ddd } eee , where the { } indicate the context start
* and limit , and the | | indicate the start and limit . */
public static StringBuffer formatInput ( StringBuffer appendTo , ReplaceableString input , Transliterator . Position pos ) { } } | if ( 0 <= pos . contextStart && pos . contextStart <= pos . start && pos . start <= pos . limit && pos . limit <= pos . contextLimit && pos . contextLimit <= input . length ( ) ) { String b , c , d ; // a = input . substring ( 0 , pos . contextStart ) ;
b = input . substring ( pos . contextStart , pos . start ) ; c = input . substring ( pos . start , pos . limit ) ; d = input . substring ( pos . limit , pos . contextLimit ) ; // e = input . substring ( pos . contextLimit , input . length ( ) ) ;
appendTo . // append ( a ) .
append ( '{' ) . append ( b ) . append ( '|' ) . append ( c ) . append ( '|' ) . append ( d ) . append ( '}' ) // . append ( e )
; } else { appendTo . append ( "INVALID Position {cs=" + pos . contextStart + ", s=" + pos . start + ", l=" + pos . limit + ", cl=" + pos . contextLimit + "} on " + input ) ; } return appendTo ; |
public class ForkJoinTask { /** * Forks the given tasks , returning when { @ code isDone } holds for each task or an ( unchecked )
* exception is encountered , in which case the exception is rethrown . If more than one task
* encounters an exception , then this method throws any one of these exceptions . If any task
* encounters an exception , others may be cancelled . However , the execution status of individual
* tasks is not guaranteed upon exceptional return . The status of each task may be obtained using
* { @ link # getException ( ) } and related methods to check if they have been cancelled , completed
* normally or exceptionally , or left unprocessed .
* @ param tasks the tasks
* @ throws NullPointerException if any task is null */
public static void invokeAll ( ForkJoinTask < ? > ... tasks ) { } } | Throwable ex = null ; int last = tasks . length - 1 ; for ( int i = last ; i >= 0 ; -- i ) { ForkJoinTask < ? > t = tasks [ i ] ; if ( t == null ) { if ( ex == null ) ex = new NullPointerException ( ) ; } else if ( i != 0 ) t . fork ( ) ; else if ( t . doInvoke ( ) < NORMAL && ex == null ) ex = t . getException ( ) ; } for ( int i = 1 ; i <= last ; ++ i ) { ForkJoinTask < ? > t = tasks [ i ] ; if ( t != null ) { if ( ex != null ) t . cancel ( false ) ; else if ( t . doJoin ( ) < NORMAL ) ex = t . getException ( ) ; } } if ( ex != null ) rethrow ( ex ) ; |
public class MonomerParser { /** * This method checks if attachment label is in the format of R # , where # is a
* number
* @ param label attachment label
* @ throws org . helm . notation2 . exception . MonomerException if label is not valid */
public static void validateAttachmentLabel ( String label ) throws MonomerException { } } | if ( label . equalsIgnoreCase ( Attachment . PAIR_ATTACHMENT ) ) { return ; } char [ ] chars = label . toCharArray ( ) ; if ( ! ( String . valueOf ( chars [ 0 ] ) ) . equals ( "R" ) ) { throw new MonomerException ( "Invalid Attachment Label format" ) ; } for ( int i = 1 ; i < chars . length ; i ++ ) { char c = chars [ i ] ; if ( ! ( String . valueOf ( c ) ) . matches ( "[0-9]" ) ) { throw new MonomerException ( "Invalid Attachment Label format" ) ; } } |
public class S3Utils { /** * Method return stream of S3ObjectSummary objects , subject to < i > req < / i >
* parameters Method will perform one query for every 1000 elements ( current
* s3 limitation ) . It is lazy , so there would be no unnecesarry calls
* @ param req
* - ListObjectRequest to be used .
* @ param processor
* - Function that convert S3ObjectSummary to any object
* @ return ReactiveSeq of converted S3Object summary elements . */
public < T > ReactiveSeq < T > getSummariesStream ( ListObjectsRequest req , Function < S3ObjectSummary , T > processor ) { } } | return ReactiveSeq . fromIterator ( new S3ObjectSummaryIterator ( client , req ) ) . map ( processor ) ; |
public class ST_Reverse3DLine { /** * Reverses a LineString according to the z value . The z of the first point
* must be lower than the z of the end point .
* @ param lineString
* @ return */
private static LineString reverse3D ( LineString lineString , String order ) { } } | CoordinateSequence seq = lineString . getCoordinateSequence ( ) ; double startZ = seq . getCoordinate ( 0 ) . z ; double endZ = seq . getCoordinate ( seq . size ( ) - 1 ) . z ; if ( order . equalsIgnoreCase ( "desc" ) ) { if ( ! Double . isNaN ( startZ ) && ! Double . isNaN ( endZ ) && startZ < endZ ) { CoordinateSequences . reverse ( seq ) ; return FACTORY . createLineString ( seq ) ; } } else if ( order . equalsIgnoreCase ( "asc" ) ) { if ( ! Double . isNaN ( startZ ) && ! Double . isNaN ( endZ ) && startZ > endZ ) { CoordinateSequences . reverse ( seq ) ; return FACTORY . createLineString ( seq ) ; } } else { throw new IllegalArgumentException ( "Supported order values are asc or desc." ) ; } return lineString ; |
public class Dbi { /** * Return statistics about this database .
* @ param txn transaction handle ( not null ; not committed )
* @ return an immutable statistics object . */
public Stat stat ( final Txn < T > txn ) { } } | if ( SHOULD_CHECK ) { requireNonNull ( txn ) ; txn . checkReady ( ) ; } final MDB_stat stat = new MDB_stat ( RUNTIME ) ; checkRc ( LIB . mdb_stat ( txn . pointer ( ) , ptr , stat ) ) ; return new Stat ( stat . f0_ms_psize . intValue ( ) , stat . f1_ms_depth . intValue ( ) , stat . f2_ms_branch_pages . longValue ( ) , stat . f3_ms_leaf_pages . longValue ( ) , stat . f4_ms_overflow_pages . longValue ( ) , stat . f5_ms_entries . longValue ( ) ) ; |
public class Utils { /** * Prints a state .
* @ param sb buffer for output .
* @ param bits state bits .
* @ return the buffer */
public static final void appendState ( StringBuilder sb , short bits ) { } } | // These 3 states are mutually exclusive .
if ( ( bits & TaskState . SCHEDULED . bit ) != 0 ) sb . append ( TaskState . SCHEDULED . name ( ) ) . append ( ',' ) ; if ( ( bits & TaskState . ENDED . bit ) != 0 ) sb . append ( TaskState . ENDED . name ( ) ) . append ( ',' ) ; if ( ( bits & TaskState . SUSPENDED . bit ) != 0 ) sb . append ( TaskState . SUSPENDED . name ( ) ) . append ( ',' ) ; // Other states that can be combined with the above
if ( ( bits & TaskState . UNATTEMPTED . bit ) != 0 ) sb . append ( TaskState . UNATTEMPTED . name ( ) ) . append ( ',' ) ; if ( ( bits & TaskState . SKIPPED . bit ) != 0 ) sb . append ( TaskState . SKIPPED . name ( ) ) . append ( ',' ) ; if ( ( bits & TaskState . SKIPRUN_FAILED . bit ) != 0 ) sb . append ( TaskState . SKIPRUN_FAILED . name ( ) ) . append ( ',' ) ; if ( ( bits & TaskState . FAILURE_LIMIT_REACHED . bit ) != 0 ) sb . append ( TaskState . FAILURE_LIMIT_REACHED . name ( ) ) . append ( ',' ) ; if ( ( bits & TaskState . CANCELED . bit ) != 0 ) sb . append ( TaskState . CANCELED . name ( ) ) . append ( ',' ) ; sb . deleteCharAt ( sb . length ( ) - 1 ) ; |
public class AbstrCFMLExprTransformer { /** * Initialmethode , wird aufgerufen um den internen Zustand des Objektes zu setzten .
* @ param fld Function Libraries zum validieren der Funktionen
* @ param cfml CFML Code der transfomiert werden soll . */
protected Data init ( Data data ) { } } | if ( JSON_ARRAY == null ) JSON_ARRAY = getFLF ( data , "_literalArray" ) ; if ( JSON_STRUCT == null ) JSON_STRUCT = getFLF ( data , "_literalStruct" ) ; if ( GET_STATIC_SCOPE == null ) GET_STATIC_SCOPE = getFLF ( data , "_getStaticScope" ) ; if ( GET_SUPER_STATIC_SCOPE == null ) GET_SUPER_STATIC_SCOPE = getFLF ( data , "_getSuperStaticScope" ) ; return data ; |
public class clusterinstance_binding { /** * Use this API to fetch clusterinstance _ binding resource of given name . */
public static clusterinstance_binding get ( nitro_service service , Long clid ) throws Exception { } } | clusterinstance_binding obj = new clusterinstance_binding ( ) ; obj . set_clid ( clid ) ; clusterinstance_binding response = ( clusterinstance_binding ) obj . get_resource ( service ) ; return response ; |
public class Angle { /** * Gets an angle field - such as degrees , minutes , or seconds . Signs
* will be consistent .
* Throws NullPointerException if field is not provided .
* @ param field
* One of the field constants specifying the field to be
* retrieved .
* @ return Value of the specified field . */
public final int getField ( final Field field ) { } } | if ( sexagesimalDegreeParts == null ) { sexagesimalDegreeParts = sexagesimalSplit ( getDegrees ( ) ) ; } return sexagesimalDegreeParts [ field . ordinal ( ) ] ; |
public class ChargingStationOcpp15SoapClient { /** * { @ inheritDoc } */
@ Override public boolean startTransaction ( ChargingStationId id , IdentifyingToken identifyingToken , EvseId evseId ) { } } | LOG . info ( "Requesting remote start transaction on {}" , id ) ; ChargePointService chargePointService = this . createChargingStationService ( id ) ; RemoteStartTransactionRequest request = new RemoteStartTransactionRequest ( ) ; request . setIdTag ( identifyingToken . getToken ( ) ) ; request . setConnectorId ( evseId . getNumberedId ( ) ) ; RemoteStartTransactionResponse response = chargePointService . remoteStartTransaction ( request , id . getId ( ) ) ; boolean willTransactionStart ; switch ( response . getStatus ( ) ) { case ACCEPTED : LOG . info ( "Remote start transaction request on {} has been accepted" , id ) ; willTransactionStart = true ; break ; case REJECTED : LOG . info ( "Remote start transaction request on {} has been rejected" , id ) ; willTransactionStart = false ; break ; default : throw new AssertionError ( "Start transaction returned unknown response status " + response . getStatus ( ) ) ; } return willTransactionStart ; |
public class Redwood { /** * Log a message . The last argument to this object is the message to log
* ( usually a String ) ; the first arguments are the channels to log to .
* For example :
* log ( Redwood . ERR , " tag " , " this message is tagged with ERROR and tag " )
* @ param args The last argument is the message ; the first arguments are the channels . */
public static void log ( Object ... args ) { } } | // - - Argument Check
if ( args . length == 0 ) { return ; } if ( isClosed ) { return ; } // - - Create Record
final Object content = args [ args . length - 1 ] ; final Object [ ] tags = new Object [ args . length - 1 ] ; final StackTraceElement ste = getStackTrace ( ) ; System . arraycopy ( args , 0 , tags , 0 , args . length - 1 ) ; final long timestamp = System . currentTimeMillis ( ) ; // - - Handle Record
if ( isThreaded ) { // ( case : multithreaded )
final Runnable log = new Runnable ( ) { public void run ( ) { assert ! isThreaded || control . isHeldByCurrentThread ( ) ; Record toPass = new Record ( content , tags , depth , ste , timestamp ) ; handlers . process ( toPass , MessageType . SIMPLE , depth , toPass . timesstamp ) ; assert ! isThreaded || control . isHeldByCurrentThread ( ) ; } } ; long threadId = Thread . currentThread ( ) . getId ( ) ; attemptThreadControl ( threadId , log ) ; } else { // ( case : no threading )
Record toPass = new Record ( content , tags , depth , ste , timestamp ) ; handlers . process ( toPass , MessageType . SIMPLE , depth , toPass . timesstamp ) ; } |
public class AVStandardWebSocketClient { /** * WebSocketClient interfaces . */
public void onOpen ( ServerHandshake var1 ) { } } | gLogger . d ( "onOpen status=" + var1 . getHttpStatus ( ) + ", statusMsg=" + var1 . getHttpStatusMessage ( ) ) ; this . heartBeatPolicy . start ( ) ; if ( null != this . socketClientMonitor ) { this . socketClientMonitor . onOpen ( ) ; } |
public class CPAttachmentFileEntryUtil { /** * Removes the cp attachment file entry with the primary key from the database . Also notifies the appropriate model listeners .
* @ param CPAttachmentFileEntryId the primary key of the cp attachment file entry
* @ return the cp attachment file entry that was removed
* @ throws NoSuchCPAttachmentFileEntryException if a cp attachment file entry with the primary key could not be found */
public static CPAttachmentFileEntry remove ( long CPAttachmentFileEntryId ) throws com . liferay . commerce . product . exception . NoSuchCPAttachmentFileEntryException { } } | return getPersistence ( ) . remove ( CPAttachmentFileEntryId ) ; |
public class NS { /** * Returns an < code > AddAction < / code > for building expression that would
* append the specified values to this number set ; or if the attribute does
* not already exist , adding the new attribute and the value ( s ) to the item .
* In general , DynamoDB recommends using SET rather than ADD . */
public AddAction append ( Number ... values ) { } } | return append ( new LinkedHashSet < Number > ( Arrays . asList ( values ) ) ) ; |
public class FileUtil { /** * 从文件中读取每一行的UTF - 8编码数据
* @ param < T > 集合类型
* @ param path 文件路径
* @ param collection 集合
* @ return 文件中的每行内容的集合
* @ throws IORuntimeException IO异常
* @ since 3.1.1 */
public static < T extends Collection < String > > T readUtf8Lines ( String path , T collection ) throws IORuntimeException { } } | return readLines ( path , CharsetUtil . CHARSET_UTF_8 , collection ) ; |
public class EventTrigger { /** * getter for probability - gets probability of this trigger to be an event or relation trigger
* @ generated
* @ return value of the feature */
public String getProbability ( ) { } } | if ( EventTrigger_Type . featOkTst && ( ( EventTrigger_Type ) jcasType ) . casFeat_probability == null ) jcasType . jcas . throwFeatMissing ( "probability" , "de.julielab.jules.types.EventTrigger" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( EventTrigger_Type ) jcasType ) . casFeatCode_probability ) ; |
public class ReflectionUtils { /** * Finds a field on the given type for the given name .
* @ param type The type
* @ param name The name
* @ return An { @ link Optional } contains the method or empty */
public static Field getRequiredField ( Class type , String name ) { } } | try { return type . getDeclaredField ( name ) ; } catch ( NoSuchFieldException e ) { Optional < Field > field = findField ( type , name ) ; return field . orElseThrow ( ( ) -> new NoSuchFieldError ( "No field '" + name + "' found for type: " + type . getName ( ) ) ) ; } |
public class LRSubsetSearch { /** * When the search is initialized , and no custom initial solution has been set ,
* an empty or full subset solution is created depending on whether \ ( L \ gt R \ )
* or \ ( R \ gt L \ ) , respectively . */
@ Override public void init ( ) { } } | // solution not yet set ?
// NOTE : important to set solution before calling super ,
// else super sets a random initial solution
if ( getCurrentSolution ( ) == null ) { if ( isIncreasing ( ) ) { // increasing : start with empty solution
SubsetSolution initial = getProblem ( ) . createEmptySubsetSolution ( ) ; updateCurrentAndBestSolution ( initial ) ; } else { // decreasing : start with full set
SubsetSolution initial = getProblem ( ) . createEmptySubsetSolution ( ) ; initial . selectAll ( ) ; updateCurrentAndBestSolution ( initial ) ; } } // init super
super . init ( ) ; |
public class MapsInner { /** * Creates or updates an integration account map .
* @ param resourceGroupName The resource group name .
* @ param integrationAccountName The integration account name .
* @ param mapName The integration account map name .
* @ param map The integration account map .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the IntegrationAccountMapInner object */
public Observable < IntegrationAccountMapInner > createOrUpdateAsync ( String resourceGroupName , String integrationAccountName , String mapName , IntegrationAccountMapInner map ) { } } | return createOrUpdateWithServiceResponseAsync ( resourceGroupName , integrationAccountName , mapName , map ) . map ( new Func1 < ServiceResponse < IntegrationAccountMapInner > , IntegrationAccountMapInner > ( ) { @ Override public IntegrationAccountMapInner call ( ServiceResponse < IntegrationAccountMapInner > response ) { return response . body ( ) ; } } ) ; |
public class TCPClientSettings { /** * Returns either the { @ link InetSocketAddress } provided to the constructor or a new instance for every invocation based on the { @ link String } provided to the constructor .
* @ return An instance of { @ link InetSocketAddress } . */
public InetSocketAddress getEndpoint ( ) { } } | return endpoint == null ? new InetSocketAddress ( uri . getHost ( ) , uri . getPort ( ) ) : endpoint ; |
public class Predicates { /** * Returns a predicate that returns to true if the incoming request is an { @ link CanFulfillIntentRequest }
* for the given intent name .
* @ param intentName intent name to evaluate against
* @ return true if the incoming request is an { @ link CanFulfillIntentRequest } for the given intent name */
public static Predicate < HandlerInput > canFulfillIntentName ( String intentName ) { } } | return i -> i . getRequestEnvelope ( ) . getRequest ( ) instanceof CanFulfillIntentRequest && intentName . equals ( ( ( CanFulfillIntentRequest ) i . getRequestEnvelope ( ) . getRequest ( ) ) . getIntent ( ) . getName ( ) ) ; |
public class JBBPDslBuilder { /** * Add named integer field .
* @ param name name of the field , can be null for anonymous
* @ return the builder instance , must not be null */
public JBBPDslBuilder Int ( final String name ) { } } | final Item item = new Item ( BinType . INT , name , this . byteOrder ) ; this . addItem ( item ) ; return this ; |
public class crvserver_lbvserver_binding { /** * Use this API to fetch crvserver _ lbvserver _ binding resources of given name . */
public static crvserver_lbvserver_binding [ ] get ( nitro_service service , String name ) throws Exception { } } | crvserver_lbvserver_binding obj = new crvserver_lbvserver_binding ( ) ; obj . set_name ( name ) ; crvserver_lbvserver_binding response [ ] = ( crvserver_lbvserver_binding [ ] ) obj . get_resources ( service ) ; return response ; |
public class Functions { /** * Creates a new < code > Function < / code > from the given list . < br >
* < br >
* The function will use given integer argument as the index for
* the list . If the given integer argument is not in bounds , then
* the given default value will be returned . < br >
* < br >
* The function will be a < i > view < / i > on the given list . So changes in
* the list will be visible via the returned function .
* @ param < T > The value type
* @ param list The list
* @ param defaultValue The default value that will be returned when
* the index that is given as the function argument is out of bounds .
* @ return The { @ link Function } */
static < T > Function < Integer , T > fromList ( final List < T > list , T defaultValue ) { } } | return new Function < Integer , T > ( ) { @ Override public T apply ( Integer i ) { if ( i >= 0 && i < list . size ( ) ) { return list . get ( i ) ; } return defaultValue ; } } ; |
public class JavaParser { /** * src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 383:1 : methodDeclaration : type Identifier methodDeclaratorRest ; */
public final void methodDeclaration ( ) throws RecognitionException { } } | VarDecl_stack . push ( new VarDecl_scope ( ) ) ; int methodDeclaration_StartIndex = input . index ( ) ; try { if ( state . backtracking > 0 && alreadyParsedRule ( input , 25 ) ) { return ; } // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 385:5 : ( type Identifier methodDeclaratorRest )
// src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 385:7 : type Identifier methodDeclaratorRest
{ pushFollow ( FOLLOW_type_in_methodDeclaration842 ) ; type ( ) ; state . _fsp -- ; if ( state . failed ) return ; match ( input , Identifier , FOLLOW_Identifier_in_methodDeclaration844 ) ; if ( state . failed ) return ; pushFollow ( FOLLOW_methodDeclaratorRest_in_methodDeclaration846 ) ; methodDeclaratorRest ( ) ; state . _fsp -- ; if ( state . failed ) return ; } } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; } finally { // do for sure before leaving
if ( state . backtracking > 0 ) { memoize ( input , 25 , methodDeclaration_StartIndex ) ; } VarDecl_stack . pop ( ) ; } |
public class OpDef { /** * < code > repeated . tensorflow . OpDef . AttrDef attr = 4 ; < / code > */
public java . util . List < ? extends org . tensorflow . framework . OpDef . AttrDefOrBuilder > getAttrOrBuilderList ( ) { } } | return attr_ ; |
public class SmbFile { /** * This method returns the free disk space in bytes of the drive this share
* represents or the drive on which the directory or file resides . Objects
* other than < tt > TYPE _ SHARE < / tt > or < tt > TYPE _ FILESYSTEM < / tt > will result
* in 0L being returned .
* @ return the free disk space in bytes of the drive on which this file or
* directory resides */
public long getDiskFreeSpace ( ) throws SmbException { } } | if ( getType ( ) == TYPE_SHARE || type == TYPE_FILESYSTEM ) { int level = Trans2QueryFSInformationResponse . SMB_FS_FULL_SIZE_INFORMATION ; try { return queryFSInformation ( level ) ; } catch ( SmbException ex ) { switch ( ex . getNtStatus ( ) ) { case NtStatus . NT_STATUS_INVALID_INFO_CLASS : case NtStatus . NT_STATUS_UNSUCCESSFUL : // NetApp Filer
// SMB _ FS _ FULL _ SIZE _ INFORMATION not supported by the server .
level = Trans2QueryFSInformationResponse . SMB_INFO_ALLOCATION ; return queryFSInformation ( level ) ; } throw ex ; } } return 0L ; |
public class MathBindings { /** * Binding for { @ link java . lang . Math # toIntExact ( long ) }
* @ param value the long value
* @ return the argument as an int
* @ throws ArithmeticException if the { @ code argument } overflows an int */
public static IntegerBinding toIntExact ( final ObservableLongValue value ) { } } | return createIntegerBinding ( ( ) -> Math . toIntExact ( value . get ( ) ) , value ) ; |
public class ItemImpl { /** * { @ inheritDoc } */
public Item getAncestor ( int degree ) throws ItemNotFoundException , AccessDeniedException , RepositoryException { } } | checkValid ( ) ; try { // 6.2.8 If depth > n is specified then an ItemNotFoundException is
// thrown .
if ( degree < 0 ) { throw new ItemNotFoundException ( "Can't get ancestor with ancestor's degree < 0." ) ; } final QPath myPath = getData ( ) . getQPath ( ) ; int n = myPath . getDepth ( ) - degree ; if ( n == 0 ) { return this ; } else if ( n < 0 ) { throw new ItemNotFoundException ( "Can't get ancestor with ancestor's degree > depth of this item." ) ; } else { final QPath ancestorPath = myPath . makeAncestorPath ( n ) ; return dataManager . getItem ( ancestorPath , true ) ; } } catch ( PathNotFoundException e ) { throw new ItemNotFoundException ( e . getMessage ( ) , e ) ; } |
public class GuidedDecisionTableUpgradeHelper1 { /** * populated */
private void assertConditionColumnPatternGrouping ( GuidedDecisionTable model ) { } } | class ConditionColData { ConditionCol col ; String [ ] data ; } // Offset into Model ' s data array
final int metaDataColCount = ( model . metadataCols == null ? 0 : model . metadataCols . size ( ) ) ; final int attributeColCount = ( model . attributeCols == null ? 0 : model . attributeCols . size ( ) ) ; final int DATA_COLUMN_OFFSET = metaDataColCount + attributeColCount + GuidedDecisionTable . INTERNAL_ELEMENTS ; Map < String , List < ConditionColData > > uniqueGroups = new TreeMap < String , List < ConditionColData > > ( ) ; List < List < ConditionColData > > groups = new ArrayList < List < ConditionColData > > ( ) ; final int DATA_ROWS = model . data . length ; // Copy conditions and related data into temporary groups
for ( int iCol = 0 ; iCol < model . conditionCols . size ( ) ; iCol ++ ) { ConditionCol col = model . conditionCols . get ( iCol ) ; String pattern = col . boundName + "" ; List < ConditionColData > groupCols = uniqueGroups . get ( pattern ) ; if ( groupCols == null ) { groupCols = new ArrayList < ConditionColData > ( ) ; groups . add ( groupCols ) ; uniqueGroups . put ( pattern , groupCols ) ; } // Make a ConditionColData object
ConditionColData ccd = new ConditionColData ( ) ; int colIndex = DATA_COLUMN_OFFSET + iCol ; ccd . data = new String [ DATA_ROWS ] ; for ( int iRow = 0 ; iRow < DATA_ROWS ; iRow ++ ) { String [ ] row = model . data [ iRow ] ; ccd . data [ iRow ] = row [ colIndex ] ; } ccd . col = col ; groupCols . add ( ccd ) ; } // Copy temporary groups back into the model
int iCol = 0 ; model . conditionCols . clear ( ) ; for ( List < ConditionColData > me : groups ) { for ( ConditionColData ccd : me ) { model . conditionCols . add ( ccd . col ) ; int colIndex = DATA_COLUMN_OFFSET + iCol ; for ( int iRow = 0 ; iRow < DATA_ROWS ; iRow ++ ) { String [ ] row = model . data [ iRow ] ; row [ colIndex ] = ccd . data [ iRow ] ; } iCol ++ ; } } |
public class ImageModerationsImpl { /** * Returns the list of faces found .
* @ param imageStream The image file .
* @ param findFacesFileInputOptionalParameter the object representing the optional parameters to be set before calling this API
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws APIErrorException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the FoundFaces object if successful . */
public FoundFaces findFacesFileInput ( byte [ ] imageStream , FindFacesFileInputOptionalParameter findFacesFileInputOptionalParameter ) { } } | return findFacesFileInputWithServiceResponseAsync ( imageStream , findFacesFileInputOptionalParameter ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class Options { /** * Parses an argument list starting at the given index , populating the bound options object with the information collected .
* Optional arguments are recognized as words starting with " - " , at least 2 characters long , and not equal to " - - " . The
* special argument " - - " is recognized as a stop sign at which the parsing process stops after consuming this argument .
* @ param args
* @ param index
* @ param invalid a list to collect unrecognized arguments or values
* @ return the stopping index - either the first index at which the argument is not an option , or args . length */
@ SuppressWarnings ( "unchecked" ) public int parse ( String [ ] args , int index , List < Pair < Unrecognized , String > > invalid ) { } } | Matcher matcher = null ; while ( index < args . length && args [ index ] . charAt ( 0 ) == '-' && args [ index ] . length ( ) > 1 ) { if ( args [ index ] . equals ( STOPPER ) ) { ++ index ; break ; } else { if ( ( matcher = SOPTION . matcher ( args [ index ] ) ) . matches ( ) ) { for ( char letter : matcher . group ( 1 ) . toCharArray ( ) ) { char key = Character . toLowerCase ( letter ) ; Field field = _booleans . get ( key ) ; if ( field != null && field . getAnnotation ( description . class ) != null ) { try { field . set ( _options , Character . isLowerCase ( letter ) ) ; } catch ( IllegalAccessException x ) { report ( String . valueOf ( letter ) , Unrecognized . ARGUMENT , invalid ) ; } } else { report ( String . valueOf ( letter ) , Unrecognized . ARGUMENT , invalid ) ; } } } else if ( ( matcher = LOPTION . matcher ( args [ index ] ) ) . matches ( ) ) { // System . out . println ( " LOPTION : " + args [ index ] ) ;
String param = matcher . group ( 1 ) ; String value = matcher . group ( 2 ) ; // System . out . println ( " groups = " + matcher . groupCount ( ) ) ;
// System . out . println ( " value = " + value ) ;
try { Field field = Beans . getKnownField ( _prototype , Strings . toLowerCamelCase ( param , '-' ) ) ; if ( field . getAnnotation ( description . class ) == null ) { throw new NoSuchFieldException ( param ) ; } else if ( value != null ) { // allowing arguments like " - - data = " if empty value is okay with the data object
if ( Collection . class . isAssignableFrom ( field . getType ( ) ) ) { Class < ? > elementType = field . getAnnotation ( typeinfo . class ) . value ( ) [ 0 ] ; ( ( Collection ) field . get ( _options ) ) . add ( new ValueOf ( elementType ) . invoke ( value ) ) ; } else { field . set ( _options , new ValueOf ( field . getType ( ) , field . getAnnotation ( typeinfo . class ) ) . invoke ( value ) ) ; } } else { field . set ( _options , Boolean . TRUE ) ; } } catch ( NullPointerException x ) { throw new IllegalArgumentException ( "Missing @typeinfo on Collection: " + param ) ; } catch ( NoSuchFieldException | IllegalAccessException x ) { report ( args [ index ] , Unrecognized . ARGUMENT , invalid ) ; } catch ( IllegalArgumentException x ) { // x . printStackTrace ( System . err ) ;
report ( args [ index ] , Unrecognized . VALUE , invalid ) ; } } else { report ( args [ index ] , Unrecognized . ARGUMENT , invalid ) ; } ++ index ; } } return index ; |
public class JossAccount { /** * Get authenticated URL
* @ return access URL , public or internal */
public String getAccessURL ( ) { } } | if ( mUsePublicURL ) { LOG . trace ( "Using public URL: " + mAccess . getPublicURL ( ) ) ; return mAccess . getPublicURL ( ) ; } LOG . trace ( "Using internal URL: " + mAccess . getInternalURL ( ) ) ; return mAccess . getInternalURL ( ) ; |
public class Token { /** * indexed getter for posTag - gets an indexed value - List contains part - of - speech tags of different part - of - speech tagsets ( see also POSTag and subtypes ) , O
* @ generated
* @ param i index in the array to get
* @ return value of the element at index i */
public POSTag getPosTag ( int i ) { } } | if ( Token_Type . featOkTst && ( ( Token_Type ) jcasType ) . casFeat_posTag == null ) jcasType . jcas . throwFeatMissing ( "posTag" , "de.julielab.jules.types.Token" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Token_Type ) jcasType ) . casFeatCode_posTag ) , i ) ; return ( POSTag ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Token_Type ) jcasType ) . casFeatCode_posTag ) , i ) ) ) ; |
public class IOUtil { /** * Copies bytes from the URL < code > source < / code > to a file
* < code > destination < / code > . The directories up to < code > destination < / code >
* will be created if they don ' t already exist . < code > destination < / code >
* will be overwritten if it already exists .
* @ param source the < code > URL < / code > to copy bytes from , must not be { @ code null }
* @ param destination the non - directory < code > File < / code > to write bytes to
* ( possibly overwriting ) , must not be { @ code null }
* @ param connectionTimeout the number of milliseconds until this method
* will timeout if no connection could be established to the < code > source < / code >
* @ param readTimeout the number of milliseconds until this method will
* timeout if no data could be read from the < code > source < / code >
* @ throws UncheckedIOException if < code > source < / code > URL cannot be opened
* @ throws UncheckedIOException if < code > destination < / code > is a directory
* @ throws UncheckedIOException if < code > destination < / code > cannot be written
* @ throws UncheckedIOException if < code > destination < / code > needs creating but can ' t be
* @ throws UncheckedIOException if an IO error occurs during copying */
public static void copyURLToFile ( final URL source , final File destination , final int connectionTimeout , final int readTimeout ) throws UncheckedIOException { } } | InputStream is = null ; try { final URLConnection connection = source . openConnection ( ) ; connection . setConnectTimeout ( connectionTimeout ) ; connection . setReadTimeout ( readTimeout ) ; is = connection . getInputStream ( ) ; write ( destination , is ) ; } catch ( IOException e ) { throw new UncheckedIOException ( e ) ; } finally { close ( is ) ; } |
public class OpenIabHelper { /** * Connects to Billing Service of each store and request list of user purchases ( inventory ) .
* Can be used as a factor when looking for best fitting store .
* @ param availableStores - list of stores to check
* @ return first found store with not empty inventory , null otherwise . */
private @ Nullable Appstore checkInventory ( @ NotNull final Set < Appstore > availableStores ) { } } | if ( Utils . uiThread ( ) ) { throw new IllegalStateException ( "Must not be called from UI thread" ) ; } final Semaphore inventorySemaphore = new Semaphore ( 0 ) ; final Appstore [ ] inventoryAppstore = new Appstore [ 1 ] ; for ( final Appstore appstore : availableStores ) { final AppstoreInAppBillingService billingService = appstore . getInAppBillingService ( ) ; final OnIabSetupFinishedListener listener = new OnIabSetupFinishedListener ( ) { @ Override public void onIabSetupFinished ( @ NotNull final IabResult result ) { if ( ! result . isSuccess ( ) ) { inventorySemaphore . release ( ) ; return ; } // queryInventory ( ) is a blocking call and must be call from background
final Runnable checkInventoryRunnable = new Runnable ( ) { @ Override public void run ( ) { try { final Inventory inventory = billingService . queryInventory ( false , null , null ) ; if ( inventory != null && ! inventory . getAllPurchases ( ) . isEmpty ( ) ) { inventoryAppstore [ 0 ] = appstore ; Logger . dWithTimeFromUp ( "inventoryCheck() in " , appstore . getAppstoreName ( ) , " found: " , inventory . getAllPurchases ( ) . size ( ) , " purchases" ) ; } } catch ( IabException exception ) { Logger . e ( "inventoryCheck() failed for " , appstore . getAppstoreName ( ) + " : " , exception ) ; } inventorySemaphore . release ( ) ; } } ; inventoryExecutor . execute ( checkInventoryRunnable ) ; } } ; // startSetup ( ) must be called from the UI thread
handler . post ( new Runnable ( ) { @ Override public void run ( ) { billingService . startSetup ( listener ) ; } } ) ; try { inventorySemaphore . acquire ( ) ; } catch ( InterruptedException exception ) { Logger . e ( "checkInventory() Error during inventory check: " , exception ) ; return null ; } if ( inventoryAppstore [ 0 ] != null ) { return inventoryAppstore [ 0 ] ; } } return null ; |
public class Status { /** * Extract an error { @ link Status } from the causal chain of a { @ link Throwable } .
* If no status can be found , a status is created with { @ link Code # UNKNOWN } as its code and
* { @ code t } as its cause .
* @ return non - { @ code null } status */
public static Status fromThrowable ( Throwable t ) { } } | Throwable cause = checkNotNull ( t , "t" ) ; while ( cause != null ) { if ( cause instanceof StatusException ) { return ( ( StatusException ) cause ) . getStatus ( ) ; } else if ( cause instanceof StatusRuntimeException ) { return ( ( StatusRuntimeException ) cause ) . getStatus ( ) ; } cause = cause . getCause ( ) ; } // Couldn ' t find a cause with a Status
return UNKNOWN . withCause ( t ) ; |
public class ConfigurationCheck { /** * In case of JOINED inheritance we may have added some columns that are in the table but that are not in the entityConfigs . We check here that we have not
* added a version column in a child .
* @ param errors
* @ param config */
private void checkVersionOnJoinedInheritance ( List < String > errors , Config config ) { } } | for ( Entity entity : config . getProject ( ) . getRootEntities ( ) . getList ( ) ) { if ( entity . hasInheritance ( ) && entity . getInheritance ( ) . is ( JOINED ) ) { for ( Entity child : entity . getAllChildrenRecursive ( ) ) { for ( Attribute attribute : child . getAttributes ( ) . getList ( ) ) { if ( attribute . isVersion ( ) ) { errors . add ( attribute . getFullColumnName ( ) + " is a version column, you should not have @Version in a child joined entity." + " Use ignore=true in columnConfig or remove it from your table." ) ; } } } } } |
public class LogHandle { /** * Resize the underlying recovery log .
* This method it invoked when a keypoint operation detects that there is
* insufficient room in a recovery log file to form a persistent record
* of all the active data .
* @ exception InternalLogException An unexpected error has occured . */
void resizeLog ( int targetSize ) throws InternalLogException , LogFullException { } } | if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "resizeLog" , new Object [ ] { this , targetSize } ) ; // Check that both files are actually open
if ( _activeFile == null || _inactiveFile == null ) { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "resizeLog" , "InternalLogException" ) ; throw new InternalLogException ( null ) ; } try { _file1 . fileExtend ( targetSize ) ; _file2 . fileExtend ( targetSize ) ; } catch ( LogAllocationException exc ) { FFDCFilter . processException ( exc , "com.ibm.ws.recoverylog.spi.LogHandle.resizeLog" , "1612" , this ) ; // " Reset " the _ activeFile reference . This is very important because when this keypoint operation
// was started ( keypointStarting ) we switched the target file to the inactive file and prepared it
// for a keypoint operation by updating its header block . Subsequently , the keypoint operation fails
// which means that _ activeFile currently points at an empty file into which we have been unable to
// keypoint .
// We must leave this method with _ activeFile pointing at the active file ( as was the case prior
// to the keypoint attempt ) . If we do not do this then any further keypoint operation will re - attempt
// the same logic by switching from this empty file back to the active file . The active file will
// be cleared in preparation for the keypoint operation ( which will subsequently fail ) and all
// persistent information will be destroyed from disk .
if ( _activeFile == _file1 ) { _activeFile = _file2 ; } else { _activeFile = _file1 ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "resizeLog" , "WriteOperationFailedException" ) ; throw new WriteOperationFailedException ( exc ) ; } catch ( Throwable exc ) { FFDCFilter . processException ( exc , "com.ibm.ws.recoverylog.spi.LogHandle.resizeLog" , "1555" , this ) ; // Reset the target file reference ( see description above for why this must be done )
if ( _activeFile == _file1 ) { _activeFile = _file2 ; } else { _activeFile = _file1 ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "resizeLog" , "InternalLogException" ) ; throw new InternalLogException ( exc ) ; } // Now determine how many bytes are currently available in the new target log file .
_physicalFreeBytes = _activeFile . freeBytes ( ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Log file " + _activeFile . fileName ( ) + " now has " + _physicalFreeBytes + " bytes of storage available" ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "resizeLog" ) ; |
public class HttpURLConnectionImpl { /** * Aggressively tries to get the final HTTP response , potentially making
* many HTTP requests in the process in order to cope with redirects and
* authentication . */
private HttpEngine getResponse ( ) throws IOException { } } | initHttpEngine ( ) ; if ( httpEngine . hasResponse ( ) ) { return httpEngine ; } while ( true ) { if ( ! execute ( true ) ) { continue ; } Response response = httpEngine . getResponse ( ) ; Request followUp = httpEngine . followUpRequest ( ) ; if ( followUp == null ) { httpEngine . releaseConnection ( ) ; return httpEngine ; } if ( ++ followUpCount > HttpEngine . MAX_FOLLOW_UPS ) { throw new ProtocolException ( "Too many follow-up requests: " + followUpCount ) ; } // The first request was insufficient . Prepare for another . . .
url = followUp . url ( ) ; requestHeaders = followUp . headers ( ) . newBuilder ( ) ; // Although RFC 2616 10.3.2 specifies that a HTTP _ MOVED _ PERM redirect
// should keep the same method , Chrome , Firefox and the RI all issue GETs
// when following any redirect .
Sink requestBody = httpEngine . getRequestBody ( ) ; if ( ! followUp . method ( ) . equals ( method ) ) { requestBody = null ; } if ( requestBody != null && ! ( requestBody instanceof RetryableSink ) ) { throw new HttpRetryException ( "Cannot retry streamed HTTP body" , responseCode ) ; } if ( ! httpEngine . sameConnection ( followUp . url ( ) ) ) { httpEngine . releaseConnection ( ) ; } Connection connection = httpEngine . close ( ) ; httpEngine = newHttpEngine ( followUp . method ( ) , connection , ( RetryableSink ) requestBody , response ) ; } |
public class BufferMgr { /** * Pins a buffer to the specified block , potentially waiting until a buffer
* becomes available . If no buffer becomes available within a fixed time
* period , then repins all currently holding blocks .
* @ param blk
* a block ID
* @ return the buffer pinned to that block */
public Buffer pin ( BlockId blk ) { } } | // Try to find out if this block has been pinned by this transaction
PinnedBuffer pinnedBuff = pinnedBuffers . get ( blk ) ; if ( pinnedBuff != null ) { pinnedBuff . pinnedCount ++ ; return pinnedBuff . buffer ; } // This transaction has pinned too many buffers
if ( pinnedBuffers . size ( ) == BUFFER_POOL_SIZE ) throw new BufferAbortException ( ) ; // Pinning process
try { Buffer buff ; long timestamp = System . currentTimeMillis ( ) ; boolean waitedBeforeGotBuffer = false ; // Try to pin a buffer or the pinned buffer for the given BlockId
buff = bufferPool . pin ( blk ) ; // If there is no such buffer or no available buffer ,
// wait for it
if ( buff == null ) { waitedBeforeGotBuffer = true ; synchronized ( bufferPool ) { waitingThreads . add ( Thread . currentThread ( ) ) ; while ( buff == null && ! waitingTooLong ( timestamp ) ) { bufferPool . wait ( MAX_TIME ) ; if ( waitingThreads . get ( 0 ) . equals ( Thread . currentThread ( ) ) ) buff = bufferPool . pin ( blk ) ; } waitingThreads . remove ( Thread . currentThread ( ) ) ; } } // If it still has no buffer after a long wait ,
// release and re - pin all buffers it has
if ( buff == null ) { repin ( ) ; buff = pin ( blk ) ; } else { pinnedBuffers . put ( buff . block ( ) , new PinnedBuffer ( buff ) ) ; } // TODO : Add some comment here
if ( waitedBeforeGotBuffer ) { synchronized ( bufferPool ) { bufferPool . notifyAll ( ) ; } } return buff ; } catch ( InterruptedException e ) { throw new BufferAbortException ( ) ; } |
public class DevicesManagementApi { /** * Create a new task for one or more devices ( asynchronously )
* Create a new task for one or more devices
* @ param taskPayload Task object to be created ( required )
* @ param callback The callback to be executed when the API call finishes
* @ return The request call
* @ throws ApiException If fail to process the API call , e . g . serializing the request body object */
public com . squareup . okhttp . Call createTasksAsync ( TaskRequest taskPayload , final ApiCallback < TaskEnvelope > callback ) throws ApiException { } } | ProgressResponseBody . ProgressListener progressListener = null ; ProgressRequestBody . ProgressRequestListener progressRequestListener = null ; if ( callback != null ) { progressListener = new ProgressResponseBody . ProgressListener ( ) { @ Override public void update ( long bytesRead , long contentLength , boolean done ) { callback . onDownloadProgress ( bytesRead , contentLength , done ) ; } } ; progressRequestListener = new ProgressRequestBody . ProgressRequestListener ( ) { @ Override public void onRequestProgress ( long bytesWritten , long contentLength , boolean done ) { callback . onUploadProgress ( bytesWritten , contentLength , done ) ; } } ; } com . squareup . okhttp . Call call = createTasksValidateBeforeCall ( taskPayload , progressListener , progressRequestListener ) ; Type localVarReturnType = new TypeToken < TaskEnvelope > ( ) { } . getType ( ) ; apiClient . executeAsync ( call , localVarReturnType , callback ) ; return call ; |
public class RoutesInner { /** * Creates or updates a route in the specified route table .
* @ param resourceGroupName The name of the resource group .
* @ param routeTableName The name of the route table .
* @ param routeName The name of the route .
* @ param routeParameters Parameters supplied to the create or update route operation .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < RouteInner > createOrUpdateAsync ( String resourceGroupName , String routeTableName , String routeName , RouteInner routeParameters , final ServiceCallback < RouteInner > serviceCallback ) { } } | return ServiceFuture . fromResponse ( createOrUpdateWithServiceResponseAsync ( resourceGroupName , routeTableName , routeName , routeParameters ) , serviceCallback ) ; |
public class GcsDelegationTokens { /** * From a token , get the session token identifier .
* @ param token token to process
* @ return the session token identifier
* @ throws IOException failure to validate / read data encoded in identifier .
* @ throws IllegalArgumentException if the token isn ' t an GCP session token */
public static DelegationTokenIdentifier extractIdentifier ( final Token < ? extends DelegationTokenIdentifier > token ) throws IOException { } } | checkArgument ( token != null , "null token" ) ; DelegationTokenIdentifier identifier ; // harden up decode beyond what Token does itself
try { identifier = token . decodeIdentifier ( ) ; } catch ( RuntimeException e ) { Throwable cause = e . getCause ( ) ; if ( cause != null ) { // its a wrapping around class instantiation .
throw new DelegationTokenIOException ( "Decoding GCS token " + cause , cause ) ; } throw e ; } if ( identifier == null ) { throw new DelegationTokenIOException ( "Failed to unmarshall token " + token ) ; } return identifier ; |
public class Dbi { /** * Store a key / value pair in the database .
* This function stores key / data pairs in the database . The default behavior
* is to enter the new key / data pair , replacing any previously existing key if
* duplicates are disallowed , or adding a duplicate data item if duplicates
* are allowed ( { @ link DbiFlags # MDB _ DUPSORT } ) .
* @ param txn transaction handle ( not null ; not committed ; must be R - W )
* @ param key key to store in the database ( not null )
* @ param val value to store in the database ( not null )
* @ param flags Special options for this operation
* @ return true if the value was put , false if MDB _ NOOVERWRITE or
* MDB _ NODUPDATA were set and the key / value existed already . */
public boolean put ( final Txn < T > txn , final T key , final T val , final PutFlags ... flags ) { } } | if ( SHOULD_CHECK ) { requireNonNull ( txn ) ; requireNonNull ( key ) ; requireNonNull ( val ) ; txn . checkReady ( ) ; txn . checkWritesAllowed ( ) ; } txn . kv ( ) . keyIn ( key ) ; txn . kv ( ) . valIn ( val ) ; final int mask = mask ( flags ) ; final int rc = LIB . mdb_put ( txn . pointer ( ) , ptr , txn . kv ( ) . pointerKey ( ) , txn . kv ( ) . pointerVal ( ) , mask ) ; if ( rc == MDB_KEYEXIST ) { if ( isSet ( mask , MDB_NOOVERWRITE ) ) { txn . kv ( ) . valOut ( ) ; // marked as in , out in LMDB C docs
} else if ( ! isSet ( mask , MDB_NODUPDATA ) ) { checkRc ( rc ) ; } return false ; } checkRc ( rc ) ; return true ; |
public class KeenClient { /** * Validates an event and inserts global properties , producing a new event object which is
* ready to be published to the Keen service .
* @ param project The project in which the event will be published .
* @ param eventCollection The name of the collection in which the event will be published .
* @ param event A Map that consists of key / value pairs .
* @ param keenProperties A Map that consists of key / value pairs to override default properties .
* @ return A new event Map containing Keen properties and global properties . */
protected Map < String , Object > validateAndBuildEvent ( KeenProject project , String eventCollection , Map < String , Object > event , Map < String , Object > keenProperties ) { } } | if ( project . getWriteKey ( ) == null ) { throw new NoWriteKeyException ( "You can't send events to Keen if you haven't set a write key." ) ; } validateEventCollection ( eventCollection ) ; validateEvent ( event ) ; KeenLogging . log ( String . format ( Locale . US , "Adding event to collection: %s" , eventCollection ) ) ; // Create maps to aggregate keen & non - keen properties
Map < String , Object > newEvent = new HashMap < String , Object > ( ) ; Map < String , Object > mergedKeenProperties = new HashMap < String , Object > ( ) ; // separate keen & non - keen properties from static globals and merge them into separate maps
if ( null != globalProperties ) { mergeGlobalProperties ( getGlobalProperties ( ) , mergedKeenProperties , newEvent ) ; } // separate keen & non - keen properties from dynamic globals and merge them into separate maps
GlobalPropertiesEvaluator globalPropertiesEvaluator = getGlobalPropertiesEvaluator ( ) ; if ( globalPropertiesEvaluator != null ) { mergeGlobalProperties ( globalPropertiesEvaluator . getGlobalProperties ( eventCollection ) , mergedKeenProperties , newEvent ) ; } // merge any per - event keen properties
if ( keenProperties != null ) { mergedKeenProperties . putAll ( keenProperties ) ; } // if no keen . timestamp was provided by globals or event , add one now
if ( ! mergedKeenProperties . containsKey ( "timestamp" ) ) { Calendar currentTime = Calendar . getInstance ( ) ; String timestamp = ISO_8601_FORMAT . format ( currentTime . getTime ( ) ) ; mergedKeenProperties . put ( "timestamp" , timestamp ) ; } // add merged keen properties to event
newEvent . put ( "keen" , mergedKeenProperties ) ; // merge any per - event non - keen properties
newEvent . putAll ( event ) ; return newEvent ; |
public class Comment { /** * Check if this comment looks like an XML Declaration .
* @ return true if it looks like , maybe , it ' s an XML Declaration . */
public boolean isXmlDeclaration ( ) { } } | String data = getData ( ) ; return ( data . length ( ) > 1 && ( data . startsWith ( "!" ) || data . startsWith ( "?" ) ) ) ; |
public class ClassPathResolver { /** * Gets all URLs ( resources ) under the pattern .
* @ param locationPattern the pattern of classPath ( a ant - style string )
* @ return all URLS */
public static Set < URL > getResources ( final String locationPattern ) { } } | final Set < URL > result = new HashSet < URL > ( ) ; final String scanRootPath = getRootPath ( locationPattern ) ; final String subPattern = locationPattern . substring ( scanRootPath . length ( ) ) ; final Set < URL > rootDirResources = getResourcesFromRoot ( scanRootPath ) ; for ( final URL rootDirResource : rootDirResources ) { LOGGER . log ( Level . INFO , "RootDirResource [protocol={0}, path={1}]" , new Object [ ] { rootDirResource . getProtocol ( ) , rootDirResource . getPath ( ) } ) ; if ( isJarURL ( rootDirResource ) ) { result . addAll ( doFindPathMatchingJarResources ( rootDirResource , subPattern ) ) ; } else if ( rootDirResource . getProtocol ( ) . startsWith ( URL_PROTOCOL_VFS ) ) { result . addAll ( VfsResourceMatchingDelegate . findMatchingResources ( rootDirResource , subPattern ) ) ; } else { result . addAll ( doFindPathMatchingFileResources ( rootDirResource , subPattern ) ) ; } } return result ; |
public class CommandOption { /** * Sets command option default value
* @ param aDefault value */
public CommandOption < T > defaultsTo ( Object aDefault ) { } } | if ( aDefault == null ) { defaultValue = null ; return this ; } boolean isCorrectType ; if ( type instanceof ParameterizedType ) { isCorrectType = ( ( Class ) ( ( ParameterizedType ) type ) . getRawType ( ) ) . isInstance ( aDefault ) ; } else { isCorrectType = ( ( Class ) type ) . isInstance ( aDefault ) ; } if ( ! isCorrectType ) { throw new IllegalArgumentException ( "Expected default setting of type: " + type . getTypeName ( ) + ", but was provided: " + aDefault . getClass ( ) . getName ( ) ) ; } defaultValue = ( T ) aDefault ; return this ; |
public class Sample { /** * does cubic interpolation with the next sample
* @ since 06.06.2006
* @ param currentTuningPos
* @ return */
private int getCubicInterpolated ( final int currentSamplePos , final int currentTuningPos ) { } } | final int poslo = ( currentTuningPos >> CubicSpline . SPLINE_FRACSHIFT ) & CubicSpline . SPLINE_FRACMASK ; final long v1 = ( ( ( currentSamplePos - 1 ) < 0 ) ? 0L : ( long ) CubicSpline . lut [ poslo ] * ( long ) sample [ currentSamplePos - 1 ] ) + ( ( long ) CubicSpline . lut [ poslo + 1 ] * ( long ) sample [ currentSamplePos ] ) + ( ( long ) CubicSpline . lut [ poslo + 2 ] * ( long ) sample [ currentSamplePos + 1 ] ) + ( ( long ) CubicSpline . lut [ poslo + 3 ] * ( long ) sample [ currentSamplePos + 2 ] ) ; return ( int ) ( v1 >> CubicSpline . SPLINE_QUANTBITS ) ; |
public class ListTemplatesResult { /** * An array the contains the name and creation time stamp for each template in your Amazon SES account .
* @ param templatesMetadata
* An array the contains the name and creation time stamp for each template in your Amazon SES account . */
public void setTemplatesMetadata ( java . util . Collection < TemplateMetadata > templatesMetadata ) { } } | if ( templatesMetadata == null ) { this . templatesMetadata = null ; return ; } this . templatesMetadata = new com . amazonaws . internal . SdkInternalList < TemplateMetadata > ( templatesMetadata ) ; |
public class PropertyAdapter { /** * Retrieves the minLength of a property
* @ return the minLength of the property */
public Optional < Integer > getMinlength ( ) { } } | if ( property instanceof StringProperty ) { StringProperty stringProperty = ( StringProperty ) property ; return Optional . ofNullable ( stringProperty . getMinLength ( ) ) ; } else if ( property instanceof UUIDProperty ) { UUIDProperty uuidProperty = ( UUIDProperty ) property ; return Optional . ofNullable ( uuidProperty . getMinLength ( ) ) ; } return Optional . empty ( ) ; |
public class ExceptionWindow { /** * Toggle the visibility of the exception details .
* @ param detailsVisible should details be visible */
private void setDetailsVisible ( boolean detailsVisible ) { } } | detailsLayout . setVisible ( detailsVisible ) ; if ( detailsVisible ) { setAutoSize ( false ) ; expandButton . setTitle ( MESSAGES . exceptionDetailsHide ( ) ) ; setHeight ( WidgetLayout . exceptionWindowHeightDetails ) ; } else { expandButton . setTitle ( MESSAGES . exceptionDetailsView ( ) ) ; setHeight ( WidgetLayout . exceptionWindowHeightNormal ) ; } |
public class CachedResource { /** * Rename the given resource */
public synchronized boolean renameTo ( Resource dest ) throws SecurityException { } } | if ( _resource . renameTo ( dest ) ) { clear ( ) ; return true ; } return false ; |
public class MailService { /** * / / / / / Private Methods */
private String getStoragePath ( final String lastPathPart ) { } } | final Calendar cal = Calendar . getInstance ( ) ; return ( attachmentBasePath . getValue ( ) + "/" + Integer . toString ( cal . get ( Calendar . YEAR ) ) + "/" + Integer . toString ( cal . get ( Calendar . MONTH ) ) + "/" + Integer . toString ( cal . get ( Calendar . DAY_OF_MONTH ) ) + "/" + lastPathPart ) ; |
public class DefaultStreamDownloader { /** * Returns the file name by path .
* @ param file _ name */
protected static String getFileName ( String file_name ) { } } | if ( file_name == null ) return "" ; file_name = file_name . trim ( ) ; int iPos = 0 ; iPos = file_name . lastIndexOf ( "\\" ) ; if ( iPos > - 1 ) file_name = file_name . substring ( iPos + 1 ) ; iPos = file_name . lastIndexOf ( "/" ) ; if ( iPos > - 1 ) file_name = file_name . substring ( iPos + 1 ) ; iPos = file_name . lastIndexOf ( File . separator ) ; if ( iPos > - 1 ) file_name = file_name . substring ( iPos + 1 ) ; return file_name ; |
public class BitmapUtils { /** * Store the bitmap as a file .
* @ param bitmap to store .
* @ param format bitmap format .
* @ param quality the quality of the compressed bitmap .
* @ return the compressed bitmap file . */
public static boolean storeAsFile ( Bitmap bitmap , File file , Bitmap . CompressFormat format , int quality ) { } } | OutputStream out = null ; try { out = new BufferedOutputStream ( new FileOutputStream ( file ) ) ; return bitmap . compress ( format , quality , out ) ; } catch ( FileNotFoundException e ) { Log . e ( TAG , "no such file for saving bitmap: " , e ) ; return false ; } finally { CloseableUtils . close ( out ) ; } |
public class CommerceNotificationAttachmentPersistenceImpl { /** * Returns a range of all the commerce notification attachments where uuid = & # 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 CommerceNotificationAttachmentModelImpl } . 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 uuid the uuid
* @ param start the lower bound of the range of commerce notification attachments
* @ param end the upper bound of the range of commerce notification attachments ( not inclusive )
* @ return the range of matching commerce notification attachments */
@ Override public List < CommerceNotificationAttachment > findByUuid ( String uuid , int start , int end ) { } } | return findByUuid ( uuid , start , end , null ) ; |
public class HtmlFormRenderer { /** * private static final Log log = LogFactory . getLog ( HtmlFormRenderer . class ) ; */
@ Override protected void afterFormElementsEnd ( FacesContext facesContext , UIComponent component ) throws IOException { } } | super . afterFormElementsEnd ( facesContext , component ) ; |
public class Buffer { /** * Returns a tail segment that we can write at least { @ code minimumCapacity }
* bytes to , creating it if necessary . */
Segment writableSegment ( int minimumCapacity ) { } } | if ( minimumCapacity < 1 || minimumCapacity > Segment . SIZE ) throw new IllegalArgumentException ( ) ; if ( head == null ) { head = SegmentPool . take ( ) ; // Acquire a first segment .
return head . next = head . prev = head ; } Segment tail = head . prev ; if ( tail . limit + minimumCapacity > Segment . SIZE || ! tail . owner ) { tail = tail . push ( SegmentPool . take ( ) ) ; // Append a new empty segment to fill up .
} return tail ; |
public class AmazonSQSExtendedClientBase { /** * Delivers a message to the specified queue . With Amazon SQS , you now have
* the ability to send large payload messages that are up to 256KB ( 262,144
* bytes ) in size . To send large payloads , you must use an AWS SDK that
* supports SigV4 signing . To verify whether SigV4 is supported for an AWS
* SDK , check the SDK release notes .
* < b > IMPORTANT : < / b > The following list shows the characters ( in Unicode )
* allowed in your message , according to the W3C XML specification . For more
* information , go to http : / / www . w3 . org / TR / REC - xml / # charsets If you send any
* characters not included in the list , your request will be rejected . # x9 |
* # xA | # xD | [ # x20 to # xD7FF ] | [ # xE000 to # xFFFD ] | [ # x10000 to # x10FFFF ]
* @ param queueUrl
* The URL of the Amazon SQS queue to take action on .
* @ param messageBody
* The message to send . String maximum 256 KB in size . For a list
* of allowed characters , see the preceding important note .
* @ return The response from the SendMessage service method , as returned by
* AmazonSQS .
* @ throws InvalidMessageContentsException
* @ throws UnsupportedOperationException
* @ throws AmazonClientException
* If any internal errors are encountered inside the client
* while attempting to make the request or handle the response .
* For example if a network connection is not available .
* @ throws AmazonServiceException
* If an error response is returned by AmazonSQS indicating
* either a problem with the data in the request , or a server
* side issue . */
public SendMessageResult sendMessage ( String queueUrl , String messageBody ) throws AmazonServiceException , AmazonClientException { } } | return amazonSqsToBeExtended . sendMessage ( queueUrl , messageBody ) ; |
public class JawrSassResolver { /** * Finds and and normalized the content of the resource
* @ param path
* the resource path
* @ return the normalized resource content
* @ throws ResourceNotFoundException
* if the resource is not found
* @ throws IOException
* if an IOException occurs */
protected String resolveAndNormalize ( String path ) throws ResourceNotFoundException , IOException { } } | List < Class < ? > > excluded = new ArrayList < > ( ) ; excluded . add ( ISassResourceGenerator . class ) ; Reader rd = null ; try { rd = rsHandler . getResource ( bundle , path , false , excluded ) ; addLinkedResource ( path ) ; } catch ( ResourceNotFoundException e ) { // Do nothing
} String content = null ; if ( rd != null ) { content = IOUtils . toString ( rd ) ; if ( ! useAbsoluteUrl ) { CssImageUrlRewriter rewriter = new CssImageUrlRewriter ( ) ; content = rewriter . rewriteUrl ( path , this . scssPath , content ) . toString ( ) ; } content = SassRubyUtils . normalizeMultiByteString ( content ) ; } return content ; |
public class UserRegistryServiceImpl { /** * Method will be called for each UserRegistryConfiguration that is
* registered in the OSGi service registry . We maintain an internal
* map of these for easy access .
* Since id values are NOT guaranteed to be unique across types ,
* it is possible to have a config like this :
* < pre >
* { @ code
* < basicRegistry id = " basic1 " realm = " SampleRealm " >
* < user name = " admin " password = " adminpwd " / >
* < / basicRegistry >
* < ldapRegistry id = " basic1 " / > < - - DUPLICATE ID
* < ldapRegistry id = " ldap1 " / > * }
* < / pre >
* In this case , there are two basic1 IDs . If this situatoin occurs ,
* the first instance of the ID is used , and all subsequent instances
* are ignored . The decision of which one to ignore was arbitrary and
* due to the nature of Declarative Services , non - deterministic as the
* order of which the services get set is not guaranteed .
* @ param ref Reference to a registered UserRegistryConfiguration */
@ Reference ( policy = ReferencePolicy . DYNAMIC , cardinality = ReferenceCardinality . MULTIPLE , target = "(!(objectClass=com.ibm.ws.security.registry.FederationRegistry))" ) protected Map < String , Object > setUserRegistry ( ServiceReference < UserRegistry > ref ) { } } | String configId = ( String ) ref . getProperty ( KEY_CONFIG_ID ) ; String type = ( String ) ref . getProperty ( KEY_TYPE ) ; if ( configId != null && type != null ) { configId = parseIdFromConfigID ( configId ) ; userRegistries . putReference ( configId , ref ) ; } else { if ( type == null ) { Tr . error ( tc , "USER_REGISTRY_SERVICE_WITHOUT_TYPE" , ref . getProperty ( KEY_COMPONENT_NAME ) ) ; } if ( configId == null ) { if ( type != null ) { Tr . error ( tc , "USER_REGISTRY_SERVICE_CONFIGURATION_WITHOUT_ID" , type ) ; } else { Tr . error ( tc , "USER_REGISTRY_SERVICE_CONFIGURATION_WITHOUT_ID" , UNKNOWN_TYPE ) ; } } } if ( type != null ) { registryTypes . add ( type ) ; } else { registryTypes . add ( UNKNOWN_TYPE ) ; } notifyListeners ( ) ; return refreshUserRegistryCache ( ) ; |
public class PreferencesFxUtils { /** * Filters a list of { @ code settings } by a given { @ code description } .
* @ param settings the list of settings to be filtered
* @ param description to be searched for
* @ return a list of { @ code settings } , containing ( ignoring case ) the given { @ code description } */
public static List < Setting > filterSettingsByDescription ( List < Setting > settings , String description ) { } } | return settings . stream ( ) . filter ( setting -> containsIgnoreCase ( setting . getDescription ( ) , description ) ) . collect ( Collectors . toList ( ) ) ; |
public class SessionMgrCoordinator { /** * Unregisters the SessionManager service ( if one is registered ) ,
* and registers a new SessionManager service based on the current
* configuration / SessionStoreService .
* We must stop applications before unregistering the SessionManager
* service because applications may require the SessionManager during stop
* ( due to listeners , etc ) .
* Note that the start operation on the appRecycleService will only
* be called if the stop operation was previously called . That ' s important ,
* because we must be careful to always call start if we ever call stop . */
private synchronized void registerSessionManager ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_CORE . isLoggable ( Level . FINER ) ) { LoggingUtil . SESSION_LOGGER_CORE . entering ( CLASS_NAME , "registerSessionManager" ) ; } // If we haven ' t activated yet , don ' t try to register
if ( this . context == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_CORE . isLoggable ( Level . FINER ) ) { LoggingUtil . SESSION_LOGGER_CORE . exiting ( CLASS_NAME , "registerSessionManager" ) ; } return ; } /* - Step 1 : Stop applications using old SessionManager ( if SessionManager has initialized ) */
if ( this . smgr != null && this . smgr . isInitialized ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_CORE . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_CORE . logp ( Level . FINE , CLASS_NAME , "registerSessionManager" , "Stopping applications because the SessionManager has been initialized" ) ; } try { this . appRecycleService . recycleApplications ( null ) ; } catch ( Throwable thrown ) { FFDCFilter . processException ( thrown , getClass ( ) . getName ( ) , "153" , this ) ; } } else { if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_CORE . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_CORE . logp ( Level . FINE , CLASS_NAME , "registerSessionManager" , "Skipping application restart because the SessionManager is not initialized" ) ; } } /* - Step 2 : Register new SessionManager ( to allow dynamic update in WebContainer )
* Note that we must register a new service BEFORE unregistering the old service
* so that anyone consuming the SessionManager can use a dynamic update ( if they want to ) . */
if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_CORE . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_CORE . logp ( Level . FINE , CLASS_NAME , "registerSessionManager" , "Registering a new SessionManager service" ) ; } Dictionary < String , Object > properties = this . context . getProperties ( ) ; SessionMgrComponentImpl newSmgr = new SessionMgrComponentImpl ( this . scheduledExecutorService , this . wsLocationAdmin , this . sessionStoreService , properties ) ; ServiceRegistration < SessionManager > newSmgrRegistration = this . context . getBundleContext ( ) . registerService ( SessionManager . class , newSmgr , properties ) ; /* - Step 3 : Unregister old SessionManager */
this . unregisterSessionManager ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_CORE . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_CORE . logp ( Level . FINE , CLASS_NAME , "registerSessionManager" , "Caching new new SessionManager registration" ) ; } this . smgrRegistration = newSmgrRegistration ; this . smgr = newSmgr ; SessionMgrComponentImpl . INSTANCE . get ( ) . set ( this . smgr ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_CORE . isLoggable ( Level . FINER ) ) { LoggingUtil . SESSION_LOGGER_CORE . exiting ( CLASS_NAME , "registerSessionManager" ) ; } |
public class Person { /** * Method to get the Timezone of this Person . Default is the " UTC " Timezone .
* @ return Timezone of this Person */
public DateTimeZone getTimeZone ( ) { } } | return this . attrValues . get ( Person . AttrName . TIMZONE ) != null ? DateTimeZone . forID ( this . attrValues . get ( Person . AttrName . TIMZONE ) ) : DateTimeZone . UTC ; |
public class StopChannelResult { /** * A collection of key - value pairs .
* @ param tags
* A collection of key - value pairs .
* @ return Returns a reference to this object so that method calls can be chained together . */
public StopChannelResult withTags ( java . util . Map < String , String > tags ) { } } | setTags ( tags ) ; return this ; |
public class Translate { /** * Translate { @ link Vertex } values using the given { @ link TranslateFunction } .
* @ param vertices input vertices
* @ param translator implements conversion from { @ code OLD } to { @ code NEW }
* @ param parallelism operator parallelism
* @ param < K > vertex ID type
* @ param < OLD > old vertex value type
* @ param < NEW > new vertex value type
* @ return translated vertices */
@ SuppressWarnings ( "unchecked" ) public static < K , OLD , NEW > DataSet < Vertex < K , NEW > > translateVertexValues ( DataSet < Vertex < K , OLD > > vertices , TranslateFunction < OLD , NEW > translator , int parallelism ) { } } | Preconditions . checkNotNull ( vertices ) ; Preconditions . checkNotNull ( translator ) ; Class < Vertex < K , NEW > > vertexClass = ( Class < Vertex < K , NEW > > ) ( Class < ? extends Vertex > ) Vertex . class ; TypeInformation < K > idType = ( ( TupleTypeInfo < Vertex < K , OLD > > ) vertices . getType ( ) ) . getTypeAt ( 0 ) ; TypeInformation < OLD > oldType = ( ( TupleTypeInfo < Vertex < K , OLD > > ) vertices . getType ( ) ) . getTypeAt ( 1 ) ; TypeInformation < NEW > newType = TypeExtractor . getUnaryOperatorReturnType ( translator , TranslateFunction . class , 0 , 1 , new int [ ] { 1 } , oldType , null , false ) ; TupleTypeInfo < Vertex < K , NEW > > returnType = new TupleTypeInfo < > ( vertexClass , idType , newType ) ; return vertices . map ( new TranslateVertexValue < > ( translator ) ) . returns ( returnType ) . setParallelism ( parallelism ) . name ( "Translate vertex values" ) ; |
public class AbstractOAuth1ApiBinding { /** * Returns a { @ link ByteArrayHttpMessageConverter } to be used by the internal { @ link RestTemplate } when consuming image or other binary resources .
* By default , the message converter supports " image / jpeg " , " image / gif " , and " image / png " media types .
* Override to customize the message converter ( for example , to set supported media types ) .
* To remove / replace this or any of the other message converters that are registered by default , override the getMessageConverters ( ) method instead .
* @ return a { @ link ByteArrayHttpMessageConverter } to be used by the internal { @ link RestTemplate } when consuming image or other binary resources . */
protected ByteArrayHttpMessageConverter getByteArrayMessageConverter ( ) { } } | ByteArrayHttpMessageConverter converter = new ByteArrayHttpMessageConverter ( ) ; converter . setSupportedMediaTypes ( Arrays . asList ( MediaType . IMAGE_JPEG , MediaType . IMAGE_GIF , MediaType . IMAGE_PNG ) ) ; return converter ; |
public class CreateNewNoteIntentBuilder { /** * Set the tags for the new note . < b > Caution : < / b > Any existing tags are overwritten . Use
* { @ link # addTags ( ArrayList ) } to keep the already set tags in this builder .
* @ param tags The tags which should be added to the new note . If { @ code null } then the current
* value gets removed .
* @ return This Builder object to allow for chaining of calls to set methods . */
public CreateNewNoteIntentBuilder setTags ( @ Nullable ArrayList < String > tags ) { } } | return putStringArrayList ( EvernoteIntent . EXTRA_TAG_NAME_LIST , tags ) ; |
public class IonBinary { /** * TODO maybe add lenInt ( int ) to micro - optimize , or ? */
public static int lenInt ( long longVal ) { } } | if ( longVal != 0 ) { return 0 ; } if ( longVal < 0 ) longVal = - longVal ; if ( longVal < ( 1L << ( 8 * 1 - 1 ) ) ) return 1 ; // 7 bits
if ( longVal < ( 1L << ( 8 * 2 - 1 ) ) ) return 2 ; // 15 bits
if ( longVal < ( 1L << ( 8 * 3 - 1 ) ) ) return 3 ; // 23 bits
if ( longVal < ( 1L << ( 8 * 4 - 1 ) ) ) return 4 ; // 31 bits
if ( longVal < ( 1L << ( 8 * 5 - 1 ) ) ) return 5 ; // 39 bits
if ( longVal < ( 1L << ( 8 * 6 - 1 ) ) ) return 6 ; // 47 bits
if ( longVal < ( 1L << ( 8 * 7 - 1 ) ) ) return 7 ; // 55 bits
if ( longVal == Long . MIN_VALUE ) return 9 ; return 8 ; |
public class ModelResourceStructure { /** * Insert a model .
* success status 201
* @ param model the model to insert
* @ return a { @ link javax . ws . rs . core . Response } object .
* @ throws java . lang . Exception if any .
* @ see javax . ws . rs . POST
* @ see AbstractModelResource # insert */
@ SuppressWarnings ( "unchecked" ) public Response insert ( @ NotNull @ Valid final MODEL model ) throws Exception { } } | matchedInsert ( model ) ; setForInsertId ( model ) ; executeTx ( t -> { preInsertModel ( model ) ; insertModel ( model ) ; postInsertModel ( model ) ; } ) ; MODEL_ID id = ( MODEL_ID ) this . server . getBeanId ( model ) ; return Response . created ( buildLocationUri ( id ) ) . build ( ) ; |
public class HashTreeBuilder { /** * Calculates the height of the hash tree in case a new node would be added .
* @ param node
* a leaf to be added to the tree , must not be null .
* @ return Height of the hash tree .
* @ throws HashException */
public long calculateHeight ( ImprintNode node ) throws HashException { } } | LinkedList < ImprintNode > tmpHeads = new LinkedList < > ( ) ; for ( ImprintNode in : heads ) { tmpHeads . add ( new ImprintNode ( in ) ) ; } addToHeads ( tmpHeads , new ImprintNode ( node ) ) ; ImprintNode root = getRootNode ( tmpHeads ) ; logger . debug ( "Adding node with hash {} and height {}, the hash tree height would be {}" , node . getValue ( ) , node . getLevel ( ) , root . getLevel ( ) ) ; return root . getLevel ( ) ; |
public class TrainingJobDefinitionMarshaller { /** * Marshall the given parameter object . */
public void marshall ( TrainingJobDefinition trainingJobDefinition , ProtocolMarshaller protocolMarshaller ) { } } | if ( trainingJobDefinition == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( trainingJobDefinition . getTrainingInputMode ( ) , TRAININGINPUTMODE_BINDING ) ; protocolMarshaller . marshall ( trainingJobDefinition . getHyperParameters ( ) , HYPERPARAMETERS_BINDING ) ; protocolMarshaller . marshall ( trainingJobDefinition . getInputDataConfig ( ) , INPUTDATACONFIG_BINDING ) ; protocolMarshaller . marshall ( trainingJobDefinition . getOutputDataConfig ( ) , OUTPUTDATACONFIG_BINDING ) ; protocolMarshaller . marshall ( trainingJobDefinition . getResourceConfig ( ) , RESOURCECONFIG_BINDING ) ; protocolMarshaller . marshall ( trainingJobDefinition . getStoppingCondition ( ) , STOPPINGCONDITION_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class ReceiveMessageAction { /** * Create control message that is expected .
* @ param context
* @ param messageType
* @ return */
protected Message createControlMessage ( TestContext context , String messageType ) { } } | if ( dataDictionary != null ) { messageBuilder . setDataDictionary ( dataDictionary ) ; } return messageBuilder . buildMessageContent ( context , messageType , MessageDirection . INBOUND ) ; |
public class TrainingsImpl { /** * Create a tag for the project .
* @ param projectId The project id
* @ param name The tag name
* @ param description Optional description for the tag
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the Tag object */
public Observable < ServiceResponse < Tag > > createTagWithServiceResponseAsync ( UUID projectId , String name , String description ) { } } | if ( projectId == null ) { throw new IllegalArgumentException ( "Parameter projectId is required and cannot be null." ) ; } if ( name == null ) { throw new IllegalArgumentException ( "Parameter name is required and cannot be null." ) ; } if ( this . client . apiKey ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiKey() is required and cannot be null." ) ; } return service . createTag ( projectId , name , description , this . client . apiKey ( ) , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < Tag > > > ( ) { @ Override public Observable < ServiceResponse < Tag > > call ( Response < ResponseBody > response ) { try { ServiceResponse < Tag > clientResponse = createTagDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.