signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class InterceptorService { /** * Only call this when assertions are enabled , it ' s expensive */ boolean haveAppropriateParams ( Pointcut thePointcut , HookParams theParams ) { } }
Validate . isTrue ( theParams . getParamsForType ( ) . values ( ) . size ( ) == thePointcut . getParameterTypes ( ) . size ( ) , "Wrong number of params for pointcut %s - Wanted %s but found %s" , thePointcut . name ( ) , toErrorString ( thePointcut . getParameterTypes ( ) ) , theParams . getParamsForType ( ) . values ( ) . stream ( ) . map ( t -> t != null ? t . getClass ( ) . getSimpleName ( ) : "null" ) . sorted ( ) . collect ( Collectors . toList ( ) ) ) ; List < String > wantedTypes = new ArrayList < > ( thePointcut . getParameterTypes ( ) ) ; ListMultimap < Class < ? > , Object > givenTypes = theParams . getParamsForType ( ) ; for ( Class < ? > nextTypeClass : givenTypes . keySet ( ) ) { String nextTypeName = nextTypeClass . getName ( ) ; for ( Object nextParamValue : givenTypes . get ( nextTypeClass ) ) { Validate . isTrue ( nextParamValue == null || nextTypeClass . isAssignableFrom ( nextParamValue . getClass ( ) ) , "Invalid params for pointcut %s - %s is not of type %s" , thePointcut . name ( ) , nextParamValue != null ? nextParamValue . getClass ( ) : "null" , nextTypeClass ) ; Validate . isTrue ( wantedTypes . remove ( nextTypeName ) , "Invalid params for pointcut %s - Wanted %s but found %s" , thePointcut . name ( ) , toErrorString ( thePointcut . getParameterTypes ( ) ) , nextTypeName ) ; } } return true ;
public class ConnecClient { /** * Fetch an entity by id * @ param entity * name * @ param groupId * customer group id * @ param entityId * id of the entity to retrieve * @ return entity * @ throws MnoException */ public Map < String , Object > retrieve ( String entityName , String groupId , String entityId ) throws MnoException { } }
return retrieve ( entityName , groupId , entityId , getAuthenticatedClient ( ) ) ;
public class Predicates { /** * Creates a { @ link Predicate } that returns { @ code true } for any string that matches the * specified regular expression . * @ param regex * The pattern * @ return { @ code true } for any string that matches its given regular expression */ public static Predicate < String > matchesRegex ( final String regex ) { } }
final Pattern pattern = Pattern . compile ( regex ) ; return matchesRegex ( pattern ) ;
public class FaceletCompositionContextImpl { /** * Remove the last component level from the components marked to be deleted . The components are removed * from this list because they are deleted from the tree . This is done in ComponentSupport . finalizeForDeletion . * @ return the array of components that are removed . */ private void decreaseComponentLevelMarkedForDeletion ( ) { } }
// The common case is this co if ( ! _componentsMarkedForDeletion . get ( _deletionLevel ) . isEmpty ( ) ) { _componentsMarkedForDeletion . get ( _deletionLevel ) . clear ( ) ; } _deletionLevel -- ;
public class CPOptionUtil { /** * Returns all the cp options where uuid = & # 63 ; and companyId = & # 63 ; . * @ param uuid the uuid * @ param companyId the company ID * @ return the matching cp options */ public static List < CPOption > findByUuid_C ( String uuid , long companyId ) { } }
return getPersistence ( ) . findByUuid_C ( uuid , companyId ) ;
public class UserBS { /** * Requisição do usuário para recuperar a senha . * @ param user * Usuário para recuperar a senha . * @ return UserRecoverRequest Requisição relizada . */ public UserRecoverRequest requestRecover ( User user ) { } }
if ( user == null ) return null ; UserRecoverRequest req = new UserRecoverRequest ( ) ; req . setUser ( user ) ; req . setCreation ( new Date ( ) ) ; req . setCreationIp ( this . request . getRemoteAddr ( ) ) ; req . setExpiration ( new Date ( System . currentTimeMillis ( ) + 1800000L ) ) ; req . setToken ( CryptManager . digest ( Math . random ( ) + "@" + System . currentTimeMillis ( ) + "#" + user . getEmail ( ) ) ) ; this . dao . persist ( req ) ; // TODO Send the recovering email . return req ;
public class InternalXbaseParser { /** * InternalXbase . g : 1317:1 : ruleXNullLiteral : ( ( rule _ _ XNullLiteral _ _ Group _ _ 0 ) ) ; */ public final void ruleXNullLiteral ( ) throws RecognitionException { } }
int stackSize = keepStackSize ( ) ; try { // InternalXbase . g : 1321:2 : ( ( ( rule _ _ XNullLiteral _ _ Group _ _ 0 ) ) ) // InternalXbase . g : 1322:2 : ( ( rule _ _ XNullLiteral _ _ Group _ _ 0 ) ) { // InternalXbase . g : 1322:2 : ( ( rule _ _ XNullLiteral _ _ Group _ _ 0 ) ) // InternalXbase . g : 1323:3 : ( rule _ _ XNullLiteral _ _ Group _ _ 0 ) { if ( state . backtracking == 0 ) { before ( grammarAccess . getXNullLiteralAccess ( ) . getGroup ( ) ) ; } // InternalXbase . g : 1324:3 : ( rule _ _ XNullLiteral _ _ Group _ _ 0 ) // InternalXbase . g : 1324:4 : rule _ _ XNullLiteral _ _ Group _ _ 0 { pushFollow ( FOLLOW_2 ) ; rule__XNullLiteral__Group__0 ( ) ; state . _fsp -- ; if ( state . failed ) return ; } if ( state . backtracking == 0 ) { after ( grammarAccess . getXNullLiteralAccess ( ) . getGroup ( ) ) ; } } } } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; } finally { restoreStackSize ( stackSize ) ; } return ;
public class GenericCollectionTypeResolver { /** * Determine the generic element type of the given Collection field . * @ param collectionField the collection field to introspect * @ param nestingLevel the nesting level of the target type * ( typically 1 ; e . g . in case of a List of Lists , 1 would indicate the * nested List , whereas 2 would indicate the element of the nested List ) * @ return the generic type , or { @ code null } if none */ public static Class < ? > getCollectionFieldType ( Field collectionField , int nestingLevel ) { } }
return ResolvableType . forField ( collectionField ) . getNested ( nestingLevel ) . asCollection ( ) . resolveGeneric ( ) ;
public class FileManagerImpl { /** * / * Read block sizes from cached area on disk */ private void read_block_sizes_from_cache ( long cache_end ) throws IOException { } }
int block_size ; long block_address ; ByteArrayInputStream bis ; byte [ ] buf ; long cache_cursor ; DataInputStream dis ; int list_index ; buf = new byte [ ( int ) ( cache_end - tail_ptr ) ] ; seek ( tail_ptr ) ; read ( buf ) ; bis = new ByteArrayInputStream ( buf ) ; dis = new DataInputStream ( bis ) ; allocated_blocks = dis . readLong ( ) ; allocated_words = dis . readLong ( ) ; free_blocks = 0 ; free_words = 0 ; cache_cursor = tail_ptr + ( 2 * LONG_SIZE ) ; while ( cache_cursor < cache_end ) { list_index = dis . readInt ( ) ; block_address = dis . readLong ( ) ; cache_cursor += INT_SIZE + PTR_SIZE ; while ( block_address != DISK_NULL ) { block_size = dis . readInt ( ) ; add_new_block_to_freelist ( block_address , block_size , list_index ) ; block_address = dis . readLong ( ) ; cache_cursor += INT_SIZE + PTR_SIZE ; } } dis . close ( ) ; bis . close ( ) ; if ( ! readOnly ) { seek ( CACHE_END ) ; writeLong ( DISK_NULL ) ; } fast_startups ++ ;
public class ServerAddress { /** * Resolves a hostname . If the hostname is a loopback address ( e . g . 127.0.0.1 or localhost ) , it * will be converted to the fully - qualified domain - name of the local address . If the hostname is * < em > not < / em > a loopback address , the original hostName parameter will be returned , unchanged . * @ param hostName the hostname to be resolved . * @ return < code > String < / code > the resolved hostname . */ public static String resolveHostName ( String hostName ) { } }
Boolean knownLoopback = null ; try { knownLoopback = InetAddress . getByName ( hostName ) . isLoopbackAddress ( ) ; } catch ( UnknownHostException ex ) { knownLoopback = ( hostName . equals ( "127.0.0.1" ) || hostName . equals ( "localhost" ) ) ; } if ( knownLoopback ) { try { return InetAddress . getLocalHost ( ) . getCanonicalHostName ( ) ; } catch ( UnknownHostException ex ) { Logger . getLogger ( ServerAddress . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } } return hostName ;
public class ExtensionScript { /** * This extension supports any number of writers to be registered which all get written to for * ever script . It also supports script specific writers . */ private Writer getWriters ( ScriptWrapper script ) { } }
Writer delegatee = this . writers ; Writer writer = script . getWriter ( ) ; if ( writer != null ) { // Use the script specific writer in addition to the std one MultipleWriters scriptWriters = new MultipleWriters ( ) ; scriptWriters . addWriter ( writer ) ; scriptWriters . addWriter ( writers ) ; delegatee = scriptWriters ; } return new ScriptWriter ( script , delegatee , outputListeners ) ;
public class MultiGetOperationImpl { /** * Add a key ( and return its new opaque value ) . */ protected int addKey ( String k ) { } }
Integer rv = rkeys . get ( k ) ; if ( rv == null ) { rv = generateOpaque ( ) ; keys . put ( rv , k ) ; bkeys . put ( rv , KeyUtil . getKeyBytes ( k ) ) ; rkeys . put ( k , rv ) ; synchronized ( vbmap ) { vbmap . put ( k , new Short ( ( short ) 0 ) ) ; } } return rv ;
public class EventConsumerUtil { public static boolean isZmqLoadable ( ) { } }
if ( ! zmqTested ) { String zmqEnable = System . getenv ( "ZMQ_DISABLE" ) ; if ( zmqEnable == null ) zmqEnable = System . getProperty ( "ZMQ_DISABLE" ) ; if ( zmqEnable == null || ! zmqEnable . equals ( "true" ) ) { try { ZMQutils . getInstance ( ) ; System . out . println ( "========== ZMQ (" + ZMQutils . getZmqVersion ( ) + ") event system is available ============" ) ; } catch ( UnsatisfiedLinkError | NoClassDefFoundError error ) { System . err . println ( "======================================================================" ) ; System . err . println ( " " + error ) ; System . err . println ( " Event system will be available only for notifd notification system " ) ; System . err . println ( "======================================================================" ) ; zmqLoadable = false ; } } else { System . err . println ( "======================================================================" ) ; System . err . println ( " ZMQ event system not enabled" ) ; System . err . println ( " Event system will be available only for notifd notification system " ) ; System . err . println ( "======================================================================" ) ; zmqLoadable = false ; } zmqTested = true ; } return zmqLoadable ;
public class CacheConfig { /** * Read config objects stored in JSON format from < code > String < / code > * @ param content of config * @ return config * @ throws IOException error */ public static Map < String , ? extends CacheConfig > fromJSON ( String content ) throws IOException { } }
return new CacheConfigSupport ( ) . fromJSON ( content ) ;
public class ImportSet { /** * Replaces inner class imports ( those with a ' $ ' ) with an import of the parent class . */ public void swapInnerClassesForParents ( ) { } }
ImportSet declarers = new ImportSet ( ) ; Iterator < String > i = _imports . iterator ( ) ; while ( i . hasNext ( ) ) { String name = i . next ( ) ; int dollar = name . indexOf ( '$' ) ; if ( dollar >= 0 ) { i . remove ( ) ; declarers . add ( name . substring ( 0 , dollar ) ) ; } } addAll ( declarers ) ;
public class AbstractRegisteredControlAdapter { /** * / * ( non - Javadoc ) * @ see com . ibm . ws . sib . processor . runtime . ControlAdapter # runtimeEventOccurred ( com . ibm . ws . sib . admin . RuntimeEvent ) */ public synchronized void runtimeEventOccurred ( RuntimeEvent event ) { } }
if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "runtimeEventOccurred" , new Object [ ] { event , this } ) ; if ( _isRegistered ) { // Check that we have a RuntimeEventListener if ( _runtimeEventListener != null ) { // Fire a Notification if Eventing is enabled if ( _messageProcessor . getMessagingEngine ( ) . isEventNotificationEnabled ( ) ) { // Fire the event - - - - This is not needed as of now in liberty release // _ runtimeEventListener . // runtimeEventOccurred ( _ messageProcessor . // getMessagingEngine ( ) , // event . getType ( ) , // event . getMessage ( ) , // ( Properties ) event . getUserData ( ) ) ; } else { if ( tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Eventing is disabled, cannot fire event" ) ; } } else { if ( tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Null RuntimeEventListener, cannot fire event" ) ; } } else { if ( tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Not registered, cannot fire event" ) ; } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "runtimeEventOccurred" ) ;
public class AmazonElasticTranscoderClient { /** * The ReadJob operation returns detailed information about a job . * @ param readJobRequest * The < code > ReadJobRequest < / code > structure . * @ return Result of the ReadJob operation returned by the service . * @ throws ValidationException * One or more required parameter values were not provided in the request . * @ throws IncompatibleVersionException * @ throws ResourceNotFoundException * The requested resource does not exist or is not available . For example , the pipeline to which you ' re * trying to add a job doesn ' t exist or is still being created . * @ throws AccessDeniedException * General authentication failure . The request was not signed correctly . * @ throws InternalServiceException * Elastic Transcoder encountered an unexpected exception while trying to fulfill the request . * @ sample AmazonElasticTranscoder . ReadJob */ @ Override public ReadJobResult readJob ( ReadJobRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeReadJob ( request ) ;
public class KnapsackDecorator { /** * remove all candidate items from a bin that is full * then synchronize potentialLoad and sup ( binLoad ) accordingly * if an item becomes instantiated then propagate the newly assigned bin * @ param bin the full bin * @ throws ContradictionException */ @ SuppressWarnings ( "squid:S3346" ) private void filterFullDim ( int bin , int dim ) throws ContradictionException { } }
for ( int i = candidate . get ( bin ) . nextSetBit ( 0 ) ; i >= 0 ; i = candidate . get ( bin ) . nextSetBit ( i + 1 ) ) { if ( prop . iSizes [ dim ] [ i ] == 0 ) { continue ; } // ISSUE 86 : the event ' i removed from bin ' can already been in the propagation stack but not yet considered // ie . ! prop . bins [ i ] . contains ( bin ) & & candidate [ bin ] . contains ( i ) : in this case , do not process it yet if ( prop . bins [ i ] . removeValue ( bin , prop ) ) { candidate . get ( bin ) . clear ( i ) ; prop . updateLoads ( i , bin ) ; if ( prop . bins [ i ] . isInstantiated ( ) ) { prop . assignItem ( i , prop . bins [ i ] . getValue ( ) ) ; } } } if ( candidate . get ( bin ) . isEmpty ( ) ) { assert prop . potentialLoad [ dim ] [ bin ] . get ( ) == prop . assignedLoad [ dim ] [ bin ] . get ( ) ; assert prop . loads [ dim ] [ bin ] . getUB ( ) == prop . potentialLoad [ dim ] [ bin ] . get ( ) ; }
public class BufferUtils { /** * Creates a buffer for the given number of elements and * native byte ordering * @ param elements The number of elements in the buffer * @ return The buffer */ public static FloatBuffer createFloatBuffer ( int elements ) { } }
ByteBuffer byteBuffer = ByteBuffer . allocateDirect ( elements * 4 ) ; byteBuffer . order ( ByteOrder . nativeOrder ( ) ) ; return byteBuffer . asFloatBuffer ( ) ;
public class MeasureUnitUtil { /** * Convert the given value expressed in meters per second to the given unit . * @ param value is the value to convert * @ param outputUnit is the unit of result . * @ return the result of the convertion . */ @ Pure public static double fromMetersPerSecond ( double value , SpeedUnit outputUnit ) { } }
switch ( outputUnit ) { case KILOMETERS_PER_HOUR : return value / 3.6 ; case MILLIMETERS_PER_SECOND : return value * 1000. ; case METERS_PER_SECOND : default : } return value ;
public class PageInBrowserStats { /** * Returns the average DOM load time for given interval and { @ link TimeUnit } . * @ param intervalName name of the interval * @ param unit { @ link TimeUnit } * @ return average DOM load time */ public double getAverageDOMLoadTime ( final String intervalName , final TimeUnit unit ) { } }
return unit . transformMillis ( totalDomLoadTime . getValueAsLong ( intervalName ) ) / numberOfLoads . getValueAsDouble ( intervalName ) ;
public class ChineseDateFormat { /** * { @ inheritDoc } * @ deprecated ICU 50 */ @ Deprecated @ Override protected int subParse ( String text , int start , char ch , int count , boolean obeyCount , boolean allowNegative , boolean [ ] ambiguousYear , Calendar cal ) { } }
// Logic to handle numeric ' G ' eras for chinese calendar , and to skip special 2 - digit year // handling for chinese calendar , is moved into SimpleDateFormat , so delete here . // Obsolete pattern char ' l ' is now ignored for parsing in SimpleDateFormat , no handling // needed here . // So just use SimpleDateFormat implementation for this . // just use its implementation return super . subParse ( text , start , ch , count , obeyCount , allowNegative , ambiguousYear , cal ) ;
public class StartDocumentClassificationJobRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( StartDocumentClassificationJobRequest startDocumentClassificationJobRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( startDocumentClassificationJobRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( startDocumentClassificationJobRequest . getJobName ( ) , JOBNAME_BINDING ) ; protocolMarshaller . marshall ( startDocumentClassificationJobRequest . getDocumentClassifierArn ( ) , DOCUMENTCLASSIFIERARN_BINDING ) ; protocolMarshaller . marshall ( startDocumentClassificationJobRequest . getInputDataConfig ( ) , INPUTDATACONFIG_BINDING ) ; protocolMarshaller . marshall ( startDocumentClassificationJobRequest . getOutputDataConfig ( ) , OUTPUTDATACONFIG_BINDING ) ; protocolMarshaller . marshall ( startDocumentClassificationJobRequest . getDataAccessRoleArn ( ) , DATAACCESSROLEARN_BINDING ) ; protocolMarshaller . marshall ( startDocumentClassificationJobRequest . getClientRequestToken ( ) , CLIENTREQUESTTOKEN_BINDING ) ; protocolMarshaller . marshall ( startDocumentClassificationJobRequest . getVolumeKmsKeyId ( ) , VOLUMEKMSKEYID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class GqSessionFactoryImpl { /** * / * ( non - Javadoc ) * @ see org . jdiameter . api . auth . ServerAuthSessionListener # doAuthRequestEvent ( org . jdiameter . api . auth . ServerAuthSession , org . jdiameter . api . app . AppRequestEvent ) */ @ Override public void doAuthRequestEvent ( ServerAuthSession appSession , AppRequestEvent request ) throws InternalException , IllegalDiameterStateException , RouteException , OverloadException { } }
logger . info ( "Diameter Gq AuthorizationSessionFactory :: doAuthRequestEvent :: appSession[{}], Request[{}]" , appSession , request ) ;
public class NetworkInterfaceTapConfigurationsInner { /** * Get the specified tap configuration on a network interface . * @ param resourceGroupName The name of the resource group . * @ param networkInterfaceName The name of the network interface . * @ param tapConfigurationName The name of the tap configuration . * @ 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 NetworkInterfaceTapConfigurationInner object if successful . */ public NetworkInterfaceTapConfigurationInner get ( String resourceGroupName , String networkInterfaceName , String tapConfigurationName ) { } }
return getWithServiceResponseAsync ( resourceGroupName , networkInterfaceName , tapConfigurationName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class RunIdMigrator { /** * Delete the record of a build . * @ param dir as in { @ link Job # getBuildDir } * @ param id a { @ link Run # getId } */ public synchronized void delete ( File dir , String id ) { } }
if ( idToNumber . remove ( id ) != null ) { save ( dir ) ; }
public class AccountsInner { /** * Updates the specified Data Lake Store account information . * @ param resourceGroupName The name of the Azure resource group . * @ param accountName The name of the Data Lake Store account . * @ param parameters Parameters supplied to update the Data Lake Store account . * @ 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 DataLakeStoreAccountInner object if successful . */ public DataLakeStoreAccountInner update ( String resourceGroupName , String accountName , UpdateDataLakeStoreAccountParameters parameters ) { } }
return updateWithServiceResponseAsync ( resourceGroupName , accountName , parameters ) . toBlocking ( ) . last ( ) . body ( ) ;
public class ThreadContextBuilderImpl { /** * Fail with error identifying unknown context type ( s ) that were specified . * @ param unknown set of unknown context types ( s ) that were specified . * @ param contextProviders */ static void failOnUnknownContextTypes ( HashSet < String > unknown , ArrayList < ThreadContextProvider > contextProviders ) { } }
Set < String > known = new TreeSet < > ( ) ; // alphabetize for readability of message known . addAll ( Arrays . asList ( ThreadContext . ALL_REMAINING , ThreadContext . APPLICATION , ThreadContext . CDI , ThreadContext . SECURITY , ThreadContext . TRANSACTION ) ) ; for ( ThreadContextProvider provider : contextProviders ) { String contextType = provider . getThreadContextType ( ) ; known . add ( contextType ) ; } throw new IllegalStateException ( Tr . formatMessage ( tc , "CWWKC1155.unknown.context" , new TreeSet < String > ( unknown ) , known ) ) ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcSymbolStyleSelect ( ) { } }
if ( ifcSymbolStyleSelectEClass == null ) { ifcSymbolStyleSelectEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 975 ) ; } return ifcSymbolStyleSelectEClass ;
public class SimpleTimeZone { /** * Sets the daylight saving time end rule . For example , if daylight saving time * ends on the last Sunday in October at 2 am in wall clock time , * you can set the end rule by calling : * < code > setEndRule ( Calendar . OCTOBER , - 1 , Calendar . SUNDAY , 2*60*60*1000 ) ; < / code > * @ param endMonth The daylight saving time ending month . Month is * a { @ link Calendar # MONTH MONTH } field * value ( 0 - based . e . g . , 9 for October ) . * @ param endDay The day of the month on which the daylight saving time ends . * See the class description for the special cases of this parameter . * @ param endDayOfWeek The daylight saving time ending day - of - week . * See the class description for the special cases of this parameter . * @ param endTime The daylight saving ending time in local wall clock time , * ( in milliseconds within the day ) which is local daylight * time in this case . * @ exception IllegalArgumentException if the < code > endMonth < / code > , < code > endDay < / code > , * < code > endDayOfWeek < / code > , or < code > endTime < / code > parameters are out of range */ public void setEndRule ( int endMonth , int endDay , int endDayOfWeek , int endTime ) { } }
this . endMonth = endMonth ; this . endDay = endDay ; this . endDayOfWeek = endDayOfWeek ; this . endTime = endTime ; this . endTimeMode = WALL_TIME ; decodeEndRule ( ) ; invalidateCache ( ) ;
public class GraphitePickleWriter { /** * Load settings , initialize the { @ link SocketWriter } pool and test the connection to the graphite server . * a { @ link Logger # warn ( String ) } message is emitted if the connection to the graphite server fails . */ @ Override public void start ( ) { } }
int port = getIntSetting ( SETTING_PORT , DEFAULT_GRAPHITE_SERVER_PORT ) ; String host = getStringSetting ( SETTING_HOST ) ; graphiteServerHostAndPort = new HostAndPort ( host , port ) ; logger . info ( "Start Graphite Pickle writer connected to '{}'..." , graphiteServerHostAndPort ) ; metricPathPrefix = getStringSetting ( SETTING_NAME_PREFIX , DEFAULT_NAME_PREFIX ) ; metricPathPrefix = getStrategy ( ) . resolveExpression ( metricPathPrefix ) ; if ( ! metricPathPrefix . isEmpty ( ) && ! metricPathPrefix . endsWith ( "." ) ) { metricPathPrefix = metricPathPrefix + "." ; } GenericKeyedObjectPoolConfig config = new GenericKeyedObjectPoolConfig ( ) ; config . setTestOnBorrow ( getBooleanSetting ( "pool.testOnBorrow" , true ) ) ; config . setTestWhileIdle ( getBooleanSetting ( "pool.testWhileIdle" , true ) ) ; config . setMaxTotal ( getIntSetting ( "pool.maxActive" , - 1 ) ) ; config . setMaxIdlePerKey ( getIntSetting ( "pool.maxIdle" , - 1 ) ) ; config . setMinEvictableIdleTimeMillis ( getLongSetting ( "pool.minEvictableIdleTimeMillis" , TimeUnit . MINUTES . toMillis ( 5 ) ) ) ; config . setTimeBetweenEvictionRunsMillis ( getLongSetting ( "pool.timeBetweenEvictionRunsMillis" , TimeUnit . MINUTES . toMillis ( 5 ) ) ) ; config . setJmxNameBase ( "org.jmxtrans.embedded:type=GenericKeyedObjectPool,writer=GraphitePickleWriter,name=" ) ; config . setJmxNamePrefix ( graphiteServerHostAndPort . getHost ( ) + "_" + graphiteServerHostAndPort . getPort ( ) ) ; int socketConnectTimeoutInMillis = getIntSetting ( "graphite.socketConnectTimeoutInMillis" , SocketOutputStreamPoolFactory . DEFAULT_SOCKET_CONNECT_TIMEOUT_IN_MILLIS ) ; socketOutputStreamPool = new GenericKeyedObjectPool < HostAndPort , SocketOutputStream > ( new SocketOutputStreamPoolFactory ( socketConnectTimeoutInMillis ) , config ) ; if ( isEnabled ( ) ) { try { SocketOutputStream socketOutputStream = socketOutputStreamPool . borrowObject ( graphiteServerHostAndPort ) ; socketOutputStreamPool . returnObject ( graphiteServerHostAndPort , socketOutputStream ) ; } catch ( Exception e ) { logger . warn ( "Test Connection: FAILURE to connect to Graphite server '{}'" , graphiteServerHostAndPort , e ) ; } } try { Class . forName ( "org.python.modules.cPickle" ) ; } catch ( ClassNotFoundException e ) { throw new EmbeddedJmxTransException ( "jython librarie is required by the " + getClass ( ) . getSimpleName ( ) + " but is not found in the classpath. Please add org.python:jython:2.5.3+ to the classpath." ) ; }
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EEnum getIfcPhysicalOrVirtualEnum ( ) { } }
if ( ifcPhysicalOrVirtualEnumEEnum == null ) { ifcPhysicalOrVirtualEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 1029 ) ; } return ifcPhysicalOrVirtualEnumEEnum ;
public class ICalParameters { /** * Sets the RANGE parameter value . * This parameter is used by the { @ link RecurrenceId } property . It defines * the effective range of recurrence instances that the property references . * @ param range the range or null to remove * @ see < a href = " http : / / tools . ietf . org / html / rfc5545 # page - 23 " > RFC 5545 * p . 23-4 < / a > */ public void setRange ( Range range ) { } }
replace ( RANGE , ( range == null ) ? null : range . getValue ( ) ) ;
public class AbstractJSBlock { /** * Create an If statement and add it to this block * @ param aTest * { @ link IJSExpression } to be tested to determine branching * @ param aThen * " then " block content . May be < code > null < / code > . * @ return Newly generated conditional statement */ @ Nonnull public JSConditional _if ( @ Nonnull final IJSExpression aTest , @ Nullable final IHasJSCode aThen ) { } }
return addStatement ( new JSConditional ( aTest , aThen ) ) ;
public class VersionNumber { /** * Replaces all { @ code null } values in the given list of groups with { @ code VersionNumber # EMPTY _ GROUP } . * @ param groups * list of numbers of a version number * @ return a new list of groups without { @ code null } values */ public static List < String > replaceNullValueWithEmptyGroup ( @ Nonnull final List < String > groups ) { } }
Check . notNull ( groups , "groups" ) ; final List < String > result = new ArrayList < String > ( groups . size ( ) ) ; for ( final String group : groups ) { if ( group == null ) { result . add ( EMPTY_GROUP ) ; } else { result . add ( group ) ; } } for ( int i = result . size ( ) ; i < MIN_GROUP_SIZE ; i ++ ) { result . add ( EMPTY_GROUP ) ; } return result ;
public class AbstractTileFactory { /** * Set the User agent that will be used when making a tile request . * Some tile server usage policies requires application to identify itself , * so please make sure that it is set properly . * @ param userAgent User agent to be used . */ public void setUserAgent ( String userAgent ) { } }
if ( userAgent == null || userAgent . isEmpty ( ) ) { throw new IllegalArgumentException ( "User agent can't be null or empty." ) ; } this . userAgent = userAgent ;
public class GameIndenter { /** * Returns null if the indentation fails . */ public static String reindentGameDescription ( String gameRules ) throws Exception { } }
List < Symbol > tokens = ParserHelper . scan ( gameRules , true ) ; tokens = collapseWhitespaceTokens ( tokens ) ; StringBuilder result = new StringBuilder ( ) ; int parensLevel = 0 ; // " ( so far " minus " ) so far " int nestingLevel = 0 ; // " < = " and " or " level ; when = = parens level , use newlines for ( int i = 0 ; i < tokens . size ( ) ; i ++ ) { Symbol token = tokens . get ( i ) ; switch ( token . sym ) { case Symbols . CONSTANT : case Symbols . VARIABLE : result . append ( token . value ) ; break ; case Symbols . POPEN : result . append ( "(" ) ; parensLevel ++ ; break ; case Symbols . PCLOSE : result . append ( ")" ) ; if ( parensLevel > 0 ) { parensLevel -- ; } if ( nestingLevel > parensLevel ) { nestingLevel = parensLevel ; } break ; case Symbols . IMPLIES : result . append ( "<=" ) ; nestingLevel ++ ; break ; case Symbols . NOT : result . append ( "not" ) ; break ; case Symbols . DISTINCT : result . append ( "distinct" ) ; break ; case Symbols . OR : result . append ( "or" ) ; nestingLevel ++ ; break ; case Symbols . EOF : break ; case Symbols2 . COMMENT : result . append ( token . value ) ; break ; case Symbols2 . WHITESPACE : result . append ( rewriteWhitespace ( ( String ) token . value , tokens , i , parensLevel , nestingLevel ) ) ; break ; } } return result . toString ( ) ;
public class MetadataContext { /** * Invokes { @ link DatabaseMetaData # getColumns ( java . lang . String , java . lang . String , java . lang . String , * java . lang . String ) } with given arguments and returns bound information . * @ param catalog the value for { @ code catalog } parameter * @ param schemaPattern the value for { @ code schemaPattern } parameter * @ param tableNamePattern the value for { @ code tableNameSchema } parameter * @ param columnNamePattern the value for { @ code columnNamePattern } parameter * @ return a list of columns * @ throws SQLException if a database error occurs . * @ see DatabaseMetaData # getColumns ( String , String , String , String ) */ public List < Column > getColumns ( final String catalog , final String schemaPattern , final String tableNamePattern , final String columnNamePattern ) throws SQLException { } }
final List < Column > list = new ArrayList < > ( ) ; try ( ResultSet results = databaseMetadata . getColumns ( catalog , schemaPattern , tableNamePattern , columnNamePattern ) ) { if ( results != null ) { bind ( results , Column . class , list ) ; } } return list ;
public class ExternalServiceAlertConditionService { /** * Returns the set of alert conditions for the given query parameters . * @ param queryParams The query parameters * @ return The set of alert conditions */ public Collection < ExternalServiceAlertCondition > list ( List < String > queryParams ) { } }
return HTTP . GET ( "/v2/alerts_external_service_conditions.json" , null , queryParams , EXTERNAL_SERVICE_ALERT_CONDITIONS ) . get ( ) ;
public class CommerceDiscountRelPersistenceImpl { /** * Returns the commerce discount rel with the primary key or throws a { @ link com . liferay . portal . kernel . exception . NoSuchModelException } if it could not be found . * @ param primaryKey the primary key of the commerce discount rel * @ return the commerce discount rel * @ throws NoSuchDiscountRelException if a commerce discount rel with the primary key could not be found */ @ Override public CommerceDiscountRel findByPrimaryKey ( Serializable primaryKey ) throws NoSuchDiscountRelException { } }
CommerceDiscountRel commerceDiscountRel = fetchByPrimaryKey ( primaryKey ) ; if ( commerceDiscountRel == null ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey ) ; } throw new NoSuchDiscountRelException ( _NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey ) ; } return commerceDiscountRel ;
public class RdfListUtils { /** * Tries to get the items of an rdf : List and throws an { @ link IllegalArgumentException } if it is not a list */ public static Collection < RDFNode > getListItemsOrFail ( RDFNode node ) { } }
if ( ! isList ( node ) ) { throw new IllegalArgumentException ( "Resource not an rdf:List" ) ; } return getListItemsOrEmpty ( node ) ;
public class SPDateTimeUtil { /** * Get time zone id . ZoneId . SHORT _ IDS used get id if time zone is * abbreviated like ' IST ' . * @ param tz * @ return ZoneId */ public static ZoneId getTimeZoneId ( final TimeZone tz ) { } }
return ZoneId . of ( tz . getID ( ) , ZoneId . SHORT_IDS ) ;
public class Miscellaneous { /** * Determines whether the specified file is a Symbolic Link rather than an * actual file . * Will not return true if there is a Symbolic Link anywhere in the path , * only if the specific file is . * < b > Note : < / b > the current implementation always returns { @ code false } if * the system is detected as Windows . * Copied from org . apache . commons . io . FileuUils * @ param file the file to check * @ return true if the file is a Symbolic Link * @ throws IOException if an IO error occurs while checking the file */ public static boolean isSymlink ( File file ) throws IOException { } }
if ( file == null ) { throw new NullPointerException ( "File must not be null" ) ; } if ( File . separatorChar == '\\' ) { return false ; } File fileInCanonicalDir ; if ( file . getParent ( ) == null ) { fileInCanonicalDir = file ; } else { File canonicalDir = file . getParentFile ( ) . getCanonicalFile ( ) ; fileInCanonicalDir = new File ( canonicalDir , file . getName ( ) ) ; } return ! fileInCanonicalDir . getCanonicalFile ( ) . equals ( fileInCanonicalDir . getAbsoluteFile ( ) ) ;
public class Datamodel { /** * Creates a { @ link GlobeCoordinatesValue } . * @ param latitude * the latitude of the coordinates in degrees * @ param longitude * the longitude of the coordinates in degrees * @ param precision * the precision of the coordinates in degrees * @ param globeIri * IRI specifying the celestial objects of the coordinates * @ return a { @ link GlobeCoordinatesValue } corresponding to the input */ public static GlobeCoordinatesValue makeGlobeCoordinatesValue ( double latitude , double longitude , double precision , String globeIri ) { } }
return factory . getGlobeCoordinatesValue ( latitude , longitude , precision , globeIri ) ;
public class ByteConverter { /** * Encodes a int value to the byte array . * @ param target The byte array to encode to . * @ param idx The starting index in the byte array . * @ param value The value to encode . */ public static void float4 ( byte [ ] target , int idx , float value ) { } }
int4 ( target , idx , Float . floatToRawIntBits ( value ) ) ;
public class ViewControlsLayer { /** * Get the control type associated with the given object or null if unknown . * @ param control the control object * @ return the control type . Can be one of { @ link AVKey # VIEW _ PAN } , { @ link AVKey # VIEW _ LOOK } , { @ link * AVKey # VIEW _ HEADING _ LEFT } , { @ link AVKey # VIEW _ HEADING _ RIGHT } , { @ link AVKey # VIEW _ ZOOM _ IN } , { @ link * AVKey # VIEW _ ZOOM _ OUT } , { @ link AVKey # VIEW _ PITCH _ UP } , { @ link AVKey # VIEW _ PITCH _ DOWN } , { @ link * AVKey # VIEW _ FOV _ NARROW } or { @ link AVKey # VIEW _ FOV _ WIDE } . < p > Returns null if the object is not a view * control associated with this layer . < / p > */ public String getControlType ( Object control ) { } }
if ( control == null || ! ( control instanceof ScreenAnnotation ) ) return null ; if ( showPanControls && controlPan . equals ( control ) ) return AVKey . VIEW_PAN ; else if ( showLookControls && controlLook . equals ( control ) ) return AVKey . VIEW_LOOK ; else if ( showHeadingControls && controlHeadingLeft . equals ( control ) ) return AVKey . VIEW_HEADING_LEFT ; else if ( showHeadingControls && controlHeadingRight . equals ( control ) ) return AVKey . VIEW_HEADING_RIGHT ; else if ( showZoomControls && controlZoomIn . equals ( control ) ) return AVKey . VIEW_ZOOM_IN ; else if ( showZoomControls && controlZoomOut . equals ( control ) ) return AVKey . VIEW_ZOOM_OUT ; else if ( showPitchControls && controlPitchUp . equals ( control ) ) return AVKey . VIEW_PITCH_UP ; else if ( showPitchControls && controlPitchDown . equals ( control ) ) return AVKey . VIEW_PITCH_DOWN ; else if ( showFovControls && controlFovNarrow . equals ( control ) ) return AVKey . VIEW_FOV_NARROW ; else if ( showFovControls && controlFovWide . equals ( control ) ) return AVKey . VIEW_FOV_WIDE ; else if ( showVeControls && controlVeUp . equals ( control ) ) return AVKey . VERTICAL_EXAGGERATION_UP ; else if ( showVeControls && controlVeDown . equals ( control ) ) return AVKey . VERTICAL_EXAGGERATION_DOWN ; return null ;
public class MavenGABaseImpl { /** * Valid form : < code > groupId : artifactId < / code > * @ see org . jboss . shrinkwrap . resolver . api . Coordinate # toCanonicalForm ( ) */ @ Override public String toCanonicalForm ( ) { } }
return new StringBuilder ( groupId ) . append ( SEPARATOR_COORDINATE ) . append ( artifactId ) . toString ( ) ;
public class AbstractDockerMojo { /** * Common method for re - throwing a { @ link DockerException } as a { @ link MojoFailureException } with a more specific * error message . Extract into a common , template method in this base class to allow pre " verify " Mojos to handle * errors differently . * @ param message The message for the exception * @ param e The Docker Exception * @ throws org . apache . maven . plugin . MojoFailureException to indicate Plugin failure */ protected void handleDockerException ( final String message , DockerException e ) throws MojoFailureException { } }
Optional < String > apiResponse = e . getApiResponse ( ) ; String exceptionMessage = apiResponse . isPresent ( ) ? ( message + "\nApi response:\n" + apiResponse . get ( ) ) : message ; throw new MojoFailureException ( exceptionMessage , e ) ;
public class BatchPredictionMarshaller { /** * Marshall the given parameter object . */ public void marshall ( BatchPrediction batchPrediction , ProtocolMarshaller protocolMarshaller ) { } }
if ( batchPrediction == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( batchPrediction . getBatchPredictionId ( ) , BATCHPREDICTIONID_BINDING ) ; protocolMarshaller . marshall ( batchPrediction . getMLModelId ( ) , MLMODELID_BINDING ) ; protocolMarshaller . marshall ( batchPrediction . getBatchPredictionDataSourceId ( ) , BATCHPREDICTIONDATASOURCEID_BINDING ) ; protocolMarshaller . marshall ( batchPrediction . getInputDataLocationS3 ( ) , INPUTDATALOCATIONS3_BINDING ) ; protocolMarshaller . marshall ( batchPrediction . getCreatedByIamUser ( ) , CREATEDBYIAMUSER_BINDING ) ; protocolMarshaller . marshall ( batchPrediction . getCreatedAt ( ) , CREATEDAT_BINDING ) ; protocolMarshaller . marshall ( batchPrediction . getLastUpdatedAt ( ) , LASTUPDATEDAT_BINDING ) ; protocolMarshaller . marshall ( batchPrediction . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( batchPrediction . getStatus ( ) , STATUS_BINDING ) ; protocolMarshaller . marshall ( batchPrediction . getOutputUri ( ) , OUTPUTURI_BINDING ) ; protocolMarshaller . marshall ( batchPrediction . getMessage ( ) , MESSAGE_BINDING ) ; protocolMarshaller . marshall ( batchPrediction . getComputeTime ( ) , COMPUTETIME_BINDING ) ; protocolMarshaller . marshall ( batchPrediction . getFinishedAt ( ) , FINISHEDAT_BINDING ) ; protocolMarshaller . marshall ( batchPrediction . getStartedAt ( ) , STARTEDAT_BINDING ) ; protocolMarshaller . marshall ( batchPrediction . getTotalRecordCount ( ) , TOTALRECORDCOUNT_BINDING ) ; protocolMarshaller . marshall ( batchPrediction . getInvalidRecordCount ( ) , INVALIDRECORDCOUNT_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class CompositePropertySource { /** * Add the given { @ link PropertySource } to the start of the chain . * @ param propertySource the PropertySource to add * @ since 4.1 */ public void addFirstPropertySource ( PropertySource < ? > propertySource ) { } }
List < PropertySource < ? > > existing = new ArrayList < PropertySource < ? > > ( this . propertySources ) ; this . propertySources . clear ( ) ; this . propertySources . add ( propertySource ) ; this . propertySources . addAll ( existing ) ;
public class MonthSheetView { /** * Sets the value of { @ link # cellFactoryProperty ( ) } . * @ param factory the cell factory */ public final void setCellFactory ( Callback < DateParameter , DateCell > factory ) { } }
requireNonNull ( factory ) ; cellFactoryProperty ( ) . set ( factory ) ;
public class KeyVaultClientBaseImpl { /** * List all versions of the specified secret . * The full secret identifier and attributes are provided in the response . No values are returned for the secrets . This operations requires the secrets / list permission . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws KeyVaultErrorException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the PagedList & lt ; SecretItem & gt ; object if successful . */ public PagedList < SecretItem > getSecretVersionsNext ( final String nextPageLink ) { } }
ServiceResponse < Page < SecretItem > > response = getSecretVersionsNextSinglePageAsync ( nextPageLink ) . toBlocking ( ) . single ( ) ; return new PagedList < SecretItem > ( response . body ( ) ) { @ Override public Page < SecretItem > nextPage ( String nextPageLink ) { return getSecretVersionsNextSinglePageAsync ( nextPageLink ) . toBlocking ( ) . single ( ) . body ( ) ; } } ;
public class Version { /** * Creates a new object of type Version * This method extracts the values for the object parameters from vStr * @ param vStr - string input */ public static Version createVersion ( String vStr ) { } }
if ( vStr == null || vStr . isEmpty ( ) ) return null ; int major = 0 ; int minor = 0 ; int micro = 0 ; String qualifier = "" ; String v [ ] = vStr . split ( "\\." , 4 ) ; try { if ( v . length > 0 ) { major = Integer . valueOf ( v [ 0 ] ) . intValue ( ) ; } if ( v . length > 1 ) { minor = Integer . valueOf ( v [ 1 ] ) . intValue ( ) ; } if ( v . length > 2 ) { micro = Integer . valueOf ( v [ 2 ] ) . intValue ( ) ; } if ( v . length > 3 ) { qualifier = v [ 3 ] ; } return new Version ( major , minor , micro , qualifier ) ; } catch ( NumberFormatException e ) { return null ; }
public class CLI { /** * Generate Properties objects for CLI usage . * @ param model the model to perform the annotation * @ param language the language * @ param multiwords whether multiwords are to be detected * @ param dictag whether tagging from a dictionary is activated * @ return a properties object */ private Properties setAnnotateProperties ( final String model , final String lemmatizerModel , final String language , final String multiwords , final String dictag ) { } }
final Properties annotateProperties = new Properties ( ) ; annotateProperties . setProperty ( "model" , model ) ; annotateProperties . setProperty ( "lemmatizerModel" , lemmatizerModel ) ; annotateProperties . setProperty ( "language" , language ) ; annotateProperties . setProperty ( "multiwords" , multiwords ) ; annotateProperties . setProperty ( "dictag" , dictag ) ; return annotateProperties ;
public class VfsOld { /** * Creates new ReadStream from an InputStream */ public static ReadStreamOld openRead ( InputStream is ) { } }
if ( is instanceof ReadStreamOld ) return ( ReadStreamOld ) is ; VfsStreamOld s = new VfsStreamOld ( is , null ) ; return new ReadStreamOld ( s ) ;
public class GridDialects { /** * Returns the given dialect , narrowed down to the given dialect facet in case it is implemented by the dialect . * @ param gridDialect the dialect of interest * @ param facetType the dialect facet type of interest * @ return the given dialect , narrowed down to the given dialect facet or { @ code null } in case the given dialect * does not implement the given facet */ static < T extends GridDialect > T getDialectFacetOrNull ( GridDialect gridDialect , Class < T > facetType ) { } }
if ( hasFacet ( gridDialect , facetType ) ) { @ SuppressWarnings ( "unchecked" ) T asFacet = ( T ) gridDialect ; return asFacet ; } return null ;
public class AnyGene { /** * Create a new { @ code AnyGene } instance with the given parameters . New * ( random ) genes are created with the given allele { @ code supplier } . * @ param < A > the allele type * @ param allele the actual allele instance the created gene represents . * { @ code null } values are allowed . * @ param supplier the allele - supplier which is used for creating new , * random alleles * @ param validator the validator used for validating the created gene . This * predicate is used in the { @ link # isValid ( ) } method . * @ return a new { @ code AnyGene } with the given parameters * @ throws NullPointerException if the { @ code supplier } or { @ code validator } * is { @ code null } */ public static < A > AnyGene < A > of ( final A allele , final Supplier < ? extends A > supplier , final Predicate < ? super A > validator ) { } }
return new AnyGene < > ( allele , supplier , validator ) ;
public class EventSubscriptionsInner { /** * Update an event subscription . * Asynchronously updates an existing event subscription . * @ param scope The scope of existing event subscription . The scope can be a subscription , or a resource group , or a top level resource belonging to a resource provider namespace , or an EventGrid topic . For example , use ' / subscriptions / { subscriptionId } / ' for a subscription , ' / subscriptions / { subscriptionId } / resourceGroups / { resourceGroupName } ' for a resource group , and ' / subscriptions / { subscriptionId } / resourceGroups / { resourceGroupName } / providers / { resourceProviderNamespace } / { resourceType } / { resourceName } ' for a resource , and ' / subscriptions / { subscriptionId } / resourceGroups / { resourceGroupName } / providers / Microsoft . EventGrid / topics / { topicName } ' for an EventGrid topic . * @ param eventSubscriptionName Name of the event subscription to be updated * @ param eventSubscriptionUpdateParameters Updated event subscription information * @ 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 < EventSubscriptionInner > beginUpdateAsync ( String scope , String eventSubscriptionName , EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters , final ServiceCallback < EventSubscriptionInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( beginUpdateWithServiceResponseAsync ( scope , eventSubscriptionName , eventSubscriptionUpdateParameters ) , serviceCallback ) ;
public class ByteCodeGenerator { /** * Creates a Javassist class from a given model class . * @ param modelClass * Model class to convert into a Javassist class . * @ return Javassist class . * @ throws NotFoundException * A class or interface from the model was not found . * @ throws CannotCompileException * Some source from the model cannot be compiled . */ private CtClass createCtClass ( final SgClass modelClass ) throws NotFoundException , CannotCompileException { } }
// Create class final CtClass clasz = pool . makeClass ( modelClass . getName ( ) ) ; clasz . setModifiers ( SgUtils . toModifiers ( modelClass . getModifiers ( ) ) ) ; // Add superclass if ( modelClass . getSuperClass ( ) != null ) { clasz . setSuperclass ( pool . get ( modelClass . getSuperClass ( ) . getName ( ) ) ) ; } addInterfaces ( modelClass , clasz ) ; addFields ( modelClass , clasz ) ; addConstructors ( modelClass , clasz ) ; addMethods ( modelClass , clasz ) ; return clasz ;
public class InstructionView { /** * Inflates this layout needed for this view and initializes the locale as the device locale . */ private void initialize ( ) { } }
LocaleUtils localeUtils = new LocaleUtils ( ) ; String language = localeUtils . inferDeviceLanguage ( getContext ( ) ) ; String unitType = localeUtils . getUnitTypeForDeviceLocale ( getContext ( ) ) ; int roundingIncrement = NavigationConstants . ROUNDING_INCREMENT_FIFTY ; distanceFormatter = new DistanceFormatter ( getContext ( ) , language , unitType , roundingIncrement ) ; inflate ( getContext ( ) , R . layout . instruction_view_layout , this ) ;
public class CompressionUtil { /** * Extract a file using the given { @ link CompressionMethod } . * @ param _ method * @ param _ compressedFile * @ param _ outputFileName * @ return file object which represents the uncompressed file or null on error */ public static File decompress ( CompressionMethod _method , String _compressedFile , String _outputFileName ) { } }
if ( _method == null || _compressedFile == null ) { return null ; } File inputFile = new File ( _compressedFile ) ; if ( ! inputFile . exists ( ) ) { return null ; } try { Constructor < ? extends InputStream > constructor = _method . getInputStreamClass ( ) . getConstructor ( InputStream . class ) ; if ( constructor != null ) { InputStream inputStream = constructor . newInstance ( new FileInputStream ( inputFile ) ) ; // write decompressed stream to new file Path destPath = Paths . get ( _outputFileName ) ; Files . copy ( inputStream , destPath , StandardCopyOption . REPLACE_EXISTING ) ; return destPath . toFile ( ) ; } } catch ( IOException | NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException iOException ) { LOGGER . error ( "Cannot uncompress file: " , iOException ) ; } return null ;
public class TeamDataClient { /** * Explicitly updates queries for the source system , and initiates the * update to MongoDB from those calls . */ public void updateTeamInformation ( ) throws HygieiaException { } }
// super . objClass = ScopeOwnerCollectorItem . class ; String returnDate = getFeatureSettings ( ) . getDeltaCollectorItemStartDate ( ) ; if ( ! StringUtils . isEmpty ( getMaxChangeDate ( ) ) ) { returnDate = getMaxChangeDate ( ) ; } returnDate = DateUtil . getChangeDateMinutePrior ( returnDate , getFeatureSettings ( ) . getScheduledPriorMin ( ) ) ; String queryName = getFeatureSettings ( ) . getTeamQuery ( ) ; String query = getQuery ( returnDate , queryName ) ; updateObjectInformation ( query ) ;
public class NettyProtocol { /** * Returns the client channel handlers . * < pre > * | Remote input channel | | request client | * | | ( 1 ) write * | | CLIENT CHANNEL PIPELINE | | * | | Request handler + | Message encoder | | * | | Message + Frame decoder | | | * | | ( 3 ) server response \ | / ( 2 ) client request * | [ Socket . read ( ) ] [ Socket . write ( ) ] | * | Netty Internal I / O Threads ( Transport Implementation ) | * < / pre > * @ return channel handlers */ public ChannelHandler [ ] getClientChannelHandlers ( ) { } }
NetworkClientHandler networkClientHandler = creditBasedEnabled ? new CreditBasedPartitionRequestClientHandler ( ) : new PartitionRequestClientHandler ( ) ; return new ChannelHandler [ ] { messageEncoder , new NettyMessage . NettyMessageDecoder ( ! creditBasedEnabled ) , networkClientHandler } ;
public class OrganizationSnippets { /** * [ START update _ organization _ settings ] */ static OrganizationSettings updateOrganizationSettings ( OrganizationName organizationName ) { } }
try ( SecurityCenterClient client = SecurityCenterClient . create ( ) ) { // Start setting up a request to update OrganizationSettings for . // OrganizationName organizationName = OrganizationName . of ( / * organizationId = * / " 123234324 " ) ; OrganizationSettings organizationSettings = OrganizationSettings . newBuilder ( ) . setName ( organizationName . toString ( ) + "/organizationSettings" ) . setEnableAssetDiscovery ( true ) . build ( ) ; FieldMask updateMask = FieldMask . newBuilder ( ) . addPaths ( "enable_asset_discovery" ) . build ( ) ; UpdateOrganizationSettingsRequest . Builder request = UpdateOrganizationSettingsRequest . newBuilder ( ) . setOrganizationSettings ( organizationSettings ) . setUpdateMask ( updateMask ) ; // Call the API . OrganizationSettings response = client . updateOrganizationSettings ( request . build ( ) ) ; System . out . println ( "Organization Settings have been updated:" ) ; System . out . println ( response ) ; return response ; } catch ( IOException e ) { throw new RuntimeException ( "Couldn't create client." , e ) ; }
public class ImportHelpers { /** * Adds an import to an instance ( provided this import was not already set ) . * @ param instance the instance whose imports must be updated * @ param componentOrFacetName the component or facet name associated with the import * @ param imp the import to add */ public static void addImport ( Instance instance , String componentOrFacetName , Import imp ) { } }
Collection < Import > imports = instance . getImports ( ) . get ( componentOrFacetName ) ; if ( imports == null ) { imports = new LinkedHashSet < Import > ( ) ; instance . getImports ( ) . put ( componentOrFacetName , imports ) ; } if ( ! imports . contains ( imp ) ) imports . add ( imp ) ;
public class LogHistogram { /** * Approximates log _ 2 ( value ) by abusing floating point hardware . The floating point exponent * is used to get the integer part of the log . The mantissa is then adjusted with a second order * polynomial to get a better approximation . The error is bounded to be less than ± 0.01 and is * zero at every power of two ( which also implies the approximation is continuous ) . * @ param value The argument of the log * @ return log _ 2 ( value ) ( within an error of about ± 0.01) */ @ SuppressWarnings ( "WeakerAccess" ) public static double approxLog2 ( double value ) { } }
final long valueBits = Double . doubleToRawLongBits ( value ) ; final long exponent = ( ( valueBits & 0x7ff0_0000_0000_0000L ) >>> 52 ) - 1024 ; final double m = Double . longBitsToDouble ( ( valueBits & 0x800fffffffffffffL ) | 0x3ff0000000000000L ) ; return ( m * ( 2 - ( 1.0 / 3 ) * m ) + exponent - ( 2.0 / 3.0 ) ) ;
public class PutRecordRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( PutRecordRequest putRecordRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( putRecordRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( putRecordRequest . getDeliveryStreamName ( ) , DELIVERYSTREAMNAME_BINDING ) ; protocolMarshaller . marshall ( putRecordRequest . getRecord ( ) , RECORD_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class SpliteratorBasedStream { /** * TODO use spliterators and createSeq */ @ Override public ReactiveSeq < T > append ( final T other ) { } }
return ReactiveSeq . concat ( get ( ) , new SingleSpliterator < T > ( other ) ) ;
public class EmbedVaadinServerBuilder { /** * Specifies the context to use to deploy the web application . An empty * string or < tt > / < / tt > means the root context . * @ param contextPath the context path to use * @ return this */ public B withContextPath ( String contextPath ) { } }
assertNotNull ( contextPath , "contextPath could not be null." ) ; getConfig ( ) . setContextPath ( contextPath ) ; return self ( ) ;
public class SimpleAssetResolver { /** * Attempt to find the specified image file in the < code > assets < / code > folder and return a decoded Bitmap . */ @ Override public Bitmap resolveImage ( String filename ) { } }
Log . i ( TAG , "resolveImage(" + filename + ")" ) ; try { InputStream istream = assetManager . open ( filename ) ; return BitmapFactory . decodeStream ( istream ) ; } catch ( IOException e1 ) { return null ; }
public class ObjectWrapper { /** * Internal : Static version of { @ link ObjectWrapper # setMappedValue ( Property , Object , Object ) } . */ @ SuppressWarnings ( "unchecked" ) private static void setMappedValue ( Object obj , Property property , Object key , Object value , ObjectWrapper options ) { } }
if ( property == null ) { throw new IllegalArgumentException ( "Cannot set a new mapped value to a 'null' property." ) ; } if ( Map . class . isAssignableFrom ( property . getType ( ) ) ) { Map map = ( Map ) property . get ( obj ) ; if ( map == null ) { if ( options . isAutoInstancing ) { map = new LinkedHashMap ( ) ; property . set ( obj , map ) ; } else { throw new NullPointerException ( "Invalid 'null' value found for the mapped '" + property + "' in " + obj . getClass ( ) . getName ( ) + " object." ) ; } } map . put ( key , value ) ; } else { throw new IllegalArgumentException ( "Cannot set a new mapped value to " + property + ". Only Map type is supported for mapped properties, but " + property . getType ( ) . getName ( ) + " found." ) ; }
public class DirectoryClient { /** * { @ inheritDoc } */ @ Override public InputStream getAttachment ( final Asset asset , final Attachment attachment ) throws IOException , BadVersionException , RequestFailureException { } }
String attachmentId = attachment . get_id ( ) ; if ( attachmentId . contains ( "#" ) ) { // new funky code to get an input stream to the license * inside * the main attachment . The start of // the assetId will point to the main attachment file . String assetId = asset . get_id ( ) ; File zipFile = new File ( _root , assetId ) ; ZipFile zip = DirectoryUtils . createZipFile ( zipFile ) ; FileInputStream fis = DirectoryUtils . createFileInputStream ( zipFile ) ; ZipInputStream zis = new ZipInputStream ( fis ) ; try { return getInputStreamToLicenseInsideZip ( zis , assetId , attachmentId ) ; } finally { zip . close ( ) ; } } else { return DirectoryUtils . createFileInputStream ( createFromRelative ( attachmentId ) ) ; }
public class MethodSignatureKeyServiceLocator { /** * 根据服务标示获取服务方法的描述 * @ param key * @ return 服务方法的描述 * @ see com . baidu . beidou . navi . server . locator . ServiceLocator # getServiceDescriptor ( java . lang . Object ) */ @ Override public MethodDescriptor < String > getServiceDescriptor ( String key ) { } }
Preconditions . checkNotNull ( key , "Key cannot be null" ) ; return serviceRegistry . getServiceDescriptorByKey ( key ) ;
public class AmazonMTurkClient { /** * The < code > ListWorkersBlocks < / code > operation retrieves a list of Workers who are blocked from working on your * HITs . * @ param listWorkerBlocksRequest * @ return Result of the ListWorkerBlocks operation returned by the service . * @ throws ServiceException * Amazon Mechanical Turk is temporarily unable to process your request . Try your call again . * @ throws RequestErrorException * Your request is invalid . * @ sample AmazonMTurk . ListWorkerBlocks * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / mturk - requester - 2017-01-17 / ListWorkerBlocks " * target = " _ top " > AWS API Documentation < / a > */ @ Override public ListWorkerBlocksResult listWorkerBlocks ( ListWorkerBlocksRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeListWorkerBlocks ( request ) ;
public class DateTimeUtil { /** * 给定时间 , 获取一月中的第几天 。 * @ param date 时间 ( { @ link Date } ) * @ return ( Integer ) , 如果date is null , 将返回null */ public static Integer getDayOfMonth ( Date date ) { } }
if ( date == null ) return null ; Calendar calendar = Calendar . getInstance ( ) ; calendar . setTime ( date ) ; return calendar . get ( Calendar . DAY_OF_MONTH ) ;
public class RowSeq { /** * Extracts the value of a cell containing a data point . * @ param value The contents of a cell in HBase . * @ param value _ idx The offset inside { @ code values } at which the value * starts . * @ param flags The flags for this value . * @ return The value of the cell . * @ throws IllegalDataException if the data is malformed */ static long extractIntegerValue ( final byte [ ] values , final int value_idx , final byte flags ) { } }
switch ( flags & Const . LENGTH_MASK ) { case 7 : return Bytes . getLong ( values , value_idx ) ; case 3 : return Bytes . getInt ( values , value_idx ) ; case 1 : return Bytes . getShort ( values , value_idx ) ; case 0 : return values [ value_idx ] ; } throw new IllegalDataException ( "Integer value @ " + value_idx + " not on 8/4/2/1 bytes in " + Arrays . toString ( values ) ) ;
public class MyProxy { /** * Retrieves delegated credentials from MyProxy server Anonymously * ( without local credentials ) * Notes : Performs simple verification of private / public keys of * the delegated credential . Should be improved later . * And only checks for RSA keys . * @ param username * The username of the credentials to retrieve . * @ param passphrase * The passphrase of the credentials to retrieve . * @ param lifetime * The requested lifetime of the retrieved credential ( in seconds ) . * @ return GSSCredential * The retrieved delegated credentials . * @ exception MyProxyException * If an error occurred during the operation . */ public GSSCredential get ( String username , String passphrase , int lifetime ) throws MyProxyException { } }
return get ( null , username , passphrase , lifetime ) ;
public class IOUtil { /** * Fills the buffer based from the varint32 read from the input stream . * The buffer ' s read offset is not set if the data ( varint32 size + message size ) is too large to fit in the buffer . * @ return the delimited size read . */ static int fillBufferWithDelimitedMessageFrom ( InputStream in , boolean drainRemainingBytesIfTooLarge , LinkedBuffer lb ) throws IOException { } }
final byte [ ] buf = lb . buffer ; int offset = lb . start , len = buf . length - offset , read = in . read ( buf , offset , len ) ; if ( read < 1 ) throw new EOFException ( "fillBufferWithDelimitedMessageFrom" ) ; int last = offset + read , size = buf [ offset ++ ] ; if ( 0 != ( size & 0x80 ) ) { size = size & 0x7f ; for ( int shift = 7 ; ; shift += 7 ) { if ( offset == last ) { // read too few bytes read = in . read ( buf , last , len - ( last - lb . start ) ) ; if ( read < 1 ) throw new EOFException ( "fillBufferWithDelimitedMessageFrom" ) ; last += read ; } byte b = buf [ offset ++ ] ; size |= ( b & 0x7f ) << shift ; if ( 0 == ( b & 0x80 ) ) break ; if ( shift == 28 ) { // discard the remaining bytes ( 5) for ( int i = 0 ; ; ) { if ( offset == last ) { // read more read = in . read ( buf , last , len - ( last - lb . start ) ) ; if ( read < 1 ) throw new EOFException ( "fillBufferWithDelimitedMessageFrom" ) ; last += read ; } if ( buf [ offset ++ ] >= 0 ) break ; if ( 5 == ++ i ) { // we ' ve already consumed 10 bytes throw ProtobufException . malformedVarint ( ) ; } } } } } if ( size == 0 ) { if ( offset != last ) throw ProtobufException . misreportedSize ( ) ; return size ; } if ( size < 0 ) throw ProtobufException . negativeSize ( ) ; final int partial = last - offset ; if ( partial < size ) { // need to read more final int delimSize = offset - lb . start ; if ( ( size + delimSize ) > len ) { // too large . if ( ! drainRemainingBytesIfTooLarge ) return size ; // drain the remaining bytes for ( int remaining = size - partial ; remaining > 0 ; ) { read = in . read ( buf , lb . start , Math . min ( remaining , len ) ) ; if ( read < 1 ) throw new EOFException ( "fillBufferWithDelimitedMessageFrom" ) ; remaining -= read ; } return size ; } // read the remaining bytes fillBufferFrom ( in , buf , last , size - partial ) ; } // set the read offset ( start of message ) lb . offset = offset ; return size ;
public class CmsExportHelper { /** * Writes the OpenCms manifest . xml file to the ZIP export . < p > * In case of the ZIP export the manifest is written to an internal StringBuffer * first , which is then stored in the ZIP file when this method is called . < p > * @ param xmlSaxWriter the SAX writer to use * @ throws SAXException in case of issues creating the manifest . xml * @ throws IOException in case of file access issues */ protected void writeManifest2Zip ( CmsXmlSaxWriter xmlSaxWriter ) throws IOException , SAXException { } }
// close the document xmlSaxWriter . endDocument ( ) ; xmlSaxWriter . getWriter ( ) . close ( ) ; // create ZIP entry for the manifest XML document ZipEntry entry = new ZipEntry ( CmsImportExportManager . EXPORT_MANIFEST ) ; m_exportZipStream . putNextEntry ( entry ) ; // complex substring operation is required to ensure handling for very large export manifest files StringBuffer result = ( ( StringWriter ) xmlSaxWriter . getWriter ( ) ) . getBuffer ( ) ; int steps = result . length ( ) / SUB_LENGTH ; int rest = result . length ( ) % SUB_LENGTH ; int pos = 0 ; for ( int i = 0 ; i < steps ; i ++ ) { String sub = result . substring ( pos , pos + SUB_LENGTH ) ; m_exportZipStream . write ( sub . getBytes ( OpenCms . getSystemInfo ( ) . getDefaultEncoding ( ) ) ) ; pos += SUB_LENGTH ; } if ( rest > 0 ) { String sub = result . substring ( pos , pos + rest ) ; m_exportZipStream . write ( sub . getBytes ( OpenCms . getSystemInfo ( ) . getDefaultEncoding ( ) ) ) ; } // close the zip entry for the manifest XML document m_exportZipStream . closeEntry ( ) ; // finally close the zip stream m_exportZipStream . close ( ) ;
public class CmsListMetadata { /** * Returns the csv output for the header of the list . < p > * @ return csv output */ public String csvHeader ( ) { } }
if ( m_csvItemFormatter != null ) { return m_csvItemFormatter . csvHeader ( ) ; } else { StringBuffer csv = new StringBuffer ( 1024 ) ; Iterator < CmsListColumnDefinition > itCols = m_columns . elementList ( ) . iterator ( ) ; while ( itCols . hasNext ( ) ) { CmsListColumnDefinition col = itCols . next ( ) ; if ( ! col . isVisible ( ) ) { continue ; } csv . append ( col . csvHeader ( ) ) ; csv . append ( "\t" ) ; } csv . append ( "\n\n" ) ; return csv . toString ( ) ; }
public class JQMListItem { /** * Adds a paragraph element containing the given text . * @ param html - the value to set as the inner html of the p element . */ public JQMListItem addText ( String html ) { } }
Element e = Document . get ( ) . createPElement ( ) ; e . setInnerHTML ( html ) ; attachChild ( e ) ; return this ;
public class ClassPathResource { /** * Get the input stream for the specified path using automatic class loader * handling . The class loaders are iterated in the following order : * < ol > * < li > Default class loader ( usually the context class loader ) < / li > * < li > The class loader of this class < / li > * < li > The system class loader < / li > * < / ol > * @ param sPath * The path to be resolved . May neither be < code > null < / code > nor empty . * @ return < code > null < / code > if the path could not be resolved . */ @ Nullable public static InputStream getInputStream ( @ Nonnull @ Nonempty final String sPath ) { } }
final URL aURL = URLHelper . getClassPathURL ( sPath ) ; return _getInputStream ( sPath , aURL , ( ClassLoader ) null ) ;
public class ConsumerSessionProxy { /** * This call will turn this asynchronous consumer into a synchronous consumer once * again and message delivery will only be able to be done through the explicit * receive methods . * @ throws com . ibm . wsspi . sib . core . exception . SISessionUnavailableException * @ throws com . ibm . wsspi . sib . core . exception . SISessionDroppedException * @ throws com . ibm . wsspi . sib . core . exception . SIConnectionUnavailableException * @ throws com . ibm . wsspi . sib . core . exception . SIConnectionDroppedException * @ throws com . ibm . websphere . sib . exception . SIErrorException * @ throws com . ibm . websphere . sib . exception . SIIncorrectCallException */ public void deregisterAsynchConsumerCallback ( ) throws SISessionUnavailableException , SISessionDroppedException , SIConnectionUnavailableException , SIConnectionDroppedException , SIErrorException , SIIncorrectCallException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "deregisterAsynchConsumerCallback" ) ; _deregisterAsynchConsumerCallback ( false ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "deregisterAsynchConsumerCallback" ) ;
public class Box { /** * Obtains the containing block bounds . * @ return the containing block bounds . */ public Rectangle getContainingBlock ( ) { } }
if ( cbox instanceof Viewport ) // initial containing block { Rectangle visible = ( ( Viewport ) cbox ) . getVisibleRect ( ) ; return new Rectangle ( 0 , 0 , visible . width , visible . height ) ; } else // static or relative position return cbox . getContentBounds ( ) ;
public class RandomDateUtils { /** * Returns a random { @ link ZonedDateTime } that is after the given { @ link ZonedDateTime } . * @ param after the value that returned { @ link ZonedDateTime } must be after * @ return the random { @ link ZonedDateTime } * @ throws IllegalArgumentException if after is null or if after is equal to or after { @ link * RandomDateUtils # MAX _ INSTANT } */ public static ZonedDateTime randomZonedDateTimeAfter ( ZonedDateTime after ) { } }
checkArgument ( after != null , "After must be non-null" ) ; Instant instant = randomInstantAfter ( after . toInstant ( ) ) ; return ZonedDateTime . ofInstant ( instant , UTC ) ;
public class ListRecoveryPointsByBackupVaultResult { /** * An array of objects that contain detailed information about recovery points saved in a backup vault . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setRecoveryPoints ( java . util . Collection ) } or { @ link # withRecoveryPoints ( java . util . Collection ) } if you want * to override the existing values . * @ param recoveryPoints * An array of objects that contain detailed information about recovery points saved in a backup vault . * @ return Returns a reference to this object so that method calls can be chained together . */ public ListRecoveryPointsByBackupVaultResult withRecoveryPoints ( RecoveryPointByBackupVault ... recoveryPoints ) { } }
if ( this . recoveryPoints == null ) { setRecoveryPoints ( new java . util . ArrayList < RecoveryPointByBackupVault > ( recoveryPoints . length ) ) ; } for ( RecoveryPointByBackupVault ele : recoveryPoints ) { this . recoveryPoints . add ( ele ) ; } return this ;
public class IndexWriter { /** * Generates an AttributeUpdate that removes a Backpointer , whether it exists or not . * @ param fromOffset The offset at which the Backpointer originates . */ private AttributeUpdate generateBackpointerRemoval ( long fromOffset ) { } }
return new AttributeUpdate ( getBackpointerAttributeKey ( fromOffset ) , AttributeUpdateType . Replace , Attributes . NULL_ATTRIBUTE_VALUE ) ;
public class SubCommandMetaCheck { /** * Initializes parser * @ return OptionParser object with all available options */ protected static OptionParser getParser ( ) { } }
OptionParser parser = new OptionParser ( ) ; // help options AdminParserUtils . acceptsHelp ( parser ) ; // required options parser . accepts ( OPT_HEAD_META_CHECK , "metadata keys to be checked" ) . withOptionalArg ( ) . describedAs ( "meta-key-list" ) . withValuesSeparatedBy ( ',' ) . ofType ( String . class ) ; AdminParserUtils . acceptsUrl ( parser ) ; return parser ;
public class SeaGlassInternalShadowEffect { /** * Create the gradient for a rounded shadow . * @ param s the shape of the gradient . This is only used for its bounds . * @ return the gradient . */ public Paint getRoundedShadowGradient ( Shape s ) { } }
Rectangle r = s . getBounds ( ) ; int x = r . x + r . width / 2 ; int y1 = r . y ; float frac = 1.0f / r . height ; int y2 = r . y + r . height ; return new LinearGradientPaint ( x , y1 , x , y2 , ( new float [ ] { 0f , frac , 1f } ) , new Color [ ] { innerShadow . top , innerShadow . bottom , innerShadow . bottom } ) ;
public class VirtualMachineImagesInner { /** * Gets a list of virtual machine image publishers for the specified Azure location . * @ param location The name of a supported Azure region . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the List & lt ; VirtualMachineImageResourceInner & gt ; object */ public Observable < List < VirtualMachineImageResourceInner > > listPublishersAsync ( String location ) { } }
return listPublishersWithServiceResponseAsync ( location ) . map ( new Func1 < ServiceResponse < List < VirtualMachineImageResourceInner > > , List < VirtualMachineImageResourceInner > > ( ) { @ Override public List < VirtualMachineImageResourceInner > call ( ServiceResponse < List < VirtualMachineImageResourceInner > > response ) { return response . body ( ) ; } } ) ;
public class DSClientUtilities { /** * Sets the basic value . * @ param entity * the entity * @ param member * the member * @ param columnName * the column name * @ param row * the row * @ param dataType * the data type * @ param metamodel * the metamodel */ private static void setBasicValue ( Object entity , Field member , String columnName , UDTValue row , CassandraType dataType , MetamodelImpl metamodel ) { } }
if ( row . isNull ( columnName ) ) { return ; } Object retVal = null ; switch ( dataType ) { case BYTES : // case CUSTOM : retVal = row . getBytes ( columnName ) ; if ( retVal != null ) { setFieldValue ( entity , member , ( ( ByteBuffer ) retVal ) . array ( ) ) ; } break ; case BOOLEAN : retVal = row . getBool ( columnName ) ; setFieldValue ( entity , member , retVal ) ; break ; case BIGINT : // bigints in embeddables and element collections are mapped / defined // by Long case LONG : case COUNTER : retVal = row . getLong ( columnName ) ; setFieldValue ( entity , member , retVal ) ; break ; case DECIMAL : retVal = row . getDecimal ( columnName ) ; setFieldValue ( entity , member , retVal ) ; break ; case DOUBLE : retVal = row . getDouble ( columnName ) ; setFieldValue ( entity , member , retVal ) ; break ; case FLOAT : retVal = row . getFloat ( columnName ) ; setFieldValue ( entity , member , retVal ) ; break ; case INET : retVal = row . getInet ( columnName ) ; setFieldValue ( entity , member , retVal ) ; break ; case INT : retVal = row . getInt ( columnName ) ; retVal = setIntValue ( member , retVal ) ; setFieldValue ( entity , member , retVal ) ; break ; case ASCII : case STRING : case CHARACTER : try { row . getBytes ( columnName ) ; } catch ( Exception e ) { // do nothing } retVal = row . getString ( columnName ) ; retVal = setTextValue ( entity , member , retVal ) ; setFieldValue ( entity , member , retVal ) ; break ; case TIMESTAMP : retVal = row . getTimestamp ( columnName ) ; if ( retVal != null && member != null ) retVal = CassandraDataTranslator . decompose ( member . getType ( ) , ByteBufferUtil . bytes ( ( ( Date ) retVal ) . getTime ( ) ) . array ( ) , true ) ; setFieldValue ( entity , member , retVal ) ; break ; case UUID : // case TIMEUUID : retVal = row . getUUID ( columnName ) ; setFieldValue ( entity , member , retVal ) ; break ; case LIST : Class listAttributeTypeClass = PropertyAccessorHelper . getGenericClass ( member ) ; Class listClazz = null ; boolean isElementCollectionList = false ; if ( listAttributeTypeClass . isAssignableFrom ( byte [ ] . class ) ) { listClazz = ByteBuffer . class ; } else if ( listAttributeTypeClass . isAnnotationPresent ( Embeddable . class ) ) { isElementCollectionList = true ; listClazz = UDTValue . class ; } else { listClazz = listAttributeTypeClass ; } retVal = row . getList ( columnName , listClazz ) ; Collection resultList = new ArrayList ( ) ; if ( isElementCollectionList ) { Iterator collectionItems = ( ( Collection ) retVal ) . iterator ( ) ; while ( collectionItems . hasNext ( ) ) { resultList . add ( setUDTValue ( entity , listAttributeTypeClass , ( UDTValue ) collectionItems . next ( ) , metamodel ) ) ; } } if ( retVal != null && ! ( ( List ) retVal ) . isEmpty ( ) && ! isElementCollectionList ) { if ( listAttributeTypeClass . isAssignableFrom ( byte [ ] . class ) ) { setFieldValue ( entity , member , CassandraDataTranslator . marshalCollection ( BytesType . class , ( Collection ) retVal , listAttributeTypeClass , ArrayList . class ) ) ; } else { Iterator collectionItems = ( ( Collection ) retVal ) . iterator ( ) ; while ( collectionItems . hasNext ( ) ) { resultList . add ( collectionItems . next ( ) ) ; } setFieldValue ( entity , member , resultList ) ; } } else if ( retVal != null && ! ( ( Collection ) retVal ) . isEmpty ( ) ) { setFieldValue ( entity , member , resultList ) ; } break ; case SET : Class setAttributeTypeClass = PropertyAccessorHelper . getGenericClass ( member ) ; Class setClazz = null ; boolean isElementCollectionSet = false ; if ( setAttributeTypeClass . isAssignableFrom ( byte [ ] . class ) ) { setClazz = ByteBuffer . class ; } else if ( setAttributeTypeClass . isAnnotationPresent ( Embeddable . class ) ) { isElementCollectionSet = true ; setClazz = UDTValue . class ; } else { setClazz = setAttributeTypeClass ; } retVal = row . getSet ( columnName , setClazz ) ; Collection resultSet = new HashSet ( ) ; if ( isElementCollectionSet ) { Iterator collectionItems = ( ( Collection ) retVal ) . iterator ( ) ; while ( collectionItems . hasNext ( ) ) { resultSet . add ( setUDTValue ( entity , setAttributeTypeClass , ( UDTValue ) collectionItems . next ( ) , metamodel ) ) ; } } if ( retVal != null && ! ( ( Set ) retVal ) . isEmpty ( ) && ! isElementCollectionSet ) { if ( setAttributeTypeClass . isAssignableFrom ( byte [ ] . class ) ) { setFieldValue ( entity , member , CassandraDataTranslator . marshalCollection ( BytesType . class , ( Collection ) retVal , setAttributeTypeClass , HashSet . class ) ) ; } else { Iterator collectionItems = ( ( Collection ) retVal ) . iterator ( ) ; while ( collectionItems . hasNext ( ) ) { resultSet . add ( collectionItems . next ( ) ) ; } setFieldValue ( entity , member , resultSet ) ; } } else if ( retVal != null && ! ( ( Collection ) retVal ) . isEmpty ( ) ) { setFieldValue ( entity , member , resultSet ) ; } break ; /* * ASCII , BIGINT , BLOB , BOOLEAN , COUNTER , DECIMAL , DOUBLE , FLOAT , INET , * INT , TEXT , TIMESTAMP , UUID , VARCHAR , VARINT , TIMEUUID , LIST , SET , * MAP , CUSTOM ; */ case MAP : List < Class < ? > > mapGenericClasses = PropertyAccessorHelper . getGenericClasses ( member ) ; Class keyClass = CassandraValidationClassMapper . getValidationClassInstance ( mapGenericClasses . get ( 0 ) , true ) ; Class valueClass = CassandraValidationClassMapper . getValidationClassInstance ( mapGenericClasses . get ( 1 ) , true ) ; Class mapValueClazz = null ; boolean isElementCollectionMap = false ; if ( mapGenericClasses . get ( 1 ) . isAssignableFrom ( byte [ ] . class ) ) { mapValueClazz = ByteBuffer . class ; } else if ( mapGenericClasses . get ( 1 ) . isAnnotationPresent ( Embeddable . class ) ) { isElementCollectionMap = true ; mapValueClazz = UDTValue . class ; } else { mapValueClazz = mapGenericClasses . get ( 1 ) ; } retVal = row . getMap ( columnName , mapGenericClasses . get ( 0 ) . isAssignableFrom ( byte [ ] . class ) ? ByteBuffer . class : mapGenericClasses . get ( 0 ) , mapValueClazz ) ; Map resultMap = new HashMap ( ) ; if ( isElementCollectionMap ) { Iterator keys = ( ( Map ) retVal ) . keySet ( ) . iterator ( ) ; while ( keys . hasNext ( ) ) { Object keyValue = keys . next ( ) ; resultMap . put ( keyValue , setUDTValue ( entity , mapGenericClasses . get ( 1 ) , ( UDTValue ) ( ( Map ) retVal ) . get ( keyValue ) , metamodel ) ) ; } } boolean isByteBuffer = mapGenericClasses . get ( 0 ) . isAssignableFrom ( byte [ ] . class ) || mapGenericClasses . get ( 1 ) . isAssignableFrom ( byte [ ] . class ) ; // set the values . if ( retVal != null && ! ( ( Map ) retVal ) . isEmpty ( ) && ! isElementCollectionMap ) { if ( isByteBuffer ) { setFieldValue ( entity , member , CassandraDataTranslator . marshalMap ( mapGenericClasses , keyClass , valueClass , ( Map ) retVal ) ) ; } else { Iterator keys = ( ( Map ) retVal ) . keySet ( ) . iterator ( ) ; while ( keys . hasNext ( ) ) { Object keyValue = keys . next ( ) ; resultMap . put ( keyValue , ( ( Map ) retVal ) . get ( keyValue ) ) ; } setFieldValue ( entity , member , resultMap ) ; } } else if ( retVal != null && ! ( ( Map ) retVal ) . isEmpty ( ) ) { setFieldValue ( entity , member , resultMap ) ; } break ; }
public class nssimpleacl_stats { /** * Use this API to fetch the statistics of all nssimpleacl _ stats resources that are configured on netscaler . */ public static nssimpleacl_stats get ( nitro_service service ) throws Exception { } }
nssimpleacl_stats obj = new nssimpleacl_stats ( ) ; nssimpleacl_stats [ ] response = ( nssimpleacl_stats [ ] ) obj . stat_resources ( service ) ; return response [ 0 ] ;
public class CharacterConverter { /** * Converts an { @ link Object } of { @ link Class type S } into an { @ link Object } of { @ link Class type T } . * @ param value { @ link Object } of { @ link Class type S } to convert . * @ return the converted { @ link Object } of { @ link Class type T } . * @ throws ConversionException if the { @ link Object } cannot be converted . * @ see org . cp . elements . data . conversion . ConversionService # convert ( Object , Class ) * @ see # convert ( Object , Class ) */ @ Override public Character convert ( Object value ) { } }
if ( value instanceof Character ) { return ( Character ) value ; } else if ( value instanceof String ) { String valueString = value . toString ( ) ; return valueString . length ( ) > 0 ? valueString . charAt ( 0 ) : '\0' ; } else { return super . convert ( value ) ; }
public class SFResultSet { /** * Advance to next row * @ return true if next row exists , false otherwise */ @ Override public boolean next ( ) throws SFException , SnowflakeSQLException { } }
if ( isClosed ( ) ) { return false ; } // otherwise try to fetch again if ( fetchNextRow ( ) ) { row ++ ; if ( isLast ( ) ) { long timeConsumeLastResult = System . currentTimeMillis ( ) - this . firstChunkTime ; logMetric ( TelemetryField . TIME_CONSUME_LAST_RESULT , timeConsumeLastResult ) ; } return true ; } else { logger . debug ( "end of result" ) ; /* * Here we check if the result has been truncated and throw exception if * so . */ if ( totalRowCountTruncated || System . getProperty ( "snowflake.enable_incident_test2" ) != null && System . getProperty ( "snowflake.enable_incident_test2" ) . equals ( "true" ) ) { throw ( SFException ) IncidentUtil . generateIncidentV2WithException ( session , new SFException ( ErrorCode . MAX_RESULT_LIMIT_EXCEEDED ) , queryId , null ) ; } // mark end of result return false ; }
public class RelationalJMapper { /** * This method verifies that the destinationClass exists . * @ param exception exception to handle * @ param clazz class to check * @ return a new instance of Class given as input */ private < I > I destinationClassControl ( Exception exception , Class < I > clazz ) { } }
try { if ( clazz == null ) throw new IllegalArgumentException ( "it's mandatory define the destination class" ) ; } catch ( Exception e ) { JmapperLog . error ( e ) ; return null ; } return logAndReturnNull ( exception ) ;
public class MapperScannerConfigurer { /** * { @ inheritDoc } * @ since 1.0.2 */ @ Override public void postProcessBeanDefinitionRegistry ( BeanDefinitionRegistry registry ) { } }
if ( this . processPropertyPlaceHolders ) { processPropertyPlaceHolders ( ) ; } ClassPathMapperScanner scanner = new ClassPathMapperScanner ( registry ) ; scanner . setAddToConfig ( this . addToConfig ) ; scanner . setAnnotationClass ( this . annotationClass ) ; scanner . setMarkerInterface ( this . markerInterface ) ; scanner . setSqlSessionFactory ( this . sqlSessionFactory ) ; scanner . setSqlSessionTemplate ( this . sqlSessionTemplate ) ; scanner . setSqlSessionFactoryBeanName ( this . sqlSessionFactoryBeanName ) ; scanner . setSqlSessionTemplateBeanName ( this . sqlSessionTemplateBeanName ) ; scanner . setResourceLoader ( this . applicationContext ) ; scanner . setBeanNameGenerator ( this . nameGenerator ) ; scanner . registerFilters ( ) ; // 设置通用 Mapper scanner . setMapperHelper ( this . mapperHelper ) ; scanner . scan ( StringUtils . tokenizeToStringArray ( this . basePackage , ConfigurableApplicationContext . CONFIG_LOCATION_DELIMITERS ) ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcRelAssignsToProduct ( ) { } }
if ( ifcRelAssignsToProductEClass == null ) { ifcRelAssignsToProductEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 524 ) ; } return ifcRelAssignsToProductEClass ;
public class GenericCollectionTypeResolver { /** * Determine the generic element type of the given Collection field . * @ param collectionField the collection field to introspect * @ param nestingLevel the nesting level of the target type * ( typically 1 ; e . g . in case of a List of Lists , 1 would indicate the * nested List , whereas 2 would indicate the element of the nested List ) * @ param typeIndexesPerLevel Map keyed by nesting level , with each value * expressing the type index for traversal at that level * @ return the generic type , or { @ code null } if none */ public static Class < ? > getCollectionFieldType ( Field collectionField , int nestingLevel , Map < Integer , Integer > typeIndexesPerLevel ) { } }
return getGenericFieldType ( collectionField , Collection . class , 0 , typeIndexesPerLevel , nestingLevel ) ;
public class Rollbar { /** * Record a warning message with extra information attached . * @ param message the message * @ param custom the extra information */ public void warning ( String message , Map < String , Object > custom ) { } }
log ( null , custom , message , Level . WARNING ) ;
public class StandardRequest { /** * Destroys current session . * @ see Request # destroySession ( ) */ public void destroySession ( ) { } }
if ( entryPoint != null ) { entryPoint . onSessionDestruction ( this , session ) ; } if ( accessManager != null ) { accessManager . destroyCurrentSession ( ) ; } session = null ;