signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class CoreTranslet { @ Override public String getMessage ( String code , Object [ ] args , String defaultMessage , Locale locale ) { } }
return activity . getActivityContext ( ) . getMessageSource ( ) . getMessage ( code , args , defaultMessage , locale ) ;
public class RequestBuilder { /** * Add an { @ link Encoder } . Several Encoder can be added and will be invoked the order they were added . This method * doesn ' t allow duplicate . * @ param e an { @ link Encoder } * @ return this */ public T encoder ( Encoder e ) { } }
if ( ! encoders . contains ( e ) ) { encoders . add ( e ) ; } return derived . cast ( this ) ;
public class HandlerContainer { /** * Subscribe for events from a given source and message type . * @ param sourceIdentifier An identifier of an event source . * @ param messageType Java class of messages to dispatch . * @ param theHandler Message handler . * @ return A new subscription object that will cancel its subscription on . close ( ) */ @ SuppressWarnings ( "checkstyle:diamondoperatorforvariabledefinition" ) public AutoCloseable registerHandler ( final RemoteIdentifier sourceIdentifier , final Class < ? extends T > messageType , final EventHandler < ? super T > theHandler ) { } }
final Tuple2 < RemoteIdentifier , Class < ? extends T > > tuple = new Tuple2 < RemoteIdentifier , Class < ? extends T > > ( sourceIdentifier , messageType ) ; this . tupleToHandlerMap . put ( tuple , theHandler ) ; LOG . log ( Level . FINER , "Add handler for tuple: {0},{1}" , new Object [ ] { tuple . getT1 ( ) , tuple . getT2 ( ) . getCanonicalName ( ) } ) ; return new SubscriptionHandler < > ( tuple , this . unsubscribeTuple ) ;
public class Lexer { /** * Lex a string . * @ return * STRING - lex of string was successful . offset points to terminating ' " ' . * EOF - end of text was encountered before we could complete the lex . * ERROR - embedded in the string were unallowable chars . offset * points to the offending char */ private TokenType lexString ( Bytes jsonText ) { } }
TokenType tok = ERROR ; boolean hasEscapes = false ; finish_string_lex : for ( ; ; ) { int curChar ; /* now jump into a faster scanning routine to skip as much * of the buffers as possible */ { if ( bufInUse && buf . readRemaining ( ) > 0 ) { stringScan ( buf ) ; } else if ( jsonText . readRemaining ( ) > 0 ) { stringScan ( jsonText ) ; } } if ( jsonText . readRemaining ( ) == 0 ) { tok = EOF ; break ; } curChar = readChar ( jsonText ) ; /* quote terminates */ if ( curChar == '"' ) { tok = STRING ; break ; } /* backslash escapes a set of control chars , */ else if ( curChar == '\\' ) { hasEscapes = true ; if ( jsonText . readRemaining ( ) == 0 ) { tok = EOF ; break ; } /* special case \ \ u */ curChar = readChar ( jsonText ) ; if ( curChar == 'u' ) { for ( int i = 0 ; i < 4 ; i ++ ) { if ( jsonText . readRemaining ( ) == 0 ) { tok = EOF ; break finish_string_lex ; } curChar = readChar ( jsonText ) ; if ( ( CHAR_LOOKUP_TABLE [ curChar ] & VHC ) == 0 ) { /* back up to offending char */ unreadChar ( jsonText ) ; error = STRING_INVALID_HEX_CHAR ; break finish_string_lex ; } } } else if ( ( CHAR_LOOKUP_TABLE [ curChar ] & VEC ) == 0 ) { /* back up to offending char */ unreadChar ( jsonText ) ; error = STRING_INVALID_ESCAPED_CHAR ; break ; } } /* when not validating UTF8 it ' s a simple table lookup to determine * if the present character is invalid */ else if ( ( CHAR_LOOKUP_TABLE [ curChar ] & IJC ) != 0 ) { /* back up to offending char */ unreadChar ( jsonText ) ; error = STRING_INVALID_JSON_CHAR ; break ; } /* when in validate UTF8 mode we need to do some extra work */ else if ( validateUTF8 ) { TokenType t = lexUtf8Char ( jsonText , curChar ) ; if ( t == EOF ) { tok = EOF ; break ; } else if ( t == ERROR ) { error = STRING_INVALID_UTF8 ; break ; } } /* accept it , and move on */ } /* tell our buddy , the parser , whether he needs to process this string again */ if ( hasEscapes && tok == STRING ) { tok = STRING_WITH_ESCAPES ; } return tok ;
public class EditsLoaderCurrent { /** * Visit OP _ SET _ PERMISSIONS */ private void visit_OP_SET_PERMISSIONS ( ) throws IOException { } }
visitTxId ( ) ; v . visitStringUTF8 ( EditsElement . PATH ) ; v . visitShort ( EditsElement . FS_PERMISSIONS ) ;
public class CmsContainerConfigurationParser { /** * Parses the contents of a resource . < p > * @ param resource the resource which should be parsed * @ throws CmsException if something goes wrong */ public void parse ( CmsResource resource ) throws CmsException { } }
CmsFile file = m_cms . readFile ( resource ) ; parse ( file ) ;
public class DataUnformatFilter { /** * Filter a character data event . * @ param ch * The characters to write . * @ param start * The starting position in the array . * @ param length * The number of characters to use . * @ exception org . xml . sax . SAXException * If a filter further down the chain raises an exception . * @ see org . xml . sax . ContentHandler # characters */ public void characters ( char ch [ ] , int start , int length ) throws SAXException { } }
if ( state != SEEN_DATA ) { /* Look for non - whitespace . */ int end = start + length ; while ( end -- > start ) { if ( ! isXMLWhitespace ( ch [ end ] ) ) break ; } /* * If all the characters are whitespace , save them for later . If * we ' ve got some data , emit any saved whitespace and update our * state to show we ' ve seen data . */ if ( end < start ) { saveWhitespace ( ch , start , length ) ; } else { state = SEEN_DATA ; emitWhitespace ( ) ; } } /* Pass on everything inside a data field . */ if ( state == SEEN_DATA ) { super . characters ( ch , start , length ) ; }
public class MetadataContext { /** * Invokes { @ link DatabaseMetaData # getFunctionColumns ( java . lang . String , java . lang . String , java . lang . String , * java . lang . String ) } with given arguments and returns bound information . * @ param catalog the value for { @ code catalog } parameter * @ param schemaPattern the value for { @ code schemaPattern } parameter * @ param functionNamePattern the value for { @ code functionNamePattern } parameter * @ param columnNamePattern the value for { @ code columnNamePattern } parameter * @ return a list of function columns * @ throws SQLException if a database error occurs . */ public List < FunctionColumn > getFunctionColumns ( final String catalog , final String schemaPattern , final String functionNamePattern , final String columnNamePattern ) throws SQLException { } }
final List < FunctionColumn > list = new ArrayList < > ( ) ; try ( ResultSet results = databaseMetadata . getFunctionColumns ( catalog , schemaPattern , functionNamePattern , columnNamePattern ) ) { if ( results != null ) { bind ( results , FunctionColumn . class , list ) ; } } return list ;
public class Pattern { /** * Returns a matcher for a specified region . */ public Matcher matcher ( char [ ] data , int start , int end ) { } }
Matcher m = new Matcher ( this ) ; m . setTarget ( data , start , end ) ; return m ;
public class RichClientFramework { /** * Outputs a log file warning if the specified chain may not have been correctly defined because * of a missing properties file . * @ param endPoint the end point to test and see if outputting a warning is appropriate . * @ see com . ibm . ws . sib . jfapchannel . framework . Framework # warnIfSSLAndPropertiesFileMissing ( java . lang . Object ) */ @ Override public void warnIfSSLAndPropertiesFileMissing ( Object endPoint ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "warnIfSSLAndPropertiesFileMissing" , endPoint ) ; // Only output a warning if running in client if ( ! RuntimeInfo . isServer ( ) && ! RuntimeInfo . isClusteredServer ( ) ) { // Only display a warning if the endpoing is SSL enabled if ( ( ( CFEndPoint ) endPoint ) . isSSLEnabled ( ) ) { // Test to see if the properties file exists . final ClassLoader classLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; Boolean propertiesFileExists = ( Boolean ) AccessController . doPrivileged ( new PrivilegedAction < Object > ( ) { @ Override public Object run ( ) { URL url = classLoader . getResource ( JFapChannelConstants . CLIENT_SSL_PROPERTIES_FILE ) ; return Boolean . valueOf ( url != null ) ; } } ) ; if ( ! propertiesFileExists . booleanValue ( ) ) { SibTr . warning ( tc , SibTr . Suppressor . ALL_FOR_A_WHILE_SIMILAR_INSERTS , "NO_SSL_PROPERTIES_FILE_SICJ0012" , new Object [ ] { JFapChannelConstants . CLIENT_SSL_PROPERTIES_FILE } ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "warnIfSSLAndPropertiesFileMissing" ) ;
public class OffHeapConcurrentMap { /** * Performs the actual remove operation removing the new address from the memory lookups . The write lock for the given * key < b > must < / b > be held before calling this method . * @ param bucketHeadAddress the starting address of the address hash * @ param actualAddress the actual address if it is known or 0 . By passing this ! = 0 equality checks can be bypassed . * If a value of 0 is provided this will use key equality . key is not required when this ! = 0 * @ param key the key of the entry * @ param value the value to match if present * @ param requireReturn whether this method is forced to return the entry removed ( optimizations can be done if * the entry is not needed ) */ private InternalCacheEntry < WrappedBytes , WrappedBytes > performRemove ( long bucketHeadAddress , long actualAddress , WrappedBytes key , WrappedBytes value , boolean requireReturn ) { } }
long prevAddress = 0 ; // We only use the head pointer for the first iteration long address = bucketHeadAddress ; InternalCacheEntry < WrappedBytes , WrappedBytes > ice = null ; while ( address != 0 ) { long nextAddress = offHeapEntryFactory . getNext ( address ) ; boolean removeThisAddress ; // If the actualAddress was not known , check key equality otherwise just compare with the address removeThisAddress = actualAddress == 0 ? offHeapEntryFactory . equalsKey ( address , key ) : actualAddress == address ; if ( removeThisAddress ) { if ( value != null ) { ice = offHeapEntryFactory . fromMemory ( address ) ; // If value doesn ' t match and was provided then don ' t remove it if ( ! value . equalsWrappedBytes ( ice . getValue ( ) ) ) { ice = null ; break ; } } if ( requireReturn && ice == null ) { ice = offHeapEntryFactory . fromMemory ( address ) ; } entryRemoved ( address ) ; if ( prevAddress != 0 ) { offHeapEntryFactory . setNext ( prevAddress , nextAddress ) ; } else { memoryLookup . putMemoryAddress ( key , nextAddress ) ; } size . decrementAndGet ( ) ; break ; } prevAddress = address ; address = nextAddress ; } return ice ;
public class BroadleafPayPalCheckoutController { @ RequestMapping ( value = "/create-payment" , method = RequestMethod . POST ) public @ ResponseBody Map < String , String > createPayment ( @ RequestParam ( "performCheckout" ) Boolean performCheckout ) throws PaymentException { } }
Map < String , String > response = new HashMap < > ( ) ; Payment createdPayment = paymentService . createPayPalPaymentForCurrentOrder ( performCheckout ) ; response . put ( "id" , createdPayment . getId ( ) ) ; return response ;
public class TemplateInfoGeneratorStarter { /** * Parses property string into HashSet * @ param property * string to parse * @ return */ public static HashSet < String > createSetFromProperty ( String property ) { } }
HashSet < String > properties = new HashSet < String > ( ) ; if ( property != null && ! property . equals ( "null" ) ) { // " ( [ \ \ w ] * ) = ( [ \ \ w ] * ) ; " Pattern params = Pattern . compile ( "([\\w]+)[;]*" ) ; Matcher matcher = params . matcher ( property . trim ( ) ) ; while ( matcher . find ( ) ) { properties . add ( matcher . group ( 1 ) ) ; } } return properties ;
public class BackupManager { /** * Restores master state from the specified backup . * @ param is an input stream to read from the backup */ public void initFromBackup ( InputStream is ) throws IOException { } }
int count = 0 ; try ( GzipCompressorInputStream gzIn = new GzipCompressorInputStream ( is ) ; JournalEntryStreamReader reader = new JournalEntryStreamReader ( gzIn ) ) { List < Master > masters = mRegistry . getServers ( ) ; JournalEntry entry ; Map < String , Master > mastersByName = Maps . uniqueIndex ( masters , Master :: getName ) ; while ( ( entry = reader . readEntry ( ) ) != null ) { String masterName = JournalEntryAssociation . getMasterForEntry ( entry ) ; Master master = mastersByName . get ( masterName ) ; try { master . processJournalEntry ( entry ) ; } catch ( Throwable t ) { JournalUtils . handleJournalReplayFailure ( LOG , t , "Failed to process journal entry %s when init from backup" , entry ) ; } try ( JournalContext jc = master . createJournalContext ( ) ) { jc . append ( entry ) ; count ++ ; } } } LOG . info ( "Restored {} entries from backup" , count ) ;
public class UpdateGlobalTableRequest { /** * A list of regions that should be added or removed from the global table . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setReplicaUpdates ( java . util . Collection ) } or { @ link # withReplicaUpdates ( java . util . Collection ) } if you want * to override the existing values . * @ param replicaUpdates * A list of regions that should be added or removed from the global table . * @ return Returns a reference to this object so that method calls can be chained together . */ public UpdateGlobalTableRequest withReplicaUpdates ( ReplicaUpdate ... replicaUpdates ) { } }
if ( this . replicaUpdates == null ) { setReplicaUpdates ( new java . util . ArrayList < ReplicaUpdate > ( replicaUpdates . length ) ) ; } for ( ReplicaUpdate ele : replicaUpdates ) { this . replicaUpdates . add ( ele ) ; } return this ;
public class Interval { /** * Creates a new interval with the specified period before the end instant . * @ param period the period to subtract from the end to get the new start instant , null means zero * @ return an interval with the end from this interval and a calculated start * @ throws IllegalArgumentException if the period is negative */ public Interval withPeriodBeforeEnd ( ReadablePeriod period ) { } }
if ( period == null ) { return withDurationBeforeEnd ( null ) ; } Chronology chrono = getChronology ( ) ; long endMillis = getEndMillis ( ) ; long startMillis = chrono . add ( period , endMillis , - 1 ) ; return new Interval ( startMillis , endMillis , chrono ) ;
public class TransitionManager { /** * Sets a specific transition to occur when the given pair of scenes is * exited / entered . * @ param fromScene The scene being exited when the given transition will * be run * @ param toScene The scene being entered when the given transition will * be run * @ param transition The transition that will play when the given scene is * entered . A value of null will result in the default behavior of * using the default transition instead . */ public void setTransition ( @ NonNull Scene fromScene , @ NonNull Scene toScene , @ Nullable Transition transition ) { } }
ArrayMap < Scene , Transition > sceneTransitionMap = mScenePairTransitions . get ( toScene ) ; if ( sceneTransitionMap == null ) { sceneTransitionMap = new ArrayMap < Scene , Transition > ( ) ; mScenePairTransitions . put ( toScene , sceneTransitionMap ) ; } sceneTransitionMap . put ( fromScene , transition ) ;
public class Config { /** * Creates a deep - copy of the given configuration . This is useful for unit - testing . * @ param original the configuration to copy . * @ return a copy of the given configuration . */ public static Configuration copyConfiguration ( final Configuration original ) { } }
Configuration copy = new MapConfiguration ( new HashMap < String , Object > ( ) ) ; for ( Iterator < ? > i = original . getKeys ( ) ; i . hasNext ( ) ; ) { String key = ( String ) i . next ( ) ; Object value = original . getProperty ( key ) ; if ( value instanceof List ) { value = new ArrayList ( ( List ) value ) ; } copy . setProperty ( key , value ) ; } return copy ;
public class SudokuApplet { /** * Helper method to create a background task for running the interactive evolutionary * algorithm . * @ return A Swing task that will execute on a background thread and update * the GUI when it is done . */ private SwingBackgroundTask < Sudoku > createTask ( final String [ ] puzzle , final int populationSize , final int eliteCount ) { } }
return new SwingBackgroundTask < Sudoku > ( ) { @ Override protected Sudoku performTask ( ) { Random rng = new MersenneTwisterRNG ( ) ; List < EvolutionaryOperator < Sudoku > > operators = new ArrayList < EvolutionaryOperator < Sudoku > > ( 2 ) ; // Cross - over rows between parents ( so offspring is x rows from parent1 and // y rows from parent2 ) . operators . add ( new SudokuVerticalCrossover ( ) ) ; // Mutate the order of cells within individual rows . operators . add ( new SudokuRowMutation ( new PoissonGenerator ( 2 , rng ) , new DiscreteUniformGenerator ( 1 , 8 , rng ) ) ) ; EvolutionaryOperator < Sudoku > pipeline = new EvolutionPipeline < Sudoku > ( operators ) ; EvolutionEngine < Sudoku > engine = new GenerationalEvolutionEngine < Sudoku > ( new SudokuFactory ( puzzle ) , pipeline , new SudokuEvaluator ( ) , selectionStrategy , rng ) ; engine . addEvolutionObserver ( new SwingEvolutionObserver < Sudoku > ( new GridViewUpdater ( ) , 100 , TimeUnit . MILLISECONDS ) ) ; engine . addEvolutionObserver ( statusBar ) ; return engine . evolve ( populationSize , eliteCount , new TargetFitness ( 0 , false ) , // Continue until a perfect solution is found . . . abortControl . getTerminationCondition ( ) ) ; // . . . or the user aborts . } @ Override protected void postProcessing ( Sudoku result ) { puzzleCombo . setEnabled ( true ) ; populationSizeSpinner . setEnabled ( true ) ; solveButton . setEnabled ( true ) ; abortControl . getControl ( ) . setEnabled ( false ) ; } } ;
public class DescribeJobDefinitionsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeJobDefinitionsRequest describeJobDefinitionsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeJobDefinitionsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeJobDefinitionsRequest . getJobDefinitions ( ) , JOBDEFINITIONS_BINDING ) ; protocolMarshaller . marshall ( describeJobDefinitionsRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; protocolMarshaller . marshall ( describeJobDefinitionsRequest . getJobDefinitionName ( ) , JOBDEFINITIONNAME_BINDING ) ; protocolMarshaller . marshall ( describeJobDefinitionsRequest . getStatus ( ) , STATUS_BINDING ) ; protocolMarshaller . marshall ( describeJobDefinitionsRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class LinkedTree { /** * Invoked when this object must be deserialized . * @ param in is the input stream . * @ throws IOException in case of input stream access error . * @ throws ClassNotFoundException if some class was not found . */ private void readObject ( ObjectInputStream in ) throws IOException , ClassNotFoundException { } }
in . defaultReadObject ( ) ; if ( this . root != null ) { this . root . removeFromParent ( ) ; this . root . addTreeNodeListener ( this . listener ) ; }
public class JpaRepository { /** * Returns all the entities contained in the repository . * The query used for this operation is the one received by the constructor . * @ return all the entities contained in the repository */ @ SuppressWarnings ( "unchecked" ) @ Override public final Collection < V > getAll ( ) { } }
final Query builtQuery ; // Query created from the query data // Builds the query builtQuery = getEntityManager ( ) . createQuery ( getAllValuesQuery ( ) ) ; // Processes the query return builtQuery . getResultList ( ) ;
public class FontManagerImpl21 { /** * https : / / github . com / android / platform _ frameworks _ base / blob / android - 5.0.0 _ r1 / graphics / java / android / graphics / Typeface . java */ @ Override public boolean init ( @ NonNull Context context , int fontsRes ) { } }
FontListParser . Config config = readFontConfig ( context , fontsRes ) ; if ( config == null ) return false ; // this will also rewrite the Font # fontName to point to the extracted file ( s ) extractToCache ( context . getAssets ( ) , context . getCodeCacheDir ( ) , config ) ; if ( BuildConfig . DEBUG ) { Log . v ( TAG , "Loading font configuration: " + config ) ; Log . v ( TAG , "Aliases=" + config . aliases ) ; Log . v ( TAG , "Families=" + config . families ) ; } init ( config ) ; return true ;
public class KerasBatchNormalization { /** * Get BatchNormalization " mode " from Keras layer configuration . Most modes currently unsupported . * @ param layerConfig dictionary containing Keras layer configuration * @ return batchnormalization mode * @ throws InvalidKerasConfigurationException Invalid Keras config */ private int getBatchNormMode ( Map < String , Object > layerConfig , boolean enforceTrainingConfig ) throws InvalidKerasConfigurationException , UnsupportedKerasConfigurationException { } }
Map < String , Object > innerConfig = KerasLayerUtils . getInnerLayerConfigFromConfig ( layerConfig , conf ) ; int batchNormMode = 0 ; if ( this . kerasMajorVersion == 1 & ! innerConfig . containsKey ( LAYER_FIELD_MODE ) ) throw new InvalidKerasConfigurationException ( "Keras BatchNorm layer config missing " + LAYER_FIELD_MODE + " field" ) ; if ( this . kerasMajorVersion == 1 ) batchNormMode = ( int ) innerConfig . get ( LAYER_FIELD_MODE ) ; switch ( batchNormMode ) { case LAYER_BATCHNORM_MODE_1 : throw new UnsupportedKerasConfigurationException ( "Keras BatchNormalization mode " + LAYER_BATCHNORM_MODE_1 + " (sample-wise) not supported" ) ; case LAYER_BATCHNORM_MODE_2 : throw new UnsupportedKerasConfigurationException ( "Keras BatchNormalization (per-batch statistics during testing) " + LAYER_BATCHNORM_MODE_2 + " not supported" ) ; } return batchNormMode ;
public class Async { /** * Convert a synchronous function call into an asynchronous function call through an Observable . * < img width = " 640 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / toAsync . s . png " alt = " " > * @ param < T1 > the first parameter type * @ param < T2 > the second parameter type * @ param < T3 > the third parameter type * @ param < R > the result type * @ param func the function to convert * @ param scheduler the Scheduler used to call the { @ code func } * @ return a function that returns an Observable that executes the { @ code func } and emits its returned value * @ see < a href = " https : / / github . com / ReactiveX / RxJava / wiki / Async - Operators # wiki - toasync - or - asyncaction - or - asyncfunc " > RxJava Wiki : toAsync ( ) < / a > * @ see < a href = " http : / / msdn . microsoft . com / en - us / library / hh229287 . aspx " > MSDN : Observable . ToAsync < / a > */ public static < T1 , T2 , T3 , R > Func3 < T1 , T2 , T3 , Observable < R > > toAsync ( final Func3 < ? super T1 , ? super T2 , ? super T3 , ? extends R > func , final Scheduler scheduler ) { } }
return new Func3 < T1 , T2 , T3 , Observable < R > > ( ) { @ Override public Observable < R > call ( final T1 t1 , final T2 t2 , final T3 t3 ) { final AsyncSubject < R > subject = AsyncSubject . create ( ) ; final Worker inner = scheduler . createWorker ( ) ; inner . schedule ( new Action0 ( ) { @ Override public void call ( ) { R result ; try { result = func . call ( t1 , t2 , t3 ) ; } catch ( Throwable t ) { subject . onError ( t ) ; return ; } finally { inner . unsubscribe ( ) ; } subject . onNext ( result ) ; subject . onCompleted ( ) ; } } ) ; return subject ; } } ;
public class Configurer { /** * Get a double in the xml tree . * @ param attribute The attribute to get as double . * @ param path The node path ( child list ) * @ return The double value . * @ throws LionEngineException If unable to read node . */ public final double getDouble ( String attribute , String ... path ) { } }
try { return Double . parseDouble ( getNodeString ( attribute , path ) ) ; } catch ( final NumberFormatException exception ) { throw new LionEngineException ( exception , media ) ; }
public class ColorBuilder { /** * { @ inheritDoc } */ @ Override protected Color buildResource ( final ColorItem ci , final ColorParams cp ) { } }
Color color = null ; if ( cp instanceof WebColor ) { color = buildWebColor ( ( WebColor ) cp ) ; } else if ( cp instanceof RGB01Color ) { color = buildRGB01Color ( ( RGB01Color ) cp ) ; } else if ( cp instanceof RGB255Color ) { color = buildRGB255Color ( ( RGB255Color ) cp ) ; } else if ( cp instanceof HSBColor ) { color = buildHSBColor ( ( HSBColor ) cp ) ; } else if ( cp instanceof GrayColor ) { color = buildGrayColor ( ( GrayColor ) cp ) ; } return color ;
public class ExecutionTransitioner { /** * Used for job and flow . * @ return */ public ExecutionStatus doExecutionLoop ( ) { } }
final String methodName = "doExecutionLoop" ; try { currentExecutionElement = modelNavigator . getFirstExecutionElement ( jobExecution . getRestartOn ( ) ) ; } catch ( IllegalTransitionException e ) { String errorMsg = "Could not transition to first execution element within job." ; logger . warning ( errorMsg ) ; throw new IllegalArgumentException ( errorMsg , e ) ; } logger . fine ( "First execution element = " + currentExecutionElement . getId ( ) ) ; while ( true ) { if ( jobContext . getBatchStatus ( ) . equals ( BatchStatus . STOPPING ) ) { logger . fine ( methodName + " Exiting execution loop as job is now in stopping state." ) ; return new ExecutionStatus ( ExtendedBatchStatus . JOB_OPERATOR_STOPPING ) ; } IExecutionElementController currentElementController = getNextElementController ( ) ; currentStoppableElementController = currentElementController ; ExecutionStatus status = currentElementController . execute ( ) ; // Nothing special for decision or step except to get exit status . For flow and split we want to bubble up though . if ( ( currentExecutionElement instanceof Split ) || ( currentExecutionElement instanceof Flow ) ) { // Exit status and restartOn should both be in the job context . if ( ! status . getExtendedBatchStatus ( ) . equals ( ExtendedBatchStatus . NORMAL_COMPLETION ) ) { logger . fine ( "Breaking out of loop with return status = " + status . getExtendedBatchStatus ( ) . name ( ) ) ; return status ; } } // Seems like this should only happen if an Error is thrown at the step level , since normally a step - level // exception is caught and the fact that it was thrown capture in the ExecutionStatus if ( jobContext . getBatchStatus ( ) . equals ( BatchStatus . FAILED ) ) { String errorMsg = "Sub-execution returned its own BatchStatus of FAILED. Deal with this by throwing exception to the next layer." ; logger . warning ( errorMsg ) ; throw new BatchContainerRuntimeException ( errorMsg ) ; } // set the execution element controller to null so we don ' t try to call stop on it after the element has finished executing currentStoppableElementController = null ; logger . fine ( "Done executing element=" + currentExecutionElement . getId ( ) + ", exitStatus=" + status . getExitStatus ( ) ) ; if ( jobContext . getBatchStatus ( ) . equals ( BatchStatus . STOPPING ) ) { logger . fine ( methodName + " Exiting as job has been stopped" ) ; return new ExecutionStatus ( ExtendedBatchStatus . JOB_OPERATOR_STOPPING ) ; } Transition nextTransition = null ; try { nextTransition = modelNavigator . getNextTransition ( currentExecutionElement , status ) ; } catch ( IllegalTransitionException e ) { String errorMsg = "Problem transitioning to next execution element." ; logger . warning ( errorMsg ) ; throw new BatchContainerRuntimeException ( errorMsg , e ) ; } // We will find ourselves in one of four states now . // 1 . Finished transitioning after a normal execution , but nothing to do ' next ' . // 2 . We just executed a step which through an exception , but didn ' t match a transition element . // 3 . We are going to ' next ' to another execution element ( and jump back to the top of this ' // ' while ' - loop . // 4 . We matched a terminating transition element ( < end > , < stop > or < fail ) . if ( nextTransition . isFinishedTransitioning ( ) ) { logger . fine ( methodName + "No next execution element, and no transition element found either. Looks like we're done and ready for COMPLETED state." ) ; this . stepExecIds = currentElementController . getLastRunStepExecutions ( ) ; // Consider just passing the last ' status ' back , but let ' s unwrap the exit status and pass a new NORMAL _ COMPLETION // status back instead . return new ExecutionStatus ( ExtendedBatchStatus . NORMAL_COMPLETION , status . getExitStatus ( ) ) ; } else if ( nextTransition . noTransitionElementMatchedAfterException ( ) ) { return new ExecutionStatus ( ExtendedBatchStatus . EXCEPTION_THROWN , status . getExitStatus ( ) ) ; } else if ( nextTransition . getNextExecutionElement ( ) != null ) { // hold on to the previous execution element for the decider // we need it because we need to inject the context of the // previous execution element into the decider previousExecutionElement = currentExecutionElement ; previousElementController = currentElementController ; currentExecutionElement = nextTransition . getNextExecutionElement ( ) ; } else if ( nextTransition . getTransitionElement ( ) != null ) { ExecutionStatus terminatingStatus = handleTerminatingTransitionElement ( nextTransition . getTransitionElement ( ) ) ; logger . finer ( methodName + " , Breaking out of execution loop after processing terminating transition element." ) ; return terminatingStatus ; } else { throw new IllegalStateException ( "Not sure how we'd end up in this state...aborting rather than looping." ) ; } }
public class Cache2kBuilder { /** * Add a new configuration sub section . * @ see org . cache2k . configuration . ConfigurationWithSections */ public final Cache2kBuilder < K , V > with ( ConfigurationSectionBuilder < ? extends ConfigurationSection > ... sectionBuilders ) { } }
for ( ConfigurationSectionBuilder < ? extends ConfigurationSection > b : sectionBuilders ) { config ( ) . getSections ( ) . add ( b . buildConfigurationSection ( ) ) ; } return this ;
public class StringUtil { /** * Converts a comma - separated String to an array of longs . * @ param pString The comma - separated string * @ param pDelimiters The delimiter string * @ return a { @ code long } array * @ throws NumberFormatException if any of the elements are not parseable * as a long */ public static long [ ] toLongArray ( String pString , String pDelimiters ) { } }
if ( isEmpty ( pString ) ) { return new long [ 0 ] ; } // Some room for improvement here . . . String [ ] temp = toStringArray ( pString , pDelimiters ) ; long [ ] array = new long [ temp . length ] ; for ( int i = 0 ; i < array . length ; i ++ ) { array [ i ] = Long . parseLong ( temp [ i ] ) ; } return array ;
public class CommerceUserSegmentCriterionLocalServiceBaseImpl { /** * Deletes the commerce user segment criterion with the primary key from the database . Also notifies the appropriate model listeners . * @ param commerceUserSegmentCriterionId the primary key of the commerce user segment criterion * @ return the commerce user segment criterion that was removed * @ throws PortalException if a commerce user segment criterion with the primary key could not be found */ @ Indexable ( type = IndexableType . DELETE ) @ Override public CommerceUserSegmentCriterion deleteCommerceUserSegmentCriterion ( long commerceUserSegmentCriterionId ) throws PortalException { } }
return commerceUserSegmentCriterionPersistence . remove ( commerceUserSegmentCriterionId ) ;
public class DefaultWhenVertx { /** * Safely execute some blocking code . * Executes the blocking code in the handler { @ code blockingCodeHandler } using a thread from the worker pool . * When the code is complete the promise will resolve with the result on the original context * ( e . g . on the original event loop of the caller ) . * A { @ code Future } instance is passed into { @ code blockingCodeHandler } . When the blocking code successfully completes , * the handler should call the { @ link Future # complete } or { @ link Future # complete ( Object ) } method , or the { @ link Future # fail } * method if it failed . * @ param blockingCodeHandler handler representing the blocking code to run * @ param ordered if true then if executeBlocking is called several times on the same context , the executions * for that context will be executed serially , not in parallel . if false then they will be no ordering * guarantees */ @ Override public < T > Promise < T > executeBlocking ( Handler < Future < T > > blockingCodeHandler , boolean ordered ) { } }
return adapter . toPromise ( handler -> vertx . executeBlocking ( blockingCodeHandler , ordered , handler ) ) ;
public class I18n { /** * Note , calling this method will < em > not < / em > trigger localization of the supplied internationalization class . * @ param i18nClass The internalization class for which localization problems should be returned . * @ param locale The locale for which localization problems should be returned . If < code > null < / code > , the default locale will * be used . * @ return The localization problems encountered while localizing the supplied internationalization class to the supplied * locale ; never < code > null < / code > . */ public static Set < String > getLocalizationProblems ( Class < ? > i18nClass , Locale locale ) { } }
CheckArg . isNotNull ( i18nClass , "i18nClass" ) ; Map < Class < ? > , Set < String > > classToProblemsMap = LOCALE_TO_CLASS_TO_PROBLEMS_MAP . get ( locale == null ? Locale . getDefault ( ) : locale ) ; if ( classToProblemsMap == null ) { return Collections . emptySet ( ) ; } Set < String > problems = classToProblemsMap . get ( i18nClass ) ; if ( problems == null ) { return Collections . emptySet ( ) ; } return problems ;
public class NetworkInterface { /** * Any tags assigned to the network interface . * @ param tagSet * Any tags assigned to the network interface . */ public void setTagSet ( java . util . Collection < Tag > tagSet ) { } }
if ( tagSet == null ) { this . tagSet = null ; return ; } this . tagSet = new com . amazonaws . internal . SdkInternalList < Tag > ( tagSet ) ;
public class PyGenerator { /** * Generate the Python package files . * < p > This function generates the " _ _ init _ _ . py " files for all the packages . * @ param name the name of the generated type . * @ param lineSeparator the line separator . * @ param context the generation context . */ protected void writePackageFiles ( QualifiedName name , String lineSeparator , IExtraLanguageGeneratorContext context ) { } }
final IFileSystemAccess2 fsa = context . getFileSystemAccess ( ) ; final String outputConfiguration = getOutputConfigurationName ( ) ; QualifiedName libraryName = null ; for ( final String segment : name . skipLast ( 1 ) . getSegments ( ) ) { if ( libraryName == null ) { libraryName = QualifiedName . create ( segment , LIBRARY_FILENAME ) ; } else { libraryName = libraryName . append ( segment ) . append ( LIBRARY_FILENAME ) ; } final String fileName = toFilename ( libraryName ) ; if ( ! fsa . isFile ( fileName ) ) { final String content = PYTHON_FILE_HEADER + lineSeparator + getGenerationComment ( context ) + lineSeparator + LIBRARY_CONTENT ; if ( Strings . isEmpty ( outputConfiguration ) ) { fsa . generateFile ( fileName , content ) ; } else { fsa . generateFile ( fileName , outputConfiguration , content ) ; } } libraryName = libraryName . skipLast ( 1 ) ; }
import java . util . ArrayList ; import java . util . List ; class EvaluatePredictions { /** * Function to evaluate the accuracy of game scores predicted by an individual . * This function calculates the absolute difference in predicted and actual scores for * each game , and returns a list of these differences . * If the prediction was correct , the value will be 0 , otherwise , it holds the absolute * difference between predicted and actual scores . * Args : * actual _ scores : List of actual game scores . * predictions : List of predicted game scores . * Returns : * A list depicting the difference between predicted and actual scores . * Examples : * > > > evaluate _ predictions ( [ 1,2,3,4,5,1 ] , [ 1,2,3,4,2 , - 2 ] ) * [ 0,0,0,0,3,3] * > > > evaluate _ predictions ( [ 0,5,0,0,0,4 ] , [ 4,1,1,0,0 , - 2 ] ) * [ 4,4,1,0,0,6] */ public static List < Integer > evaluatePredictions ( List < Integer > actual_scores , List < Integer > predictions ) { } }
List < Integer > result = new ArrayList < > ( ) ; for ( int i = 0 ; i < actual_scores . size ( ) ; i ++ ) { result . add ( Math . abs ( actual_scores . get ( i ) - predictions . get ( i ) ) ) ; } return result ;
public class MetaBeans { /** * lookup the MetaBean outside the fast path , aiding hotspot inlining */ private static MetaBean metaBeanLookup ( Class < ? > cls ) { } }
// handle dynamic beans if ( cls == FlexiBean . class ) { return new FlexiBean ( ) . metaBean ( ) ; } else if ( cls == MapBean . class ) { return new MapBean ( ) . metaBean ( ) ; } else if ( DynamicBean . class . isAssignableFrom ( cls ) ) { try { return cls . asSubclass ( DynamicBean . class ) . getDeclaredConstructor ( ) . newInstance ( ) . metaBean ( ) ; } catch ( NoSuchMethodException | InvocationTargetException | InstantiationException | IllegalAccessException ex ) { throw new IllegalArgumentException ( "Unable to find meta-bean for a DynamicBean: " + cls . getName ( ) , ex ) ; } } // a Class can be loaded without being initialized // in this state , the static initializers have not run , and thus the metabean not registered // here initialization is forced to handle that scenario try { cls = Class . forName ( cls . getName ( ) , true , cls . getClassLoader ( ) ) ; } catch ( ClassNotFoundException | Error ex ) { // should be impossible throw new IllegalArgumentException ( "Unable to find meta-bean: " + cls . getName ( ) , ex ) ; } MetaBean meta = META_BEANS . get ( cls ) ; if ( meta == null ) { throw new IllegalArgumentException ( "Unable to find meta-bean: " + cls . getName ( ) ) ; } return meta ;
public class Deferrers { /** * Cancel all defer actions for the current stack depth . * @ since 1.0 */ @ Weight ( value = Weight . Unit . VARIABLE , comment = "Depends on the current call stack depth" ) public static void cancelDeferredActions ( ) { } }
final int stackDepth = ThreadUtils . stackDepth ( ) ; final List < Deferred > list = REGISTRY . get ( ) ; final Iterator < Deferred > iterator = list . iterator ( ) ; while ( iterator . hasNext ( ) ) { final Deferred deferred = iterator . next ( ) ; if ( deferred . getStackDepth ( ) >= stackDepth ) { iterator . remove ( ) ; } } if ( list . isEmpty ( ) ) { REGISTRY . remove ( ) ; }
public class FileSystemManager { /** * create properties folder * @ throws IOException could throw IOException because working with files */ private void createPropertiesFolder ( ) throws IOException { } }
if ( ! Files . exists ( propertiesLocation . toPath ( ) ) ) Files . createDirectories ( propertiesLocation . toPath ( ) ) ;
public class MSDelegatingLocalTransaction { /** * Rollback all work associated with this local transaction . * @ exception SIIncorrectCallException * Thrown if this transaction has already been completed . * @ exception SIResourceException * Thrown if an unknown MessageStore error occurs . */ public void rollback ( ) throws SIIncorrectCallException , SIResourceException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "rollback" ) ; if ( _state != TransactionState . STATE_ACTIVE ) { SIIncorrectCallException sie = new SIIncorrectCallException ( nls . getFormattedMessage ( "CANNOT_ROLLBACK_COMPLETE_SIMS1005" , new Object [ ] { } , null ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Cannot rollback Transaction. Transaction is complete or completing!" , sie ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "rollback" ) ; throw sie ; } _state = TransactionState . STATE_ROLLINGBACK ; try { // We are rolling back all changes so we don ' t need // to tell the persistence layer to do anything we // just need to get the in memory model to back out // its changes . if ( _workList != null ) { _workList . rollback ( this ) ; } _state = TransactionState . STATE_ROLLEDBACK ; } catch ( Throwable t ) { com . ibm . ws . ffdc . FFDCFilter . processException ( t , "com.ibm.ws.sib.msgstore.transactions.MSDelegatingLocalTransaction.rollback" , "1:539:1.51.1.14" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Exception caught during rollback phase of transaction!" , t ) ; throw new SIResourceException ( nls . getFormattedMessage ( "COMPLETION_EXCEPTION_SIMS1002" , new Object [ ] { t } , null ) , t ) ; } finally { // We always ensure that all afterCompletion // callbacks are called even in the case of // rollback . // Defect 316887 try { if ( _workList != null ) { _workList . postComplete ( this , false ) ; } for ( int i = 0 ; i < _callbacks . size ( ) ; i ++ ) { TransactionCallback callback = ( TransactionCallback ) _callbacks . get ( i ) ; callback . afterCompletion ( this , false ) ; } } catch ( Throwable t ) { com . ibm . ws . ffdc . FFDCFilter . processException ( t , "com.ibm.ws.sib.msgstore.transactions.MSDelegatingLocalTransaction.rollback" , "1:565:1.51.1.14" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( this , tc , "Exception caught during post rollback phase of transaction!" , t ) ; // We aren ' t going to rethrow this exception as if // a previous exception has been thrown outside the // finally block it is likely to have more // information about the root problem . } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "rollback" ) ; }
public class PropertiesCache { /** * Get the java Properties stored in the file , loading from disk only if the file has been modified * since the last read , or the cached data has been invalidated . * @ param file java properties file * @ return java Properties * @ throws IOException due to file read or find error */ public synchronized Properties getProperties ( final File file ) throws IOException { } }
final Properties fileprops ; if ( needsReload ( file ) ) { fileprops = new Properties ( ) ; final InputStream is = new FileInputStream ( file ) ; try { fileprops . load ( is ) ; } finally { if ( null != is ) { is . close ( ) ; } } mtimes . put ( file , file . lastModified ( ) ) ; props . put ( file , fileprops ) ; return fileprops ; } return props . get ( file ) ;
public class JsonUtil { /** * Write a JCR value to the JSON writer . * @ param writer the JSON writer object ( with the JSON state ) * @ param type the JCR type of the value ( see PropertyType ) * @ param value the value itself , should be a JCR property otherwise a java scalar object or array of scalars * @ param type the type of the value * @ throws javax . jcr . RepositoryException error on accessing JCR * @ throws java . io . IOException error on write JSON */ public static void writeJsonValue ( JsonWriter writer , Node node , String name , Object value , Integer type , MappingRules mapping ) throws RepositoryException , IOException { } }
Value jcrValue = value instanceof Value ? ( Value ) value : null ; switch ( type ) { case PropertyType . BINARY : if ( node != null && jcrValue != null ) { if ( mapping . propertyFormat . binary == MappingRules . PropertyFormat . Binary . link ) { String uri = "/bin/cpm/nodes/property.bin" + LinkUtil . encodePath ( node . getPath ( ) ) + "?name=" + LinkUtil . encodePath ( name ) ; boolean htmlSafe = writer . isHtmlSafe ( ) ; writer . setHtmlSafe ( false ) ; writer . value ( uri ) ; writer . setHtmlSafe ( htmlSafe ) ; } else if ( mapping . propertyFormat . binary == MappingRules . PropertyFormat . Binary . base64 ) { Binary binary = jcrValue . getBinary ( ) ; byte [ ] buffer = IOUtils . toByteArray ( binary . getStream ( ) ) ; String encoded = Base64 . encodeBase64String ( buffer ) ; writer . value ( getValueString ( encoded , type , mapping ) ) ; } else { writer . nullValue ( ) ; } } else { writer . nullValue ( ) ; } break ; case PropertyType . BOOLEAN : writer . value ( jcrValue != null ? jcrValue . getBoolean ( ) : ( value instanceof Boolean ? ( Boolean ) value : Boolean . valueOf ( value . toString ( ) ) ) ) ; break ; case PropertyType . DATE : Calendar cal = jcrValue != null ? jcrValue . getDate ( ) : ( value instanceof Calendar ? ( Calendar ) value : null ) ; if ( cal != null ) { SimpleDateFormat dateFormat = new SimpleDateFormat ( MappingRules . MAP_DATE_FORMAT ) ; dateFormat . setTimeZone ( cal . getTimeZone ( ) ) ; writer . value ( getValueString ( dateFormat . format ( cal . getTime ( ) ) , type , mapping ) ) ; } break ; case PropertyType . DECIMAL : writer . value ( getValueString ( jcrValue != null ? jcrValue . getDecimal ( ) : ( value instanceof BigDecimal ? ( BigDecimal ) value : new BigDecimal ( value . toString ( ) ) ) , type , mapping ) ) ; break ; case PropertyType . DOUBLE : writer . value ( getValueString ( jcrValue != null ? jcrValue . getDouble ( ) : ( value instanceof Double ? ( Double ) value : Double . valueOf ( value . toString ( ) ) ) , type , mapping ) ) ; break ; case PropertyType . LONG : writer . value ( jcrValue != null ? jcrValue . getLong ( ) : ( value instanceof Long ? ( Long ) value : Long . valueOf ( value . toString ( ) ) ) ) ; break ; case PropertyType . NAME : case PropertyType . PATH : case PropertyType . REFERENCE : case PropertyType . STRING : case PropertyType . URI : case PropertyType . WEAKREFERENCE : writer . value ( getValueString ( jcrValue != null ? jcrValue . getString ( ) : value . toString ( ) , type , mapping ) ) ; break ; case PropertyType . UNDEFINED : writer . nullValue ( ) ; break ; }
public class ChannelUtils { /** * Convert the input string to a list of strings based on the * provided delimiter . * @ param input * @ param delimiter * @ return String [ ] */ public static String [ ] extractList ( String input , char delimiter ) { } }
int end = input . indexOf ( delimiter ) ; if ( - 1 == end ) { return new String [ ] { input . trim ( ) } ; } List < String > output = new LinkedList < String > ( ) ; int start = 0 ; do { output . add ( input . substring ( start , end ) . trim ( ) ) ; start = end + 1 ; end = input . indexOf ( delimiter , start ) ; } while ( - 1 != end ) ; // copy the last value if it exists if ( start < input . length ( ) ) { output . add ( input . substring ( start ) . trim ( ) ) ; } return output . toArray ( new String [ output . size ( ) ] ) ;
public class XMLRoadUtil { /** * Write the XML description for the given container of roads . * @ param xmlNode is the XML node to fill with the container data . * @ param primitive is the container of roads to output . * @ param geometryURL is the URL of the file that contains the geometry of the roads . * If < code > null < / code > , the road will be directly written in the XML document . * @ param mapProjection is the map projection to use to write the geometry shapes . * @ param attributeURL is the URL of the file that contains the attributes of the roads . * This parameter is used only if < var > geometryURL < / var > is not < code > null < / code > . * @ param builder is the tool to create XML nodes . * @ param pathBuilder is the tool to make paths relative . * @ param resources is the tool that permits to gather the resources . * @ throws IOException in case of error . */ public static void writeRoadNetwork ( Element xmlNode , RoadNetwork primitive , URL geometryURL , MapMetricProjection mapProjection , URL attributeURL , XMLBuilder builder , PathBuilder pathBuilder , XMLResources resources ) throws IOException { } }
final ContainerWrapper w = new ContainerWrapper ( primitive ) ; w . setElementGeometrySource ( geometryURL , mapProjection ) ; w . setElementAttributeSourceURL ( attributeURL ) ; writeGISElementContainer ( xmlNode , w , NODE_ROAD , builder , pathBuilder , resources ) ; final Rectangle2d bounds = primitive . getBoundingBox ( ) ; if ( bounds != null ) { xmlNode . setAttribute ( ATTR_X , Double . toString ( bounds . getMinX ( ) ) ) ; xmlNode . setAttribute ( ATTR_Y , Double . toString ( bounds . getMinY ( ) ) ) ; xmlNode . setAttribute ( ATTR_WIDTH , Double . toString ( bounds . getWidth ( ) ) ) ; xmlNode . setAttribute ( ATTR_HEIGHT , Double . toString ( bounds . getHeight ( ) ) ) ; }
public class UpdateFlowEntitlementRequest { /** * The AWS account IDs that you want to share your content with . The receiving accounts ( subscribers ) will be * allowed to create their own flow using your content as the source . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setSubscribers ( java . util . Collection ) } or { @ link # withSubscribers ( java . util . Collection ) } if you want to * override the existing values . * @ param subscribers * The AWS account IDs that you want to share your content with . The receiving accounts ( subscribers ) will be * allowed to create their own flow using your content as the source . * @ return Returns a reference to this object so that method calls can be chained together . */ public UpdateFlowEntitlementRequest withSubscribers ( String ... subscribers ) { } }
if ( this . subscribers == null ) { setSubscribers ( new java . util . ArrayList < String > ( subscribers . length ) ) ; } for ( String ele : subscribers ) { this . subscribers . add ( ele ) ; } return this ;
public class ExceptionCollection { /** * Prints the stack trace . * @ param s the writer to print to */ @ Override public void printStackTrace ( PrintWriter s ) { } }
s . println ( MSG ) ; super . printStackTrace ( s ) ; this . exceptions . forEach ( ( t ) -> { s . println ( "Next Exception:" ) ; t . printStackTrace ( s ) ;
public class ISPNQuotaPersister { /** * { @ inheritDoc } */ public void setGlobalDataSize ( final long dataSize ) { } }
SecurityHelper . doPrivilegedAction ( new PrivilegedAction < Void > ( ) { public Void run ( ) { CacheKey key = new GlobalDataSizeKey ( ) ; cache . put ( key , dataSize ) ; return null ; } } ) ;
public class TitlePaneCloseButtonPainter { /** * Paint the background of the button using the specified colors . * @ param g the Graphics2D context to paint with . * @ param c the component . * @ param width the width of the component . * @ param height the height of the component . * @ param colors the color set to use to paint the button . */ private void paintClose ( Graphics2D g , JComponent c , int width , int height , ButtonColors colors ) { } }
g . setRenderingHint ( RenderingHints . KEY_ANTIALIASING , RenderingHints . VALUE_ANTIALIAS_ON ) ; Shape s = decodeInterior ( width , height ) ; g . setPaint ( decodeCloseGradient ( s , colors . interiorTop , colors . interiorBottom ) ) ; g . fill ( s ) ; s = decodeEdge ( width , height ) ; g . setColor ( colors . edge ) ; g . draw ( s ) ; s = decodeShadow ( width , height ) ; g . setColor ( colors . shadow ) ; g . draw ( s ) ; g . setRenderingHint ( RenderingHints . KEY_ANTIALIASING , RenderingHints . VALUE_ANTIALIAS_OFF ) ; g . setColor ( colors . top ) ; g . drawLine ( 0 , 0 , width - 2 , 0 ) ; g . setColor ( colors . left ) ; g . drawLine ( 0 , 1 , 0 , height - 3 ) ; s = decodeMarkInterior ( width , height ) ; g . setColor ( colors . markInterior ) ; g . fill ( s ) ; s = decodeMarkBorder ( width , height ) ; g . setColor ( colors . markBorder ) ; g . draw ( s ) ;
public class AmazonEC2Client { /** * Determines whether a product code is associated with an instance . This action can only be used by the owner of * the product code . It is useful when a product code owner must verify whether another user ' s instance is eligible * for support . * @ param confirmProductInstanceRequest * @ return Result of the ConfirmProductInstance operation returned by the service . * @ sample AmazonEC2 . ConfirmProductInstance * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / ec2-2016-11-15 / ConfirmProductInstance " target = " _ top " > AWS API * Documentation < / a > */ @ Override public ConfirmProductInstanceResult confirmProductInstance ( ConfirmProductInstanceRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeConfirmProductInstance ( request ) ;
public class EntityCollection { /** * Add item to collection . * @ param item item for addition ( must be Entity or subclass ) . * @ return if item add then will return true in the other case false . * @ throws UnsupportedOperationException if object is read only . */ @ Override public boolean add ( D item ) throws UnsupportedOperationException { } }
readOnlyGuardCondition ( ) ; instance . addRelation ( entity , writeAttributeName , item ) ; entity . save ( ) ; return true ;
public class DefaultGroovyStaticMethods { /** * Start a daemon Thread with a given name and the given closure as * a Runnable instance . * @ param self placeholder variable used by Groovy categories ; ignored for default static methods * @ param name the name to give the thread * @ param closure the Runnable closure * @ return the started thread * @ since 1.6 */ public static Thread startDaemon ( Thread self , String name , Closure closure ) { } }
return createThread ( name , true , closure ) ;
public class GSection { /** * Set the number of notification for this section * @ param notifications the number of notification active for this section * @ return this section */ public GSection setNotifications ( int notifications ) { } }
String textNotification ; textNotification = String . valueOf ( notifications ) ; if ( notifications < 1 ) { textNotification = "" ; } if ( notifications > 99 ) { textNotification = "99+" ; } this . notifications . setText ( textNotification ) ; numberNotifications = notifications ; return this ;
public class InternalSARLParser { /** * InternalSARL . g : 11982:1 : ruleXAnnotationOrExpression returns [ EObject current = null ] : ( this _ XAnnotation _ 0 = ruleXAnnotation | this _ XExpression _ 1 = ruleXExpression ) ; */ public final EObject ruleXAnnotationOrExpression ( ) throws RecognitionException { } }
EObject current = null ; EObject this_XAnnotation_0 = null ; EObject this_XExpression_1 = null ; enterRule ( ) ; try { // InternalSARL . g : 11988:2 : ( ( this _ XAnnotation _ 0 = ruleXAnnotation | this _ XExpression _ 1 = ruleXExpression ) ) // InternalSARL . g : 11989:2 : ( this _ XAnnotation _ 0 = ruleXAnnotation | this _ XExpression _ 1 = ruleXExpression ) { // InternalSARL . g : 11989:2 : ( this _ XAnnotation _ 0 = ruleXAnnotation | this _ XExpression _ 1 = ruleXExpression ) int alt297 = 2 ; int LA297_0 = input . LA ( 1 ) ; if ( ( LA297_0 == 105 ) ) { alt297 = 1 ; } else if ( ( ( LA297_0 >= RULE_STRING && LA297_0 <= RULE_RICH_TEXT_START ) || ( LA297_0 >= RULE_HEX && LA297_0 <= RULE_DECIMAL ) || LA297_0 == 25 || ( LA297_0 >= 28 && LA297_0 <= 29 ) || LA297_0 == 36 || ( LA297_0 >= 39 && LA297_0 <= 40 ) || ( LA297_0 >= 42 && LA297_0 <= 45 ) || ( LA297_0 >= 48 && LA297_0 <= 49 ) || LA297_0 == 51 || LA297_0 == 55 || ( LA297_0 >= 60 && LA297_0 <= 63 ) || ( LA297_0 >= 67 && LA297_0 <= 68 ) || ( LA297_0 >= 73 && LA297_0 <= 75 ) || ( LA297_0 >= 78 && LA297_0 <= 96 ) || LA297_0 == 106 || LA297_0 == 129 || ( LA297_0 >= 131 && LA297_0 <= 140 ) ) ) { alt297 = 2 ; } else { if ( state . backtracking > 0 ) { state . failed = true ; return current ; } NoViableAltException nvae = new NoViableAltException ( "" , 297 , 0 , input ) ; throw nvae ; } switch ( alt297 ) { case 1 : // InternalSARL . g : 11990:3 : this _ XAnnotation _ 0 = ruleXAnnotation { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXAnnotationOrExpressionAccess ( ) . getXAnnotationParserRuleCall_0 ( ) ) ; } pushFollow ( FOLLOW_2 ) ; this_XAnnotation_0 = ruleXAnnotation ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current = this_XAnnotation_0 ; afterParserOrEnumRuleCall ( ) ; } } break ; case 2 : // InternalSARL . g : 11999:3 : this _ XExpression _ 1 = ruleXExpression { if ( state . backtracking == 0 ) { newCompositeNode ( grammarAccess . getXAnnotationOrExpressionAccess ( ) . getXExpressionParserRuleCall_1 ( ) ) ; } pushFollow ( FOLLOW_2 ) ; this_XExpression_1 = ruleXExpression ( ) ; state . _fsp -- ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current = this_XExpression_1 ; afterParserOrEnumRuleCall ( ) ; } } break ; } } if ( state . backtracking == 0 ) { leaveRule ( ) ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ;
public class IncludeTileImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setTIRID ( Integer newTIRID ) { } }
Integer oldTIRID = tirid ; tirid = newTIRID ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . INCLUDE_TILE__TIRID , oldTIRID , tirid ) ) ;
public class ValidationJob { /** * Execute Hive queries using { @ link HiveJdbcConnector } and validate results . * @ param queries Queries to execute . */ @ edu . umd . cs . findbugs . annotations . SuppressWarnings ( value = "SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE" , justification = "Temporary fix" ) private List < Long > getValidationOutputFromHive ( List < String > queries ) throws IOException { } }
if ( null == queries || queries . size ( ) == 0 ) { log . warn ( "No queries specified to be executed" ) ; return Collections . emptyList ( ) ; } List < Long > rowCounts = Lists . newArrayList ( ) ; Closer closer = Closer . create ( ) ; try { HiveJdbcConnector hiveJdbcConnector = closer . register ( HiveJdbcConnector . newConnectorWithProps ( props ) ) ; for ( String query : queries ) { String hiveOutput = "hiveConversionValidationOutput_" + UUID . randomUUID ( ) . toString ( ) ; Path hiveTempDir = new Path ( "/tmp" + Path . SEPARATOR + hiveOutput ) ; query = "INSERT OVERWRITE DIRECTORY '" + hiveTempDir + "' " + query ; log . info ( "Executing query: " + query ) ; try { if ( this . hiveSettings . size ( ) > 0 ) { hiveJdbcConnector . executeStatements ( this . hiveSettings . toArray ( new String [ this . hiveSettings . size ( ) ] ) ) ; } hiveJdbcConnector . executeStatements ( "SET hive.exec.compress.output=false" , "SET hive.auto.convert.join=false" , query ) ; FileStatus [ ] fileStatusList = this . fs . listStatus ( hiveTempDir ) ; List < FileStatus > files = new ArrayList < > ( ) ; for ( FileStatus fileStatus : fileStatusList ) { if ( fileStatus . isFile ( ) ) { files . add ( fileStatus ) ; } } if ( files . size ( ) > 1 ) { log . warn ( "Found more than one output file. Should have been one." ) ; } else if ( files . size ( ) == 0 ) { log . warn ( "Found no output file. Should have been one." ) ; } else { String theString = IOUtils . toString ( new InputStreamReader ( this . fs . open ( files . get ( 0 ) . getPath ( ) ) , Charsets . UTF_8 ) ) ; log . info ( "Found row count: " + theString . trim ( ) ) ; if ( StringUtils . isBlank ( theString . trim ( ) ) ) { rowCounts . add ( 0l ) ; } else { try { rowCounts . add ( Long . parseLong ( theString . trim ( ) ) ) ; } catch ( NumberFormatException e ) { throw new RuntimeException ( "Could not parse Hive output: " + theString . trim ( ) , e ) ; } } } } finally { if ( this . fs . exists ( hiveTempDir ) ) { log . debug ( "Deleting temp dir: " + hiveTempDir ) ; this . fs . delete ( hiveTempDir , true ) ; } } } } catch ( SQLException e ) { log . warn ( "Execution failed for query set " + queries . toString ( ) , e ) ; } finally { try { closer . close ( ) ; } catch ( Exception e ) { log . warn ( "Could not close HiveJdbcConnector" , e ) ; } } return rowCounts ;
public class HttpHelper { /** * Execute a request for a subclass . * @ param request request to be executed * @ return response containing response to request * @ throws IOException * @ throws ReadOnlyException */ public HttpResponse execute ( final HttpUriRequest request ) throws IOException , ReadOnlyException { } }
if ( readOnly ) { switch ( request . getMethod ( ) . toLowerCase ( ) ) { case "copy" : case "delete" : case "move" : case "patch" : case "post" : case "put" : throw new ReadOnlyException ( ) ; default : break ; } } return httpClient . execute ( request , httpContext ) ;
public class FoxHttpRequestQuery { /** * Parse an object as query map * @ param params list of attribute names which will be included * @ param o object with the attributes * @ throws FoxHttpRequestException can throw an exception if a field does not exist */ public void parseObjectAsQueryMap ( List < String > params , Object o ) throws FoxHttpRequestException { } }
try { Class clazz = o . getClass ( ) ; HashMap < String , String > paramMap = new HashMap < > ( ) ; for ( String param : params ) { Field field = clazz . getDeclaredField ( param ) ; field . setAccessible ( true ) ; String paramName = field . getName ( ) ; String value = String . valueOf ( field . get ( o ) ) ; if ( field . get ( o ) != null && ! value . isEmpty ( ) ) { paramMap . put ( paramName , value ) ; } } queryMap = paramMap ; } catch ( Exception e ) { throw new FoxHttpRequestException ( e ) ; }
public class ASMUtil { /** * Append the call of proper autoboxing method for the given primitif type . */ public static void autoBoxing ( MethodVisitor mv , Class < ? > clz ) { } }
autoBoxing ( mv , Type . getType ( clz ) ) ;
public class OpenAPIModelFilterAdapter { /** * { @ inheritDoc } */ @ Override public APIResponse visitResponse ( Context context , String key , APIResponse response ) { } }
visitor . visitResponse ( context , key , response ) ; return response ;
public class SessionContextRegistry { /** * To get at TrackerData */ public static String getTrackerData ( ) { } }
// loop through all the contexts Enumeration vEnum = scrSessionContexts . elements ( ) ; StringBuffer bigStrbuf = new StringBuffer ( ) ; bigStrbuf . append ( "<center><h3>Session Tracking Internals</h3></center>" + "<UL>\n" ) ; while ( vEnum . hasMoreElements ( ) ) { SessionContext localContext = ( SessionContext ) vEnum . nextElement ( ) ; String contextData = localContext . toHTML ( ) ; bigStrbuf . append ( contextData ) . append ( "</UL>\n" ) ; } return ( bigStrbuf . toString ( ) ) ;
public class QPath { /** * Get relative path with degree . * @ param relativeDegree * - degree value * @ return arrayf of QPathEntry * @ throws IllegalPathException * - if the degree is invalid */ public QPathEntry [ ] getRelPath ( int relativeDegree ) throws IllegalPathException { } }
int len = getLength ( ) - relativeDegree ; if ( len < 0 ) throw new IllegalPathException ( "Relative degree " + relativeDegree + " is more than depth for " + getAsString ( ) ) ; QPathEntry [ ] relPath = new QPathEntry [ relativeDegree ] ; System . arraycopy ( names , len , relPath , 0 , relPath . length ) ; return relPath ;
public class LightWeightHashSet { /** * Remove and return first n elements on the linked list of all elements . * @ return first element */ public List < T > pollN ( int n ) { } }
if ( n >= size ) { return pollAll ( ) ; } List < T > retList = new ArrayList < T > ( n ) ; if ( n == 0 ) { return retList ; } boolean done = false ; int currentBucketIndex = 0 ; while ( ! done ) { LinkedElement < T > current = entries [ currentBucketIndex ] ; while ( current != null ) { retList . add ( current . element ) ; current = current . next ; entries [ currentBucketIndex ] = current ; size -- ; modification ++ ; if ( -- n == 0 ) { done = true ; break ; } } currentBucketIndex ++ ; } shrinkIfNecessary ( ) ; return retList ;
public class HttpConnector { /** * Handles output from the application . This may be the payload * of e . g . a POST or data to be transferes on a websocket connection . * @ param event the event * @ param appChannel the application layer channel * @ throws InterruptedException the interrupted exception */ @ Handler public void onOutput ( Output < ? > event , WebAppMsgChannel appChannel ) throws InterruptedException { } }
appChannel . handleAppOutput ( event ) ;
public class ServerSentEventService { /** * Adds a new connection to the manager * @ param connection The connection to put */ public void addConnection ( ServerSentEventConnection connection ) { } }
Objects . requireNonNull ( connection , Required . CONNECTION . toString ( ) ) ; final String url = RequestUtils . getServerSentEventURL ( connection ) ; Set < ServerSentEventConnection > uriConnections = getConnections ( url ) ; if ( uriConnections == null ) { uriConnections = new HashSet < > ( ) ; uriConnections . add ( connection ) ; } else { uriConnections . add ( connection ) ; } setConnections ( url , uriConnections ) ;
public class LBiObjDblPredicateBuilder { /** * One of ways of creating builder . This is possibly the least verbose way where compiler should be able to guess the generic parameters . */ @ Nonnull public static < T1 , T2 > LBiObjDblPredicate < T1 , T2 > biObjDblPredicateFrom ( Consumer < LBiObjDblPredicateBuilder < T1 , T2 > > buildingFunction ) { } }
LBiObjDblPredicateBuilder builder = new LBiObjDblPredicateBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ;
public class TableSchema { /** * Returns the specified name for the given field index . * @ param fieldIndex the index of the field */ public Optional < String > getFieldName ( int fieldIndex ) { } }
if ( fieldIndex < 0 || fieldIndex >= fieldNames . length ) { return Optional . empty ( ) ; } return Optional . of ( fieldNames [ fieldIndex ] ) ;
public class RelationMention { /** * indexed setter for arguments - sets an indexed value - * @ generated * @ param i index in the array to set * @ param v value to set into the array */ public void setArguments ( int i , ArgumentMention v ) { } }
if ( RelationMention_Type . featOkTst && ( ( RelationMention_Type ) jcasType ) . casFeat_arguments == null ) jcasType . jcas . throwFeatMissing ( "arguments" , "de.julielab.jules.types.RelationMention" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( RelationMention_Type ) jcasType ) . casFeatCode_arguments ) , i ) ; jcasType . ll_cas . ll_setRefArrayValue ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( RelationMention_Type ) jcasType ) . casFeatCode_arguments ) , i , jcasType . ll_cas . ll_getFSRef ( v ) ) ;
public class SmbComLockingAndX { /** * { @ inheritDoc } * @ see jcifs . internal . smb1 . ServerMessageBlock # readParameterWordsWireFormat ( byte [ ] , int ) */ @ Override protected int readParameterWordsWireFormat ( byte [ ] buffer , int bufferIndex ) { } }
int start = bufferIndex ; this . fid = SMBUtil . readInt2 ( buffer , bufferIndex ) ; bufferIndex += 2 ; this . typeOfLock = buffer [ bufferIndex ] ; if ( ( this . typeOfLock & 0x10 ) == 0x10 ) { this . largeFile = true ; } this . newOpLockLevel = buffer [ bufferIndex + 1 ] ; bufferIndex += 2 ; this . timeout = SMBUtil . readInt4 ( buffer , bufferIndex ) ; bufferIndex += 4 ; int nunlocks = SMBUtil . readInt2 ( buffer , bufferIndex ) ; this . unlocks = new LockingAndXRange [ nunlocks ] ; bufferIndex += 2 ; int nlocks = SMBUtil . readInt2 ( buffer , bufferIndex ) ; this . locks = new LockingAndXRange [ nlocks ] ; bufferIndex += 2 ; return start - bufferIndex ;
public class Cipher { /** * Returns the length in bytes that an output buffer would need to be in * order to hold the result of the next < code > update < / code > or * < code > doFinal < / code > operation , given the input length * < code > inputLen < / code > ( in bytes ) . * < p > This call takes into account any unprocessed ( buffered ) data from a * previous < code > update < / code > call , padding , and AEAD tagging . * < p > The actual output length of the next < code > update < / code > or * < code > doFinal < / code > call may be smaller than the length returned by * this method . * @ param inputLen the input length ( in bytes ) * @ return the required output buffer size ( in bytes ) * @ exception IllegalStateException if this cipher is in a wrong state * ( e . g . , has not yet been initialized ) */ public final int getOutputSize ( int inputLen ) { } }
if ( ! initialized && ! ( this instanceof NullCipher ) ) { throw new IllegalStateException ( "Cipher not initialized" ) ; } if ( inputLen < 0 ) { throw new IllegalArgumentException ( "Input size must be equal " + "to or greater than zero" ) ; } updateProviderIfNeeded ( ) ; return spi . engineGetOutputSize ( inputLen ) ;
public class SHARED_LOOPBACK { /** * / * - - - - - Protocol interface - - - - - */ public Object down ( Event evt ) { } }
Object retval = super . down ( evt ) ; switch ( evt . getType ( ) ) { case Event . CONNECT : case Event . CONNECT_WITH_STATE_TRANSFER : case Event . CONNECT_USE_FLUSH : case Event . CONNECT_WITH_STATE_TRANSFER_USE_FLUSH : register ( cluster_name , local_addr , this ) ; break ; case Event . DISCONNECT : unregister ( cluster_name , local_addr ) ; break ; case Event . SET_LOCAL_ADDRESS : local_addr = evt . getArg ( ) ; break ; case Event . BECOME_SERVER : // called after client has joined and is fully working group member is_server = true ; break ; case Event . VIEW_CHANGE : case Event . TMP_VIEW : curr_view = evt . getArg ( ) ; Address [ ] mbrs = ( ( View ) evt . getArg ( ) ) . getMembersRaw ( ) ; is_coord = local_addr != null && mbrs != null && mbrs . length > 0 && local_addr . equals ( mbrs [ 0 ] ) ; break ; case Event . GET_PING_DATA : return getDiscoveryResponsesFor ( evt . getArg ( ) ) ; // don ' t pass further down case Event . GET_PHYSICAL_ADDRESS : if ( cluster_name == null ) return retval ; Address mbr = evt . getArg ( ) ; Map < Address , SHARED_LOOPBACK > map = routing_table . get ( cluster_name ) ; SHARED_LOOPBACK lp = map != null ? map . get ( mbr ) : null ; return lp != null ? lp . getPhysicalAddress ( ) : null ; } return retval ;
public class Log { /** * Understands and applies the following boolean properties . True is the * default value if the value doesn ' t equal " false " , ignoring case . * < ul > * < li > enabled * < li > debug * < li > info * < li > warn * < li > error * < / ul > */ public void applyProperties ( Map properties ) { } }
if ( properties . containsKey ( "enabled" ) ) { setEnabled ( ! "false" . equalsIgnoreCase ( ( String ) properties . get ( "enabled" ) ) ) ; } if ( properties . containsKey ( "debug" ) ) { setDebugEnabled ( ! "false" . equalsIgnoreCase ( ( String ) properties . get ( "debug" ) ) ) ; } if ( properties . containsKey ( "info" ) ) { setInfoEnabled ( ! "false" . equalsIgnoreCase ( ( String ) properties . get ( "info" ) ) ) ; } if ( properties . containsKey ( "warn" ) ) { setWarnEnabled ( ! "false" . equalsIgnoreCase ( ( String ) properties . get ( "warn" ) ) ) ; } if ( properties . containsKey ( "error" ) ) { setErrorEnabled ( ! "false" . equalsIgnoreCase ( ( String ) properties . get ( "error" ) ) ) ; }
public class tmsessionpolicy_aaagroup_binding { /** * Use this API to fetch tmsessionpolicy _ aaagroup _ binding resources of given name . */ public static tmsessionpolicy_aaagroup_binding [ ] get ( nitro_service service , String name ) throws Exception { } }
tmsessionpolicy_aaagroup_binding obj = new tmsessionpolicy_aaagroup_binding ( ) ; obj . set_name ( name ) ; tmsessionpolicy_aaagroup_binding response [ ] = ( tmsessionpolicy_aaagroup_binding [ ] ) obj . get_resources ( service ) ; return response ;
public class ProtectionContainersInner { /** * Inquires all the protectable item in the given container that can be protected . * Inquires all the protectable items that are protectable under the given container . * @ param vaultName The name of the recovery services vault . * @ param resourceGroupName The name of the resource group where the recovery services vault is present . * @ param fabricName Fabric Name associated with the container . * @ param containerName Name of the container in which inquiry needs to be triggered . * @ param filter OData filter options . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceResponse } object if successful . */ public Observable < Void > inquireAsync ( String vaultName , String resourceGroupName , String fabricName , String containerName , String filter ) { } }
return inquireWithServiceResponseAsync ( vaultName , resourceGroupName , fabricName , containerName , filter ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ;
public class KeyTranslatorImpl { /** * documentation inherited from interface KeyTranslator */ public String getReleaseCommand ( char ch ) { } }
KeyRecord krec = _charCommands . get ( ch ) ; return ( krec == null ) ? null : krec . releaseCommand ;
public class RunLevel { /** * All cache initialize methods stored in { @ link # cacheMethods } are called . * @ see # cacheMethods * @ throws EFapsException on error */ protected void executeMethods ( ) throws EFapsException { } }
if ( this . parent != null ) { this . parent . executeMethods ( ) ; } for ( final CacheMethod cacheMethod : this . cacheMethods ) { cacheMethod . callMethod ( ) ; }
public class AmazonIdentityManagementClient { /** * Retrieves the specified SSH public key , including metadata about the key . * The SSH public key retrieved by this operation is used only for authenticating the associated IAM user to an AWS * CodeCommit repository . For more information about using SSH keys to authenticate to an AWS CodeCommit repository , * see < a href = " https : / / docs . aws . amazon . com / codecommit / latest / userguide / setting - up - credentials - ssh . html " > Set up AWS * CodeCommit for SSH Connections < / a > in the < i > AWS CodeCommit User Guide < / i > . * @ param getSSHPublicKeyRequest * @ return Result of the GetSSHPublicKey operation returned by the service . * @ throws NoSuchEntityException * The request was rejected because it referenced a resource entity that does not exist . The error message * describes the resource . * @ throws UnrecognizedPublicKeyEncodingException * The request was rejected because the public key encoding format is unsupported or unrecognized . * @ sample AmazonIdentityManagement . GetSSHPublicKey * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / iam - 2010-05-08 / GetSSHPublicKey " target = " _ top " > AWS API * Documentation < / a > */ @ Override public GetSSHPublicKeyResult getSSHPublicKey ( GetSSHPublicKeyRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeGetSSHPublicKey ( request ) ;
public class ZxingKit { /** * 将BufferedImage对象写入文件 * @ param bufImg * BufferedImage对象 * @ param format * 图片格式 , 可选 [ png , jpg , bmp ] * @ param saveImgFilePath * 存储图片的完整位置 , 包含文件名 * @ return { boolean } */ @ SuppressWarnings ( "finally" ) public static boolean writeToFile ( BufferedImage bufImg , String format , String saveImgFilePath ) { } }
Boolean bool = false ; try { bool = ImageIO . write ( bufImg , format , new File ( saveImgFilePath ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } finally { return bool ; }
public class EpanetWrapper { /** * Retrieves the value of a specific link parameter . * @ param index link index . * @ param param { @ link LinkParameters } . * @ return the value . * @ throws EpanetException */ public float [ ] ENgetlinkvalue ( int index , LinkParameters param ) throws EpanetException { } }
float [ ] value = new float [ 2 ] ; int errcode = epanet . ENgetlinkvalue ( index , param . getCode ( ) , value ) ; checkError ( errcode ) ; return value ;
public class IfcDistributionControlElementImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public EList < IfcRelFlowControlElements > getAssignedToFlowElement ( ) { } }
return ( EList < IfcRelFlowControlElements > ) eGet ( Ifc4Package . Literals . IFC_DISTRIBUTION_CONTROL_ELEMENT__ASSIGNED_TO_FLOW_ELEMENT , true ) ;
public class SegmentMetadataUpdateTransaction { /** * Applies all the outstanding changes to the base SegmentMetadata object . */ void apply ( UpdateableSegmentMetadata target ) { } }
if ( ! this . isChanged ) { // No changes made . return ; } Preconditions . checkArgument ( target . getId ( ) == this . id , "Target Segment Id mismatch. Expected %s, given %s." , this . id , target . getId ( ) ) ; Preconditions . checkArgument ( target . getName ( ) . equals ( this . name ) , "Target Segment Name mismatch. Expected %s, given %s." , name , target . getName ( ) ) ; // Apply to base metadata . target . setLastUsed ( this . lastUsed ) ; target . updateAttributes ( this . attributeUpdates ) ; target . setLength ( this . length ) ; // Update StartOffset after ( potentially ) updating the length , since he Start Offset must be less than or equal to Length . target . setStartOffset ( this . startOffset ) ; if ( this . storageLength >= 0 ) { // Only update this if it really was set . Otherwise we might revert back to an old value if the Writer // has already made progress on it . target . setStorageLength ( this . storageLength ) ; } if ( this . sealed ) { target . markSealed ( ) ; if ( this . sealedInStorage ) { target . markSealedInStorage ( ) ; } } if ( this . merged ) { target . markMerged ( ) ; } if ( this . deleted ) { target . markDeleted ( ) ; if ( this . deletedInStorage ) { target . markDeletedInStorage ( ) ; } } if ( this . pinned ) { target . markPinned ( ) ; }
public class ModelAdapter { /** * static method to retrieve a new ` ItemAdapter ` * @ return a new ItemAdapter */ public static < Model , Item extends IItem > ModelAdapter < Model , Item > models ( IInterceptor < Model , Item > interceptor ) { } }
return new ModelAdapter < > ( interceptor ) ;
public class CmsCmisRepository { /** * Initializes a CMS context for the authentication data contained in a call context . < p > * @ param context the call context * @ return the initialized CMS context */ protected CmsObject getCmsObject ( CmsCmisCallContext context ) { } }
try { if ( context . getUsername ( ) == null ) { // user name can be null CmsObject cms = OpenCms . initCmsObject ( OpenCms . getDefaultUsers ( ) . getUserGuest ( ) ) ; cms . getRequestContext ( ) . setCurrentProject ( m_adminCms . getRequestContext ( ) . getCurrentProject ( ) ) ; return cms ; } else { CmsObject cms = OpenCms . initCmsObject ( m_adminCms ) ; CmsProject projectBeforeLogin = cms . getRequestContext ( ) . getCurrentProject ( ) ; cms . loginUser ( context . getUsername ( ) , context . getPassword ( ) ) ; cms . getRequestContext ( ) . setCurrentProject ( projectBeforeLogin ) ; return cms ; } } catch ( CmsException e ) { throw new CmisPermissionDeniedException ( e . getLocalizedMessage ( ) , e ) ; }
public class LocalSymbolTableImports { /** * Finds a symbol already interned by an import , returning the lowest * known SID . * This method will not necessarily return the same instance given the * same input . * @ param text the symbol text to find * @ return * the interned symbol ( with both text and SID ) , or { @ code null } * if it ' s not defined by an imported table */ SymbolToken find ( String text ) { } }
for ( int i = 0 ; i < myImports . length ; i ++ ) { SymbolTable importedTable = myImports [ i ] ; SymbolToken tok = importedTable . find ( text ) ; if ( tok != null ) { int sid = tok . getSid ( ) + myBaseSids [ i ] ; text = tok . getText ( ) ; // Use interned instance assert text != null ; return new SymbolTokenImpl ( text , sid ) ; } } return null ;
public class Graph { /** * Runs a { @ link VertexCentricIteration } on the graph with configuration options . * @ param computeFunction the vertex compute function * @ param combiner an optional message combiner * @ param maximumNumberOfIterations maximum number of iterations to perform * @ param parameters the { @ link VertexCentricConfiguration } parameters * @ return the updated Graph after the vertex - centric iteration has converged or * after maximumNumberOfIterations . */ public < M > Graph < K , VV , EV > runVertexCentricIteration ( ComputeFunction < K , VV , EV , M > computeFunction , MessageCombiner < K , M > combiner , int maximumNumberOfIterations , VertexCentricConfiguration parameters ) { } }
VertexCentricIteration < K , VV , EV , M > iteration = VertexCentricIteration . withEdges ( edges , computeFunction , combiner , maximumNumberOfIterations ) ; iteration . configure ( parameters ) ; DataSet < Vertex < K , VV > > newVertices = this . getVertices ( ) . runOperation ( iteration ) ; return new Graph < > ( newVertices , this . edges , this . context ) ;
public class AnomalyDetectionTransform { /** * Identifies the min and max values of a metric * @ param metricData Metric to find the min and max values of * @ return Map containing the min and max values of the metric */ private Map < String , Double > getMinMax ( Map < Long , Double > metricData ) { } }
double min = 0.0 ; double max = 0.0 ; boolean isMinMaxSet = false ; for ( Double value : metricData . values ( ) ) { double valueDouble = value ; if ( ! isMinMaxSet ) { min = valueDouble ; max = valueDouble ; isMinMaxSet = true ; } else { if ( valueDouble < min ) { min = valueDouble ; } else if ( valueDouble > max ) { max = valueDouble ; } } } Map < String , Double > minMax = new HashMap < > ( ) ; minMax . put ( "min" , min ) ; minMax . put ( "max" , max ) ; return minMax ;
public class StringMap { public void readExternal ( java . io . ObjectInput in ) throws java . io . IOException , ClassNotFoundException { } }
HashMap map = ( HashMap ) in . readObject ( ) ; this . putAll ( map ) ;
public class Common { /** * Alert in the console of a database update . * @ param currentVersion The current version * @ param newVersion The database update version */ private void alertOldDbVersion ( int currentVersion , int newVersion ) { } }
Common . getInstance ( ) . sendConsoleMessage ( Level . INFO , "Your database is out of date! (Version " + currentVersion + "). Updating it to Revision " + newVersion + "." ) ;
public class CommerceCountryUtil { /** * Returns the first commerce country in the ordered set where groupId = & # 63 ; and active = & # 63 ; . * @ param groupId the group ID * @ param active the active * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching commerce country , or < code > null < / code > if a matching commerce country could not be found */ public static CommerceCountry fetchByG_A_First ( long groupId , boolean active , OrderByComparator < CommerceCountry > orderByComparator ) { } }
return getPersistence ( ) . fetchByG_A_First ( groupId , active , orderByComparator ) ;
public class FactoryBuilderSupport { /** * Use { @ link FactoryBuilderSupport # dispatchNodeCall ( Object , Object ) } instead . */ @ Deprecated protected Object dispathNodeCall ( Object name , Object args ) { } }
return dispatchNodeCall ( name , args ) ;
public class Page { /** * Returns all elements of the given HTML tag name as subtypes of { @ link DomElement } . * @ param tagName HTML tag name * @ param < T > type of elements * @ return list of DOM elements */ @ SuppressWarnings ( "unchecked" ) private < T extends DomElement > List < T > allByTagName ( String tagName ) { } }
return ( List < T > ) htmlPage . getElementsByTagName ( tagName ) ;
public class PresentationSpaceResetMixingImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case AfplibPackage . PRESENTATION_SPACE_RESET_MIXING__BG_MX_FLAG : setBgMxFlag ( ( Integer ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
public class AbstractSegment3F { /** * Replies the squared distance between this segment and the given point . * @ param point * @ return the squared distance . */ @ Pure public double distanceSquaredSegment ( Point3D point ) { } }
return distanceSquaredSegmentPoint ( getX1 ( ) , getY1 ( ) , getZ1 ( ) , getX2 ( ) , getY2 ( ) , getZ2 ( ) , point . getX ( ) , point . getY ( ) , point . getZ ( ) ) ;
public class PasswordCrypt { /** * Converts the salt into a byte array using { @ link # stringToSalt ( String ) } and * then calls { @ link # computePasswordHash ( String , byte [ ] ) } */ public static String computePasswordHash ( final String password , final String salt ) { } }
return computePasswordHash ( password , stringToSalt ( salt ) ) ;
public class IronJacamarWithByteman { /** * { @ inheritDoc } */ @ Override public void extensionStart ( TestClass tc ) throws Exception { } }
List < ScriptText > scripts = new ArrayList < ScriptText > ( ) ; int key = 1 ; BMRules rules = tc . getAnnotation ( BMRules . class ) ; if ( rules != null ) { for ( BMRule rule : rules . value ( ) ) { scripts . add ( createScriptText ( key , rule ) ) ; key ++ ; } } BMRule rule = tc . getAnnotation ( BMRule . class ) ; if ( rule != null ) { scripts . add ( createScriptText ( key , rule ) ) ; } if ( ! scripts . isEmpty ( ) ) { Submit submit = new Submit ( ) ; String result = submit . addScripts ( scripts ) ; }
public class DescribeFileSystemsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeFileSystemsRequest describeFileSystemsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeFileSystemsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeFileSystemsRequest . getFileSystemIds ( ) , FILESYSTEMIDS_BINDING ) ; protocolMarshaller . marshall ( describeFileSystemsRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; protocolMarshaller . marshall ( describeFileSystemsRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class LCMSRunInfo { /** * Call with null parameter to unset . * @ param id this id must be present in the run info already . */ public void setDefaultInstrumentID ( String id ) { } }
if ( id == null ) { unsetDefaultInstrument ( ) ; return ; } if ( instruments . containsKey ( id ) ) { defaultInstrumentID = id ; isDefaultExplicitlySet = true ; } else { throw new IllegalArgumentException ( "The instrument map did not contain provided instrument ID, " + "have you added the instrument first?" ) ; }
public class CmsColorSelector { /** * Sets the Red , Green , and Blue color variables . This will automatically populate the Hue , Saturation and Brightness and Hexadecimal fields , too . * The RGB color model is an additive color model in which red , green , and blue light are added together in various ways to reproduce a broad array of colors . The name of the model comes from the initials of the three additive primary colors , red , green , and blue . * @ param red strength - valid range is 0-255 * @ param green strength - valid range is 0-255 * @ param blue strength - valid range is 0-255 * @ throws java . lang . Exception Exception if the Red , Green or Blue variables are out of range . */ public void setRGB ( int red , int green , int blue ) throws Exception { } }
CmsColor color = new CmsColor ( ) ; color . setRGB ( red , green , blue ) ; m_red = red ; m_green = green ; m_blue = blue ; m_hue = color . getHue ( ) ; m_saturation = color . getSaturation ( ) ; m_brightness = color . getValue ( ) ; m_tbRed . setText ( Integer . toString ( m_red ) ) ; m_tbGreen . setText ( Integer . toString ( m_green ) ) ; m_tbBlue . setText ( Integer . toString ( m_blue ) ) ; m_tbHue . setText ( Integer . toString ( m_hue ) ) ; m_tbSaturation . setText ( Integer . toString ( m_saturation ) ) ; m_tbBrightness . setText ( Integer . toString ( m_brightness ) ) ; m_tbHexColor . setText ( color . getHex ( ) ) ; setPreview ( color . getHex ( ) ) ; updateSliders ( ) ;
public class AbstractDocument { /** * Helper method to create the document from an object input stream , used for serialization purposes . * @ param stream the stream to read from . * @ throws IOException * @ throws ClassNotFoundException */ @ SuppressWarnings ( "unchecked" ) protected void readFromSerializedStream ( final ObjectInputStream stream ) throws IOException , ClassNotFoundException { } }
cas = stream . readLong ( ) ; expiry = stream . readInt ( ) ; id = stream . readUTF ( ) ; content = ( T ) stream . readObject ( ) ; mutationToken = ( MutationToken ) stream . readObject ( ) ;
public class TemplateHelper { /** * Return a list of producible media types of the last matched resource method . * @ param extendedUriInfo uri info to obtain resource method from . * @ return list of producible media types of the last matched resource method . */ private static List < MediaType > getResourceMethodProducibleTypes ( final ExtendedUriInfo extendedUriInfo ) { } }
if ( extendedUriInfo . getMatchedResourceMethod ( ) != null && ! extendedUriInfo . getMatchedResourceMethod ( ) . getProducedTypes ( ) . isEmpty ( ) ) { return extendedUriInfo . getMatchedResourceMethod ( ) . getProducedTypes ( ) ; } return Collections . singletonList ( MediaType . WILDCARD_TYPE ) ;
public class AbstractResourceBasedServiceRegistry { /** * Gets registered service from file . * @ param file the file * @ return the registered service from file */ protected RegisteredService getRegisteredServiceFromFile ( final File file ) { } }
val fileName = file . getName ( ) ; if ( fileName . startsWith ( "." ) ) { LOGGER . trace ( "[{}] starts with ., ignoring" , fileName ) ; return null ; } if ( Arrays . stream ( getExtensions ( ) ) . noneMatch ( fileName :: endsWith ) ) { LOGGER . trace ( "[{}] doesn't end with valid extension, ignoring" , fileName ) ; return null ; } val matcher = this . serviceFileNamePattern . matcher ( fileName ) ; if ( matcher . find ( ) ) { val serviceId = matcher . group ( 2 ) ; if ( NumberUtils . isCreatable ( serviceId ) ) { val id = Long . parseLong ( serviceId ) ; return findServiceById ( id ) ; } val serviceName = matcher . group ( 1 ) ; return findServiceByExactServiceName ( serviceName ) ; } LOGGER . warn ( "Provided file [{}} does not match the recommended service definition file pattern [{}]" , file . getName ( ) , this . serviceFileNamePattern . pattern ( ) ) ; return null ;