signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Cursor { /** * Synchronized . Move the cursor down to the next entry
* in the list and return it .
* @ return The next entry in the list , or null if there is no next entry . */
public synchronized Entry next ( ) { } } | if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "next" ) ; // can only do anything if the cursor is still pointing in to a list
checkEntryParent ( ) ; Entry nextEntry = null ; synchronized ( parentList ) { // get the next entry in the list
nextEntry = getNextEntry ( ) ; // if the next entry is null
if ( nextEntry =... |
public class ConfigurationUtils { /** * Returns an instance of { @ link AlluxioConfiguration } with the defaults and values from
* alluxio - site properties .
* @ return the set of Alluxio properties loaded from the site - properties file */
public static AlluxioProperties defaults ( ) { } } | if ( sDefaultProperties == null ) { synchronized ( DEFAULT_PROPERTIES_LOCK ) { // We don ' t want multiple threads to reload
// properties at the same time .
// Check if properties are still null so we don ' t reload a second time .
if ( sDefaultProperties == null ) { reloadProperties ( ) ; } } } return sDefaultPropert... |
public class ReflectionUtils { /** * < p > getAllFields . < / p >
* @ param type a { @ link java . lang . Class } object .
* @ return a { @ link java . util . List } object . */
public static List < Field > getAllFields ( Class < ? > type ) { } } | List < Field > fields = new ArrayList < > ( ) ; for ( Class < ? > currentType = type ; currentType != null ; currentType = currentType . getSuperclass ( ) ) { fields . addAll ( Arrays . asList ( currentType . getDeclaredFields ( ) ) ) ; } return fields ; |
public class AnimaQuery { /** * Build a delete statement .
* @ param model model instance
* @ param < S >
* @ return delete sql */
private < S extends Model > String buildDeleteSQL ( S model ) { } } | SQLParams sqlParams = SQLParams . builder ( ) . model ( model ) . modelClass ( this . modelClass ) . tableName ( this . tableName ) . pkName ( this . primaryKeyColumn ) . conditionSQL ( this . conditionSQL ) . build ( ) ; return Anima . of ( ) . dialect ( ) . delete ( sqlParams ) ; |
public class CmsXmlSitemapGenerator { /** * Gets the list of pages which should be directly added to the XML sitemap . < p >
* @ return the list of resources which should be directly added to the XML sitemap
* @ throws CmsException if something goes wrong */
protected List < CmsResource > getDirectPages ( ) throws ... | List < CmsResource > result = new ArrayList < CmsResource > ( ) ; result . addAll ( getNavigationPages ( ) ) ; Set < String > includeRoots = m_includeExcludeSet . getIncludeRoots ( ) ; for ( String includeRoot : includeRoots ) { try { CmsResource resource = m_guestCms . readResource ( includeRoot ) ; if ( resource . is... |
public class EConv { /** * / * rb _ econv _ convert0 */
private EConvResult convertInternal ( byte [ ] in , Ptr inPtr , int inStop , byte [ ] out , Ptr outPtr , int outStop , int flags ) { } } | lastError . reset ( ) ; EConvResult res ; int len ; if ( numTranscoders == 0 ) { if ( inBuf . bytes != null && inBuf . dataStart != inBuf . dataEnd ) { if ( outStop - outPtr . p < inBuf . dataEnd - inBuf . dataStart ) { len = outStop - outPtr . p ; System . arraycopy ( inBuf . bytes , inBuf . dataStart , out , outPtr .... |
public class CommandMarshaller { /** * Marshall the given parameter object . */
public void marshall ( Command command , ProtocolMarshaller protocolMarshaller ) { } } | if ( command == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( command . getCommandId ( ) , COMMANDID_BINDING ) ; protocolMarshaller . marshall ( command . getDocumentName ( ) , DOCUMENTNAME_BINDING ) ; protocolMarshaller . marshall ( comma... |
public class BusHolder { /** * Update the Bus held by the this instance using the provided parameters .
* This basically prepares the bus for being used with JBossWS .
* @ param resolver The ResourceResolver to configure , if any
* @ param configurer The JBossWSCXFConfigurer to install in the bus , if any
* @ p... | if ( configured ) { throw Messages . MESSAGES . busAlreadyConfigured ( bus ) ; } bus . setProperty ( org . jboss . wsf . stack . cxf . client . Constants . DEPLOYMENT_BUS , true ) ; busHolderListener = new BusHolderLifeCycleListener ( ) ; bus . getExtension ( BusLifeCycleManager . class ) . registerLifeCycleListener ( ... |
public class Instant { /** * Returns a copy of this instant with the specified duration added .
* This instance is immutable and unaffected by this method call .
* @ param secondsToAdd the seconds to add , positive or negative
* @ param nanosToAdd the nanos to add , positive or negative
* @ return an { @ code I... | if ( ( secondsToAdd | nanosToAdd ) == 0 ) { return this ; } long epochSec = Jdk8Methods . safeAdd ( seconds , secondsToAdd ) ; epochSec = Jdk8Methods . safeAdd ( epochSec , nanosToAdd / NANOS_PER_SECOND ) ; nanosToAdd = nanosToAdd % NANOS_PER_SECOND ; long nanoAdjustment = nanos + nanosToAdd ; // safe int + NANOS _ PER... |
public class Currency { /** * Returns a Currency instance for the given currency code . */
public static Currency getInstance ( String currencyCode ) { } } | Currency currency = getInstanceNoCreate ( currencyCode . toUpperCase ( ) ) ; if ( currency == null ) { return createCurrency ( currencyCode . toUpperCase ( ) , null , null ) ; } else { return currency ; } |
public class ManagementClient { /** * Deletes the subscription described by the topicPath and the subscriptionName .
* @ param topicPath - The name of the topic .
* @ param subscriptionName - The name of the subscription .
* @ throws IllegalArgumentException - path is not null / empty / too long / invalid .
* @... | return Utils . completeFuture ( this . asyncClient . deleteSubscriptionAsync ( topicPath , subscriptionName ) ) ; |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIfcTorqueMeasure ( ) { } } | if ( ifcTorqueMeasureEClass == null ) { ifcTorqueMeasureEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 757 ) ; } return ifcTorqueMeasureEClass ; |
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public IfcDistributionChamberElementTypeEnum createIfcDistributionChamberElementTypeEnumFromString ( EDataType eDataType , String initialValue ) { } } | IfcDistributionChamberElementTypeEnum result = IfcDistributionChamberElementTypeEnum . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class Headers { /** * / * - - - - - [ Remove ] - - - - - */
public Header remove ( AsciiString name ) { } } | if ( name == null || first == null ) return null ; Header h = null ; int idx = name . hashCode ( ) & ( table . length - 1 ) ; Object obj = table [ idx ] ; if ( obj == null ) return null ; else if ( obj instanceof Header ) { Header header = ( Header ) obj ; if ( header . name . equals ( name ) ) { table [ idx ] = null ;... |
public class ProviGenProvider { /** * Creates a table in the database for the specified { @ link Contract } . < br / >
* This may be used if you ' re < b > not < / b > calling { @ code super . onCreateDatabase ( database ) } .
* @ param database The database .
* @ param contractClass A { @ link Contract } class t... | try { openHelper . createTable ( database , new ContractHolder ( contractClass ) ) ; } catch ( InvalidContractException exception ) { exception . printStackTrace ( ) ; } |
public class ResponseImpl { /** * This method gets the Content - Length of the response body .
* @ return The content length of the response . */
public long getContentLength ( ) { } } | try { return getInternalResponse ( ) . body ( ) . contentLength ( ) ; } catch ( NullPointerException e ) { logger . error ( "Failed to get the response content length from " + getRequestURL ( ) + ". Error: " + e . getMessage ( ) ) ; return 0 ; } |
public class LpSolve { /** * Register an < code > LogListener < / code > for callback .
* @ param listener the listener that should be called by lp _ solve
* @ param userhandle an arbitrary object that is passed to the listener on call */
public void putLogfunc ( LogListener listener , Object userhandle ) throws Lp... | logListener = listener ; logUserhandle = ( listener != null ) ? userhandle : null ; addLp ( this ) ; registerLogfunc ( ) ; |
public class SessionBuilder { /** * Adds a contact point to use for the initial connection to the cluster .
* < p > You only need this method if you use a custom { @ link EndPoint } implementation . Otherwise ,
* use { @ link # addContactPoint ( InetSocketAddress ) } . */
@ NonNull public SelfT addContactEndPoint (... | this . programmaticContactPoints . add ( contactPoint ) ; return self ; |
public class AbstractMinMaxTextBox { /** * set distance value should be increased / decreased when using up / down buttons .
* @ param pstep step distance */
public void setStep ( final Integer pstep ) { } } | if ( pstep == null ) { getInputElement ( ) . removeAttribute ( "step" ) ; } else { getInputElement ( ) . setStep ( pstep . toString ( ) ) ; } |
public class Node { /** * Convenience method for writeXml ( node , true ) ; */
public T writeXml ( org . w3c . dom . Node node ) throws IOException { } } | return ( T ) writeXml ( node , true ) ; |
public class CudaZeroHandler { /** * Asynchronous version of memcpy
* PLEASE NOTE : This is device - dependent method , if it ' s not supported in your environment , blocking call will be used instead .
* @ param dstBuffer
* @ param srcPointer
* @ param length
* @ param dstOffset */
@ Override public void mem... | AllocationPoint point = ( ( BaseCudaDataBuffer ) dstBuffer ) . getAllocationPoint ( ) ; // we update host memory regardless .
// Pointer dP = new Pointer ( ( point . getAllocationStatus ( ) = = AllocationStatus . DEVICE ? point . getPointers ( ) . getDevicePointer ( ) . address ( ) : point . getPointers ( ) . getHostPo... |
public class AbstractCurrencyConversion { /** * Optionally rounds the factor to be used . By default this method will only round
* as much as it is needed , so the factor can be handled by the target amount instance based on its
* numeric capabilities . Rounding is applied only if { @ code amount . getContext ( ) .... | if ( amount . getContext ( ) . getMaxScale ( ) > 0 ) { MathContext mathContext = amount . getContext ( ) . get ( MathContext . class ) ; if ( mathContext == null ) { int scale = factor . getScale ( ) ; if ( factor . getScale ( ) > amount . getContext ( ) . getMaxScale ( ) ) { scale = amount . getContext ( ) . getMaxSca... |
public class FileUtils { /** * Asserts that the given file exists .
* @ param path the { @ link File } to assert for existence .
* @ return a reference back to the file .
* @ throws java . io . FileNotFoundException if the file does not exist .
* @ see # isExisting ( File ) */
@ NullSafe public static File asse... | if ( isExisting ( path ) ) { return path ; } throw new FileNotFoundException ( String . format ( "[%1$s] was not found" , path ) ) ; |
public class AWSCodeCommitClient { /** * Creates a commit for a repository on the tip of a specified branch .
* @ param createCommitRequest
* @ return Result of the CreateCommit operation returned by the service .
* @ throws RepositoryNameRequiredException
* A repository name is required but was not specified .... | request = beforeClientExecution ( request ) ; return executeCreateCommit ( request ) ; |
public class ImmutableBiMap { /** * Returns an immutable bimap containing the given entries .
* @ throws IllegalArgumentException if two keys have the same value or two
* values have the same key
* @ throws NullPointerException if any key , value , or entry is null
* @ since 19.0 */
@ Beta public static < K , V... | Entry < ? , ? > [ ] entryArray = Iterables . toArray ( entries , EMPTY_ENTRY_ARRAY ) ; switch ( entryArray . length ) { case 0 : return of ( ) ; case 1 : @ SuppressWarnings ( "unchecked" ) // safe covariant cast in this context
Entry < K , V > entry = ( Entry < K , V > ) entryArray [ 0 ] ; return of ( entry . getKey ( ... |
public class JesqueUtils { /** * Join the given strings , separated by the given separator .
* @ param sep
* the separator
* @ param strs
* the strings to join
* @ return the joined string */
public static String join ( final String sep , final Iterable < String > strs ) { } } | final StringBuilder buf = new StringBuilder ( ) ; String prefix = "" ; for ( final String str : strs ) { buf . append ( prefix ) . append ( str ) ; prefix = sep ; } return buf . toString ( ) ; |
public class TransliteratorRegistry { /** * Register an ID and a Transliterator object . This adds an entry
* to the dynamic store , or replaces an existing entry . Any entry
* in the underlying static locale resource store is masked . */
public void put ( String ID , Transliterator trans , boolean visible ) { } } | registerEntry ( ID , trans , visible ) ; |
public class Ifc4FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public IfcMechanicalFastenerTypeEnum createIfcMechanicalFastenerTypeEnumFromString ( EDataType eDataType , String initialValue ) { } } | IfcMechanicalFastenerTypeEnum result = IfcMechanicalFastenerTypeEnum . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class MongodbQueryBuilderFactory { /** * 获取builder
* @ return */
public MongodbBuilder builder ( ) { } } | List < IRuleParser > mongodbRuleParsers = new ArrayList < > ( ) ; for ( IRuleParser parser : ruleParsers ) { if ( parser instanceof AbstractMongodbRuleParser ) { mongodbRuleParsers . add ( parser ) ; } } return new MongodbBuilder ( groupParser , mongodbRuleParsers , filters ) ; |
public class StringMan { /** * Takes an array of Strings with integer values and returns an array of ints , or throws a
* { @ link NumberFormatException } if there ' s a problem . */
public static int [ ] parseInts ( String [ ] array ) { } } | int [ ] result = new int [ array . length ] ; for ( int i = 0 ; i < array . length ; i ++ ) result [ i ] = Integer . parseInt ( array [ i ] ) ; return result ; |
public class Roaring64NavigableMap { /** * Returns the number of distinct integers added to the bitmap ( e . g . , number of bits set ) .
* @ return the cardinality */
@ Override public long getLongCardinality ( ) { } } | if ( doCacheCardinalities ) { if ( highToBitmap . isEmpty ( ) ) { return 0L ; } int indexOk = ensureCumulatives ( highestHigh ( ) ) ; // ensureCumulatives may have removed empty bitmaps
if ( highToBitmap . isEmpty ( ) ) { return 0L ; } return sortedCumulatedCardinality [ indexOk - 1 ] ; } else { long cardinality = 0L ;... |
public class DocVectorModel { /** * 查询最相似的前10个文档
* @ param query 查询语句 ( 或者说一个文档的内容 )
* @ return */
public List < Map . Entry < Integer , Float > > nearest ( String query ) { } } | return queryNearest ( query , 10 ) ; |
public class HtmlTable { /** * Conveniently allows column implementations to lookup cells inside a column without
* duplicating the effort to come up with xpath for each column ' s cells . Simply use this method
* with that column ' s index .
* @ return A locator that finds a cell based on a row and column index ... | if ( rowIndex < 1 ) { throw new IllegalArgumentException ( "Row index must be greater than 0." ) ; } if ( colIndex < 1 ) { throw new IllegalArgumentException ( "Column index must be greater than 0." ) ; } String xpath = bodyTag . isPresent ( ) ? "./tbody/tr[" + rowIndex + "]/td[" + colIndex + "]" : "./tr[" + rowIndex +... |
public class Util { /** * Returns a thread safe counter map
* @ return */
public static < K , V > CounterMap < K , V > parallelCounterMap ( ) { } } | CounterMap < K , V > totalWords = new CounterMap < > ( ) ; return totalWords ; |
public class LongHashMap { /** * Initializes object to be an empty map with the specified initial
* capacity , which is assumed to be a power of two between
* MINIMUM _ CAPACITY and MAXIMUM _ CAPACITY inclusive . */
private void init ( int initCapacity ) { } } | assert ( initCapacity & - initCapacity ) == initCapacity ; // power of 2
assert initCapacity >= MINIMUM_CAPACITY ; assert initCapacity <= MAXIMUM_CAPACITY ; threshold = ( initCapacity * 3 ) / 4 ; table = new long [ 2 * initCapacity ] ; |
public class ObjectReferenceMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ObjectReference objectReference , ProtocolMarshaller protocolMarshaller ) { } } | if ( objectReference == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( objectReference . getSelector ( ) , SELECTOR_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage... |
public class DescribeLoadBalancersRequest { /** * The Amazon Resource Names ( ARN ) of the load balancers . You can specify up to 20 load balancers in a single call .
* @ param loadBalancerArns
* The Amazon Resource Names ( ARN ) of the load balancers . You can specify up to 20 load balancers in a single
* call .... | if ( loadBalancerArns == null ) { this . loadBalancerArns = null ; return ; } this . loadBalancerArns = new java . util . ArrayList < String > ( loadBalancerArns ) ; |
public class SortHelper { /** * Creates a comparator for the { @ link InputColumn } based on its type
* ( sorting numerically or lexicographically ) .
* @ param column
* the column to sort on
* @ param columnIndex
* the index of the column in the input { @ link Row }
* @ return the comparator instance */
pu... | final Class < ? > dataType = column . getDataType ( ) ; final boolean isNumber = dataType != null && ReflectionUtils . isNumber ( dataType ) ; final boolean isDate = dataType != null && ReflectionUtils . isDate ( dataType ) ; return ( row1 , row2 ) -> { final Comparable < ? > value1 = getComparableValue ( row1 , column... |
public class RequestCreator { /** * Asynchronously fulfills the request into the specified { @ link RemoteViews } object with the
* given { @ code viewId } . This is used for loading bitmaps into all instances of a widget . */
public void into ( @ NonNull RemoteViews remoteViews , @ IdRes int viewId , int appWidgetId... | into ( remoteViews , viewId , new int [ ] { appWidgetId } , null ) ; |
public class InternalPage { /** * Returns unsafe binary search index .
* @ return index ( non - negative or - 1 which means that nothing was found ) */
protected static int binarySearchGuessUnsafe ( @ NotNull final BasePage page , @ NotNull final ByteIterable key ) { } } | int index = page . binarySearch ( key ) ; if ( index < 0 ) { index = - index - 2 ; } return index ; |
public class UIInput { /** * A boolean value that indicates whether an input value is required .
* If this value is true and no input value is provided by a postback operation , then the " requiredMessage " text is
* registered as a FacesMessage for the request , and validation fails .
* Default value : false . *... | return ( Boolean ) getStateHelper ( ) . eval ( PropertyKeys . required , Boolean . FALSE ) ; |
public class SecurityContextProviderImpl { /** * { @ inheritDoc } */
@ Override public ThreadContext createDefaultThreadContext ( Map < String , String > execProps ) { } } | return new SecurityContextImpl ( false , null ) ; |
public class ApiOvhMe { /** * Get this object properties
* REST : GET / me / api / application / { applicationId }
* @ param applicationId [ required ] */
public OvhApplication api_application_applicationId_GET ( Long applicationId ) throws IOException { } } | String qPath = "/me/api/application/{applicationId}" ; StringBuilder sb = path ( qPath , applicationId ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhApplication . class ) ; |
public class DashboardResources { /** * Return all dashboard objects filtered by owner .
* @ param dashboardName The dashboard name filter .
* @ param owner The principlaUser owner for owner name filter .
* @ parampopulateMetaFieldsOnlyThe flag to determine if only meta fields should be populated .
* @ param ve... | List < Dashboard > result = new ArrayList < > ( ) ; if ( dashboardName != null && ! dashboardName . isEmpty ( ) ) { Dashboard dashboard = dService . findDashboardByNameAndOwner ( dashboardName , owner ) ; if ( dashboard == null ) { throw new WebApplicationException ( Response . Status . NOT_FOUND . getReasonPhrase ( ) ... |
public class ReflectionInterface { /** * Get the info for the specified method .
* @ param methodName
* The method name
* @ return The Method object
* @ throws FlickrException */
public Method getMethodInfo ( String methodName ) throws FlickrException { } } | Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_METHOD_INFO ) ; parameters . put ( "method_name" , methodName ) ; Response response = transport . get ( transport . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isError ( ) ) { thr... |
public class AudienceSegment { /** * Gets the dataProvider value for this AudienceSegment .
* @ return dataProvider * Owner data provider of this segment . This attribute is readonly
* and is assigned by Google . */
public com . google . api . ads . admanager . axis . v201811 . AudienceSegmentDataProvider getDataPr... | return dataProvider ; |
public class RepositoryApi { /** * Get an archive of the complete repository by SHA ( optional ) and saves to the specified directory .
* If the archive already exists in the directory it will be overwritten .
* < pre > < code > GitLab Endpoint : GET / projects / : id / repository / archive < / code > < / pre >
*... | if ( format == null ) { format = ArchiveFormat . TAR_GZ ; } /* * Gitlab - ce has a bug when you try to download file archives with format by using " & format = zip ( or tar . . . etc . ) " ,
* there is a solution to request . . . / archive . : format instead of . . . / archive ? format = : format .
* Issue : https ... |
public class ExpressRouteCrossConnectionsInner { /** * Gets the route table summary associated with the express route cross connection in a resource group .
* @ param resourceGroupName The name of the resource group .
* @ param crossConnectionName The name of the ExpressRouteCrossConnection .
* @ param peeringNam... | return ServiceFuture . fromResponse ( beginListRoutesTableSummaryWithServiceResponseAsync ( resourceGroupName , crossConnectionName , peeringName , devicePath ) , serviceCallback ) ; |
public class FileConsumer { /** * Push message through pipe
* @ param pipe
* Pipe
* @ param message
* Message to push
* @ throws IOException
* if message could not be written */
@ SuppressWarnings ( "rawtypes" ) public void pushMessage ( IPipe pipe , IMessage message ) throws IOException { } } | if ( message instanceof RTMPMessage ) { final IRTMPEvent msg = ( ( RTMPMessage ) message ) . getBody ( ) ; // if writes are delayed , queue the data and sort it by time
if ( queue == null ) { if ( usePriority ) { if ( log . isTraceEnabled ( ) ) { log . trace ( "Creating priority typed packet queue. queueThreshold={}" ,... |
public class MBeanServerProxy { /** * { @ inheritDoc } */
public void addNotificationListener ( ObjectName name , NotificationListener listener , NotificationFilter filter , Object handback ) throws InstanceNotFoundException { } } | delegate . addNotificationListener ( name , listener , filter , handback ) ; |
public class ResourceChange { /** * Information about the resource changes .
* @ param details
* Information about the resource changes . */
public void setDetails ( java . util . Collection < ResourceChangeDetail > details ) { } } | if ( details == null ) { this . details = null ; return ; } this . details = new java . util . ArrayList < ResourceChangeDetail > ( details ) ; |
public class Math { /** * Returns the row sums for a matrix . */
public static double [ ] rowSums ( double [ ] [ ] data ) { } } | double [ ] x = new double [ data . length ] ; for ( int i = 0 ; i < x . length ; i ++ ) { x [ i ] = sum ( data [ i ] ) ; } return x ; |
public class MetricsImpl { /** * Retrieve metric data .
* Gets metric values for a single metric .
* @ param appId ID of the application . This is Application ID from the API Access settings blade in the Azure portal .
* @ param metricId ID of the metric . This is either a standard AI metric , or an application -... | return getWithServiceResponseAsync ( appId , metricId , timespan , interval , aggregation , segment , top , orderby , filter ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class CmsDirectEditEntryPoint { /** * Initializes the direct edit buttons . < p > */
public void initializeButtons ( ) { } } | List < Element > editableElements = CmsDomUtil . getElementsByClass ( CmsGwtConstants . CLASS_EDITABLE , Tag . div ) ; List < CmsDirectEditButtons > editables = Lists . newArrayList ( ) ; for ( Element elem : editableElements ) { CmsPositionBean pos = CmsDomUtil . getEditablePosition ( elem ) ; m_positions . put ( elem... |
public class DragItemRecyclerView { /** * Returns the child view under the specific x , y coordinate .
* This method will take margins of the child into account when finding it . */
public View findChildView ( float x , float y ) { } } | final int count = getChildCount ( ) ; if ( y <= 0 && count > 0 ) { return getChildAt ( 0 ) ; } for ( int i = count - 1 ; i >= 0 ; i -- ) { final View child = getChildAt ( i ) ; MarginLayoutParams params = ( MarginLayoutParams ) child . getLayoutParams ( ) ; if ( x >= child . getLeft ( ) - params . leftMargin && x <= ch... |
public class WTextField { /** * Override validateComponent to perform further validation .
* @ param diags the list into which any validation diagnostics are added . */
@ Override protected void validateComponent ( final List < Diagnostic > diags ) { } } | super . validateComponent ( diags ) ; if ( ! isEmpty ( ) ) { String value = getValueAsString ( ) ; // Maximum Length
int max = getMaxLength ( ) ; if ( max > 0 && value . length ( ) > max ) { diags . add ( createErrorDiagnostic ( InternalMessages . DEFAULT_VALIDATION_ERROR_MAX_LENGTH , this , String . valueOf ( max ) ) ... |
public class RelaxedNames { /** * Return a { @ link RelaxedNames } for the given source camelCase source name .
* @ param name the source name in camelCase
* @ return the relaxed names */
public static RelaxedNames forCamelCase ( String name ) { } } | StringBuilder result = new StringBuilder ( ) ; for ( char c : name . toCharArray ( ) ) { result . append ( Character . isUpperCase ( c ) && result . length ( ) > 0 && result . charAt ( result . length ( ) - 1 ) != '-' ? "-" + Character . toLowerCase ( c ) : c ) ; } return new RelaxedNames ( result . toString ( ) ) ; |
public class EntityPropertyDescFactory { /** * プロパティクラス名を処理します 。
* @ param entityDesc エンティティ記述
* @ param propertyDesc エンティティプロパティ記述
* @ param columnMeta カラムメタデータ */
protected void handlePropertyClassName ( EntityDesc entityDesc , EntityPropertyDesc propertyDesc , ColumnMeta columnMeta ) { } } | String defaultClassName = dialect . getMappedPropertyClassName ( columnMeta ) ; String className = propertyClassNameResolver . resolve ( entityDesc , propertyDesc . getName ( ) , defaultClassName ) ; if ( className == null ) { Logger . info ( Message . DOMAGEN0018 . getMessage ( columnMeta . getTableMeta ( ) . getName ... |
public class TagUtils { /** * String - - > boolean
* @ param value
* @ return */
public static boolean getBoolean ( Object value ) { } } | if ( value == null ) { return false ; } if ( value instanceof Boolean ) { return ( ( Boolean ) value ) . booleanValue ( ) ; } return Boolean . valueOf ( value . toString ( ) ) . booleanValue ( ) ; |
public class QQPlot { /** * Generate the quantile - quantile pairs . */
private static double [ ] [ ] quantile ( double [ ] x , Distribution d ) { } } | Arrays . sort ( x ) ; int n = x . length ; double [ ] [ ] q = new double [ n ] [ 2 ] ; for ( int i = 0 ; i < n ; i ++ ) { double p = ( i + 1 ) / ( n + 1.0 ) ; q [ i ] [ 0 ] = x [ ( int ) Math . round ( p * x . length ) ] ; q [ i ] [ 1 ] = d . quantile ( p ) ; } return q ; |
public class XpathUtils { /** * Same as { @ link # asNode ( String , Node ) } but allows an xpath to be
* passed in explicitly for reuse . */
public static Node asNode ( String nodeName , Node node , XPath xpath ) throws XPathExpressionException { } } | if ( node == null ) return null ; return ( Node ) xpath . evaluate ( nodeName , node , XPathConstants . NODE ) ; |
public class CmsListManager { /** * Edits the given list configuration resource . < p >
* @ param resource the configuration resource */
void editListConfiguration ( CmsResource resource ) { } } | try { CmsObject cms = A_CmsUI . getCmsObject ( ) ; String editState ; if ( resource == null ) { editState = CmsEditor . getEditStateForNew ( cms , OpenCms . getResourceManager ( ) . getResourceType ( RES_TYPE_LIST_CONFIG ) , "/" , null , false , UI . getCurrent ( ) . getPage ( ) . getLocation ( ) . toString ( ) ) ; } e... |
public class ComputePoliciesInner { /** * Lists the Data Lake Analytics compute policies within the specified Data Lake Analytics account . An account supports , at most , 50 policies .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ throws IllegalArgumentException thro... | return listByAccountNextSinglePageAsync ( nextPageLink ) . concatMap ( new Func1 < ServiceResponse < Page < ComputePolicyInner > > , Observable < ServiceResponse < Page < ComputePolicyInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < ComputePolicyInner > > > call ( ServiceResponse < Page < Com... |
public class AndroidUtil { /** * Utility function to create a two - level tile cache with the right size , using the size of the map view . This is
* the compatibility version that by default creates a non - persistent cache .
* @ param c the Android context
* @ param id name for the storage directory
* @ param... | return createTileCache ( c , id , tileSize , width , height , overdraw , false ) ; |
public class SemanticPropUtil { /** * Creates SemanticProperties by adding an offset to each input field index of the given SemanticProperties .
* @ param props The SemanticProperties to which the offset is added .
* @ param numInputFields The original number of fields of the input .
* @ param offset The offset t... | SingleInputSemanticProperties offsetProps = new SingleInputSemanticProperties ( ) ; if ( props . getReadFields ( 0 ) != null ) { FieldSet offsetReadFields = new FieldSet ( ) ; for ( int r : props . getReadFields ( 0 ) ) { offsetReadFields = offsetReadFields . addField ( r + offset ) ; } offsetProps . addReadFields ( of... |
public class BoxRequestUpdateSharedItem { /** * Sets whether the shared link allows downloads in the request .
* @ param canDownload new value for whether the shared link allows downloads .
* @ return request with the updated value for whether the shared link allows downloads . */
protected R setCanDownload ( boole... | JsonObject jsonPermissionsObject = getPermissionsJsonObject ( ) ; jsonPermissionsObject . add ( BoxSharedLink . Permissions . FIELD_CAN_DOWNLOAD , canDownload ) ; BoxSharedLink . Permissions permissions = new BoxSharedLink . Permissions ( jsonPermissionsObject ) ; JsonObject sharedLinkJsonObject = getSharedLinkJsonObje... |
public class GraphicalTerminalImplementation { /** * Updates the back buffer ( if necessary ) and draws it to the component ' s surface
* @ param componentGraphics Object to use when drawing to the component ' s surface */
synchronized void paintComponent ( Graphics componentGraphics ) { } } | int width = getWidth ( ) ; int height = getHeight ( ) ; this . scrollController . updateModel ( virtualTerminal . getBufferLineCount ( ) * getFontHeight ( ) , height ) ; boolean needToUpdateBackBuffer = // User has used the scrollbar , we need to update the back buffer to reflect this
lastBufferUpdateScrollPosition != ... |
public class OstrichOwnerGroup { /** * Returns the specified managed service if this server is responsible for the specified object and has won a
* ZooKeeper - managed leader election .
* @ param name object name . Whether this server owns the object is computed by Ostrich using consistent hashing .
* @ param wai... | long timeoutAt = System . currentTimeMillis ( ) + waitDuration . toMillis ( ) ; LeaderService leaderService = _leaderMap . getUnchecked ( name ) . orNull ( ) ; if ( leaderService == null || ! awaitRunning ( leaderService , timeoutAt ) ) { return null ; } Service service ; for ( ; ; ) { Optional < Service > opt = leader... |
public class CmsPropertyResourceComparator { /** * Initializes the comparator key based on the member variables . < p >
* @ param resource the resource to use
* @ param cms the current OpenCms user contxt
* @ param property the name of the sort property ( case sensitive ) */
private void init ( CmsResource resour... | try { cms . readPropertyDefinition ( property ) ; CmsProperty prop = cms . readPropertyObject ( resource , property , false ) ; if ( prop == CmsProperty . getNullProperty ( ) ) { m_propertyValue = "" ; } else { m_propertyValue = prop . getValue ( ) ; } } catch ( CmsDbEntryNotFoundException dbe ) { // property are not c... |
public class RuleSessionImpl { /** * / * ( non - Javadoc )
* @ see nz . co . senanque . rules . RuleSession # assign ( nz . co . senanque . rules . RuleContext , java . lang . Object , java . util . List ) */
public void assign ( RuleContext ruleContext , Object value , List < ProxyField > list ) { } } | for ( ProxyField proxyField : list ) { assign ( getRuleProxyField ( proxyField ) , value , ruleContext , true ) ; } |
public class LockedObject { /** * deletes this Lock object . assumes that it has no children and no owners ( does not check this itself ) */
public void removeLockedObject ( ) { } } | if ( this != resourceLocks . root && ! this . getPath ( ) . equals ( "/" ) ) { int size = parent . children . length ; for ( int i = 0 ; i < size ; i ++ ) { if ( parent . children [ i ] . equals ( this ) ) { LockedObject [ ] newChildren = new LockedObject [ size - 1 ] ; for ( int i2 = 0 ; i2 < ( size - 1 ) ; i2 ++ ) { ... |
public class TopNBuffer { /** * Gets record which rank is given value .
* @ param rank rank value to search
* @ return the record which rank is given value */
BaseRow getElement ( int rank ) { } } | int curRank = 0 ; Iterator < Map . Entry < BaseRow , Collection < BaseRow > > > iter = treeMap . entrySet ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { Map . Entry < BaseRow , Collection < BaseRow > > entry = iter . next ( ) ; Collection < BaseRow > list = entry . getValue ( ) ; Iterator < BaseRow > listIter = li... |
public class CORSConfigBuilder { /** * The origin values that CORS requests are allowed for , or null to allow all origins .
* @ param allowedOrigins Allowed origins , such as < code > https : / / example . org < / code > or < code > http : / / localhost : 8080 < / code >
* @ return This builder */
public CORSConfi... | if ( allowedOrigins != null ) { for ( String allowedOrigin : allowedOrigins ) { if ( ! allowedOrigin . startsWith ( "http://" ) && ! allowedOrigin . startsWith ( "https://" ) ) { throw new IllegalArgumentException ( allowedOrigin + " is invalid: origins much have an http:// or https:// prefix" ) ; } if ( allowedOrigin ... |
public class DummyFileObjectStore { /** * ( non - Javadoc )
* @ see com . ibm . ws . objectManager . ObjectStore # captureStatistics ( ) */
public java . util . Map captureStatistics ( ) throws ObjectManagerException { } } | if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "captureStatistics" ) ; java . util . Map statistics = super . captureStatistics ( ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "captureStatistics" , "retur... |
public class FlowTypeCheck { /** * Extract the element type from an array . The array type can be null if some
* earlier part of type checking generated an error message and we are just
* continuing after that .
* @ param type
* @ param item
* @ return */
public SemanticType extractElementType ( SemanticType ... | if ( type == null ) { return null ; } else { return type . getElement ( ) ; } |
public class Hessian2Output { /** * Writes a date to the stream .
* < code > < pre >
* date : : = d b7 b6 b5 b4 b3 b2 b1 b0
* : : = x65 b3 b2 b1 b0
* < / pre > < / code >
* @ param time the date in milliseconds from the epoch in UTC */
public void writeUTCDate ( long time ) throws IOException { } } | if ( SIZE < _offset + 32 ) flushBuffer ( ) ; int offset = _offset ; byte [ ] buffer = _buffer ; if ( time % 60000L == 0 ) { // compact date : : = x65 b3 b2 b1 b0
long minutes = time / 60000L ; if ( ( minutes >> 31 ) == 0 || ( minutes >> 31 ) == - 1 ) { buffer [ offset ++ ] = ( byte ) BC_DATE_MINUTE ; buffer [ offset ++... |
public class PropagateRequestImpl { /** * Create smartfox object to response to client
* @ return smartfox parameter object */
private ISFSObject createResponseParams ( ) { } } | return ResponseParamsBuilder . create ( ) . addition ( addition ) . excludedVars ( excludedVars ) . includedVars ( includedVars ) . transformer ( new ParamTransformer ( context ) ) . data ( data ) . build ( ) ; |
public class DoubleTuples { /** * Computes < code > t0 + factor * t1 < / code > , and stores the result in the given
* result tuple .
* @ param t0 The first input tuple
* @ param factor The scaling factor
* @ param t1 The second input tuple
* @ param result The tuple that will store the result
* @ return Th... | return DoubleTupleFunctions . apply ( t0 , t1 , ( a , b ) -> ( a + factor * b ) , result ) ; |
public class LoggingConfigUtils { /** * Read integer value from properties : begin by preserving the old value . If
* the property is found , and the new value is an integer , the new value
* will be returned .
* @ param newValue
* New parameter value to parse / evaluate
* @ param defaultValue
* Starting / ... | if ( newValue != null ) { if ( newValue instanceof String ) { try { return Integer . parseInt ( ( String ) newValue ) ; } catch ( NumberFormatException ex ) { } } else if ( newValue instanceof Integer ) return ( Integer ) newValue ; } return defaultValue ; |
public class SoftHashMap { /** * { @ inheritDoc } */
@ Override public final V put ( final K key , final V value ) { } } | processQueue ( ) ; internalMap . put ( key , new SoftValue < V > ( value , key , queue ) ) ; return null ; |
public class CollectionUtils { /** * 返回第一个列表中比第二个多出来的元素 */
public static < T > List < T > getLeftDiff ( List < T > list1 , List < T > list2 ) { } } | if ( isEmpty ( list2 ) ) { return list1 ; } List < T > list = new ArrayList < T > ( ) ; if ( isNotEmpty ( list1 ) ) { for ( T o : list1 ) { if ( ! list2 . contains ( o ) ) { list . add ( o ) ; } } } return list ; |
public class RawJsonDocument { /** * Creates a { @ link RawJsonDocument } which the document id , JSON content and the expiration time .
* @ param id the per - bucket unique document id .
* @ param content the content of the document .
* @ param expiry the expiration time of the document .
* @ return a { @ link... | return new RawJsonDocument ( id , expiry , content , 0 , null ) ; |
public class SerializerIntrinsics { /** * Return the Count of Number of Bits Set to 1 ( SSE4.2 ) . */
public final void popcnt ( Register dst , Mem src ) { } } | assert ( ! dst . isRegType ( REG_GPB ) ) ; emitX86 ( INST_POPCNT , dst , src ) ; |
public class RdfConverter { /** * Writes triples which conect properties with there corresponding rdf
* properties for statements , simple statements , qualifiers , reference
* attributes and values .
* @ param document
* @ throws RDFHandlerException */
void writeInterPropertyLinks ( PropertyDocument document )... | Resource subject = this . rdfWriter . getUri ( document . getEntityId ( ) . getIri ( ) ) ; this . rdfWriter . writeTripleUriObject ( subject , this . rdfWriter . getUri ( Vocabulary . WB_DIRECT_CLAIM_PROP ) , Vocabulary . getPropertyUri ( document . getEntityId ( ) , PropertyContext . DIRECT ) ) ; this . rdfWriter . wr... |
public class Misc { /** * Check that a parameter is not null and throw IllegalArgumentException with a message of
* errorMessagePrefix + " must not be null . " if it is null , defaulting to " Parameter must not be
* null . " .
* @ param param the parameter to check
* @ param errorMessagePrefix the prefix of the... | checkArgument ( param != null , ( errorMessagePrefix != null ? errorMessagePrefix : "Parameter" ) + " must not be null." ) ; |
public class JwtIssuer { /** * Construct a default JwtClaims
* @ return JwtClaims */
public static JwtClaims getDefaultJwtClaims ( ) { } } | JwtClaims claims = new JwtClaims ( ) ; claims . setIssuer ( jwtConfig . getIssuer ( ) ) ; claims . setAudience ( jwtConfig . getAudience ( ) ) ; claims . setExpirationTimeMinutesInTheFuture ( jwtConfig . getExpiredInMinutes ( ) ) ; claims . setGeneratedJwtId ( ) ; // a unique identifier for the token
claims . setIssued... |
public class HostNameValidator { /** * ( non - Javadoc )
* @ see
* com . fs . commons . desktop . validation . Validator # validate ( com . fs . commons . desktop .
* validation . Problems , java . lang . String , java . lang . Object ) */
@ Override public boolean validate ( final Problems problems , final Strin... | if ( model . length ( ) == 0 ) { problems . add ( ValidationBundle . getMessage ( HostNameValidator . class , "INVALID_HOST_NAME" , compName , model ) ) ; // NOI18N
return false ; } if ( model . startsWith ( "." ) || model . endsWith ( "." ) ) { // NOI18N
problems . add ( ValidationBundle . getMessage ( IpAddressValida... |
public class BitmapUtils { /** * Get width and height of the bitmap specified with the { @ link android . net . Uri } .
* @ param resolver the resolver .
* @ param uri the uri that points to the bitmap .
* @ return the size . */
public static Point getSize ( ContentResolver resolver , Uri uri ) { } } | InputStream is = null ; try { BitmapFactory . Options options = new BitmapFactory . Options ( ) ; options . inJustDecodeBounds = true ; is = resolver . openInputStream ( uri ) ; BitmapFactory . decodeStream ( is , null , options ) ; int width = options . outWidth ; int height = options . outHeight ; return new Point ( ... |
public class UISelectMany { /** * < p > Return < code > true < / code > if the new value is different from the
* previous value . Value comparison must not be sensitive to element order .
* @ param previous old value of this component
* @ param value new value of this component */
protected boolean compareValues ... | if ( ( previous == null ) && ( value != null ) ) { return ( true ) ; } else if ( ( previous != null ) && ( value == null ) ) { return ( true ) ; } else if ( ( previous == null ) ) { return ( false ) ; } boolean valueChanged = false ; Object oldarray [ ] ; Object newarray [ ] ; // The arrays may be arrays of primitives ... |
public class CommerceOrderItemPersistenceImpl { /** * Returns a range of all the commerce order items where commerceOrderId = & # 63 ; .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they... | return findByCommerceOrderId ( commerceOrderId , start , end , null ) ; |
public class PagedInputBuffer { /** * Select buffer .
* @ param offset the offset */
private void selectPage ( long offset ) { } } | if ( currentBuffer == null || currentBuffer . seekSuccessful ( offset ) ) { currentBuffer = null ; int i = 0 ; // Look if the given offset is already stored in a page
while ( i < pages . size ( ) && currentBuffer == null ) { if ( pages . get ( i ) . seekSuccessful ( offset ) ) currentBuffer = pages . get ( i ) ; i ++ ;... |
public class PrefHelper { /** * < p > Sets the value of the { @ link String } key value supplied in preferences . < / p >
* @ param key A { @ link String } value containing the key to reference .
* @ param value A { @ link Boolean } value to set the preference record to . */
public void setBool ( String key , Boole... | prefHelper_ . prefsEditor_ . putBoolean ( key , value ) ; prefHelper_ . prefsEditor_ . apply ( ) ; |
public class GRLINERGImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setXOSSF ( Integer newXOSSF ) { } } | Integer oldXOSSF = xossf ; xossf = newXOSSF ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . GRLINERG__XOSSF , oldXOSSF , xossf ) ) ; |
public class NameTable { /** * Convert a Java type into the equivalent JNI type . */
public String getJniType ( TypeMirror type ) { } } | if ( TypeUtil . isPrimitiveOrVoid ( type ) ) { return getPrimitiveObjCType ( type ) ; } else if ( TypeUtil . isArray ( type ) ) { return "jarray" ; } else if ( typeUtil . isString ( type ) ) { return "jstring" ; } else if ( typeUtil . isClassType ( type ) ) { return "jclass" ; } return "jobject" ; |
public class DRL5Lexer { /** * $ ANTLR start " PLUS _ ASSIGN " */
public final void mPLUS_ASSIGN ( ) throws RecognitionException { } } | try { int _type = PLUS_ASSIGN ; int _channel = DEFAULT_TOKEN_CHANNEL ; // src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 156:5 : ( ' + = ' )
// src / main / resources / org / drools / compiler / lang / DRL5Lexer . g : 156:7 : ' + = '
{ match ( "+=" ) ; if ( state . failed ) return ; } state .... |
public class Quaternion { /** * Sets the value of this quaternion to the conjugate of quaternion q1.
* @ param q1 the source vector */
public final void conjugate ( Quaternion q1 ) { } } | this . x = - q1 . x ; this . y = - q1 . y ; this . z = - q1 . z ; this . w = q1 . w ; |
public class RuleBasedNumberFormat { /** * Set capitalizationForListOrMenu , capitalizationForStandAlone */
private void initCapitalizationContextInfo ( ULocale theLocale ) { } } | ICUResourceBundle rb = ( ICUResourceBundle ) UResourceBundle . getBundleInstance ( ICUData . ICU_BASE_NAME , theLocale ) ; try { ICUResourceBundle rdb = rb . getWithFallback ( "contextTransforms/number-spellout" ) ; int [ ] intVector = rdb . getIntVector ( ) ; if ( intVector . length >= 2 ) { capitalizationForListOrMen... |
public class HibernateClient { /** * ( non - Javadoc )
* @ see
* com . impetus . kundera . client . ClientBase # onPersist ( com . impetus . kundera . metadata
* . model . EntityMetadata , java . lang . Object , java . lang . Object ,
* java . util . List ) */
@ Override protected void onPersist ( EntityMetadat... | boolean proxyRemoved = removeKunderaProxies ( metadata , entity , relationHolders ) ; Transaction tx = null ; s = getStatelessSession ( ) ; tx = onBegin ( ) ; try { if ( ! isUpdate ) { id = s . insert ( entity ) ; // Update foreign Keys
updateForeignKeys ( metadata , id , relationHolders ) ; onCommit ( tx ) ; /* tx . c... |
public class XmppClient { /** * Calculates the SHA1 Digest of a given input .
* @ param input the input
* @ return the string
* @ throws NoSuchAlgorithmException the no such algorithm exception */
@ SneakyThrows ( IOException . class ) public static String sha1 ( String input ) throws NoSuchAlgorithmException { }... | MessageDigest mDigest = MessageDigest . getInstance ( "SHA1" ) ; byte [ ] result = mDigest . digest ( input . getBytes ( "UTF-8" ) ) ; String resultString = String . format ( "%040x" , new BigInteger ( 1 , result ) ) ; return resultString ; |
public class Configuration { /** * Reload existing configuration instances . */
public static synchronized void reloadExistingConfigurations ( ) { } } | if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Reloading " + REGISTRY . keySet ( ) . size ( ) + " existing configurations" ) ; } for ( Configuration conf : REGISTRY . keySet ( ) ) { conf . reloadConfiguration ( ) ; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.