signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class HttpMessage { /** * Compares this { @ code HttpMessage } against another . Messages are equal
* type if the host , port , path and parameter names are equal . Even though
* the query values may differ . For POST this assumes x - www - form - urlencoded ,
* for other types ( such as JSON ) this means ... | boolean result = false ; // compare method
if ( ! this . getRequestHeader ( ) . getMethod ( ) . equalsIgnoreCase ( msg . getRequestHeader ( ) . getMethod ( ) ) ) { return false ; } // compare host , port and URI
URI uri1 = this . getRequestHeader ( ) . getURI ( ) ; URI uri2 = msg . getRequestHeader ( ) . getURI ( ) ; t... |
public class Cache { /** * Insert the value into the Cache using the specified key .
* @ param key the key of the entry to be inserted
* @ param value the value of the entry to be inserted
* @ return the previous value associated with key , or null if there was none */
public synchronized Object insert ( String k... | // evict until size < maxSize
while ( isEvictionRequired ( ) && entryLimit > 0 && entryLimit < Integer . MAX_VALUE ) { evictStaleEntries ( ) ; } CacheEntry curEntry = new CacheEntry ( value ) ; CacheEntry oldEntry1 = ( CacheEntry ) primaryTable . put ( key , curEntry ) ; CacheEntry oldEntry2 = ( CacheEntry ) secondaryT... |
public class DictionarySettings { /** * { @ inheritDoc } */
@ SuppressWarnings ( { } } | "unchecked" } ) public < V > void put ( Key < ? super V > key , V value ) { dictionary . put ( key . getKey ( ) , value ) ; |
public class DateRangeChooser { /** * Searches for a Listitem that has a label that matches the specified value . The search is case
* insensitive .
* @ param label Label text to find .
* @ return A Listitem with a matching label . , or null if not found . */
public Listitem findMatchingItem ( String label ) { } ... | for ( Listitem item : getChildren ( Listitem . class ) ) { if ( label . equalsIgnoreCase ( item . getLabel ( ) ) ) { return item ; } } return null ; |
public class Es6RewriteRestAndSpread { /** * Processes new calls containing spreads .
* < p > Example :
* < pre > < code >
* new F ( . . . args ) = >
* new Function . prototype . bind . apply ( F , [ ] . concat ( $ jscomp . arrayFromIterable ( args ) ) )
* < / code > < / pre > */
private void visitNewWithSpre... | checkArgument ( spreadParent . isNew ( ) ) ; // Must remove callee before extracting argument groups .
Node callee = spreadParent . removeFirstChild ( ) ; List < Node > groups = extractSpreadGroups ( spreadParent ) ; // We need to generate
// ` new ( Function . prototype . bind . apply ( callee , [ null ] . concat ( ot... |
public class CommerceWishListLocalServiceWrapper { /** * Returns the commerce wish list matching the UUID and group .
* @ param uuid the commerce wish list ' s UUID
* @ param groupId the primary key of the group
* @ return the matching commerce wish list , or < code > null < / code > if a matching commerce wish l... | return _commerceWishListLocalService . fetchCommerceWishListByUuidAndGroupId ( uuid , groupId ) ; |
public class DescribeAssociationExecutionTargetsResult { /** * Information about the execution .
* @ param associationExecutionTargets
* Information about the execution . */
public void setAssociationExecutionTargets ( java . util . Collection < AssociationExecutionTarget > associationExecutionTargets ) { } } | if ( associationExecutionTargets == null ) { this . associationExecutionTargets = null ; return ; } this . associationExecutionTargets = new com . amazonaws . internal . SdkInternalList < AssociationExecutionTarget > ( associationExecutionTargets ) ; |
public class PartitionTable { /** * Retrieve the partition identifier for this set of matching variables . */
private String getPartition ( Set < String > variables ) { } } | String key = buildKey ( variables ) ; return partitionIds . computeIfAbsent ( key , k -> Character . toString ( ( char ) ( BASE_ID + idSequence ++ ) ) ) ; |
public class Configs { /** * Get self config string .
* @ param key config key with configAbsoluteClassPath in config file
* @ return config value string . Return null if not add config file or not config in config file .
* @ see # addSelfConfigs ( String , OneProperties ) */
public static String getHavePathSelfC... | String configAbsoluteClassPath = key . getConfigPath ( ) ; return getSelfConfig ( configAbsoluteClassPath , key ) ; |
public class ListFunctionsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ListFunctionsRequest listFunctionsRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( listFunctionsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listFunctionsRequest . getApiId ( ) , APIID_BINDING ) ; protocolMarshaller . marshall ( listFunctionsRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; protocolMars... |
public class ApiClientMgr { /** * Activity onResume回调
* @ param activity 发生 onResume 事件的activity */
@ Override public void onActivityResume ( Activity activity ) { } } | // 通知hmssdk activity onResume了
HuaweiApiClient client = getApiClient ( ) ; if ( client != null ) { HMSAgentLog . d ( "tell hmssdk: onResume" ) ; client . onResume ( activity ) ; } // 如果正在解决错误 , 则处理被覆盖的场景
HMSAgentLog . d ( "is resolving:" + isResolving ) ; if ( isResolving && ! PACKAGE_NAME_HIAPP . equals ( curAppPackag... |
public class AWSCodeCommitClient { /** * Sets or changes the comment or description for a repository .
* < note >
* The description field for a repository accepts all HTML characters and all valid Unicode characters . Applications
* that do not HTML - encode the description and display it in a web page could expo... | request = beforeClientExecution ( request ) ; return executeUpdateRepositoryDescription ( request ) ; |
public class JsonWriter { /** * Write a tab character to a character stream .
* @ throws IOException if an I / O error has occurred */
protected void indent ( ) throws IOException { } } | if ( prettyPrint ) { for ( int i = 0 ; i < indentDepth ; i ++ ) { writer . write ( indentString ) ; } } |
public class WTree { /** * Sets the row expansion mode .
* @ param expandMode the expand mode to set . */
public void setExpandMode ( final ExpandMode expandMode ) { } } | getOrCreateComponentModel ( ) . expandMode = expandMode == null ? ExpandMode . CLIENT : expandMode ; |
public class ModelsImpl { /** * Update an entity role for a given entity .
* @ param appId The application ID .
* @ param versionId The version ID .
* @ param entityId The entity ID .
* @ param roleId The entity role ID .
* @ param updateEntityRoleOptionalParameter the object representing the optional paramet... | return ServiceFuture . fromResponse ( updateEntityRoleWithServiceResponseAsync ( appId , versionId , entityId , roleId , updateEntityRoleOptionalParameter ) , serviceCallback ) ; |
public class AlluxioStatusException { /** * Converts an IOException to a corresponding status exception . Unless special cased , IOExceptions
* are converted to { @ link UnavailableException } .
* @ param ioe the IO exception to convert
* @ return the corresponding status exception */
public static AlluxioStatusE... | try { throw ioe ; } catch ( FileNotFoundException e ) { return new NotFoundException ( e ) ; } catch ( MalformedURLException e ) { return new InvalidArgumentException ( e ) ; } catch ( UserPrincipalNotFoundException e ) { return new UnauthenticatedException ( e ) ; } catch ( ClosedChannelException e ) { return new Fail... |
public class AnnotatedHttpServiceFactory { /** * Returns an { @ link AnnotatedHttpService } instance defined to { @ code method } of { @ code object } using
* { @ link Path } annotation . */
private static AnnotatedHttpServiceElement create ( String pathPrefix , Object object , Method method , List < ExceptionHandler... | final Set < Annotation > methodAnnotations = httpMethodAnnotations ( method ) ; if ( methodAnnotations . isEmpty ( ) ) { throw new IllegalArgumentException ( "HTTP Method specification is missing: " + method . getName ( ) ) ; } final Set < HttpMethod > methods = toHttpMethods ( methodAnnotations ) ; if ( methods . isEm... |
public class GrpcUtil { /** * Quietly closes all messages in MessageProducer . */
static void closeQuietly ( MessageProducer producer ) { } } | InputStream message ; while ( ( message = producer . next ( ) ) != null ) { closeQuietly ( message ) ; } |
public class GSLTImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public boolean eIsSet ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . GSLT__LINETYPE : return LINETYPE_EDEFAULT == null ? linetype != null : ! LINETYPE_EDEFAULT . equals ( linetype ) ; } return super . eIsSet ( featureID ) ; |
public class JAltGridScreen { /** * Move the the data record ( s ) to the screen controls . */
public void fieldsToControls ( ) { } } | super . fieldsToControls ( ) ; for ( int iRowIndex = 0 ; iRowIndex < m_vComponentCache . size ( ) ; iRowIndex ++ ) { ComponentCache componentCache = ( ComponentCache ) m_vComponentCache . elementAt ( iRowIndex ) ; if ( componentCache != null ) { // Move the data to the model
for ( int iColumnIndex = 0 ; iColumnIndex < ... |
public class EventLogQueue { /** * On event .
* @ param log
* the log
* @ param eventType
* the event type */
void onEvent ( EventLog log , EventType eventType ) { } } | switch ( eventType ) { case INSERT : onInsert ( log ) ; break ; case UPDATE : onUpdate ( log ) ; break ; case DELETE : onDelete ( log ) ; break ; default : throw new KunderaException ( "Invalid event type:" + eventType ) ; } |
public class OWLSubClassOfAxiomImpl_CustomFieldSerializer { /** * Deserializes the content of the object from the
* { @ link com . google . gwt . user . client . rpc . SerializationStreamReader } .
* @ param streamReader the { @ link com . google . gwt . user . client . rpc . SerializationStreamReader } to read the... | deserialize ( streamReader , instance ) ; |
public class AllGroupCombineDriver { @ Override public void setup ( TaskContext < GroupCombineFunction < IN , OUT > , OUT > context ) { } } | this . taskContext = context ; |
public class FeatureUtilities { /** * Make a { @ link SimpleFeatureCollection } from a set of { @ link Geometry } .
* < p > This is a fast utility and adds no attributes . < / p >
* @ param crs The { @ link CoordinateReferenceSystem } .
* @ param geometries the set of { @ link Geometry } to add .
* @ return the... | SimpleFeatureTypeBuilder b = new SimpleFeatureTypeBuilder ( ) ; b . setName ( "simplegeom" ) ; b . setCRS ( crs ) ; DefaultFeatureCollection newCollection = new DefaultFeatureCollection ( ) ; EGeometryType geometryType = EGeometryType . forGeometry ( geometries [ 0 ] ) ; b . add ( "the_geom" , geometryType . getClazz (... |
public class GeometryUtilities { /** * Creates a polygon that may help out as placeholder .
* @ return a dummy { @ link Polygon } . */
public static Polygon createDummyPolygon ( ) { } } | Coordinate [ ] c = new Coordinate [ ] { new Coordinate ( 0.0 , 0.0 ) , new Coordinate ( 1.0 , 1.0 ) , new Coordinate ( 1.0 , 0.0 ) , new Coordinate ( 0.0 , 0.0 ) } ; LinearRing linearRing = gf ( ) . createLinearRing ( c ) ; return gf ( ) . createPolygon ( linearRing , null ) ; |
public class CTLuMoranScatterplotOutlier { /** * Main method .
* @ param database Database
* @ param nrel Neighborhood relation
* @ param relation Data relation ( 1d ! )
* @ return Outlier detection result */
public OutlierResult run ( Database database , Relation < N > nrel , Relation < ? extends NumberVector ... | final NeighborSetPredicate npred = getNeighborSetPredicateFactory ( ) . instantiate ( database , nrel ) ; // Compute the global mean and variance
MeanVariance globalmv = new MeanVariance ( ) ; for ( DBIDIter iditer = relation . iterDBIDs ( ) ; iditer . valid ( ) ; iditer . advance ( ) ) { globalmv . put ( relation . ge... |
public class ConvertImage { /** * Converts an { @ link boofcv . struct . image . GrayF32 } into a { @ link boofcv . struct . image . GrayU16 } .
* @ param input Input image which is being converted . Not modified .
* @ param output ( Optional ) The output image . If null a new image is created . Modified .
* @ re... | if ( output == null ) { output = new GrayU16 ( input . width , input . height ) ; } else { output . reshape ( input . width , input . height ) ; } // threaded code is not significantly faster here
ImplConvertImage . convert ( input , output ) ; return output ; |
public class A_CmsReport { /** * Initializes some member variables for this report . < p >
* @ param locale the locale for this report
* @ param siteRoot the site root of the user who started this report ( may be < code > null < / code > ) */
protected void init ( Locale locale , String siteRoot ) { } } | m_starttime = System . currentTimeMillis ( ) ; m_locale = locale ; m_siteRoot = siteRoot ; m_messages = Messages . get ( ) . getBundle ( locale ) ; |
public class MetricDto { /** * Converts a metric entity to a DTO .
* @ param metric The metric to convert .
* @ return The corresponding DTO .
* @ throws WebApplicationException If an error occurs . */
public static MetricDto transformToDto ( Metric metric ) { } } | if ( metric == null ) { throw new WebApplicationException ( "Null entity object cannot be converted to Dto object." , Status . INTERNAL_SERVER_ERROR ) ; } MetricDto result = createDtoObject ( MetricDto . class , metric ) ; return result ; |
public class ListPlaybackConfigurationsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ListPlaybackConfigurationsRequest listPlaybackConfigurationsRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( listPlaybackConfigurationsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listPlaybackConfigurationsRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; protocolMarshaller . marshall ( listPlaybackConfigurationsRequest . getN... |
public class CmsSearchIndex { /** * Appends the a category filter to the given filter clause that matches all given categories . < p >
* In case the provided List is null or empty , the original filter is left unchanged . < p >
* The original filter parameter is extended and also provided as return value . < p >
... | if ( ( categories != null ) && ( categories . size ( ) > 0 ) ) { // add query categories ( if required )
// categories are indexed as lower - case strings
// @ see org . opencms . search . fields . CmsSearchFieldConfiguration # appendCategories
List < String > lowerCaseCategories = new ArrayList < String > ( ) ; for ( ... |
public class RegExStringUtil { /** * Return a list of < code > SearchLocation < / code > s representing the occurrences of the
* specified pattern in the specified source string .
* @ param strSource A string to search .
* @ param strPattern A pattern to search for .
* @ return A list of SearchLocations for eac... | return search ( strSource , strPattern , true ) ; |
public class TimeFilter { /** * Set start ( inclusive ) of time span .
* @ param s string representation of start time as HH : mm : ss . */
public void setStart ( final String s ) { } } | SimpleDateFormat stf = new SimpleDateFormat ( "HH:mm:ss" ) ; stf . setTimeZone ( TimeZone . getTimeZone ( "UTC" ) ) ; try { start = stf . parse ( s ) . getTime ( ) ; } catch ( ParseException ex ) { LogLog . warn ( "Error parsing start value " + s , ex ) ; } |
public class AbstractExtractionCondition { /** * { @ inheritDoc }
* @ see jp . co . future . uroborosql . fluent . ExtractionCondition # in ( java . lang . String , java . lang . Object [ ] ) */
@ SuppressWarnings ( "unchecked" ) @ Override public T in ( final String col , final Object ... values ) { } } | context ( ) . param ( CaseFormat . CAMEL_CASE . convert ( col ) , new In ( col , values ) ) ; this . useOperator = true ; return ( T ) this ; |
public class MSExcelUtil { /** * Generate a cell address in A1 format from a row and column number
* @ param rowNum row number
* @ param columnNum column number
* @ return Address in A1 format */
public static String getCellAddressA1Format ( int rowNum , int columnNum ) { } } | CellAddress cellAddr = new CellAddress ( rowNum , columnNum ) ; return cellAddr . formatAsString ( ) ; |
public class GridFTPServerFacade { /** * authenticate socket .
* if protection on , return authenticated socket wrapped over the original simpleSocket ,
* else return original socket . */
public static Socket authenticate ( Socket simpleSocket , boolean isClientSocket , GSSCredential credential , int protection , D... | GSSContext gssContext = null ; GSSManager manager = ExtendedGSSManager . getInstance ( ) ; if ( isClientSocket ) { gssContext = manager . createContext ( null , GSSConstants . MECH_OID , credential , GSSContext . DEFAULT_LIFETIME ) ; } else { gssContext = manager . createContext ( credential ) ; } if ( protection != Gr... |
public class Location { /** * Compare two locations and return if the locations are near or not
* @ param location Location to compare with
* @ param distance The distance between two locations
* @ return true is the real distance is lower or equals than the distance parameter */
public boolean isNearTo ( Locatio... | if ( this . is2DLocation ( ) && location . is2DLocation ( ) ) { return this . isNearTo ( location . getLocation2D ( ) , distance ) ; } else if ( this . is3DLocation ( ) && location . is3DLocation ( ) ) { return this . isNearTo ( location . getLocation3D ( ) , distance ) ; } else { return false ; } |
public class CommerceNotificationTemplateUtil { /** * Returns the first commerce notification template in the ordered set where uuid = & # 63 ; .
* @ param uuid the uuid
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the first matching commerce no... | return getPersistence ( ) . fetchByUuid_First ( uuid , orderByComparator ) ; |
public class IOUtil { /** * return the mime type of a file , dont check extension
* @ param barr
* @ return mime type of the file
* @ throws IOException */
public static String getMimeType ( byte [ ] barr , String defaultValue ) { } } | PrintStream out = System . out ; try { Tika tika = new Tika ( ) ; return tika . detect ( barr ) ; } catch ( Throwable t ) { ExceptionUtil . rethrowIfNecessary ( t ) ; return defaultValue ; } |
public class PdfContentByte { /** * Gets a < CODE > Graphics2D < / CODE > to print on . The graphics
* are translated to PDF commands .
* @ param width the width of the panel
* @ param height the height of the panel
* @ param printerJob
* @ return a < CODE > Graphics2D < / CODE > */
public java . awt . Graphi... | return new PdfPrinterGraphics2D ( this , width , height , null , false , false , 0 , printerJob ) ; |
public class ProfilerParseRunner { /** * Returns a string describing , in order of ' expensiveness ' , the top - level failed rule chains in the parse run . */
public String getOverviewReport ( ) { } } | TreeSet < ReportEntry < V > > topLevelFailed = new TreeSet < ReportEntry < V > > ( ) ; fillReport ( topLevelFailed , rootReport ) ; StringBuilder out = new StringBuilder ( ) ; for ( ReportEntry < V > entry : topLevelFailed ) { if ( entry . getSubSteps ( ) < 100 ) break ; out . append ( formatReport ( entry , false ) ) ... |
public class EventManger { /** * Signal an event and the event result .
* This method will return < code > false < / code > if the event was not created with
* { @ link # performActionAndWaitForEvent ( Object , long , Callback ) } .
* @ param eventKey the event key , must not be null .
* @ param eventResult the... | final Reference < R > reference = events . get ( eventKey ) ; if ( reference == null ) { return false ; } reference . eventResult = eventResult ; synchronized ( reference ) { reference . notifyAll ( ) ; } return true ; |
public class URL { /** * Makes a copy of a given URL with some additional components .
* @ param serviceUUID UUID of a GATT service
* @ return a copy of a given URL with some additional components */
public URL copyWithService ( String serviceUUID ) { } } | return new URL ( this . protocol , this . adapterAddress , this . deviceAddress , this . deviceAttributes , serviceUUID , null , null ) ; |
public class ForwardCurveWithFixings { /** * Returns the forwards for a given vector fixing times .
* @ param model An analytic model providing a context . The discount curve ( if needed ) is obtained from this model .
* @ param fixingTimes The given fixing times .
* @ return The forward rates . */
public double ... | double [ ] values = new double [ fixingTimes . length ] ; for ( int i = 0 ; i < fixingTimes . length ; i ++ ) { values [ i ] = getForward ( model , fixingTimes [ i ] ) ; } return values ; |
public class BaasUser { /** * Asynchronously fetches the list of users from the server .
* @ param flags { @ link RequestOptions }
* @ param handler an handler to be invoked upon completion of the request
* @ return a { @ link com . baasbox . android . RequestToken } to manage the request */
public static Request... | BaasBox box = BaasBox . getDefaultChecked ( ) ; FetchUsers users = new FetchUsers ( box , "users" , null , filter , flags , handler ) ; return box . submitAsync ( users ) ; |
public class ClasspathElementZip { /** * / * ( non - Javadoc )
* @ see io . github . classgraph . ClasspathElement # getURI ( ) */
@ Override URI getURI ( ) { } } | try { return new URI ( URLPathEncoder . normalizeURLPath ( getZipFilePath ( ) ) ) ; } catch ( final URISyntaxException e ) { throw new IllegalArgumentException ( "Could not form URI: " + e ) ; } |
public class AWSJavaMailTransport { /** * Sends a MIME message through Amazon ' s E - mail Service with the specified
* recipients . Addresses that are passed into this method are merged with
* the ones already embedded in the message ( duplicates are removed ) .
* @ param msg
* A Mime type e - mail message to ... | checkConnection ( ) ; checkMessage ( msg ) ; checkAddresses ( msg , addresses ) ; collateRecipients ( msg , addresses ) ; SendRawEmailRequest req = prepareEmail ( msg ) ; sendEmail ( msg , req ) ; |
public class KeyVaultClientBaseImpl { /** * Gets the creation operation of a certificate .
* Gets the creation operation associated with a specified certificate . This operation requires the certificates / get permission .
* @ param vaultBaseUrl The vault name , for example https : / / myvault . vault . azure . net... | return getCertificateOperationWithServiceResponseAsync ( vaultBaseUrl , certificateName ) . map ( new Func1 < ServiceResponse < CertificateOperation > , CertificateOperation > ( ) { @ Override public CertificateOperation call ( ServiceResponse < CertificateOperation > response ) { return response . body ( ) ; } } ) ; |
public class FctBnPublicTradeProcessors { /** * < p > Lazy get PrBur . < / p >
* @ param pAddParam additional param
* @ return requested PrBur
* @ throws Exception - an exception */
protected final PrBur < RS > lazyGetPrBur ( final Map < String , Object > pAddParam ) throws Exception { } } | String beanName = PrBur . class . getSimpleName ( ) ; @ SuppressWarnings ( "unchecked" ) PrBur < RS > proc = ( PrBur < RS > ) this . processorsMap . get ( beanName ) ; if ( proc == null ) { proc = new PrBur < RS > ( ) ; proc . setSrvOrm ( getSrvOrm ( ) ) ; proc . setSrvDb ( getSrvDatabase ( ) ) ; proc . setLog ( getLog... |
public class AttributeCollector { /** * Method called to decode the whole attribute value as a single
* typed value .
* Decoding is done using the decoder provided . */
public final void decodeValue ( int index , TypedValueDecoder tvd ) throws IllegalArgumentException { } } | if ( index < 0 || index >= mAttrCount ) { throwIndex ( index ) ; } /* Should be faster to pass the char array even if we might
* have a String */
// Either way , need to trim before passing :
char [ ] buf = mValueBuilder . getCharBuffer ( ) ; int start = mAttributes [ index ] . mValueStartOffset ; int end = getValueS... |
public class SolrIndexer { /** * Index a payload using the provided data using a python script
* @ param object
* : The DigitalObject to index
* @ param payload
* : The Payload to index
* @ param in
* : Reader containing the new empty document
* @ param inConf
* : An InputStream holding the config file ... | try { JsonSimpleConfig jsonConfig = getConfigFile ( confOid ) ; // Get our data ready
Map < String , Object > bindings = new HashMap < String , Object > ( ) ; Map < String , List < String > > fields = new HashMap < String , List < String > > ( ) ; bindings . put ( "fields" , fields ) ; bindings . put ( "jsonConfig" , j... |
public class CmsSitemapController { /** * Validates the entry and the given path . < p >
* @ param entry the entry
* @ param toPath the path
* @ return < code > true < / code > if entry and path are valid */
private boolean isValidEntryAndPath ( CmsClientSitemapEntry entry , String toPath ) { } } | return ( ( toPath != null ) && ( CmsResource . getParentFolder ( toPath ) != null ) && ( entry != null ) && ( getEntry ( CmsResource . getParentFolder ( toPath ) ) != null ) && ( getEntry ( entry . getSitePath ( ) ) != null ) ) ; |
public class SmartHandle { /** * Use this SmartHandle as a test to guard target and fallback handles .
* @ param target the " true " path for this handle ' s test
* @ param fallback the " false " path for this handle ' s test
* @ return a new SmartHandle that performs the test and branch */
public SmartHandle gua... | return new SmartHandle ( target . signature , MethodHandles . guardWithTest ( handle , target . handle , fallback . handle ) ) ; |
public class SchemaService { /** * Delete the given application ' s schema row from the Applications CF . */
private void deleteAppProperties ( ApplicationDefinition appDef ) { } } | Tenant tenant = Tenant . getTenant ( appDef ) ; DBTransaction dbTran = DBService . instance ( tenant ) . startTransaction ( ) ; dbTran . deleteRow ( SchemaService . APPS_STORE_NAME , appDef . getAppName ( ) ) ; DBService . instance ( tenant ) . commit ( dbTran ) ; |
public class LongStream { /** * Returns a { @ code LongStream } produced by iterative application of a accumulation function
* to an initial element { @ code identity } and next element of the current stream .
* Produces a { @ code LongStream } consisting of { @ code identity } , { @ code acc ( identity , value1 ) ... | Objects . requireNonNull ( accumulator ) ; return new LongStream ( params , new LongScanIdentity ( iterator , identity , accumulator ) ) ; |
public class CreateFleetRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional
* parameters to enable operation dry - run . */
@ Override public Request < CreateFleetRequest > getDryRunRequest ( ) { } } | Request < CreateFleetRequest > request = new CreateFleetRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ; |
public class CompletedJobStatusStore { /** * This method retrieves Counters information from DFS stored using
* store method .
* @ param jobId the jobId for which Counters is queried
* @ return Counters object , null if not able to retrieve */
public Counters readCounters ( JobID jobId ) { } } | Counters counters = null ; if ( active ) { try { FSDataInputStream dataIn = getJobInfoFile ( jobId ) ; if ( dataIn != null ) { readJobStatus ( dataIn ) ; readJobProfile ( dataIn ) ; counters = readCounters ( dataIn ) ; dataIn . close ( ) ; } } catch ( IOException ex ) { LOG . warn ( "Could not read [" + jobId + "] job ... |
public class SqlUtil { /** * 将RowId转为字符串
* @ param rowId RowId
* @ return RowId字符串 */
public static String rowIdToString ( RowId rowId ) { } } | return StrUtil . str ( rowId . getBytes ( ) , CharsetUtil . CHARSET_ISO_8859_1 ) ; |
public class DescribeConfigurationRecorderStatusRequest { /** * The name ( s ) of the configuration recorder . If the name is not specified , the action returns the current status of
* all the configuration recorders associated with the account .
* @ param configurationRecorderNames
* The name ( s ) of the config... | if ( configurationRecorderNames == null ) { this . configurationRecorderNames = null ; return ; } this . configurationRecorderNames = new com . amazonaws . internal . SdkInternalList < String > ( configurationRecorderNames ) ; |
public class ServiceContainerHelper { /** * Ensures the specified service is removed .
* @ param controller a service controller */
public static void remove ( ServiceController < ? > controller ) { } } | try { transition ( controller , State . REMOVED ) ; } catch ( StartException e ) { // This can ' t happen
throw new IllegalStateException ( e ) ; } |
public class DoubleTupleCollections { /** * Returns a deep copy of the given collection of tuples . If any element
* of the given collection is < code > null < / code > , then < code > null < / code >
* will also be added to the target collection .
* @ param tuples The input tuples
* @ return The deep copy */
p... | List < MutableDoubleTuple > result = new ArrayList < MutableDoubleTuple > ( tuples . size ( ) ) ; for ( DoubleTuple t : tuples ) { if ( t == null ) { result . add ( null ) ; } else { result . add ( DoubleTuples . copy ( t ) ) ; } } return result ; |
public class DatabaseVulnerabilityAssessmentScansInner { /** * Lists the vulnerability assessment scans of a database .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable t... | return listByDatabaseNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < VulnerabilityAssessmentScanRecordInner > > , Page < VulnerabilityAssessmentScanRecordInner > > ( ) { @ Override public Page < VulnerabilityAssessmentScanRecordInner > call ( ServiceResponse < Page < Vulnerabi... |
public class PrefsAdapter { /** * Get a View that displays the data at the specified position in the data set . You can either create a View manually or inflate it from an XML
* layout file . When the View is inflated , the parent View ( GridView , ListView . . . ) will apply default layout parameters unless you use ... | ViewHolder holder ; Pair < String , ? > keyVal = getItem ( position ) ; if ( convertView == null ) { holder = new ViewHolder ( ) ; convertView = inflater . inflate ( R . layout . preference_item , parent , false ) ; holder . key = ( TextView ) convertView . findViewById ( R . id . key ) ; holder . value = ( TextView ) ... |
public class A_CmsHtmlIconButton { /** * Generates a default html code where several buttons can have the same help text . < p >
* @ param style the style of the button
* @ param id the id
* @ param helpId the id of the helptext div tag
* @ param name the name , if empty only the icon is displayed
* @ param h... | StringBuffer html = new StringBuffer ( 1024 ) ; if ( style == CmsHtmlIconButtonStyleEnum . BIG_ICON_TEXT ) { html . append ( "<div class='bigLink' id='img" ) ; html . append ( id ) ; html . append ( "'>\n" ) ; } html . append ( "\t<span class=\"link" ) ; if ( enabled ) { html . append ( "\"" ) ; } else { html . append ... |
public class StackBenchmarkParameterized { /** * Simple setUp of a benchmark . The { @ link Benchmark } is initialized with two Meters ( < code > TimeMeter < / code > and
* < code > MemMeter < / code > ) . Afterwards the benchmark is running with a TabularOutput as a listener registered . The
* result of the benchm... | final Benchmark bench = new Benchmark ( config ) ; bench . add ( StackBenchmarkParameterized . class ) ; final BenchmarkResult res = bench . run ( ) ; new TabularSummaryOutput ( ) . visitBenchmark ( res ) ; |
public class MetricReportReporter { /** * Converts a single key - value pair into a metric .
* @ param name name of the metric
* @ param value value of the metric to report
* @ param path additional suffixes to further identify the meaning of the reported value
* @ return a { @ link org . apache . gobblin . met... | return new Metric ( MetricRegistry . name ( name , path ) , value . doubleValue ( ) ) ; |
public class CmsAliasTableController { /** * Triggers server - side validation of the alias table and of a new entry which should be added to it . < p >
* @ param newEntry the new entry */
protected void validateNew ( final CmsAliasTableRow newEntry ) { } } | CmsRpcAction < CmsAliasEditValidationReply > action = new CmsRpcAction < CmsAliasEditValidationReply > ( ) { @ Override public void execute ( ) { start ( 200 , true ) ; CmsAliasEditValidationRequest validationRequest = new CmsAliasEditValidationRequest ( ) ; List < CmsAliasTableRow > rows = m_view . getLiveData ( ) ; v... |
public class AbstractInstant { /** * Checks if the field type specified is supported by this instant and chronology .
* This can be used to avoid exceptions in { @ link # get ( DateTimeFieldType ) } .
* @ param type a field type , usually obtained from DateTimeFieldType
* @ return true if the field type is suppor... | if ( type == null ) { return false ; } return type . getField ( getChronology ( ) ) . isSupported ( ) ; |
public class TransformationDescription { /** * Adds a value step to the transformation description . The given value is written to the target field . */
public void valueField ( String targetField , String value ) { } } | TransformationStep step = new TransformationStep ( ) ; step . setTargetField ( targetField ) ; step . setOperationParameter ( TransformationConstants . VALUE_PARAM , value ) ; step . setOperationName ( "value" ) ; steps . add ( step ) ; |
public class KeyVaultClientBaseImpl { /** * Creates or updates a new storage account . This operation requires the storage / set permission .
* @ param vaultBaseUrl The vault name , for example https : / / myvault . vault . azure . net .
* @ param storageAccountName The name of the storage account .
* @ param res... | return ServiceFuture . fromResponse ( setStorageAccountWithServiceResponseAsync ( vaultBaseUrl , storageAccountName , resourceId , activeKeyName , autoRegenerateKey ) , serviceCallback ) ; |
public class AppEngineStrongDatastoreSession { /** * Updates entity with the specified entity instance with
* { @ code AppEngineCoordinator } .
* This method must be invoked under a transaction .
* @ param entity The entity instance to be updated . */
@ Override public void update ( Object entity ) { } } | if ( entity == null ) { throw new IllegalArgumentException ( "'entity' must not be [" + entity + "]" ) ; } assertTransactional ( ) ; ( ( AppEngineGlobalTransaction ) transaction . get ( ) ) . coordinator ( ) . update ( entity ) ; |
public class Expression { /** * Create a logical AND expression that performs logical AND operation with
* the current expression .
* @ param expression the expression to AND with the current expression .
* @ return a logical AND expression . */
@ NonNull public Expression and ( @ NonNull Expression expression ) ... | if ( expression == null ) { throw new IllegalArgumentException ( "expression cannot be null." ) ; } return new CompoundExpression ( Arrays . asList ( this , expression ) , CompoundExpression . OpType . And ) ; |
public class ClassDescriptorDef { /** * Returns the field descriptors given in the the field names list .
* @ param fieldNames The field names , separated by commas
* @ return The field descriptors in the order given by the field names
* @ throws NoSuchFieldException If a field hasn ' t been found */
public Array... | ArrayList result = new ArrayList ( ) ; FieldDescriptorDef fieldDef ; String name ; for ( CommaListIterator it = new CommaListIterator ( fieldNames ) ; it . hasNext ( ) ; ) { name = it . getNext ( ) ; fieldDef = getField ( name ) ; if ( fieldDef == null ) { throw new NoSuchFieldException ( name ) ; } result . add ( fiel... |
public class BaseLexicon { /** * Evaluates how many words ( = terminals ) in a collection of trees are
* covered by the lexicon . First arg is the collection of trees ; second
* through fourth args get the results . Currently unused ; this probably
* only works if train and test at same time so tags and words var... | List < IntTaggedWord > iTW1 = new ArrayList < IntTaggedWord > ( ) ; for ( Tree t : trees ) { iTW1 . addAll ( treeToEvents ( t ) ) ; } int total = 0 ; int unseen = 0 ; for ( IntTaggedWord itw : iTW1 ) { total ++ ; if ( ! words . contains ( new IntTaggedWord ( itw . word ( ) , nullTag ) ) ) { missingWords . add ( wordInd... |
public class AmazonSimpleEmailServiceClient { /** * Creates a receipt rule .
* For information about setting up receipt rules , see the < a
* href = " http : / / docs . aws . amazon . com / ses / latest / DeveloperGuide / receiving - email - receipt - rules . html " > Amazon SES
* Developer Guide < / a > .
* Yo... | request = beforeClientExecution ( request ) ; return executeCreateReceiptRule ( request ) ; |
public class ConfluenceGreenPepper { /** * < p > getTokenAuthenticationManager . < / p >
* @ return a { @ link com . atlassian . confluence . rpc . auth . TokenAuthenticationManager } object . */
public TokenAuthenticationManager getTokenAuthenticationManager ( ) { } } | if ( tokenManager != null ) { return tokenManager ; } tokenManager = ( TokenAuthenticationManager ) ContainerManager . getComponent ( "tokenAuthenticationManager" ) ; return tokenManager ; |
public class LaTypicalPostcard { public void attachPlainText ( String filenameOnHeader , InputStream resourceStream , String textEncoding ) { } } | assertArgumentNotEmpty ( "filenameOnHeader" , filenameOnHeader ) ; assertArgumentNotNull ( "resourceStream" , resourceStream ) ; assertArgumentNotEmpty ( "textEncoding" , textEncoding ) ; postcard . attachPlainText ( filenameOnHeader , resourceStream , textEncoding ) ; |
public class Timex3Interval { /** * setter for endTimex - sets
* @ generated
* @ param v value to set into the feature */
public void setEndTimex ( String v ) { } } | if ( Timex3Interval_Type . featOkTst && ( ( Timex3Interval_Type ) jcasType ) . casFeat_endTimex == null ) jcasType . jcas . throwFeatMissing ( "endTimex" , "de.unihd.dbs.uima.types.heideltime.Timex3Interval" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Timex3Interval_Type ) jcasType ) . casFeatCode_endTimex ,... |
public class GeneralStorable { /** * Returns the key belonging to the given field as long
* @ param field
* the name of the field
* @ return the requested value
* @ throws IOException */
public double getKeyAsDouble ( String field ) throws IOException { } } | int hash = Arrays . hashCode ( field . getBytes ( ) ) ; return getKeyAsDouble ( structure . keyHash2Index . get ( hash ) ) ; |
public class YggdrasilAuthenticator { /** * Creates a < code > YggdrasilAuthenticator < / code > , and initializes it with
* password .
* @ param username the username
* @ param password the password
* @ param characterSelector the character selector
* @ return a YggdrasilAuthenticator
* @ throws Authentica... | return password ( username , password , characterSelector , UUIDUtils . randomUnsignedUUID ( ) ) ; |
public class PoolManager { /** * This method releases ManagedConnection . If the affinity is used and the connection is associated
* with the affinity , it is registered as unused . Otherwise it is prepared
* for reuse ( using < code > cleanup < / code > method and then registered as unused .
* @ param managed Ma... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( this , tc , "release" , mcWrapper , affinity , "Pool contents ==>" , toString2 ( 1 ) ) ; } if ( ( ( com . ibm . ejs . j2c . MCWrapper ) mcWrapper ) . isAlreadyBeingReleased ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && ... |
public class MarkLogicRepositoryConnection { /** * set bindings ? s , ? p and special handling of Value ? o ( and ? ctx )
* @ param query
* @ param subj
* @ param pred
* @ param obj
* @ param contexts
* @ throws RepositoryException */
private void setBindings ( Query query , Resource subj , URI pred , Value... | if ( subj != null ) { query . setBinding ( "s" , subj ) ; } if ( pred != null && pred instanceof URI ) { query . setBinding ( "p" , pred ) ; } if ( obj != null ) { query . setBinding ( "o" , obj ) ; } if ( contexts != null && contexts . length > 0 ) { DatasetImpl dataset = new DatasetImpl ( ) ; if ( notNull ( contexts ... |
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public STOBORNTION createSTOBORNTIONFromString ( EDataType eDataType , String initialValue ) { } } | STOBORNTION result = STOBORNTION . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class UTS46 { /** * returns the new label length */
private int processLabel ( StringBuilder dest , int labelStart , int labelLength , boolean toASCII , Info info ) { } } | StringBuilder fromPunycode ; StringBuilder labelString ; int destLabelStart = labelStart ; int destLabelLength = labelLength ; boolean wasPunycode ; if ( labelLength >= 4 && dest . charAt ( labelStart ) == 'x' && dest . charAt ( labelStart + 1 ) == 'n' && dest . charAt ( labelStart + 2 ) == '-' && dest . charAt ( label... |
public class AllureThreadContext { /** * Returns first ( oldest ) uuid . */
public Optional < String > getRoot ( ) { } } | final LinkedList < String > uuids = context . get ( ) ; return uuids . isEmpty ( ) ? Optional . empty ( ) : Optional . of ( uuids . getLast ( ) ) ; |
public class DocumentConventions { /** * Gets the collection name for a given type .
* @ param entity entity to get collection name
* @ return collection name */
public String getCollectionName ( Object entity ) { } } | if ( entity == null ) { return null ; } return getCollectionName ( entity . getClass ( ) ) ; |
public class JenkinsController { /** * Creating a configuration */
@ RequestMapping ( value = "configurations/create" , method = RequestMethod . POST ) public JenkinsConfiguration newConfiguration ( @ RequestBody JenkinsConfiguration configuration ) { } } | return jenkinsService . newConfiguration ( configuration ) ; |
public class PaxLoggingServiceImpl { /** * use local class to delegate calls to underlying instance while keeping bundle reference */
public Object getService ( final Bundle bundle , ServiceRegistration registration ) { } } | class ManagedPaxLoggingService implements PaxLoggingService , LogService , ManagedService { private final String fqcn = getClass ( ) . getName ( ) ; public void log ( int level , String message ) { PaxLoggingServiceImpl . this . log ( bundle , level , message , null , fqcn ) ; } public void log ( int level , String mes... |
public class SequenceMixin { /** * A case - sensitive manner of comparing two sequence objects together .
* We will throw out any compounds which fail to match on their sequence
* length & compound sets used . The code will also bail out the moment
* we find something is wrong with a Sequence . Cost to run is lin... | return baseSequenceEquality ( source , target , false ) ; |
public class WebSocketConnection { /** * Returns the input stream for this connection . If { @ code untilCloseFrame } is { @ code true } then the returned stream
* completes after receiving ( and emitting ) a { @ link CloseWebSocketFrame } , otherwise , it completes with an error
* when the underlying channel is cl... | Observable < WebSocketFrame > rawInput = delegate . getInput ( ) ; if ( untilCloseFrame ) { return rawInput . takeUntil ( new Func1 < WebSocketFrame , Boolean > ( ) { @ Override public Boolean call ( WebSocketFrame webSocketFrame ) { return webSocketFrame instanceof CloseWebSocketFrame ; } } ) ; } else { return rawInpu... |
public class NLS { /** * Create a simple default formatted string .
* @ param key which would look up the message in a resource bundle .
* @ param objects which would be inserted into the message .
* @ return String the formatted String . */
String objectsToString ( String key , Object objects ) { } } | java . io . StringWriter stringWriter = new java . io . StringWriter ( ) ; stringWriter . write ( key ) ; stringWriter . write ( ":" ) ; if ( objects == null ) { stringWriter . write ( "\n" ) ; } else if ( objects instanceof Object [ ] ) { for ( int i = 0 ; i < ( ( Object [ ] ) objects ) . length ; i ++ ) { Object obje... |
public class ZonedDateTime { /** * Returns a copy of this { @ code ZonedDateTime } with the specified number of minutes subtracted .
* This operates on the instant time - line , such that subtracting one minute will
* always be a duration of one minute earlier .
* This may cause the local date - time to change by... | return ( minutes == Long . MIN_VALUE ? plusMinutes ( Long . MAX_VALUE ) . plusMinutes ( 1 ) : plusMinutes ( - minutes ) ) ; |
public class WmfDumpFileManager { /** * Finds all page revision dump files , online or locally , that are relevant
* to obtain the most current state of the data . Revision dump files are
* dumps that contain page revisions in MediaWiki ' s XML format .
* If the parameter < b > preferCurrent < / b > is true , the... | MwDumpFile mainDump ; if ( preferCurrent ) { mainDump = findMostRecentDump ( DumpContentType . CURRENT ) ; } else { mainDump = findMostRecentDump ( DumpContentType . FULL ) ; } if ( mainDump == null ) { return findAllDumps ( DumpContentType . DAILY ) ; } List < MwDumpFile > result = new ArrayList < > ( ) ; for ( MwDump... |
public class RemoteBundleContextClient { /** * { @ inheritDoc } */
public void waitForState ( final long bundleId , final int state , final long timeoutInMillis ) throws TimeoutException { } } | try { getRemoteBundleContext ( ) . waitForState ( bundleId , state , timeoutInMillis ) ; } catch ( org . ops4j . pax . exam . rbc . internal . TimeoutException e ) { throw new TimeoutException ( e . getMessage ( ) ) ; } catch ( RemoteException e ) { throw new TestContainerException ( "Remote exception" , e ) ; } catch ... |
public class StateFilter { /** * / * ( non - Javadoc )
* @ see tuwien . auto . calimero . buffer . Configuration . RequestFilter # request (
* tuwien . auto . calimero . KNXAddress , tuwien . auto . calimero . buffer . Configuration ) */
@ Override public CEMILData request ( final KNXAddress dst , final Configurati... | final Cache cache = c . getCache ( ) ; if ( cache == null || ! ( dst instanceof GroupAddress ) ) return null ; final LDataObject o = ( LDataObject ) cache . get ( dst ) ; if ( o == null ) return null ; // check if there is an expiration timeout for a state based value
final Datapoint dp ; final DatapointModel < ? > m =... |
public class Slice { /** * Returns a slice of this buffer ' s sub - region . Modifying the content of
* the returned buffer or this buffer affects each other ' s content while
* they maintain separate indexes and marks . */
public Slice slice ( int index , int length ) { } } | if ( index == 0 && length == this . length ) { return this ; } checkPositionIndexes ( index , index + length , this . length ) ; if ( index >= 0 && length == 0 ) { return Slices . EMPTY_SLICE ; } return new Slice ( data , offset + index , length ) ; |
public class CommandArgs { /** * Add multiple key arguments .
* @ param keys must not be { @ literal null } .
* @ return the command args . */
public CommandArgs < K , V > addKeys ( Iterable < K > keys ) { } } | LettuceAssert . notNull ( keys , "Keys must not be null" ) ; for ( K key : keys ) { addKey ( key ) ; } return this ; |
public class DataStoreScanStatusDAO { /** * Returns the scan status table name . On the first call it also verifies that the table exists , then skips this
* check on future calls . */
private String getTable ( ) { } } | if ( ! _tableChecked ) { if ( ! _dataStore . getTableExists ( _tableName ) ) { _dataStore . createTable ( _tableName , new TableOptionsBuilder ( ) . setPlacement ( _tablePlacement ) . build ( ) , ImmutableMap . < String , Object > of ( ) , new AuditBuilder ( ) . setLocalHost ( ) . setComment ( "Create scan status table... |
public class AIStream { /** * Turn a tick to L / A . Used to either :
* ( 1 ) turn an assured V / U to L / A , in which case acceptedItemId is valid , or
* ( 2 ) turn an express Q / G to L / A when discarding a message that came in out of order */
public void updateToAccepted ( long tick , AIProtocolItem acceptedIt... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "updateToAccepted" , new Object [ ] { Long . valueOf ( tick ) , acceptedItem } ) ; _targetStream . setCursor ( tick ) ; TickRange tr = _targetStream . getNext ( ) ; if ( ( tr . type == TickRange . Requested ) || ( tr . type ... |
public class ReferenceCountedOpenSslContext { /** * Return the pointer to a < a href = " https : / / www . openssl . org / docs / crypto / BIO _ get _ mem _ ptr . html " > in - memory BIO < / a >
* or { @ code 0 } if the { @ code certChain } is { @ code null } . The BIO contains the content of the { @ code certChain ... | if ( certChain == null ) { return 0 ; } if ( certChain . length == 0 ) { throw new IllegalArgumentException ( "certChain can't be empty" ) ; } PemEncoded pem = PemX509Certificate . toPEM ( allocator , true , certChain ) ; try { return toBIO ( allocator , pem . retain ( ) ) ; } finally { pem . release ( ) ; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.