signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class ConsoleServlet { /** * Displays more detailed configuration
* @ return html representation of the verbose hub config */
private String getVerboseConfig ( ) { } } | StringBuilder builder = new StringBuilder ( ) ; GridHubConfiguration config = getRegistry ( ) . getHub ( ) . getConfiguration ( ) ; builder . append ( "<div id='verbose-config-container'>" ) ; builder . append ( "<a id='verbose-config-view-toggle' href='#'>View Verbose</a>" ) ; builder . append ( "<div id='verbose-conf... |
public class AttributeDefinition { /** * Finds a value in the given { @ code model } whose key matches this attribute ' s { @ link # getName ( ) name } ,
* uses the given { @ code context } to { @ link OperationContext # resolveExpressions ( org . jboss . dmr . ModelNode ) resolve }
* it and validates it using this... | return resolveModelAttribute ( new ExpressionResolver ( ) { @ Override public ModelNode resolveExpressions ( ModelNode node ) throws OperationFailedException { return context . resolveExpressions ( node ) ; } } , model ) ; |
public class TwitterEndpointServices { /** * Evaluate the response from the oauth / request _ token endpoint . This checks the status code of the response and ensures
* that oauth _ callback _ confirmed , oauth _ token , and oauth _ token _ secret values are contained in the response .
* @ param responseBody
* @ ... | Map < String , Object > response = new HashMap < String , Object > ( ) ; String endpoint = TwitterConstants . TWITTER_ENDPOINT_REQUEST_TOKEN ; Map < String , String > responseValues = populateResponseValues ( responseBody ) ; Map < String , Object > result = checkForEmptyResponse ( endpoint , responseBody , responseVal... |
public class FeaturesInner { /** * Gets all the preview features in a provider namespace that are available through AFEC for the subscription .
* @ param resourceProviderNamespace The namespace of the resource provider for getting features .
* @ param serviceCallback the async ServiceCallback to handle successful a... | return AzureServiceFuture . fromPageResponse ( list1SinglePageAsync ( resourceProviderNamespace ) , new Func1 < String , Observable < ServiceResponse < Page < FeatureResultInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < FeatureResultInner > > > call ( String nextPageLink ) { return list1Next... |
public class Strings { /** * Ensure a given text start with requested prefix . If < code > text < / code > argument is empty returns given prefix ;
* returns null if < code > text < / code > argument is null .
* @ param text text to add prefix to , null accepted ,
* @ param prefix prefix to force on text start . ... | if ( text == null ) { return null ; } if ( ! text . startsWith ( prefix ) ) { text = prefix + text ; } return text ; |
public class PrivateKeyUsageExtension { /** * Encode this extension value . */
private void encodeThis ( ) throws IOException { } } | if ( notBefore == null && notAfter == null ) { this . extensionValue = null ; return ; } DerOutputStream seq = new DerOutputStream ( ) ; DerOutputStream tagged = new DerOutputStream ( ) ; if ( notBefore != null ) { DerOutputStream tmp = new DerOutputStream ( ) ; tmp . putGeneralizedTime ( notBefore ) ; tagged . writeIm... |
public class JCalendarPopup { /** * Invoked when the mouse enters a component . */
public void mouseEntered ( MouseEvent evt ) { } } | JLabel button = ( JLabel ) evt . getSource ( ) ; oldBorder = button . getBorder ( ) ; button . setBorder ( ROLLOVER_BORDER ) ; |
public class CompactionRecordCountProvider { /** * Get the record count through filename . */
@ Override public long getRecordCount ( Path filepath ) { } } | String filename = filepath . getName ( ) ; Preconditions . checkArgument ( filename . startsWith ( M_OUTPUT_FILE_PREFIX ) || filename . startsWith ( MR_OUTPUT_FILE_PREFIX ) , String . format ( "%s is not a supported filename, which should start with %s, or %s." , filename , M_OUTPUT_FILE_PREFIX , MR_OUTPUT_FILE_PREFIX ... |
public class InteropFramework { /** * Returns an option at given index in an array of options , or null
* @ param options an array of Strings
* @ param index position of the option that is sought
* @ return the option or null */
String getOption ( String [ ] options , int index ) { } } | if ( ( options != null ) && ( options . length > index ) ) { return options [ index ] ; } return null ; |
public class WithMavenStepExecution2 { /** * Setup the selected JDK . If none is provided nothing is done . */
private void setupJDK ( ) throws AbortException , IOException , InterruptedException { } } | String jdkInstallationName = step . getJdk ( ) ; if ( StringUtils . isEmpty ( jdkInstallationName ) ) { console . println ( "[withMaven] using JDK installation provided by the build agent" ) ; return ; } if ( withContainer ) { // see # detectWithContainer ( )
LOGGER . log ( Level . FINE , "Ignoring JDK installation par... |
public class VpnConnectionsInner { /** * Retrieves the details of a vpn connection .
* @ param resourceGroupName The resource group name of the VpnGateway .
* @ param gatewayName The name of the gateway .
* @ param connectionName The name of the vpn connection .
* @ throws IllegalArgumentException thrown if par... | return getWithServiceResponseAsync ( resourceGroupName , gatewayName , connectionName ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class BeanContextServicesSupport { /** * Serializes all serializable services and their providers before the children of this context is serialized .
* First a < code > int < / code > is writtern , indicating the number of serializable services . Then pairs of service class and service provider are writtern on... | super . bcsPreSerializationHook ( oos ) ; // serialize services
synchronized ( services ) { oos . writeInt ( serializable ) ; for ( Iterator iter = services . entrySet ( ) . iterator ( ) ; iter . hasNext ( ) ; ) { Entry entry = ( Entry ) iter . next ( ) ; if ( ( ( BCSSServiceProvider ) entry . getValue ( ) ) . getServi... |
public class Op { /** * Creates an array with the specified elements and an < i > operation expression < / i > on it .
* @ param elements the elements of the array being created
* @ return an operator , ready for chaining */
public static < T > Level0ArrayOperator < Byte [ ] , Byte > onArrayFor ( final Byte ... ele... | return onArrayOf ( Types . BYTE , VarArgsUtil . asRequiredObjectArray ( elements ) ) ; |
public class FhirValidator { /** * Should the validator validate the resource against the base schema ( the schema provided with the FHIR distribution itself ) */
public synchronized boolean isValidateAgainstStandardSchematron ( ) { } } | if ( ! ourPhPresentOnClasspath ) { // No need to ask since we dont have Ph - Schematron . Also Class . forname will complain
// about missing ph - schematron import .
return false ; } Class < ? extends IValidatorModule > cls = SchematronProvider . getSchematronValidatorClass ( ) ; return haveValidatorOfType ( cls ) ; |
public class TemplateBase { /** * Add layout section . Should not be used in user application or template
* @ param name
* @ param section */
private void __addLayoutSection ( String name , String section , boolean def ) { } } | Map < String , String > m = def ? layoutSections0 : layoutSections ; if ( m . containsKey ( name ) ) return ; m . put ( name , section ) ; |
public class Preconditions { /** * < p > Evaluate the given { @ code predicate } using { @ code value } as input . < / p >
* < p > The function throws { @ link PreconditionViolationException } if the
* predicate is false . < / p >
* @ param value The value
* @ param predicate The predicate
* @ param describer... | final boolean ok ; try { ok = predicate . test ( value ) ; } catch ( final Throwable e ) { final Violations violations = singleViolation ( failedPredicate ( e ) ) ; throw new PreconditionViolationException ( failedMessage ( value , violations ) , e , violations . count ( ) ) ; } return innerCheck ( value , ok , describ... |
public class MeasureUnit { /** * Create a MeasureUnit instance ( creates a singleton instance ) .
* Normally this method should not be used , since there will be no formatting data
* available for it , and it may not be returned by getAvailable ( ) .
* However , for special purposes ( such as CLDR tooling ) , it ... | if ( type == null || subType == null ) { throw new NullPointerException ( "Type and subType must be non-null" ) ; } if ( ! "currency" . equals ( type ) ) { if ( ! ASCII . containsAll ( type ) || ! ASCII_HYPHEN_DIGITS . containsAll ( subType ) ) { throw new IllegalArgumentException ( "The type or subType are invalid." )... |
public class SeaGlassStyle { /** * Returns the color for the specified state . This should NOT call any
* methods on the < code > JComponent < / code > .
* < p > Overridden to cause this style to populate itself with data from
* UIDefaults , if necessary . < / p >
* < p > In addition , SeaGlassStyle handles Col... | String key = null ; if ( type == ColorType . BACKGROUND ) { key = "background" ; } else if ( type == ColorType . FOREGROUND ) { // map FOREGROUND as TEXT _ FOREGROUND
key = "textForeground" ; } else if ( type == ColorType . TEXT_BACKGROUND ) { key = "textBackground" ; } else if ( type == ColorType . TEXT_FOREGROUND ) {... |
public class AxesChartSeriesNumericalNoErrorBars { /** * This is an internal method which shouldn ' t be called from client code . Use
* XYChart . updateXYSeries or CategoryChart . updateXYSeries instead !
* @ param newXData
* @ param newYData
* @ param newExtraValues */
public void replaceData ( double [ ] new... | // Sanity check
if ( newExtraValues != null && newExtraValues . length != newYData . length ) { throw new IllegalArgumentException ( "error bars and Y-Axis sizes are not the same!!!" ) ; } if ( newXData . length != newYData . length ) { throw new IllegalArgumentException ( "X and Y-Axis sizes are not the same!!!" ) ; }... |
public class WebDriverWaitUtils { /** * Waits until element is present on the DOM of a page and visible . Visibility means that the element is not only
* displayed but also has a height and width that is greater than 0.
* @ param elementLocator
* identifier of element to be visible */
public static void waitUntil... | logger . entering ( elementLocator ) ; By by = HtmlElementUtils . resolveByType ( elementLocator ) ; ExpectedCondition < WebElement > condition = ExpectedConditions . visibilityOfElementLocated ( by ) ; waitForCondition ( condition ) ; logger . exiting ( ) ; |
public class QueueRegistry { /** * Retrieves and returns a registered queue by name .
* @ param queueName
* The name of the queue to retrieve
* @ return
* The retrieved queue with name < code > queueName < / code >
* @ throws IllegalArgumentException if there is queue with the name < code > queueName < / code... | Preconditions . checkArgument ( registry . containsKey ( queueName ) , "Queue %s does not exist" , queueName ) ; return registry . get ( queueName ) ; |
public class MapPolyline { /** * Replies the geo - location of the point described by the specified distance .
* The desired distance is < code > 0 < / code > for the starting point and { @ link # getLength ( ) }
* for the ending point .
* @ param desired _ distance is the distance for which the geo location must... | assert geoLocation != null ; double desiredDistance = desired_distance ; for ( final PointGroup group : groups ( ) ) { Point2d prevPoint = null ; for ( final Point2d thepoint : group . points ( ) ) { if ( prevPoint != null ) { // Compute the length between the current point and the previous point
double vx = thepoint .... |
public class ApiOvhDedicatedserver { /** * Retrieve partition charts
* REST : GET / dedicated / server / { serviceName } / statistics / partition / { partition } / chart
* @ param period [ required ] chart period
* @ param serviceName [ required ] The internal name of your dedicated server
* @ param partition [... | String qPath = "/dedicated/server/{serviceName}/statistics/partition/{partition}/chart" ; StringBuilder sb = path ( qPath , serviceName , partition ) ; query ( sb , "period" , period ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhChartReturn . class ) ; |
public class SelfContainedContainer { /** * Stops the service container and cleans up all file system resources .
* @ throws Exception */
public void stop ( ) throws Exception { } } | final CountDownLatch latch = new CountDownLatch ( 1 ) ; this . serviceContainer . addTerminateListener ( info -> latch . countDown ( ) ) ; this . serviceContainer . shutdown ( ) ; latch . await ( ) ; executor . submit ( new Runnable ( ) { @ Override public void run ( ) { TempFileManager . deleteRecursively ( tmpDir ) ;... |
public class ServerDumpPackager { /** * Copy relevant data ( like service data , shared config , etc ) to the dump dir to be zipped up .
* @ param dumpDir
* @ param installDir */
private void captureEnvData ( File dumpDir , File installDir ) { } } | File versionsSource = new File ( installDir , "lib/versions" ) ; File fixesSource = new File ( installDir , "lib/fixes" ) ; String sharedConfigDir = AccessController . doPrivileged ( new PrivilegedAction < String > ( ) { @ Override public String run ( ) { return System . getProperty ( "shared.config.dir" ) ; } } ) ; Fi... |
public class GoogleCloudStorageFileSystem { /** * Convert { @ code CreateFileOptions } to { @ code CreateObjectOptions } . */
public static CreateObjectOptions objectOptionsFromFileOptions ( CreateFileOptions options ) { } } | return new CreateObjectOptions ( options . overwriteExisting ( ) , options . getContentType ( ) , options . getAttributes ( ) ) ; |
public class DOMAttribute { /** * - - - - - interface DOMImportable - - - - - */
@ Override public Node doImport ( Page newPage ) throws DOMException { } } | Attr newAttr = newPage . createAttribute ( name ) ; newAttr . setValue ( value ) ; return newAttr ; |
public class Vector3f { /** * / * ( non - Javadoc )
* @ see org . joml . Vector3fc # div ( org . joml . Vector3fc , org . joml . Vector3f ) */
public Vector3f div ( Vector3fc v , Vector3f dest ) { } } | dest . x = x / v . x ( ) ; dest . y = y / v . y ( ) ; dest . z = z / v . z ( ) ; return dest ; |
public class Assembly { /** * Submits the configured assembly to Transloadit for processing .
* @ param isResumable boolean value that tells the assembly whether or not to use tus .
* @ return { @ link AssemblyResponse } the response received from the Transloadit server .
* @ throws RequestException if request to... | Request request = new Request ( getClient ( ) ) ; options . put ( "steps" , steps . toMap ( ) ) ; // only do tus uploads if files will be uploaded
if ( isResumable && getFilesCount ( ) > 0 ) { Map < String , String > tusOptions = new HashMap < String , String > ( ) ; tusOptions . put ( "tus_num_expected_upload_files" ,... |
public class SymmOptimizer { /** * Move all the block residues of one repeat one position to the left or
* right and move the corresponding boundary residues from the freePool to
* the block , and viceversa .
* The boundaries are determined by any irregularity ( either a gap or a
* discontinuity in the alignmen... | int su = rnd . nextInt ( order ) ; // Select the repeat
int rl = rnd . nextInt ( 2 ) ; // Select between moving right ( 0 ) or left ( 1)
int res = rnd . nextInt ( length ) ; // Residue as a pivot
// When the pivot residue is null try to add a residue from the freePool
if ( block . get ( su ) . get ( res ) == null ) { i... |
public class Utils { /** * Same as { @ link java . lang . System # getProperty ( java . lang . String ) } .
* @ param name the name of the property
* @ return the property value */
public static String getSystemProperty ( String name ) { } } | return StringUtils . isBlank ( name ) ? "" : System . getProperty ( name ) ; |
public class CmsSiteManagerImpl { /** * Returns the site for the given resources root path ,
* or < code > null < / code > if the resources root path does not match any site . < p >
* @ param rootPath the root path of a resource
* @ return the site for the given resources root path ,
* or < code > null < / code... | if ( ( rootPath . length ( ) > 0 ) && ! rootPath . endsWith ( "/" ) ) { rootPath = rootPath + "/" ; } // most sites will be below the " / sites / " folder ,
CmsSite result = lookupSitesFolder ( rootPath ) ; if ( result != null ) { return result ; } // look through all folders that are not below " / sites / "
String sit... |
public class PropertyAccessorHelper { /** * Gets object from field .
* @ param from
* the from
* @ param field
* the field
* @ return the object
* @ throws PropertyAccessException
* the property access exception */
public static Object getObject ( Object from , Field field ) { } } | if ( ! field . isAccessible ( ) ) { field . setAccessible ( true ) ; } try { return field . get ( from ) ; } catch ( IllegalArgumentException iarg ) { throw new PropertyAccessException ( iarg ) ; } catch ( IllegalAccessException iacc ) { throw new PropertyAccessException ( iacc ) ; } |
public class LogbackReconfigure { /** * 重新配置当前logback
* @ param config logback的xml配置文件
* @ param context 要配置的context */
public static void reconfigure ( InputStream config , LoggerContext context ) { } } | if ( context == null ) { throw new NullPointerException ( "LoggerContext must not be null" ) ; } LoggerContext lc = context ; JoranConfigurator jc = new JoranConfigurator ( ) ; jc . setContext ( lc ) ; StatusUtil statusUtil = new StatusUtil ( lc ) ; List < SaxEvent > eventList = jc . recallSafeConfiguration ( ) ; URL m... |
public class SnakGroupImpl { /** * Construct a list of { @ link SnakGroup } objects from a map from property
* ids to snak lists as found in JSON .
* @ param snaks
* the map with the data
* @ return the result list */
public static List < SnakGroup > makeSnakGroups ( Map < String , List < Snak > > snaks , List ... | List < SnakGroup > result = new ArrayList < > ( snaks . size ( ) ) ; for ( String propertyName : propertyOrder ) { result . add ( new SnakGroupImpl ( snaks . get ( propertyName ) ) ) ; } return result ; |
public class EncryptKit { /** * HmacSHA1加密
* @ param data 明文字符串
* @ param key 秘钥
* @ return 16进制密文 */
public static String hmacSHA1 ( String data , String key ) { } } | return hmacSHA1 ( data . getBytes ( ) , key . getBytes ( ) ) ; |
public class VirtualMediaPanel { /** * We overload this to translate mouse events into the proper coordinates before they are
* dispatched to any of the mouse listeners . */
@ Override protected void processMouseMotionEvent ( MouseEvent event ) { } } | event . translatePoint ( _vbounds . x , _vbounds . y ) ; super . processMouseMotionEvent ( event ) ; |
public class DataStream { /** * Applies the given { @ link ProcessFunction } on the input stream , thereby
* creating a transformed output stream .
* < p > The function will be called for every element in the input streams and can produce zero
* or more output elements .
* @ param processFunction The { @ link P... | ProcessOperator < T , R > operator = new ProcessOperator < > ( clean ( processFunction ) ) ; return transform ( "Process" , outputType , operator ) ; |
public class OntopMappingSQLAllConfigurationImpl { /** * Please overload isMappingDefined ( ) instead . */
@ Override boolean isInputMappingDefined ( ) { } } | return super . isInputMappingDefined ( ) || options . mappingFile . isPresent ( ) || options . mappingGraph . isPresent ( ) || options . mappingReader . isPresent ( ) ; |
public class ImageExtensions { /** * Convenience method to write the given { @ link BufferedImage } object to the given { @ link File }
* object .
* @ param bufferedImage
* the { @ link BufferedImage } object to be written .
* @ param formatName
* the format name
* @ param outputfile
* the output file
*... | ImageIO . write ( bufferedImage , formatName , outputfile ) ; return outputfile ; |
public class XbaseFormatter2 { /** * checks whether the given lambda should be formatted as a block .
* That includes newlines after and before the brackets , and a fresh line for each expression . */
protected boolean isMultilineLambda ( final XClosure closure ) { } } | final ILeafNode closingBracket = this . _nodeModelAccess . nodeForKeyword ( closure , "]" ) ; HiddenLeafs _hiddenLeafsBefore = null ; if ( closingBracket != null ) { _hiddenLeafsBefore = this . _hiddenLeafAccess . getHiddenLeafsBefore ( closingBracket ) ; } boolean _tripleNotEquals = ( _hiddenLeafsBefore != null ) ; if... |
public class FNMRGImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } } | switch ( featureID ) { case AfplibPackage . FNMRG__CHAR_BOX_WD : return getCharBoxWd ( ) ; case AfplibPackage . FNMRG__CHAR_BOX_HT : return getCharBoxHt ( ) ; case AfplibPackage . FNMRG__PAT_DOSET : return getPatDOset ( ) ; } return super . eGet ( featureID , resolve , coreType ) ; |
public class SignatureBinder { /** * Example of not allowed literal variable usages across typeSignatures :
* < p > < ul >
* < li > x used in different base types : char ( x ) and varchar ( x )
* < li > x used in different positions of the same base type : decimal ( x , y ) and decimal ( z , x )
* < li > p used... | Map < String , TypeSignature > existingUsages = new HashMap < > ( ) ; for ( TypeSignature parameter : declaredSignature . getArgumentTypes ( ) ) { checkNoLiteralVariableUsageAcrossTypes ( parameter , existingUsages ) ; } |
public class JSON { /** * Write a reconfiguration plan .
* @ param plan the reconfiguration plan to write
* @ param f the output file . If it ends with ' . gz ' it will be gzipped
* @ throws IllegalArgumentException if an error occurred while writing the json */
public static void write ( ReconfigurationPlan plan... | try ( OutputStreamWriter out = makeOut ( f ) ) { write ( plan , out ) ; } catch ( IOException e ) { throw new IllegalArgumentException ( e ) ; } |
public class PositionDecoder { /** * This function is used to induce some tolerance if messages
* were received shortly after ( due to Internet jitter in timestmaps ) .
* This function is derived empirically
* @ param timeDifference the time between the reception of both messages
* @ param distance covered
* ... | double x = abs ( timeDifference ) ; double d = abs ( distance ) ; // if ( d / x > = ( surface ? 51.44:514.4 ) * 2.5)
// System . err . format ( " % . 2f / % . 2f = % . 2f \ n " , d , x , d / x ) ;
// may be due to Internet jitter ; distance is realistic
if ( x < 0.7 && d < 2000 ) return true ; else return d / x < ( sur... |
public class HiveAvroORCQueryGenerator { /** * Generate DML mapping query to populate output schema table by selecting from input schema table
* This method assumes that each output schema field has a corresponding source input table ' s field reference
* . . in form of ' flatten _ source ' property
* @ param inp... | Preconditions . checkNotNull ( inputAvroSchema ) ; Preconditions . checkNotNull ( outputOrcSchema ) ; Preconditions . checkArgument ( StringUtils . isNotBlank ( inputTblName ) ) ; Preconditions . checkArgument ( StringUtils . isNotBlank ( outputTblName ) ) ; String inputDbName = optionalInputDbName . isPresent ( ) ? op... |
public class Pageable { /** * Specifies a specific page to jump to .
* @ param page the page to jump to */
private void setCurrentPage ( int page ) { } } | if ( page >= totalPages ) { this . currentPage = totalPages ; } else if ( page <= 1 ) { this . currentPage = 1 ; } else { this . currentPage = page ; } // now work out where the sub - list should start and end
startingIndex = pageSize * ( currentPage - 1 ) ; if ( startingIndex < 0 ) { startingIndex = 0 ; } endingIndex ... |
public class Query { /** * Executes this { @ link Query } generating a new { @ link View } from the result set .
* @ return a new { @ link View } based on the result set of this { @ link Query } .
* @ throws IllegalStateException if the { @ link View } is { @ literal null } .
* @ throws IllegalArgumentException i... | this . resultSet . set ( null ) ; View from = getFrom ( ) ; List < Column > projection = resolveProjection ( from ) ; Predicate < Row > predicate = resolvePredicate ( ) ; List < Row > resultSet = sort ( run ( from , predicate ) ) ; View view = AbstractView . of ( projection , resultSet ) ; this . resultSet . set ( view... |
public class FileInfo { /** * Indicates whether { @ code itemInfo } is a directory ; static version of { @ link # isDirectory ( ) }
* to avoid having to create a FileInfo object just to use this logic . */
static boolean isDirectory ( GoogleCloudStorageItemInfo itemInfo ) { } } | return isGlobalRoot ( itemInfo ) || itemInfo . isBucket ( ) || objectHasDirectoryPath ( itemInfo . getObjectName ( ) ) ; |
public class AbstractExtraLanguageValidator { /** * Collect the check methods .
* @ param clazz the type to explore .
* @ param visitedClasses the visited classes .
* @ param result the collected methods . */
protected void collectMethods ( Class < ? extends AbstractExtraLanguageValidator > clazz , Collection < C... | if ( ! visitedClasses . add ( clazz ) ) { return ; } for ( final Method method : clazz . getDeclaredMethods ( ) ) { if ( method . getAnnotation ( Check . class ) != null && method . getParameterTypes ( ) . length == 1 ) { result . add ( createMethodWrapper ( method ) ) ; } } final Class < ? extends AbstractExtraLanguag... |
public class AbstractPutObjectRequest { /** * Sets the optional customer - provided server - side encryption key to use to
* encrypt the uploaded object , and returns the updated request object so
* that additional method calls can be chained together .
* @ param sseKey
* The optional customer - provided server... | setSSECustomerKey ( sseKey ) ; @ SuppressWarnings ( "unchecked" ) T t = ( T ) this ; return t ; |
public class MessageDigest { /** * Returns the length of the digest in bytes , or 0 if this operation is
* not supported by the provider and the implementation is not cloneable .
* @ return the digest length in bytes , or 0 if this operation is not
* supported by the provider and the implementation is not cloneab... | int digestLen = engineGetDigestLength ( ) ; if ( digestLen == 0 ) { try { MessageDigest md = ( MessageDigest ) clone ( ) ; byte [ ] digest = md . digest ( ) ; return digest . length ; } catch ( CloneNotSupportedException e ) { return digestLen ; } } return digestLen ; |
public class CmsTabDialog { /** * Builds the html for the tab row of the tab dialog . < p >
* @ return the html for the tab row */
public String dialogTabRow ( ) { } } | StringBuffer result = new StringBuffer ( 512 ) ; StringBuffer lineRow = new StringBuffer ( 256 ) ; List < String > tabNames = getTabs ( ) ; if ( tabNames . size ( ) < 2 ) { // less than 2 tabs present , do not show them and create a border line
result . append ( "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" ... |
public class GhprbPullRequest { /** * Get the PullRequest object for this PR
* @ param force If true , forces retrieval of the PR info from the github API . Use sparingly .
* @ return a copy of the pull request
* @ throws IOException if unable to connect to GitHub */
public GHPullRequest getPullRequest ( boolean ... | if ( this . pr == null || force ) { setPullRequest ( repo . getActualPullRequest ( this . id ) ) ; } return pr ; |
public class ChangesetInfo { /** * A shortcut to getTags ( ) . get ( " source " ) . split ( " ; " )
* @ return the source of the data entered . Common values include " bing " , " survey " , " local
* knowledge " , " common knowledge " , " extrapolation " , " photograph " ( and more ) . null if
* none supplied . *... | String source = tags != null ? tags . get ( "source" ) : null ; return source != null ? source . split ( "(\\s)?;(\\s)?" ) : null ; |
public class AmazonApiGatewayV2Client { /** * Gets an Authorizer .
* @ param getAuthorizerRequest
* @ return Result of the GetAuthorizer operation returned by the service .
* @ throws NotFoundException
* The resource specified in the request was not found .
* @ throws TooManyRequestsException
* The client i... | request = beforeClientExecution ( request ) ; return executeGetAuthorizer ( request ) ; |
public class PushMetricRegistryInstance { /** * Set the history module that the push processor is to use . */
public synchronized void setHistory ( CollectHistory history ) { } } | history_ = Optional . of ( history ) ; history_ . ifPresent ( getApi ( ) :: setHistory ) ; data_ . initWithHistoricalData ( history , getDecoratorLookBack ( ) ) ; |
public class SeaGlassTextFieldUI { /** * DOCUMENT ME !
* @ param c DOCUMENT ME !
* @ param region DOCUMENT ME !
* @ return DOCUMENT ME ! */
private int getComponentState ( JComponent c , Region region ) { } } | if ( region == SeaGlassRegion . SEARCH_FIELD_CANCEL_BUTTON && c . isEnabled ( ) ) { if ( ( ( JTextComponent ) c ) . getText ( ) . length ( ) == 0 ) { return DISABLED ; } else if ( isCancelArmed ) { return PRESSED ; } return ENABLED ; } return SeaGlassLookAndFeel . getComponentState ( c ) ; |
public class ComplexMetricSerde { /** * Converts intermediate representation of aggregate to byte [ ] .
* @ param val intermediate representation of aggregate
* @ return serialized intermediate representation of aggregate in byte [ ] */
public byte [ ] toBytes ( @ Nullable Object val ) { } } | if ( val != null ) { byte [ ] bytes = getObjectStrategy ( ) . toBytes ( val ) ; return bytes != null ? bytes : ByteArrays . EMPTY_ARRAY ; } else { return ByteArrays . EMPTY_ARRAY ; } |
public class IndirectBigQueryOutputCommitter { /** * Runs an import job on BigQuery for the data in the output path in addition to calling the
* delegate ' s commitJob . */
@ Override public void commitJob ( JobContext context ) throws IOException { } } | super . commitJob ( context ) ; // Get the destination configuration information .
Configuration conf = context . getConfiguration ( ) ; TableReference destTable = BigQueryOutputConfiguration . getTableReference ( conf ) ; String destProjectId = BigQueryOutputConfiguration . getProjectId ( conf ) ; String writeDisposit... |
public class TextUtils { /** * Returns a CharSequence concatenating the specified CharSequences ,
* retaining their spans if any . */
public static CharSequence concat ( CharSequence ... text ) { } } | if ( text . length == 0 ) { return "" ; } if ( text . length == 1 ) { return text [ 0 ] ; } boolean spanned = false ; for ( int i = 0 ; i < text . length ; i ++ ) { if ( text [ i ] instanceof Spanned ) { spanned = true ; break ; } } StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < text . length ; i ++ )... |
public class Code { /** * Returns the local for { @ code this } of type { @ code type } . It is an error
* to call { @ code getThis ( ) } if this is a static method . */
public < T > Local < T > getThis ( TypeId < T > type ) { } } | if ( thisLocal == null ) { throw new IllegalStateException ( "static methods cannot access 'this'" ) ; } return coerce ( thisLocal , type ) ; |
public class CmsSearchIndex { /** * Removes the given backup folder of this index . < p >
* @ param path the backup folder to remove */
protected void removeIndexBackup ( String path ) { } } | if ( ! isBackupReindexing ( ) ) { // if no backup is generated we don ' t need to do anything
return ; } // check if the target directory already exists
File file = new File ( path ) ; if ( ! file . exists ( ) ) { // index does not exist yet
return ; } try { FSDirectory dir = FSDirectory . open ( file . toPath ( ) ) ; ... |
public class CmsXmlGroupContainerFactory { /** * Factory method to unmarshal ( generate ) a group container instance from a String
* that contains XML data . < p >
* The given encoding is used when marshalling the XML again later . < p >
* < b > Warning : < / b > < br / >
* This method does not support requeste... | // create the XML content object from the provided String
return unmarshal ( cms , CmsXmlUtils . unmarshalHelper ( xmlData , resolver ) , encoding , resolver ) ; |
public class SendInvitationImpl { /** * / * ( non - Javadoc )
* @ see com . tvd12 . ezyfox . core . command . SendInvitation # invitees ( com . tvd12 . ezyfox . core . entities . ApiBaseUser [ ] ) */
@ Override public SendInvitation invitees ( ApiBaseUser ... users ) { } } | this . invitees . addAll ( Arrays . asList ( users ) ) ; return this ; |
public class FeatureSourceRetriever { /** * Retrieve the FeatureSource object from the data store .
* @ return An OpenGIS FeatureSource object ;
* @ throws LayerException
* oops */
public SimpleFeatureSource getFeatureSource ( ) throws LayerException { } } | try { if ( dataStore instanceof WFSDataStore ) { return dataStore . getFeatureSource ( featureSourceName . replace ( ":" , "_" ) ) ; } else { return dataStore . getFeatureSource ( featureSourceName ) ; } } catch ( IOException e ) { throw new LayerException ( e , ExceptionCode . FEATURE_MODEL_PROBLEM , "Cannot find feat... |
public class DecodedBitStreamParser { /** * Byte Compaction mode ( see 5.4.3 ) permits all 256 possible 8 - bit byte values to be encoded .
* This includes all ASCII characters value 0 to 127 inclusive and provides for international
* character set support .
* @ param mode The byte compaction mode i . e . 901 or ... | ByteArrayOutputStream decodedBytes = new ByteArrayOutputStream ( ) ; int count = 0 ; long value = 0 ; boolean end = false ; switch ( mode ) { case BYTE_COMPACTION_MODE_LATCH : // Total number of Byte Compaction characters to be encoded
// is not a multiple of 6
int [ ] byteCompactedCodewords = new int [ 6 ] ; int nextC... |
public class GobblinMultiTaskAttempt { /** * A method that shuts down all running tasks managed by this instance .
* TODO : Call this from the right place . */
public void shutdownTasks ( ) throws InterruptedException { } } | log . info ( "Shutting down tasks" ) ; for ( Task task : this . tasks ) { task . shutdown ( ) ; } for ( Task task : this . tasks ) { task . awaitShutdown ( 1000 ) ; } for ( Task task : this . tasks ) { if ( task . cancel ( ) ) { log . info ( "Task {} cancelled." , task . getTaskId ( ) ) ; } else { log . info ( "Task {}... |
public class AbstractBpmnActivityBehavior { /** * Decides how to propagate the exception properly , e . g . as bpmn error or " normal " error .
* @ param execution the current execution
* @ param ex the exception to propagate
* @ throws Exception if no error handler could be found */
protected void propagateExcep... | BpmnError bpmnError = checkIfCauseOfExceptionIsBpmnError ( ex ) ; if ( bpmnError != null ) { propagateBpmnError ( bpmnError , execution ) ; } else { propagateExceptionAsError ( ex , execution ) ; } |
public class ModelContext { /** * Convenience method to provide an new context for an return parameter
* @ param groupName - group name of the docket
* @ param type - type
* @ param documentationType - for documentation type
* @ param alternateTypeProvider - alternate type provider
* @ param genericNamingStra... | return new ModelContext ( groupName , type , true , documentationType , alternateTypeProvider , genericNamingStrategy , ignorableTypes ) ; |
public class MCF1RGImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setCPName ( String newCPName ) { } } | String oldCPName = cpName ; cpName = newCPName ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . MCF1RG__CP_NAME , oldCPName , cpName ) ) ; |
public class WorkflowsInner { /** * Validates the workflow definition .
* @ param resourceGroupName The resource group name .
* @ param location The workflow location .
* @ param workflowName The workflow name .
* @ param workflow The workflow definition .
* @ param serviceCallback the async ServiceCallback t... | return ServiceFuture . fromResponse ( validateWithServiceResponseAsync ( resourceGroupName , location , workflowName , workflow ) , serviceCallback ) ; |
public class GravityUtils { /** * Calculates movement area position within viewport area with gravity applied .
* @ param settings Image settings
* @ param out Output rectangle */
public static void getMovementAreaPosition ( Settings settings , Rect out ) { } } | tmpRect1 . set ( 0 , 0 , settings . getViewportW ( ) , settings . getViewportH ( ) ) ; Gravity . apply ( settings . getGravity ( ) , settings . getMovementAreaW ( ) , settings . getMovementAreaH ( ) , tmpRect1 , out ) ; |
public class ClassDescriptorDef { /** * Returns all base types .
* @ return An iterator of the base types */
public Iterator getAllBaseTypes ( ) { } } | ArrayList baseTypes = new ArrayList ( ) ; baseTypes . addAll ( _directBaseTypes . values ( ) ) ; for ( int idx = baseTypes . size ( ) - 1 ; idx >= 0 ; idx -- ) { ClassDescriptorDef curClassDef = ( ClassDescriptorDef ) baseTypes . get ( idx ) ; for ( Iterator it = curClassDef . getDirectBaseTypes ( ) ; it . hasNext ( ) ... |
public class SystemClock { /** * Utility method to convert a value in the given unit to the internal time
* @ param unit
* The unit of the time parameter
* @ param time
* The time to convert
* @ return The internal time representation of the parameter */
public static long timeToInternal ( TimeUnit unit , Dou... | return Math . round ( time * unit . getValue ( ) / TimeUnit . nanosecond . getValue ( ) ) ; |
public class CmsGalleryService { /** * Returns the VFS root entries . < p >
* @ return the VFS root entries
* @ throws CmsRpcException if something goes wrong */
private List < CmsVfsEntryBean > getRootEntries ( ) throws CmsRpcException { } } | List < CmsVfsEntryBean > rootFolders = new ArrayList < CmsVfsEntryBean > ( ) ; CmsObject cms = getCmsObject ( ) ; try { String path = "/" ; if ( ! cms . existsResource ( path , CmsResourceFilter . ONLY_VISIBLE_NO_DELETED ) ) { String startFolder = getWorkplaceSettings ( ) . getUserSettings ( ) . getStartFolder ( ) ; if... |
public class EmailGlobalSettings { /** * Use SSL by default ?
* @ param bUseSSL
* < code > true < / code > to use it by default , < code > false < / code > if not .
* @ return { @ link EChange } */
@ Nonnull public static EChange setUseSSL ( final boolean bUseSSL ) { } } | return s_aRWLock . writeLocked ( ( ) -> { if ( s_bUseSSL == bUseSSL ) return EChange . UNCHANGED ; s_bUseSSL = bUseSSL ; return EChange . CHANGED ; } ) ; |
public class GeometryFactory { /** * Create a new geometry from an existing geometry . This will basically create a clone .
* @ param geometry
* The original geometry .
* @ return Returns a clone . */
public Geometry createGeometry ( Geometry geometry ) { } } | if ( geometry instanceof Point ) { return createPoint ( geometry . getCoordinate ( ) ) ; } else if ( geometry instanceof LinearRing ) { return createLinearRing ( geometry . getCoordinates ( ) ) ; } else if ( geometry instanceof LineString ) { return createLineString ( geometry . getCoordinates ( ) ) ; } else if ( geome... |
public class MilestonesApi { /** * Get the list of issues associated with the specified group milestone .
* @ param groupIdOrPath the group in the form of an Integer ( ID ) , String ( path ) , or Group instance
* @ param milestoneId the milestone ID to get the issues for
* @ return a List of Issue for the milesto... | Response response = get ( Response . Status . OK , getDefaultPerPageParam ( ) , "groups" , getGroupIdOrPath ( groupIdOrPath ) , "milestones" , milestoneId , "issues" ) ; return ( response . readEntity ( new GenericType < List < Issue > > ( ) { } ) ) ; |
public class Nested { /** * If { @ code o } is a { @ link PrecedencedSelfDescribing } ,
* calls { @ link PrecedencedSelfDescribing # getDescriptionPrecedence ( ) } ,
* otherwise returns { @ link PrecedencedSelfDescribing # P _ ATOMIC } .
* @ param o
* @ return precedence value */
public static int precedenceOf ... | if ( o instanceof PrecedencedSelfDescribing ) { return ( ( PrecedencedSelfDescribing ) o ) . getDescriptionPrecedence ( ) ; } else { return PrecedencedSelfDescribing . P_ATOMIC ; } |
public class FuncFlatRate { /** * { @ inheritDoc } */
@ Override public void resolve ( final ValueStack values ) throws Exception { } } | if ( values . size ( ) < getParameterCount ( ) ) throw new Exception ( "missing operands for " + toString ( ) ) ; try { final String tableName = values . popString ( ) ; final String [ ] keys = new String [ 5 ] ; for ( int a = 0 ; a < getParameterCount ( ) - 1 ; a ++ ) keys [ a ] = values . popString ( ) ; final Equati... |
public class GenXml { /** * 读入文件夹列表 */
private void ReadInTable ( String clasz ) { } } | this . clasz = clasz ; DefaultTableModel tableModel = ( DefaultTableModel ) table . getModel ( ) ; while ( tableModel . getRowCount ( ) > 0 ) { tableModel . removeRow ( 0 ) ; } try { BeanInfo sourceBean = Introspector . getBeanInfo ( Class . forName ( clasz ) , Object . class ) ; PropertyDescriptor [ ] ps = sourceBean ... |
public class MessageParserFactory { /** * Creates an instance of a concrete < code > AbstractMessageParser < / code > object .
* @ param protocolDataUnit The reference < code > ProtocolDataUnit < / code > instance , which contains this
* < code > AbstractMessageParser < / code > object .
* @ param operationCode T... | switch ( operationCode ) { case LOGIN_REQUEST : return new LoginRequestParser ( protocolDataUnit ) ; case LOGIN_RESPONSE : return new LoginResponseParser ( protocolDataUnit ) ; case LOGOUT_REQUEST : return new LogoutRequestParser ( protocolDataUnit ) ; case LOGOUT_RESPONSE : return new LogoutResponseParser ( protocolDa... |
public class Handlers { /** * Handler that appends the JVM route to the session cookie
* @ param sessionCookieName The session cookie name
* @ param jvmRoute The JVM route to append
* @ param next The next handler
* @ return The handler */
public static JvmRouteHandler jvmRoute ( final String sessionCookieName ... | return new JvmRouteHandler ( next , sessionCookieName , jvmRoute ) ; |
public class PhysicsUtil { /** * Replies the new velocity according to a previous velocity and
* a mouvement during a given time .
* < p > < code > velocity = movement / dt < / code >
* @ param movement is the movement distance .
* @ param dt is the time
* @ return a new speed */
@ Pure @ Inline ( value = "Ph... | PhysicsUtil . class } ) public static double speed ( double movement , double dt ) { return engine . speed ( movement , dt ) ; |
public class Token { /** * setter for wordForms - sets A Token is related to one or more WordForm
* @ generated
* @ param v value to set into the feature */
public void setWordForms ( FSArray v ) { } } | if ( Token_Type . featOkTst && ( ( Token_Type ) jcasType ) . casFeat_wordForms == null ) jcasType . jcas . throwFeatMissing ( "wordForms" , "com.digitalpebble.rasp.Token" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( Token_Type ) jcasType ) . casFeatCode_wordForms , jcasType . ll_cas . ll_getFSRef ( v ) ) ; |
public class GPXPoint { /** * Set the vertical dilution of precision of a point .
* @ param contentBuffer Contains the information to put in the table */
public final void setVdop ( StringBuilder contentBuffer ) { } } | ptValues [ GpxMetadata . PTVDOP ] = Double . parseDouble ( contentBuffer . toString ( ) ) ; |
public class sslservicegroup { /** * Use this API to update sslservicegroup resources . */
public static base_responses update ( nitro_service client , sslservicegroup resources [ ] ) throws Exception { } } | base_responses result = null ; if ( resources != null && resources . length > 0 ) { sslservicegroup updateresources [ ] = new sslservicegroup [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { updateresources [ i ] = new sslservicegroup ( ) ; updateresources [ i ] . servicegroupname = resource... |
public class HttpOutboundServiceContextImpl { /** * Retrieve the next buffer of the body asynchronously . This will avoid any
* body modifications , such as decompression or removal of chunked - encoding
* markers .
* If the read can be performed immediately , then a VirtualConnection will be returned and the pro... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "getRawResponseBodyBuffer(async)" ) ; } setRawBody ( true ) ; VirtualConnection vc = getResponseBodyBuffer ( callback , bForce ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , ... |
public class IOUtils { /** * Instead of reading the file at once , reads the file by reading 2K blocks . Useful for reading special files , where the size of the file isn ' t
* determinable , for example / proc / xxx files on linux .
* @ param filename a { @ link java . lang . String } object .
* @ return file co... | FileReader in = null ; try { StringBuilder result = new StringBuilder ( ) ; char [ ] buffer = new char [ 2048 ] ; in = new FileReader ( filename ) ; int len = 0 ; do { len = in . read ( buffer ) ; if ( len > 0 ) result . append ( buffer , 0 , len ) ; } while ( len > 0 ) ; return result . toString ( ) ; } finally { clos... |
public class ByteUtils { /** * Calculates the bit length of a given byte array
* @ param bytes The byte array
* @ return The number of bit */
public static int bitLength ( byte [ ] bytes ) { } } | Objects . requireNonNull ( bytes , Required . BYTES . toString ( ) ) ; int byteLength = bytes . length ; int length = 0 ; if ( byteLength <= MAX_BYTE_LENGTH && byteLength > 0 ) { length = byteLength * BYTES ; } return length ; |
public class Event { /** * CHECKSTYLE . OFF : IllegalType */
private static HashMap < String , ? super Serializable > convertToSerializable ( Map < String , Object > objectMap ) { } } | HashMap < String , ? super Serializable > serializableMap = new HashMap < > ( objectMap . size ( ) ) ; for ( Map . Entry < String , Object > objectEntry : objectMap . entrySet ( ) ) { if ( objectEntry . getValue ( ) == null ) { serializableMap . put ( objectEntry . getKey ( ) , ( String ) null ) ; } else if ( objectEnt... |
public class HttpUtil { /** * 通过GET方式请求数据
* @ param host 服务器主机 [ http ( s ) : / / ip : port ]
* @ param path 服务器虚拟目录
* @ param headers 请求header设置 ( Map < String , String > )
* @ param param 参数 ( URL编码 )
* @ return 响应数据 ( String ) */
public static String get ( String host , String path , Map < String , String ... | CloseableHttpClient httpClient = null ; CloseableHttpResponse response = null ; try { // host校验 , 一定不能为空 , 否则无法进行请求
ExceptionUtil . notNull ( host ) ; // 创建HttpClient
httpClient = wrapClient ( host ) ; // 创建HttpGet
HttpGet request = new HttpGet ( buildUrl ( host , path , param ) ) ; defaultHeader ( request ) ; // heade... |
public class DRL6Expressions { /** * src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 213:1 : annotationValue [ AnnotatedDescrBuilder inDescrBuilder ] returns [ Object result ] : ( exp = expression | annos = annotationArray [ inDescrBuilder ] | anno = fullAnnotation [ inDescrBuilder ] ) ;... | Object result = null ; ParserRuleReturnScope exp = null ; java . util . List annos = null ; AnnotationDescr anno = null ; try { // src / main / resources / org / drools / compiler / lang / DRL6Expressions . g : 214:3 : ( exp = expression | annos = annotationArray [ inDescrBuilder ] | anno = fullAnnotation [ inDescrBuil... |
public class ListDeploymentInstancesResult { /** * A list of instance IDs .
* @ return A list of instance IDs . */
public java . util . List < String > getInstancesList ( ) { } } | if ( instancesList == null ) { instancesList = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return instancesList ; |
public class Gauge { /** * Defines if the LED is on ( if available )
* @ param ON */
public void setLedOn ( final boolean ON ) { } } | if ( null == ledOn ) { _ledOn = ON ; fireUpdateEvent ( LED_EVENT ) ; } else { ledOn . set ( ON ) ; } |
public class TemplateUtil { /** * Replace each component tag with the key so it can be used in the replace writer .
* @ param context the context to modify .
* @ param taggedComponents the tagged components
* @ return the keyed components */
public static Map < String , WComponent > mapTaggedComponents ( final Ma... | Map < String , WComponent > componentsByKey = new HashMap < > ( ) ; // Replace each component tag with the key so it can be used in the replace writer
for ( Map . Entry < String , WComponent > tagged : taggedComponents . entrySet ( ) ) { String tag = tagged . getKey ( ) ; WComponent comp = tagged . getValue ( ) ; // Th... |
public class AbstractBufferedOutputStream { /** * { @ inheritDoc } */
@ Override public void flush ( ) throws IOException { } } | if ( curr > 0 ) { writeBuffer ( Arrays . copyOf ( buf , curr ) ) ; curr = 0 ; } |
public class Query { /** * Checks whether the provided object is NULL or NaN . */
private static boolean isUnaryComparison ( @ Nullable Object value ) { } } | return value == null || value . equals ( Double . NaN ) || value . equals ( Float . NaN ) ; |
public class Reflections { /** * get all constructors annotated with a given annotation , including annotation member values matching
* < p / > depends on MethodAnnotationsScanner configured */
public Set < Constructor > getConstructorsAnnotatedWith ( final Annotation annotation ) { } } | return filter ( getConstructorsAnnotatedWith ( annotation . annotationType ( ) ) , withAnnotation ( annotation ) ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.