signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class CostBalancerStrategy { /** * For assignment , we want to move to the lowest cost server that isn ' t already serving the segment . * @ param proposalSegment A DataSegment that we are proposing to move . * @ param serverHolders An iterable of ServerHolders for a particular tier . * @ return A ServerHo...
Pair < Double , ServerHolder > bestServer = Pair . of ( Double . POSITIVE_INFINITY , null ) ; List < ListenableFuture < Pair < Double , ServerHolder > > > futures = new ArrayList < > ( ) ; for ( final ServerHolder server : serverHolders ) { futures . add ( exec . submit ( ( ) -> Pair . of ( computeCost ( proposalSegmen...
public class PeriodicReplicationService { /** * If the stored preferences are in the old format , upgrade them to the new format so that * the app continues to work after upgrade to this version . */ protected void upgradePreferences ( ) { } }
String alarmDueElapsed = "com.cloudant.sync.replication.PeriodicReplicationService.alarmDueElapsed" ; if ( mPrefs . contains ( alarmDueElapsed ) ) { // These are old style preferences . We need to rewrite them in the new form that allows // multiple replication policies . String alarmDueClock = "com.cloudant.sync.repli...
public class DescribePullRequestEventsResult { /** * Information about the pull request events . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setPullRequestEvents ( java . util . Collection ) } or { @ link # withPullRequestEvents ( java . util . Collection...
if ( this . pullRequestEvents == null ) { setPullRequestEvents ( new java . util . ArrayList < PullRequestEvent > ( pullRequestEvents . length ) ) ; } for ( PullRequestEvent ele : pullRequestEvents ) { this . pullRequestEvents . add ( ele ) ; } return this ;
public class JsonReader { /** * Read the Json from the passed { @ link IHasInputStream } . * @ param aISP * The input stream provider to use . May not be < code > null < / code > . * @ param aFallbackCharset * The charset to be used if no BOM is present . May not be * < code > null < / code > . * @ return <...
return readFromStream ( aISP , aFallbackCharset , null ) ;
public class Ix { /** * Collects the elements of this sequence into a Map where the key is * determined from each element via the keySelector function ; duplicates are * overwritten . * @ param < K > the key type * @ param keySelector the function that receives the current element and returns * a key for it t...
return this . < K > collectToMap ( keySelector ) . first ( ) ;
public class ModifyImageAttributeRequest { /** * The user groups . This parameter can be used only when the < code > Attribute < / code > parameter is * < code > launchPermission < / code > . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setUserGroups ( j...
if ( this . userGroups == null ) { setUserGroups ( new com . amazonaws . internal . SdkInternalList < String > ( userGroups . length ) ) ; } for ( String ele : userGroups ) { this . userGroups . add ( ele ) ; } return this ;
public class AbstractSmartLifecycleService { /** * / * ( non - Javadoc ) * @ see org . springframework . context . SmartLifecycle # stop ( java . lang . Runnable ) */ @ Override public void stop ( final Runnable callback ) { } }
if ( state . stop ( ) ) { serviceThreadPool . execute ( new Runnable ( ) { @ Override public void run ( ) { try { doStop ( ) ; state . finishStopping ( ) ; callback . run ( ) ; } catch ( Exception e ) { state . failStopping ( ) ; logger . warn ( "Failed to stop {}" , this . getClass ( ) . getName ( ) , e ) ; } } } ) ; ...
public class CassandraSchemaManager { /** * On composite columns . * @ param translator * the translator * @ param compositeColumns * the composite columns * @ param queryBuilder * the query builder * @ param columns * the columns * @ param isCounterColumnFamily * the is counter column family */ pri...
MetamodelImpl metaModel = ( MetamodelImpl ) kunderaMetadata . getApplicationMetadata ( ) . getMetamodel ( puMetadata . getPersistenceUnitName ( ) ) ; for ( ColumnInfo colInfo : compositeColumns ) { if ( columns == null || ( columns != null && ! columns . contains ( colInfo ) ) ) { String cqlType = null ; if ( isCounter...
public class CallableStatementHandle { /** * # endif JDK > 6 */ public < T > T getObject ( int parameterIndex , Class < T > type ) throws SQLException { } }
return this . internalCallableStatement . getObject ( parameterIndex , type ) ;
public class AccountsApi { /** * Updates an existing account custom field . * @ param accountId The external account number ( int ) or account ID Guid . ( required ) * @ param customFieldId ( required ) * @ param customField ( optional ) * @ return CustomFields */ public CustomFields updateCustomField ( String ...
return updateCustomField ( accountId , customFieldId , customField , null ) ;
public class AbstractManagedType { /** * On check set attribute . * @ param < E > * the element type * @ param pluralAttribute * the plural attribute * @ param paramClass * the param class * @ return true , if successful */ private < E > boolean onCheckSetAttribute ( PluralAttribute < ? super X , ? , ? > ...
if ( pluralAttribute != null ) { if ( isSetAttribute ( pluralAttribute ) && isBindable ( pluralAttribute , paramClass ) ) { return true ; } } return false ;
public class DSLMapParser { /** * src / main / resources / org / drools / compiler / lang / dsl / DSLMap . g : 172:1 : value _ sentence : ( variable _ reference | vc = value _ chunk - > VT _ LITERAL [ $ vc . start , text ] ) ; */ public final DSLMapParser . value_sentence_return value_sentence ( ) throws RecognitionExc...
DSLMapParser . value_sentence_return retval = new DSLMapParser . value_sentence_return ( ) ; retval . start = input . LT ( 1 ) ; Object root_0 = null ; ParserRuleReturnScope vc = null ; ParserRuleReturnScope variable_reference19 = null ; RewriteRuleSubtreeStream stream_value_chunk = new RewriteRuleSubtreeStream ( adapt...
public class GenericReflection { /** * This method dynamically invokes the method with the given name on the given * object . * @ param < RETURNTYPE > * The method return type * @ param aSrcObj * The source object on which the method is to be invoked . May not be * < code > null < / code > . * @ param sMe...
return GenericReflection . < RETURNTYPE > invokeMethod ( aSrcObj , sMethodName , getClassArray ( aArgs ) , aArgs ) ;
public class HttpClientBuilder { /** * Configures an Apache { @ link org . apache . http . impl . client . HttpClientBuilder HttpClientBuilder } . * Intended for use by subclasses to inject HttpClientBuilder * configuration . The default implementation is an identity * function . */ protected org . apache . http ...
return builder ;
public class AstaTextFileReader { /** * Process tasks . * @ throws SQLException */ private void processTasks ( ) throws SQLException { } }
List < Row > bars = getTable ( "BAR" ) ; List < Row > expandedTasks = getTable ( "EXPANDED_TASK" ) ; List < Row > tasks = getTable ( "TASK" ) ; List < Row > milestones = getTable ( "MILESTONE" ) ; m_reader . processTasks ( bars , expandedTasks , tasks , milestones ) ;
public class AccountsApi { /** * Gets a list of brand profiles . * Retrieves the list of brand profiles associated with the account and the default brand profiles . The Account Branding feature ( accountSettings properties & # x60 ; canSelfBrandSend & # x60 ; and & # x60 ; canSelfBrandSend & # x60 ; ) must be set to ...
Object localVarPostBody = "{}" ; // verify the required parameter ' accountId ' is set if ( accountId == null ) { throw new ApiException ( 400 , "Missing the required parameter 'accountId' when calling listBrands" ) ; } // create path and map variables String localVarPath = "/v2/accounts/{accountId}/brands" . replaceAl...
public class Command { /** * Create a CORBA Any object and insert a String in it . * @ param data The String to be inserted into the Any object * @ exception DevFailed If the Any object creation failed . * Click < a href = " . . / . . / tango _ basic / idl _ html / Tango . html # DevFailed " > here < / a > to rea...
Any out_any = alloc_any ( ) ; out_any . insert_string ( data ) ; return out_any ;
public class CPFriendlyURLEntryPersistenceImpl { /** * Returns the cp friendly url entry where groupId = & # 63 ; and classNameId = & # 63 ; and languageId = & # 63 ; and urlTitle = & # 63 ; or returns < code > null < / code > if it could not be found . Uses the finder cache . * @ param groupId the group ID * @ par...
return fetchByG_C_L_U ( groupId , classNameId , languageId , urlTitle , true ) ;
public class CmsMultiMessages { /** * Adds a list a messages instances to this multi message bundle . < p > * @ param messages the messages instance to add */ public void addMessages ( List < CmsMessages > messages ) { } }
if ( messages == null ) { throw new CmsIllegalArgumentException ( Messages . get ( ) . container ( Messages . ERR_MULTIMSG_EMPTY_LIST_0 ) ) ; } Iterator < CmsMessages > i = messages . iterator ( ) ; while ( i . hasNext ( ) ) { addMessages ( i . next ( ) ) ; }
public class HomeActivity { /** * show any error messages posted to the bus . */ @ Subscribe public void onFailure ( Throwable t ) { } }
Toast . makeText ( this , t . getMessage ( ) , LENGTH_LONG ) . show ( ) ;
public class FeatureCoreStyleExtension { /** * Create a style relationship for the feature table * @ param featureTable * feature table */ public void createStyleRelationship ( String featureTable ) { } }
createStyleRelationship ( getMappingTableName ( TABLE_MAPPING_STYLE , featureTable ) , featureTable , featureTable , StyleTable . TABLE_NAME ) ;
public class PaymentChannelClient { /** * < p > Called when the connection terminates . Notifies the { @ link StoredClientChannel } object that we can attempt to * resume this channel in the future and stops generating messages for the server . < / p > * < p > For stateless protocols , this translates to a client n...
lock . lock ( ) ; try { connectionOpen = false ; if ( state != null ) state . disconnectFromChannel ( ) ; } finally { lock . unlock ( ) ; }
public class WebSiteManagementClientImpl { /** * Updates publishing user . * Updates publishing user . * @ param userDetails Details of publishing user * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the UserInner object */ public Observable < ServiceRes...
if ( userDetails == null ) { throw new IllegalArgumentException ( "Parameter userDetails is required and cannot be null." ) ; } if ( this . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.apiVersion() is required and cannot be null." ) ; } Validator . validate ( userDetails ) ; return se...
public class InitializationService { /** * Used to create a user . Implements special logic by encoding the password . * @ param user */ public void saveUser ( User user ) { } }
LOG . trace ( "Trying to create a new user" ) ; // encode the raw password using bcrypt final String pwHash = passwordEncoder . encode ( user . getPassword ( ) ) ; user . setPassword ( pwHash ) ; dao . saveOrUpdate ( user ) ; LOG . info ( "Created the user " + user . getAccountName ( ) ) ;
public class IPCLoggerChannel { /** * Separated out for easy overriding in tests . */ @ VisibleForTesting protected ExecutorService createExecutor ( ) { } }
return Executors . newSingleThreadExecutor ( new ThreadFactoryBuilder ( ) . setDaemon ( true ) . setNameFormat ( "Logger channel to " + addr ) . setUncaughtExceptionHandler ( UncaughtExceptionHandlers . systemExit ( ) ) . build ( ) ) ;
public class AbstractSaga { /** * Requests a timeout event with a specific name to this saga . The name can * be used to distinguish the timeout if multiple ones have been requested by the saga . */ protected TimeoutId requestTimeout ( final long delay , final TimeUnit unit , @ Nullable final String name ) { } }
return requestTimeout ( delay , unit , name , null ) ;
public class NotificationBoard { /** * Set the y degree that this board is rotated . * @ param y */ public void setBoardRotationY ( float y ) { } }
if ( mListeners != null ) { for ( StateListener l : mListeners ) { l . onBoardRotationY ( this , y ) ; } } mContentView . setRotationY ( y ) ;
public class Util { /** * Returns the first header with the given name ( case - insensitive ) or null . */ public static Header findHeader ( HttpResponse response , String headerName ) { } }
Header [ ] headers = response . getHeaders ( headerName ) ; return headers . length > 0 ? headers [ 0 ] : null ;
public class ContentType { /** * Extracts < code > Content - Type < / code > value from { @ link HttpEntity } exactly as * specified by the < code > Content - Type < / code > header of the entity . Returns < code > null < / code > * if not specified . * @ param entity HTTP entity * @ return content type * @ t...
if ( entity == null ) { return null ; } Header header = entity . getContentType ( ) ; if ( header != null ) { HeaderElement [ ] elements = header . getElements ( ) ; if ( elements . length > 0 ) { return create ( elements [ 0 ] ) ; } } return null ;
public class IndexBuilder { /** * Sort the index map . Traverse the index map for all it ' s elements and * sort each element which is a list . */ protected void sortIndexMap ( ) { } }
for ( Iterator < List < Doc > > it = indexmap . values ( ) . iterator ( ) ; it . hasNext ( ) ; ) { Collections . sort ( it . next ( ) , new DocComparator ( ) ) ; }
public class TableBucketReader { /** * Creates a new instance of the { @ link TableBucketReader } class that can read { @ link TableEntry } instances . * @ param segment A { @ link DirectSegmentAccess } that can be used to read from the Segment . * @ param getBackpointer A Function that , when invoked with a { @ li...
return new TableBucketReader . Entry ( segment , getBackpointer , executor ) ;
public class Text { /** * deserialize */ public void readFields ( DataInput in ) throws IOException { } }
int newLength = WritableUtils . readVInt ( in ) ; setCapacity ( newLength , false ) ; in . readFully ( bytes , 0 , newLength ) ; length = newLength ;
public class Base64Url { /** * Encode a byte array into Base64Url encoded bytes . * @ param bytes The byte array to encode . * @ return a Base64Url instance */ public static Base64Url encode ( byte [ ] bytes ) { } }
if ( bytes == null ) { return new Base64Url ( null ) ; } else { return new Base64Url ( BaseEncoding . base64Url ( ) . omitPadding ( ) . encode ( bytes ) ) ; }
public class IfBlock { /** * define an ElseIf block . < br > * @ param init lambda expression returns an object or boolean value , * init = = null | | init . equals ( false ) will be considered * < b > false < / b > in traditional if expression . in other * cases , considered true * @ param body return body '...
if ( procceed ) if ( initVal != null && ! initVal . equals ( false ) ) { return new IfBlock < > ( this . body . apply ( initVal ) ) ; } else { return new IfBlock < > ( init , body ) ; } else return new IfBlock < > ( this . val ) ;
public class ContentStoreImpl { /** * { @ inheritDoc } */ @ Override public Content getContent ( final String spaceId , final String contentId ) throws ContentStoreException { } }
return getContent ( spaceId , contentId , 0l , null ) ;
public class Variables { /** * Shortcut for { @ code Variables . createVariables ( ) . putValue ( name , value ) } */ public static VariableMap putValue ( String name , Object value ) { } }
return createVariables ( ) . putValue ( name , value ) ;
public class Exec { /** * Launches the process , returning a handle to it for IO ops , etc . < br / > * The finish condition for the OutputProcess is that all processes outputting to standard out must be complete before * proceeding * @ return * @ throws IOException */ public Execed start ( ) throws IOException...
Process p = getProcessBuilder ( ) . start ( ) ; return new Execed ( cmd , p , builder . redirectErrorStream ( ) ) ;
public class FileUtils { /** * Deletes a file , never throwing an exception . If file is a directory , delete it and all sub - directories . * The difference between File . delete ( ) and this method are : * < ul > * < li > A directory to be deleted does not have to be empty . < / li > * < li > No exceptions ar...
if ( path == null ) { return false ; } try { if ( path . toFile ( ) . isDirectory ( ) ) { deleteDirectory ( path ) ; } else { Files . delete ( path ) ; } return true ; } catch ( IOException | SecurityException ignored ) { return false ; }
public class RestClientConfiguration { /** * Creates and returns a new { @ link RestClientConfiguration } from the given { @ link Configuration } . * @ param config configuration from which the REST client endpoint configuration should be created from * @ return REST client endpoint configuration * @ throws Confi...
Preconditions . checkNotNull ( config ) ; final SSLHandlerFactory sslHandlerFactory ; if ( SSLUtils . isRestSSLEnabled ( config ) ) { try { sslHandlerFactory = SSLUtils . createRestClientSSLEngineFactory ( config ) ; } catch ( Exception e ) { throw new ConfigurationException ( "Failed to initialize SSLContext for the R...
public class Writer { /** * 设置specify * @ param value Type */ public void specify ( Type value ) { } }
if ( value instanceof GenericArrayType ) { this . specify = ( ( GenericArrayType ) value ) . getGenericComponentType ( ) ; } else if ( value instanceof Class && ( ( Class ) value ) . isArray ( ) ) { this . specify = ( ( Class ) value ) . getComponentType ( ) ; } else { this . specify = value ; }
public class Http2CodecUtil { /** * Results in a RST _ STREAM being sent for { @ code streamId } due to violating * < a href = " https : / / tools . ietf . org / html / rfc7540 # section - 6.5.2 " > SETTINGS _ MAX _ HEADER _ LIST _ SIZE < / a > . * @ param streamId The stream ID that was being processed when the ex...
throw headerListSizeError ( streamId , PROTOCOL_ERROR , onDecode , "Header size exceeded max " + "allowed size (%d)" , maxHeaderListSize ) ;
public class TypeHandlerUtils { /** * Transfers data from InputStream into sql . Blob * @ param blob sql . Blob which would be filled * @ param input InputStream * @ return sql . Blob from InputStream * @ throws SQLException */ public static Object convertBlob ( Object blob , InputStream input ) throws SQLExcep...
return convertBlob ( blob , toByteArray ( input ) ) ;
public class AtlasEntityStoreV1 { /** * Validate if classification is not already associated with the entities * @ param guid unique entity id * @ param classifications list of classifications to be associated */ private void validateEntityAssociations ( String guid , List < AtlasClassification > classifications ) ...
List < String > entityClassifications = getClassificationNames ( guid ) ; for ( AtlasClassification classification : classifications ) { String newClassification = classification . getTypeName ( ) ; if ( CollectionUtils . isNotEmpty ( entityClassifications ) && entityClassifications . contains ( newClassification ) ) {...
public class DOMJettyWebXmlParser { private Class < ? > nodeClass ( Element node ) throws ClassNotFoundException { } }
String className = getAttribute ( node , "class" ) ; if ( className == null ) { return null ; } return Loader . loadClass ( DOMJettyWebXmlParser . class , className , true ) ;
public class IonizationPotentialTool { /** * Get the prediction result for the Oxygen family given a series of values . * It is based on 368 instances and 9 attributes ( descriptors ) using the Linear Regression Model * with result of Root mean squared error 0.64 with a cross validation of 10 folds . * @ param re...
double result = 0.0 ; double SE = resultsH [ 0 ] ; double PE = resultsH [ 1 ] ; double PSC = resultsH [ 2 ] ; double PIC = resultsH [ 3 ] ; double ETP = resultsH [ 4 ] ; double SPC = resultsH [ 5 ] ; double COUNTR = resultsH [ 6 ] ; // System . out . println ( " SE : " + SE + " , PE : " + PE + " , PSC : " + PSC + " , P...
public class CommerceDiscountPersistenceImpl { /** * Removes the commerce discount where uuid = & # 63 ; and groupId = & # 63 ; from the database . * @ param uuid the uuid * @ param groupId the group ID * @ return the commerce discount that was removed */ @ Override public CommerceDiscount removeByUUID_G ( String...
CommerceDiscount commerceDiscount = findByUUID_G ( uuid , groupId ) ; return remove ( commerceDiscount ) ;
public class RetryHandlingMetaMasterMasterClient { /** * Sends a heartbeat to the leader master . Standby masters periodically execute this method * so that the leader master knows they are still running . * @ param masterId the master id * @ return whether this master should re - register */ public MetaCommand h...
return retryRPC ( ( ) -> mClient . masterHeartbeat ( MasterHeartbeatPRequest . newBuilder ( ) . setMasterId ( masterId ) . build ( ) ) . getCommand ( ) ) ;
public class GeoEquals { /** * Evaluates the given object against this expression . * @ param o The object to evaluate . * @ return True if the given object matches this expression , false otherwise . */ public Boolean evaluate ( Object o ) { } }
return getLeft ( ) . evaluate ( o ) . equals ( getRight ( ) . evaluate ( o ) ) ;
public class EurekaClientFactoryBuilder { /** * Use { @ link # withSSLContext ( SSLContext ) } */ @ Deprecated public B withTrustStoreFile ( String trustStoreFileName , String trustStorePassword ) { } }
this . trustStoreFileName = trustStoreFileName ; this . trustStorePassword = trustStorePassword ; return self ( ) ;
public class EllipseClustersIntoRegularGrid { /** * Combines the inner and outer grid into one grid for output . See { @ link Grid } for a discussion * on how elements are ordered internally . */ static void createRegularGrid ( List < List < NodeInfo > > gridByRows , Grid g ) { } }
g . reset ( ) ; g . columns = gridByRows . get ( 0 ) . size ( ) ; g . rows = gridByRows . size ( ) ; for ( int row = 0 ; row < g . rows ; row ++ ) { List < NodeInfo > list = gridByRows . get ( row ) ; for ( int i = 0 ; i < g . columns ; i ++ ) { g . ellipses . add ( list . get ( i ) . ellipse ) ; } }
public class DefaultCasConfigurationPropertiesSourceLocator { /** * Get all possible configuration files for config directory that actually exist as files . * @ param config Folder in which to look for files * @ param profiles Profiles that are active * @ return List of files to be processed in order where last o...
val possibleFiles = getAllPossibleExternalConfigDirFilenames ( config , profiles ) ; return possibleFiles . stream ( ) . filter ( File :: exists ) . filter ( File :: isFile ) . map ( FileSystemResource :: new ) . collect ( Collectors . toList ( ) ) ;
public class DelayPath { /** * documentation inherited */ public boolean tick ( Pathable pable , long tickstamp ) { } }
if ( tickstamp >= _startStamp + _duration ) { if ( _source != null ) { pable . setLocation ( _source . x , _source . y ) ; } pable . pathCompleted ( tickstamp ) ; return ( _source != null ) ; } // If necessary , move the sprite to the supplied location if ( _source != null && ( pable . getX ( ) != _source . x || pable ...
public class PropsVectors { /** * Call compact ( ) , create a IntTrie with indexes into the compacted * vectors array . */ public IntTrie compactToTrieWithRowIndexes ( ) { } }
PVecToTrieCompactHandler compactor = new PVecToTrieCompactHandler ( ) ; compact ( compactor ) ; return compactor . builder . serialize ( new DefaultGetFoldedValue ( compactor . builder ) , new DefaultGetFoldingOffset ( ) ) ;
public class TagAdapter { /** * Returns the parent of this tag , which is always * getAdaptee ( ) . getParent ( ) . * This will either be the enclosing Tag ( if getAdaptee ( ) . getParent ( ) * implements Tag ) , or an adapter to the enclosing Tag ( if * getAdaptee ( ) . getParent ( ) does not implement Tag ) ....
if ( ! parentDetermined ) { JspTag adapteeParent = simpleTagAdaptee . getParent ( ) ; if ( adapteeParent != null ) { if ( adapteeParent instanceof Tag ) { this . parent = ( Tag ) adapteeParent ; } else { // Must be SimpleTag - no other types defined . this . parent = new TagAdapter ( ( SimpleTag ) adapteeParent ) ; } }...
public class ExecutionPath { /** * This will create an execution path from the list of objects * @ param objects the path objects * @ return a new execution path */ public static ExecutionPath fromList ( List < ? > objects ) { } }
assertNotNull ( objects ) ; ExecutionPath path = ExecutionPath . rootPath ( ) ; for ( Object object : objects ) { if ( object instanceof Number ) { path = path . segment ( ( ( Number ) object ) . intValue ( ) ) ; } else { path = path . segment ( String . valueOf ( object ) ) ; } } return path ;
public class ReflectiveInterceptor { /** * Performs access checks and returns a ( potential ) copy of the field with accessibility flag set if this necessary * for the acces operation to succeed . * If any checks fail , an appropriate exception is raised . * Warning this method is sensitive to stack depth ! Shoul...
if ( isDeleted ( field ) ) { throw Exceptions . noSuchFieldError ( field ) ; } Class < ? > clazz = field . getDeclaringClass ( ) ; int mods = field . getModifiers ( ) ; if ( field . isAccessible ( ) || Modifier . isPublic ( mods & jlClassGetModifiers ( clazz ) ) ) { // More expensive check not required / copy not requi...
public class PDatabase { /** * Get the physical db type from the record db type . * @ param iDatabaseType * @ return */ public static char getPDBTypeFromDBType ( int iDatabaseType ) { } }
char strPDBType = ThinPhysicalDatabase . MEMORY_TYPE ; if ( ( iDatabaseType & Constants . MAPPED ) != 0 ) ; iDatabaseType = iDatabaseType & Constants . TABLE_TYPE_MASK ; if ( iDatabaseType == Constants . LOCAL ) strPDBType = ThinPhysicalDatabase . NET_TYPE ; // Never asked if ( iDatabaseType == Constants . REMOTE ) str...
public class SwingGroovyMethods { /** * Overloads the left shift operator to provide an easy way to add * components to a popupMenu . < p > * @ param self a JPopupMenu * @ param action an action to be added to the popupMenu . * @ return same popupMenu , after the value was added to it . * @ since 1.6.4 */ pub...
self . add ( action ) ; return self ;
public class CellField { /** * 複数の { @ link FieldValidator } を追加する 。 * @ param validators 複数のvalidatorのインスタンス 。 * @ return 自身のインスタンス 。 * @ throws NullPointerException validator is null . */ public CellField < T > add ( final List < FieldValidator < T > > validators ) { } }
if ( validators . isEmpty ( ) ) { return this ; } for ( FieldValidator < T > validator : validators ) { add ( validator ) ; } return this ;
public class ISUPMessageFactoryImpl { /** * ( non - Javadoc ) * @ see org . restcomm . protocols . ss7 . isup . ISUPMessageFactory # createIRS ( int ) */ @ Override public IdentificationResponseMessage createIRS ( int cic ) { } }
IdentificationResponseMessage msg = createIRS ( ) ; CircuitIdentificationCode code = this . parameterFactory . createCircuitIdentificationCode ( ) ; code . setCIC ( cic ) ; msg . setCircuitIdentificationCode ( code ) ; return msg ;
public class Gmp { /** * Calculate ( base ^ exponent ) % modulus ; faster , VULNERABLE TO TIMING ATTACKS . * @ param base the base , must be positive * @ param exponent the exponent * @ param modulus the modulus * @ return the ( base ^ exponent ) % modulus * @ throws ArithmeticException if modulus is non - po...
if ( modulus . signum ( ) <= 0 ) { throw new ArithmeticException ( "modulus must be positive" ) ; } return INSTANCE . get ( ) . modPowInsecureImpl ( base , exponent , modulus ) ;
public class AcceptPreference { /** * Constructs an { @ link AcceptPreference } array from an { @ link javax . servlet . http . HttpServletRequest } . * @ param request the request to extract the { @ link AcceptPreference } from . * @ return the { @ link AcceptPreference } s reflecting all Accept - Headers in * t...
ArrayList < AcceptPreference > headers = new ArrayList < AcceptPreference > ( ) ; Enumeration < String > strHeaders = request . getHeaders ( RFC7231_HEADER ) ; while ( strHeaders . hasMoreElements ( ) ) { headers . add ( fromString ( strHeaders . nextElement ( ) ) ) ; } if ( headers . isEmpty ( ) ) { return fromString ...
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcAdvancedFace ( ) { } }
if ( ifcAdvancedFaceEClass == null ) { ifcAdvancedFaceEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 9 ) ; } return ifcAdvancedFaceEClass ;
public class Costs { /** * The order of comparison is : network first , then disk , then CPU . The comparison here happens each time * primarily after the heuristic costs , then after the quantifiable costs . * @ see java . lang . Comparable # compareTo ( java . lang . Object ) */ @ Override public int compareTo ( ...
// check the network cost . if we have actual costs on both , use them , otherwise use the heuristic costs . if ( this . networkCost != UNKNOWN && o . networkCost != UNKNOWN ) { if ( this . networkCost != o . networkCost ) { return this . networkCost < o . networkCost ? - 1 : 1 ; } } else if ( this . heuristicNetworkCo...
public class Validators { /** * The input parameter must contain the string c . if yes , the check passes * @ param c contained strings * @ return Validation */ public static Validation < String > contains ( String c ) { } }
return contains ( c , I18N_MAP . get ( i18nPrefix + "CONTAINS" ) ) ;
public class AbstractBaseLauncher { /** * Get the port for the instance represented by this launcher * @ return the port information . */ int getPort ( ) { } }
LOGGER . entering ( ) ; int val = - 1 ; InstanceType type = getType ( ) ; if ( commands . contains ( PORT_ARG ) ) { val = Integer . parseInt ( commands . get ( commands . indexOf ( PORT_ARG ) + 1 ) ) ; LOGGER . exiting ( val ) ; return val ; } try { if ( type . equals ( InstanceType . SELENIUM_NODE ) || type . equals (...
public class Resolve { /** * Resolve a constructor , throw a fatal error if not found . * @ param pos The position to use for error reporting . * @ param env The environment current at the method invocation . * @ param site The type to be constructed . * @ param argtypes The types of the invocation ' s value ar...
MethodResolutionContext resolveContext = new MethodResolutionContext ( ) ; resolveContext . internalResolution = true ; Symbol sym = resolveConstructor ( resolveContext , pos , env , site , argtypes , typeargtypes ) ; if ( sym . kind == MTH ) return ( MethodSymbol ) sym ; else throw new FatalError ( diags . fragment ( ...
public class CPMeasurementUnitPersistenceImpl { /** * Returns the cp measurement unit where groupId = & # 63 ; and key = & # 63 ; and type = & # 63 ; or returns < code > null < / code > if it could not be found , optionally using the finder cache . * @ param groupId the group ID * @ param key the key * @ param ty...
Object [ ] finderArgs = new Object [ ] { groupId , key , type } ; Object result = null ; if ( retrieveFromCache ) { result = finderCache . getResult ( FINDER_PATH_FETCH_BY_G_K_T , finderArgs , this ) ; } if ( result instanceof CPMeasurementUnit ) { CPMeasurementUnit cpMeasurementUnit = ( CPMeasurementUnit ) result ; if...
public class DescribeIpGroupsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeIpGroupsRequest describeIpGroupsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeIpGroupsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeIpGroupsRequest . getGroupIds ( ) , GROUPIDS_BINDING ) ; protocolMarshaller . marshall ( describeIpGroupsRequest . getNextToken ( ) , NEXTTOKEN_BINDING )...
public class PushDownBooleanExpressionExecutorImpl { /** * TODO : explain */ @ Override public NodeCentricOptimizationResults < JoinOrFilterNode > apply ( PushDownBooleanExpressionProposal proposal , IntermediateQuery query , QueryTreeComponent treeComponent ) throws InvalidQueryOptimizationProposalException { } }
JoinOrFilterNode focusNode = proposal . getFocusNode ( ) ; for ( Map . Entry < CommutativeJoinOrFilterNode , Collection < ImmutableExpression > > targetEntry : proposal . getNewDirectRecipientNodes ( ) . asMap ( ) . entrySet ( ) ) { updateNewDirectRecipientNode ( treeComponent , targetEntry . getKey ( ) , targetEntry ....
public class AioSession { /** * 关闭输出 * @ return this */ public AioSession closeIn ( ) { } }
if ( null != this . channel ) { try { this . channel . shutdownInput ( ) ; } catch ( IOException e ) { throw new IORuntimeException ( e ) ; } } return this ;
public class JavaUserDefinedUntypedAggregation { /** * $ example off : untyped _ custom _ aggregation $ */ public static void main ( String [ ] args ) { } }
SparkSession spark = SparkSession . builder ( ) . appName ( "Java Spark SQL user-defined DataFrames aggregation example" ) . getOrCreate ( ) ; // $ example on : untyped _ custom _ aggregation $ // Register the function to access it spark . udf ( ) . register ( "myAverage" , new MyAverage ( ) ) ; Dataset < Row > df = sp...
public class UrlUtils { /** * Gets the singular of a plural . * @ param noun * Name . * @ return if the name was at singular , it does anything . If the name was a * plural , returns its singular . */ public String singularize ( String noun ) { } }
String singular = noun ; if ( singulars . get ( noun ) != null ) { singular = singulars . get ( noun ) ; } else if ( noun . matches ( ".*is$" ) ) { // Singular of * is = > * es singular = noun . substring ( 0 , noun . length ( ) - 2 ) + "es" ; } else if ( noun . matches ( ".*ies$" ) ) { // Singular of * ies = > * y sin...
public class DefaultDedupEventStore { /** * Returns the mutable persistent sorted queue if managed by this JVM , { @ code null } otherwise . */ @ Nullable private DedupQueue getQueueReadWrite ( String queue , Duration waitDuration ) { } }
return _ownerGroup . startIfOwner ( queue , waitDuration ) ;
public class Lines { /** * Returns the square of the distance between the specified point and the specified line * segment . */ public static float pointSegDistSq ( float px , float py , float x1 , float y1 , float x2 , float y2 ) { } }
// A = ( x2 - x1 , y2 - y1) // P = ( px - x1 , py - y1) x2 -= x1 ; // A = ( x2 , y2) y2 -= y1 ; px -= x1 ; // P = ( px , py ) py -= y1 ; float dist ; if ( px * x2 + py * y2 <= 0.0 ) { // P * A dist = px * px + py * py ; } else { px = x2 - px ; // P = A - P = ( x2 - px , y2 - py ) py = y2 - py ; if ( px * x2 + py * y2 <...
public class FastaReader { /** * The parsing is done in this method . < br > * This method tries to process all the available fasta records * in the File or InputStream , closes the underlying resource , * and return the results in { @ link LinkedHashMap } . < br > * You don ' t need to call { @ link # close ( ...
LinkedHashMap < String , S > sequences = process ( - 1 ) ; close ( ) ; return sequences ;
public class CertificateVersion { /** * Encode the CertificateVersion period in DER form to the stream . * @ param out the OutputStream to marshal the contents to . * @ exception IOException on errors . */ public void encode ( OutputStream out ) throws IOException { } }
// Nothing for default if ( version == V1 ) { return ; } DerOutputStream tmp = new DerOutputStream ( ) ; tmp . putInteger ( version ) ; DerOutputStream seq = new DerOutputStream ( ) ; seq . write ( DerValue . createTag ( DerValue . TAG_CONTEXT , true , ( byte ) 0 ) , tmp ) ; out . write ( seq . toByteArray ( ) ) ;
public class AntlrGrammarGenUtil { /** * Returns the effective rule name for the generated Antlr grammar . * Inherited rules may be prefixed by { @ code super [ 0 . . 9 ] * } . Otherwise the * prefix { @ code rule or RULE _ } is used . * @ since 2.9 */ public static String getRuleName ( AbstractRule rule ) { } }
RuleWithParameterValues parameterValues = RuleWithParameterValues . findInEmfObject ( rule ) ; if ( parameterValues != null ) { return rule . getName ( ) ; } RuleNames ruleNames = RuleNames . getRuleNames ( rule ) ; return ruleNames . getAntlrRuleName ( rule ) ;
public class BaseMessageReplyInProcessor { /** * Given the converted message for return , do any further processing before returning the message . * @ param internalMessage The internal return message just as it was converted from the source . */ public BaseMessage processMessage ( BaseMessage message ) { } }
if ( message == null ) return null ; this . updateLogFiles ( message , true ) ; // Need to change log status to SENTOK ( also associate return message log trx ID ) ( todo ) String strReturnQueueName = null ; if ( message . getMessageHeader ( ) instanceof TrxMessageHeader ) strReturnQueueName = ( String ) ( ( TrxMessage...
public class LocalDateTime { /** * Formats this date - time using the specified formatter . * This date - time will be passed to the formatter to produce a string . * @ param formatter the formatter to use , not null * @ return the formatted date - time string , not null * @ throws DateTimeException if an error...
Objects . requireNonNull ( formatter , "formatter" ) ; return formatter . format ( this ) ;
public class MemberModifier { /** * Suppress an array of accessible objects . */ public static void suppress ( AccessibleObject [ ] accessibleObjects ) { } }
if ( accessibleObjects == null ) { throw new IllegalArgumentException ( "accessibleObjects cannot be null" ) ; } for ( AccessibleObject accessibleObject : accessibleObjects ) { if ( accessibleObject instanceof Constructor < ? > ) { SuppressCode . suppressConstructor ( ( Constructor < ? > ) accessibleObject ) ; } else i...
public class CommerceWishListUtil { /** * Returns all the commerce wish lists where groupId = & # 63 ; and userId = & # 63 ; and defaultWishList = & # 63 ; . * @ param groupId the group ID * @ param userId the user ID * @ param defaultWishList the default wish list * @ return the matching commerce wish lists */...
return getPersistence ( ) . findByG_U_D ( groupId , userId , defaultWishList ) ;
public class Element { /** * Focuses on the element , but only if the element * is present , displayed , enabled , and an input . If those conditions are not * met , the focus action will be logged , but skipped and the test will * continue . */ public void focus ( ) { } }
String cantFocus = "Unable to focus on " ; String action = "Focusing on " + prettyOutput ( ) ; String expected = prettyOutputStart ( ) + " is present, displayed, and enabled to be focused" ; try { if ( isNotPresentDisplayedEnabledInput ( action , expected , cantFocus ) ) { return ; } WebElement webElement = getWebEleme...
public class TileTOCRGImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setCOMPR ( Integer newCOMPR ) { } }
Integer oldCOMPR = compr ; compr = newCOMPR ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . TILE_TOCRG__COMPR , oldCOMPR , compr ) ) ;
public class ApiOvhEmailpro { /** * Alter this object properties * REST : PUT / email / pro / { service } / domain / { domainName } * @ param body [ required ] New object properties * @ param service [ required ] The internal name of your pro organization * @ param domainName [ required ] Domain name * API be...
String qPath = "/email/pro/{service}/domain/{domainName}" ; StringBuilder sb = path ( qPath , service , domainName ) ; exec ( qPath , "PUT" , sb . toString ( ) , body ) ;
public class CommandRunner { /** * Executes < code > command < / code > and returns the result . Use this method * when the command you are executing requires no input , writes only UTF - 8 * compatible text to STDOUT and / or STDERR , and you are comfortable with * buffering up all of that data in memory . Other...
logger . debug ( "executing {} on {}" , command , sessionManager ) ; Session session = sessionManager . getSession ( ) ; ByteArrayOutputStream stdErr = new ByteArrayOutputStream ( ) ; ByteArrayOutputStream stdOut = new ByteArrayOutputStream ( ) ; int exitCode ; ChannelExecWrapper channel = null ; try { channel = new Ch...
public class ListSpeechSynthesisTasksResult { /** * List of SynthesisTask objects that provides information from the specified task in the list request , including * output format , creation time , task status , and so on . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use ...
if ( this . synthesisTasks == null ) { setSynthesisTasks ( new java . util . ArrayList < SynthesisTask > ( synthesisTasks . length ) ) ; } for ( SynthesisTask ele : synthesisTasks ) { this . synthesisTasks . add ( ele ) ; } return this ;
public class CommandExecutor { /** * Combination of everything before . * @ param timeout a * @ param unit a * @ param logLevel a * @ return a */ public NativeResponse exec ( long timeout , TimeUnit unit , Level logLevel ) { } }
return internalexec ( timeout , unit , logLevel ) ;
public class FlakeEncodingProvider { /** * Return a 128 - bit version of the given time and sequence numbers according * to the Flake specification . * @ param time a time value to encode * @ param sequence a sequence value to encode * @ return the Flake id as bytes */ @ Override public byte [ ] encodeAsBytes (...
byte [ ] buffer = new byte [ 16 ] ; buffer [ 0 ] = ( byte ) ( time >>> 56 ) ; buffer [ 1 ] = ( byte ) ( time >>> 48 ) ; buffer [ 2 ] = ( byte ) ( time >>> 40 ) ; buffer [ 3 ] = ( byte ) ( time >>> 32 ) ; buffer [ 4 ] = ( byte ) ( time >>> 24 ) ; buffer [ 5 ] = ( byte ) ( time >>> 16 ) ; buffer [ 6 ] = ( byte ) ( time >...
public class JDBCRepository { /** * Returns the highest supported level for the given desired level . * @ return null if not supported */ IsolationLevel selectIsolationLevel ( Transaction parent , IsolationLevel desiredLevel ) { } }
if ( desiredLevel == null ) { if ( parent == null ) { desiredLevel = mDefaultIsolationLevel ; } else { desiredLevel = parent . getIsolationLevel ( ) ; } } else if ( parent != null ) { IsolationLevel parentLevel = parent . getIsolationLevel ( ) ; // Can promote to higher level , but not lower . if ( parentLevel . compar...
public class HdfsBasedUpdateProvider { /** * Get the update time of a { @ link Partition } * @ return the update time if available , 0 otherwise * { @ inheritDoc } * @ see HiveUnitUpdateProvider # getUpdateTime ( org . apache . hadoop . hive . ql . metadata . Partition ) */ @ Override public long getUpdateTime ( ...
try { return getUpdateTime ( partition . getDataLocation ( ) ) ; } catch ( IOException e ) { throw new UpdateNotFoundException ( String . format ( "Failed to get update time for %s" , partition . getCompleteName ( ) ) , e ) ; }
public class TaskManager { /** * / * This method is not thread safe , gets called from the thread safe method addNewList ( . . ) */ private boolean appendList ( List < Object > formattedEvents ) { } }
if ( newLists . size ( ) >= clientPoolSize ) return false ; boolean done = false ; while ( ! done ) { try { newLists . putLast ( formattedEvents ) ; done = true ; } catch ( InterruptedException e ) { // Interrupted try again } } return true ;
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public Tristate createTristateFromString ( EDataType eDataType , String initialValue ) { } }
Tristate result = Tristate . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
public class LinkFactoryImpl { /** * { @ inheritDoc } */ protected Content getTypeParameterLink ( LinkInfo linkInfo , Type typeParam ) { } }
LinkInfoImpl typeLinkInfo = new LinkInfoImpl ( m_writer . configuration , ( ( LinkInfoImpl ) linkInfo ) . getContext ( ) , typeParam ) ; typeLinkInfo . excludeTypeBounds = linkInfo . excludeTypeBounds ; typeLinkInfo . excludeTypeParameterLinks = linkInfo . excludeTypeParameterLinks ; typeLinkInfo . linkToSelf = linkInf...
public class DwgFile { /** * Modify the geometry of the objects applying the Extrusion vector where it * is necessary */ public void applyExtrusions ( ) { } }
for ( int i = 0 ; i < dwgObjects . size ( ) ; i ++ ) { DwgObject dwgObject = ( DwgObject ) dwgObjects . get ( i ) ; if ( dwgObject instanceof DwgArc ) { double [ ] arcCenter = ( ( DwgArc ) dwgObject ) . getCenter ( ) ; double [ ] arcExt = ( ( DwgArc ) dwgObject ) . getExtrusion ( ) ; arcCenter = AcadExtrusionCalculator...
public class DynamicVirtualHost { /** * BEGIN : NEVER INVOKED BY WEBSPHERE APPLICATION SERVER ( Common Component Specific ) */ @ SuppressWarnings ( "unchecked" ) @ Override public void addWebApplication ( DeployedModule deployedModule , List extensionFactories ) throws WebAppNotLoadedException { } }
com . ibm . ws . webcontainer . osgi . container . DeployedModule deployedModuleImpl = ( com . ibm . ws . webcontainer . osgi . container . DeployedModule ) deployedModule ; String ct = deployedModuleImpl . getProperContextRoot ( ) ; String contextRoot = deployedModuleImpl . getMappingContextRoot ( ) ; String displayNa...
public class CmsTypesTab { /** * Updates the types list . < p > * @ param types the new types list * @ param selectedTypes the list of types to select */ public void updateContent ( List < CmsResourceTypeBean > types , List < String > selectedTypes ) { } }
clearList ( ) ; fillContent ( types , selectedTypes ) ;
public class ByteBufQueue { /** * Returns the first byte from this queue without any recycling . * @ see # getByte ( ) . */ @ Contract ( pure = true ) public byte peekByte ( ) { } }
assert hasRemaining ( ) ; ByteBuf buf = bufs [ first ] ; return buf . peek ( ) ;
public class MethodSignatureKeyServiceLocator { /** * 注入服务 * @ param exporter * 服务的实例或者封装类 * @ return 是否注册成功 * @ see com . baidu . beidou . navi . server . locator . ServiceLocator # regiserService ( java . lang . Object ) */ @ Override public boolean regiserService ( NaviRpcExporter exporter ) { } }
Class < ? > interf = exporter . getServiceInterface ( ) ; Object bean = exporter . getServiceBean ( ) ; List < AppIdToken > appIdTokens = getAuthIfPossible ( bean ) ; String interfSimpleName = interf . getSimpleName ( ) ; try { exporters . put ( exporter . getName ( ) , exporter ) ; if ( interf . isAssignableFrom ( bea...
public class AbstractReady { /** * { @ inheritDoc } */ @ Override public final < M extends Model > M getModel ( final UniqueKey < M > modelKey ) { } }
localFacade ( ) . globalFacade ( ) . trackEvent ( JRebirthEventType . ACCESS_MODEL , this . getClass ( ) , modelKey . classField ( ) ) ; return localFacade ( ) . globalFacade ( ) . uiFacade ( ) . retrieve ( modelKey ) ;