signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class FnString { /** * Converts a String into a Short , using the specified decimal point * configuration ( { @ link DecimalPoint } ) . Rounding mode is used for removing the * decimal part of the number . The target String should contain no * thousand separators . The integer part of the input string must...
return new ToShort ( roundingMode , decimalPoint ) ;
public class ClassPropertyUsageAnalyzer { /** * Writes the data collected about properties to a file . */ private void writePropertyData ( ) { } }
try ( PrintStream out = new PrintStream ( ExampleHelpers . openExampleFileOuputStream ( "properties.csv" ) ) ) { out . println ( "Id" + ",Label" + ",Description" + ",URL" + ",Datatype" + ",Uses in statements" + ",Items with such statements" + ",Uses in statements with qualifiers" + ",Uses in qualifiers" + ",Uses in ref...
public class TransportResolver { /** * Get the list of candidates . * @ return the list of transport candidates */ public List < TransportCandidate > getCandidatesList ( ) { } }
List < TransportCandidate > result ; synchronized ( candidates ) { result = new ArrayList < > ( candidates ) ; } return result ;
public class UuidUtil { /** * Determines if the specified string is a valid UUID . * @ param uuid the UUID to evaluate * @ return true if UUID is valid , false if invalid * @ since 1.0.0 */ public static boolean isValidUUID ( String uuid ) { } }
return ! StringUtils . isEmpty ( uuid ) && UUID_PATTERN . matcher ( uuid ) . matches ( ) ;
public class UDPChannelConfiguration { /** * Update the configuration with a new channel framework configuration object . * @ param data * @ throws ChannelException */ public void setChannelData ( ChannelData data ) throws ChannelException { } }
this . channelData = data ; setValues ( data . getPropertyBag ( ) ) ; if ( tc . isDebugEnabled ( ) ) outputConfigToTrace ( ) ;
public class ImageInterleaved { /** * Creates a sub - image from ' this ' image . The subimage will share the same internal array * that stores each pixel ' s value , but will only pertain to an axis - aligned rectangular segment * of the original . * @ param x0 x - coordinate of top - left corner of the sub - im...
T ret = createNew ( - 1 , - 1 ) ; ret . _setData ( _getData ( ) ) ; ret . stride = Math . max ( width * numBands , stride ) ; // ok why is this done ? ! ? ! Shouldn ' t it always be stride ? ret . width = x1 - x0 ; ret . height = y1 - y0 ; ret . numBands = numBands ; ret . startIndex = startIndex + y0 * stride + x0 * n...
public class JWSHeader { /** * Sets the JSON Web Key URL header parameter that is an absolute URL that refers to a resource * for a set of JSON - encoded public keys , one of which corresponds to the key that was used to * digitally sign the JWS or { @ code null } for none . * Overriding is only supported for the...
this . jwkUrl = jwkUrl ; this . put ( HeaderConstants . JWK_URL , jwkUrl ) ; return this ;
public class CmsExternalLinksValidationResult { /** * Returns a Html representation of this pointer link validation result . < p > * @ param locale the Locale to display the result in * @ return a Html representation of this external link validation result */ public String toHtml ( Locale locale ) { } }
CmsMessages mg = Messages . get ( ) . getBundle ( locale ) ; if ( m_brokenLinks . size ( ) > 0 ) { StringBuffer result = new StringBuffer ( 1024 ) ; Iterator < Entry < String , String > > brokenLinks = m_brokenLinks . entrySet ( ) . iterator ( ) ; result . append ( mg . key ( Messages . GUI_LINK_VALIDATION_RESULTS_INTR...
public class Arrays2 { /** * Create a set from an array . If the array contains duplicate objects , the * last object in the array will be placed in resultant set . * @ param < T > the type of the objects in the set * @ param array the array from which to create the set * @ return the created sets */ public sta...
Set < T > result = new HashSet < T > ( ) ; for ( T a : array ) { result . add ( a ) ; } return result ;
public class AgentActivator { /** * Creates the event type . * @ param type the EventEnumType * @ return the event type */ private EventType createEventType ( EventEnumType type ) { } }
EventType eventType = new EventType ( ) ; eventType . setTimestamp ( Converter . convertDate ( new Date ( ) ) ) ; eventType . setEventType ( type ) ; OriginatorType origType = new OriginatorType ( ) ; origType . setProcessId ( Converter . getPID ( ) ) ; try { InetAddress inetAddress = InetAddress . getLocalHost ( ) ; o...
public class CodedConstant { /** * Compute the number of bytes that would be needed to encode a particular value of arbitrary type , excluding tag . * @ param type The field ' s type . * @ param value Object representing the field ' s value . Must be of the exact type which would be returned by * { @ link Message...
switch ( type ) { // Note : Minor violation of 80 - char limit rule here because this would // actually be harder to read if we wrapped the lines . case DOUBLE : return CodedOutputStream . computeDoubleSizeNoTag ( ( Double ) value ) ; case FLOAT : return CodedOutputStream . computeFloatSizeNoTag ( ( Float ) value ) ; c...
public class SourcePartitionedScheduler { /** * Obtains a { @ code SourceScheduler } suitable for use in FixedSourcePartitionedScheduler . * This returns a { @ code SourceScheduler } that can be used for a pipeline * that is either ungrouped or grouped . However , the caller is responsible initializing * the driv...
return new SourcePartitionedScheduler ( stage , partitionedNode , splitSource , splitPlacementPolicy , splitBatchSize , groupedExecution ) ;
public class CmsDefaultValidationHandler { /** * A user name can only be composed of digits , * standard ASCII letters and the symbols defined in { @ link # USERNAME _ CONSTRAINTS } . < p > * @ see org . opencms . security . I _ CmsValidationHandler # checkUserName ( java . lang . String ) */ public void checkUserN...
if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( userName ) ) { throw new CmsIllegalArgumentException ( Messages . get ( ) . container ( Messages . ERR_BAD_USERNAME_EMPTY_0 , userName ) ) ; } CmsStringUtil . checkName ( userName , USERNAME_CONSTRAINTS , Messages . ERR_BAD_USERNAME_4 , Messages . get ( ) ) ;
public class GroupService { /** * Receives notice that the UserInstance has been unbound from the HttpSession . In response , we * remove the corresponding group member from the cache . We use the roundabout route of creating * a group member and then getting its EntityIdentifier because we need the EntityIdentifie...
IGroupMember gm = getGroupMember ( person . getEntityIdentifier ( ) ) ; try { final EntityIdentifier entityIdentifier = gm . getEntityIdentifier ( ) ; EntityCachingService . getEntityCachingService ( ) . remove ( entityIdentifier . getType ( ) , entityIdentifier . getKey ( ) ) ; } catch ( CachingException ce ) { throw ...
public class WrappedByteBuffer { /** * Puts a buffer into the buffer at the specified index . * @ param index the index * @ param v the WrappedByteBuffer * @ return the buffer */ public WrappedByteBuffer putBufferAt ( int index , WrappedByteBuffer v ) { } }
// TODO : I believe this method incorrectly moves the position ! // Can ' t change it without a code analysis - and this is a public API ! int pos = _buf . position ( ) ; _buf . position ( index ) ; _buf . put ( v . _buf ) ; _buf . position ( pos ) ; return this ;
public class CompositeELResolver { /** * For a given < code > base < / code > and < code > property < / code > , attempts to * identify the most general type that is acceptable for an object to be * passed as the < code > value < / code > parameter in a future call * to the { @ link # setValue } method . The resu...
context . setPropertyResolved ( false ) ; Class < ? > type ; for ( int i = 0 ; i < size ; i ++ ) { type = elResolvers [ i ] . getType ( context , base , property ) ; if ( context . isPropertyResolved ( ) ) { return type ; } } return null ;
public class LTPACrypto { /** * Set the 16 - byte initialization vector . * @ param key The key */ private static final synchronized void setIVS16 ( byte [ ] key ) { } }
if ( ivs16 == null ) { byte [ ] iv16 = new byte [ 16 ] ; for ( int i = 0 ; i < 16 ; i ++ ) { iv16 [ i ] = key [ i ] ; } ivs16 = new IvParameterSpec ( iv16 ) ; }
public class AbstractResultSet { /** * { @ inheritDoc } */ public Object getObject ( final String columnLabel , final Map < String , Class < ? > > typemap ) throws SQLException { } }
throw new RuntimeException ( "Not implemented" ) ;
public class SQLParser { /** * Build a pattern segment to recognize all the EXPORT or PARTITION modifier clauses * of a CREATE STREAM statement . * @ return Pattern to be used by the caller inside a CREATE STREAM pattern . * Capture groups : * ( 1 ) All EXPORT / PARTITION modifier clauses as one string */ priva...
// Force the leading space to go inside the repeat block . return SPF . capture ( SPF . repeat ( makeInnerStreamModifierClausePattern ( false ) ) ) . withFlags ( SQLPatternFactory . ADD_LEADING_SPACE_TO_CHILD ) ;
public class TimeUUIDs { /** * Returns a UUID that sorts greater than or equal to all RFC 4122 timestamp UUIDs ( version = 1 , variant = 2 ) . */ public static UUID maximumUuid ( ) { } }
return new UUID ( getMostSignificantBits ( Long . MAX_VALUE ) , getLeastSignificantBits ( Integer . MAX_VALUE , Long . MAX_VALUE ) ) ;
public class SeleniumHelper { /** * Executes condition until it returns a value other than null or false . * It does not forward StaleElementReferenceExceptions , but keeps waiting . * @ param maxSecondsToWait number of seconds to wait at most . * @ param condition condition to check . * @ param < T > return ty...
ExpectedCondition < T > cHandlingStale = getConditionIgnoringStaleElement ( condition ) ; FluentWait < WebDriver > wait = waitDriver ( ) . withTimeout ( Duration . ofSeconds ( maxSecondsToWait ) ) ; return wait . until ( cHandlingStale ) ;
public class Variant { /** * Called from the native code to assist VT _ DATE - > Date conversion . */ static Date toDate ( double d ) { } }
GregorianCalendar ret = new GregorianCalendar ( 1899 , 11 , 30 ) ; int days = ( int ) d ; d -= days ; ret . add ( Calendar . DATE , days ) ; d *= 24 ; int hours = ( int ) d ; ret . add ( Calendar . HOUR , hours ) ; d -= hours ; d *= 60 ; // d + = 0.5 ; / / round int min = ( int ) d ; ret . add ( Calendar . MINUTE , min...
public class AwsHostNameUtils { /** * Returns the host name for the local host . If the operation is not allowed * by the security check , the textual representation of the IP address of * the local host is returned instead . If the ip address of the local host * cannot be resolved or if there is any other failur...
try { InetAddress localhost = InetAddress . getLocalHost ( ) ; return localhost . getHostName ( ) ; } catch ( Exception e ) { InternalLogFactory . getLog ( AwsHostNameUtils . class ) . debug ( "Failed to determine the local hostname; fall back to " + "use \"localhost\"." , e ) ; return "localhost" ; }
public class UpgradedWebConnectionImpl { /** * ( non - Javadoc ) * @ see javax . servlet . http . WebConnection # getOutputStream ( ) */ @ Override public ServletOutputStream getOutputStream ( ) throws IOException { } }
if ( _out == null ) { // create the outputstream _out = new SRTUpgradeOutputStream31 ( ) ; _outbb = new UpgradeOutputByteBufferUtil ( this ) ; _out . init ( _outbb , _req ) ; } return _out ;
public class Reflection { /** * getPrimitiveType of the given class * @ param type the given class . * @ return the primitive of the given class , eg . Integer / int to int , Double / double to double etc . . . * @ throws IllegalArgumentException if the given class can not be unpacked to primitive type . */ publi...
if ( type == int . class || type == Integer . class ) { return int . class ; } else if ( type == long . class || type == Long . class ) { return long . class ; } else if ( type == short . class || type == Short . class ) { return short . class ; } else if ( type == double . class || type == Double . class ) { return do...
public class CatalogSchemaTools { /** * Convert a Catalog Procedure into a DDL string . * @ param proc */ public static void toSchema ( StringBuilder sb , Procedure proc ) { } }
// CRUD : hasJava ( false ) , m _ defaultproc ( true ) // SQL : hasJava ( false ) , m _ defaultproc ( false ) , m _ statements . m _ items . " SQL " // JAVA : hasJava ( true , m _ defaultproc ( false ) if ( proc . getDefaultproc ( ) ) { return ; } // Build the optional ALLOW clause . CatalogMap < GroupRef > roleList = ...
public class DynamicFactory { /** * Register a constructor key with a public constructor . * @ param key the key to register this constructor with * @ param constructor the constructor to invoke when the key is match * @ param < T > the type the constructor will create * @ return return the constructor passed a...
Creator < T > creator = new ReflectionCreator < T > ( constructor ) ; if ( modifier != null ) creator = new ModifiedCreator < T > ( creator , modifier ) ; return register ( key , creator ) ;
public class FctBnPublicTradeProcessors { /** * < p > Lazy get PrcDelItemFromCart . < / p > * @ param pAddParam additional param * @ return requested PrcDelItemFromCart * @ throws Exception - an exception */ protected final PrcDelItemFromCart < RS > lazyGetPrcDelItemFromCart ( final Map < String , Object > pAddPa...
String beanName = PrcDelItemFromCart . class . getSimpleName ( ) ; @ SuppressWarnings ( "unchecked" ) PrcDelItemFromCart < RS > proc = ( PrcDelItemFromCart < RS > ) this . processorsMap . get ( beanName ) ; if ( proc == null ) { proc = new PrcDelItemFromCart < RS > ( ) ; proc . setSrvOrm ( getSrvOrm ( ) ) ; proc . setS...
public class AbstractCsvAnnotationBeanReader { /** * Beanの各フィールドに対して値を設定する 。 * @ param resultBean * @ param nameMapping * @ param bindingErrors */ protected void populateBean ( final T resultBean , final String [ ] nameMapping , final CsvBindingErrors bindingErrors ) { } }
// map each column to its associated field on the bean for ( int i = 0 ; i < nameMapping . length ; i ++ ) { final String fieldName = nameMapping [ i ] ; final Object fieldValue = processedColumns . get ( i ) ; // don ' t call a set - method in the bean if there is no name mapping for the column or no result to store i...
public class DateRangePicker { /** * Check the current selection . If nothing is selected , display a prompt message in gray text . * Also , remembers the last selection made . * @ param suppressEvent If true , onSelectRange event is not fired . */ private void checkSelection ( boolean suppressEvent ) { } }
Dateitem selectedItem = getSelectedItem ( ) ; if ( selectedItem == null ) { selectedItem = lastSelectedItem ; setSelectedItem ( selectedItem ) ; } else if ( selectedItem != customItem && lastSelectedItem != selectedItem ) { lastSelectedItem = selectedItem ; if ( ! suppressEvent ) { EventUtil . send ( new Event ( ON_SEL...
public class AttachmentManager { /** * Iterate candidate filenames generated from the filenameRandom generator * until we find one which doesn ' t already exist . * We try inserting the new record into attachments _ key _ filename to find a * unique filename rather than checking on disk filenames . This is becaus...
String filename = null ; long result = - 1 ; // -1 is error for insert call int tries = 0 ; while ( result == - 1 && tries < 200 ) { byte [ ] randomBytes = new byte [ 20 ] ; filenameRandom . nextBytes ( randomBytes ) ; String candidate = keyToString ( randomBytes ) ; ContentValues contentValues = new ContentValues ( ) ...
public class JmolSymmetryScriptGeneratorH { /** * Returns a unique color palette based on point group * @ param nColors * @ return */ private Color4f [ ] getSymmetryColors ( int nColors ) { } }
int offset = 0 ; int dMax = nColors + offset ; Color [ ] col = ColorBrewer . Spectral . getColorPalette ( dMax ) ; Color4f [ ] colors = ColorConverter . convertColor4f ( col ) ; System . arraycopy ( colors , offset , colors , 0 , dMax - offset ) ; return colors ;
public class ValidatableField { /** * Merge the rule names with the list in the field element ' s depends attribute . */ void mergeDependsList ( Element element ) { } }
String depends = getElementAttribute ( element , "depends" ) ; StringBuffer updatedDepends = new StringBuffer ( ) ; if ( depends != null ) { updatedDepends . append ( depends ) ; } else { depends = "" ; } ArrayList rules = new ArrayList ( ) ; for ( Iterator i = _rules . iterator ( ) ; i . hasNext ( ) ; ) { ValidatorRul...
public class Entry { /** * Returns a newly - created { @ link Entry } of a text file . * @ param revision the revision of the text file * @ param path the path of the text file * @ param content the content of the text file */ public static Entry < String > ofText ( Revision revision , String path , String conten...
return new Entry < > ( revision , path , EntryType . TEXT , content ) ;
public class MonitorInterceptor { /** * Returns name for monitored method . * @ param method the monitored { @ link Method } * @ return the method name or custom name provided via { @ link StatName } annotation */ private String getMethodName ( Method method ) { } }
StatName statName = method . getAnnotation ( StatName . class ) ; return statName == null ? method . getName ( ) : statName . value ( ) ;
public class JettyBootstrap { /** * Initialize Jetty server using the given { @ link IJettyConfiguration } . Basically creates the server , set connectors , handlers and adds the shutdown hook . * @ param iJettyConfiguration * Jetty Configuration * @ throws JettyBootstrapException * on failure */ protected void...
if ( server == null ) { server = createServer ( iJettyConfiguration ) ; server . setConnectors ( createConnectors ( iJettyConfiguration , server ) ) ; server . setHandler ( handlers ) ; if ( iJettyConfiguration . isStopAtShutdown ( ) ) { createShutdownHook ( ) ; } }
public class BoundedBuffer { /** * @ awisniew - ADDED * ( non - Javadoc ) * @ see java . util . Collection # toArray ( T [ ] ) */ @ Override @ SuppressWarnings ( "unchecked" ) public < E > E [ ] toArray ( E [ ] a ) { } }
if ( a . length < size ( ) ) { a = ( E [ ] ) Array . newInstance ( a . getClass ( ) . getComponentType ( ) , size ( ) ) ; } int aIndex = 0 ; synchronized ( this ) { synchronized ( lock ) { // First add anything in the expedited buffer // Check if we wrap around the end of the array before iterating if ( expeditedPutInd...
public class MessageProcessor { /** * ( non - Javadoc ) * @ see * com . ibm . ws . sib . admin . JsEngineComponent # engineReloaded ( com . ibm . ws . sib . * admin . JsMessagingEngine ) */ @ Override public void engineReloaded ( Object newEngine ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "engineReloaded" , newEngine ) ; // At this point , a dynamic configuartion change has occurred , admin // have updated all our // localized destinations and we should now make use of the new // configuration and drive // th...
public class LiveOutputsInner { /** * Get Live Output . * Gets a Live Output . * @ param resourceGroupName The name of the resource group within the Azure subscription . * @ param accountName The Media Services account name . * @ param liveEventName The name of the Live Event . * @ param liveOutputName The na...
return ServiceFuture . fromResponse ( getWithServiceResponseAsync ( resourceGroupName , accountName , liveEventName , liveOutputName ) , serviceCallback ) ;
public class StartUserImportJobRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( StartUserImportJobRequest startUserImportJobRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( startUserImportJobRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( startUserImportJobRequest . getUserPoolId ( ) , USERPOOLID_BINDING ) ; protocolMarshaller . marshall ( startUserImportJobRequest . getJobId ( ) , JOBID_BINDING...
public class TimedMessage { /** * Renderable */ @ Override public void render ( Graphic g ) { } }
for ( final MessageData messageData : messages ) { text . draw ( g , messageData . x , messageData . y , messageData . message ) ; }
public class PinyinKey { /** * 拼音的个数 * @ return */ public int size ( ) { } }
int length = 0 ; for ( Pinyin pinyin : pinyinArray ) { if ( pinyin != Pinyin . none5 ) ++ length ; } return length ;
public class DefaultCriterionFilterConverter { /** * Convert a criterion to a filter . * @ param criterionDto * @ param schema * @ return */ public Filter convert ( Criterion criterionDto , List < AttributeDescriptor > schema ) { } }
FilterContext fc = new FilterContext ( ) ; fc . setSchema ( schema ) ; criterionDto . accept ( this , fc ) ; try { log . debug ( "Filter converted : " + ECQL . toCQL ( fc . getFilter ( ) ) ) ; } catch ( Exception e ) { // ignore } return fc . getFilter ( ) ;
public class MathUtils { /** * / * [ deutsch ] * < p > Multipliziert die Zahlen mit & Uuml ; berlaufkontrolle . < / p > * @ param op1 first operand * @ param op2 second operand * @ return product * @ throws ArithmeticException if long - range overflows */ public static long safeMultiply ( long op1 , long op2 ...
if ( op2 == 1L ) { return op1 ; } if ( ( op2 > 0 ) ? ( op1 > Long . MAX_VALUE / op2 ) || ( op1 < Long . MIN_VALUE / op2 ) : ( ( op2 < - 1 ) ? ( op1 > Long . MIN_VALUE / op2 ) || ( op1 < Long . MAX_VALUE / op2 ) : ( op2 == - 1 ) && ( op1 == Long . MIN_VALUE ) ) ) { StringBuilder sb = new StringBuilder ( 32 ) ; sb . appe...
public class SequenceValueProducerPool { /** * Returns reserved values for all { @ link SequenceValueProducer } s . * @ param log optional log to report errors ; uses default log if null */ public void returnReservedValues ( Log log ) { } }
for ( SequenceValueProducer producer : values ( ) ) { try { producer . returnReservedValues ( ) ; } catch ( RepositoryException e ) { if ( log == null ) { log = LogFactory . getLog ( SequenceValueProducerPool . class ) ; } log . error ( e . getMessage ( ) , e ) ; } }
public class ExperimentalCrypto { /** * Calculate a single block with SimpleHashEncryption ( see doSHE for details ) * @ param block The block number , text and initialization vector for the block that is to be calculated * @ param key a 128 bit or stronger key * @ return an array containing the calculated block ...
// make sure key is at least 128 bits . if ( key . length < 16 ) throw new RuntimeException ( "Key too short" ) ; // make sure iv is at least 256 bits . if ( block . getIV ( ) . length < 32 ) throw new RuntimeException ( "IV too short." ) ; // make sure text block is exactly 256 bits . if ( block . getText ( ) . length...
public class JCommanderParameterResolver { /** * Return < em > all < / em > JCommander parameter descriptions , including the " main " parameter * if present . */ private Stream < com . beust . jcommander . ParameterDescription > streamAllJCommanderDescriptions ( JCommander jCommander ) { } }
return Stream . concat ( jCommander . getParameters ( ) . stream ( ) , jCommander . getMainParameter ( ) != null ? Stream . of ( jCommander . getMainParameter ( ) ) : Stream . empty ( ) ) ;
public class Cache { /** * Find the specified key in the cache ; the object is returned * in the pinned state . < p > * @ param key key for the object to locate in the cache . * @ return the object from the cache , or null if there is no object * associated with the key in the cache . * @ see Cache # pin * ...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "find" , key ) ; Bucket bucket = getBucketForKey ( key ) ; Object object = null ; if ( bucket != null ) // d739870 { synchronized ( bucket ) { Element element = bucket . findByKey ( key ) ; if ( element != null ) { // We found ...
public class SocketNode13 { /** * Close the node and underlying socket */ public void close ( ) throws IOException { } }
getLogger ( ) . debug ( "closing socket" ) ; this . closed = true ; socket . close ( ) ; fireSocketClosedEvent ( null ) ;
public class CloudantClient { /** * Provides access to Cloudant < tt > replication < / tt > APIs . * @ return Replicator object for interacting with the _ replicator DB * @ see com . cloudant . client . api . Replicator * @ see < a target = " _ blank " * href = " https : / / console . bluemix . net / docs / ser...
Replicator couchDbReplicator = couchDbClient . replicator ( ) ; com . cloudant . client . api . Replicator replicator = new com . cloudant . client . api . Replicator ( couchDbReplicator ) ; return replicator ;
public class RowInputBinary { /** * Used to reset the row , ready for Result data to be written into the * byte [ ] buffer by an external routine . */ public void resetRow ( int rowsize ) { } }
if ( out != null ) { out . reset ( rowsize ) ; buf = out . getBuffer ( ) ; } super . reset ( ) ;
public class HubState { /** * Prints the status of the hub . */ @ CommandArgument public void stat ( ) { } }
if ( this . jobHub == null ) { System . err . println ( "Hub not running" ) ; return ; } System . out . println ( "Hub running" ) ;
public class TypeCheck { /** * Emits a warning if we can prove that a property cannot possibly be defined on an object . Note * the difference between JS and a strictly statically typed language : we ' re checking if the * property * cannot be defined * , whereas a java compiler would check if the property * can be...
String propName = propNode . getString ( ) ; if ( propType . isEquivalentTo ( typeRegistry . getNativeType ( UNKNOWN_TYPE ) ) ) { childType = childType . autobox ( ) ; ObjectType objectType = ObjectType . cast ( childType ) ; if ( objectType != null ) { // We special - case object types so that checks on enums can be /...
public class Async { /** * Convert a synchronous function call into an asynchronous function call through an Observable . * < img width = " 640 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / toAsync . png " alt = " " > * @ param < T1 > the first parameter type * @...
return toAsync ( func , Schedulers . computation ( ) ) ;
public class AbstractInterval { /** * Does this time interval contain the specified time interval . * Non - zero duration intervals are inclusive of the start instant and * exclusive of the end . The other interval is contained if this interval * wholly contains , starts , finishes or equals it . * A zero durat...
if ( interval == null ) { return containsNow ( ) ; } long otherStart = interval . getStartMillis ( ) ; long otherEnd = interval . getEndMillis ( ) ; long thisStart = getStartMillis ( ) ; long thisEnd = getEndMillis ( ) ; return ( thisStart <= otherStart && otherStart < thisEnd && otherEnd <= thisEnd ) ;
public class AmazonLightsailClient { /** * Returns information about a specific block storage disk . * @ param getDiskRequest * @ return Result of the GetDisk operation returned by the service . * @ throws ServiceException * A general service exception . * @ throws InvalidInputException * Lightsail throws t...
request = beforeClientExecution ( request ) ; return executeGetDisk ( request ) ;
public class PolicyReader { /** * Standard handler routine for the XML parsing . * @ param exception * information on what caused the problem * @ throws SAXException * always to halt parsing on errors */ @ Override public void error ( SAXParseException exception ) throws SAXException { } }
logger . warn ( "Error on line " + exception . getLineNumber ( ) + ": " + exception . getMessage ( ) + " ... " + "Policy will not be available" ) ; throw new SAXException ( "error parsing policy" ) ;
public class GatewayImpl { /** * Configure a new Gateway instance with the given environment properties . */ @ Override public void setProperties ( Properties properties ) { } }
if ( this . env == null ) { this . env = properties ; } else { this . env . putAll ( properties ) ; } if ( baseGateway != null ) { baseGateway . setProperties ( properties ) ; }
public class AddressBinding { /** * Turns this address into a subresource address , * including the address and child - type properties . < br / > * The child - type is derived from the last address token qualifier . * This method allows to specify a base address prefix ( i . e server vs . domain addressing ) . ...
int numWildCards = getNumWildCards ( ) ; int wildcards = ( numWildCards - 1 ) > 0 ? numWildCards - 1 : 0 ; assert wildcards == args . length : "Address arguments don't match number of wildcards: " + wildcards + " -> " + Arrays . toString ( args ) ; ModelNode model = new ModelNode ( ) ; model . get ( ADDRESS ) . set ( b...
public class SymmetricKey { /** * Generate an AES key of the specifies size in bytes . * @ param size Size in bytes * @ return An AES key * @ throws SymmetricKeyException */ private static byte [ ] generateKey ( int size ) throws SymmetricKeyException { } }
if ( size <= 0 ) throw new IllegalArgumentException ( "Size cannot be zero or less than zero." ) ; try { SecureRandom secureRandom = new SecureRandom ( ) ; KeyGenerator keyGenerator = KeyGenerator . getInstance ( "AES" ) ; keyGenerator . init ( size * 8 , secureRandom ) ; return keyGenerator . generateKey ( ) . getEnco...
public class AppServiceCertificateOrdersInner { /** * Reissue an existing certificate order . * Reissue an existing certificate order . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param certificateOrderName Name of the certificate order . * @ param reissueCertifica...
return reissueWithServiceResponseAsync ( resourceGroupName , certificateOrderName , reissueCertificateOrderRequest ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ;
public class RepositoryService { /** * Resolves dependencies transitively from the given jar artifact , with the specified Maven scope * ( compile , runtime , and so on . ) */ public DependencyResult resolveDependencies ( GAV a , String scope ) throws DependencyResolutionException { } }
DependencyFilter classpathFlter = DependencyFilterUtils . classpathFilter ( scope ) ; CollectRequest collectRequest = new CollectRequest ( ) ; collectRequest . setRoot ( new Dependency ( new DefaultArtifact ( a . toString ( ) ) , JavaScopes . COMPILE ) ) ; collectRequest . setRepositories ( remoteRepositories ) ; Depen...
public class VecmathUtil { /** * Calculate the intersection of two lines described by the points ( x1 , y1 - > x2 , y2 ) and ( x3 , y3 * - > x4 , y4 ) . * @ param x1 first x coordinate of line 1 * @ param y1 first y coordinate of line 1 * @ param x2 second x coordinate of line 1 * @ param y2 second y coordina...
final double x = ( ( x2 - x1 ) * ( x3 * y4 - x4 * y3 ) - ( x4 - x3 ) * ( x1 * y2 - x2 * y1 ) ) / ( ( x1 - x2 ) * ( y3 - y4 ) - ( y1 - y2 ) * ( x3 - x4 ) ) ; final double y = ( ( y3 - y4 ) * ( x1 * y2 - x2 * y1 ) - ( y1 - y2 ) * ( x3 * y4 - x4 * y3 ) ) / ( ( x1 - x2 ) * ( y3 - y4 ) - ( y1 - y2 ) * ( x3 - x4 ) ) ; return...
public class DestinationTools { /** * Make sure the given destination is a light - weight serializable destination reference */ public static Queue asRef ( Queue queue ) throws JMSException { } }
if ( queue == null ) return null ; if ( queue instanceof QueueRef ) return queue ; return new QueueRef ( queue . getQueueName ( ) ) ;
public class BoxApiMetadata { /** * Gets a request that updates the metadata for a specific template on a file * @ param id id of the file to retrieve metadata for * @ param scope currently only global and enterprise scopes are supported * @ param template metadata template to use * @ return request to update m...
BoxRequestsMetadata . UpdateFileMetadata request = new BoxRequestsMetadata . UpdateFileMetadata ( getFileMetadataUrl ( id , scope , template ) , mSession ) ; return request ;
public class Reflect { /** * Searches a method with the exact same signature as desired . * If a public method is found in the class hierarchy , this method is returned . Otherwise a private method with the * exact same signature is returned . If no exact match could be found , we let the { @ code NoSuchMethodExcep...
final Class < ? > type = type ( ) ; // first priority : find a public method with exact signature match in class hierarchy try { return type . getMethod ( name , types ) ; } // second priority : find a private method with exact signature match on declaring class catch ( NoSuchMethodException e ) { return type . getDecl...
public class VpnSitesInner { /** * Creates a VpnSite resource if it doesn ' t exist else updates the existing VpnSite . * @ param resourceGroupName The resource group name of the VpnSite . * @ param vpnSiteName The name of the VpnSite being created or updated . * @ param vpnSiteParameters Parameters supplied to c...
return ServiceFuture . fromResponse ( createOrUpdateWithServiceResponseAsync ( resourceGroupName , vpnSiteName , vpnSiteParameters ) , serviceCallback ) ;
public class MaxGauge { /** * Update the max if the provided value is larger than the current max . */ public void update ( long v ) { } }
spectatorGauge . set ( v ) ; for ( int i = 0 ; i < Pollers . NUM_POLLERS ; ++ i ) { updateMax ( i , v ) ; }
public class IllegalPatternArgumentException { /** * Converts a { @ link Pattern } to a string representation . * @ param pattern * Pattern * @ return string representation of a pattern */ private static String patternToString ( @ Nullable final Pattern pattern ) { } }
return pattern != null ? pattern . pattern ( ) + " (flags: " + pattern . flags ( ) + ")" : NO_PATTERN_PLACEHOLDER ;
public class AES { /** * 加密 * @ throws Exception */ public static byte [ ] encrypt ( byte [ ] data , byte [ ] key ) throws Exception { } }
// 恢复密钥 SecretKey secretKey = new SecretKeySpec ( key , "AES" ) ; // Cipher完成加密 Cipher cipher = Cipher . getInstance ( "AES" ) ; // 根据密钥对cipher进行初始化 cipher . init ( Cipher . ENCRYPT_MODE , secretKey ) ; // 加密 byte [ ] encrypt = cipher . doFinal ( data ) ; return encrypt ;
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcMetricValueSelect ( ) { } }
if ( ifcMetricValueSelectEClass == null ) { ifcMetricValueSelectEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 963 ) ; } return ifcMetricValueSelectEClass ;
public class EqualityUtil { /** * Hash a bunch of objects * @ param objects the objects * @ return a hash code */ public int hashObjects ( final Object ... objects ) { } }
final int prime = 31 ; int result = 1 ; for ( final Object object : objects ) { result = prime * result + ( ( object == null ) ? 0 : object . hashCode ( ) ) ; } return result ;
public class LongChromosome { /** * Returns an long array containing all of the elements in this chromosome * in proper sequence . If the chromosome fits in the specified array , it is * returned therein . Otherwise , a new array is allocated with the length of * this chromosome . * @ since 3.0 * @ param arra...
final long [ ] a = array . length >= length ( ) ? array : new long [ length ( ) ] ; for ( int i = length ( ) ; -- i >= 0 ; ) { a [ i ] = longValue ( i ) ; } return a ;
public class KnowledgeOperations { /** * Contains the globals . * @ param message * the message * @ param operation * the operation * @ param runtime * the runtime engine * @ return containsGlobal */ public static boolean containsGlobals ( Message message , KnowledgeOperation operation , KnowledgeRuntimeE...
Map < String , Object > expressionMap = getMap ( message , operation . getGlobalExpressionMappings ( ) , null ) ; return expressionMap != null && expressionMap . size ( ) > 0 ;
public class DERSet { /** * A note on the implementation : * As DER requires the constructed , definite - length model to * be used for structured types , this varies slightly from the * ASN . 1 descriptions given . Rather than just outputing SET , * we also have to specify CONSTRUCTED , and the objects length ...
ByteArrayOutputStream bOut = new ByteArrayOutputStream ( ) ; DEROutputStream dOut = new DEROutputStream ( bOut ) ; Enumeration e = this . getObjects ( ) ; while ( e . hasMoreElements ( ) ) { Object obj = e . nextElement ( ) ; dOut . writeObject ( obj ) ; } dOut . close ( ) ; byte [ ] bytes = bOut . toByteArray ( ) ; ou...
public class Database { /** * Returns an { @ link Observable } that is the result of running a sequence of * update commands ( insert / update / delete , ddl ) commands read from an * { @ link InputStream } with the given { @ link Charset } using the given * delimiter as the statement delimiter ( for example semi...
return Strings . split ( Strings . from ( new InputStreamReader ( is , charset ) ) , ";" ) . compose ( run ( ) ) ;
public class PutEvaluationsRequest { /** * The assessments that the AWS Lambda function performs . Each evaluation identifies an AWS resource and indicates * whether it complies with the AWS Config rule that invokes the AWS Lambda function . * < b > NOTE : < / b > This method appends the values to the existing list...
if ( this . evaluations == null ) { setEvaluations ( new com . amazonaws . internal . SdkInternalList < Evaluation > ( evaluations . length ) ) ; } for ( Evaluation ele : evaluations ) { this . evaluations . add ( ele ) ; } return this ;
public class DumpResultSqlFilter { /** * 検索結果を表示 * @ param rs 検索結果のResultSet * @ return 表示文字列 */ public StringBuilder displayResult ( final ResultSet rs ) { } }
try { List < String > keys = new ArrayList < > ( ) ; Map < String , Integer > maxLengthList = new HashMap < > ( ) ; ResultSetMetaData rsmd = rs . getMetaData ( ) ; int columnCount = rsmd . getColumnCount ( ) ; for ( int i = 1 ; i <= columnCount ; i ++ ) { String columnLabel = rsmd . getColumnLabel ( i ) ; keys . add ( ...
public class EntitlementType { /** * Gets the value of the requested property * @ param propName * allowed object is { @ link String } * @ return * returned object is { @ link Object } */ public Object get ( String propName ) { } }
if ( propName . equals ( "method" ) ) { return getMethod ( ) ; } if ( propName . equals ( "object" ) ) { return getObject ( ) ; } if ( propName . equals ( "attribute" ) ) { return getAttribute ( ) ; } return null ;
public class JsiiClient { /** * Returns all names for a jsii module . * @ param moduleName The name of the module . * @ return The result ( map from " lang " to language configuration ) . */ public JsonNode getModuleNames ( final String moduleName ) { } }
ObjectNode req = makeRequest ( "naming" ) ; req . put ( "assembly" , moduleName ) ; JsonNode resp = this . runtime . requestResponse ( req ) ; return resp . get ( "naming" ) ;
public class AzkabanSingleServer { /** * To enable " run out of the box for testing " . */ private static String [ ] prepareDefaultConf ( ) throws IOException { } }
final File templateFolder = new File ( "test/local-conf-templates" ) ; final File localConfFolder = new File ( "local/conf" ) ; if ( ! localConfFolder . exists ( ) ) { FileUtils . copyDirectory ( templateFolder , localConfFolder . getParentFile ( ) ) ; log . info ( "Copied local conf templates from " + templateFolder ....
public class JacksonUtils { /** * Calculate checksum of a { @ link JsonNode } , using a supplied hash function . * < ul > * < li > Checksum is calculated recursively ( e . g . child - nodes are included ) . < / li > * < li > If target node is { @ code null } , { @ link NullNode } or { @ link MissingNode } , value...
if ( node == null || node instanceof NullNode || node instanceof MissingNode ) { return 0 ; } if ( node instanceof ValueNode ) { return hashFunc . hashString ( node . toString ( ) , StandardCharsets . UTF_8 ) . asLong ( ) ; } if ( node instanceof ArrayNode ) { final List < HashCode > hashCodes = new ArrayList < > ( ) ;...
public class InternalSARLParser { /** * InternalSARL . g : 8258:1 : ruleFullJvmFormalParameter returns [ EObject current = null ] : ( ( ( lv _ extension _ 0_0 = ' extension ' ) ) ? ( ( lv _ name _ 1_0 = ruleValidID ) ) otherlv _ 2 = ' : ' ( ( lv _ parameterType _ 3_0 = ruleMultiTypeReference ) ) ) ; */ public final EOb...
EObject current = null ; Token lv_extension_0_0 = null ; Token otherlv_2 = null ; AntlrDatatypeRuleToken lv_name_1_0 = null ; EObject lv_parameterType_3_0 = null ; enterRule ( ) ; try { // InternalSARL . g : 8264:2 : ( ( ( ( lv _ extension _ 0_0 = ' extension ' ) ) ? ( ( lv _ name _ 1_0 = ruleValidID ) ) otherlv _ 2 = ...
public class Base64 { /** * Encodes a raw byte array into a BASE64 < code > byte [ ] < / code > representation i accordance with RFC 2045. * @ param sArr The bytes to convert . If < code > null < / code > or length 0 an empty array will be returned . * @ param lineSep Optional " \ r \ n " after 76 characters , unle...
// Check special case int sLen = sArr != null ? sArr . length : 0 ; if ( sLen == 0 ) { return new byte [ 0 ] ; } int eLen = ( sLen / 3 ) * 3 ; // Length of even 24 - bits . int cCnt = ( ( sLen - 1 ) / 3 + 1 ) << 2 ; // Returned character count int dLen = cCnt + ( lineSep ? ( cCnt - 1 ) / 76 << 1 : 0 ) ; // Length of re...
public class JBlinkLabel { /** * Remove this icon from the list of icons alternating for this label . * @ param iIndex The index for this icon . */ public void removeIcon ( int iIndex ) { } }
if ( m_rgIcons != null ) { m_rgIcons [ iIndex ] = null ; // Always at location 0 for ( int i = 0 ; i < MAX_ICONS ; i ++ ) { if ( m_rgIcons [ i ] != null ) return ; } this . removeTimer ( ) ; // No icons left m_rgIcons = null ; }
public class PageFlowController { /** * This is a framework method for initializing a newly - created page flow , and should not normally be called * directly . */ public final synchronized void create ( HttpServletRequest request , HttpServletResponse response , ServletContext servletContext ) { } }
reinitialize ( request , response , servletContext ) ; initializeSharedFlowFields ( request ) ; if ( isNestable ( ) ) { // Initialize a ViewRenderer for exiting the nested page flow . This is used ( currently ) as part of popup // window support - - when exiting a popup nested page flow , a special view renderer writes...
public class LinuxProcFileReader { /** * Read and parse data from / proc / stat and / proc / & lt ; pid & gt ; / stat . * If this doesn ' t work for some reason , the values will be - 1. */ public void read ( ) { } }
String pid = "-1" ; try { pid = getProcessId ( ) ; _pid = pid ; } catch ( Exception ignore ) { } File f = new File ( "/proc/stat" ) ; if ( ! f . exists ( ) ) { return ; } try { readSystemProcFile ( ) ; readProcessProcFile ( pid ) ; readProcessNumOpenFds ( pid ) ; readProcessStatusFile ( pid ) ; parseSystemProcFile ( _s...
public class DescribeScheduledInstanceAvailabilityResult { /** * Information about the available Scheduled Instances . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setScheduledInstanceAvailabilitySet ( java . util . Collection ) } or * { @ link # withSch...
if ( this . scheduledInstanceAvailabilitySet == null ) { setScheduledInstanceAvailabilitySet ( new com . amazonaws . internal . SdkInternalList < ScheduledInstanceAvailability > ( scheduledInstanceAvailabilitySet . length ) ) ; } for ( ScheduledInstanceAvailability ele : scheduledInstanceAvailabilitySet ) { this . sche...
public class KTypeArrayDeque { /** * { @ inheritDoc } */ @ Override public boolean contains ( KType e ) { } }
int fromIndex = head ; int toIndex = tail ; final KType [ ] buffer = Intrinsics . < KType [ ] > cast ( this . buffer ) ; for ( int i = fromIndex ; i != toIndex ; i = oneRight ( i , buffer . length ) ) { if ( Intrinsics . equals ( this , e , buffer [ i ] ) ) { return true ; } } return false ;
public class Hours { /** * Creates a < code > Hours < / code > representing the number of whole hours * between the two specified datetimes . * @ param start the start instant , must not be null * @ param end the end instant , must not be null * @ return the period in hours * @ throws IllegalArgumentException...
int amount = BaseSingleFieldPeriod . between ( start , end , DurationFieldType . hours ( ) ) ; return Hours . hours ( amount ) ;
public class WordBuilder { /** * Appends a word to the contents of the internal storage . * @ param word * the word to append . * @ return { @ code this } */ public WordBuilder < I > append ( Word < ? extends I > word ) { } }
int wLen = word . length ( ) ; ensureAdditionalCapacity ( wLen ) ; word . writeToArray ( 0 , array , length , wLen ) ; length += wLen ; return this ;
public class SegmentUtilities { /** * Initialises the NodeSegment memory for all nodes in the segment . */ public static void createSegmentMemory ( LeftTupleSource tupleSource , InternalWorkingMemory wm ) { } }
Memory mem = wm . getNodeMemory ( ( MemoryFactory ) tupleSource ) ; SegmentMemory smem = mem . getSegmentMemory ( ) ; if ( smem == null ) { createSegmentMemory ( tupleSource , mem , wm ) ; }
public class CheckedOutputStream { /** * Writes an array of bytes . Will block until the bytes are * actually written . * @ param b the data to be written * @ param off the start offset of the data * @ param len the number of bytes to be written * @ exception IOException if an I / O error has occurred */ publ...
out . write ( b , off , len ) ; cksum . update ( b , off , len ) ;
public class AbstractSoftMap { /** * Here we go through the ReferenceQueue and remove garbage collected * SoftValue objects from the HashMap by looking them up using the * SoftValue . m _ aKey data member . */ private void _processQueue ( ) { } }
SoftValue < K , V > aSoftValue ; while ( ( aSoftValue = GenericReflection . uncheckedCast ( m_aQueue . poll ( ) ) ) != null ) { m_aSrcMap . remove ( aSoftValue . m_aKey ) ; }
public class JobExecutionInfoClient { /** * Get a { @ link org . apache . gobblin . rest . JobExecutionQueryResult } for a { @ link org . apache . gobblin . rest . JobExecutionQuery } . * @ param query a { @ link org . apache . gobblin . rest . JobExecutionQuery } * @ return a { @ link org . apache . gobblin . rest...
GetRequest < JobExecutionQueryResult > getRequest = new JobExecutionsBuilders ( ) . get ( ) . id ( new ComplexResourceKey < JobExecutionQuery , EmptyRecord > ( query , new EmptyRecord ( ) ) ) . build ( ) ; Response < JobExecutionQueryResult > response = this . restClient . sendRequest ( getRequest , ErrorHandlingBehavi...
public class FaunusPipeline { /** * Order the previous property value results and emit them with another element property value . * It is important to emit the previous property with a provided type else it is ordered lexigraphically . * @ param order increasing and descending order * @ param elementKey the key o...
return this . order ( com . tinkerpop . gremlin . Tokens . mapOrder ( order ) , elementKey ) ;
public class MetricsUtil { /** * Parses metric name in tagged format into a list of tag - value tuples . * Correctly handles the escaped values . * @ throws IllegalArgumentException if the metricName format is invalid * ( missing square bracket , invalid escape , empty tag name . . . ) */ @ Nonnull public static ...
if ( metricName . charAt ( 0 ) != '[' || metricName . charAt ( metricName . length ( ) - 1 ) != ']' ) { throw new IllegalArgumentException ( "key not enclosed in []: " + metricName ) ; } StringBuilder sb = new StringBuilder ( ) ; List < Map . Entry < String , String > > result = new ArrayList < Map . Entry < String , S...
public class JpaControllerManagement { /** * Returns the count to be used for reducing polling interval while calling * { @ link ControllerManagement # getPollingTimeForAction ( ) } . * @ return configured value of * { @ link TenantConfigurationKey # MAINTENANCE _ WINDOW _ POLL _ COUNT } . */ @ Override public in...
return systemSecurityContext . runAsSystem ( ( ) -> tenantConfigurationManagement . getConfigurationValue ( TenantConfigurationKey . MAINTENANCE_WINDOW_POLL_COUNT , Integer . class ) . getValue ( ) ) ;
public class Hosts { /** * Returns a { @ link Set } of { @ link InetAddress } per { @ link NetworkInterface } as a { @ link Map } . * @ return */ public static Map < String , Set < InetAddress > > getNetworkInterfaceAddresses ( boolean includeLoopback ) { } }
// JVM returns interfaces in a non - predictable order , so to make this more predictable // let ' s have them sort by interface name ( by using a TreeMap ) . Map < String , Set < InetAddress > > interfaceAddressMap = new TreeMap < > ( ) ; try { Enumeration ifaces = NetworkInterface . getNetworkInterfaces ( ) ; while (...
public class MultimapJoiner { /** * Appends the string representation of each entry in { @ code entries } , using the previously configured separator and * key - value separator , to { @ code appendable } . */ public < A extends Appendable > A appendTo ( A appendable , Iterable < ? extends Entry < ? , ? extends Colle...
// checkNotNull ( appendable ) ; Iterator < ? extends Entry < ? , ? extends Collection < ? > > > iterator = entries . iterator ( ) ; if ( iterator . hasNext ( ) ) { Entry < ? , ? extends Collection < ? > > entry = iterator . next ( ) ; appendable . append ( toString ( entry . getKey ( ) ) ) ; appendable . append ( keyV...