signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class InternalPartitionServiceImpl { /** * Called on the master node to publish the current partition state to all cluster nodes . It will not publish the partition * state if the partitions have not yet been initialized , there is ongoing repartitioning or a node is joining the cluster . */ @ SuppressWarnings...
if ( ! partitionStateManager . isInitialized ( ) ) { // do not send partition state until initialized ! return ; } if ( ! node . isMaster ( ) ) { return ; } if ( ! areMigrationTasksAllowed ( ) ) { // migration is disabled because of a member leave , wait till enabled ! return ; } PartitionRuntimeState partitionState = ...
public class UrlHelper { /** * Returns the baseUri of the request : http : / / www . example . com : 8080 / example * @ param request the current HttpServletRequest * @ return base uri including protocol , host , port and context path */ public static String baseUriOf ( final HttpServletRequest request ) { } }
final StringBuffer requestUrl = request . getRequestURL ( ) ; return requestUrl != null ? requestUrl . substring ( 0 , requestUrl . indexOf ( request . getServletPath ( ) ) ) : "" ;
public class Streams { /** * Repeat in a Stream until specified predicate holds * < pre > * { @ code * count = 0; * assertThat ( Streams . cycleUntil ( Stream . of ( 1,2,2,3) * , next - > count + + > 10 ) * . collect ( CyclopsCollectors . toList ( ) ) , equalTo ( Arrays . asList ( 1 , 2 , 2 , 3 , 1 , 2 , 2 ...
return Streams . takeUntil ( Streams . cycle ( stream ) , predicate ) ;
public class AVIMFileMessage { /** * 判断是不是通过外部设置 url 来的 AVFile * @ param avFile * @ return */ static boolean isExternalAVFile ( AVFile avFile ) { } }
return null != avFile && null != avFile . getMetaData ( ) && avFile . getMetaData ( ) . containsKey ( "__source" ) && avFile . getMetaData ( ) . get ( "__source" ) . equals ( "external" ) ;
public class RedisURI { /** * Create a Redis URI from host and port . * @ param host the host * @ param port the port * @ return An instance of { @ link RedisURI } containing details from the { @ code host } and { @ code port } . */ public static RedisURI create ( String host , int port ) { } }
return Builder . redis ( host , port ) . build ( ) ;
public class JpaAttribute { public String getGeneratedValueAnnotation ( ) { } }
if ( useSequenceNameShortcut ( ) ) { return getGeneratedValueForSequenceNameByConfiguration ( ) ; } if ( attribute . getColumnConfig ( ) . useConfigForIdGenerator ( ) ) { // TODO : explain why we do not directly check attribute . getColumnConfig ( ) . hasGeneratedValue ( ) in the if statement above . return getGenerate...
public class Objects2 { /** * Performs emptiness and nullness check . * @ see # checkNotEmpty ( Object , String , Object . . . ) */ public static < T > T checkNotEmpty ( T reference , Object errorMessage ) { } }
checkNotNull ( reference , "Expected not null object, got '%s'" , reference ) ; checkNotEmpty ( reference , String . valueOf ( errorMessage ) , Arrays2 . EMPTY_ARRAY ) ; return reference ;
public class SettingsPack { /** * Sets the maximum number of bytes a connection may have pending in the disk * write queue before its download rate is being throttled . This prevents * fast downloads to slow medias to allocate more memory indefinitely . * This should be set to at least 16 kB to not completely dis...
sp . set_int ( settings_pack . int_types . max_queued_disk_bytes . swigValue ( ) , value ) ; return this ;
public class MultipartProcessor { /** * Adds the final boundary to the multipart message and closes streams . */ public void finish ( ) throws IOException { } }
writer . append ( "--" + boundary + "--" ) . append ( LINE_BREAK ) ; writer . flush ( ) ; writer . close ( ) ; outputStream . flush ( ) ; outputStream . close ( ) ;
public class FibonacciHeap { /** * Decrease the key of a node . */ private void decreaseKeyWithComparator ( Node < K , V > n , K newKey ) { } }
int c = comparator . compare ( newKey , n . key ) ; if ( c > 0 ) { throw new IllegalArgumentException ( "Keys can only be decreased!" ) ; } n . key = newKey ; if ( c == 0 ) { return ; } if ( n . next == null ) { throw new IllegalArgumentException ( "Invalid handle!" ) ; } // if not root and heap order violation Node < ...
public class JsonObject { /** * Returns the value mapped by { @ code name } if it exists and is a { @ code * JsonArray } , or null otherwise . */ public JsonArray optJsonArray ( String name ) { } }
JsonElement el = null ; try { el = get ( name ) ; } catch ( JsonException e ) { return null ; } if ( ! el . isJsonArray ( ) ) { return null ; } return el . asJsonArray ( ) ;
public class AbstractDatabase { /** * The main save method . */ private boolean save ( Document document , boolean deletion , ConcurrencyControl concurrencyControl ) throws CouchbaseLiteException { } }
if ( deletion && ! document . exists ( ) ) { throw new CouchbaseLiteException ( "Cannot delete a document that has not yet been saved." , CBLError . Domain . CBLITE , CBLError . Code . NOT_FOUND ) ; } C4Document curDoc = null ; C4Document newDoc = null ; synchronized ( lock ) { mustBeOpen ( ) ; prepareDocument ( docume...
public class CmsEditSiteForm { /** * Are the aliase valid ? < p > * @ return true if ok */ boolean isValidAliase ( ) { } }
boolean ret = true ; for ( I_CmsEditableGroupRow row : m_aliasGroup . getRows ( ) ) { FormLayout layout = ( FormLayout ) ( row . getComponent ( ) ) ; TextField field = ( TextField ) layout . getComponent ( 0 ) ; ret = ret & field . isValid ( ) ; } return ret ;
public class BasePostprocessor { /** * Copies the content of { @ code sourceBitmap } to { @ code destBitmap } . Both bitmaps must have the * same width and height . If their { @ link Bitmap . Config } are identical , the memory is directly * copied . Otherwise , the { @ code sourceBitmap } is drawn into { @ code de...
if ( destBitmap . getConfig ( ) == sourceBitmap . getConfig ( ) ) { Bitmaps . copyBitmap ( destBitmap , sourceBitmap ) ; } else { // The bitmap configurations might be different when the source bitmap ' s configuration is // null , because it uses an internal configuration and the destination bitmap ' s configuration /...
public class JobInstanceService { /** * This method exists only so that we can scope the transaction properly */ private void internalUpdateJobStateAndResult ( final JobInstance job ) { } }
transactionTemplate . execute ( new TransactionCallbackWithoutResult ( ) { protected void doInTransactionWithoutResult ( TransactionStatus status ) { jobInstanceDao . updateStateAndResult ( job ) ; if ( job . isCompleted ( ) ) { buildPropertiesService . saveCruiseProperties ( job ) ; } } } ) ;
public class DeviceFinder { /** * Send a device lost announcement to all registered listeners . * @ param announcement the last message received from the vanished device */ private void deliverLostAnnouncement ( final DeviceAnnouncement announcement ) { } }
for ( final DeviceAnnouncementListener listener : getDeviceAnnouncementListeners ( ) ) { SwingUtilities . invokeLater ( new Runnable ( ) { @ Override public void run ( ) { try { listener . deviceLost ( announcement ) ; } catch ( Throwable t ) { logger . warn ( "Problem delivering device lost announcement to listener" ,...
public class Matrix4d { /** * Set only the translation components < code > ( m30 , m31 , m32 ) < / code > of this matrix to the given values < code > ( x , y , z ) < / code > . * To build a translation matrix instead , use { @ link # translation ( double , double , double ) } . * To apply a translation , use { @ li...
m30 = x ; m31 = y ; m32 = z ; properties &= ~ ( PROPERTY_PERSPECTIVE | PROPERTY_IDENTITY ) ; return this ;
public class BitcoinBlockReader { /** * This function is used to read from a raw Bitcoin block some identifier . Note : Does not change ByteBuffer position * @ param rawByteBuffer ByteBuffer as read by readRawBlock * @ return byte array containing hashMerkleRoot and prevHashBlock */ public byte [ ] getKeyFromRawBlo...
rawByteBuffer . mark ( ) ; byte [ ] magicNo = new byte [ 4 ] ; byte [ ] hashMerkleRoot = new byte [ 32 ] ; byte [ ] hashPrevBlock = new byte [ 32 ] ; // magic no ( skip ) rawByteBuffer . get ( magicNo , 0 , 4 ) ; // blocksize ( skip ) rawByteBuffer . getInt ( ) ; // version ( skip ) rawByteBuffer . getInt ( ) ; // hash...
public class CsvBindingErrors { /** * フィールドエラーを登録します 。 * @ param field フィールドパス 。 * @ param errorCode エラーコード 。 */ public void rejectValue ( final String field , final String errorCode ) { } }
rejectValue ( field , null , errorCode , Collections . emptyMap ( ) , null ) ;
public class Benchmark { /** * Converts the time to different scales * @ param time is the time to convert * @ param from is the units of the time to convert from * @ param to is the units of the time to convert to * @ return the time in the units specified */ public double convert ( double time , TimeUnit from...
return time * factorOf ( to ) / factorOf ( from ) ;
public class WaitPageInterceptor { /** * Copy errors from a context to another context . * @ param source source containing errors to copy * @ param destination where errors will be copied */ protected void copyErrors ( ActionBeanContext source , ActionBeanContext destination ) { } }
destination . getValidationErrors ( ) . putAll ( source . getValidationErrors ( ) ) ;
public class Preconditions { /** * Ensures a collection is neither null nor empty . * @ param collection collection to be validated . * @ param errorMessage error message to be thrown if collection is null or empty . * @ param < T > type of the collection item . * @ return collection passed in . */ @ Nonnull pu...
checkState ( collection != null && ! collection . isEmpty ( ) , errorMessage ) ; return collection ;
public class TaskEmailNotifier { /** * Creates the mime message for the e - mail . * @ param taskInstance the task instance * @ param outcome the resulting task status or state * @ return the message */ protected void sendEmail ( TaskRuntimeContext context , String outcome ) throws ObserverException { } }
TaskInstance taskInstance = context . getTaskInstance ( ) ; TemplatedEmail templatedEmail = new TemplatedEmail ( ) ; templatedEmail . setFromAddress ( getFromAddress ( ) ) ; templatedEmail . setSubject ( getSubject ( taskInstance , outcome ) ) ; templatedEmail . setHtml ( true ) ; templatedEmail . setTemplateAssetVerSp...
public class UcsApi { /** * Identify the contact for the interaction * @ param id id of the Interaction ( required ) * @ param identifyContactData ( required ) * @ return ApiResponse & lt ; ApiSuccessResponse & gt ; * @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the...
com . squareup . okhttp . Call call = identifyContactValidateBeforeCall ( id , identifyContactData , null , null ) ; Type localVarReturnType = new TypeToken < ApiSuccessResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class CombinationGenerator { private void moveIndexesToNextCombination ( ) { } }
for ( int i = currentIndexes . length - 1 , j = list . size ( ) - 1 ; i >= 0 ; i -- , j -- ) { if ( currentIndexes [ i ] != j ) { currentIndexes [ i ] ++ ; for ( int k = i + 1 ; k < currentIndexes . length ; k ++ ) { currentIndexes [ k ] = currentIndexes [ k - 1 ] + 1 ; } return ; } } // otherwise , we are all done : c...
public class PropertiesConfigNodeFactory { /** * Load a given { @ link java . util . Properties } into a { @ link ConfigNode } . * @ param input The properties to load . * @ return The loaded { @ code ConfigNode } . */ public static ConfigNode load ( Properties input ) { } }
ConfigNode config = new ConfigNode ( ) ; load ( config , input ) ; return config ;
public class ID3v2ExtendedHeader { /** * A helper function for the getBytes method that returns a byte array * representing the extended flags field of the extended header . * @ return the extended flags field of the extended header */ private byte [ ] getFlagBytes ( ) { } }
byte [ ] b = new byte [ numFlagBytes ] ; int bytesCopied = 1 ; b [ 0 ] = 0 ; if ( update ) { b [ 0 ] |= 0x80 ; b [ bytesCopied ++ ] = 0 ; } if ( crced ) { b [ 0 ] |= 0x40 ; b [ bytesCopied ++ ] = ( byte ) crc . length ; System . arraycopy ( crc , 0 , b , bytesCopied , crc . length ) ; bytesCopied += crc . length ; } if...
public class ModelControllerClientServerDeploymentManager { /** * { @ inheritDoc } */ @ Override protected Future < ModelNode > executeOperation ( Operation operation ) { } }
return client . executeAsync ( operation , null ) ;
public class PhysicalTable { /** * Read the record given the ID to this persistent object . * Note : You can ' t use an OBJECT _ ID handle , as these tables are non - persistent . * @ param objectID java . lang . Object The handle to lookup . * @ return true if found . * @ exception DBException File exception ....
try { if ( iHandleType == DBConstants . OBJECT_ID_HANDLE ) { return super . doSetHandle ( bookmark , iHandleType ) ; // ? throw new DBException ( " Object IDs are not supported for PhysicalTables ( non persistent ) " ) ; } else return super . doSetHandle ( bookmark , iHandleType ) ; } catch ( DBException ex ) { throw D...
public class SFImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case BasePackage . SF__NUMBER : setNumber ( NUMBER_EDEFAULT ) ; return ; case BasePackage . SF__OFFSET : setOffset ( OFFSET_EDEFAULT ) ; return ; case BasePackage . SF__ID : setId ( ID_EDEFAULT ) ; return ; case BasePackage . SF__LENGTH : setLength ( LENGTH_EDEFAULT ) ; return ; case BasePackage ...
public class RgbaColor { /** * See http : / / www . w3 . org / TR / css3 - color / # hsl - color */ private static float hue2rgb ( float m1 , float m2 , float h ) { } }
if ( h < 0 ) h += 1 ; if ( h > 1 ) h -= 1 ; if ( h * 6f < 1 ) return m1 + ( m2 - m1 ) * 6f * h ; if ( h * 2f < 1 ) return m2 ; if ( h * 3f < 2 ) return m1 + ( m2 - m1 ) * ( 2 / 3f - h ) * 6f ; return m1 ;
public class RequestEvent { /** * < p > getExceptionCause . < / p > * @ return a { @ link org . glassfish . jersey . server . monitoring . RequestEvent . ExceptionCause } object . */ public org . glassfish . jersey . server . monitoring . RequestEvent . ExceptionCause getExceptionCause ( ) { } }
return event . getExceptionCause ( ) ;
public class OAuth2Credentials { /** * Indicates if the access token has expired * @ return true if expired , false otherwise */ public boolean hasExpired ( ) { } }
if ( expiresAt == null ) { LOGGER . debug ( "hasExpired - token is not expirable" ) ; return false ; } long now = System . currentTimeMillis ( ) ; if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "hasExpired? - now: {} expiredAt: {} " , new Date ( now ) , expiresAt ) ; } return now > expiresAt . getTime ( ) ;
public class ViewDragHelper { /** * The result of a call to this method is equivalent to * { @ link # processTouchEvent ( android . view . MotionEvent ) } receiving an ACTION _ CANCEL event . */ public void cancel ( ) { } }
mActivePointerId = INVALID_POINTER ; clearMotionHistory ( ) ; if ( mVelocityTracker != null ) { mVelocityTracker . recycle ( ) ; mVelocityTracker = null ; }
public class JMonthChooser { /** * Enable or disable the JMonthChooser . * @ param enabled * the new enabled value */ public void setEnabled ( boolean enabled ) { } }
super . setEnabled ( enabled ) ; comboBox . setEnabled ( enabled ) ; if ( spinner != null ) { spinner . setEnabled ( enabled ) ; }
public class RocksDbWrapper { /** * Gets a value from a column family , specifying read options . * @ param cfName * @ param readOptions * @ param key * @ return * @ throws RocksDbException */ public byte [ ] get ( String cfName , ReadOptions readOptions , String key ) throws RocksDbException { } }
if ( cfName == null ) { cfName = DEFAULT_COLUMN_FAMILY ; } ColumnFamilyHandle cfh = columnFamilyHandles . get ( cfName ) ; if ( cfh == null ) { throw new RocksDbException . ColumnFamilyNotExists ( cfName ) ; } return get ( cfh , readOptions , key . getBytes ( StandardCharsets . UTF_8 ) ) ;
public class FunctionInjector { /** * If required , rewrite the statement containing the call expression . * @ see ExpressionDecomposer # canExposeExpression */ void maybePrepareCall ( Reference ref ) { } }
CallSiteType callSiteType = classifyCallSite ( ref ) ; callSiteType . prepare ( this , ref ) ;
public class AddAdGroupBidModifier { /** * Runs the example . * @ param adWordsServices the services factory . * @ param session the session . * @ param adGroupId the ID of the ad group where bid modifiers will be added . * @ throws ApiException if the API request failed with one or more service errors . * @ ...
// Get the AdGroupBidModifierService . AdGroupBidModifierServiceInterface adGroupBidModifierService = adWordsServices . get ( session , AdGroupBidModifierServiceInterface . class ) ; // Create mobile platform . The ID can be found in the documentation . // https : / / developers . google . com / adwords / api / docs / ...
public class MetricCollectingService { /** * Returns a new { @ link Service } decorator that tracks request stats using { @ link MeterRegistry } . */ public static < I extends Request , O extends Response > Function < Service < I , O > , MetricCollectingService < I , O > > newDecorator ( MeterIdPrefixFunction meterIdPr...
requireNonNull ( meterIdPrefixFunction , "meterIdPrefixFunction" ) ; return delegate -> new MetricCollectingService < > ( delegate , meterIdPrefixFunction ) ;
public class HostVsanInternalSystem { /** * Query information about VSAN DOM objects that are currently syncing data . Instead of returning all objects , * only such objects are returned that are currently resyncing any stale components or syncing fresh replicas . * The API returns the same output format as queryVs...
return getVimService ( ) . querySyncingVsanObjects ( getMOR ( ) , uuids ) ;
public class ArrayUtils { /** * Create an array starting with first element and followed by others . * This can be useful when handling vararg parameters and when you want to * force to have at least one value . * @ param first * the first element * @ param others * the other elements * @ param < T > * ...
@ SuppressWarnings ( "unchecked" ) T [ ] arr = ( T [ ] ) Array . newInstance ( first . getClass ( ) , 1 ) ; arr [ 0 ] = first ; return concat ( arr , others ) ;
public class DisasterRecoveryConfigurationsInner { /** * Fails over from the current primary server to this server . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of ...
return ServiceFuture . fromResponse ( beginFailoverWithServiceResponseAsync ( resourceGroupName , serverName , disasterRecoveryConfigurationName ) , serviceCallback ) ;
public class SinglePageDocument { /** * Prepare the document before rendering . * @ param outputStream output stream to render to , null if only for layout * @ param format format * @ throws DocumentException oops * @ throws IOException oops * @ throws PrintingException oops */ private void prepare ( ) throws...
if ( baos == null ) { baos = new ByteArrayOutputStream ( ) ; // let it grow as much as needed } baos . reset ( ) ; boolean resize = false ; if ( page . getConstraint ( ) . getWidth ( ) == 0 || page . getConstraint ( ) . getHeight ( ) == 0 ) { resize = true ; } // Create a document in the requested ISO scale . Document ...
public class PoolEvaluateAutoScaleHeaders { /** * Set the time at which the resource was last modified . * @ param lastModified the lastModified value to set * @ return the PoolEvaluateAutoScaleHeaders object itself . */ public PoolEvaluateAutoScaleHeaders withLastModified ( DateTime lastModified ) { } }
if ( lastModified == null ) { this . lastModified = null ; } else { this . lastModified = new DateTimeRfc1123 ( lastModified ) ; } return this ;
public class EvalCacheImpl { public Object getExprValue ( int id ) { } }
if ( tc . isEntryEnabled ( ) ) tc . entry ( this , cclass , "getExprValue" , "id: " + new Integer ( id ) ) ; Object result = null ; if ( cacheTag [ id ] == generation ) result = cacheValue [ id ] ; if ( tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "getExprValue" , "result: " + result ) ; return result ;
public class SpringApplication { /** * Called to log active profile information . * @ param context the application context */ protected void logStartupProfileInfo ( ConfigurableApplicationContext context ) { } }
Log log = getApplicationLog ( ) ; if ( log . isInfoEnabled ( ) ) { String [ ] activeProfiles = context . getEnvironment ( ) . getActiveProfiles ( ) ; if ( ObjectUtils . isEmpty ( activeProfiles ) ) { String [ ] defaultProfiles = context . getEnvironment ( ) . getDefaultProfiles ( ) ; log . info ( "No active profile set...
public class LocalVariableAnnotationNode { /** * Makes the given visitor visit this type annotation . * @ param mv * the visitor that must visit this annotation . * @ param visible * < tt > true < / tt > if the annotation is visible at runtime . */ public void accept ( final MethodVisitor mv , boolean visible )...
Label [ ] start = new Label [ this . start . size ( ) ] ; Label [ ] end = new Label [ this . end . size ( ) ] ; int [ ] index = new int [ this . index . size ( ) ] ; for ( int i = 0 ; i < start . length ; ++ i ) { start [ i ] = this . start . get ( i ) . getLabel ( ) ; end [ i ] = this . end . get ( i ) . getLabel ( ) ...
public class PagedList { /** * Removes a previously added callback . * @ param callback Callback , previously added . * @ see # addWeakCallback ( List , Callback ) */ @ SuppressWarnings ( "WeakerAccess" ) public void removeWeakCallback ( @ NonNull Callback callback ) { } }
for ( int i = mCallbacks . size ( ) - 1 ; i >= 0 ; i -- ) { Callback currentCallback = mCallbacks . get ( i ) . get ( ) ; if ( currentCallback == null || currentCallback == callback ) { // found callback , or empty weak ref mCallbacks . remove ( i ) ; } }
public class HttpsURLConnection { /** * Returns the server ' s principal which was established as part of * defining the session . * Note : Subclasses should override this method . If not overridden , it * will default to returning the X500Principal of the server ' s end - entity * certificate for certificate -...
java . security . cert . Certificate [ ] certs = getServerCertificates ( ) ; return ( ( X500Principal ) ( ( X509Certificate ) certs [ 0 ] ) . getSubjectX500Principal ( ) ) ;
public class ScopeContext { /** * @ param cfmlFactory */ private void clearUnusedMemoryScope ( CFMLFactoryImpl cfmlFactory , int type ) { } }
Map < String , Map < String , Scope > > contexts = type == Scope . SCOPE_CLIENT ? cfClientContexts : cfSessionContexts ; if ( contexts . size ( ) == 0 ) return ; Object [ ] arrContexts = contexts . keySet ( ) . toArray ( ) ; ApplicationListener listener = cfmlFactory . getConfig ( ) . getApplicationListener ( ) ; Objec...
public class ClustersInner { /** * Rotate disk encryption key of the specified HDInsight cluster . * @ param resourceGroupName The name of the resource group . * @ param clusterName The name of the cluster . * @ param parameters The parameters for the disk encryption operation . * @ throws IllegalArgumentExcept...
beginRotateDiskEncryptionKeyWithServiceResponseAsync ( resourceGroupName , clusterName , parameters ) . toBlocking ( ) . single ( ) . body ( ) ;
public class ExceptionFormatter { /** * Returns a formatted stack trace for an exception . * < p > This method provides a full ( non - truncated ) trace delimited by * { @ link # DELIMITER } . Currently it doesn ' t make any use of Java 7 ' s < a * href = " http : / / docs . oracle . com / javase / tutorial / ess...
String ex = "" ; ex += formatTopLevelError ( error ) ; ex += formatStackTraceElements ( error . getStackTraceElementProxyArray ( ) ) ; IThrowableProxy cause = error . getCause ( ) ; ex += DELIMITER ; while ( cause != null ) { ex += formatTopLevelError ( cause ) ; StackTraceElementProxy [ ] arr = cause . getStackTraceEl...
public class ControlClientAnnotationProcessor { /** * Enforces the VersionRequired annotation for control fields . */ private void enforceVersionRequired ( FieldDeclaration f , InterfaceDeclaration controlIntf ) { } }
VersionRequired versionRequired = f . getAnnotation ( VersionRequired . class ) ; Version versionPresent = controlIntf . getAnnotation ( Version . class ) ; if ( versionRequired != null ) { int majorRequired = - 1 ; try { majorRequired = versionRequired . major ( ) ; } catch ( NullPointerException ignore ) { /* the maj...
public class HttpClientBuilder { /** * Map the parameters in { @ link HttpClientConfiguration } to configuration on a * { @ link org . apache . http . impl . client . HttpClientBuilder } instance * @ param builder * @ param manager * @ param name * @ return the configured { @ link CloseableHttpClient } */ pro...
final String cookiePolicy = configuration . isCookiesEnabled ( ) ? CookieSpecs . DEFAULT : CookieSpecs . IGNORE_COOKIES ; final Integer timeout = ( int ) configuration . getTimeout ( ) . toMilliseconds ( ) ; final Integer connectionTimeout = ( int ) configuration . getConnectionTimeout ( ) . toMilliseconds ( ) ; final ...
public class dnspolicy64 { /** * Use this API to fetch filtered set of dnspolicy64 resources . * set the filter parameter values in filtervalue object . */ public static dnspolicy64 [ ] get_filtered ( nitro_service service , filtervalue [ ] filter ) throws Exception { } }
dnspolicy64 obj = new dnspolicy64 ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; dnspolicy64 [ ] response = ( dnspolicy64 [ ] ) obj . getfiltered ( service , option ) ; return response ;
public class CommonOps_DDF3 { /** * < p > Performs the following operation : < br > * < br > * c = a - b < br > * c < sub > i < / sub > = a < sub > i < / sub > - b < sub > i < / sub > < br > * Vector C can be the same instance as Vector A and / or B . * @ param a A Vector . Not modified . * @ param b A Vect...
c . a1 = a . a1 - b . a1 ; c . a2 = a . a2 - b . a2 ; c . a3 = a . a3 - b . a3 ;
public class DatePicker { /** * This function return the current date of a date picker in the format of " MM / dd / yyyy " * @ return the current date */ public String getDate ( ) { } }
SimpleDateFormat formatter = new SimpleDateFormat ( "MM/dd/yyyy" ) ; String date = formatter . format ( calendar . getTime ( ) ) ; return date ;
public class PrintStreamOutput { /** * Prints text to output stream , replacing parameter start and end * placeholders * @ param text the String to print */ protected void print ( String text ) { } }
String tableStart = format ( PARAMETER_TABLE_START , PARAMETER_TABLE_START ) ; String tableEnd = format ( PARAMETER_TABLE_END , PARAMETER_TABLE_END ) ; boolean containsTable = text . contains ( tableStart ) && text . contains ( tableEnd ) ; String textToPrint = containsTable ? transformPrintingTable ( text , tableStart...
public class CreateSyntheticOverheadViewS { /** * Computes overhead view of input image . All pixels in input image are assumed to be on the ground plane . * @ param input ( Input ) Camera image . * @ param output ( Output ) Image containing overhead view . */ public void process ( T input , T output ) { } }
this . output = FactoryGImageGray . wrap ( output , this . output ) ; interp . setImage ( input ) ; int indexMap = 0 ; for ( int i = 0 ; i < output . height ; i ++ ) { int indexOut = output . startIndex + i * output . stride ; for ( int j = 0 ; j < output . width ; j ++ , indexOut ++ , indexMap ++ ) { Point2D_F32 p = m...
public class Util { /** * Computes the raw delta area between two quantile sketches for the * { @ link # kolmogorovSmirnovTest ( DoubleSketch , DoubleSketch , double ) * Kolmogorov - Smirnov Test } * method . * @ param sketch1 Input DoubleSketch 1 * @ param sketch2 Input DoubleSketch 2 * @ return the raw de...
final DoublesAuxiliary p = new DoublesAuxiliary ( sketch1 ) ; final DoublesAuxiliary q = new DoublesAuxiliary ( sketch2 ) ; final double [ ] pSamplesArr = p . auxSamplesArr_ ; final double [ ] qSamplesArr = q . auxSamplesArr_ ; final long [ ] pCumWtsArr = p . auxCumWtsArr_ ; final long [ ] qCumWtsArr = q . auxCumWtsArr...
public class CreateDeploymentConfigRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CreateDeploymentConfigRequest createDeploymentConfigRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( createDeploymentConfigRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createDeploymentConfigRequest . getDeploymentConfigName ( ) , DEPLOYMENTCONFIGNAME_BINDING ) ; protocolMarshaller . marshall ( createDeploymentConfigReques...
public class Engine { /** * Gets the output variable of the given name after iterating the output * variables . The cost of this method is O ( n ) , where n is the number of output * variables in the engine . For performance , please get the variables by * index . * @ param name is the name of the output variab...
for ( OutputVariable outputVariable : this . outputVariables ) { if ( outputVariable . getName ( ) . equals ( name ) ) { return outputVariable ; } } throw new RuntimeException ( String . format ( "[engine error] no output variable by name <%s>" , name ) ) ;
public class MySqlDdlParser { /** * { @ inheritDoc } * @ see org . modeshape . sequencer . ddl . StandardDdlParser # parseCreateStatement ( org . modeshape . sequencer . ddl . DdlTokenStream , * org . modeshape . sequencer . ddl . node . AstNode ) */ @ Override protected AstNode parseCreateStatement ( DdlTokenStrea...
assert tokens != null ; assert parentNode != null ; if ( tokens . matches ( STMT_CREATE_INDEX ) ) { return parseStatement ( tokens , MySqlStatementStartPhrases . STMT_CREATE_INDEX , parentNode , TYPE_CREATE_INDEX_STATEMENT ) ; } else if ( tokens . matches ( STMT_CREATE_UNIQUE_INDEX ) ) { return parseStatement ( tokens ...
public class OffheapIncrementalIndex { /** * NOTE : This is NOT thread - safe with add . . . so make sure all the adding is DONE before closing */ @ Override public void close ( ) { } }
super . close ( ) ; facts . clear ( ) ; indexAndOffsets . clear ( ) ; if ( selectors != null ) { selectors . clear ( ) ; } Closer c = Closer . create ( ) ; aggBuffers . forEach ( c :: register ) ; try { c . close ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } aggBuffers . clear ( ) ;
public class GracefulShutdownService { /** * Register a shutdown hook with the service . * @ param shutdownHook a class that implements { @ link GracefulShutdownHook } * @ throws IllegalStateException if the server shutdown is already in progress and the hook cannot be registered * @ throws NullPointerException i...
if ( isShuttingDown . get ( ) ) { // Avoid any changes to the shutdown hooks set when the shutdown is already in progress throw new IllegalStateException ( "Couldn't register shutdown hook because shutdown is already in progress" ) ; } shutdownHooks . add ( requireNonNull ( shutdownHook , "shutdownHook cannot be null" ...
public class OkCoinTradeServiceRaw { /** * 批量下单 * @ param symbol * @ param type 限价单 ( buy / sell ) * @ param ordersData " [ { price : 3 , amount : 5 , type : ' sell ' } , { price : 3 , amount : 3 , type : ' buy ' } ] " * 最终买卖类型由orders _ data 中type 为准 , 如orders _ data不设定type 则由上面type设置为准 。 若 , 上面type没有设置 , order...
OkCoinMoreTradeResult tradeResult = okCoin . batchTrade ( apikey , symbol , type , ordersData , signatureCreator ( ) ) ; return returnOrThrow ( tradeResult ) ;
public class SnowflakeResultChunk { /** * Checks that all data has been added after parsing . * @ throws SnowflakeSQLException when rows are not all downloaded */ public final void ensureRowsComplete ( ) throws SnowflakeSQLException { } }
// Check that all the rows have been decoded , raise an error if not if ( rowCount != currentRow ) { throw new SnowflakeSQLException ( SqlState . INTERNAL_ERROR , ErrorCode . INTERNAL_ERROR . getMessageCode ( ) , "Exception: expected " + rowCount + " rows and received " + currentRow ) ; }
public class DSClient { /** * Iterate and return . * @ param rSet * the r set * @ return the list */ private List iterateAndReturn ( ResultSet rSet ) { } }
Iterator < Row > rowIter = rSet . iterator ( ) ; List results = new ArrayList ( ) ; while ( rowIter . hasNext ( ) ) { Row row = rowIter . next ( ) ; ColumnDefinitions columnDefs = row . getColumnDefinitions ( ) ; Iterator < Definition > columnDefIter = columnDefs . iterator ( ) ; Map rowData = new HashMap ( ) ; while (...
public class HostMessenger { /** * Synchronization protects m _ knownFailedHosts and ensures that every failed host is only reported * once */ @ Override public synchronized void reportForeignHostFailed ( int hostId ) { } }
long initiatorSiteId = CoreUtils . getHSIdFromHostAndSite ( hostId , AGREEMENT_SITE_ID ) ; m_agreementSite . reportFault ( initiatorSiteId ) ; if ( ! m_shuttingDown ) { // should be the single console message a user sees when another node fails networkLog . warn ( String . format ( "Host %d failed. Cluster remains oper...
public class StreamRemoteConnector { /** * Register for connection change events , when there is a change in connectivity status * on the underlying transport . * @ param listener the listener */ @ Override public void registerConnectionChangeListener ( ConnectionChangeListener listener ) { } }
connectionListeners . add ( listener ) ; executor . execute ( ( ) -> listener . connectionChange ( this , isConnected ( ) ) ) ;
public class CmsPathMap { /** * Converts a path into list form . < p > * @ param path the path to convert * @ return the list of the path elements */ private List < String > splitPath ( String path ) { } }
List < String > result = new ArrayList < String > ( ) ; for ( String token : path . split ( "/" ) ) { if ( "" . equals ( token ) ) { continue ; } result . add ( token ) ; } return result ;
public class JvmGenericArrayTypeReferenceImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case TypesPackage . JVM_GENERIC_ARRAY_TYPE_REFERENCE__COMPONENT_TYPE : setComponentType ( ( JvmTypeReference ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
public class DecimalFormat { /** * Matches a string at text [ pos ] and return the index of the next character upon * success . Return - 1 on failure . Match a run of white space in str with a run of * white space in text . */ static final int match ( String text , int pos , String str ) { } }
for ( int i = 0 ; i < str . length ( ) && pos >= 0 ; ) { int ch = UTF16 . charAt ( str , i ) ; i += UTF16 . getCharCount ( ch ) ; if ( isBidiMark ( ch ) ) { continue ; } pos = match ( text , pos , ch ) ; if ( PatternProps . isWhiteSpace ( ch ) ) { i = skipPatternWhiteSpace ( str , i ) ; } } return pos ;
public class EjbDescriptors { /** * Adds an EJB descriptor to the maps * @ param ejbDescriptor The EJB descriptor to add */ private < T > void add ( EjbDescriptor < T > ejbDescriptor ) { } }
InternalEjbDescriptor < T > internalEjbDescriptor = InternalEjbDescriptor . of ( ejbDescriptor ) ; ejbByName . put ( ejbDescriptor . getEjbName ( ) , internalEjbDescriptor ) ; ejbByClass . put ( ejbDescriptor . getBeanClass ( ) , internalEjbDescriptor . getEjbName ( ) ) ;
public class CodeAttr { /** * Returns the length ( in bytes ) of this object in the class file . */ public int getLength ( ) { } }
int length = 12 ; if ( mCodeBuffer != null ) { length += mCodeBuffer . getByteCodes ( ) . length ; ExceptionHandler [ ] handlers = mCodeBuffer . getExceptionHandlers ( ) ; if ( handlers != null ) { length += 8 * handlers . length ; } } int size = mAttributes . size ( ) ; for ( int i = 0 ; i < size ; i ++ ) { length += ...
public class AsynchronousRequest { /** * For more info on TokenInfo API go < a href = " https : / / wiki . guildwars2 . com / wiki / API : 2 / tokeninfo " > here < / a > < br / > * Give user the access to { @ link Callback # onResponse ( Call , Response ) } and { @ link Callback # onFailure ( Call , Throwable ) } met...
isParamValid ( new ParamChecker ( ParamType . API , API ) ) ; gw2API . getAPIInfo ( API ) . enqueue ( callback ) ;
public class Country { /** * Compares two ISOCountry objects for ordering . * Returns the value < code > zero < / code > if the two countries have equal * country codes . Returns a value less than < code > zero < / code > if this * country code is before the country argument and a value greater than * < code > ...
String thisCode = this . getCode ( ) ; String otherCode = country . getCode ( ) ; return thisCode . compareTo ( otherCode ) ;
public class ForkJoinPool { /** * Runs tasks until { @ code isQuiescent ( ) } . We piggyback on * active count ctl maintenance , but rather than blocking * when tasks cannot be found , we rescan until all others cannot * find tasks either . */ final void helpQuiescePool ( WorkQueue w ) { } }
ForkJoinTask < ? > ps = w . currentSteal ; // save context int wc = w . config ; for ( boolean active = true ; ; ) { long c ; WorkQueue q ; ForkJoinTask < ? > t ; if ( wc >= 0 && ( t = w . pop ( ) ) != null ) { // run locals if LIFO ( w . currentSteal = t ) . doExec ( ) ; w . currentSteal = ps ; } else if ( ( q = findN...
public class FrameOutputWriter { /** * Add the FRAME tag for the frame that lists all packages . * @ param contentTree the content tree to which the information will be added */ private void addAllPackagesFrameTag ( Content contentTree ) { } }
HtmlTree frame = HtmlTree . FRAME ( DocPaths . OVERVIEW_FRAME . getPath ( ) , "packageListFrame" , configuration . getText ( "doclet.All_Packages" ) ) ; contentTree . addContent ( frame ) ;
public class EJSDeployedSupport { /** * Returns the context data associated with this method invocation . */ public Map < String , Object > getContextData ( ) { } }
if ( ivContextData == null ) { ivContextData = new HashMap < String , Object > ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getContextData: created empty" ) ; } return ivContextData ;
public class SObject { /** * Load an sobject from classpath by given url path * This method will call { @ link Class # getResource ( String ) } method to open * an inputstream to the resource and then construct an SObject with the * inputstream * @ param url the resource url path * @ return the sobject instan...
InputStream is = SObject . class . getResourceAsStream ( url ) ; if ( null == is ) { return null ; } String filename = S . afterLast ( url , "/" ) ; if ( S . blank ( filename ) ) { filename = url ; } return of ( randomKey ( ) , is , ATTR_FILE_NAME , filename ) ;
public class TypedControllerConfiguration { /** * / * - - - - - GET ROUTES - - - - - */ protected final < REQ , RESP > Route get ( RouteAction < Request < REQ > , Response < RESP > > action , RequestType < REQ > req , ResponseType < RESP > resp ) { } }
return createEntityRoute ( HttpMethod . GET , "" , action , req , resp ) ;
public class UniqueId { /** * Attempts to find suggestions of names given a search term . * @ param search The search term ( possibly empty ) . * @ return A list of known valid names that have UIDs that sort of match * the search term . If the search term is empty , returns the first few * terms . * @ throws ...
return new SuggestCB ( search , max_results ) . search ( ) ;
public class Mediawiki { /** * show a usage */ public void usage ( String msg ) { } }
System . err . println ( msg ) ; showVersion ( ) ; System . err . println ( " usage: java com.bitplan.mediawiki.japi.Mediawiki" ) ; parser . printUsage ( System . err ) ; exitCode = 1 ;
public class AESUtils { /** * Decrypt data using AES . * @ param keyData * @ param iv * initial vector . If { @ code null } or empty , { @ link # DEFAULT _ IV } * will be used . * @ param cipherTransformation * cipher - transformation to use . If empty , { @ link # DEFAULT _ CIPHER _ TRANSFORMATION } * wi...
Cipher cipher = createCipher ( Cipher . DECRYPT_MODE , keyData , iv , cipherTransformation ) ; try ( DdthCipherInputStream cis = new DdthCipherInputStream ( encryptedData , cipher , false ) ) { IOUtils . copy ( cis , output , 1024 ) ; output . flush ( ) ; }
public class DateTime { /** * Parse the timezone offset from the input , returning its millisecond value . */ private static Integer parseTzOffsetMs ( Input s , boolean strict ) { } }
if ( s . index < s . len ) { char c = s . getChar ( ) ; s . index ++ ; int sign ; if ( c == 'Z' ) { return 0 ; } else if ( c == '+' ) { sign = 1 ; } else if ( c == '-' ) { sign = - 1 ; } else { throw new DateFormatException ( "unexpected character, expected one of [Z+-]" , s . str , s . index - 1 ) ; } int tzHours = pa...
public class AbstractProject { /** * List of necessary resources to perform the build of this project . */ public ResourceList getResourceList ( ) { } }
final Set < ResourceActivity > resourceActivities = getResourceActivities ( ) ; final List < ResourceList > resourceLists = new ArrayList < ResourceList > ( 1 + resourceActivities . size ( ) ) ; for ( ResourceActivity activity : resourceActivities ) { if ( activity != this && activity != null ) { // defensive infinite ...
public class CreateKeyRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CreateKeyRequest createKeyRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( createKeyRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createKeyRequest . getPolicy ( ) , POLICY_BINDING ) ; protocolMarshaller . marshall ( createKeyRequest . getDescription ( ) , DESCRIPTION_BINDING ) ; protocolMarshaller...
public class SecurityActions { /** * Load a class using the provided classloader * @ param name * @ return * @ throws PrivilegedActionException */ static Class < ? > loadClass ( final ClassLoader cl , final String name ) throws PrivilegedActionException , ClassNotFoundException { } }
SecurityManager sm = System . getSecurityManager ( ) ; if ( sm == null ) { return cl . loadClass ( name ) ; } else { return AccessController . doPrivileged ( new PrivilegedExceptionAction < Class < ? > > ( ) { public Class < ? > run ( ) throws PrivilegedActionException { try { return cl . loadClass ( name ) ; } catch (...
public class WebACFilter { /** * Add URIs to collect permissions information for . * @ param httpRequest the request . * @ param uri the uri to check . */ private void addURIToAuthorize ( final HttpServletRequest httpRequest , final URI uri ) { } }
@ SuppressWarnings ( "unchecked" ) Set < URI > targetURIs = ( Set < URI > ) httpRequest . getAttribute ( URIS_TO_AUTHORIZE ) ; if ( targetURIs == null ) { targetURIs = new HashSet < > ( ) ; httpRequest . setAttribute ( URIS_TO_AUTHORIZE , targetURIs ) ; } targetURIs . add ( uri ) ;
public class Fn { /** * Split this stream at where { @ code maxWindowSize } or { @ code maxDuration } reaches first . * @ param maxWindowSize * @ param maxDuration * @ param startTime * @ param collectionSupplier * @ return * @ see # window ( Duration , long , LongSupplier , Supplier ) */ public static < T ...
return new Function < Stream < Timed < T > > , Stream < C > > ( ) { @ Override public Stream < C > apply ( final Stream < Timed < T > > s ) { final ObjIterator < C > iter = new ObjIteratorEx < C > ( ) { private long maxDurationInMillis ; private ObjIterator < Timed < T > > iter ; private Timed < T > next = null ; priva...
public class WriterConfig { /** * Public API */ @ Override public Object getProperty ( int id ) { } }
switch ( id ) { // First , Stax 1.0 properties : case PROP_AUTOMATIC_NS : return automaticNamespacesEnabled ( ) ? Boolean . TRUE : Boolean . FALSE ; // Then Stax2 properties : // First , properties common to input / output factories : case PROP_ENABLE_NS : return willSupportNamespaces ( ) ? Boolean . TRUE : Boolean . F...
public class ServiceTools { /** * Get instancename from Dataservice Class * @ param cls * @ return */ public String getInstanceNameFromDataservice ( Class cls ) { } }
DataService dataService = ( DataService ) cls . getAnnotation ( DataService . class ) ; String clsName = dataService . name ( ) ; if ( clsName . isEmpty ( ) ) { clsName = cls . getSimpleName ( ) ; } return getInstanceName ( clsName ) ;
public class CouchDbUtil { /** * create a HTTP POST request . * @ return { @ link HttpConnection } */ public static HttpConnection createPost ( URI uri , String body , String contentType ) { } }
HttpConnection connection = Http . POST ( uri , "application/json" ) ; if ( body != null ) { setEntity ( connection , body , contentType ) ; } return connection ;
public class FileUtils { /** * Sticky bit can be set primarily on directories in UNIX / Linux . * If the sticky bit of is enabled on a directory , only the owner and the root user can delete / * rename the files or directories within that directory . No one else can delete other users data * in this directory ( W...
try { // Support for sticky bit is platform specific . Check if the path starts with " / " and if so , // assume that the host supports the chmod command . if ( dir . startsWith ( AlluxioURI . SEPARATOR ) ) { // TODO ( peis ) : This is very slow . Consider removing this . Runtime . getRuntime ( ) . exec ( "chmod +t " +...
public class Reflection { /** * Get the parameter name of a ( { @ linkplain Serializable serializable } ) lambda with a single parameter . * Getting the parameter requires the source to be compiled with the { @ code - parameters } flag passed to { @ code * javac } and JDK { @ code 1.8.0_60 } or newer . * @ param ...
SerializedLambda serialized = serializedLambda ( lambda ) ; Parameter [ ] parameters = lambdaMethod ( serialized ) . getParameters ( ) ; int bound ; switch ( serialized . getImplMethodKind ( ) ) { case REF_invokeStatic : bound = serialized . getCapturedArgCount ( ) ; break ; case REF_invokeSpecial : bound = serialized ...
public class JsonArray { /** * Adds the specified element to self . * @ param element the element that needs to be added to the array . */ public void add ( JsonElement element ) { } }
if ( element == null ) { element = JsonNull . INSTANCE ; } elements . add ( element ) ;
public class RelatedArticleList { /** * getter for relatedArticles - gets * @ generated * @ return value of the feature */ public FSArray getRelatedArticles ( ) { } }
if ( RelatedArticleList_Type . featOkTst && ( ( RelatedArticleList_Type ) jcasType ) . casFeat_relatedArticles == null ) jcasType . jcas . throwFeatMissing ( "relatedArticles" , "de.julielab.jules.types.RelatedArticleList" ) ; return ( FSArray ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ...
public class KrakenImpl { /** * Query implementation for multiple result with the parsed query . */ private void findStream ( QueryKraken query , Object [ ] args , ResultStream < Cursor > result ) { } }
try { TableKraken table = query . table ( ) ; TableKelp tableKelp = table . getTableKelp ( ) ; TablePod tablePod = table . getTablePod ( ) ; if ( query . isStaticNode ( ) ) { RowCursor cursor = tableKelp . cursor ( ) ; query . fillKey ( cursor , args ) ; int hash = query . calculateHash ( cursor ) ; // ShardPod node = ...
public class RenderAny { /** * TODO : Allow plugin to support rendering pdf , xls or other binary types */ public void apply ( ActionContext context ) { } }
Boolean hasTemplate = context . hasTemplate ( ) ; if ( null != hasTemplate && hasTemplate ) { RenderTemplate . get ( context . successStatus ( ) ) . apply ( context ) ; return ; } H . Format fmt = context . accept ( ) ; if ( fmt == UNKNOWN ) { H . Request req = context . req ( ) ; if ( req . userAgent ( ) . isIE9Down (...