signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class CreateApplicationRequest { /** * Use this parameter to configure a CloudWatch log stream to monitor application configuration errors . For more * information , see < a href = " http : / / docs . aws . amazon . com / kinesisanalytics / latest / dev / cloudwatch - logs . html " > Working * with Amazon Cl...
if ( cloudWatchLoggingOptions == null ) { this . cloudWatchLoggingOptions = null ; return ; } this . cloudWatchLoggingOptions = new java . util . ArrayList < CloudWatchLoggingOption > ( cloudWatchLoggingOptions ) ;
public class FaunusPipeline { /** * Count the number of times the previous element ( or property ) has been traversed to . * The results are stored in the jobs sideeffect file in HDFS . * @ return the extended FaunusPipeline . */ public FaunusPipeline groupCount ( ) { } }
this . state . assertNotLocked ( ) ; final Pair < String , Class < ? extends WritableComparable > > pair = this . state . popProperty ( ) ; if ( null == pair ) { return this . groupCount ( null , null ) ; } else { this . compiler . addMapReduce ( ValueGroupCountMapReduce . Map . class , ValueGroupCountMapReduce . Combi...
public class UTF8String { /** * Creates an UTF8String from given address ( base and offset ) and length . */ public static UTF8String fromAddress ( Object base , long offset , int numBytes ) { } }
return new UTF8String ( base , offset , numBytes ) ;
public class HttpServer { /** * Start the server in a new thread */ public void start ( ) { } }
if ( socket == null ) { throw new RuntimeException ( "Cannot bind a server that has not been initialized!" ) ; } running = true ; Thread t = new Thread ( this ) ; t . setName ( "HttpServer" ) ; t . start ( ) ;
public class HttpClient { /** * Posts data to stackify * @ param path REST path * @ param jsonBytes JSON bytes * @ param gzip True if the post should be gzipped , false otherwise * @ return Response string * @ throws IOException * @ throws HttpException */ public String post ( final String path , final byte...
Preconditions . checkNotNull ( path ) ; Preconditions . checkArgument ( ! path . isEmpty ( ) ) ; Preconditions . checkNotNull ( jsonBytes ) ; Preconditions . checkArgument ( 0 < jsonBytes . length ) ; HttpURLConnection connection = null ; try { URL url = new URL ( apiConfig . getApiUrl ( ) + path ) ; // request propert...
public class Options { /** * Given a path like { @ code a . b . c . d } and a set of paths like { @ code { a . b . c , a . f . g , h . j } } , this * returns the original path split on dots such that the first element is in the set . For the * above example it would return the array { @ code [ a . b . c , d ] } . ...
// Try to resolve a local name . for ( int i = 0 ; i < name . length ( ) ; i ++ ) { i = name . indexOf ( '.' , i ) ; if ( i == - 1 ) i = name . length ( ) ; String candidate = name . substring ( 0 , i ) ; if ( fullyQualifiedNames . contains ( candidate ) ) { String [ ] path = name . substring ( i ) . split ( "\\." , - ...
public class WDialog { /** * Run the trigger open action . * @ param request the request being processed */ protected void handleTriggerOpenAction ( final Request request ) { } }
// Run the action ( if set ) final Action action = getTriggerOpenAction ( ) ; if ( action != null ) { final ActionEvent event = new ActionEvent ( this , OPEN_DIALOG_ACTION ) ; Runnable later = new Runnable ( ) { @ Override public void run ( ) { action . execute ( event ) ; } } ; invokeLater ( later ) ; }
public class ShutdownOp { /** * I promise that this is always a collection of HazeltaskTasks */ public Collection < HazeltaskTask < GROUP > > call ( ) throws Exception { } }
try { if ( isShutdownNow ) return this . getDistributedExecutorService ( ) . shutdownNowWithHazeltask ( ) ; else this . getDistributedExecutorService ( ) . shutdown ( ) ; } catch ( IllegalStateException e ) { } return Collections . emptyList ( ) ;
public class Util { /** * read length bytes from stream and return length of coming word */ private static int readLen ( InputStream in ) throws IOException { } }
int c = in . read ( ) ; if ( c > 0 ) { if ( ( c & 0x80 ) == 0 ) { } else if ( ( c & 0xC0 ) == 0x80 ) { c = c & ~ 0xC0 ; c = ( c << 8 ) | in . read ( ) ; } else if ( ( c & 0xE0 ) == 0xC0 ) { c = c & ~ 0xE0 ; c = ( c << 8 ) | in . read ( ) ; c = ( c << 8 ) | in . read ( ) ; } else if ( ( c & 0xF0 ) == 0xE0 ) { c = c & ~ ...
public class BaseRTMPClientHandler { /** * Sends a ping . * @ param pingType * the type of ping * @ param streamId * streams id * @ param param * ping parameter */ public void ping ( short pingType , Number streamId , int param ) { } }
conn . ping ( new Ping ( pingType , streamId , param ) ) ;
public class HttpHeaders { /** * Adds a new header with the specified name and values . * This getMethod can be represented approximately as the following code : * < pre > * for ( Object v : values ) { * if ( v = = null ) { * break ; * headers . add ( name , v ) ; * < / pre > * @ param name The name of ...
return add ( name . toString ( ) , values ) ;
public class MultifactorAuthenticationTrustUtils { /** * Generate key . * @ param r the r * @ return the key for this trust record */ public static String generateKey ( final MultifactorAuthenticationTrustRecord r ) { } }
val builder = new StringBuilder ( r . getPrincipal ( ) ) ; return builder . append ( '@' ) . append ( r . getRecordDate ( ) ) . append ( '@' ) . append ( r . getDeviceFingerprint ( ) ) . toString ( ) ;
public class Sanitizers { /** * Makes sure that the input is a valid CSS identifier part , CLASS or ID part , quantity , or CSS * keyword part . */ public static String filterCssValue ( SoyValue value ) { } }
value = normalizeNull ( value ) ; if ( isSanitizedContentOfKind ( value , SanitizedContent . ContentKind . CSS ) ) { // We don ' t need to do this when the CSS is embedded in a // style attribute since then the HTML escaper kicks in . // TODO ( msamuel ) : Maybe change the autoescaper to generate // | filterCssValue : ...
public class DoubleList { /** * Operates exactly as { @ link # set ( int , java . lang . Double ) } * @ param index the index to set * @ param element the value to set * @ return the previous value at said index */ public double set ( int index , double element ) { } }
boundsCheck ( index ) ; double ret = get ( index ) ; array [ index ] = element ; return ret ;
public class FuzzyActivityDomain { /** * Add a { @ link Rule } to this { @ link MetaConstraint } . * @ param r The rule to add . */ public void addRule ( Rule r ) { } }
rules . add ( r ) ; FuzzyActivity head = ( FuzzyActivity ) solver . createVariable ( r . getComponent ( ) . getName ( ) ) ; head . setMarking ( markings . UNJUSTIFIED ) ; head . setDomain ( r . getComponent ( ) . getStates ( ) , r . getPossibilities ( ) ) ; ruleHeads . put ( head , r ) ; // fan . addVariable ( head ) ;...
public class MiniTemplatorParser { /** * Processes the $ endIf command . */ private void processEndIfCmd ( String parms , int cmdTPosBegin , int cmdTPosEnd ) throws MiniTemplator . TemplateSyntaxException { } }
excludeTemplateRange ( cmdTPosBegin , cmdTPosEnd ) ; if ( parms . trim ( ) . length ( ) != 0 ) { throw new MiniTemplator . TemplateSyntaxException ( "Invalid parameters for $endIf command." ) ; } if ( condLevel < 0 ) { throw new MiniTemplator . TemplateSyntaxException ( "$endif without matching $if." ) ; } condLevel --...
public class Utils { /** * return string as bytes if it has only ascii symbols , or null */ private static byte [ ] toAsciiBytes ( String str ) { } }
for ( int i = 0 ; i < str . length ( ) ; i ++ ) { if ( str . charAt ( i ) > 127 ) return null ; } byte [ ] bytes = new byte [ str . length ( ) ] ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { bytes [ i ] = ( byte ) str . charAt ( i ) ; } return bytes ;
public class ByteCodeWriter { /** * Writes UTF - 8 */ public void writeIntUTF8 ( String value ) throws IOException { } }
writeUTF8 ( _bb , value ) ; writeInt ( _bb . size ( ) ) ; _os . write ( _bb . getBuffer ( ) , 0 , _bb . size ( ) ) ;
public class GetTagsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetTagsRequest getTagsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getTagsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getTagsRequest . getArn ( ) , ARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ;...
public class Logger { /** * This method logs a message at the INFO level . * @ param mesg The message * @ param t exception to log */ public void info ( String mesg , Throwable t ) { } }
log ( Level . INFO , mesg , t ) ;
public class GetDeviceDefinitionResult { /** * The tags for the definition . * @ param tags * The tags for the definition . * @ return Returns a reference to this object so that method calls can be chained together . */ public GetDeviceDefinitionResult withTags ( java . util . Map < String , String > tags ) { } }
setTags ( tags ) ; return this ;
public class Logger { /** * Logging API . Fatal , Warning , and Informational are localized */ public void addFatal ( String key , Throwable throwable ) { } }
logEvent ( FATAL , getString ( key ) , throwable ) ;
public class Generics2 { /** * Returns a list that applies { @ code transformer } to each element of { @ code * elements } */ public static < P , R > List < R > transform ( List < P > elements , Function < P , R > transformer ) { } }
return Lists . transform ( elements , transformer ) ;
public class ResourceBundlesHandlerImpl { /** * Process the bundle content in live * @ param reader * the reader * @ return the processed bundle content * @ throws IOException * if an IOException occured */ private StringReader processInLive ( Reader reader ) throws IOException { } }
String requestURL = ThreadLocalJawrContext . getRequestURL ( ) ; StringWriter swriter = new StringWriter ( ) ; IOUtils . copy ( reader , swriter , true ) ; String updatedContent = swriter . getBuffer ( ) . toString ( ) ; if ( requestURL != null ) { updatedContent = updatedContent . replaceAll ( JawrConstant . JAWR_BUND...
public class Channel { /** * query a peer in this channel for a Block by the blockNumber * @ param peers the peers to try and send the request to * @ param blockNumber index of the Block in the chain * @ param userContext the user context to use . * @ return the { @ link BlockInfo } with the given blockNumber ...
checkChannelState ( ) ; checkPeers ( peers ) ; userContextCheck ( userContext ) ; try { logger . debug ( "queryBlockByNumber with blockNumber " + blockNumber + " on channel " + name ) ; QuerySCCRequest querySCCRequest = new QuerySCCRequest ( userContext ) ; querySCCRequest . setFcn ( QuerySCCRequest . GETBLOCKBYNUMBER ...
public class SynchronizedGeneratorIdentity { /** * Create a new { @ link SynchronizedGeneratorIdentity } instance . * @ param quorum Addresses of the ZooKeeper quorum ( comma - separated ) . * @ param znode Root znode of the ZooKeeper resource - pool . * @ param claimDuration How long a claim to a generator - ID ...
ZooKeeperConnection zooKeeperConnection = new ZooKeeperConnection ( quorum ) ; int clusterId = ClusterID . get ( zooKeeperConnection . getActiveConnection ( ) , znode ) ; Supplier < Duration > durationSupplier = ( ) -> Duration . ofMillis ( claimDuration ) ; return new SynchronizedGeneratorIdentity ( zooKeeperConnectio...
public class ExtensionScript { /** * Removes the given script type . * The templates and scripts associated with the given type are also removed , if any . * The call to this method has no effect if the given type is not registered . * @ param type the script type that will be removed * @ since 2.4.0 * @ see ...
ScriptType scriptType = typeMap . remove ( type . getName ( ) ) ; if ( scriptType != null ) { getTreeModel ( ) . removeType ( scriptType ) ; }
public class QrCodeUtil { /** * 将文本内容编码为条形码或二维码 * @ param content 文本内容 * @ param format 格式枚举 * @ param config 二维码配置 , 包括长 、 宽 、 边距 、 颜色等 * @ return { @ link BitMatrix } * @ since 4.1.2 */ public static BitMatrix encode ( String content , BarcodeFormat format , QrConfig config ) { } }
final MultiFormatWriter multiFormatWriter = new MultiFormatWriter ( ) ; if ( null == config ) { // 默认配置 config = new QrConfig ( ) ; } BitMatrix bitMatrix ; try { bitMatrix = multiFormatWriter . encode ( content , format , config . width , config . height , config . toHints ( ) ) ; } catch ( WriterException e ) { throw ...
public class ControllerPreAuthenticatedSecurityHeaderFilter { /** * Iterates over the { @ link # sslIssuerHashBasicHeader } basic header * { @ code X - Ssl - Issuer - Hash - % d } and try to finds the same hash as known . * It ' s ok if we find the the hash in any the trusted CA chain to accept * this request for...
// there may be several knownIssuerHashes configured for the tenant final List < String > knownHashes = splitMultiHashBySemicolon ( knownIssuerHashes ) ; // iterate over the headers until we get a null header . int iHeader = 1 ; String foundHash ; while ( ( foundHash = secruityToken . getHeader ( String . format ( sslI...
public class WrappingUtils { /** * Applies rounding on the drawable ' s leaf . * < p > Currently only { @ link BitmapDrawable } or { @ link ColorDrawable } leafs can be rounded . * < p > If the leaf cannot be rounded , or the rounding params do not specify BITMAP _ ONLY mode , * the given drawable is returned wit...
try { if ( FrescoSystrace . isTracing ( ) ) { FrescoSystrace . beginSection ( "WrappingUtils#maybeApplyLeafRounding" ) ; } if ( drawable == null || roundingParams == null || roundingParams . getRoundingMethod ( ) != RoundingParams . RoundingMethod . BITMAP_ONLY ) { return drawable ; } if ( drawable instanceof Forwardin...
public class StringHelper { /** * Takes a String s and returns a new String [ 1 ] with s as the only element . * If s is null or " " , return String [ 0 ] . * @ param s The element to be wrapped * @ return String [ ] */ public static String [ ] toArrayElement ( String s ) { } }
return ( s == null || s . length ( ) == 0 ) ? new String [ 0 ] : new String [ ] { s } ;
public class RoadNetworkConstants { /** * Replies the preferred distance below which roads may be connected . * @ return the preferred distance ( in meters ) below which roads may be connected . */ @ Pure public static double getPreferredRoadConnectionDistance ( ) { } }
final Preferences prefs = Preferences . userNodeForPackage ( RoadNetworkConstants . class ) ; if ( prefs != null ) { return prefs . getDouble ( "ROAD_CONNECTION_DISTANCE" , DEFAULT_ROAD_CONNECTION_DISTANCE ) ; // $ NON - NLS - 1 $ } return DEFAULT_ROAD_CONNECTION_DISTANCE ;
public class WhiteboxImpl { /** * Creates the instance . * @ param < T > the generic type * @ param constructor the constructor * @ param arguments the arguments * @ return the t * @ throws Exception the exception */ private static < T > T createInstance ( Constructor < T > constructor , Object ... arguments ...
if ( constructor == null ) { throw new IllegalArgumentException ( "Constructor cannot be null" ) ; } constructor . setAccessible ( true ) ; T createdObject = null ; try { if ( constructor . isVarArgs ( ) ) { Class < ? > [ ] parameterTypes = constructor . getParameterTypes ( ) ; final int varArgsIndex = parameterTypes ....
public class RangeHashFunction { /** * generates the correct index structure , namely the bucketIds to the already initialized filenames and * maxRangeValues */ private void generateBucketIds ( ) { } }
// generate indexes for buckets , needed if two different ranges belong to the same file this . buckets = 0 ; bucketIds = new int [ filenames . length ] ; HashMap < String , Integer > tmpSeenFilenames = new HashMap < String , Integer > ( ) ; for ( int i = 0 ; i < filenames . length ; i ++ ) { if ( ! tmpSeenFilenames . ...
public class ClassPathGeneratorHelper { /** * Returns the resources name from a Jar file . * @ param path * the directory path * @ param resourceURL * the jar file URL * @ return the resources name from a Jar file . */ private Set < String > getResourceNamesFromJar ( String path , URL resourceURL ) { } }
URLConnection con = null ; try { if ( resourceURL . toString ( ) . startsWith ( JawrConstant . JAR_URL_PREFIX ) ) { con = resourceURL . openConnection ( ) ; } } catch ( IOException e ) { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "Unable to find resources name for path '" + path + "'" , e ) ; } return Collec...
public class AOPool { /** * Gets the number of connections currently connected . */ final public int getConnectionCount ( ) { } }
int total = 0 ; synchronized ( poolLock ) { for ( PooledConnection < C > pooledConnection : allConnections ) { if ( pooledConnection . connection != null ) total ++ ; } } return total ;
public class CmsResourceManager { /** * Reads a template resource together with its name . < p > * @ param cms the current CMS context * @ param path the template path * @ return the template together with its name , or null if the template couldn ' t be read */ private NamedTemplate readTemplateWithName ( CmsObj...
try { CmsResource resource = cms . readResource ( path , CmsResourceFilter . IGNORE_EXPIRATION ) ; String name = getTemplateName ( cms , resource ) ; return new NamedTemplate ( resource , name ) ; } catch ( Exception e ) { return null ; }
public class IOUtils { /** * Prints { @ code string } to { @ code file } . * @ throws IOException If any I / O exception occurs while printing ; this method does not catch any exceptions */ public static void print ( String string , File file ) throws IOException { } }
PrintWriter out = null ; try { out = new PrintWriter ( new BufferedWriter ( new FileWriter ( file ) ) ) ; out . print ( string ) ; out . flush ( ) ; out . close ( ) ; } finally { if ( out != null ) out . close ( ) ; }
public class PageSpec { /** * Parses the spec from specText and adds it to the page spec inside specified section . If section does not exit , it will create it * @ param sectionName * @ param objectName * @ param specText */ public void addSpec ( String sectionName , String objectName , String specText ) { } }
PageSection pageSection = findSection ( sectionName ) ; if ( pageSection == null ) { pageSection = new PageSection ( sectionName ) ; sections . add ( pageSection ) ; } ObjectSpecs objectSpecs = new ObjectSpecs ( objectName ) ; objectSpecs . addSpec ( new SpecReader ( ) . read ( specText ) ) ; pageSection . addObjects (...
public class AggregationReader { /** * Returns the next reader in the iteration . If the object is not * a Reader or an InputStream , then returns a StringReader for the * object ' s toString ( ) result . * @ return The next reader in the iteration * @ throws IOException */ protected Reader getNextInputReader (...
if ( iter == null ) { return null ; } if ( ! iter . hasNext ( ) ) { return null ; } Object o = iter . next ( ) ; if ( o instanceof Reader ) { return ( Reader ) o ; } else if ( o instanceof InputStream ) { return new InputStreamReader ( ( InputStream ) o , "UTF-8" ) ; // $ NON - NLS - 1 $ } return new StringReader ( o ....
public class ProtobufConnection { /** * Does set the buffers ' s position to its limit */ @ SuppressWarnings ( "unchecked" ) // The warning ' unchecked cast ' being suppressed here comes from the build ( ) formally returning // a MessageLite - derived class that cannot be statically guaranteed to be the MessageType . p...
MessageType msg = ( MessageType ) prototype . newBuilderForType ( ) . mergeFrom ( ByteString . copyFrom ( buff ) ) . build ( ) ; resetTimeout ( ) ; handler . messageReceived ( this , msg ) ;
public class AverageDownSampleOps { /** * Down samples a planar image . Type checking is done at runtime . * @ param input Input image . Not modified . * @ param sampleWidth Width of square region . * @ param output Output image . Modified . */ public static < T extends ImageGray < T > > void down ( Planar < T > ...
for ( int band = 0 ; band < input . getNumBands ( ) ; band ++ ) { down ( input . getBand ( band ) , sampleWidth , output . getBand ( band ) ) ; }
public class U { /** * Documented , # debounce */ public static < T > Supplier < T > debounce ( final Supplier < T > function , final int delayMilliseconds ) { } }
return new Supplier < T > ( ) { private java . util . concurrent . ScheduledFuture < T > timeout ; @ Override public T get ( ) { clearTimeout ( timeout ) ; timeout = delay ( function , delayMilliseconds ) ; return null ; } } ;
public class ObjectExtensions { /** * The < code > equals not < / code > operator . This is the equivalent to a negated , null - safe * { @ link Object # equals ( Object ) } method . * @ param a * an object . * @ param b * another object . * @ return < code > true < / code > if { @ code a } and { @ code b }...
return ! Objects . equal ( a , b ) ;
public class AWSGlueClient { /** * Updates a crawler . If a crawler is running , you must stop it using < code > StopCrawler < / code > before updating it . * @ param updateCrawlerRequest * @ return Result of the UpdateCrawler operation returned by the service . * @ throws InvalidInputException * The input prov...
request = beforeClientExecution ( request ) ; return executeUpdateCrawler ( request ) ;
public class BeanHelperCache { /** * Write an Empty Interface implementing * { @ link de . knightsoftnet . validators . client . impl . AbstractGwtSpecificValidator } with Generic * parameter of the bean type . */ private void writeInterface ( final GeneratorContext context , final TreeLogger logger , final BeanHel...
final PrintWriter pw = context . tryCreate ( logger , bean . getPackage ( ) , bean . getValidatorName ( ) ) ; if ( pw != null ) { final TreeLogger interfaceLogger = logger . branch ( TreeLogger . TRACE , "Creating the interface for " + bean . getFullyQualifiedValidatorName ( ) ) ; final ClassSourceFileComposerFactory f...
public class TSDB { /** * Given a prefix search , returns matching tag values . * @ param search A prefix to search . * @ param max _ results Maximum number of results to return . * @ since 2.0 */ public List < String > suggestTagValues ( final String search , final int max_results ) { } }
return tag_values . suggest ( search , max_results ) ;
public class VAFile { /** * Initialize the data set grid by computing quantiles . * @ param relation Data relation * @ throws IllegalArgumentException */ public void setPartitions ( Relation < V > relation ) throws IllegalArgumentException { } }
if ( ( FastMath . log ( partitions ) / FastMath . log ( 2 ) ) != ( int ) ( FastMath . log ( partitions ) / FastMath . log ( 2 ) ) ) { throw new IllegalArgumentException ( "Number of partitions must be a power of 2!" ) ; } final int dimensions = RelationUtil . dimensionality ( relation ) ; final int size = relation . si...
public class EncodedGradientsAccumulator { /** * This method does initialization of given worker wrt Thread - Device Affinity */ @ Override public void touch ( ) { } }
if ( index . get ( ) == null ) { // set index int numDevces = Nd4j . getAffinityManager ( ) . getNumberOfDevices ( ) ; /* if we have > 1 computational device , we assign workers to workspaces " as is " , as provided via AffinityManager */ if ( numDevces > 1 && parties > 1 ) { int localIndex = Nd4j . getAffinityManager ...
public class CmsModelPageTreeItem { /** * Creates the fake model page tree item used as a root for the tree view . < p > * @ param isModelGroup in case of a model group page * @ param title the title * @ param subTitle the sub title * @ return the root tree item */ public static CmsModelPageTreeItem createRootI...
return new CmsModelPageTreeItem ( isModelGroup , title , subTitle ) ;
public class TreeValueExpression { /** * Evaluates the expression as an lvalue and answers the result type . * @ param context used to resolve properties ( < code > base . property < / code > and < code > base [ property ] < / code > ) * and to determine the result from the last base / property pair * @ return lv...
return node . getType ( bindings , context ) ;
public class ChangeOnChangeHandler { /** * Constructor . * @ param field The basefield owner of this listener ( usually null and set on setOwner ( ) ) . * @ param fldTarget Field to initialize on change ( to the owner ' s field ) . */ public void init ( BaseField field , BaseField fldTarget , boolean bSetModified )...
super . init ( field ) ; m_fldTarget = fldTarget ; m_bSetModified = bSetModified ; this . setRespondsToMode ( DBConstants . INIT_MOVE , false ) ; this . setRespondsToMode ( DBConstants . READ_MOVE , false ) ;
public class PelopsUtils { /** * Gets the pool config policy . * @ param persistenceUnitMetadata * the persistence unit metadata * @ param puProperties * @ return the pool config policy */ public static Policy getPoolConfigPolicy ( com . impetus . client . cassandra . service . CassandraHost cassandraHost ) { }...
Policy policy = new Policy ( ) ; if ( cassandraHost . getMaxActive ( ) > 0 ) { policy . setMaxActivePerNode ( cassandraHost . getMaxActive ( ) ) ; } if ( cassandraHost . getMaxIdle ( ) > 0 ) { policy . setMaxIdlePerNode ( cassandraHost . getMaxIdle ( ) ) ; } if ( cassandraHost . getMinIdle ( ) > 0 ) { policy . setMinId...
public class VisLmlSyntax { /** * ColorPicker attributes . */ protected void registerColorPickerAttributes ( ) { } }
addAttributeProcessor ( new CloseAfterPickingLmlAttribute ( ) , "closeAfterPickingFinished" , "closeAfter" ) ; addAttributeProcessor ( new ColorPickerListenerLmlAttribute ( ) , "listener" ) ; addAttributeProcessor ( new ColorPickerResponsiveListenerLmlAttribute ( ) , "responsiveListener" ) ; // BasicColorPicker : addAt...
public class ArrayCollectionConverter { /** * say hello to arrays of primitives */ private final < T > Object parseTypeArr ( Converter < T > converter , Class < T > valType , String [ ] arr ) throws Exception { } }
Object objArr = Array . newInstance ( valType , arr . length ) ; for ( int i = 0 ; i < arr . length ; i ++ ) { T item = converter . parseFromString ( valType , null , null , arr [ i ] ) ; Array . set ( objArr , i , item ) ; } return objArr ;
public class Utils { /** * Determine if the type specified in lookingFor is a supertype ( class / interface ) of the specified typedescriptor , i . e . can an * object of type ' candidate ' be assigned to a variable of typ ' lookingFor ' . * @ return true if it is a supertype */ public static boolean isAssignableFr...
String [ ] interfaces = candidate . getSuperinterfacesName ( ) ; for ( String intface : interfaces ) { if ( intface . equals ( lookingFor ) ) { return true ; } boolean b = isAssignableFrom ( lookingFor , candidate . getTypeRegistry ( ) . getDescriptorFor ( intface ) ) ; if ( b ) { return true ; } } String supertypename...
public class CollectionUtil { /** * Returns an Array , of the type specified by the runtime - type token < code > type < / code > , * containing the elements of the collection . */ @ ReplacedBy ( "com.google.common.collect.Iterables#toArray()" ) public static < T > T [ ] toArray ( Collection < ? extends T > col , Cla...
@ SuppressWarnings ( "unchecked" ) T [ ] array = ( T [ ] ) Array . newInstance ( type , col . size ( ) ) ; return col . toArray ( array ) ;
public class SliceUtf8 { /** * Gets the UTF - 8 sequence length using the sequence start byte . * Note : This method does not explicitly check for valid UTF - 8 , and may * return incorrect results or throw an exception for invalid UTF - 8. */ public static int lengthOfCodePointFromStartByte ( byte startByte ) { } ...
int unsignedStartByte = startByte & 0xFF ; if ( unsignedStartByte < 0x80 ) { // normal ASCII // 0xxx _ xxxx return 1 ; } if ( unsignedStartByte < 0xc0 ) { // illegal bytes // 10xx _ xxxx throw new InvalidUtf8Exception ( "Illegal start 0x" + toHexString ( unsignedStartByte ) . toUpperCase ( ) + " of code point" ) ; } if...
public class CPMeasurementUnitPersistenceImpl { /** * Caches the cp measurement unit in the entity cache if it is enabled . * @ param cpMeasurementUnit the cp measurement unit */ @ Override public void cacheResult ( CPMeasurementUnit cpMeasurementUnit ) { } }
entityCache . putResult ( CPMeasurementUnitModelImpl . ENTITY_CACHE_ENABLED , CPMeasurementUnitImpl . class , cpMeasurementUnit . getPrimaryKey ( ) , cpMeasurementUnit ) ; finderCache . putResult ( FINDER_PATH_FETCH_BY_UUID_G , new Object [ ] { cpMeasurementUnit . getUuid ( ) , cpMeasurementUnit . getGroupId ( ) } , cp...
public class Schemas { /** * Constraint info from ConstraintDefinition for relationships * @ param constraintDefinition * @ return */ private ConstraintRelationshipInfo relationshipInfoFromConstraintDefinition ( ConstraintDefinition constraintDefinition ) { } }
return new ConstraintRelationshipInfo ( String . format ( "CONSTRAINT %s" , constraintDefinition . toString ( ) ) , constraintDefinition . getConstraintType ( ) . name ( ) , Iterables . asList ( constraintDefinition . getPropertyKeys ( ) ) , "" ) ;
public class CUarray_cubemap_face { /** * Returns the String identifying the given CUarray _ cubemap _ face * @ param n The CUarray _ cubemap _ face * @ return The String identifying the given CUarray _ cubemap _ face */ public static String stringFor ( int n ) { } }
switch ( n ) { case CU_CUBEMAP_FACE_POSITIVE_X : return "CU_CUBEMAP_FACE_POSITIVE_X" ; case CU_CUBEMAP_FACE_NEGATIVE_X : return "CU_CUBEMAP_FACE_NEGATIVE_X" ; case CU_CUBEMAP_FACE_POSITIVE_Y : return "CU_CUBEMAP_FACE_POSITIVE_Y" ; case CU_CUBEMAP_FACE_NEGATIVE_Y : return "CU_CUBEMAP_FACE_NEGATIVE_Y" ; case CU_CUBEMAP_F...
public class ConfigMgr { /** * 初始化配置 * @ throws Exception */ public synchronized static void init ( ) throws Exception { } }
LOGGER . info ( "--------------- LOAD CONFIG START ---------------" ) ; LOGGER . info ( "Finer print: " + DisClientComConfig . getInstance ( ) . getInstanceFingerprint ( ) ) ; // 导入系统配置 DisClientSysConfig . getInstance ( ) . loadConfig ( null ) ; // 校验 系统配置 DisInnerConfigHelper . verifySysConfig ( ) ; // 导入用户配置 DisClie...
public class ZipUtil { /** * 对文件或文件目录进行压缩 < br > * 使用默认UTF - 8编码 * @ param zipFile 生成的Zip文件 , 包括文件名 。 注意 : zipPath不能是srcPath路径下的子文件夹 * @ param withSrcDir 是否包含被打包目录 , 只针对压缩目录有效 。 若为false , 则只压缩目录下的文件或目录 , 为true则将本目录也压缩 * @ param srcFiles 要压缩的源文件或目录 。 * @ return 压缩文件 * @ throws UtilException IO异常 */ public st...
return zip ( zipFile , DEFAULT_CHARSET , withSrcDir , srcFiles ) ;
public class Types { /** * Get a capture variable ' s lower bound , returning other types unchanged . * @ param t a type */ public Type cvarLowerBound ( Type t ) { } }
if ( t . hasTag ( TYPEVAR ) ) { TypeVar v = ( TypeVar ) t . unannotatedType ( ) ; return v . isCaptured ( ) ? cvarLowerBound ( v . getLowerBound ( ) ) : v ; } else return t . unannotatedType ( ) ;
public class AbstractEkstaziMojo { /** * Locate paramName in the given ( surefire ) plugin . Returns value * of the file . */ protected String extractParamValue ( Plugin plugin , String paramName ) throws MojoExecutionException { } }
Xpp3Dom configuration = ( Xpp3Dom ) plugin . getConfiguration ( ) ; if ( configuration == null ) { return null ; } Xpp3Dom paramDom = configuration . getChild ( paramName ) ; return paramDom == null ? null : paramDom . getValue ( ) ;
public class Collator { /** * < strong > [ icu ] < / strong > Registers a collator as the default collator for the provided locale . The * collator should not be modified after it is registered . * < p > Because ICU may choose to cache Collator objects internally , this must * be called at application startup , p...
return getShim ( ) . registerInstance ( collator , locale ) ;
public class GetUsersTopTracksRequest { /** * Get an user ' s top tracks . * @ return An user ' s top tracks . * @ throws IOException In case of networking issues . * @ throws SpotifyWebApiException The Web API returned an error further specified in this exception ' s root cause . */ @ SuppressWarnings ( "uncheck...
return new Track . JsonUtil ( ) . createModelObjectPaging ( getJson ( ) ) ;
public class CodedOutputStream { /** * Compute the number of bytes that would be needed to encode a * MessageSet extension to the stream . For historical reasons , * the wire format differs from normal fields . */ public static int computeMessageSetExtensionSize ( final int fieldNumber , final MessageLite value ) {...
return computeTagSize ( WireFormat . MESSAGE_SET_ITEM ) * 2 + computeUInt32Size ( WireFormat . MESSAGE_SET_TYPE_ID , fieldNumber ) + computeMessageSize ( WireFormat . MESSAGE_SET_MESSAGE , value ) ;
public class Encryption { /** * Decrypt the specified string according to the given key . * < p > Caution : this function use some Sun ' s JDK classes . * < p > The DES algorithm is used . * @ param str is the string to decrypt * @ param decrypting _ key is the key used for decryption . * @ param algorithm is...
try { // Initialize the decoder final Cipher cipher = Cipher . getInstance ( algorithm ) ; cipher . init ( Cipher . DECRYPT_MODE , decrypting_key ) ; // Decode return cipher . doFinal ( str ) ; } catch ( Exception e ) { return null ; }
public class ScalableStatistics { /** * Merges another statistics instance into this instance . For example , this way the independent * stats and quantiles of each separate MapReduce task can be merged into a single overall job * summary statistic . */ public void add ( ScalableStatistics other ) { } }
count += other . count ; min = Math . min ( min , other . min ) ; max = Math . max ( max , other . max ) ; sum += other . sum ; sumOfSquares += other . sumOfSquares ; tdigest . add ( other . tdigest ) ; if ( other . exactValues != null ) { for ( int i = 0 ; i < other . numExactValues ; i ++ ) { addQuantileValue ( other...
public class AeronNDArraySerde { /** * Get the direct byte buffer from the given direct buffer * @ param directBuffer * @ return */ public static ByteBuffer getDirectByteBuffer ( DirectBuffer directBuffer ) { } }
return directBuffer . byteBuffer ( ) == null ? ByteBuffer . allocateDirect ( directBuffer . capacity ( ) ) . put ( directBuffer . byteArray ( ) ) : directBuffer . byteBuffer ( ) ;
public class LocalWeightedHistogramRotRect { /** * Converts a point from square coordinates into image coordinates */ protected void squareToImageSample ( float x , float y , RectangleRotate_F32 region ) { } }
// -1 because it starts counting at 0 . otherwise width + 1 samples are made x *= region . width - 1 ; y *= region . height - 1 ; imageX = x * c - y * s + region . cx ; imageY = x * s + y * c + region . cy ;
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getMMORG ( ) { } }
if ( mmorgEClass == null ) { mmorgEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 425 ) ; } return mmorgEClass ;
public class RelationalOperationsMatrix { /** * with the interior of Point B . */ private void interiorPointInteriorPoint_ ( int cluster , int id_a , int id_b ) { } }
if ( m_matrix [ MatrixPredicate . InteriorInterior ] == 0 ) return ; int clusterParentage = m_topo_graph . getClusterParentage ( cluster ) ; if ( ( clusterParentage & id_a ) != 0 && ( clusterParentage & id_b ) != 0 ) { m_matrix [ MatrixPredicate . InteriorInterior ] = 0 ; }
public class StorageProviderUtil { /** * Loads a stream containing properties and populates a map * with the properties name / value pairs . * @ param is * @ return * @ throws StorageException */ public static Map < String , String > loadProperties ( InputStream is ) throws StorageException { } }
Map < String , String > propertiesMap = null ; if ( is != null ) { try { String properties = readStringFromStream ( is ) ; propertiesMap = deserializeMap ( properties ) ; } catch ( Exception e ) { String err = "Could not read properties " + " due to error: " + e . getMessage ( ) ; throw new StorageException ( err , e )...
public class LightFileDescriptor { /** * Returns true if file modified */ public boolean checkModified ( LightFileDescriptor other ) { } }
if ( isAlwaysModified ( ) || other . isAlwaysModified ( ) ) return true ; if ( ! name . equals ( other . name ) ) return true ; if ( ! ( hasChecksum ( ) && other . hasChecksum ( ) ) && ! ( hasModificationDate ( ) && other . hasModificationDate ( ) ) ) // No intersecting characteristics , cant compare = > file is modifi...
public class TransactionIntegrationImpl { /** * { @ inheritDoc } */ public XAResourceWrapper createXAResourceWrapper ( XAResource xares , boolean pad , Boolean override , String productName , String productVersion , String jndiName , boolean firstResource , XAResourceStatistics xastat ) { } }
if ( firstResource ) { if ( xastat != null && xastat . isEnabled ( ) ) { return new FirstResourceXAResourceWrapperStatImpl ( xares , pad , override , productName , productVersion , jndiName , xastat ) ; } else { return new FirstResourceXAResourceWrapperImpl ( xares , pad , override , productName , productVersion , jndi...
public class MathUtils { /** * Calculates the Fibonacci Sequence to the nth position . * @ param n an integer value indicating the position of the nth element in the Fibonacci Sequence . * @ return an integer array containing n elements of the Fibonacci Sequence . * @ throws IllegalArgumentException if the positi...
Assert . argument ( n > 0 , "The number of elements from the Fibonacci Sequence to calculate must be greater than equal to 0!" ) ; int [ ] fibonacciNumbers = new int [ n ] ; for ( int position = 0 ; position < n ; position ++ ) { if ( position == 0 ) { fibonacciNumbers [ position ] = 0 ; } else if ( position < 2 ) { fi...
public class EJSHome { /** * f111627 */ public EJBLocalObject postCreate_Local ( BeanO beanO ) throws CreateException , ContainerException , RemoteException { } }
homeEnabled ( ) ; return postCreate_Local ( beanO , beanO . getId ( ) , false ) ;
public class Pair { /** * Makes grabbing the first value out of a collection of Pairs a bit easier , e . g . * given an iterable over Pair . of ( String , ? ) objects : * < br > * < code > * . . . = Iterables . transform ( iterable , Pair . & lt ; String & gt ; fst ( ) ) * < / code > * @ param < T > The exp...
return new Function < Pair < ? extends T , ? > , T > ( ) { @ Nullable @ Override public T apply ( @ Nullable Pair < ? extends T , ? > input ) { return ( input == null ) ? null : input . getFirst ( ) ; } } ;
public class DeclaredDependencies { /** * Get the transient dependencies defined for the given artifact specification . * @ param artifact the artifact specification . * @ return the transient dependencies defined for the given artifact specification . */ public Collection < ArtifactSpec > getTransientDependencies ...
Set < ArtifactSpec > deps = new HashSet < > ( ) ; if ( this . isDirectDep ( artifact ) ) { deps . addAll ( getTransientDeps ( artifact ) ) ; } if ( presolvedDependencies . isDirectDep ( artifact ) ) { deps . addAll ( presolvedDependencies . getTransientDeps ( artifact ) ) ; } return deps ;
public class JsonWriter { /** * < b > 注意 : < / b > 该String值不能为null且不会进行转义 , 只用于不含需要转义字符的字符串 , 例如enum 、 double 、 BigInteger转换的String * @ param quote 是否加双引号 * @ param value 非null且不含需要转义的字符的String值 */ public void writeTo ( final boolean quote , final String value ) { } }
int len = value . length ( ) ; expand ( len + ( quote ? 2 : 0 ) ) ; if ( quote ) content [ count ++ ] = '"' ; value . getChars ( 0 , len , content , count ) ; count += len ; if ( quote ) content [ count ++ ] = '"' ;
public class Cob2AvroJob { /** * Gets the job input record matcher class . * @ param conf The job configuration . * @ return The job input record matcher class , or null if not set . */ public static Class < ? extends CobolTypeFinder > getInputRecordMatcher ( Configuration conf ) { } }
return conf . getClass ( CONF_INPUT_RECORD_MATCHER_CLASS , null , CobolTypeFinder . class ) ;
public class Cash { /** * Add the amount with the existing one and return a new immutable Money . * @ throws IllegalArgumentException if the money . currency does not match the current one . */ @ Override public CurrencyAmount add ( final CurrencyAmount money ) { } }
if ( ! money . getCurrency ( ) . equals ( currency ) ) { throw new IllegalArgumentException ( "You cannot add " + money . getCurrency ( ) + " with " + currency ) ; } return new Cash ( currency , BigDecimalUtil . add ( amount , money . getAmount ( ) ) ) ;
public class PhotosInterface { /** * Get the photo for the specified ID with the given secret . Currently maps to the getInfo ( ) method . * @ param id * The ID * @ param secret * The secret * @ return The Photo */ public Photo getPhoto ( String id , String secret ) throws FlickrException { } }
return getInfo ( id , secret ) ;
public class AmazonGameLiftClient { /** * Deletes a build . This action permanently deletes the build record and any uploaded build files . * To delete a build , specify its ID . Deleting a build does not affect the status of any active fleets using the * build , but you can no longer create new fleets with the del...
request = beforeClientExecution ( request ) ; return executeDeleteBuild ( request ) ;
public class AWSStorageGatewayClient { /** * Returns a list of the gateway ' s local disks . To specify which gateway to describe , you use the Amazon Resource * Name ( ARN ) of the gateway in the body of the request . * The request returns a list of all disks , specifying which are configured as working storage , ...
request = beforeClientExecution ( request ) ; return executeListLocalDisks ( request ) ;
public class LongList { /** * Returns whether any elements of this List match the provided predicate . * @ param filter * @ return */ public < E extends Exception > boolean anyMatch ( Try . LongPredicate < E > filter ) throws E { } }
return anyMatch ( 0 , size ( ) , filter ) ;
public class ZmqEventConsumer { protected void unsubscribeTheEvent ( EventCallBackStruct callbackStruct ) throws DevFailed { } }
ZMQutils . disConnectEvent ( callbackStruct . device . get_tango_host ( ) , callbackStruct . device . name ( ) , callbackStruct . attr_name , callbackStruct . device . get_idl_version ( ) , callbackStruct . event_name ) ;
public class UIViewRoot { /** * null checks . */ private void notifyBefore ( FacesContext context , PhaseId phaseId ) { } }
if ( getBeforePhaseListener ( ) != null || phaseListenerIterator != null ) { notifyPhaseListeners ( context , phaseId , true ) ; }
public class LogInvocationProcessor { /** * Check whether type element extends { @ link VariableContext } */ private boolean extendsVariableContext ( final TypeElement typeElement ) { } }
boolean extendsVariableContext = false ; for ( TypeMirror extendingInterface : typeElement . getInterfaces ( ) ) { if ( extendingInterface . toString ( ) . equals ( VariableContext . class . getCanonicalName ( ) ) ) { extendsVariableContext = true ; } } return extendsVariableContext ;
public class DefaultPagination { /** * Notes : elements should be the entire records set ( regardless of filtering ) otherwise maxNbRecords won ' t be accurate */ public static < T > Pagination < T > build ( final Long offset , final Long limit , final Collection < T > elements ) { } }
return build ( offset , limit , elements . size ( ) , elements ) ;
public class RangeStreamer { /** * Get a map of all ranges and their respective sources that are candidates for streaming the given ranges * to us . For each range , the list of sources is sorted by proximity relative to the given destAddress . */ private Multimap < Range < Token > , InetAddress > getAllRangesWithSou...
AbstractReplicationStrategy strat = Keyspace . open ( keyspaceName ) . getReplicationStrategy ( ) ; Multimap < Range < Token > , InetAddress > rangeAddresses = strat . getRangeAddresses ( metadata . cloneOnlyTokenMap ( ) ) ; Multimap < Range < Token > , InetAddress > rangeSources = ArrayListMultimap . create ( ) ; for ...
public class JobAgentsInner { /** * Gets a job agent . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of the server . * @ param jobAgentName The name of the job agen...
return getWithServiceResponseAsync ( resourceGroupName , serverName , jobAgentName ) . map ( new Func1 < ServiceResponse < JobAgentInner > , JobAgentInner > ( ) { @ Override public JobAgentInner call ( ServiceResponse < JobAgentInner > response ) { return response . body ( ) ; } } ) ;
public class WMultiTextField { /** * Helper that removes empty / null string from the < code > original < / code > string array . * Will treat an empty array the same as null . * @ param originals The string array from which the null / empty strings should be removed from . * @ return Array of non empty strings f...
if ( originals == null ) { return null ; } else { List < String > parsed = new ArrayList < > ( ) ; for ( String original : originals ) { if ( original != null && original . length ( ) > 0 ) { parsed . add ( original ) ; } } // Treat empty the same as null return parsed . isEmpty ( ) ? null : parsed . toArray ( new Stri...
public class XPath { /** * Creates a new { @ code XPath } expression based on the expression string specified with * optional < tt > $ $ < / tt > placeholders replaced by supplied values . Note that i - th placeholder * is replaced with i - th value of the { @ code values } vararg array , while namespaces reference...
return parse ( Data . getNamespaceMap ( ) , string , values ) ;
public class GlobalExceptionHandler { /** * 处理参数绑定错误 * @ param be 绑定异常 * @ param mvc mvc * @ return mvc */ private ModelAndView buildBizErrors ( BindException be , ModelAndView mvc ) { } }
Map < String , Object > paramErrors = new HashMap < String , Object > ( ) ; Object o = be . getTarget ( ) ; for ( Object error : be . getAllErrors ( ) ) { if ( error instanceof FieldError ) { FieldError fe = ( FieldError ) error ; String field = fe . getField ( ) ; Field oField = null ; try { oField = o . getClass ( ) ...
public class TranslationServiceClient { /** * Returns a list of supported languages for translation . * < p > Sample code : * < pre > < code > * try ( TranslationServiceClient translationServiceClient = TranslationServiceClient . create ( ) ) { * String formattedParent = TranslationServiceClient . formatLocatio...
if ( ! parent . isEmpty ( ) ) { LOCATION_PATH_TEMPLATE . validate ( parent , "getSupportedLanguages" ) ; } GetSupportedLanguagesRequest request = GetSupportedLanguagesRequest . newBuilder ( ) . setParent ( parent ) . setDisplayLanguageCode ( displayLanguageCode ) . setModel ( model ) . build ( ) ; return getSupportedLa...
public class LocalSession { /** * / * ( non - Javadoc ) * @ see javax . jms . Session # createBrowser ( javax . jms . Queue , java . lang . String ) */ @ Override public QueueBrowser createBrowser ( Queue queueRef , String messageSelector ) throws JMSException { } }
return createBrowser ( idProvider . createID ( ) , queueRef , messageSelector ) ;
public class ListHITsResult { /** * The list of HIT elements returned by the query . * @ param hITs * The list of HIT elements returned by the query . */ public void setHITs ( java . util . Collection < HIT > hITs ) { } }
if ( hITs == null ) { this . hITs = null ; return ; } this . hITs = new java . util . ArrayList < HIT > ( hITs ) ;