signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class ImplDisparityScoreSadRectFive_U8 { /** * Using previously computed results it efficiently finds the disparity in the remaining rows .
* When a new block is processes the last row / column is subtracted and the new row / column is
* added . */
private void computeRemainingRows ( GrayU8 left , GrayU8 rig... | for ( int row = regionHeight ; row < left . height ; row ++ , activeVerticalScore ++ ) { int oldRow = row % regionHeight ; int previous [ ] = verticalScore [ ( activeVerticalScore - 1 ) % regionHeight ] ; int active [ ] = verticalScore [ activeVerticalScore % regionHeight ] ; // subtract first row from vertical score
i... |
public class EbInterfaceReader { /** * Create a new reader builder .
* @ param aClass
* The UBL class to be read . May not be < code > null < / code > .
* @ return The new reader builder . Never < code > null < / code > .
* @ param < T >
* The ebInterface document implementation type */
@ Nonnull public stati... | return new EbInterfaceReader < > ( aClass ) ; |
public class RestService { /** * Returns the first address in { @ code locations } that is equals to a public IP of the system
* @ param locations The list of address ( hostname : port or ip : port ) to check
* @ return The first address in { @ code locations } that is equals to a public IP of the system or null if... | try { InetAddress [ ] candidates = NetworkUtils . getGlobalInterfaces ( ) ; for ( String address : locations ) { StringUtils . IpAndPort ipAndPort = StringUtils . parseIpAddress ( address ) ; InetAddress addr = InetAddress . getByName ( ipAndPort . ip ) ; for ( InetAddress candidate : candidates ) { if ( addr . equals ... |
public class UriEscapeUtil { /** * Perform an escape operation , based on a Reader , according to the specified type and writing the
* result 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... | if ( reader == null ) { return ; } int c1 , c2 ; // c0 : last char , c1 : current char , c2 : next char
c2 = reader . read ( ) ; while ( c2 >= 0 ) { c1 = c2 ; c2 = reader . read ( ) ; final int codepoint = codePointAt ( ( char ) c1 , ( char ) c2 ) ; /* * Shortcut : most characters will be alphabetic , and we won ' t ne... |
public class JNRPERequest { /** * Initializes the object with the given command and the given list of ' ! '
* separated list of arguments .
* @ param commandName
* The command
* @ param argumentsString
* The arguments */
private void init ( final String commandName , final String argumentsString ) { } } | String fullCommandString ; String tmpArgumentsString = argumentsString ; if ( tmpArgumentsString != null && ! tmpArgumentsString . isEmpty ( ) && tmpArgumentsString . charAt ( 0 ) == '!' ) { tmpArgumentsString = tmpArgumentsString . substring ( 1 ) ; } if ( ! StringUtils . isBlank ( tmpArgumentsString ) ) { fullCommand... |
public class SDMath { /** * Element - wise reciprocal ( inverse ) function : out [ i ] = 1 / in [ i ]
* @ param name Name of the output variable
* @ param a Input variable
* @ return Output variable */
public SDVariable reciprocal ( String name , SDVariable a ) { } } | validateNumerical ( "reciprocal" , a ) ; SDVariable ret = f ( ) . reciprocal ( a ) ; return updateVariableNameAndReference ( ret , name ) ; |
public class DefaultTextBundleRegistry { /** * Convert locale to string with language _ country [ _ variant ]
* @ param locale
* @ return locale string */
protected final String toLocaleStr ( Locale locale ) { } } | if ( locale == Locale . ROOT ) { return "" ; } String language = locale . getLanguage ( ) ; String country = locale . getCountry ( ) ; String variant = locale . getVariant ( ) ; if ( language == "" && country == "" && variant == "" ) { return "" ; } StringBuilder sb = new StringBuilder ( ) ; if ( variant != "" ) { sb .... |
public class CmsUsersCsvDownloadDialog { /** * Generates the CSV file for the given users . < p >
* @ return CSV file */
public String generateCsv ( ) { } } | Map < String , List < String > > objects = getData ( ) ; // get the data object from session
List < String > groups = objects . get ( "groups" ) ; List < String > roles = objects . get ( "roles" ) ; Map < CmsUUID , CmsUser > exportUsers = new HashMap < CmsUUID , CmsUser > ( ) ; try { if ( ( ( groups == null ) || ( grou... |
public class NetUtils { /** * Converts an IPv4 address to raw bytes , returning a byte [ 4 ] , or null if the input is malformed .
* @ param ipv4Address The string representation of an ipv4 address .
* @ return A { @ code byte [ ] } containing the parts of the v4 ip address . */
public static byte [ ] getRawAddress... | final Matcher m = IPV4_ADDRESS . matcher ( ipv4Address ) ; if ( ! m . find ( ) ) { return null ; } final byte [ ] addr = new byte [ 4 ] ; for ( int i = 0 ; i < 4 ; i ++ ) { final int intVal = Integer . parseInt ( m . group ( i + 1 ) ) & 0x00ff ; addr [ i ] = ( byte ) intVal ; } return addr ; |
public class DocBookBuilder { /** * Builds a Report Chapter to be included in the book that displays a count of different types of errors and then a table to
* list the errors , providing links and basic topic data .
* @ param buildData Information and data structures for the build .
* @ return The Docbook Report... | log . info ( "\tBuilding Report Chapter" ) ; final ContentSpec contentSpec = buildData . getContentSpec ( ) ; final String locale = buildData . getBuildLocale ( ) ; final ZanataDetails zanataDetails = buildData . getZanataDetails ( ) ; String reportChapter = "" ; final List < TopicErrorData > noContentTopics = buildDat... |
public class AppServiceEnvironmentsInner { /** * Move an App Service Environment to a different VNET .
* Move an App Service Environment to a different VNET .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param name Name of the App Service Environment .
* @ param vne... | return beginChangeVnetWithServiceResponseAsync ( resourceGroupName , name , vnetInfo ) . map ( new Func1 < ServiceResponse < Page < SiteInner > > , Page < SiteInner > > ( ) { @ Override public Page < SiteInner > call ( ServiceResponse < Page < SiteInner > > response ) { return response . body ( ) ; } } ) ; |
public class AbstractCasWebflowConfigurer { /** * Create mapper to subflow state .
* @ param mappings the mappings
* @ return the mapper */
public Mapper createMapperToSubflowState ( final List < DefaultMapping > mappings ) { } } | val inputMapper = new DefaultMapper ( ) ; mappings . forEach ( inputMapper :: addMapping ) ; return inputMapper ; |
public class Rebuilder { /** * Resizes existing hash array into a larger one within a single Memory assuming enough space .
* This assumes a Memory preamble of standard form with the correct value of thetaLong .
* The Memory lgArrLongs will change .
* Afterwards , the caller must update local copies of lgArrLongs... | // Note : This copies the Memory data onto the heap and then at the end copies the result
// back to Memory . Even if we tried to do this directly into Memory it would require pre - clearing ,
// and the internal loops would be slower . The bulk copies are performed at a low level and
// are quite fast . Measurements r... |
public class ElementParametersImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setCostParameters ( CostParameters newCostParameters ) { } } | if ( newCostParameters != costParameters ) { NotificationChain msgs = null ; if ( costParameters != null ) msgs = ( ( InternalEObject ) costParameters ) . eInverseRemove ( this , EOPPOSITE_FEATURE_BASE - BpsimPackage . ELEMENT_PARAMETERS__COST_PARAMETERS , null , msgs ) ; if ( newCostParameters != null ) msgs = ( ( Int... |
public class Matchers { /** * Matches an AST node if it has the same erased type as the given class . */
public static < T extends Tree > Matcher < T > isSameType ( Class < ? > clazz ) { } } | return new IsSameType < > ( typeFromClass ( clazz ) ) ; |
public class HeatMap { /** * this generates the heatmap off of the main thread , loads the data , makes the overlay , then
* adds it to the map */
private void generateMap ( ) { } } | if ( getActivity ( ) == null ) // java . lang . IllegalStateException : Fragment HeatMap { 44f341d0 } not attached to Activity
return ; if ( renderJobActive ) return ; renderJobActive = true ; int densityDpi = ( int ) ( dm . density * cellSizeInDp ) ; // 10 dpi sized cells
IGeoPoint iGeoPoint = mMapView . getProjection... |
public class ConnectionManager { /** * Opens the project .
* @ throws KnowledgeSourceBackendInitializationException if an error
* occurs . */
void init ( ) throws KnowledgeSourceBackendInitializationException { } } | if ( this . project == null ) { Util . logger ( ) . log ( Level . FINE , "Opening Protege project {0}" , this . projectIdentifier ) ; this . project = initProject ( ) ; if ( this . project == null ) { throw new KnowledgeSourceBackendInitializationException ( "Could not load project " + this . projectIdentifier ) ; } el... |
public class ParameterProperty { /** * Set the non - null param set from given BitSet .
* @ param nonNullSet
* BitSet indicating which parameters are non - null */
public void setParamsWithProperty ( BitSet nonNullSet ) { } } | for ( int i = 0 ; i < 32 ; ++ i ) { setParamWithProperty ( i , nonNullSet . get ( i ) ) ; } |
public class ComparatorCompat { /** * Returns a comparator that considers { @ code null } to be less than non - null .
* If the specified comparator is { @ code null } , then the returned
* comparator considers all non - null values to be equal .
* @ param < T > the type of the objects compared by the comparator ... | return nullsComparator ( true , comparator ) ; |
public class RequestFromVertx { /** * Same like { @ link # parameter ( String ) } , but converts the parameter to
* Integer if found .
* The parameter is decoded by default .
* @ param name The name of the post or query parameter
* @ return The value of the parameter or null if not found . */
@ Override public ... | String parameter = parameter ( name ) ; try { return Integer . parseInt ( parameter ) ; } catch ( Exception e ) { // NOSONAR
return null ; } |
public class IpPermission { /** * [ VPC only ] The IPv6 ranges .
* @ param ipv6Ranges
* [ VPC only ] The IPv6 ranges . */
public void setIpv6Ranges ( java . util . Collection < Ipv6Range > ipv6Ranges ) { } } | if ( ipv6Ranges == null ) { this . ipv6Ranges = null ; return ; } this . ipv6Ranges = new com . amazonaws . internal . SdkInternalList < Ipv6Range > ( ipv6Ranges ) ; |
public class GetSampledRequestsResult { /** * A complex type that contains detailed information about each of the requests in the sample .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setSampledRequests ( java . util . Collection ) } or { @ link # withSamp... | if ( this . sampledRequests == null ) { setSampledRequests ( new java . util . ArrayList < SampledHTTPRequest > ( sampledRequests . length ) ) ; } for ( SampledHTTPRequest ele : sampledRequests ) { this . sampledRequests . add ( ele ) ; } return this ; |
public class TarArchive { /** * Set user and group information that will be used to fill in the tar archive ' s entry headers . Since Java currently
* provides no means of determining a user name , user id , group name , or group id for a given File , TarArchive
* allows the programmer to specify values to be used ... | this . userId = userId ; this . userName = userName ; this . groupId = groupId ; this . groupName = groupName ; |
public class AbstractSequenceClassifier { /** * Load a test file , run the classifier on it , and then write a Viterbi search
* graph for each sequence .
* @ param testFile
* The file to test on . */
public void classifyAndWriteViterbiSearchGraph ( String testFile , String searchGraphPrefix , DocumentReaderAndWri... | Timing timer = new Timing ( ) ; ObjectBank < List < IN > > documents = makeObjectBankFromFile ( testFile , readerAndWriter ) ; int numWords = 0 ; int numSentences = 0 ; for ( List < IN > doc : documents ) { DFSA < String , Integer > tagLattice = getViterbiSearchGraph ( doc , AnswerAnnotation . class ) ; numWords += doc... |
public class SimpleMisoSceneParser { /** * Parses the XML file on the supplied input stream into a scene model instance . */
public SimpleMisoSceneModel parseScene ( InputStream in ) throws IOException , SAXException { } } | _model = null ; _digester . push ( this ) ; _digester . parse ( in ) ; return _model ; |
public class Util { /** * Get a string containing the stack of the specified exception
* @ param e
* @ return */
public static String stackToDebugString ( Throwable e ) { } } | StringWriter sw = new StringWriter ( ) ; PrintWriter pw = new PrintWriter ( sw ) ; e . printStackTrace ( pw ) ; pw . close ( ) ; String text = sw . toString ( ) ; // Jump past the throwable
text = text . substring ( text . indexOf ( "at" ) ) ; return text ; |
public class JdbcExtractor { /** * Execute query using JDBC PreparedStatement to pass query parameters Set
* fetch size
* @ param cmds commands - query , fetch size , query parameters
* @ return JDBC ResultSet
* @ throws Exception */
private CommandOutput < ? , ? > executePreparedSql ( List < Command > cmds ) {... | String query = null ; List < String > queryParameters = null ; int fetchSize = 0 ; for ( Command cmd : cmds ) { if ( cmd instanceof JdbcCommand ) { JdbcCommandType type = ( JdbcCommandType ) cmd . getCommandType ( ) ; switch ( type ) { case QUERY : query = cmd . getParams ( ) . get ( 0 ) ; break ; case QUERYPARAMS : qu... |
public class SpringUtil { /** * Returns the resource at the specified location . Supports classpath references .
* @ param location The resource location .
* @ return The corresponding resource , or null if one does not exist . */
public static Resource getResource ( String location ) { } } | Resource resource = resolver . getResource ( location ) ; return resource . exists ( ) ? resource : null ; |
public class ConcurrentConveyor { /** * Drains a batch of items from the queue at the supplied index into the
* supplied collection .
* @ return the number of items drained */
public final int drainTo ( int queueIndex , Collection < ? super E > drain ) { } } | return drain ( queues [ queueIndex ] , drain , Integer . MAX_VALUE ) ; |
public class AbstractPrintQuery { /** * The instance method executes the query without an access check .
* @ return true if the query contains values , else false
* @ throws EFapsException on error */
public boolean executeWithoutAccessCheck ( ) throws EFapsException { } } | boolean ret = false ; if ( isMarked4execute ( ) ) { if ( getInstanceList ( ) . size ( ) > 0 ) { ret = executeOneCompleteStmt ( createSQLStatement ( ) , this . allSelects ) ; } if ( ret ) { for ( final OneSelect onesel : this . allSelects ) { if ( onesel . getFromSelect ( ) != null ) { onesel . getFromSelect ( ) . execu... |
public class ToolsClassFinder { /** * Searches for < code > tools . jar < / code > in various locations and uses an { @ link URLClassLoader } for
* loading a class from this files . If the class could not be found in any , then a { @ link ClassNotFoundException }
* is thrown . The locations used for lookup are ( in... | // Try to look up tools . jar within $ java . home , otherwise give up
String extraInfo ; if ( JAVA_HOME != null ) { extraInfo = "JAVA_HOME is " + JAVA_HOME ; for ( File toolsJar : TOOLS_JAR_LOCATIONS ) { try { if ( toolsJar . exists ( ) ) { ClassLoader loader = createClassLoader ( toolsJar ) ; return loader . loadClas... |
public class sslcrl { /** * Use this API to unset the properties of sslcrl resource .
* Properties that need to be unset are specified in args array . */
public static base_response unset ( nitro_service client , sslcrl resource , String [ ] args ) throws Exception { } } | sslcrl unsetresource = new sslcrl ( ) ; unsetresource . crlname = resource . crlname ; return unsetresource . unset_resource ( client , args ) ; |
public class Declarations { /** * Upcasts a Builder instance to the generated superclass , to allow access to private fields .
* < p > Reuses an existing upcast instance if one was already declared in this scope .
* @ param code the { @ link SourceBuilder } to add the declaration to
* @ param datatype metadata ab... | return code . scope ( ) . computeIfAbsent ( Declaration . UPCAST , ( ) -> { Variable base = new Variable ( "base" ) ; code . addLine ( UPCAST_COMMENT ) . addLine ( "%s %s = %s;" , datatype . getGeneratedBuilder ( ) , base , builder ) ; return base ; } ) ; |
public class NfsFileBase { /** * ( non - Javadoc )
* @ see com . emc . ecs . nfsclient . nfs . NfsFile # commit ( long , int ) */
public NfsCommitResponse commit ( long offsetToCommit , int dataSizeToCommit ) throws IOException { } } | return getNfs ( ) . wrapped_sendCommit ( makeCommitRequest ( offsetToCommit , dataSizeToCommit ) ) ; |
public class AbstractDataType { /** * Validate that current definition can be updated with the new definition
* @ param newType */
@ Override public void validateUpdate ( IDataType newType ) throws TypeUpdateException { } } | if ( ! getName ( ) . equals ( newType . getName ( ) ) || ! getClass ( ) . getName ( ) . equals ( newType . getClass ( ) . getName ( ) ) ) { throw new TypeUpdateException ( newType ) ; } |
public class HttpInputStream { /** * Fills input buffer with more bytes . */
protected void fill ( ) throws IOException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { // 306998.15
logger . logp ( Level . FINE , CLASS_NAME , "fill" , "fill" ) ; } // PK79219 Start
long longLeft = limit - total ; int len ; if ( longLeft > Integer . MAX_VALUE ) len = buf . length ; else len = Math . min ( buf . len... |
public class OnChangeSubscriptionQos { /** * internal method required to prevent findbugs warning */
private OnChangeSubscriptionQos setMinIntervalMsInternal ( final long minIntervalMs ) { } } | if ( minIntervalMs < MIN_MIN_INTERVAL_MS ) { this . minIntervalMs = MIN_MIN_INTERVAL_MS ; logger . warn ( "minIntervalMs < MIN_MIN_INTERVAL_MS. Using MIN_MIN_INTERVAL_MS: {}" , MIN_MIN_INTERVAL_MS ) ; } else if ( minIntervalMs > MAX_MIN_INTERVAL_MS ) { this . minIntervalMs = MAX_MIN_INTERVAL_MS ; logger . warn ( "minIn... |
public class Wxs { /** * 将一个WxOutMsg转为主动信息所需要的Json文本
* @ param msg
* 微信消息输出对象
* @ return 输出的 JSON 文本 */
public static void asJson ( Writer writer , WxOutMsg msg ) { } } | NutMap map = new NutMap ( ) ; map . put ( "touser" , msg . getToUserName ( ) ) ; map . put ( "msgtype" , msg . getMsgType ( ) ) ; switch ( WxMsgType . valueOf ( msg . getMsgType ( ) ) ) { case text : map . put ( "text" , new NutMap ( ) . setv ( "content" , msg . getContent ( ) ) ) ; break ; case image : map . put ( "im... |
public class DescribeDirectoriesRequest { /** * A list of identifiers of the directories for which to obtain the information . If this member is null , all
* directories that belong to the current account are returned .
* An empty list results in an < code > InvalidParameterException < / code > being thrown .
* @... | if ( directoryIds == null ) { directoryIds = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return directoryIds ; |
public class GenListModuleReader { /** * Get all targets except copy - to .
* @ return set of target file path with option format after
* { @ link org . dita . dost . util . Constants # STICK STICK } */
public Set < Reference > getNonCopytoResult ( ) { } } | final Set < Reference > nonCopytoSet = new LinkedHashSet < > ( 128 ) ; nonCopytoSet . addAll ( nonConrefCopytoTargets ) ; for ( final URI f : conrefTargets ) { nonCopytoSet . add ( new Reference ( stripFragment ( f ) , currentFileFormat ( ) ) ) ; } for ( final URI f : copytoMap . values ( ) ) { nonCopytoSet . add ( new... |
public class IncomeOperand { /** * Gets the tier value for this IncomeOperand .
* @ return tier * Income tier specifying an income bracket that a household falls
* under . Tier 1 belongs to the
* highest income bracket .
* < span class = " constraint Required " > This field is
* required and should not be { @... | return tier ; |
public class ClassPathUtils { /** * Find the root path for the given resource . If the resource is found in a Jar file , then the
* result will be an absolute path to the jar file . If the resource is found in a directory ,
* then the result will be the parent path of the given resource .
* For example , if the r... | Objects . requireNonNull ( resourceName , "resourceName" ) ; Objects . requireNonNull ( classLoader , "classLoader" ) ; URL resource = classLoader . getResource ( resourceName ) ; if ( resource != null ) { String protocol = resource . getProtocol ( ) ; if ( protocol . equals ( "jar" ) ) { return getJarPathFromUrl ( res... |
public class Column { /** * Decodes the column ' s { @ code byte [ ] } buffer .
* A { @ code null } is returned if the column is nullable and the
* { @ code byte [ ] } buffer equals { @ link Column # getNullValue ( ) nullValue } .
* @ param buffer { @ code byte [ ] } of size { @ link # getSize ( ) }
* @ return ... | if ( buffer == null ) { throw new InvalidArgument ( "buffer" , buffer ) ; } else if ( buffer . length != size ) { final String fmt = "cannot decode %s bytes, expected %d" ; final String msg = format ( fmt , buffer . length , size ) ; throw new InvalidArgument ( msg ) ; } if ( nullable ) { final byte [ ] nullValue = get... |
public class BinaryJedis { /** * Return a subset of the string from offset start to offset end ( both offsets are inclusive ) .
* Negative offsets can be used in order to provide an offset starting from the end of the string .
* So - 1 means the last char , - 2 the penultimate and so forth .
* The function handle... | checkIsInMultiOrPipeline ( ) ; client . substr ( key , start , end ) ; return client . getBinaryBulkReply ( ) ; |
public class ConstructorInstrumenter { /** * Ensures that the given sampler will be invoked every time a constructor for class c is invoked .
* @ param c The class to be tracked
* @ param sampler the code to be invoked when an instance of c is constructed
* @ throws UnmodifiableClassException if c cannot be modif... | // IMPORTANT : Don ' t forget that other threads may be accessing this
// class while this code is running . Specifically , the class may be
// executed directly after the retransformClasses is called . Thus , we need
// to be careful about what happens after the retransformClasses call .
synchronized ( samplerPutAtomi... |
public class Descriptor { /** * Filename of the form " < ksname > - < cfname > - [ tmp - ] [ < version > - ] < gen > - < component > "
* @ param directory The directory of the SSTable files
* @ param name The name of the SSTable file
* @ param skipComponent true if the name param should not be parsed for a compon... | // tokenize the filename
StringTokenizer st = new StringTokenizer ( name , String . valueOf ( separator ) ) ; String nexttok ; // all filenames must start with keyspace and column family
String ksname = st . nextToken ( ) ; String cfname = st . nextToken ( ) ; // optional temporary marker
nexttok = st . nextToken ( ) ;... |
public class GetBundlesResult { /** * An array of key - value pairs that contains information about the available bundles .
* @ param bundles
* An array of key - value pairs that contains information about the available bundles . */
public void setBundles ( java . util . Collection < Bundle > bundles ) { } } | if ( bundles == null ) { this . bundles = null ; return ; } this . bundles = new java . util . ArrayList < Bundle > ( bundles ) ; |
public class EditText { /** * @ return the minimum height of this TextView expressed in pixels , or - 1 if the minimum
* height was set in number of lines instead using { @ link # setMinLines ( int ) or # setLines ( int ) } .
* @ see # setMinHeight ( int )
* @ attr ref android . R . styleable # TextView _ minHeig... | if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . JELLY_BEAN ) return mInputView . getMinHeight ( ) ; return - 1 ; |
public class CmsSitemapView { /** * Performs necessary async actions before actually setting the mode . < p >
* @ param mode the mode */
public void onBeforeSetEditorMode ( final EditorMode mode ) { } } | EditorMode oldMode = m_editorMode ; if ( ( oldMode == EditorMode . categories ) && ( ( mode == EditorMode . vfs ) || ( mode == EditorMode . navigation ) ) ) { final CmsRpcAction < Void > action = new CmsRpcAction < Void > ( ) { @ Override public void execute ( ) { start ( 200 , true ) ; getController ( ) . refreshRoot ... |
public class BidiOrder { /** * Set resultLevels from start up to ( but not including ) limit to newLevel . */
private void setLevels ( int start , int limit , byte newLevel ) { } } | for ( int i = start ; i < limit ; ++ i ) { resultLevels [ i ] = newLevel ; } |
public class CostlessMeldPairingHeap { /** * Cut the oldest child of a node .
* @ param n
* the node
* @ return the oldest child of a node or null */
private Node < K , V > cutOldestChild ( Node < K , V > n ) { } } | Node < K , V > oldestChild = n . o_c ; if ( oldestChild != null ) { if ( oldestChild . y_s != null ) { oldestChild . y_s . o_s = n ; } n . o_c = oldestChild . y_s ; oldestChild . y_s = null ; oldestChild . o_s = null ; } return oldestChild ; |
public class RestoreArgs { /** * Set TTL in { @ code milliseconds } after restoring the key .
* @ param ttl time to live .
* @ return { @ code this } . */
public RestoreArgs ttl ( Duration ttl ) { } } | LettuceAssert . notNull ( ttl , "Time to live must not be null" ) ; return ttl ( ttl . toMillis ( ) ) ; |
public class BigtableSession { /** * Snapshot operations need various aspects of a { @ link BigtableClusterName } . This method gets a
* clusterId from either a lookup ( projectId and instanceId translate to a single clusterId when
* an instance has only one cluster ) . */
public synchronized BigtableClusterName ge... | if ( this . clusterName == null ) { try ( BigtableClusterUtilities util = new BigtableClusterUtilities ( options ) ) { ListClustersResponse clusters = util . getClusters ( ) ; Preconditions . checkState ( clusters . getClustersCount ( ) == 1 , String . format ( "Project '%s' / Instance '%s' has %d clusters. There must ... |
public class RythmEngine { /** * Prepare the render operation environment settings
* @ param codeType
* @ param locale
* @ param usrCtx
* @ return the engine instance itself */
public final RythmEngine prepare ( ICodeType codeType , Locale locale , Map < String , Object > usrCtx ) { } } | renderSettings . init ( codeType ) . init ( locale ) . init ( usrCtx ) ; return this ; |
public class LWJGFont { /** * Draws the paragraph given by the specified string , using this font instance ' s current color . < br >
* if the specified string protrudes from paragraphWidth , protruded substring is auto wrapped with left align . < br >
* Note that the specified destination coordinates is a left poi... | this . drawParagraph ( text , dstX , dstY , dstZ , paragraphWidth , ALIGN . LEGT ) ; |
public class ResolveFileAction { /** * { @ inheritDoc } */
@ Override public void onBaseline ( Collection < File > baseline ) { } } | onChange ( baseline , Collections . < File > emptyList ( ) , Collections . < File > emptyList ( ) ) ; |
public class LazyMultiLoaderWithInclude { /** * Loads the specified ids . */
@ Override public < TResult > Lazy < Map < String , TResult > > load ( Class < TResult > clazz , Collection < String > ids ) { } } | return _session . lazyLoadInternal ( clazz , ids . toArray ( new String [ 0 ] ) , _includes . toArray ( new String [ 0 ] ) , null ) ; |
public class DefaultQueueManager { /** * key对应的队里产生了处理任务
* @ param key
* @ param handleTask */
protected void onQueueHandleTask ( String key , Runnable handleTask ) { } } | KeyGroupEventListener tmp = listener ; if ( tmp != null ) { // 任务抛给监听者
tmp . onQueueHandleTask ( key , handleTask ) ; } |
public class ThriftCLIServiceClient { /** * / * ( non - Javadoc )
* @ see org . apache . hive . service . cli . ICLIService # getColumns ( org . apache . hive . service . cli . SessionHandle ) */
@ Override public OperationHandle getColumns ( SessionHandle sessionHandle , String catalogName , String schemaName , Stri... | try { TGetColumnsReq req = new TGetColumnsReq ( ) ; req . setSessionHandle ( sessionHandle . toTSessionHandle ( ) ) ; req . setCatalogName ( catalogName ) ; req . setSchemaName ( schemaName ) ; req . setTableName ( tableName ) ; req . setColumnName ( columnName ) ; TGetColumnsResp resp = cliService . GetColumns ( req )... |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIRD ( ) { } } | if ( irdEClass == null ) { irdEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 283 ) ; } return irdEClass ; |
public class PropertyDescriptor { /** * Returns true if this property type is applicable to the
* given target type .
* The default implementation of this method checks if the given node type is assignable
* according to the parameterization , but subtypes can extend this to change this behavior .
* @ return
... | Class < ? extends T > applicable = Functions . getTypeParameter ( clazz , getP ( ) , 0 ) ; return applicable . isAssignableFrom ( targetType ) ; |
public class SortableBehavior { /** * Moves the sorting element or helper so the cursor always appears to drag from the
* same position . Coordinates can be given as a hash using a combination of one or two
* keys : { top , left , right , bottom }
* @ param cusorAt
* @ return instance of the current behavior */... | this . options . putLiteral ( "cursorAt" , cusorAt . toString ( ) . toLowerCase ( ) . replace ( '_' , ' ' ) ) ; return this ; |
public class Session { /** * Reads the idToRequest map from a JSON stream
* @ param coronaSerializer The CoronaSerializer instance to be used to
* read the JSON
* @ throws IOException */
private void readIdToRequest ( CoronaSerializer coronaSerializer ) throws IOException { } } | coronaSerializer . readField ( "idToRequest" ) ; // Expecting the START _ OBJECT token for idToRequest
coronaSerializer . readStartObjectToken ( "idToRequest" ) ; JsonToken current = coronaSerializer . nextToken ( ) ; while ( current != JsonToken . END_OBJECT ) { Integer id = Integer . parseInt ( coronaSerializer . get... |
public class UpfrontAllocatingPageSource { /** * Frees the supplied buffer .
* If the given buffer was not allocated by this source or has already been
* freed then an { @ code AssertionError } is thrown . */
@ Override public synchronized void free ( Page page ) { } } | if ( page . isFreeable ( ) ) { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Freeing a {}B buffer from chunk {} &{}" , DebuggingUtils . toBase2SuffixedString ( page . size ( ) ) , page . index ( ) , page . address ( ) ) ; } markAllAvailable ( ) ; sliceAllocators . get ( page . index ( ) ) . free ( page . addre... |
public class LabAccountsInner { /** * List lab accounts in a subscription .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList & lt ; LabAccountInner & gt ; object */
public Observable < Page < LabAccountInner > > listAsync ( ) { } } | return listWithServiceResponseAsync ( ) . map ( new Func1 < ServiceResponse < Page < LabAccountInner > > , Page < LabAccountInner > > ( ) { @ Override public Page < LabAccountInner > call ( ServiceResponse < Page < LabAccountInner > > response ) { return response . body ( ) ; } } ) ; |
public class Object2ObjectHashMap { /** * { @ inheritDoc } */
public V remove ( final Object key ) { } } | final Object [ ] entries = this . entries ; final int mask = entries . length - 1 ; int keyIndex = Hashing . evenHash ( key . hashCode ( ) , mask ) ; Object oldValue = null ; while ( entries [ keyIndex + 1 ] != null ) { if ( entries [ keyIndex ] == key || entries [ keyIndex ] . equals ( key ) ) { oldValue = entries [ k... |
public class CustomRuleMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CustomRule customRule , ProtocolMarshaller protocolMarshaller ) { } } | if ( customRule == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( customRule . getSource ( ) , SOURCE_BINDING ) ; protocolMarshaller . marshall ( customRule . getTarget ( ) , TARGET_BINDING ) ; protocolMarshaller . marshall ( customRule . g... |
public class DescribeSigningJobResult { /** * Map of user - assigned key - value pairs used during signing . These values contain any information that you specified
* for use in your signing job .
* @ param signingParameters
* Map of user - assigned key - value pairs used during signing . These values contain any... | setSigningParameters ( signingParameters ) ; return this ; |
public class XMLChecker { /** * Checks if the specified string matches the < em > PubidLiteral < / em > production .
* See : < a href = " http : / / www . w3 . org / TR / REC - xml # NT - PubidLiteral " > Definition of PubidLiteral < / a > .
* @ param s the character string to check , cannot be < code > null < / co... | checkPubidLiteral ( s . toCharArray ( ) , 0 , s . length ( ) ) ; |
public class HeapUpdateDoublesSketch { /** * Obtains a new on - heap instance of a DoublesSketch .
* @ param k Parameter that controls space usage of sketch and accuracy of estimates .
* Must be greater than 1 and less than 65536 and a power of 2.
* @ return a HeapUpdateDoublesSketch */
static HeapUpdateDoublesSk... | final HeapUpdateDoublesSketch hqs = new HeapUpdateDoublesSketch ( k ) ; final int baseBufAlloc = 2 * Math . min ( DoublesSketch . MIN_K , k ) ; // the min is important
hqs . n_ = 0 ; hqs . combinedBuffer_ = new double [ baseBufAlloc ] ; hqs . baseBufferCount_ = 0 ; hqs . bitPattern_ = 0 ; hqs . minValue_ = Double . NaN... |
public class StoringLocalLogs { /** * Add a new log entry to the local storage .
* @ param logType the log type to store
* @ param entry the entry to store */
@ Override public void addEntry ( String logType , LogEntry entry ) { } } | if ( ! logTypesToInclude . contains ( logType ) ) { return ; } if ( ! localLogs . containsKey ( logType ) ) { List < LogEntry > entries = new ArrayList < > ( ) ; entries . add ( entry ) ; localLogs . put ( logType , entries ) ; } else { localLogs . get ( logType ) . add ( entry ) ; } |
public class Version { /** * Compares this version to the other version .
* This method does not take into account the versions ' build
* metadata . If you want to compare the versions ' build metadata
* use the { @ code Version . compareWithBuildsTo } method or the
* { @ code Version . BUILD _ AWARE _ ORDER } ... | int result = normal . compareTo ( other . normal ) ; if ( result == 0 ) { result = preRelease . compareTo ( other . preRelease ) ; } return result ; |
public class StaticLog { /** * Error等级日志 < br >
* 由于动态获取Log , 效率较低 , 建议在非频繁调用的情况下使用 ! !
* @ param e 需在日志中堆栈打印的异常
* @ param format 格式文本 , { } 代表变量
* @ param arguments 变量对应的参数 */
public static void error ( Throwable e , String format , Object ... arguments ) { } } | error ( LogFactory . indirectGet ( ) , e , format , arguments ) ; |
public class ServiceHandler { /** * Get TopologyInfo , it contain all topology running data
* @ return TopologyInfo */
@ Override public TopologyInfo getTopologyInfo ( String topologyId ) throws TException { } } | long start = System . nanoTime ( ) ; StormClusterState stormClusterState = data . getStormClusterState ( ) ; try { // get topology ' s StormBase
StormBase base = stormClusterState . storm_base ( topologyId , null ) ; if ( base == null ) { throw new NotAliveException ( "No topology of " + topologyId ) ; } Assignment ass... |
public class FixedLengthDecodingState { /** * { @ inheritDoc } */
@ Override public DecodingState finishDecode ( ProtocolDecoderOutput out ) throws Exception { } } | IoBufferEx readData ; if ( buffer == null ) { readData = allocator . wrap ( allocator . allocate ( 0 ) ) ; } else { buffer . flip ( ) ; readData = buffer ; buffer = null ; } return finishDecode ( ( IoBuffer ) readData , out ) ; |
public class AnnotationUtils { /** * Get the annotation metadata for the given element .
* @ param element The element
* @ return The { @ link AnnotationMetadata } */
public AnnotationMetadata getAnnotationMetadata ( Element element ) { } } | AnnotationMetadata metadata = annotationMetadataCache . get ( element ) ; if ( metadata == null ) { metadata = newAnnotationBuilder ( ) . build ( element ) ; annotationMetadataCache . put ( element , metadata ) ; } return metadata ; |
public class CoFeedbackTransformation { /** * Adds a feedback edge . The parallelism of the { @ code StreamTransformation } must match
* the parallelism of the input { @ code StreamTransformation } of the upstream
* { @ code StreamTransformation } .
* @ param transform The new feedback { @ code StreamTransformati... | if ( transform . getParallelism ( ) != this . getParallelism ( ) ) { throw new UnsupportedOperationException ( "Parallelism of the feedback stream must match the parallelism of the original" + " stream. Parallelism of original stream: " + this . getParallelism ( ) + "; parallelism of feedback stream: " + transform . ge... |
public class GroovyScriptEngine { /** * Initialize a new GroovyClassLoader with a default or
* constructor - supplied parentClassLoader .
* @ return the parent classloader used to load scripts */
private GroovyClassLoader initGroovyLoader ( ) { } } | return ( GroovyClassLoader ) AccessController . doPrivileged ( new PrivilegedAction ( ) { public Object run ( ) { if ( parentLoader instanceof GroovyClassLoader ) { return new ScriptClassLoader ( ( GroovyClassLoader ) parentLoader ) ; } else { return new ScriptClassLoader ( parentLoader , config ) ; } } } ) ; |
public class GBSInsertFringe { /** * Balance a fringe following the addition of its final node .
* @ param kFactor The K factor for the tree .
* @ param stack The stack of nodes through which the insert operation
* passed .
* @ param fpoint The fringe balance point ( the top of the fringe ) .
* @ param fpidx ... | /* Get parent of balance point */
GBSNode bparent = stack . node ( fpidx - 1 ) ; switch ( kFactor ) { case 2 : balance2 ( stack , bparent , fpoint , fpidx , maxBal ) ; break ; case 4 : balance4 ( stack , bparent , fpoint , fpidx , maxBal ) ; break ; case 6 : balance6 ( stack , bparent , fpoint , fpidx , maxBal ) ; brea... |
public class DescendantAxis { /** * { @ inheritDoc } */
@ Override public boolean hasNext ( ) { } } | resetToLastKey ( ) ; // Fail if there is no node anymore .
if ( mNextKey == NULL_NODE ) { resetToStartKey ( ) ; return false ; } moveTo ( mNextKey ) ; // Fail if the subtree is finished .
if ( ( ( ITreeStructData ) getNode ( ) ) . getLeftSiblingKey ( ) == getStartKey ( ) ) { resetToStartKey ( ) ; return false ; } // Al... |
public class MultiVertexGeometryImpl { /** * Checked vs . Jan 11 , 2011 */
int QueryCoordinates ( Point3D [ ] dst , int dstSize , int beginIndex , int endIndex ) { } } | int endIndexC = endIndex < 0 ? m_pointCount : endIndex ; endIndexC = Math . min ( endIndexC , beginIndex + dstSize ) ; if ( beginIndex < 0 || beginIndex >= m_pointCount || endIndexC < beginIndex ) // TODO replace geometry exc
throw new IllegalArgumentException ( ) ; AttributeStreamOfDbl xy = ( AttributeStreamOfDbl ) ge... |
public class MoreWindows { /** * Performs an action . */
@ Override public void actionPerformed ( ActionEvent e ) { } } | String cmd = e . getActionCommand ( ) ; if ( cmd . equals ( "Cancel" ) ) { setVisible ( false ) ; value = null ; } else if ( cmd . equals ( "Select" ) ) { value = list . getSelectedValue ( ) ; setVisible ( false ) ; swingGui . showFileWindow ( value , - 1 ) ; } |
public class DatasetSnippets { /** * [ TARGET list ( TableListOption . . . ) ] */
public Page < Table > list ( ) { } } | // [ START ]
Page < Table > tables = dataset . list ( ) ; for ( Table table : tables . iterateAll ( ) ) { // do something with the table
} // [ END ]
return tables ; |
public class ElytronExtension { /** * Gets whether the given { @ code resourceRegistration } is for a server , or if not ,
* is not for a resource in the { @ code profile } resource tree . */
static boolean isServerOrHostController ( ImmutableManagementResourceRegistration resourceRegistration ) { } } | return resourceRegistration . getProcessType ( ) . isServer ( ) || ! ModelDescriptionConstants . PROFILE . equals ( resourceRegistration . getPathAddress ( ) . getElement ( 0 ) . getKey ( ) ) ; |
public class ST_Azimuth { /** * This code compute the angle in radian as postgis does .
* @ author : Jose Martinez - Llario from JASPA . JAva SPAtial for SQL
* @ param pointA
* @ param pointB
* @ return */
public static Double azimuth ( Geometry pointA , Geometry pointB ) { } } | if ( pointA == null || pointB == null ) { return null ; } if ( ( pointA instanceof Point ) && ( pointB instanceof Point ) ) { Double angle ; double x0 = ( ( Point ) pointA ) . getX ( ) ; double y0 = ( ( Point ) pointA ) . getY ( ) ; double x1 = ( ( Point ) pointB ) . getX ( ) ; double y1 = ( ( Point ) pointB ) . getY (... |
public class TypeUtils { /** * Wrap the specified { @ link Type } in a { @ link Typed } wrapper .
* @ param < T > inferred generic type
* @ param type to wrap
* @ return Typed & lt ; T & gt ;
* @ since 3.2 */
public static < T > Typed < T > wrap ( final Type type ) { } } | return new Typed < T > ( ) { @ Override public Type getType ( ) { return type ; } } ; |
public class InternalSARLParser { /** * InternalSARL . g : 16872:1 : ruleQualifiedNameInStaticImport returns [ AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken ( ) ] : ( this _ ValidID _ 0 = ruleValidID kw = ' . ' ) + ; */
public final AntlrDatatypeRuleToken ruleQualifiedNameInStaticImport ( ) throws Recogni... | AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken ( ) ; Token kw = null ; AntlrDatatypeRuleToken this_ValidID_0 = null ; enterRule ( ) ; try { // InternalSARL . g : 16878:2 : ( ( this _ ValidID _ 0 = ruleValidID kw = ' . ' ) + )
// InternalSARL . g : 16879:2 : ( this _ ValidID _ 0 = ruleValidID kw = ' . ' ) +... |
public class GroupDeviceElement { /** * Dump element */
@ Override void dump_i ( final int indent_level ) { } } | for ( int i = 0 ; i < indent_level ; i ++ ) { System . out . print ( " " ) ; } System . out . println ( "`-> Device: " + get_name ( ) ) ; |
public class GridBy { /** * Creates an XPath expression - segment that will find a row , selecting the row based on the
* text in a specific column .
* @ param selectIndex index of the column to find value in ( usually obtained via { @ link # getXPathForColumnIndex ( String ) } ) .
* @ param value text to find in... | return String . format ( "/tr[td[%1$s]/descendant-or-self::text()[normalized(.)='%2$s']]" , selectIndex , value ) ; |
public class Bbox { /** * Computes the intersection of this bounding box with the specified bounding box .
* @ param other
* Another Bbox .
* @ return bounding box of intersection or null if they do not intersect . */
public Bbox intersection ( Bbox other ) { } } | if ( ! this . intersects ( other ) ) { return null ; } else { double minx = other . getX ( ) > this . getX ( ) ? other . getX ( ) : this . getX ( ) ; double maxx = other . getEndPoint ( ) . getX ( ) < this . getEndPoint ( ) . getX ( ) ? other . getEndPoint ( ) . getX ( ) : this . getEndPoint ( ) . getX ( ) ; double min... |
public class PieChart { /** * This is called during layout when the size of this view has changed . If
* you were just added to the view hierarchy , you ' re called with the old
* values of 0.
* @ param w Current width of this view .
* @ param h Current height of this view .
* @ param oldw Old width of this v... | super . onSizeChanged ( w , h , oldw , oldh ) ; mGraph . setPivot ( mGraphBounds . centerX ( ) , mGraphBounds . centerY ( ) ) ; onDataChanged ( ) ; |
public class CmsGwtService { /** * Clears the objects stored in thread local . < p > */
protected void clearThreadStorage ( ) { } } | if ( m_perThreadCmsObject != null ) { m_perThreadCmsObject . remove ( ) ; } if ( perThreadRequest != null ) { perThreadRequest . remove ( ) ; } if ( perThreadResponse != null ) { perThreadResponse . remove ( ) ; } |
public class Metadata { /** * Get a value from a multiselect metadata field .
* @ param path the key path in the metadata object . Must be prefixed with a " / " .
* @ return the list of values set in the field . */
public List < String > getMultiSelect ( String path ) { } } | List < String > values = new ArrayList < String > ( ) ; for ( JsonValue val : this . getValue ( path ) . asArray ( ) ) { values . add ( val . asString ( ) ) ; } return values ; |
public class BeanCopier { /** * Map转Bean属性拷贝
* @ param map Map
* @ param bean Bean */
private void mapToBean ( Map < ? , ? > map , Object bean ) { } } | valueProviderToBean ( new MapValueProvider ( map , this . copyOptions . ignoreCase ) , bean ) ; |
public class XSynchronizedExpressionImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setExpression ( XExpression newExpression ) { } } | if ( newExpression != expression ) { NotificationChain msgs = null ; if ( expression != null ) msgs = ( ( InternalEObject ) expression ) . eInverseRemove ( this , EOPPOSITE_FEATURE_BASE - XbasePackage . XSYNCHRONIZED_EXPRESSION__EXPRESSION , null , msgs ) ; if ( newExpression != null ) msgs = ( ( InternalEObject ) newE... |
public class InjectionBinding { /** * d730349.1 */
void metadataProcessingInitialize ( ComponentNameSpaceConfiguration nameSpaceConfig ) { } } | ivContext = ( InjectionProcessorContext ) nameSpaceConfig . getInjectionProcessorContext ( ) ; ivNameSpaceConfig = nameSpaceConfig ; // Following must be available after ivContext and ivNameSpaceConfig are cleared
ivCheckAppConfig = nameSpaceConfig . isCheckApplicationConfiguration ( ) ; |
public class HttpUtil { /** * 下载远程文本
* @ param url 请求的url
* @ param customCharset 自定义的字符集 , 可以使用 { @ link CharsetUtil # charset } 方法转换
* @ param streamPress 进度条 { @ link StreamProgress }
* @ return 文本 */
public static String downloadString ( String url , Charset customCharset , StreamProgress streamPress ) { } ... | if ( StrUtil . isBlank ( url ) ) { throw new NullPointerException ( "[url] is null!" ) ; } FastByteArrayOutputStream out = new FastByteArrayOutputStream ( ) ; download ( url , out , true , streamPress ) ; return null == customCharset ? out . toString ( ) : out . toString ( customCharset ) ; |
public class ArrayUtil { /** * Fills the array with a value . */
public static void fillArray ( Object [ ] array , Object value ) { } } | int to = array . length ; while ( -- to >= 0 ) { array [ to ] = value ; } |
public class EntityCapsManager { /** * Returns true if Entity Caps are supported by a given JID .
* @ param jid
* @ return true if the entity supports Entity Capabilities .
* @ throws XMPPErrorException
* @ throws NoResponseException
* @ throws NotConnectedException
* @ throws InterruptedException */
public... | return sdm . supportsFeature ( jid , NAMESPACE ) ; |
public class ProjectStatusesBase { /** * Deletes a specific , existing project status update .
* Returns an empty data record .
* @ param projectStatus The project status update to delete .
* @ return Request object */
public ItemRequest < ProjectStatus > delete ( String projectStatus ) { } } | String path = String . format ( "/project_statuses/%s" , projectStatus ) ; return new ItemRequest < ProjectStatus > ( this , ProjectStatus . class , path , "DELETE" ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.