signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class LruCache { /** * Returns the value for { @ code key } if it exists in the cache or can be
* created by { @ code # create } . If a value was returned , it is moved to the
* head of the queue . This returns null if a value is not cached and cannot
* be created . */
public final V get ( K key ) { } } | if ( key == null ) { throw new NullPointerException ( "key == null" ) ; } V mapValue ; synchronized ( this ) { mapValue = map . get ( key ) ; if ( mapValue != null ) { hitCount ++ ; return mapValue ; } missCount ++ ; } /* * Attempt to create a value . This may take a long time , and the map
* may be different when cr... |
public class MonetaryFormats { /** * Checks if a { @ link MonetaryAmountFormat } is available for the given { @ link javax . money . format . AmountFormatQuery } .
* @ param formatQuery the required { @ link AmountFormatQuery } , not { @ code null } . If the query does not define
* any explicit provider chain , the... | return Optional . ofNullable ( getMonetaryFormatsSpi ( ) ) . orElseThrow ( ( ) -> new MonetaryException ( "No MonetaryFormatsSingletonSpi " + "loaded, query functionality is not available." ) ) . isAvailable ( formatQuery ) ; |
public class DependencyTable { /** * Determines if the specified target needs to be rebuilt .
* This task may result in substantial IO as files are parsed to determine
* their dependencies */
public boolean needsRebuild ( final CCTask task , final TargetInfo target , final int dependencyDepth ) { } } | // look at any files where the compositeLastModified
// is not known , but the includes are known
boolean mustRebuild = false ; final CompilerConfiguration compiler = ( CompilerConfiguration ) target . getConfiguration ( ) ; final String includePathIdentifier = compiler . getIncludePathIdentifier ( ) ; final File [ ] s... |
public class RunbookDraftsInner { /** * Replaces the runbook draft content .
* @ param resourceGroupName Name of an Azure Resource group .
* @ param automationAccountName The name of the automation account .
* @ param runbookName The runbook name .
* @ param runbookContent The runbook draft content .
* @ thro... | return replaceContentWithServiceResponseAsync ( resourceGroupName , automationAccountName , runbookName , runbookContent ) . map ( new Func1 < ServiceResponseWithHeaders < String , RunbookDraftReplaceContentHeaders > , String > ( ) { @ Override public String call ( ServiceResponseWithHeaders < String , RunbookDraftRepl... |
public class ClassReader { /** * Reads a numeric or string constant pool item in { @ link # b b } . < i > This
* method is intended for { @ link Attribute } sub classes , and is normally not
* needed by class generators or adapters . < / i >
* @ param item the index of a constant pool item .
* @ param buf buffe... | int index = items [ item ] ; switch ( b [ index - 1 ] ) { case ClassWriter . INT : return new Integer ( readInt ( index ) ) ; case ClassWriter . FLOAT : return new Float ( Float . intBitsToFloat ( readInt ( index ) ) ) ; case ClassWriter . LONG : return new Long ( readLong ( index ) ) ; case ClassWriter . DOUBLE : retu... |
public class SparkDataHandler { /** * Load data and populate results .
* @ param dataFrame
* the data frame
* @ param m
* the m
* @ param kunderaQuery
* the kundera query
* @ return the list */
public List < ? > loadDataAndPopulateResults ( DataFrame dataFrame , EntityMetadata m , KunderaQuery kunderaQuer... | if ( kunderaQuery != null && kunderaQuery . isAggregated ( ) ) { return dataFrame . collectAsList ( ) ; } // TODO : handle the case of specific field selection
else { return populateEntityObjectsList ( dataFrame , m ) ; } |
public class Autoencoder { /** * Initializes the Autoencoder classifier on the argument trainingPoints .
* @ param trainingPoints the Collection of instances on which to initialize the Autoencoder classifier . */
@ Override public void initialize ( Collection < Instance > trainingPoints ) { } } | Iterator < Instance > trgPtsIterator = trainingPoints . iterator ( ) ; if ( trgPtsIterator . hasNext ( ) && this . reset ) { Instance inst = ( Instance ) trgPtsIterator . next ( ) ; this . numAttributes = inst . numAttributes ( ) - 1 ; this . initializeNetwork ( ) ; } while ( trgPtsIterator . hasNext ( ) ) { this . tra... |
public class DescribeCommand { /** * < pre > - - dirty [ = mark ] < / pre >
* Describe the working tree . It means describe HEAD and appends mark ( < pre > - dirty < / pre > by default ) if the
* working tree is dirty .
* @ param dirtyMarker the marker name to be appended to the describe output when the workspace... | Optional < String > option = Optional . ofNullable ( dirtyMarker ) ; log . info ( "--dirty = {}" , option . orElse ( "" ) ) ; this . dirtyOption = option ; return this ; |
public class AbstractChannelFactory { /** * Configures the security options that should be used by the channel .
* @ param builder The channel builder to configure .
* @ param name The name of the client to configure . */
protected void configureSecurity ( final T builder , final String name ) { } } | final GrpcChannelProperties properties = getPropertiesFor ( name ) ; final Security security = properties . getSecurity ( ) ; if ( properties . getNegotiationType ( ) != NegotiationType . TLS // non - default
|| isNonNullAndNonBlank ( security . getAuthorityOverride ( ) ) || isNonNullAndNonBlank ( security . getCertifi... |
public class TrmMessageFactoryImpl { /** * Create a new , empty TrmMeBridgeBootstrapReply message
* @ return The new TrmMeBridgeBootstrapReply .
* @ exception MessageCreateFailedException Thrown if such a message can not be created */
public TrmMeBridgeBootstrapReply createNewTrmMeBridgeBootstrapReply ( ) throws Me... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createNewTrmMeBridgeBootstrapReply" ) ; TrmMeBridgeBootstrapReply msg = null ; try { msg = new TrmMeBridgeBootstrapReplyImpl ( ) ; } catch ( MessageDecodeFailedException e ) { /* No need to FFDC this as JsMsgObject will alr... |
public class IO { /** * Static factory method for creating an { @ link IO } from an externally managed source of
* { @ link CompletableFuture completable futures } .
* Note that constructing an { @ link IO } this way results in no intermediate futures being constructed by either
* { @ link IO # unsafePerformAsync... | return new IO < A > ( ) { @ Override public A unsafePerformIO ( ) { return checked ( ( ) -> unsafePerformAsyncIO ( ) . get ( ) ) . get ( ) ; } @ Override public CompletableFuture < A > unsafePerformAsyncIO ( Executor executor ) { return supplier . get ( ) ; } } ; |
public class ReUtil { /** * 获得匹配的字符串 , 对应分组0表示整个匹配内容 , 1表示第一个括号分组内容 , 依次类推
* @ param pattern 编译后的正则模式
* @ param content 被匹配的内容
* @ param groupIndex 匹配正则的分组序号 , 0表示整个匹配内容 , 1表示第一个括号分组内容 , 依次类推
* @ return 匹配后得到的字符串 , 未匹配返回null */
public static String get ( Pattern pattern , CharSequence content , int groupIndex )... | if ( null == content || null == pattern ) { return null ; } final Matcher matcher = pattern . matcher ( content ) ; if ( matcher . find ( ) ) { return matcher . group ( groupIndex ) ; } return null ; |
public class DataUtil { /** * big - endian or motorola format . */
public static void writeUnsignedShortBigEndian ( byte [ ] buffer , int offset , int value ) { } } | buffer [ offset ++ ] = ( byte ) ( ( value >> 8 ) & 0xFF ) ; buffer [ offset ] = ( byte ) ( value & 0xFF ) ; |
public class XYChartLabelFormatter { /** * Formats the label Text shapes in the given axis by cutting text value . */
private void cut ( XYChartLabel label , double maxWidth , double maxHeight , double rotation ) { } } | String text = label . getLabel ( ) . getText ( ) ; // Cut text .
cutLabelText ( label , maxWidth - 5 , maxHeight - 5 , rotation ) ; String cutText = label . getLabel ( ) . getText ( ) ; // If text is cut , add suffix characters .
if ( text . length ( ) != cutText . length ( ) ) { label . getLabel ( ) . setText ( label ... |
public class StopCriterionChecker { /** * Start checking the stop criteria , in a separate background thread . If the stop criterion checker is
* already active , or if no stop criteria have been added , calling this method does not have any effect . */
public void startChecking ( ) { } } | // synchronize with other attempts to update the running task
synchronized ( runningTaskLock ) { // check if not already active
if ( runningTask == null ) { // only activate if at least one stop criterion has been set
if ( ! stopCriteria . isEmpty ( ) ) { // schedule periodical check
runningTask = new StopCriterionChec... |
public class StringSearch { /** * TODO : We probably do not need Pattern CE table . */
private int initializePatternCETable ( ) { } } | int [ ] cetable = new int [ INITIAL_ARRAY_SIZE_ ] ; int cetablesize = cetable . length ; int patternlength = pattern_ . text_ . length ( ) ; CollationElementIterator coleiter = utilIter_ ; if ( coleiter == null ) { coleiter = new CollationElementIterator ( pattern_ . text_ , collator_ ) ; utilIter_ = coleiter ; } else ... |
public class TagsBenchmarksUtil { /** * Adds ' numTags ' tags to ' tagsBuilder ' and returns the associated tag context . */
@ VisibleForTesting public static TagContext createTagContext ( TagContextBuilder tagsBuilder , int numTags ) { } } | for ( int i = 0 ; i < numTags ; i ++ ) { tagsBuilder . put ( TAG_KEYS . get ( i ) , TAG_VALUES . get ( i ) , UNLIMITED_PROPAGATION ) ; } return tagsBuilder . build ( ) ; |
public class StatViewFeature { /** * 读取配置参数 .
* @ param key 配置参数名
* @ return 配置参数值 , 如果不存在当前配置参数 , 或者为配置参数长度为0 , 将返回null */
private static String readInitParam ( Configuration configuration , String key ) { } } | String value = null ; try { String param = ( String ) configuration . getProperty ( key ) ; if ( param != null ) { param = param . trim ( ) ; if ( param . length ( ) > 0 ) { value = param ; } } } catch ( Exception e ) { String msg = "initParameter config [" + key + "] error" ; logger . warn ( msg , e ) ; } return value... |
public class StartAndStopSQL { /** * Check if the database is in a specific condition by checking the result of a SQL statement loaded as a resource .
* @ param resource the resource containing the SQL statement that would return a number
* @ return true if the returned number is greater than 0 */
protected boolean... | Resource sqlResource = context . getResource ( resource ) ; InputStream in = null ; String sql = null ; try { in = sqlResource . getInputStream ( ) ; sql = IOUtils . toString ( in ) ; } catch ( IOException ioe ) { throw new RuntimeException ( "Failed to get condition SQL (" + ioe . getMessage ( ) + ") from: " + resourc... |
public class EventDispatcher { protected int subscribe_data_ready_event ( String attr_name , String [ ] filters , boolean stateless ) throws DevFailed { } } | return event_supplier . subscribe_event ( attr_name , DATA_READY_EVENT , this , filters , stateless ) ; |
public class JMapperCache { /** * Returns an instance of JMapper from cache if exists , in alternative a new instance .
* < br > Taking as input the path to the xml file or the content .
* @ param destination the Destination Class
* @ param source the Source Class
* @ param xml xml configuration as content or p... | return getMapper ( destination , source , null , xml ) ; |
public class DocTreeScanner { /** * { @ inheritDoc } This implementation scans the children in left to right order .
* @ param node { @ inheritDoc }
* @ param p { @ inheritDoc }
* @ return the result of scanning */
@ Override public R visitUnknownBlockTag ( UnknownBlockTagTree node , P p ) { } } | return scan ( node . getContent ( ) , p ) ; |
public class PropertiesStringField { /** * DoGetData Method . */
public Object doGetData ( ) { } } | String data = ( String ) super . doGetData ( ) ; FileListener listener = this . getRecord ( ) . getListener ( PropertiesStringFileListener . class ) ; if ( this . getComponent ( 0 ) == null ) // Don ' t convert if this is linked to a screen
if ( enableConversion ) if ( listener != null ) if ( listener . isEnabled ( ) )... |
public class VircurexMarketDataServiceRaw { /** * get _ lowest _ ask APIs : https : / / vircurex . com / welcome / api ? locale = en */
public VircurexLastTrade getVircurexTicker ( CurrencyPair currencyPair ) throws IOException { } } | VircurexLastTrade vircurexLastTrade = vircurexAuthenticated . getLastTrade ( currencyPair . base . getCurrencyCode ( ) . toLowerCase ( ) , currencyPair . counter . getCurrencyCode ( ) . toLowerCase ( ) ) ; return vircurexLastTrade ; |
public class LittleEndianDataInputStream { /** * Reads a string of no more than 65,535 characters
* from the underlying input stream using UTF - 8
* encoding . This method first reads a two byte short
* in < b > big < / b > endian order as required by the
* UTF - 8 specification . This gives the number of bytes... | int byte1 = in . read ( ) ; int byte2 = in . read ( ) ; if ( byte2 < 0 ) { throw new EOFException ( ) ; } int numbytes = ( byte1 << 8 ) + byte2 ; char result [ ] = new char [ numbytes ] ; int numread = 0 ; int numchars = 0 ; while ( numread < numbytes ) { int c1 = readUnsignedByte ( ) ; int c2 , c3 ; // The first four ... |
public class WAB { /** * state should only transition while the terminated lock is held .
* @ param newState
* @ return */
private boolean setState ( State newState ) { } } | switch ( newState ) { case DEPLOYED : return changeState ( State . DEPLOYING , State . DEPLOYED ) ; case DEPLOYING : // can move from either UNDEPLOYED or FAILED into DEPLOYING state
return ( changeState ( State . UNDEPLOYED , State . DEPLOYING ) || changeState ( State . FAILED , State . DEPLOYING ) ) ; case UNDEPLOYIN... |
public class CmsUserEditDialog { /** * Sets up the validators . < p > */
protected void setupValidators ( ) { } } | if ( m_loginname . getValidators ( ) . size ( ) == 0 ) { m_loginname . addValidator ( new LoginNameValidator ( ) ) ; m_pw . getPassword1Field ( ) . addValidator ( new PasswordValidator ( ) ) ; m_site . addValidator ( new StartSiteValidator ( ) ) ; m_startview . addValidator ( new StartViewValidator ( ) ) ; m_startfolde... |
public class Projections { /** * Create an appending factory expression which serializes all the arguments but the uses
* the base value as the return value
* @ param base first argument
* @ param rest additional arguments
* @ param < T > type of projection
* @ return factory expression */
public static < T >... | return new AppendingFactoryExpression < T > ( base , rest ) ; |
public class LocalePreference { /** * A safe , cross - platform way of converting serialized locale string to { @ link Locale } instance . Matches
* { @ link # toString ( Locale ) } serialization implementation .
* @ param locale locale converted to string .
* @ return { @ link Locale } stored the deserialized da... | final String [ ] data = Strings . split ( locale , '_' ) ; if ( data . length == 1 ) { return new Locale ( data [ 0 ] ) ; } else if ( data . length == 2 ) { return new Locale ( data [ 0 ] , data [ 1 ] ) ; } else if ( data . length == 3 ) { return new Locale ( data [ 0 ] , data [ 1 ] , data [ 2 ] ) ; } throw new Illegal... |
public class ProcessContext { /** * Checks if the given activity is executable , i . e . there is at least
* one subject which is authorized to execute it . < br >
* This method delegates the call to the access control model .
* @ param activity The activity in question .
* @ return < code > true < / code > if ... | validateActivity ( activity ) ; return acModel != null && acModel . isExecutable ( activity ) ; |
public class ByteToMessageDecoder { /** * Called when the input of the channel was closed which may be because it changed to inactive or because of
* { @ link ChannelInputShutdownEvent } . */
void channelInputClosed ( ChannelHandlerContext ctx , List < Object > out ) throws Exception { } } | if ( cumulation != null ) { callDecode ( ctx , cumulation , out ) ; decodeLast ( ctx , cumulation , out ) ; } else { decodeLast ( ctx , Unpooled . EMPTY_BUFFER , out ) ; } |
public class BigtableVeneerSettingsFactory { /** * To build BigtableDataSettings # sampleRowKeysSettings with default Retry settings . */
private static void buildSampleRowKeysSettings ( Builder builder , BigtableOptions options ) { } } | RetrySettings retrySettings = buildIdempotentRetrySettings ( builder . sampleRowKeysSettings ( ) . getRetrySettings ( ) , options ) ; builder . sampleRowKeysSettings ( ) . setRetrySettings ( retrySettings ) . setRetryableCodes ( buildRetryCodes ( options . getRetryOptions ( ) ) ) ; |
public class ProtocolDataUnit { /** * Calculates the needed size ( in bytes ) of serializing this object .
* @ return The needed size to store this object . */
private final int calcSize ( ) { } } | int size = BasicHeaderSegment . BHS_FIXED_SIZE ; size += basicHeaderSegment . getTotalAHSLength ( ) * AdditionalHeaderSegment . AHS_FACTOR ; // plus the sizes of the used digests
size += headerDigest . getSize ( ) ; size += dataDigest . getSize ( ) ; size += AbstractDataSegment . getTotalLength ( basicHeaderSegment . g... |
public class SimpleMisoSceneRuleSet { /** * documentation inherited from interface */
public void addRuleInstances ( String prefix , Digester dig ) { } } | // this creates the appropriate instance when we encounter our
// prefix tag
dig . addRule ( prefix , new Rule ( ) { @ Override public void begin ( String namespace , String name , Attributes attributes ) throws Exception { digester . push ( createMisoSceneModel ( ) ) ; } @ Override public void end ( String namespace ,... |
public class CmsVfsIndexer { /** * Updates ( writes ) a single resource in the index . < p >
* @ param writer the index writer to use
* @ param threadManager the thread manager to use when extracting the document text
* @ param resource the resource to update
* @ throws CmsIndexException if something goes wrong... | if ( resource . isFolder ( ) || resource . isTemporaryFile ( ) ) { // don ' t ever index folders or temporary files
return ; } try { // create the index thread for the resource
threadManager . createIndexingThread ( this , writer , resource ) ; } catch ( Exception e ) { if ( m_report != null ) { m_report . println ( Me... |
public class DeviceClass { /** * Export a device .
* Send device network parameter to TANGO database . The main parameter sent
* to database is the CORBA stringified device IOR .
* @ param dev The device to be exported
* @ throws DevFailed If the command sent to the database failed . Click < a
* href = " . . ... | Util . out4 . println ( "DeviceClass::export_device() arrived" ) ; Device d ; // Activate the CORBA object incarnated by the Java object
final Util tg = Util . instance ( ) ; final ORB orb = tg . get_orb ( ) ; d = dev . _this ( orb ) ; // Get the object id and store it
byte [ ] oid = null ; final POA r_poa = tg . get_p... |
public class TextParams { /** * Set text parameters from properties
* @ param context Valid Android { @ link Context }
* @ param properties JSON text properties */
public void setFromJSON ( Context context , JSONObject properties ) { } } | String backgroundResStr = optString ( properties , Properties . background ) ; if ( backgroundResStr != null && ! backgroundResStr . isEmpty ( ) ) { final int backgroundResId = getId ( context , backgroundResStr , "drawable" ) ; setBackGround ( context . getResources ( ) . getDrawable ( backgroundResId , null ) ) ; } s... |
public class FileSystemGroupStore { /** * Returns an EntityIdentifier [ ] of groups of the given leaf type whose names match the query
* string according to the search method .
* < p > Treats case sensitive and case insensitive searches the same .
* @ param query String the string used to match group names .
* ... | List ids = new ArrayList ( ) ; File baseDir = getFileRoot ( leafType ) ; if ( log . isDebugEnabled ( ) ) log . debug ( DEBUG_CLASS_NAME + "searchForGroups(): " + query + " method: " + searchMethod + " type: " + leafType ) ; if ( baseDir != null ) { String nameFilter = null ; switch ( searchMethod ) { case DISCRETE : ca... |
public class GVRWebViewSceneObject { /** * Draws the { @ link WebView } onto { @ link # mSurfaceTexture } */
private void refresh ( ) { } } | try { Canvas canvas = mSurface . lockCanvas ( null ) ; mWebView . draw ( canvas ) ; mSurface . unlockCanvasAndPost ( canvas ) ; } catch ( Surface . OutOfResourcesException t ) { Log . e ( "GVRWebBoardObject" , "lockCanvas failed" ) ; } mSurfaceTexture . updateTexImage ( ) ; |
public class DefaultCurieProvider { /** * ( non - Javadoc )
* @ see org . springframework . hateoas . hal . CurieProvider # getCurieInformation ( ) */
@ Override public Collection < ? extends Object > getCurieInformation ( Links links ) { } } | return curies . entrySet ( ) . stream ( ) . map ( it -> new Curie ( it . getKey ( ) , getCurieHref ( it . getKey ( ) , it . getValue ( ) ) ) ) . collect ( Collectors . collectingAndThen ( Collectors . toList ( ) , Collections :: unmodifiableCollection ) ) ; |
public class Specification { /** * Specifies that no exception should be thrown , failing with a
* { @ link UnallowedExceptionThrownError } otherwise . */
public void noExceptionThrown ( ) { } } | Throwable thrown = getSpecificationContext ( ) . getThrownException ( ) ; if ( thrown == null ) return ; throw new UnallowedExceptionThrownError ( null , thrown ) ; |
public class XmlJobDefExporter { /** * Exports several ( given ) job def to a XML file . */
static void export ( String xmlPath , List < JobDef > jobDefList , DbConn cnx ) throws JqmXmlException { } } | // Argument tests
if ( xmlPath == null ) { throw new IllegalArgumentException ( "file path cannot be null" ) ; } // Create XML into file
OutputStream os = null ; try { os = new FileOutputStream ( xmlPath ) ; export ( os , jobDefList , cnx ) ; } catch ( FileNotFoundException e ) { throw new JqmXmlException ( e ) ; } fin... |
public class JavaProcessSession { /** * normally just increments , but for Integration , defers to the run object */
public void incrementCurrentSection ( ) { } } | if ( runner_controlled_sections ) { // assume the current run object is at least a JavaProcessRunner !
rollback_section = current_section ; current_section = getCurrentSection ( ) . incrementCurrentSection ( current_section ) ; } else { // as previously
rollback_section = current_section ; current_section ++ ; } |
public class PropertyUtils { /** * Returns the value of an optional property , if the property is
* set . If it is not set defval is returned . */
public static String get ( Properties props , String name , String defval ) { } } | String value = props . getProperty ( name ) ; if ( value == null ) value = defval ; return value ; |
public class BufferParallelAggregation { /** * Computes the bitwise union of the input bitmaps
* @ param bitmaps the input bitmaps
* @ return the union of the bitmaps */
public static MutableRoaringBitmap or ( ImmutableRoaringBitmap ... bitmaps ) { } } | SortedMap < Short , List < MappeableContainer > > grouped = groupByKey ( bitmaps ) ; short [ ] keys = new short [ grouped . size ( ) ] ; MappeableContainer [ ] values = new MappeableContainer [ grouped . size ( ) ] ; List < List < MappeableContainer > > slices = new ArrayList < > ( grouped . size ( ) ) ; int i = 0 ; fo... |
public class ElementNameQualifier { /** * Strip any namespace information off a node name
* @ param node
* @ return the localName if the node is namespaced , or the name otherwise */
protected String getNonNamespacedNodeName ( Node node ) { } } | String name = node . getLocalName ( ) ; if ( name == null ) { return node . getNodeName ( ) ; } return name ; |
public class Accounts { /** * Generate Financial Reports for an owned Account
* @ param freelancerReference Freelancer ' s reference
* @ param params Parameters
* @ throwsJSONException If error occurred
* @ return { @ link JSONObject } */
public JSONObject getOwned ( String freelancerReference , HashMap < Strin... | return oClient . get ( "/finreports/v2/financial_account_owner/" + freelancerReference , params ) ; |
public class JXMapViewer { /** * A property indicating the center position of the map
* @ param geoPosition the new property value */
public void setCenterPosition ( GeoPosition geoPosition ) { } } | GeoPosition oldVal = getCenterPosition ( ) ; setCenter ( getTileFactory ( ) . geoToPixel ( geoPosition , zoomLevel ) ) ; repaint ( ) ; GeoPosition newVal = getCenterPosition ( ) ; firePropertyChange ( "centerPosition" , oldVal , newVal ) ; |
public class NodeUtil { /** * Returns true if this is a literal value . We define a literal value
* as any node that evaluates to the same thing regardless of when or
* where it is evaluated . So / xyz / and [ 3 , 5 ] are literals , but
* the name a is not .
* < p > Function literals do not meet this definition... | switch ( n . getToken ( ) ) { case CAST : return isLiteralValue ( n . getFirstChild ( ) , includeFunctions ) ; case ARRAYLIT : for ( Node child = n . getFirstChild ( ) ; child != null ; child = child . getNext ( ) ) { if ( ( ! child . isEmpty ( ) ) && ! isLiteralValue ( child , includeFunctions ) ) { return false ; } }... |
public class MiniTemplatorParser { /** * Completes the main block registration . */
private void endMainBlock ( ) { } } | BlockTabRec btr = blockTab [ 0 ] ; btr . tPosContentsEnd = templateText . length ( ) ; btr . tPosEnd = templateText . length ( ) ; btr . definitionIsOpen = false ; currentNestingLevel -- ; |
public class CascadingPersonAttributeDao { /** * If this is the first call , or there are no results in the resultPeople Set and stopIfFirstDaoReturnsNull = false ,
* the seed map is used . If not the attributes of the first user in the resultPeople Set are used for each child
* dao . If stopIfFirstDaoReturnsNull =... | if ( isFirstQuery || ( ! stopIfFirstDaoReturnsNull && ( resultPeople == null || resultPeople . size ( ) == 0 ) ) ) { return currentlyConsidering . getPeopleWithMultivaluedAttributes ( seed , filter ) ; } else if ( stopIfFirstDaoReturnsNull && ! isFirstQuery && ( resultPeople == null || resultPeople . size ( ) == 0 ) ) ... |
public class PathHelper { /** * Simply removes all relative parts of a path ( meaning " . . " and " . " )
* @ param path
* @ return path without relative parts */
public static String removeRelativeParts ( final String path ) { } } | String partialPath = "" ; for ( String part : PathHelper . getParts ( path ) ) { // ignore " . . " and " . " in paths
if ( ".." . equals ( part ) || "." . equals ( part ) ) { continue ; } partialPath += PathHelper . PATH_SEP + part ; } return partialPath ; |
public class CmsWorkplaceManager { /** * Sets the Workplace default locale . < p >
* @ param locale the locale to set */
public void setDefaultLocale ( String locale ) { } } | try { m_defaultLocale = CmsLocaleManager . getLocale ( locale ) ; } catch ( Exception e ) { if ( CmsLog . INIT . isWarnEnabled ( ) ) { CmsLog . INIT . warn ( Messages . get ( ) . getBundle ( ) . key ( Messages . INIT_NONCRIT_ERROR_0 ) , e ) ; } } if ( CmsLog . INIT . isInfoEnabled ( ) ) { CmsLog . INIT . info ( Message... |
public class Metrics { /** * Register a gauge that reports the size of the { @ link java . util . Collection } . The registration
* will keep a weak reference to the collection so it will not prevent garbage collection .
* The collection implementation used should be thread safe . Note that calling
* { @ link jav... | return globalRegistry . gaugeCollectionSize ( name , tags , collection ) ; |
public class JstormMaster { /** * Setup the request that will be sent to the RM for the container ask .
* @ return the setup ResourceRequest to be sent to RM */
public ContainerRequest setupContainerAskForRM ( int containerMemory , int containerVirtualCores , int priority , String [ ] racks , String [ ] hosts ) { } } | Priority pri = Priority . newInstance ( priority ) ; Resource capability = Resource . newInstance ( containerMemory , containerVirtualCores ) ; ContainerRequest request = new ContainerRequest ( capability , hosts , racks , pri , false ) ; LOG . info ( "By Thrift Server Requested container ask: " + request . toString (... |
public class DependsFileParser { /** * Converts a SortedMap received from a { @ code getVersionMap } call to hold DependencyInfo values ,
* and keys on the form { @ code groupId / artifactId } .
* @ param versionMap A non - null Map , as received from a call to { @ code getVersionMap } .
* @ return a SortedMap re... | // Check sanity
Validate . notNull ( versionMap , "anURL" ) ; final SortedMap < String , DependencyInfo > toReturn = new TreeMap < String , DependencyInfo > ( ) ; // First , only find the version lines .
for ( Map . Entry < String , String > current : versionMap . entrySet ( ) ) { final String currentKey = current . ge... |
public class Query { /** * Allows filtering values in a ArrayNode as per passed ComparisonExpression
* @ param expression
* @ return */
public ArrayNode filter ( ComparisonExpression expression ) { } } | ArrayNode result = new ObjectMapper ( ) . createArrayNode ( ) ; if ( node . isArray ( ) ) { Iterator < JsonNode > iterator = node . iterator ( ) ; int validObjectsCount = 0 ; int topCount = 0 ; while ( iterator . hasNext ( ) ) { JsonNode curNode = iterator . next ( ) ; if ( expression == null || ( expression != null &&... |
public class StashReader { /** * Get the splits for a record stored in stash . Each split corresponds to a file in the Stash table ' s directory . */
public List < StashSplit > getSplits ( String table ) throws StashNotAvailableException , TableNotStashedException { } } | ImmutableList . Builder < StashSplit > splitsBuilder = ImmutableList . builder ( ) ; Iterator < S3ObjectSummary > objectSummaries = getS3ObjectSummariesForTable ( table ) ; while ( objectSummaries . hasNext ( ) ) { S3ObjectSummary objectSummary = objectSummaries . next ( ) ; String key = objectSummary . getKey ( ) ; //... |
public class VariableUtilImpl { /** * used by generated bytecode */
public static Object recordcount ( PageContext pc , Object obj ) throws PageException { } } | if ( obj instanceof Query ) return Caster . toDouble ( ( ( Query ) obj ) . getRecordcount ( ) ) ; return pc . getCollection ( obj , KeyConstants . _RECORDCOUNT ) ; |
public class Template { /** * Writes to the supplied Writer .
* Note : Does NOT close the writer . */
public void writeTo ( Writer writer ) throws IOException { } } | JsonSerializer . write ( Json . jObject ( "template" , asJson ( ) ) , writer ) ; writer . flush ( ) ; |
public class Bpmn2JsonUnmarshaller { /** * Revisit message to set their item ref to a item definition
* @ param def Definitions */
private void revisitMessages ( Definitions def ) { } } | List < RootElement > rootElements = def . getRootElements ( ) ; List < ItemDefinition > toAddDefinitions = new ArrayList < ItemDefinition > ( ) ; for ( RootElement root : rootElements ) { if ( root instanceof Message ) { if ( ! existsMessageItemDefinition ( rootElements , root . getId ( ) ) ) { ItemDefinition itemdef =... |
public class PlainTextChainingRenderer { /** * { @ inheritDoc }
* @ since 2.0RC1 */
@ Override public void beginDefinitionList ( Map < String , String > parameters ) { } } | if ( getBlockState ( ) . getDefinitionListDepth ( ) == 1 && ! getBlockState ( ) . isInList ( ) ) { printEmptyLine ( ) ; } else { getPrinter ( ) . print ( NL ) ; } |
public class Error { /** * Thrown when there is an error in mapper generated class .
* @ param destination destination class
* @ param source source class
* @ param path xml path configuration
* @ param e exception captured */
public static void illegalCode ( Class < ? > destination , Class < ? > source , Strin... | String additionalInformation = e . getMessage ( ) . split ( "," ) [ 1 ] ; throw new IllegalCodeException ( MSG . INSTANCE . message ( illegalCodePath , destination . getSimpleName ( ) , source . getSimpleName ( ) , path , additionalInformation ) ) ; |
public class EntityCapsManager { /** * Returns the local entity ' s NodeVer ( e . g .
* " http : / / www . igniterealtime . org / projects / smack / # 66/0NaeaBKkwk85efJTGmU47vXI =
* @ return the local NodeVer */
public String getLocalNodeVer ( ) { } } | CapsVersionAndHash capsVersionAndHash = getCapsVersionAndHash ( ) ; if ( capsVersionAndHash == null ) { return null ; } return entityNode + '#' + capsVersionAndHash . version ; |
public class ApiOvhDedicatednasha { /** * Get this object properties
* REST : GET / dedicated / nasha / { serviceName } / partition / { partitionName } / options
* @ param serviceName [ required ] The internal name of your storage
* @ param partitionName [ required ] the given name of partition */
public OvhOptio... | String qPath = "/dedicated/nasha/{serviceName}/partition/{partitionName}/options" ; StringBuilder sb = path ( qPath , serviceName , partitionName ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhOptions . class ) ; |
public class CheckMethodAdapter { /** * Checks a stack frame value .
* @ param value
* the value to be checked . */
void checkFrameValue ( final Object value ) { } } | if ( value == Opcodes . TOP || value == Opcodes . INTEGER || value == Opcodes . FLOAT || value == Opcodes . LONG || value == Opcodes . DOUBLE || value == Opcodes . NULL || value == Opcodes . UNINITIALIZED_THIS ) { return ; } if ( value instanceof String ) { checkInternalName ( ( String ) value , "Invalid stack frame va... |
public class JdbiMappers { /** * Returns an array of Strings or null if the input is null . Null is intentional ( not empty list ) , to be
* able to distinguish between null value and empty list in the db . */
public static List < String > getStringList ( final ResultSet rs , final String columnName ) throws SQLExcep... | final Array ary = rs . getArray ( columnName ) ; if ( ary != null ) { Preconditions . checkArgument ( ary . getBaseType ( ) == Types . VARCHAR || ary . getBaseType ( ) == Types . CHAR ) ; return Arrays . asList ( ( String [ ] ) ary . getArray ( ) ) ; } return null ; |
public class GenericUrl { /** * Adds query parameters from the provided entrySet into the buffer . */
static void addQueryParams ( Set < Entry < String , Object > > entrySet , StringBuilder buf ) { } } | // ( similar to UrlEncodedContent )
boolean first = true ; for ( Map . Entry < String , Object > nameValueEntry : entrySet ) { Object value = nameValueEntry . getValue ( ) ; if ( value != null ) { String name = CharEscapers . escapeUriQuery ( nameValueEntry . getKey ( ) ) ; if ( value instanceof Collection < ? > ) { Co... |
public class NativeCursors { /** * Convert a cursor in 32 - bit BYTE _ ARGB _ PRE format to a 16 - bit or 32 - bit
* color - keyed format
* @ param source the cursor pixels
* @ param dest a target ShortBuffer or IntBuffer
* @ param targetDepth the depth of the target format ( 16 or 32)
* @ param transparentPi... | switch ( targetDepth ) { case 32 : colorKeyCursor32 ( source , ( IntBuffer ) dest , transparentPixel ) ; break ; case 16 : colorKeyCursor16 ( source , ( ShortBuffer ) dest , transparentPixel ) ; break ; default : throw new UnsupportedOperationException ( ) ; } |
public class sms_server { /** * Use this API to fetch filtered set of sms _ server resources .
* filter string should be in JSON format . eg : " vm _ state : DOWN , name : [ a - z ] + " */
public static sms_server [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } } | sms_server obj = new sms_server ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; sms_server [ ] response = ( sms_server [ ] ) obj . getfiltered ( service , option ) ; return response ; |
public class Bits { /** * Exclude [ start . . . end ] from this set . */
public void excludeFrom ( int start ) { } } | Assert . check ( currentState != BitsState . UNKNOWN ) ; Bits temp = new Bits ( ) ; temp . sizeTo ( bits . length ) ; temp . inclRange ( 0 , start ) ; internalAndSet ( temp ) ; currentState = BitsState . NORMAL ; |
public class SchemaManager { /** * Returns the specified session context table .
* Returns null if the table does not exist in the context . */
public Table findSessionTable ( Session session , String name , String schemaName ) { } } | return session . findSessionTable ( name ) ; |
public class AbstractRepository { /** * Default implementation checks if Repository implements Capability
* interface , and if so , returns the Repository . */
@ SuppressWarnings ( "unchecked" ) public < C extends Capability > C getCapability ( Class < C > capabilityType ) { } } | if ( capabilityType . isInstance ( this ) ) { return ( C ) this ; } return null ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcMeasureWithUnit ( ) { } } | if ( ifcMeasureWithUnitEClass == null ) { ifcMeasureWithUnitEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 375 ) ; } return ifcMeasureWithUnitEClass ; |
public class Command { /** * Get the command output and if the command hasn ' t completed
* yet , wait until it does .
* @ return The command output . */
@ Override public T get ( ) { } } | try { latch . await ( ) ; return output . get ( ) ; } catch ( InterruptedException e ) { throw new RedisCommandInterruptedException ( e ) ; } |
public class CobWeb { /** * public void updateClusterer ( Instance newInstance ) throws Exception { */
@ Override public void trainOnInstanceImpl ( Instance newInstance ) { } } | // throws Exception {
m_numberOfClustersDetermined = false ; if ( m_cobwebTree == null ) { m_cobwebTree = new CNode ( newInstance . numAttributes ( ) , newInstance ) ; } else { m_cobwebTree . addInstance ( newInstance ) ; } |
public class NLS { /** * Not sure why this is here . Looks like it is a replacement for
* Integer . getInteger . */
public int getInteger ( String key ) throws MissingResourceException { } } | String result = getString ( key ) ; try { return Integer . parseInt ( result ) ; } catch ( NumberFormatException nfe ) { if ( tc . isEventEnabled ( ) ) { Tr . event ( tc , "Unable to parse " + result + " as Integer." ) ; } // DGH20040823 : Begin fix for defect 218797 - Source provided by Tom Musta
// String msg = messa... |
public class KeyAgreement { /** * Choose the Spi from the first provider available . Used if
* delayed provider selection is not possible because init ( )
* is not the first method called . */
void chooseFirstProvider ( ) { } } | if ( spi != null ) { return ; } synchronized ( lock ) { if ( spi != null ) { return ; } /* Android - removed : this debugging mechanism is not used in Android .
if ( debug ! = null ) {
int w = - - warnCount ;
if ( w > = 0 ) {
debug . println ( " KeyAgreement . init ( ) not first method "
+ " called , disablin... |
public class Operation { /** * < pre >
* Service - specific metadata associated with the operation . It typically
* contains progress information and common metadata such as create time .
* Some services might not provide such metadata . Any method that returns a
* long - running operation should document the m... | return metadata_ == null ? com . google . protobuf . Any . getDefaultInstance ( ) : metadata_ ; |
public class SparseBitmap { /** * Reverseflatand .
* @ param bitmap
* the bitmap
* @ return the skippable iterator */
public static SkippableIterator reverseflatand ( SkippableIterator ... bitmap ) { } } | if ( bitmap . length == 0 ) throw new RuntimeException ( "nothing to process" ) ; SkippableIterator answer = bitmap [ bitmap . length - 1 ] ; for ( int k = bitmap . length - 1 ; k > 0 ; -- k ) { answer = and2by2 ( answer , bitmap [ k ] ) ; } return answer ; |
public class AngleCalc { /** * Change the representation of an orientation , so the difference to the given baseOrientation
* will be smaller or equal to PI ( 180 degree ) . This is achieved by adding or subtracting a
* 2 * PI , so the direction of the orientation will not be changed */
public double alignOrientati... | double resultOrientation ; if ( baseOrientation >= 0 ) { if ( orientation < - Math . PI + baseOrientation ) resultOrientation = orientation + 2 * Math . PI ; else resultOrientation = orientation ; } else if ( orientation > + Math . PI + baseOrientation ) resultOrientation = orientation - 2 * Math . PI ; else resultOrie... |
public class GanttChartView12 { /** * { @ inheritDoc } */
@ Override protected void processDefaultBarStyles ( Props props ) { } } | GanttBarStyleFactory f = new GanttBarStyleFactoryCommon ( ) ; m_barStyles = f . processDefaultStyles ( props ) ; |
public class AbstractAppender { /** * Sends a configuration message . */
protected void sendConfigureRequest ( Connection connection , MemberState member , ConfigureRequest request ) { } } | logger . trace ( "{} - Sending {} to {}" , context . getCluster ( ) . member ( ) . address ( ) , request , member . getMember ( ) . serverAddress ( ) ) ; connection . < ConfigureRequest , ConfigureResponse > sendAndReceive ( request ) . whenComplete ( ( response , error ) -> { context . checkThread ( ) ; // Complete th... |
public class ChartJs { /** * Method injecting native chart . js code into the browser < br / >
* In case code already been injected do nothing */
public static void ensureInjected ( ) { } } | // TODO : do real injection ( lazy loading )
if ( injected ) return ; Resources res = GWT . create ( Resources . class ) ; String source = res . chartJsSource ( ) . getText ( ) ; ScriptElement scriptElement = Document . get ( ) . createScriptElement ( ) ; scriptElement . setId ( "_chartjs" ) ; scriptElement . setInnerT... |
public class Client { /** * Gets a client instance on the roboremote port
* @ return */
public static Client getInstance ( ) { } } | if ( instance == null ) { instance = new Client ( ) ; } instance . API_PORT = PortSingleton . getInstance ( ) . getPort ( ) ; return instance ; |
public class SchemaModifier { /** * Create the tables over the connection .
* @ param connection to use
* @ param mode creation mode .
* @ param createIndexes true to also create indexes , false otherwise */
public void createTables ( Connection connection , TableCreationMode mode , boolean createIndexes ) { } } | ArrayList < Type < ? > > sorted = sortTypes ( ) ; try ( Statement statement = connection . createStatement ( ) ) { if ( mode == TableCreationMode . DROP_CREATE ) { ArrayList < Type < ? > > reversed = sortTypes ( ) ; Collections . reverse ( reversed ) ; executeDropStatements ( statement , reversed ) ; } for ( Type < ? >... |
public class RhinoScriptEngine { /** * The sync function creates a synchronized function ( in the sense
* of a Java synchronized method ) from an existing function . The
* new function synchronizes on the < code > this < / code > object of
* its invocation .
* js > var o = { f : sync ( function ( x ) {
* prin... | if ( args . length == 1 && args [ 0 ] instanceof Function ) { return new Synchronizer ( ( Function ) args [ 0 ] ) ; } else { throw Context . reportRuntimeError ( "wrong argument(s) for sync" ) ; } |
public class AbstractItemLink { /** * ( non - Javadoc )
* @ see com . ibm . ws . sib . msgstore . cache . xalist . Task # postAbort ( com . ibm . ws . sib . msgstore . Transaction ) */
public final void postAbortAdd ( final PersistentTransaction transaction ) throws SevereMessageStoreException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "postAbortAdd" , transaction ) ; releaseItem ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "postAbortAdd" ) ; |
public class CryptoConfidentialKey { /** * Returns a { @ link javax . crypto . Cipher } object for encrypting with this key . */
@ Override public Cipher encrypt ( ) { } } | try { Cipher cipher = Cipher . getInstance ( ALGORITHM ) ; cipher . init ( Cipher . ENCRYPT_MODE , getKey ( ) ) ; return cipher ; } catch ( GeneralSecurityException e ) { throw new AssertionError ( e ) ; } |
public class ProjectFilterSettings { /** * Create a string containing the encoded form of the ProjectFilterSettings .
* @ return an encoded string */
public String toEncodedString ( ) { } } | // Priority threshold
StringBuilder buf = new StringBuilder ( ) ; buf . append ( getMinPriority ( ) ) ; // Encode enabled bug categories . Note that these aren ' t really used for
// much .
// They only come in to play when parsed by a version of FindBugs older
// than 1.1.
buf . append ( FIELD_DELIMITER ) ; for ( Iter... |
public class ResourceGroovyMethods { /** * Read the content of this URL and returns it as a byte [ ] .
* The default connection parameters can be modified by adding keys to the
* < i > parameters map < / i > :
* < ul >
* < li > connectTimeout : the connection timeout < / li >
* < li > readTimeout : the read t... | return IOGroovyMethods . getBytes ( configuredInputStream ( parameters , url ) ) ; |
public class AsynchronousRequest { /** * For more info on achievements groups API go < a href = " https : / / wiki . guildwars2 . com / wiki / API : 2 / achievements / groups " > here < / a > < br / >
* Give user the access to { @ link Callback # onResponse ( Call , Response ) } and { @ link Callback # onFailure ( Ca... | gw2API . getAllAchievementGroupIDs ( ) . enqueue ( callback ) ; |
public class ApiOvhIp { /** * List services available as a destination
* REST : GET / ip / { ip } / move
* @ param ip [ required ]
* API beta */
public OvhDestinations ip_move_GET ( String ip ) throws IOException { } } | String qPath = "/ip/{ip}/move" ; StringBuilder sb = path ( qPath , ip ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhDestinations . class ) ; |
public class HttpStream { /** * Opens a new HTTP stream for reading , i . e . a GET request .
* @ param path the URL for the stream
* @ return the opened stream */
static HttpStreamWrapper openRead ( HttpPath path ) throws IOException { } } | HttpStream stream = createStream ( path ) ; stream . _isPost = false ; HttpStreamWrapper wrapper = new HttpStreamWrapper ( stream ) ; String status = ( String ) wrapper . getAttribute ( "status" ) ; // ioc / 23p0
if ( "404" . equals ( status ) ) { throw new FileNotFoundException ( L . l ( "'{0}' returns a HTTP 404." , ... |
public class UpdatableResultSet { /** * { inheritDoc } . */
public void updateBinaryStream ( int columnIndex , InputStream inputStream ) throws SQLException { } } | updateBinaryStream ( columnIndex , inputStream , Long . MAX_VALUE ) ; |
public class FilterMandates { /** * Gets map of fields and values .
* @ return Collection of field name - field value pairs . */
@ Override public Map < String , String > getValues ( ) { } } | HashMap < String , String > result = new HashMap < > ( ) ; if ( status != null && status != MandateStatus . NotSpecified ) { result . put ( "status" , status . name ( ) ) ; } if ( beforeDate != null ) result . put ( "beforeDate" , Long . toString ( beforeDate ) ) ; if ( afterDate != null ) result . put ( "afterDate" , ... |
public class SparseMatrix { /** * long型索引转换为int [ ] 索引
* @ param idx
* @ return 索引 */
public int [ ] getIndices ( long idx ) { } } | int xIndices = ( int ) idx % dim1 ; int yIndices = ( int ) ( idx - xIndices ) / dim1 ; int [ ] Indices = { xIndices , yIndices } ; return Indices ; |
public class SqlServerParser { /** * 处理PlainSelect类型的selectBody
* @ param plainSelect */
protected void processPlainSelect ( PlainSelect plainSelect , int level ) { } } | if ( level > 1 ) { if ( isNotEmptyList ( plainSelect . getOrderByElements ( ) ) ) { if ( plainSelect . getTop ( ) == null ) { plainSelect . setTop ( TOP100_PERCENT ) ; } } } if ( plainSelect . getFromItem ( ) != null ) { processFromItem ( plainSelect . getFromItem ( ) , level + 1 ) ; } if ( plainSelect . getJoins ( ) !... |
public class Gen { /** * Generate code to call all finalizers of structures aborted by
* a non - local
* exit . Return target environment of the non - local exit .
* @ param target The tree representing the structure that ' s aborted
* @ param env The environment current at the non - local exit . */
Env < GenCo... | Env < GenContext > env1 = env ; while ( true ) { genFinalizer ( env1 ) ; if ( env1 . tree == target ) break ; env1 = env1 . next ; } return env1 ; |
public class DocumentRootImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public NotificationChain basicSetNegativeExponentialDistribution ( NegativeExponentialDistributionType newNegativeExponentialDistribution , NotificationChain msgs ) { } } | return ( ( FeatureMap . Internal ) getMixed ( ) ) . basicAdd ( BpsimPackage . Literals . DOCUMENT_ROOT__NEGATIVE_EXPONENTIAL_DISTRIBUTION , newNegativeExponentialDistribution , msgs ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.