signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcCartesianTransformationOperator2D ( ) { } } | if ( ifcCartesianTransformationOperator2DEClass == null ) { ifcCartesianTransformationOperator2DEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 82 ) ; } return ifcCartesianTransformationOperator2DEClass ; |
public class SymmetryHttpMessageConverter { private static Charset getCharset ( HttpOutputMessage outputMessage ) { } } | Charset charset = outputMessage . getHeaders ( ) . getContentType ( ) . getCharSet ( ) ; if ( charset == null ) { charset = DEFAULT_CHARSET ; } return charset ; |
public class ConsumerSessionImpl { /** * Adds the bifurcated consumer to the list of associated consumers .
* @ param consumer */
protected void attachBifurcatedConsumer ( BifurcatedConsumerSessionImpl consumer ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "attachBifurcatedConsumer" , consumer ) ; // Create a bifurcated list if required
if ( _bifurcatedConsumers == null ) { synchronized ( this ) { if ( _bifurcatedConsumers == null ) _bifurcatedConsumers = new LinkedList < Bifu... |
public class CollationIterator { /** * Returns the next code point and its local CE32 value .
* Returns Collation . FALLBACK _ CE32 at the end of the text ( c < 0)
* or when c ' s CE32 value is to be looked up in the base data ( fallback ) .
* The code point is used for fallbacks , context and implicit weights . ... | int c = nextCodePoint ( ) ; if ( c < 0 ) { return NO_CP_AND_CE32 ; } return makeCodePointAndCE32Pair ( c , data . getCE32 ( c ) ) ; |
public class UniqueCountMap { /** * Returns total bytes used by all internal maps
* @ return total bytes used by all internal maps */
public long getMemoryUsageBytes ( ) { } } | long total = 0 ; for ( int i = 0 ; i < maps_ . length ; i ++ ) { if ( maps_ [ i ] != null ) { total += maps_ [ i ] . getMemoryUsageBytes ( ) ; } } return total ; |
public class CmsSelectWidgetOption { /** * Returns a list of default options from the given list of select options . < p >
* If an element found in the given list is not of type
* < code > { @ link CmsSelectWidgetOption } < / code > , this is ignored . < p >
* @ param options the list of select options to get the... | List < CmsSelectWidgetOption > defaults = new ArrayList < CmsSelectWidgetOption > ( ) ; if ( ( options == null ) || ( options . size ( ) == 0 ) ) { return defaults ; } for ( int i = 0 ; i < options . size ( ) ; i ++ ) { Object o = options . get ( i ) ; if ( o instanceof CmsSelectWidgetOption ) { CmsSelectWidgetOption o... |
public class Expression { /** * Return the first node out of the nodeset , if this expression is
* a nodeset expression .
* @ param xctxt The XPath runtime context .
* @ return the first node out of the nodeset , or DTM . NULL .
* @ throws javax . xml . transform . TransformerException */
public int asNode ( XP... | DTMIterator iter = execute ( xctxt ) . iter ( ) ; return iter . nextNode ( ) ; |
public class MavenHelpers { /** * Updates the given maven property value if value is not null and returns true if the pom has been changed
* @ return true if the value changed and was non null or updated was true */
public static boolean updatePomProperty ( Properties properties , String name , Object value , boolean... | if ( value != null ) { Object oldValue = properties . get ( name ) ; if ( ! Objects . equal ( oldValue , value ) ) { getLOG ( ) . debug ( "Updating pom.xml property: " + name + " to " + value ) ; properties . put ( name , value ) ; return true ; } } return updated ; |
public class GenMapAndTopicListModule { /** * Handle topic which are only conref sources from normal processing . */
private void handleConref ( ) { } } | // Get pure conref targets
final Set < URI > pureConrefTargets = new HashSet < > ( 128 ) ; for ( final URI target : conrefTargetSet ) { if ( ! nonConrefCopytoTargetSet . contains ( target ) ) { pureConrefTargets . add ( target ) ; } } conrefTargetSet = pureConrefTargets ; // Remove pure conref targets from fullTopicSet... |
public class LocalThreadObjectPool { /** * Gets an array of Objects from the pool . This method will return a varying
* number
* of elements based on the number of available objects ( it will always leave
* at
* least 1/2 the minimum pool size ) and the batch size configured for the
* pool .
* @ return Obje... | Object [ ] objectArray = new Object [ batchSize ] ; objectArray [ 0 ] = get ( ) ; // always attempt to get at least 1 , get ( ) could
// return null
// if no factory was defined when instantiated .
int numElements = getCurrentNumElements ( ) ; for ( int i = 1 ; i <= numElements && i < batchSize ; i ++ ) { objectArray [... |
public class StringToTranscriptEffect { /** * Split the specified string into a list of effects .
* @ param s string to split
* @ return the specified string split into a list of effects */
List < String > splitEffects ( final String s ) { } } | return Splitter . on ( "&" ) . omitEmptyStrings ( ) . splitToList ( s ) ; |
public class JdbcCpoXaAdapter { /** * Retrieves the bean from the datasource . The assumption is that the bean exists in the datasource .
* @ param name The filter name which tells the datasource which beans should be returned . The name also signifies what
* data in the bean will be populated .
* @ param criteri... | return getCurrentResource ( ) . retrieveBeans ( name , criteria ) ; |
public class Parameters { /** * Set a float value to the query parameter referenced by the given name . A query parameter
* is defined by using the Expression ' s parameter ( String name ) function .
* @ param name The parameter name .
* @ param value The float value .
* @ return The self object . */
@ NonNull ... | return setValue ( name , value ) ; |
public class ThumborUrlBuilder { /** * This filter permit to return an image sized exactly as requested wherever is its ratio by
* filling with chosen color the missing parts . Usually used with " fit - in " or " adaptive - fit - in "
* @ param color integer representation of color . */
public static String fill ( ... | final String colorCode = Integer . toHexString ( color & 0xFFFFFF ) ; // Strip alpha
return FILTER_FILL + "(" + colorCode + ")" ; |
public class ZipLoader { /** * Use this call to load a zip file using the
* { @ link ZipLoader } and apply the { @ link ZipEntryProcessor } to each entry . The result is a
* list of all processed entries obtained from the zip file .
* @ param gvrContext the GVRf context
* @ param zipFileName the name of the zip... | Context context = gvrContext . getContext ( ) ; InputStream inputStream = context . getAssets ( ) . open ( zipFileName ) ; ZipInputStream zipInputStream = new ZipInputStream ( inputStream ) ; List < T > result = new ArrayList < T > ( ) ; try { ZipEntry zipEntry ; while ( ( zipEntry = zipInputStream . getNextEntry ( ) )... |
public class KvStateLocation { /** * Registers a KvState instance for the given key group index .
* @ param keyGroupRange Key group range to unregister .
* @ throws IndexOutOfBoundsException If key group range start < 0 or key group range end > = Number of key groups
* @ throws IllegalArgumentException If no loca... | if ( keyGroupRange . getStartKeyGroup ( ) < 0 || keyGroupRange . getEndKeyGroup ( ) >= numKeyGroups ) { throw new IndexOutOfBoundsException ( "Key group index" ) ; } for ( int kgIdx = keyGroupRange . getStartKeyGroup ( ) ; kgIdx <= keyGroupRange . getEndKeyGroup ( ) ; ++ kgIdx ) { if ( kvStateIds [ kgIdx ] == null || k... |
public class AcceptReservedInstancesExchangeQuoteRequest { /** * The configuration of the target Convertible Reserved Instance to exchange for your current Convertible Reserved
* Instances .
* @ param targetConfigurations
* The configuration of the target Convertible Reserved Instance to exchange for your current... | if ( targetConfigurations == null ) { this . targetConfigurations = null ; return ; } this . targetConfigurations = new com . amazonaws . internal . SdkInternalList < TargetConfigurationRequest > ( targetConfigurations ) ; |
public class PolicyRestrictor { /** * { @ inheritDoc } */
public boolean isAttributeWriteAllowed ( ObjectName pName , String pAttribute ) { } } | return check ( RequestType . WRITE , pName , pAttribute ) ; |
public class ResponseCreationSupport { /** * Create a { @ link URI } from a { @ link URL } . This is similar to calling
* ` url . toURI ( ) ` with the { @ link URISyntaxException }
* converted to a { @ link IllegalArgumentException } .
* @ param url the url
* @ return the uri
* @ throws IllegalArgumentExcepti... | try { return url . toURI ( ) ; } catch ( URISyntaxException e ) { throw new IllegalArgumentException ( e ) ; } |
public class RocksUtils { /** * Generates a path to use for a RocksDB database .
* @ param baseDir the base directory path
* @ param dbName a name for the database
* @ return the generated database path */
public static String generateDbPath ( String baseDir , String dbName ) { } } | return PathUtils . concatPath ( baseDir , dbName ) ; |
public class RulesController { /** * Ensure scheme has a double slash . eg replaces " http : / blah " with " http : / / blah " */
private String fixupSchemeSlashes ( String surt ) { } } | if ( surt . indexOf ( ":/(" ) == surt . indexOf ( ":" ) ) { int i = surt . indexOf ( ":" ) ; surt = surt . substring ( 0 , i + 1 ) + "/" + surt . substring ( i + 1 ) ; } return surt ; |
public class FormatTables { /** * Retrieves a variants map for a given format name .
* @ param name
* The format name
* @ return a mutable map of variants */
public static Map < String , Format > get ( String name ) { } } | return instance ( ) . methods . get ( name ) ; |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getCTC ( ) { } } | if ( ctcEClass == null ) { ctcEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 231 ) ; } return ctcEClass ; |
public class HTTPAdminListener { /** * Load a template for the admin page , fill it out and return the value .
* @ param params The key - value set of variables to replace in the template .
* @ return The completed template . */
String getHTMLForAdminPage ( Map < String , String > params ) { } } | try { String template = m_htmlTemplates . get ( "admintemplate.html" ) ; for ( Entry < String , String > e : params . entrySet ( ) ) { String key = e . getKey ( ) . toUpperCase ( ) ; String value = e . getValue ( ) ; if ( key == null ) continue ; if ( value == null ) value = "NULL" ; template = template . replace ( "#"... |
public class SVBar { /** * Set the bar color . < br >
* < br >
* Its discouraged to use this method .
* @ param color */
public void setColor ( int color ) { } } | int x1 , y1 ; if ( mOrientation ) { x1 = ( mBarLength + mBarPointerHaloRadius ) ; y1 = mBarThickness ; } else { x1 = mBarThickness ; y1 = ( mBarLength + mBarPointerHaloRadius ) ; } Color . colorToHSV ( color , mHSVColor ) ; shader = new LinearGradient ( mBarPointerHaloRadius , 0 , x1 , y1 , new int [ ] { Color . WHITE ... |
public class AdminToolUtils { /** * Utility function that constructs AdminClient .
* @ param url URL pointing to the bootstrap node
* @ return Newly constructed AdminClient */
public static AdminClient getAdminClient ( String url ) { } } | ClientConfig config = new ClientConfig ( ) . setBootstrapUrls ( url ) . setConnectionTimeout ( 5 , TimeUnit . SECONDS ) ; AdminClientConfig adminConfig = new AdminClientConfig ( ) . setAdminSocketTimeoutSec ( 5 ) ; return new AdminClient ( adminConfig , config ) ; |
public class Jenkins { /** * Accepts submission from the node configuration page . */
@ RequirePOST public synchronized void doConfigExecutorsSubmit ( StaplerRequest req , StaplerResponse rsp ) throws IOException , ServletException , FormException { } } | checkPermission ( ADMINISTER ) ; BulkChange bc = new BulkChange ( this ) ; try { JSONObject json = req . getSubmittedForm ( ) ; ExtensionList . lookupSingleton ( MasterBuildConfiguration . class ) . configure ( req , json ) ; getNodeProperties ( ) . rebuild ( req , json . optJSONObject ( "nodeProperties" ) , NodeProper... |
public class Controller { /** * Returns the Controller with the given instance id or { @ code null } if no such Controller
* exists . May return the Controller itself or a matching descendant
* @ param instanceId The instance ID being searched for */
@ Nullable final Controller findController ( @ NonNull String ins... | if ( this . instanceId . equals ( instanceId ) ) { return this ; } for ( Router router : childRouters ) { Controller matchingChild = router . getControllerWithInstanceId ( instanceId ) ; if ( matchingChild != null ) { return matchingChild ; } } return null ; |
public class PortComponentType { /** * { @ inheritDoc } */
@ Override public QName getWSDLService ( ) { } } | if ( wsdl_service != null ) { return new QName ( wsdl_service . getNamespaceURI ( ) , wsdl_service . getLocalPart ( ) ) ; } else return null ; |
public class BlobStore { /** * Wrapper around readBlobTo which
* returns a ByteArray output stream .
* @ param key Key for the blob .
* the read privilege for the blob .
* @ return ByteArrayOutputStream
* @ throws IOException
* @ throws KeyNotFoundException */
public byte [ ] readBlob ( String key ) throws ... | ByteArrayOutputStream out = new ByteArrayOutputStream ( ) ; readBlobTo ( key , out ) ; byte [ ] bytes = out . toByteArray ( ) ; out . close ( ) ; return bytes ; |
public class MetricCollectorSupport { /** * Stops this collector immediately , dropping all pending metrics in memory . */
@ Override public boolean stop ( ) { } } | synchronized ( MetricCollectorSupport . class ) { if ( uploaderThread != null ) { uploaderThread . cancel ( ) ; uploaderThread . interrupt ( ) ; uploaderThread = null ; if ( singleton == this ) { // defensive check
singleton = null ; } return true ; } } return false ; |
public class XmlParser { /** * Parse File . */
public synchronized Node parse ( File file ) throws IOException , SAXException { } } | if ( log . isDebugEnabled ( ) ) log . debug ( "parse: " + file ) ; return parse ( new InputSource ( file . toURL ( ) . toString ( ) ) ) ; |
public class SortedArrayList { /** * Searches for the first occurrence of the given argument , testing
* for equality using the < tt > equals < / tt > method .
* @ param elem an object .
* @ return the index of the first occurrence of the argument in this
* list ; returns < tt > - 1 < / tt > if the object is no... | int elemHash = elem . hashCode ( ) ; // Find the location to insert the object at
int elemHashPos = binarySearchHashCode ( elemHash ) ; // Not found
if ( elemHashPos < 0 ) return - 1 ; // Try backwards until found or different hashCode
int pos = elemHashPos ; while ( pos >= 0 ) { E T = get ( pos ) ; if ( T . hashCode (... |
public class ConsumerDispatcher { /** * Checks to see if another update has occured to the ReceiveAllowedState .
* If it has it returns false to indicate that another run is required of the
* thread , otherwise it deletes this instance of the receiveAllowedThread by setting
* the reference to null */
private sync... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "deleteReceiveAllowedThread" ) ; if ( _receiveAllowedThread . isMarkedForUpdate ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "deleteReceiveAllowedThread" , Boolean . ... |
public class Pays { /** * JS支付 ( 公众号支付 )
* @ param request 支付请求对象
* @ return JsPayResponse对象 , 或抛WepayException */
public JsPayResponse jsPay ( JsPayRequest request ) { } } | checkJsPayParams ( request ) ; Map < String , Object > respData = doJsPay ( request , TradeType . JSAPI ) ; return buildJsPayResp ( respData ) ; |
public class SqlDocument { /** * Override for other languages */
protected boolean isQuoteDelimiter ( String character ) { } } | String quoteDelimiters = "\"'" ; if ( quoteDelimiters . indexOf ( character ) < 0 ) return false ; else return true ; |
public class RequestUtil { /** * Unrafels a cookie string containing a username and password .
* @ param value
* The cookie value .
* @ return String [ ] containing the username at index 0 and the password at
* index 1 , or < code > { null , null } < / code > if cookieVal equals
* < code > null < / code > or ... | // check that the cookie value isn ' t null or zero - length
if ( cookieVal == null || cookieVal . length ( ) <= 0 ) { return null ; } // unrafel the cookie value
char [ ] chars = cookieVal . toCharArray ( ) ; byte [ ] bytes = new byte [ chars . length / 2 ] ; int b ; for ( int n = 0 , m = 0 ; n < bytes . length ; n ++... |
public class CmsDefaultAuthorizationHandler { /** * Checks if the current request contains HTTP basic authentication information in
* the headers , if so the user is tried to log in with this data , and on success a
* session is generated . < p >
* @ param req the current HTTP request
* @ return the authenticat... | if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Checking for basic authorization." ) ; } try { CmsObject cms = OpenCms . initCmsObject ( OpenCms . getDefaultUsers ( ) . getUserGuest ( ) ) ; if ( OpenCms . getSystemInfo ( ) . getHttpAuthenticationSettings ( ) . getBrowserBasedAuthenticationMechanism ( ) == null ) { // ... |
public class ZonedDateTime { /** * Obtains an instance of { @ code ZonedDateTime } using seconds from the
* epoch of 1970-01-01T00:00:00Z .
* @ param epochSecond the number of seconds from the epoch of 1970-01-01T00:00:00Z
* @ param nanoOfSecond the nanosecond within the second , from 0 to 999,999,999
* @ param... | ZoneRules rules = zone . getRules ( ) ; Instant instant = Instant . ofEpochSecond ( epochSecond , nanoOfSecond ) ; // TODO : rules should be queryable by epochSeconds
ZoneOffset offset = rules . getOffset ( instant ) ; LocalDateTime ldt = LocalDateTime . ofEpochSecond ( epochSecond , nanoOfSecond , offset ) ; return ne... |
public class CompactionAuditCountVerifier { /** * Verify a specific dataset by following below steps
* 1 ) Retrieve a tier - to - count mapping
* 2 ) Read count from { @ link CompactionAuditCountVerifier # gobblinTier }
* 3 ) Read count from all other { @ link CompactionAuditCountVerifier # referenceTiers }
* 4... | if ( auditCountClient == null ) { log . debug ( "No audit count client specified, skipped" ) ; return new Result ( true , "" ) ; } CompactionPathParser . CompactionParserResult result = new CompactionPathParser ( this . state ) . parse ( dataset ) ; DateTime startTime = result . getTime ( ) ; DateTime endTime = startTi... |
public class Validate { /** * < p > Validate that the specified argument character sequence matches the specified regular
* expression pattern ; otherwise throwing an exception . < / p >
* < pre > Validate . matchesPattern ( " hi " , " [ a - z ] * " ) ; < / pre >
* < p > The syntax of the pattern is the one used ... | // TODO when breaking BC , consider returning input
if ( input == null || ! input . toString ( ) . matches ( pattern ) ) { throw new IllegalArgumentException ( StringUtils . simpleFormat ( DEFAULT_MATCHES_PATTERN_EX , input , pattern ) ) ; } |
public class AmazonElastiCacheClient { /** * Makes a copy of an existing snapshot .
* < note >
* This operation is valid for Redis only .
* < / note > < important >
* Users or groups that have permissions to use the < code > CopySnapshot < / code > operation can create their own Amazon
* S3 buckets and copy s... | request = beforeClientExecution ( request ) ; return executeCopySnapshot ( request ) ; |
public class ValueTaglet { /** * { @ inheritDoc } */
public Content getTagletOutput ( Element holder , DocTree tag , TagletWriter writer ) { } } | Utils utils = writer . configuration ( ) . utils ; Messages messages = writer . configuration ( ) . getMessages ( ) ; VariableElement field = getVariableElement ( holder , writer . configuration ( ) , tag ) ; if ( field == null ) { if ( tag . toString ( ) . isEmpty ( ) ) { // Invalid use of @ value
messages . warning (... |
public class ObjectStructuredFieldOffsetImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setSFOff ( Integer newSFOff ) { } } | Integer oldSFOff = sfOff ; sfOff = newSFOff ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . OBJECT_STRUCTURED_FIELD_OFFSET__SF_OFF , oldSFOff , sfOff ) ) ; |
public class ArrayTransitionModel { /** * Called by CompositeTransitionModel */
void dump ( int size , Appendable buffer ) throws IOException { } } | for ( int i = 0 ; i < size ; i ++ ) { ZonalTransition transition = this . transitions [ i ] ; TransitionModel . dump ( transition , buffer ) ; } |
public class JenkinsLogs { /** * Adds { @ link Jenkins # logRecords } ( from core ) into the support bundle .
* This is a small ring buffer that contains most recent log entries emitted from j . u . l logging .
* @ see WebAppMain # installLogger ( ) */
private void addMasterJulRingBuffer ( Container result ) { } } | result . add ( new LogRecordContent ( "nodes/master/logs/jenkins.log" ) { @ Override public Iterable < LogRecord > getLogRecords ( ) { return Lists . reverse ( new ArrayList < LogRecord > ( Jenkins . logRecords ) ) ; } } ) ; |
public class ThreadPoolController { /** * Evaluate current poolSize against farthest poolSize to decide whether it makes sense
* to shrink . The final outcome is probabilistic , not deterministic .
* @ param smallerPoolSize - smaller poolSize for comparison
* @ param largerPoolSize - larger poolSize for compariso... | boolean shouldShrink = false ; double poolRatio = largerPoolSize / smallerPoolSize ; double tputRatio = largerPoolTput / smallerPoolTput ; double poolTputRatio = poolRatio / tputRatio ; // compare the poolSize ratio and tput ratio between current and largest poolSizes
// if tput no better at larger poolSize , or not mu... |
public class AmazonECRClient { /** * Retrieves the results of the specified lifecycle policy preview request .
* @ param getLifecyclePolicyPreviewRequest
* @ return Result of the GetLifecyclePolicyPreview operation returned by the service .
* @ throws ServerException
* These errors are usually caused by a serve... | request = beforeClientExecution ( request ) ; return executeGetLifecyclePolicyPreview ( request ) ; |
public class ResilientActiveKeyValueStore { /** * @ param path
* @ param watcher
* @ return String
* @ throws InterruptedException
* @ throws KeeperException
* @ Description : 读数据
* @ author liaoqiqi
* @ date 2013-6-14 */
public String read ( String path , Watcher watcher , Stat stat ) throws InterruptedE... | byte [ ] data = zk . getData ( path , watcher , stat ) ; return new String ( data , CHARSET ) ; |
public class Where { /** * Add a EXISTS clause with a sub - query inside of parenthesis .
* < b > NOTE : < / b > The sub - query will be prepared at the same time that the outside query is . */
public Where < T , ID > exists ( QueryBuilder < ? , ? > subQueryBuilder ) { } } | // we do this to turn off the automatic addition of the ID column in the select column list
subQueryBuilder . enableInnerQuery ( ) ; addClause ( new Exists ( new InternalQueryBuilderWrapper ( subQueryBuilder ) ) ) ; return this ; |
public class CfgAlignmentModel { /** * Gets the { @ code beamSize } highest - scoring logical form derivations
* for { @ code example } according to this model . The returned list is
* approximate ( because it is produced by a beam search over CFG parses ) .
* @ param example
* @ param beamSize
* @ return */
... | CfgParser parser = getCfgParser ( example ) ; ExpressionTree tree = example . getTree ( ) ; Factor rootFactor = getRootFactor ( tree , parser . getParentVariable ( ) ) ; List < CfgParseTree > parseTrees = parser . beamSearch ( example . getWords ( ) , beamSize ) ; List < AlignedExpressionTree > expressionTrees = Lists ... |
public class MRCompactorJobPropCreator { /** * Check if inputFolder contains any files which have modification times which are more
* recent than the last compaction time as stored within outputFolder ; return any files
* which do . An empty list will be returned if all files are older than the last compaction time... | Set < Path > newFiles = Sets . newHashSet ( ) ; if ( ! this . fs . exists ( inputFolder ) || ! this . fs . exists ( outputFolder ) ) { return newFiles ; } DateTime lastCompactionTime = new DateTime ( MRCompactor . readCompactionTimestamp ( this . fs , outputFolder ) ) ; for ( FileStatus fstat : FileListUtils . listFile... |
public class Main { String expand ( String s ) { } } | int i1 = 0 ; int i2 = 0 ; while ( s != null ) { i1 = s . indexOf ( "$(" , i2 ) ; if ( i1 < 0 ) break ; i2 = s . indexOf ( ")" , i1 + 2 ) ; if ( i2 < 0 ) break ; String property = System . getProperty ( s . substring ( i1 + 2 , i2 ) , "" ) ; s = s . substring ( 0 , i1 ) + property + s . substring ( i2 + 1 ) ; } return s... |
public class FbBotMillMockMediator { /** * Forwards an envelope to the registered bots .
* @ param envelope
* the envelope to forward . */
public void forward ( MessageEnvelope envelope ) { } } | List < FbBot > bots = FbBotMillContext . getInstance ( ) . getRegisteredBots ( ) ; for ( FbBot b : bots ) { b . processMessage ( envelope ) ; } |
public class CsvBindingErrors { /** * フィールドエラーを登録します 。
* @ param field フィールドパス 。
* @ param errorCode エラーコード 。
* @ param messageVariables メッセージ中の変数 。
* @ param defaultMessage 指定したエラーコードに対するメッセージが見つからないときに使用するメッセージです 。 指定しない場合はnullを設定します 。 */
public void rejectValue ( final String field , final String e... | rejectValue ( field , null , errorCode , Collections . emptyMap ( ) , defaultMessage ) ; |
public class JobOperations { /** * Adds a job to the Batch account .
* @ param jobId The ID of the job to be added .
* @ param poolInfo Specifies how a job should be assigned to a pool .
* @ param additionalBehaviors A collection of { @ link BatchClientBehavior } instances that are applied to the Batch service re... | JobAddParameter param = new JobAddParameter ( ) . withId ( jobId ) . withPoolInfo ( poolInfo ) ; createJob ( param , additionalBehaviors ) ; |
public class User { /** * Called by tests in the JTH . Otherwise this shouldn ' t be called .
* Even in the tests this usage is questionable . */
@ Deprecated public static void clear ( ) { } } | if ( ExtensionList . lookup ( AllUsers . class ) . isEmpty ( ) ) { return ; } UserIdMapper . getInstance ( ) . clear ( ) ; AllUsers . clear ( ) ; |
public class FSAConfiguration { /** * returns data of proxy url from command line parameter proxy */
public static String [ ] parseProxy ( String proxy , List < String > errors ) { } } | String [ ] parsedProxyInfo = new String [ 4 ] ; if ( proxy != null ) { try { URL proxyAsUrl = new URL ( proxy ) ; parsedProxyInfo [ 0 ] = proxyAsUrl . getHost ( ) ; parsedProxyInfo [ 1 ] = String . valueOf ( proxyAsUrl . getPort ( ) ) ; if ( proxyAsUrl . getUserInfo ( ) != null ) { String [ ] parsedCred = proxyAsUrl . ... |
public class DescribeDeliveryChannelStatusRequest { /** * A list of delivery channel names .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setDeliveryChannelNames ( java . util . Collection ) } or { @ link # withDeliveryChannelNames ( java . util . Collecti... | if ( this . deliveryChannelNames == null ) { setDeliveryChannelNames ( new com . amazonaws . internal . SdkInternalList < String > ( deliveryChannelNames . length ) ) ; } for ( String ele : deliveryChannelNames ) { this . deliveryChannelNames . add ( ele ) ; } return this ; |
public class CommonUtils { /** * 字符串转布尔
* @ param bool 数字
* @ param defaultInt 默认值
* @ return int */
public static boolean parseBoolean ( String bool , boolean defaultInt ) { } } | if ( bool == null ) { return defaultInt ; } else { return Boolean . parseBoolean ( bool ) ; } |
public class BackendMarshaller { /** * Marshall the given parameter object . */
public void marshall ( Backend backend , ProtocolMarshaller protocolMarshaller ) { } } | if ( backend == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( backend . getVirtualService ( ) , VIRTUALSERVICE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( )... |
public class ArrayListIterate { /** * Mutates the internal array of the ArrayList by sorting it and then returns the same ArrayList . */
public static < T extends Comparable < ? super T > > ArrayList < T > sortThis ( ArrayList < T > list ) { } } | return ArrayListIterate . sortThis ( list , Comparators . naturalOrder ( ) ) ; |
public class LineItemSummary { /** * Gets the startDateTimeType value for this LineItemSummary .
* @ return startDateTimeType * Specifies whether to start serving to the { @ code LineItem }
* right away , in
* an hour , etc . This attribute is optional and defaults
* to
* { @ link StartDateTimeType # USE _ ST... | return startDateTimeType ; |
public class ExceptionSoftening { /** * reduces the end pc based on the optional LocalVariableTable ' s exception
* register scope
* @ param infos the list of active catch blocks
* @ param pc the current pc
* @ param seen the currently parsed opcode */
private void updateEndPCsOnCatchRegScope ( List < CatchInfo... | if ( lvt != null ) { for ( CatchInfo ci : infos ) { if ( ( ci . getStart ( ) == pc ) && OpcodeUtils . isAStore ( seen ) ) { int exReg = RegisterUtils . getAStoreReg ( this , seen ) ; LocalVariable lv = lvt . getLocalVariable ( exReg , pc + 1 ) ; if ( lv != null ) { ci . setFinish ( lv . getStartPC ( ) + lv . getLength ... |
public class CmsXmlContentDefinition { /** * Factory method that returns the XML content definition instance for a given resource . < p >
* @ param cms the cms - object
* @ param resource the resource
* @ return the XML content definition
* @ throws CmsException if something goes wrong */
public static CmsXmlCo... | CmsXmlContentDefinition contentDef = null ; I_CmsResourceType resType = OpenCms . getResourceManager ( ) . getResourceType ( resource . getTypeId ( ) ) ; String schema = resType . getConfiguration ( ) . get ( CmsResourceTypeXmlContent . CONFIGURATION_SCHEMA ) ; if ( schema != null ) { try { // this wont in most cases r... |
public class ProjectImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) @ Override public EList < NewService > getNewServices ( ) { } } | return ( EList < NewService > ) eGet ( StorePackage . Literals . PROJECT__NEW_SERVICES , true ) ; |
public class Scene { /** * Moves the layer one level down in this scene .
* @ param layer */
@ Override public final Scene moveDown ( final Layer layer ) { } } | if ( ( null != layer ) && ( LienzoCore . IS_CANVAS_SUPPORTED ) ) { final int size = getElement ( ) . getChildCount ( ) ; if ( size < 2 ) { return this ; } final DivElement element = layer . getElement ( ) ; for ( int i = 0 ; i < size ; i ++ ) { final DivElement look = getElement ( ) . getChild ( i ) . cast ( ) ; if ( l... |
public class AssociateGreedy { /** * Associates the two sets objects against each other by minimizing fit score .
* @ param src Source list .
* @ param dst Destination list . */
@ Override public void associate ( FastQueue < D > src , FastQueue < D > dst ) { } } | fitQuality . reset ( ) ; pairs . reset ( ) ; workBuffer . reset ( ) ; pairs . resize ( src . size ) ; fitQuality . resize ( src . size ) ; workBuffer . resize ( src . size * dst . size ) ; // CONCURRENT _ BELOW BoofConcurrency . loopFor ( 0 , src . size , i - > {
for ( int i = 0 ; i < src . size ; i ++ ) { D a = src . ... |
public class LCAGraphManager { private void initParams ( ) { } } | nbActives = graph . getNodes ( ) . size ( ) ; for ( int i = 0 ; i < nbNodes ; i ++ ) { successors [ i ] = graph . getSuccOf ( i ) ; dfsNumberOfNode [ i ] = - 1 ; father [ i ] = - 1 ; A [ i ] = - 1 ; } |
public class UniqueCountMap { /** * Returns total bytes used for key storage
* @ return total bytes used for key storage */
public long getKeyMemoryUsageBytes ( ) { } } | long total = 0 ; for ( int i = 0 ; i < maps_ . length ; i ++ ) { if ( maps_ [ i ] != null ) { total += ( long ) ( maps_ [ i ] . getActiveEntries ( ) ) * keySizeBytes_ ; } } return total ; |
public class Streams { /** * Generic zip function . E . g . Zipping a Stream and a Sequence
* < pre >
* { @ code
* Stream < List < Integer > > zipped = Streams . zip ( Stream . of ( 1,2,3)
* , ReactiveSeq . of ( 2,3,4 ) ,
* ( a , b ) - > Arrays . asList ( a , b ) ) ;
* List < Integer > zip = zipped . collec... | final Iterator < T > left = stream . iterator ( ) ; final Iterator < ? extends S > right = second . iterator ( ) ; return Streams . stream ( new Iterator < R > ( ) { @ Override public boolean hasNext ( ) { return left . hasNext ( ) && right . hasNext ( ) ; } @ Override public R next ( ) { return zipper . apply ( left .... |
public class UIComponentClassicTagBase { /** * < p > Pop the top { @ link UIComponentTag } instance off of our component tag
* stack , deleting the stack if this was the last entry . < / p > */
private void popUIComponentClassicTagBase ( ) { } } | List list = ( List ) context . getAttributes ( ) . get ( COMPONENT_TAG_STACK_ATTR ) ; // if an exception occurred in a nested tag ,
// there could be a few tags left in the stack .
UIComponentClassicTagBase uic = null ; while ( list != null && uic != this ) { int idx = list . size ( ) - 1 ; uic = ( UIComponentClassicTa... |
public class Normalizer { /** * Normalize a string .
* The string will be normalized according to the specified normalization
* mode and options .
* @ param source The char array to normalize .
* @ param target A char buffer to receive the normalized text .
* @ param mode The normalization mode ; one of Norma... | return normalize ( source , 0 , source . length , target , 0 , target . length , mode , options ) ; |
public class MergeRequestApi { /** * Creates a merge request and optionally assigns a reviewer to it .
* < pre > < code > GitLab Endpoint : POST / projects / : id / merge _ requests < / code > < / pre >
* @ param projectIdOrPath the project in the form of an Integer ( ID ) , String ( path ) , or Project instance
... | return createMergeRequest ( projectIdOrPath , sourceBranch , targetBranch , title , description , assigneeId , null , null , null , null ) ; |
public class TomlWriter { /** * Write an Object in TOML to a { @ link File } . Output is encoded as UTF - 8.
* @ param from the object to be written
* @ param target the File to which the TOML will be written
* @ throws IOException if any file operations fail */
public void write ( Object from , File target ) thr... | OutputStream outputStream = new FileOutputStream ( target ) ; try { write ( from , outputStream ) ; } finally { outputStream . close ( ) ; } |
public class EJBMethodInfoImpl { /** * Return method name for this method . < p > */
@ Override public String getMethodName ( ) { } } | // Generally , the method name is pretty static , but for internal
// CMR methods ( with index < 0 ) they are dynamic , and based on
// the signature . For performance , the substring operation is
// deferred until the method name is actually used . d154342.10
if ( methodName == null && methodSignature != null ) method... |
public class AbstractMethodTypeListener { /** * Allows traverse the input type hierarchy .
* @ param type encountered by Guice .
* @ param encounter the injection context . */
private < I > void hear ( Class < ? super I > type , TypeEncounter < I > encounter ) { } } | if ( type == null || type . getPackage ( ) . getName ( ) . startsWith ( JAVA_PACKAGE ) ) { return ; } for ( Method method : type . getDeclaredMethods ( ) ) { if ( method . isAnnotationPresent ( annotationType ) ) { if ( method . getParameterTypes ( ) . length != 0 ) { encounter . addError ( "Annotated methods with @%s ... |
public class OQL { /** * FROM
* FROM foo . bar . Type Type */
private void _buildFrom ( final String alias , final StringBuilder stmt ) { } } | stmt . append ( _FROM_ ) . append ( getType ( ) . getName ( ) ) ; stmt . append ( _SPACE_ ) . append ( alias ) ; |
public class ObjectMappedQuery { /** * Executes the query and returns the results as a list of objects . */
public List < T > getResults ( Connection conn , DataObject object ) throws Exception { } } | return executeSelect ( conn , object , new ResultSetMapper < ArrayListCollector < T > > ( new ArrayListCollector < T > ( ) ) ) ; |
public class Signatures { /** * Selects the best method for the given argument types .
* @ param methods
* @ param argTypes
* @ return method
* @ throws AmbiguousSignatureMatchException if multiple methods match equally */
public static Method bestMethod ( Method [ ] methods , Class < ? > [ ] argTypes ) throws ... | try { return best ( methods , collectSignatures ( methods ) , collectVarArgs ( methods ) , argTypes ) ; } catch ( AmbiguousSignatureMatchException e ) { throw new AmbiguousMethodMatchException ( e , methods ) ; } |
public class LocaleSelectorImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eSet ( int featureID , Object newValue ) { } } | switch ( featureID ) { case AfplibPackage . LOCALE_SELECTOR__LOC_FLGS : setLocFlgs ( ( Integer ) newValue ) ; return ; case AfplibPackage . LOCALE_SELECTOR__LANG_CODE : setLangCode ( ( String ) newValue ) ; return ; case AfplibPackage . LOCALE_SELECTOR__SCRPT_CDE : setScrptCde ( ( String ) newValue ) ; return ; case Af... |
public class AWSOrganizationsClient { /** * Lists all of the organizational units ( OUs ) or accounts that are contained in the specified parent OU or root .
* This operation , along with < a > ListParents < / a > enables you to traverse the tree structure that makes up this root .
* < note >
* Always check the <... | request = beforeClientExecution ( request ) ; return executeListChildren ( request ) ; |
public class JSONUtil { /** * 读取JSON
* @ param file JSON文件
* @ param charset 编码
* @ return JSON ( 包括JSONObject和JSONArray )
* @ throws IORuntimeException IO异常 */
public static JSON readJSON ( File file , Charset charset ) throws IORuntimeException { } } | return parse ( FileReader . create ( file , charset ) . readString ( ) ) ; |
public class StringTransformerChain { /** * This method implements { @ link # transform ( String ) } recursively .
* @ param original is the original value .
* @ param state is the { @ link State } used to indicate if a { @ link StringTransformerRule rule } causes the chain to
* { @ link State # stop } .
* @ re... | String value = original ; if ( this . parent != null ) { value = this . parent . transformRecursive ( original , state ) ; if ( state . stop ) { return value ; } } for ( StringTransformerRule rule : this . rules ) { String transformed = rule . transform ( value ) ; if ( ( transformed != value ) && ( rule . isStopOnMatc... |
public class PatternsImpl { /** * Deletes the patterns with the specified IDs .
* @ param appId The application ID .
* @ param versionId The version ID .
* @ param patternIds The patterns IDs .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the Operat... | return deletePatternsWithServiceResponseAsync ( appId , versionId , patternIds ) . map ( new Func1 < ServiceResponse < OperationStatus > , OperationStatus > ( ) { @ Override public OperationStatus call ( ServiceResponse < OperationStatus > response ) { return response . body ( ) ; } } ) ; |
public class FieldErrorBuilder { /** * セルのアドレス情報を設定します 。
* < p > 値が存在する場合のみ設定されます 。 < / p >
* @ param address アドレス情報
* @ return 自身のインスタンス */
public FieldErrorBuilder address ( final Optional < CellPosition > address ) { } } | address . ifPresent ( a -> address ( a ) ) ; return this ; |
public class JDBCBlobClient { /** * Writes the given array of bytes to the < code > BLOB < / code > value that
* this < code > Blob < / code > object represents , starting at position
* < code > pos < / code > , and returns the number of bytes written .
* @ param pos the position in the < code > BLOB < / code > o... | if ( ! isInLimits ( Long . MAX_VALUE , pos - 1 , bytes . length ) ) { throw Util . outOfRangeArgument ( ) ; } try { return blob . setBytes ( session , pos - 1 , bytes ) ; } catch ( HsqlException e ) { throw Util . sqlException ( e ) ; } |
public class ParamGraphCanvas { /** * Sets the scatter graph .
* @ param measures
* information about the curves
* @ param measureStds
* standard deviation for the measures
* @ param variedParamValues
* values of the varied parameter
* @ param colors
* color encoding for the param array */
public void s... | this . measures = measures ; this . variedParamValues = variedParamValues ; ( ( GraphScatter ) this . plotPanel ) . setGraph ( measures , measureStds , variedParamValues , colors ) ; updateCanvas ( false ) ; |
public class VerticalViewPager { /** * Set a { @ link ViewPager . PageTransformer } that will be called for each attached page whenever
* the scroll position is changed . This allows the application to apply custom property
* transformations to each page , overriding the default sliding look and feel .
* < p > < ... | if ( Build . VERSION . SDK_INT >= 11 ) { final boolean hasTransformer = transformer != null ; final boolean needsPopulate = hasTransformer != ( mPageTransformer != null ) ; mPageTransformer = transformer ; setChildrenDrawingOrderEnabledCompat ( hasTransformer ) ; if ( hasTransformer ) { mDrawingOrder = reverseDrawingOr... |
public class AccessScreen { /** * Add button ( s ) to the toolbar . */
public void addToolbarButtons ( ToolScreen toolScreen ) { } } | new SCannedBox ( toolScreen . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . SET_ANCHOR ) , toolScreen , null , ScreenConstants . DEFAULT_DISPLAY , null , "Delete All" , MenuConstants . DELETE , "Delete All" , null ) ; |
public class SingleAdditionNeighbourhood { /** * Generates a list of all possible addition moves that add a single ID to the selection of a given
* subset solution . Possible fixed IDs are not considered to be added and the maximum subset size
* is taken into account . May return an empty list if no addition moves ... | // check size limit
if ( maxSizeReached ( solution ) ) { return Collections . emptyList ( ) ; } // get set of candidate IDs for addition ( possibly fixed IDs are discarded )
Set < Integer > addCandidates = getAddCandidates ( solution ) ; // check if there are any candidates to be added
if ( addCandidates . isEmpty ( ) ... |
public class CsvEscapeUtil { /** * Perform an escape operation , based on a Reader , writing the results to a Writer .
* Note this reader is going to be read char - by - char , so some kind of buffering might be appropriate if this
* is an inconvenience for the specific Reader implementation . */
static void escape... | if ( reader == null ) { return ; } /* * Escape in CSV requires using buffers because CSV escaped text might be surrounded by quotes or not
* depending on whether they contain any non - alphanumeric chars or not , which is something we cannot
* know until we find any . */
int doQuote = - 1 ; int bufferSize = 0 ; cha... |
public class ZipUtil { /** * Returns the unzipped contents of the zipped input stream in a byte array
* @ param in
* the input stream to unzip
* @ return the unzipped content in a byte array
* @ throws IOException */
static public byte [ ] unzip ( InputStream in ) throws IOException { } } | ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; CopyUtil . copy ( new GZIPInputStream ( in ) , bos ) ; return bos . toByteArray ( ) ; |
public class UndoHelper { /** * convenience method to be used if you have previously set a { @ link Snackbar } with { @ link # withSnackBar ( Snackbar , String ) }
* @ param positions the positions where the items were removed
* @ return the snackbar or null if { @ link # withSnackBar ( Snackbar , String ) } was no... | if ( mSnackBar == null ) { return null ; } View snackbarView = mSnackBar . getView ( ) ; TextView snackbarText = ( TextView ) snackbarView . findViewById ( com . google . android . material . R . id . snackbar_text ) ; return remove ( snackbarView , snackbarText . getText ( ) . toString ( ) , mSnackbarActionText , mSna... |
public class IfcComplexNumberImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) @ Override public EList < Double > getWrappedValue ( ) { } } | return ( EList < Double > ) eGet ( Ifc4Package . Literals . IFC_COMPLEX_NUMBER__WRAPPED_VALUE , true ) ; |
public class ParallelMapIterate { /** * A parallel form of forEachKeyValue .
* @ see MapIterate # forEachKeyValue ( Map , Procedure2)
* @ see ParallelIterate */
public static < K , V > void forEachKeyValue ( Map < K , V > map , Procedure2 < ? super K , ? super V > procedure , Executor executor ) { } } | ParallelMapIterate . forEachKeyValue ( map , procedure , 2 , map . size ( ) , executor ) ; |
public class NestedSerializersSnapshotDelegate { /** * Writes the composite snapshot of all the contained serializers . */
public final void writeNestedSerializerSnapshots ( DataOutputView out ) throws IOException { } } | out . writeInt ( MAGIC_NUMBER ) ; out . writeInt ( VERSION ) ; out . writeInt ( nestedSnapshots . length ) ; for ( TypeSerializerSnapshot < ? > snap : nestedSnapshots ) { TypeSerializerSnapshot . writeVersionedSnapshot ( out , snap ) ; } |
public class Pattern { /** * Creates a mapped constraint with the given generative constraint and the indexes it applies .
* Also labels the last given index .
* @ param constr constraint to add
* @ param label a label for the last of the given indices */
public void add ( Constraint constr , String ... label ) {... | checkLabels ( constr . canGenerate ( ) , label ) ; int [ ] ind = convertLabelsToInds ( label ) ; if ( ind . length != constr . getVariableSize ( ) ) { throw new IllegalArgumentException ( "Mapped elements do not match the constraint size." ) ; } // This will also increment lastIndex if necessary
add ( constr , ind ) ; ... |
public class ViewSet { /** * Gets the set of all views ( except filtered views ) .
* @ return a Collection of View objects */
@ JsonIgnore public Collection < View > getViews ( ) { } } | HashSet < View > views = new HashSet < > ( ) ; views . addAll ( getSystemLandscapeViews ( ) ) ; views . addAll ( getSystemContextViews ( ) ) ; views . addAll ( getContainerViews ( ) ) ; views . addAll ( getComponentViews ( ) ) ; views . addAll ( getDynamicViews ( ) ) ; views . addAll ( getDeploymentViews ( ) ) ; return... |
public class HostDirectives { /** * Change the user agent string used to crawl after initialization . This will
* reorder ( recreate ) the list of user agent directives for this host .
* @ param userAgent The new user agent to use . */
public void setUserAgent ( String userAgent ) { } } | this . userAgent = userAgent . toLowerCase ( ) ; // Re - order the set
Set < UserAgentDirectives > replace = new TreeSet < UserAgentDirectives > ( new UserAgentDirectives . UserAgentComparator ( this . userAgent ) ) ; replace . addAll ( rules ) ; rules = replace ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.