signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class UpdateModelVisitor { /** * { @ inheritDoc } */ @ Override public void component ( final FormComponent < ? > formComponent , final IVisit < Void > visit ) { } }
if ( formComponent instanceof IFormModelUpdateListener ) { final Form < ? > form = Form . findForm ( formComponent ) ; if ( form != null ) { if ( this . form == null || this . form == form ) { if ( form . isEnabledInHierarchy ( ) ) { if ( formComponent . isVisibleInHierarchy ( ) && formComponent . isEnabledInHierarchy ( ) ) { formComponent . modelChanging ( ) ; ( ( IFormModelUpdateListener ) formComponent ) . updateModel ( ) ; formComponent . modelChanged ( ) ; } } } } }
public class A_CmsUI { /** * Tries to open a new browser window , and shows a warning if opening the window fails ( usually because of popup blockers ) . < p > * @ param link the URL to open in the new window * @ param target the target window name * @ param warning the warning to show if opening the window fails */ public void openPageOrWarn ( String link , String target , final String warning ) { } }
m_windowExtension . open ( link , target , new Runnable ( ) { public void run ( ) { Notification . show ( warning , Type . ERROR_MESSAGE ) ; } } ) ;
public class JsonLdUrl { /** * Removes dot segments from a JsonLdUrl path . * @ param path * the path to remove dot segments from . * @ param hasAuthority * true if the JsonLdUrl has an authority , false if not . * @ return The URL without the dot segments */ public static String removeDotSegments ( String path , boolean hasAuthority ) { } }
String rval = "" ; if ( path . indexOf ( "/" ) == 0 ) { rval = "/" ; } // RFC 3986 5.2.4 ( reworked ) final List < String > input = new ArrayList < String > ( Arrays . asList ( path . split ( "/" ) ) ) ; if ( path . endsWith ( "/" ) ) { // javascript . split includes a blank entry if the string ends with // the delimiter , java . split does not so we need to add it manually input . add ( "" ) ; } final List < String > output = new ArrayList < String > ( ) ; for ( int i = 0 ; i < input . size ( ) ; i ++ ) { if ( "." . equals ( input . get ( i ) ) || ( "" . equals ( input . get ( i ) ) && input . size ( ) - i > 1 ) ) { // input . remove ( 0 ) ; continue ; } if ( ".." . equals ( input . get ( i ) ) ) { // input . remove ( 0 ) ; if ( hasAuthority || ( output . size ( ) > 0 && ! ".." . equals ( output . get ( output . size ( ) - 1 ) ) ) ) { // [ ] . pop ( ) doesn ' t fail , to replicate this we need to check // that there is something to remove if ( output . size ( ) > 0 ) { output . remove ( output . size ( ) - 1 ) ; } } else { output . add ( ".." ) ; } continue ; } output . add ( input . get ( i ) ) ; // input . remove ( 0 ) ; } if ( output . size ( ) > 0 ) { rval += output . get ( 0 ) ; for ( int i = 1 ; i < output . size ( ) ; i ++ ) { rval += "/" + output . get ( i ) ; } } return rval ;
public class FileUtils { /** * Creates a string of XML that describes the supplied file or directory ( and , optionally , all its * subdirectories ) . Includes absolute path , last modified time , read / write permissions , etc . * @ param aFilePath The file or directory to be returned as XML * @ param aDeepConversion Whether the subdirectories are included * @ return A string of XML describing the supplied file system path ' s structure * @ throws FileNotFoundException If the supplied file or directory can not be found * @ throws TransformerException If there is trouble with the XSL transformation */ public static String toXML ( final String aFilePath , final boolean aDeepConversion ) throws FileNotFoundException , TransformerException { } }
return toXML ( aFilePath , WILDCARD , aDeepConversion ) ;
public class LayerImpl { /** * De - serialize this object from an ObjectInputStream * @ param in The ObjectInputStream * @ throws IOException * @ throws ClassNotFoundException */ private void readObject ( ObjectInputStream in ) throws IOException , ClassNotFoundException { } }
// Call the default implementation to de - serialize our object in . defaultReadObject ( ) ; // init transients _validateLastModified = new AtomicBoolean ( true ) ; _cacheKeyGenMutex = new Semaphore ( 1 ) ; _isReportCacheInfo = false ;
public class JacksonJsonMarshaller { /** * Serialize the given Java object into JSON string . */ @ Override public String serialize ( Object obj ) throws JsonMarshallingException { } }
try { return serializeChecked ( obj ) ; } catch ( Exception e ) { throw new JsonMarshallingException ( e ) ; }
public class VoltBulkLoader { /** * Waits for all pending inserts to be acknowledged and then closes this instance of the * VoltBulkLoader . During and after the invocation of close ( ) , calls to insertRow will get * an Exception . All other instances of VoltBulkLoader will continue to function . * @ throws java . lang . InterruptedException */ public synchronized void close ( ) throws Exception { } }
// Stop the periodic flush as we will flush laster if ( m_flush != null ) { m_flush . cancel ( false ) ; } m_ses . shutdown ( ) ; // Remove this VoltBulkLoader from the active set . synchronized ( m_vblGlobals ) { drain ( ) ; List < VoltBulkLoader > loaderList = m_vblGlobals . m_TableNameToLoader . get ( m_tableName ) ; if ( loaderList . size ( ) == 1 ) { m_vblGlobals . m_TableNameToLoader . remove ( m_tableName ) ; // We are the last loader for this table , // shutdown the PerPartitionTable instances for ( PerPartitionTable ppt : m_partitionTable ) { if ( ppt != null ) { try { ppt . shutdown ( ) ; } catch ( Exception e ) { loaderLog . error ( "Failed to close processor for partition " + ppt . m_partitionId , e ) ; } } } } else { loaderList . remove ( this ) ; } } assert m_outstandingRowCount . get ( ) == 0 ;
public class ClassNodeResolver { /** * try to find a script using the compilation unit class loader . */ private static LookupResult tryAsScript ( String name , CompilationUnit compilationUnit , ClassNode oldClass ) { } }
LookupResult lr = null ; if ( oldClass != null ) { lr = new LookupResult ( null , oldClass ) ; } if ( name . startsWith ( "java." ) ) return lr ; // TODO : don ' t ignore inner static classes completely if ( name . indexOf ( '$' ) != - 1 ) return lr ; // try to find a script from classpath * / GroovyClassLoader gcl = compilationUnit . getClassLoader ( ) ; URL url = null ; try { url = gcl . getResourceLoader ( ) . loadGroovySource ( name ) ; } catch ( MalformedURLException e ) { // fall through and let the URL be null } if ( url != null && ( oldClass == null || isSourceNewer ( url , oldClass ) ) ) { SourceUnit su = compilationUnit . addSource ( url ) ; return new LookupResult ( su , null ) ; } return lr ;
public class DeleteAgentRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteAgentRequest deleteAgentRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteAgentRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteAgentRequest . getAgentArn ( ) , AGENTARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class Processor { /** * Transforms an input stream into HTML . * @ param reader * The Reader to process . * @ param safeMode * Set to < code > true < / code > to escape unsafe HTML tags . * @ return The processed String . * @ throws IOException * if an IO error occurs * @ see Configuration # DEFAULT */ public final static String process ( final Reader reader , final boolean safeMode ) throws IOException { } }
return process ( reader , Configuration . builder ( ) . setSafeMode ( safeMode ) . build ( ) ) ;
public class ClassInfo { /** * Get the annotations and meta - annotations on this class . ( Call { @ link # getAnnotationInfo ( ) } instead , if you * need the parameter values of annotations , rather than just the annotation classes . ) * Also handles the { @ link Inherited } meta - annotation , which causes an annotation to annotate a class and all of * its subclasses . * Filters out meta - annotations in the { @ code java . lang . annotation } package . * @ return the list of annotations and meta - annotations on this class . */ public ClassInfoList getAnnotations ( ) { } }
if ( ! scanResult . scanSpec . enableAnnotationInfo ) { throw new IllegalArgumentException ( "Please call ClassGraph#enableAnnotationInfo() before #scan()" ) ; } // Get all annotations on this class final ReachableAndDirectlyRelatedClasses annotationClasses = this . filterClassInfo ( RelType . CLASS_ANNOTATIONS , /* strictWhitelist = */ false ) ; // Check for any @ Inherited annotations on superclasses Set < ClassInfo > inheritedSuperclassAnnotations = null ; for ( final ClassInfo superclass : getSuperclasses ( ) ) { for ( final ClassInfo superclassAnnotation : superclass . filterClassInfo ( RelType . CLASS_ANNOTATIONS , /* strictWhitelist = */ false ) . reachableClasses ) { // Check if any of the meta - annotations on this annotation are @ Inherited , // which causes an annotation to annotate a class and all of its subclasses . if ( superclassAnnotation != null && superclassAnnotation . isInherited ) { // superclassAnnotation has an @ Inherited meta - annotation if ( inheritedSuperclassAnnotations == null ) { inheritedSuperclassAnnotations = new LinkedHashSet < > ( ) ; } inheritedSuperclassAnnotations . add ( superclassAnnotation ) ; } } } if ( inheritedSuperclassAnnotations == null ) { // No inherited superclass annotations return new ClassInfoList ( annotationClasses , /* sortByName = */ true ) ; } else { // Merge inherited superclass annotations and annotations on this class inheritedSuperclassAnnotations . addAll ( annotationClasses . reachableClasses ) ; return new ClassInfoList ( inheritedSuperclassAnnotations , annotationClasses . directlyRelatedClasses , /* sortByName = */ true ) ; }
public class LogSupport { /** * Ignore an exception unless trace is enabled . * This works around the problem that log4j does not support the trace level . */ public static void ignore ( Log log , Throwable th ) { } }
if ( log . isTraceEnabled ( ) ) log . trace ( IGNORED , th ) ;
public class ManagedBackupShortTermRetentionPoliciesInner { /** * Updates a managed database ' s short term retention 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 managedInstanceName The name of the managed instance . * @ param databaseName The name of the database . * @ param retentionDays The backup retention period in days . This is how many days Point - in - Time Restore will be supported . * @ 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 < ManagedBackupShortTermRetentionPolicyInner > createOrUpdateAsync ( String resourceGroupName , String managedInstanceName , String databaseName , Integer retentionDays , final ServiceCallback < ManagedBackupShortTermRetentionPolicyInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( createOrUpdateWithServiceResponseAsync ( resourceGroupName , managedInstanceName , databaseName , retentionDays ) , serviceCallback ) ;
public class CmsGalleryController { /** * Add type to search object . < p > * @ param resourceType the id ( name ? ) of the resource type to add */ public void addType ( String resourceType ) { } }
m_searchObject . addType ( resourceType ) ; m_searchObjectChanged = true ; ValueChangeEvent . fire ( this , m_searchObject ) ;
public class RestApiClient { /** * Close all user sessions . * @ param username the username * @ return the response */ public Response deleteSessions ( String username ) { } }
return restClient . delete ( "sessions/" + username , new HashMap < String , String > ( ) ) ;
public class InlineMenu { /** * Handle an inline query sent . * Caller dependent , throws exception if called from a class which doesn ' t implement InlineMenuRegistry * @ param query The callback query * @ param row The button ' s row * @ param button The button ' s column * @ return Whether the menu handled the request , if not it was due to a user predicate or invalid row or invalid button * @ see InlineMenuRegistry * @ see InlineMenuRow # handle ( CallbackQuery , int ) */ public boolean handle ( CallbackQuery query , int row , int button ) { } }
if ( ! validateCaller ( InlineMenuRegistry . class ) ) { throw new UnsupportedOperationException ( "Invalid caller! Caller must implement InlineMenuRegistry" ) ; } return ( userPredicate == null || userPredicate . test ( query . getFrom ( ) ) ) && row < rows . size ( ) && rowAt ( row ) . handle ( query , button ) ;
public class CollectionUtils { /** * Return the items of an Iterable as a sorted list . * @ param < T > * The type of items in the Iterable . * @ param items * The collection to be sorted . * @ return A list containing the same items as the Iterable , but sorted . */ public static < T extends Comparable < T > > List < T > sorted ( Iterable < T > items ) { } }
List < T > result = toList ( items ) ; Collections . sort ( result ) ; return result ;
public class UserMarshaller { /** * Marshall the given parameter object . */ public void marshall ( User user , ProtocolMarshaller protocolMarshaller ) { } }
if ( user == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( user . getId ( ) , ID_BINDING ) ; protocolMarshaller . marshall ( user . getArn ( ) , ARN_BINDING ) ; protocolMarshaller . marshall ( user . getUsername ( ) , USERNAME_BINDING ) ; protocolMarshaller . marshall ( user . getIdentityInfo ( ) , IDENTITYINFO_BINDING ) ; protocolMarshaller . marshall ( user . getPhoneConfig ( ) , PHONECONFIG_BINDING ) ; protocolMarshaller . marshall ( user . getDirectoryUserId ( ) , DIRECTORYUSERID_BINDING ) ; protocolMarshaller . marshall ( user . getSecurityProfileIds ( ) , SECURITYPROFILEIDS_BINDING ) ; protocolMarshaller . marshall ( user . getRoutingProfileId ( ) , ROUTINGPROFILEID_BINDING ) ; protocolMarshaller . marshall ( user . getHierarchyGroupId ( ) , HIERARCHYGROUPID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class LegacyCookieSupport { /** * Returns true if the byte is a separator as defined by V1 of the cookie * spec , RFC2109. * @ throws IllegalArgumentException if a control character was supplied as * input */ private static boolean isHttpSeparator ( final char c ) { } }
if ( c < 0x20 || c >= 0x7f ) { if ( c != 0x09 ) { throw UndertowMessages . MESSAGES . invalidControlCharacter ( Integer . toString ( c ) ) ; } } return HTTP_SEPARATOR_FLAGS [ c ] ;
public class DescribePublicIpv4PoolsResult { /** * Information about the address pools . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setPublicIpv4Pools ( java . util . Collection ) } or { @ link # withPublicIpv4Pools ( java . util . Collection ) } if you * want to override the existing values . * @ param publicIpv4Pools * Information about the address pools . * @ return Returns a reference to this object so that method calls can be chained together . */ public DescribePublicIpv4PoolsResult withPublicIpv4Pools ( PublicIpv4Pool ... publicIpv4Pools ) { } }
if ( this . publicIpv4Pools == null ) { setPublicIpv4Pools ( new com . amazonaws . internal . SdkInternalList < PublicIpv4Pool > ( publicIpv4Pools . length ) ) ; } for ( PublicIpv4Pool ele : publicIpv4Pools ) { this . publicIpv4Pools . add ( ele ) ; } return this ;
public class FileLock { /** * Tells whether or not this lock overlaps the given lock range . < / p > * @ return < tt > true < / tt > if , and only if , this lock and the given lock * range overlap by at least one byte */ public final boolean overlaps ( long position , long size ) { } }
if ( position + size <= this . position ) return false ; // That is below this if ( this . position + this . size <= position ) return false ; // This is below that return true ;
public class CommerceAddressRestrictionLocalServiceWrapper { /** * Adds the commerce address restriction to the database . Also notifies the appropriate model listeners . * @ param commerceAddressRestriction the commerce address restriction * @ return the commerce address restriction that was added */ @ Override public com . liferay . commerce . model . CommerceAddressRestriction addCommerceAddressRestriction ( com . liferay . commerce . model . CommerceAddressRestriction commerceAddressRestriction ) { } }
return _commerceAddressRestrictionLocalService . addCommerceAddressRestriction ( commerceAddressRestriction ) ;
public class ResourcesInner { /** * Updates a resource by ID . * @ param resourceId The fully qualified ID of the resource , including the resource name and resource type . Use the format , / subscriptions / { guid } / resourceGroups / { resource - group - name } / { resource - provider - namespace } / { resource - type } / { resource - name } * @ param apiVersion The API version to use for the operation . * @ param parameters Update resource parameters . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the GenericResourceInner object */ public Observable < GenericResourceInner > beginUpdateByIdAsync ( String resourceId , String apiVersion , GenericResourceInner parameters ) { } }
return beginUpdateByIdWithServiceResponseAsync ( resourceId , apiVersion , parameters ) . map ( new Func1 < ServiceResponse < GenericResourceInner > , GenericResourceInner > ( ) { @ Override public GenericResourceInner call ( ServiceResponse < GenericResourceInner > response ) { return response . body ( ) ; } } ) ;
public class ContentPackage { /** * Adds a binary file . * @ param path Full content path and file name of file * @ param inputStream Input stream with binary dta * @ throws IOException I / O exception */ public void addFile ( String path , InputStream inputStream ) throws IOException { } }
addFile ( path , inputStream , null ) ;
public class RLSControllerImpl { /** * Suspend i / o to the recovery log files * @ param timeout value in seconds after which this suspend operation will be cancelled . * A timeout value of zero indicates no timeout * @ exception RLSTimeoutRangeException Thrown if timeout is not in the range 0 < timeout < = 1,000,000,000. */ public RLSSuspendToken suspend ( int timeout ) throws RLSTimeoutRangeException { } }
if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "suspend" , new Integer ( timeout ) ) ; if ( Configuration . isZOS ( ) ) { if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "Operation not supported on ZOS - throwing UnsupportedOperationException" ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "resume" , "java.lang.UnsupportedOperationException" ) ; throw new UnsupportedOperationException ( ) ; } RLSSuspendToken token = RLSControllerImpl . suspendRLS ( timeout ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "suspend" ) ; return token ;
public class ReasonFlags { /** * Set the attribute value . */ public void set ( String name , Object obj ) throws IOException { } }
if ( ! ( obj instanceof Boolean ) ) { throw new IOException ( "Attribute must be of type Boolean." ) ; } boolean val = ( ( Boolean ) obj ) . booleanValue ( ) ; set ( name2Index ( name ) , val ) ;
public class StringUtility { /** * Counts how many times a word appears in a line . Case insensitive matching . */ public static int countOccurrences ( byte [ ] buff , int len , String word ) { } }
int wordlen = word . length ( ) ; int end = len - wordlen ; int count = 0 ; Loop : for ( int c = 0 ; c <= end ; c ++ ) { for ( int d = 0 ; d < wordlen ; d ++ ) { char ch1 = ( char ) buff [ c + d ] ; if ( ch1 <= 'Z' && ch1 >= 'A' ) ch1 += 'a' - 'A' ; char ch2 = word . charAt ( d ) ; if ( ch2 <= 'Z' && ch2 >= 'A' ) ch2 += 'a' - 'A' ; if ( ch1 != ch2 ) continue Loop ; } c += wordlen - 1 ; count ++ ; } return count ;
public class ClasspathUtils { /** * Get the list of classpath components * @ param ucl url classloader * @ return List of classpath components */ private static List getUrlClassLoaderClasspathComponents ( URLClassLoader ucl ) { } }
List components = new ArrayList ( ) ; URL [ ] urls = new URL [ 0 ] ; // Workaround for running on JBoss with UnifiedClassLoader3 usage // We need to invoke getClasspath ( ) method instead of getURLs ( ) if ( ucl . getClass ( ) . getName ( ) . equals ( "org.jboss.mx.loading.UnifiedClassLoader3" ) ) { try { Method classPathMethod = ucl . getClass ( ) . getMethod ( "getClasspath" , new Class [ ] { } ) ; urls = ( URL [ ] ) classPathMethod . invoke ( ucl , new Object [ 0 ] ) ; } catch ( Exception e ) { LogFactory . getLog ( ClasspathUtils . class ) . debug ( "Error invoking getClasspath on UnifiedClassLoader3: " , e ) ; } } else { // Use regular ClassLoader method to get classpath urls = ucl . getURLs ( ) ; } for ( int i = 0 ; i < urls . length ; i ++ ) { URL url = urls [ i ] ; components . add ( getCanonicalPath ( url . getPath ( ) ) ) ; } return components ;
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getFNCXftUnits ( ) { } }
if ( fncXftUnitsEEnum == null ) { fncXftUnitsEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 22 ) ; } return fncXftUnitsEEnum ;
public class WebUtils { /** * Gets the http servlet request from the current servlet context . * @ return the http servlet request */ public static HttpServletRequest getHttpServletRequestFromExternalWebflowContext ( ) { } }
val servletExternalContext = ( ServletExternalContext ) ExternalContextHolder . getExternalContext ( ) ; if ( servletExternalContext != null ) { return ( HttpServletRequest ) servletExternalContext . getNativeRequest ( ) ; } return null ;
public class AWSBackupClient { /** * Sets a resource - based policy that is used to manage access permissions on the target backup vault . Requires a * backup vault name and an access policy document in JSON format . * @ param putBackupVaultAccessPolicyRequest * @ return Result of the PutBackupVaultAccessPolicy operation returned by the service . * @ throws ResourceNotFoundException * A resource that is required for the action doesn ' t exist . * @ throws InvalidParameterValueException * Indicates that something is wrong with a parameter ' s value . For example , the value is out of range . * @ throws MissingParameterValueException * Indicates that a required parameter is missing . * @ throws ServiceUnavailableException * The request failed due to a temporary failure of the server . * @ sample AWSBackup . PutBackupVaultAccessPolicy * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / backup - 2018-11-15 / PutBackupVaultAccessPolicy " * target = " _ top " > AWS API Documentation < / a > */ @ Override public PutBackupVaultAccessPolicyResult putBackupVaultAccessPolicy ( PutBackupVaultAccessPolicyRequest request ) { } }
request = beforeClientExecution ( request ) ; return executePutBackupVaultAccessPolicy ( request ) ;
public class SubscriptionRegistrar { /** * Method addNewConsumerForExpression * Categorises a consumer and adds it to the appropriate hashtable . * @ param topicExpression * @ param mc * @ param selector * @ param isWildcarded */ public void addNewConsumerForExpression ( String topicExpression , MonitoredConsumer mc , boolean selector , boolean isWildcarded ) { } }
if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "addNewConsumerForExpression" , new Object [ ] { topicExpression , mc , new Boolean ( selector ) , new Boolean ( isWildcarded ) } ) ; ArrayList consumerList = new ArrayList ( 1 ) ; // Add new consumer into list consumerList . add ( mc ) ; if ( selector ) { if ( isWildcarded ) { // Selector and wildcarded _wildcardSelectorSubs . put ( topicExpression , consumerList ) ; _areWildcardSelectorSubs = true ; } else { // Selector but not wildcarded _exactSelectorSubs . put ( topicExpression , consumerList ) ; _areExactSelectorSubs = true ; } } else { // No Selector expression if ( isWildcarded ) { // No selector and wildcarded _wildcardNonSelectorSubs . put ( topicExpression , consumerList ) ; _areWildcardNonSelectorSubs = true ; } else { // No selector and not wildcarded _exactNonSelectorSubs . put ( topicExpression , consumerList ) ; _areExactNonSelectorSubs = true ; } } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "addNewConsumerForExpression" ) ;
public class UTF8String { /** * Returns the upper case of this string */ public UTF8String toUpperCase ( ) { } }
if ( numBytes == 0 ) { return EMPTY_UTF8 ; } byte [ ] bytes = new byte [ numBytes ] ; bytes [ 0 ] = ( byte ) Character . toTitleCase ( getByte ( 0 ) ) ; for ( int i = 0 ; i < numBytes ; i ++ ) { byte b = getByte ( i ) ; if ( numBytesForFirstByte ( b ) != 1 ) { // fallback return toUpperCaseSlow ( ) ; } int upper = Character . toUpperCase ( ( int ) b ) ; if ( upper > 127 ) { // fallback return toUpperCaseSlow ( ) ; } bytes [ i ] = ( byte ) upper ; } return fromBytes ( bytes ) ;
public class DSUtil { /** * Similar to teh other < code > mapColl < / code > method , but the * function is given as a map . This map is expected to map all * elements from the entry collection < code > coll < / code > . * @ see # mapColl ( Iterable , Function , Collection ) */ public static < E1 , E2 > Collection < E2 > mapColl ( Iterable < E1 > coll , Map < E1 , E2 > map , Collection < E2 > newColl ) { } }
return mapColl ( coll , map2fun ( map ) , newColl ) ;
public class Command { /** * Create a CORBA Any object and insert a short array in it . * @ param data The short array to be inserted into the Any object * @ exception DevFailed If the Any object creation failed . * Click < a href = " . . / . . / tango _ basic / idl _ html / Tango . html # DevFailed " > here < / a > to read * < b > DevFailed < / b > exception specification */ public Any insert ( short [ ] data ) throws DevFailed { } }
Any out_any = alloc_any ( ) ; DevVarShortArrayHelper . insert ( out_any , data ) ; return out_any ;
public class ServletUtils { /** * Returns the value of the { @ link ServletConstants # DISABLE _ REQUEST _ SIGNATURE _ CHECK _ SYSTEM _ PROPERTY } JVM system property as a { @ link Boolean } . * @ return value of the { @ link ServletConstants # DISABLE _ REQUEST _ SIGNATURE _ CHECK _ SYSTEM _ PROPERTY } system property as a { @ link Boolean } . */ public static Boolean isRequestSignatureCheckSystemPropertyDisabled ( ) { } }
String isRequestSignatureCheckDisabled = System . getProperty ( ServletConstants . DISABLE_REQUEST_SIGNATURE_CHECK_SYSTEM_PROPERTY ) ; return Boolean . valueOf ( isRequestSignatureCheckDisabled ) ;
public class ConfigUtils { /** * Method will create a TrustManagerFactory based on the Algorithm type specified in the config . * @ param config Config to read from . * @ param key Key to read from * @ return TrustManagerFactory based on the type specified in the config . */ public static TrustManagerFactory trustManagerFactory ( AbstractConfig config , String key ) { } }
final String trustManagerFactoryType = config . getString ( key ) ; try { return TrustManagerFactory . getInstance ( trustManagerFactoryType ) ; } catch ( NoSuchAlgorithmException e ) { ConfigException exception = new ConfigException ( key , trustManagerFactoryType , "Unknown Algorithm." ) ; exception . initCause ( e ) ; throw exception ; }
public class LazyObject { /** * Returns the integer value stored in this object for the given key . * Returns 0 if there is no such key . * @ param key the name of the field on this object * @ return the requested integer value or 0 if there was no such key */ public int optInt ( String key ) { } }
LazyNode token = getOptionalFieldToken ( key ) ; if ( token == null ) return 0 ; if ( token . type == LazyNode . VALUE_NULL ) return 0 ; return token . getIntValue ( ) ;
public class CachingGroovyEngine { /** * Initialize the engine . */ public void initialize ( final BSFManager mgr , String lang , Vector declaredBeans ) throws BSFException { } }
super . initialize ( mgr , lang , declaredBeans ) ; ClassLoader parent = mgr . getClassLoader ( ) ; if ( parent == null ) parent = GroovyShell . class . getClassLoader ( ) ; setLoader ( mgr , parent ) ; execScripts = new HashMap < Object , Class > ( ) ; evalScripts = new HashMap < Object , Class > ( ) ; context = shell . getContext ( ) ; // create a shell // register the mgr with object name " bsf " context . setVariable ( "bsf" , new BSFFunctions ( mgr , this ) ) ; int size = declaredBeans . size ( ) ; for ( int i = 0 ; i < size ; i ++ ) { declareBean ( ( BSFDeclaredBean ) declaredBeans . elementAt ( i ) ) ; }
public class CmsJspContentAccessBean { /** * Gets a lazy map which maps locales to attachment beans for that locale . < p > * @ return the lazy map */ public Map < ? , ? > getAttachmentsForLocale ( ) { } }
return CmsCollectionsGenericWrapper . createLazyMap ( new Transformer ( ) { @ SuppressWarnings ( "synthetic-access" ) public Object transform ( Object arg0 ) { String localeStr = ( String ) arg0 ; return CmsJspContentAttachmentsBean . getAttachmentsForLocale ( m_cms , m_resource , localeStr ) ; } } ) ;
public class DescribeTapeRecoveryPointsResult { /** * An array of TapeRecoveryPointInfos that are available for the specified gateway . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setTapeRecoveryPointInfos ( java . util . Collection ) } or * { @ link # withTapeRecoveryPointInfos ( java . util . Collection ) } if you want to override the existing values . * @ param tapeRecoveryPointInfos * An array of TapeRecoveryPointInfos that are available for the specified gateway . * @ return Returns a reference to this object so that method calls can be chained together . */ public DescribeTapeRecoveryPointsResult withTapeRecoveryPointInfos ( TapeRecoveryPointInfo ... tapeRecoveryPointInfos ) { } }
if ( this . tapeRecoveryPointInfos == null ) { setTapeRecoveryPointInfos ( new com . amazonaws . internal . SdkInternalList < TapeRecoveryPointInfo > ( tapeRecoveryPointInfos . length ) ) ; } for ( TapeRecoveryPointInfo ele : tapeRecoveryPointInfos ) { this . tapeRecoveryPointInfos . add ( ele ) ; } return this ;
public class GenericWindowContainer { /** * - - - - - 以下代码是PortalListener和Invocation的实现代码 - - - - - */ @ Override public void onWindowAdded ( Window window ) { } }
if ( windowListeners != null ) { try { windowListeners . onWindowAdded ( window ) ; } catch ( Exception e ) { logger . error ( "" , e ) ; } }
public class ClassReplicaCreator { /** * Add a field to the replica class that holds the instance delegator . I . e . * if we ' re creating a instance replica of { @ code java . lang . Long } this * methods adds a new field of type { @ code delegator . getClass ( ) } to the * replica class . */ private < T > void addDelegatorField ( T delegator , final CtClass replicaClass ) throws CannotCompileException { } }
CtField f = CtField . make ( String . format ( "private %s %s = null;" , delegator . getClass ( ) . getName ( ) , POWERMOCK_INSTANCE_DELEGATOR_FIELD_NAME ) , replicaClass ) ; replicaClass . addField ( f ) ;
public class CredentialFactory { /** * Initializes OAuth2 application default credentials based on the environment the code is running * in . If a service account is to be used with JSON file , set the environment variable with name * " GOOGLE _ APPLICATION _ CREDENTIALS " to the JSON file path . For more details on application default * credentials : * < a href = " https : / / developers . google . com / identity / protocols / application - default - credentials " > * Application Default Credentials < / a > . * @ return a { @ link com . google . auth . Credentials } object . * @ throws java . io . IOException if any . */ public static Credentials getApplicationDefaultCredential ( ) throws IOException { } }
GoogleCredentials credentials = GoogleCredentials . getApplicationDefault ( getHttpTransportFactory ( ) ) ; if ( credentials instanceof ServiceAccountCredentials ) { return getJwtToken ( ( ServiceAccountCredentials ) credentials ) ; } return credentials . createScoped ( CLOUD_BIGTABLE_ALL_SCOPES ) ;
public class Member { /** * Create a MemberUpdater to execute update . * @ param pathServiceSid The SID of the Service to create the resource under * @ param pathChannelSid The unique ID of the channel the member to update * belongs to * @ param pathSid The unique string that identifies the resource * @ return MemberUpdater capable of executing the update */ public static MemberUpdater updater ( final String pathServiceSid , final String pathChannelSid , final String pathSid ) { } }
return new MemberUpdater ( pathServiceSid , pathChannelSid , pathSid ) ;
public class Utility { /** * MD5加密 * @ param str 待加密数据 * @ return md5值 */ public static byte [ ] md5Bytes ( String str ) { } }
if ( str == null ) return null ; MessageDigest md5 ; try { md5 = MessageDigest . getInstance ( "MD5" ) ; } catch ( NoSuchAlgorithmException ex ) { throw new RuntimeException ( ex ) ; } return md5 . digest ( str . getBytes ( ) ) ;
public class ZipExporterImpl { /** * { @ inheritDoc } * @ see org . jboss . shrinkwrap . api . exporter . StreamExporter # exportAsInputStream ( ) */ @ Override public InputStream exportAsInputStream ( ) { } }
// Create export delegate final AbstractExporterDelegate < InputStream > exportDelegate = new ZipExporterDelegate ( this . getArchive ( ) ) ; // Export and get result return exportDelegate . export ( ) ;
public class DescribeInputResult { /** * A list of the sources of the input ( PULL - type ) . * @ param sources * A list of the sources of the input ( PULL - type ) . */ public void setSources ( java . util . Collection < InputSource > sources ) { } }
if ( sources == null ) { this . sources = null ; return ; } this . sources = new java . util . ArrayList < InputSource > ( sources ) ;
public class RedisMemoryImpl { @ Override public Long hset ( String key , long field , String value ) { } }
return this . hset ( key , Long . toString ( field ) , value ) ;
public class State { /** * Save view hierarchy state so it can be restored later from { @ link # restore ( View ) } . The view * must have a non - zero id . */ public void save ( @ NonNull View view ) { } }
int viewId = view . getId ( ) ; Preconditions . checkArgument ( viewId != 0 , "Cannot save state for View with no id " + view . getClass ( ) . getSimpleName ( ) ) ; SparseArray < Parcelable > state = new SparseArray < > ( ) ; view . saveHierarchyState ( state ) ; viewStateById . put ( viewId , state ) ;
public class AbstractImporter { /** * { @ inheritDoc } 进行转换 */ public void transfer ( TransferResult tr ) { } }
this . transferResult = tr ; this . transferResult . setTransfer ( this ) ; long transferStartAt = System . currentTimeMillis ( ) ; try { prepare . prepare ( this ) ; } catch ( Exception e ) { // 预导入发生位置错误 , 错误信息已经记录在tr了 return ; } for ( final TransferListener listener : listeners ) { listener . onStart ( tr ) ; } while ( read ( ) ) { long transferItemStart = System . currentTimeMillis ( ) ; index ++ ; beforeImportItem ( ) ; if ( ! isDataValid ( ) ) continue ; int errors = tr . errors ( ) ; // 实体转换开始 for ( final TransferListener listener : listeners ) { listener . onItemStart ( tr ) ; } // 如果转换前已经存在错误 , 则不进行转换 if ( tr . errors ( ) > errors ) continue ; // 进行转换 transferItem ( ) ; // 实体转换结束 for ( final TransferListener listener : listeners ) { listener . onItemFinish ( tr ) ; } // 如果导入过程中没有错误 , 将成功记录数增一 if ( tr . errors ( ) == errors ) this . success ++ ; else this . fail ++ ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "importer item:{} take time: {}" , getTranferIndex ( ) , ( System . currentTimeMillis ( ) - transferItemStart ) ) ; } } for ( final TransferListener listener : listeners ) { listener . onFinish ( tr ) ; } reader . close ( ) ; logger . debug ( "importer elapse: {}" , ( System . currentTimeMillis ( ) - transferStartAt ) ) ;
public class ContinuousDistributions { /** * 给定卡方分布的p值和自由度 , 返回卡方值 。 内部采用二分搜索实现 , 移植自JS代码 : * http : / / www . fourmilab . ch / rpkp / experiments / analysis / chiCalc . js * @ param p p值 ( 置信度 ) * @ param df * @ return */ public static double ChisquareInverseCdf ( double p , int df ) { } }
final double CHI_EPSILON = 0.000001 ; /* Accuracy of critchi approximation */ final double CHI_MAX = 99999.0 ; /* Maximum chi - square value */ double minchisq = 0.0 ; double maxchisq = CHI_MAX ; double chisqval = 0.0 ; if ( p <= 0.0 ) { return CHI_MAX ; } else if ( p >= 1.0 ) { return 0.0 ; } chisqval = df / Math . sqrt ( p ) ; /* fair first value */ while ( ( maxchisq - minchisq ) > CHI_EPSILON ) { if ( 1 - ChisquareCdf ( chisqval , df ) < p ) { maxchisq = chisqval ; } else { minchisq = chisqval ; } chisqval = ( maxchisq + minchisq ) * 0.5 ; } return chisqval ;
public class UserRegistryServiceImpl { /** * When a configuration element is defined , use it to resolve the effective * UserRegistry configuration . * @ return * @ throws RegistryException */ private UserRegistry getUserRegistryFromConfiguration ( ) throws RegistryException { } }
String [ ] refIds = this . refId ; if ( refIds == null || refIds . length == 0 ) { // Can look for config . source = file // If thats set , and we ' re missing this , we can error . // If its not set , we don ' t have configuration from the // file and we should try to resolve if we have one instance defined ? Tr . error ( tc , "USER_REGISTRY_SERVICE_CONFIG_ERROR_NO_REFID" ) ; throw new RegistryException ( TraceNLS . getFormattedMessage ( this . getClass ( ) , TraceConstants . MESSAGE_BUNDLE , "USER_REGISTRY_SERVICE_CONFIG_ERROR_NO_REFID" , null , "CWWKS3000E: A configuration error has occurred. There is no configured refId parameter for the userRegistry configuration." ) ) ; } else if ( refIds . length == 1 ) { return getUserRegistry ( refIds [ 0 ] ) ; } else { // Multiple refIds , we ' ll use the UserRegistryProxy . List < UserRegistry > delegates = new ArrayList < UserRegistry > ( ) ; for ( String refId : refIds ) { delegates . add ( getUserRegistry ( refId ) ) ; } return new UserRegistryProxy ( realm , delegates ) ; }
public class WCheckBoxSelectRenderer { /** * Paints the given WCheckBoxSelect . * @ param component the WCheckBoxSelect to paint . * @ param renderContext the RenderContext to paint to . */ @ Override public void doRender ( final WComponent component , final WebXmlRenderContext renderContext ) { } }
WCheckBoxSelect select = ( WCheckBoxSelect ) component ; XmlStringBuilder xml = renderContext . getWriter ( ) ; int cols = select . getButtonColumns ( ) ; boolean readOnly = select . isReadOnly ( ) ; xml . appendTagOpen ( "ui:checkboxselect" ) ; xml . appendAttribute ( "id" , component . getId ( ) ) ; xml . appendOptionalAttribute ( "class" , component . getHtmlClass ( ) ) ; xml . appendOptionalAttribute ( "track" , component . isTracking ( ) , "true" ) ; xml . appendOptionalAttribute ( "hidden" , select . isHidden ( ) , "true" ) ; if ( readOnly ) { xml . appendAttribute ( "readOnly" , "true" ) ; } else { int min = select . getMinSelect ( ) ; int max = select . getMaxSelect ( ) ; xml . appendOptionalAttribute ( "disabled" , select . isDisabled ( ) , "true" ) ; xml . appendOptionalAttribute ( "required" , select . isMandatory ( ) , "true" ) ; xml . appendOptionalAttribute ( "submitOnChange" , select . isSubmitOnChange ( ) , "true" ) ; xml . appendOptionalAttribute ( "toolTip" , component . getToolTip ( ) ) ; xml . appendOptionalAttribute ( "accessibleText" , component . getAccessibleText ( ) ) ; xml . appendOptionalAttribute ( "min" , min > 0 , min ) ; xml . appendOptionalAttribute ( "max" , max > 0 , max ) ; } xml . appendOptionalAttribute ( "frameless" , select . isFrameless ( ) , "true" ) ; switch ( select . getButtonLayout ( ) ) { case COLUMNS : xml . appendAttribute ( "layout" , "column" ) ; xml . appendOptionalAttribute ( "layoutColumnCount" , cols > 0 , cols ) ; break ; case FLAT : xml . appendAttribute ( "layout" , "flat" ) ; break ; case STACKED : xml . appendAttribute ( "layout" , "stacked" ) ; break ; default : throw new SystemException ( "Unknown layout type: " + select . getButtonLayout ( ) ) ; } xml . appendClose ( ) ; // Options List < ? > options = select . getOptions ( ) ; boolean renderSelectionsOnly = readOnly ; if ( options != null ) { int optionIndex = 0 ; List < ? > selections = select . getSelected ( ) ; for ( Object option : options ) { if ( option instanceof OptionGroup ) { throw new SystemException ( "Option groups not supported in WCheckBoxSelect." ) ; } else { renderOption ( select , option , optionIndex ++ , xml , selections , renderSelectionsOnly ) ; } } } if ( ! readOnly ) { DiagnosticRenderUtil . renderDiagnostics ( select , renderContext ) ; } xml . appendEndTag ( "ui:checkboxselect" ) ;
public class GrpcClientBeanPostProcessor { /** * Creates the instance to be injected for the given member . * @ param name The name that was used to create the channel . * @ param < T > The type of the instance to be injected . * @ param injectionTarget The target member for the injection . * @ param injectionType The class that should injected . * @ param channel The channel that should be used to create the instance . * @ return The value that matches the type of the given field . * @ throws BeansException If the value of the field could not be created or the type of the field is unsupported . */ protected < T > T valueForMember ( final String name , final Member injectionTarget , final Class < T > injectionType , final Channel channel ) throws BeansException { } }
if ( Channel . class . equals ( injectionType ) ) { return injectionType . cast ( channel ) ; } else if ( AbstractStub . class . isAssignableFrom ( injectionType ) ) { try { @ SuppressWarnings ( "unchecked" ) final Class < ? extends AbstractStub < ? > > stubClass = ( Class < ? extends AbstractStub < ? > > ) injectionType . asSubclass ( AbstractStub . class ) ; final Constructor < ? extends AbstractStub < ? > > constructor = ReflectionUtils . accessibleConstructor ( stubClass , Channel . class ) ; AbstractStub < ? > stub = constructor . newInstance ( channel ) ; for ( final StubTransformer stubTransformer : getStubTransformers ( ) ) { stub = stubTransformer . transform ( name , stub ) ; } return injectionType . cast ( stub ) ; } catch ( final NoSuchMethodException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e ) { throw new BeanInstantiationException ( injectionType , "Failed to create gRPC client for : " + injectionTarget , e ) ; } } else { throw new InvalidPropertyException ( injectionTarget . getDeclaringClass ( ) , injectionTarget . getName ( ) , "Unsupported type " + injectionType . getName ( ) ) ; }
public class Functions { /** * Returns the correctly rounded positive square root of a { @ code double } * value . * Any numeric string recognized by { @ code BigDecimal } is supported . * @ param value A valid number * @ return the positive square root of { @ code value } . */ public static String sqrt ( String value ) { } }
try { BigDecimal bd = new BigDecimal ( value ) ; return Math . sqrt ( bd . doubleValue ( ) ) + "" ; } catch ( Exception ex ) { return null ; }
public class ProposalLineItemConstraints { /** * Gets the builtInRoadblockingType value for this ProposalLineItemConstraints . * @ return builtInRoadblockingType * The built - in roadblocking type for the created { @ link ProposalLineItem } . * < p > This attribute is read - only . */ public com . google . api . ads . admanager . axis . v201902 . RoadblockingType getBuiltInRoadblockingType ( ) { } }
return builtInRoadblockingType ;
public class Taint { /** * Checks whether one of the specified taint tag is present for this fact * @ param tags Tags to test * @ return true if at least one is present , false otherwise */ public boolean hasOneTag ( Tag ... tags ) { } }
for ( Tag t : tags ) { if ( this . tags . contains ( t ) ) return true ; } return false ;
public class IgnoreableProcessor { /** * Certain events have no time basis on the person . * @ param event the event * @ return true if it is non - time event */ protected final boolean ignoreable ( final Attribute event ) { } }
// Layed out like this because it is easier to understand // coverage . No performance differences expected compared // to tighter layout . if ( "Sex" . equals ( event . getString ( ) ) ) { return true ; } if ( "Changed" . equals ( event . getString ( ) ) ) { return true ; } if ( "Ancestral File Number" . equals ( event . getString ( ) ) ) { return true ; } if ( "Title" . equals ( event . getString ( ) ) ) { return true ; } if ( "Attribute" . equals ( event . getString ( ) ) ) { // Only care about random attributes if they are dated final GetDateVisitor visitor = new GetDateVisitor ( ) ; event . accept ( visitor ) ; return "" . equals ( visitor . getDate ( ) ) ; } if ( "Note" . equals ( event . getString ( ) ) ) { // Only care about notes if they are dated final GetDateVisitor visitor = new GetDateVisitor ( ) ; event . accept ( visitor ) ; return "" . equals ( visitor . getDate ( ) ) ; } return "Reference Number" . equals ( event . getString ( ) ) ;
public class SherlockAccountAuthenticatorActivity { /** * Retreives the AccountAuthenticatorResponse from either the intent of the icicle , if the * icicle is non - zero . * @ param icicle the save instance data of this Activity , may be null */ protected void onCreate ( Bundle icicle ) { } }
super . onCreate ( icicle ) ; mAccountAuthenticatorResponse = getIntent ( ) . getParcelableExtra ( AccountManager . KEY_ACCOUNT_AUTHENTICATOR_RESPONSE ) ; if ( mAccountAuthenticatorResponse != null ) { mAccountAuthenticatorResponse . onRequestContinued ( ) ; }
public class QueryBuilder { /** * Starts an INSERT query for a qualified table . */ @ NonNull public static InsertInto insertInto ( @ Nullable CqlIdentifier keyspace , @ NonNull CqlIdentifier table ) { } }
return new DefaultInsert ( keyspace , table ) ;
public class ApiOvhXdsl { /** * Get this object properties * REST : GET / xdsl / email / pro / { email } * @ param email [ required ] The email address if the XDSL Email Pro */ public OvhXdslEmailPro email_pro_email_GET ( String email ) throws IOException { } }
String qPath = "/xdsl/email/pro/{email}" ; StringBuilder sb = path ( qPath , email ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhXdslEmailPro . class ) ;
public class StringUtils { /** * < p > Search a String to find the first index of any * character in the given set of characters . < / p > * < p > A < code > null < / code > String will return < code > - 1 < / code > . * A < code > null < / code > or zero length search array will return < code > - 1 < / code > . < / p > * < pre > * StringUtils . indexOfAny ( null , * ) = - 1 * StringUtils . indexOfAny ( " " , * ) = - 1 * StringUtils . indexOfAny ( * , null ) = - 1 * StringUtils . indexOfAny ( * , [ ] ) = - 1 * StringUtils . indexOfAny ( " zzabyycdxx " , [ ' z ' , ' a ' ] ) = 0 * StringUtils . indexOfAny ( " zzabyycdxx " , [ ' b ' , ' y ' ] ) = 3 * StringUtils . indexOfAny ( " aba " , [ ' z ' ] ) = - 1 * < / pre > * @ param str the String to check , may be null * @ param searchChars the chars to search for , may be null * @ return the index of any of the chars , - 1 if no match or null input * @ since 2.0 */ public static int indexOfAny ( String str , char [ ] searchChars ) { } }
if ( isEmpty ( str ) || ArrayUtils . isEmpty ( searchChars ) ) { return INDEX_NOT_FOUND ; } int csLen = str . length ( ) ; int csLast = csLen - 1 ; int searchLen = searchChars . length ; int searchLast = searchLen - 1 ; for ( int i = 0 ; i < csLen ; i ++ ) { char ch = str . charAt ( i ) ; for ( int j = 0 ; j < searchLen ; j ++ ) { if ( searchChars [ j ] == ch ) { if ( i < csLast && j < searchLast && CharUtils . isHighSurrogate ( ch ) ) { // ch is a supplementary character if ( searchChars [ j + 1 ] == str . charAt ( i + 1 ) ) { return i ; } } else { return i ; } } } } return INDEX_NOT_FOUND ;
public class IterativeStream { /** * Closes the iteration . This method defines the end of the iterative * program part that will be fed back to the start of the iteration . * < p > A common usage pattern for streaming iterations is to use output * splitting to send a part of the closing data stream to the head . Refer to * { @ link DataStream # split ( org . apache . flink . streaming . api . collector . selector . OutputSelector ) } * for more information . * @ param feedbackStream * { @ link DataStream } that will be used as input to the iteration * head . * @ return The feedback stream . */ @ SuppressWarnings ( { } }
"unchecked" , "rawtypes" } ) public DataStream < T > closeWith ( DataStream < T > feedbackStream ) { Collection < StreamTransformation < ? > > predecessors = feedbackStream . getTransformation ( ) . getTransitivePredecessors ( ) ; if ( ! predecessors . contains ( this . transformation ) ) { throw new UnsupportedOperationException ( "Cannot close an iteration with a feedback DataStream that does not originate from said iteration." ) ; } ( ( FeedbackTransformation ) getTransformation ( ) ) . addFeedbackEdge ( feedbackStream . getTransformation ( ) ) ; return feedbackStream ;
public class AnomalyDetectionTransform { /** * Creates an interval for each data point ( after currentIndex ) in the metric * and calculates the anomaly score for that data point using only other data * points in that same interval , i . e . " a moving contextual anomaly score " * @ param predictionDatapoints data points to fill with contextual anomaly scores * @ param completeDatapoints original metric data points * @ param timestamps sorted timestamps of the original metric * @ param currentIndex index at which to start contextual anomaly detection * @ param detectionIntervalInSeconds anomaly detection interval */ private void calculateContextualAnomalyScores ( Map < Long , Double > predictionDatapoints , Map < Long , Double > completeDatapoints , Long [ ] timestamps , int currentIndex , long detectionIntervalInSeconds ) { } }
for ( int i = currentIndex ; i < timestamps . length ; i ++ ) { long timestampAtCurrentIndex = timestamps [ i ] ; long projectedIntervalStartTime = timestampAtCurrentIndex - detectionIntervalInSeconds ; Metric intervalMetric = createIntervalMetric ( i , completeDatapoints , timestamps , projectedIntervalStartTime ) ; List < Metric > intervalRawDataMetrics = new ArrayList < > ( ) ; intervalRawDataMetrics . add ( intervalMetric ) ; // Apply the anomaly detection transform to each interval separately Metric intervalAnomaliesMetric = transform ( null , intervalRawDataMetrics ) . get ( 0 ) ; Map < Long , Double > intervalAnomaliesMetricData = intervalAnomaliesMetric . getDatapoints ( ) ; predictionDatapoints . put ( timestamps [ i ] , intervalAnomaliesMetricData . get ( timestamps [ i ] ) ) ; }
public class ByteBufferOutputStream { /** * Prepend a list of ByteBuffers to this stream . */ public void prepend ( List < ByteBuffer > lists ) { } }
for ( ByteBuffer buffer : lists ) { buffer . position ( buffer . limit ( ) ) ; } buffers . addAll ( 0 , lists ) ;
public class SlidingWindowCounter { /** * Return the current ( total ) counts of all tracked objects , then advance * the window . * Whenever this method is called , we consider the counts of the current * sliding window to be available to and successfully processed " upstream " * ( i . e . by the caller ) . Knowing this we will start counting any subsequent * objects within the next " chunk " of the sliding window . * @ return The current ( total ) counts of all tracked objects . */ public Map < T , Long > getCountsThenAdvanceWindow ( ) { } }
Map < T , Long > counts = objCounter . getCounts ( ) ; objCounter . wipeZeros ( ) ; objCounter . wipeSlot ( tailSlot ) ; advanceHead ( ) ; return counts ;
public class AuditUtils { /** * Creates an audit entry for the ' plan updated ' event . * @ param bean the bean * @ param data the updated data * @ param securityContext the security context * @ return the audit entry */ public static AuditEntryBean planUpdated ( PlanBean bean , EntityUpdatedData data , ISecurityContext securityContext ) { } }
if ( data . getChanges ( ) . isEmpty ( ) ) { return null ; } AuditEntryBean entry = newEntry ( bean . getOrganization ( ) . getId ( ) , AuditEntityType . Plan , securityContext ) ; entry . setEntityId ( bean . getId ( ) ) ; entry . setEntityVersion ( null ) ; entry . setWhat ( AuditEntryType . Update ) ; entry . setData ( toJSON ( data ) ) ; return entry ;
public class Block { /** * Removes the given line from this block . * @ param line * Line to remove . */ public void removeLine ( final Line line ) { } }
if ( line . previous == null ) { this . lines = line . next ; } else { line . previous . next = line . next ; } if ( line . next == null ) { this . lineTail = line . previous ; } else { line . next . previous = line . previous ; } line . previous = line . next = null ;
public class DrawerUIUtils { /** * helper method to get a person placeHolder drawable * @ param ctx * @ return */ public static Drawable getPlaceHolder ( Context ctx ) { } }
return new IconicsDrawable ( ctx , MaterialDrawerFont . Icon . mdf_person ) . colorRes ( R . color . accent ) . backgroundColorRes ( R . color . primary ) . sizeDp ( 56 ) . paddingDp ( 16 ) ;
public class JvmLocationInFileProvider { /** * / * @ Nullable */ @ Override public ITextRegion getTextRegion ( EObject object , RegionDescription query ) { } }
return super . getTextRegion ( convertToSource ( object ) , query ) ;
public class TrainingsImpl { /** * Add the provided images urls to the set of training images . * This API accepts a batch of urls , and optionally tags , to create images . There is a limit of 64 images and 20 tags . * @ param projectId The project id * @ param batch Image urls and tag ids . Limited to 64 images and 20 tags per batch * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the ImageCreateSummary object if successful . */ public ImageCreateSummary createImagesFromUrls ( UUID projectId , ImageUrlCreateBatch batch ) { } }
return createImagesFromUrlsWithServiceResponseAsync ( projectId , batch ) . toBlocking ( ) . single ( ) . body ( ) ;
public class CPDefinitionGroupedEntryUtil { /** * Returns the last cp definition grouped entry in the ordered set where uuid = & # 63 ; . * @ param uuid the uuid * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the last matching cp definition grouped entry , or < code > null < / code > if a matching cp definition grouped entry could not be found */ public static CPDefinitionGroupedEntry fetchByUuid_Last ( String uuid , OrderByComparator < CPDefinitionGroupedEntry > orderByComparator ) { } }
return getPersistence ( ) . fetchByUuid_Last ( uuid , orderByComparator ) ;
public class ClassFile { /** * Add an interface that this class implements . * @ param interfaceName Full interface name . */ public void addInterface ( String interfaceName ) { } }
if ( ! mInterfaceSet . contains ( interfaceName ) ) { mInterfaces . add ( ConstantClassInfo . make ( mCp , interfaceName ) ) ; mInterfaceSet . add ( interfaceName ) ; }
public class FieldDefinition { /** * Add the given FieldDefiniton as a child ( nested field ) of this field . */ private void addNestedField ( FieldDefinition nestedFieldDef ) { } }
// Prerequisites assert nestedFieldDef != null ; assert m_type == FieldType . GROUP ; Utils . require ( ! m_nestedFieldMap . containsKey ( nestedFieldDef . getName ( ) ) , "Duplicate nested field name: %s" , nestedFieldDef . getName ( ) ) ; // Add it to us and point it at us . m_nestedFieldMap . put ( nestedFieldDef . getName ( ) , nestedFieldDef ) ; nestedFieldDef . m_parentField = this ;
public class LinkerDeclarationsManager { /** * Compute and apply all the modifications bring by the modification of the DeclarationFilter . * Find all the Declaration that are now matching the filter and all that are no more matching the filter . * < ul > * < li > Remove all the links of the ones which are no more matching the DeclarationFilter . < / li > * < li > Create the links of the ones which are now matching the DeclarationFilter . < / li > * < / ul > */ public void applyFilterChanges ( Filter declarationFilter ) { } }
this . declarationFilter = declarationFilter ; Set < ServiceReference < D > > added = new HashSet < ServiceReference < D > > ( ) ; Set < ServiceReference < D > > removed = new HashSet < ServiceReference < D > > ( ) ; for ( Map . Entry < ServiceReference < D > , Boolean > e : declarations . entrySet ( ) ) { Map < String , Object > metadata = getDeclaration ( e . getKey ( ) ) . getMetadata ( ) ; boolean matchFilter = declarationFilter . matches ( metadata ) ; if ( matchFilter != e . getValue ( ) && matchFilter ) { added . add ( e . getKey ( ) ) ; } else if ( matchFilter != e . getValue ( ) && ! matchFilter ) { removed . add ( e . getKey ( ) ) ; } e . setValue ( matchFilter ) ; } for ( ServiceReference < D > declarationSRef : removed ) { removeLinks ( declarationSRef ) ; } for ( ServiceReference < D > declarationSRef : added ) { createLinks ( declarationSRef ) ; }
public class RelationalOperations { /** * Returns true if polyline _ a contains polyline _ b . */ private static boolean polylineContainsPolyline_ ( Polyline polyline_a , Polyline polyline_b , double tolerance , ProgressTracker progress_tracker ) { } }
Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; polyline_a . queryEnvelope2D ( env_a ) ; polyline_b . queryEnvelope2D ( env_b ) ; // Quick envelope rejection test for false equality . if ( ! envelopeInfContainsEnvelope_ ( env_a , env_b , tolerance ) ) return false ; // Quick rasterize test to see whether the the geometries are disjoint . if ( tryRasterizedContainsOrDisjoint_ ( polyline_a , polyline_b , tolerance , false ) == Relation . disjoint ) return false ; return linearPathWithinLinearPath_ ( polyline_b , polyline_a , tolerance , false ) ;
public class JvmTypeParameterImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public NotificationChain eInverseAdd ( InternalEObject otherEnd , int featureID , NotificationChain msgs ) { } }
switch ( featureID ) { case TypesPackage . JVM_TYPE_PARAMETER__CONSTRAINTS : return ( ( InternalEList < InternalEObject > ) ( InternalEList < ? > ) getConstraints ( ) ) . basicAdd ( otherEnd , msgs ) ; case TypesPackage . JVM_TYPE_PARAMETER__DECLARATOR : if ( eInternalContainer ( ) != null ) msgs = eBasicRemoveFromContainer ( msgs ) ; return basicSetDeclarator ( ( JvmTypeParameterDeclarator ) otherEnd , msgs ) ; } return super . eInverseAdd ( otherEnd , featureID , msgs ) ;
public class CocoaPodsAnalyzer { /** * Extracts evidence from the contents and adds it to the given evidence * collection . * @ param contents the text to extract evidence from * @ param blockVariable the block variable within the content to search for * @ param fieldPattern the field pattern within the contents to search for * @ return the evidence */ private String determineEvidence ( String contents , String blockVariable , String fieldPattern ) { } }
String value = "" ; // capture array value between [ ] final Matcher arrayMatcher = Pattern . compile ( String . format ( "\\s*?%s\\.%s\\s*?=\\s*?\\{\\s*?(.*?)\\s*?\\}" , blockVariable , fieldPattern ) , Pattern . CASE_INSENSITIVE ) . matcher ( contents ) ; if ( arrayMatcher . find ( ) ) { value = arrayMatcher . group ( 1 ) ; } else { // capture single value between quotes final Matcher matcher = Pattern . compile ( String . format ( "\\s*?%s\\.%s\\s*?=\\s*?(['\"])(.*?)\\1" , blockVariable , fieldPattern ) , Pattern . CASE_INSENSITIVE ) . matcher ( contents ) ; if ( matcher . find ( ) ) { value = matcher . group ( 2 ) ; } } return value ;
public class Client { /** * Sends a CSR to the SCEP server for enrolling in a PKI . * This method enrols the provider < tt > CertificationRequest < / tt > into the * PKI represented by the SCEP server . * @ param identity * the identity of the client . * @ param key * the private key to sign the SCEP request . * @ param csr * the CSR to enrol . * @ return the certificate store returned by the server . * @ throws ClientException * if any client error occurs . * @ throws TransactionException * if there is a problem with the SCEP transaction . * @ see CertStoreInspector */ public EnrollmentResponse enrol ( final X509Certificate identity , final PrivateKey key , final PKCS10CertificationRequest csr ) throws ClientException , TransactionException { } }
return enrol ( identity , key , csr , null ) ;
public class AnalyticsBot { /** * Use this method to specify a url and receive incoming updates via an outgoing webhook . * Whenever there is an update for the bot , an HTTPS POST request to the specified url will be sent , containing a JSON - serialized Update . * In case of an unsuccessful request , it will give up after a reasonable amount of attempts . * You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up . * To use a self - signed certificate , you need to upload your public key certificate using certificate parameter . * Please upload the certificate as InputFile , sending a String will not work . * Ports currently supported for Webhooks : 443 , 80 , 88 , 8443. * @ param url HTTPS url to send updates to . Use an empty string to remove webhook integration * @ param certificate Upload your public key certificate so that the root certificate in use can be checked . See our self - signed guide for details . * @ return An array of Update objects is returned . Returns an empty array if there aren ' t any updates . * @ throws IOException an exception is thrown in case of any service call failures */ @ Override public boolean setWebhook ( String url , InputFile certificate ) throws IOException { } }
AnalyticsData data = new AnalyticsData ( "setWebhook" ) ; IOException ioException = null ; boolean returned = false ; data . setValue ( "url" , url ) ; data . setValue ( "certificate" , certificate ) ; try { returned = bot . setWebhook ( url , certificate ) ; data . setReturned ( returned ) ; } catch ( IOException e ) { ioException = e ; data . setIoException ( ioException ) ; } analyticsWorker . putData ( data ) ; if ( ioException != null ) { throw ioException ; } return returned ;
public class MathTools { /** * Analog of Math . max that returns the largest double value in an array of doubles . * @ param values the values to be searched for the largest value among them * @ return the largest value among a set of given values */ static double max ( double [ ] values ) { } }
double max = values [ 0 ] ; for ( double value : values ) if ( value > max ) max = value ; return max ;
public class InjectionUtils { /** * Inject JNRPE code inside the passed in plugin . * The annotation is searched in the whole hierarchy . * @ param plugin plugin to be injected * @ param context the jnrpe context */ @ SuppressWarnings ( "rawtypes" ) public static void inject ( final IPluginInterface plugin , final IJNRPEExecutionContext context ) { } }
try { Class clazz = plugin . getClass ( ) ; inject ( clazz , plugin , context ) ; while ( IPluginInterface . class . isAssignableFrom ( clazz . getSuperclass ( ) ) ) { clazz = clazz . getSuperclass ( ) ; inject ( clazz , plugin , context ) ; } } catch ( Exception e ) { throw new Error ( e . getMessage ( ) , e ) ; }
public class Math { /** * Kullback - Leibler divergence . The Kullback - Leibler divergence ( also * information divergence , information gain , relative entropy , or KLIC ) * is a non - symmetric measure of the difference between two probability * distributions P and Q . KL measures the expected number of extra bits * required to code samples from P when using a code based on Q , rather * than using a code based on P . Typically P represents the " true " * distribution of data , observations , or a precise calculated theoretical * distribution . The measure Q typically represents a theory , model , * description , or approximation of P . * Although it is often intuited as a distance metric , the KL divergence is * not a true metric - for example , the KL from P to Q is not necessarily * the same as the KL from Q to P . */ public static double KullbackLeiblerDivergence ( SparseArray x , SparseArray y ) { } }
if ( x . isEmpty ( ) ) { throw new IllegalArgumentException ( "List x is empty." ) ; } if ( y . isEmpty ( ) ) { throw new IllegalArgumentException ( "List y is empty." ) ; } Iterator < SparseArray . Entry > iterX = x . iterator ( ) ; Iterator < SparseArray . Entry > iterY = y . iterator ( ) ; SparseArray . Entry a = iterX . hasNext ( ) ? iterX . next ( ) : null ; SparseArray . Entry b = iterY . hasNext ( ) ? iterY . next ( ) : null ; boolean intersection = false ; double kl = 0.0 ; while ( a != null && b != null ) { if ( a . i < b . i ) { a = iterX . hasNext ( ) ? iterX . next ( ) : null ; } else if ( a . i > b . i ) { b = iterY . hasNext ( ) ? iterY . next ( ) : null ; } else { intersection = true ; kl += a . x * Math . log ( a . x / b . x ) ; a = iterX . hasNext ( ) ? iterX . next ( ) : null ; b = iterY . hasNext ( ) ? iterY . next ( ) : null ; } } if ( intersection ) { return kl ; } else { return Double . POSITIVE_INFINITY ; }
public class DoubleIntIndex { /** * Adds a pair , ensuring no duplicate key xor value already exists in the * current search target column . * @ param key the key * @ param value the value * @ return true or false depending on success */ public synchronized boolean addUnique ( int key , int value ) { } }
if ( count == capacity ) { if ( fixedSize ) { return false ; } else { doubleCapacity ( ) ; } } if ( ! sorted ) { fastQuickSort ( ) ; } targetSearchValue = sortOnValues ? value : key ; int i = binaryEmptySlotSearch ( ) ; if ( i == - 1 ) { return false ; } hasChanged = true ; if ( count != i ) { moveRows ( i , i + 1 , count - i ) ; } keys [ i ] = key ; values [ i ] = value ; count ++ ; return true ;
public class RowServiceSkinny { /** * { @ inheritDoc } */ @ Override public void indexInner ( ByteBuffer key , ColumnFamily columnFamily , long timestamp ) { } }
DecoratedKey partitionKey = rowMapper . partitionKey ( key ) ; if ( columnFamily . iterator ( ) . hasNext ( ) ) // Create or update row { Row row = row ( partitionKey , timestamp ) ; // Read row Document document = rowMapper . document ( row ) ; Term term = rowMapper . term ( partitionKey ) ; luceneIndex . upsert ( term , document ) ; // Store document } else if ( columnFamily . deletionInfo ( ) != null ) // Delete full row { Term term = rowMapper . term ( partitionKey ) ; luceneIndex . delete ( term ) ; }
public class VCalAlarmPropertyScribe { /** * Converts an instance of a vCal alarm property into a { @ link VAlarm } * component . * @ param property the property to convert * @ return the component */ protected VAlarm toVAlarm ( T property ) { } }
Trigger trigger = new Trigger ( property . getStart ( ) ) ; VAlarm valarm = new VAlarm ( action ( ) , trigger ) ; valarm . setDuration ( property . getSnooze ( ) ) ; valarm . setRepeat ( property . getRepeat ( ) ) ; toVAlarm ( valarm , property ) ; return valarm ;
public class JKTableRecord { public double getColumnValueAsDouble ( final int col ) { } }
final Object value = getColumnValue ( col ) ; if ( value == null ) { return 0 ; } return new Double ( value . toString ( ) ) ;
public class BoxesRunTime { /** * / * UNBOXING . . . UNBOXING . . . UNBOXING . . . UNBOXING . . . UNBOXING . . . UNBOXING . . . UNBOXING */ public static boolean unboxToBoolean ( Object b ) { } }
return b == null ? false : ( ( java . lang . Boolean ) b ) . booleanValue ( ) ;
public class HOSECodeGenerator { /** * Produces a HOSE code for Atom < code > root < / code > in the { @ link IAtomContainer } < code > ac < / code > . The HOSE * code is produced for the number of spheres given by < code > noOfSpheres < / code > . * IMPORTANT : if you want aromaticity to be included in the code , you need * to run the IAtomContainer < code > ac < / code > to the { @ link org . openscience . cdk . aromaticity . CDKHueckelAromaticityDetector } prior to * using < code > getHOSECode ( ) < / code > . This method only gives proper results if the molecule is * fully saturated ( if not , the order of the HOSE code might depend on atoms in higher spheres ) . * This method is known to fail for protons sometimes . * IMPORTANT : Your molecule must contain implicit or explicit hydrogens * for this method to work properly . * @ param ac The { @ link IAtomContainer } with the molecular skeleton in which the root atom resides * @ param root The root atom for which to produce the HOSE code * @ param noOfSpheres The number of spheres to look at * @ return The HOSECode value * @ exception org . openscience . cdk . exception . CDKException Thrown if something is wrong */ public String getHOSECode ( IAtomContainer ac , IAtom root , int noOfSpheres ) throws CDKException { } }
return getHOSECode ( ac , root , noOfSpheres , false ) ;
public class LIBSVMLoader { /** * Loads a new regression data set from a LIBSVM file , assuming the label is * a numeric target value to predict * @ param file the file to load * @ param sparseRatio the fraction of non zero values to qualify a data * point as sparse * @ return a regression data set * @ throws FileNotFoundException if the file was not found * @ throws IOException if an error occurred reading the input stream */ public static RegressionDataSet loadR ( File file , double sparseRatio ) throws FileNotFoundException , IOException { } }
return loadR ( file , sparseRatio , - 1 ) ;
public class HadoopJobUtils { /** * < pre > * Uses YarnClient to kill the job on HDFS . * Using JobClient only works partially : * If yarn container has started but spark job haven ' t , it will kill * If spark job has started , the cancel will hang until the spark job is complete * If the spark job is complete , it will return immediately , with a job not found on job tracker * < / pre > */ public static void killJobOnCluster ( String applicationId , Logger log ) throws YarnException , IOException { } }
YarnConfiguration yarnConf = new YarnConfiguration ( ) ; YarnClient yarnClient = YarnClient . createYarnClient ( ) ; yarnClient . init ( yarnConf ) ; yarnClient . start ( ) ; String [ ] split = applicationId . split ( "_" ) ; ApplicationId aid = ApplicationId . newInstance ( Long . parseLong ( split [ 1 ] ) , Integer . parseInt ( split [ 2 ] ) ) ; log . info ( "start klling application: " + aid ) ; yarnClient . killApplication ( aid ) ; log . info ( "successfully killed application: " + aid ) ;
public class LogFactory { /** * Returns a string that uniquely identifies the specified object , including * its class . * The returned string is of form " classname @ hashcode " , i . e . is the same as the * return value of the Object . toString ( ) method , but works even when the * specified object ' s class has overridden the toString method . * @ param o * may be null . * @ return a string of form classname @ hashcode , or " null " if param o is null . * @ since 1.1 */ public static String objectId ( Object o ) { } }
if ( o == null ) { return "null" ; } else { return o . getClass ( ) . getName ( ) + "@" + System . identityHashCode ( o ) ; }
public class ResourcesInner { /** * Updates a resource . * @ param resourceGroupName The name of the resource group for the resource . The name is case insensitive . * @ param resourceProviderNamespace The namespace of the resource provider . * @ param parentResourcePath The parent resource identity . * @ param resourceType The resource type of the resource to update . * @ param resourceName The name of the resource to update . * @ param apiVersion The API version to use for the operation . * @ param parameters Parameters for updating the resource . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the GenericResourceInner object */ public Observable < ServiceResponse < GenericResourceInner > > beginUpdateWithServiceResponseAsync ( String resourceGroupName , String resourceProviderNamespace , String parentResourcePath , String resourceType , String resourceName , String apiVersion , GenericResourceInner parameters ) { } }
if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( resourceProviderNamespace == null ) { throw new IllegalArgumentException ( "Parameter resourceProviderNamespace is required and cannot be null." ) ; } if ( parentResourcePath == null ) { throw new IllegalArgumentException ( "Parameter parentResourcePath is required and cannot be null." ) ; } if ( resourceType == null ) { throw new IllegalArgumentException ( "Parameter resourceType is required and cannot be null." ) ; } if ( resourceName == null ) { throw new IllegalArgumentException ( "Parameter resourceName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( apiVersion == null ) { throw new IllegalArgumentException ( "Parameter apiVersion is required and cannot be null." ) ; } if ( parameters == null ) { throw new IllegalArgumentException ( "Parameter parameters is required and cannot be null." ) ; } Validator . validate ( parameters ) ; return service . beginUpdate ( resourceGroupName , resourceProviderNamespace , parentResourcePath , resourceType , resourceName , this . client . subscriptionId ( ) , apiVersion , parameters , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < GenericResourceInner > > > ( ) { @ Override public Observable < ServiceResponse < GenericResourceInner > > call ( Response < ResponseBody > response ) { try { ServiceResponse < GenericResourceInner > clientResponse = beginUpdateDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class DiGraph { /** * Returns the set of all vertices from < code > this < / code > * digraph : vertices that are ( trasitively and reflexively ) * reachable from the root vertices by following the forward arcs * provided by the navigator . * < p > The returned set is unmodifiable and has a deterministic * iteration order ( it ' s based on a < code > LinkedHashSet < / code > ) . * Moreover , if the following conditions are met , different calls * to < code > vertices ( ) < / code > return equal sets of vertices , with * the same deterministic iteration order ; here are the * conditions : ( 1 ) the navigator and the set of graph roots do * not change , ( 2 ) for each node , the forward graph navigator * always returns the same list of neighbors ( instead of * re - arragements of them ) , ( 3 ) the set of roots has a * deterministic iteration order . */ public Set < Vertex > vertices ( ) { } }
if ( CACHING && ( cachedVertices != null ) ) return cachedVertices ; Set < Vertex > vertices = Collections . unmodifiableSet ( transitiveSucc ( getRoots ( ) ) ) ; if ( CACHING ) { cachedVertices = vertices ; } return vertices ;
public class CLIRegisterer { /** * Finds a resolved method annotated with { @ link CLIResolver } . */ private Method findResolver ( Class type ) throws IOException { } }
List < Method > resolvers = Util . filter ( Index . list ( CLIResolver . class , Jenkins . get ( ) . getPluginManager ( ) . uberClassLoader ) , Method . class ) ; for ( ; type != null ; type = type . getSuperclass ( ) ) for ( Method m : resolvers ) if ( m . getReturnType ( ) == type ) return m ; return null ;
public class RawRequest { /** * Set a query parameter value for the underlying HTTP request . * Query parameters set with this method will be merged with query * parameters found in the configured { @ link SdkRequestConfig } . * @ param name The name of the header . * @ param value The value of the header . * @ return This object for method chaining . */ public RawRequest queryParameter ( String name , String value ) { } }
queryParameters . computeIfAbsent ( name , k -> new ArrayList < > ( ) ) ; queryParameters . get ( name ) . add ( value ) ; setRequestConfigDirty ( ) ; return this ;
public class ValueEnforcer { /** * Check if * < code > nValue & gt ; nLowerBoundInclusive & amp ; & amp ; nValue & lt ; nUpperBoundInclusive < / code > * @ param nValue * Value * @ param aName * Name * @ param nLowerBoundExclusive * Lower bound * @ param nUpperBoundExclusive * Upper bound * @ return The value */ public static long isBetweenExclusive ( final long nValue , @ Nonnull final Supplier < ? extends String > aName , final long nLowerBoundExclusive , final long nUpperBoundExclusive ) { } }
if ( isEnabled ( ) ) if ( nValue <= nLowerBoundExclusive || nValue >= nUpperBoundExclusive ) throw new IllegalArgumentException ( "The value of '" + aName . get ( ) + "' must be > " + nLowerBoundExclusive + " and < " + nUpperBoundExclusive + "! The current value is: " + nValue ) ; return nValue ;
public class SecondsBasedEntryTaskScheduler { /** * Removes the entry if it exists from being scheduled to be evicted . * Cleans up parent container ( second - > entries map ) if it doesn ' t hold anymore items this second . * Cancels associated scheduler ( second - > scheduler map ) if there are no more items to remove for this second . * Returns associated scheduled entry . * @ param second second at which this entry was scheduled to be evicted * @ param entries entries which were already scheduled to be evicted for this second * @ param key entry key * @ param entryToRemove entry value that is expected to exist in the map * @ return true if entryToRemove exists in the map and removed */ private boolean cancelAndCleanUpIfEmpty ( Integer second , Map < Object , ScheduledEntry < K , V > > entries , Object key , ScheduledEntry < K , V > entryToRemove ) { } }
ScheduledEntry < K , V > entry = entries . get ( key ) ; if ( entry == null || ! entry . equals ( entryToRemove ) ) { return false ; } entries . remove ( key ) ; cleanUpScheduledFuturesIfEmpty ( second , entries ) ; return true ;
public class SQLiteModelMethod { /** * Builds the prepared statement name . * @ return the string */ public String buildPreparedStatementName ( ) { } }
if ( ! StringUtils . hasText ( preparedStatementName ) ) { preparedStatementName = getParent ( ) . buildPreparedStatementName ( getName ( ) ) ; } return preparedStatementName ;