signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class HistogramLikeValue { /** * adds a new value to the InApplicationMonitor , grouping it into the appropriate bin . * @ param newValue the value that should be added */ public void addValue ( long newValue ) { } }
// keep a " total " timer for all values InApplicationMonitor . getInstance ( ) . addTimerMeasurement ( timerName , newValue ) ; // keep track of the current maximum value if ( newValue > currentMaxValue ) { currentMaxValue = newValue ; } // select the bin to put this value in long binIndex ; if ( newValue > maxLimit ) { binIndex = maxLimit / factor ; } else { binIndex = newValue / factor ; } // add the new value to the appropriate bin String binName = getBinName ( binIndex ) ; InApplicationMonitor . getInstance ( ) . incrementCounter ( binName ) ;
public class AbstractCli { /** * Creates a { @ code StochasticGradientTrainer } configured using the * provided options . In order to use this method , pass * { @ link CommonOptions # STOCHASTIC _ GRADIENT } to the constructor . * @ return a stochastic gradient trainer configured using any * command - line options passed to the program */ private StochasticGradientTrainer createStochasticGradientTrainer ( int numExamples ) { } }
Preconditions . checkState ( opts . contains ( CommonOptions . STOCHASTIC_GRADIENT ) ) ; long iterationsOption = parsedOptions . valueOf ( sgdIterations ) ; int batchSize = numExamples ; if ( parsedOptions . has ( sgdBatchSize ) ) { batchSize = parsedOptions . valueOf ( sgdBatchSize ) ; } long numIterations = ( int ) Math . ceil ( iterationsOption * numExamples / ( ( double ) batchSize ) ) ; double initialStepSize = parsedOptions . valueOf ( sgdInitialStep ) ; double l2Regularization = parsedOptions . valueOf ( sgdL2Regularization ) ; LogFunction log = LogFunctions . getLogFunction ( ) ; StochasticGradientTrainer trainer = null ; if ( ! parsedOptions . has ( sgdAdagrad ) ) { trainer = StochasticGradientTrainer . createWithStochasticL2Regularization ( numIterations , batchSize , initialStepSize , ! parsedOptions . has ( sgdNoDecayStepSize ) , ! parsedOptions . has ( sgdNoReturnAveragedParameters ) , parsedOptions . valueOf ( sgdClipGradients ) , l2Regularization , parsedOptions . valueOf ( sgdRegularizationFrequency ) , log ) ; } else { trainer = StochasticGradientTrainer . createAdagrad ( numIterations , batchSize , initialStepSize , ! parsedOptions . has ( sgdNoDecayStepSize ) , ! parsedOptions . has ( sgdNoReturnAveragedParameters ) , parsedOptions . valueOf ( sgdClipGradients ) , l2Regularization , parsedOptions . valueOf ( sgdRegularizationFrequency ) , log ) ; } return trainer ;
public class Difference { /** * field type changed */ private boolean matches6004 ( ApiDifference apiDiff ) { } }
throwIfMissing ( true , false , true , true ) ; if ( ! SelectorUtils . matchPath ( field , apiDiff . getAffectedField ( ) ) ) { return false ; } String [ ] args = getArgs ( apiDiff ) ; String diffFrom = args [ 0 ] ; String diffTo = args [ 1 ] ; return SelectorUtils . matchPath ( from , diffFrom ) && SelectorUtils . matchPath ( to , diffTo ) ;
public class Logger { /** * Issue a formatted log message with a level of TRACE . * @ param format the format string as per { @ link String # format ( String , Object . . . ) } or resource bundle key therefor * @ param params the parameters */ public void tracef ( String format , Object ... params ) { } }
doLogf ( Level . TRACE , FQCN , format , params , null ) ;
public class XmlEscape { /** * Perform a ( configurable ) XML 1.1 < strong > escape < / strong > operation on a < tt > String < / tt > input , * writing results to a < tt > Writer < / tt > . * This method will perform an escape operation according to the specified * { @ link org . unbescape . xml . XmlEscapeType } and { @ link org . unbescape . xml . XmlEscapeLevel } * argument values . * All other < tt > String < / tt > / < tt > Writer < / tt > - based < tt > escapeXml11 * ( . . . ) < / tt > methods call this one with preconfigured * < tt > type < / tt > and < tt > level < / tt > values . * This method is < strong > thread - safe < / strong > . * @ param text the < tt > String < / tt > to be escaped . * @ param type the type of escape operation to be performed , see { @ link org . unbescape . xml . XmlEscapeType } . * @ param writer the < tt > java . io . Writer < / tt > to which the escaped result will be written . Nothing will * be written at all to this writer if input is < tt > null < / tt > . * @ param level the escape level to be applied , see { @ link org . unbescape . xml . XmlEscapeLevel } . * @ throws IOException if an input / output exception occurs * @ since 1.1.2 */ public static void escapeXml11 ( final String text , final Writer writer , final XmlEscapeType type , final XmlEscapeLevel level ) throws IOException { } }
escapeXml ( text , writer , XmlEscapeSymbols . XML11_SYMBOLS , type , level ) ;
public class XtextFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EObject create ( EClass eClass ) { } }
switch ( eClass . getClassifierID ( ) ) { case XtextPackage . GRAMMAR : return createGrammar ( ) ; case XtextPackage . ABSTRACT_RULE : return createAbstractRule ( ) ; case XtextPackage . ABSTRACT_METAMODEL_DECLARATION : return createAbstractMetamodelDeclaration ( ) ; case XtextPackage . GENERATED_METAMODEL : return createGeneratedMetamodel ( ) ; case XtextPackage . REFERENCED_METAMODEL : return createReferencedMetamodel ( ) ; case XtextPackage . PARSER_RULE : return createParserRule ( ) ; case XtextPackage . TYPE_REF : return createTypeRef ( ) ; case XtextPackage . ABSTRACT_ELEMENT : return createAbstractElement ( ) ; case XtextPackage . ACTION : return createAction ( ) ; case XtextPackage . KEYWORD : return createKeyword ( ) ; case XtextPackage . RULE_CALL : return createRuleCall ( ) ; case XtextPackage . ASSIGNMENT : return createAssignment ( ) ; case XtextPackage . CROSS_REFERENCE : return createCrossReference ( ) ; case XtextPackage . TERMINAL_RULE : return createTerminalRule ( ) ; case XtextPackage . ABSTRACT_NEGATED_TOKEN : return createAbstractNegatedToken ( ) ; case XtextPackage . NEGATED_TOKEN : return createNegatedToken ( ) ; case XtextPackage . UNTIL_TOKEN : return createUntilToken ( ) ; case XtextPackage . WILDCARD : return createWildcard ( ) ; case XtextPackage . ENUM_RULE : return createEnumRule ( ) ; case XtextPackage . ENUM_LITERAL_DECLARATION : return createEnumLiteralDeclaration ( ) ; case XtextPackage . ALTERNATIVES : return createAlternatives ( ) ; case XtextPackage . UNORDERED_GROUP : return createUnorderedGroup ( ) ; case XtextPackage . GROUP : return createGroup ( ) ; case XtextPackage . CHARACTER_RANGE : return createCharacterRange ( ) ; case XtextPackage . COMPOUND_ELEMENT : return createCompoundElement ( ) ; case XtextPackage . EOF : return createEOF ( ) ; case XtextPackage . PARAMETER : return createParameter ( ) ; case XtextPackage . NAMED_ARGUMENT : return createNamedArgument ( ) ; case XtextPackage . CONDITION : return createCondition ( ) ; case XtextPackage . CONJUNCTION : return createConjunction ( ) ; case XtextPackage . NEGATION : return createNegation ( ) ; case XtextPackage . DISJUNCTION : return createDisjunction ( ) ; case XtextPackage . COMPOSITE_CONDITION : return createCompositeCondition ( ) ; case XtextPackage . PARAMETER_REFERENCE : return createParameterReference ( ) ; case XtextPackage . LITERAL_CONDITION : return createLiteralCondition ( ) ; case XtextPackage . ANNOTATION : return createAnnotation ( ) ; default : throw new IllegalArgumentException ( "The class '" + eClass . getName ( ) + "' is not a valid classifier" ) ; }
public class AzureServiceFuture { /** * Creates a ServiceCall from a paging operation that returns a header response . * @ param first the observable to the first page * @ param next the observable to poll subsequent pages * @ param callback the client - side callback * @ param < E > the element type * @ param < V > the header object type * @ return the future based ServiceCall */ public static < E , V > ServiceFuture < List < E > > fromHeaderPageResponse ( Observable < ServiceResponseWithHeaders < Page < E > , V > > first , final Func1 < String , Observable < ServiceResponseWithHeaders < Page < E > , V > > > next , final ListOperationCallback < E > callback ) { } }
final AzureServiceFuture < List < E > > serviceCall = new AzureServiceFuture < > ( ) ; final PagingSubscriber < E > subscriber = new PagingSubscriber < > ( serviceCall , new Func1 < String , Observable < ServiceResponse < Page < E > > > > ( ) { @ Override public Observable < ServiceResponse < Page < E > > > call ( String s ) { return next . call ( s ) . map ( new Func1 < ServiceResponseWithHeaders < Page < E > , V > , ServiceResponse < Page < E > > > ( ) { @ Override public ServiceResponse < Page < E > > call ( ServiceResponseWithHeaders < Page < E > , V > pageVServiceResponseWithHeaders ) { return pageVServiceResponseWithHeaders ; } } ) ; } } , callback ) ; serviceCall . setSubscription ( first . single ( ) . subscribe ( subscriber ) ) ; return serviceCall ;
public class FlowController { /** * Log out the current user . Goes through a custom { @ link LoginHandler } , if one has been configured in * beehive - netui - config . xml . * @ param invalidateSessions if true , the session is invalidated ( on all single - signon webapps ) ; * otherwise the session and its data are left intact ( except for authentication * information used internally by the server ) . To invalidate the session in only the * current webapp , set this parameter to < code > false < / code > and call * { @ link FlowController # getSession } . invalidate ( ) . */ public void logout ( boolean invalidateSessions ) { } }
LoginHandler lh = Handlers . get ( getServletContext ( ) ) . getLoginHandler ( ) ; lh . logout ( getHandlerContext ( ) , invalidateSessions ) ;
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertFNDFtDsFlagsToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class PendingInvitation { /** * Gets the client value for this PendingInvitation . * @ return client */ public com . google . api . ads . adwords . axis . v201809 . mcm . ManagedCustomer getClient ( ) { } }
return client ;
public class SpillRecord { /** * Write this spill record to the location provided . */ public void writeToFile ( Path loc , JobConf job ) throws IOException { } }
writeToFile ( loc , job , new PureJavaCrc32 ( ) ) ;
public class FileDefinitionParser { /** * Parses the file and fills - in the resulting structure . * @ throws IOException */ private void fillIn ( ) throws IOException { } }
BufferedReader br = null ; InputStream in = null ; try { in = new FileInputStream ( this . definitionFile . getEditedFile ( ) ) ; br = new BufferedReader ( new InputStreamReader ( in , StandardCharsets . UTF_8 ) ) ; String line ; while ( ( line = nextLine ( br ) ) != null ) { int code = recognizeBlankLine ( line , this . definitionFile . getBlocks ( ) ) ; if ( code == P_CODE_YES ) continue ; code = recognizeComment ( line , this . definitionFile . getBlocks ( ) ) ; if ( code == P_CODE_YES ) continue ; code = recognizeImport ( line ) ; if ( code == P_CODE_CANCEL ) break ; else if ( code == P_CODE_YES ) continue ; code = recognizeFacet ( line , br ) ; if ( code == P_CODE_CANCEL ) break ; else if ( code == P_CODE_YES ) continue ; code = recognizeInstanceOf ( line , br , null ) ; if ( code == P_CODE_CANCEL ) break ; else if ( code == P_CODE_YES ) continue ; // " recognizeComponent " is the last attempt to identify the line . code = recognizeComponent ( line , br ) ; // So , eventually , we add the line as an unknown block . if ( code != P_CODE_YES ) this . definitionFile . getBlocks ( ) . add ( new BlockUnknown ( this . definitionFile , line ) ) ; // Deal with the error codes . // Cancel : break the loop . // No : try to process the next line . if ( code == P_CODE_CANCEL ) break ; if ( code == P_CODE_NO ) addModelError ( ErrorCode . P_UNRECOGNIZED_BLOCK ) ; } if ( line == null && this . lastLineEndedWithLineBreak ) this . definitionFile . getBlocks ( ) . add ( new BlockBlank ( this . definitionFile , "" ) ) ; } finally { Utils . closeQuietly ( br ) ; Utils . closeQuietly ( in ) ; }
public class VisualStudioNETProjectWriter { /** * Get value of PreprocessorDefinitions property . * @ param compilerConfig * compiler configuration . * @ param isDebug * true if generating debug configuration . * @ return value of PreprocessorDefinitions property . */ private String getPreprocessorDefinitions ( final CommandLineCompilerConfiguration compilerConfig , final boolean isDebug ) { } }
final StringBuffer defines = new StringBuffer ( ) ; final String [ ] args = compilerConfig . getPreArguments ( ) ; for ( final String arg : args ) { if ( arg . startsWith ( "/D" ) ) { String macro = arg . substring ( 2 ) ; if ( isDebug ) { if ( macro . equals ( "NDEBUG" ) ) { macro = "_DEBUG" ; } } else { if ( macro . equals ( "_DEBUG" ) ) { macro = "NDEBUG" ; } } defines . append ( macro ) ; defines . append ( ";" ) ; } } if ( defines . length ( ) > 0 ) { defines . setLength ( defines . length ( ) - 1 ) ; } return defines . toString ( ) ;
public class Ed25519LittleEndianEncoding { /** * Decodes a given field element in its 10 byte $ 2 ^ { 25.5 } $ representation . * @ param in The 32 byte representation . * @ return The field element in its $ 2 ^ { 25.5 } $ bit representation . */ public FieldElement decode ( byte [ ] in ) { } }
long h0 = load_4 ( in , 0 ) ; long h1 = load_3 ( in , 4 ) << 6 ; long h2 = load_3 ( in , 7 ) << 5 ; long h3 = load_3 ( in , 10 ) << 3 ; long h4 = load_3 ( in , 13 ) << 2 ; long h5 = load_4 ( in , 16 ) ; long h6 = load_3 ( in , 20 ) << 7 ; long h7 = load_3 ( in , 23 ) << 5 ; long h8 = load_3 ( in , 26 ) << 4 ; long h9 = ( load_3 ( in , 29 ) & 0x7FFFFF ) << 2 ; long carry0 ; long carry1 ; long carry2 ; long carry3 ; long carry4 ; long carry5 ; long carry6 ; long carry7 ; long carry8 ; long carry9 ; // Remember : 2 ^ 255 congruent 19 modulo p carry9 = ( h9 + ( long ) ( 1 << 24 ) ) >> 25 ; h0 += carry9 * 19 ; h9 -= carry9 << 25 ; carry1 = ( h1 + ( long ) ( 1 << 24 ) ) >> 25 ; h2 += carry1 ; h1 -= carry1 << 25 ; carry3 = ( h3 + ( long ) ( 1 << 24 ) ) >> 25 ; h4 += carry3 ; h3 -= carry3 << 25 ; carry5 = ( h5 + ( long ) ( 1 << 24 ) ) >> 25 ; h6 += carry5 ; h5 -= carry5 << 25 ; carry7 = ( h7 + ( long ) ( 1 << 24 ) ) >> 25 ; h8 += carry7 ; h7 -= carry7 << 25 ; carry0 = ( h0 + ( long ) ( 1 << 25 ) ) >> 26 ; h1 += carry0 ; h0 -= carry0 << 26 ; carry2 = ( h2 + ( long ) ( 1 << 25 ) ) >> 26 ; h3 += carry2 ; h2 -= carry2 << 26 ; carry4 = ( h4 + ( long ) ( 1 << 25 ) ) >> 26 ; h5 += carry4 ; h4 -= carry4 << 26 ; carry6 = ( h6 + ( long ) ( 1 << 25 ) ) >> 26 ; h7 += carry6 ; h6 -= carry6 << 26 ; carry8 = ( h8 + ( long ) ( 1 << 25 ) ) >> 26 ; h9 += carry8 ; h8 -= carry8 << 26 ; int [ ] h = new int [ 10 ] ; h [ 0 ] = ( int ) h0 ; h [ 1 ] = ( int ) h1 ; h [ 2 ] = ( int ) h2 ; h [ 3 ] = ( int ) h3 ; h [ 4 ] = ( int ) h4 ; h [ 5 ] = ( int ) h5 ; h [ 6 ] = ( int ) h6 ; h [ 7 ] = ( int ) h7 ; h [ 8 ] = ( int ) h8 ; h [ 9 ] = ( int ) h9 ; return new Ed25519FieldElement ( f , h ) ;
public class MapStoredSessionProviderService { /** * ( non - Javadoc ) * @ see * org . exoplatform . services . jcr . ext . app . SessionProviderService # removeSessionProvider ( java . lang * . Object ) */ public void removeSessionProvider ( Object key ) { } }
if ( providers . containsKey ( key ) ) { getSessionProvider ( key ) . close ( ) ; providers . remove ( key ) ; } if ( systemProviders . containsKey ( key ) ) { systemProviders . get ( key ) . close ( ) ; systemProviders . remove ( key ) ; }
public class AbstractLockedMessageEnumeration { /** * Method to unlock all messages which haven ' t been read * @ param incrementRedeliveryCount * @ throws SISessionDroppedException */ private void unlockAllUnread ( ) throws SIResourceException , SISessionDroppedException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "unlockAllUnread" , new Object [ ] { new Integer ( hashCode ( ) ) , this } ) ; int unlockedMessages = 0 ; synchronized ( this ) { messageAvailable = false ; // Only unlock messages if we have reached the end of the list . if ( firstMsg != null && ! endReached ) { LMEMessage pointerMsg = null ; if ( currentMsg == null ) pointerMsg = firstMsg ; else pointerMsg = currentMsg . next ; LMEMessage removedMsg = null ; boolean more = true ; if ( pointerMsg != null ) { while ( more ) { // See if this is the last message in the list if ( pointerMsg == lastMsg ) more = false ; // Only unlock messages that are in the MS ( and haven ' t already // been unlocked by us ) if ( pointerMsg != currentUnlockedMessage ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Unlocking Message " + pointerMsg ) ; if ( pointerMsg . isStored ) { try { unlockMessage ( pointerMsg . message , false ) ; } catch ( SIMPMessageNotLockedException e ) { // No FFDC code needed SibTr . exception ( tc , e ) ; // See defect 387591 // We should only get this exception if the message was deleted via // the controllable objects i . e . the admin console . If we are here for // another reason that we have a real error . } } unlockedMessages ++ ; } removedMsg = pointerMsg ; pointerMsg = pointerMsg . next ; // Remove the element from the list removeMessage ( removedMsg ) ; } } } } if ( unlockedMessages != 0 ) localConsumerPoint . removeActiveMessages ( unlockedMessages ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "unlockAllUnread" , this ) ;
public class BitSieve { /** * Test probable primes in the sieve and return successful candidates . */ BigInteger retrieve ( BigInteger initValue , int certainty , java . util . Random random ) { } }
// Examine the sieve one long at a time to find possible primes int offset = 1 ; for ( int i = 0 ; i < bits . length ; i ++ ) { long nextLong = ~ bits [ i ] ; for ( int j = 0 ; j < 64 ; j ++ ) { if ( ( nextLong & 1 ) == 1 ) { BigInteger candidate = initValue . add ( BigInteger . valueOf ( offset ) ) ; if ( candidate . primeToCertainty ( certainty , random ) ) return candidate ; } nextLong >>>= 1 ; offset += 2 ; } } return null ;
public class ResourceGroovyMethods { /** * Creates a buffered input stream for this URL . * The default connection parameters can be modified by adding keys to the * < i > parameters map < / i > : * < ul > * < li > connectTimeout : the connection timeout < / li > * < li > readTimeout : the read timeout < / li > * < li > useCaches : set the use cache property for the URL connection < / li > * < li > allowUserInteraction : set the user interaction flag for the URL connection < / li > * < li > requestProperties : a map of properties to be passed to the URL connection < / li > * < / ul > * @ param url a URL * @ param parameters connection parameters * @ return a BufferedInputStream for the URL * @ throws MalformedURLException is thrown if the URL is not well formed * @ throws IOException if an I / O error occurs while creating the input stream * @ since 1.8.1 */ public static BufferedInputStream newInputStream ( URL url , Map parameters ) throws MalformedURLException , IOException { } }
return new BufferedInputStream ( configuredInputStream ( parameters , url ) ) ;
public class LinuxResourceCalculatorPlugin { /** * Test the { @ link LinuxResourceCalculatorPlugin } * @ param args */ public static void main ( String [ ] args ) { } }
LinuxResourceCalculatorPlugin plugin = new LinuxResourceCalculatorPlugin ( ) ; System . out . println ( "Physical memory Size (bytes) : " + plugin . getPhysicalMemorySize ( ) ) ; System . out . println ( "Total Virtual memory Size (bytes) : " + plugin . getVirtualMemorySize ( ) ) ; System . out . println ( "Available Physical memory Size (bytes) : " + plugin . getAvailablePhysicalMemorySize ( ) ) ; System . out . println ( "Total Available Virtual memory Size (bytes) : " + plugin . getAvailableVirtualMemorySize ( ) ) ; System . out . println ( "Number of Processors : " + plugin . getNumProcessors ( ) ) ; System . out . println ( "CPU frequency (kHz) : " + plugin . getCpuFrequency ( ) ) ; System . out . println ( "Cumulative CPU time (ms) : " + plugin . getCumulativeCpuTime ( ) ) ; try { // Sleep so we can compute the CPU usage Thread . sleep ( 500L ) ; } catch ( InterruptedException e ) { // do nothing } System . out . println ( "CPU usage % : " + plugin . getCpuUsage ( ) ) ;
public class ConnectivityPredicate { /** * Filter , which returns true if at least one given type occurred * @ param types int , which can have one or more types * @ return true if at least one given type occurred */ public static Predicate < Connectivity > hasType ( final int ... types ) { } }
final int [ ] extendedTypes = appendUnknownNetworkTypeToTypes ( types ) ; return new Predicate < Connectivity > ( ) { @ Override public boolean test ( @ NonNull Connectivity connectivity ) throws Exception { for ( int type : extendedTypes ) { if ( connectivity . type ( ) == type ) { return true ; } } return false ; } } ;
public class BatchUpdateDaemon { /** * This allows a cache entry to be added to the BatchUpdateDaemon . * The cache entry will be added to all caches . * @ param cacheEntry The cache entry to be added . */ public synchronized void pushAliasEntry ( AliasEntry aliasEntry , DCache cache ) { } }
BatchUpdateList bul = getUpdateList ( cache ) ; bul . aliasEntryEvents . add ( aliasEntry ) ;
public class ApiOvhDomain { /** * DynHost ' logins * REST : GET / domain / zone / { zoneName } / dynHost / login * @ param login [ required ] Filter the value of login property ( like ) * @ param subDomain [ required ] Filter the value of subDomain property ( like ) * @ param zoneName [ required ] The internal name of your zone */ public ArrayList < String > zone_zoneName_dynHost_login_GET ( String zoneName , String login , String subDomain ) throws IOException { } }
String qPath = "/domain/zone/{zoneName}/dynHost/login" ; StringBuilder sb = path ( qPath , zoneName ) ; query ( sb , "login" , login ) ; query ( sb , "subDomain" , subDomain ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t2 ) ;
public class FunctionInjector { /** * Determine which , if any , of the supported types the call site is . * Constant vars are treated differently so that we don ' t break their * const - ness when we decompose the expression . Once the CONSTANT _ VAR * annotation is used everywhere instead of coding conventions , we should just * teach this pass how to remove the annotation . */ private CallSiteType classifyCallSite ( Reference ref ) { } }
Node callNode = ref . callNode ; Node parent = callNode . getParent ( ) ; Node grandParent = parent . getParent ( ) ; // Verify the call site : if ( NodeUtil . isExprCall ( parent ) ) { // This is a simple call . Example : " foo ( ) ; " . return CallSiteType . SIMPLE_CALL ; } else if ( NodeUtil . isExprAssign ( grandParent ) && ! NodeUtil . isNameDeclOrSimpleAssignLhs ( callNode , parent ) && parent . getFirstChild ( ) . isName ( ) // TODO ( nicksantos ) : Remove this once everyone is using // the CONSTANT _ VAR annotation . We know how to remove that . && ! NodeUtil . isConstantName ( parent . getFirstChild ( ) ) ) { // This is a simple assignment . Example : " x = foo ( ) ; " return CallSiteType . SIMPLE_ASSIGNMENT ; } else if ( parent . isName ( ) // TODO ( nicksantos ) : Remove this once everyone is using the CONSTANT _ VAR annotation . && ! NodeUtil . isConstantName ( parent ) // Note : not let or const . See InlineFunctionsTest . testInlineFunctions35 && grandParent . isVar ( ) && grandParent . hasOneChild ( ) ) { // This is a var declaration . Example : " var x = foo ( ) ; " // TODO ( johnlenz ) : Should we be checking for constants on the // left - hand - side of the assignments and handling them as EXPRESSION ? return CallSiteType . VAR_DECL_SIMPLE_ASSIGNMENT ; } else { ExpressionDecomposer decomposer = getDecomposer ( ref . scope ) ; switch ( decomposer . canExposeExpression ( callNode ) ) { case MOVABLE : return CallSiteType . EXPRESSION ; case DECOMPOSABLE : return CallSiteType . DECOMPOSABLE_EXPRESSION ; case UNDECOMPOSABLE : break ; } } return CallSiteType . UNSUPPORTED ;
public class CmsObject { /** * Deletes the versions from the history tables , keeping the given number of versions per resource . < p > * @ param versionsToKeep number of versions to keep , is ignored if negative * @ param versionsDeleted number of versions to keep for deleted resources , is ignored if negative * @ param timeDeleted deleted resources older than this will also be deleted , is ignored if negative * @ param report the report for output logging * @ throws CmsException if operation was not successful */ public void deleteHistoricalVersions ( int versionsToKeep , int versionsDeleted , long timeDeleted , I_CmsReport report ) throws CmsException { } }
m_securityManager . deleteHistoricalVersions ( m_context , versionsToKeep , versionsDeleted , timeDeleted , report ) ;
public class DescribeSubscriptionFiltersResult { /** * The subscription filters . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setSubscriptionFilters ( java . util . Collection ) } or { @ link # withSubscriptionFilters ( java . util . Collection ) } * if you want to override the existing values . * @ param subscriptionFilters * The subscription filters . * @ return Returns a reference to this object so that method calls can be chained together . */ public DescribeSubscriptionFiltersResult withSubscriptionFilters ( SubscriptionFilter ... subscriptionFilters ) { } }
if ( this . subscriptionFilters == null ) { setSubscriptionFilters ( new com . amazonaws . internal . SdkInternalList < SubscriptionFilter > ( subscriptionFilters . length ) ) ; } for ( SubscriptionFilter ele : subscriptionFilters ) { this . subscriptionFilters . add ( ele ) ; } return this ;
public class InternalInputStream { /** * This method sends Nacks for any ticks within the range * startstamp to endstamp which are in Unknown state * Those in Requested should already be being satisfied */ public void processNack ( ControlNack nm ) throws SIResourceException { } }
if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "processNack" , nm ) ; long startstamp = nm . getStartTick ( ) ; long endstamp = nm . getEndTick ( ) ; synchronized ( this ) { // the following steps are performed : // (1 ) check ticks in Unknown // (2 ) create nacks when appropriate // (3 ) change Unknown ticks to Requested // (4 ) send nacks . iststream . setCursor ( startstamp ) ; boolean changed = false ; TickRange tr = iststream . getNext ( ) ; TickRange tr2 ; do { // look at each TickRange individually // and send nacks for ranges that are not already in Requested state if ( tr . type == TickRange . Unknown ) { changed = true ; long maxStartstamp = max ( tr . startstamp , startstamp ) ; long minEndstamp = min ( tr . endstamp , endstamp ) ; upControl . sendNackMessage ( null , null , null , maxStartstamp , minEndstamp , priority , reliability , streamID ) ; } tr2 = tr ; tr = iststream . getNext ( ) ; } while ( ( tr . startstamp <= endstamp ) && ( tr2 != tr ) ) ; if ( changed ) { // update the stream to Requested tr = new TickRange ( TickRange . Requested , startstamp , endstamp ) ; iststream . writeRange ( tr ) ; // start a timer to forget this Request new ReqExpiryHandle ( tr ) ; } } // end synchronized ( this ) if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "processNack" ) ;
public class TypeUtils { /** * Sets one { @ link io . sundr . codegen . model . TypeDef } as a generic of an other . * @ param base The base type . * @ param parameters The parameter types . * @ return The generic type . */ public static TypeDef typeGenericOf ( TypeDef base , TypeParamDef ... parameters ) { } }
return new TypeDefBuilder ( base ) . withParameters ( parameters ) . build ( ) ;
public class HttpJsonSerializer { /** * Parses a timeseries data query * @ return A TSQuery with data ready to validate * @ throws JSONException if parsing failed * @ throws BadRequestException if the content was missing or parsing failed */ public TSQuery parseQueryV1 ( ) { } }
final String json = query . getContent ( ) ; if ( json == null || json . isEmpty ( ) ) { throw new BadRequestException ( HttpResponseStatus . BAD_REQUEST , "Missing message content" , "Supply valid JSON formatted data in the body of your request" ) ; } try { TSQuery data_query = JSON . parseToObject ( json , TSQuery . class ) ; // Filter out duplicate queries Set < TSSubQuery > query_set = new LinkedHashSet < TSSubQuery > ( data_query . getQueries ( ) ) ; data_query . getQueries ( ) . clear ( ) ; data_query . getQueries ( ) . addAll ( query_set ) ; return data_query ; } catch ( IllegalArgumentException iae ) { throw new BadRequestException ( "Unable to parse the given JSON" , iae ) ; }
public class ICECandidate { /** * Check if a transport candidate is usable . The transport resolver should * check if the transport candidate the other endpoint has provided is * usable . * ICE Candidate can check connectivity using UDP echo Test . */ @ Override public void check ( final List < TransportCandidate > localCandidates ) { } }
// TODO candidate is being checked trigger // candidatesChecking . add ( cand ) ; final ICECandidate checkingCandidate = this ; Thread checkThread = new Thread ( new Runnable ( ) { @ Override public void run ( ) { final TestResult result = new TestResult ( ) ; // Media Proxy don ' t have Echo features . // If its a relayed candidate we assumed that is NOT Valid while other candidates still being checked . // The negotiator MUST add then in the correct situations if ( getType ( ) . equals ( Type . relay ) ) { triggerCandidateChecked ( false ) ; return ; } ResultListener resultListener = new ResultListener ( ) { @ Override public void testFinished ( TestResult testResult , TransportCandidate candidate ) { if ( testResult . isReachable ( ) && checkingCandidate . equals ( candidate ) ) { result . setResult ( true ) ; LOGGER . fine ( "Candidate reachable: " + candidate . getIp ( ) + ":" + candidate . getPort ( ) + " from " + getIp ( ) + ":" + getPort ( ) ) ; } } } ; for ( TransportCandidate candidate : localCandidates ) { CandidateEcho echo = candidate . getCandidateEcho ( ) ; if ( echo != null ) { if ( candidate instanceof ICECandidate ) { ICECandidate iceCandidate = ( ICECandidate ) candidate ; if ( iceCandidate . getType ( ) . equals ( getType ( ) ) ) { try { echo . addResultListener ( resultListener ) ; InetAddress address = InetAddress . getByName ( getIp ( ) ) ; echo . testASync ( checkingCandidate , getPassword ( ) ) ; } catch ( UnknownHostException e ) { LOGGER . log ( Level . WARNING , "exception" , e ) ; } } } } } for ( int i = 0 ; i < 10 && ! result . isReachable ( ) ; i ++ ) try { LOGGER . severe ( "ICE Candidate retry #" + i ) ; Thread . sleep ( 400 ) ; } catch ( InterruptedException e ) { LOGGER . log ( Level . WARNING , "exception" , e ) ; } for ( TransportCandidate candidate : localCandidates ) { CandidateEcho echo = candidate . getCandidateEcho ( ) ; if ( echo != null ) { echo . removeResultListener ( resultListener ) ; } } triggerCandidateChecked ( result . isReachable ( ) ) ; // TODO candidate is being checked trigger // candidatesChecking . remove ( cand ) ; } } , "Transport candidate check" ) ; checkThread . setName ( "Transport candidate test" ) ; checkThread . start ( ) ;
public class ApplicationDefinition { /** * Parse the application definition rooted at given UNode tree and copy its contents * into this object . The root node is the " application " object , so its name is the * application name and its child nodes are definitions such as " key " , " options " , * " fields " , etc . An exception is thrown if the definition contains an error . * @ param appNode Root of a UNode tree that defines an application . */ public void parse ( UNode appNode ) { } }
assert appNode != null ; // Verify application name and save it . setAppName ( appNode . getName ( ) ) ; // Iterate through the application object ' s members . for ( String childName : appNode . getMemberNames ( ) ) { // See if we recognize this member . UNode childNode = appNode . getMember ( childName ) ; // " key " if ( childName . equals ( "key" ) ) { // Must be a value . Utils . require ( childNode . isValue ( ) , "'key' value must be a string: " + childNode ) ; Utils . require ( m_key == null , "'key' can be specified only once" ) ; m_key = childNode . getValue ( ) ; // " options " } else if ( childName . equals ( "options" ) ) { // Each name in the map is an option name . for ( String optName : childNode . getMemberNames ( ) ) { // Option must be a value . UNode optNode = childNode . getMember ( optName ) ; Utils . require ( optNode . isValue ( ) , "'option' must be a value: " + optNode ) ; setOption ( optNode . getName ( ) , optNode . getValue ( ) ) ; } // " tables " } else if ( childName . equals ( "tables" ) ) { // Should be specified only once . Utils . require ( m_tableMap . size ( ) == 0 , "'tables' can be specified only once" ) ; // Parse the table definitions , adding them to this app def and building // the external link map as we go . for ( UNode tableNode : childNode . getMemberList ( ) ) { // This will throw if the table definition has an error . TableDefinition tableDef = new TableDefinition ( ) ; tableDef . parse ( tableNode ) ; addTable ( tableDef ) ; } // Unrecognized } else { Utils . require ( false , "Unrecognized 'application' element: " + childName ) ; } } verify ( ) ;
public class NNStorage { /** * Return the list of locations being used for a specific purpose . * i . e . Image or edit log storage . * @ param dirType Purpose of locations requested . * @ throws IOException */ Collection < File > getDirectories ( NameNodeDirType dirType ) throws IOException { } }
ArrayList < File > list = new ArrayList < File > ( ) ; Iterator < StorageDirectory > it = ( dirType == null ) ? dirIterator ( ) : dirIterator ( dirType ) ; for ( ; it . hasNext ( ) ; ) { StorageDirectory sd = it . next ( ) ; list . add ( sd . getRoot ( ) ) ; } return list ;
public class CommercePriceListUserSegmentEntryRelUtil { /** * Returns the first commerce price list user segment entry rel in the ordered set where commercePriceListId = & # 63 ; . * @ param commercePriceListId the commerce price list ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching commerce price list user segment entry rel , or < code > null < / code > if a matching commerce price list user segment entry rel could not be found */ public static CommercePriceListUserSegmentEntryRel fetchByCommercePriceListId_First ( long commercePriceListId , OrderByComparator < CommercePriceListUserSegmentEntryRel > orderByComparator ) { } }
return getPersistence ( ) . fetchByCommercePriceListId_First ( commercePriceListId , orderByComparator ) ;
public class NetworkMonitor { /** * Get the type of network connection that the device is currently using * to connect to the internet . * @ return The type of network connection that the device is currently using . */ public NetworkConnectionType getCurrentConnectionType ( ) { } }
NetworkInfo activeNetworkInfo = getActiveNetworkInfo ( ) ; if ( activeNetworkInfo == null || ! isInternetAccessAvailable ( ) ) { return NetworkConnectionType . NO_CONNECTION ; } switch ( activeNetworkInfo . getType ( ) ) { case ConnectivityManager . TYPE_WIFI : return NetworkConnectionType . WIFI ; case ConnectivityManager . TYPE_MOBILE : return NetworkConnectionType . MOBILE ; case ConnectivityManager . TYPE_WIMAX : return NetworkConnectionType . WIMAX ; case ConnectivityManager . TYPE_ETHERNET : return NetworkConnectionType . ETHERNET ; default : return NetworkConnectionType . NO_CONNECTION ; }
public class GraphicsDeviceExtensions { /** * Gets the array index ( in the available { @ link GraphicsDevice } array ) of the given component is * showing on . * @ param component * the component * @ return the array index ( in the available { @ link GraphicsDevice } array ) of the given component * is showing on . */ public static int getGraphicsDeviceIndexIsShowingOn ( final Component component ) { } }
final GraphicsDevice graphicsDevice = getGraphicsDeviceIsShowingOn ( component ) ; final GraphicsDevice [ ] graphicsDevices = getAvailableScreens ( ) ; for ( int i = 0 ; i < graphicsDevices . length ; i ++ ) { if ( graphicsDevices [ i ] . equals ( graphicsDevice ) ) { return i ; } } return 0 ;
public class WebUtils { /** * 执行HTTP POST请求 。 * @ param url 请求地址 * @ param ctype 请求类型 * @ param content 请求字节数组 * @ return 响应字符串 */ public static String doPost ( String url , String ctype , byte [ ] content , int connectTimeout , int readTimeout ) throws IOException { } }
return _doPost ( url , ctype , content , connectTimeout , readTimeout , null ) ;
public class AppServiceCertificateOrdersInner { /** * Retrieve the list of certificate actions . * Retrieve the list of certificate actions . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param name Name of the certificate order . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws DefaultErrorResponseException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the List & lt ; CertificateOrderActionInner & gt ; object if successful . */ public List < CertificateOrderActionInner > retrieveCertificateActions ( String resourceGroupName , String name ) { } }
return retrieveCertificateActionsWithServiceResponseAsync ( resourceGroupName , name ) . toBlocking ( ) . single ( ) . body ( ) ;
public class PolicyVersionMarshaller { /** * Marshall the given parameter object . */ public void marshall ( PolicyVersion policyVersion , ProtocolMarshaller protocolMarshaller ) { } }
if ( policyVersion == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( policyVersion . getVersionId ( ) , VERSIONID_BINDING ) ; protocolMarshaller . marshall ( policyVersion . getIsDefaultVersion ( ) , ISDEFAULTVERSION_BINDING ) ; protocolMarshaller . marshall ( policyVersion . getCreateDate ( ) , CREATEDATE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class RadioChoicesListView { /** * Factory method for creating the new { @ link Label } . This method is invoked in the constructor * from the derived classes and can be overridden so users can provide their own version of a * new { @ link Label } . * @ param id * the id * @ param label * the string for the label * @ return the new { @ link Label } */ protected Label newLabel ( final String id , final String label ) { } }
return ComponentFactory . newLabel ( id , label ) ;
public class HeronClient { /** * Register the protobuf Message ' s name with protobuf Message */ public void registerOnMessage ( Message . Builder builder ) { } }
messageMap . put ( builder . getDescriptorForType ( ) . getFullName ( ) , builder ) ;
public class ZmqEventConsumer { @ Override protected synchronized void connect_event_channel ( ConnectionStructure cs ) throws DevFailed { } }
// Get a reference to an EventChannel for // this device server from the tango database DeviceProxy adminDevice = new DeviceProxy ( cs . channelName ) ; cs . channelName = adminDevice . fullName ( ) . toLowerCase ( ) ; // Update name with tango host DevVarLongStringArray lsa = cs . deviceData . extractLongStringArray ( ) ; ApiUtil . printTrace ( "connect_event_channel for " + cs . channelName ) ; // Build the buffer to connect heartbeat and send it ZMQutils . connectHeartbeat ( adminDevice . get_tango_host ( ) , adminDevice . name ( ) , lsa , false ) ; // Build the buffer to connect event and send it ZMQutils . connectEvent ( cs . tangoHost , cs . deviceName , cs . attributeName , lsa , cs . eventName , false ) ; if ( cs . reconnect ) { EventChannelStruct eventChannelStruct = channel_map . get ( cs . channelName ) ; // eventChannelStruct . eventChannel = eventChannel ; eventChannelStruct . last_heartbeat = System . currentTimeMillis ( ) ; eventChannelStruct . heartbeat_skipped = false ; eventChannelStruct . has_notifd_closed_the_connection = 0 ; eventChannelStruct . setTangoRelease ( lsa . lvalue [ 0 ] ) ; eventChannelStruct . setIdlVersion ( lsa . lvalue [ 1 ] ) ; } else { // Crate new one EventChannelStruct newEventChannelStruct = new EventChannelStruct ( ) ; // newEventChannelStruct . eventChannel = eventChannel ; newEventChannelStruct . last_heartbeat = System . currentTimeMillis ( ) ; newEventChannelStruct . heartbeat_skipped = false ; newEventChannelStruct . adm_device_proxy = adminDevice ; newEventChannelStruct . has_notifd_closed_the_connection = 0 ; newEventChannelStruct . consumer = this ; newEventChannelStruct . zmqEndpoint = lsa . svalue [ 0 ] ; newEventChannelStruct . setTangoRelease ( lsa . lvalue [ 0 ] ) ; newEventChannelStruct . setIdlVersion ( lsa . lvalue [ 1 ] ) ; channel_map . put ( cs . channelName , newEventChannelStruct ) ; ApiUtil . printTrace ( "Adding " + cs . channelName + " to channel_map" ) ; // Get possible TangoHosts and add it to list if not already in . String [ ] tangoHosts = adminDevice . get_db_obj ( ) . getPossibleTangoHosts ( ) ; for ( String tangoHost : tangoHosts ) { tangoHost = "tango://" + tangoHost ; boolean found = false ; for ( String possibleTangoHost : possibleTangoHosts ) { if ( possibleTangoHost . equals ( tangoHost ) ) found = true ; } if ( ! found ) { possibleTangoHosts . add ( tangoHost ) ; } } }
public class IntStreamEx { /** * Returns a sequential { @ code IntStreamEx } containing an * { @ link OptionalInt } value , if present , otherwise returns an empty * { @ code IntStreamEx } . * @ param optional the optional to create a stream of * @ return a stream with an { @ code OptionalInt } value if present , otherwise * an empty stream * @ since 0.1.1 */ public static IntStreamEx of ( OptionalInt optional ) { } }
return optional . isPresent ( ) ? of ( optional . getAsInt ( ) ) : empty ( ) ;
public class RequestMetadata { /** * < pre > * The IP address of the caller . * < / pre > * < code > string caller _ ip = 1 ; < / code > */ public com . google . protobuf . ByteString getCallerIpBytes ( ) { } }
java . lang . Object ref = callerIp_ ; if ( ref instanceof java . lang . String ) { com . google . protobuf . ByteString b = com . google . protobuf . ByteString . copyFromUtf8 ( ( java . lang . String ) ref ) ; callerIp_ = b ; return b ; } else { return ( com . google . protobuf . ByteString ) ref ; }
public class PICTUtil { /** * TODO : Refactor , don ' t need both readPattern methods */ public static Pattern readPattern ( final DataInput pStream , final Color fg , final Color bg ) throws IOException { } }
// Get the data ( 8 bytes ) byte [ ] data = new byte [ 8 ] ; pStream . readFully ( data ) ; return new BitMapPattern ( data , fg , bg ) ;
public class AbstractTreeNode { /** * Fire the event for the node child sets . * @ param event the event . */ void firePropertyChildAdded ( TreeNodeAddedEvent event ) { } }
if ( this . nodeListeners != null ) { for ( final TreeNodeListener listener : this . nodeListeners ) { if ( listener != null ) { listener . treeNodeChildAdded ( event ) ; } } } final N parentNode = getParentNode ( ) ; assert parentNode != this ; if ( parentNode != null ) { parentNode . firePropertyChildAdded ( event ) ; }
public class EdifactEncoder { /** * Handle " end of data " situations * @ param context the encoder context * @ param buffer the buffer with the remaining encoded characters */ private static void handleEOD ( EncoderContext context , CharSequence buffer ) { } }
try { int count = buffer . length ( ) ; if ( count == 0 ) { return ; // Already finished } if ( count == 1 ) { // Only an unlatch at the end context . updateSymbolInfo ( ) ; int available = context . getSymbolInfo ( ) . getDataCapacity ( ) - context . getCodewordCount ( ) ; int remaining = context . getRemainingCharacters ( ) ; // The following two lines are a hack inspired by the ' fix ' from https : / / sourceforge . net / p / barcode4j / svn / 221/ if ( remaining > available ) { context . updateSymbolInfo ( context . getCodewordCount ( ) + 1 ) ; available = context . getSymbolInfo ( ) . getDataCapacity ( ) - context . getCodewordCount ( ) ; } if ( remaining <= available && available <= 2 ) { return ; // No unlatch } } if ( count > 4 ) { throw new IllegalStateException ( "Count must not exceed 4" ) ; } int restChars = count - 1 ; String encoded = encodeToCodewords ( buffer , 0 ) ; boolean endOfSymbolReached = ! context . hasMoreCharacters ( ) ; boolean restInAscii = endOfSymbolReached && restChars <= 2 ; if ( restChars <= 2 ) { context . updateSymbolInfo ( context . getCodewordCount ( ) + restChars ) ; int available = context . getSymbolInfo ( ) . getDataCapacity ( ) - context . getCodewordCount ( ) ; if ( available >= 3 ) { restInAscii = false ; context . updateSymbolInfo ( context . getCodewordCount ( ) + encoded . length ( ) ) ; // available = context . symbolInfo . dataCapacity - context . getCodewordCount ( ) ; } } if ( restInAscii ) { context . resetSymbolInfo ( ) ; context . pos -= restChars ; } else { context . writeCodewords ( encoded ) ; } } finally { context . signalEncoderChange ( HighLevelEncoder . ASCII_ENCODATION ) ; }
public class Region { /** * Returns the 0 - indexed identifier * Note : IMPORTANT : to get id1 , you would call getIdentifier ( 0 ) ; * @ param i * @ return */ public Identifier getIdentifier ( int i ) { } }
return mIdentifiers . size ( ) > i ? mIdentifiers . get ( i ) : null ;
public class Navis { /** * Return longitude change after moving distance at bearing * @ param latitude * @ param distance * @ param bearing * @ return */ public static final double deltaLongitude ( double latitude , double distance , double bearing ) { } }
double departure = departure ( latitude ) ; double sin = Math . sin ( Math . toRadians ( bearing ) ) ; return ( sin * distance ) / ( 60 * departure ) ;
public class FacebookEndpoint { /** * Fetches the link settings from persisted storage . * @ return the { @ link com . groundupworks . wings . facebook . FacebookSettings } ; or null if unlinked . */ private FacebookSettings fetchSettings ( ) { } }
SharedPreferences preferences = PreferenceManager . getDefaultSharedPreferences ( mContext ) ; if ( ! preferences . getBoolean ( mContext . getString ( R . string . wings_facebook__link_key ) , false ) ) { return null ; } int destinationId = preferences . getInt ( mContext . getString ( R . string . wings_facebook__destination_id_key ) , DestinationId . UNLINKED ) ; String accountName = preferences . getString ( mContext . getString ( R . string . wings_facebook__account_name_key ) , null ) ; String albumName = preferences . getString ( mContext . getString ( R . string . wings_facebook__album_name_key ) , null ) ; String albumGraphPath = preferences . getString ( mContext . getString ( R . string . wings_facebook__album_graph_path_key ) , null ) ; String pageAccessToken = preferences . getString ( mContext . getString ( R . string . wings_facebook__page_access_token_key ) , null ) ; String photoPrivacy = preferences . getString ( mContext . getString ( R . string . wings_facebook__photo_privacy_key ) , null ) ; return FacebookSettings . newInstance ( destinationId , accountName , albumName , albumGraphPath , pageAccessToken , photoPrivacy ) ;
public class AbstractAnsibleMojo { /** * Checks whether the given file is an absolute path or a classpath file * @ param path the relative path * @ return the absolute path to the extracted file * @ throws IOException if the path can not be determined */ protected String findClasspathFile ( final String path ) throws IOException { } }
if ( path == null ) { return null ; } final File file = new File ( path ) ; if ( file . exists ( ) ) { return file . getAbsolutePath ( ) ; } return createTmpFile ( path ) . getAbsolutePath ( ) ;
public class JavaParserModule { /** * Create an index containing all compilation units of Java files from * the source tree under the given root folder . * @ param rootFolder */ public void indexSourceTree ( final Folder rootFolder ) { } }
logger . info ( "Starting indexing of source tree " + rootFolder . getPath ( ) ) ; final SecurityContext securityContext = rootFolder . getSecurityContext ( ) ; app = StructrApp . getInstance ( securityContext ) ; structrTypeSolver . parseRoot ( rootFolder ) ; final CombinedTypeSolver typeSolver = new CombinedTypeSolver ( ) ; typeSolver . add ( new ReflectionTypeSolver ( ) ) ; typeSolver . add ( structrTypeSolver ) ; facade = JavaParserFacade . get ( typeSolver ) ; logger . info ( "Done with indexing of source tree " + rootFolder . getPath ( ) ) ;
public class Provider { /** * Ensure all the legacy String properties are fully parsed into * service objects . */ private void ensureLegacyParsed ( ) { } }
if ( ( legacyChanged == false ) || ( legacyStrings == null ) ) { return ; } serviceSet = null ; if ( legacyMap == null ) { legacyMap = new LinkedHashMap < ServiceKey , Service > ( ) ; } else { legacyMap . clear ( ) ; } for ( Map . Entry < String , String > entry : legacyStrings . entrySet ( ) ) { parseLegacyPut ( entry . getKey ( ) , entry . getValue ( ) ) ; } removeInvalidServices ( legacyMap ) ; legacyChanged = false ;
public class AsyncContext31Impl { /** * A read listener has been set on the SRTInputStream and we will set it up to do its * first read on another thread . */ public void startReadListener ( ThreadContextManager tcm , SRTInputStream31 inputStream ) throws Exception { } }
try { ReadListenerRunnable rlRunnable = new ReadListenerRunnable ( tcm , inputStream , this ) ; this . setReadListenerRunning ( true ) ; com . ibm . ws . webcontainer . osgi . WebContainer . getExecutorService ( ) . execute ( rlRunnable ) ; // The read listener will now be invoked on another thread . Call pre - join to // notify interested components that this will be happening . It ' s possible that // the read listener may run before the pre - join is complete , and callers need to // be able to cope with that . notifyITransferContextPreProcessWorkState ( ) ; } catch ( Exception e ) { this . setReadListenerRunning ( false ) ; throw e ; }
public class DataService { /** * verifies availability of an object in response * @ param intuitMessage * @ param idx * @ return */ private boolean isContainResponse ( IntuitMessage intuitMessage , int idx ) { } }
List < AttachableResponse > response = ( ( IntuitResponse ) intuitMessage . getResponseElements ( ) . getResponse ( ) ) . getAttachableResponse ( ) ; if ( null == response ) { return false ; } if ( 0 >= response . size ( ) ) { return false ; } if ( idx >= response . size ( ) ) { return false ; } return true ;
public class JvmBooleanAnnotationValueImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EList < Boolean > getValues ( ) { } }
if ( values == null ) { values = new EDataTypeEList < Boolean > ( Boolean . class , this , TypesPackage . JVM_BOOLEAN_ANNOTATION_VALUE__VALUES ) ; } return values ;
public class N { /** * Mostly it ' s designed for one - step operation to complete the operation in one step . * < code > java . util . stream . Stream < / code > is preferred for multiple phases operation . * @ param a * @ param fromIndex * @ param toIndex * @ param func * @ return */ public static < T , E extends Exception > IntList mapToInt ( final Collection < ? extends T > c , final int fromIndex , final int toIndex , final Try . ToIntFunction < ? super T , E > func ) throws E { } }
checkFromToIndex ( fromIndex , toIndex , size ( c ) ) ; N . checkArgNotNull ( func ) ; if ( N . isNullOrEmpty ( c ) && fromIndex == 0 && toIndex == 0 ) { return new IntList ( ) ; } final IntList result = new IntList ( toIndex - fromIndex ) ; if ( c instanceof List && c instanceof RandomAccess ) { final List < T > list = ( List < T > ) c ; for ( int i = fromIndex ; i < toIndex ; i ++ ) { result . add ( func . applyAsInt ( list . get ( i ) ) ) ; } } else { int idx = 0 ; for ( T e : c ) { if ( idx ++ < fromIndex ) { continue ; } result . add ( func . applyAsInt ( e ) ) ; if ( idx >= toIndex ) { break ; } } } return result ;
public class HystrixMetricsPublisherFactory { /** * Get an instance of { @ link HystrixMetricsPublisherCommand } with the given factory { @ link HystrixMetricsPublisher } implementation for each { @ link HystrixCommand } instance . * @ param commandKey * Pass - thru to { @ link HystrixMetricsPublisher # getMetricsPublisherForCommand } implementation * @ param commandOwner * Pass - thru to { @ link HystrixMetricsPublisher # getMetricsPublisherForCommand } implementation * @ param metrics * Pass - thru to { @ link HystrixMetricsPublisher # getMetricsPublisherForCommand } implementation * @ param circuitBreaker * Pass - thru to { @ link HystrixMetricsPublisher # getMetricsPublisherForCommand } implementation * @ param properties * Pass - thru to { @ link HystrixMetricsPublisher # getMetricsPublisherForCommand } implementation * @ return { @ link HystrixMetricsPublisherCommand } instance */ public static HystrixMetricsPublisherCommand createOrRetrievePublisherForCommand ( HystrixCommandKey commandKey , HystrixCommandGroupKey commandOwner , HystrixCommandMetrics metrics , HystrixCircuitBreaker circuitBreaker , HystrixCommandProperties properties ) { } }
return SINGLETON . getPublisherForCommand ( commandKey , commandOwner , metrics , circuitBreaker , properties ) ;
public class BTreeIndex { /** * Deletes the specified index record . The method first traverses the * directory to find the leaf page containing that record ; then it deletes * the record from the page . F * @ see Index # delete ( SearchKey , RecordId , boolean ) */ @ Override public void delete ( SearchKey key , RecordId dataRecordId , boolean doLogicalLogging ) { } }
if ( tx . isReadOnly ( ) ) throw new UnsupportedOperationException ( ) ; search ( new SearchRange ( key ) , SearchPurpose . DELETE ) ; // log the logical operation starts if ( doLogicalLogging ) tx . recoveryMgr ( ) . logLogicalStart ( ) ; leaf . delete ( dataRecordId ) ; // log the logical operation ends if ( doLogicalLogging ) tx . recoveryMgr ( ) . logIndexDeletionEnd ( ii . indexName ( ) , key , dataRecordId . block ( ) . number ( ) , dataRecordId . id ( ) ) ;
public class AbstractProtoRealization { /** * Method to indicate the destination is to be deleted . */ public void setToBeDeleted ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setToBeDeleted" ) ; // Tell the remote code the destination is to be deleted if ( _remoteSupport != null ) _remoteSupport . setToBeDeleted ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setToBeDeleted" ) ;
public class EnumTrianglesOpt { public static void main ( String [ ] args ) throws Exception { } }
if ( ! parseParameters ( args ) ) { return ; } // set up execution environment final ExecutionEnvironment env = ExecutionEnvironment . getExecutionEnvironment ( ) ; // read input data DataSet < Edge > edges = getEdgeDataSet ( env ) ; // annotate edges with degrees DataSet < EdgeWithDegrees > edgesWithDegrees = edges . flatMap ( new EdgeDuplicator ( ) ) . groupBy ( Edge . V1 ) . sortGroup ( Edge . V2 , Order . ASCENDING ) . reduceGroup ( new DegreeCounter ( ) ) . groupBy ( EdgeWithDegrees . V1 , EdgeWithDegrees . V2 ) . reduce ( new DegreeJoiner ( ) ) ; // project edges by degrees DataSet < Edge > edgesByDegree = edgesWithDegrees . map ( new EdgeByDegreeProjector ( ) ) ; // project edges by vertex id DataSet < Edge > edgesById = edgesByDegree . map ( new EdgeByIdProjector ( ) ) ; DataSet < Triad > triangles = edgesByDegree // build triads . groupBy ( Edge . V1 ) . sortGroup ( Edge . V2 , Order . ASCENDING ) . reduceGroup ( new TriadBuilder ( ) ) // filter triads . join ( edgesById ) . where ( Triad . V2 , Triad . V3 ) . equalTo ( Edge . V1 , Edge . V2 ) . with ( new TriadFilter ( ) ) ; // emit result if ( fileOutput ) { triangles . writeAsCsv ( outputPath , "\n" , "," ) ; } else { triangles . print ( ) ; } // execute program env . execute ( "Triangle Enumeration Example" ) ;
public class DescribeCodeRepositoryRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeCodeRepositoryRequest describeCodeRepositoryRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeCodeRepositoryRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeCodeRepositoryRequest . getCodeRepositoryName ( ) , CODEREPOSITORYNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class Miniball { /** * Adds a point to the list . < br > * Skip action on null parameter . < br > * @ param p The object to be added to the list */ public void check_in ( double [ ] p ) { } }
if ( p != null ) { L . add ( p ) ; } else { System . out . println ( "Miniball.check_in WARNING: Skipping null point" ) ; }
public class JOGLTypeConversions { /** * Convert primitives from GL constants . * @ param code The GL constant . * @ return The value . */ public static JCGLPrimitives primitiveFromGL ( final int code ) { } }
switch ( code ) { case GL . GL_LINES : return JCGLPrimitives . PRIMITIVE_LINES ; case GL . GL_LINE_LOOP : return JCGLPrimitives . PRIMITIVE_LINE_LOOP ; case GL . GL_POINTS : return JCGLPrimitives . PRIMITIVE_POINTS ; case GL . GL_TRIANGLES : return JCGLPrimitives . PRIMITIVE_TRIANGLES ; case GL . GL_TRIANGLE_STRIP : return JCGLPrimitives . PRIMITIVE_TRIANGLE_STRIP ; default : throw new UnreachableCodeException ( ) ; }
public class ClusterTemplet { /** * { @ inheritDoc } */ public int generateAt ( Instance instance , IFeatureAlphabet features , int pos , int ... numLabels ) throws Exception { } }
String feaOri = getFeaString ( instance , pos , numLabels ) ; if ( feaOri == null ) return - 1 ; int index = - 1 ; if ( keymap . containsKey ( feaOri ) ) index = features . lookupIndex ( keymap . get ( feaOri ) , ( int ) Math . pow ( numLabels [ 0 ] , order + 1 ) ) ; return index ;
public class ValuesFileFixture { /** * Saves content of a key ' s value as file in the files section . * @ param basename filename to use . * @ param key key to get value from . * @ return file created . */ public String createContainingBase64Value ( String basename , String key ) { } }
String file ; Object value = value ( key ) ; if ( value == null ) { throw new SlimFixtureException ( false , "No value for key: " + key ) ; } else if ( value instanceof String ) { file = createFileFromBase64 ( basename , ( String ) value ) ; } else { throw new SlimFixtureException ( false , "Value for key: " + key + " is not a String, but: " + value ) ; } return file ;
public class TitlePaneCloseButtonWindowModifiedState { /** * { @ inheritDoc } */ public boolean isInState ( JComponent c ) { } }
Component parent = c ; while ( parent . getParent ( ) != null ) { if ( parent instanceof JFrame ) { break ; } parent = parent . getParent ( ) ; } if ( parent instanceof JFrame ) { return ( ( JFrame ) parent ) . getRootPane ( ) . getClientProperty ( WINDOW_DOCUMENT_MODIFIED ) == Boolean . TRUE ; } return false ;
public class NFVORequestor { /** * Returns a NetworkServiceDescriptorAgent with which requests regarding NetworkServiceDescriptors * can be sent to the NFVO . * @ return a NetworkServiceDescriptorAgent */ public synchronized NetworkServiceDescriptorAgent getNetworkServiceDescriptorAgent ( ) { } }
if ( this . networkServiceDescriptorAgent == null ) { if ( isService ) { this . networkServiceDescriptorAgent = new NetworkServiceDescriptorAgent ( this . serviceName , this . projectId , this . sslEnabled , this . nfvoIp , this . nfvoPort , this . version , this . serviceKey ) ; } else { this . networkServiceDescriptorAgent = new NetworkServiceDescriptorAgent ( this . username , this . password , this . projectId , this . sslEnabled , this . nfvoIp , this . nfvoPort , this . version ) ; } } return this . networkServiceDescriptorAgent ;
public class BudgetOrder { /** * Gets the totalAdjustments value for this BudgetOrder . * @ return totalAdjustments * The adjustments amount in micros . Adjustments from Google come * in the form of credits or * debits to your budget order . This amount is the net * sum of adjustments since the creation * of the budget order . You can use the adjustments amount * to compute your current base * spendingLimit by subtracting your adjustments from * the value returned from spendingLimit * in get requests . * < span class = " constraint Selectable " > This field can * be selected using the value " TotalAdjustments " . < / span > < span class = " constraint * Filterable " > This field can be filtered on . < / span > * < span class = " constraint ReadOnly " > This field is read * only and will be ignored when sent to the API . < / span > */ public com . google . api . ads . adwords . axis . v201809 . cm . Money getTotalAdjustments ( ) { } }
return totalAdjustments ;
public class Word { /** * Retrieves a " flattened " version of this word , i . e . , without any hierarchical structure attached . This can be * helpful if { @ link Word } is subclassed to allow representing , e . g . , a concatenation dynamically , but due to * performance concerns not too many levels of indirection should be introduced . * @ return a flattened version of this word . */ @ Nonnull public Word < I > flatten ( ) { } }
int len = length ( ) ; Object [ ] array = new Object [ len ] ; writeToArray ( 0 , array , 0 , len ) ; return new SharedWord < > ( array ) ;
public class MoreCollectors { /** * Returns a { @ code Collector } which collects only the last stream element * if any . * @ param < T > the type of the input elements * @ return a collector which returns an { @ link Optional } which describes the * last element of the stream . For empty stream an empty * { @ code Optional } is returned . */ public static < T > Collector < T , ? , Optional < T > > last ( ) { } }
return Collectors . reducing ( ( u , v ) -> v ) ;
public class ServerSecurityAlertPoliciesInner { /** * Get a server ' s security alert policy . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of the server . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the ServerSecurityAlertPolicyInner object */ public Observable < ServerSecurityAlertPolicyInner > getAsync ( String resourceGroupName , String serverName ) { } }
return getWithServiceResponseAsync ( resourceGroupName , serverName ) . map ( new Func1 < ServiceResponse < ServerSecurityAlertPolicyInner > , ServerSecurityAlertPolicyInner > ( ) { @ Override public ServerSecurityAlertPolicyInner call ( ServiceResponse < ServerSecurityAlertPolicyInner > response ) { return response . body ( ) ; } } ) ;
public class TriggerWorkflowExternalConditionRequests { /** * Runs the example . * @ param adManagerServices the services factory . * @ param session the session . * @ param proposalId the ID of the proposal to trigger workflow external conditions for . * @ throws ApiException if the API request failed with one or more service errors . * @ throws RemoteException if the API request failed due to other errors . */ public static void runExample ( AdManagerServices adManagerServices , AdManagerSession session , long proposalId ) throws RemoteException { } }
// Get the WorkflowRequestService . WorkflowRequestServiceInterface workflowRequestService = adManagerServices . get ( session , WorkflowRequestServiceInterface . class ) ; // Create a statement to select workflow external condition requests for a proposal . StatementBuilder statementBuilder = new StatementBuilder ( ) . where ( "WHERE entityId = :entityId and entityType = :entityType " + "and type = :type and conditionStatus = :conditionStatus" ) . orderBy ( "id ASC" ) . limit ( StatementBuilder . SUGGESTED_PAGE_LIMIT ) . withBindVariableValue ( "entityId" , proposalId ) . withBindVariableValue ( "entityType" , WorkflowEntityType . PROPOSAL . toString ( ) ) . withBindVariableValue ( "conditionStatus" , WorkflowEvaluationStatus . PENDING . toString ( ) ) . withBindVariableValue ( "type" , WorkflowRequestType . WORKFLOW_EXTERNAL_CONDITION_REQUEST . toString ( ) ) ; // Default for total result set size . int totalResultSetSize = 0 ; do { // Get workflow requests by statement . WorkflowRequestPage page = workflowRequestService . getWorkflowRequestsByStatement ( statementBuilder . toStatement ( ) ) ; if ( page . getResults ( ) != null ) { totalResultSetSize = page . getTotalResultSetSize ( ) ; int i = page . getStartIndex ( ) ; for ( WorkflowRequest workflowRequest : page . getResults ( ) ) { System . out . printf ( "%d) Workflow external condition request with ID %d " + "for '%s' with ID %d will be triggered.%n" , i ++ , workflowRequest . getId ( ) , workflowRequest . getEntityType ( ) , workflowRequest . getEntityId ( ) ) ; } } statementBuilder . increaseOffsetBy ( StatementBuilder . SUGGESTED_PAGE_LIMIT ) ; } while ( statementBuilder . getOffset ( ) < totalResultSetSize ) ; System . out . printf ( "Number of workflow external condition requests to be triggered: %d%n" , totalResultSetSize ) ; if ( totalResultSetSize > 0 ) { // Remove limit and offset from statement . statementBuilder . removeLimitAndOffset ( ) ; // Create action . com . google . api . ads . admanager . axis . v201808 . TriggerWorkflowExternalConditionRequests action = new com . google . api . ads . admanager . axis . v201808 . TriggerWorkflowExternalConditionRequests ( ) ; // Perform action . UpdateResult result = workflowRequestService . performWorkflowRequestAction ( action , statementBuilder . toStatement ( ) ) ; if ( result != null && result . getNumChanges ( ) > 0 ) { System . out . printf ( "Number of workflow external condition requests triggered: %d%n" , result . getNumChanges ( ) ) ; } else { System . out . println ( "No workflow external condition requests were triggered." ) ; } }
public class InnerClasses { /** * Registers this factory as an inner class on the given class writer . * < p > Registering an inner class is confusing . The inner class needs to call this and so does the * outer class . Confirmed by running ASMIfier . Also , failure to call visitInnerClass on both * classes either breaks reflective apis ( like class . getSimpleName ( ) / getEnclosingClass ) , or causes * verifier errors ( like IncompatibleClassChangeError ) . */ public void registerAsInnerClass ( ClassVisitor visitor , TypeInfo innerClass ) { } }
checkRegistered ( innerClass ) ; doRegister ( visitor , innerClass ) ;
public class CPDAvailabilityEstimateUtil { /** * Returns the cpd availability estimate where uuid = & # 63 ; and groupId = & # 63 ; or throws a { @ link NoSuchCPDAvailabilityEstimateException } if it could not be found . * @ param uuid the uuid * @ param groupId the group ID * @ return the matching cpd availability estimate * @ throws NoSuchCPDAvailabilityEstimateException if a matching cpd availability estimate could not be found */ public static CPDAvailabilityEstimate findByUUID_G ( String uuid , long groupId ) throws com . liferay . commerce . exception . NoSuchCPDAvailabilityEstimateException { } }
return getPersistence ( ) . findByUUID_G ( uuid , groupId ) ;
public class ServerKeysInner { /** * Gets a server key . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of the server . * @ param keyName The name of the server key to be retrieved . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < ServerKeyInner > getAsync ( String resourceGroupName , String serverName , String keyName , final ServiceCallback < ServerKeyInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( getWithServiceResponseAsync ( resourceGroupName , serverName , keyName ) , serviceCallback ) ;
public class CommerceAvailabilityEstimateModelImpl { /** * Converts the soap model instances into normal model instances . * @ param soapModels the soap model instances to convert * @ return the normal model instances */ public static List < CommerceAvailabilityEstimate > toModels ( CommerceAvailabilityEstimateSoap [ ] soapModels ) { } }
if ( soapModels == null ) { return null ; } List < CommerceAvailabilityEstimate > models = new ArrayList < CommerceAvailabilityEstimate > ( soapModels . length ) ; for ( CommerceAvailabilityEstimateSoap soapModel : soapModels ) { models . add ( toModel ( soapModel ) ) ; } return models ;
public class TraceWebAspect { /** * NOSONAR */ @ Around ( "anyControllerOrRestControllerWithPublicAsyncMethod()" ) @ SuppressWarnings ( "unchecked" ) public Object wrapWithCorrelationId ( ProceedingJoinPoint pjp ) throws Throwable { } }
Callable < Object > callable = ( Callable < Object > ) pjp . proceed ( ) ; TraceContext currentSpan = this . tracing . currentTraceContext ( ) . get ( ) ; if ( currentSpan == null ) { return callable ; } if ( log . isDebugEnabled ( ) ) { log . debug ( "Wrapping callable with span [" + currentSpan + "]" ) ; } return new TraceCallable < > ( this . tracing , this . spanNamer , callable ) ;
public class CliShell { /** * Provide assistance for the given command line . Assistance means 2 things : * < ol > * < li > Auto complete the command line < / li > * < li > Print information that is specific to the context of the command line ( if the command line indicates * that we are parsing a command , assist with information like values that were already parsed , * next parameter to parse etc ' ) . < / li > * < li > Print suggestions for the next word to be added to the command line , if any . < / li > * < / ol > * Any output is printed as a side effect to the { @ link CliOutput } this shell was constructed with . * Returns the result of the auto complete operation that should be appended to the command line by the caller . * @ param commandLine Command line to provide assistance for . * @ return A value that should be appended to the command line as a result of the auto complete operation . */ public Opt < String > assist ( String commandLine ) { } }
try { return doAssist ( commandLine ) ; } catch ( ParseException e ) { handleParseException ( e ) ; } catch ( Exception e ) { err . printThrowable ( e ) ; } return Opt . absent ( ) ;
public class Context { /** * Report a warning using the error reporter for the current thread . * @ param message the warning message to report * @ param sourceName a string describing the source , such as a filename * @ param lineno the starting line number * @ param lineSource the text of the line ( may be null ) * @ param lineOffset the offset into lineSource where problem was detected * @ see org . mozilla . javascript . ErrorReporter */ public static void reportWarning ( String message , String sourceName , int lineno , String lineSource , int lineOffset ) { } }
Context cx = Context . getContext ( ) ; if ( cx . hasFeature ( FEATURE_WARNING_AS_ERROR ) ) reportError ( message , sourceName , lineno , lineSource , lineOffset ) ; else cx . getErrorReporter ( ) . warning ( message , sourceName , lineno , lineSource , lineOffset ) ;
public class PostExecutionInterceptorContext { /** * Requests that the call tree should not be added to the current { @ link Span } * @ param reason the reason why the call tree should be excluded ( debug message ) * @ return < code > this < / code > for chaining */ public PostExecutionInterceptorContext excludeCallTree ( String reason ) { } }
if ( ! mustPreserveCallTree ) { logger . debug ( "Excluding call tree because {}" , reason ) ; excludeCallTree = true ; } return this ;
public class Results { /** * Creates a new result with the status { @ literal 200 - OK } building a JSONP response . * @ param padding the callback name * @ param node the json object ( JSON array or JSON object ) * @ return the JSONP response built as follows : padding ( node ) */ public static Result ok ( String padding , JsonNode node ) { } }
return status ( Result . OK ) . render ( padding , node ) ;
public class OpenPgpPubSubUtil { /** * Consult the public key metadata node of { @ code contact } to fetch the list of their published OpenPGP public keys . * @ see < a href = " https : / / xmpp . org / extensions / xep - 0373 . html # discover - pubkey - list " > * XEP - 0373 § 4.3 : Discovering Public Keys of a User < / a > * @ param connection XMPP connection * @ param contact { @ link BareJid } of the user we want to fetch the list from . * @ return content of { @ code contact } ' s metadata node . * @ throws InterruptedException if the thread gets interrupted . * @ throws XMPPException . XMPPErrorException in case of an XMPP protocol exception . * @ throws SmackException . NoResponseException in case the server doesn ' t respond * @ throws PubSubException . NotALeafNodeException in case the queried node is not a { @ link LeafNode } * @ throws SmackException . NotConnectedException in case we are not connected * @ throws PubSubException . NotAPubSubNodeException in case the queried entity is not a PubSub node */ public static PublicKeysListElement fetchPubkeysList ( XMPPConnection connection , BareJid contact ) throws InterruptedException , XMPPException . XMPPErrorException , SmackException . NoResponseException , PubSubException . NotALeafNodeException , SmackException . NotConnectedException , PubSubException . NotAPubSubNodeException { } }
PubSubManager pm = PubSubManager . getInstanceFor ( connection , contact ) ; LeafNode node = getLeafNode ( pm , PEP_NODE_PUBLIC_KEYS ) ; List < PayloadItem < PublicKeysListElement > > list = node . getItems ( 1 ) ; if ( list . isEmpty ( ) ) { return null ; } return list . get ( 0 ) . getPayload ( ) ;
public class GetSchemaCreationStatusRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetSchemaCreationStatusRequest getSchemaCreationStatusRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getSchemaCreationStatusRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getSchemaCreationStatusRequest . getApiId ( ) , APIID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ExecutionEngine { /** * Finalize collected statistics ( stops timer and supplies cache statistics ) . * @ param cacheSize size of cache * @ param cacheUse where the plan came from */ protected void endStatsCollection ( long cacheSize , CacheUse cacheUse ) { } }
if ( m_plannerStats != null ) { m_plannerStats . endStatsCollection ( cacheSize , 0 , cacheUse , m_partitionId ) ; }
public class WebSocket { /** * Create a new { @ code WebSocket } instance that has the same settings * as this instance . Note that , however , settings you made on the raw * socket are not copied . * The { @ link WebSocketFactory } instance that you used to create this * { @ code WebSocket } instance is used again . * @ return * A new { @ code WebSocket } instance . * @ param timeout * The timeout value in milliseconds for socket timeout . * A timeout of zero is interpreted as an infinite timeout . * @ throws IllegalArgumentException * The given timeout value is negative . * @ throws IOException * { @ link WebSocketFactory # createSocket ( URI ) } threw an exception . * @ since 1.10 */ public WebSocket recreate ( int timeout ) throws IOException { } }
if ( timeout < 0 ) { throw new IllegalArgumentException ( "The given timeout value is negative." ) ; } WebSocket instance = mWebSocketFactory . createSocket ( getURI ( ) , timeout ) ; // Copy the settings . instance . mHandshakeBuilder = new HandshakeBuilder ( mHandshakeBuilder ) ; instance . setPingInterval ( getPingInterval ( ) ) ; instance . setPongInterval ( getPongInterval ( ) ) ; instance . setPingPayloadGenerator ( getPingPayloadGenerator ( ) ) ; instance . setPongPayloadGenerator ( getPongPayloadGenerator ( ) ) ; instance . mExtended = mExtended ; instance . mAutoFlush = mAutoFlush ; instance . mMissingCloseFrameAllowed = mMissingCloseFrameAllowed ; instance . mDirectTextMessage = mDirectTextMessage ; instance . mFrameQueueSize = mFrameQueueSize ; // Copy listeners . List < WebSocketListener > listeners = mListenerManager . getListeners ( ) ; synchronized ( listeners ) { instance . addListeners ( listeners ) ; } return instance ;
public class CleverTapAPI { /** * Event */ private void queueEventToDB ( final Context context , final JSONObject event , final int type ) { } }
DBAdapter . Table table = ( type == Constants . PROFILE_EVENT ) ? DBAdapter . Table . PROFILE_EVENTS : DBAdapter . Table . EVENTS ; queueEventInternal ( context , event , table ) ;
public class DialogUtil { /** * Creates and shows an internal dialog with the specified panel . */ public static JInternalDialog createDialog ( JFrame frame , JPanel content ) { } }
return createDialog ( frame , null , content ) ;
public class Section { /** * Checks if the section contains the given value and fires an event * in case the value " entered " or " left " the section . With this one * can react if a value enters / leaves a specific region in a gauge . * @ param VALUE */ public void checkForValue ( final double VALUE ) { } }
boolean wasInSection = contains ( checkedValue ) ; boolean isInSection = contains ( VALUE ) ; if ( ! wasInSection && isInSection ) { fireSectionEvent ( ENTERED_EVENT ) ; } else if ( wasInSection && ! isInSection ) { fireSectionEvent ( LEFT_EVENT ) ; } checkedValue = VALUE ;
public class DocumentBuilder { /** * Parse the content of the given < code > InputStream < / code > as an XML * document and return a new DOM { @ link Document } object . * An < code > IllegalArgumentException < / code > is thrown if the * < code > InputStream < / code > is null . * @ param is InputStream containing the content to be parsed . * @ return < code > Document < / code > result of parsing the * < code > InputStream < / code > * @ exception IOException If any IO errors occur . * @ exception SAXException If any parse errors occur . * @ see org . xml . sax . DocumentHandler */ public Document parse ( InputStream is ) throws SAXException , IOException { } }
if ( is == null ) { throw new IllegalArgumentException ( "InputStream cannot be null" ) ; } InputSource in = new InputSource ( is ) ; return parse ( in ) ;
public class XPath { /** * Returns a lenient / not lenient version of this { @ code XPath } expression . * @ param lenient * the requested lenient mode * @ return an { @ code XPath } expression with the same xpath string of this expression but the * requested lenient mode ; note that this { @ code XPath } instance is returned in case * the requested lenient mode matches the mode of this expression */ public final XPath lenient ( final boolean lenient ) { } }
if ( lenient == isLenient ( ) ) { return this ; } else if ( ! lenient ) { return new StrictXPath ( this . support ) ; } else { return new LenientXPath ( this . support ) ; }
public class PeerManager { /** * Reloads the list of peer nodes from our table and refreshes each with a call to { @ link * # refreshPeer } . */ protected void refreshPeers ( ) { } }
if ( _adHoc ) { return ; } // load up information on our nodes _invoker . postUnit ( new RepositoryUnit ( "refreshPeers" ) { @ Override public void invokePersist ( ) throws Exception { // let the world know that we ' re alive _noderepo . heartbeatNode ( _nodeName ) ; // then load up all the peer records _nodes = Maps . newHashMap ( ) ; for ( NodeRecord record : _noderepo . loadNodes ( _nodeNamespace ) ) { _nodes . put ( record . nodeName , record ) ; } } @ Override public void handleSuccess ( ) { // refresh peers with loaded records long now = System . currentTimeMillis ( ) ; for ( Iterator < NodeRecord > it = _nodes . values ( ) . iterator ( ) ; it . hasNext ( ) ; ) { NodeRecord record = it . next ( ) ; if ( Objects . equal ( record . nodeName , _nodeName ) ) { continue ; } if ( ( now - record . lastUpdated . getTime ( ) ) > PeerNode . STALE_INTERVAL ) { it . remove ( ) ; continue ; } try { refreshPeer ( record ) ; } catch ( Exception e ) { log . warning ( "Failure refreshing peer " + record + "." , e ) ; } } // remove peers for which we no longer have up - to - date records for ( Iterator < PeerNode > it = _peers . values ( ) . iterator ( ) ; it . hasNext ( ) ; ) { PeerNode peer = it . next ( ) ; if ( ! _nodes . containsKey ( peer . getNodeName ( ) ) ) { peer . shutdown ( ) ; it . remove ( ) ; } } } @ Override public long getLongThreshold ( ) { return 700L ; } protected Map < String , NodeRecord > _nodes ; } ) ;
public class ReportUtil { /** * Read data from input stream * @ param is * input stream * @ return string content read from input stream * @ throws IOException * if cannot read from input stream */ public static String readAsString ( InputStream is ) throws IOException { } }
try { // Scanner iterates over tokens in the stream , and in this case // we separate tokens using " beginning of the input boundary " ( \ A ) // thus giving us only one token for the entire contents of the // stream return new Scanner ( is , "UTF-8" ) . useDelimiter ( "\\A" ) . next ( ) ; } catch ( java . util . NoSuchElementException e ) { return "" ; }
public class RoundedMoney { /** * ( non - Javadoc ) * @ see MonetaryAmount # divideToIntegralValue ( Number ) ) D */ @ Override public RoundedMoney divideToIntegralValue ( Number divisor ) { } }
MathContext mc = monetaryContext . get ( MathContext . class ) ; if ( mc == null ) { mc = MathContext . DECIMAL64 ; } BigDecimal dec = number . divideToIntegralValue ( MoneyUtils . getBigDecimal ( divisor ) , mc ) ; return new RoundedMoney ( dec , currency , rounding ) ;
public class CamelHbaseStoreBolt { /** * { @ inheritDoc } */ @ SuppressWarnings ( "unchecked" ) @ Override public void onMessage ( StreamMessage message ) { } }
Map < String , Object > values ; try { values = this . converter . toMap ( message ) ; } catch ( ConvertFailException ex ) { String logFormat = "Fail convert to hbase record. Dispose received message. : Message={0}" ; logger . warn ( MessageFormat . format ( logFormat , message ) , ex ) ; ack ( ) ; return ; } // rowidを設定する 。 HBaseData data = new HBaseData ( ) ; HBaseRow row = new HBaseRow ( ) ; row . setId ( values . get ( "timestamp" ) . toString ( ) + "_" + values . get ( "source" ) . toString ( ) ) ; List < String > bodyList = ( List < String > ) values . get ( "body" ) ; for ( int i = 0 ; i < bodyList . size ( ) ; i ++ ) { CellDefine cellDefine = this . cellDefineList . get ( i ) ; HBaseCell registCell = new HBaseCell ( ) ; registCell . setFamily ( cellDefine . family ) ; registCell . setQualifier ( cellDefine . qualifier ) ; registCell . setValue ( bodyList . get ( i ) ) ; row . getCells ( ) . add ( registCell ) ; } data . getRows ( ) . add ( row ) ; insert ( data ) ; ack ( ) ;
public class ModelsImpl { /** * Create an entity role for an entity in the application . * @ param appId The application ID . * @ param versionId The version ID . * @ param entityId The entity model ID . * @ param name The entity role name . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the UUID object */ public Observable < ServiceResponse < UUID > > createRegexEntityRoleWithServiceResponseAsync ( UUID appId , String versionId , UUID entityId , String name ) { } }
if ( this . client . endpoint ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.endpoint() is required and cannot be null." ) ; } if ( appId == null ) { throw new IllegalArgumentException ( "Parameter appId is required and cannot be null." ) ; } if ( versionId == null ) { throw new IllegalArgumentException ( "Parameter versionId is required and cannot be null." ) ; } if ( entityId == null ) { throw new IllegalArgumentException ( "Parameter entityId is required and cannot be null." ) ; } EntityRoleCreateObject entityRoleCreateObject = new EntityRoleCreateObject ( ) ; entityRoleCreateObject . withName ( name ) ; String parameterizedHost = Joiner . on ( ", " ) . join ( "{Endpoint}" , this . client . endpoint ( ) ) ; return service . createRegexEntityRole ( appId , versionId , entityId , this . client . acceptLanguage ( ) , entityRoleCreateObject , parameterizedHost , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < UUID > > > ( ) { @ Override public Observable < ServiceResponse < UUID > > call ( Response < ResponseBody > response ) { try { ServiceResponse < UUID > clientResponse = createRegexEntityRoleDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class VirtualNetworkGatewaysInner { /** * Gets all the connections in a virtual network gateway . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ param serviceFuture the ServiceFuture object tracking the Retrofit calls * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < List < VirtualNetworkGatewayConnectionListEntityInner > > listConnectionsNextAsync ( final String nextPageLink , final ServiceFuture < List < VirtualNetworkGatewayConnectionListEntityInner > > serviceFuture , final ListOperationCallback < VirtualNetworkGatewayConnectionListEntityInner > serviceCallback ) { } }
return AzureServiceFuture . fromPageResponse ( listConnectionsNextSinglePageAsync ( nextPageLink ) , new Func1 < String , Observable < ServiceResponse < Page < VirtualNetworkGatewayConnectionListEntityInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < VirtualNetworkGatewayConnectionListEntityInner > > > call ( String nextPageLink ) { return listConnectionsNextSinglePageAsync ( nextPageLink ) ; } } , serviceCallback ) ;
public class FloatStyle { /** * Append the number : number tag * @ param util an util * @ param appendable the destination * @ throws IOException if an I / O error occurs */ public void appendNumberTag ( final XMLUtil util , final Appendable appendable ) throws IOException { } }
appendable . append ( "<number:number" ) ; this . appendXMLAttributes ( util , appendable ) ; appendable . append ( "/>" ) ;
public class AdapterDelegatesManager { /** * Must be called from { @ link RecyclerView . Adapter # getItemViewType ( int ) } . Internally it scans all * the registered { @ link AdapterDelegate } and picks the right one to return the ViewType integer . * @ param items Adapter ' s data source * @ param position the position in adapters data source * @ return the ViewType ( integer ) . Returns { @ link # FALLBACK _ DELEGATE _ VIEW _ TYPE } in case that the * fallback adapter delegate should be used * @ throws NullPointerException if no { @ link AdapterDelegate } has been found that is * responsible for the given data element in data set ( No { @ link AdapterDelegate } for the given * ViewType ) * @ throws NullPointerException if items is null */ public int getItemViewType ( @ NonNull T items , int position ) { } }
if ( items == null ) { throw new NullPointerException ( "Items datasource is null!" ) ; } int delegatesCount = delegates . size ( ) ; for ( int i = 0 ; i < delegatesCount ; i ++ ) { AdapterDelegate < T > delegate = delegates . valueAt ( i ) ; if ( delegate . isForViewType ( items , position ) ) { return delegates . keyAt ( i ) ; } } if ( fallbackDelegate != null ) { return FALLBACK_DELEGATE_VIEW_TYPE ; } throw new NullPointerException ( "No AdapterDelegate added that matches position=" + position + " in data source" ) ;
public class ApplicationScoreService { /** * Generate criteria settings for each widget type * @ param scoreCriteriaSettings Score Criteria Settings * @ return Map of settings by each widget name */ private Map < String , ScoreComponentSettings > generateWidgetSettings ( ScoreCriteriaSettings scoreCriteriaSettings ) { } }
Map < String , ScoreComponentSettings > scoreParamSettingsMap = new HashMap < > ( ) ; addSettingsToMap ( scoreParamSettingsMap , Constants . WIDGET_BUILD , getSettingsIfEnabled ( scoreCriteriaSettings . getBuild ( ) ) ) ; addSettingsToMap ( scoreParamSettingsMap , Constants . WIDGET_DEPLOY , getSettingsIfEnabled ( scoreCriteriaSettings . getDeploy ( ) ) ) ; addSettingsToMap ( scoreParamSettingsMap , Constants . WIDGET_CODE_ANALYSIS , getSettingsIfEnabled ( scoreCriteriaSettings . getQuality ( ) ) ) ; addSettingsToMap ( scoreParamSettingsMap , Constants . WIDGET_GITHUB_SCM , getSettingsIfEnabled ( scoreCriteriaSettings . getScm ( ) ) ) ; return scoreParamSettingsMap ;
public class Task { /** * Set a text value . * @ param index text index ( 1-30) * @ param value text value */ public void setText ( int index , String value ) { } }
set ( selectField ( TaskFieldLists . CUSTOM_TEXT , index ) , value ) ;
public class BigDecimal { /** * Divides { @ code long } by { @ code long } and do rounding based on the * passed in roundingMode . */ private static long divideAndRound ( long ldividend , long ldivisor , int roundingMode ) { } }
int qsign ; // quotient sign long q = ldividend / ldivisor ; // store quotient in long if ( roundingMode == ROUND_DOWN ) return q ; long r = ldividend % ldivisor ; // store remainder in long qsign = ( ( ldividend < 0 ) == ( ldivisor < 0 ) ) ? 1 : - 1 ; if ( r != 0 ) { boolean increment = needIncrement ( ldivisor , roundingMode , qsign , q , r ) ; return increment ? q + qsign : q ; } else { return q ; }