signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class QueryDocumentSnapshot { /** * Returns the fields of the document as a Map . Field values will be converted to their native * Java representation . * @ return The fields of the document as a Map . */ @ Nonnull @ Override public Map < String , Object > getData ( ) { } }
Map < String , Object > result = super . getData ( ) ; Preconditions . checkNotNull ( result , "Data in a QueryDocumentSnapshot should be non-null" ) ; return result ;
public class Server { /** * Stops the running server . */ public synchronized void stop ( ) { } }
running = false ; pool . shutdown ( ) ; try { if ( ! pool . awaitTermination ( 60 , TimeUnit . SECONDS ) ) pool . shutdownNow ( ) ; if ( ! serverSocket . isClosed ( ) ) this . serverSocket . close ( ) ; } catch ( IOException e ) { DBP . printerror ( "Error closing Socket." ) ; DBP . printException ( e ) ; } catch ( InterruptedException ie ) { DBP . printerror ( "Error shutting down threadpool." ) ; DBP . printException ( ie ) ; // ( Re - ) Cancel if current thread also interrupted pool . shutdownNow ( ) ; // Preserve interrupt status Thread . currentThread ( ) . interrupt ( ) ; }
public class MultiMEProxyHandler { /** * When a link is deleted we need to clean up any neighbours that won ` t * be deleted at restart time . * @ param String The name of the foreign bus */ public void cleanupLinkNeighbour ( String busName ) throws SIRollbackException , SIConnectionLostException , SIIncorrectCallException , SIResourceException , SIErrorException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "cleanupLinkNeighbour" ) ; Neighbour neighbour = _neighbours . getBusNeighbour ( busName ) ; if ( neighbour != null ) { LocalTransaction tran = _messageProcessor . getTXManager ( ) . createLocalTransaction ( true ) ; deleteNeighbourForced ( neighbour . getUUID ( ) , busName , ( Transaction ) tran ) ; tran . commit ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "cleanupLinkNeighbour" ) ;
public class CheckpointStatsHistory { /** * Searches for the in progress checkpoint with the given ID and replaces * it with the given completed or failed checkpoint . * < p > This is bounded by the maximum number of concurrent in progress * checkpointsArray , which means that the runtime of this is constant . * @ param completedOrFailed The completed or failed checkpoint to replace the in progress checkpoint with . * @ return < code > true < / code > if the checkpoint was replaced or < code > false < / code > otherwise . */ boolean replacePendingCheckpointById ( AbstractCheckpointStats completedOrFailed ) { } }
checkArgument ( ! completedOrFailed . getStatus ( ) . isInProgress ( ) , "Not allowed to replace with in progress checkpoints." ) ; if ( readOnly ) { throw new UnsupportedOperationException ( "Can't create a snapshot of a read-only history." ) ; } // Update the latest checkpoint stats if ( completedOrFailed . getStatus ( ) . isCompleted ( ) ) { CompletedCheckpointStats completed = ( CompletedCheckpointStats ) completedOrFailed ; if ( completed . getProperties ( ) . isSavepoint ( ) && ( latestSavepoint == null || completed . getCheckpointId ( ) > latestSavepoint . getCheckpointId ( ) ) ) { latestSavepoint = completed ; } else if ( latestCompletedCheckpoint == null || completed . getCheckpointId ( ) > latestCompletedCheckpoint . getCheckpointId ( ) ) { latestCompletedCheckpoint = completed ; } } else if ( completedOrFailed . getStatus ( ) . isFailed ( ) ) { FailedCheckpointStats failed = ( FailedCheckpointStats ) completedOrFailed ; if ( latestFailedCheckpoint == null || failed . getCheckpointId ( ) > latestFailedCheckpoint . getCheckpointId ( ) ) { latestFailedCheckpoint = failed ; } } if ( maxSize == 0 ) { return false ; } long checkpointId = completedOrFailed . getCheckpointId ( ) ; // We start searching from the last inserted position . Since the entries // wrap around the array we search until we are at index 0 and then from // the end of the array until ( start pos + 1 ) . int startPos = nextPos == checkpointsArray . length ? checkpointsArray . length - 1 : nextPos - 1 ; for ( int i = startPos ; i >= 0 ; i -- ) { if ( checkpointsArray [ i ] . getCheckpointId ( ) == checkpointId ) { checkpointsArray [ i ] = completedOrFailed ; return true ; } } for ( int i = checkpointsArray . length - 1 ; i > startPos ; i -- ) { if ( checkpointsArray [ i ] . getCheckpointId ( ) == checkpointId ) { checkpointsArray [ i ] = completedOrFailed ; return true ; } } return false ;
public class Call { /** * Gets the gather DTMF parameters and results . * @ param gatherId gather id * @ return gather DTMF parameters and results * @ throws IOException unexpected error . */ public Gather getGather ( final String gatherId ) throws Exception { } }
final String gatherPath = StringUtils . join ( new String [ ] { getUri ( ) , "gather" , gatherId } , '/' ) ; final JSONObject jsonObject = toJSONObject ( client . get ( gatherPath , null ) ) ; return new Gather ( client , jsonObject ) ;
public class AiMatrix4f { /** * Stores the matrix in a new direct ByteBuffer with native byte order . * The returned buffer can be passed to rendering APIs such as LWJGL , e . g . , * as parameter for < code > GL20 . glUniformMatrix4 ( ) < / code > . Be sure to set * < code > transpose < / code > to < code > true < / code > in this case , as OpenGL * expects the matrix in column order . * @ return a new native order , direct ByteBuffer */ public FloatBuffer toByteBuffer ( ) { } }
ByteBuffer bbuf = ByteBuffer . allocateDirect ( 16 * 4 ) ; bbuf . order ( ByteOrder . nativeOrder ( ) ) ; FloatBuffer fbuf = bbuf . asFloatBuffer ( ) ; fbuf . put ( m_data ) ; fbuf . flip ( ) ; return fbuf ;
public class GISCoordinates { /** * This function convert France Lambert 93 coordinate to * France Lambert IV coordinate . * @ param x is the coordinate in France Lambert 93 * @ param y is the coordinate in France Lambert 93 * @ return the France Lambert IV coordinate . */ @ Pure public static Point2d L93_L4 ( double x , double y ) { } }
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi ( x , y , LAMBERT_93_N , LAMBERT_93_C , LAMBERT_93_XS , LAMBERT_93_YS ) ; return NTFLambdaPhi_NTFLambert ( ntfLambdaPhi . getX ( ) , ntfLambdaPhi . getY ( ) , LAMBERT_4_N , LAMBERT_4_C , LAMBERT_4_XS , LAMBERT_4_YS ) ;
public class ProjectApi { /** * Get a list of variables for the specified project in the specified page range . * < pre > < code > GitLab Endpoint : GET / projects / : id / variables < / code > < / pre > * @ param projectIdOrPath projectIdOrPath the project in the form of an Integer ( ID ) , String ( path ) , or Project instance , required * @ param page the page to get * @ param perPage the number of Variable instances per page * @ return a list of variables belonging to the specified project in the specified page range * @ throws GitLabApiException if any exception occurs */ public List < Variable > getVariables ( Object projectIdOrPath , int page , int perPage ) throws GitLabApiException { } }
Response response = get ( Response . Status . OK , getPageQueryParams ( page , perPage ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "variables" ) ; return ( response . readEntity ( new GenericType < List < Variable > > ( ) { } ) ) ;
public class NodeUtil { /** * This method checks whether a URI template has been defined . If so , then it will * extract the relevant properties from the URI and rewrite the URI to be the template . * This results in the URI being a stable / consistent value ( for aggregation purposes ) * while retaining the parameters from the actual URI as properties . * @ param node The node containing the current URI and optional template * @ return Whether the node was processed */ public static boolean rewriteURI ( Node node ) { } }
boolean processed = false ; // Check if URI and template has been defined if ( node . getUri ( ) != null && node . hasProperty ( Constants . PROP_HTTP_URL_TEMPLATE ) ) { List < String > queryParameters = new ArrayList < String > ( ) ; String template = node . getProperties ( Constants . PROP_HTTP_URL_TEMPLATE ) . iterator ( ) . next ( ) . getValue ( ) ; if ( template == null ) { return false ; } // If template contains a query string component , then separate the details if ( template . indexOf ( '?' ) != - 1 ) { int index = template . indexOf ( '?' ) ; String queryString = template . substring ( index + 1 ) ; template = template . substring ( 0 , index ) ; StringTokenizer st = new StringTokenizer ( queryString , "&" ) ; while ( st . hasMoreTokens ( ) ) { String token = st . nextToken ( ) ; if ( token . charAt ( 0 ) == '{' && token . charAt ( token . length ( ) - 1 ) == '}' ) { queryParameters . add ( token . substring ( 1 , token . length ( ) - 1 ) ) ; } else { log . severe ( "Expecting query parameter template, e.g. {name}, but got '" + token + "'" ) ; } } } String [ ] templateTokensArray = template . split ( "/" ) ; String [ ] uriTokensArray = node . getUri ( ) . split ( "/" , templateTokensArray . length ) ; if ( templateTokensArray . length != uriTokensArray . length ) { return false ; } Set < Property > props = null ; for ( int i = 1 ; i < uriTokensArray . length ; i ++ ) { String uriToken = uriTokensArray [ i ] ; String templateToken = templateTokensArray [ i ] ; if ( templateToken . charAt ( 0 ) == '{' && templateToken . charAt ( templateToken . length ( ) - 1 ) == '}' ) { int lastPosition = templateToken . length ( ) - 1 ; int positionColon = templateToken . indexOf ( ':' ) ; if ( positionColon > 0 ) { lastPosition = positionColon ; } String name = templateToken . substring ( 1 , lastPosition ) ; if ( props == null ) { props = new HashSet < Property > ( ) ; } try { props . add ( new Property ( name , URLDecoder . decode ( uriToken , "UTF-8" ) ) ) ; } catch ( UnsupportedEncodingException e ) { if ( log . isLoggable ( Level . FINEST ) ) { log . finest ( "Failed to decode value '" + uriToken + "': " + e ) ; } } } else if ( ! uriToken . equals ( templateToken ) ) { // URI template mismatch return false ; } } // If properties extracted , then add to txn properties , and set the node ' s // URI to the template , to make it stable / consistent - to make analytics easier if ( props != null ) { node . setUri ( template ) ; node . getProperties ( ) . addAll ( props ) ; processed = true ; } if ( rewriteURIQueryParameters ( node , queryParameters ) ) { processed = true ; } } return processed ;
public class PlatformIndependentMOTD { /** * Returns the file name to be used for serializing a new { @ code MOTD } * @ return The file name to be used for serializing a new { @ code MOTD } */ private static String getNextSerializationFileName ( ) { } }
List < Integer > usedIndexes = getUsedIndexes ( ) ; int maxUsedIndex ; try { maxUsedIndex = Collections . max ( usedIndexes ) ; } catch ( Exception e ) { maxUsedIndex = - 1 ; } return latestMOTDSerializedFileName . replace ( "{index}" , Integer . toString ( maxUsedIndex + 1 ) ) ;
public class Tile { /** * Defines the alignment that will be used to align the text * in the Tile . Keep in mind that this property will not be used * by every skin . * @ param ALIGNMENT */ public void setTextAlignment ( final TextAlignment ALIGNMENT ) { } }
if ( null == textAlignment ) { _textAlignment = ALIGNMENT ; fireTileEvent ( RESIZE_EVENT ) ; } else { textAlignment . set ( ALIGNMENT ) ; }
public class ServiceLocalCache { /** * Prepare to build cache * @ throws InterruptedException */ public static void prepare ( ) throws InterruptedException { } }
semaphore . acquire ( ) ; if ( cacheReference == masterCache ) { slaveCache . clear ( ) ; } else { masterCache . clear ( ) ; }
public class AbstractCommand { /** * Detach the button from the { @ link CommandFaceButtonManager } . * @ param button the button to detach . */ public void detach ( AbstractButton button ) { } }
if ( getDefaultButtonManager ( ) . isAttachedTo ( button ) ) { getDefaultButtonManager ( ) . detach ( button ) ; onButtonDetached ( ) ; }
import java . lang . Math ; class ComputeSeriesSum { /** * Computes the sum of the series : 13 + 23 + 33 + . . . + n3. * The formula to calculate the sum of the series uses the square of the sum * of the first n natural numbers : ( ( n * ( n + 1 ) ) / 2 ) ^ 2. * Args : * n : The number of terms in the series . * Returns : * The sum of the first n terms of the series . * Examples : * > > > compute _ series _ sum ( 7) * 784.0 * > > > compute _ series _ sum ( 5) * 225.0 * > > > compute _ series _ sum ( 15) * 14400.0 */ public static double computeSeriesSum ( int n ) { } }
double sum_of_terms = ( ( n * ( n + 1 ) ) / 2.0 ) ; double series_sum = Math . pow ( sum_of_terms , 2 ) ; return series_sum ;
public class InternalXbaseParser { /** * InternalXbase . g : 5829:1 : ruleJvmWildcardTypeReference returns [ EObject current = null ] : ( ( ) otherlv _ 1 = ' ? ' ( ( ( ( lv _ constraints _ 2_0 = ruleJvmUpperBound ) ) ( ( lv _ constraints _ 3_0 = ruleJvmUpperBoundAnded ) ) * ) | ( ( ( lv _ constraints _ 4_0 = ruleJvmLowerBound ) ) ( ( lv _ constraints _ 5_0 = ruleJvmLowerBoundAnded ) ) * ) ) ? ) ; */ public final EObject ruleJvmWildcardTypeReference ( ) throws RecognitionException { } }
EObject current = null ; Token otherlv_1 = null ; EObject lv_constraints_2_0 = null ; EObject lv_constraints_3_0 = null ; EObject lv_constraints_4_0 = null ; EObject lv_constraints_5_0 = null ; enterRule ( ) ; try { // InternalXbase . g : 5835:2 : ( ( ( ) otherlv _ 1 = ' ? ' ( ( ( ( lv _ constraints _ 2_0 = ruleJvmUpperBound ) ) ( ( lv _ constraints _ 3_0 = ruleJvmUpperBoundAnded ) ) * ) | ( ( ( lv _ constraints _ 4_0 = ruleJvmLowerBound ) ) ( ( lv _ constraints _ 5_0 = ruleJvmLowerBoundAnded ) ) * ) ) ? ) ) // InternalXbase . g : 5836:2 : ( ( ) otherlv _ 1 = ' ? ' ( ( ( ( lv _ constraints _ 2_0 = ruleJvmUpperBound ) ) ( ( lv _ constraints _ 3_0 = ruleJvmUpperBoundAnded ) ) * ) | ( ( ( lv _ constraints _ 4_0 = ruleJvmLowerBound ) ) ( ( lv _ constraints _ 5_0 = ruleJvmLowerBoundAnded ) ) * ) ) ? ) { // InternalXbase . g : 5836:2 : ( ( ) otherlv _ 1 = ' ? ' ( ( ( ( lv _ constraints _ 2_0 = ruleJvmUpperBound ) ) ( ( lv _ constraints _ 3_0 = ruleJvmUpperBoundAnded ) ) * ) | ( ( ( lv _ constraints _ 4_0 = ruleJvmLowerBound ) ) ( ( lv _ constraints _ 5_0 = ruleJvmLowerBoundAnded ) ) * ) ) ? ) // InternalXbase . g : 5837:3 : ( ) otherlv _ 1 = ' ? ' ( ( ( ( lv _ constraints _ 2_0 = ruleJvmUpperBound ) ) ( ( lv _ constraints _ 3_0 = ruleJvmUpperBoundAnded ) ) * ) | ( ( ( lv _ constraints _ 4_0 = ruleJvmLowerBound ) ) ( ( lv _ constraints _ 5_0 = ruleJvmLowerBoundAnded ) ) * ) ) ? { // InternalXbase . g : 5837:3 : ( ) // InternalXbase . g : 5838:4: { if ( state . backtracking == 0 ) { current = forceCreateModelElement ( grammarAccess . getJvmWildcardTypeReferenceAccess ( ) . getJvmWildcardTypeReferenceAction_0 ( ) , current ) ; } } otherlv_1 = ( Token ) match ( input , 85 , FOLLOW_76 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { newLeafNode ( otherlv_1 , grammarAccess . getJvmWildcardTypeReferenceAccess ( ) . getQuestionMarkKeyword_1 ( ) ) ; } // InternalXbase . g : 5848:3 : ( ( ( ( lv _ constraints _ 2_0 = ruleJvmUpperBound ) ) ( ( lv _ constraints _ 3_0 = ruleJvmUpperBoundAnded ) ) * ) | ( ( ( lv _ constraints _ 4_0 = ruleJvmLowerBound ) ) ( ( lv _ constraints _ 5_0 = ruleJvmLowerBoundAnded ) ) * ) ) ? int alt105 = 3 ; int LA105_0 = input . LA ( 1 ) ; if ( ( LA105_0 == 69 ) ) { alt105 = 1 ; } else if ( ( LA105_0 == 73 ) ) { alt105 = 2 ; } switch ( alt105 ) { case 1 : // InternalXbase . g : 5849:4 : ( ( ( lv _ constraints _ 2_0 = ruleJvmUpperBound ) ) ( ( lv _ constraints _ 3_0 = ruleJvmUpperBoundAnded ) ) * ) { // InternalXbase . g : 5849:4 : ( ( ( lv _ constraints _ 2_0 = ruleJvmUpperBound ) ) ( ( lv _ constraints _ 3_0 = ruleJvmUpperBoundAnded ) ) * ) // InternalXbase . g : 5850:5 : ( ( lv _ constraints _ 2_0 = ruleJvmUpperBound ) ) ( ( lv _ constraints _ 3_0 = ruleJvmUpperBoundAnded ) ) * { // InternalXbase . g : 5850:5 : ( ( lv _ constraints _ 2_0 = ruleJvmUpperBound ) ) // InternalXbase . g : 5851:6 : ( lv _ constraints _ 2_0 = ruleJvmUpperBound ) { // InternalXbase . g : 5851:6 : ( lv _ constraints _ 2_0 = ruleJvmUpperBound ) // InternalXbase . g : 5852:7 : lv _ constraints _ 2_0 = ruleJvmUpperBound { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getJvmWildcardTypeReferenceAccess ( ) . getConstraintsJvmUpperBoundParserRuleCall_2_0_0_0 ( ) ) ; } pushFollow ( FOLLOW_77 ) ; lv_constraints_2_0 = ruleJvmUpperBound ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElementForParent ( grammarAccess . getJvmWildcardTypeReferenceRule ( ) ) ; } add ( current , "constraints" , lv_constraints_2_0 , "org.eclipse.xtext.xbase.Xtype.JvmUpperBound" ) ; afterParserOrEnumRuleCall ( ) ; } } } // InternalXbase . g : 5869:5 : ( ( lv _ constraints _ 3_0 = ruleJvmUpperBoundAnded ) ) * loop103 : do { int alt103 = 2 ; int LA103_0 = input . LA ( 1 ) ; if ( ( LA103_0 == 86 ) ) { alt103 = 1 ; } switch ( alt103 ) { case 1 : // InternalXbase . g : 5870:6 : ( lv _ constraints _ 3_0 = ruleJvmUpperBoundAnded ) { // InternalXbase . g : 5870:6 : ( lv _ constraints _ 3_0 = ruleJvmUpperBoundAnded ) // InternalXbase . g : 5871:7 : lv _ constraints _ 3_0 = ruleJvmUpperBoundAnded { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getJvmWildcardTypeReferenceAccess ( ) . getConstraintsJvmUpperBoundAndedParserRuleCall_2_0_1_0 ( ) ) ; } pushFollow ( FOLLOW_77 ) ; lv_constraints_3_0 = ruleJvmUpperBoundAnded ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElementForParent ( grammarAccess . getJvmWildcardTypeReferenceRule ( ) ) ; } add ( current , "constraints" , lv_constraints_3_0 , "org.eclipse.xtext.xbase.Xtype.JvmUpperBoundAnded" ) ; afterParserOrEnumRuleCall ( ) ; } } } break ; default : break loop103 ; } } while ( true ) ; } } break ; case 2 : // InternalXbase . g : 5890:4 : ( ( ( lv _ constraints _ 4_0 = ruleJvmLowerBound ) ) ( ( lv _ constraints _ 5_0 = ruleJvmLowerBoundAnded ) ) * ) { // InternalXbase . g : 5890:4 : ( ( ( lv _ constraints _ 4_0 = ruleJvmLowerBound ) ) ( ( lv _ constraints _ 5_0 = ruleJvmLowerBoundAnded ) ) * ) // InternalXbase . g : 5891:5 : ( ( lv _ constraints _ 4_0 = ruleJvmLowerBound ) ) ( ( lv _ constraints _ 5_0 = ruleJvmLowerBoundAnded ) ) * { // InternalXbase . g : 5891:5 : ( ( lv _ constraints _ 4_0 = ruleJvmLowerBound ) ) // InternalXbase . g : 5892:6 : ( lv _ constraints _ 4_0 = ruleJvmLowerBound ) { // InternalXbase . g : 5892:6 : ( lv _ constraints _ 4_0 = ruleJvmLowerBound ) // InternalXbase . g : 5893:7 : lv _ constraints _ 4_0 = ruleJvmLowerBound { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getJvmWildcardTypeReferenceAccess ( ) . getConstraintsJvmLowerBoundParserRuleCall_2_1_0_0 ( ) ) ; } pushFollow ( FOLLOW_77 ) ; lv_constraints_4_0 = ruleJvmLowerBound ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElementForParent ( grammarAccess . getJvmWildcardTypeReferenceRule ( ) ) ; } add ( current , "constraints" , lv_constraints_4_0 , "org.eclipse.xtext.xbase.Xtype.JvmLowerBound" ) ; afterParserOrEnumRuleCall ( ) ; } } } // InternalXbase . g : 5910:5 : ( ( lv _ constraints _ 5_0 = ruleJvmLowerBoundAnded ) ) * loop104 : do { int alt104 = 2 ; int LA104_0 = input . LA ( 1 ) ; if ( ( LA104_0 == 86 ) ) { alt104 = 1 ; } switch ( alt104 ) { case 1 : // InternalXbase . g : 5911:6 : ( lv _ constraints _ 5_0 = ruleJvmLowerBoundAnded ) { // InternalXbase . g : 5911:6 : ( lv _ constraints _ 5_0 = ruleJvmLowerBoundAnded ) // InternalXbase . g : 5912:7 : lv _ constraints _ 5_0 = ruleJvmLowerBoundAnded { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getJvmWildcardTypeReferenceAccess ( ) . getConstraintsJvmLowerBoundAndedParserRuleCall_2_1_1_0 ( ) ) ; } pushFollow ( FOLLOW_77 ) ; lv_constraints_5_0 = ruleJvmLowerBoundAnded ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { if ( current == null ) { current = createModelElementForParent ( grammarAccess . getJvmWildcardTypeReferenceRule ( ) ) ; } add ( current , "constraints" , lv_constraints_5_0 , "org.eclipse.xtext.xbase.Xtype.JvmLowerBoundAnded" ) ; afterParserOrEnumRuleCall ( ) ; } } } break ; default : break loop104 ; } } while ( true ) ; } } break ; } } } if ( state . backtracking == 0 ) { leaveRule ( ) ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ;
public class Headers { /** * Returns headers for the header names and values in the { @ link Map } . */ public static Headers of ( Map < String , String > headers ) { } }
if ( headers == null ) throw new NullPointerException ( "headers == null" ) ; // Make a defensive copy and clean it up . String [ ] namesAndValues = new String [ headers . size ( ) * 2 ] ; int i = 0 ; for ( Map . Entry < String , String > header : headers . entrySet ( ) ) { if ( header . getKey ( ) == null || header . getValue ( ) == null ) { throw new IllegalArgumentException ( "Headers cannot be null" ) ; } String name = header . getKey ( ) . trim ( ) ; String value = header . getValue ( ) . trim ( ) ; if ( name . length ( ) == 0 || name . indexOf ( '\0' ) != - 1 || value . indexOf ( '\0' ) != - 1 ) { throw new IllegalArgumentException ( "Unexpected header: " + name + ": " + value ) ; } namesAndValues [ i ] = name ; namesAndValues [ i + 1 ] = value ; i += 2 ; } return new Headers ( namesAndValues ) ;
public class HeaderUtil { /** * Create headers from a string . * @ param headersAndValues by the header1 : value1 , header2 : value2 . . . * @ return the Headers as a Set */ public Map < String , String > createHeadersFromString ( String headersAndValues ) { } }
if ( headersAndValues == null || headersAndValues . isEmpty ( ) ) return Collections . emptyMap ( ) ; final StringTokenizer token = new StringTokenizer ( headersAndValues , "@" ) ; final Map < String , String > theHeaders = new HashMap < String , String > ( token . countTokens ( ) ) ; while ( token . hasMoreTokens ( ) ) { final String headerAndValue = token . nextToken ( ) ; if ( ! headerAndValue . contains ( ":" ) ) throw new IllegalArgumentException ( "Request headers wrongly configured, missing separator :" + headersAndValues ) ; final String header = headerAndValue . substring ( 0 , headerAndValue . indexOf ( ":" ) ) ; final String value = headerAndValue . substring ( headerAndValue . indexOf ( ":" ) + 1 , headerAndValue . length ( ) ) ; theHeaders . put ( header , value ) ; } return theHeaders ;
public class WOrientConf { /** * Extract all WOrientConf configuration with the given prefix from the parent wisdom configuration . * If the prefix is < code > " orientdb " < / code > and the configuration is : < br / > * < code > * orientdb . default . url = " plocal : / home / wisdom / db " * orientdb . test . url = " plocal : / home / wisdom / test / db " * < / code > * the sub configuration will be : * < code > * [ alias : default ] * url = " plocal : / home / wisdom / db " * [ alias : test ] * url = " plocal : / home / wisdom / test / db " * < / code > * @ param config The wisdom configuration * @ param prefix The prefix of the wisdom - orientdb configuration . * @ return A Collection of WOrientConf retrieve from the Wisdom configuration file , or an empty set if there is no configuration under the given prefix . */ public static Collection < WOrientConf > createFromApplicationConf ( Configuration config , String prefix ) { } }
Configuration orient = config . getConfiguration ( prefix ) ; if ( orient == null ) { return Collections . EMPTY_SET ; } Set < String > subkeys = new HashSet < > ( ) ; for ( String key : orient . asMap ( ) . keySet ( ) ) { subkeys . add ( key ) ; } Collection < WOrientConf > subconfs = new ArrayList < > ( subkeys . size ( ) ) ; for ( String subkey : subkeys ) { subconfs . add ( new WOrientConf ( subkey , orient . getConfiguration ( subkey ) ) ) ; } return subconfs ;
public class PoolablePreparedStatement { /** * Method setNClob . * @ param parameterIndex * @ param reader * @ throws SQLException * @ see java . sql . PreparedStatement # setNClob ( int , Reader ) */ @ Override public void setNClob ( int parameterIndex , Reader reader ) throws SQLException { } }
internalStmt . setNClob ( parameterIndex , reader ) ;
public class ComponentTag { /** * Create the requested component instance */ protected SlingBean createComponent ( ) throws ClassNotFoundException , IllegalAccessException , InstantiationException { } }
SlingBean component = null ; Class < ? extends SlingBean > type = getComponentType ( ) ; if ( type != null ) { BeanFactory factoryRule = type . getAnnotation ( BeanFactory . class ) ; if ( factoryRule != null ) { SlingBeanFactory factory = context . getService ( factoryRule . serviceClass ( ) ) ; if ( factory != null ) { return factory . createBean ( context , getModelResource ( context ) , type ) ; } } BeanContext baseContext = context . withResource ( getModelResource ( context ) ) ; component = baseContext . adaptTo ( type ) ; injectServices ( component ) ; additionalInitialization ( component ) ; } return component ;
public class UpdateCenter { /** * Called to determine if there was an incomplete installation , what the statuses of the plugins are */ @ Restricted ( DoNotUse . class ) // WebOnly public HttpResponse doIncompleteInstallStatus ( ) { } }
try { Map < String , String > jobs = InstallUtil . getPersistedInstallStatus ( ) ; if ( jobs == null ) { jobs = Collections . emptyMap ( ) ; } return HttpResponses . okJSON ( jobs ) ; } catch ( Exception e ) { return HttpResponses . errorJSON ( String . format ( "ERROR: %s" , e . getMessage ( ) ) ) ; }
public class DeviceManager { /** * Push a PIPE EVENT event if some client had registered it * @ param pipeName The pipe name * @ param blob The pipe data * @ throws DevFailed */ public void pushPipeEvent ( final String pipeName , final PipeValue blob ) throws DevFailed { } }
// set attribute value final PipeImpl pipe = DeviceImpl . getPipe ( pipeName , device . getPipeList ( ) ) ; try { pipe . updateValue ( blob ) ; // push the event EventManager . getInstance ( ) . pushPipeEvent ( name , pipeName , blob ) ; } catch ( final DevFailed e ) { EventManager . getInstance ( ) . pushPipeEvent ( name , pipeName , e ) ; }
public class AssertKripton { /** * Assert true or unknown param in JQL exception . * @ param expression * the expression * @ param method * the method * @ param paramName * the param name */ public static void assertTrueOrUnknownParamInJQLException ( boolean expression , SQLiteModelMethod method , String paramName ) { } }
if ( ! expression ) { throw ( new UnknownParamUsedInJQLException ( method , paramName ) ) ; }
public class BiddableAdGroupCriterion { /** * Sets the biddingStrategyConfiguration value for this BiddableAdGroupCriterion . * @ param biddingStrategyConfiguration * Bidding configuration for this ad group criterion . To set the * bids on the ad groups * use { @ link BiddingStrategyConfiguration # bids } . * Multiple bids can be set on * ad group criterion at the same time . Only the * bids that apply to the campaign ' s bidding * strategy { @ linkplain Campaign # biddingStrategyConfiguration * bidding strategy } * will be used . */ public void setBiddingStrategyConfiguration ( com . google . api . ads . adwords . axis . v201809 . cm . BiddingStrategyConfiguration biddingStrategyConfiguration ) { } }
this . biddingStrategyConfiguration = biddingStrategyConfiguration ;
public class ItemTouchHelper { /** * Checks if we should swap w / another view holder . */ void moveIfNecessary ( ViewHolder viewHolder ) { } }
if ( mRecyclerView . isLayoutRequested ( ) ) { return ; } if ( mActionState != ACTION_STATE_DRAG ) { return ; } final float threshold = mCallback . getMoveThreshold ( viewHolder ) ; final int x = ( int ) ( mSelectedStartX + mDx ) ; final int y = ( int ) ( mSelectedStartY + mDy ) ; if ( Math . abs ( y - viewHolder . itemView . getTop ( ) ) < viewHolder . itemView . getHeight ( ) * threshold && Math . abs ( x - viewHolder . itemView . getLeft ( ) ) < viewHolder . itemView . getWidth ( ) * threshold ) { return ; } List < ViewHolder > swapTargets = findSwapTargets ( viewHolder ) ; if ( swapTargets . size ( ) == 0 ) { return ; } // may swap . ViewHolder target = mCallback . chooseDropTarget ( viewHolder , swapTargets , x , y ) ; if ( target == null ) { mSwapTargets . clear ( ) ; mDistances . clear ( ) ; return ; } final int toPosition = target . getAdapterPosition ( ) ; final int fromPosition = viewHolder . getAdapterPosition ( ) ; if ( mCallback . onMove ( mRecyclerView , viewHolder , target ) ) { // keep target visible mCallback . onMoved ( mRecyclerView , viewHolder , fromPosition , target , toPosition , x , y ) ; }
public class PersistenceBrokerImpl { /** * Check if the references of the specified object have enabled * the < em > refresh < / em > attribute and refresh the reference if set < em > true < / em > . * @ throws PersistenceBrokerException if there is a error refreshing collections or references * @ param obj The object to check . * @ param oid The { @ link Identity } of the object . * @ param cld The { @ link org . apache . ojb . broker . metadata . ClassDescriptor } of the object . */ public void checkRefreshRelationships ( Object obj , Identity oid , ClassDescriptor cld ) { } }
Iterator iter ; CollectionDescriptor cds ; ObjectReferenceDescriptor rds ; // to avoid problems with circular references , locally cache the current object instance Object tmp = getInternalCache ( ) . doLocalLookup ( oid ) ; if ( tmp != null && getInternalCache ( ) . isEnabledMaterialisationCache ( ) ) { /* arminw : This should fix OJB - 29 , infinite loops on bidirectional 1:1 relations with refresh attribute ' true ' for both references . OJB now assume that the object is already refreshed when it ' s cached in the materialisation cache */ return ; } try { getInternalCache ( ) . enableMaterializationCache ( ) ; if ( tmp == null ) { getInternalCache ( ) . doInternalCache ( oid , obj , MaterializationCache . TYPE_TEMP ) ; } if ( logger . isDebugEnabled ( ) ) logger . debug ( "Refresh relationships for " + oid ) ; iter = cld . getCollectionDescriptors ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { cds = ( CollectionDescriptor ) iter . next ( ) ; if ( cds . isRefresh ( ) ) { referencesBroker . retrieveCollection ( obj , cld , cds , false ) ; } } iter = cld . getObjectReferenceDescriptors ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { rds = ( ObjectReferenceDescriptor ) iter . next ( ) ; if ( rds . isRefresh ( ) ) { referencesBroker . retrieveReference ( obj , cld , rds , false ) ; } } getInternalCache ( ) . disableMaterializationCache ( ) ; } catch ( RuntimeException e ) { getInternalCache ( ) . doLocalClear ( ) ; throw e ; }
public class SmartTypeResolver { /** * / * ( non - Javadoc ) */ @ Override public Class resolveType ( Object obj ) { } }
if ( obj instanceof Number ) { Number value = ( Number ) obj ; if ( isDecimal ( value ) ) { return ( isFloat ( value ) ? Float . class : Double . class ) ; } else { return ( isByte ( value ) ? Byte . class : ( isShort ( value ) ? Short . class : ( isInteger ( value ) ? Integer . class : Long . class ) ) ) ; } } return super . resolveType ( obj ) ;
public class Element { /** * Change the tag of this element . For example , convert a { @ code < span > } to a { @ code < div > } with * { @ code el . tagName ( " div " ) ; } . * @ param tagName new tag name for this element * @ return this element , for chaining */ public Element tagName ( String tagName ) { } }
Validate . notEmpty ( tagName , "Tag name must not be empty." ) ; tag = Tag . valueOf ( tagName , NodeUtils . parser ( this ) . settings ( ) ) ; // maintains the case option of the original parse return this ;
public class PrefixedPropertyOverrideConfigurer { /** * ( non - Javadoc ) * @ see org . springframework . core . io . support . PropertiesLoaderSupport # * mergeProperties ( ) */ @ Override protected Properties mergeProperties ( ) throws IOException { } }
final PrefixedProperties myProperties = createProperties ( ) ; if ( localOverride ) { loadProperties ( myProperties ) ; } if ( localProperties != null ) { for ( int i = 0 ; i < localProperties . length ; i ++ ) { CollectionUtils . mergePropertiesIntoMap ( localProperties [ i ] , myProperties ) ; } } if ( ! localOverride ) { loadProperties ( myProperties ) ; } return myProperties ;
public class BuildRetentionFactory { /** * Create a Build retention object out of the build * @ param build The build to create the build retention out of * @ param discardOldArtifacts Flag whether to discard artifacts of those builds that are to be discarded . * @ return a new Build retention */ public static BuildRetention createBuildRetention ( Run build , boolean discardOldArtifacts ) { } }
BuildRetention buildRetention = new BuildRetention ( discardOldArtifacts ) ; LogRotator rotator = null ; BuildDiscarder buildDiscarder = build . getParent ( ) . getBuildDiscarder ( ) ; if ( buildDiscarder != null && buildDiscarder instanceof LogRotator ) { rotator = ( LogRotator ) buildDiscarder ; } if ( rotator == null ) { return buildRetention ; } if ( rotator . getNumToKeep ( ) > - 1 ) { buildRetention . setCount ( rotator . getNumToKeep ( ) ) ; } if ( rotator . getDaysToKeep ( ) > - 1 ) { Calendar calendar = Calendar . getInstance ( ) ; calendar . add ( Calendar . DAY_OF_YEAR , - rotator . getDaysToKeep ( ) ) ; buildRetention . setMinimumBuildDate ( new Date ( calendar . getTimeInMillis ( ) ) ) ; } List < String > notToBeDeleted = ExtractorUtils . getBuildNumbersNotToBeDeleted ( build ) ; buildRetention . setBuildNumbersNotToBeDiscarded ( notToBeDeleted ) ; return buildRetention ;
public class RoaringBitmap { /** * Create a new Roaring bitmap containing at most maxcardinality integers . * @ param maxcardinality maximal cardinality * @ return a new bitmap with cardinality no more than maxcardinality */ @ Override public RoaringBitmap limit ( int maxcardinality ) { } }
RoaringBitmap answer = new RoaringBitmap ( ) ; int currentcardinality = 0 ; for ( int i = 0 ; ( currentcardinality < maxcardinality ) && ( i < this . highLowContainer . size ( ) ) ; i ++ ) { Container c = this . highLowContainer . getContainerAtIndex ( i ) ; if ( c . getCardinality ( ) + currentcardinality <= maxcardinality ) { answer . highLowContainer . appendCopy ( this . highLowContainer , i ) ; currentcardinality += c . getCardinality ( ) ; } else { int leftover = maxcardinality - currentcardinality ; Container limited = c . limit ( leftover ) ; answer . highLowContainer . append ( this . highLowContainer . getKeyAtIndex ( i ) , limited ) ; break ; } } return answer ;
public class Table { /** * Returns the Index List that represent unique constraints . */ public List < IndexHolder > getUniqueIndexHolders ( ) { } }
List < IndexHolder > result = newArrayList ( ) ; for ( IndexHolder ih : indexHoldersByName . values ( ) ) { if ( ih . isUnique ( ) ) { result . add ( ih ) ; } } return result ;
public class RelationalOperationsMatrix { /** * with the exterior of Line B . */ private void boundaryAreaExteriorLine_ ( int half_edge , int id_a , int id_b ) { } }
if ( m_matrix [ MatrixPredicate . BoundaryExterior ] == 1 ) return ; int parentage = m_topo_graph . getHalfEdgeParentage ( half_edge ) ; if ( ( parentage & id_a ) != 0 && ( parentage & id_b ) == 0 ) m_matrix [ MatrixPredicate . BoundaryExterior ] = 1 ;
public class Node { /** * Returns the neareast < code > Entry < / code > to the given < code > Cluster < / code > . * The distance is minimized over < code > Entry . calcDistance ( Cluster ) < / code > . * @ param buffer The cluster to which the distance has to be compared . * @ return The < code > Entry < / code > with minimal distance to the given * cluster . * @ throws EmptyNodeException This Exception is thrown when this function is * called on an empty node . * @ see Kernel * @ see Entry # calcDistance ( moa . clusterers . tree . Kernel ) */ public Entry nearestEntry ( ClusKernel buffer ) { } }
// TODO : ( Fernando ) Adapt the nearestEntry ( . . . ) function to the new algorithmn . Entry res = entries [ 0 ] ; double min = res . calcDistance ( buffer ) ; for ( int i = 1 ; i < entries . length ; i ++ ) { Entry entry = entries [ i ] ; if ( entry . isEmpty ( ) ) { break ; } double distance = entry . calcDistance ( buffer ) ; if ( distance < min ) { min = distance ; res = entry ; } } return res ;
public class StartExecutionRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( StartExecutionRequest startExecutionRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( startExecutionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( startExecutionRequest . getStateMachineArn ( ) , STATEMACHINEARN_BINDING ) ; protocolMarshaller . marshall ( startExecutionRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( startExecutionRequest . getInput ( ) , INPUT_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class SystemPublicMetrics { /** * Add metrics from ManagementFactory if possible . Note that ManagementFactory is not available on Google App Engine . * @ param result the result */ private void addManagementMetrics ( Collection < Metric < ? > > result ) { } }
try { // Add JVM up time in ms result . add ( new Metric < > ( "uptime" , ManagementFactory . getRuntimeMXBean ( ) . getUptime ( ) ) ) ; result . add ( new Metric < > ( "systemload.average" , ManagementFactory . getOperatingSystemMXBean ( ) . getSystemLoadAverage ( ) ) ) ; this . addHeapMetrics ( result ) ; addNonHeapMetrics ( result ) ; this . addThreadMetrics ( result ) ; this . addClassLoadingMetrics ( result ) ; this . addGarbageCollectionMetrics ( result ) ; } catch ( NoClassDefFoundError ex ) { // Expected on Google App Engine }
public class appflowparam { /** * Use this API to fetch all the appflowparam resources that are configured on netscaler . */ public static appflowparam get ( nitro_service service ) throws Exception { } }
appflowparam obj = new appflowparam ( ) ; appflowparam [ ] response = ( appflowparam [ ] ) obj . get_resources ( service ) ; return response [ 0 ] ;
public class ScanResult { /** * Returns an ordered list of unique classpath element and module URIs . * @ return The unique classpath element and module URIs . */ public List < URI > getClasspathURIs ( ) { } }
if ( closed . get ( ) ) { throw new IllegalArgumentException ( "Cannot use a ScanResult after it has been closed" ) ; } final List < URI > classpathElementOrderURIs = new ArrayList < > ( ) ; for ( final ClasspathElement classpathElement : classpathOrder ) { try { final URI uri = classpathElement . getURI ( ) ; if ( uri != null ) { classpathElementOrderURIs . add ( uri ) ; } } catch ( final IllegalArgumentException e ) { // Skip null location URIs } } return classpathElementOrderURIs ;
public class GitlabAPI { /** * Get raw file content * @ param project The Project * @ param sha The commit or branch name * @ param filepath The path of the file * @ throws IOException on gitlab api call error */ public byte [ ] getRawFileContent ( GitlabProject project , String sha , String filepath ) throws IOException { } }
return getRawFileContent ( project . getId ( ) , sha , filepath ) ;
public class AbstractColorPickerPreference { /** * Obtains the border color of the preview of the preference ' s color from a specific typed * array . * @ param typedArray * The typed array , the border color should be obtained from , as an instance of the * class { @ link TypedArray } . The typed array may not be null */ private void obtainPreviewBorderColor ( @ NonNull final TypedArray typedArray ) { } }
int defaultValue = ContextCompat . getColor ( getContext ( ) , R . color . color_picker_preference_default_preview_border_color ) ; setPreviewBorderColor ( typedArray . getColor ( R . styleable . AbstractColorPickerPreference_previewBorderColor , defaultValue ) ) ;
public class Index { /** * Custom batch * @ param actions the array of actions */ public JSONObject batch ( List < JSONObject > actions ) throws AlgoliaException { } }
return postBatch ( actions , RequestOptions . empty ) ;
public class UnicodeRegex { /** * Utility for loading lines from a file . * @ param result The result of the appended lines . * @ param file The file to have an input stream . * @ param encoding if null , then UTF - 8 * @ return filled list * @ throws IOException If there were problems opening the file for input stream . */ public static List < String > appendLines ( List < String > result , String file , String encoding ) throws IOException { } }
InputStream is = new FileInputStream ( file ) ; try { return appendLines ( result , is , encoding ) ; } finally { is . close ( ) ; }
public class LifeTimeConnectionWrapper { /** * Rolls the connection back , resets the connection back to defaults , clears warnings , * resets the connection on the server side , and returns the connection to the pool . * @ throws SQLException */ public void close ( ) throws SQLException { } }
validate ( ) ; try { this . connection . rollback ( ) ; this . connection . clearWarnings ( ) ; this . connectionDefaults . setDefaults ( this . connection ) ; this . connection . reset ( ) ; fireCloseEvent ( ) ; } catch ( SQLException e ) { fireSqlExceptionEvent ( e ) ; throw e ; }
public class OIDType { /** * The oid ( object id ) is the type id , than a point and the id itself . If in * the attribute the attribute has no defined type id SQL column name , the * type from the attribute is used ( this means , the type itself is not * derived and has no childs ) . * @ param _ attribute related attribute which is read * @ param _ objectList list of objects from the eFaps Database * @ return Object as needed for eFaps */ @ Override public Object readValue ( final Attribute _attribute , final List < Object > _objectList ) { } }
final List < String > ret = new ArrayList < String > ( ) ; for ( final Object object : _objectList ) { final StringBuilder oid = new StringBuilder ( ) ; if ( object instanceof Object [ ] ) { final Object [ ] temp = ( Object [ ] ) object ; oid . append ( temp [ 0 ] ) . append ( "." ) . append ( temp [ 1 ] ) ; } else { oid . append ( _attribute . getParentId ( ) ) . append ( "." ) . append ( object ) ; } ret . add ( oid . toString ( ) ) ; } return _objectList . size ( ) > 0 ? ( ret . size ( ) > 1 ? ret : ret . get ( 0 ) ) : null ;
public class ErrorUtils { /** * Prints an error message showing a location in the given InputBuffer . * @ param format the format string , must include three placeholders for a string * ( the error message ) and two integers ( the error line / column respectively ) * @ param errorMessage the error message * @ param errorIndex the error location as an index into the inputBuffer * @ param inputBuffer the underlying InputBuffer * @ return the error message including the relevant line from the underlying input plus location indicator */ public static String printErrorMessage ( String format , String errorMessage , int errorIndex , InputBuffer inputBuffer ) { } }
checkArgNotNull ( inputBuffer , "inputBuffer" ) ; return printErrorMessage ( format , errorMessage , errorIndex , errorIndex + 1 , inputBuffer ) ;
public class Driver { /** * { @ inheritDoc } * @ throws IllegalArgumentException if | info | doesn ' t contain handler * ( ConnectionHandler ) for property " connection . handler " . */ public acolyte . jdbc . Connection connect ( final String url , final Properties info ) throws SQLException { } }
if ( ! acceptsURL ( url ) ) { return null ; } // end of if final String [ ] parts = url . substring ( url . lastIndexOf ( "?" ) + 1 ) . split ( "&" ) ; String h = null ; for ( final String p : parts ) { if ( p . startsWith ( "handler=" ) ) { h = p . substring ( 8 ) ; break ; } // end of if } // end of for if ( h == null || h . length ( ) == 0 ) { throw new IllegalArgumentException ( "Invalid handler ID: " + h ) ; } // end of if final String id = h ; final ConnectionHandler handler = handlers . get ( id ) ; if ( handler == null ) { throw new IllegalArgumentException ( "No matching handler: " + id ) ; } // end of if return new acolyte . jdbc . Connection ( url , info , handler ) ;
public class ProcessContext { /** * Returns the usage of the given data attribute by the given * activity . < br > * If the given attribute is not used as input by the given activity , * the returned set contains no elements . The given activity / attribute * have to be known by the context , i . e . be contained in the * activity / attribute list . * @ param activity Activity for which the usage is requested . * @ param attribute Attribute used by the given activity . * @ return The usage of the given data attribute by the given activity . * @ throws ParameterException * @ throws CompatibilityException * @ throws IllegalArgumentException IllegalArgumentException If the * given activity / attribute is not known . * @ see # getActivities ( ) * @ see # getAttributes ( ) */ public Set < DataUsage > getDataUsageFor ( String activity , String attribute ) throws CompatibilityException { } }
validateActivity ( activity ) ; validateAttribute ( attribute ) ; if ( activityDataUsage . get ( activity ) == null ) { return new HashSet < > ( ) ; // No input data elements for this activity } if ( activityDataUsage . get ( activity ) . get ( attribute ) == null ) { return new HashSet < > ( ) ; // Attribute not used by the given activity } return Collections . unmodifiableSet ( activityDataUsage . get ( activity ) . get ( attribute ) ) ;
public class BaseMessagingEngineImpl { /** * Pass the request to delete a localization point onto the localizer object . * @ param lp localization point definition */ final void deleteLocalizationPoint ( JsBus bus , LWMConfig dest ) { } }
String thisMethodName = "deleteLocalizationPoint" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , thisMethodName , dest ) ; } try { _localizer . deleteLocalizationPoint ( bus , dest ) ; } catch ( SIBExceptionBase ex ) { SibTr . exception ( tc , ex ) ; } catch ( SIException e ) { SibTr . exception ( tc , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , thisMethodName ) ; }
public class CmsSearchIndexTable { /** * Returns the available menu entries . < p > * @ return the menu entries */ List < I_CmsSimpleContextMenuEntry < Set < String > > > getMenuEntries ( ) { } }
if ( m_menuEntries == null ) { m_menuEntries = new ArrayList < I_CmsSimpleContextMenuEntry < Set < String > > > ( ) ; m_menuEntries . add ( new EntrySources ( ) ) ; // Option for show Sources of index m_menuEntries . add ( new EntryRebuild ( ) ) ; } return m_menuEntries ;
public class WSJobRepositoryImpl { /** * { @ inheritDoc } */ @ Override public WSStepThreadExecutionAggregate getStepExecutionAggregate ( long topLevelStepExecutionId ) throws IllegalArgumentException , JobSecurityException { } }
if ( authService != null ) { authService . authorizedStepExecutionRead ( topLevelStepExecutionId ) ; } return persistenceManagerService . getStepExecutionAggregate ( topLevelStepExecutionId ) ;
public class QueueProcessor { /** * This method is overridden over parent class so that one piece of data is taken * from the queue and { @ link # process ( Object ) } is invoked . < br > * 这个方法被重载了 , 从而队列中的一份数据会被取出并调用 { @ link # process ( Object ) } 方法 。 */ @ Override protected void consume ( ) { } }
E obj = null ; try { obj = queue . take ( ) ; } catch ( InterruptedException e ) { // thread . isInterrupted ( ) ; return ; } process ( obj ) ;
public class NearestEdgeSnapAlgorithm { /** * Set the full list of target geometries . These are the geometries where to this snapping algorithm can snap . * @ param geometries The list of target geometries . */ public void setGeometries ( Geometry [ ] geometries ) { } }
coordinates . clear ( ) ; for ( Geometry geometry : geometries ) { addCoordinateArrays ( geometry , coordinates ) ; }
public class Weighers { /** * A weigher where an entry has a weight of < tt > 1 < / tt > . A map bounded with * this weigher will evict when the number of key - value pairs exceeds the * capacity . * @ param < K > The key type * @ param < V > The value type * @ return A weigher where a value takes one unit of capacity . */ @ SuppressWarnings ( { } }
"cast" , "unchecked" } ) public static < K , V > EntryWeigher < K , V > entrySingleton ( ) { return ( EntryWeigher < K , V > ) SingletonEntryWeigher . INSTANCE ;
public class Nucleotide { /** * return the phosphate monomer of this nucleotide * @ return phosphate monomer */ public Monomer getPhosphateMonomer ( ) { } }
MonomerFactory factory = null ; try { factory = MonomerFactory . getInstance ( ) ; } catch ( Exception ex ) { Logger . getLogger ( Nucleotide . class . getName ( ) ) . log ( Level . SEVERE , "Unable to initialize monomer factory" , ex ) ; } return getPhosphateMonomer ( factory . getMonomerStore ( ) ) ;
public class Util { /** * A utility method that creates a deep clone of the specified object . * There is no other way of doing this reliably . * @ param fromBean java bean to be cloned . * @ return a new java bean cloned from fromBean . */ protected static Object deepCopy ( Object fromBean ) { } }
ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; XMLEncoder out = new XMLEncoder ( bos ) ; out . writeObject ( fromBean ) ; out . close ( ) ; ByteArrayInputStream bis = new ByteArrayInputStream ( bos . toByteArray ( ) ) ; XMLDecoder in = new XMLDecoder ( bis , null , null , JsonDBTemplate . class . getClassLoader ( ) ) ; Object toBean = in . readObject ( ) ; in . close ( ) ; return toBean ;
public class Util { /** * / * Use alpha channel to compute percentage RGB share in blending . * * Background color may be visible only if foreground alpha is smaller than 100% */ public static int alphaMixColors ( int backgroundColor , int foregroundColor ) { } }
final byte ALPHA_CHANNEL = 24 ; final byte RED_CHANNEL = 16 ; final byte GREEN_CHANNEL = 8 ; final byte BLUE_CHANNEL = 0 ; final double ap1 = ( double ) ( backgroundColor >> ALPHA_CHANNEL & 0xff ) / 255d ; final double ap2 = ( double ) ( foregroundColor >> ALPHA_CHANNEL & 0xff ) / 255d ; final double ap = ap2 + ( ap1 * ( 1 - ap2 ) ) ; final double amount1 = ( ap1 * ( 1 - ap2 ) ) / ap ; final double amount2 = amount1 / ap ; int a = ( ( int ) ( ap * 255d ) ) & 0xff ; int r = ( ( int ) ( ( ( float ) ( backgroundColor >> RED_CHANNEL & 0xff ) * amount1 ) + ( ( float ) ( foregroundColor >> RED_CHANNEL & 0xff ) * amount2 ) ) ) & 0xff ; int g = ( ( int ) ( ( ( float ) ( backgroundColor >> GREEN_CHANNEL & 0xff ) * amount1 ) + ( ( float ) ( foregroundColor >> GREEN_CHANNEL & 0xff ) * amount2 ) ) ) & 0xff ; int b = ( ( int ) ( ( ( float ) ( backgroundColor & 0xff ) * amount1 ) + ( ( float ) ( foregroundColor & 0xff ) * amount2 ) ) ) & 0xff ; return a << ALPHA_CHANNEL | r << RED_CHANNEL | g << GREEN_CHANNEL | b << BLUE_CHANNEL ;
public class Metrics { /** * if metrics is not null returns a Counter instance for a given component and method name . * @ param metrics factory instance to get timer . * @ param component name for the requested timer . * @ param methodName for the requested timer . * @ return counter instance . */ public static Counter counter ( Metrics metrics , String component , String methodName ) { } }
if ( metrics != null ) { return metrics . getCounter ( component , methodName ) ; } else { return null ; }
public class SortedGrouping { /** * Uses a custom partitioner for the grouping . * @ param partitioner The custom partitioner . * @ return The grouping object itself , to allow for method chaining . */ public SortedGrouping < T > withPartitioner ( Partitioner < ? > partitioner ) { } }
Preconditions . checkNotNull ( partitioner ) ; getKeys ( ) . validateCustomPartitioner ( partitioner , null ) ; this . customPartitioner = partitioner ; return this ;
public class RubyIO { /** * Reads the content of a file . * @ return String * @ throws IllegalStateException * if file is not readable */ public String read ( ) { } }
if ( mode . isReadable ( ) == false ) throw new IllegalStateException ( "IOError: not opened for reading" ) ; StringBuilder sb = new StringBuilder ( ) ; try { BufferedReader reader = new BufferedReader ( new FileReader ( file ) ) ; char [ ] buf = new char [ 1024 ] ; int numOfChars = 0 ; while ( ( numOfChars = reader . read ( buf ) ) != - 1 ) { sb . append ( String . valueOf ( buf , 0 , numOfChars ) ) ; } reader . close ( ) ; } catch ( IOException e ) { logger . log ( Level . SEVERE , null , e ) ; throw new RuntimeException ( e ) ; } return sb . toString ( ) ;
public class BaasACL { /** * Returns the roles that have the specified { @ code grant } * @ param grant a { @ link com . baasbox . android . Grant } * @ return */ public Set < String > rolesWithGrant ( Grant grant ) { } }
if ( grant == null ) throw new IllegalArgumentException ( "grant cannot be null" ) ; return rolesGrants . get ( grant ) ;
public class policydataset { /** * Use this API to add policydataset . */ public static base_response add ( nitro_service client , policydataset resource ) throws Exception { } }
policydataset addresource = new policydataset ( ) ; addresource . name = resource . name ; addresource . type = resource . type ; addresource . indextype = resource . indextype ; return addresource . add_resource ( client ) ;
public class OkCoinTradeServiceRaw { /** * 下单交易 * @ param symbol * @ param type * @ param price * @ param amount ( 只能是整数 ) * @ return * @ throws IOException */ public OkCoinTradeResult trade ( String symbol , String type , String price , String amount ) throws IOException { } }
OkCoinTradeResult tradeResult = okCoin . trade ( apikey , symbol , type , price , amount , signatureCreator ( ) ) ; return returnOrThrow ( tradeResult ) ;
public class LocIterator { /** * Get portion of bounding location that has not yet been retrieved by next ( ) method . * @ return The location not yet retrieved . */ public Location remainder ( ) { } }
Location remainder = null ; if ( mPosition == 0 ) { remainder = mBounds ; } else { if ( mIncrement > 0 ) { remainder = mBounds . suffix ( mPosition ) ; } else { remainder = mBounds . prefix ( mPosition ) ; } } return remainder ;
public class CanvasOverlay { /** * Get a { @ link VerticalLine } instance * @ return VerticalLine */ public VerticalLine verticalLineInstance ( ) { } }
LineObject lineObject = new LineObject ( ) ; VerticalLine verticalLine = lineObject . verticalLineInstance ( ) ; objectsInstance ( ) . add ( lineObject ) ; return verticalLine ;
public class AbstractBinaryMemcacheDecoder { /** * Helper method to create a message indicating a invalid decoding result . * @ param cause the cause of the decoding failure . * @ return a valid message indicating failure . */ private M invalidMessage ( Exception cause ) { } }
state = State . BAD_MESSAGE ; M message = buildInvalidMessage ( ) ; message . setDecoderResult ( DecoderResult . failure ( cause ) ) ; return message ;
public class AnimaQuery { /** * generate " < " statement , simultaneous setting value * @ param column table column name [ sql ] * @ param value column value * @ return AnimaQuery */ public AnimaQuery < T > lt ( String column , Object value ) { } }
conditionSQL . append ( " AND " ) . append ( column ) . append ( " < ?" ) ; paramValues . add ( value ) ; return this ;
public class GeomUtil { /** * Combine two shapes * @ param target The target shape * @ param missing The second shape to apply * @ param subtract True if we should subtract missing from target , otherwise union * @ param start The point to start at * @ return The newly created shape */ private Shape combineSingle ( Shape target , Shape missing , boolean subtract , int start ) { } }
Shape current = target ; Shape other = missing ; int point = start ; int dir = 1 ; Polygon poly = new Polygon ( ) ; boolean first = true ; int loop = 0 ; // while we ' ve not reached the same point float px = current . getPoint ( point ) [ 0 ] ; float py = current . getPoint ( point ) [ 1 ] ; while ( ! poly . hasVertex ( px , py ) || ( first ) || ( current != target ) ) { first = false ; loop ++ ; if ( loop > MAX_POINTS ) { break ; } // add the current point to the result shape poly . addPoint ( px , py ) ; if ( listener != null ) { listener . pointUsed ( px , py ) ; } // if the line between the current point and the next one intersect the // other shape work out where on the other shape and start traversing it ' s // path instead Line line = getLine ( current , px , py , rationalPoint ( current , point + dir ) ) ; HitResult hit = intersect ( other , line ) ; if ( hit != null ) { Line hitLine = hit . line ; Vector2f pt = hit . pt ; px = pt . x ; py = pt . y ; if ( listener != null ) { listener . pointIntersected ( px , py ) ; } if ( other . hasVertex ( px , py ) ) { point = other . indexOf ( pt . x , pt . y ) ; dir = 1 ; px = pt . x ; py = pt . y ; Shape temp = current ; current = other ; other = temp ; continue ; } float dx = hitLine . getDX ( ) / hitLine . length ( ) ; float dy = hitLine . getDY ( ) / hitLine . length ( ) ; dx *= EDGE_SCALE ; dy *= EDGE_SCALE ; if ( current . contains ( pt . x + dx , pt . y + dy ) ) { // the point is the next one , we need to take the first and traverse // the path backwards if ( subtract ) { if ( current == missing ) { point = hit . p2 ; dir = - 1 ; } else { point = hit . p1 ; dir = 1 ; } } else { if ( current == target ) { point = hit . p2 ; dir = - 1 ; } else { point = hit . p2 ; dir = - 1 ; } } // swap the shapes over , we ' ll traverse the other one Shape temp = current ; current = other ; other = temp ; } else if ( current . contains ( pt . x - dx , pt . y - dy ) ) { if ( subtract ) { if ( current == target ) { point = hit . p2 ; dir = - 1 ; } else { point = hit . p1 ; dir = 1 ; } } else { if ( current == missing ) { point = hit . p1 ; dir = 1 ; } else { point = hit . p1 ; dir = 1 ; } } // swap the shapes over , we ' ll traverse the other one Shape temp = current ; current = other ; other = temp ; } else { // give up if ( subtract ) { break ; } else { point = hit . p1 ; dir = 1 ; Shape temp = current ; current = other ; other = temp ; point = rationalPoint ( current , point + dir ) ; px = current . getPoint ( point ) [ 0 ] ; py = current . getPoint ( point ) [ 1 ] ; } } } else { // otherwise just move to the next point in the current shape point = rationalPoint ( current , point + dir ) ; px = current . getPoint ( point ) [ 0 ] ; py = current . getPoint ( point ) [ 1 ] ; } } poly . addPoint ( px , py ) ; if ( listener != null ) { listener . pointUsed ( px , py ) ; } return poly ;
public class RepositoryManagerImpl { /** * Returns the { @ link javax . jcr . Repository } instance with the given name . * @ param repositoryName a { @ code non - null } string * @ return a { @ link javax . jcr . Repository } instance , never { @ code null } * @ throws org . wisdom . jcr . modeshape . api . NoSuchRepositoryException if no repository with the given name exists . */ @ Override public Repository getRepository ( String repositoryName ) throws NoSuchRepositoryException { } }
Repository repository = null ; try { Map < String , String > map = new HashMap < > ( ) ; map . put ( org . modeshape . jcr . api . RepositoryFactory . REPOSITORY_NAME , repositoryName ) ; repository = repositoryFactory . getRepository ( map ) ; } catch ( RepositoryException e ) { throw new NoSuchRepositoryException ( WebJcrI18n . cannotInitializeRepository . text ( repositoryName ) , e ) ; } if ( repository == null ) { throw new NoSuchRepositoryException ( WebJcrI18n . repositoryNotFound . text ( repositoryName ) ) ; } return repository ;
public class PgResultSet { /** * # if mvn . project . property . postgresql . jdbc . spec > = " JDBC4.2" */ private LocalDateTime getLocalDateTime ( int i ) throws SQLException { } }
checkResultSet ( i ) ; if ( wasNullFlag ) { return null ; } int col = i - 1 ; int oid = fields [ col ] . getOID ( ) ; if ( oid != Oid . TIMESTAMP ) { throw new PSQLException ( GT . tr ( "Cannot convert the column of type {0} to requested type {1}." , Oid . toString ( oid ) , "timestamp" ) , PSQLState . DATA_TYPE_MISMATCH ) ; } if ( isBinary ( i ) ) { TimeZone timeZone = getDefaultCalendar ( ) . getTimeZone ( ) ; return connection . getTimestampUtils ( ) . toLocalDateTimeBin ( timeZone , thisRow [ col ] ) ; } String string = getString ( i ) ; return connection . getTimestampUtils ( ) . toLocalDateTime ( string ) ;
public class TransactionIntegrationImpl { /** * { @ inheritDoc } */ public boolean isFirstResource ( ManagedConnection mc ) { } }
return mc != null && mc instanceof org . ironjacamar . core . spi . transaction . FirstResource ;
public class RecastMesh { /** * diagonal of P . */ private static boolean diagonal ( int i , int j , int n , int [ ] verts , int [ ] indices ) { } }
return inCone ( i , j , n , verts , indices ) && diagonalie ( i , j , n , verts , indices ) ;
public class Vector3f { /** * / * ( non - Javadoc ) * @ see org . joml . Vector3fc # distanceSquared ( org . joml . Vector3fc ) */ public float distanceSquared ( Vector3fc v ) { } }
return distanceSquared ( v . x ( ) , v . y ( ) , v . z ( ) ) ;
public class TldDetection { /** * Detects the object inside the image . Eliminates candidate regions using a cascade of tests */ protected void detectionCascade ( FastQueue < ImageRectangle > cascadeRegions ) { } }
// initialize data structures success = false ; ambiguous = false ; best = null ; candidateDetections . reset ( ) ; localMaximums . reset ( ) ; ambiguousRegions . clear ( ) ; storageMetric . reset ( ) ; storageIndexes . reset ( ) ; storageRect . clear ( ) ; fernRegions . clear ( ) ; fernInfo . reset ( ) ; int totalP = 0 ; int totalN = 0 ; // Run through all candidate regions , ignore ones without enough variance , compute // the fern for each one TldRegionFernInfo info = fernInfo . grow ( ) ; for ( int i = 0 ; i < cascadeRegions . size ; i ++ ) { ImageRectangle region = cascadeRegions . get ( i ) ; if ( ! variance . checkVariance ( region ) ) { continue ; } info . r = region ; if ( fern . lookupFernPN ( info ) ) { totalP += info . sumP ; totalN += info . sumN ; info = fernInfo . grow ( ) ; } } fernInfo . removeTail ( ) ; // avoid overflow errors in the future by re - normalizing the Fern detector if ( totalP > 0x0fffffff ) fern . renormalizeP ( ) ; if ( totalN > 0x0fffffff ) fern . renormalizeN ( ) ; // Select the ferns with the highest likelihood selectBestRegionsFern ( totalP , totalN ) ; // From the remaining regions , score using the template algorithm computeTemplateConfidence ( ) ; if ( candidateDetections . size == 0 ) { return ; } // use non - maximum suppression to reduce the number of candidates nonmax . process ( candidateDetections , localMaximums ) ; best = selectBest ( ) ; if ( best != null ) { ambiguous = checkAmbiguous ( best ) ; success = true ; }
public class FontLoader { /** * Apply a typeface to a given view by id * @ param activity the activity in which the textview resides * @ param viewId the id of the textview you want to style * @ param type the typeface code to apply */ public static void apply ( Activity activity , int viewId , Face type ) { } }
TextView text = ( TextView ) activity . findViewById ( viewId ) ; if ( text != null ) apply ( text , type ) ;
public class WpsProcessExecuteService { /** * Removes the passed WpsProcessExecute from all WpsPlugins and afterwards * deletes the WpsProcessExecute itself . This overrides the generic method * to delete { @ link AbstractCrudService # delete ( de . terrestris . shoguncore . model . PersistentObject ) } . * @ param wpsProcessExecute */ @ Override @ PreAuthorize ( "hasRole(@configHolder.getSuperAdminRoleName()) or hasPermission(#plugin, 'DELETE')" ) public void delete ( E wpsProcessExecute ) { } }
if ( wpsPluginService == null ) { LOG . error ( "WPSProcessExecute cannot be deleted, failed to autowire WpsPluginService" ) ; return ; } WpsPluginDao < WpsPlugin > wpsPluginDao = wpsPluginService . getDao ( ) ; SimpleExpression eqProcess = Restrictions . eq ( "process" , wpsProcessExecute ) ; List < WpsPlugin > wpsPlugins = wpsPluginDao . findByCriteria ( eqProcess ) ; Integer processId = wpsProcessExecute . getId ( ) ; for ( WpsPlugin wpsPlugin : wpsPlugins ) { WpsProcessExecute process = wpsPlugin . getProcess ( ) ; if ( process != null ) { String msg = String . format ( "Remove WpsProcessExecute (id=%s) from WpsPlugin (id=%s)" , processId , wpsPlugin . getId ( ) ) ; LOG . debug ( msg ) ; wpsPlugin . setProcess ( null ) ; wpsPluginService . saveOrUpdate ( wpsPlugin ) ; } } LOG . debug ( String . format ( "Delete plugin (id=%s)" , processId ) ) ; // Call overridden parent to actually delete the entity itself super . delete ( wpsProcessExecute ) ;
public class NeuralNetworkParser { /** * 获取某个状态的上下文 * @ param s 状态 * @ param ctx 上下文 */ void get_context ( final State s , Context ctx ) { } }
ctx . S0 = ( s . stack . size ( ) > 0 ? s . stack . get ( s . stack . size ( ) - 1 ) : - 1 ) ; ctx . S1 = ( s . stack . size ( ) > 1 ? s . stack . get ( s . stack . size ( ) - 2 ) : - 1 ) ; ctx . S2 = ( s . stack . size ( ) > 2 ? s . stack . get ( s . stack . size ( ) - 3 ) : - 1 ) ; ctx . N0 = ( s . buffer < s . ref . size ( ) ? s . buffer : - 1 ) ; ctx . N1 = ( s . buffer + 1 < s . ref . size ( ) ? s . buffer + 1 : - 1 ) ; ctx . N2 = ( s . buffer + 2 < s . ref . size ( ) ? s . buffer + 2 : - 1 ) ; ctx . S0L = ( ctx . S0 >= 0 ? s . left_most_child . get ( ctx . S0 ) : - 1 ) ; ctx . S0R = ( ctx . S0 >= 0 ? s . right_most_child . get ( ctx . S0 ) : - 1 ) ; ctx . S0L2 = ( ctx . S0 >= 0 ? s . left_2nd_most_child . get ( ctx . S0 ) : - 1 ) ; ctx . S0R2 = ( ctx . S0 >= 0 ? s . right_2nd_most_child . get ( ctx . S0 ) : - 1 ) ; ctx . S0LL = ( ctx . S0L >= 0 ? s . left_most_child . get ( ctx . S0L ) : - 1 ) ; ctx . S0RR = ( ctx . S0R >= 0 ? s . right_most_child . get ( ctx . S0R ) : - 1 ) ; ctx . S1L = ( ctx . S1 >= 0 ? s . left_most_child . get ( ctx . S1 ) : - 1 ) ; ctx . S1R = ( ctx . S1 >= 0 ? s . right_most_child . get ( ctx . S1 ) : - 1 ) ; ctx . S1L2 = ( ctx . S1 >= 0 ? s . left_2nd_most_child . get ( ctx . S1 ) : - 1 ) ; ctx . S1R2 = ( ctx . S1 >= 0 ? s . right_2nd_most_child . get ( ctx . S1 ) : - 1 ) ; ctx . S1LL = ( ctx . S1L >= 0 ? s . left_most_child . get ( ctx . S1L ) : - 1 ) ; ctx . S1RR = ( ctx . S1R >= 0 ? s . right_most_child . get ( ctx . S1R ) : - 1 ) ;
public class CmsXmlUtils { /** * Removes the last Xpath index from the given path . < p > * Examples : < br > * < code > title < / code > is left untouched < br > * < code > title [ 1 ] < / code > becomes < code > title < / code > < br > * < code > title / subtitle < / code > is left untouched < br > * < code > title [ 1 ] / subtitle [ 1 ] < / code > becomes < code > title [ 1 ] / subtitle < / code > < p > * @ param path the path to remove the Xpath index from * @ return the path with the last Xpath index removed */ public static String removeXpathIndex ( String path ) { } }
int pos1 = path . lastIndexOf ( '/' ) ; int pos2 = path . lastIndexOf ( '[' ) ; if ( ( pos2 < 0 ) || ( pos1 > pos2 ) ) { return path ; } return path . substring ( 0 , pos2 ) ;
public class Version { /** * < pre > * Environment variables available to the application . * Only returned in ` GET ` requests if ` view = FULL ` is set . * < / pre > * < code > map & lt ; string , string & gt ; env _ variables = 104 ; < / code > */ public boolean containsEnvVariables ( java . lang . String key ) { } }
if ( key == null ) { throw new java . lang . NullPointerException ( ) ; } return internalGetEnvVariables ( ) . getMap ( ) . containsKey ( key ) ;
public class Session { /** * { @ inheritDoc } */ @ Override public void waitForRunningCommit ( ) throws TTIOException { } }
if ( mCommitRunning != null ) { try { // long time = System . currentTimeMillis ( ) ; mCommitRunning . get ( ) ; // System . out . println ( System . currentTimeMillis ( ) - time ) ; mCommitRunning = null ; } catch ( InterruptedException | ExecutionException exc ) { throw new TTIOException ( exc ) ; } }
public class GetSMSAttributesRequest { /** * A list of the individual attribute names , such as < code > MonthlySpendLimit < / code > , for which you want values . * For all attribute names , see < a * href = " https : / / docs . aws . amazon . com / sns / latest / api / API _ SetSMSAttributes . html " > SetSMSAttributes < / a > . * If you don ' t use this parameter , Amazon SNS returns all SMS attributes . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setAttributes ( java . util . Collection ) } or { @ link # withAttributes ( java . util . Collection ) } if you want to * override the existing values . * @ param attributes * A list of the individual attribute names , such as < code > MonthlySpendLimit < / code > , for which you want * values . < / p > * For all attribute names , see < a * href = " https : / / docs . aws . amazon . com / sns / latest / api / API _ SetSMSAttributes . html " > SetSMSAttributes < / a > . * If you don ' t use this parameter , Amazon SNS returns all SMS attributes . * @ return Returns a reference to this object so that method calls can be chained together . */ public GetSMSAttributesRequest withAttributes ( String ... attributes ) { } }
if ( this . attributes == null ) { setAttributes ( new com . amazonaws . internal . SdkInternalList < String > ( attributes . length ) ) ; } for ( String ele : attributes ) { this . attributes . add ( ele ) ; } return this ;
public class JarXtractor { /** * Extract class names from the given jar . This method is for debugging * purpose . * @ param jarName * path to jar file * @ throws IOException * in case file is not found */ private static List < String > extractClassNames ( String jarName ) throws IOException { } }
List < String > classes = new LinkedList < String > ( ) ; ZipInputStream orig = new ZipInputStream ( new FileInputStream ( jarName ) ) ; for ( ZipEntry entry = orig . getNextEntry ( ) ; entry != null ; entry = orig . getNextEntry ( ) ) { String fullName = entry . getName ( ) . replaceAll ( "/" , "." ) . replace ( ".class" , "" ) ; classes . add ( fullName ) ; } orig . close ( ) ; return classes ;
public class Configuration { /** * Used in erb */ public Map < String , Map < String , Object > > getPropertyMetadataAndValuesAsMap ( ) { } }
Map < String , Map < String , Object > > configMap = new HashMap < > ( ) ; for ( ConfigurationProperty property : this ) { Map < String , Object > mapValue = new HashMap < > ( ) ; mapValue . put ( "isSecure" , property . isSecure ( ) ) ; if ( property . isSecure ( ) ) { mapValue . put ( VALUE_KEY , property . getEncryptedValue ( ) ) ; } else { final String value = property . getConfigurationValue ( ) == null ? null : property . getConfigurationValue ( ) . getValue ( ) ; mapValue . put ( VALUE_KEY , value ) ; } mapValue . put ( "displayValue" , property . getDisplayValue ( ) ) ; configMap . put ( property . getConfigKeyName ( ) , mapValue ) ; } return configMap ;
public class MessageProcessor { /** * Starts a new thread from the MP Consumers Thread Pool Only consumer * threads should use this thread pool . * @ param runnable * @ throws InterruptedException */ public void startNewThread ( Runnable runnable ) throws InterruptedException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "startNewThread" ) ; if ( _consumerThreadPool == null ) { createConsumerThreadPool ( ) ; } try { _consumerThreadPool . execute ( runnable , ThreadPool . EXPAND_WHEN_QUEUE_IS_FULL_WAIT_AT_LIMIT ) ; } catch ( ThreadPoolQueueIsFullException e ) { // Exception should never occur as we are waiting when the queue is // full . FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.MessageProcessor.startNewThread" , "1:2705:1.445" , this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "startNewThread" ) ;
public class ClientImpl { /** * Asynchronously invoke a procedure call . * @ param callback TransactionCallback that will be invoked with procedure results . * @ param batchTimeout procedure invocation batch timeout . * @ param procName class name ( not qualified by package ) of the procedure to execute . * @ param timeout timeout for the procedure * @ param allPartition whether this is an all - partition invocation * @ param unit TimeUnit of procedure timeout * @ param parameters vararg list of procedure ' s parameter values . * @ return True if the procedure was queued and false otherwise */ public boolean callProcedureWithClientTimeout ( ProcedureCallback callback , int batchTimeout , boolean allPartition , String procName , long clientTimeout , TimeUnit clientTimeoutUnit , Object ... parameters ) throws IOException , NoConnectionsException { } }
if ( callback instanceof ProcedureArgumentCacher ) { ( ( ProcedureArgumentCacher ) callback ) . setArgs ( parameters ) ; } long handle = m_handle . getAndIncrement ( ) ; ProcedureInvocation invocation = new ProcedureInvocation ( handle , batchTimeout , allPartition , procName , parameters ) ; if ( m_isShutdown ) { return false ; } if ( callback == null ) { callback = NULL_CALLBACK ; } return internalAsyncCallProcedure ( callback , clientTimeoutUnit . toNanos ( clientTimeout ) , invocation ) ;
public class AWSIotClient { /** * Lists OTA updates . * @ param listOTAUpdatesRequest * @ return Result of the ListOTAUpdates operation returned by the service . * @ throws InvalidRequestException * The request is not valid . * @ throws ThrottlingException * The rate exceeds the limit . * @ throws UnauthorizedException * You are not authorized to perform this operation . * @ throws InternalFailureException * An unexpected error has occurred . * @ throws ServiceUnavailableException * The service is temporarily unavailable . * @ sample AWSIot . ListOTAUpdates */ @ Override public ListOTAUpdatesResult listOTAUpdates ( ListOTAUpdatesRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeListOTAUpdates ( request ) ;
public class AbstractTextFileConverter { /** * Initializes the resource storing the MIME encoding names and its mapping to classic < code > java . io < / code > encoding names . */ private static void initEncodingResource ( ) { } }
try { theEncodingResource = ResourceBundle . getBundle ( RB_PREXIX + RB_ENCODING ) ; } // try catch ( MissingResourceException _exception ) { _exception . printStackTrace ( ) ; } // catch ( MissingResourceException _ exception )
public class Trie { /** * 建立failure表 */ private void constructFailureStates ( ) { } }
Queue < State > queue = new LinkedBlockingDeque < State > ( ) ; // 第一步 , 将深度为1的节点的failure设为根节点 for ( State depthOneState : this . rootState . getStates ( ) ) { depthOneState . setFailure ( this . rootState ) ; queue . add ( depthOneState ) ; } this . failureStatesConstructed = true ; // 第二步 , 为深度 > 1 的节点建立failure表 , 这是一个bfs while ( ! queue . isEmpty ( ) ) { State currentState = queue . remove ( ) ; for ( Character transition : currentState . getTransitions ( ) ) { State targetState = currentState . nextState ( transition ) ; queue . add ( targetState ) ; State traceFailureState = currentState . failure ( ) ; while ( traceFailureState . nextState ( transition ) == null ) { traceFailureState = traceFailureState . failure ( ) ; } State newFailureState = traceFailureState . nextState ( transition ) ; targetState . setFailure ( newFailureState ) ; targetState . addEmit ( newFailureState . emit ( ) ) ; } }
public class HttpResponseImpl { /** * @ see com . ibm . websphere . http . HttpResponse # setContentLength ( long ) */ @ Override public void setContentLength ( long length ) { } }
this . message . setContentLength ( length ) ; if ( this . body != null ) { this . body . setContentLength ( length ) ; }
public class ClassUtil { /** * 获得指定类过滤后的Public方法列表 * @ param clazz 查找方法的类 * @ param filter 过滤器 * @ return 过滤后的方法列表 */ public static List < Method > getPublicMethods ( Class < ? > clazz , Filter < Method > filter ) { } }
return ReflectUtil . getPublicMethods ( clazz , filter ) ;
public class TouchImageView { /** * Performs boundary checking and fixes the image matrix if it * is out of bounds . */ private void fixTrans ( ) { } }
matrix . getValues ( m ) ; float transX = m [ Matrix . MTRANS_X ] ; float transY = m [ Matrix . MTRANS_Y ] ; float fixTransX = getFixTrans ( transX , viewWidth , getImageWidth ( ) ) ; float fixTransY = getFixTrans ( transY , viewHeight , getImageHeight ( ) ) ; if ( fixTransX != 0 || fixTransY != 0 ) { matrix . postTranslate ( fixTransX , fixTransY ) ; }
public class FeatureWebSecurityCollaboratorImpl { /** * { @ inheritDoc } */ @ Override public RoleSet getRolesForAccessId ( String resourceName , String accessId , String realmName ) { } }
RoleSet roles = null ; AuthorizationTableService authzTable = featureTables . get ( resourceName ) ; if ( authzTable != null ) roles = authzTable . getRolesForAccessId ( resourceName , accessId , realmName ) ; return roles ;
public class HelpDoclet { /** * Process the classes that have been included by the javadoc process in the rootDoc object . * @ param rootDoc root structure containing the the set of objects accumulated by the javadoc process */ private void processDocs ( final RootDoc rootDoc ) { } }
this . rootDoc = rootDoc ; // Get a list of all the features and groups that we ' ll actually retain workUnits = computeWorkUnits ( ) ; final Set < String > uniqueGroups = new HashSet < > ( ) ; final List < Map < String , String > > featureMaps = new ArrayList < > ( ) ; final List < Map < String , String > > groupMaps = new ArrayList < > ( ) ; // First pass over work units : create the top level map of features and groups workUnits . stream ( ) . forEach ( workUnit -> { featureMaps . add ( indexDataMap ( workUnit ) ) ; if ( ! uniqueGroups . contains ( workUnit . getGroupName ( ) ) ) { uniqueGroups . add ( workUnit . getGroupName ( ) ) ; groupMaps . add ( getGroupMap ( workUnit ) ) ; } } ) ; // Second pass : populate the property map for each work unit workUnits . stream ( ) . forEach ( workUnit -> { workUnit . processDoc ( featureMaps , groupMaps ) ; } ) ; // Third pass : Generate the individual outputs for each work unit , and the top - level index file emitOutputFromTemplates ( groupMaps , featureMaps ) ;
public class MPDUtility { /** * This method converts between the duration units representation * used in the MPP file , and the standard MPX duration units . * If the supplied units are unrecognised , the units default to days . * @ param type MPP units * @ return MPX units */ public static final TimeUnit getDurationTimeUnits ( int type ) { } }
TimeUnit units ; switch ( type & DURATION_UNITS_MASK ) { case 3 : { units = TimeUnit . MINUTES ; break ; } case 4 : { units = TimeUnit . ELAPSED_MINUTES ; break ; } case 5 : { units = TimeUnit . HOURS ; break ; } case 6 : { units = TimeUnit . ELAPSED_HOURS ; break ; } case 8 : { units = TimeUnit . ELAPSED_DAYS ; break ; } case 9 : { units = TimeUnit . WEEKS ; break ; } case 10 : { units = TimeUnit . ELAPSED_WEEKS ; break ; } case 11 : { units = TimeUnit . MONTHS ; break ; } case 12 : { units = TimeUnit . ELAPSED_MONTHS ; break ; } default : case 7 : { units = TimeUnit . DAYS ; break ; } } return ( units ) ;
public class Extension { /** * Returns a new collection of all AuthenticationProvider subclasses having * the given names . If any class does not exist or isn ' t actually a * subclass of AuthenticationProvider , an exception will be thrown , and * no further AuthenticationProvider classes will be loaded . * @ param names * The names of the AuthenticationProvider classes to retrieve . * @ return * A new collection of all AuthenticationProvider subclasses having the * given names . * @ throws GuacamoleException * If any given class does not exist , or if any given class is not a * subclass of AuthenticationProvider . */ private Collection < Class < AuthenticationProvider > > getAuthenticationProviderClasses ( Collection < String > names ) throws GuacamoleException { } }
// If no classnames are provided , just return an empty list if ( names == null ) return Collections . < Class < AuthenticationProvider > > emptyList ( ) ; // Define all auth provider classes Collection < Class < AuthenticationProvider > > classes = new ArrayList < Class < AuthenticationProvider > > ( names . size ( ) ) ; for ( String name : names ) classes . add ( getAuthenticationProviderClass ( name ) ) ; // Callers should not rely on modifying the result return Collections . unmodifiableCollection ( classes ) ;
public class DefaultFeatureForm { /** * Get a string value from the form , and place it in < code > attribute < / code > . * @ param name attribute name * @ param attribute attribute to put value * @ since 1.11.1 */ @ Api public void getValue ( String name , StringAttribute attribute ) { } }
attribute . setValue ( ( String ) formWidget . getValue ( name ) ) ;
public class BranchCreator { /** * Creates required cadmium branches using the given basename . * This will also create the source branch . The branches created will be as follows : * < ul > * < li > < i > basename < / i > < / li > * < li > cd - < i > basename < / i > < / li > * < li > cfg - < i > basename < / i > < / li > * < / ul > * @ param basename The basename used for all branches that will be created . * @ param empty If true the branches will all be created with no content . If false the * branches will be created off of the associated < i > master < / i > branch . * @ param log * @ throws Exception */ public void createNewBranches ( String basename , boolean empty , Logger log ) throws Exception { } }
createNewBranch ( null , basename , empty , log ) ; createNewBranch ( "cd" , basename , empty , log ) ; createNewBranch ( "cfg" , basename , empty , log ) ;
public class TimeZoneNamesImpl { /** * ( non - Javadoc ) * @ see android . icu . text . TimeZoneNames # getTimeZoneDisplayName ( java . lang . String , android . icu . text . TimeZoneNames . NameType ) */ @ Override public String getTimeZoneDisplayName ( String tzID , NameType type ) { } }
if ( tzID == null || tzID . length ( ) == 0 ) { return null ; } return loadTimeZoneNames ( tzID ) . getName ( type ) ;
public class ApiModelToGedObjectVisitor { /** * { @ inheritDoc } */ @ Override public void visit ( final ApiPerson person ) { } }
gedObject = new Person ( builder . getRoot ( ) , new ObjectId ( person . getString ( ) ) ) ; new AttributeListHelper ( this ) . addAttributes ( person ) ;
public class CustomTag { /** * Retrieves attribute name . */ public String getAttributeName ( ) { } }
return ! StringUtils . isEmpty ( attribute ) && attribute . contains ( "." ) ? attribute . substring ( attribute . indexOf ( "." ) + 1 , attribute . length ( ) ) : "" ;
public class AbstractZKClient { /** * Returns both the data as a byte [ ] as well as the stat ( and sets a watcher if not null ) */ @ Override public ZKData < byte [ ] > getZKByteData ( String path , Watcher watcher ) throws InterruptedException , KeeperException { } }
Stat stat = new Stat ( ) ; return new ZKData < byte [ ] > ( getData ( path , watcher , stat ) , stat ) ;