signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class FilterPredicate { /** * From the ' value ' object , find the field name that will be filtered on , which is a effectively a key into * a JSON object . This will generally be the result of calling toString on the object , but * for enums , there maybe a getValue method which be used instead . * @ param value * @ return */ private static String getString ( Object value ) { } }
// The logic here is slightly icky , as getValue may or may not exist , // and must be called reflectively if it does exist if ( ! ( value instanceof Enum ) ) { return value . toString ( ) ; } Method method = null ; try { method = value . getClass ( ) . getMethod ( "getValue" ) ; } catch ( NoSuchMethodException e ) { } catch ( SecurityException e ) { } if ( method != null && method . getReturnType ( ) != String . class ) { method = null ; } if ( method == null ) { // There was no appropriate getValue method , so rely on toString return value . toString ( ) ; } // An error at this point is unrecoverable , something is really wrong String answer = null ; try { answer = ( String ) method . invoke ( value ) ; } catch ( IllegalAccessException e ) { throw new RuntimeException ( "The enum " + value . getClass ( ) . getName ( ) + " was expected to have a public getValue method" , e ) ; } catch ( IllegalArgumentException e ) { throw new RuntimeException ( "The enum " + value . getClass ( ) . getName ( ) + " was expected to have a public getValue method with no arguments" , e ) ; } catch ( InvocationTargetException e ) { throw new RuntimeException ( "The enum " + value . getClass ( ) . getName ( ) + " getValue method threw an unexpectd exception" , e ) ; } return answer ;
public class RESTBaseEntityCollectionV1 { /** * It is possible that a client has sent up a collection that asks to add and remove the same child item in a collection . * This method , combined with the ignoreDuplicatedAddRemoveItemRequests ( ) method , will weed out any duplicated requests . */ @ Override public void removeInvalidChangeItemRequests ( ) { } }
/* ignore attempts to add / remove / update null items and items with invalid states */ if ( getItems ( ) != null ) { final List < V > items = new ArrayList < V > ( getItems ( ) ) ; for ( final V item : items ) { if ( item . getItem ( ) == null ) { getItems ( ) . remove ( item ) ; } else if ( item . getState ( ) != null && item . getState ( ) . equals ( UNCHANGED_STATE ) ) { getItems ( ) . remove ( item ) ; } else if ( item . getItem ( ) . getId ( ) == null && ! item . getState ( ) . equals ( ADD_STATE ) ) { getItems ( ) . remove ( item ) ; } else if ( item . getState ( ) != null && ! item . validState ( item . getState ( ) ) ) { getItems ( ) . remove ( item ) ; } } ignoreDuplicatedChangeItemRequests ( ) ; }
public class SecureUtil { /** * sha256计算后进行16进制转换 * @ param data * 待计算的数据 * @ param encoding * 编码 * @ return 计算结果 */ public static byte [ ] sha256X16 ( String data , String encoding ) { } }
byte [ ] bytes = sha256 ( data , encoding ) ; StringBuilder sha256StrBuff = new StringBuilder ( ) ; for ( int i = 0 ; i < bytes . length ; i ++ ) { if ( Integer . toHexString ( 0xFF & bytes [ i ] ) . length ( ) == 1 ) { sha256StrBuff . append ( "0" ) . append ( Integer . toHexString ( 0xFF & bytes [ i ] ) ) ; } else { sha256StrBuff . append ( Integer . toHexString ( 0xFF & bytes [ i ] ) ) ; } } try { return sha256StrBuff . toString ( ) . getBytes ( encoding ) ; } catch ( UnsupportedEncodingException e ) { LogUtil . writeErrorLog ( e . getMessage ( ) , e ) ; return null ; }
public class Element { /** * Find elements that have an attribute with the specific value . Case insensitive . * @ param key name of the attribute * @ param value value of the attribute * @ return elements that have this attribute with this value , empty if none */ public Elements getElementsByAttributeValue ( String key , String value ) { } }
return Collector . collect ( new Evaluator . AttributeWithValue ( key , value ) , this ) ;
public class JDBC4ClientConnection { /** * Blocks the current thread until there is no more backpressure or there are no more * connections to the database * @ throws InterruptedException * @ throws IOException */ public void backpressureBarrier ( ) throws InterruptedException , IOException { } }
ClientImpl currentClient = this . getClient ( ) ; if ( currentClient == null ) { throw new IOException ( "Client is unavailable for backpressureBarrier()." ) ; } currentClient . backpressureBarrier ( ) ;
public class TypeConverterTools { /** * This assumes that comparability implies assignability or convertability . . . * @ param o object * @ param type type */ public static void checkAssignability ( Object o , Class < ? > type ) { } }
COMPARISON_TYPE ctO = COMPARISON_TYPE . fromObject ( o ) ; COMPARISON_TYPE ctT = COMPARISON_TYPE . fromClass ( type ) ; try { COMPARISON_TYPE . fromOperands ( ctO , ctT ) ; } catch ( Exception e ) { throw DBLogger . newUser ( "Cannot assign " + o . getClass ( ) + " to " + type , e ) ; }
public class EnumeratedMap { /** * Converts to a Map */ Map convertToMap ( ) { } }
Map ret = new HashMap ( ) ; for ( Enumeration e = enumerateKeys ( ) ; e . hasMoreElements ( ) ; ) { Object key = e . nextElement ( ) ; Object value = getValue ( key ) ; ret . put ( key , value ) ; } return ret ;
public class CompensationBehavior { /** * Determines whether an execution is responsible for default compensation handling . * This is the case if * < ul > * < li > the execution has an activity * < li > the execution is a scope * < li > the activity is a scope * < li > the execution has children * < li > the execution does not throw compensation * < / ul > */ public static boolean executesDefaultCompensationHandler ( PvmExecutionImpl scopeExecution ) { } }
ActivityImpl currentActivity = scopeExecution . getActivity ( ) ; if ( currentActivity != null ) { return scopeExecution . isScope ( ) && currentActivity . isScope ( ) && ! scopeExecution . getNonEventScopeExecutions ( ) . isEmpty ( ) && ! isCompensationThrowing ( scopeExecution ) ; } else { return false ; }
public class ProtectionIntentsInner { /** * It will validate followings * 1 . Vault capacity * 2 . VM is already protected * 3 . Any VM related configuration passed in properties . * @ param azureRegion Azure region to hit Api * @ param parameters Enable backup validation request on Virtual Machine * @ 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 PreValidateEnableBackupResponseInner object if successful . */ public PreValidateEnableBackupResponseInner validate ( String azureRegion , PreValidateEnableBackupRequest parameters ) { } }
return validateWithServiceResponseAsync ( azureRegion , parameters ) . toBlocking ( ) . single ( ) . body ( ) ;
public class BOverrideBlurImageOps { /** * TODO replace with native normalized ? */ public static < T extends ImageBase < T > > boolean invokeNativeGaussian ( T input , T output , double sigma , int radius , T storage ) { } }
boolean processed = false ; if ( BOverrideBlurImageOps . gaussian != null ) { try { BOverrideBlurImageOps . gaussian . processGaussian ( input , output , sigma , radius , storage ) ; processed = true ; } catch ( RuntimeException ignore ) { } } return processed ;
public class TradeManager { /** * Update a exchange order * @ param trade */ public void updateTrade ( final BitfinexAccountSymbol account , final BitfinexMyExecutedTrade trade ) { } }
trade . setApiKey ( client . getConfiguration ( ) . getApiKey ( ) ) ; notifyCallbacks ( trade ) ;
public class BigFloat { /** * Returns the { @ link BigFloat } that is < code > cot ( x ) < / code > . * @ param x the value * @ return the resulting { @ link BigFloat } * @ see BigDecimalMath # cot ( BigDecimal , MathContext ) */ public static BigFloat cot ( BigFloat x ) { } }
if ( x . isSpecial ( ) ) return x ; if ( x . isZero ( ) ) return POSITIVE_INFINITY ; return x . context . valueOf ( BigDecimalMath . cot ( x . value , x . context . mathContext ) ) ;
public class MessageFormat { /** * Gets the formats used for the format elements in the * previously set pattern string . * The order of formats in the returned array corresponds to * the order of format elements in the pattern string . * Since the order of format elements in a pattern string often * changes during localization , it ' s generally better to use the * { @ link # getFormatsByArgumentIndex getFormatsByArgumentIndex } * method , which assumes an order of formats corresponding to the * order of elements in the < code > arguments < / code > array passed to * the < code > format < / code > methods or the result array returned by * the < code > parse < / code > methods . * @ return the formats used for the format elements in the pattern */ public Format [ ] getFormats ( ) { } }
Format [ ] resultArray = new Format [ maxOffset + 1 ] ; System . arraycopy ( formats , 0 , resultArray , 0 , maxOffset + 1 ) ; return resultArray ;
public class PatientList { /** * Returns the patient list . * @ return Patient list . */ @ Override public Collection < PatientListItem > getListItems ( ) { } }
if ( ! noCaching && patients != null ) { return patients ; } patients = new ArrayList < > ( ) ; AbstractPatientListFilter filter = isFiltered ( ) ? getActiveFilter ( ) : null ; PatientListFilterEntity entity = filter == null ? null : ( PatientListFilterEntity ) filter . getEntity ( ) ; List < String > tempList = VistAUtil . getBrokerSession ( ) . callRPCList ( "RGCWPTPL LISTPTS" , null , listId , entity == null ? 0 : entity . getId ( ) , formatDateRange ( ) ) ; addPatients ( patients , tempList , 0 ) ; return patients ;
public class HostAndPortChecker { /** * Blocks current thread for { @ code time } of { @ code units } * @ param time number of units * @ param units to convert to millis */ private static void sleepFor ( int time , TimeUnit units ) { } }
try { LOG . trace ( "Sleeping for {} {}" , time , units . toString ( ) ) ; Thread . sleep ( units . toMillis ( time ) ) ; } catch ( InterruptedException e ) { // no - op }
public class ProfileDefinition { /** * Add an attribute as a secondary one and its converter . * @ param name name of the attribute * @ param converter converter */ protected void secondary ( final String name , final AttributeConverter < ? extends Object > converter ) { } }
secondaries . add ( name ) ; converters . put ( name , converter ) ;
public class IntervalCollection { /** * / * [ deutsch ] * < p > F & uuml ; gt die angegebenen Intervalle hinzu . < / p > * < p > Leere Intervalle werden ignoriert . < / p > * @ param intervals the new intervals to be added * @ return new IntervalCollection - instance containing a sum of * the own intervals and the given one while this instance remains unaffected * @ throws IllegalArgumentException if given list contains a finite * interval with open start which cannot be adjusted to one with closed start * @ since 3.35/4.30 */ public IntervalCollection < T > plus ( Collection < ? extends ChronoInterval < T > > intervals ) { } }
if ( intervals . isEmpty ( ) ) { return this ; } List < ChronoInterval < T > > windows = new ArrayList < > ( this . intervals ) ; for ( ChronoInterval < T > i : intervals ) { if ( ! i . isEmpty ( ) ) { windows . add ( this . adjust ( i ) ) ; } } windows . sort ( this . getComparator ( ) ) ; return this . create ( windows ) ;
public class FastDatePrinter { /** * / * ( non - Javadoc ) * @ see org . apache . commons . lang3 . time . DatePrinter # format ( java . util . Calendar , java . lang . Appendable ) */ @ Override public < B extends Appendable > B format ( Calendar calendar , final B buf ) { } }
// do not pass in calendar directly , this will cause TimeZone of FastDatePrinter to be ignored if ( ! calendar . getTimeZone ( ) . equals ( mTimeZone ) ) { calendar = ( Calendar ) calendar . clone ( ) ; calendar . setTimeZone ( mTimeZone ) ; } return applyRules ( calendar , buf ) ;
public class Privacy { /** * Returns the privacy item in the specified order . * @ param listName the name of the privacy list . * @ param order the order of the element . * @ return a List with { @ link PrivacyItem } */ public PrivacyItem getItem ( String listName , int order ) { } }
// CHECKSTYLE : OFF Iterator < PrivacyItem > values = getPrivacyList ( listName ) . iterator ( ) ; PrivacyItem itemFound = null ; while ( itemFound == null && values . hasNext ( ) ) { PrivacyItem element = values . next ( ) ; if ( element . getOrder ( ) == order ) { itemFound = element ; } } return itemFound ; // CHECKSTYLE : ON
public class ShortSummaryAggregator { /** * Like Math . max ( ) except for shorts . */ public static Short max ( Short a , Short b ) { } }
return a >= b ? a : b ;
public class ProcessConsolePageParticipant { /** * ( non - Javadoc ) * @ see org . eclipse . ui . console . IConsolePageParticipant # dispose ( ) */ public void dispose ( ) { } }
DebugUITools . getDebugContextManager ( ) . getContextService ( fPage . getSite ( ) . getWorkbenchWindow ( ) ) . removeDebugContextListener ( this ) ; DebugPlugin . getDefault ( ) . removeDebugEventListener ( this ) ; // if ( fRemoveTerminated ! = null ) { // fRemoveTerminated . dispose ( ) ; // fRemoveTerminated = null ; // if ( fRemoveAllTerminated ! = null ) { // fRemoveAllTerminated . dispose ( ) ; // fRemoveAllTerminated = null ; if ( fTerminate != null ) { fTerminate . dispose ( ) ; fTerminate = null ; } // if ( fStdOut ! = null ) { // fStdOut . dispose ( ) ; // fStdOut = null ; // if ( fStdErr ! = null ) { // fStdErr . dispose ( ) ; // fStdErr = null ; fConsole = null ;
public class SpecializedOps_ZDRM { /** * Creates a pivot matrix that exchanges the rows in a matrix : * < br > * A ' = P * A < br > * For example , if element 0 in ' pivots ' is 2 then the first row in A ' will be the 3rd row in A . * @ param ret If null then a new matrix is declared otherwise the results are written to it . Is modified . * @ param pivots Specifies the new order of rows in a matrix . * @ param numPivots How many elements in pivots are being used . * @ param transposed If the transpose of the matrix is returned . * @ return A pivot matrix . */ public static ZMatrixRMaj pivotMatrix ( ZMatrixRMaj ret , int pivots [ ] , int numPivots , boolean transposed ) { } }
if ( ret == null ) { ret = new ZMatrixRMaj ( numPivots , numPivots ) ; } else { if ( ret . numCols != numPivots || ret . numRows != numPivots ) throw new IllegalArgumentException ( "Unexpected matrix dimension" ) ; CommonOps_ZDRM . fill ( ret , 0 , 0 ) ; } if ( transposed ) { for ( int i = 0 ; i < numPivots ; i ++ ) { ret . set ( pivots [ i ] , i , 1 , 0 ) ; } } else { for ( int i = 0 ; i < numPivots ; i ++ ) { ret . set ( i , pivots [ i ] , 1 , 0 ) ; } } return ret ;
public class QueryStateMachine { /** * Add a listener for the final query info . This notification is guaranteed to be fired only once . * Listener is always notified asynchronously using a dedicated notification thread pool so , care should * be taken to avoid leaking { @ code this } when adding a listener in a constructor . */ public void addQueryInfoStateChangeListener ( StateChangeListener < QueryInfo > stateChangeListener ) { } }
AtomicBoolean done = new AtomicBoolean ( ) ; StateChangeListener < Optional < QueryInfo > > fireOnceStateChangeListener = finalQueryInfo -> { if ( finalQueryInfo . isPresent ( ) && done . compareAndSet ( false , true ) ) { stateChangeListener . stateChanged ( finalQueryInfo . get ( ) ) ; } } ; finalQueryInfo . addStateChangeListener ( fireOnceStateChangeListener ) ;
public class Solo { /** * Sets the time in the specified TimePicker . * @ param timePicker the { @ link TimePicker } object * @ param hour the hour e . g . 15 * @ param minute the minute e . g . 30 */ public void setTimePicker ( TimePicker timePicker , int hour , int minute ) { } }
if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "setTimePicker(" + timePicker + ", " + hour + ", " + minute + ")" ) ; } timePicker = ( TimePicker ) waiter . waitForView ( timePicker , Timeout . getSmallTimeout ( ) ) ; setter . setTimePicker ( timePicker , hour , minute ) ;
public class AccountsInner { /** * Gets the first page of Azure Storage accounts , if any , linked to the specified Data Lake Analytics account . The response includes a link to the next page , if any . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; StorageAccountInfoInner & gt ; object */ public Observable < ServiceResponse < Page < StorageAccountInfoInner > > > listStorageAccountsNextWithServiceResponseAsync ( final String nextPageLink ) { } }
return listStorageAccountsNextSinglePageAsync ( nextPageLink ) . concatMap ( new Func1 < ServiceResponse < Page < StorageAccountInfoInner > > , Observable < ServiceResponse < Page < StorageAccountInfoInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < StorageAccountInfoInner > > > call ( ServiceResponse < Page < StorageAccountInfoInner > > page ) { String nextPageLink = page . body ( ) . nextPageLink ( ) ; if ( nextPageLink == null ) { return Observable . just ( page ) ; } return Observable . just ( page ) . concatWith ( listStorageAccountsNextWithServiceResponseAsync ( nextPageLink ) ) ; } } ) ;
public class Calendar { /** * Adjusts the stamp [ ] values before nextStamp overflow . nextStamp * is set to the next stamp value upon the return . */ private void adjustStamp ( ) { } }
int max = MINIMUM_USER_STAMP ; int newStamp = MINIMUM_USER_STAMP ; for ( ; ; ) { int min = Integer . MAX_VALUE ; for ( int i = 0 ; i < stamp . length ; i ++ ) { int v = stamp [ i ] ; if ( v >= newStamp && min > v ) { min = v ; } if ( max < v ) { max = v ; } } if ( max != min && min == Integer . MAX_VALUE ) { break ; } for ( int i = 0 ; i < stamp . length ; i ++ ) { if ( stamp [ i ] == min ) { stamp [ i ] = newStamp ; } } newStamp ++ ; if ( min == max ) { break ; } } nextStamp = newStamp ;
public class UniformSnapshot { /** * Returns the value at the given quantile . * @ param quantile a given quantile , in { @ code [ 0 . . 1 ] } * @ return the value in the distribution at { @ code quantile } */ @ Override public double getValue ( double quantile ) { } }
if ( quantile < 0.0 || quantile > 1.0 || Double . isNaN ( quantile ) ) { throw new IllegalArgumentException ( quantile + " is not in [0..1]" ) ; } if ( values . length == 0 ) { return 0.0 ; } final double pos = quantile * ( values . length + 1 ) ; final int index = ( int ) pos ; if ( index < 1 ) { return values [ 0 ] ; } if ( index >= values . length ) { return values [ values . length - 1 ] ; } final double lower = values [ index - 1 ] ; final double upper = values [ index ] ; return lower + ( pos - floor ( pos ) ) * ( upper - lower ) ;
public class GenerateCompatibilityGraph { /** * compGraphNodesCZero is used to build up of the edges of the compatibility graph * @ return * @ throws IOException */ protected Integer compatibilityGraphNodesIfCEdgeIsZero ( ) throws IOException { } }
int countNodes = 1 ; List < String > map = new ArrayList < String > ( ) ; compGraphNodesCZero = new ArrayList < Integer > ( ) ; // Initialize the compGraphNodesCZero List LabelContainer labelContainer = LabelContainer . getInstance ( ) ; compGraphNodes . clear ( ) ; for ( int i = 0 ; i < source . getAtomCount ( ) ; i ++ ) { for ( int j = 0 ; j < target . getAtomCount ( ) ; j ++ ) { IAtom atom1 = source . getAtom ( i ) ; IAtom atom2 = target . getAtom ( j ) ; // You can also check object equal or charge , hydrogen count etc if ( atom1 . getSymbol ( ) . equalsIgnoreCase ( atom2 . getSymbol ( ) ) && ( ! map . contains ( i + "_" + j ) ) ) { compGraphNodesCZero . add ( i ) ; compGraphNodesCZero . add ( j ) ; compGraphNodesCZero . add ( labelContainer . getLabelID ( atom1 . getSymbol ( ) ) ) ; // i . e C is label 1 compGraphNodesCZero . add ( countNodes ) ; compGraphNodes . add ( i ) ; compGraphNodes . add ( j ) ; compGraphNodes . add ( countNodes ++ ) ; map . add ( i + "_" + j ) ; } } } map . clear ( ) ; return countNodes ;
public class JobHistoryRawService { /** * Flags a job ' s RAW record for reprocessing * @ param jobId */ public void markJobForReprocesssing ( QualifiedJobId jobId ) throws IOException { } }
Put p = new Put ( idConv . toBytes ( jobId ) ) ; p . addColumn ( Constants . INFO_FAM_BYTES , Constants . RAW_COL_REPROCESS_BYTES , Bytes . toBytes ( true ) ) ; Table rawTable = null ; try { rawTable = hbaseConnection . getTable ( TableName . valueOf ( Constants . HISTORY_RAW_TABLE ) ) ; rawTable . put ( p ) ; } finally { if ( rawTable != null ) { rawTable . close ( ) ; } }
public class AnnotationManager { /** * Find first { @ link ru . yandex . qatools . allure . annotations . Title } annotation * @ return title or null if annotation doesn ' t present */ public String getTitle ( ) { } }
Title title = getAnnotation ( Title . class ) ; return title == null ? null : title . value ( ) ;
public class TreeString { /** * / * package */ void dedup ( final Map < String , char [ ] > table ) { } }
String l = getLabel ( ) ; char [ ] v = table . get ( l ) ; if ( v != null ) { label = v ; } else { table . put ( l , label ) ; }
public class Navigate { /** * Starts activity by intent . */ public void start ( Intent intent ) { } }
intent = setupIntent ( intent ) ; if ( application != null ) { // Extra flag is required when starting from application : intent . addFlags ( Intent . FLAG_ACTIVITY_NEW_TASK ) ; application . startActivity ( intent ) ; return ; // No transitions , so just return } if ( activity != null ) { if ( requestCode == NO_RESULT_CODE ) { activity . startActivity ( intent ) ; } else { activity . startActivityForResult ( intent , requestCode ) ; } } else if ( fragment != null ) { if ( requestCode == NO_RESULT_CODE ) { fragment . startActivity ( intent ) ; } else { fragment . startActivityForResult ( intent , requestCode ) ; } } else if ( fragmentSupport != null ) { if ( requestCode == NO_RESULT_CODE ) { fragmentSupport . startActivity ( intent ) ; } else { fragmentSupport . startActivityForResult ( intent , requestCode ) ; } } setTransition ( false ) ;
public class LogNormalProcess { /** * A derived class may change the Brownian motion . This is only allowed prior to lazy initialization . * The method should be used only while constructing new object . Do not use in flight . * @ param brownianMotion The brownianMotion to set . */ protected synchronized void setBrownianMotion ( BrownianMotion brownianMotion ) { } }
if ( discreteProcessWeights != null && discreteProcessWeights . length != 0 ) { throw new RuntimeException ( "Tying to change lazy initialized immutable object after initialization." ) ; } this . brownianMotion = brownianMotion ;
public class PeerAwareInstanceRegistryImpl { /** * Gets the number of < em > renewals < / em > in the last minute . * @ return a long value representing the number of < em > renewals < / em > in the last minute . */ @ com . netflix . servo . annotations . Monitor ( name = "numOfReplicationsInLastMin" , description = "Number of total replications received in the last minute" , type = com . netflix . servo . annotations . DataSourceType . GAUGE ) public long getNumOfReplicationsInLastMin ( ) { } }
return numberOfReplicationsLastMin . getCount ( ) ;
public class LocalTypeDetector { /** * implements the visitor to find the constructors defined in getWatchedConstructors ( ) and the method calls in getWatchedClassMethods ( ) * @ param seen * the opcode of the currently parsed instruction */ @ Override public void sawOpcode ( int seen ) { } }
Integer tosIsSyncColReg = null ; try { stack . precomputation ( this ) ; if ( seen == Const . INVOKESPECIAL ) { tosIsSyncColReg = checkConstructors ( ) ; } else if ( seen == Const . INVOKESTATIC ) { tosIsSyncColReg = checkStaticCreations ( ) ; } else if ( ( seen == Const . INVOKEVIRTUAL ) || ( seen == Const . INVOKEINTERFACE ) ) { tosIsSyncColReg = checkSelfReturningMethods ( ) ; } else if ( isAStore ( seen ) ) { dealWithStoring ( seen ) ; } else if ( isALoad ( seen ) ) { int reg = RegisterUtils . getALoadReg ( this , seen ) ; RegisterInfo cri = suspectLocals . get ( Integer . valueOf ( reg ) ) ; if ( ( cri != null ) && ! cri . getIgnore ( ) ) { tosIsSyncColReg = Integer . valueOf ( reg ) ; } } else if ( ( ( seen == Const . PUTFIELD ) || ( seen == Const . ARETURN ) ) && ( stack . getStackDepth ( ) > 0 ) ) { OpcodeStack . Item item = stack . getStackItem ( 0 ) ; suspectLocals . remove ( item . getUserValue ( ) ) ; } if ( ! suspectLocals . isEmpty ( ) ) { if ( isStandardInvoke ( seen ) ) { String sig = getSigConstantOperand ( ) ; int argCount = SignatureUtils . getNumParameters ( sig ) ; if ( stack . getStackDepth ( ) >= argCount ) { for ( int i = 0 ; i < argCount ; i ++ ) { OpcodeStack . Item item = stack . getStackItem ( i ) ; RegisterInfo cri = suspectLocals . get ( item . getUserValue ( ) ) ; if ( cri != null ) { if ( SignatureUtils . similarPackages ( SignatureUtils . getPackageName ( SignatureUtils . stripSignature ( getClassConstantOperand ( ) ) ) , SignatureUtils . getPackageName ( SignatureUtils . stripSignature ( this . getClassName ( ) ) ) , 2 ) ) { cri . setPriority ( LOW_PRIORITY ) ; } else { cri . setIgnore ( ) ; } } } } } else if ( seen == Const . MONITORENTER ) { // Assume if synchronized blocks are used then something // tricky is going on . // There is really no valid reason for this , other than // folks who use // synchronized blocks tend to know what ' s going on . if ( stack . getStackDepth ( ) > 0 ) { OpcodeStack . Item item = stack . getStackItem ( 0 ) ; suspectLocals . remove ( item . getUserValue ( ) ) ; } } else if ( ( seen == Const . AASTORE ) && ( stack . getStackDepth ( ) > 0 ) ) { OpcodeStack . Item item = stack . getStackItem ( 0 ) ; suspectLocals . remove ( item . getUserValue ( ) ) ; } } reportTroublesomeLocals ( ) ; } finally { TernaryPatcher . pre ( stack , seen ) ; stack . sawOpcode ( this , seen ) ; TernaryPatcher . post ( stack , seen ) ; if ( ( tosIsSyncColReg != null ) && ( stack . getStackDepth ( ) > 0 ) ) { OpcodeStack . Item item = stack . getStackItem ( 0 ) ; item . setUserValue ( tosIsSyncColReg ) ; } }
public class Rows { /** * Sets the value of the horizontal alignment attribute of the HTML tbody tag . * @ param align the horizontal alignment * @ jsptagref . attributedescription The horizontal alignment of the HTML tbody tag . * @ jsptagref . attributesyntaxvalue < i > string _ align < / i > * @ netui : attribute required = " false " rtexprvalue = " true " description = " The cell ' s horizontal alignment of the HTML tbody tag . " */ public void setAlign ( String align ) { } }
/* todo : should this enforce left | center | right | justify | char as in the spec */ _tbodyTag . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , HtmlConstants . ALIGN , align ) ;
public class SimpleBase { /** * Computes the dot product ( a . k . a . inner product ) between this vector and vector ' v ' . * @ param v The second vector in the dot product . Not modified . * @ return dot product */ public double dot ( T v ) { } }
convertType . specify ( this , v ) ; T A = convertType . convert ( this ) ; v = convertType . convert ( v ) ; if ( ! isVector ( ) ) { throw new IllegalArgumentException ( "'this' matrix is not a vector." ) ; } else if ( ! v . isVector ( ) ) { throw new IllegalArgumentException ( "'v' matrix is not a vector." ) ; } return A . ops . dot ( A . mat , v . getMatrix ( ) ) ;
public class VorbisAudioFileReader { /** * Return the AudioFileFormat from the given InputStream , length in bytes * and length in milliseconds . * @ param bitStream * @ param totalms * @ param mediaLength * @ return * @ throws javax . sound . sampled . UnsupportedAudioFileException * @ throws java . io . IOException */ protected AudioFileFormat getAudioFileFormat ( InputStream bitStream , int mediaLength , int totalms ) throws UnsupportedAudioFileException , IOException { } }
Map < String , Object > aff_properties = new HashMap < > ( ) ; Map < String , Object > af_properties = new HashMap < > ( ) ; if ( totalms == AudioSystem . NOT_SPECIFIED ) { totalms = 0 ; } if ( totalms > 0 ) { aff_properties . put ( "duration" , ( long ) totalms * 1000 ) ; } oggBitStream_ = bitStream ; // init jorbis oggSyncState_ = new SyncState ( ) ; oggStreamState_ = new StreamState ( ) ; oggPage_ = new Page ( ) ; oggPacket_ = new Packet ( ) ; vorbisInfo = new Info ( ) ; vorbisComment = new Comment ( ) ; buffer = null ; bytes = 0 ; oggSyncState_ . init ( ) ; index = 0 ; try { readHeaders ( aff_properties , af_properties ) ; } catch ( IOException ioe ) { LOG . log ( Level . FINE , ioe . getMessage ( ) ) ; throw new UnsupportedAudioFileException ( ioe . getMessage ( ) ) ; } String dmp = vorbisInfo . toString ( ) ; LOG . log ( Level . FINE , dmp ) ; int ind = dmp . lastIndexOf ( "bitrate:" ) ; int minbitrate = - 1 ; int nominalbitrate = - 1 ; int maxbitrate = - 1 ; if ( ind != - 1 ) { dmp = dmp . substring ( ind + 8 , dmp . length ( ) ) ; StringTokenizer st = new StringTokenizer ( dmp , "," ) ; if ( st . hasMoreTokens ( ) ) { minbitrate = Integer . parseInt ( st . nextToken ( ) ) ; } if ( st . hasMoreTokens ( ) ) { nominalbitrate = Integer . parseInt ( st . nextToken ( ) ) ; } if ( st . hasMoreTokens ( ) ) { maxbitrate = Integer . parseInt ( st . nextToken ( ) ) ; } } if ( nominalbitrate > 0 ) { af_properties . put ( "bitrate" , nominalbitrate ) ; } af_properties . put ( "vbr" , true ) ; if ( minbitrate > 0 ) { aff_properties . put ( "ogg.bitrate.min.bps" , minbitrate ) ; } if ( maxbitrate > 0 ) { aff_properties . put ( "ogg.bitrate.max.bps" , maxbitrate ) ; } if ( nominalbitrate > 0 ) { aff_properties . put ( "ogg.bitrate.nominal.bps" , nominalbitrate ) ; } if ( vorbisInfo . channels > 0 ) { aff_properties . put ( "ogg.channels" , vorbisInfo . channels ) ; } if ( vorbisInfo . rate > 0 ) { aff_properties . put ( "ogg.frequency.hz" , vorbisInfo . rate ) ; } if ( mediaLength > 0 ) { aff_properties . put ( "ogg.length.bytes" , mediaLength ) ; } aff_properties . put ( "ogg.version" , vorbisInfo . version ) ; // AudioFormat . Encoding encoding = VorbisEncoding . VORBISENC ; // AudioFormat format = new VorbisAudioFormat ( encoding , vorbisInfo . rate , AudioSystem . NOT _ SPECIFIED , vorbisInfo . channels , AudioSystem . NOT _ SPECIFIED , AudioSystem . NOT _ SPECIFIED , true , af _ properties ) ; // Patch from MS to ensure more SPI compatibility . . . float frameRate = - 1 ; if ( nominalbitrate > 0 ) { frameRate = nominalbitrate / 8 ; } else if ( minbitrate > 0 ) { frameRate = minbitrate / 8 ; } // New Patch from MS : AudioFormat format = new AudioFormat ( VORBISENC , vorbisInfo . rate , AudioSystem . NOT_SPECIFIED , vorbisInfo . channels , 1 , frameRate , false , af_properties ) ; // Patch end return new VorbisAudioFileFormat ( OGG_AUDIOFILEFORMAT_TYPE , format , AudioSystem . NOT_SPECIFIED , mediaLength , aff_properties ) ;
public class Symbol { /** * TODO : getEnclosedElements should return a javac List , fix in FilteredMemberList */ @ DefinedBy ( Api . LANGUAGE_MODEL ) public java . util . List < Symbol > getEnclosedElements ( ) { } }
return List . nil ( ) ;
public class RangeSets { /** * Unions a set of rangeSets , or returns null if the set is empty . */ public static < T extends Comparable < T > > RangeSet < T > unionRangeSets ( final Iterable < RangeSet < T > > rangeSets ) { } }
final RangeSet < T > rangeSet = TreeRangeSet . create ( ) ; for ( RangeSet < T > set : rangeSets ) { rangeSet . addAll ( set ) ; } return rangeSet ;
public class vpnicaconnection { /** * Use this API to fetch all the vpnicaconnection resources that are configured on netscaler . * This uses vpnicaconnection _ args which is a way to provide additional arguments while fetching the resources . */ public static vpnicaconnection [ ] get ( nitro_service service , vpnicaconnection_args args ) throws Exception { } }
vpnicaconnection obj = new vpnicaconnection ( ) ; options option = new options ( ) ; option . set_args ( nitro_util . object_to_string_withoutquotes ( args ) ) ; vpnicaconnection [ ] response = ( vpnicaconnection [ ] ) obj . get_resources ( service , option ) ; return response ;
public class SparkComputationGraph { /** * DataSet version of { @ link # scoreExamples ( JavaRDD , boolean ) } */ public JavaDoubleRDD scoreExamples ( JavaRDD < DataSet > data , boolean includeRegularizationTerms ) { } }
return scoreExamplesMultiDataSet ( data . map ( new DataSetToMultiDataSetFn ( ) ) , includeRegularizationTerms ) ;
public class MailSourceConfiguration { /** * Method to build Integration Flow for Mail . Suppress Warnings for * MailInboundChannelAdapterSpec . * @ return Integration Flow object for Mail Source */ @ SuppressWarnings ( { } }
"rawtypes" , "unchecked" } ) private IntegrationFlowBuilder getFlowBuilder ( ) { IntegrationFlowBuilder flowBuilder ; URLName urlName = this . properties . getUrl ( ) ; if ( this . properties . isIdleImap ( ) ) { flowBuilder = getIdleImapFlow ( urlName ) ; } else { MailInboundChannelAdapterSpec adapterSpec ; switch ( urlName . getProtocol ( ) . toUpperCase ( ) ) { case "IMAP" : case "IMAPS" : adapterSpec = getImapFlowBuilder ( urlName ) ; break ; case "POP3" : case "POP3S" : adapterSpec = getPop3FlowBuilder ( urlName ) ; break ; default : throw new IllegalArgumentException ( "Unsupported mail protocol: " + urlName . getProtocol ( ) ) ; } flowBuilder = IntegrationFlows . from ( adapterSpec . javaMailProperties ( getJavaMailProperties ( urlName ) ) . selectorExpression ( this . properties . getExpression ( ) ) . shouldDeleteMessages ( this . properties . isDelete ( ) ) , new Consumer < SourcePollingChannelAdapterSpec > ( ) { @ Override public void accept ( SourcePollingChannelAdapterSpec sourcePollingChannelAdapterSpec ) { sourcePollingChannelAdapterSpec . poller ( MailSourceConfiguration . this . defaultPoller ) ; } } ) ; } return flowBuilder ;
public class Factories { /** * Returns an instance of the provided ` @ Factory ` interface . * @ param type Factory type * @ param < T > * @ return Generated Factory instance * @ throws org . androidtransfuse . util . TransfuseRuntimeException * if there was an error looking up the wrapped * Factory class */ public static < T > T get ( Class < T > type ) { } }
FactoryBuilder factoryBuilder = REPOSITORY . get ( type ) ; return ( T ) factoryBuilder . get ( ) ;
public class DescribeLoadBasedAutoScalingResult { /** * An array of < code > LoadBasedAutoScalingConfiguration < / code > objects that describe each layer ' s configuration . * @ return An array of < code > LoadBasedAutoScalingConfiguration < / code > objects that describe each layer ' s * configuration . */ public java . util . List < LoadBasedAutoScalingConfiguration > getLoadBasedAutoScalingConfigurations ( ) { } }
if ( loadBasedAutoScalingConfigurations == null ) { loadBasedAutoScalingConfigurations = new com . amazonaws . internal . SdkInternalList < LoadBasedAutoScalingConfiguration > ( ) ; } return loadBasedAutoScalingConfigurations ;
public class DescribeCasesRequest { /** * A list of ID numbers of the support cases you want returned . The maximum number of cases is 100. * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setCaseIdList ( java . util . Collection ) } or { @ link # withCaseIdList ( java . util . Collection ) } if you want to * override the existing values . * @ param caseIdList * A list of ID numbers of the support cases you want returned . The maximum number of cases is 100. * @ return Returns a reference to this object so that method calls can be chained together . */ public DescribeCasesRequest withCaseIdList ( String ... caseIdList ) { } }
if ( this . caseIdList == null ) { setCaseIdList ( new com . amazonaws . internal . SdkInternalList < String > ( caseIdList . length ) ) ; } for ( String ele : caseIdList ) { this . caseIdList . add ( ele ) ; } return this ;
public class GreenPepperXmlRpcServer { /** * { @ inheritDoc } */ public Vector < Object > getRegisteredRepository ( Vector < Object > repositoryParams ) { } }
try { Repository repository = loadRepository ( repositoryParams ) ; repository = service . getRegisteredRepository ( repository ) ; return repository . marshallize ( ) ; } catch ( Exception e ) { return errorAsVector ( e , REPOSITORY_GET_REGISTERED ) ; }
public class AmazonGuardDutyClient { /** * Archives Amazon GuardDuty findings specified by the list of finding IDs . * @ param archiveFindingsRequest * ArchiveFindings request body . * @ return Result of the ArchiveFindings operation returned by the service . * @ throws BadRequestException * 400 response * @ throws InternalServerErrorException * 500 response * @ sample AmazonGuardDuty . ArchiveFindings * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / guardduty - 2017-11-28 / ArchiveFindings " target = " _ top " > AWS API * Documentation < / a > */ @ Override public ArchiveFindingsResult archiveFindings ( ArchiveFindingsRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeArchiveFindings ( request ) ;
public class AWSBatchClient { /** * Deletes an AWS Batch compute environment . * Before you can delete a compute environment , you must set its state to < code > DISABLED < / code > with the * < a > UpdateComputeEnvironment < / a > API operation and disassociate it from any job queues with the * < a > UpdateJobQueue < / a > API operation . * @ param deleteComputeEnvironmentRequest * @ return Result of the DeleteComputeEnvironment operation returned by the service . * @ throws ClientException * These errors are usually caused by a client action , such as using an action or resource on behalf of a * user that doesn ' t have permissions to use the action or resource , or specifying an identifier that is not * valid . * @ throws ServerException * These errors are usually caused by a server issue . * @ sample AWSBatch . DeleteComputeEnvironment * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / batch - 2016-08-10 / DeleteComputeEnvironment " target = " _ top " > AWS * API Documentation < / a > */ @ Override public DeleteComputeEnvironmentResult deleteComputeEnvironment ( DeleteComputeEnvironmentRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeDeleteComputeEnvironment ( request ) ;
public class FactoryDetectDescribe { /** * Given independent algorithms for feature detection , orientation , and describing , create a new * { @ link DetectDescribePoint } . * @ param detector Feature detector * @ param orientation Orientation estimation . Optionally , can be null . * @ param describe Feature descriptor * @ return { @ link DetectDescribePoint } . */ public static < T extends ImageGray < T > , D extends TupleDesc > DetectDescribePoint < T , D > fuseTogether ( InterestPointDetector < T > detector , @ Nullable OrientationImage < T > orientation , DescribeRegionPoint < T , D > describe ) { } }
return new DetectDescribeFusion < > ( detector , orientation , describe ) ;
public class FunctionExpression { /** * Get the idx parameter from the parameter list as percent ( range 0 - 1 ) . * @ param idx * the index starting with 0 * @ param defaultValue * the result if such a parameter idx does not exists . * @ param formatter * current formatter * @ return the the percent value */ private double getPercent ( int idx , double defaultValue , CssFormatter formatter ) { } }
if ( parameters . size ( ) <= idx ) { return defaultValue ; } return ColorUtils . getPercent ( get ( idx ) , formatter ) ;
import java . io . * ; import java . lang . * ; import java . util . * ; import java . math . * ; public class CheckUniqueness { /** * Java function that checks if all numbers in the list are distinct . * Args : * elements ( List < Integer > ) : List of numbers to be checked . * Returns : * boolean : true if all numbers are distinct , false otherwise . * Examples : * > > > checkUniqueness ( Arrays . asList ( 1 , 5 , 7 , 9 ) ) * True * > > > checkUniqueness ( Arrays . asList ( 2 , 4 , 5 , 5 , 7 , 9 ) ) * False * > > > checkUniqueness ( Arrays . asList ( 1 , 2 , 3 ) ) * True */ public static boolean checkUniqueness ( List < Integer > elements ) { } }
Set < Integer > uniqueElements = new HashSet < > ( elements ) ; return elements . size ( ) == uniqueElements . size ( ) ;
public class Dict { /** * 将值对象转换为Dict < br > * 类名会被当作表名 , 小写第一个字母 * @ param < T > Bean类型 * @ param bean 值对象 * @ param isToUnderlineCase 是否转换为下划线模式 * @ param ignoreNullValue 是否忽略值为空的字段 * @ return 自己 */ public < T > Dict parseBean ( T bean , boolean isToUnderlineCase , boolean ignoreNullValue ) { } }
Assert . notNull ( bean , "Bean class must be not null" ) ; this . putAll ( BeanUtil . beanToMap ( bean , isToUnderlineCase , ignoreNullValue ) ) ; return this ;
public class Var { /** * Provides a new frame for the variable . * Potentially existing previous frames are saved . * Normally you do not have to call this method manually as parboiled provides for automatic Var frame management . * @ return true */ public boolean enterFrame ( ) { } }
if ( level ++ > 0 ) { if ( stack == null ) stack = new LinkedList < T > ( ) ; stack . add ( get ( ) ) ; } return set ( initialValueFactory . create ( ) ) ;
public class MwsJsonWriter { /** * Append string to the output . * @ param value */ protected void append ( String value ) { } }
try { writer . write ( value ) ; } catch ( Exception e ) { throw MwsUtl . wrap ( e ) ; }
public class RegexValidator { /** * Validate a value against the set of regular expressions . * @ param value The value to validate . * @ return < code > true < / code > if the value is valid * otherwise < code > false < / code > . */ public boolean isValid ( String value ) { } }
if ( value == null ) { return false ; } for ( Pattern pattern : patterns ) { if ( pattern . matcher ( value ) . matches ( ) ) { return true ; } } return false ;
public class NumberValue { /** * Compares this value and another numerically , or checks this number value * for membership in a value list . * @ param o a { @ link Value } . * @ return If the provided value is a { @ link NumericalValue } , returns null { @ link ValueComparator # GREATER _ THAN } , * { @ link ValueComparator # LESS _ THAN } or { @ link ValueComparator # EQUAL _ TO } * depending on whether this value is numerically greater than , less than or * equal to the value provided as argument . If the provided value is a * { @ link ValueList } , returns { @ link ValueComparator # IN } if this object is a * member of the list , or { @ link ValueComparator # NOT _ IN } if not . Otherwise , * returns { @ link ValueComparator # UNKNOWN } . */ @ Override public ValueComparator compare ( Value o ) { } }
if ( o == null ) { return ValueComparator . NOT_EQUAL_TO ; } switch ( o . getType ( ) ) { case NUMBERVALUE : NumberValue other = ( NumberValue ) o ; int comp = compareTo ( other ) ; return comp > 0 ? ValueComparator . GREATER_THAN : ( comp < 0 ? ValueComparator . LESS_THAN : ValueComparator . EQUAL_TO ) ; case INEQUALITYNUMBERVALUE : InequalityNumberValue other2 = ( InequalityNumberValue ) o ; int comp2 = num . compareTo ( ( BigDecimal ) other2 . getNumber ( ) ) ; switch ( other2 . getComparator ( ) ) { case EQUAL_TO : return comp2 > 0 ? ValueComparator . GREATER_THAN : ( comp2 < 0 ? ValueComparator . LESS_THAN : ValueComparator . EQUAL_TO ) ; case GREATER_THAN : return comp2 <= 0 ? ValueComparator . LESS_THAN : ValueComparator . UNKNOWN ; default : return comp2 >= 0 ? ValueComparator . GREATER_THAN : ValueComparator . UNKNOWN ; } case VALUELIST : ValueList < ? > vl = ( ValueList < ? > ) o ; return equals ( vl ) ? ValueComparator . EQUAL_TO : ValueComparator . NOT_EQUAL_TO ; default : return ValueComparator . NOT_EQUAL_TO ; }
public class SARLDiagnosticLabelDecorator { /** * Replies the image that corresponds to the given object . * @ param imageDescription * a { @ link String } , an { @ link ImageDescriptor } or an { @ link Image } * @ return the { @ link Image } associated with the description or < code > null < / code > */ protected Image convertToImage ( Object imageDescription ) { } }
if ( imageDescription instanceof Image ) { return ( Image ) imageDescription ; } else if ( imageDescription instanceof ImageDescriptor ) { return this . imageHelper . getImage ( ( ImageDescriptor ) imageDescription ) ; } else if ( imageDescription instanceof String ) { return this . imageHelper . getImage ( ( String ) imageDescription ) ; } return null ;
public class BshScriptEngine { /** * Calls a procedure compiled during a previous script execution , which is * retained in the state of the { @ code ScriptEngine { @ code . * @ param name The name of the procedure to be called . * @ param thiz If the procedure is a member of a class defined in the script * and thiz is an instance of that class returned by a previous execution or * invocation , the named method is called through that instance . If classes are * not supported in the scripting language or if the procedure is not a member * function of any class , the argument must be { @ code null } . * @ param args Arguments to pass to the procedure . The rules for converting * the arguments to scripting variables are implementation - specific . * @ return The value returned by the procedure . The rules for converting the * scripting variable returned by the procedure to a Java Object are * implementation - specific . * @ throws javax . script . ScriptException if an error occurrs during invocation * of the method . * @ throws NoSuchMethodException if method with given name or matching argument * types cannot be found . * @ throws NullPointerException if method name is null . */ @ Override public Object invokeMethod ( Object thiz , String name , Object ... args ) throws ScriptException , NoSuchMethodException { } }
if ( ! ( thiz instanceof bsh . This ) ) { throw new ScriptException ( "Illegal object type: " + ( null == thiz ? "null" : thiz . getClass ( ) ) ) ; } bsh . This bshObject = ( bsh . This ) thiz ; try { return bshObject . invokeMethod ( name , args ) ; } catch ( TargetError e ) { // The script threw an application level exception // set it as the cause ? ScriptException se = new ScriptException ( e . toString ( ) , e . getErrorSourceFile ( ) , e . getErrorLineNumber ( ) ) ; se . initCause ( e . getTarget ( ) ) ; throw se ; } catch ( EvalError e ) { // The script couldn ' t be evaluated properly throw new ScriptException ( e . toString ( ) , e . getErrorSourceFile ( ) , e . getErrorLineNumber ( ) ) ; }
public class EthiopicDate { /** * Obtains a { @ code EthiopicDate } from a temporal object . * This obtains a date in the Ethiopic calendar system based on the specified temporal . * A { @ code TemporalAccessor } represents an arbitrary set of date and time information , * which this factory converts to an instance of { @ code EthiopicDate } . * The conversion typically uses the { @ link ChronoField # EPOCH _ DAY EPOCH _ DAY } * field , which is standardized across calendar systems . * This method matches the signature of the functional interface { @ link TemporalQuery } * allowing it to be used as a query via method reference , { @ code EthiopicDate : : from } . * @ param temporal the temporal object to convert , not null * @ return the date in Ethiopic calendar system , not null * @ throws DateTimeException if unable to convert to a { @ code EthiopicDate } */ public static EthiopicDate from ( TemporalAccessor temporal ) { } }
if ( temporal instanceof EthiopicDate ) { return ( EthiopicDate ) temporal ; } return EthiopicDate . ofEpochDay ( temporal . getLong ( EPOCH_DAY ) ) ;
public class FleetsApi { /** * Rename fleet wing Rename a fleet wing - - - SSO Scope : * esi - fleets . write _ fleet . v1 * @ param fleetId * ID for a fleet ( required ) * @ param wingId * The wing to rename ( required ) * @ param datasource * The server name you would like data from ( optional , default to * tranquility ) * @ param token * Access token to use if unable to set a header ( optional ) * @ param fleetWingNaming * ( optional ) * @ return ApiResponse & lt ; Void & gt ; * @ throws ApiException * If fail to call the API , e . g . server error or cannot * deserialize the response body */ public ApiResponse < Void > putFleetsFleetIdWingsWingIdWithHttpInfo ( Long fleetId , Long wingId , String datasource , String token , FleetWingNaming fleetWingNaming ) throws ApiException { } }
com . squareup . okhttp . Call call = putFleetsFleetIdWingsWingIdValidateBeforeCall ( fleetId , wingId , datasource , token , fleetWingNaming , null ) ; return apiClient . execute ( call ) ;
public class PropertiesBuilder { /** * Sets the model properties . * @ param propertiesModel the properties model * @ return this PropertiesBuilder */ public PropertiesBuilder setModelProperties ( PropertiesModel propertiesModel ) { } }
_modelProperties = propertiesModel != null ? propertiesModel . toProperties ( ) : null ; return this ;
public class ReflectionServer { /** * Handle client request , this method will be called when new client connection * received by the start method . * @ param client the client * @ throws IOException Signals that an I / O exception has occurred . */ protected void handleClient ( final Socket client ) throws IOException { } }
final ClientHandler handler = new ClientHandler ( client ) ; this . executorService . execute ( handler ) ;
public class BoundsOnRatiosInSampledSets { /** * Return the approximate upper bound based on a 95 % confidence interval * @ param a See class javadoc * @ param b See class javadoc * @ param f the inclusion probability used to produce the set with size < i > a < / i > . * @ return the approximate lower bound */ public static double getUpperBoundForBoverA ( final long a , final long b , final double f ) { } }
checkInputs ( a , b , f ) ; if ( a == 0 ) { return 1.0 ; } if ( f == 1.0 ) { return ( double ) b / a ; } return approximateUpperBoundOnP ( a , b , NUM_STD_DEVS * hackyAdjuster ( f ) ) ;
public class Index { /** * Update an api key * @ param acls the list of ACL for this key . Defined by an array of strings that * can contains the following values : * - search : allow to search ( https and http ) * - addObject : allows to add / update an object in the index ( https only ) * - deleteObject : allows to delete an existing object ( https only ) * - deleteIndex : allows to delete index content ( https only ) * - settings : allows to get index settings ( https only ) * - editSettings : allows to change index settings ( https only ) * @ param validity the number of seconds after which the key will be automatically removed ( 0 means no time limit for this key ) * @ param maxQueriesPerIPPerHour Specify the maximum number of API calls allowed from an IP address per hour . Defaults to 0 ( no rate limit ) . * @ param maxHitsPerQuery Specify the maximum number of hits this API key can retrieve in one call . Defaults to 0 ( unlimited ) * @ param requestOptions Options to pass to this request */ public JSONObject updateApiKey ( String key , List < String > acls , int validity , int maxQueriesPerIPPerHour , int maxHitsPerQuery , RequestOptions requestOptions ) throws AlgoliaException { } }
try { JSONObject jsonObject = generateUpdateUser ( acls , validity , maxQueriesPerIPPerHour , maxHitsPerQuery ) ; return updateApiKey ( key , jsonObject , requestOptions ) ; } catch ( JSONException e ) { throw new RuntimeException ( e ) ; }
public class JpaOverridePersistenceXmlClassLoader { /** * { @ inheritDoc } */ @ Override public Enumeration < URL > getResources ( final String name ) throws IOException { } }
final Enumeration < URL > urls = super . getResources ( name ) ; if ( PERSISTENCE_XML . equals ( name ) ) { final Collection < URL > overrided = new LinkedList < URL > ( ) ; while ( urls . hasMoreElements ( ) ) { final URL url = urls . nextElement ( ) ; overrided . add ( newUrl ( url , slurp ( url ) ) ) ; } return Collections . enumeration ( overrided ) ; } return urls ;
public class ELKIServiceLoader { /** * Load the service file . */ public static void load ( Class < ? > parent , ClassLoader cl ) { } }
char [ ] buf = new char [ 0x4000 ] ; try { String fullName = RESOURCE_PREFIX + parent . getName ( ) ; Enumeration < URL > configfiles = cl . getResources ( fullName ) ; while ( configfiles . hasMoreElements ( ) ) { URL nextElement = configfiles . nextElement ( ) ; URLConnection conn = nextElement . openConnection ( ) ; conn . setUseCaches ( false ) ; try ( InputStreamReader is = new InputStreamReader ( conn . getInputStream ( ) , "UTF-8" ) ; ) { int start = 0 , cur = 0 , valid = is . read ( buf , 0 , buf . length ) ; char c ; while ( cur < valid ) { // Find newline or end while ( cur < valid && ( c = buf [ cur ] ) != '\n' && c != '\r' ) { cur ++ ; } if ( cur == valid && is . ready ( ) ) { // Move consumed buffer contents : if ( start > 0 ) { System . arraycopy ( buf , start , buf , 0 , valid - start ) ; valid -= start ; cur -= start ; start = 0 ; } else if ( valid == buf . length ) { throw new IOException ( "Buffer size exceeded. Maximum line length in service files is: " + buf . length + " in file: " + fullName ) ; } valid = is . read ( buf , valid , buf . length - valid ) ; continue ; } parseLine ( parent , buf , start , cur ) ; while ( cur < valid && ( ( c = buf [ cur ] ) == '\n' || c == '\r' ) ) { cur ++ ; } start = cur ; } } catch ( IOException x ) { throw new AbortException ( "Error reading configuration file" , x ) ; } } } catch ( IOException x ) { throw new AbortException ( "Could not load service configuration files." , x ) ; }
public class HelpCommand { /** * Reads the extended Description from a BotCommand . If the Command is not of Type { @ link IManCommand } , it calls toString ( ) ; * @ param command a command the extended Descriptions is read from * @ return the extended Description or the toString ( ) if IManCommand is not implemented */ public static String getManText ( IBotCommand command ) { } }
return IManCommand . class . isInstance ( command ) ? getManText ( ( IManCommand ) command ) : command . toString ( ) ;
public class BaseReportGenerator { /** * prepare the report , call { @ link # continueOnDataCollectionMessages ( com . vectorprint . report . data . DataCollectionMessages , com . itextpdf . text . Document ) * and when this returns true call { @ link # createReportBody ( com . itextpdf . text . Document , com . vectorprint . report . data . ReportDataHolder , com . itextpdf . text . pdf . PdfWriter ) * } . When a Runtime , VectorPrint , IO and DocumentException occurs { @ link # handleException ( java . lang . Exception , java . io . OutputStream ) * } will be called . * @ param data * @ param outputStream * @ return 0 or { @ link # ERRORINREPORT } * @ throws com . vectorprint . VectorPrintException */ @ Override public final int generate ( RD data , OutputStream out ) throws VectorPrintException { } }
try { DocumentStyler ds = stylerFactory . getDocumentStyler ( ) ; ds . setReportDataHolder ( data ) ; wasDebug = getSettings ( ) . getBooleanProperty ( Boolean . FALSE , DEBUG ) ; if ( ds . getValue ( DocumentSettings . TOC , Boolean . class ) ) { out = new TocOutputStream ( out , bufferSize , this ) ; getSettings ( ) . put ( DEBUG , Boolean . FALSE . toString ( ) ) ; } if ( ds . isParameterSet ( DocumentSettings . KEYSTORE ) ) { out = new SigningOutputStream ( out , bufferSize , this ) ; } document = new VectorPrintDocument ( eventHelper , stylerFactory , styleHelper ) ; writer = PdfWriter . getInstance ( document , out ) ; styleHelper . setVpd ( ( VectorPrintDocument ) document ) ; ( ( VectorPrintDocument ) document ) . setWriter ( writer ) ; eventHelper . setReportDataHolder ( data ) ; writer . setPageEvent ( eventHelper ) ; stylerFactory . setDocument ( document , writer ) ; stylerFactory . setImageLoader ( elementProducer ) ; stylerFactory . setLayerManager ( elementProducer ) ; StylerFactoryHelper . initStylingObject ( ds , writer , document , this , elementProducer , settings ) ; ds . loadFonts ( ) ; styleHelper . style ( document , data , StyleHelper . toCollection ( ds ) ) ; document . open ( ) ; if ( ds . canStyle ( document ) && ds . shouldStyle ( data , document ) ) { ds . styleAfterOpen ( document , data ) ; } // data from the data collection phase doesn ' t have to be present if ( data == null || continueOnDataCollectionMessages ( data . getMessages ( ) , document ) ) { createReportBody ( document , data , writer ) ; /* * when using queueing we may have run into failures in the data collection thread */ if ( data != null && ! data . getData ( ) . isEmpty ( ) ) { Object t = data . getData ( ) . poll ( ) ; if ( t instanceof Throwable ) { throw new VectorPrintException ( ( Throwable ) t ) ; } } } eventHelper . setLastPage ( writer . getCurrentPageNumber ( ) ) ; if ( getSettings ( ) . getBooleanProperty ( false , DEBUG ) ) { eventHelper . setLastPage ( writer . getCurrentPageNumber ( ) ) ; document . setPageSize ( new Rectangle ( ItextHelper . mmToPts ( 297 ) , ItextHelper . mmToPts ( 210 ) ) ) ; document . setMargins ( 5 , 5 , 5 , 5 ) ; document . newPage ( ) ; eventHelper . setDebugHereAfter ( true ) ; if ( ! ds . getValue ( DocumentSettings . TOC , Boolean . class ) ) { DebugHelper . appendDebugInfo ( writer , document , settings , stylerFactory ) ; } } document . close ( ) ; writer . close ( ) ; return 0 ; } catch ( RuntimeException | DocumentException | VectorPrintException | IOException e ) { return handleException ( e , out ) ; }
public class VpnConnectionsInner { /** * Retrieves all vpn connections for a particular virtual wan vpn gateway . * @ param resourceGroupName The resource group name of the VpnGateway . * @ param gatewayName The name of the gateway . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < List < VpnConnectionInner > > listByVpnGatewayAsync ( final String resourceGroupName , final String gatewayName , final ListOperationCallback < VpnConnectionInner > serviceCallback ) { } }
return AzureServiceFuture . fromPageResponse ( listByVpnGatewaySinglePageAsync ( resourceGroupName , gatewayName ) , new Func1 < String , Observable < ServiceResponse < Page < VpnConnectionInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < VpnConnectionInner > > > call ( String nextPageLink ) { return listByVpnGatewayNextSinglePageAsync ( nextPageLink ) ; } } , serviceCallback ) ;
public class JcrSession { /** * Throws an { @ link AccessControlException } if the current user does not have permission for all of the named actions in the * named workspace , otherwise returns silently . * The { @ code path } parameter is included for future use and is currently ignored * @ param workspaceName the name of the workspace in which the path exists * @ param path the absolute path on which the actions are occurring * @ param actions a comma - delimited list of actions to check * @ throws AccessDeniedException if the actions cannot be performed on the node at the specified path */ void checkPermission ( String workspaceName , Path path , String ... actions ) throws AccessDeniedException { } }
checkPermission ( workspaceName , pathSupplierFor ( path ) , actions ) ;
public class CacheEvents { /** * Creates an { @ link EventType # UPDATED updated } { @ link CacheEvent } . * @ param key the key for which the mapping was updated * @ param oldValue the old value * @ param newValue the new value * @ param source the event source * @ param < K > the key type * @ param < V > the value type * @ return an updated cache event */ public static < K , V > CacheEvent < K , V > update ( K key , V oldValue , V newValue , Cache < K , V > source ) { } }
return new UpdateEvent < > ( key , oldValue , newValue , source ) ;
public class Equation { /** * Searches for pairs of parentheses and processes blocks inside of them . Embedded parentheses are handled * with no problem . On output only a single token should be in tokens . * @ param tokens List of parsed tokens * @ param sequence Sequence of operators */ protected void handleParentheses ( TokenList tokens , Sequence sequence ) { } }
// have a list to handle embedded parentheses , e . g . ( ( ( ( ( a ) ) ) ) ) List < TokenList . Token > left = new ArrayList < TokenList . Token > ( ) ; // find all of them TokenList . Token t = tokens . first ; while ( t != null ) { TokenList . Token next = t . next ; if ( t . getType ( ) == Type . SYMBOL ) { if ( t . getSymbol ( ) == Symbol . PAREN_LEFT ) left . add ( t ) ; else if ( t . getSymbol ( ) == Symbol . PAREN_RIGHT ) { if ( left . isEmpty ( ) ) throw new ParseError ( ") found with no matching (" ) ; TokenList . Token a = left . remove ( left . size ( ) - 1 ) ; // remember the element before so the new one can be inserted afterwards TokenList . Token before = a . previous ; TokenList sublist = tokens . extractSubList ( a , t ) ; // remove parentheses sublist . remove ( sublist . first ) ; sublist . remove ( sublist . last ) ; // if its a function before ( ) then the ( ) indicates its an input to a function if ( before != null && before . getType ( ) == Type . FUNCTION ) { List < TokenList . Token > inputs = parseParameterCommaBlock ( sublist , sequence ) ; if ( inputs . isEmpty ( ) ) throw new ParseError ( "Empty function input parameters" ) ; else { createFunction ( before , inputs , tokens , sequence ) ; } } else if ( before != null && before . getType ( ) == Type . VARIABLE && before . getVariable ( ) . getType ( ) == VariableType . MATRIX ) { // if it ' s a variable then that says it ' s a sub - matrix TokenList . Token extract = parseSubmatrixToExtract ( before , sublist , sequence ) ; // put in the extract operation tokens . insert ( before , extract ) ; tokens . remove ( before ) ; } else { // if null then it was empty inside TokenList . Token output = parseBlockNoParentheses ( sublist , sequence , false ) ; if ( output != null ) tokens . insert ( before , output ) ; } } } t = next ; } if ( ! left . isEmpty ( ) ) throw new ParseError ( "Dangling ( parentheses" ) ;
public class ValidateGlobalRules { /** * Checks if the plays edge has been added between the roleplayer ' s Type and * the Role being played . * Also checks that required Role are satisfied * @ param role The Role which the role - player is playing * @ param thing the role - player * @ return an error if one is found */ private static Optional < String > roleNotAllowedToBePlayed ( Role role , Thing thing ) { } }
TypeImpl < ? , ? > currentConcept = ( TypeImpl < ? , ? > ) thing . type ( ) ; boolean satisfiesPlays = false ; while ( currentConcept != null ) { Map < Role , Boolean > plays = currentConcept . directPlays ( ) ; for ( Map . Entry < Role , Boolean > playsEntry : plays . entrySet ( ) ) { Role rolePlayed = playsEntry . getKey ( ) ; Boolean required = playsEntry . getValue ( ) ; if ( rolePlayed . label ( ) . equals ( role . label ( ) ) ) { satisfiesPlays = true ; // Assert unique relation for this role type if ( required && ! CommonUtil . containsOnly ( thing . relations ( role ) , 1 ) ) { return Optional . of ( VALIDATION_REQUIRED_RELATION . getMessage ( thing . id ( ) , thing . type ( ) . label ( ) , role . label ( ) , thing . relations ( role ) . count ( ) ) ) ; } } } currentConcept = ( TypeImpl ) currentConcept . sup ( ) ; } if ( satisfiesPlays ) { return Optional . empty ( ) ; } else { return Optional . of ( VALIDATION_CASTING . getMessage ( thing . type ( ) . label ( ) , thing . id ( ) , role . label ( ) ) ) ; }
public class ExpressionParser { /** * Parses the { @ literal < comparison - expr > } non - terminal . * < pre > * { @ literal * < comparison - expr > : : = < comparison - op > < version > * | < version > * < / pre > * @ return the expression AST */ private Expression parseComparisonExpression ( ) { } }
Token token = tokens . lookahead ( ) ; Expression expr ; switch ( token . type ) { case EQUAL : tokens . consume ( ) ; expr = new Equal ( parseVersion ( ) ) ; break ; case NOT_EQUAL : tokens . consume ( ) ; expr = new NotEqual ( parseVersion ( ) ) ; break ; case GREATER : tokens . consume ( ) ; expr = new Greater ( parseVersion ( ) ) ; break ; case GREATER_EQUAL : tokens . consume ( ) ; expr = new GreaterOrEqual ( parseVersion ( ) ) ; break ; case LESS : tokens . consume ( ) ; expr = new Less ( parseVersion ( ) ) ; break ; case LESS_EQUAL : tokens . consume ( ) ; expr = new LessOrEqual ( parseVersion ( ) ) ; break ; default : expr = new Equal ( parseVersion ( ) ) ; } return expr ;
public class WstxInputFactory { /** * Method that is eventually called to create a ( full ) stream read * instance . * Note : defined as public method because it needs to be called by * SAX implementation . * @ param systemId System id used for this reader ( if any ) * @ param bs Bootstrapper to use for creating actual underlying * physical reader * @ param forER Flag to indicate whether it will be used via * Event API ( will affect some configuration settings ) , true if it * will be , false if not ( or not known ) * @ param autoCloseInput Whether the underlying input source should be * actually closed when encountering EOF , or when < code > close ( ) < / code > * is called . Will be true for input sources that are automatically * managed by stream reader ( input streams created for * { @ link java . net . URL } and { @ link java . io . File } arguments , or when * configuration settings indicate auto - closing is to be enabled * ( the default value is false as per Stax 1.0 specs ) . */ public XMLStreamReader2 createSR ( ReaderConfig cfg , String systemId , InputBootstrapper bs , boolean forER , boolean autoCloseInput ) throws XMLStreamException { } }
// 16 - Aug - 2004 , TSa : Maybe we have a context ? URL src = cfg . getBaseURL ( ) ; // If not , maybe we can derive it from system id ? if ( ( src == null ) && ( systemId != null && systemId . length ( ) > 0 ) ) { try { src = URLUtil . urlFromSystemId ( systemId ) ; } catch ( IOException ie ) { throw new WstxIOException ( ie ) ; } } return doCreateSR ( cfg , SystemId . construct ( systemId , src ) , bs , forER , autoCloseInput ) ;
public class EigenDecompositor { /** * Nonsymmetric reduction to Hessenberg form . */ private void orthes ( Matrix h , Matrix v , Vector ort ) { } }
// This is derived from the Algol procedures orthes and ortran , // by Martin and Wilkinson , Handbook for Auto . Comp . , // Vol . ii - Linear Algebra , and the corresponding // Fortran subroutines in EISPACK . int n = ort . length ( ) ; int low = 0 ; int high = n - 1 ; for ( int m = low + 1 ; m <= high - 1 ; m ++ ) { // Scale column . double scale = 0.0 ; for ( int i = m ; i <= high ; i ++ ) { scale = scale + Math . abs ( h . get ( i , m - 1 ) ) ; } if ( scale != 0.0 ) { // Compute Householder transformation . double hh = 0.0 ; for ( int i = high ; i >= m ; i -- ) { ort . set ( i , h . get ( i , m - 1 ) / scale ) ; hh += ort . get ( i ) * ort . get ( i ) ; } double g = Math . sqrt ( hh ) ; if ( ort . get ( m ) > Matrices . EPS ) { g = - g ; } hh = hh - ort . get ( m ) * g ; ort . updateAt ( m , Vectors . asMinusFunction ( g ) ) ; // Apply Householder similarity transformation // H = ( I - u * u ' / h ) * H * ( I - u * u ' ) / h ) for ( int j = m ; j < n ; j ++ ) { double f = 0.0 ; for ( int i = high ; i >= m ; i -- ) { f += ort . get ( i ) * h . get ( i , j ) ; } f = f / hh ; for ( int i = m ; i <= high ; i ++ ) { h . updateAt ( i , j , Matrices . asMinusFunction ( f * ort . get ( i ) ) ) ; } } for ( int i = 0 ; i <= high ; i ++ ) { double f = 0.0 ; for ( int j = high ; j >= m ; j -- ) { f += ort . get ( j ) * h . get ( i , j ) ; } f = f / hh ; for ( int j = m ; j <= high ; j ++ ) { h . updateAt ( i , j , Matrices . asMinusFunction ( f * ort . get ( j ) ) ) ; } } ort . set ( m , scale * ort . get ( m ) ) ; h . set ( m , m - 1 , scale * g ) ; } } // Accumulate transformations ( Algol ' s ortran ) . for ( int m = high - 1 ; m >= low + 1 ; m -- ) { if ( Math . abs ( h . get ( m , m - 1 ) ) > Matrices . EPS ) { for ( int i = m + 1 ; i <= high ; i ++ ) { ort . set ( i , h . get ( i , m - 1 ) ) ; } for ( int j = m ; j <= high ; j ++ ) { double g = 0.0 ; for ( int i = m ; i <= high ; i ++ ) { g += ort . get ( i ) * v . get ( i , j ) ; } // Double division avoids possible underflow g = ( g / ort . get ( m ) ) / h . get ( m , m - 1 ) ; for ( int i = m ; i <= high ; i ++ ) { v . updateAt ( i , j , Matrices . asPlusFunction ( g * ort . get ( i ) ) ) ; } } } }
public class HelpFormatter { /** * Print the help with the given Command object . * @ param command the Command instance */ public void printHelp ( Command command ) { } }
if ( command . getDescriptor ( ) . getUsage ( ) != null ) { printUsage ( command . getDescriptor ( ) . getUsage ( ) ) ; } else { printUsage ( command ) ; } int leftWidth = printOptions ( command . getOptions ( ) ) ; printArguments ( command . getArgumentsList ( ) , leftWidth ) ;
public class InferenceSpecification { /** * The supported MIME types for the input data . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setSupportedContentTypes ( java . util . Collection ) } or * { @ link # withSupportedContentTypes ( java . util . Collection ) } if you want to override the existing values . * @ param supportedContentTypes * The supported MIME types for the input data . * @ return Returns a reference to this object so that method calls can be chained together . */ public InferenceSpecification withSupportedContentTypes ( String ... supportedContentTypes ) { } }
if ( this . supportedContentTypes == null ) { setSupportedContentTypes ( new java . util . ArrayList < String > ( supportedContentTypes . length ) ) ; } for ( String ele : supportedContentTypes ) { this . supportedContentTypes . add ( ele ) ; } return this ;
public class DataEncryption { /** * Decrypts the specified string using AES - 256 . The encryptedText is * expected to be the Base64 encoded representation of the encrypted bytes * generated from { @ link # encryptAsString ( String ) } . * @ param secretKey the secret key to decrypt with * @ param encryptedText the text to decrypt * @ return the decrypted string * @ throws Exception a number of exceptions may be thrown * @ since 1.3.0 */ public static String decryptAsString ( final SecretKey secretKey , final String encryptedText ) throws Exception { } }
return new String ( decryptAsBytes ( secretKey , Base64 . getDecoder ( ) . decode ( encryptedText ) ) ) ;
public class SVGParser { /** * Parse the ' style ' attribute . */ private static void parseStyle ( SvgElementBase obj , String style ) { } }
TextScanner scan = new TextScanner ( style . replaceAll ( "/\\*.*?\\*/" , "" ) ) ; // regex strips block comments while ( true ) { String propertyName = scan . nextToken ( ':' ) ; scan . skipWhitespace ( ) ; if ( ! scan . consume ( ':' ) ) break ; // Syntax error . Stop processing CSS rules . scan . skipWhitespace ( ) ; String propertyValue = scan . nextTokenWithWhitespace ( ';' ) ; if ( propertyValue == null ) break ; // Syntax error scan . skipWhitespace ( ) ; if ( scan . empty ( ) || scan . consume ( ';' ) ) { if ( obj . style == null ) obj . style = new Style ( ) ; processStyleProperty ( obj . style , propertyName , propertyValue ) ; scan . skipWhitespace ( ) ; } }
public class Parser { /** * Parse a fragment of HTML into a list of nodes . The context element , if supplied , supplies parsing context . * @ param fragmentHtml the fragment of HTML to parse * @ param context ( optional ) the element that this HTML fragment is being parsed for ( i . e . for inner HTML ) . This * provides stack context ( for implicit element creation ) . * @ param baseUri base URI of document ( i . e . original fetch location ) , for resolving relative URLs . * @ param errorList list to add errors to * @ return list of nodes parsed from the input HTML . Note that the context element , if supplied , is not modified . */ public static List < Node > parseFragment ( String fragmentHtml , Element context , String baseUri , ParseErrorList errorList ) { } }
HtmlTreeBuilder treeBuilder = new HtmlTreeBuilder ( ) ; Parser parser = new Parser ( treeBuilder ) ; parser . errors = errorList ; return treeBuilder . parseFragment ( fragmentHtml , context , baseUri , parser ) ;
public class OIndexFullText { /** * Indexes a value and save the index . Splits the value in single words and index each one . Save of the index is responsibility of * the caller . */ @ Override public OIndexFullText put ( final Object iKey , final OIdentifiable iSingleValue ) { } }
if ( iKey == null ) return this ; modificationLock . requestModificationLock ( ) ; try { final List < String > words = splitIntoWords ( iKey . toString ( ) ) ; // FOREACH WORD CREATE THE LINK TO THE CURRENT DOCUMENT for ( final String word : words ) { acquireExclusiveLock ( ) ; try { Set < OIdentifiable > refs ; // SEARCH FOR THE WORD refs = map . get ( word ) ; if ( refs == null ) // WORD NOT EXISTS : CREATE THE KEYWORD CONTAINER THE FIRST TIME THE WORD IS FOUND refs = new OMVRBTreeRIDSet ( ) . setAutoConvert ( false ) ; // ADD THE CURRENT DOCUMENT AS REF FOR THAT WORD refs . add ( iSingleValue ) ; // SAVE THE INDEX ENTRY map . put ( word , refs ) ; } finally { releaseExclusiveLock ( ) ; } } return this ; } finally { modificationLock . releaseModificationLock ( ) ; }
public class StringUtilities { /** * This method ensures that the output String has only * valid XML unicode characters as specified by the * XML 1.0 standard . For reference , please see * < a href = " http : / / www . w3 . org / TR / 2000 / REC - xml - 20001006 # NT - Char " > the * standard < / a > . This method will return an empty * String if the input is null or empty . * @ param in The String whose non - valid characters we want to remove . * @ return The in String , stripped of non - valid characters . */ public static String stripNonValidXMLCharacters ( String in ) { } }
StringBuffer out = new StringBuffer ( ) ; // Used to hold the output . char current ; // Used to reference the current character . if ( in == null || ( "" . equals ( in ) ) ) return "" ; // vacancy test . for ( int i = 0 ; i < in . length ( ) ; i ++ ) { current = in . charAt ( i ) ; // NOTE : No IndexOutOfBoundsException caught here ; it should not happen . if ( ( current == 0x9 ) || ( current == 0xA ) || ( current == 0xD ) || ( ( current >= 0x20 ) && ( current <= 0xD7FF ) ) || ( ( current >= 0xE000 ) && ( current <= 0xFFFD ) ) || ( ( current >= 0x10000 ) && ( current <= 0x10FFFF ) ) ) out . append ( current ) ; } return out . toString ( ) ;
public class Utils { /** * list of points to draw */ private static void weaveDNAStrands ( LinkedList < DNASegment > segments , int firstJulianDay , HashMap < Integer , DNAStrand > strands , int top , int bottom , int [ ] dayXs ) { } }
// First , get rid of any colors that ended up with no segments Iterator < DNAStrand > strandIterator = strands . values ( ) . iterator ( ) ; while ( strandIterator . hasNext ( ) ) { DNAStrand strand = strandIterator . next ( ) ; if ( strand . count < 1 && strand . allDays == null ) { strandIterator . remove ( ) ; continue ; } strand . points = new float [ strand . count * 4 ] ; strand . position = 0 ; } // Go through each segment and compute its points for ( DNASegment segment : segments ) { // Add the points to the strand of that color DNAStrand strand = strands . get ( segment . color ) ; int dayIndex = segment . day - firstJulianDay ; int dayStartMinute = segment . startMinute % DAY_IN_MINUTES ; int dayEndMinute = segment . endMinute % DAY_IN_MINUTES ; int height = bottom - top ; int workDayHeight = height * 3 / 4 ; int remainderHeight = ( height - workDayHeight ) / 2 ; int x = dayXs [ dayIndex ] ; int y0 = 0 ; int y1 = 0 ; y0 = top + getPixelOffsetFromMinutes ( dayStartMinute , workDayHeight , remainderHeight ) ; y1 = top + getPixelOffsetFromMinutes ( dayEndMinute , workDayHeight , remainderHeight ) ; if ( DEBUG ) { Log . d ( TAG , "Adding " + Integer . toHexString ( segment . color ) + " at x,y0,y1: " + x + " " + y0 + " " + y1 + " for " + dayStartMinute + " " + dayEndMinute ) ; } strand . points [ strand . position ++ ] = x ; strand . points [ strand . position ++ ] = y0 ; strand . points [ strand . position ++ ] = x ; strand . points [ strand . position ++ ] = y1 ; }
public class BreadthFirstIterator { /** * Removes the current element in the iteration . * @ throws java . lang . IllegalStateException if the next method has not yet been called , or the remove method * has already been called after the last call to the next method . * @ see java . util . Iterator # remove ( ) */ @ Override public void remove ( ) { } }
Assert . state ( nextCalled . compareAndSet ( true , false ) , "next was not called before remove" ) ; iterators . peek ( ) . remove ( ) ;
public class WebSocketController { /** * tag : : binary [ ] */ @ Every ( "1h" ) public void binary ( ) { } }
byte [ ] bytes = new byte [ 5 ] ; random . nextBytes ( bytes ) ; logger ( ) . info ( "Message dispatching binary : {}" , bytes ) ; publisher . publish ( "/binary" , bytes ) ;
public class FileMemento { private String whereIs ( String savePoint , Class < ? > objClass ) { } }
if ( savePoint == null || savePoint . length ( ) == 0 ) throw new RequiredException ( "savePoint" ) ; StringBuffer text = new StringBuffer ( ) ; text . append ( this . rootPath ) . append ( "/" ) . append ( objClass . getName ( ) ) . append ( "." ) . append ( savePoint ) . append ( fileExtension ) ; return text . toString ( ) ;
public class ODataLocalHole { /** * Appends the hole to the end of the segment . * @ throws IOException */ public synchronized void createHole ( final long iRecordOffset , final int iRecordSize ) throws IOException { } }
final long timer = OProfiler . getInstance ( ) . startChrono ( ) ; // IN MEMORY final int recycledPosition ; final ODataHoleInfo hole ; if ( ! freeHoles . isEmpty ( ) ) { // RECYCLE THE FIRST FREE HOLE recycledPosition = freeHoles . remove ( 0 ) ; hole = availableHolesList . get ( recycledPosition ) ; hole . dataOffset = iRecordOffset ; hole . size = iRecordSize ; } else { // APPEND A NEW ONE recycledPosition = getHoles ( ) ; hole = new ODataHoleInfo ( iRecordSize , iRecordOffset , recycledPosition ) ; availableHolesList . add ( hole ) ; file . allocateSpace ( RECORD_SIZE ) ; } availableHolesBySize . put ( hole , hole ) ; availableHolesByPosition . put ( hole , hole ) ; if ( maxHoleSize < iRecordSize ) maxHoleSize = iRecordSize ; // TO FILE final long p = recycledPosition * RECORD_SIZE ; file . writeLong ( p , iRecordOffset ) ; file . writeInt ( p + OBinaryProtocol . SIZE_LONG , iRecordSize ) ; OProfiler . getInstance ( ) . stopChrono ( PROFILER_DATA_HOLE_CREATE , timer ) ;
public class ApplicationSettingRepository { /** * region > helpers */ private ApplicationSettingJdo newSetting ( final String key , final String description , final SettingType settingType , final String valueRaw ) { } }
final ApplicationSettingJdo setting = repositoryService . instantiate ( ApplicationSettingJdo . class ) ; setting . setKey ( key ) ; setting . setDescription ( description ) ; setting . setValueRaw ( valueRaw ) ; setting . setType ( settingType ) ; repositoryService . persist ( setting ) ; return setting ;
public class WsByteBufferPoolManagerImpl { /** * Initialize the pool manager with the number of pools , the entry sizes for each * pool , and the maximum depth of the free pool . * @ param bufferEntrySizes the memory sizes of each entry in the pools * @ param bufferEntryDepths the maximum number of entries in the free pool */ public void initialize ( int [ ] bufferEntrySizes , int [ ] bufferEntryDepths ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "initialize" ) ; } // order both lists from smallest to largest , based only on Entry Sizes int len = bufferEntrySizes . length ; int [ ] bSizes = new int [ len ] ; int [ ] bDepths = new int [ len ] ; int sizeCompare ; int depth ; int sizeSort ; int j ; for ( int i = 0 ; i < len ; i ++ ) { sizeCompare = bufferEntrySizes [ i ] ; depth = bufferEntryDepths [ i ] ; // go backwards , for speed , since first Array List is // probably already ordered small to large for ( j = i - 1 ; j >= 0 ; j -- ) { sizeSort = bSizes [ j ] ; if ( sizeCompare > sizeSort ) { // add the bigger one after the smaller one bSizes [ j + 1 ] = sizeCompare ; bDepths [ j + 1 ] = depth ; break ; } // move current one down , since it is bigger bSizes [ j + 1 ] = sizeSort ; bDepths [ j + 1 ] = bDepths [ j ] ; } if ( j < 0 ) { // smallest so far , add it at the front of the list bSizes [ 0 ] = sizeCompare ; bDepths [ 0 ] = depth ; } } boolean tracking = trackingBuffers ( ) ; this . pools = new WsByteBufferPool [ len ] ; this . poolsDirect = new WsByteBufferPool [ len ] ; this . poolSizes = new int [ len ] ; for ( int i = 0 ; i < len ; i ++ ) { // make backing pool 10 times larger than local pools this . pools [ i ] = new WsByteBufferPool ( bSizes [ i ] , bDepths [ i ] * 10 , tracking , false ) ; this . poolsDirect [ i ] = new WsByteBufferPool ( bSizes [ i ] , bDepths [ i ] * 10 , tracking , true ) ; this . poolSizes [ i ] = bSizes [ i ] ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Number of pools created: " + this . poolSizes . length ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "initialize" ) ; }
public class PredictionsImpl { /** * Predict an image without saving the result . * @ param projectId The project id * @ param imageData the InputStream value * @ param predictImageWithNoStoreOptionalParameter the object representing the optional parameters to be set before calling this API * @ 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 < ImagePrediction > predictImageWithNoStoreAsync ( UUID projectId , byte [ ] imageData , PredictImageWithNoStoreOptionalParameter predictImageWithNoStoreOptionalParameter , final ServiceCallback < ImagePrediction > serviceCallback ) { } }
return ServiceFuture . fromResponse ( predictImageWithNoStoreWithServiceResponseAsync ( projectId , imageData , predictImageWithNoStoreOptionalParameter ) , serviceCallback ) ;
public class ServerStateMachine { /** * Applies register session entry to the state machine . * Register entries are applied to the state machine to create a new session . The resulting session ID is the * index of the RegisterEntry . Once a new session is registered , we call register ( ) on the state machine . * In the event that the { @ code synchronous } flag is set , that indicates that the registration command expects a * response , i . e . it was applied by a leader . In that case , any events published during the execution of the * state machine ' s register ( ) method must be completed synchronously prior to the completion of the returned future . */ private CompletableFuture < Long > apply ( RegisterEntry entry ) { } }
// Allow the executor to execute any scheduled events . long timestamp = executor . timestamp ( entry . getTimestamp ( ) ) ; long sessionId = entry . getIndex ( ) ; ServerSessionContext session = new ServerSessionContext ( sessionId , entry . getClient ( ) , log , executor . context ( ) , entry . getTimeout ( ) ) ; ServerSessionContext oldSession = executor . context ( ) . sessions ( ) . registerSession ( session ) ; // Update the session timestamp * after * executing any scheduled operations . The executor ' s timestamp // is guaranteed to be monotonically increasing , whereas the RegisterEntry may have an earlier timestamp // if , e . g . , it was written shortly after a leader change . session . setTimestamp ( timestamp ) ; // Determine whether any sessions appear to be expired . This won ' t immediately expire the session ( s ) , // but it will make them available to be unregistered by the leader . suspectSessions ( 0 , timestamp ) ; ThreadContext context = ThreadContext . currentContextOrThrow ( ) ; long index = entry . getIndex ( ) ; // Call the register ( ) method on the user - provided state machine to allow the state machine to react to // a new session being registered . User state machine methods are always called in the state machine thread . CompletableFuture < Long > future = new ComposableFuture < > ( ) ; executor . executor ( ) . execute ( ( ) -> registerSession ( index , timestamp , session , oldSession , future , context ) ) ; return future ;
import java . util . * ; public class Main { public static void main ( String [ ] args ) { List < Integer > list = new ArrayList < > ( Arrays . asList ( 5 , 6 , 3 , 4 ) ) ; System . out . println ( sortEvenIndices ( list ) ) ; } /** * This function takes a list as an input and returns a new list . The new list retains the odd - indexed elements * from the initial list , and contains the even - indexed elements in sorted order . * > > > sort _ even _ indices ( [ 1 , 2 , 3 ] ) * [ 1 , 2 , 3] * > > > sort _ even _ indices ( [ 5 , 6 , 3 , 4 ] ) * [ 3 , 6 , 5 , 4] * @ param initialList unsorted input list * @ return list with even indexed elements sorted */ public static List < Integer > sortEvenIndices ( List < Integer > initialList ) { } }
List < Integer > evenIndexElements = new ArrayList < > ( ) ; for ( int i = 0 ; i < initialList . size ( ) ; i += 2 ) { evenIndexElements . add ( initialList . get ( i ) ) ; } List < Integer > oddIndexElements = new ArrayList < > ( ) ; for ( int i = 1 ; i < initialList . size ( ) ; i += 2 ) { oddIndexElements . add ( initialList . get ( i ) ) ; } Collections . sort ( evenIndexElements ) ; List < Integer > result = new ArrayList < > ( ) ; for ( int i = 0 ; i < oddIndexElements . size ( ) ; i ++ ) { result . add ( evenIndexElements . get ( i ) ) ; result . add ( oddIndexElements . get ( i ) ) ; } if ( evenIndexElements . size ( ) > oddIndexElements . size ( ) ) { result . add ( evenIndexElements . get ( evenIndexElements . size ( ) - 1 ) ) ; } return result ;
public class SLF4JBridgeHandler { /** * Removes previously installed SLF4JBridgeHandler instances . See also * { @ link # install ( ) } . * @ throws SecurityException A < code > SecurityException < / code > is thrown , if a security manager * exists and if the caller does not have * LoggingPermission ( " control " ) . */ public static void uninstall ( ) throws SecurityException { } }
java . util . logging . Logger rootLogger = getRootLogger ( ) ; Handler [ ] handlers = rootLogger . getHandlers ( ) ; for ( int i = 0 ; i < handlers . length ; i ++ ) { if ( handlers [ i ] instanceof SLF4JBridgeHandler ) { rootLogger . removeHandler ( handlers [ i ] ) ; } }
public class HeapQueueingStrategy { /** * Increment the count of removed items from the queue . Calling this will * optionally request that the garbage collector run to free up heap space * for every nth dequeue , where n is the value set for the dequeueHint . * @ param value value that was removed from the queue */ public void onAfterRemove ( E value ) { } }
if ( value != null ) { dequeued ++ ; if ( dequeued % dequeueHint == 0 ) { RUNTIME . gc ( ) ; } }
public class HandleHelper { /** * 处理单条数据 * @ param columnCount 列数 * @ param meta ResultSetMetaData * @ param rs 数据集 * @ param beanClass 目标Bean类型 * @ return 每一行的Entity * @ throws SQLException SQL执行异常 * @ since 3.3.1 */ @ SuppressWarnings ( "unchecked" ) public static < T > T handleRow ( int columnCount , ResultSetMetaData meta , ResultSet rs , Class < T > beanClass ) throws SQLException { } }
Assert . notNull ( beanClass , "Bean Class must be not null !" ) ; if ( beanClass . isArray ( ) ) { // 返回数组 final Class < ? > componentType = beanClass . getComponentType ( ) ; final Object [ ] result = ArrayUtil . newArray ( componentType , columnCount ) ; for ( int i = 0 , j = 1 ; i < columnCount ; i ++ , j ++ ) { result [ i ] = getColumnValue ( rs , j , meta . getColumnType ( j ) , componentType ) ; } return ( T ) result ; } else if ( Iterable . class . isAssignableFrom ( beanClass ) ) { // 集合 final Object [ ] objRow = handleRow ( columnCount , meta , rs , Object [ ] . class ) ; return Convert . convert ( beanClass , objRow ) ; } else if ( beanClass . isAssignableFrom ( Entity . class ) ) { // Entity的父类都可按照Entity返回 return ( T ) handleRow ( columnCount , meta , rs ) ; } else if ( String . class == beanClass ) { // 字符串 final Object [ ] objRow = handleRow ( columnCount , meta , rs , Object [ ] . class ) ; return ( T ) StrUtil . join ( ", " , objRow ) ; } // 普通bean final T bean = ReflectUtil . newInstanceIfPossible ( beanClass ) ; // 忽略字段大小写 final Map < String , PropDesc > propMap = BeanUtil . getBeanDesc ( beanClass ) . getPropMap ( true ) ; String columnLabel ; PropDesc pd ; Method setter = null ; Object value = null ; for ( int i = 1 ; i <= columnCount ; i ++ ) { columnLabel = meta . getColumnLabel ( i ) ; // 驼峰命名风格 pd = propMap . get ( StrUtil . toCamelCase ( columnLabel ) ) ; setter = ( null == pd ) ? null : pd . getSetter ( ) ; if ( null != setter ) { value = getColumnValue ( rs , columnLabel , meta . getColumnType ( i ) , TypeUtil . getFirstParamType ( setter ) ) ; ReflectUtil . invokeWithCheck ( bean , setter , new Object [ ] { value } ) ; } } return bean ;
public class EventMessage { /** * 转换 未定义XML 字段为 Map * @ since 2.8.13 * @ return MAP */ public Map < String , String > otherElementsToMap ( ) { } }
Map < String , String > map = new LinkedHashMap < String , String > ( ) ; if ( otherElements != null ) { for ( org . w3c . dom . Element e : otherElements ) { if ( e . hasChildNodes ( ) ) { if ( e . getChildNodes ( ) . getLength ( ) == 1 && e . getChildNodes ( ) . item ( 0 ) . getNodeType ( ) == Node . TEXT_NODE ) { map . put ( e . getTagName ( ) , e . getTextContent ( ) ) ; } } } } return map ;
public class DeviceAppearanceImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . DEVICE_APPEARANCE__DEV_APP : setDevApp ( DEV_APP_EDEFAULT ) ; return ; case AfplibPackage . DEVICE_APPEARANCE__RESERVED : setReserved ( RESERVED_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ;
public class RemoteQueuePoint { /** * / * ( non - Javadoc ) * @ see com . ibm . ws . sib . processor . runtime . SIMPRemoteQueuePointControllable # getRemoteConsumerReceiver ( ) */ public SIMPRemoteConsumerReceiverControllable getRemoteConsumerReceiver ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getRemoteConsumerReceiver" ) ; // SIB0113a // This method gets the non gathering RemoteConsumerReceiver - in other words the // controllable for the remote consumerdispatcher with a null gatheringUuid SIMPRemoteConsumerReceiverControllable remoteConsumerReceiverControl = null ; // createAIH is false as if there isn ' t one already created then there is little benefit to // creating a new one . RemoteConsumerDispatcher rcd = destinationHandler . getRemoteConsumerDispatcher ( remoteME , null , false ) ; if ( rcd != null ) { AnycastInputHandler aih = rcd . getAnycastInputHandler ( ) ; if ( aih != null ) { AIStream aiStream = aih . getAIStream ( ) ; if ( aiStream != null ) { remoteConsumerReceiverControl = ( SIMPRemoteConsumerReceiverControllable ) aiStream . getControlAdapter ( ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getRemoteConsumerReceiver" , remoteConsumerReceiverControl ) ; return remoteConsumerReceiverControl ;