signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ParserME { /** * Returns a parse for the specified parse of tokens . * @ param tokens The root node of a flat parse containing only tokens . * @ return A full parse of the specified tokens or the flat chunks of the tokens if a fullparse could not be found . */ public Parse parse ( Parse tokens ) { } }
Parse p = parse ( tokens , 1 ) [ 0 ] ; setParents ( p ) ; return p ;
public class TimeBasedAvroWriterPartitioner { /** * Check if the partition column value is present and is a Long object . Otherwise , use current system time . */ private static long getRecordTimestamp ( Optional < Object > writerPartitionColumnValue ) { } }
return writerPartitionColumnValue . orNull ( ) instanceof Long ? ( Long ) writerPartitionColumnValue . get ( ) : System . currentTimeMillis ( ) ;
public class FloatingLabelWidgetBase { /** * Inflate the widget layout and make sure we have everything in there * @ param context The context * @ param layoutId The id of the layout to inflate */ private void inflateWidgetLayout ( Context context , int layoutId ) { } }
inflate ( context , layoutId , this ) ; floatingLabel = ( TextView ) findViewById ( R . id . flw_floating_label ) ; if ( floatingLabel == null ) { throw new RuntimeException ( "Your layout must have a TextView whose ID is @id/flw_floating_label" ) ; } View iw = findViewById ( R . id . flw_input_widget ) ; if ( iw == null ) { throw new RuntimeException ( "Your layout must have an input widget whose ID is @id/flw_input_widget" ) ; } try { inputWidget = ( InputWidgetT ) iw ; } catch ( ClassCastException e ) { throw new RuntimeException ( "The input widget is not of the expected type" ) ; }
public class JPnlPropertyEditorDBMetaCatalog { /** * GEN - END : initComponents */ public void setEditorTarget ( PropertyEditorTarget target ) { } }
if ( target instanceof DBMetaCatalogNode ) { super . setEditorTarget ( target ) ; this . tfCatalogName . setText ( ( String ) target . getAttribute ( DBMetaCatalogNode . ATT_CATALOG_NAME ) ) ; } else { throw new UnsupportedOperationException ( "This editor can only edit DBMetaCatalogNode objects" ) ; }
public class PolicyEventsInner { /** * Queries policy events for the subscription level policy set definition . * @ param subscriptionId Microsoft Azure subscription ID . * @ param policySetDefinitionName Policy set definition name . * @ 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 < PolicyEventsQueryResultsInner > listQueryResultsForPolicySetDefinitionAsync ( String subscriptionId , String policySetDefinitionName , final ServiceCallback < PolicyEventsQueryResultsInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( listQueryResultsForPolicySetDefinitionWithServiceResponseAsync ( subscriptionId , policySetDefinitionName ) , serviceCallback ) ;
public class AWSServiceCatalogClient { /** * Gets information about the resource changes for the specified plan . * @ param describeProvisionedProductPlanRequest * @ return Result of the DescribeProvisionedProductPlan operation returned by the service . * @ throws ResourceNotFoundException * The specified resource was not found . * @ throws InvalidParametersException * One or more parameters provided to the operation are not valid . * @ sample AWSServiceCatalog . DescribeProvisionedProductPlan * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / servicecatalog - 2015-12-10 / DescribeProvisionedProductPlan " * target = " _ top " > AWS API Documentation < / a > */ @ Override public DescribeProvisionedProductPlanResult describeProvisionedProductPlan ( DescribeProvisionedProductPlanRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeDescribeProvisionedProductPlan ( request ) ;
public class IotVizClient { /** * Create a token * @ param ttl - token ' s time to live , in seconds * @ return a string token */ public String createToken ( int ttl ) { } }
checkArgument ( ttl > 0 ) ; CreateTokenRequest request = new CreateTokenRequest ( ) ; request . setTtl ( ttl ) ; InternalRequest internalRequest = createRequest ( request , HttpMethodName . POST , null , TOKEN ) ; CreateTokenResponse response = this . invokeHttpClient ( internalRequest , CreateTokenResponse . class ) ; return response . getToken ( ) ;
public class MethodAnnotation { /** * Get the " full " method name . This is a format which looks sort of like a * method signature that would appear in Java source code . * note : If shortenPackeges = = true , this will return the same value as * getNameInClass ( ) , except that method caches the result and this one does * not . Calling this one may be slow . * @ param shortenPackages * whether to shorten package names if they are in java or in the * same package as this method . */ public String getNameInClass ( boolean shortenPackages , boolean useJVMMethodName , boolean hash , boolean omitMethodName ) { } }
// Convert to " nice " representation StringBuilder result = new StringBuilder ( ) ; if ( ! omitMethodName ) { if ( useJVMMethodName ) { result . append ( getMethodName ( ) ) ; } else { result . append ( getJavaSourceMethodName ( ) ) ; } } result . append ( '(' ) ; // append args SignatureConverter converter = new SignatureConverter ( methodSig ) ; if ( converter . getFirst ( ) != '(' ) { throw new IllegalStateException ( "bad method signature " + methodSig ) ; } converter . skip ( ) ; boolean needsComma = false ; while ( converter . getFirst ( ) != ')' ) { if ( needsComma ) { if ( hash ) { result . append ( "," ) ; } else { result . append ( ", " ) ; } } if ( shortenPackages ) { result . append ( removePackageName ( converter . parseNext ( ) ) ) ; } else { result . append ( converter . parseNext ( ) ) ; } needsComma = true ; } converter . skip ( ) ; result . append ( ')' ) ; return result . toString ( ) ;
public class TargetsApi { /** * Get personal favorites * Get the agent & # 39 ; s personal favorites . * @ param limit Number of results to return . The default value is 50 . ( optional ) * @ return TargetsResponse * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */ public TargetsResponse getPersonalFavorites ( BigDecimal limit ) throws ApiException { } }
ApiResponse < TargetsResponse > resp = getPersonalFavoritesWithHttpInfo ( limit ) ; return resp . getData ( ) ;
public class ScheduleManager { /** * Schedules the flow , but doesn ' t save the schedule afterwards . */ private synchronized void internalSchedule ( final Schedule s ) { } }
this . scheduleIDMap . put ( s . getScheduleId ( ) , s ) ; this . scheduleIdentityPairMap . put ( s . getScheduleIdentityPair ( ) , s ) ;
public class BranchNode { /** * Returns true if one of the tree nodes has outer join */ @ Override public boolean hasOuterJoin ( ) { } }
assert ( m_leftNode != null && m_rightNode != null ) ; return m_joinType != JoinType . INNER || m_leftNode . hasOuterJoin ( ) || m_rightNode . hasOuterJoin ( ) ;
public class MapServiceContextImpl { /** * { @ inheritDoc } * The method will set the owned partition set in a CAS loop because * this method can be called concurrently . */ @ Override public void reloadOwnedPartitions ( ) { } }
final IPartitionService partitionService = nodeEngine . getPartitionService ( ) ; for ( ; ; ) { final PartitionIdSet expected = ownedPartitions . get ( ) ; final Collection < Integer > partitions = partitionService . getMemberPartitions ( nodeEngine . getThisAddress ( ) ) ; final PartitionIdSet newSet = immutablePartitionIdSet ( partitionService . getPartitionCount ( ) , partitions ) ; if ( ownedPartitions . compareAndSet ( expected , newSet ) ) { return ; } }
public class ProcCode { /** * Parse bb - code * Before invocation suspicious method must be call * @ param context the bb - processing context * @ return true - if parse source * false - if can ' t parse code * @ throws NestingException if nesting is too big . */ public boolean process ( Context context ) throws NestingException { } }
for ( ProcPattern pattern : patterns ) { Context codeContext = new Context ( context ) ; if ( pattern . parse ( codeContext ) ) { if ( transparent ) { codeContext . mergeWithParent ( ) ; } template . generate ( codeContext ) ; if ( logContext . isTraceEnabled ( ) ) { for ( Map . Entry < String , CharSequence > entry : context . getAttributes ( ) . entrySet ( ) ) { logContext . trace ( "Context: {} = {}" , entry . getKey ( ) , entry . getValue ( ) ) ; } } if ( logGenerate . isTraceEnabled ( ) ) { logGenerate . trace ( "Generated text: {}" , codeContext . getTarget ( ) ) ; } return true ; } } return false ;
public class SnapshotNode { /** * Shutdown snapshot node and attached daemons */ public void shutdown ( ) { } }
if ( purgeThread != null ) { WaitingRoomPurger purger = ( WaitingRoomPurger ) purgeThread . getRunnable ( ) ; purger . shutdown ( ) ; } RPC . stopProxy ( namenode ) ; if ( server != null ) server . stop ( ) ;
public class CharacterParser { public Match parseMax ( String src ) throws SyntaxError { } }
Options options = new Options ( ) ; return this . parseMax ( src , options ) ;
public class PropertiesUtils { /** * Load a file from an directory . * @ param baseUrl * Directory URL - Cannot be < code > null < / code > . * @ param filename * Filename without path - Cannot be < code > null < / code > . * @ return Properties . */ public static Properties loadProperties ( final URL baseUrl , final String filename ) { } }
return loadProperties ( createUrl ( baseUrl , "" , filename ) ) ;
public class ServiceDirectory { /** * Set the Directory User . * @ param userName * the user name . * @ param password * the password of the user . * @ throws ServiceException */ public static void setUser ( String userName , String password ) { } }
getImpl ( ) . getDirectoryServiceClient ( ) . setUser ( userName , password ) ;
public class Keys { private static int [ ] makeFields ( int [ ] fields , TupleTypeInfo < ? > type ) { } }
int inLength = type . getArity ( ) ; // null parameter means all fields are considered if ( fields == null || fields . length == 0 ) { fields = new int [ inLength ] ; for ( int i = 0 ; i < inLength ; i ++ ) { fields [ i ] = i ; } return fields ; } else { return rangeCheckAndOrderFields ( fields , inLength - 1 ) ; }
public class CloseInstancePublicPortsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CloseInstancePublicPortsRequest closeInstancePublicPortsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( closeInstancePublicPortsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( closeInstancePublicPortsRequest . getPortInfo ( ) , PORTINFO_BINDING ) ; protocolMarshaller . marshall ( closeInstancePublicPortsRequest . getInstanceName ( ) , INSTANCENAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class FieldMetadata { /** * Returns a Function which gets the ` isLegacyId ` setting from a FieldMetadata , if present , * or { @ link Optional # absent ( ) } if not , ish . * The semantics would ideally want are : * < pre > * 1 @ ThriftField ( id = X , isLegacyId = false ) = > Optional . of ( false ) * 2 @ ThriftField ( id = X , isLegacyId = true ) = > Optional . of ( true ) * 3 @ ThriftField ( isLegacyId = false ) = > Optional . of ( false ) * 4 @ ThriftField ( isLegacyId = true ) = > Optional . of ( true ) * 5 @ ThriftField ( ) = > Optional . absent ( ) * < / pre > * Unfortunately , there is no way to tell cases 3 and 5 apart , because isLegacyId * defaults to false . ( There is no good way around this : making an enum is overkill , * using a numeric / character / string / class type is pretty undesirable , and requiring * isLegacyId to be specified explicitly on every ThriftField is unacceptable . ) * The best we can do is treat 3 and 5 the same ( obviously needing the behavior * of 5 . ) This ends up actually not making much of a difference : it would fail to * detect cases like : * < pre > * @ ThriftField ( id = - 2 , isLegacyId = true ) * public boolean getBlah ( ) { . . . } * @ ThriftField ( isLegacyId = false ) * public void setBlah ( boolean v ) { . . . } * < / pre > * but other than that , ends up working out fine . */ static < T extends FieldMetadata > Function < T , Optional < Boolean > > getThriftFieldIsLegacyId ( ) { } }
return new Function < T , Optional < Boolean > > ( ) { @ Override public Optional < Boolean > apply ( @ Nullable T input ) { if ( input == null ) { return Optional . absent ( ) ; } Boolean value = input . isLegacyId ( ) ; if ( input . getId ( ) == null || input . getId ( ) . shortValue ( ) == Short . MIN_VALUE ) { if ( value != null && value . booleanValue ( ) == false ) { return Optional . absent ( ) ; } } return Optional . fromNullable ( value ) ; } } ;
public class AlternateOf { /** * Gets the value of the alternate2 property . * @ return * possible object is * { @ link org . openprovenance . prov . sql . IDRef } */ @ ManyToOne ( targetEntity = org . openprovenance . prov . sql . QualifiedName . class , cascade = { } }
CascadeType . ALL } ) @ JoinColumn ( name = "ALTERNATE2" ) public org . openprovenance . prov . model . QualifiedName getAlternate2 ( ) { return alternate2 ;
public class LineSignatureValidator { /** * Generate signature value . * @ param content Body of the http request . * @ return generated signature value . */ public byte [ ] generateSignature ( @ NonNull byte [ ] content ) { } }
try { Mac mac = Mac . getInstance ( HASH_ALGORITHM ) ; mac . init ( secretKeySpec ) ; return mac . doFinal ( content ) ; } catch ( NoSuchAlgorithmException | InvalidKeyException e ) { // " HmacSHA256 " is always supported in Java 8 platform . // ( see https : / / docs . oracle . com / javase / 8 / docs / api / javax / crypto / Mac . html ) // All valid - SecretKeySpec - instance are not InvalidKey . // ( because the key for HmacSHA256 can be of any length . see RFC2104) throw new IllegalStateException ( e ) ; }
public class ResourceCompliantRRPacking { /** * Attempts to place the instance the current containerId . * @ param planBuilder packing plan builder * @ param componentName the component name of the instance that needs to be placed in the container * @ throws ResourceExceededException if there is no room on the current container for the instance */ private void strictRRpolicy ( PackingPlanBuilder planBuilder , String componentName ) throws ConstraintViolationException { } }
planBuilder . addInstance ( this . containerId , componentName ) ; this . containerId = nextContainerId ( this . containerId ) ;
public class TaskManagerService { /** * See if the given in - progress task may be hung or abandoned . */ private void checkForDeadTask ( Tenant tenant , TaskRecord taskRecord ) { } }
Calendar lastReport = taskRecord . getTime ( TaskRecord . PROP_PROGRESS_TIME ) ; if ( lastReport == null ) { lastReport = taskRecord . getTime ( TaskRecord . PROP_START_TIME ) ; if ( lastReport == null ) { return ; // corrupt / incomplete task record } } long minsSinceLastActivity = ( System . currentTimeMillis ( ) - lastReport . getTimeInMillis ( ) ) / ( 1000 * 60 ) ; if ( isOurActiveTask ( tenant , taskRecord . getTaskID ( ) ) ) { checkForHungTask ( tenant , taskRecord , minsSinceLastActivity ) ; } else { checkForAbandonedTask ( tenant , taskRecord , minsSinceLastActivity ) ; }
public class Strings { /** * joins a collection of objects together as a String using a separator */ public static String join ( final Collection < ? > collection , final String separator ) { } }
StringBuffer buffer = new StringBuffer ( ) ; boolean first = true ; Iterator < ? > iter = collection . iterator ( ) ; while ( iter . hasNext ( ) ) { Object next = iter . next ( ) ; if ( first ) { first = false ; } else { buffer . append ( separator ) ; } buffer . append ( next ) ; } return buffer . toString ( ) ;
public class BaseLayoutHelper { /** * Helper function which do layout children and also update layoutRegion * but it won ' t consider margin in layout , so you need take care of margin if you apply margin to your layoutView * @ param child child that will be laid * @ param left left position * @ param top top position * @ param right right position * @ param bottom bottom position * @ param helper layoutManagerHelper , help to lay child */ protected void layoutChildWithMargin ( final View child , int left , int top , int right , int bottom , @ NonNull LayoutManagerHelper helper ) { } }
layoutChildWithMargin ( child , left , top , right , bottom , helper , false ) ;
public class XBlockExpressionImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case XbasePackage . XBLOCK_EXPRESSION__EXPRESSIONS : getExpressions ( ) . clear ( ) ; getExpressions ( ) . addAll ( ( Collection < ? extends XExpression > ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
public class GosuParser { /** * < i > array - value - list < / i > * & lt ; expression & gt ; * & lt ; array - value - list & gt ; , & lt ; expression & gt ; */ List < Expression > parseArrayValueList ( IType componentType ) { } }
while ( componentType instanceof TypeVariableType ) { componentType = ( ( TypeVariableType ) componentType ) . getBoundingType ( ) ; } List < Expression > valueExpressions = new ArrayList < > ( ) ; do { parseExpression ( new ContextType ( componentType ) ) ; Expression e = popExpression ( ) ; valueExpressions . add ( e ) ; } while ( match ( null , ',' ) ) ; return valueExpressions ;
public class ByteToCharBase { /** * Sets the encoding for the converter . */ public void setEncoding ( String encoding ) throws UnsupportedEncodingException { } }
if ( encoding != null ) { _readEncoding = Encoding . getReadEncoding ( this , encoding ) ; _readEncodingName = Encoding . getMimeName ( encoding ) ; } else { _readEncoding = null ; _readEncodingName = null ; }
public class AvatarShell { /** * run */ public int run ( String argv [ ] ) throws Exception { } }
if ( argv . length < 1 ) { printUsage ( ) ; return - 1 ; } AvatarShellCommand cmd = AvatarShellCommand . parseCommand ( argv ) ; if ( cmd == null ) { printUsage ( ) ; return - 1 ; } int exitCode = 0 ; if ( conf . get ( FSConstants . DFS_FEDERATION_NAMESERVICES ) != null && ( ! cmd . isServiceCommand ) && ( ! cmd . isAddressCommand ) ) { printServiceErrorMessage ( "AvatarShell" , conf ) ; return - 1 ; } String serviceName = null ; if ( cmd . isServiceCommand ) { serviceName = cmd . serviceArgs [ 0 ] ; } // commands without - { zero | one } prefix if ( cmd . isWaitTxIdCommand ) { AvatarZooKeeperClient zk = new AvatarZooKeeperClient ( conf , null ) ; try { processServiceName ( serviceName , true ) ; waitForLastTxIdNode ( zk , originalConf ) ; } catch ( Exception e ) { exitCode = - 1 ; printError ( e ) ; } finally { zk . shutdown ( ) ; } if ( exitCode == 0 ) { LOG . info ( "Primary shutdown was successful!" ) ; } return exitCode ; } if ( cmd . isFailoverCommand || cmd . isPrepfailoverCommand ) { boolean prep = cmd . isPrepfailoverCommand ; try { processServiceName ( serviceName , true ) ; exitCode = failover ( serviceName , prep ) ; } catch ( Exception e ) { exitCode = - 1 ; printError ( e ) ; } String prefix = prep ? "Prep" : "" ; if ( exitCode == 0 ) { LOG . info ( prefix + "Failover was successful!" ) ; if ( prep ) { System . out . println ( "WARNING: Standby is in pre-failover state! If the failover " + "is not performed, the standby needs to be restarted to " + "continue checkpointing." ) ; } } else { LOG . error ( prefix + "Failover failed!" ) ; if ( prep ) { System . out . println ( "WARNING: Standby is in bad state! Restart the standby node!" ) ; } } return exitCode ; } // / / / / / direct commands ( - zero - one - address ) String address = cmd . isAddressCommand ? cmd . addressArgs [ 0 ] : null ; String instance = cmd . isZeroCommand ? StartupOption . NODEZERO . getName ( ) : ( cmd . isOneCommand ? StartupOption . NODEONE . getName ( ) : null ) ; if ( ! processServiceName ( serviceName , false ) ) { return - 1 ; } // remove 0/1 suffix if ( instance != null ) { if ( ( conf = AvatarZKShell . updateConf ( instance , originalConf ) ) == null ) { printUsage ( ) ; return - 1 ; } } initAvatarRPC ( address ) ; try { if ( cmd . isShowAvatarCommand ) { exitCode = showAvatar ( ) ; } else if ( cmd . isSetAvatarCommand ) { exitCode = setAvatar ( "primary" , contains ( cmd . setAvatarArgs , "force" ) , serviceName , instance ) ; } else if ( cmd . isIsInitializedCommand ) { exitCode = isInitialized ( ) ; } else if ( cmd . isMetasaveCommand ) { exitCode = metasave ( cmd . metasageArgs [ 0 ] ) ; } else if ( cmd . isSaveNamespaceCommand ) { exitCode = saveNamespace ( cmd . getSaveNamespaceArgs ( ) ) ; } else if ( cmd . isShutdownAvatarCommand ) { shutdownAvatar ( serviceName ) ; } else if ( cmd . isSafemodeCommand ) { processSafeMode ( cmd . safemodeArgs [ 0 ] ) ; } else { exitCode = - 1 ; System . err . println ( "Unknown command" ) ; printUsage ( ) ; } } catch ( IllegalArgumentException arge ) { exitCode = - 1 ; arge . printStackTrace ( ) ; printError ( arge ) ; printUsage ( ) ; } catch ( RemoteException e ) { // This is a error returned by avatarnode server . Print // out the first line of the error mesage , ignore the stack trace . exitCode = - 1 ; try { String [ ] content ; content = e . getLocalizedMessage ( ) . split ( "\n" ) ; System . err . println ( content [ 0 ] ) ; } catch ( Exception ex ) { System . err . println ( ex . getLocalizedMessage ( ) ) ; } } catch ( IOException e ) { // IO exception encountered locally . exitCode = - 1 ; printError ( e ) ; } catch ( Throwable re ) { exitCode = - 1 ; printError ( re ) ; } finally { } if ( exitCode == 0 ) { LOG . info ( "Command was successful!" ) ; } return exitCode ;
public class FtpFileUtil { /** * Upload a given file to FTP server . * @ param hostName the FTP server host name to connect * @ param port the port to connect * @ param userName the user name * @ param password the password * @ param localFileFullName the full name ( inclusive path ) of the local file . * @ param remotePath the path to the file on the FTP . * @ return reply string from FTP server after the command has been executed . * @ throws RuntimeException in case any exception has been thrown . */ public static String uploadFileToFTPServer ( String hostName , Integer port , String userName , String password , String localFileFullName , String remotePath ) { } }
String result = null ; FTPClient ftpClient = new FTPClient ( ) ; String errorMessage = "Unable to upload file '%s' for FTP server '%s'." ; InputStream inputStream = null ; try { connectAndLoginOnFTPServer ( ftpClient , hostName , port , userName , password ) ; ftpClient . setFileType ( FTP . BINARY_FILE_TYPE ) ; ftpClient . enterLocalPassiveMode ( ) ; // String fullLocalPath = localPath + fileName ; File localFile = new File ( localFileFullName ) ; // String fullRemotePath = remotePath + fileName ; String remoteFile = remotePath + FilenameUtils . getName ( localFileFullName ) ; inputStream = new FileInputStream ( localFile ) ; boolean uploadFinished = ftpClient . storeFile ( remoteFile , inputStream ) ; if ( uploadFinished ) { result = String . format ( "File '%s' successfully uploaded" , localFileFullName ) ; } else { result = String . format ( "Failed upload '%s' file to FTP server. Got reply: %s" , localFileFullName , ftpClient . getReplyString ( ) ) ; } } catch ( IOException ex ) { throw new RuntimeException ( String . format ( errorMessage , remotePath , hostName ) , ex ) ; } finally { closeInputStream ( inputStream ) ; disconnectAndLogoutFromFTPServer ( ftpClient , hostName ) ; } return result ;
public class ServerLogImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) public EList < LogAction > getActions ( ) { } }
return ( EList < LogAction > ) eGet ( LogPackage . Literals . SERVER_LOG__ACTIONS , true ) ;
public class PathUtils { /** * Use { @ link java . nio . file . Path # relativize ( java . nio . file . Path ) } in JDK1.7. * @ param baseDir * @ param file * @ return */ public static String getRelativePath ( File baseDir , File file ) { } }
if ( ! baseDir . isDirectory ( ) ) { throw new IllegalArgumentException ( "Base directory must be a directory." ) ; } String dirPath = FilenameUtils . normalize ( baseDir . getAbsolutePath ( ) , true ) ; String filePath = FilenameUtils . normalize ( file . getAbsolutePath ( ) , true ) ; if ( ! dirPath . endsWith ( "/" ) ) { dirPath += "/" ; } if ( filePath . startsWith ( dirPath ) ) { return filePath . substring ( dirPath . length ( ) ) ; } else { throw new IllegalArgumentException ( "File '" + file + "' not in base directory '" + baseDir + "'" ) ; }
public class PeriodFormatterBuilder { /** * Constructs a PeriodFormatter using all the appended elements . * This is the main method used by applications at the end of the build * process to create a usable formatter . * Once this method has been called , the builder is in an invalid state . * The returned formatter may not support both printing and parsing . * The methods { @ link PeriodFormatter # isPrinter ( ) } and * { @ link PeriodFormatter # isParser ( ) } will help you determine the state * of the formatter . * @ return the newly created formatter * @ throws IllegalStateException if the builder can produce neither a printer nor a parser */ public PeriodFormatter toFormatter ( ) { } }
PeriodFormatter formatter = toFormatter ( iElementPairs , iNotPrinter , iNotParser ) ; for ( FieldFormatter fieldFormatter : iFieldFormatters ) { if ( fieldFormatter != null ) { fieldFormatter . finish ( iFieldFormatters ) ; } } iFieldFormatters = ( FieldFormatter [ ] ) iFieldFormatters . clone ( ) ; return formatter ;
public class LogHelper { /** * Generically log something * @ param aLoggingClass * Logging class to use . May not be < code > null < / code > . * @ param aErrorLevelProvider * Error level provided to use . May not be < code > null < / code > . * @ param aMsgSupplier * Message supplier to use . The supplier is only invoked if the log * level is enabled on the provided logger . May not be * < code > null < / code > . * @ param t * Optional exception that occurred . May be < code > null < / code > . * @ since 9.1.3 */ public static void log ( @ Nonnull final Class < ? > aLoggingClass , @ Nonnull final IHasErrorLevel aErrorLevelProvider , @ Nonnull final Supplier < String > aMsgSupplier , @ Nullable final Throwable t ) { } }
log ( LoggerFactory . getLogger ( aLoggingClass ) , aErrorLevelProvider . getErrorLevel ( ) , aMsgSupplier , t ) ;
public class Options { /** * Convert a comma separated list of extension names to an int . Each name is * converted to upper case , any ' - ' is replaced by ' _ ' . The result is expected to * be a flag from { @ link Extensions } . * @ param extensions A comma separated list of PegDown extensions . * @ return An ` int ` representing the enabled Pegdown extensions . */ public static int toExtensions ( String extensions ) { } }
int result = 0 ; for ( String ext : Splitter . on ( ',' ) . trimResults ( ) . omitEmptyStrings ( ) . split ( extensions ) ) { try { Field f = Extensions . class . getField ( ext . replace ( '-' , '_' ) . toUpperCase ( ) ) ; result |= ( int ) f . get ( null ) ; } catch ( NoSuchFieldException e ) { throw new IllegalArgumentException ( "No such extension: " + ext ) ; } catch ( IllegalAccessException e ) { throw new IllegalArgumentException ( "Cannot read int value for extension " + ext + ": " + e , e ) ; } } return result ;
public class ValidationResult { /** * Adds an error . * @ param desc Error description * @ param loc Error Location * @ param value the integer value that caused the error */ public void addError ( String desc , String loc , long value ) { } }
iaddError ( desc , "" + value , loc ) ;
public class MessageDecryption { /** * 随机生成16位字符串 */ private String getRandomStr ( ) { } }
String base = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" ; Random random = new Random ( ) ; StringBuffer sb = new StringBuffer ( ) ; for ( int i = 0 ; i < 16 ; i ++ ) { int number = random . nextInt ( base . length ( ) ) ; sb . append ( base . charAt ( number ) ) ; } return sb . toString ( ) ;
public class Unpooled { /** * Creates a new 4 - byte big - endian buffer that holds the specified 32 - bit floating point number . */ public static ByteBuf copyFloat ( float value ) { } }
ByteBuf buf = buffer ( 4 ) ; buf . writeFloat ( value ) ; return buf ;
public class PmiModuleConfig { /** * Returns the data ID for a Statistic name in this module ( Stats ) */ public int getDataId ( String name ) { } }
Iterator allData = perfData . values ( ) . iterator ( ) ; while ( allData . hasNext ( ) ) { PmiDataInfo dataInfo = ( PmiDataInfo ) allData . next ( ) ; if ( dataInfo . getName ( ) . equalsIgnoreCase ( name ) ) return dataInfo . getId ( ) ; } return UNKNOWN_ID ;
public class Dater { /** * Analyst date time string * @ param date * @ return */ private static String analyst ( String date ) { } }
String style = null ; boolean hasDiagonal = false ; Replacer r = Replacer . of ( checkNotNull ( date ) ) ; if ( hasDiagonal = r . contain ( "/" ) ) { r . update ( r . lookups ( "/" ) . with ( "-" ) ) ; } // ISO if ( r . containAll ( "." , "T" ) ) { style = DateStyle . ISO_FORMAT ; } // CST else if ( r . contain ( "CST" ) ) { style = DateStyle . CST_FORMAT ; } // GMT else if ( r . contain ( "GMT" ) ) { style = DateStyle . GMT_FORMAT ; } // analyst else { switch ( date . length ( ) ) { case 6 : style = "HHmmss" ; break ; case 8 : style = r . contain ( ":" ) ? DateStyle . HH_mm_ss : DateStyle . yyyyMMdd ; break ; case 10 : style = DateStyle . yyyy_MM_dd ; break ; case 14 : style = DateStyle . yyyyMMddHHmmss ; break ; case 19 : style = DateStyle . yyyy_MM_dd_HH_mm_ss ; break ; } } return hasDiagonal ? r . set ( style ) . lookups ( "-" ) . with ( "/" ) : style ;
public class AbstractNegatedTokenImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public NotificationChain eInverseRemove ( InternalEObject otherEnd , int featureID , NotificationChain msgs ) { } }
switch ( featureID ) { case XtextPackage . ABSTRACT_NEGATED_TOKEN__TERMINAL : return basicSetTerminal ( null , msgs ) ; } return super . eInverseRemove ( otherEnd , featureID , msgs ) ;
public class CmsWebdavServlet { /** * Handle a partial PUT . < p > * New content specified in request is appended to * existing content in oldRevisionContent ( if present ) . This code does * not support simultaneous partial updates to the same resource . < p > * @ param req the servlet request we are processing * @ param range the range of the content in the file * @ param path the path where to find the resource * @ return the new content file with the appended data * @ throws IOException if an input / output error occurs */ protected File executePartialPut ( HttpServletRequest req , CmsWebdavRange range , String path ) throws IOException { } }
// Append data specified in ranges to existing content for this // resource - create a temp . file on the local filesystem to // perform this operation File tempDir = ( File ) getServletContext ( ) . getAttribute ( ATT_SERVLET_TEMPDIR ) ; // Convert all ' / ' characters to ' . ' in resourcePath String convertedResourcePath = path . replace ( '/' , '.' ) ; File contentFile = new File ( tempDir , convertedResourcePath ) ; contentFile . createNewFile ( ) ; RandomAccessFile randAccessContentFile = new RandomAccessFile ( contentFile , "rw" ) ; InputStream oldResourceStream = null ; try { I_CmsRepositoryItem item = m_session . getItem ( path ) ; oldResourceStream = new ByteArrayInputStream ( item . getContent ( ) ) ; } catch ( CmsException e ) { if ( LOG . isErrorEnabled ( ) ) { LOG . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_ITEM_NOT_FOUND_1 , path ) , e ) ; } } // Copy data in oldRevisionContent to contentFile if ( oldResourceStream != null ) { int numBytesRead ; byte [ ] copyBuffer = new byte [ BUFFER_SIZE ] ; while ( ( numBytesRead = oldResourceStream . read ( copyBuffer ) ) != - 1 ) { randAccessContentFile . write ( copyBuffer , 0 , numBytesRead ) ; } oldResourceStream . close ( ) ; } randAccessContentFile . setLength ( range . getLength ( ) ) ; // Append data in request input stream to contentFile randAccessContentFile . seek ( range . getStart ( ) ) ; int numBytesRead ; byte [ ] transferBuffer = new byte [ BUFFER_SIZE ] ; BufferedInputStream requestBufInStream = new BufferedInputStream ( req . getInputStream ( ) , BUFFER_SIZE ) ; while ( ( numBytesRead = requestBufInStream . read ( transferBuffer ) ) != - 1 ) { randAccessContentFile . write ( transferBuffer , 0 , numBytesRead ) ; } randAccessContentFile . close ( ) ; requestBufInStream . close ( ) ; return contentFile ;
public class DTDEnumAttr { /** * Method called by the validator * to let the attribute do necessary normalization and / or validation * for the value . */ @ Override public String validate ( DTDValidatorBase v , char [ ] cbuf , int start , int end , boolean normalize ) throws XMLStreamException { } }
String ok = validateEnumValue ( cbuf , start , end , normalize , mEnumValues ) ; if ( ok == null ) { String val = new String ( cbuf , start , ( end - start ) ) ; return reportValidationProblem ( v , "Invalid enumerated value '" + val + "': has to be one of (" + mEnumValues + ")" ) ; } return ok ;
public class Choice5 { /** * { @ inheritDoc } */ @ Override public < F > Choice5 < A , B , C , D , F > zip ( Applicative < Function < ? super E , ? extends F > , Choice5 < A , B , C , D , ? > > appFn ) { } }
return Monad . super . zip ( appFn ) . coerce ( ) ;
public class ZipChemCompProvider { /** * Use DownloadChemCompProvider to grab a gzipped cif record from the PDB . * Zip all downloaded cif . gz files into the dictionary . * @ param recordName is the three - letter chemical component code ( i . e . residue name ) . * @ return ChemComp matching recordName */ private ChemComp downloadAndAdd ( String recordName ) { } }
final ChemComp cc = m_dlProvider . getChemComp ( recordName ) ; // final File [ ] files = finder ( m _ tempDir . resolve ( " chemcomp " ) . toString ( ) , " cif . gz " ) ; final File [ ] files = new File [ 1 ] ; Path cif = m_tempDir . resolve ( "chemcomp" ) . resolve ( recordName + ".cif.gz" ) ; files [ 0 ] = cif . toFile ( ) ; if ( files [ 0 ] != null ) { addToZipFileSystem ( m_zipFile , files , m_zipRootDir ) ; if ( m_removeCif ) for ( File f : files ) f . delete ( ) ; } return cc ;
public class ApiOvhTelephony { /** * Ask to cancel the portability * REST : POST / telephony / { billingAccount } / portability / { id } / cancel * @ param reason [ required ] The cancellation reason * @ param billingAccount [ required ] The name of your billingAccount * @ param id [ required ] The ID of the portability */ public void billingAccount_portability_id_cancel_POST ( String billingAccount , Long id , String reason ) throws IOException { } }
String qPath = "/telephony/{billingAccount}/portability/{id}/cancel" ; StringBuilder sb = path ( qPath , billingAccount , id ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "reason" , reason ) ; exec ( qPath , "POST" , sb . toString ( ) , o ) ;
public class VendorExtensionImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public NotificationChain eInverseRemove ( InternalEObject otherEnd , int featureID , NotificationChain msgs ) { } }
switch ( featureID ) { case BpsimPackage . VENDOR_EXTENSION__ANY : return ( ( InternalEList < ? > ) getAny ( ) ) . basicRemove ( otherEnd , msgs ) ; case BpsimPackage . VENDOR_EXTENSION__ANY_ATTRIBUTE : return ( ( InternalEList < ? > ) getAnyAttribute ( ) ) . basicRemove ( otherEnd , msgs ) ; } return super . eInverseRemove ( otherEnd , featureID , msgs ) ;
public class GenericTableModel { /** * Update the row . * @ param row * the row */ public void update ( final T row ) { } }
final int index = data . indexOf ( row ) ; if ( index != - 1 ) { data . set ( index , row ) ; fireTableDataChanged ( ) ; }
public class OAuth20Utils { /** * Gets attributes . * @ param attributes the attributes * @ param context the context * @ return the attributes */ public static Map < String , Object > getRequestParameters ( final Collection < String > attributes , final HttpServletRequest context ) { } }
return attributes . stream ( ) . filter ( a -> StringUtils . isNotBlank ( context . getParameter ( a ) ) ) . map ( m -> { val values = context . getParameterValues ( m ) ; val valuesSet = new LinkedHashSet < Object > ( ) ; if ( values != null && values . length > 0 ) { Arrays . stream ( values ) . forEach ( v -> valuesSet . addAll ( Arrays . stream ( v . split ( " " ) ) . collect ( Collectors . toSet ( ) ) ) ) ; } return Pair . of ( m , valuesSet ) ; } ) . collect ( Collectors . toMap ( Pair :: getKey , Pair :: getValue ) ) ;
public class DescribeDBLogFilesResult { /** * The DB log files returned . * @ param describeDBLogFiles * The DB log files returned . */ public void setDescribeDBLogFiles ( java . util . Collection < DescribeDBLogFilesDetails > describeDBLogFiles ) { } }
if ( describeDBLogFiles == null ) { this . describeDBLogFiles = null ; return ; } this . describeDBLogFiles = new com . amazonaws . internal . SdkInternalList < DescribeDBLogFilesDetails > ( describeDBLogFiles ) ;
public class JobResource { /** * The Amazon Machine Images ( AMIs ) associated with this job . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setEc2AmiResources ( java . util . Collection ) } or { @ link # withEc2AmiResources ( java . util . Collection ) } if you * want to override the existing values . * @ param ec2AmiResources * The Amazon Machine Images ( AMIs ) associated with this job . * @ return Returns a reference to this object so that method calls can be chained together . */ public JobResource withEc2AmiResources ( Ec2AmiResource ... ec2AmiResources ) { } }
if ( this . ec2AmiResources == null ) { setEc2AmiResources ( new java . util . ArrayList < Ec2AmiResource > ( ec2AmiResources . length ) ) ; } for ( Ec2AmiResource ele : ec2AmiResources ) { this . ec2AmiResources . add ( ele ) ; } return this ;
public class FormValidations { /** * Validates an internet address ( url , email address , etc . ) . * @ param address The address to validate * @ return { @ link hudson . util . FormValidation . ok ( ) } if valid or empty , error otherwise */ public static FormValidation validateInternetAddress ( String address ) { } }
if ( Strings . isNullOrEmpty ( address ) ) { return FormValidation . ok ( ) ; } Matcher matcher = VALID_EMAIL_PATTERN . matcher ( address ) ; if ( matcher . matches ( ) ) { return FormValidation . ok ( ) ; } else { return FormValidation . error ( "Email address is invalid" ) ; }
public class TreeKernel { /** * 计算Tree Kernel * @ param t1 * @ param t2 * @ param depth * @ return */ private float getDepScore ( DependencyTree t1 , DependencyTree t2 , int depth ) { } }
float score = 0.0f ; float modify = getDepthModify ( depth ) ; if ( modify == 0 ) return score ; double sScore = getWordScore ( t1 , t2 ) ; if ( sScore != 0 ) score += modify * sScore ; else score += factor * modify * getTagScore ( t1 , t2 ) ; for ( int i = 0 ; i < t1 . leftChilds . size ( ) ; i ++ ) for ( int j = 0 ; j < t2 . leftChilds . size ( ) ; j ++ ) score += getDepScore ( t1 . leftChilds . get ( i ) , t2 . leftChilds . get ( j ) , depth + 1 ) ; // for ( int i = 0 ; i < t1 . leftChilds . size ( ) ; i + + ) // for ( int j = 0 ; j < t2 . rightChilds . size ( ) ; j + + ) // score + = getDepScore ( t1 . leftChilds . get ( i ) , t2 . rightChilds . get ( j ) , depth + 1 ) ; // for ( int i = 0 ; i < t1 . rightChilds . size ( ) ; i + + ) // for ( int j = 0 ; j < t2 . leftChilds . size ( ) ; j + + ) // score + = getDepScore ( t1 . rightChilds . get ( i ) , t2 . leftChilds . get ( j ) , depth + 1 ) ; for ( int i = 0 ; i < t1 . rightChilds . size ( ) ; i ++ ) for ( int j = 0 ; j < t2 . rightChilds . size ( ) ; j ++ ) score += getDepScore ( t1 . rightChilds . get ( i ) , t2 . rightChilds . get ( j ) , depth + 1 ) ; return score ;
public class DateConverter { /** * { @ inheritDoc } */ protected Object doConvert ( String value ) { } }
try { return format . parse ( value ) ; } catch ( ParseException ex ) { throw new IllegalArgumentException ( "Unsupported date format" , ex ) ; }
public class ListAccountsResult { /** * A list of objects in the organization . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setAccounts ( java . util . Collection ) } or { @ link # withAccounts ( java . util . Collection ) } if you want to override * the existing values . * @ param accounts * A list of objects in the organization . * @ return Returns a reference to this object so that method calls can be chained together . */ public ListAccountsResult withAccounts ( Account ... accounts ) { } }
if ( this . accounts == null ) { setAccounts ( new java . util . ArrayList < Account > ( accounts . length ) ) ; } for ( Account ele : accounts ) { this . accounts . add ( ele ) ; } return this ;
public class FSNamesystem { /** * stores the modification and access time for this inode . * The access time is precise upto an hour . The transaction , if needed , is * written to the edits log but is not flushed . */ public void setTimes ( String src , long mtime , long atime ) throws IOException { } }
if ( ! accessTimeTouchable && atime != - 1 ) { throw new AccessTimeException ( "setTimes is not allowed for accessTime" ) ; } setTimesInternal ( src , mtime , atime ) ; getEditLog ( ) . logSync ( false ) ;
public class HaltonUniformDistribution { /** * Compute the inverse with respect to the given base . * @ param current Current value * @ return Integer inverse */ private long inverse ( double current ) { } }
// Represent to base b . short [ ] digits = new short [ maxi ] ; for ( int j = 0 ; j < maxi ; j ++ ) { current *= base ; digits [ j ] = ( short ) current ; current -= digits [ j ] ; if ( current <= 1e-10 ) { break ; } } long inv = 0 ; for ( int j = maxi - 1 ; j >= 0 ; j -- ) { inv = inv * base + digits [ j ] ; } return inv ;
public class JvmTypesBuilder { /** * / * @ Nullable */ public JvmGenericType toInterface ( /* @ Nullable */ EObject sourceElement , /* @ Nullable */ String name , /* @ Nullable */ Procedure1 < ? super JvmGenericType > initializer ) { } }
final JvmGenericType result = createJvmGenericType ( sourceElement , name ) ; if ( result == null ) return null ; result . setInterface ( true ) ; result . setAbstract ( true ) ; associate ( sourceElement , result ) ; return initializeSafely ( result , initializer ) ;
public class MessageProcessorControl { /** * / * ( non - Javadoc ) * @ see com . ibm . ws . sib . processor . runtime . SIMPMessageProcessorControllable # getRemoteSubscriptionIterator ( ) */ public SIMPIterator getRemoteSubscriptionIterator ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getRemoteSubscriptionIterator" ) ; DestinationTypeFilter filter = new DestinationTypeFilter ( ) ; filter . QUEUE = Boolean . FALSE ; Collection mpAIHCollection = new LinkedList ( ) ; for ( SIMPIterator iter = destinationIndex . iterator ( filter ) ; iter . hasNext ( ) ; ) { BaseDestinationHandler destination = ( BaseDestinationHandler ) iter . next ( ) ; Map destAIHMap = destination . getPseudoDurableAIHMap ( ) ; mpAIHCollection . add ( destAIHMap . values ( ) ) ; } AttachedRemoteSubscriberIterator remoteSubscriptionItr = new AttachedRemoteSubscriberIterator ( mpAIHCollection ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getRemoteSubscriptionIterator" , remoteSubscriptionItr ) ; return remoteSubscriptionItr ;
public class CmsImageAdvancedForm { /** * Displays the provided image information . < p > * @ param imageInfo the image information * @ param imageAttributes the image attributes * @ param initialFill flag to indicate that a new image has been selected */ public void fillContent ( CmsImageInfoBean imageInfo , CmsJSONMap imageAttributes , boolean initialFill ) { } }
for ( Entry < Attribute , I_CmsFormWidget > entry : m_fields . entrySet ( ) ) { String val = imageAttributes . getString ( entry . getKey ( ) . name ( ) ) ; if ( CmsStringUtil . isNotEmptyOrWhitespaceOnly ( val ) ) { if ( ( entry . getKey ( ) == Attribute . linkPath ) && val . startsWith ( CmsCoreProvider . get ( ) . getVfsPrefix ( ) ) ) { entry . getValue ( ) . setFormValueAsString ( val . substring ( CmsCoreProvider . get ( ) . getVfsPrefix ( ) . length ( ) ) ) ; } else { entry . getValue ( ) . setFormValueAsString ( val ) ; } } }
public class YPipe { /** * Check whether item is available for reading . */ @ Override public boolean checkRead ( ) { } }
// Was the value prefetched already ? If so , return . int h = queue . frontPos ( ) ; if ( h != r ) { return true ; } // There ' s no prefetched value , so let us prefetch more values . // Prefetching is to simply retrieve the // pointer from c in atomic fashion . If there are no // items to prefetch , set c to - 1 ( using compare - and - swap ) . if ( c . compareAndSet ( h , - 1 ) ) { // nothing to read , h = = r must be the same } else { // something to have been written r = c . get ( ) ; } // If there are no elements prefetched , exit . // During pipe ' s lifetime r should never be NULL , however , // it can happen during pipe shutdown when items // are being deallocated . if ( h == r || r == - 1 ) { return false ; } // There was at least one value prefetched . return true ;
public class CmsResourceTreeContainer { /** * Gets the name to display for the given resource . < p > * @ param cms the CMS context * @ param resource a resource * @ param parentId the id of the parent of the resource * @ return the name for the given resoure */ protected String getName ( CmsObject cms , CmsResource resource , CmsUUID parentId ) { } }
return parentId == null ? resource . getRootPath ( ) : resource . getName ( ) ;
public class PostBuilder { /** * Add existing Category term items when building a post . */ public PostBuilder withCategories ( Term ... terms ) { } }
return withCategories ( Arrays . stream ( terms ) . map ( Term :: getId ) . collect ( toList ( ) ) ) ;
public class Math { /** * Returns the index of maximum value of an array . */ public static int whichMax ( int [ ] x ) { } }
int m = x [ 0 ] ; int which = 0 ; for ( int i = 1 ; i < x . length ; i ++ ) { if ( x [ i ] > m ) { m = x [ i ] ; which = i ; } } return which ;
public class JenkinsServer { /** * Get a list of all the computers on the server ( at the summary level ) * @ return map of defined computers ( summary level , for details @ see * Computer # details * @ throws IOException in case of an error . */ public Map < String , Computer > getComputers ( ) throws IOException { } }
List < Computer > computers = client . get ( "computer/" , Computer . class ) . getComputers ( ) ; return computers . stream ( ) . map ( SET_CLIENT ( this . client ) ) . collect ( Collectors . toMap ( s -> s . getDisplayName ( ) . toLowerCase ( ) , Function . identity ( ) ) ) ;
public class Predicates { /** * Adds a clause that checks whether ANY set bits in a bitmask are present * in a numeric expression . * @ param expr * SQL numeric expression to check . * @ param bits * Integer containing the bits for which to check . */ public static Predicate anyBitsSet ( final String expr , final long bits ) { } }
return new Predicate ( ) { private String param ; public void init ( AbstractSqlCreator creator ) { param = creator . allocateParameter ( ) ; creator . setParameter ( param , bits ) ; } public String toSql ( ) { return String . format ( "(%s & :%s) > 0" , expr , param ) ; } } ;
public class IOWritePool { /** * Write the given buffer . */ public void write ( ByteBuffer buffer ) throws IOException { } }
synchronized ( buffers ) { if ( writing == null ) { writing = io . writeAsync ( buffer ) ; writing . listenInline ( listener ) ; return ; } if ( writing . hasError ( ) ) throw writing . getError ( ) ; buffers . add ( buffer ) ; }
public class CredentialUtils { /** * Returns the credentials provider that will be used to fetch the * credentials when signing the request . Request specific credentials * takes precedence over the credentials / credentials provider set in the * client . */ public static AWSCredentialsProvider getCredentialsProvider ( AmazonWebServiceRequest req , AWSCredentialsProvider base ) { } }
if ( req != null && req . getRequestCredentialsProvider ( ) != null ) { return req . getRequestCredentialsProvider ( ) ; } return base ;
public class StackedTryBlocks { /** * overrides the visitor to document what catch blocks do with regard to rethrowing the exceptions , and if the message is a static message * @ param seen * the currently parsed opcode */ @ Override public void sawOpcode ( int seen ) { } }
String message = null ; try { stack . precomputation ( this ) ; if ( ( seen == Const . TABLESWITCH ) || ( seen == Const . LOOKUPSWITCH ) ) { int pc = getPC ( ) ; for ( int offset : getSwitchOffsets ( ) ) { transitionPoints . set ( pc + offset ) ; } transitionPoints . set ( pc + getDefaultSwitchOffset ( ) ) ; } else if ( isBranch ( seen ) && ( getBranchOffset ( ) < 0 ) ) { // throw out try blocks in loops , this could cause false // negatives // with two try / catches in one loop , but more unlikely Iterator < TryBlock > it = blocks . iterator ( ) ; int target = getBranchTarget ( ) ; while ( it . hasNext ( ) ) { TryBlock block = it . next ( ) ; if ( block . getStartPC ( ) >= target ) { it . remove ( ) ; } } } int pc = getPC ( ) ; TryBlock block = findBlockWithStart ( pc ) ; if ( block != null ) { inBlocks . add ( block ) ; block . setState ( TryBlock . State . IN_TRY ) ; } if ( inBlocks . isEmpty ( ) ) { return ; } TryBlock innerBlock = inBlocks . get ( inBlocks . size ( ) - 1 ) ; int nextPC = getNextPC ( ) ; if ( innerBlock . atHandlerPC ( nextPC ) ) { if ( ( seen == Const . GOTO ) || ( seen == Const . GOTO_W ) ) { innerBlock . setEndHandlerPC ( getBranchTarget ( ) ) ; } else { inBlocks . remove ( innerBlock ) ; blocks . remove ( innerBlock ) ; } } else if ( innerBlock . atHandlerPC ( pc ) ) { innerBlock . setState ( TryBlock . State . IN_CATCH ) ; } else if ( innerBlock . atEndHandlerPC ( pc ) ) { inBlocks . remove ( inBlocks . size ( ) - 1 ) ; innerBlock . setState ( TryBlock . State . AFTER ) ; } if ( transitionPoints . get ( nextPC ) ) { if ( innerBlock . inCatch ( ) && ( innerBlock . getEndHandlerPC ( ) > nextPC ) ) { innerBlock . setEndHandlerPC ( nextPC ) ; } } if ( innerBlock . inCatch ( ) ) { if ( ( ( seen >= Const . IFEQ ) && ( ( seen <= Const . RET ) ) ) || ( seen == Const . GOTO_W ) || OpcodeUtils . isReturn ( seen ) ) { blocks . remove ( innerBlock ) ; inBlocks . remove ( inBlocks . size ( ) - 1 ) ; } else if ( seen == Const . ATHROW ) { if ( stack . getStackDepth ( ) > 0 ) { OpcodeStack . Item item = stack . getStackItem ( 0 ) ; XMethod xm = item . getReturnValueOf ( ) ; if ( xm != null ) { innerBlock . setThrowSignature ( xm . getSignature ( ) ) ; } innerBlock . setExceptionSignature ( item . getSignature ( ) ) ; innerBlock . setMessage ( ( String ) item . getUserValue ( ) ) ; } else { inBlocks . remove ( inBlocks . size ( ) - 1 ) ; innerBlock . setState ( TryBlock . State . AFTER ) ; } } else if ( ( seen == Const . INVOKESPECIAL ) && Values . CONSTRUCTOR . equals ( getNameConstantOperand ( ) ) ) { String cls = getClassConstantOperand ( ) ; JavaClass exCls = Repository . lookupClass ( cls ) ; if ( exCls . instanceOf ( THROWABLE_CLASS ) ) { String signature = getSigConstantOperand ( ) ; List < String > types = SignatureUtils . getParameterSignatures ( signature ) ; if ( ! types . isEmpty ( ) ) { if ( Values . SIG_JAVA_LANG_STRING . equals ( types . get ( 0 ) ) && ( stack . getStackDepth ( ) >= types . size ( ) ) ) { OpcodeStack . Item item = stack . getStackItem ( types . size ( ) - 1 ) ; message = ( String ) item . getConstant ( ) ; if ( message == null ) { message = "____UNKNOWN____" + System . identityHashCode ( item ) ; } } } else { message = "" ; } } } } } catch ( ClassNotFoundException cnfe ) { bugReporter . reportMissingClass ( cnfe ) ; } finally { stack . sawOpcode ( this , seen ) ; if ( ( message != null ) && ( stack . getStackDepth ( ) > 0 ) ) { OpcodeStack . Item item = stack . getStackItem ( 0 ) ; item . setUserValue ( message ) ; } }
public class NetworkInterfacesInner { /** * Gets all network interfaces in a virtual machine scale set . * @ param resourceGroupName The name of the resource group . * @ param virtualMachineScaleSetName The name of the virtual machine scale set . * @ 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 PagedList & lt ; NetworkInterfaceInner & gt ; object if successful . */ public PagedList < NetworkInterfaceInner > listVirtualMachineScaleSetNetworkInterfaces ( final String resourceGroupName , final String virtualMachineScaleSetName ) { } }
ServiceResponse < Page < NetworkInterfaceInner > > response = listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync ( resourceGroupName , virtualMachineScaleSetName ) . toBlocking ( ) . single ( ) ; return new PagedList < NetworkInterfaceInner > ( response . body ( ) ) { @ Override public Page < NetworkInterfaceInner > nextPage ( String nextPageLink ) { return listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync ( nextPageLink ) . toBlocking ( ) . single ( ) . body ( ) ; } } ;
public class SitelinkFeedItem { /** * Gets the sitelinkFinalMobileUrls value for this SitelinkFeedItem . * @ return sitelinkFinalMobileUrls * A list of possible final mobile URLs after all cross domain * redirects . */ public com . google . api . ads . adwords . axis . v201809 . cm . UrlList getSitelinkFinalMobileUrls ( ) { } }
return sitelinkFinalMobileUrls ;
public class DeleteApplicationRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteApplicationRequest deleteApplicationRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteApplicationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteApplicationRequest . getApplicationId ( ) , APPLICATIONID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class MapLens { /** * A lens that focuses on a map while mapping its values with the mapping { @ link Iso } . * Note that for this lens to be lawful , < code > iso < / code > must be lawful . * @ param iso the mapping { @ link Iso } * @ param < K > the key type * @ param < V > the unfocused map value type * @ param < V2 > the focused map value type * @ return a lens that focuses on a map while mapping its values */ public static < K , V , V2 > Lens . Simple < Map < K , V > , Map < K , V2 > > mappingValues ( Iso < V , V , V2 , V2 > iso ) { } }
return simpleLens ( m -> toMap ( HashMap :: new , map ( t -> t . biMapR ( view ( iso ) ) , map ( Tuple2 :: fromEntry , m . entrySet ( ) ) ) ) , ( s , b ) -> view ( mappingValues ( iso . mirror ( ) ) , b ) ) ;
public class StaticFeatureSet { /** * Returns the registered instance of { @ code featureType } , or the value of * { @ link FeatureType # testDefault } if no explicit instance was registered with this set . */ @ Override public < T extends Feature < T > > T get ( FeatureType < T > featureType ) { } }
@ SuppressWarnings ( "unchecked" ) T feature = ( T ) featuresByType . get ( featureType . type ( ) ) ; if ( feature != null ) { return feature ; } return featureType . testDefault ( this ) ;
public class ObjectMapper { /** * Builds a SQL FROM clause from the tables / joins Hashtable */ private String buildFromClause ( ) { } }
StringBuilder sqlBuf = new StringBuilder ( ) ; sqlBuf . append ( "FROM " ) ; String table = null ; String schema = null ; for ( Enumeration from = mTables . keys ( ) ; from . hasMoreElements ( ) ; ) { table = ( String ) from . nextElement ( ) ; /* schema = ( String ) schemas . get ( table ) ; if ( schema ! = null ) sqlBuf . append ( schema + " . " ) ; */ sqlBuf . append ( table ) ; sqlBuf . append ( from . hasMoreElements ( ) ? ", " : " " ) ; } return sqlBuf . toString ( ) ;
public class Endpoint { /** * Converts this endpoint into the authority part of a URI . * @ return the authority string */ public String authority ( ) { } }
String authority = this . authority ; if ( authority != null ) { return authority ; } if ( isGroup ( ) ) { authority = "group:" + groupName ; } else if ( port != 0 ) { if ( hostType == HostType . IPv6_ONLY ) { authority = '[' + host ( ) + "]:" + port ; } else { authority = host ( ) + ':' + port ; } } else if ( hostType == HostType . IPv6_ONLY ) { authority = '[' + host ( ) + ']' ; } else { authority = host ( ) ; } return this . authority = authority ;
public class EventHandlers { /** * This method is called from Javascript , passing in the previously created * callback key . It uses that to find the correct handler and then passes on * the call . State events in the Google Maps API don ' t pass any parameters . * @ param callbackKey Key generated by the call to registerHandler . */ public void handleStateEvent ( String callbackKey ) { } }
if ( handlers . containsKey ( callbackKey ) && handlers . get ( callbackKey ) instanceof StateEventHandler ) { ( ( StateEventHandler ) handlers . get ( callbackKey ) ) . handle ( ) ; } else { System . err . println ( "Error in handle: " + callbackKey + " for state handler " ) ; }
public class Env { /** * 添加本 Template 的 ISource , 以及该 Template 使用 include 包含进来的所有 ISource * 以便于在 devMode 之下判断该 Template 是否被 modified , 进而 reload 该 Template */ public void addSource ( ISource source ) { } }
if ( sourceList == null ) { sourceList = new ArrayList < ISource > ( ) ; } sourceList . add ( source ) ;
public class MuzeiArtSource { /** * Schedules an update for some time in the future . Any previously scheduled updates will be * replaced . When the update time elapses , { @ link # onUpdate ( int ) } will be called with * { @ link # UPDATE _ REASON _ SCHEDULED } . * < p > Note that this is persisted across device reboots , but only triggers after a subscriber * subscribes to the source after reboot . The Muzei Live Wallpaper will re - subscribe to sources * after reboot if it ' s the active wallpaper . * @ param scheduledUpdateTimeMillis The absolute scheduled update time , based on { @ link * System # currentTimeMillis ( ) } . This value must be after * the current time . */ protected final void scheduleUpdate ( long scheduledUpdateTimeMillis ) { } }
getSharedPreferences ( ) . edit ( ) . putLong ( PREF_SCHEDULED_UPDATE_TIME_MILLIS , scheduledUpdateTimeMillis ) . apply ( ) ; setUpdateAlarm ( scheduledUpdateTimeMillis ) ;
public class DatePickerDialog { /** * Sets a list of days which are the only valid selections . * Setting this value will take precedence over using setMinDate ( ) and setMaxDate ( ) * @ param selectableDays an Array of Calendar Objects containing the selectable dates */ @ SuppressWarnings ( "unused" ) public void setSelectableDays ( Calendar [ ] selectableDays ) { } }
mDefaultLimiter . setSelectableDays ( selectableDays ) ; if ( mDayPickerView != null ) mDayPickerView . onChange ( ) ;
public class JmxUtils { /** * Register the given mbean with the platform mbean server * @ param mbean The mbean to register * @ param name The name to register under */ public static void registerMbean ( Object mbean , ObjectName name ) { } }
registerMbean ( ManagementFactory . getPlatformMBeanServer ( ) , JmxUtils . createModelMBean ( mbean ) , name ) ;
public class MwsUtl { /** * Create a new instance of a class , wrap exceptions . * @ param cls * @ return The new instance . */ static < T > T newInstance ( Class < T > cls ) { } }
try { return cls . newInstance ( ) ; } catch ( Exception e ) { throw wrap ( e ) ; }
public class SQLUtils { /** * 往where sql里面插入AND关系的表达式 。 * 例如 : whereSql为 where a ! = 3 or a ! = 2 limit 1 * condExpress为 deleted = 0 * 那么返回 : where ( deleted = 0 and ( a ! = 3 or a ! = 2 ) ) limit 1 * @ param whereSql 从where起的sql子句 , 如果有where必须带上where关键字 。 * @ param condExpression 例如a = ? 不带where或and关键字 。 * @ return 注意返回字符串前面没有空格 * @ throws JSQLParserException */ public static String insertWhereAndExpression ( String whereSql , String condExpression ) throws JSQLParserException { } }
if ( condExpression == null || condExpression . trim ( ) . isEmpty ( ) ) { return whereSql == null ? "" : whereSql ; } if ( whereSql == null || whereSql . trim ( ) . isEmpty ( ) ) { return "WHERE " + condExpression ; } whereSql = whereSql . trim ( ) ; if ( ! whereSql . toUpperCase ( ) . startsWith ( "WHERE " ) ) { return "WHERE " + condExpression + " " + whereSql ; } // 为解决JSqlParse对复杂的condExpression不支持的问题 , 这里用替换的形式来达到目的 String magic = "A" + UUID . randomUUID ( ) . toString ( ) . replace ( "-" , "" ) ; String selectSql = "select * from dual " ; // 辅助where sql解析用 Statement statement = CCJSqlParserUtil . parse ( selectSql + whereSql ) ; Select selectStatement = ( Select ) statement ; PlainSelect plainSelect = ( PlainSelect ) selectStatement . getSelectBody ( ) ; Expression ce = CCJSqlParserUtil . parseCondExpression ( magic ) ; Expression oldWhere = plainSelect . getWhere ( ) ; Expression newWhere = new FixedAndExpression ( oldWhere , ce ) ; plainSelect . setWhere ( newWhere ) ; String result = plainSelect . toString ( ) . substring ( selectSql . length ( ) ) ; return result . replace ( magic , condExpression ) ;
public class NetworkInterfacesInner { /** * Get the specified network interface ip configuration in a virtual machine scale set . * @ param resourceGroupName The name of the resource group . * @ param virtualMachineScaleSetName The name of the virtual machine scale set . * @ param virtualmachineIndex The virtual machine index . * @ param networkInterfaceName The name of the network interface . * @ param ipConfigurationName The name of the ip configuration . * @ param expand Expands referenced resources . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the NetworkInterfaceIPConfigurationInner object */ public Observable < ServiceResponse < NetworkInterfaceIPConfigurationInner > > getVirtualMachineScaleSetIpConfigurationWithServiceResponseAsync ( String resourceGroupName , String virtualMachineScaleSetName , String virtualmachineIndex , String networkInterfaceName , String ipConfigurationName , String expand ) { } }
if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( virtualMachineScaleSetName == null ) { throw new IllegalArgumentException ( "Parameter virtualMachineScaleSetName is required and cannot be null." ) ; } if ( virtualmachineIndex == null ) { throw new IllegalArgumentException ( "Parameter virtualmachineIndex is required and cannot be null." ) ; } if ( networkInterfaceName == null ) { throw new IllegalArgumentException ( "Parameter networkInterfaceName is required and cannot be null." ) ; } if ( ipConfigurationName == null ) { throw new IllegalArgumentException ( "Parameter ipConfigurationName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } final String apiVersion = "2017-03-30" ; return service . getVirtualMachineScaleSetIpConfiguration ( resourceGroupName , virtualMachineScaleSetName , virtualmachineIndex , networkInterfaceName , ipConfigurationName , this . client . subscriptionId ( ) , apiVersion , expand , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < NetworkInterfaceIPConfigurationInner > > > ( ) { @ Override public Observable < ServiceResponse < NetworkInterfaceIPConfigurationInner > > call ( Response < ResponseBody > response ) { try { ServiceResponse < NetworkInterfaceIPConfigurationInner > clientResponse = getVirtualMachineScaleSetIpConfigurationDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class DoubleHistogram { /** * Add the contents of another histogram to this one . * @ param fromHistogram The other histogram . * @ throws ArrayIndexOutOfBoundsException ( may throw ) if values in fromHistogram ' s cannot be * covered by this histogram ' s range */ public void add ( final DoubleHistogram fromHistogram ) throws ArrayIndexOutOfBoundsException { } }
int arrayLength = fromHistogram . integerValuesHistogram . countsArrayLength ; AbstractHistogram fromIntegerHistogram = fromHistogram . integerValuesHistogram ; for ( int i = 0 ; i < arrayLength ; i ++ ) { long count = fromIntegerHistogram . getCountAtIndex ( i ) ; if ( count > 0 ) { recordValueWithCount ( fromIntegerHistogram . valueFromIndex ( i ) * fromHistogram . integerToDoubleValueConversionRatio , count ) ; } }
public class RandomNumbersTool { /** * Generates a random integer between the specified values . * @ param lo the lower bound for the generated integer . * @ param hi the upper bound for the generated integer . * @ return a random integer between < code > lo < / code > and < code > hi < / code > . */ public static int randomInt ( int lo , int hi ) { } }
return ( Math . abs ( random . nextInt ( ) ) % ( hi - lo + 1 ) ) + lo ;
public class LogMetaInfUtils { /** * This method performs part of the factory search outlined in section 10.2.6.1. */ @ SuppressWarnings ( "unchecked" ) protected static void logMetaInf ( ) { } }
if ( ! log . isLoggable ( Level . WARNING ) ) { return ; } try { Map < String , List < JarInfo > > libs = new HashMap < String , List < JarInfo > > ( 30 ) ; Iterator < URL > it = ClassUtils . getResources ( "META-INF/MANIFEST.MF" , LogMetaInfUtils . class ) ; while ( it . hasNext ( ) ) { URL url = it . next ( ) ; addJarInfo ( libs , url ) ; } final List < String > keys = new ArrayList ( libs . keySet ( ) ) ; Collections . sort ( keys ) ; if ( log . isLoggable ( Level . WARNING ) ) { for ( String artifactId : keys ) { List < JarInfo > versions = libs . get ( artifactId ) ; if ( versions != null && versions . size ( ) > 1 ) { StringBuilder builder = new StringBuilder ( 1024 ) ; builder . append ( "You are using the library: " ) ; builder . append ( artifactId ) ; builder . append ( " in different versions; first (and probably used) version is: " ) ; builder . append ( versions . get ( 0 ) . getVersion ( ) ) ; builder . append ( " loaded from: " ) ; builder . append ( versions . get ( 0 ) . getUrl ( ) ) ; builder . append ( ", but also found the following versions: " ) ; boolean needComma = false ; for ( int i = 1 ; i < versions . size ( ) ; i ++ ) { JarInfo info = versions . get ( i ) ; if ( needComma ) { builder . append ( ", " ) ; } builder . append ( info . getVersion ( ) ) ; builder . append ( " loaded from: " ) ; builder . append ( info . getUrl ( ) ) ; needComma = true ; } log . warning ( builder . toString ( ) ) ; } } } if ( log . isLoggable ( Level . INFO ) ) { for ( String artifactId : keys ) { logArtifact ( artifactId , libs ) ; } } } catch ( Throwable e ) { throw new FacesException ( e ) ; }
public class SearchManager { /** * { @ inheritDoc } */ public Set < String > getFieldNames ( ) throws IndexException { } }
final Set < String > fildsSet = new HashSet < String > ( ) ; if ( handler instanceof SearchIndex ) { IndexReader reader = null ; try { reader = ( ( SearchIndex ) handler ) . getIndexReader ( ) ; FieldInfos infos = ReaderUtil . getMergedFieldInfos ( reader ) ; for ( FieldInfo info : infos ) { fildsSet . add ( info . name ) ; } } catch ( IOException e ) { throw new IndexException ( e . getLocalizedMessage ( ) , e ) ; } finally { try { if ( reader != null ) { Util . closeOrRelease ( reader ) ; } } catch ( IOException e ) { throw new IndexException ( e . getLocalizedMessage ( ) , e ) ; } } } return fildsSet ;
public class Encrypter { /** * Methode de decryptage d ' un texte * @ param textTexte a decrypter * @ returnTexte decrypte */ public synchronized String decryptText ( String text ) { } }
try { // Mise en mode Decrypt cipher . init ( Cipher . DECRYPT_MODE , this . createDESSecretKey ( stringKey ) ) ; // Obtention des bytes byte [ ] encodedByteText = new Base64 ( ) . decode ( text ) ; // Decryption byte [ ] byteText = cipher . doFinal ( encodedByteText ) ; // Retour de la chaine return new String ( byteText ) ; } catch ( Exception e ) { // On relance l ' exception throw new RuntimeException ( e ) ; }
public class QuerySpecification { void resolveColumnReferencesInOrderBy ( SortAndSlice sortAndSlice ) { } }
// replace the aliases with expressions // replace column names with expressions and resolve the table columns int orderCount = sortAndSlice . getOrderLength ( ) ; for ( int i = 0 ; i < orderCount ; i ++ ) { ExpressionOrderBy e = ( ExpressionOrderBy ) sortAndSlice . exprList . get ( i ) ; replaceColumnIndexInOrderBy ( e ) ; if ( e . getLeftNode ( ) . queryTableColumnIndex != - 1 ) { continue ; } if ( sortAndSlice . sortUnion ) { if ( e . getLeftNode ( ) . getType ( ) != OpTypes . COLUMN ) { throw Error . error ( ErrorCode . X_42576 ) ; } } e . replaceAliasInOrderBy ( exprColumns , indexLimitVisible ) ; resolveColumnReferencesAndAllocate ( e , rangeVariables . length , false ) ; } sortAndSlice . prepare ( this ) ;
public class FluoConfigurationImpl { /** * Gets the time before stale entries in the cache are evicted based on age . This method returns a * long representing the time converted from the TimeUnit passed in . * @ param conf The FluoConfiguration * @ param tu The TimeUnit desired to represent the cache timeout */ public static long getVisibilityCacheTimeout ( FluoConfiguration conf , TimeUnit tu ) { } }
long millis = conf . getLong ( VISIBILITY_CACHE_TIMEOUT , VISIBILITY_CACHE_TIMEOUT_DEFAULT ) ; if ( millis <= 0 ) { throw new IllegalArgumentException ( "Timeout must positive for " + VISIBILITY_CACHE_TIMEOUT ) ; } return tu . convert ( millis , TimeUnit . MILLISECONDS ) ;
public class sslcipher { /** * Use this API to fetch sslcipher resource of given name . */ public static sslcipher get ( nitro_service service , String ciphergroupname ) throws Exception { } }
sslcipher obj = new sslcipher ( ) ; obj . set_ciphergroupname ( ciphergroupname ) ; sslcipher response = ( sslcipher ) obj . get_resource ( service ) ; return response ;
public class PoolablePreparedStatement { /** * Method setNCharacterStream . * @ param parameterIndex * @ param value * @ throws SQLException * @ see java . sql . PreparedStatement # setNCharacterStream ( int , Reader ) */ @ Override public void setNCharacterStream ( int parameterIndex , Reader value ) throws SQLException { } }
internalStmt . setNCharacterStream ( parameterIndex , value ) ;
public class Slf4jLogger { /** * Log an exception ( throwable ) at the DEBUG level with an * accompanying message . * @ param msg the message accompanying the exception * @ param t the exception ( throwable ) to log */ public void debug ( String msg , Throwable t ) { } }
if ( m_delegate . isDebugEnabled ( ) ) { m_delegate . debug ( msg , t ) ; }
import java . util . * ; public class CollectPrefixes { /** * Generates a list of all prefixes of the input string in ascending order of their length * @ param word The string from which prefixes are to be generated * @ return The list of all possible prefixes of the input string * Example : * > > > collect _ prefixes ( ' abc ' ) * [ ' a ' , ' ab ' , ' abc ' ] */ public static List < String > collectPrefixes ( String word ) { } }
List < String > resultList = new ArrayList < > ( ) ; for ( int i = 0 ; i < word . length ( ) ; i ++ ) { resultList . add ( word . substring ( 0 , i + 1 ) ) ; } return resultList ;
public class DefaultXPathEvaluator { /** * Perform an XPath evaluation on an invocation context . * @ param expression * @ param node * @ param method * @ param invocationContext * @ return a list of evaluation results * @ throws XPathExpressionException */ public static List < ? > evaluateAsList ( final XPathExpression expression , final Node node , final Method method , final InvocationContext invocationContext ) throws XPathExpressionException { } }
// assert targetComponentType ! = null ; final Class < ? > targetComponentType = invocationContext . getTargetComponentType ( ) ; final NodeList nodes = ( NodeList ) expression . evaluate ( node , XPathConstants . NODESET ) ; final List < Object > linkedList = new LinkedList < Object > ( ) ; final TypeConverter typeConverter = invocationContext . getProjector ( ) . config ( ) . getTypeConverter ( ) ; if ( typeConverter . isConvertable ( targetComponentType ) ) { for ( int i = 0 ; i < nodes . getLength ( ) ; ++ i ) { linkedList . add ( typeConverter . convertTo ( targetComponentType , nodes . item ( i ) . getTextContent ( ) , invocationContext . getExpressionFormatPattern ( ) ) ) ; } return linkedList ; } if ( Node . class . equals ( targetComponentType ) ) { for ( int i = 0 ; i < nodes . getLength ( ) ; ++ i ) { linkedList . add ( nodes . item ( i ) ) ; } return linkedList ; } if ( targetComponentType . isInterface ( ) ) { for ( int i = 0 ; i < nodes . getLength ( ) ; ++ i ) { Object subprojection = invocationContext . getProjector ( ) . projectDOMNode ( nodes . item ( i ) , targetComponentType ) ; linkedList . add ( subprojection ) ; } return linkedList ; } throw new IllegalArgumentException ( "Return type " + targetComponentType + " is not valid for list or array component type returning from method " + method + " using the current type converter:" + invocationContext . getProjector ( ) . config ( ) . getTypeConverter ( ) + ". Please change the return type to a sub projection or add a conversion to the type converter." ) ;
public class SlaveComputer { /** * { @ inheritDoc } */ @ Override public void taskCompleted ( Executor executor , Queue . Task task , long durationMS ) { } }
super . taskCompleted ( executor , task , durationMS ) ; if ( launcher instanceof ExecutorListener ) { ( ( ExecutorListener ) launcher ) . taskCompleted ( executor , task , durationMS ) ; } RetentionStrategy r = getRetentionStrategy ( ) ; if ( r instanceof ExecutorListener ) { ( ( ExecutorListener ) r ) . taskCompleted ( executor , task , durationMS ) ; }
public class WCardManager { /** * Override method to show Error indicators on the visible card . * @ param diags the list of diagnostics containing errors . */ @ Override public void showErrorIndicators ( final List < Diagnostic > diags ) { } }
WComponent visibleComponent = getVisible ( ) ; visibleComponent . showErrorIndicators ( diags ) ;
public class Emitter { /** * syck _ scan _ scalar */ public int scanScalar ( int req_width , Pointer _cursor , int len ) { } }
byte [ ] cursorb = _cursor . buffer ; int cursor = _cursor . start ; int start = 0 ; int flags = SCAN_NONE ; if ( len < 1 ) { return flags ; } switch ( cursorb [ cursor ] ) { case '[' : case ']' : case '{' : case '}' : case '!' : case '*' : case '&' : case '|' : case '>' : case '\'' : case '"' : case '#' : case '%' : case '@' : case '`' : flags |= SCAN_INDIC_S ; break ; case '-' : case ':' : case '?' : case ',' : if ( len == 1 || cursorb [ cursor + 1 ] == ' ' || cursorb [ cursor + 1 ] == '\n' ) { flags |= SCAN_INDIC_S ; } break ; } if ( cursorb [ cursor + len - 1 ] != '\n' ) { flags |= SCAN_NONL_E ; } else if ( len > 1 && cursorb [ cursor + len - 2 ] == '\n' ) { flags |= SCAN_MANYNL_E ; } if ( ( len > 0 && ( cursorb [ cursor ] == ' ' || cursorb [ cursor ] == '\t' ) ) || ( len > 1 && ( cursorb [ cursor + len - 1 ] == ' ' || cursorb [ cursor + len - 1 ] == '\t' ) ) ) { flags |= SCAN_WHITEEDGE ; } if ( len >= 3 && cursorb [ cursor ] == '-' && cursorb [ cursor + 1 ] == '-' && cursorb [ cursor + 2 ] == '-' ) { flags |= SCAN_DOCSEP ; } for ( int i = 0 ; i < len ; i ++ ) { int ci = ( int ) ( cursorb [ cursor + i ] & 0xFF ) ; if ( ! ( ci == 0x9 || ci == 0xA || ci == 0xD || ( ci >= 0x20 && ci <= 0x7E ) ) ) { flags |= SCAN_NONPRINT ; } else if ( ci == '\n' ) { flags |= SCAN_NEWLINE ; if ( len - i >= 3 && cursorb [ cursor + i + 1 ] == '-' && cursorb [ cursor + i + 2 ] == '-' && cursorb [ cursor + i + 3 ] == '-' ) { flags |= SCAN_DOCSEP ; } if ( i + 1 < len && ( cursorb [ cursor + i + 1 ] == ' ' || cursorb [ cursor + i + 1 ] == '\t' ) ) { flags |= SCAN_INDENTED ; } if ( req_width > 0 && ( i - start ) > req_width ) { flags |= SCAN_WIDE ; } start = i ; } else if ( ci == '\'' ) { flags |= SCAN_SINGLEQ ; } else if ( ci == '"' ) { flags |= SCAN_DOUBLEQ ; } else if ( ci == ']' ) { flags |= SCAN_FLOWSEQ ; } else if ( ci == '}' ) { flags |= SCAN_FLOWMAP ; } else if ( ( ( ci == ' ' && ( i + 1 < len && cursorb [ cursor + i + 1 ] == '#' ) ) || ( ci == ':' && ( ( i + 1 < len && cursorb [ cursor + i + 1 ] == ' ' ) || ( i + 1 < len && cursorb [ cursor + i + 1 ] == '\n' ) || i == len - 1 ) ) ) ) { flags |= SCAN_INDIC_C ; } else if ( ci == ',' && ( ( i == len - 1 || cursorb [ cursor + i + 1 ] == ' ' || cursorb [ cursor + i + 1 ] == '\n' ) ) ) { flags |= SCAN_FLOWMAP ; flags |= SCAN_FLOWSEQ ; } } return flags ;