signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class BlockId { /** * Return a string of the form " siteId _ _ _ blockId " . This is used * for file names and not for displaying in , say , error messages . * It would be weird to have a file names with minus signs , * so format the IDs as unsigned . * @ return A string of the form " SID _ _ _ BLOCKID . block " where SID and BLOCKID are unsigned . */ public String fileNameString ( ) { } }
BigInteger bigSiteId = BigInteger . valueOf ( getSiteId ( ) ) ; BigInteger bigBlockCounter = BigInteger . valueOf ( getBlockId ( ) ) ; final BigInteger BIT_64 = BigInteger . ONE . shiftLeft ( 64 ) ; if ( bigSiteId . signum ( ) < 0 ) { bigSiteId = bigSiteId . add ( BIT_64 ) ; } if ( bigBlockCounter . signum ( ) < 0 ) { bigBlockCounter = bigBlockCounter . add ( BIT_64 ) ; } return bigSiteId . toString ( ) + "___" + bigBlockCounter . toString ( ) + ".block" ;
public class FastSet { /** * Convert a given collection to a { @ link FastSet } instance */ private FastSet convert ( IntSet c ) { } }
if ( c instanceof FastSet ) { return ( FastSet ) c ; } if ( c == null ) { return new FastSet ( ) ; } FastSet res = new FastSet ( ) ; IntIterator itr = c . iterator ( ) ; while ( itr . hasNext ( ) ) { res . add ( itr . next ( ) ) ; } return res ;
public class AbcGrammar { /** * In header defines in which order parts should be played * field - parts : : = % x50.3A * WSP parts - play - order header - eol < p > * < tt > P : < / tt > */ Rule FieldParts ( ) { } }
return Sequence ( String ( "P:" ) , ZeroOrMore ( WSP ( ) ) . suppressNode ( ) , PartsPlayOrder ( ) , HeaderEol ( ) ) . label ( FieldParts ) ;
public class SubscriberIdentityImpl { /** * ( non - Javadoc ) * @ see org . restcomm . protocols . ss7 . map . api . primitives . MAPAsnPrimitive # encodeData * ( org . mobicents . protocols . asn . AsnOutputStream ) */ public void encodeData ( AsnOutputStream asnOs ) throws MAPException { } }
if ( this . imsi == null && this . msisdn == null ) throw new MAPException ( "Error while encoding " + _PrimitiveName + ": all choices must not be null" ) ; if ( this . imsi != null && this . msisdn != null ) throw new MAPException ( "Error while encoding " + _PrimitiveName + ": all choices must not be not null" ) ; if ( this . imsi != null ) { ( ( IMSIImpl ) this . imsi ) . encodeData ( asnOs ) ; } else { ( ( ISDNAddressStringImpl ) this . msisdn ) . encodeData ( asnOs ) ; }
public class PredefinedMetricTransformer { /** * Returns a request type specific metrics for * { @ link Field # ClientExecuteTime } which is special in the sense that it * makes a more accurate measurement by taking the { @ link TimingInfo } at the * root into account . */ protected List < MetricDatum > latencyOfClientExecuteTime ( Request < ? > req , Object response ) { } }
AWSRequestMetrics m = req . getAWSRequestMetrics ( ) ; TimingInfo root = m . getTimingInfo ( ) ; final String metricName = Field . ClientExecuteTime . name ( ) ; if ( root . isEndTimeKnown ( ) ) { // being defensive List < Dimension > dims = new ArrayList < Dimension > ( ) ; dims . add ( new Dimension ( ) . withName ( Dimensions . MetricType . name ( ) ) . withValue ( metricName ) ) ; // request type specific dims . add ( new Dimension ( ) . withName ( Dimensions . RequestType . name ( ) ) . withValue ( requestType ( req ) ) ) ; MetricDatum datum = new MetricDatum ( ) . withMetricName ( req . getServiceName ( ) ) . withDimensions ( dims ) . withUnit ( StandardUnit . Milliseconds ) . withValue ( root . getTimeTakenMillisIfKnown ( ) ) ; return Collections . singletonList ( datum ) ; } return Collections . emptyList ( ) ;
public class TrueTypeFontUnicode { /** * Gets the glyph index and metrics for a character . * @ param c the character * @ return an < CODE > int < / CODE > array with { glyph index , width } */ public int [ ] getMetricsTT ( int c ) { } }
if ( cmapExt != null ) return ( int [ ] ) cmapExt . get ( Integer . valueOf ( c ) ) ; HashMap map = null ; if ( fontSpecific ) map = cmap10 ; else map = cmap31 ; if ( map == null ) return null ; if ( fontSpecific ) { if ( ( c & 0xffffff00 ) == 0 || ( c & 0xffffff00 ) == 0xf000 ) return ( int [ ] ) map . get ( Integer . valueOf ( c & 0xff ) ) ; else return null ; } else return ( int [ ] ) map . get ( Integer . valueOf ( c ) ) ;
public class AppDriver { /** * / * ( non - Javadoc ) * @ see org . duracloud . mill . util . DriverSupport # executeImpl ( org . apache . commons . cli . CommandLine ) */ @ Override protected void executeImpl ( CommandLine cmd ) { } }
String taskQueueNames = cmd . getOptionValue ( TASK_QUEUES_OPTION ) ; if ( taskQueueNames != null ) { setSystemProperty ( ConfigConstants . QUEUE_TASK_ORDERED , taskQueueNames ) ; } List < PropertyDefinition > defintions = new PropertyDefinitionListBuilder ( ) . addAws ( ) . addMillDb ( ) . addMcDb ( ) . addDeadLetterQueue ( ) . addAuditQueue ( ) . addBitIntegrityQueue ( ) . addBitIntegrityErrorQueue ( ) . addBitIntegrityReportQueue ( ) . addNotifications ( ) . addWorkDir ( ) . addTaskQueueOrder ( ) . addDuplicationPolicyBucketSuffix ( ) . addDuplicationPolicyRefreshFrequency ( ) . addDuplicationHighPriorityQueue ( ) . addLocalDuplicationDir ( ) . addMaxWorkers ( ) . build ( ) ; PropertyVerifier verifier = new PropertyVerifier ( defintions ) ; verifier . verify ( System . getProperties ( ) ) ; TaskProducerConfigurationManager config = new WorkmanConfigurationManager ( ) ; String workDirPath = config . getWorkDirectoryPath ( ) ; if ( workDirPath == null || workDirPath . trim ( ) == "" ) { // this should never happen since workDirPath is required , // but I ' ll leave this in here as a sanity check . workDirPath = System . getProperty ( "java.io.tmpdir" ) + File . separator + "workman-work" ; } initializeWorkDir ( workDirPath ) ; String localDuplicationPolicyDirPath = config . getDuplicationPolicyDir ( ) ; if ( localDuplicationPolicyDirPath != null && ! new File ( localDuplicationPolicyDirPath ) . exists ( ) ) { System . err . print ( "The local duplication policy directory " + "path you specified, " + localDuplicationPolicyDirPath + " does not exist: " ) ; die ( ) ; } ApplicationContext context = new AnnotationConfigApplicationContext ( "org.duracloud.mill" ) ;
public class RendererModel { /** * Notifies registered listeners of certain changes that have occurred in * this model . */ public void fireChange ( ) { } }
if ( getNotification ( ) && listeners != null ) { EventObject event = new EventObject ( this ) ; for ( int i = 0 ; i < listeners . size ( ) ; i ++ ) { listeners . get ( i ) . stateChanged ( event ) ; } }
public class BaseFilterQueryBuilder { /** * Add a Field Search Condition that will search a field for values that aren ' t like a specified value using the following * SQL logic : { @ code field NOT LIKE ' % value % ' } * @ param propertyName The name of the field as defined in the Entity mapping class . * @ param value The value to search against . */ protected void addNotLikeCondition ( final String propertyName , final String value ) { } }
final Expression < String > propertyNameField = getRootPath ( ) . get ( propertyName ) . as ( String . class ) ; fieldConditions . add ( getCriteriaBuilder ( ) . notLike ( propertyNameField , "%" + cleanLikeCondition ( value ) + "%" ) ) ;
public class FieldMetaData { /** * 获取Field大小 * @ param field * @ return */ private int getFieldSize ( Field field ) { } }
if ( String . class == field . getType ( ) ) { return this . max ; } else if ( long . class == field . getType ( ) ) { return OtherConstants . FDFS_PROTO_PKG_LEN_SIZE ; } else if ( int . class == field . getType ( ) ) { return OtherConstants . FDFS_PROTO_PKG_LEN_SIZE ; } else if ( java . util . Date . class == field . getType ( ) ) { return OtherConstants . FDFS_PROTO_PKG_LEN_SIZE ; } else if ( byte . class == field . getType ( ) ) { return 1 ; } else if ( boolean . class == field . getType ( ) ) { return 1 ; } else if ( Set . class == field . getType ( ) ) { return 0 ; } throw new FdfsColumnMapException ( field . getName ( ) + "获取Field大小时未识别的FdfsColumn类型" + field . getType ( ) ) ;
public class ClassLoaderResourceUtils { /** * Builds a class instance using reflection , by using its classname . The * class must have a zero - arg constructor . * @ param classname * the class to build an instance of . * @ param params * the parameters * @ return the class instance */ public static Object buildObjectInstance ( String classname , Object [ ] params ) { } }
Object rets = null ; Class < ? > [ ] paramTypes = new Class [ params . length ] ; for ( int x = 0 ; x < params . length ; x ++ ) { paramTypes [ x ] = params [ x ] . getClass ( ) ; } try { Class < ? > clazz = getClass ( classname ) ; rets = clazz . getConstructor ( paramTypes ) . newInstance ( params ) ; } catch ( Exception e ) { throw new BundlingProcessException ( e . getMessage ( ) + " [The custom class " + classname + " could not be instantiated, check wether it is available on the classpath and" + " verify that it has a zero-arg constructor].\n" + " The specific error message is: " + e . getClass ( ) . getName ( ) + ":" + e . getMessage ( ) , e ) ; } return rets ;
public class FilterTrackerCustomizer { /** * { @ inheritDoc } */ public final FilterFactoryReference addingService ( ServiceReference < FilterFactory > reference ) { } }
FilterFactory filterFactory = bundleContext . getService ( reference ) ; if ( filterFactory != null ) { FilterFactoryReference factoryReference = new FilterFactoryReference ( filterFactory ) ; LOGGER . debug ( "added FilterFactory {} for application {}" , filterFactory . getClass ( ) . getName ( ) , applicationName ) ; return factoryReference ; } return null ;
public class ClassInfo { /** * Handle { @ link Repeatable } annotations . * @ param allRepeatableAnnotationNames * the names of all repeatable annotations */ void handleRepeatableAnnotations ( final Set < String > allRepeatableAnnotationNames ) { } }
if ( annotationInfo != null ) { annotationInfo . handleRepeatableAnnotations ( allRepeatableAnnotationNames , this , RelType . CLASS_ANNOTATIONS , RelType . CLASSES_WITH_ANNOTATION ) ; } if ( fieldInfo != null ) { for ( final FieldInfo fi : fieldInfo ) { fi . handleRepeatableAnnotations ( allRepeatableAnnotationNames ) ; } } if ( methodInfo != null ) { for ( final MethodInfo mi : methodInfo ) { mi . handleRepeatableAnnotations ( allRepeatableAnnotationNames ) ; } }
public class ISUPMessageFactoryImpl { /** * ( non - Javadoc ) * @ see org . restcomm . protocols . ss7 . isup . ISUPMessageFactory # createPRI ( int cic ) */ public PreReleaseInformationMessage createPRI ( int cic ) { } }
PreReleaseInformationMessage msg = createPRI ( ) ; CircuitIdentificationCode code = this . parameterFactory . createCircuitIdentificationCode ( ) ; code . setCIC ( cic ) ; msg . setCircuitIdentificationCode ( code ) ; return msg ;
public class CompositeConditionImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public NotificationChain basicSetRight ( Condition newRight , NotificationChain msgs ) { } }
Condition oldRight = right ; right = newRight ; if ( eNotificationRequired ( ) ) { ENotificationImpl notification = new ENotificationImpl ( this , Notification . SET , XtextPackage . COMPOSITE_CONDITION__RIGHT , oldRight , newRight ) ; if ( msgs == null ) msgs = notification ; else msgs . add ( notification ) ; } return msgs ;
public class SnackBar { /** * Set the padding between this SnackBar and it ' s text and button . * @ param horizontalPadding The horizontal padding . * @ param verticalPadding The vertical padding . * @ return This SnackBar for chaining methods . */ public SnackBar padding ( int horizontalPadding , int verticalPadding ) { } }
mText . setPadding ( horizontalPadding , verticalPadding , horizontalPadding , verticalPadding ) ; mAction . setPadding ( horizontalPadding , verticalPadding , horizontalPadding , verticalPadding ) ; return this ;
public class CPDefinitionLocalServiceBaseImpl { /** * Adds the cp definition to the database . Also notifies the appropriate model listeners . * @ param cpDefinition the cp definition * @ return the cp definition that was added */ @ Indexable ( type = IndexableType . REINDEX ) @ Override public CPDefinition addCPDefinition ( CPDefinition cpDefinition ) { } }
cpDefinition . setNew ( true ) ; return cpDefinitionPersistence . update ( cpDefinition ) ;
public class MultipartContent { /** * Configures a field part with the given field name and value ( of the specified content type ) . * @ param fieldName the field name * @ param contentType the value content type * @ param value the value * @ return a reference to this { @ link MultipartContent } instance */ public MultipartContent field ( String fieldName , String contentType , String value ) { } }
return part ( fieldName , contentType , value ) ;
public class SecurityCenterClient { /** * Gets a source . * < p > Sample code : * < pre > < code > * try ( SecurityCenterClient securityCenterClient = SecurityCenterClient . create ( ) ) { * SourceName name = SourceName . of ( " [ ORGANIZATION ] " , " [ SOURCE ] " ) ; * Source response = securityCenterClient . getSource ( name . toString ( ) ) ; * < / code > < / pre > * @ param name Relative resource name of the source . Its format is * " organizations / [ organization _ id ] / source / [ source _ id ] " . * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ public final Source getSource ( String name ) { } }
GetSourceRequest request = GetSourceRequest . newBuilder ( ) . setName ( name ) . build ( ) ; return getSource ( request ) ;
public class JsonUtil { /** * Writes the given value with the given writer . * @ param writer * @ param values * @ throws IOException * @ author vvakame */ public static void putFloatList ( Writer writer , List < Float > values ) throws IOException { } }
if ( values == null ) { writer . write ( "null" ) ; } else { startArray ( writer ) ; for ( int i = 0 ; i < values . size ( ) ; i ++ ) { put ( writer , values . get ( i ) ) ; if ( i != values . size ( ) - 1 ) { addSeparator ( writer ) ; } } endArray ( writer ) ; }
public class SqlBuilder { /** * Creates a case expression . * @ param condition The name of the view . * @ param trueAction The name of the view . * @ return The case when representation . */ public static Case caseWhen ( final Expression condition , final Expression trueAction ) { } }
return Case . caseWhen ( condition , trueAction ) ;
public class BaseMoskitoUIAction { /** * Rebuilds query string from source . * @ param source original source . * @ param params parameters that should be included in the query string . * @ return */ protected String rebuildQueryStringWithoutParameter ( String source , String ... params ) { } }
if ( source == null || source . length ( ) == 0 ) return "" ; if ( params == null || params . length == 0 ) return source ; HashSet < String > paramsSet = new HashSet < String > ( params . length ) ; paramsSet . addAll ( Arrays . asList ( params ) ) ; String [ ] tokens = StringUtils . tokenize ( source , '&' ) ; StringBuilder ret = new StringBuilder ( ) ; for ( String t : tokens ) { String [ ] values = StringUtils . tokenize ( t , '=' ) ; if ( paramsSet . contains ( values [ 0 ] ) ) continue ; if ( ret . length ( ) > 0 ) ret . append ( '&' ) ; ret . append ( values [ 0 ] ) . append ( '=' ) . append ( values . length >= 2 ? values [ 1 ] : "" ) ; } return ret . toString ( ) ;
public class JellyClassLoaderTearOff { /** * Creates { @ link JellyContext } for compiling view scripts * for classes in this classloader . */ public JellyContext createContext ( ) { } }
JellyContext context = new CustomJellyContext ( ROOT_CONTEXT ) ; context . setClassLoader ( owner . loader ) ; context . setExportLibraries ( false ) ; return context ;
public class PhotosGeoApi { /** * Set the permission for who may view the geo data associated with a photo . * < br > * This method requires authentication with ' write ' permission . * @ param photoId ( Required ) The id of the photo to set permissions for . * @ param isPublic viewing permissions for the photo location data to public . * @ param isContact viewing permissions for the photo location data to contacts . * @ param isFriend viewing permissions for the photo location data to friends . * @ param isFamily viewing permissions for the photo location data to family . * @ return object with the status of the requested operation . * @ throws JinxException if required parameters are missing , or if there are any errors . * @ see < a href = " https : / / www . flickr . com / services / api / flickr . photos . geo . setPerms . html " > flickr . photos . geo . setPerms < / a > */ public Response setPerms ( String photoId , boolean isPublic , boolean isContact , boolean isFriend , boolean isFamily ) throws JinxException { } }
JinxUtils . validateParams ( photoId ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.photos.geo.setPerms" ) ; params . put ( "photo_id" , photoId ) ; params . put ( "is_public" , isPublic ? "1" : "0" ) ; params . put ( "is_contact" , isContact ? "1" : "0" ) ; params . put ( "is_friend" , isFriend ? "1" : "0" ) ; params . put ( "is_family" , isFamily ? "1" : "0" ) ; return jinx . flickrPost ( params , Response . class ) ;
public class LogFileHeader { /** * Test to determine if the target log file header belongs to a valid RLS * file . * @ return boolean true if the log file header is valid , otherwise false . */ public boolean valid ( ) { } }
boolean valid = true ; if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "valid" , this ) ; if ( _status == STATUS_INVALID ) valid = false ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "valid" , new Boolean ( valid ) ) ; return valid ;
public class CloudSpannerXAConnection { /** * Preconditions : 1 . xid is known to the RM or it ' s in prepared state * Implementation deficiency preconditions : 1 . xid must be associated with this connection if it ' s * not in prepared state . * Postconditions : 1 . Transaction is rolled back and disassociated from connection */ @ Override public void rollback ( Xid xid ) throws XAException { } }
if ( logger . logDebug ( ) ) { debug ( "rolling back xid = " + xid ) ; } // We don ' t explicitly check precondition 1. try { if ( currentXid != null && xid . equals ( currentXid ) ) { state = STATE_IDLE ; currentXid = null ; conn . rollback ( ) ; conn . setAutoCommit ( localAutoCommitMode ) ; } else { String s = RecoveredXid . xidToString ( xid ) ; conn . setAutoCommit ( true ) ; conn . rollbackPreparedTransaction ( s ) ; } } catch ( CloudSpannerSQLException ex ) { if ( ex . getCode ( ) . equals ( Code . NOT_FOUND ) ) { throw new CloudSpannerXAException ( CloudSpannerXAException . ERROR_ROLLBACK_PREPARED , ex , XAException . XAER_NOTA ) ; } throw new CloudSpannerXAException ( CloudSpannerXAException . ERROR_ROLLBACK_PREPARED , ex , XAException . XAER_RMERR ) ; } catch ( SQLException ex ) { throw new CloudSpannerXAException ( CloudSpannerXAException . ERROR_ROLLBACK_PREPARED , ex , Code . UNKNOWN , XAException . XAER_RMERR ) ; }
public class QuartzJobSpecScheduler { /** * { @ inheritDoc } */ @ Override protected JobSpecSchedule doScheduleJob ( JobSpec jobSpec , Runnable jobRunnable ) { } }
// Build a data map that gets passed to the job JobDataMap jobDataMap = new JobDataMap ( ) ; jobDataMap . put ( JOB_SPEC_KEY , jobSpec ) ; jobDataMap . put ( JOB_RUNNABLE_KEY , jobRunnable ) ; // Build a Quartz job JobDetail job = JobBuilder . newJob ( QuartzJob . class ) . withIdentity ( jobSpec . getUri ( ) . toString ( ) ) . withDescription ( Strings . nullToEmpty ( jobSpec . getDescription ( ) ) ) . usingJobData ( jobDataMap ) . build ( ) ; Trigger jobTrigger = createTrigger ( job . getKey ( ) , jobSpec ) ; QuartzJobSchedule jobSchedule = new QuartzJobSchedule ( jobSpec , jobRunnable , jobTrigger ) ; try { _scheduler . getScheduler ( ) . scheduleJob ( job , jobTrigger ) ; getLog ( ) . info ( String . format ( "Scheduled job %s next two fire times: %s , %s." , jobSpec , jobTrigger . getNextFireTime ( ) , jobTrigger . getFireTimeAfter ( jobTrigger . getNextFireTime ( ) ) ) ) ; } catch ( SchedulerException e ) { throw new RuntimeException ( "Scheduling failed for " + jobSpec + ":" + e , e ) ; } return jobSchedule ;
public class RequestWrapperFactory { /** * create a HttpServletRequestWrapper with session supports . this method * will create HttpSession . * @ param request * @ return */ public static RequestWrapper create ( HttpServletRequest request ) { } }
HttpSession session = request . getSession ( ) ; AppContextWrapper acw = new ServletContextWrapper ( session . getServletContext ( ) ) ; SessionWrapper sw = new HttpSessionWrapper ( session ) ; ContextHolder contextHolder = new ContextHolder ( acw , sw ) ; return new HttpServletRequestWrapper ( request , contextHolder ) ;
public class Atom { /** * Determines whether the subsumption relation between this ( A ) and provided atom ( B ) holds , * i . e . determines if : * A > = B , * is true meaning that B is more general than A and the respective answer sets meet : * answers ( B ) subsetOf answers ( A ) * i . e . the set of answers of A is a subset of the set of answers of B * @ param atomic to compare with * @ return true if this atom subsumes the provided atom */ @ Override public boolean subsumes ( Atomic atomic ) { } }
if ( ! atomic . isAtom ( ) ) return false ; Atom parent = ( Atom ) atomic ; MultiUnifier multiUnifier = this . getMultiUnifier ( parent , UnifierType . SUBSUMPTIVE ) ; if ( multiUnifier . isEmpty ( ) ) return false ; MultiUnifier inverse = multiUnifier . inverse ( ) ; return // check whether propagated answers would be complete ! inverse . isEmpty ( ) && inverse . stream ( ) . allMatch ( u -> u . values ( ) . containsAll ( this . getVarNames ( ) ) ) && ! parent . getPredicates ( NeqPredicate . class ) . findFirst ( ) . isPresent ( ) && ! this . getPredicates ( NeqPredicate . class ) . findFirst ( ) . isPresent ( ) ;
public class TemplatesApi { /** * Returns document page image ( s ) based on input . * @ param accountId The external account number ( int ) or account ID Guid . ( required ) * @ param templateId The ID of the template being accessed . ( required ) * @ param documentId The ID of the document being accessed . ( required ) * @ return PageImages */ public PageImages getPages ( String accountId , String templateId , String documentId ) throws ApiException { } }
return getPages ( accountId , templateId , documentId , null ) ;
public class TimeWindowFunction { /** * Calculates the start time of the window for which the specified time belongs , in unix epoch ( millisecond ) format < br > * For example , if the window size is 1 hour with offset 0 , then a time 10:17 would return 10:00 , as the 1 hour window * is for 10:00:00.000 to 10:59:59.999 inclusive , or 10:00:00.000 ( inclusive ) to 11:00:00.000 ( exclusive ) * @ param time Time at which to determine the window start time ( milliseconds epoch format ) */ public long getWindowStartTimeForTime ( long time ) { } }
// Calculate aggregate offset : aggregate offset is due to both timezone and manual offset long aggregateOffset = ( timeZone . getOffset ( time ) + this . offsetAmountMilliseconds ) % this . windowSizeMilliseconds ; return ( time + aggregateOffset ) - ( time + aggregateOffset ) % this . windowSizeMilliseconds ;
public class AssemblyAnalyzer { /** * Builds the beginnings of a List for ProcessBuilder * @ return the list of arguments to begin populating the ProcessBuilder */ protected List < String > buildArgumentList ( ) { } }
// Use file . separator as a wild guess as to whether this is Windows final List < String > args = new ArrayList < > ( ) ; if ( ! StringUtils . isEmpty ( getSettings ( ) . getString ( Settings . KEYS . ANALYZER_ASSEMBLY_DOTNET_PATH ) ) ) { args . add ( getSettings ( ) . getString ( Settings . KEYS . ANALYZER_ASSEMBLY_DOTNET_PATH ) ) ; } else if ( isDotnetPath ( ) ) { args . add ( "dotnet" ) ; } else { return null ; } args . add ( grokAssembly . getPath ( ) ) ; return args ;
public class GrpcUtils { /** * Converts a proto type to a wire type . * @ param blockPInfo the proto type to convert * @ return the converted wire type */ public static BlockInfo fromProto ( alluxio . grpc . BlockInfo blockPInfo ) { } }
BlockInfo blockInfo = new BlockInfo ( ) ; blockInfo . setBlockId ( blockPInfo . getBlockId ( ) ) ; blockInfo . setLength ( blockPInfo . getLength ( ) ) ; blockInfo . setLocations ( map ( GrpcUtils :: fromProto , blockPInfo . getLocationsList ( ) ) ) ; return blockInfo ;
public class UserGroupService { /** * Returns the LDAP entries representing all user groups that the given * user is a member of . Only user groups which are readable by the current * user will be retrieved . * @ param ldapConnection * The current connection to the LDAP server , associated with the * current user . * @ param userDN * The DN of the user whose group membership should be retrieved . * @ return * The LDAP entries representing all readable parent user groups of the * user having the given DN . * @ throws GuacamoleException * If an error occurs preventing retrieval of user groups . */ public List < LDAPEntry > getParentUserGroupEntries ( LDAPConnection ldapConnection , String userDN ) throws GuacamoleException { } }
// Do not return any user groups if base DN is not specified String groupBaseDN = confService . getGroupBaseDN ( ) ; if ( groupBaseDN == null ) return Collections . emptyList ( ) ; // Get all groups the user is a member of starting at the groupBaseDN , // excluding guacConfigGroups return queryService . search ( ldapConnection , groupBaseDN , getGroupSearchFilter ( ) , Collections . singleton ( confService . getMemberAttribute ( ) ) , userDN ) ;
public class WatchedDoubleStepQREigen_DDRM { /** * Performs an implicit double step using the values contained in the lower right hand side * of the submatrix for the estimated eigenvector values . * @ param x1 * @ param x2 */ public void implicitDoubleStep ( int x1 , int x2 ) { } }
if ( printHumps ) System . out . println ( "Performing implicit double step" ) ; // compute the wilkinson shift double z11 = A . get ( x2 - 1 , x2 - 1 ) ; double z12 = A . get ( x2 - 1 , x2 ) ; double z21 = A . get ( x2 , x2 - 1 ) ; double z22 = A . get ( x2 , x2 ) ; double a11 = A . get ( x1 , x1 ) ; double a21 = A . get ( x1 + 1 , x1 ) ; double a12 = A . get ( x1 , x1 + 1 ) ; double a22 = A . get ( x1 + 1 , x1 + 1 ) ; double a32 = A . get ( x1 + 2 , x1 + 1 ) ; if ( normalize ) { temp [ 0 ] = a11 ; temp [ 1 ] = a21 ; temp [ 2 ] = a12 ; temp [ 3 ] = a22 ; temp [ 4 ] = a32 ; temp [ 5 ] = z11 ; temp [ 6 ] = z22 ; temp [ 7 ] = z12 ; temp [ 8 ] = z21 ; double max = Math . abs ( temp [ 0 ] ) ; for ( int j = 1 ; j < temp . length ; j ++ ) { if ( Math . abs ( temp [ j ] ) > max ) max = Math . abs ( temp [ j ] ) ; } a11 /= max ; a21 /= max ; a12 /= max ; a22 /= max ; a32 /= max ; z11 /= max ; z22 /= max ; z12 /= max ; z21 /= max ; } // these equations are derived when the eigenvalues are extracted from the lower right // 2 by 2 matrix . See page 388 of Fundamentals of Matrix Computations 2nd ed for details . double b11 , b21 , b31 ; if ( useStandardEq ) { b11 = ( ( a11 - z11 ) * ( a11 - z22 ) - z21 * z12 ) / a21 + a12 ; b21 = a11 + a22 - z11 - z22 ; b31 = a32 ; } else { // this is different from the version in the book and seems in my testing to be more resilient to // over flow issues b11 = ( ( a11 - z11 ) * ( a11 - z22 ) - z21 * z12 ) + a12 * a21 ; b21 = ( a11 + a22 - z11 - z22 ) * a21 ; b31 = a32 * a21 ; } performImplicitDoubleStep ( x1 , x2 , b11 , b21 , b31 ) ;
public class LogTemplates { /** * Produces a log template which logs something at most every N secoonds . * @ param delegateLogger Concrete log template * @ param period N value in seconds , maximum period * @ return Logger */ public static < C > LogTemplate < C > everyNSeconds ( LogTemplate < C > delegateLogger , long period ) { } }
return everyNMilliseconds ( delegateLogger , period * SimonClock . MILLIS_IN_SECOND ) ;
public class DocBookBuildUtilities { /** * Generates the Revision component of a revnumber to be used in a Revision _ History . xml * file using the Book Version , Edition and Pubsnumber values from a content * specification . * @ param contentSpec the content specification to generate the revision number for . * @ return The generated revision number . */ public static String generateRevision ( final ContentSpec contentSpec ) { } }
final StringBuilder rev = new StringBuilder ( ) ; // Build the BookVersion / Edition part of the revision number . final String bookVersion ; if ( contentSpec . getBookVersion ( ) == null ) { bookVersion = contentSpec . getEdition ( ) ; } else { bookVersion = contentSpec . getBookVersion ( ) ; } if ( bookVersion == null ) { rev . append ( BuilderConstants . DEFAULT_EDITION ) . append ( ".0.0" ) ; } else { // Remove any beta / alpha declarations final String removeContent = bookVersion . replaceAll ( "^(([0-9]+)|([0-9]+.[0-9]+)|([0-9]+.[0-9]+.[0-9]+))" , "" ) ; final String fixedBookVersion = bookVersion . replace ( removeContent , "" ) ; if ( fixedBookVersion . matches ( "^[0-9]+\\.[0-9]+\\.[0-9]+$" ) ) { rev . append ( fixedBookVersion ) ; } else if ( fixedBookVersion . matches ( "^[0-9]+\\.[0-9]+$" ) ) { rev . append ( fixedBookVersion ) . append ( ".0" ) ; } else { rev . append ( fixedBookVersion ) . append ( ".0.0" ) ; } } return rev . toString ( ) ;
public class ComStmtExecute { /** * Send a prepare statement binary stream . * @ param pos database socket * @ param statementId prepareResult object received after preparation . * @ param parameters parameters * @ param parameterCount parameters number * @ param parameterTypeHeader parameters header * @ param cursorFlag cursor flag . Possible values : < ol > * < li > CURSOR _ TYPE _ NO _ CURSOR = fetch all < / li > * < li > CURSOR _ TYPE _ READ _ ONLY = fetch by bunch < / li > * < li > CURSOR _ TYPE _ FOR _ UPDATE = fetch by bunch with lock ? < / li > * < li > CURSOR _ TYPE _ SCROLLABLE = / / reserved , but not working < / li > * < / ol > * @ throws IOException if a connection error occur */ public static void send ( final PacketOutputStream pos , final int statementId , final ParameterHolder [ ] parameters , final int parameterCount , ColumnType [ ] parameterTypeHeader , byte cursorFlag ) throws IOException { } }
pos . startPacket ( 0 ) ; writeCmd ( statementId , parameters , parameterCount , parameterTypeHeader , pos , cursorFlag ) ; pos . flush ( ) ;
public class EurekaClinicalProperties { /** * Reads in a property value as a whitespace - delimited list of items . * @ param inPropertyName The name of the property to read . * @ return A list containing the items in the value , or < code > null < / code > if * the property is not found . */ protected final List < String > getStringListValue ( final String inPropertyName ) { } }
List < String > result = null ; String value = this . properties . getProperty ( inPropertyName ) ; if ( value != null ) { String [ ] temp = value . split ( "\\s+" ) ; result = new ArrayList < > ( temp . length ) ; for ( String s : temp ) { String trimmed = s . trim ( ) ; if ( trimmed . length ( ) > 0 ) { result . add ( s . trim ( ) ) ; } } } return result ;
public class AbstractLauncher { /** * Adds a no - value argument to the Spark invocation . If the argument is known , this method * validates whether the argument is indeed a no - value argument , and throws an exception * otherwise . * Use this method with caution . It is possible to create an invalid Spark command by passing * unknown arguments to this method , since those are allowed for forward compatibility . * @ since 1.5.0 * @ param arg Argument to add . * @ return This launcher . */ public T addSparkArg ( String arg ) { } }
SparkSubmitOptionParser validator = new ArgumentValidator ( false ) ; validator . parse ( Arrays . asList ( arg ) ) ; builder . userArgs . add ( arg ) ; return self ( ) ;
public class CmsDbExportView { /** * Sets up the combo box for the site choice . < p > */ private void setupComboBoxSite ( ) { } }
IndexedContainer container = CmsVaadinUtils . getAvailableSitesContainer ( A_CmsUI . getCmsObject ( ) , "title" ) ; m_site . setContainerDataSource ( container ) ; m_site . setItemCaptionMode ( ItemCaptionMode . PROPERTY ) ; m_site . setItemCaptionPropertyId ( "title" ) ; m_site . setNullSelectionAllowed ( false ) ; m_site . setTextInputAllowed ( false ) ; m_site . setValue ( A_CmsUI . getCmsObject ( ) . getRequestContext ( ) . getSiteRoot ( ) ) ; m_site . addValueChangeListener ( new ValueChangeListener ( ) { private static final long serialVersionUID = - 1019243885633462477L ; public void valueChange ( ValueChangeEvent event ) { changeSite ( ) ; removeUnvalidPathFields ( ) ; } } ) ; m_project . setContainerDataSource ( CmsVaadinUtils . getProjectsContainer ( A_CmsUI . getCmsObject ( ) , "caption" ) ) ; m_project . setItemCaptionPropertyId ( "caption" ) ; m_project . select ( A_CmsUI . getCmsObject ( ) . getRequestContext ( ) . getCurrentProject ( ) . getUuid ( ) ) ; m_project . setNewItemsAllowed ( false ) ; m_project . setNullSelectionAllowed ( false ) ; m_project . setTextInputAllowed ( false ) ;
public class SAXRule { /** * Add - on to the original code by manfred and seninp . This one similar to the original getRules ( ) * but populates and returns the array list of SAXRuleRecords . */ protected void getSAXRules ( ) { } }
arrRuleRecords . clear ( ) ; Vector < SAXRule > rules = new Vector < SAXRule > ( numRules . intValue ( ) ) ; rules . addElement ( this ) ; SAXRule currentRule ; int processedRules = 0 ; StringBuilder sbCurrentRule = new StringBuilder ( ) ; while ( processedRules < rules . size ( ) ) { currentRule = rules . elementAt ( processedRules ) ; for ( SAXSymbol sym = currentRule . first ( ) ; ( ! sym . isGuard ( ) ) ; sym = sym . n ) { if ( sym . isNonTerminal ( ) ) { SAXRule referedTo = ( ( SAXNonTerminal ) sym ) . r ; if ( ( rules . size ( ) > referedTo . index ) && ( rules . elementAt ( referedTo . index ) == referedTo ) ) { index = referedTo . index ; } else { index = rules . size ( ) ; referedTo . index = index ; rules . addElement ( referedTo ) ; } sbCurrentRule . append ( 'R' ) ; sbCurrentRule . append ( index ) ; } else { sbCurrentRule . append ( sym . value ) ; } sbCurrentRule . append ( ' ' ) ; } GrammarRuleRecord ruleConteiner = new GrammarRuleRecord ( ) ; ruleConteiner . setRuleNumber ( processedRules ) ; ruleConteiner . setRuleString ( sbCurrentRule . toString ( ) ) ; ruleConteiner . setRuleLevel ( currentRule . getLevel ( ) ) ; ruleConteiner . setRuleUseFrequency ( currentRule . count ) ; ruleConteiner . setOccurrences ( currentRule . getIndexes ( ) ) ; arrRuleRecords . add ( ruleConteiner ) ; sbCurrentRule = new StringBuilder ( ) ; processedRules ++ ; }
public class NFRule { /** * Formats the number , and inserts the resulting text into * toInsertInto . * @ param number The number being formatted * @ param toInsertInto The string where the resultant text should * be inserted * @ param pos The position in toInsertInto where the resultant text * should be inserted */ public void doFormat ( double number , StringBuilder toInsertInto , int pos , int recursionCount ) { } }
// first , insert the rule ' s rule text into toInsertInto at the // specified position , then insert the results of the substitutions // into the right places in toInsertInto // [ again , we have two copies of this routine that do the same thing // so that we don ' t sacrifice precision in a long by casting it // to a double ] int pluralRuleStart = ruleText . length ( ) ; int lengthOffset = 0 ; if ( rulePatternFormat == null ) { toInsertInto . insert ( pos , ruleText ) ; } else { pluralRuleStart = ruleText . indexOf ( "$(" ) ; int pluralRuleEnd = ruleText . indexOf ( ")$" , pluralRuleStart ) ; int initialLength = toInsertInto . length ( ) ; if ( pluralRuleEnd < ruleText . length ( ) - 1 ) { toInsertInto . insert ( pos , ruleText . substring ( pluralRuleEnd + 2 ) ) ; } double pluralVal = number ; if ( 0 <= pluralVal && pluralVal < 1 ) { // We ' re in a fractional rule , and we have to match the NumeratorSubstitution behavior . // 2.3 can become 0.2999998 for the fraction due to rounding errors . pluralVal = Math . round ( pluralVal * power ( radix , exponent ) ) ; } else { pluralVal = pluralVal / power ( radix , exponent ) ; } toInsertInto . insert ( pos , rulePatternFormat . format ( ( long ) ( pluralVal ) ) ) ; if ( pluralRuleStart > 0 ) { toInsertInto . insert ( pos , ruleText . substring ( 0 , pluralRuleStart ) ) ; } lengthOffset = ruleText . length ( ) - ( toInsertInto . length ( ) - initialLength ) ; } if ( sub2 != null ) { sub2 . doSubstitution ( number , toInsertInto , pos - ( sub2 . getPos ( ) > pluralRuleStart ? lengthOffset : 0 ) , recursionCount ) ; } if ( sub1 != null ) { sub1 . doSubstitution ( number , toInsertInto , pos - ( sub1 . getPos ( ) > pluralRuleStart ? lengthOffset : 0 ) , recursionCount ) ; }
public class CommonUtils { /** * Verify if the string sorting matches with asc or desc * Returns FALSE when sorting query value matches desc , otherwise it returns TRUE . * @ param sorting the sorting value from the http header * @ return false for desc or true for as */ public static Boolean isAscendingOrder ( String sorting ) { } }
return "desc" . equalsIgnoreCase ( sorting ) ? Boolean . FALSE : Boolean . TRUE ;
public class HttpMessage { /** * Sets the value of a date field . * Header or Trailer fields are set depending on message state . * @ param name the field name * @ param date the field date value */ public void setDateField ( String name , long date ) { } }
if ( _state != __MSG_EDITABLE ) return ; _header . putDateField ( name , date ) ;
public class SummernoteBase { /** * Set customized font names . * @ param fontNames customized font names * @ see SummernoteFontName */ public void setFontNames ( final SummernoteFontName ... fontNames ) { } }
JsArrayString array = JavaScriptObject . createArray ( ) . cast ( ) ; for ( SummernoteFontName fontName : fontNames ) { array . push ( fontName . getName ( ) ) ; } options . setFontNames ( array ) ;
public class CommerceNotificationTemplateWrapper { /** * Returns the localized from name of this commerce notification template in the language , optionally using the default language if no localization exists for the requested language . * @ param languageId the ID of the language * @ param useDefault whether to use the default language if no localization exists for the requested language * @ return the localized from name of this commerce notification template */ @ Override public String getFromName ( String languageId , boolean useDefault ) { } }
return _commerceNotificationTemplate . getFromName ( languageId , useDefault ) ;
public class BackgroundGmmCommon { /** * Checks to see if the the pivel value refers to the background or foreground * @ return true for background or false for foreground */ public int checkBackground ( float [ ] pixelValue , float [ ] dataRow , int modelIndex ) { } }
// see which gaussian is the best fit based on Mahalanobis distance int index = modelIndex ; float bestDistance = maxDistance * numBands ; float bestWeight = 0 ; int ng ; // number of gaussians in use for ( ng = 0 ; ng < maxGaussians ; ng ++ , index += gaussianStride ) { float variance = dataRow [ index + 1 ] ; if ( variance <= 0 ) { break ; } float mahalanobis = 0 ; for ( int i = 0 ; i < numBands ; i ++ ) { float mean = dataRow [ index + 2 + i ] ; float delta = pixelValue [ i ] - mean ; mahalanobis += delta * delta / variance ; } if ( mahalanobis < bestDistance ) { bestDistance = mahalanobis ; bestWeight = dataRow [ index ] ; } } if ( ng == 0 ) // There are no models . Return unknown return unknownValue ; return bestWeight >= significantWeight ? 0 : 1 ;
public class BitUtil { /** * Generate a byte array that is a hex representation of a given byte array . * @ param buffer to convert to a hex representation . * @ param offset the offset into the buffer . * @ param length the number of bytes to convert . * @ return new byte array that is hex representation ( in Big Endian ) of the passed array . */ public static byte [ ] toHexByteArray ( final byte [ ] buffer , final int offset , final int length ) { } }
final byte [ ] outputBuffer = new byte [ length << 1 ] ; for ( int i = 0 ; i < ( length << 1 ) ; i += 2 ) { final byte b = buffer [ offset + ( i >> 1 ) ] ; outputBuffer [ i ] = HEX_DIGIT_TABLE [ ( b >> 4 ) & 0x0F ] ; outputBuffer [ i + 1 ] = HEX_DIGIT_TABLE [ b & 0x0F ] ; } return outputBuffer ;
public class GrpcServerBuilder { /** * Create an new instance of { @ link GrpcServerBuilder } with authentication support . * @ param hostName the host name * @ param address the address * @ param authenticationServer the authentication server to use * @ param conf the Alluxio configuration * @ return a new instance of { @ link GrpcServerBuilder } */ public static GrpcServerBuilder forAddress ( String hostName , SocketAddress address , AuthenticationServer authenticationServer , AlluxioConfiguration conf ) { } }
return new GrpcServerBuilder ( hostName , address , authenticationServer , conf ) ;
public class CborDecoder { /** * Decodes exactly one DataItem from the input stream . * @ return a { @ link DataItem } or null if end of stream has reached . * @ throws CborException * if decoding failed */ public DataItem decodeNext ( ) throws CborException { } }
int symbol ; try { symbol = inputStream . read ( ) ; } catch ( IOException ioException ) { throw new CborException ( ioException ) ; } if ( symbol == - 1 ) { return null ; } switch ( MajorType . ofByte ( symbol ) ) { case ARRAY : return arrayDecoder . decode ( symbol ) ; case BYTE_STRING : return byteStringDecoder . decode ( symbol ) ; case MAP : return mapDecoder . decode ( symbol ) ; case NEGATIVE_INTEGER : return negativeIntegerDecoder . decode ( symbol ) ; case UNICODE_STRING : return unicodeStringDecoder . decode ( symbol ) ; case UNSIGNED_INTEGER : return unsignedIntegerDecoder . decode ( symbol ) ; case SPECIAL : return specialDecoder . decode ( symbol ) ; case TAG : Tag tag = tagDecoder . decode ( symbol ) ; DataItem next = decodeNext ( ) ; if ( next == null ) { throw new CborException ( "Unexpected end of stream: tag without following data item." ) ; } else { if ( autoDecodeRationalNumbers && tag . getValue ( ) == 30 ) { return decodeRationalNumber ( next ) ; } else if ( autoDecodeLanguageTaggedStrings && tag . getValue ( ) == 38 ) { return decodeLanguageTaggedString ( next ) ; } else { DataItem itemToTag = next ; while ( itemToTag . hasTag ( ) ) itemToTag = itemToTag . getTag ( ) ; itemToTag . setTag ( tag ) ; return next ; } } case INVALID : default : throw new CborException ( "Not implemented major type " + symbol ) ; }
public class MapUtil { /** * 转换对象为map * @ param object object * @ param ignore ignore * @ return map */ public static Map < String , String > objectToMap ( Object object , String ... ignore ) { } }
Map < String , String > tempMap = new LinkedHashMap < String , String > ( ) ; for ( Field f : getAllFields ( object . getClass ( ) ) ) { if ( ! f . isAccessible ( ) ) { f . setAccessible ( true ) ; } boolean ig = false ; if ( ignore != null && ignore . length > 0 ) { for ( String i : ignore ) { if ( i . equals ( f . getName ( ) ) ) { ig = true ; break ; } } } if ( ig ) { continue ; } else { Object o = null ; try { o = f . get ( object ) ; } catch ( IllegalArgumentException e ) { logger . error ( "" , e ) ; } catch ( IllegalAccessException e ) { logger . error ( "" , e ) ; } tempMap . put ( f . getName ( ) , o == null ? "" : o . toString ( ) ) ; } } return tempMap ;
public class Searcher { /** * Checks if a facet refinement is enabled . * @ param attribute the attribute to refine on . * @ param value the facet ' s value to check . * @ return { @ code true } if { @ code attribute } is being refined with { @ code value } . */ @ SuppressWarnings ( { } }
"WeakerAccess" , "unused" , "SameParameterValue" } ) // For library users public boolean hasFacetRefinement ( @ NonNull String attribute , @ NonNull String value ) { List < String > attributeRefinements = refinementMap . get ( attribute ) ; return attributeRefinements != null && attributeRefinements . contains ( value ) ;
public class WriteExecutor { /** * Return a ConceptBuilder for given Variable . This can be used to provide information for how to create * the concept that the variable represents . * This method is expected to be called from implementations of * VarProperty # insert ( Variable ) , provided they include the given Variable in * their PropertyExecutor # producedVars ( ) . * For example , a property may call { @ code executor . builder ( var ) . isa ( type ) ; } in order to provide a type for a var . * If the concept has already been created , this will return empty . */ public Optional < ConceptBuilder > tryBuilder ( Variable var ) { } }
var = equivalentVars . componentOf ( var ) ; if ( concepts . containsKey ( var ) ) { return Optional . empty ( ) ; } ConceptBuilder builder = conceptBuilders . get ( var ) ; if ( builder != null ) { return Optional . of ( builder ) ; } builder = ConceptBuilder . of ( this , var ) ; conceptBuilders . put ( var , builder ) ; return Optional . of ( builder ) ;
public class JavaDialectConfiguration { /** * Set the compiler to be used when building the rules semantic code blocks . * This overrides the default , and even what was set as a system property . */ public void setCompiler ( final CompilerType compiler ) { } }
// check that the jar for the specified compiler are present if ( compiler == CompilerType . ECLIPSE ) { try { Class . forName ( "org.eclipse.jdt.internal.compiler.Compiler" , true , this . conf . getClassLoader ( ) ) ; } catch ( ClassNotFoundException e ) { throw new RuntimeException ( "The Eclipse JDT Core jar is not in the classpath" ) ; } } else if ( compiler == CompilerType . JANINO ) { try { Class . forName ( "org.codehaus.janino.Parser" , true , this . conf . getClassLoader ( ) ) ; } catch ( ClassNotFoundException e ) { throw new RuntimeException ( "The Janino jar is not in the classpath" ) ; } } switch ( compiler ) { case ECLIPSE : this . compiler = CompilerType . ECLIPSE ; break ; case JANINO : this . compiler = CompilerType . JANINO ; break ; case NATIVE : this . compiler = CompilerType . NATIVE ; break ; default : throw new RuntimeException ( "value '" + compiler + "' is not a valid compiler" ) ; }
public class AbstractTableFilter { /** * { @ inheritDoc } */ public boolean canFilter ( Example example ) { } }
for ( String keyword : keywords ) { if ( keyword . equalsIgnoreCase ( contentOf ( example . at ( 0 , 0 , 0 ) ) ) ) return true ; } return false ;
public class TlvUtil { /** * Method used to parser Tag and length * @ param data * data to parse * @ return tag and length */ public static List < TagAndLength > parseTagAndLength ( final byte [ ] data ) { } }
List < TagAndLength > tagAndLengthList = new ArrayList < TagAndLength > ( ) ; if ( data != null ) { TLVInputStream stream = new TLVInputStream ( new ByteArrayInputStream ( data ) ) ; try { while ( stream . available ( ) > 0 ) { if ( stream . available ( ) < 2 ) { throw new TlvException ( "Data length < 2 : " + stream . available ( ) ) ; } ITag tag = searchTagById ( stream . readTag ( ) ) ; int tagValueLength = stream . readLength ( ) ; tagAndLengthList . add ( new TagAndLength ( tag , tagValueLength ) ) ; } } catch ( IOException e ) { LOGGER . error ( e . getMessage ( ) , e ) ; } finally { IOUtils . closeQuietly ( stream ) ; } } return tagAndLengthList ;
public class BetaDetector { /** * Returns true if the given annotations contain { @ link Beta } . */ private static boolean isBeta ( AnnotationEntry [ ] annotationEntries ) { } }
for ( AnnotationEntry annotation : annotationEntries ) { if ( BETA_ANNOTATION . equals ( annotation . getAnnotationType ( ) ) ) { return true ; } } return false ;
public class AbstractKSIResponse { /** * Checks the MAC code . * @ param key * key to be used to calculate MAC code . * @ param hmacAlgorithm * algorithm for verifying the HMAC of incoming messages . * @ throws KSIException * when MAC code doesn ' t validate */ private void validateMac ( byte [ ] key , HashAlgorithm hmacAlgorithm ) throws KSIException { } }
try { HashAlgorithm receivedHmacAlgorithm = mac . getAlgorithm ( ) ; if ( receivedHmacAlgorithm != hmacAlgorithm ) { throw new KSIException ( "HMAC algorithm mismatch. Expected " + hmacAlgorithm . getName ( ) + ", received " + receivedHmacAlgorithm . getName ( ) ) ; } // calculate and set the MAC value DataHash macValue = new DataHash ( hmacAlgorithm , Util . calculateHMAC ( getContent ( ) , key , hmacAlgorithm . getName ( ) ) ) ; if ( ! mac . equals ( macValue ) ) { throw new InvalidMessageAuthenticationCodeException ( "Invalid MAC code. Expected " + mac + ", calculated " + macValue ) ; } } catch ( IOException e ) { throw new InvalidMessageAuthenticationCodeException ( "IO Exception occurred turning MAC calculation" , e ) ; } catch ( InvalidKeyException e ) { throw new InvalidMessageAuthenticationCodeException ( "Problem with HMAC key." , e ) ; } catch ( NoSuchAlgorithmException e ) { throw new InvalidMessageAuthenticationCodeException ( "Unsupported HMAC algorithm." , e ) ; } catch ( HashException e ) { throw new KSIProtocolException ( "Hashing exception occurred when calculating KSI service response HMAC" , e ) ; }
public class CmsResourceUtil { /** * Returns the name of the user who created the given resource . < p > * @ return the name of the user who created the given resource */ public String getUserCreated ( ) { } }
String user = m_resource . getUserCreated ( ) . toString ( ) ; try { user = getCurrentOuRelativeName ( CmsPrincipal . readPrincipalIncludingHistory ( getCms ( ) , m_resource . getUserCreated ( ) ) . getName ( ) ) ; } catch ( Throwable e ) { LOG . info ( e . getLocalizedMessage ( ) ) ; } return user ;
public class ServletHttpResponse { void setOutputState ( int s ) throws IOException { } }
if ( s < 0 ) { _outputState = DISABLED ; if ( _writer != null ) _writer . disable ( ) ; _writer = null ; if ( _out != null ) _out . disable ( ) ; _out = null ; } else _outputState = s ;
public class CompileStack { /** * Defines a new Variable using an AST variable . * @ param initFromStack if true the last element of the * stack will be used to initialize * the new variable . If false null * will be used . */ public BytecodeVariable defineVariable ( Variable v , boolean initFromStack ) { } }
return defineVariable ( v , v . getOriginType ( ) , initFromStack ) ;
public class ImmutableLightMetaProperty { @ Override @ SuppressWarnings ( "unchecked" ) public P get ( Bean bean ) { } }
return ( P ) getter . get ( bean ) ;
public class AbstractLocaleResolver { /** * Resolve the default time zone for the given translet , * Called if can not find specified TimeZone . * @ param translet the translet to resolve the time zone for * @ return the default time zone ( or { @ code null } if none defined ) * @ see # setDefaultTimeZone */ protected TimeZone resolveDefaultTimeZone ( Translet translet ) { } }
TimeZone defaultTimeZone = getDefaultTimeZone ( ) ; if ( defaultTimeZone != null ) { translet . getRequestAdapter ( ) . setTimeZone ( defaultTimeZone ) ; return defaultTimeZone ; } else { return translet . getRequestAdapter ( ) . getTimeZone ( ) ; }
public class SSLConfigManager { /** * Called after all the SSL configuration is processed , set the default SSLContext for the runtime . * @ throws SSLException */ public synchronized void resetDefaultSSLContextIfNeeded ( String modifiedFile ) throws Exception { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "resetDefaultSSLContextIfNeeded" , modifiedFile ) ; SSLConfig defaultSSLConfig = getDefaultSSLConfig ( ) ; if ( defaultSSLConfig != null && keyStoreModified ( defaultSSLConfig , modifiedFile ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Setting new default SSLContext with: " + defaultSSLConfig ) ; JSSEProviderFactory . getInstance ( null ) . setServerDefaultSSLContext ( defaultSSLConfig ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Modified keystore file are not part of the default SSL configuration." ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "resetDefaultSSLContextIfNeeded" ) ;
public class JsonMapper { /** * Serialize an object to a JSON String . * @ param object The object to serialize . */ public String serialize ( T object ) throws IOException { } }
StringWriter sw = new StringWriter ( ) ; JsonGenerator jsonGenerator = LoganSquare . JSON_FACTORY . createGenerator ( sw ) ; serialize ( object , jsonGenerator , true ) ; jsonGenerator . close ( ) ; return sw . toString ( ) ;
public class AbstractTypeCheckVisitor { /** * Type check method for let be such that * @ param node * @ param nodeLocation * @ param bind * @ param suchThat * @ param body * @ param question * @ return a pair of the type and definition * @ throws AnalysisException */ protected Map . Entry < PType , AMultiBindListDefinition > typecheckLetBeSt ( INode node , ILexLocation nodeLocation , PMultipleBind bind , PExp suchThat , INode body , TypeCheckInfo question ) throws AnalysisException { } }
final PDefinition def = AstFactory . newAMultiBindListDefinition ( nodeLocation , question . assistantFactory . createPMultipleBindAssistant ( ) . getMultipleBindList ( ( PMultipleBind ) bind ) ) ; def . apply ( THIS , question . newConstraint ( null ) ) ; List < PDefinition > qualified = new Vector < PDefinition > ( ) ; for ( PDefinition d : question . assistantFactory . createPDefinitionAssistant ( ) . getDefinitions ( def ) ) { PDefinition copy = d . clone ( ) ; copy . setNameScope ( NameScope . LOCAL ) ; qualified . add ( copy ) ; } Environment local = new FlatCheckedEnvironment ( question . assistantFactory , qualified , question . env , question . scope ) ; TypeCheckInfo newInfo = new TypeCheckInfo ( question . assistantFactory , local , question . scope , question . qualifiers , question . constraint , null ) ; if ( suchThat != null && ! question . assistantFactory . createPTypeAssistant ( ) . isType ( suchThat . apply ( THIS , newInfo . newConstraint ( null ) ) , ABooleanBasicType . class ) ) { boolean isExpression = node instanceof PExp ; TypeCheckerErrors . report ( ( isExpression ? 3117 : 3225 ) , "Such that clause is not boolean" , nodeLocation , node ) ; } newInfo . qualifiers = null ; final PType r = body . apply ( THIS , newInfo ) ; local . unusedCheck ( ) ; return new Map . Entry < PType , AMultiBindListDefinition > ( ) { @ Override public AMultiBindListDefinition setValue ( AMultiBindListDefinition value ) { return null ; } @ Override public AMultiBindListDefinition getValue ( ) { return ( AMultiBindListDefinition ) def ; } @ Override public PType getKey ( ) { return r ; } } ;
public class ActionSupport { /** * Add error to next action . * @ param msgKey * @ param args */ protected final void addFlashError ( String msgKey , Object ... args ) { } }
getFlash ( ) . addError ( getTextInternal ( msgKey , args ) ) ;
public class CronTrigger { /** * Updates the < code > CronTrigger < / code > ' s state based on the * MISFIRE _ INSTRUCTION _ XXX that was selected when the < code > CronTrigger < / code > * was created . * If the misfire instruction is set to MISFIRE _ INSTRUCTION _ SMART _ POLICY , then * the following scheme will be used : < br > * < ul > * < li > The instruction will be interpreted as * < code > MISFIRE _ INSTRUCTION _ FIRE _ ONCE _ NOW < / code > < / li > * < / ul > */ @ Override public void updateAfterMisfire ( final ICalendar cal ) { } }
int instr = getMisfireInstruction ( ) ; if ( instr == ITrigger . MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY ) return ; if ( instr == MISFIRE_INSTRUCTION_SMART_POLICY ) { instr = MISFIRE_INSTRUCTION_FIRE_ONCE_NOW ; } if ( instr == MISFIRE_INSTRUCTION_DO_NOTHING ) { Date newFireTime = getFireTimeAfter ( new Date ( ) ) ; while ( newFireTime != null && cal != null && ! cal . isTimeIncluded ( newFireTime . getTime ( ) ) ) { newFireTime = getFireTimeAfter ( newFireTime ) ; } setNextFireTime ( newFireTime ) ; } else if ( instr == MISFIRE_INSTRUCTION_FIRE_ONCE_NOW ) { setNextFireTime ( new Date ( ) ) ; }
public class CommerceOrderPersistenceImpl { /** * Removes all the commerce orders where uuid = & # 63 ; and companyId = & # 63 ; from the database . * @ param uuid the uuid * @ param companyId the company ID */ @ Override public void removeByUuid_C ( String uuid , long companyId ) { } }
for ( CommerceOrder commerceOrder : findByUuid_C ( uuid , companyId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( commerceOrder ) ; }
public class Parser { /** * A { @ link Parser } that reports reports an error about { @ code name } expected , if { @ code this } fails with no partial * match . */ public Parser < T > label ( final String name ) { } }
return new Parser < T > ( ) { @ Override public Parser < T > label ( String overrideName ) { return Parser . this . label ( overrideName ) ; } @ Override boolean apply ( ParseContext ctxt ) { return ctxt . applyNewNode ( Parser . this , name ) ; } @ Override public String toString ( ) { return name ; } } ;
public class ResolverUtil { /** * Finds matching classes within a jar files that contains a folder structure matching the package structure . If the * File is not a JarFile or does not exist a warning will be logged , but no error will be raised . * @ param test * a Test used to filter the classes that are discovered * @ param parent * the parent package under which classes must be in order to be considered * @ param stream * The jar InputStream */ private void loadImplementationsInJar ( final Test test , final String parent , final String path , final JarInputStream stream ) { } }
try { JarEntry entry ; while ( ( entry = stream . getNextJarEntry ( ) ) != null ) { final String name = entry . getName ( ) ; if ( ! entry . isDirectory ( ) && name . startsWith ( parent ) && isTestApplicable ( test , name ) ) { addIfMatching ( test , name ) ; } } } catch ( final IOException ioe ) { LOGGER . error ( "Could not search jar file '" + path + "' for classes matching criteria: " + test + " due to an IOException" , ioe ) ; }
public class Matrix4d { /** * Set this matrix to a rotation transformation about the X axis . * When used with a right - handed coordinate system , the produced rotation will rotate a vector * counter - clockwise around the rotation axis , when viewing along the negative axis direction towards the origin . * When used with a left - handed coordinate system , the rotation is clockwise . * Reference : < a href = " http : / / en . wikipedia . org / wiki / Rotation _ matrix # Basic _ rotations " > http : / / en . wikipedia . org < / a > * @ param ang * the angle in radians * @ return this */ public Matrix4d rotationX ( double ang ) { } }
double sin , cos ; sin = Math . sin ( ang ) ; cos = Math . cosFromSin ( sin , ang ) ; if ( ( properties & PROPERTY_IDENTITY ) == 0 ) this . _identity ( ) ; m11 = cos ; m12 = sin ; m21 = - sin ; m22 = cos ; properties = PROPERTY_AFFINE | PROPERTY_ORTHONORMAL ; return this ;
public class LocaleDisplayNames { /** * Returns an instance of LocaleDisplayNames that returns names formatted for the provided locale , * using the provided dialectHandling . * @ param locale the display locale * @ param dialectHandling how to select names for locales * @ return a LocaleDisplayNames instance */ public static LocaleDisplayNames getInstance ( ULocale locale , DialectHandling dialectHandling ) { } }
LocaleDisplayNames result = null ; if ( FACTORY_DIALECTHANDLING != null ) { try { result = ( LocaleDisplayNames ) FACTORY_DIALECTHANDLING . invoke ( null , locale , dialectHandling ) ; } catch ( InvocationTargetException e ) { // fall through } catch ( IllegalAccessException e ) { // fall through } } if ( result == null ) { result = new LastResortLocaleDisplayNames ( locale , dialectHandling ) ; } return result ;
public class techsupport { /** * < pre > * Performs generic data validation for the operation to be performed * < / pre > */ protected void validate ( String operationType ) throws Exception { } }
super . validate ( operationType ) ; MPSString mode_validator = new MPSString ( ) ; mode_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 128 ) ; mode_validator . setConstraintMinStrLen ( MPSConstants . GENERIC_CONSTRAINT , 1 ) ; mode_validator . setConstraintIsReq ( MPSConstants . ADD_CONSTRAINT , true ) ; mode_validator . validate ( operationType , mode , "\"mode\"" ) ; MPSString file_name_validator = new MPSString ( ) ; file_name_validator . setConstraintIsReq ( MPSConstants . DELETE_CONSTRAINT , true ) ; file_name_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 256 ) ; file_name_validator . setConstraintMinStrLen ( MPSConstants . GENERIC_CONSTRAINT , 1 ) ; file_name_validator . setConstraintIsReq ( MPSConstants . MODIFY_CONSTRAINT , true ) ; file_name_validator . validate ( operationType , file_name , "\"file_name\"" ) ; MPSString file_last_modified_validator = new MPSString ( ) ; file_last_modified_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 128 ) ; file_last_modified_validator . setConstraintMinStrLen ( MPSConstants . GENERIC_CONSTRAINT , 1 ) ; file_last_modified_validator . validate ( operationType , file_last_modified , "\"file_last_modified\"" ) ; MPSInt file_size_validator = new MPSInt ( ) ; file_size_validator . validate ( operationType , file_size , "\"file_size\"" ) ; MPSString act_id_validator = new MPSString ( ) ; act_id_validator . validate ( operationType , act_id , "\"act_id\"" ) ; MPSString vpx_list_for_techsupport_validator = new MPSString ( ) ; vpx_list_for_techsupport_validator . setConstraintMaxStrLen ( MPSConstants . GENERIC_CONSTRAINT , 50 ) ; vpx_list_for_techsupport_validator . setConstraintMinStrLen ( MPSConstants . GENERIC_CONSTRAINT , 1 ) ; if ( vpx_list_for_techsupport != null ) { for ( int i = 0 ; i < vpx_list_for_techsupport . length ; i ++ ) { vpx_list_for_techsupport_validator . validate ( operationType , vpx_list_for_techsupport [ i ] , "vpx_list_for_techsupport[" + i + "]" ) ; } }
public class JDBCCallableStatement { /** * # ifdef JAVA4 */ public synchronized void setDate ( String parameterName , Date x ) throws SQLException { } }
setDate ( findParameterIndex ( parameterName ) , x ) ;
public class UserAPI { /** * 创建分组 * @ param name 分组名称 * @ return 返回对象 , 包含分组的ID和名称信息 */ public CreateGroupResponse createGroup ( String name ) { } }
CreateGroupResponse response ; BeanUtil . requireNonNull ( name , "name is null" ) ; LOG . debug ( "创建分组....." ) ; String url = BASE_API_URL + "cgi-bin/groups/create?access_token=#" ; Map < String , Object > param = new HashMap < String , Object > ( ) ; Map < String , Object > group = new HashMap < String , Object > ( ) ; group . put ( "name" , name ) ; param . put ( "group" , group ) ; BaseResponse r = executePost ( url , JSONUtil . toJson ( param ) ) ; String resultJson = isSuccess ( r . getErrcode ( ) ) ? r . getErrmsg ( ) : r . toJsonString ( ) ; response = JSONUtil . toBean ( resultJson , CreateGroupResponse . class ) ; return response ;
public class RunWindupCommand { /** * Removes the . * suffix from the include and exclude packages input . */ private void normalizePackagePrefixes ( WindupConfiguration windupConfiguration ) { } }
List < String > includePackages = windupConfiguration . getOptionValue ( ScanPackagesOption . NAME ) ; includePackages = normalizePackagePrefixes ( includePackages ) ; windupConfiguration . setOptionValue ( ScanPackagesOption . NAME , includePackages ) ; List < String > excludePackages = windupConfiguration . getOptionValue ( ExcludePackagesOption . NAME ) ; excludePackages = normalizePackagePrefixes ( excludePackages ) ; windupConfiguration . setOptionValue ( ExcludePackagesOption . NAME , excludePackages ) ;
public class ScanSpec { /** * Applicable only when an expression has been specified . * Used to specify the actual values for the attribute - name placeholders , * where the value in the map can either be string for simple attribute * name , or a JSON path expression . * @ see ScanRequest # withExpressionAttributeNames ( Map ) */ public ScanSpec withNameMap ( Map < String , String > nameMap ) { } }
if ( nameMap == null ) this . nameMap = null ; else this . nameMap = Collections . unmodifiableMap ( new LinkedHashMap < String , String > ( nameMap ) ) ; return this ;
public class ContactType { /** * Get the contact type for this record . * ( The code is the record table name ) . * @ param The record . * @ return The Contact Type record ( or null if not found ) . */ public ContactType getContactType ( Record record ) { } }
String strType = record . getTableNames ( false ) ; this . setKeyArea ( ContactType . CODE_KEY ) ; this . getField ( ContactType . CODE ) . setString ( strType ) ; try { if ( this . seek ( null ) ) { // Success return this ; } } catch ( DBException ex ) { ex . printStackTrace ( ) ; } return null ; // Not found
public class DirectoryValidator { /** * Does the actual validation * @ param directory the directory to validate * @ param option validation options */ protected void validate ( File directory , ValidationOptions option ) { } }
if ( ! directory . exists ( ) ) { this . errors . addError ( "directory <{}> does not exist in file system" , directory . getAbsolutePath ( ) ) ; } else if ( ! directory . isDirectory ( ) ) { this . errors . addError ( "directory <{}> is not a directory" , directory . getAbsolutePath ( ) ) ; } else if ( directory . isHidden ( ) ) { this . errors . addError ( "directory <{}> is a hidden directory" , directory . getAbsolutePath ( ) ) ; } else { switch ( option ) { case AS_SOURCE : if ( ! directory . canRead ( ) ) { this . errors . addError ( "directory <{}> is not readable" , directory . getAbsolutePath ( ) ) ; } break ; case AS_SOURCE_AND_TARGET : if ( ! directory . canRead ( ) ) { this . errors . addError ( "directory <{}> is not readable" , directory . getAbsolutePath ( ) ) ; } if ( ! directory . canWrite ( ) ) { this . errors . addError ( "directory <{}> is not writable" , directory . getAbsolutePath ( ) ) ; } break ; case AS_TARGET : if ( ! directory . canWrite ( ) ) { this . errors . addError ( "directory <{}> is not writable" , directory . getAbsolutePath ( ) ) ; } break ; } }
public class TextUtility { /** * 是否全部不是中文 * @ param sString * @ return */ public static boolean isAllNonChinese ( byte [ ] sString ) { } }
int nLen = sString . length ; int i = 0 ; while ( i < nLen ) { if ( getUnsigned ( sString [ i ] ) < 248 && getUnsigned ( sString [ i ] ) > 175 ) return false ; if ( sString [ i ] < 0 ) i += 2 ; else i += 1 ; } return true ;
public class Row { /** * Creates a new instance of the { @ link Row } . */ @ InternalApi public static Row create ( ByteString key , List < RowCell > cells ) { } }
return new AutoValue_Row ( key , cells ) ;
public class Checkin { /** * The check in is done without calling triggers and check of access * rights . Executes the check in : * < ul > * < li > the file is checked in < / li > * < li > the file name and file length is stored in with * { @ link org . efaps . db . Update } ( complete filename without path ) < / li > * < / ul > * @ param _ fileName file name to check in ( could include also the path ) * @ param _ in input stream with the binary data * @ param _ size size of file in stream to check in ( negative size means * that all from the stream must be written ) * @ throws EFapsException if checkout action fails */ public void executeWithoutTrigger ( final String _fileName , final InputStream _in , final int _size ) throws EFapsException { } }
final Context context = Context . getThreadContext ( ) ; Resource storeRsrc = null ; boolean ok = false ; try { getInstance ( ) . getType ( ) ; storeRsrc = context . getStoreResource ( getInstance ( ) , Resource . StoreEvent . WRITE ) ; storeRsrc . write ( _in , _size , _fileName ) ; storeRsrc = null ; ok = true ; } catch ( final EFapsException e ) { Checkin . LOG . error ( "could not checkin " + super . getInstance ( ) , e ) ; throw e ; } finally { if ( ! ok ) { context . abort ( ) ; } }
public class AptControlInterface { /** * Enforces the VersionRequired annotation for control extensions . */ private void enforceVersionRequired ( ) { } }
if ( _versionRequired != null ) { if ( ! isExtension ( ) ) { _ap . printError ( _intfDecl , "versionrequired.illegal.usage" ) ; return ; } int majorRequired = _versionRequired . major ( ) ; int minorRequired = _versionRequired . minor ( ) ; if ( majorRequired < 0 ) // no real version requirement return ; AptControlInterface ci = getMostDerivedInterface ( ) ; if ( ci == null ) return ; int majorPresent = - 1 ; int minorPresent = - 1 ; Version ciVersion = ci . _version ; if ( ciVersion != null ) { majorPresent = ciVersion . major ( ) ; minorPresent = ciVersion . minor ( ) ; if ( majorRequired <= majorPresent && ( minorRequired < 0 || minorRequired <= minorPresent ) ) { // Version requirement is satisfied return ; } } // Version requirement failed _ap . printError ( _intfDecl , "versionrequired.failed" , _intfDecl . getSimpleName ( ) , majorRequired , minorRequired , majorPresent , minorPresent ) ; }
public class CmsImageCacheHelper { /** * Returns the variations for the given image . < p > * @ param imgName the image name * @ return the variations for the given image */ public List getVariations ( String imgName ) { } }
List ret = ( List ) m_variations . get ( imgName ) ; if ( ret == null ) { return new ArrayList ( ) ; } Collections . sort ( ret ) ; return ret ;
public class DBInstance { /** * The status of a Read Replica . If the instance is not a Read Replica , this is blank . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setStatusInfos ( java . util . Collection ) } or { @ link # withStatusInfos ( java . util . Collection ) } if you want to * override the existing values . * @ param statusInfos * The status of a Read Replica . If the instance is not a Read Replica , this is blank . * @ return Returns a reference to this object so that method calls can be chained together . */ public DBInstance withStatusInfos ( DBInstanceStatusInfo ... statusInfos ) { } }
if ( this . statusInfos == null ) { setStatusInfos ( new com . amazonaws . internal . SdkInternalList < DBInstanceStatusInfo > ( statusInfos . length ) ) ; } for ( DBInstanceStatusInfo ele : statusInfos ) { this . statusInfos . add ( ele ) ; } return this ;
public class KafkaConsumer { /** * Stop message listener container . */ public void stop ( ) { } }
try { if ( CollectionUtils . isEmpty ( consumer . subscription ( ) ) ) { consumer . unsubscribe ( ) ; } } finally { consumer . close ( Duration . ofMillis ( 10 * 1000L ) ) ; }
public class AmazonDynamoDBAsyncClient { /** * Edits an existing item ' s attributes . * You can perform a conditional update ( insert a new attribute * name - value pair if it doesn ' t exist , or replace an existing name - value * pair if it has certain expected attribute values ) . * @ param updateItemRequest Container for the necessary parameters to * execute the UpdateItem operation on AmazonDynamoDB . * @ return A Java Future object containing the response from the * UpdateItem service method , as returned by AmazonDynamoDB . * @ throws AmazonClientException * If any internal errors are encountered inside the client while * attempting to make the request or handle the response . For example * if a network connection is not available . * @ throws AmazonServiceException * If an error response is returned by AmazonDynamoDB indicating * either a problem with the data in the request , or a server side issue . */ public Future < UpdateItemResult > updateItemAsync ( final UpdateItemRequest updateItemRequest ) throws AmazonServiceException , AmazonClientException { } }
return executorService . submit ( new Callable < UpdateItemResult > ( ) { public UpdateItemResult call ( ) throws Exception { return updateItem ( updateItemRequest ) ; } } ) ;
public class LdaptiveAuthenticatorBuilder { /** * New connection config connection config . * @ param l the ldap properties * @ return the connection config */ public static ConnectionConfig newConnectionConfig ( final AbstractLdapProperties l ) { } }
final ConnectionConfig cc = new ConnectionConfig ( ) ; final String urls = Arrays . stream ( l . getLdapUrl ( ) . split ( "," ) ) . collect ( Collectors . joining ( " " ) ) ; LOGGER . debug ( "Transformed LDAP urls from [{}] to [{}]" , l . getLdapUrl ( ) , urls ) ; cc . setLdapUrl ( urls ) ; cc . setUseSSL ( l . isUseSsl ( ) ) ; cc . setUseStartTLS ( l . isUseStartTls ( ) ) ; cc . setConnectTimeout ( newDuration ( l . getConnectTimeout ( ) ) ) ; if ( l . getTrustCertificates ( ) != null ) { final X509CredentialConfig cfg = new X509CredentialConfig ( ) ; cfg . setTrustCertificates ( l . getTrustCertificates ( ) ) ; cc . setSslConfig ( new SslConfig ( cfg ) ) ; } else if ( l . getKeystore ( ) != null ) { final KeyStoreCredentialConfig cfg = new KeyStoreCredentialConfig ( ) ; cfg . setKeyStore ( l . getKeystore ( ) ) ; cfg . setKeyStorePassword ( l . getKeystorePassword ( ) ) ; cfg . setKeyStoreType ( l . getKeystoreType ( ) ) ; cc . setSslConfig ( new SslConfig ( cfg ) ) ; } else { cc . setSslConfig ( new SslConfig ( ) ) ; } if ( l . getSaslMechanism ( ) != null ) { final BindConnectionInitializer bc = new BindConnectionInitializer ( ) ; final SaslConfig sc ; switch ( l . getSaslMechanism ( ) ) { case DIGEST_MD5 : sc = new DigestMd5Config ( ) ; ( ( DigestMd5Config ) sc ) . setRealm ( l . getSaslRealm ( ) ) ; break ; case CRAM_MD5 : sc = new CramMd5Config ( ) ; break ; case EXTERNAL : sc = new ExternalConfig ( ) ; break ; case GSSAPI : sc = new GssApiConfig ( ) ; ( ( GssApiConfig ) sc ) . setRealm ( l . getSaslRealm ( ) ) ; break ; default : throw new IllegalArgumentException ( "Unknown SASL mechanism " + l . getSaslMechanism ( ) . name ( ) ) ; } sc . setAuthorizationId ( l . getSaslAuthorizationId ( ) ) ; sc . setMutualAuthentication ( l . getSaslMutualAuth ( ) ) ; sc . setQualityOfProtection ( l . getSaslQualityOfProtection ( ) ) ; sc . setSecurityStrength ( l . getSaslSecurityStrength ( ) ) ; bc . setBindSaslConfig ( sc ) ; cc . setConnectionInitializer ( bc ) ; } else if ( CommonHelper . areEquals ( l . getBindCredential ( ) , "*" ) && CommonHelper . areEquals ( l . getBindDn ( ) , "*" ) ) { cc . setConnectionInitializer ( new FastBindOperation . FastBindConnectionInitializer ( ) ) ; } else if ( CommonHelper . isNotBlank ( l . getBindDn ( ) ) && CommonHelper . isNotBlank ( l . getBindCredential ( ) ) ) { cc . setConnectionInitializer ( new BindConnectionInitializer ( l . getBindDn ( ) , new Credential ( l . getBindCredential ( ) ) ) ) ; } return cc ;
public class FileSystemView { /** * Returns a file attribute view for the given path in this view . */ @ Nullable public < V extends FileAttributeView > V getFileAttributeView ( final JimfsPath path , Class < V > type , final Set < ? super LinkOption > options ) { } }
return store . getFileAttributeView ( new FileLookup ( ) { @ Override public File lookup ( ) throws IOException { return lookUpWithLock ( path , options ) . requireExists ( path ) . file ( ) ; } } , type ) ;
public class Value { /** * Arbitrarily nested arrays * @ param arrayValues * Arbitrarily nested arrays */ public void setArrayValues ( java . util . Collection < Value > arrayValues ) { } }
if ( arrayValues == null ) { this . arrayValues = null ; return ; } this . arrayValues = new java . util . ArrayList < Value > ( arrayValues ) ;
public class ExpressionParser { /** * Parses the SemVer Expressions . * @ param input a string representing the SemVer Expression * @ return the AST for the SemVer Expressions * @ throws LexerException when encounters an illegal character * @ throws UnexpectedTokenException when consumes a token of an unexpected type */ @ Override public Expression parse ( String input ) { } }
tokens = lexer . tokenize ( input ) ; Expression expr = parseSemVerExpression ( ) ; consumeNextToken ( EOI ) ; return expr ;
public class AmazonIdentityManagementClient { /** * Lists all the managed policies that are available in your AWS account , including your own customer - defined * managed policies and all AWS managed policies . * You can filter the list of policies that is returned using the optional < code > OnlyAttached < / code > , * < code > Scope < / code > , and < code > PathPrefix < / code > parameters . For example , to list only the customer managed * policies in your AWS account , set < code > Scope < / code > to < code > Local < / code > . To list only AWS managed policies , * set < code > Scope < / code > to < code > AWS < / code > . * You can paginate the results using the < code > MaxItems < / code > and < code > Marker < / code > parameters . * For more information about managed policies , see < a * href = " https : / / docs . aws . amazon . com / IAM / latest / UserGuide / policies - managed - vs - inline . html " > Managed Policies and * Inline Policies < / a > in the < i > IAM User Guide < / i > . * @ param listPoliciesRequest * @ return Result of the ListPolicies operation returned by the service . * @ throws ServiceFailureException * The request processing has failed because of an unknown error , exception or failure . * @ sample AmazonIdentityManagement . ListPolicies * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / iam - 2010-05-08 / ListPolicies " target = " _ top " > AWS API * Documentation < / a > */ @ Override public ListPoliciesResult listPolicies ( ListPoliciesRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeListPolicies ( request ) ;
public class AbstractInjectionEngine { /** * Populates the empty cookie map with cookies to be injections . * @ param injectionTargetMap An empty map to be populated with the injection targets from * the merged xml and annotations . * @ param compNSConfig The component configuration information provided by the container . * @ throws InjectionException if an error occurs processing the injection metadata */ @ Override public void processInjectionMetaData ( HashMap < Class < ? > , InjectionTarget [ ] > injectionTargetMap , ComponentNameSpaceConfiguration compNSConfig ) throws InjectionException { } }
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "processInjectionMetaData (targets)" ) ; InjectionProcessorContextImpl context = createInjectionProcessorContext ( ) ; // F743-31682 - Always bind in the client container code flow . context . ivBindNonCompInjectionBindings = compNSConfig . isClientContainer ( ) && compNSConfig . getClassLoader ( ) != null ; compNSConfig . setInjectionProcessorContext ( context ) ; processInjectionMetaData ( compNSConfig , null ) ; List < Class < ? > > injectionClasses = compNSConfig . getInjectionClasses ( ) ; if ( injectionClasses != null && ! injectionClasses . isEmpty ( ) ) // d721619 { Map < Class < ? > , List < InjectionTarget > > declaredTargets = getDeclaredInjectionTargets ( context . ivProcessedInjectionBindings ) ; boolean checkAppConfig = compNSConfig . isCheckApplicationConfiguration ( ) ; for ( Class < ? > injectionClass : injectionClasses ) { InjectionTarget [ ] injectionTargets = getInjectionTargets ( declaredTargets , injectionClass , checkAppConfig ) ; injectionTargetMap . put ( injectionClass , injectionTargets ) ; } } context . metadataProcessingComplete ( ) ; // F87539 notifyInjectionMetaDataListeners ( null , compNSConfig ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "processInjectionMetaData: " + injectionTargetMap ) ;
public class DateUtils { /** * 计算日期为星期几 * @ param date 日期 * @ return 从星期天开始 , 星期天是1 , 依次类推 */ public static int getWeek ( Date date ) { } }
CALENDAR . setTime ( date ) ; return CALENDAR . get ( Calendar . DAY_OF_WEEK ) ;
public class FragmentStack { /** * Pushes a fragment to the top of the stack . */ public void push ( Fragment fragment ) { } }
Fragment top = peek ( ) ; if ( top != null ) { manager . beginTransaction ( ) . setCustomAnimations ( R . anim . enter_from_right , R . anim . exit_to_left , R . anim . enter_from_left , R . anim . exit_to_right ) . remove ( top ) . add ( containerId , fragment , indexToTag ( manager . getBackStackEntryCount ( ) + 1 ) ) . addToBackStack ( null ) . commit ( ) ; } else { manager . beginTransaction ( ) . add ( containerId , fragment , indexToTag ( 0 ) ) . commit ( ) ; } manager . executePendingTransactions ( ) ;
public class MaterialScrollfire { /** * Executes callback method depending on how far into the page you ' ve scrolled */ public static void apply ( String selector , Functions . Func callback ) { } }
apply ( $ ( selector ) . asElement ( ) , 100 , callback ) ;
public class SchemasInner { /** * Creates or updates an integration account schema . * @ param resourceGroupName The resource group name . * @ param integrationAccountName The integration account name . * @ param schemaName The integration account schema name . * @ param schema The integration account schema . * @ 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 < IntegrationAccountSchemaInner > createOrUpdateAsync ( String resourceGroupName , String integrationAccountName , String schemaName , IntegrationAccountSchemaInner schema , final ServiceCallback < IntegrationAccountSchemaInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( createOrUpdateWithServiceResponseAsync ( resourceGroupName , integrationAccountName , schemaName , schema ) , serviceCallback ) ;
public class ModuleAssets { /** * Update an Asset . * @ param asset Asset * @ return { @ link CMAAsset } result instance * @ throws IllegalArgumentException if asset is null . * @ throws IllegalArgumentException if asset ' s id is null . * @ throws IllegalArgumentException if asset ' s space id is null . * @ throws IllegalArgumentException if asset ' s version is null . */ public CMAAsset update ( CMAAsset asset ) { } }
assertNotNull ( asset , "asset" ) ; final String assetId = getResourceIdOrThrow ( asset , "asset" ) ; final String spaceId = getSpaceIdOrThrow ( asset , "asset" ) ; final String environmentId = asset . getEnvironmentId ( ) ; final Integer version = getVersionOrThrow ( asset , "update" ) ; final CMASystem sys = asset . getSystem ( ) ; asset . setSystem ( null ) ; try { return service . update ( version , spaceId , environmentId , assetId , asset ) . blockingFirst ( ) ; } finally { asset . setSystem ( sys ) ; }