signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class StorageSize { /** * Converts the size of this StorageSize to another unit , rounding the result to an integer < br / >
* This method may result in the loss of information ( due to rounding ) . If precision is required then getDecimalAmount ( unit )
* should be used < br / >
* @ param unit
* the uni... | final BigDecimal amount = getDecimalAmount ( unit ) ; return amount . toBigInteger ( ) ; |
public class WSRdbManagedConnectionImpl { /** * Process request for a CONNECTION _ ERROR _ OCCURRED event .
* @ param event the Connection handle requesting to send the event .
* @ param ex the exception which indicates the connection error , or null if no exception .
* @ param logEvent fire a logging or non - lo... | // Method is not synchronized because of the contract that add / remove event
// listeners will only be used on ManagedConnection create / destroy , when the
// ManagedConnection is not used by any other threads .
// Some object using the physical jdbc connection has received a SQLException that
// when translated to a... |
public class DBInstance { /** * Provides the list of DB parameter groups applied to this DB instance .
* @ param dBParameterGroups
* Provides the list of DB parameter groups applied to this DB instance . */
public void setDBParameterGroups ( java . util . Collection < DBParameterGroupStatus > dBParameterGroups ) { ... | if ( dBParameterGroups == null ) { this . dBParameterGroups = null ; return ; } this . dBParameterGroups = new java . util . ArrayList < DBParameterGroupStatus > ( dBParameterGroups ) ; |
public class SVDModel { /** * Write out K / V pairs */
@ Override protected AutoBuffer writeAll_impl ( AutoBuffer ab ) { } } | ab . putKey ( _output . _u_key ) ; ab . putKey ( _output . _v_key ) ; return super . writeAll_impl ( ab ) ; |
public class DeviceImpl { void set_non_auto_polled_cmd ( final String [ ] s ) { } } | for ( final String value : s ) { ext . non_auto_polled_cmd . add ( value ) ; } |
public class BatchStatementBuilder { /** * Sets the CQL keyspace to execute this batch in . Shortcut for { @ link # setKeyspace ( CqlIdentifier )
* setKeyspace ( CqlIdentifier . fromCql ( keyspaceName ) ) } .
* @ return this builder ; never { @ code null } . */
@ NonNull public BatchStatementBuilder setKeyspace ( @... | return setKeyspace ( CqlIdentifier . fromCql ( keyspaceName ) ) ; |
public class MtasPennTreebankParser { /** * Creates the node mappings .
* @ param mtasTokenIdFactory
* the mtas token id factory
* @ param level
* the level
* @ param parentLevel
* the parent level */
private void createNodeMappings ( MtasTokenIdFactory mtasTokenIdFactory , Level level , Level parentLevel )... | MtasToken nodeToken ; if ( level . node != null && level . positionStart != null && level . positionEnd != null ) { nodeToken = new MtasTokenString ( mtasTokenIdFactory . createTokenId ( ) , level . node , "" ) ; nodeToken . setOffset ( level . offsetStart , level . offsetEnd ) ; nodeToken . setRealOffset ( level . rea... |
public class ComputeTypeMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ComputeType computeType , ProtocolMarshaller protocolMarshaller ) { } } | if ( computeType == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( computeType . getName ( ) , NAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class MetaPropertyVersion { /** * Compares two string ordered lists containing numbers .
* @ return - 1 when first group is higher , 0 if equals , 1 when second group is higher */
private static int compareTo ( Deque < String > first , Deque < String > second ) { } } | if ( 0 == first . size ( ) && 0 == second . size ( ) ) { return 0 ; } if ( 0 == first . size ( ) ) { return 1 ; } if ( 0 == second . size ( ) ) { return - 1 ; } int headsComparation = ( Integer . valueOf ( first . remove ( ) ) ) . compareTo ( Integer . parseInt ( second . remove ( ) ) ) ; if ( 0 == headsComparation ) {... |
public class MinioClient { /** * Get bucket life cycle configuration .
* @ param bucketName Bucket name .
* < / p > < b > Example : < / b > < br >
* < pre > { @ code String bucketLifeCycle = minioClient . getBucketLifecycle ( " my - bucketname " ) ;
* } < / pre >
* @ throws InvalidBucketNameException upon inv... | Map < String , String > queryParamMap = new HashMap < > ( ) ; queryParamMap . put ( "lifecycle" , "" ) ; HttpResponse response = null ; String bodyContent = "" ; Scanner scanner = null ; try { response = executeGet ( bucketName , "" , null , queryParamMap ) ; scanner = new Scanner ( response . body ( ) . charStream ( )... |
public class LCTManager { /** * Extracts the constant fields from the specified class using the ClassInspector . */
public void register ( Class < ? > aClass ) { } } | List < ConstantField > tmp = inspector . getConstants ( aClass ) ; constantList . addAll ( tmp ) ; for ( ConstantField constant : tmp ) constants . put ( constant . name , constant ) ; |
public class Checks { /** * Performs check with the regular expression pattern .
* @ param reference reference to check
* @ param pattern the regular expression pattern
* @ param errorMessage the exception message to use if the check fails ; will
* be converted to a string using { @ link String # valueOf ( Obje... | checkMatches ( reference , pattern , String . valueOf ( errorMessage ) , EMPTY_ERROR_MESSAGE_ARGS ) ; |
public class TypeUtils { /** * Format a { @ link TypeVariable } including its { @ link GenericDeclaration } .
* @ param var the type variable to create a String representation for , not { @ code null }
* @ return String
* @ since 3.2 */
public static String toLongString ( final TypeVariable < ? > var ) { } } | Validate . notNull ( var , "var is null" ) ; final StringBuilder buf = new StringBuilder ( ) ; final GenericDeclaration d = var . getGenericDeclaration ( ) ; if ( d instanceof Class < ? > ) { Class < ? > c = ( Class < ? > ) d ; while ( true ) { if ( c . getEnclosingClass ( ) == null ) { buf . insert ( 0 , c . getName (... |
public class ClientDObjectMgr { /** * Called periodically to flush any objects that have been lingering due to a previously
* enacted flush delay . */
protected void flushObjects ( ) { } } | long now = System . currentTimeMillis ( ) ; for ( Iterator < IntMap . IntEntry < FlushRecord > > iter = _flushes . intEntrySet ( ) . iterator ( ) ; iter . hasNext ( ) ; ) { IntMap . IntEntry < FlushRecord > entry = iter . next ( ) ; // int oid = entry . getIntKey ( ) ;
FlushRecord rec = entry . getValue ( ) ; if ( rec ... |
public class PaigeTarjanInitializers { /** * Initializes the partition refinement data structure from a given abstracted deterministic automaton , using a
* predefined initial partitioning mode .
* @ param pt
* the partition refinement data structure
* @ param absAutomaton
* the abstraction of the input autom... | initCompleteDeterministic ( pt , absAutomaton , ip . initialClassifier ( absAutomaton ) , pruneUnreachable ) ; |
public class DomainTopicsInner { /** * List domain topics .
* List all the topics in a domain .
* @ param resourceGroupName The name of the resource group within the user ' s subscription .
* @ param domainName Domain name .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ retu... | return listByDomainWithServiceResponseAsync ( resourceGroupName , domainName ) . map ( new Func1 < ServiceResponse < List < DomainTopicInner > > , List < DomainTopicInner > > ( ) { @ Override public List < DomainTopicInner > call ( ServiceResponse < List < DomainTopicInner > > response ) { return response . body ( ) ; ... |
public class FpUtils { /** * Returns a floating - point power of two in the normal range . */
static double powerOfTwoD ( int n ) { } } | assert ( n >= DoubleConsts . MIN_EXPONENT && n <= DoubleConsts . MAX_EXPONENT ) ; return Double . longBitsToDouble ( ( ( ( long ) n + ( long ) DoubleConsts . EXP_BIAS ) << ( DoubleConsts . SIGNIFICAND_WIDTH - 1 ) ) & DoubleConsts . EXP_BIT_MASK ) ; |
public class ManyToOneAttribute { /** * Sets the specified long attribute to the specified value .
* @ param name name of the attribute
* @ param value value of the attribute
* @ since 1.9.0 */
public void setLongAttribute ( String name , Long value ) { } } | ensureValue ( ) ; Attribute attribute = new LongAttribute ( value ) ; attribute . setEditable ( isEditable ( name ) ) ; getValue ( ) . getAllAttributes ( ) . put ( name , attribute ) ; |
public class HttpServer { /** * Start the server . Does not wait for the server to start . */
public void start ( ) throws IOException { } } | try { int port = 0 ; int oriPort = listener . getPort ( ) ; // The original requested port
while ( true ) { try { port = webServer . getConnectors ( ) [ 0 ] . getLocalPort ( ) ; LOG . info ( "Port returned by webServer.getConnectors()[0]." + "getLocalPort() before open() is " + port + ". Opening the listener on " + ori... |
public class ClinAsserTraitSetType { /** * Gets the value of the attributeSet property .
* This accessor method returns a reference to the live list ,
* not a snapshot . Therefore any modification you make to the
* returned list will be present inside the JAXB object .
* This is why there is not a < CODE > set ... | if ( attributeSet == null ) { attributeSet = new ArrayList < ClinAsserTraitSetType . AttributeSet > ( ) ; } return this . attributeSet ; |
public class RemoteMessageRequest { /** * / * ( non - Javadoc )
* @ see com . ibm . ws . sib . processor . runtime . SIMPRemoteMessageRequestControllable # getRequestMessageInfo ( ) */
public SIMPRequestMessageInfo getRequestMessageInfo ( ) throws SIMPRuntimeOperationFailedException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getRequestMessageInfo" ) ; SIMPRequestMessageInfo requestMessageInfo = null ; try { if ( State . REQUEST . toString ( ) . equals ( getState ( ) ) ) { // This RemoteMessageRequest is in state request so lets get the info
Tic... |
public class BrokerSession { /** * Performs a remote procedure call .
* @ param name Name of the remote procedure . This has the format :
* < pre >
* & lt ; remote procedure name & gt ; [ : & lt ; remote procedure version & gt ; ] [ : & lt ; calling context & gt ; ]
* < / pre >
* where only the remote procedu... | ensureConnection ( ) ; String version = "" ; String context = connectionParams . getAppid ( ) ; if ( name . contains ( ":" ) ) { String pcs [ ] = StrUtil . split ( name , ":" , 3 , true ) ; name = pcs [ 0 ] ; version = pcs [ 1 ] ; context = pcs [ 2 ] . isEmpty ( ) ? context : pcs [ 2 ] ; } Request request = new Request... |
public class ScriptPluginProviderLoader { /** * Load plugin metadata for a file and zip inputstream
* @ param jar the file
* @ param zipinput zip input stream
* @ return loaded metadata , or null if it is invalid or not found */
static PluginMeta loadMeta ( final File jar , final ZipInputStream zipinput ) throws ... | final String basename = basename ( jar ) ; PluginMeta metadata = null ; boolean topfound = false ; boolean found = false ; boolean dirfound = false ; boolean resfound = false ; ZipEntry nextEntry = zipinput . getNextEntry ( ) ; Set < String > paths = new HashSet < > ( ) ; while ( null != nextEntry ) { paths . add ( nex... |
public class OperationFuture { /** * Whether or not the Operation is done and result can be retrieved with
* get ( ) .
* The most common way to wait for this OperationFuture is to use the get ( )
* method which will block . This method allows one to check if it ' s complete
* without blocking .
* @ return tru... | assert op != null : "No operation" ; return latch . getCount ( ) == 0 || op . isCancelled ( ) || op . getState ( ) == OperationState . COMPLETE ; |
public class PaxWicketApplicationFactory { /** * < p > createPaxWicketApplicationFactory . < / p >
* @ param bundleContext a { @ link org . osgi . framework . BundleContext } object .
* @ param webApplicationFactory a { @ link org . ops4j . pax . wicket . api . WebApplicationFactory } object .
* @ param reference... | File tmpDir = retrieveTmpFile ( bundleContext ) ; tmpDir . mkdirs ( ) ; String mountPoint = ( String ) reference . getProperty ( Constants . MOUNTPOINT ) ; String applicationName = ( String ) reference . getProperty ( Constants . APPLICATION_NAME ) ; Map < String , String > contextParams = ( Map < String , String > ) r... |
public class BigramCollocationFinder { /** * Help function for calculating likelihood ratio statistic . */
private double logL ( int k , long n , double x ) { } } | if ( x == 0.0 ) x = 0.01 ; if ( x == 1.0 ) x = 0.99 ; return k * Math . log ( x ) + ( n - k ) * Math . log ( 1 - x ) ; |
public class FTPClient { /** * Reads a GFD . 47 compliant 127 reply and extracts the port
* information from it . */
protected HostPort get127Reply ( ) throws ServerException , IOException , FTPReplyParseException { } } | Reply reply = controlChannel . read ( ) ; if ( Reply . isTransientNegativeCompletion ( reply ) || Reply . isPermanentNegativeCompletion ( reply ) ) { throw ServerException . embedUnexpectedReplyCodeException ( new UnexpectedReplyCodeException ( reply ) , reply . getMessage ( ) ) ; } if ( reply . getCode ( ) != 127 ) { ... |
public class TextUtil { /** * Format the text to be sure that each line is not
* more longer than the specified critera .
* @ param text is the string to cut
* @ param critera is the critera to respect .
* @ param output is the given { @ code text } splitted in lines separated by < code > \ n < / code > .
* @... | cutStringAlgo ( text , critera , new CutStringToArray ( output ) ) ; |
public class QuatSymmetryResults { /** * Determine if this symmetry result is a subset of the other Symmetry result .
* Checks the following conditions :
* - ' Other ' includes all subunits of ' this ' .
* - ' Other ' has the same or higher order than ' this ' .
* Special treatment for the helical symmetry :
... | if ( other . getSymmetry ( ) . startsWith ( "H" ) ) { if ( this . getSymmetry ( ) . startsWith ( "C" ) || this . getSymmetry ( ) . startsWith ( "H" ) ) { if ( other . subunits . containsAll ( this . subunits ) ) { return true ; } } return false ; } if ( this . getSymmetry ( ) . startsWith ( "H" ) ) { return false ; } i... |
public class GeoJsonReaderDriver { /** * Parses a GeoJSON coordinate array and check if it ' s wellformed . The first
* token corresponds to the first X value . The last token correponds to the
* end of the coordinate array " ] " .
* Parsed syntax :
* 100.0 , 0.0]
* @ param jp
* @ throws IOException
* @ r... | jp . nextToken ( ) ; jp . nextToken ( ) ; // second value
// We look for a z value
jp . nextToken ( ) ; if ( jp . getCurrentToken ( ) != JsonToken . END_ARRAY ) { jp . nextToken ( ) ; // exit array
} jp . nextToken ( ) ; |
public class CmsSearchDialog { /** * Returns a list of < code > { @ link CmsSelectWidgetOption } < / code > objects for field list selection . < p >
* @ return a list of < code > { @ link CmsSelectWidgetOption } < / code > objects */
private List < CmsSelectWidgetOption > getFieldList ( ) { } } | List < CmsSelectWidgetOption > retVal = new ArrayList < CmsSelectWidgetOption > ( ) ; try { Iterator < CmsLuceneField > i = getFields ( ) . iterator ( ) ; while ( i . hasNext ( ) ) { CmsLuceneField field = i . next ( ) ; if ( isInitialCall ( ) ) { // search form is in the initial state
retVal . add ( new CmsSelectWidge... |
public class PropertyFilterList { /** * Returns the amount of previous remaining list nodes . */
public int getPreviousRemaining ( ) { } } | int remaining = mPrevRemaining ; if ( remaining < 0 ) { mPrevRemaining = remaining = ( ( mPrev == null ) ? 0 : ( mPrev . getPreviousRemaining ( ) + 1 ) ) ; } return remaining ; |
public class DsParser { /** * Store a driver
* @ param drv The driver
* @ param writer The writer
* @ exception Exception Thrown if an error occurs */
protected void storeDriver ( Driver drv , XMLStreamWriter writer ) throws Exception { } } | writer . writeStartElement ( XML . ELEMENT_DRIVER ) ; if ( drv . getName ( ) != null ) writer . writeAttribute ( XML . ATTRIBUTE_NAME , drv . getValue ( XML . ATTRIBUTE_NAME , drv . getName ( ) ) ) ; if ( drv . getModule ( ) != null ) writer . writeAttribute ( XML . ATTRIBUTE_MODULE , drv . getValue ( XML . ATTRIBUTE_M... |
public class RedisStrSortSet { /** * 删除有序集合中的一个成员
* @ param member
* @ return */
public boolean remove ( String mem ) { } } | try { return getJedisCommands ( groupName ) . zrem ( key , mem ) >= 1 ; } finally { getJedisProvider ( groupName ) . release ( ) ; } |
public class ExportGeneration { /** * Create export ack mailbox during generation initialization , do nothing if generation has already initialized .
* @ param localPartitions locally covered partitions */
private void createAckMailboxesIfNeeded ( final Set < Integer > localPartitions ) { } } | m_mailboxesZKPath = VoltZK . exportGenerations + "/" + "mailboxes" ; if ( m_mbox == null ) { m_mbox = new LocalMailbox ( m_messenger ) { @ Override public void deliver ( VoltMessage message ) { if ( message instanceof BinaryPayloadMessage ) { BinaryPayloadMessage bpm = ( BinaryPayloadMessage ) message ; ByteBuffer buf ... |
public class RandomCollectionUtils { /** * Returns a list filled randomly from the given elements .
* @ param elements elements to randomly fill list from
* @ param size range that the size of the list will be randomly chosen from
* @ param < T > the type of elements in the given iterable
* @ return list filled... | checkArgument ( ! isEmpty ( elements ) , "Elements to populate from must not be empty" ) ; return randomListFrom ( ( ) -> IterableUtils . randomFrom ( elements ) , size ) ; |
public class BackupConsole { /** * Check is " / repo " or " / repo / ws " parameter .
* @ param parameter
* String , parameter .
* @ return Boolean
* return " true " if it " / repo " or " / repo / ws " parameter */
private static boolean isRepoWS ( String parameter ) { } } | String repWS = parameter ; repWS = repWS . replaceAll ( "\\\\" , "/" ) ; if ( ! repWS . matches ( "[/][^/]+" ) && ! repWS . matches ( "[/][^/]+[/][^/]+" ) ) { return false ; } else { return true ; } |
public class Agent { /** * / * Methods required to extend JGroupsJobManager . */
@ Override public BubingJob fromString ( final String s ) { } } | final URI url = BURL . parse ( s ) ; if ( url != null && url . isAbsolute ( ) ) return new BubingJob ( ByteArrayList . wrap ( BURL . toByteArray ( url ) ) ) ; throw new IllegalArgumentException ( ) ; |
public class TableManipulationConfigurationBuilder { /** * The name of the database column used to store the entries */
public S dataColumnName ( String dataColumnName ) { } } | attributes . attribute ( DATA_COLUMN_NAME ) . set ( dataColumnName ) ; return self ( ) ; |
public class Configuration { /** * Enforce the fact that a parameter is mandatory
* @ param name The name of the parameter
* @ return The value found
* @ throws RuntimeException When a mandatory parameter is missing */
private String getMandatory ( String name ) { } } | if ( ! config . containsKey ( name ) ) { throw new RuntimeException ( name + " parameter is missing." ) ; } else { return config . getString ( name ) ; } |
public class DiscoveryClientConfiguration { /** * Sets the Discovery servers to use for the default zone .
* @ param defaultZone The default zone */
public void setDefaultZone ( List < URL > defaultZone ) { } } | this . defaultZone = defaultZone . stream ( ) . map ( uriMapper ( ) ) . map ( uri -> ServiceInstance . builder ( getServiceID ( ) , uri ) . build ( ) ) . collect ( Collectors . toList ( ) ) ; |
public class RoleResource1 { /** * Returns all roles for which the caller has read access . Since the number of roles is typically low
* this call does not support " from " or " limit " parameters similar to the system or record . */
@ GET public Iterator < EmoRole > getAllRoles ( final @ Authenticated Subject subjec... | return _uac . getAllRoles ( subject ) ; |
public class CmsEditSearchIndexDialog { /** * Returns the rebuild mode widget configuration . < p >
* @ return the rebuild mode widget configuration */
private List < CmsSelectWidgetOption > getRebuildModeWidgetConfiguration ( ) { } } | List < CmsSelectWidgetOption > result = new ArrayList < CmsSelectWidgetOption > ( ) ; String rebuildMode = getSearchIndexIndex ( ) . getRebuildMode ( ) ; result . add ( new CmsSelectWidgetOption ( "auto" , "auto" . equals ( rebuildMode ) ) ) ; result . add ( new CmsSelectWidgetOption ( "manual" , "manual" . equals ( re... |
public class JSMessageImpl { /** * Locking : The caller is expected to hold the lock . */
void invalidateSchemaCache ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) JmfTr . entry ( this , tc , "invalidateSchemaCache" ) ; // If this is the master message , clear the cache . . . .
if ( isMaster ( ) ) { schemata = null ; } // . . . otherwise call on up the tree .
else { getParent ( ) . invalidateSchemaCache ( ... |
public class JavaBackedType { /** * If method m is annotated with FEELProperty , will return FEELProperty . value , otherwise empty . */
private static Optional < String > methodToCustomProperty ( Method m ) { } } | return Optional . ofNullable ( m . getAnnotation ( FEELProperty . class ) ) . map ( a -> a . value ( ) ) ; |
public class StackBenchmark { /** * Bench for pushing the data to the { @ link FastIntStack } . */
@ Bench ( runs = RUNS ) public void benchFastIntPush ( ) { } } | fastInt = new FastIntStack ( ) ; for ( final int i : intData ) { fastInt . push ( i ) ; } |
public class SchemaRepositoryParser { /** * Decides whether the given element is a xml schema repository .
* Note :
* If the " type " attribute has not been set , the repository is interpreted as a xml repository by definition .
* This is important to guarantee downwards compatibility .
* @ param element The el... | String schemaRepositoryType = element . getAttribute ( "type" ) ; return StringUtils . isEmpty ( schemaRepositoryType ) || "xml" . equals ( schemaRepositoryType ) ; |
public class DateBackwardHandler { /** * If the current date of the give calculator is a non - working day , it will
* be moved according to the algorithm implemented .
* @ param calculator
* the calculator
* @ return the date which may have moved . */
@ Override public Date moveCurrentDate ( final BaseCalculat... | return adjustDate ( calculator . getCurrentBusinessDate ( ) , - 1 , calculator ) ; |
public class DSResultIterator { /** * ( non - Javadoc )
* @ see com . impetus . client . cassandra . query . ResultIterator # next ( ) */
@ Override public E next ( ) { } } | if ( results != null && ! results . isEmpty ( ) && count < results . size ( ) ) { current = results . get ( count ++ ) ; return current ; } else { throw new NoSuchElementException ( "No object found in the iterator... Use hasNext() to check for valid next()" ) ; } |
public class GrailsWebRequest { /** * Looks up the current Grails WebRequest instance
* @ return The GrailsWebRequest instance */
public static @ Nullable GrailsWebRequest lookup ( ) { } } | GrailsWebRequest webRequest = null ; RequestAttributes requestAttributes = RequestContextHolder . getRequestAttributes ( ) ; if ( requestAttributes instanceof GrailsWebRequest ) { webRequest = ( GrailsWebRequest ) requestAttributes ; } return webRequest ; |
public class DateUtils { /** * Get how many seconds between two date .
* @ param date1 date to be tested .
* @ param date2 date to be tested .
* @ return how many seconds between two date . */
public static long subSeconds ( final Date date1 , final Date date2 ) { } } | return subTime ( date1 , date2 , DatePeriod . SECOND ) ; |
public class ConfigurationsInner { /** * Configures the HTTP settings on the specified cluster . This API is deprecated , please use UpdateGatewaySettings in cluster endpoint instead .
* @ param resourceGroupName The name of the resource group .
* @ param clusterName The name of the cluster .
* @ param configurat... | if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( cluster... |
public class ModelSqlUtils { /** * use getter to guess column name , if there is annotation then use annotation value , if not then guess from field name
* @ param getter
* @ param f
* @ return
* @ throws NoColumnAnnotationFoundException */
private static String getColumnNameFromGetter ( Method getter , Field f... | String columnName = "" ; Column columnAnno = getter . getAnnotation ( Column . class ) ; if ( columnAnno != null ) { // 如果是列注解就读取name属性
columnName = columnAnno . name ( ) ; } if ( columnName == null || "" . equals ( columnName ) ) { // 如果没有列注解就用命名方式去猜
columnName = IdUtils . toUnderscore ( f . getName ( ) ) ; } return c... |
public class CRDTMigrationTask { /** * Performs migration of a { @ link CRDTReplicationAwareService } to the
* given target .
* @ param service the service to migrate
* @ param target the target to migrate to
* @ param maxConfiguredReplicaCount the maximum configured replica count
* for the CRDTs to be migrat... | if ( Thread . currentThread ( ) . isInterrupted ( ) ) { return false ; } final OperationService operationService = nodeEngine . getOperationService ( ) ; final CRDTReplicationContainer migrationOperation = service . prepareMigrationOperation ( maxConfiguredReplicaCount ) ; if ( migrationOperation == null ) { logger . f... |
public class GroveQTouch_Example { /** * This function prints out the button numbers from 0 through 6
* @ param buttonNumber */
public static void printButtons ( int buttonNumber ) { } } | boolean buttonPressed = false ; System . out . print ( "Button Pressed: " ) ; for ( int i = 0 ; i < 7 ; i ++ ) { if ( ( buttonNumber & ( 1 << i ) ) != 0 ) { System . out . println ( i + " " ) ; buttonPressed = true ; } } if ( ! buttonPressed ) { System . out . println ( "None " ) ; } |
public class SpdyStreamStatus { /** * Returns the { @ link SpdyStreamStatus } represented by the specified code .
* If the specified code is a defined SPDY status code , a cached instance
* will be returned . Otherwise , a new instance will be returned . */
public static SpdyStreamStatus valueOf ( int code ) { } } | if ( code == 0 ) { throw new IllegalArgumentException ( "0 is not a valid status code for a RST_STREAM" ) ; } switch ( code ) { case 1 : return PROTOCOL_ERROR ; case 2 : return INVALID_STREAM ; case 3 : return REFUSED_STREAM ; case 4 : return UNSUPPORTED_VERSION ; case 5 : return CANCEL ; case 6 : return INTERNAL_ERROR... |
public class Trace { /** * Put spans with null endpoints first , so that their data can be attached to the first span with
* the same ID and endpoint . It is possible that a server can get the same request on a different
* port . Not addressing this . */
static int compareEndpoint ( Endpoint left , Endpoint right )... | if ( left == null ) { // nulls first
return ( right == null ) ? 0 : - 1 ; } else if ( right == null ) { return 1 ; } int byService = nullSafeCompareTo ( left . serviceName ( ) , right . serviceName ( ) , false ) ; if ( byService != 0 ) return byService ; int byIpV4 = nullSafeCompareTo ( left . ipv4 ( ) , right . ipv4 (... |
public class MessageSetImpl { /** * Gets messages in the given channel before a given message in any channel while they meet the given condition .
* If the first message does not match the condition , an empty set is returned .
* @ param channel The channel of the messages .
* @ param condition The condition that... | return getMessagesWhile ( channel , condition , before , - 1 ) ; |
public class SystemInputs { /** * Maps every property in the given FunctionInputDef to the conditional elements that reference it . */
public static Map < String , Collection < IConditional > > getPropertyReferences ( FunctionInputDef function ) { } } | SetValuedMap < String , IConditional > refs = MultiMapUtils . newSetValuedHashMap ( ) ; conditionals ( function ) . forEach ( conditional -> propertiesReferenced ( conditional . getCondition ( ) ) . forEach ( p -> refs . put ( p , conditional ) ) ) ; return refs . asMap ( ) ; |
public class Main { /** * Parse command - line arguments and start server . */
public static void main ( String [ ] args ) throws IOException { } } | if ( args . length != 3 ) { System . out . println ( "" ) ; System . out . println ( "Usage: COMMAND <http-listen-port> <app-info-file> <database-file>" ) ; System . out . println ( "" ) ; System . out . println ( " <http-listen-port>: The port to run the HTTP server on. For example," ) ; System . out . println ( " ... |
public class JacksonJsonNode { /** * Maps the json represented by this object to a java object of the given type .
* @ throws SpinJsonException if the json representation cannot be mapped to the specified type */
public < C > C mapTo ( Class < C > type ) { } } | DataFormatMapper mapper = dataFormat . getMapper ( ) ; return mapper . mapInternalToJava ( jsonNode , type ) ; |
public class SetupProjectProcess { /** * PopulateSourceDir Method . */
public boolean populateSourceDir ( String templateDir ) { } } | URL fromDirUrl = this . getTask ( ) . getApplication ( ) . getResourceURL ( templateDir , null ) ; if ( "jar" . equalsIgnoreCase ( fromDirUrl . getProtocol ( ) ) ) { // Copy jar files
try { String fileName = fromDirUrl . getFile ( ) ; if ( fileName . lastIndexOf ( ':' ) != - 1 ) fileName = fileName . substring ( fileNa... |
public class PathMessageBodyWriter { /** * { @ inheritDoc } */
@ Override public void writeTo ( Path path , Class < ? > type , Type genericType , Annotation [ ] annotations , MediaType mediaType , MultivaluedMap < String , Object > httpHeaders , OutputStream entityStream ) throws IOException , WebApplicationException {... | try ( InputStream in = Files . newInputStream ( path ) ) { ReaderWriter . writeTo ( in , entityStream ) ; } |
public class AbstractReadableProperty { /** * Notifies the listeners that the property value has changed , if the property is not inhibited .
* @ param oldValue Previous value .
* @ param newValue New value .
* @ see # maybeNotifyListeners ( Object , Object )
* @ see # doNotifyListeners ( Object , Object ) */
p... | if ( inhibited ) { inhibitCount ++ ; lastInhibitedValue = newValue ; } else { lastInhibitedValue = newValue ; // Just in case , even though not really necessary
lastNonInhibitedValue = newValue ; doNotifyListeners ( oldValue , newValue ) ; } |
public class OpenSslSessionStats { /** * Returns the number of sessions proposed by clients that were not found in the internal session cache
* in server mode . */
public long misses ( ) { } } | Lock readerLock = context . ctxLock . readLock ( ) ; readerLock . lock ( ) ; try { return SSLContext . sessionMisses ( context . ctx ) ; } finally { readerLock . unlock ( ) ; } |
public class TrainingSpecification { /** * A list of the instance types that this algorithm can use for training .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setSupportedTrainingInstanceTypes ( java . util . Collection ) } or
* { @ link # withSupported... | if ( this . supportedTrainingInstanceTypes == null ) { setSupportedTrainingInstanceTypes ( new java . util . ArrayList < String > ( supportedTrainingInstanceTypes . length ) ) ; } for ( String ele : supportedTrainingInstanceTypes ) { this . supportedTrainingInstanceTypes . add ( ele ) ; } return this ; |
public class ProcyonDecompiler { /** * Default settings set type loader to ClasspathTypeLoader if not set before . */
private DecompilerSettings getDefaultSettings ( File outputDir ) { } } | DecompilerSettings settings = new DecompilerSettings ( ) ; procyonConf . setDecompilerSettings ( settings ) ; settings . setOutputDirectory ( outputDir . getPath ( ) ) ; settings . setShowSyntheticMembers ( false ) ; settings . setForceExplicitImports ( true ) ; if ( settings . getTypeLoader ( ) == null ) settings . se... |
public class CmsMacroFormatterResolver { /** * Resolves the macro . < p >
* @ throws IOException in case writing to the page context output stream fails
* @ throws CmsException in case reading the macro settings fails */
public void resolve ( ) throws IOException , CmsException { } } | initMacroContent ( ) ; String input = getMacroInput ( ) ; if ( input == null ) { return ; } if ( input . length ( ) < 3 ) { // macro must have at last 3 chars " $ { } " or " % ( ) "
m_context . getOut ( ) . print ( input ) ; return ; } int newDelimPos = input . indexOf ( I_CmsMacroResolver . MACRO_DELIMITER ) ; int old... |
public class MethodCompiler { /** * Add new local variable
* @ param name
* @ param type */
public void addVariable ( String name , TypeMirror type ) { } } | localVariables . add ( new LocalVariable ( executableElement , type , name ) ) ; |
public class NorwegianDateUtil { /** * Check if the given date represents the given date and month .
* @ param cal
* The Calendar object representing date to check .
* @ param date
* The date .
* @ param month
* The month .
* @ return true if they match , false otherwise . */
private static boolean checkD... | return cal . get ( Calendar . DATE ) == date && cal . get ( Calendar . MONTH ) == month ; |
public class SpecificationAction { /** * < p > getRenderedResults . < / p >
* @ return a { @ link java . lang . String } object . */
public String getRenderedResults ( ) { } } | String results = execution . getResults ( ) ; if ( results != null ) { results = results . replaceAll ( "greenpepper-manage-not-rendered" , "greenpepper-manage" ) ; results = results . replaceAll ( "greenpepper-hierarchy-not-rendered" , "greenpepper-hierarchy" ) ; results = results . replaceAll ( "greenpepper-children-... |
public class SetUtils { /** * Return is s1 \ s2 */
public static < T > Set < T > difference ( Collection < ? extends T > s1 , Collection < ? extends T > s2 ) { } } | Set < T > s3 = new HashSet < > ( s1 ) ; s3 . removeAll ( s2 ) ; return s3 ; |
public class A_CmsPublishGroupHelper { /** * Gets the difference in days between to dates given as longs . < p >
* The first date must be later than the second date .
* @ param first the first date
* @ param second the second date
* @ return the difference between the two dates in days */
public int getDayDiffe... | Calendar firstDay = getStartOfDay ( first ) ; Calendar secondDay = getStartOfDay ( second ) ; int result = 0 ; if ( first >= second ) { while ( firstDay . after ( secondDay ) ) { firstDay . add ( Calendar . DAY_OF_MONTH , - 1 ) ; result += 1 ; } } else { while ( secondDay . after ( firstDay ) ) { secondDay . add ( Cale... |
public class StaticFilesConfiguration { /** * Clears all static file configuration */
public void clear ( ) { } } | if ( staticResourceHandlers != null ) { staticResourceHandlers . clear ( ) ; staticResourceHandlers = null ; } staticResourcesSet = false ; externalStaticResourcesSet = false ; |
public class ProxyHandler { /** * Is scheme , host & port Forbidden .
* @ param scheme A scheme that mast be in the proxySchemes StringMap .
* @ param host A host that must pass the white and black lists
* @ param port A port that must in the allowedConnectPorts Set
* @ param openNonPrivPorts If true ports grea... | // Check port
Integer p = new Integer ( port ) ; if ( port > 0 && ! _allowedConnectPorts . contains ( p ) ) { if ( ! openNonPrivPorts || port <= 1024 ) return true ; } // Must be a scheme that can be proxied .
if ( scheme == null || ! _ProxySchemes . containsKey ( scheme ) ) return true ; // Must be in any defined whit... |
public class MaskImpl { /** * Method insert { @ code input } to the buffer . Only validated characters would be inserted .
* Hardcoded slots are omitted . Method returns new cursor position that is affected by input
* and
* { @ code cursorAfterTrailingHardcoded } flag . In most cases if input string is followed b... | if ( slots . isEmpty ( ) || ! slots . checkIsIndex ( position ) || input == null || input . length ( ) == 0 ) { return position ; } showHardcodedTail = true ; int cursorPosition = position ; Slot slotCandidate = slots . getSlot ( position ) ; if ( forbidInputWhenFilled && filledFrom ( slotCandidate ) ) { return positio... |
public class VodClient { /** * Load a media resource from URL to VOD .
* @ param sourceUrl The source url of the media resource
* @ param title The title string of the media resource
* @ param description The description string of the media resource
* @ param transcodingPresetGroupName set transcoding presetgro... | checkStringNotEmpty ( sourceUrl , "sourceUrl should not be null or empty!" ) ; // generate media Id
GenerateMediaIdResponse generateMediaIdresponse ; if ( mode == null ) { generateMediaIdresponse = applyMedia ( ) ; } else { generateMediaIdresponse = applyMedia ( mode ) ; } String mediaId = generateMediaIdresponse . get... |
public class FormLayout { /** * Sets the ColumnSpec at the specified column index .
* @ param columnIndex the index of the column to be changed
* @ param columnSpec the ColumnSpec to be set
* @ throws NullPointerException if { @ code columnSpec } is { @ code null }
* @ throws IndexOutOfBoundsException if the co... | checkNotNull ( columnSpec , "The column spec must not be null." ) ; colSpecs . set ( columnIndex - 1 , columnSpec ) ; |
public class EventHelper { /** * prints debug info when property debug is true , calls renderHeader and renderFooter and
* { @ link Advanced # draw ( com . itextpdf . text . Rectangle , java . lang . String ) } with { @ link Document # getPageSize ( ) }
* and null for { @ link DefaultStylerFactory # PAGESTYLERS } .... | super . onEndPage ( writer , document ) ; sanitize ( writer ) ; try { if ( failuresHereAfter || debugHereAfter ) { PdfContentByte bg = writer . getDirectContentUnder ( ) ; Rectangle rect = writer . getPageSize ( ) ; rect . setBackgroundColor ( itextHelper . fromColor ( getSettings ( ) . getColorProperty ( new Color ( 2... |
public class JBBPTextWriter { /** * Print string values .
* @ param str array of string values , must not be null but may contain nulls
* @ return the context
* @ throws IOException it will be thrown for error */
public JBBPTextWriter Str ( final String ... str ) throws IOException { } } | JBBPUtils . assertNotNull ( str , "String must not be null" ) ; final String oldPrefix = this . prefixValue ; final String oldPostfix = this . postfixValue ; this . prefixValue = "" ; this . postfixValue = "" ; for ( final String s : str ) { ensureValueMode ( ) ; printValueString ( s == null ? "<NULL>" : s ) ; } this .... |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link CurveArrayPropertyType } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link CurveArrayPropertyType } ... | return new JAXBElement < CurveArrayPropertyType > ( _CurveArrayProperty_QNAME , CurveArrayPropertyType . class , null , value ) ; |
public class InputSampler { /** * Driver for InputSampler from the command line .
* Configures a JobConf instance and calls { @ link # writePartitionFile } . */
public int run ( String [ ] args ) throws Exception { } } | JobConf job = ( JobConf ) getConf ( ) ; ArrayList < String > otherArgs = new ArrayList < String > ( ) ; Sampler < K , V > sampler = null ; for ( int i = 0 ; i < args . length ; ++ i ) { try { if ( "-r" . equals ( args [ i ] ) ) { job . setNumReduceTasks ( Integer . parseInt ( args [ ++ i ] ) ) ; } else if ( "-inFormat"... |
public class DescribeSuggestersRequest { /** * The suggesters you want to describe .
* @ param suggesterNames
* The suggesters you want to describe . */
public void setSuggesterNames ( java . util . Collection < String > suggesterNames ) { } } | if ( suggesterNames == null ) { this . suggesterNames = null ; return ; } this . suggesterNames = new com . amazonaws . internal . SdkInternalList < String > ( suggesterNames ) ; |
public class AbstractMenu { /** * The method takes values of the { @ link # commands } and returnes them as
* { @ link java . util . ArrayList } .
* @ return the values of the { @ link # commands } map instance as array list
* @ see # commands
* @ see # add ( Command )
* @ see # add ( Menu ) */
public List < ... | return commands . values ( ) . stream ( ) . map ( id -> AbstractCommand . search ( id ) ) . collect ( Collectors . toList ( ) ) ; |
public class DateUtil { /** * 计算两个日期相差年数 < br >
* 在非重置情况下 , 如果起始日期的月小于结束日期的月 , 年数要少算1 ( 不足1年 )
* @ param beginDate 起始日期
* @ param endDate 结束日期
* @ param isReset 是否重置时间为起始时间 ( 重置月天时分秒 )
* @ return 相差年数
* @ since 3.0.8 */
public static long betweenYear ( Date beginDate , Date endDate , boolean isReset ) { } } | return new DateBetween ( beginDate , endDate ) . betweenYear ( isReset ) ; |
public class JavaParser { /** * This will take a RecognitionException , and create a sensible error message out of it */
public String createErrorMessage ( RecognitionException e ) { } } | StringBuilder message = new StringBuilder ( ) ; message . append ( source + ":" + e . line + ":" + e . charPositionInLine + " " ) ; if ( e instanceof MismatchedTokenException ) { MismatchedTokenException mte = ( MismatchedTokenException ) e ; message . append ( "mismatched token: " + e . token + "; expecting type " + t... |
public class TempCharReader { /** * Reads the next character . */
public int read ( ) { } } | if ( _length <= _offset ) { if ( _head == null ) return - 1 ; TempCharBuffer next = _head . getNext ( ) ; if ( _isFree ) TempCharBuffer . free ( _head ) ; _head = next ; if ( _head == null ) return - 1 ; _buffer = _head . buffer ( ) ; _length = _head . getLength ( ) ; _offset = 0 ; } return _buffer [ _offset ++ ] ; |
public class ContentMappings { /** * Looks up or creates a new ContentMapping for the given original string and a ContentMapping generator . */
public @ Nonnull ContentMapping getMappingOrCreate ( @ Nonnull String original , @ Nonnull Function < String , ContentMapping > generator ) { } } | boolean isNew = ! mappings . containsKey ( original ) ; ContentMapping mapping = mappings . computeIfAbsent ( original , generator ) ; try { if ( isNew ) { save ( ) ; } } catch ( IOException e ) { LOGGER . log ( Level . WARNING , "Could not save mappings file" , e ) ; } return mapping ; |
public class AbstractHttp2ClientTransport { /** * 调用前设置一些属性
* @ param context RPC上下文
* @ param request 请求对象 */
protected void beforeSend ( RpcInternalContext context , SofaRequest request ) { } } | currentRequests . incrementAndGet ( ) ; context . getStopWatch ( ) . tick ( ) . read ( ) ; context . setLocalAddress ( localAddress ( ) ) ; if ( EventBus . isEnable ( ClientBeforeSendEvent . class ) ) { EventBus . post ( new ClientBeforeSendEvent ( request ) ) ; } |
public class QueryRunner { /** * Execute an SQL SELECT query with replacement parameters . The
* caller is responsible for closing the connection .
* @ param conn The connection to execute the query in .
* @ param sql The query to execute .
* @ param params The replacement parameters .
* @ param rsh The handl... | PreparedStatement stmt = null ; ResultSet rs = null ; T result = null ; try { stmt = this . prepareStatement ( conn , sql ) ; this . fillStatement ( stmt , params ) ; rs = this . wrap ( stmt . executeQuery ( ) ) ; result = rsh . handle ( rs ) ; } catch ( SQLException e ) { this . rethrow ( e , sql , params ) ; } finall... |
public class DIRImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setRWIDTHFRACTION ( Integer newRWIDTHFRACTION ) { } } | Integer oldRWIDTHFRACTION = rwidthfraction ; rwidthfraction = newRWIDTHFRACTION ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . DIR__RWIDTHFRACTION , oldRWIDTHFRACTION , rwidthfraction ) ) ; |
public class CurrentGpsInfo { /** * Method to add a new { @ link GSASentence } .
* @ param gsa the sentence to add . */
public void addGSA ( GSASentence gsa ) { } } | try { if ( gsa . isValid ( ) ) { gpsFixStatus = gsa . getFixStatus ( ) ; horizontalPrecision = gsa . getHorizontalDOP ( ) ; verticalPrecision = gsa . getVerticalDOP ( ) ; positionPrecision = gsa . getPositionDOP ( ) ; satelliteIds = gsa . getSatelliteIds ( ) ; } } catch ( Exception e ) { // ignore it , this should be h... |
public class RestApiClient { /** * Delete chat room .
* @ param roomName
* the room name
* @ return the response */
public Response deleteChatRoom ( String roomName ) { } } | return restClient . delete ( "chatrooms/" + roomName , new HashMap < String , String > ( ) ) ; |
public class DefaultPageHeader { /** * Writes this header to the specified file . Writes the { @ link # FILE _ VERSION
* version } of this header and the integer value of { @ link # pageSize } to the
* file . */
@ Override public void writeHeader ( RandomAccessFile file ) throws IOException { } } | file . seek ( 0 ) ; file . writeInt ( FILE_VERSION ) ; file . writeInt ( this . pageSize ) ; |
public class ListGrantsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ListGrantsRequest listGrantsRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( listGrantsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listGrantsRequest . getLimit ( ) , LIMIT_BINDING ) ; protocolMarshaller . marshall ( listGrantsRequest . getMarker ( ) , MARKER_BINDING ) ; protocolMarshaller . marsha... |
public class CalendarQuarter { /** * / * [ deutsch ]
* < p > Addiert die angegebenen Jahre zu diesem Kalenderquartal . < / p >
* @ param years the count of years to be added
* @ return result of addition */
public CalendarQuarter plus ( Years < CalendarUnit > years ) { } } | if ( years . isEmpty ( ) ) { return this ; } return CalendarQuarter . of ( MathUtils . safeAdd ( this . year , years . getAmount ( ) ) , this . quarter ) ; |
public class CmsCmisUtil { /** * Converts milliseconds into a calendar object .
* @ param millis a time given in milliseconds after epoch
* @ return the calendar object for the given time */
public static GregorianCalendar millisToCalendar ( long millis ) { } } | GregorianCalendar result = new GregorianCalendar ( ) ; result . setTimeZone ( TimeZone . getTimeZone ( "GMT" ) ) ; result . setTimeInMillis ( ( long ) ( Math . ceil ( millis / 1000 ) * 1000 ) ) ; return result ; |
public class CacheStore { /** * Then remove the session from cache */
@ Override public void remoteInvalidate ( String sessionId , boolean backendUpdate ) { } } | super . remoteInvalidate ( sessionId , backendUpdate ) ; if ( backendUpdate ) { ( ( CacheHashMap ) _sessions ) . setMaxInactToZero ( sessionId , getId ( ) ) ; } // now clean this session out of cache - - we do this even if not doing db inval
Enumeration < String > e = Collections . enumeration ( Collections . singleton... |
public class AbstractEJBRuntime { /** * Creates a non - persistent calendar based EJB timer .
* @ param beanId the bean Id for which the timer is being created
* @ param parsedExpr the parsed values of the schedule for a calendar - based timer
* @ param info application information to be delivered to the timeout ... | final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . entry ( tc , "createNonPersistentCalendarTimer : " + beanO ) ; // create the non - persistent Timer
TimerNpImpl timer = new TimerNpImpl ( beanO . getId ( ) , parsedExpr , info... |
public class AgentsClient { /** * Restores the specified agent from a ZIP file .
* < p > Replaces the current agent version with a new one . All the intents and entity types in the
* older version are deleted .
* < p > Operation & lt ; response : [ google . protobuf . Empty ] [ google . protobuf . Empty ] & gt ; ... | return restoreAgentOperationCallable ( ) . futureCall ( request ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.