signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class JFreeChartExporter { /** * replace $ P { . . . } parameters ( used in title and x , y legends */
private String replaceParameters ( String text ) { } } | if ( text == null ) { return null ; } for ( String param : parameterValues . keySet ( ) ) { text = StringUtil . replace ( text , "\\$P\\{" + param + "\\}" , StringUtil . getValueAsString ( parameterValues . get ( param ) , null , I18nUtil . getLanguageByName ( chart , language ) ) ) ; } return text ; |
public class SyncListItemReader { /** * Add the requested query string arguments to the Request .
* @ param request Request to add query string arguments to */
private void addQueryParams ( final Request request ) { } } | if ( order != null ) { request . addQueryParam ( "Order" , order . toString ( ) ) ; } if ( from != null ) { request . addQueryParam ( "From" , from ) ; } if ( bounds != null ) { request . addQueryParam ( "Bounds" , bounds . toString ( ) ) ; } if ( getPageSize ( ) != null ) { request . addQueryParam ( "PageSize" , Integ... |
public class BizLoggerFactory { /** * 保证一个TaskTracker只能有一个Logger , 因为一个jvm可以有多个TaskTracker */
public static BizLogger getLogger ( Level level , RemotingClientDelegate remotingClient , TaskTrackerAppContext appContext ) { } } | // 单元测试的时候返回 Mock
if ( Environment . UNIT_TEST == LTSConfig . getEnvironment ( ) ) { return new MockBizLogger ( level ) ; } String key = appContext . getConfig ( ) . getIdentity ( ) ; BizLogger logger = BIZ_LOGGER_CONCURRENT_HASH_MAP . get ( key ) ; if ( logger == null ) { synchronized ( BIZ_LOGGER_CONCURRENT_HASH_MAP ... |
public class JpaRepository { /** * Returns all the entities contained in the repository paginated .
* The query used for this operation is the one received by the constructor .
* @ return all the entities contained in the repository paginated */
@ SuppressWarnings ( "unchecked" ) @ Override public final Collection ... | final Query builtQuery ; // Query created from the query data
checkNotNull ( pagination , "Received a null pointer as the pagination data" ) ; // Builds the query
builtQuery = getEntityManager ( ) . createQuery ( getAllValuesQuery ( ) ) ; // Sets the pagination
applyPagination ( builtQuery , pagination ) ; // Processes... |
public class VirtualNetworkGatewaysInner { /** * Updates a virtual network gateway tags .
* @ param resourceGroupName The name of the resource group .
* @ param virtualNetworkGatewayName The name of the virtual network gateway .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ th... | return updateTagsWithServiceResponseAsync ( resourceGroupName , virtualNetworkGatewayName ) . toBlocking ( ) . last ( ) . body ( ) ; |
public class TCPChannel { /** * Initialize this channel .
* @ param runtimeConfig
* @ param tcpConfig
* @ throws ChannelException */
public void setup ( ChannelData runtimeConfig , TCPChannelConfiguration tcpConfig ) throws ChannelException { } } | setup ( runtimeConfig , tcpConfig , null ) ; |
public class CmsRole { /** * Returns a role violation exception configured with a localized , role specific message
* for this role . < p >
* @ param requestContext the current users OpenCms request context
* @ return a role violation exception configured with a localized , role specific message
* for this role... | return new CmsRoleViolationException ( Messages . get ( ) . container ( Messages . ERR_USER_NOT_IN_ROLE_2 , requestContext . getCurrentUser ( ) . getName ( ) , getName ( requestContext . getLocale ( ) ) ) ) ; |
public class ApolloCodegenInstallTask { /** * Generates a dummy package . json file to silence npm warnings */
private void writePackageFile ( File apolloPackageFile ) { } } | try { JsonWriter writer = JsonWriter . of ( Okio . buffer ( Okio . sink ( apolloPackageFile ) ) ) ; writer . beginObject ( ) ; writer . name ( "name" ) . value ( "apollo-android" ) ; writer . name ( "version" ) . value ( "0.0.1" ) ; writer . name ( "description" ) . value ( "Generates Java code based on a GraphQL schem... |
public class FindComponentsByClassVisitor { /** * { @ inheritDoc } */
@ Override public VisitorResult visit ( final WComponent comp ) { } } | // Check if root component should be included ( if ignore then just continue )
if ( ! includeRoot && comp == root ) { return VisitorResult . CONTINUE ; } boolean match = false ; // Check inherited classes
outer : for ( Class < ? > clazz = comp . getClass ( ) ; clazz != null ; clazz = clazz . getSuperclass ( ) ) { // Ch... |
public class HttpUtils { /** * Do a GET request on the provided URL and construct the Query String part
* with the provided list of parameters . If the URL already contains
* parameters ( already contains a ' ? ' character ) , then the parameters are
* added to the existing parameters . The parameters are convert... | try { Map < String , Object > map = new HashMap < > ( ) ; for ( Object bean : params ) { if ( bean instanceof Parameter ) { Parameter p = ( Parameter ) bean ; map . put ( p . getName ( ) , p . getValue ( ) ) ; } else if ( bean instanceof Map ) { map . putAll ( ( Map < String , Object > ) bean ) ; } else { map . putAll ... |
public class SqlMapper { /** * 删除数据
* @ param sql 执行的sql
* @ param value 参数
* @ return 执行行数 */
public int delete ( String sql , Object value ) { } } | Class < ? > parameterType = value != null ? value . getClass ( ) : null ; String msId = msUtils . deleteDynamic ( sql , parameterType ) ; return sqlSession . delete ( msId , value ) ; |
public class TvdbParser { /** * Parse the banner record from the document
* @ param eBanner
* @ throws Throwable */
private static Banner parseNextBanner ( Element eBanner ) { } } | Banner banner = new Banner ( ) ; String artwork ; artwork = DOMHelper . getValueFromElement ( eBanner , BANNER_PATH ) ; if ( ! artwork . isEmpty ( ) ) { banner . setUrl ( URL_BANNER + artwork ) ; } artwork = DOMHelper . getValueFromElement ( eBanner , VIGNETTE_PATH ) ; if ( ! artwork . isEmpty ( ) ) { banner . setVigne... |
public class TypeConformanceComputer { /** * Logic was moved to inner class CommonSuperTypeFinder in the context of bug 495314.
* This method is scheduled for deletion in Xtext 2.15
* @ deprecated see { @ link CommonSuperTypeFinder # enhanceSuperType ( List , ParameterizedTypeReference ) } */
@ Deprecated protected... | CommonSuperTypeFinder typeFinder = newCommonSuperTypeFinder ( superTypes . get ( 0 ) . getOwner ( ) ) ; typeFinder . requestsInProgress = Lists . newArrayList ( ) ; typeFinder . requestsInProgress . add ( initiallyRequested ) ; return typeFinder . enhanceSuperType ( superTypes , result ) ; |
public class SARLProjectConfigurator { /** * Collect the list of SARL project folders that are under directory into files .
* @ param folders the list of folders to fill in .
* @ param directory the directory to explore .
* @ param directoriesVisited Set of canonical paths of directories , used as recursion guard... | if ( monitor . isCanceled ( ) ) { return ; } monitor . subTask ( NLS . bind ( Messages . SARLProjectConfigurator_0 , directory . getPath ( ) ) ) ; final File [ ] contents = directory . listFiles ( ) ; if ( contents == null ) { return ; } Set < String > visited = directoriesVisited ; if ( visited == null ) { visited = n... |
public class RedisObjectFactory { /** * New redis template .
* @ param < K > the type parameter
* @ param < V > the type parameter
* @ param connectionFactory the connection factory
* @ return the redis template */
public static < K , V > RedisTemplate < K , V > newRedisTemplate ( final RedisConnectionFactory c... | val template = new RedisTemplate < K , V > ( ) ; val string = new StringRedisSerializer ( ) ; val jdk = new JdkSerializationRedisSerializer ( ) ; template . setKeySerializer ( string ) ; template . setValueSerializer ( jdk ) ; template . setHashValueSerializer ( jdk ) ; template . setHashKeySerializer ( string ) ; temp... |
public class BaasObject { /** * Asynchronously revokes the access < code > grant < / code > to this object from users with < code > role < / code > .
* The outcome of the request is handed to the provided < code > handler < / code > .
* @ param grant a non null { @ link com . baasbox . android . Grant }
* @ param... | return grantAll ( grant , role , RequestOptions . DEFAULT , handler ) ; |
public class Studio { /** * Returns table with column renderers . */
private JTable withColRenderers ( final JTable table ) { } } | // Data renderers
final DefaultTableCellRenderer dtcr = new DefaultTableCellRenderer ( ) ; // BigDecimal
table . setDefaultRenderer ( BigDecimal . class , new TableCellRenderer ( ) { public Component getTableCellRendererComponent ( final JTable table , final Object value , final boolean isSelected , final boolean hasFo... |
public class ApptentiveNotificationObserverList { /** * Removes observer os its weak reference from the list
* @ return < code > true < / code > if observer was returned */
boolean removeObserver ( ApptentiveNotificationObserver observer ) { } } | int index = indexOf ( observer ) ; if ( index != - 1 ) { observers . remove ( index ) ; return true ; } return false ; |
public class CommerceOrderNoteUtil { /** * Returns the commerce order notes before and after the current commerce order note in the ordered set where commerceOrderId = & # 63 ; .
* @ param commerceOrderNoteId the primary key of the current commerce order note
* @ param commerceOrderId the commerce order ID
* @ pa... | return getPersistence ( ) . findByCommerceOrderId_PrevAndNext ( commerceOrderNoteId , commerceOrderId , orderByComparator ) ; |
public class CSSBoxTree { /** * Creates the style declaration for a text box based on the given { @ link BoxStyle } structure .
* @ param style The source box style .
* @ return The element style definition . */
protected NodeData createTextStyle ( BoxStyle style , float width ) { } } | NodeData ret = CSSFactory . createNodeData ( ) ; TermFactory tf = CSSFactory . getTermFactory ( ) ; ret . push ( createDeclaration ( "position" , tf . createIdent ( "absolute" ) ) ) ; ret . push ( createDeclaration ( "overflow" , tf . createIdent ( "hidden" ) ) ) ; ret . push ( createDeclaration ( "left" , tf . createL... |
public class MediaType { /** * < em > Replaces < / em > all parameters with the given parameters .
* @ throws IllegalArgumentException if any parameter or value is invalid */
public MediaType withParameters ( Map < String , ? extends Iterable < String > > parameters ) { } } | final ImmutableListMultimap . Builder < String , String > builder = ImmutableListMultimap . builder ( ) ; for ( Map . Entry < String , ? extends Iterable < String > > e : parameters . entrySet ( ) ) { final String k = e . getKey ( ) ; for ( String v : e . getValue ( ) ) { builder . put ( k , v ) ; } } return create ( t... |
public class CPDefinitionOptionValueRelPersistenceImpl { /** * Removes the cp definition option value rel with the primary key from the database . Also notifies the appropriate model listeners .
* @ param primaryKey the primary key of the cp definition option value rel
* @ return the cp definition option value rel ... | Session session = null ; try { session = openSession ( ) ; CPDefinitionOptionValueRel cpDefinitionOptionValueRel = ( CPDefinitionOptionValueRel ) session . get ( CPDefinitionOptionValueRelImpl . class , primaryKey ) ; if ( cpDefinitionOptionValueRel == null ) { if ( _log . isDebugEnabled ( ) ) { _log . debug ( _NO_SUCH... |
public class FavoritesInner { /** * Gets a list of favorites defined within an Application Insights component .
* @ param resourceGroupName The name of the resource group .
* @ param resourceName The name of the Application Insights component resource .
* @ param serviceCallback the async ServiceCallback to handl... | return ServiceFuture . fromResponse ( listWithServiceResponseAsync ( resourceGroupName , resourceName ) , serviceCallback ) ; |
public class BottomSheet { /** * Adds a new divider to the bottom sheet .
* @ param titleId
* The resource id of the title of the divider , which should be added , as an { @ link
* Integer } value . The resource id must correspond to a valid string resource */
public final void addDivider ( @ StringRes final int ... | Divider divider = new Divider ( ) ; divider . setTitle ( getContext ( ) , titleId ) ; adapter . add ( divider ) ; adaptGridViewHeight ( ) ; |
public class CSSHandler { /** * Create a { @ link CSSDeclarationList } object from a parsed object .
* @ param eVersion
* The CSS version to use . May not be < code > null < / code > .
* @ param aNode
* The parsed CSS object to read . May not be < code > null < / code > .
* @ return Never < code > null < / co... | return readDeclarationListFromNode ( eVersion , aNode , CSSReader . getDefaultInterpretErrorHandler ( ) ) ; |
public class DefaultOptionParser { /** * Handles the following tokens :
* < pre >
* - - L = V
* - - L V
* < / pre >
* @ param token the command line token to handle
* @ throws OptionParserException if option parsing fails */
private void handleLongOption ( String token ) throws OptionParserException { } } | if ( token . indexOf ( '=' ) == - 1 ) { handleLongOptionWithoutEqual ( token ) ; } else { handleLongOptionWithEqual ( token ) ; } |
public class Repositories { /** * Loads repository description . */
private static void loadRepositoryDescription ( ) { } } | LOGGER . log ( Level . INFO , "Loading repository description...." ) ; final InputStream inputStream = AbstractRepository . class . getResourceAsStream ( "/repository.json" ) ; if ( null == inputStream ) { LOGGER . log ( Level . INFO , "Not found repository description [repository.json] file under classpath" ) ; return... |
public class VdmBreakpointPropertyPage { /** * Adds the given error message to the errors currently displayed on this page . The page displays the most recently
* added error message . Clients should retain messages that are passed into this method as the message should later
* be passed into removeErrorMessage ( S... | fErrorMessages . remove ( message ) ; fErrorMessages . add ( message ) ; setErrorMessage ( message ) ; setValid ( message == null ) ; |
public class CommerceAddressPersistenceImpl { /** * Returns all the commerce addresses where commerceCountryId = & # 63 ; .
* @ param commerceCountryId the commerce country ID
* @ return the matching commerce addresses */
@ Override public List < CommerceAddress > findByCommerceCountryId ( long commerceCountryId ) ... | return findByCommerceCountryId ( commerceCountryId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ; |
public class InMemoryTopology { /** * { @ inheritDoc } .
* If the result is already in cache , return the result .
* Otherwise , delegate the functionality to the fallback object */
@ Override public List < ConfigKeyPath > getOwnImports ( ConfigKeyPath configKey ) { } } | return getOwnImports ( configKey , Optional . < Config > absent ( ) ) ; |
public class RollingLogger { /** * Get the log file index from the composed log file name .
* @ param fileName
* Log file name with index appended
* @ return Log file index */
private int getLogFileIndex ( String fileName ) { } } | int fileIndex = 0 ; try { fileIndex = Integer . parseInt ( fileName . substring ( fileName . lastIndexOf ( COUNT_SEPARATOR ) + 1 ) ) ; } catch ( NumberFormatException e ) { e . printStackTrace ( ) ; } return fileIndex ; |
public class NonBlockingStringReader { /** * Marks the present position in the stream . Subsequent calls to reset ( ) will
* reposition the stream to this point .
* @ param nReadAheadLimit
* Limit on the number of characters that may be read while still
* preserving the mark . Because the stream ' s input comes... | ValueEnforcer . isGE0 ( nReadAheadLimit , "ReadAheadLimit" ) ; _ensureOpen ( ) ; m_nMark = m_nNext ; |
public class HeapKeyedStateBackend { /** * Returns the total number of state entries across all keys for the given namespace . */
@ VisibleForTesting public int numKeyValueStateEntries ( Object namespace ) { } } | int sum = 0 ; for ( StateTable < ? , ? , ? > state : registeredKVStates . values ( ) ) { sum += state . sizeOfNamespace ( namespace ) ; } return sum ; |
public class RelatedTablesCoreExtension { /** * Adds an attributes relationship between the base table and related
* attributes table . Creates a default user mapping table if needed .
* @ param baseTableName
* base table name
* @ param relatedAttributesTableName
* related attributes table name
* @ param ma... | return addRelationship ( baseTableName , relatedAttributesTableName , mappingTableName , RelationType . ATTRIBUTES ) ; |
public class MscRuntimeContainerDelegate { /** * ProcessApplicationService implementation / / / / / */
public ProcessApplicationInfo getProcessApplicationInfo ( String processApplicationName ) { } } | MscManagedProcessApplication managedPa = getManagedProcessApplication ( processApplicationName ) ; if ( managedPa == null ) { return null ; } else { return managedPa . getProcessApplicationInfo ( ) ; } |
public class FrequencySketch { /** * Returns the estimated number of occurrences of an element , up to the maximum ( 15 ) .
* @ param hash the hash code of the element to count occurrences of
* @ return the estimated number of occurrences of the element ; possibly zero but never negative */
int frequency ( long has... | long start = ( hash & 3 ) << 2 ; int frequency = countOf ( start , 0 , indexOf ( hash , 0 ) ) ; frequency = Math . min ( frequency , countOf ( start , 1 , indexOf ( hash , 1 ) ) ) ; frequency = Math . min ( frequency , countOf ( start , 2 , indexOf ( hash , 2 ) ) ) ; return Math . min ( frequency , countOf ( start , 3 ... |
public class AppServicePlansInner { /** * Create or update a Virtual Network route in an App Service plan .
* Create or update a Virtual Network route in an App Service plan .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param name Name of the App Service plan .
* @... | return updateVnetRouteWithServiceResponseAsync ( resourceGroupName , name , vnetName , routeName , route ) . map ( new Func1 < ServiceResponse < VnetRouteInner > , VnetRouteInner > ( ) { @ Override public VnetRouteInner call ( ServiceResponse < VnetRouteInner > response ) { return response . body ( ) ; } } ) ; |
public class Bar { /** * Set a gradient color from point 1 with color 1 to point2 with color 2.
* @ param x1 The first horizontal location .
* @ param y1 The first vertical location .
* @ param color1 The first color .
* @ param x2 The last horizontal location .
* @ param y2 The last vertical location .
* @... | gradientColor = new ColorGradient ( x1 , y1 , color1 , x2 , y2 , color2 ) ; |
public class Xml { /** * Find elements through an XPath like pathQuery
* e . g .
* / fruits / orange
* will find the orange element :
* < fruits > < orange / > < / fruits >
* @ param pathQuery path pathQuery string
* @ return { @ code List } of { @ code Node } objects matching the query
* @ throws XmlMode... | return new PathQueryParser ( root ) . pathQuery ( pathQuery ) ; |
public class DescribeInstanceAttributeRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional
* parameters to enable operation dry - run . */
@ Override public Request < DescribeInstanceAttributeRequest > getDryRunRequest ( ) { } } | Request < DescribeInstanceAttributeRequest > request = new DescribeInstanceAttributeRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ; |
public class SystemClassReflectionGenerator { /** * TODO remove extraneous visits to things like lvar names */
public static void generateJLCGDMS ( ClassWriter cw , String classname , String field , String methodname ) { } } | FieldVisitor fv = cw . visitField ( ACC_PUBLIC + ACC_STATIC , field , "Ljava/lang/reflect/Method;" , null , null ) ; fv . visitEnd ( ) ; MethodVisitor mv = cw . visitMethod ( ACC_PRIVATE + ACC_STATIC , field , "(Ljava/lang/Class;)[Ljava/lang/reflect/Method;" , null , null ) ; mv . visitCode ( ) ; Label l0 = new Label (... |
public class ExpressRouteCrossConnectionsInner { /** * Gets the currently advertised ARP table 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... | if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( crossConnectionName == null ) { throw new IllegalArgumentException ( "Parameter crossConnectionName is required and cannot be null." ) ; } if ( peeringName == null ) { throw n... |
public class ICUService { /** * Return a snapshot of the currently registered factories . There
* is no guarantee that the list will still match the current
* factory list of the service subsequent to this call . */
public final List < Factory > factories ( ) { } } | try { factoryLock . acquireRead ( ) ; return new ArrayList < Factory > ( factories ) ; } finally { factoryLock . releaseRead ( ) ; } |
public class RingBuffer { /** * Write buffers content from mark ( included )
* @ param op
* @ param splitter
* @ return
* @ throws IOException */
protected int writeTo ( SparseBufferOperator < B > op , Splitter < SparseBufferOperator < B > > splitter ) throws IOException { } } | return writeTo ( op , splitter , mark , marked ) ; |
public class CPRulePersistenceImpl { /** * Returns all the cp rules .
* @ return the cp rules */
@ Override public List < CPRule > findAll ( ) { } } | return findAll ( QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ; |
public class ParamListFactory { public < T > Param < List < T > > asAny ( ParamReader < List < T > > reader , String name ) { } } | return getParam ( reader , name ) ; |
public class OrderAwarePluginRegistry { /** * Creates a new { @ link OrderAwarePluginRegistry } with the given { @ link Plugin } s and the order of the { @ link Plugin } s
* reverted .
* @ param plugins must not be { @ literal null } .
* @ return
* @ since 2.0 */
public static < S , T extends Plugin < S > > Ord... | return of ( plugins , DEFAULT_REVERSE_COMPARATOR ) ; |
public class BaseGridScreen { /** * Process the " Delete " toolbar command .
* @ return true If command was handled */
public boolean onDelete ( ) { } } | if ( this . getEditing ( ) == false ) { // Can ' t delete on a disabled grid .
String strError = "Can't Delete from disabled grid" ; if ( this . getTask ( ) != null ) if ( this . getTask ( ) . getApplication ( ) != null ) strError = ( ( BaseApplication ) this . getTask ( ) . getApplication ( ) ) . getResources ( Resour... |
public class ModelUtils { /** * Wrap object to a corresponding { @ link IModel }
* @ param o object to wrap
* @ param < K > type of a model to wrap
* @ return { @ link IModel } which contains passed object o */
@ SuppressWarnings ( "unchecked" ) public static < K > IModel < K > model ( K o ) { } } | if ( o instanceof ODocument ) return ( IModel < K > ) new ODocumentModel ( ( ODocument ) o ) ; else if ( o instanceof ODocumentWrapper ) return ( IModel < K > ) new ODocumentWrapperModel < ODocumentWrapper > ( ( ODocumentWrapper ) o ) ; else if ( o instanceof Serializable ) return ( IModel < K > ) Model . of ( ( Serial... |
public class JCusparse { /** * < pre >
* Description : Solution of triangular linear system op ( A ) * X = alpha * F ,
* with multiple right - hand - sides , where A is a sparse matrix in CSR storage
* format , rhs F and solution X are dense tall matrices .
* This routine implements algorithm 1 for this problem... | return checkResult ( cusparseScsrsm_analysisNative ( handle , transA , m , nnz , descrA , csrSortedValA , csrSortedRowPtrA , csrSortedColIndA , info ) ) ; |
public class NativeRSAEngine { /** * initialise the RSA engine .
* @ param forEncryption true if we are encrypting , false otherwise .
* @ param param the necessary RSA key parameters . */
public void init ( boolean forEncryption , CipherParameters param ) { } } | if ( core == null ) { core = new NativeRSACoreEngine ( ) ; } core . init ( forEncryption , param ) ; |
public class ModelHelper { /** * The method translates the internal object StreamConfiguration into REST response object .
* @ param scope the scope of the stream
* @ param streamName the name of the stream
* @ param streamConfiguration The configuration of stream
* @ return Stream properties wrapped in StreamR... | ScalingConfig scalingPolicy = new ScalingConfig ( ) ; if ( streamConfiguration . getScalingPolicy ( ) . getScaleType ( ) == ScalingPolicy . ScaleType . FIXED_NUM_SEGMENTS ) { scalingPolicy . setType ( ScalingConfig . TypeEnum . valueOf ( streamConfiguration . getScalingPolicy ( ) . getScaleType ( ) . name ( ) ) ) ; sca... |
public class FormInputHandler { /** * Creates a new { @ link FormInputHandler } based on this { @ link FormInputHandler } using the specified data key for retrieving
* the value from the { @ link DataSet } associated with this { @ link FormInputHandler } .
* @ param theDataKey
* the data set key used to retrieve ... | checkState ( dataSet != null , "Cannot specify a data key. Please specify a DataSet first." ) ; Fields fields = new Fields ( this ) ; fields . dataKey = theDataKey ; return new FormInputHandler ( fields ) ; |
public class UnderReplicatedBlocks { /** * Empty the queues . */
void clear ( ) { } } | for ( int i = 0 ; i < LEVEL ; i ++ ) { priorityQueues . get ( i ) . clear ( ) ; } raidQueue . clear ( ) ; |
public class TypeVariableSignature { /** * / * ( non - Javadoc )
* @ see io . github . classgraph . TypeSignature # equalsIgnoringTypeParams ( io . github . classgraph . TypeSignature ) */
@ Override public boolean equalsIgnoringTypeParams ( final TypeSignature other ) { } } | if ( other instanceof ClassRefTypeSignature ) { if ( ( ( ClassRefTypeSignature ) other ) . className . equals ( "java.lang.Object" ) ) { // java . lang . Object can be reconciled with any type , so it can be reconciled with
// any type variable
return true ; } // Resolve the type variable against the containing class '... |
public class EntityField { /** * 先创建field , 然后可以通过该方法获取property等属性
* @ param other */
public void copyFromPropertyDescriptor ( EntityField other ) { } } | this . setter = other . setter ; this . getter = other . getter ; this . javaType = other . javaType ; this . name = other . name ; |
public class Routed { /** * When target is a class , this method calls " newInstance " on the class .
* Otherwise it returns the target as is .
* @ return null if target is null */
public static Object instanceFromTarget ( Object target ) throws InstantiationException , IllegalAccessException { } } | if ( target == null ) return null ; if ( target instanceof Class ) { // Create handler from class
Class < ? > klass = ( Class < ? > ) target ; return klass . newInstance ( ) ; } else { return target ; } |
public class DigestServerAuthenticationMethod { /** * Generate the challenge string .
* @ return a generated nonce . */
public String generateNonce ( ) { } } | // Get the time of day and run MD5 over it .
Date date = new Date ( ) ; long time = date . getTime ( ) ; Random rand = new Random ( ) ; long pad = rand . nextLong ( ) ; String nonceString = ( Long . valueOf ( time ) ) . toString ( ) + ( Long . valueOf ( pad ) ) . toString ( ) ; byte mdbytes [ ] = messageDigest . digest... |
public class GoogleCloudStorageReadChannel { /** * Closes this channel .
* @ throws IOException on IO error */
@ Override public void close ( ) throws IOException { } } | if ( ! channelIsOpen ) { logger . atFine ( ) . log ( "Ignoring close: channel for '%s' is not open." , resourceIdString ) ; return ; } logger . atFine ( ) . log ( "Closing channel for '%s'" , resourceIdString ) ; channelIsOpen = false ; closeContentChannel ( ) ; |
public class AbstractStrategy { /** * Print the item ranking and scores for a specific user .
* @ param user The user ( as a String ) .
* @ param scoredItems The item to print rankings for .
* @ param out Where to direct the print .
* @ param format The format of the printer . */
protected void printRanking ( f... | final Map < Double , Set < Long > > preferenceMap = new HashMap < Double , Set < Long > > ( ) ; for ( Map . Entry < Long , Double > e : scoredItems . entrySet ( ) ) { long item = e . getKey ( ) ; double pref = e . getValue ( ) ; // ignore NaN ' s
if ( Double . isNaN ( pref ) ) { continue ; } Set < Long > items = prefer... |
public class ServerStateMachineExecutor { /** * Commits the application of a command to the state machine . */
@ SuppressWarnings ( "unchecked" ) void commit ( ) { } } | // Execute any tasks that were queue during execution of the command .
if ( ! tasks . isEmpty ( ) ) { for ( ServerTask task : tasks ) { context . update ( context . index ( ) , context . clock ( ) . instant ( ) , ServerStateMachineContext . Type . COMMAND ) ; try { task . future . complete ( task . callback . get ( ) )... |
public class Row { /** * Returns a sublist of the cells that belong to the specified family and qualifier .
* @ see RowCell # compareByNative ( ) For details about the ordering . */
public List < RowCell > getCells ( @ Nonnull String family , @ Nonnull ByteString qualifier ) { } } | Preconditions . checkNotNull ( family , "family" ) ; Preconditions . checkNotNull ( qualifier , "qualifier" ) ; int start = getFirst ( family , qualifier ) ; if ( start < 0 ) { return ImmutableList . of ( ) ; } int end = getLast ( family , qualifier , start ) ; return getCells ( ) . subList ( start , end + 1 ) ; |
public class GitlabAPI { /** * Get a list of the namespaces of the authenticated user .
* If the user is an administrator , a list of all namespaces in the GitLab instance is shown .
* @ return A list of gitlab namespace */
public List < GitlabNamespace > getNamespaces ( ) { } } | String tailUrl = GitlabNamespace . URL + PARAM_MAX_ITEMS_PER_PAGE ; return retrieve ( ) . getAll ( tailUrl , GitlabNamespace [ ] . class ) ; |
public class SecurityUtils { /** * It decodes / deobfuscates an encoded password with a human readable prefix .
* @ param encodedPasswordWithPrefix
* @ return a String containing the decoded password */
public static String decodePasswordWithPrefix ( final String encodedPasswordWithPrefix ) { } } | if ( encodedPasswordWithPrefix == null ) { return null ; } if ( hasPrefix ( encodedPasswordWithPrefix ) ) { return decodePassword ( encodedPasswordWithPrefix . substring ( PREFIX . length ( ) ) ) ; } else { return encodedPasswordWithPrefix ; } |
public class LdapPersonAttributeDao { /** * Sets the LdapTemplate , and thus the ContextSource ( implicitly ) .
* @ param ldapTemplate the LdapTemplate to query the LDAP server from . CANNOT be NULL . */
public synchronized void setLdapTemplate ( final LdapTemplate ldapTemplate ) { } } | Assert . notNull ( ldapTemplate , "ldapTemplate cannot be null" ) ; this . ldapTemplate = ldapTemplate ; this . contextSource = this . ldapTemplate . getContextSource ( ) ; |
public class BranchFilterModule { /** * Read and cache filter . */
private FilterUtils getFilterUtils ( final Element ditavalRef ) { } } | if ( ditavalRef . getAttribute ( ATTRIBUTE_NAME_HREF ) . isEmpty ( ) ) { return null ; } final URI href = toURI ( ditavalRef . getAttribute ( ATTRIBUTE_NAME_HREF ) ) ; final URI tmp = currentFile . resolve ( href ) ; final FileInfo fi = job . getFileInfo ( tmp ) ; final URI ditaval = fi . src ; FilterUtils f = filterCa... |
public class XMLConfigAdmin { /** * * updates the Memory Logger
* @ param memoryLogger
* @ throws SecurityException / public void updateMemoryLogger ( String memoryLogger ) throws
* SecurityException { boolean
* hasAccess = ConfigWebUtil . hasAccess ( config , SecurityManager . TYPE _ DEBUGGING ) ; if ( ! hasAc... | Element el = XMLConfigWebFactory . getChildByName ( doc . getDocumentElement ( ) , name ) ; if ( el == null ) { el = doc . createElement ( name ) ; doc . getDocumentElement ( ) . appendChild ( el ) ; } return el ; |
public class OptionEditor { /** * Format the Object as String of concatenated properties . */
public String getAsText ( ) { } } | Object value = getValue ( ) ; if ( value == null ) { return "" ; } String propertyName = null ; // used in error handling below
try { StringBuffer label = new StringBuffer ( ) ; for ( int i = 0 ; i < properties . length ; i ++ ) { propertyName = properties [ i ] ; Class < ? > propertyType = PropertyUtils . getPropertyT... |
public class LogFileHeader { /** * Return the date field stored in the target header
* @ return long The date field . */
public long date ( ) { } } | if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "date" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "date" , new Long ( _date ) ) ; return _date ; |
public class Nfs3 { /** * Query the port and root file handle for NFS server .
* @ throws IOException */
private void prepareRootFhAndNfsPort ( ) throws IOException { } } | if ( ! _prepareLock . tryLock ( ) ) { return ; } try { _port = getNfsPortFromServer ( ) ; _rpcWrapper . setPort ( _port ) ; _rootFileHandle = lookupRootHandle ( ) ; } finally { _prepareLock . unlock ( ) ; } |
public class ExportBucket { /** * Computes the minimal row for a bucket */
private Bytes getMinimalRow ( ) { } } | return Bytes . builder ( bucketRow . length ( ) + 1 ) . append ( bucketRow ) . append ( ':' ) . toBytes ( ) ; |
public class AntStyleParser { /** * FIXME : Refactor ! */
public Appender parse ( String pattern ) throws IllegalArgumentException { } } | List < Appender > appenders = new ArrayList < Appender > ( ) ; int prev = 0 ; int pos = 0 ; while ( ( pos = pattern . indexOf ( VAR_START , pos ) ) >= 0 ) { // Add text between beginning / end of last variable
if ( pos > prev ) { appenders . add ( new TextAppender ( pattern . substring ( prev , pos ) ) ) ; } // Move to... |
public class SecurityUtil { /** * Log shell environment variables associated with Java process . */
public static void logShellEnvironmentVariables ( ) { } } | Map < String , String > env = System . getenv ( ) ; Iterator < String > keys = env . keySet ( ) . iterator ( ) ; while ( keys . hasNext ( ) ) { String key = keys . next ( ) ; String value = env . get ( key ) ; logMessage ( "Env, " + key + "=" + value . trim ( ) ) ; } |
public class WordCluster { /** * 一次性统计概率 , 节约时间 */
private void statisticProb ( ) { } } | System . out . println ( "统计概率" ) ; TIntFloatIterator it = wordProb . iterator ( ) ; while ( it . hasNext ( ) ) { it . advance ( ) ; float v = it . value ( ) / totalword ; it . setValue ( v ) ; int key = it . key ( ) ; if ( key < 0 ) continue ; Cluster cluster = new Cluster ( key , v , alpahbet . lookupString ( key ) )... |
public class AbstrCFMLExprTransformer { /** * Liest den folgenden idetifier ein und prueft ob dieser ein boolscher Wert ist . Im Gegensatz zu
* CFMX wird auch " yes " und " no " als bolscher < wert akzeptiert , was bei CFMX nur beim Umwandeln
* einer Zeichenkette zu einem boolschen Wert der Fall ist . < br / >
* ... | // Die Implementation weicht ein wenig von der Grammatik ab ,
// aber nicht in der Logik sondern rein wie es umgesetzt wurde .
// get First Element of the Variable
Position line = data . srcCode . getPosition ( ) ; Identifier id = identifier ( data , false , true ) ; if ( id == null ) { if ( ! data . srcCode . forwardI... |
public class ReplicatedTree { /** * Adds a new node to the tree and sets its data . If the node doesn not yet exist , it will be created .
* Also , parent nodes will be created if not existent . If the node already has data , then the new data
* will override the old one . If the node already existed , a nodeModifi... | if ( ! remote_calls ) { _put ( fqn , data ) ; return ; } // Changes done by < aos >
// if true , propagate action to the group
if ( send_message ) { if ( channel == null ) { if ( log . isErrorEnabled ( ) ) log . error ( "channel is null, cannot broadcast PUT request" ) ; return ; } try { channel . send ( new Message ( ... |
public class Functions { /** * Create a token , from a clients point of view , for establishing a secure
* communication channel . This is a client side token so it needs to bootstrap
* the token creation .
* @ param context GSSContext for which a connection has been established to the remote peer
* @ return a ... | byte [ ] initialToken = new byte [ 0 ] ; if ( ! context . isEstablished ( ) ) { try { // token is ignored on the first call
initialToken = context . initSecContext ( initialToken , 0 , initialToken . length ) ; return getTokenWithLengthPrefix ( initialToken ) ; } catch ( GSSException ex ) { throw new RuntimeException (... |
public class Utils { /** * Must call when epoll is available */
private static Class < ? extends ServerChannel > epollServerChannelType ( ) { } } | try { Class < ? extends ServerChannel > serverSocketChannel = Class . forName ( "io.netty.channel.epoll.EpollServerSocketChannel" ) . asSubclass ( ServerChannel . class ) ; return serverSocketChannel ; } catch ( ClassNotFoundException e ) { throw new RuntimeException ( "Cannot load EpollServerSocketChannel" , e ) ; } |
public class Result { /** * For interval PSM return values */
public static Result newPSMResult ( int type , String label , Object value ) { } } | Result result = newResult ( ResultConstants . VALUE ) ; result . errorCode = type ; result . mainString = label ; result . valueData = value ; return result ; |
public class AbstractConnectionManager { /** * { @ inheritDoc } */
public boolean dissociateManagedConnection ( Object connection , ManagedConnection mc , ManagedConnectionFactory mcf ) throws ResourceException { } } | log . tracef ( "dissociateManagedConnection(%s, %s, %s)" , connection , mc , mcf ) ; if ( connection == null || mc == null || mcf == null ) throw new ResourceException ( ) ; org . ironjacamar . core . connectionmanager . listener . ConnectionListener cl = pool . findConnectionListener ( mc , connection ) ; if ( cl != n... |
public class ImapHostManagerImpl { /** * Partial implementation of list functionality .
* TODO : Handle wildcards anywhere in store pattern
* ( currently only supported as last character of pattern )
* @ see com . icegreen . greenmail . imap . ImapHostManager # listMailboxes */
private Collection < MailFolder > l... | List < MailFolder > mailboxes = new ArrayList < > ( ) ; String qualifiedPattern = getQualifiedMailboxName ( user , mailboxPattern ) ; for ( MailFolder folder : store . listMailboxes ( qualifiedPattern ) ) { // TODO check subscriptions .
if ( subscribedOnly && ! subscriptions . isSubscribed ( user , folder ) ) { // if n... |
public class PGPUtils { /** * Performs the decryption of the given data .
* @ param privateKey PGP Private Key to decrypt
* @ param data encrypted data
* @ param calculator instance of { @ link BcKeyFingerprintCalculator }
* @ param targetStream stream to receive the decrypted data
* @ throws PGPException if ... | PublicKeyDataDecryptorFactory decryptorFactory = new JcePublicKeyDataDecryptorFactoryBuilder ( ) . setProvider ( PROVIDER ) . setContentProvider ( PROVIDER ) . build ( privateKey ) ; InputStream content = data . getDataStream ( decryptorFactory ) ; PGPObjectFactory plainFactory = new PGPObjectFactory ( content , calcul... |
public class QuartzScheduler { /** * Get the < code > { @ link ITrigger } < / code > instance with the given name and
* group . */
public ITrigger getTrigger ( final TriggerKey triggerKey ) throws SchedulerException { } } | validateState ( ) ; return m_aResources . getJobStore ( ) . retrieveTrigger ( triggerKey ) ; |
public class IdemixEnrollmentRequest { /** * Convert the enrollment request to a JSON object */
private JsonObject toJsonObject ( ) { } } | JsonObjectBuilder factory = Json . createObjectBuilder ( ) ; if ( idemixCredReq != null ) { factory . add ( "request" , idemixCredReq . toJsonObject ( ) ) ; } else { factory . add ( "request" , JsonValue . NULL ) ; } if ( caName != null ) { factory . add ( HFCAClient . FABRIC_CA_REQPROP , caName ) ; } return factory . ... |
public class MathUtil { /** * Replies the cosecant of the specified angle .
* < p > < code > csc ( a ) = 1 / sin ( a ) < / code >
* < p > < img src = " . / doc - files / trigo1 . png " alt = " [ Cosecant function ] " >
* < img src = " . / doc - files / trigo3 . png " alt = " [ Cosecant function ] " >
* @ param ... | Math . class } ) public static double csc ( double angle ) { return 1. / Math . sin ( angle ) ; |
public class WindowedStream { /** * Sets the { @ code Evictor } that should be used to evict elements from a window before emission .
* < p > Note : When using an evictor window performance will degrade significantly , since
* incremental aggregation of window results cannot be used . */
@ PublicEvolving public Win... | if ( windowAssigner instanceof BaseAlignedWindowAssigner ) { throw new UnsupportedOperationException ( "Cannot use a " + windowAssigner . getClass ( ) . getSimpleName ( ) + " with an Evictor." ) ; } this . evictor = evictor ; return this ; |
public class CostlessMeldPairingHeap { /** * Append to decrease pool . */
@ SuppressWarnings ( "unchecked" ) private void addPool ( Node < K , V > n , boolean updateMinimum ) { } } | decreasePool [ decreasePoolSize ] = n ; n . poolIndex = decreasePoolSize ; decreasePoolSize ++ ; if ( updateMinimum && decreasePoolSize > 1 ) { Node < K , V > poolMin = decreasePool [ decreasePoolMinPos ] ; int c ; if ( comparator == null ) { c = ( ( Comparable < ? super K > ) n . key ) . compareTo ( poolMin . key ) ; ... |
public class AbstractJsonDeserializer { /** * Convenience method . Parses a string into a double . If it can no be converted to a double , the
* defaultvalue is returned . Depending on your choice , you can allow null as output or assign it some value
* and have very convenient syntax such as : double d = parseDefa... | if ( input == null ) { return defaultValue ; } Double answer = defaultValue ; try { answer = Double . parseDouble ( input ) ; } catch ( NumberFormatException ignored ) { } return answer ; |
public class TableService { /** * region TableStore Implementation */
@ Override public CompletableFuture < Void > createSegment ( String segmentName , Duration timeout ) { } } | return invokeExtension ( segmentName , e -> e . createSegment ( segmentName , timeout ) , "createSegment" , segmentName ) ; |
public class VisitorState { /** * Gets the original source code that represents the given node .
* < p > Note that this may be different from what is returned by calling . toString ( ) on the node .
* This returns exactly what is in the source code , whereas . toString ( ) pretty - prints the node
* from its AST ... | JCTree node = ( JCTree ) tree ; int start = node . getStartPosition ( ) ; int end = getEndPosition ( node ) ; if ( end < 0 ) { return null ; } return getSourceCode ( ) . subSequence ( start , end ) . toString ( ) ; |
public class XCAInitiatingGatewayAuditor { /** * Audits an ITI - 43 Retrieve Document Set - b event for XCA Initiating Gateway actors . Audits as a XDS Document Registry .
* @ param eventOutcome The event outcome indicator
* @ param consumerUserId The Active Participant UserID for the document consumer ( if using W... | if ( ! isAuditorEnabled ( ) ) { return ; } XDSRepositoryAuditor . getAuditor ( ) . auditRetrieveDocumentSetEvent ( eventOutcome , consumerUserId , consumerUserName , consumerIpAddress , repositoryEndpointUri , documentUniqueIds , repositoryUniqueIds , homeCommunityIds , purposesOfUse , userRoles ) ; |
public class PortletsRESTController { /** * Provides information about all portlets in the portlet registry . NOTE : The response is
* governed by the < code > IPermission . PORTLET _ MANAGER _ xyz < / code > series of permissions . The
* actual level of permission required is based on the current lifecycle state o... | // get a list of all channels
List < IPortletDefinition > allPortlets = portletDefinitionRegistry . getAllPortletDefinitions ( ) ; IAuthorizationPrincipal ap = getAuthorizationPrincipal ( request ) ; List < PortletTuple > rslt = new ArrayList < PortletTuple > ( ) ; for ( IPortletDefinition pdef : allPortlets ) { if ( a... |
public class DelayWatcher { /** * - - - - - Constructor end */
@ Override public void onModify ( WatchEvent < ? > event , Path currentPath ) { } } | if ( this . delay < 1 ) { this . watcher . onModify ( event , currentPath ) ; } else { onDelayModify ( event , currentPath ) ; } |
public class Duration { /** * Converts this duration to the total length in nanoseconds expressed as a { @ code long } .
* If this duration is too large to fit in a { @ code long } nanoseconds , then an
* exception is thrown .
* @ return the total length of the duration in nanoseconds
* @ throws ArithmeticExcep... | long totalNanos = Math . multiplyExact ( seconds , NANOS_PER_SECOND ) ; totalNanos = Math . addExact ( totalNanos , nanos ) ; return totalNanos ; |
public class BackgroundCommandServiceJdo { /** * region > schedule ( API - deprecated ) */
@ Deprecated @ Programmatic @ Override public void schedule ( final ActionInvocationMemento aim , final Command parentCommand , final String targetClassName , final String targetActionName , final String targetArgs ) { } } | final CommandJdo backgroundCommand = newBackgroundCommand ( parentCommand , targetClassName , targetActionName , targetArgs ) ; backgroundCommand . setTargetStr ( aim . getTarget ( ) . toString ( ) ) ; backgroundCommand . setMemento ( aim . asMementoString ( ) ) ; backgroundCommand . setMemberIdentifier ( aim . getActi... |
public class TcpTransporter { /** * - - - LOCAL NODE ' S DESCRIPTOR - - - */
public NodeDescriptor getDescriptor ( ) { } } | cachedDescriptor . writeLock . lock ( ) ; try { // Check timestamp
long current = registry . getTimestamp ( ) ; if ( timestamp . get ( ) == current ) { return cachedDescriptor ; } else { while ( true ) { current = registry . getTimestamp ( ) ; cachedDescriptor . info = registry . getDescriptor ( ) ; if ( current == reg... |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link String } { @ code > } */
@ XmlElementDecl ( namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/" , name = "filter" , scope = GetAppliedPolicies . class ) public JAXBElement < String > createGetAppliedPoli... | return new JAXBElement < String > ( _GetPropertiesFilter_QNAME , String . class , GetAppliedPolicies . class , value ) ; |
public class SshKeyPairGenerator { /** * Generates a new key pair .
* @ param algorithm
* @ param bits
* @ return SshKeyPair
* @ throws IOException */
public static SshKeyPair generateKeyPair ( String algorithm , int bits ) throws IOException , SshException { } } | if ( ! SSH2_RSA . equalsIgnoreCase ( algorithm ) && ! SSH2_DSA . equalsIgnoreCase ( algorithm ) ) { throw new IOException ( algorithm + " is not a supported key algorithm!" ) ; } SshKeyPair pair = new SshKeyPair ( ) ; if ( SSH2_RSA . equalsIgnoreCase ( algorithm ) ) { pair = ComponentManager . getInstance ( ) . generat... |
public class RBACModel { /** * - - - - - inherited methods - - - - - */
@ Override public boolean isAuthorizedForTransaction ( String subject , String transaction ) throws CompatibilityException { } } | getContext ( ) . validateSubject ( subject ) ; getContext ( ) . validateActivity ( transaction ) ; if ( ! roleMembershipUR . containsKey ( subject ) ) return false ; for ( String role : getRolesFor ( subject , true ) ) if ( rolePermissions . isAuthorizedForTransaction ( role , transaction ) ) return true ; return false... |
public class MockScanner { /** * Scan and prepare mocks for the given < code > testClassInstance < / code > and < code > clazz < / code > in the type hierarchy .
* @ return A prepared set of mock */
private Set < Object > scan ( ) { } } | Set < Object > mocks = newMockSafeHashSet ( ) ; for ( Field field : clazz . getDeclaredFields ( ) ) { // mock or spies only
FieldReader fieldReader = new FieldReader ( instance , field ) ; Object mockInstance = preparedMock ( fieldReader . read ( ) , field ) ; if ( mockInstance != null ) { mocks . add ( mockInstance ) ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.