signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class QuickSort { /** * Sort the elements in the specified List according to the reverse ordering imposed by the * specified Comparator . */ public static < T > void rsort ( List < T > a , Comparator < ? super T > comp ) { } }
sort ( a , Collections . reverseOrder ( comp ) ) ;
public class DevicesInner { /** * Updates the security settings on a data box edge / gateway device . * @ param deviceName The device name . * @ param resourceGroupName The resource group name . * @ param deviceAdminPassword Device administrator password as an encrypted string ( encrypted using RSA PKCS # 1 ) is used to sign into the local web UI of the device . The Actual password should have at least 8 characters that are a combination of uppercase , lowercase , numeric , and special characters . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable for the request */ public Observable < Void > createOrUpdateSecuritySettingsAsync ( String deviceName , String resourceGroupName , AsymmetricEncryptedSecret deviceAdminPassword ) { } }
return createOrUpdateSecuritySettingsWithServiceResponseAsync ( deviceName , resourceGroupName , deviceAdminPassword ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ;
public class Polynomial { /** * Prunes zero coefficients from the end of a sequence . A coefficient is zero if its absolute value * is less than or equal to tolerance . * @ param tol Tolerance for zero . Try 1e - 15 */ public void truncateZeros ( double tol ) { } }
// double max = 0; // for ( int i = 0 ; i < size ; i + + ) { // double d = Math . abs ( c [ i ] ) ; // if ( d > max ) // max = d ; // tol * = max ; int i = size - 1 ; for ( ; i >= 0 ; i -- ) { if ( Math . abs ( c [ i ] ) > tol ) break ; } size = i + 1 ;
public class ApiOvhTelephony { /** * Create a new menu * REST : POST / telephony / { billingAccount } / ovhPabx / { serviceName } / menu * @ param greetSound [ required ] The id of the OvhPabxSound played to greet * @ param invalidSound [ required ] The id of the OvhPabxSound played when the caller uses an invalid DTMF * @ param invalidSoundTts [ required ] The text to speech sound played when the caller uses an invalid DTMF * @ param greetSoundTts [ required ] The text to speech sound played to greet * @ param name [ required ] The name of the menu * @ param billingAccount [ required ] The name of your billingAccount * @ param serviceName [ required ] */ public OvhOvhPabxMenu billingAccount_ovhPabx_serviceName_menu_POST ( String billingAccount , String serviceName , Long greetSound , Long greetSoundTts , Long invalidSound , Long invalidSoundTts , String name ) throws IOException { } }
String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/menu" ; StringBuilder sb = path ( qPath , billingAccount , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "greetSound" , greetSound ) ; addBody ( o , "greetSoundTts" , greetSoundTts ) ; addBody ( o , "invalidSound" , invalidSound ) ; addBody ( o , "invalidSoundTts" , invalidSoundTts ) ; addBody ( o , "name" , name ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhOvhPabxMenu . class ) ;
public class ExqlCompiler { /** * 从当前位置查找匹配的 : { . . . } 并编译出 : ExqlUnit 对象 。 * 如果有匹配的 : { . . . } , 编译后 , 当前位置指向匹配的右括号后一个字符 。 * @ return ExqlUnit , 如果没有 : { . . . } 匹配 , 返回 < code > null < / code > . */ private ExqlUnit compileBlock ( ) { } }
// 查找匹配的 { . . . } String group = findBrace ( BLOCK_LEFT , BLOCK_RIGHT ) ; if ( group != null ) { // 编译 { . . . } 内部的子句 ExqlCompiler compiler = new ExqlCompiler ( group ) ; return compiler . compileUnit ( ) ; } return null ; // 没有 { . . . } 匹配
public class DdosProtectionPlansInner { /** * Creates or updates a DDoS protection plan . * @ param resourceGroupName The name of the resource group . * @ param ddosProtectionPlanName The name of the DDoS protection plan . * @ param parameters Parameters supplied to the create or update operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the DdosProtectionPlanInner object */ public Observable < DdosProtectionPlanInner > beginCreateOrUpdateAsync ( String resourceGroupName , String ddosProtectionPlanName , DdosProtectionPlanInner parameters ) { } }
return beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , ddosProtectionPlanName , parameters ) . map ( new Func1 < ServiceResponse < DdosProtectionPlanInner > , DdosProtectionPlanInner > ( ) { @ Override public DdosProtectionPlanInner call ( ServiceResponse < DdosProtectionPlanInner > response ) { return response . body ( ) ; } } ) ;
public class ScriptWriterBinary { /** * RowInput / OutputBinary : row ( column values ) */ protected void writeRow ( Session session , Table t , Object [ ] data ) throws IOException { } }
rowOut . reset ( ) ; rowOut . writeRow ( data , t . getColumnTypes ( ) ) ; fileStreamOut . write ( rowOut . getOutputStream ( ) . getBuffer ( ) , 0 , rowOut . size ( ) ) ; tableRowCount ++ ;
public class Query { /** * < pre > * { array : < array > , elemMatch : < x > } * < / pre > */ public static Query arrayMatch ( String array , Query x ) { } }
Query q = new Query ( false ) ; q . add ( "array" , array ) . add ( "elemMatch" , x . toJson ( ) ) ; return q ;
public class Client { /** * Take an IOException and the address we were trying to connect to * and return an IOException with the input exception as the cause . * The new exception provides the stack trace of the place where * the exception is thrown and some extra diagnostics information . * If the exception is ConnectException or SocketTimeoutException , * return a new one of the same type ; Otherwise return an IOException . * @ param addr target address * @ param exception the relevant exception * @ return an exception to throw */ private IOException wrapException ( InetSocketAddress addr , IOException exception ) { } }
if ( exception instanceof ConnectException ) { // connection refused ; include the host : port in the error return ( ConnectException ) new ConnectException ( "Call to " + addr + " failed on connection exception: " + exception ) . initCause ( exception ) ; } else if ( exception instanceof SocketTimeoutException ) { return ( SocketTimeoutException ) new SocketTimeoutException ( "Call to " + addr + " failed on socket timeout exception: " + exception ) . initCause ( exception ) ; } else if ( exception instanceof NoRouteToHostException ) { return ( NoRouteToHostException ) new NoRouteToHostException ( "Call to " + addr + " failed on NoRouteToHostException exception: " + exception ) . initCause ( exception ) ; } else if ( exception instanceof PortUnreachableException ) { return ( PortUnreachableException ) new PortUnreachableException ( "Call to " + addr + " failed on PortUnreachableException exception: " + exception ) . initCause ( exception ) ; } else if ( exception instanceof EOFException ) { return ( EOFException ) new EOFException ( "Call to " + addr + " failed on EOFException exception: " + exception ) . initCause ( exception ) ; } else { return ( IOException ) new IOException ( "Call to " + addr + " failed on local exception: " + exception ) . initCause ( exception ) ; }
public class DestinationManager { /** * Indicates whether the async deletion thread should be startable or not . * @ param isStartable */ private void setIsAsyncDeletionThreadStartable ( boolean isStartable ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setIsAsyncDeletionThreadStartable" , new Boolean ( isStartable ) ) ; synchronized ( deletionThreadLock ) { _isAsyncDeletionThreadStartable = isStartable ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setIsAsyncDeletionThreadStartable" ) ;
public class CmsExplorerTypeSettings { /** * Sets the key name of the explorer type setting . < p > * @ param key the key name of the explorer type setting */ public void setKey ( String key ) { } }
m_key = key ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_SET_KEY_1 , key ) ) ; }
public class ArgumentUnitUtils { /** * Sets the property * @ param argumentUnit argument component * @ param propertyName property name * @ param propertyValue property value * @ return the previous value of the specified key in this property * list , or { @ code null } if it did not have one . */ public static String setProperty ( ArgumentUnit argumentUnit , String propertyName , String propertyValue ) { } }
Properties properties = ArgumentUnitUtils . getProperties ( argumentUnit ) ; String result = ( String ) properties . setProperty ( propertyName , propertyValue ) ; ArgumentUnitUtils . setProperties ( argumentUnit , properties ) ; return result ;
public class TagFactory { /** * Will add values from params map except the exceptions . * @ param params map with values . Key used as an attribute name , value as value . * @ param exceptions list of excepted keys . */ public void addAttributesExcept ( Map params , String ... exceptions ) { } }
List exceptionList = Arrays . asList ( exceptions ) ; for ( Object key : params . keySet ( ) ) { if ( ! exceptionList . contains ( key ) ) { attribute ( key . toString ( ) , params . get ( key ) . toString ( ) ) ; } }
public class JSONWriter { /** * / * Other internal methods */ private void _badType ( int type , Object value ) { } }
if ( type < 0 ) { throw new IllegalStateException ( String . format ( "Internal error: missing BeanDefinition for id %d (class %s)" , type , value . getClass ( ) . getName ( ) ) ) ; } String typeDesc = ( value == null ) ? "NULL" : value . getClass ( ) . getName ( ) ; throw new IllegalStateException ( String . format ( "Unsupported type: %s (%s)" , type , typeDesc ) ) ;
public class N { /** * Returns a new array with removes all the occurrences of specified elements from < code > a < / code > * @ param a * @ param elements * @ return * @ see Collection # removeAll ( Collection ) */ @ SafeVarargs public static char [ ] removeAll ( final char [ ] a , final char ... elements ) { } }
if ( N . isNullOrEmpty ( a ) ) { return N . EMPTY_CHAR_ARRAY ; } else if ( N . isNullOrEmpty ( elements ) ) { return a . clone ( ) ; } else if ( elements . length == 1 ) { return removeAllOccurrences ( a , elements [ 0 ] ) ; } final CharList list = CharList . of ( a . clone ( ) ) ; list . removeAll ( CharList . of ( elements ) ) ; return list . trimToSize ( ) . array ( ) ;
public class SARLValidator { /** * Check if all the fields are initialized in a SARL behavior . * @ param behavior the behavior . */ @ Check public void checkFinalFieldInitialization ( SarlBehavior behavior ) { } }
final JvmGenericType inferredType = this . associations . getInferredType ( behavior ) ; if ( inferredType != null ) { checkFinalFieldInitialization ( inferredType ) ; }
public class CommerceTaxFixedRateAddressRelPersistenceImpl { /** * Returns the last commerce tax fixed rate address rel in the ordered set where CPTaxCategoryId = & # 63 ; . * @ param CPTaxCategoryId the cp tax category ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the last matching commerce tax fixed rate address rel * @ throws NoSuchTaxFixedRateAddressRelException if a matching commerce tax fixed rate address rel could not be found */ @ Override public CommerceTaxFixedRateAddressRel findByCPTaxCategoryId_Last ( long CPTaxCategoryId , OrderByComparator < CommerceTaxFixedRateAddressRel > orderByComparator ) throws NoSuchTaxFixedRateAddressRelException { } }
CommerceTaxFixedRateAddressRel commerceTaxFixedRateAddressRel = fetchByCPTaxCategoryId_Last ( CPTaxCategoryId , orderByComparator ) ; if ( commerceTaxFixedRateAddressRel != null ) { return commerceTaxFixedRateAddressRel ; } StringBundler msg = new StringBundler ( 4 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "CPTaxCategoryId=" ) ; msg . append ( CPTaxCategoryId ) ; msg . append ( "}" ) ; throw new NoSuchTaxFixedRateAddressRelException ( msg . toString ( ) ) ;
public class ValidatedInputView { /** * Validates the input data and updates the icon . DataType must be set . * @ param validateEmptyFields if an empty input should be considered invalid . * @ return whether the data is valid or not . */ protected boolean validate ( boolean validateEmptyFields ) { } }
boolean isValid = false ; String value = dataType == PASSWORD ? getText ( ) : getText ( ) . trim ( ) ; if ( ! validateEmptyFields && value . isEmpty ( ) ) { return true ; } switch ( dataType ) { case TEXT_NAME : case NUMBER : case PASSWORD : case NON_EMPTY_USERNAME : isValid = ! value . isEmpty ( ) ; break ; case EMAIL : isValid = value . matches ( EMAIL_REGEX ) ; break ; case USERNAME : isValid = value . matches ( USERNAME_REGEX ) && value . length ( ) >= 1 && value . length ( ) <= 15 ; break ; case USERNAME_OR_EMAIL : final boolean validEmail = value . matches ( EMAIL_REGEX ) ; final boolean validUsername = value . matches ( USERNAME_REGEX ) && value . length ( ) >= 1 && value . length ( ) <= 15 ; isValid = validEmail || validUsername ; break ; case MOBILE_PHONE : case PHONE_NUMBER : isValid = value . matches ( PHONE_NUMBER_REGEX ) ; break ; case MFA_CODE : isValid = value . matches ( CODE_REGEX ) ; break ; } Log . v ( TAG , "Field validation results: Is valid? " + isValid ) ; return isValid ;
public class AbstractAmazonDynamoDBAsync { /** * Simplified method form for invoking the ListTables operation . * @ see # listTablesAsync ( ListTablesRequest ) */ @ Override public java . util . concurrent . Future < ListTablesResult > listTablesAsync ( Integer limit ) { } }
return listTablesAsync ( new ListTablesRequest ( ) . withLimit ( limit ) ) ;
public class Screen { /** * Get the command string that will restore this screen . * @ return The URL for this screen . */ public String getScreenURL ( ) { } }
String strURL = super . getScreenURL ( ) ; if ( this . getClass ( ) . getName ( ) . equals ( Screen . class . getName ( ) ) ) { strURL = this . addURLParam ( strURL , DBParams . RECORD , this . getMainRecord ( ) . getClass ( ) . getName ( ) ) ; strURL = this . addURLParam ( strURL , DBParams . COMMAND , ThinMenuConstants . FORM ) ; } else strURL = this . addURLParam ( strURL , DBParams . SCREEN , this . getClass ( ) . getName ( ) ) ; try { if ( this . getMainRecord ( ) != null ) if ( ( this . getMainRecord ( ) . getEditMode ( ) == Constants . EDIT_IN_PROGRESS ) || ( this . getMainRecord ( ) . getEditMode ( ) == Constants . EDIT_CURRENT ) ) { String strBookmark = DBConstants . BLANK ; if ( this . getMainRecord ( ) . getHandle ( DBConstants . OBJECT_ID_HANDLE ) != null ) strBookmark = this . getMainRecord ( ) . getHandle ( DBConstants . OBJECT_ID_HANDLE ) . toString ( ) ; strURL = this . addURLParam ( strURL , DBConstants . STRING_OBJECT_ID_HANDLE , strBookmark ) ; } } catch ( DBException ex ) { ex . printStackTrace ( ) ; } return strURL ;
public class TypeConver { /** * 根据类型描述获取对应的Class * @ param type 类型描述 * @ return 对应的Class * @ throws ClassNotFoundException 无法找到对应的类 */ @ SuppressWarnings ( "rawtypes" ) public static Class getTypeClass ( String type ) throws ClassNotFoundException { } }
Class clazz = null ; if ( type . equals ( "int" ) ) { clazz = int . class ; } else if ( type . equals ( "boolean" ) ) { clazz = boolean . class ; } else if ( type . equals ( "float" ) ) { clazz = float . class ; } else if ( type . equals ( "double" ) ) { clazz = double . class ; } else if ( type . equals ( "short" ) ) { clazz = short . class ; } else if ( type . equals ( "char" ) ) { clazz = char . class ; } else if ( type . equals ( "long" ) ) { clazz = long . class ; } else if ( type . equals ( "byte" ) ) { clazz = byte . class ; } else { clazz = Class . forName ( type ) ; } return clazz ;
public class LinkFieldUpdater { /** * Delete all possible term rows that might exist for our sharded link . */ private void deleteShardedLinkTermRows ( ) { } }
// When link is shard , its sharded extent table is also sharded . Set < Integer > shardNums = SpiderService . instance ( ) . getShards ( m_invTableDef ) . keySet ( ) ; for ( Integer shardNumber : shardNums ) { m_dbTran . deleteShardedLinkRow ( m_linkDef , m_dbObj . getObjectID ( ) , shardNumber ) ; }
public class UIRepeat { /** * PI45044 start */ @ Override public void restoreState ( FacesContext context , Object state ) { } }
if ( _saveUIDataRowState ) { if ( state == null ) { return ; } Object values [ ] = ( Object [ ] ) state ; super . restoreState ( context , values [ 0 ] ) ; // Object restoredRowStates = UIComponentBase . restoreAttachedState ( context , values [ 1 ] ) ; /* if ( restoredRowStates = = null ) if ( ! _ rowDeltaStates . isEmpty ( ) ) _ rowDeltaStates . clear ( ) ; else _ rowDeltaStates = ( Map < String , Map < String , Object > > ) restoredRowStates ; */ if ( values . length > 2 ) { Object rs = UIComponentBase . restoreAttachedState ( context , values [ 2 ] ) ; if ( rs == null ) { if ( ! _rowStates . isEmpty ( ) ) { _rowStates . clear ( ) ; } } else { _rowStates = ( Map < String , Collection < Object [ ] > > ) rs ; } } } else { super . restoreState ( context , state ) ; }
public class LowercaseEnumTypeAdapterFactory { /** * Transforms the given enum constant to lower case . If a { @ code SerializedName } annotation is present , the default * adapter result is returned . * @ param enumConstant the enumeration constant * @ param delegateAdapter the default adapter of the given type * @ return the transformed string representation of the constant */ private < T > String transform ( T enumConstant , TypeAdapter < T > delegateAdapter ) { } }
try { final String enumValue = ( ( Enum ) enumConstant ) . name ( ) ; final boolean hasSerializedNameAnnotation = enumConstant . getClass ( ) . getField ( enumValue ) . isAnnotationPresent ( SerializedName . class ) ; return hasSerializedNameAnnotation ? delegateAdapter . toJsonTree ( enumConstant ) . getAsString ( ) : enumValue . toLowerCase ( ) ; } catch ( NoSuchFieldException e ) { // should never happen throw new RuntimeException ( e ) ; }
public class Iterables { /** * Removes and returns the first matching element , or returns { @ code null } if there is none . */ @ Nullable static < T > T removeFirstMatching ( Iterable < T > removeFrom , Predicate < ? super T > predicate ) { } }
checkNotNull ( predicate ) ; Iterator < T > iterator = removeFrom . iterator ( ) ; while ( iterator . hasNext ( ) ) { T next = iterator . next ( ) ; if ( predicate . apply ( next ) ) { iterator . remove ( ) ; return next ; } } return null ;
public class DiscreteFourierTransformOps { /** * Performs element - wise complex multiplication between two complex images . * @ param complexA ( Input ) Complex image * @ param complexB ( Input ) Complex image * @ param complexC ( Output ) Complex image */ public static void multiplyComplex ( InterleavedF32 complexA , InterleavedF32 complexB , InterleavedF32 complexC ) { } }
InputSanityCheck . checkSameShape ( complexA , complexB , complexC ) ; for ( int y = 0 ; y < complexA . height ; y ++ ) { int indexA = complexA . startIndex + y * complexA . stride ; int indexB = complexB . startIndex + y * complexB . stride ; int indexC = complexC . startIndex + y * complexC . stride ; for ( int x = 0 ; x < complexA . width ; x ++ , indexA += 2 , indexB += 2 , indexC += 2 ) { float realA = complexA . data [ indexA ] ; float imgA = complexA . data [ indexA + 1 ] ; float realB = complexB . data [ indexB ] ; float imgB = complexB . data [ indexB + 1 ] ; complexC . data [ indexC ] = realA * realB - imgA * imgB ; complexC . data [ indexC + 1 ] = realA * imgB + imgA * realB ; } }
public class AbstractReliefComponentType { /** * Gets the value of the genericApplicationPropertyOfReliefComponent property . * This accessor method returns a reference to the live list , * not a snapshot . Therefore any modification you make to the * returned list will be present inside the JAXB object . * This is why there is not a < CODE > set < / CODE > method for the genericApplicationPropertyOfReliefComponent property . * For example , to add a new item , do as follows : * < pre > * get _ GenericApplicationPropertyOfReliefComponent ( ) . add ( newItem ) ; * < / pre > * Objects of the following type ( s ) are allowed in the list * { @ link JAXBElement } { @ code < } { @ link Object } { @ code > } * { @ link JAXBElement } { @ code < } { @ link Object } { @ code > } */ public List < JAXBElement < Object > > get_GenericApplicationPropertyOfReliefComponent ( ) { } }
if ( _GenericApplicationPropertyOfReliefComponent == null ) { _GenericApplicationPropertyOfReliefComponent = new ArrayList < JAXBElement < Object > > ( ) ; } return this . _GenericApplicationPropertyOfReliefComponent ;
public class AutoMlClient { /** * Deploys a model . If a model is already deployed , deploying it with the same parameters has no * effect . Deploying with different parametrs ( as e . g . changing * < p > [ node _ number ] [ google . cloud . automl . v1beta1 . ImageObjectDetectionModelDeploymentMetadata . node _ number ] * ) will update the deployment without pausing the model ' s availability . * < p > Only applicable for Text Classification , Image Object Detection and Tables ; all other * domains manage deployment automatically . * < p > Returns an empty response in the [ response ] [ google . longrunning . Operation . response ] field * when it completes . * < p > Sample code : * < pre > < code > * try ( AutoMlClient autoMlClient = AutoMlClient . create ( ) ) { * ModelName name = ModelName . of ( " [ PROJECT ] " , " [ LOCATION ] " , " [ MODEL ] " ) ; * autoMlClient . deployModelAsync ( name ) . get ( ) ; * < / code > < / pre > * @ param name Resource name of the model to deploy . * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ @ BetaApi ( "The surface for long-running operations is not stable yet and may change in the future." ) public final OperationFuture < Empty , OperationMetadata > deployModelAsync ( ModelName name ) { } }
DeployModelRequest request = DeployModelRequest . newBuilder ( ) . setName ( name == null ? null : name . toString ( ) ) . build ( ) ; return deployModelAsync ( request ) ;
public class NodeMessageExchange { /** * Process message * @ param operation * @ param data * @ return */ protected Object process ( String operation , Object data ) { } }
Closure < Object , Object > cl = operations . get ( operation ) ; if ( cl != null ) { return cl . call ( data ) ; } return true ;
public class ExtractUtil { /** * Return the response descriptions as String from a JavaDoc comment block . * @ param jdoc The javadoc block comment . * @ return the response descriptions as String */ public static List < String > extractResponseDescription ( JavadocComment jdoc ) { } }
List < String > list = new ArrayList < > ( ) ; list . addAll ( extractDocAnnotation ( DOC_RESPONSE_DESCRIPTION , jdoc ) ) ; return list ;
public class MapListenerAdaptors { /** * Creates a { @ link ListenerAdapter } for a specific { @ link com . hazelcast . core . EntryEventType } . * @ param eventType an { @ link com . hazelcast . core . EntryEventType } . * @ param mapListener a { @ link com . hazelcast . map . listener . MapListener } instance . * @ return { @ link com . hazelcast . map . impl . ListenerAdapter } for a specific { @ link com . hazelcast . core . EntryEventType } */ private static ListenerAdapter createListenerAdapter ( EntryEventType eventType , MapListener mapListener ) { } }
final ConstructorFunction < MapListener , ListenerAdapter > constructorFunction = CONSTRUCTORS . get ( eventType ) ; if ( constructorFunction == null ) { throw new IllegalArgumentException ( "First, define a ListenerAdapter for the event EntryEventType." + eventType ) ; } return constructorFunction . createNew ( mapListener ) ;
public class CmdInformationBatch { /** * Clear error state , used for clear exception after first batch query , when fall back to * per - query execution . */ @ Override public void reset ( ) { } }
insertIds . clear ( ) ; updateCounts . clear ( ) ; insertIdNumber = 0 ; hasException = false ; rewritten = false ;
public class DestructuringGlobalNameExtractor { /** * Given an lvalue in a destructuring pattern , and a detached subtree , rewrites the AST to assign * the lvalue to the subtree instead of its previous value , while preserving the rest of the * destructuring pattern * < p > For example : given stringKey : ' y ' and newName : ' new . name ' , where ' y ' is contained in the * declaration ` const { x , y , z } = original ; ` , this method will produce ` const { x } = original ; * const y = new . name ; const { z } = original ; ` * < p > This method only handles a limited subset of destructuring patterns and is intended only for * CollapseProperties and AggressiveInlineAliases . Preconditions are : * < ul > * < li > the pattern must be the lhs of an assignment or declaration ( e . g . not a nested pattern ) * < li > the original rvalue for the pattern must be an effectively constant qualified name . it is * safe to evaluate the rvalue multiple times . * < / ul > * @ param stringKey the STRING _ KEY node representing the ref to rewrite , e . g . ` y ` * @ param newName what the lvalue in the STRING _ KEY should now be assigned to , e . g . foo . bar * @ param newNodes optionally a set to add new AstChanges to , if you need to keep the * GlobalNamespace up - to - date . Otherwise null . * @ param ref the Ref corresponding to the ` stringKey ` */ static void reassignDestructringLvalue ( Node stringKey , Node newName , @ Nullable Set < AstChange > newNodes , Ref ref , AbstractCompiler compiler ) { } }
Node pattern = stringKey . getParent ( ) ; Node assignmentType = pattern . getParent ( ) ; checkState ( assignmentType . isAssign ( ) || assignmentType . isDestructuringLhs ( ) , assignmentType ) ; Node originalRvalue = pattern . getNext ( ) ; // e . g . ` original ` checkState ( originalRvalue . isQualifiedName ( ) ) ; // don ' t handle rvalues with side effects // Create a new assignment using the provided qualified name , e . g . ` const y = new . name ; ` Node lvalueToReassign = stringKey . getOnlyChild ( ) . isDefaultValue ( ) ? stringKey . getOnlyChild ( ) . getFirstChild ( ) : stringKey . getOnlyChild ( ) ; if ( newNodes != null ) { newNodes . add ( new AstChange ( ref . module , ref . scope , newName ) ) ; } Node rvalue = makeNewRvalueForDestructuringKey ( stringKey , newName , newNodes , ref ) ; // Add that new assignment to the AST after the original destructuring pattern if ( stringKey . getPrevious ( ) == null && stringKey . getNext ( ) != null ) { // Remove the original item completely if the given string key doesn ' t have any preceding // string keys , / and / it has succeeding string keys . replaceDestructuringAssignment ( pattern , lvalueToReassign . detach ( ) , rvalue ) ; } else { addAfter ( pattern , lvalueToReassign . detach ( ) , rvalue ) ; } // Remove any lvalues in the pattern that are after the given stringKey , and put them in // a second destructuring pattern . This is necessary in case they depend on side effects from // assigning ` lvalueToReassign ` . e . g . create ` const { z } = original ; ` if ( stringKey . getNext ( ) != null ) { Node newPattern = createNewObjectPatternFromSuccessiveKeys ( stringKey ) . srcref ( pattern ) ; // reuse the original rvalue if we don ' t need it for earlier keys , otherwise make a copy . final Node newRvalue ; if ( stringKey . getPrevious ( ) == null ) { newRvalue = originalRvalue . detach ( ) ; } else { newRvalue = originalRvalue . cloneTree ( ) ; if ( newNodes != null ) { newNodes . add ( new AstChange ( ref . module , ref . scope , newRvalue ) ) ; } } addAfter ( lvalueToReassign , newPattern , newRvalue ) ; } stringKey . detach ( ) ; compiler . reportChangeToEnclosingScope ( lvalueToReassign ) ;
public class DependencyFinder { /** * Gets the file of the dependency with the given artifact id from the project dependencies and if not found from * the plugin dependencies . This method also check the extension . * @ param mojo the mojo * @ param artifactId the name of the artifact to find * @ param type the extension of the artifact to find * @ return the artifact file , null if not found */ public static File getArtifactFile ( AbstractWisdomMojo mojo , String artifactId , String type ) { } }
File file = getArtifactFileFromProjectDependencies ( mojo , artifactId , type ) ; if ( file == null ) { file = getArtifactFileFromPluginDependencies ( mojo , artifactId , type ) ; } return file ;
public class UserTransactionProviderImpl { /** * Set the user transaction registry * @ param v The value */ public void setTransactionRegistry ( org . jboss . tm . usertx . UserTransactionRegistry v ) { } }
( ( org . jboss . tm . usertx . UserTransactionProvider ) utp ) . setTransactionRegistry ( v ) ;
public class Instrumentation { /** * < code > optional string report _ defined = 1 ; < / code > * < pre > * name of function ( ID = & lt ; numeric function id & gt ; ) ; * used to inform the harness about the contents of a module * < / pre > */ public com . google . protobuf . ByteString getReportDefinedBytes ( ) { } }
java . lang . Object ref = reportDefined_ ; if ( ref instanceof java . lang . String ) { com . google . protobuf . ByteString b = com . google . protobuf . ByteString . copyFromUtf8 ( ( java . lang . String ) ref ) ; reportDefined_ = b ; return b ; } else { return ( com . google . protobuf . ByteString ) ref ; }
public class Parser { /** * called for inner parses for list items and blockquotes */ public RootNode parseInternal ( StringBuilderVar block ) { } }
char [ ] chars = block . getChars ( ) ; int [ ] ixMap = new int [ chars . length + 1 ] ; // map of cleaned indices to original indices // strip out CROSSED _ OUT characters and build index map StringBuilder clean = new StringBuilder ( ) ; for ( int i = 0 ; i < chars . length ; i ++ ) { char c = chars [ i ] ; if ( c != CROSSED_OUT ) { ixMap [ clean . length ( ) ] = i ; clean . append ( c ) ; } } ixMap [ clean . length ( ) ] = chars . length ; // run inner parse char [ ] cleaned = new char [ clean . length ( ) ] ; clean . getChars ( 0 , cleaned . length , cleaned , 0 ) ; RootNode rootNode = parseInternal ( cleaned ) ; // correct AST indices with index map fixIndices ( rootNode , ixMap ) ; return rootNode ;
public class ObjectWritable { /** * Read a { @ link Writable } , { @ link String } , primitive type , or an array of * the preceding . */ public static Object readObject ( DataInput in , Configuration conf ) throws IOException { } }
return readObject ( in , null , conf ) ;
public class Invariants { /** * An { @ code int } specialized version of { @ link # checkInvariant ( Object , * ContractConditionType ) } . * @ param value The value * @ param predicate The predicate * @ param describer The describer for the predicate * @ return value * @ throws InvariantViolationException If the predicate is false */ public static int checkInvariantI ( final int value , final IntPredicate predicate , final IntFunction < String > describer ) { } }
final boolean ok ; try { ok = predicate . test ( value ) ; } catch ( final Throwable e ) { final Violations violations = singleViolation ( failedPredicate ( e ) ) ; throw new InvariantViolationException ( failedMessage ( Integer . valueOf ( value ) , violations ) , e , violations . count ( ) ) ; } return innerCheckInvariantI ( value , ok , describer ) ;
public class MixinParentNode { /** * Replaces the child at the given index with the given new child . * @ param index The index of the child to replace . * @ param newChild The new child . */ public void replaceChild ( int index , N newChild ) { } }
checkNotNull ( newChild ) ; tryRemoveFromOldParent ( newChild ) ; N oldChild = children . set ( index , newChild ) ; oldChild . setParent ( null ) ; newChild . setParent ( master ) ;
public class KieServerHttpRequest { /** * Encode the given URL as an ASCII { @ link String } * This method ensures the path and query segments of the URL are properly encoded such as ' ' characters being encoded to ' % 20' * or any UTF - 8 characters that are non - ASCII . No encoding of URLs is done by default by the { @ link KieServerHttpRequest } * constructors and so if URL encoding is needed this method should be called before calling the { @ link KieServerHttpRequest } * constructor . * @ param url * @ return encoded URL * @ throws KieServerHttpRequestException */ static String encodeUrlToUTF8 ( final CharSequence url ) throws KieServerHttpRequestException { } }
URL parsed ; try { parsed = new URL ( url . toString ( ) ) ; } catch ( IOException ioe ) { throw new KieServerHttpRequestException ( "Unable to encode url '" + url . toString ( ) + "'" , ioe ) ; } String host = parsed . getHost ( ) ; int port = parsed . getPort ( ) ; if ( port != - 1 ) host = host + ':' + Integer . toString ( port ) ; try { String encoded = new URI ( parsed . getProtocol ( ) , host , parsed . getPath ( ) , parsed . getQuery ( ) , null ) . toASCIIString ( ) ; int paramsStart = encoded . indexOf ( '?' ) ; if ( paramsStart > 0 && paramsStart + 1 < encoded . length ( ) ) encoded = encoded . substring ( 0 , paramsStart + 1 ) + encoded . substring ( paramsStart + 1 ) . replace ( "+" , "%2B" ) ; return encoded ; } catch ( URISyntaxException e ) { KieServerHttpRequestException krhre = new KieServerHttpRequestException ( "Unable to parse parse URI" , e ) ; throw krhre ; }
public class CharOperation { /** * Answers true if the array contains an occurrence of one of the characters , false otherwise . < br > * < br > * For example : * < ol > * < li > * < pre > * characters = { ' c ' , ' d ' } * array = { ' a ' , ' b ' } * result = & gt ; false * < / pre > * < / li > * < li > * < pre > * characters = { ' c ' , ' d ' } * array = { ' a ' , ' b ' , ' c ' } * result = & gt ; true * < / pre > * < / li > * < / ol > * @ param characters * the characters to search * @ param array * the array in which the search is done * @ return true if the array contains an occurrence of one of the characters , false otherwise . * @ throws NullPointerException * if array is null . */ public static final boolean contains ( char [ ] characters , char [ ] array ) { } }
for ( int i = array . length ; -- i >= 0 ; ) { for ( int j = characters . length ; -- j >= 0 ; ) { if ( array [ i ] == characters [ j ] ) { return true ; } } } return false ;
public class AWSStorageGatewayClient { /** * Resets all cache disks that have encountered a error and makes the disks available for reconfiguration as cache * storage . If your cache disk encounters a error , the gateway prevents read and write operations on virtual tapes * in the gateway . For example , an error can occur when a disk is corrupted or removed from the gateway . When a * cache is reset , the gateway loses its cache storage . At this point you can reconfigure the disks as cache disks . * This operation is only supported in the cached volume and tape types . * < important > * If the cache disk you are resetting contains data that has not been uploaded to Amazon S3 yet , that data can be * lost . After you reset cache disks , there will be no configured cache disks left in the gateway , so you must * configure at least one new cache disk for your gateway to function properly . * < / important > * @ param resetCacheRequest * @ return Result of the ResetCache operation returned by the service . * @ throws InvalidGatewayRequestException * An exception occurred because an invalid gateway request was issued to the service . For more information , * see the error and message fields . * @ throws InternalServerErrorException * An internal server error has occurred during the request . For more information , see the error and message * fields . * @ sample AWSStorageGateway . ResetCache * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / storagegateway - 2013-06-30 / ResetCache " target = " _ top " > AWS API * Documentation < / a > */ @ Override public ResetCacheResult resetCache ( ResetCacheRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeResetCache ( request ) ;
public class MOEADSTM { /** * Select the next parent population , based on the stable matching criteria */ public void stmSelection ( ) { } }
int [ ] idx = new int [ populationSize ] ; double [ ] nicheCount = new double [ populationSize ] ; int [ ] [ ] solPref = new int [ jointPopulation . size ( ) ] [ ] ; double [ ] [ ] solMatrix = new double [ jointPopulation . size ( ) ] [ ] ; double [ ] [ ] distMatrix = new double [ jointPopulation . size ( ) ] [ ] ; double [ ] [ ] fitnessMatrix = new double [ jointPopulation . size ( ) ] [ ] ; for ( int i = 0 ; i < jointPopulation . size ( ) ; i ++ ) { solPref [ i ] = new int [ populationSize ] ; solMatrix [ i ] = new double [ populationSize ] ; distMatrix [ i ] = new double [ populationSize ] ; fitnessMatrix [ i ] = new double [ populationSize ] ; } int [ ] [ ] subpPref = new int [ populationSize ] [ ] ; double [ ] [ ] subpMatrix = new double [ populationSize ] [ ] ; for ( int i = 0 ; i < populationSize ; i ++ ) { subpPref [ i ] = new int [ jointPopulation . size ( ) ] ; subpMatrix [ i ] = new double [ jointPopulation . size ( ) ] ; } // Calculate the preference values of solution matrix for ( int i = 0 ; i < jointPopulation . size ( ) ; i ++ ) { int minIndex = 0 ; for ( int j = 0 ; j < populationSize ; j ++ ) { fitnessMatrix [ i ] [ j ] = fitnessFunction ( jointPopulation . get ( i ) , lambda [ j ] ) ; distMatrix [ i ] [ j ] = calculateDistance2 ( jointPopulation . get ( i ) , lambda [ j ] ) ; if ( distMatrix [ i ] [ j ] < distMatrix [ i ] [ minIndex ] ) { minIndex = j ; } } nicheCount [ minIndex ] = nicheCount [ minIndex ] + 1 ; } // calculate the preference values of subproblem matrix and solution matrix for ( int i = 0 ; i < jointPopulation . size ( ) ; i ++ ) { for ( int j = 0 ; j < populationSize ; j ++ ) { subpMatrix [ j ] [ i ] = fitnessFunction ( jointPopulation . get ( i ) , lambda [ j ] ) ; solMatrix [ i ] [ j ] = distMatrix [ i ] [ j ] + nicheCount [ j ] ; } } // sort the preference value matrix to get the preference rank matrix for ( int i = 0 ; i < populationSize ; i ++ ) { for ( int j = 0 ; j < jointPopulation . size ( ) ; j ++ ) { subpPref [ i ] [ j ] = j ; } MOEADUtils . quickSort ( subpMatrix [ i ] , subpPref [ i ] , 0 , jointPopulation . size ( ) - 1 ) ; } for ( int i = 0 ; i < jointPopulation . size ( ) ; i ++ ) { for ( int j = 0 ; j < populationSize ; j ++ ) { solPref [ i ] [ j ] = j ; } MOEADUtils . quickSort ( solMatrix [ i ] , solPref [ i ] , 0 , populationSize - 1 ) ; } idx = stableMatching ( subpPref , solPref , populationSize , jointPopulation . size ( ) ) ; population . clear ( ) ; for ( int i = 0 ; i < populationSize ; i ++ ) { population . add ( i , jointPopulation . get ( idx [ i ] ) ) ; }
public class AbstractEndpointComponent { /** * Sets properties on endpoint configuration using method reflection . * @ param endpointConfiguration * @ param parameters * @ param context */ protected void enrichEndpointConfiguration ( EndpointConfiguration endpointConfiguration , Map < String , String > parameters , TestContext context ) { } }
for ( Map . Entry < String , String > parameterEntry : parameters . entrySet ( ) ) { Field field = ReflectionUtils . findField ( endpointConfiguration . getClass ( ) , parameterEntry . getKey ( ) ) ; if ( field == null ) { throw new CitrusRuntimeException ( String . format ( "Unable to find parameter field on endpoint configuration '%s'" , parameterEntry . getKey ( ) ) ) ; } Method setter = ReflectionUtils . findMethod ( endpointConfiguration . getClass ( ) , "set" + parameterEntry . getKey ( ) . substring ( 0 , 1 ) . toUpperCase ( ) + parameterEntry . getKey ( ) . substring ( 1 ) , field . getType ( ) ) ; if ( setter == null ) { throw new CitrusRuntimeException ( String . format ( "Unable to find parameter setter on endpoint configuration '%s'" , "set" + parameterEntry . getKey ( ) . substring ( 0 , 1 ) . toUpperCase ( ) + parameterEntry . getKey ( ) . substring ( 1 ) ) ) ; } if ( parameterEntry . getValue ( ) != null ) { ReflectionUtils . invokeMethod ( setter , endpointConfiguration , TypeConversionUtils . convertStringToType ( parameterEntry . getValue ( ) , field . getType ( ) , context ) ) ; } else { ReflectionUtils . invokeMethod ( setter , endpointConfiguration , field . getType ( ) . cast ( null ) ) ; } }
public class PhoneNumber { /** * The phone number associations . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setAssociations ( java . util . Collection ) } or { @ link # withAssociations ( java . util . Collection ) } if you want to * override the existing values . * @ param associations * The phone number associations . * @ return Returns a reference to this object so that method calls can be chained together . */ public PhoneNumber withAssociations ( PhoneNumberAssociation ... associations ) { } }
if ( this . associations == null ) { setAssociations ( new java . util . ArrayList < PhoneNumberAssociation > ( associations . length ) ) ; } for ( PhoneNumberAssociation ele : associations ) { this . associations . add ( ele ) ; } return this ;
public class HttpClientResourceAdaptor { /** * ( non - Javadoc ) * @ see javax . slee . resource . ResourceAdaptor # raActive ( ) */ public void raActive ( ) { } }
activities = new ConcurrentHashMap < HttpClientActivityHandle , HttpClientActivity > ( ) ; executorService = Executors . newCachedThreadPool ( ) ; if ( httpClientFactory != null ) { httpclient = httpClientFactory . newHttpClient ( ) ; } else { HttpParams params = new SyncBasicHttpParams ( ) ; SchemeRegistry schemeRegistry = new SchemeRegistry ( ) ; schemeRegistry . register ( new Scheme ( "http" , 80 , PlainSocketFactory . getSocketFactory ( ) ) ) ; schemeRegistry . register ( new Scheme ( "https" , 443 , SSLSocketFactory . getSocketFactory ( ) ) ) ; PoolingClientConnectionManager threadSafeClientConnManager = new PoolingClientConnectionManager ( schemeRegistry ) ; threadSafeClientConnManager . setMaxTotal ( maxTotal ) ; threadSafeClientConnManager . setDefaultMaxPerRoute ( defaultMaxForRoute ) ; for ( Entry < HttpRoute , Integer > entry : maxForRoutes . entrySet ( ) ) { if ( tracer . isInfoEnabled ( ) ) { tracer . info ( String . format ( "Configuring MaxForRoute %s max %d" , entry . getKey ( ) , entry . getValue ( ) ) ) ; } threadSafeClientConnManager . setMaxPerRoute ( entry . getKey ( ) , entry . getValue ( ) ) ; } httpclient = new DefaultHttpClient ( threadSafeClientConnManager , params ) ; ( ( DefaultHttpClient ) httpclient ) . setKeepAliveStrategy ( new ConnectionKeepAliveStrategy ( ) { public long getKeepAliveDuration ( HttpResponse response , HttpContext context ) { // Honor ' keep - alive ' header HeaderElementIterator it = new BasicHeaderElementIterator ( response . headerIterator ( HTTP . CONN_KEEP_ALIVE ) ) ; while ( it . hasNext ( ) ) { HeaderElement he = it . nextElement ( ) ; String param = he . getName ( ) ; String value = he . getValue ( ) ; if ( value != null && param . equalsIgnoreCase ( "timeout" ) ) { try { return Long . parseLong ( value ) * 1000 ; } catch ( NumberFormatException ignore ) { } } } // otherwise keep alive for 30 seconds return 30 * 1000 ; } } ) ; this . idleConnectionMonitorThread = new IdleConnectionMonitorThread ( threadSafeClientConnManager , this . tracer ) ; this . idleConnectionMonitorThread . start ( ) ; } isActive = true ; if ( tracer . isInfoEnabled ( ) ) { tracer . info ( String . format ( "HttpClientResourceAdaptor=%s entity activated." , this . resourceAdaptorContext . getEntityName ( ) ) ) ; }
public class Line { /** * Set the LineColor property * The color with which the line will be drawn . * To update the line on the map use { @ link LineManager # update ( Annotation ) } . * @ param color value for String */ public void setLineColor ( @ ColorInt int color ) { } }
jsonObject . addProperty ( LineOptions . PROPERTY_LINE_COLOR , ColorUtils . colorToRgbaString ( color ) ) ;
public class ReporterBase { /** * Initialize the properties . * @ param name The instance name . * @ param props The properties . */ protected void init ( final String name , final Properties props ) { } }
init = new InitUtil ( "" , props , false ) ; this . name = name ;
public class F4 { /** * Returns a composed function from this function and the specified function that takes the * result of this function . When applying the composed function , this function is applied * first to given parameter and then the specified function is applied to the result of * this function . * @ param f * the function takes the < code > R < / code > type parameter and return < code > T < / code > * type result * @ param < T > * the return type of function { @ code f } * @ return the composed function * @ throws NullPointerException * if < code > f < / code > is null */ public < T > F4 < P1 , P2 , P3 , P4 , T > andThen ( final Function < ? super R , ? extends T > f ) { } }
E . NPE ( f ) ; final Func4 < P1 , P2 , P3 , P4 , R > me = this ; return new F4 < P1 , P2 , P3 , P4 , T > ( ) { @ Override public T apply ( P1 p1 , P2 p2 , P3 p3 , P4 p4 ) { R r = me . apply ( p1 , p2 , p3 , p4 ) ; return f . apply ( r ) ; } } ;
public class SDMath { /** * Compute the 2d confusion matrix of size [ numClasses , numClasses ] from a pair of labels and predictions , both of * which are represented as integer values . This version assumes the number of classes is 1 + max ( max ( labels ) , max ( pred ) ) < br > * For example , if labels = [ 0 , 1 , 1 ] and predicted = [ 0 , 2 , 1 ] then output is : < br > * [ 1 , 0 , 0 ] < br > * [ 0 , 1 , 1 ] < br > * [ 0 , 0 , 0 ] < br > * @ param name Name of the output variable * @ param labels Labels - 1D array of integer values representing label values * @ param pred Predictions - 1D array of integer values representing predictions . Same length as labels * @ return Output variable ( 2D , shape [ numClasses , numClasses } ) */ public SDVariable confusionMatrix ( String name , SDVariable labels , SDVariable pred , DataType dataType ) { } }
validateInteger ( "confusionMatrix" , "labels" , labels ) ; validateInteger ( "confusionMatrix" , "prediction" , pred ) ; SDVariable result = f ( ) . confusionMatrix ( labels , pred , dataType ) ; return updateVariableNameAndReference ( result , name ) ;
public class CmsGalleryField { /** * Sets the widget value . < p > * @ param value the value to set * @ param fireEvent if the change event should be fired */ protected void setValue ( String value , boolean fireEvent ) { } }
m_textbox . setValue ( value ) ; updateUploadTarget ( CmsResource . getFolderPath ( value ) ) ; updateResourceInfo ( value ) ; m_previousValue = value ; if ( fireEvent ) { fireChange ( true ) ; }
public class TimePickerSettings { /** * zApplyMinimumToggleTimeMenuButtonWidthInPixels , This applies the specified setting to the * time picker . */ void zApplyMinimumToggleTimeMenuButtonWidthInPixels ( ) { } }
if ( parent == null ) { return ; } Dimension menuButtonPreferredSize = parent . getComponentToggleTimeMenuButton ( ) . getPreferredSize ( ) ; int width = menuButtonPreferredSize . width ; int height = menuButtonPreferredSize . height ; int minimumWidth = minimumToggleTimeMenuButtonWidthInPixels ; width = ( width < minimumWidth ) ? minimumWidth : width ; Dimension newSize = new Dimension ( width , height ) ; parent . getComponentToggleTimeMenuButton ( ) . setPreferredSize ( newSize ) ;
public class DialogRootView { /** * Adds the areas , which are contained by the dialog , to the root view . */ private void addAreas ( ) { } }
if ( areas != null ) { removeAllViews ( ) ; scrollView = null ; topDivider = null ; bottomDivider = null ; Area previousArea = null ; boolean canAddTopDivider = false ; for ( Map . Entry < Area , View > entry : areas . entrySet ( ) ) { Area area = entry . getKey ( ) ; View view = entry . getValue ( ) ; if ( scrollableArea . isScrollable ( area ) ) { if ( topDivider == null && canAddTopDivider && ! scrollableArea . isScrollable ( previousArea ) ) { topDivider = addDivider ( ) ; } inflateScrollView ( scrollableArea ) ; ViewGroup scrollContainer = scrollView . getChildCount ( ) > 0 ? ( ViewGroup ) scrollView . getChildAt ( 0 ) : scrollView ; view . getViewTreeObserver ( ) . addOnGlobalLayoutListener ( createScrollViewChildLayoutListener ( ) ) ; scrollContainer . addView ( view ) ; } else { if ( bottomDivider == null && previousArea != null && scrollableArea . getBottomScrollableArea ( ) != null && scrollableArea . getBottomScrollableArea ( ) . getIndex ( ) < area . getIndex ( ) && view . getVisibility ( ) == View . VISIBLE && area != Area . BUTTON_BAR ) { bottomDivider = addDivider ( ) ; } addView ( view ) ; } canAddTopDivider |= area != Area . HEADER && view . getVisibility ( ) == View . VISIBLE ; previousArea = area ; } adaptAreaPadding ( ) ; findListView ( ) ; }
public class VEvent { /** * Sets whether an event is visible to free / busy time searches . * @ param transparent true to hide the event , false to make it visible it , * or null to remove the property * @ return the property that was created * @ see < a href = " http : / / tools . ietf . org / html / rfc5545 # page - 101 " > RFC 5545 * p . 101-2 < / a > * @ see < a href = " http : / / tools . ietf . org / html / rfc2445 # page - 96 " > RFC 2445 * p . 96-7 < / a > * @ see < a href = " http : / / www . imc . org / pdi / vcal - 10 . doc " > vCal 1.0 p . 36-7 < / a > */ public Transparency setTransparency ( Boolean transparent ) { } }
Transparency prop = null ; if ( transparent != null ) { prop = transparent ? Transparency . transparent ( ) : Transparency . opaque ( ) ; } setTransparency ( prop ) ; return prop ;
public class CircuitBreakerBuilder { /** * Adds a { @ link CircuitBreakerListener } . */ public CircuitBreakerBuilder listener ( CircuitBreakerListener listener ) { } }
requireNonNull ( listener , "listener" ) ; if ( listeners . isEmpty ( ) ) { listeners = new ArrayList < > ( 3 ) ; } listeners . add ( listener ) ; return this ;
public class PeerGroup { /** * Creates a version message to send , constructs a Peer object and attempts to connect it . Returns the peer on * success or null on failure . * @ param address Remote network address * @ param incrementMaxConnections Whether to consider this connection an attempt to fill our quota , or something * explicitly requested . * @ return Peer or null . */ @ Nullable @ GuardedBy ( "lock" ) protected Peer connectTo ( PeerAddress address , boolean incrementMaxConnections , int connectTimeoutMillis ) { } }
checkState ( lock . isHeldByCurrentThread ( ) ) ; VersionMessage ver = getVersionMessage ( ) . duplicate ( ) ; ver . bestHeight = chain == null ? 0 : chain . getBestChainHeight ( ) ; ver . time = Utils . currentTimeSeconds ( ) ; ver . receivingAddr = address ; ver . receivingAddr . setParent ( ver ) ; Peer peer = createPeer ( address , ver ) ; peer . addConnectedEventListener ( Threading . SAME_THREAD , startupListener ) ; peer . addDisconnectedEventListener ( Threading . SAME_THREAD , startupListener ) ; peer . setMinProtocolVersion ( vMinRequiredProtocolVersion ) ; pendingPeers . add ( peer ) ; try { log . info ( "Attempting connection to {} ({} connected, {} pending, {} max)" , address , peers . size ( ) , pendingPeers . size ( ) , maxConnections ) ; ListenableFuture < SocketAddress > future = channels . openConnection ( address . toSocketAddress ( ) , peer ) ; if ( future . isDone ( ) ) Uninterruptibles . getUninterruptibly ( future ) ; } catch ( ExecutionException e ) { Throwable cause = Throwables . getRootCause ( e ) ; log . warn ( "Failed to connect to " + address + ": " + cause . getMessage ( ) ) ; handlePeerDeath ( peer , cause ) ; return null ; } peer . setSocketTimeout ( connectTimeoutMillis ) ; // When the channel has connected and version negotiated successfully , handleNewPeer will end up being called on // a worker thread . if ( incrementMaxConnections ) { // We don ' t use setMaxConnections here as that would trigger a recursive attempt to establish a new // outbound connection . maxConnections ++ ; } return peer ;
public class BucketFlusher { /** * Flush the bucket and make sure flush is complete before completing the observable . * @ param core the core reference . * @ param bucket the bucket to flush . * @ param username the user authorized for the bucket . * @ param password the password of the user . * @ return an observable which is completed once the flush process is done . */ public static Observable < Boolean > flush ( final ClusterFacade core , final String bucket , final String username , final String password ) { } }
return createMarkerDocuments ( core , bucket ) . flatMap ( new Func1 < List < String > , Observable < Boolean > > ( ) { @ Override public Observable < Boolean > call ( List < String > strings ) { return initiateFlush ( core , bucket , username , password ) ; } } ) . flatMap ( new Func1 < Boolean , Observable < Boolean > > ( ) { @ Override public Observable < Boolean > call ( Boolean isDone ) { return isDone ? Observable . just ( true ) : pollMarkerDocuments ( core , bucket ) ; } } ) ;
public class RubyIO { /** * Writes a line in the file . * @ param words * to write a line * @ throws IllegalStateException * if file is not writable */ public void puts ( String words ) { } }
if ( mode . isWritable ( ) == false ) throw new IllegalStateException ( "IOError: not opened for writing" ) ; try { raFile . write ( words . getBytes ( ) ) ; raFile . writeBytes ( System . getProperty ( "line.separator" ) ) ; } catch ( IOException e ) { logger . log ( Level . SEVERE , null , e ) ; throw new RuntimeException ( e ) ; }
public class RegExUtil { /** * get all allowed characters which can be part of a String which matches a given regular * expression . TODO : this is a first feature incomplete implementation , has to be improved . * @ param pregEx string contains a regular expression pattern * @ return string with all characters that can be part of a string that matches the regex */ public static String getAllowedCharactersForRegEx ( final String pregEx ) { } }
if ( StringUtils . isEmpty ( pregEx ) ) { return null ; } final StringBuilder regExCheck = new StringBuilder ( ) ; final StringBuilder regExCheckOut = new StringBuilder ( ) ; boolean inSequence = false ; boolean isNegativeSequence = false ; boolean inSize = false ; boolean isMasked = false ; regExCheck . append ( "([" ) ; for ( final char character : pregEx . toCharArray ( ) ) { switch ( character ) { case '\\' : if ( isMasked || inSequence ) { regExCheck . append ( character ) ; } if ( ! inSequence ) { isMasked = ! isMasked ; } break ; case '^' : if ( inSequence ) { if ( isMasked ) { regExCheck . append ( character ) ; } else { isNegativeSequence = true ; } } isMasked = false ; break ; case '$' : case '*' : case '+' : case '?' : case '|' : if ( isMasked || inSequence ) { regExCheck . append ( character ) ; } isMasked = false ; break ; case '[' : if ( isMasked || inSequence ) { regExCheck . append ( character ) ; } else { inSequence = true ; isNegativeSequence = false ; } isMasked = false ; break ; case ']' : if ( isMasked ) { regExCheck . append ( character ) ; } else { inSequence = false ; isNegativeSequence = false ; } isMasked = false ; break ; case '{' : if ( isMasked || inSequence ) { regExCheck . append ( character ) ; } else { inSize = true ; } isMasked = false ; break ; case '}' : if ( isMasked || inSequence ) { regExCheck . append ( character ) ; } else { inSize = false ; } isMasked = false ; break ; case '(' : if ( isMasked || inSequence ) { regExCheck . append ( character ) ; } isMasked = false ; break ; case ')' : if ( isMasked || inSequence ) { regExCheck . append ( character ) ; } isMasked = false ; break ; default : if ( inSize ) { if ( character != ',' && ( character < '0' || character > '9' ) ) { regExCheck . append ( character ) ; } } else if ( ! isNegativeSequence ) { if ( isMasked ) { if ( regExCheckOut . length ( ) > 1 ) { regExCheckOut . append ( '|' ) ; } regExCheckOut . append ( '\\' ) ; regExCheckOut . append ( character ) ; } else { regExCheck . append ( character ) ; } } isMasked = false ; break ; } } if ( regExCheck . length ( ) < 3 ) { regExCheck . delete ( 1 , regExCheck . length ( ) ) ; } else { regExCheck . append ( ']' ) ; if ( regExCheckOut . length ( ) > 0 ) { regExCheck . append ( '|' ) ; } } regExCheck . append ( regExCheckOut ) ; regExCheck . append ( ')' ) ; final RegExp regEx = RegExp . compile ( regExCheck . toString ( ) ) ; final StringBuilder result = new StringBuilder ( ) ; for ( int count = Character . MIN_VALUE ; count < Character . MAX_VALUE ; count ++ ) { if ( regEx . exec ( String . valueOf ( ( char ) count ) ) != null ) { result . append ( ( char ) count ) ; } } return result . toString ( ) ;
public class ContractsApi { /** * Get contract items Lists items of a particular contract - - - This route is * cached for up to 3600 seconds SSO Scope : * esi - contracts . read _ corporation _ contracts . v1 SSO Scope : * esi - contracts . read _ character _ contracts . v1 * @ param characterId * An EVE character ID ( required ) * @ param contractId * ID of a contract ( required ) * @ param datasource * The server name you would like data from ( optional , default to * tranquility ) * @ param ifNoneMatch * ETag from a previous request . A 304 will be returned if this * matches the current ETag ( optional ) * @ param token * Access token to use if unable to set a header ( optional ) * @ return List & lt ; CharacterContractsItemsResponse & gt ; * @ throws ApiException * If fail to call the API , e . g . server error or cannot * deserialize the response body */ public List < CharacterContractsItemsResponse > getCharactersCharacterIdContractsContractIdItems ( Integer characterId , Integer contractId , String datasource , String ifNoneMatch , String token ) throws ApiException { } }
ApiResponse < List < CharacterContractsItemsResponse > > resp = getCharactersCharacterIdContractsContractIdItemsWithHttpInfo ( characterId , contractId , datasource , ifNoneMatch , token ) ; return resp . getData ( ) ;
public class PGbytea { /** * Converts a java byte [ ] into a PG bytea string ( i . e . the text representation of the bytea data * type ) */ public static String toPGString ( byte [ ] buf ) { } }
if ( buf == null ) { return null ; } StringBuilder stringBuilder = new StringBuilder ( 2 * buf . length ) ; for ( byte element : buf ) { int elementAsInt = ( int ) element ; if ( elementAsInt < 0 ) { elementAsInt = 256 + elementAsInt ; } // we escape the same non - printable characters as the backend // we must escape all 8bit characters otherwise when convering // from java unicode to the db character set we may end up with // question marks if the character set is SQL _ ASCII if ( elementAsInt < 040 || elementAsInt > 0176 ) { // escape charcter with the form \ 000 , but need two \ \ because of // the Java parser stringBuilder . append ( "\\" ) ; stringBuilder . append ( ( char ) ( ( ( elementAsInt >> 6 ) & 0x3 ) + 48 ) ) ; stringBuilder . append ( ( char ) ( ( ( elementAsInt >> 3 ) & 0x7 ) + 48 ) ) ; stringBuilder . append ( ( char ) ( ( elementAsInt & 0x07 ) + 48 ) ) ; } else if ( element == ( byte ) '\\' ) { // escape the backslash character as \ \ , but need four \ \ \ \ because // of the Java parser stringBuilder . append ( "\\\\" ) ; } else { // other characters are left alone stringBuilder . append ( ( char ) element ) ; } } return stringBuilder . toString ( ) ;
public class InheritanceHelper { /** * Replies if the type candidate is a subtype of the given super type . * @ param candidate the type to test . * @ param jvmSuperType the expected JVM super - type . * @ param sarlSuperType the expected SARL super - type . * @ return < code > true < / code > if the candidate is a sub - type of the super - type . */ public boolean isSubTypeOf ( LightweightTypeReference candidate , Class < ? > jvmSuperType , Class < ? extends XtendTypeDeclaration > sarlSuperType ) { } }
if ( candidate . isSubtypeOf ( jvmSuperType ) ) { return true ; } if ( sarlSuperType != null ) { final JvmType type = candidate . getType ( ) ; if ( type instanceof JvmGenericType ) { final JvmGenericType genType = ( JvmGenericType ) type ; if ( genType . getSuperTypes ( ) . isEmpty ( ) ) { for ( final EObject sarlObject : this . sarlAssociations . getSourceElements ( type ) ) { if ( sarlSuperType . isInstance ( sarlObject ) ) { return true ; } } } } } return false ;
public class PriceLevel { /** * Match order if possible . * @ param orderId the incoming order id * @ param side the incoming order side * @ param size incoming order quantity * @ param matchEmmiter an emitter to be notified for matches { @ link Processor # onNext ( Object ) } * @ return the remaining quantity of the incoming order */ public long match ( long orderId , Side side , long size , EmitterProcessor < MatchOrder > matchEmmiter ) { } }
long quantity = size ; while ( quantity > 0 && ! orders . isEmpty ( ) ) { Order order = orders . get ( 0 ) ; long orderQuantity = order . size ( ) ; if ( orderQuantity > quantity ) { order . reduce ( quantity ) ; matchEmmiter . onNext ( new MatchOrder ( order . id ( ) , orderId , side , price , quantity , order . size ( ) ) ) ; quantity = 0 ; } else { orders . remove ( 0 ) ; matchEmmiter . onNext ( new MatchOrder ( order . id ( ) , orderId , side , price , orderQuantity , 0 ) ) ; quantity -= orderQuantity ; } } return quantity ;
public class MultiUserChatLight { /** * Change the MUC Light affiliations . * @ param affiliations * @ throws NoResponseException * @ throws XMPPErrorException * @ throws NotConnectedException * @ throws InterruptedException */ public void changeAffiliations ( HashMap < Jid , MUCLightAffiliation > affiliations ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { } }
MUCLightChangeAffiliationsIQ changeAffiliationsIQ = new MUCLightChangeAffiliationsIQ ( room , affiliations ) ; connection . createStanzaCollectorAndSend ( changeAffiliationsIQ ) . nextResultOrThrow ( ) ;
public class ConnectionDataGroup { /** * Close a conversation on the specified connection . The connection must be part of this * group . If the connection has no more conversations left using it , then it is added * to the idle pool . * @ param connection The connection to close a conversation on . */ protected synchronized void close ( OutboundConnection connection ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "close" , connection ) ; // Paranoia : Check that this connection believes that it belongs in this group . if ( connection . getConnectionData ( ) . getConnectionDataGroup ( ) != this ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "connection does not belong to this group" , connection . getConnectionData ( ) . getConnectionDataGroup ( ) ) ; throw new SIErrorException ( nls . getFormattedMessage ( "CONNDATAGROUP_INTERNAL_SICJ0062" , null , "CONNDATAGROUP_INTERNAL_SICJ0062" ) ) ; // D226223 } ConnectionData data ; boolean isNowIdle = false ; synchronized ( connectionData ) { data = connection . getConnectionData ( ) ; data . decrementUseCount ( ) ; if ( data . getUseCount ( ) == 0 ) { // If no one is using this connection , then remove it from our group and // add it to the idle pool . connectionData . remove ( data ) ; isNowIdle = true ; } } if ( isNowIdle ) { IdleConnectionPool . getInstance ( ) . add ( data . getConnection ( ) , groupEndpointDescriptor ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "close" ) ;
public class BasicAnnotationProcessor { /** * Processes the valid elements , including those previously deferred by each step . */ private void process ( ImmutableSetMultimap < Class < ? extends Annotation > , Element > validElements ) { } }
for ( ProcessingStep step : steps ) { ImmutableSetMultimap < Class < ? extends Annotation > , Element > stepElements = new ImmutableSetMultimap . Builder < Class < ? extends Annotation > , Element > ( ) . putAll ( indexByAnnotation ( elementsDeferredBySteps . get ( step ) , step . annotations ( ) ) ) . putAll ( filterKeys ( validElements , Predicates . < Object > in ( step . annotations ( ) ) ) ) . build ( ) ; if ( stepElements . isEmpty ( ) ) { elementsDeferredBySteps . removeAll ( step ) ; } else { Set < ? extends Element > rejectedElements = step . process ( stepElements ) ; elementsDeferredBySteps . replaceValues ( step , transform ( rejectedElements , new Function < Element , ElementName > ( ) { @ Override public ElementName apply ( Element element ) { return ElementName . forAnnotatedElement ( element ) ; } } ) ) ; } }
public class ArrayBasedStrategy { /** * - - - GET LOCAL OR REMOTE ENDPOINT - - - */ @ SuppressWarnings ( "unchecked" ) @ Override public T getEndpoint ( String nodeID ) { } }
Endpoint [ ] array ; if ( nodeID == null && preferLocal ) { array = getEndpointsByNodeID ( this . nodeID ) ; if ( array . length == 0 ) { array = endpoints ; } } else { array = getEndpointsByNodeID ( nodeID ) ; } if ( array . length == 0 ) { return null ; } if ( array . length == 1 ) { return ( T ) array [ 0 ] ; } return ( T ) next ( array ) ;
public class CommunicationRegistry { /** * 注册一个事件对应的处理对象 * @ param eventType * @ param action */ public static void regist ( EventType eventType , Object action ) { } }
if ( logger . isInfoEnabled ( ) ) { logger . info ( " Regist " + action + " For " + eventType ) ; } if ( table . containsKey ( eventType ) ) { if ( logger . isWarnEnabled ( ) ) { logger . warn ( " EventType " + eventType + " is already exist!" ) ; } } table . put ( eventType , action ) ;
public class ConfigurationBuilder { /** * returns the metadata adapter . * if javassist library exists in the classpath , this method returns { @ link JavassistAdapter } otherwise defaults to { @ link JavaReflectionAdapter } . * < p > the { @ link JavassistAdapter } is preferred in terms of performance and class loading . */ public MetadataAdapter getMetadataAdapter ( ) { } }
if ( metadataAdapter != null ) return metadataAdapter ; else { try { return ( metadataAdapter = new JavassistAdapter ( ) ) ; } catch ( Throwable e ) { if ( Reflections . log != null ) Reflections . log . warn ( "could not create JavassistAdapter, using JavaReflectionAdapter" , e ) ; return ( metadataAdapter = new JavaReflectionAdapter ( ) ) ; } }
public class PdfAction { /** * Creates a GoToE action to an embedded file . * @ param filenamethe root document of the target ( null if the target is in the same document ) * @ param dest the named destination * @ param isName if true sets the destination as a name , if false sets it as a String * @ return a GoToE action */ public static PdfAction gotoEmbedded ( String filename , PdfTargetDictionary target , String dest , boolean isName , boolean newWindow ) { } }
if ( isName ) return gotoEmbedded ( filename , target , new PdfName ( dest ) , newWindow ) ; else return gotoEmbedded ( filename , target , new PdfString ( dest , null ) , newWindow ) ;
public class AbstractIntegerAttr { /** * Utility method to parse a { @ code String } into an { @ code Integer } , * converting any possible { @ code NumberFormatException } thrown into * a { @ code BOSHException } . * @ param str string to parse * @ return integer value * @ throws BOSHException on { @ code NumberFormatException } */ private static int parseInt ( final String str ) throws BOSHException { } }
try { return Integer . parseInt ( str ) ; } catch ( NumberFormatException nfx ) { throw ( new BOSHException ( "Could not parse an integer from the value provided: " + str , nfx ) ) ; }
public class BlockTemplate { /** * Returns a { @ code String } representation of a statement , including semicolon . */ private static String printStatement ( Context context , JCStatement statement ) { } }
StringWriter writer = new StringWriter ( ) ; try { pretty ( context , writer ) . printStat ( statement ) ; } catch ( IOException e ) { throw new AssertionError ( "StringWriter cannot throw IOExceptions" ) ; } return writer . toString ( ) ;
public class TreeParser { /** * Parses the given parentheses tree string * @ since 4.3 * @ param < B > the tree node value type * @ param value the parentheses tree string * @ param mapper the mapper which converts the serialized string value to * the desired type * @ return the parsed tree object * @ throws NullPointerException if one of the arguments is { @ code null } * @ throws IllegalArgumentException if the given parentheses tree string * doesn ' t represent a valid tree */ static < B > TreeNode < B > parse ( final String value , final Function < ? super String , ? extends B > mapper ) { } }
requireNonNull ( value ) ; requireNonNull ( mapper ) ; final TreeNode < B > root = TreeNode . of ( ) ; final Deque < TreeNode < B > > parents = new ArrayDeque < > ( ) ; TreeNode < B > current = root ; for ( Token token : tokenize ( value . trim ( ) ) ) { switch ( token . seq ) { case "(" : if ( current == null ) { throw new IllegalArgumentException ( format ( "Illegal parentheses tree string: '%s'." , value ) ) ; } final TreeNode < B > tn1 = TreeNode . of ( ) ; current . attach ( tn1 ) ; parents . push ( current ) ; current = tn1 ; break ; case "," : if ( parents . isEmpty ( ) ) { throw new IllegalArgumentException ( format ( "Expect '(' at position %d." , token . pos ) ) ; } final TreeNode < B > tn2 = TreeNode . of ( ) ; assert parents . peek ( ) != null ; parents . peek ( ) . attach ( tn2 ) ; current = tn2 ; break ; case ")" : if ( parents . isEmpty ( ) ) { throw new IllegalArgumentException ( format ( "Unbalanced parentheses at position %d." , token . pos ) ) ; } current = parents . pop ( ) ; if ( parents . isEmpty ( ) ) { current = null ; } break ; default : if ( current == null ) { throw new IllegalArgumentException ( format ( "More than one root element at pos %d: '%s'." , token . pos , value ) ) ; } if ( current . getValue ( ) == null ) { current . setValue ( mapper . apply ( token . seq ) ) ; } break ; } } if ( ! parents . isEmpty ( ) ) { throw new IllegalArgumentException ( "Unbalanced parentheses." ) ; } return root ;
public class Validator { /** * Validate a given jPDL process definition against the applicable definition language ' s schema . * @ param def * The process definition , in { @ link String } format . * @ param language * The process definition language for which the given definition is to be validated . * @ return Whether the validation was successful . */ static boolean validateDefinition ( final String def , final ProcessLanguage language ) { } }
return XmlUtils . validate ( new StreamSource ( new StringReader ( def ) ) , language . getSchemaSources ( ) ) ;
public class Strings { /** * Substitute sub - strings in side of a string . * @ param string String to subst mappings in * @ param map Map of from - > to strings * @ param beginToken Beginning token * @ param endToken Ending token * @ return Substituted string */ public static String subst ( final String string , final Map < ? , ? > map , final String beginToken , final String endToken ) { } }
return subst ( new StringBuffer ( ) , string , map , beginToken , endToken ) ;
public class DefaultGroovyMethods { /** * A variant of collectEntries for Iterable objects using the identity closure as the transform . * The source Iterable should contain a list of < code > [ key , value ] < / code > tuples or < code > Map . Entry < / code > objects . * < pre class = " groovyTestCase " > * def nums = [ 1 , 10 , 100 , 1000] * def tuples = nums . collect { [ it , it . toString ( ) . size ( ) ] } * assert tuples = = [ [ 1 , 1 ] , [ 10 , 2 ] , [ 100 , 3 ] , [ 1000 , 4 ] ] * def map = tuples . collectEntries ( ) * assert map = = [ 1:1 , 10:2 , 100:3 , 1000:4] * < / pre > * @ param self an Iterable * @ return a Map of the transformed entries * @ see # collectEntries ( Iterator ) * @ since 1.8.7 */ public static < K , V > Map < K , V > collectEntries ( Iterable < ? > self ) { } }
return collectEntries ( self . iterator ( ) ) ;
public class JCellCheckBox { /** * Get the editor for this location in the table . * From the TableCellEditor interface . * Sets the value of this control and returns this . * @ return this . */ public Component getTableCellEditorComponent ( JTable table , Object value , boolean isSelected , int row , int column ) { } }
this . setControlValue ( value ) ; return this ;
public class LengthCheckInputStream { /** * { @ inheritDoc } * @ throws SdkClientException * if the data length read has exceeded the expected total , or * if the total data length is not the same as the expected * total . */ @ Override public int read ( ) throws IOException { } }
final int c = super . read ( ) ; if ( c >= 0 ) dataLength ++ ; checkLength ( c == - 1 ) ; return c ;
public class SibRaActivationSpecImpl { /** * ( non - Javadoc ) * @ see com . ibm . wsspi . sib . ra . SibRaActivationSpec # setMaxConcurrency ( java . lang . String ) */ public void setMaxConcurrency ( final String maxConcurrency ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( this , TRACE , "MaxConcurrency" , maxConcurrency ) ; } _maxConcurrency = ( maxConcurrency == null ? null : Integer . valueOf ( maxConcurrency ) ) ;
public class TaskSummary { /** * Returns true if field corresponding to fieldID is set ( has been assigned a value ) and false otherwise */ public boolean isSet ( _Fields field ) { } }
if ( field == null ) { throw new IllegalArgumentException ( ) ; } switch ( field ) { case TASK_ID : return is_set_taskId ( ) ; case UPTIME : return is_set_uptime ( ) ; case STATUS : return is_set_status ( ) ; case HOST : return is_set_host ( ) ; case PORT : return is_set_port ( ) ; case ERRORS : return is_set_errors ( ) ; } throw new IllegalStateException ( ) ;
public class OctalToDecimal { /** * This method is used to convert an octal number to a decimal number . * Examples : * octal _ to _ decimal ( 25 ) - > 21 * octal _ to _ decimal ( 30 ) - > 24 * octal _ to _ decimal ( 40 ) - > 32 * Args : * octal _ value : an integer representing an octal number * Returns : * a decimal _ value : decimal value of the input octal number */ public static int octalToDecimal ( int octalValue ) { } }
int temporaryOctal = octalValue ; int decimalValue = 0 ; int multiplier = 1 ; while ( temporaryOctal != 0 ) { int digit = ( temporaryOctal % 10 ) ; temporaryOctal = ( temporaryOctal / 10 ) ; decimalValue += ( digit * multiplier ) ; multiplier *= 8 ; } return decimalValue ;
public class StepFunctionBuilder { /** * Binary condition for String equality comparison . * @ param variable The JSONPath expression that determines which piece of the input document is used for the comparison . * @ param expectedValue The expected value for this condition . * @ see < a href = " https : / / states - language . net / spec . html # choice - state " > https : / / states - language . net / spec . html # choice - state < / a > * @ see com . amazonaws . services . stepfunctions . builder . states . Choice */ public static StringEqualsCondition . Builder eq ( String variable , String expectedValue ) { } }
return StringEqualsCondition . builder ( ) . variable ( variable ) . expectedValue ( expectedValue ) ;
public class PageFlowUtils { /** * Tell whether a web application resource requires a secure transport protocol . This is * determined from web . xml ; for example , the following block specifies that all resources under * / login require a secure transport protocol . * < pre > * & lt ; security - constraint & gt ; * & lt ; web - resource - collection & gt ; * & lt ; web - resource - name & gt ; Secure PageFlow - begin & lt ; / web - resource - name & gt ; * & lt ; url - pattern & gt ; / login / * & lt ; / url - pattern & gt ; * & lt ; / web - resource - collection & gt ; * & lt ; user - data - constraint & gt ; * & lt ; transport - guarantee & gt ; CONFIDENTIAL & lt ; / transport - guarantee & gt ; * & lt ; / user - data - constraint & gt ; * & lt ; / security - constraint & gt ; * < / pre > * @ param uri a webapp - relative URI for a resource . There must not be query parameters or a scheme * on the URI . * @ param request the current request . * @ return < code > Boolean . TRUE < / code > if a transport - guarantee of < code > CONFIDENTIAL < / code > or * < code > INTEGRAL < / code > is associated with the given resource ; < code > Boolean . FALSE < / code > * a transport - guarantee of < code > NONE < / code > is associated with the given resource ; or * < code > null < / code > if there is no transport - guarantee associated with the given resource . */ public static SecurityProtocol getSecurityProtocol ( String uri , ServletContext servletContext , HttpServletRequest request ) { } }
return AdapterManager . getServletContainerAdapter ( servletContext ) . getSecurityProtocol ( uri , request ) ;
public class Strings { /** * 返回一个新的逗号相隔字符串 , 实现其中的单词a - b的功能 * @ param first a { @ link java . lang . String } object . * @ param second a { @ link java . lang . String } object . * @ param delimiter a { @ link java . lang . String } object . * @ return a { @ link java . lang . String } object . */ public static String intersectSeq ( final String first , final String second , final String delimiter ) { } }
if ( isEmpty ( first ) || isEmpty ( second ) ) { return "" ; } List < String > firstSeq = Arrays . asList ( split ( first , ',' ) ) ; List < String > secondSeq = Arrays . asList ( split ( second , ',' ) ) ; Collection < String > rs = CollectUtils . intersection ( firstSeq , secondSeq ) ; StringBuilder buf = new StringBuilder ( ) ; for ( final String ele : rs ) { buf . append ( delimiter ) . append ( ele ) ; } if ( buf . length ( ) > 0 ) { buf . append ( delimiter ) ; } return buf . toString ( ) ;
public class KAMCatalogDao { /** * Retrieves the { @ link KamInfo } objects from the KAM catalog database . * If the < tt > kam < / tt > doesn ' t exist then a null { @ link KamInfo } is returned . * @ return { @ link KamInfo } , the kam info object from the * kam catalog database or null if the kam name cannot be found . * @ throws SQLException Thrown if a SQL error occurred while retrieving * the { @ link KamInfo } objects from the kam catalog . */ public List < KamInfo > getCatalog ( ) throws SQLException { } }
List < KamInfo > list = new ArrayList < KamInfo > ( ) ; ResultSet rset = null ; try { PreparedStatement ps = getPreparedStatement ( SELECT_KAM_CATALOG_SQL ) ; rset = ps . executeQuery ( ) ; while ( rset . next ( ) ) { list . add ( getKamInfo ( rset ) ) ; } } catch ( SQLException ex ) { throw ex ; } finally { close ( rset ) ; } return list ;
public class MomentInterval { /** * / * [ deutsch ] * < p > Konvertiert ein beliebiges Intervall zu einem Intervall dieses Typs . < / p > * @ param interval any kind of moment interval * @ return MomentInterval * @ since 3.34/4.29 */ public static MomentInterval from ( ChronoInterval < Moment > interval ) { } }
if ( interval instanceof MomentInterval ) { return MomentInterval . class . cast ( interval ) ; } else { return new MomentInterval ( interval . getStart ( ) , interval . getEnd ( ) ) ; }
public class Aggregations { /** * Returns an aggregation to find the integer minimum of all supplied values . < br / > * This aggregation is similar to : < pre > SELECT MIN ( value ) FROM x < / pre > * @ param < Key > the input key type * @ param < Value > the supplied value type * @ return the minimum value over all supplied values */ public static < Key , Value > Aggregation < Key , Integer , Integer > integerMin ( ) { } }
return new AggregationAdapter ( new IntegerMinAggregation < Key , Value > ( ) ) ;
public class ManagementLocksInner { /** * Delete a management lock by scope . * @ param scope The scope for the lock . * @ param lockName The name of lock . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceResponse } object if successful . */ public Observable < Void > deleteByScopeAsync ( String scope , String lockName ) { } }
return deleteByScopeWithServiceResponseAsync ( scope , lockName ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ;
public class TrueTypeFont { /** * Reads a < CODE > String < / CODE > from the font file as bytes using the Cp1252 * encoding . * @ param length the length of bytes to read * @ return the < CODE > String < / CODE > read * @ throws IOException the font file could not be read */ protected String readStandardString ( int length ) throws IOException { } }
byte buf [ ] = new byte [ length ] ; rf . readFully ( buf ) ; try { return new String ( buf , WINANSI ) ; } catch ( Exception e ) { throw new ExceptionConverter ( e ) ; }
public class JsonPathAssert { /** * Extracts a JSON boolean using a JsonPath expression and wrap it in an { @ link BooleanAssert } * @ param path JsonPath to extract the number * @ return an instance of { @ link BooleanAssert } */ public AbstractBooleanAssert < ? > jsonPathAsBoolean ( String path ) { } }
return Assertions . assertThat ( actual . read ( path , Boolean . class ) ) ;
public class ExportRecordsScreen { /** * CopyProcessParams Method . */ public String copyProcessParams ( ) { } }
String strProcess = null ; strProcess = Utility . addURLParam ( strProcess , DBParams . LOCAL , this . getProperty ( DBParams . LOCAL ) ) ; strProcess = Utility . addURLParam ( strProcess , DBParams . REMOTE , this . getProperty ( DBParams . REMOTE ) ) ; strProcess = Utility . addURLParam ( strProcess , DBParams . TABLE , this . getProperty ( DBParams . TABLE ) ) ; strProcess = Utility . addURLParam ( strProcess , DBParams . MESSAGE_SERVER , this . getProperty ( DBParams . MESSAGE_SERVER ) ) ; strProcess = Utility . addURLParam ( strProcess , DBParams . CONNECTION_TYPE , this . getProperty ( DBParams . CONNECTION_TYPE ) ) ; strProcess = Utility . addURLParam ( strProcess , DBParams . REMOTE_HOST , this . getProperty ( DBParams . REMOTE_HOST ) ) ; strProcess = Utility . addURLParam ( strProcess , DBParams . CODEBASE , this . getProperty ( DBParams . CODEBASE ) ) ; strProcess = Utility . addURLParam ( strProcess , SQLParams . DATABASE_PRODUCT_PARAM , this . getProperty ( SQLParams . DATABASE_PRODUCT_PARAM ) ) ; strProcess = Utility . addURLParam ( strProcess , DBConstants . SYSTEM_NAME , this . getProperty ( DBConstants . SYSTEM_NAME ) , false ) ; return strProcess ;
public class MatrixVectorMult_DSCC { /** * c = a < sup > T < / sup > * B * @ param a ( Input ) vector * @ param offsetA Input ) first index in vector a * @ param B ( Input ) Matrix * @ param c ( Output ) vector * @ param offsetC ( Output ) first index in vector c */ public static void mult ( double a [ ] , int offsetA , DMatrixSparseCSC B , double c [ ] , int offsetC ) { } }
if ( a . length - offsetA < B . numRows ) throw new IllegalArgumentException ( "Length of 'a' isn't long enough" ) ; if ( c . length - offsetC < B . numCols ) throw new IllegalArgumentException ( "Length of 'c' isn't long enough" ) ; for ( int k = 0 ; k < B . numCols ; k ++ ) { int idx0 = B . col_idx [ k ] ; int idx1 = B . col_idx [ k + 1 ] ; double sum = 0 ; for ( int indexB = idx0 ; indexB < idx1 ; indexB ++ ) { sum += a [ offsetA + B . nz_rows [ indexB ] ] * B . nz_values [ indexB ] ; } c [ offsetC + k ] = sum ; }
public class Types { /** * Creates a new instance of the given class by invoking its default constructor . * < p > The given class must be public and must have a public default constructor , and must not be * an array or an interface or be abstract . If an enclosing class , it must be static . */ public static < T > T newInstance ( Class < T > clazz ) { } }
// TODO ( yanivi ) : investigate " sneaky " options for allocating the class that GSON uses , like // setting the constructor to be accessible , or possibly provide a factory method of a special // name try { return clazz . newInstance ( ) ; } catch ( IllegalAccessException e ) { throw handleExceptionForNewInstance ( e , clazz ) ; } catch ( InstantiationException e ) { throw handleExceptionForNewInstance ( e , clazz ) ; }
public class Utils { /** * get column list from the user provided query to build schema with the respective columns * @ param input query * @ return list of columns */ public static List < String > getColumnListFromQuery ( String query ) { } }
if ( Strings . isNullOrEmpty ( query ) ) { return null ; } String queryLowerCase = query . toLowerCase ( ) ; int startIndex = queryLowerCase . indexOf ( "select " ) + 7 ; int endIndex = queryLowerCase . indexOf ( " from " ) ; if ( startIndex < 0 || endIndex < 0 ) { return null ; } String [ ] inputQueryColumns = query . substring ( startIndex , endIndex ) . toLowerCase ( ) . replaceAll ( " " , "" ) . split ( "," ) ; return Arrays . asList ( inputQueryColumns ) ;
public class Timer { /** * Times and records the duration of an event . * @ param event a { @ link Runnable } whose { @ link Runnable # run ( ) } method implements a process * whose duration should be timed */ public void time ( Runnable event ) { } }
long startTime = this . clock . getTick ( ) ; try { event . run ( ) ; } finally { update ( this . clock . getTick ( ) - startTime ) ; }
public class QueryMethodTypeImpl { /** * If not already created , a new < code > method - params < / code > element with the given value will be created . * Otherwise , the existing < code > method - params < / code > element will be returned . * @ return a new or existing instance of < code > MethodParamsType < QueryMethodType < T > > < / code > */ public MethodParamsType < QueryMethodType < T > > getOrCreateMethodParams ( ) { } }
Node node = childNode . getOrCreate ( "method-params" ) ; MethodParamsType < QueryMethodType < T > > methodParams = new MethodParamsTypeImpl < QueryMethodType < T > > ( this , "method-params" , childNode , node ) ; return methodParams ;
public class ClassEnvy { /** * add the current line number to a set of line numbers * @ param lineNumbers * the current set of line numbers */ private void addLineNumber ( BitSet lineNumbers ) { } }
LineNumberTable lnt = getCode ( ) . getLineNumberTable ( ) ; if ( lnt == null ) { lineNumbers . set ( 0 ) ; } else { int line = lnt . getSourceLine ( getPC ( ) ) ; if ( line < 0 ) { lineNumbers . set ( lineNumbers . size ( ) ) ; } else { lineNumbers . set ( line ) ; } }
public class ProxySettings { /** * Set the proxy server by a URI . The parameters are updated as * described below . * < blockquote > * < dl > * < dt > Secure < / dt > * < dd > < p > * If the URI contains the scheme part and its value is * either { @ code " http " } or { @ code " https " } ( case - insensitive ) , * the { @ code secure } parameter is updated to { @ code false } * or to { @ code true } accordingly . In other cases , the parameter * is not updated . * < / p > < / dd > * < dt > ID & amp ; Password < / dt > * < dd > < p > * If the URI contains the userinfo part and the ID embedded * in the userinfo part is not an empty string , the { @ code * id } parameter and the { @ code password } parameter are updated * accordingly . In other cases , the parameters are not updated . * < / p > < / dd > * < dt > Host < / dt > * < dd > < p > * The { @ code host } parameter is always updated by the given URI . * < / p > < / dd > * < dt > Port < / dt > * < dd > < p > * The { @ code port } parameter is always updated by the given URI . * < / p > < / dd > * < / dl > * < / blockquote > * @ param uri * The URI of the proxy server . If { @ code null } is given , * none of the parameters is updated . * @ return * { @ code this } object . */ public ProxySettings setServer ( URI uri ) { } }
if ( uri == null ) { return this ; } String scheme = uri . getScheme ( ) ; String userInfo = uri . getUserInfo ( ) ; String host = uri . getHost ( ) ; int port = uri . getPort ( ) ; return setServer ( scheme , userInfo , host , port ) ;
public class Humanize { /** * Converts a number to its ordinal as a string . * E . g . 1 becomes ' 1st ' , 2 becomes ' 2nd ' , 3 becomes ' 3rd ' , etc . * @ param value * The number to convert * @ return String representing the number as ordinal */ public static String ordinal ( Number value ) { } }
int v = value . intValue ( ) ; int vc = v % 100 ; if ( vc > 10 && vc < 14 ) return String . format ( ORDINAL_FMT , v , context . get ( ) . ordinalSuffix ( 0 ) ) ; return String . format ( ORDINAL_FMT , v , context . get ( ) . ordinalSuffix ( v % 10 ) ) ;