consults all the existing { @ link alternative ui text provider } and return an override , if any , or null

public static < t > string get ( message < t > text , t context ) { for ( alternative ui text provider p : all ( ) ) { string s = p get text ( text , context ) ; if ( s ! = null ) return s ; } return null ; }


creates the file in < code > path < code > location will also create all subdirectories , if they do not exist

public static path create file ( path path ) throws i o exception { files create directories ( path get parent ( ) ) ; if ( files exists ( path ) ) { return path ; } files create file ( path ) ; return path ; }


set the ' repository ' annotation type the default repository annotation type is the { @ link repository } annotation this setter property exists so that developers can provide their own ( non - spring - specific ) annotation type to indicate that a class has a repository role

public void set repository annotation type ( class < ? extends annotation > repository annotation type ) { assert not null ( repository annotation type , " ' repository annotation type ' must not be null " ) ; this repository annotation type = repository annotation type ; }


public void add tenant listeners ( string data id , string group , list < ? extends listener > listeners ) throws nacos exception { group = null 2default group ( group ) ; string tenant = agent get tenant ( ) ; cache data cache = add cache data if absent ( data id , group , tenant ) ; for ( listener listener : listeners ) { cache add listener ( listener ) ; } }


total time recoveries waited due to throttling

public time value throttle time ( ) { return time value time value nanos ( throttle time in nanos get ( ) ) ; }


this is used primarily when the object is listed in the breadcrumb , in the user management screen

public string get display name ( ) { return messages hudson private security realm display name ( ) ; }


marks the build as disabled the method will ignore the disable command if { @ link # supports make disabled ( ) } returns false the enable command will be executed in any case

default void make disabled ( boolean b ) throws i o exception { if ( is disabled ( ) = = b ) { return ; / / noop } if ( b & & ! supports make disabled ( ) ) { return ; / / do nothing if the disabling is unsupported } set disabled ( b ) ; if ( b ) { jenkins get ( ) get queue ( ) cancel ( this ) ; } save ( ) ; item listener fire on updated ( this ) ; }


compute split - per - shard ( separate split for each shard )

private bucket shards compute ( ) throws s q l exception { if ( ! result set next ( ) ) { return end of data ( ) ; } uuid shard uuid = uuid from bytes ( result set get bytes ( " shard uuid " ) ) ; optional < uuid > delta shard uuid = get delta shard uuid from result set ( ) ; set < string > node identifiers ; optional int bucket number = optional int empty ( ) ; if ( bucket to node ! = null ) { int bucket = result set get int ( " bucket number " ) ; bucket number = optional int of ( bucket ) ; node identifiers = immutable set of ( get bucket node ( bucket ) ) ; } else { list < integer > node ids = int array from bytes ( result set get bytes ( " node ids " ) ) ; node identifiers = get node identifiers ( node ids , shard uuid ) ; } shard nodes shard = new shard nodes ( shard uuid , delta shard uuid , node identifiers ) ; return new bucket shards ( bucket number , immutable set of ( shard ) ) ; }


sets the source of this symbol { @ link source type }

public void set source ( source type source ) ;


get the value of sigma to use when calculating the standard deviation bounds

public double sigma ( ) { return sigma ; }


returns the size of this entry ( the size of the bubble )

public float get size ( ) { return m size ; }


return the errors instance ( typically a binding result ) that this bind status is currently associated with

public errors get errors ( ) { return this errors ; }


determines whether or not the current cluster state represents an entirely new cluster , either when a node joins a cluster for the first time or when the node receives a cluster state update from a brand new cluster ( different uuid from the previous cluster ) , which will happen when a master node is elected that has never been part of the cluster before

public boolean is new cluster ( ) { final string prev cluster u u i d = previous state metadata ( ) cluster u u i d ( ) ; final string curr cluster u u i d = state metadata ( ) cluster u u i d ( ) ; return prev cluster u u i d equals ( curr cluster u u i d ) = = false ; }


namenode high availability related configuration returns collection of namenode ids from the configuration one logical id for each namenode in the in the ha setup

public static collection < string > get name node ids ( configuration conf , string ns id ) { string key = add suffix ( dfs ha namenodes key prefix , ns id ) ; return conf get trimmed string collection ( key ) ; }


short for { @ code validate file mask ( value , true , true ) }

public form validation validate file mask ( string value ) throws i o exception { return validate file mask ( value , true , true ) ; }


returns the first of two given parameters that is not { @ code null } , if either is , or otherwise throws a { @ link null pointer exception } < b > note : < b > if { @ code first } is represented as an { @ link optional } , this can be accomplished with { @ linkplain optional # or ( object ) first or ( second ) } that approach also allows for lazy evaluation of the fallback instance , using { @ linkplain optional # or ( supplier ) first or ( supplier ) }

public static < t > t first non null ( @ nullable t first , @ nullable t second ) { return first ! = null ? first : check not null ( second ) ; }


creates an unbounded replay subject the internal buffer is backed by an { @ link array list } and starts with an initial capacity of 16 once the number of items reaches this capacity , it will grow as necessary ( usually by 50 % ) however , as the number of items grows , this causes frequent array reallocation and copying , and may hurt performance and latency this can be avoided with the { @ link # create ( int ) } overload which takes an initial capacity parameter and can be tuned to reduce the array reallocation frequency as needed

public static < t > replay subject < t > create ( ) { return new replay subject < > ( new unbounded replay buffer < > ( 16 ) ) ; }


waits until all shard initialization is completed this is a handy alternative to ensure green as it relates to all shards in the cluster and doesn ' t require to know how many nodesreplica there are

protected static void ensure no initializing shards ( ) throws i o exception { request request = new request ( " get " , " / cluster / health " ) ; request add parameter ( " wait for no initializing shards " , " true " ) ; request add parameter ( " timeout " , " 7 0s " ) ; request add parameter ( " level " , " shards " ) ; admin client ( ) perform request ( request ) ; }


reads longs from the current position into the specified long array and increases the position by the number of longs read calling this method has the same effect as { @ code get ( dest , 0 , dest length ) }

public long buffer get ( long [ ] dest ) { return get ( dest , 0 , dest length ) ; }


returns a collection of plugins that should be loaded on each node

protected collection < class < ? extends plugin > > node plugins ( ) { return collections empty list ( ) ; }


creates a bucket ordering strategy that sorts buckets by their document counts ( ascending or descending )

public static bucket order count ( boolean asc ) { return asc ? internal order count asc : internal order count desc ; }


returns the target configuration for the most recent build , as created in blaze ' s master configuration creation phase

protected build configuration get target configuration ( ) throws interrupted exception { return iterables get only element ( master config get target configurations ( ) ) ; }


creates a configuration to operate in { @ link high availability mode # zookeeper }

public static configuration create zoo keeper h a config ( string zoo keeper quorum , string fs state handle path ) { return configure zoo keeper h a ( new configuration ( ) , zoo keeper quorum , fs state handle path ) ; }


returns the dot product between this and the given vector

public float dot ( float x , float y , float z ) { return this x * x + this y * y + this z * z ; }


returns whether this playlist is newer than { @ code other }

public boolean is newer than ( hls media playlist other ) { if ( other = = null | | media sequence > other media sequence ) { return true ; } if ( media sequence < other media sequence ) { return false ; } / / the media sequences are equal int segment count = segments size ( ) ; int other segment count = other segments size ( ) ; return segment count > other segment count | | ( segment count = = other segment count & & has end tag & & ! other has end tag ) ; }


called after the azure storage sdk receives a response

private void response received ( response received event event ) { http u r l connection conn = ( http u r l connection ) event get connection object ( ) ; blob operation descriptor operation type operation type = blob operation descriptor get operation type ( conn ) ; last operation type received = operation type ; switch ( operation type ) { case append block : case put block : case put page : last content length received = blob operation descriptor get content length if known ( conn , operation type ) ; break ; case get blob : last content length received = blob operation descriptor get content length if known ( conn , operation type ) ; break ; default : last content length received = 0 ; break ; } }


get a list of < code > application report < code > of an application

public abstract void set application attempt list ( list < application attempt report > application attempts ) ;


lets the given class visitor visit the superclass , if it is known

public void super class accept ( class visitor class visitor ) { if ( super class ! = null ) { super class accept ( class visitor ) ; } }


void set record count ( int count ) { record set int value ( record count column , count ) ; }


returns the color color used as the background for highlighted items

public color get highlight color ( ) { return paint context get highlight color ( ) ; }


public void cancel ( @ nullable string message , @ nullable throwable cause ) { entry entry = atomic reference entry get ( ) ; / / some exceptions will call on close and cancel if ( entry ! = null ) { / / record the exception metrics tracer trace entry ( cause , entry ) ; entry exit ( ) ; atomic reference entry set ( null ) ; } super cancel ( message , cause ) ; }


searches all databases for functions that match a domain path substring

public list < function record > find functions by domain path substring ( string domain path ) { array list < function record > result = new array list < function record > ( ) ; for ( fid d b fid db : fid db list ) { list < function record > list = fid db find functions by domain path substring ( domain path ) ; if ( list ! = null ) { result add all ( list ) ; } } return result ; }


get the offset to use when rounding , which is a number of milliseconds

public long offset ( ) { return offset ; }


seek to given position on a node other than the current node if a node other than the current node is found , then returns true if another node could not be found , then returns false

public synchronized boolean seek to new source ( long target pos ) throws i o exception { if ( current node = = null ) { return seek to block source ( target pos ) ; } boolean marked dead = dfs client is dead node ( this , current node ) ; add to local dead nodes ( current node ) ; datanode info old node = current node ; datanode info new node = block seek to ( target pos ) ; if ( ! marked dead ) { / * remove it from dead nodes block seek to could have cleared * dead nodes and added current node again thats ok * / remove from local dead nodes ( old node ) ; } if ( ! old node get datanode uuid ( ) equals ( new node get datanode uuid ( ) ) ) { current node = new node ; return true ; } else { return false ; } }


{ @ inherit doc } the default implementation does nothing

@ override public void exit timestamp escaped literal ( sql base parser timestamp escaped literal context ctx ) { }


split the given text into parts where the returned list contains either a string or an annotation

private static list < object > do parse text into text and annotations ( string text , function < annotation , annotation > fixer upper , program program , attributed string prototype ) { list < object > results = new array list < > ( ) ; list < word location > annotations = get comment annotations ( text ) ; if ( annotations is empty ( ) ) { results add ( text ) ; return results ; } / / split the text into pieces of normal text and annotated int offset = 0 ; for ( word location word : annotations ) { int start = word get start ( ) ; if ( offset ! = start ) { / / text between annotations string preceeding = text substring ( offset , start ) ; results add ( preceeding ) ; } string annotation text = word get word ( ) ; annotation annotation = new annotation ( annotation text , prototype , program ) ; annotation = fixer upper apply ( annotation ) ; results add ( annotation ) ; offset = start + annotation text length ( ) ; } if ( offset ! = text length ( ) ) { / / trailing text results add ( text substring ( offset ) ) ; } return results ; }


validates the parameters and creates an { @ link stored script source }

private stored script source build ( boolean ignore empty ) { if ( lang = = null ) { throw new illegal argument exception ( " must specify lang for stored script " ) ; } else if ( lang is empty ( ) ) { throw new illegal argument exception ( " lang cannot be empty " ) ; } if ( source = = null ) { if ( ignore empty | | script default template lang equals ( lang ) ) { if ( script default template lang equals ( lang ) ) { deprecation logger deprecate ( " empty templates " , " empty templates should no longer be used " ) ; } else { deprecation logger deprecate ( " empty scripts " , " empty scripts should no longer be used " ) ; } } else { throw new illegal argument exception ( " must specify source for stored script " ) ; } } else if ( source is empty ( ) ) { if ( ignore empty | | script default template lang equals ( lang ) ) { if ( script default template lang equals ( lang ) ) { deprecation logger deprecate ( " empty templates " , " empty templates should no longer be used " ) ; } else { deprecation logger deprecate ( " empty scripts " , " empty scripts should no longer be used " ) ; } } else { throw new illegal argument exception ( " source cannot be empty " ) ; } } if ( options size ( ) > 1 | | options size ( ) = = 1 & & options get ( script content type option ) = = null ) { throw new illegal argument exception ( " illegal compiler options [ " + options + " ] specified " ) ; } return new stored script source ( lang , source , options ) ; }


returns the value nearest to { @ code value } which is within the closed range { @ code [ min max ] } if { @ code value } is within the range { @ code [ min max ] } , { @ code value } is returned unchanged if { @ code value } is less than { @ code min } , { @ code min } is returned , and if { @ code value } is greater than { @ code max } , { @ code max } is returned

public static long constrain to range ( long value , long min , long max ) { check argument ( min < = max , " min ( % s ) must be less than or equal to max ( % s ) " , min , max ) ; return math min ( math max ( value , min ) , max ) ; }


create a stream output statistics instance

public block output stream statistics new output stream statistics ( ) { return get instrumentation ( ) new output stream statistics ( get instance statistics ( ) ) ; }


format url template using default server variables

public string url ( ) { return url ( null ) ; }


get the profiler configuration arguments the default value for this property is " - agentlib : hprof = cpu = samples , heap = sites , force = n , thread = y , verbose = n , file = % s "

public string get profile params ( ) { return get ( job context task profile params , m r job config default task profile params ) ; }


if validation required is true and the history data file has been updated , the history data will be re - initialized from the file this is undesirable and is only required when mulitple instances of a local folder item are used for a specific item path ( e g , unit testing )

private void validate ( ) throws i o exception { if ( local file system is refresh required ( ) ) { versions = null ; min version = 0 ; cur version = 0 ; } file history file = get history file ( ) ; if ( history file exists ( ) ) { version [ ] old versions = versions ; int old min version = min version ; int old cur version = cur version ; boolean success = false ; try { read history file ( ) ; success = true ; } finally { if ( ! success ) { versions = old versions ; min version = old min version ; cur version = old cur version ; } } } else { versions = new version [ 0 ] ; } }


add a buffer to the end of the queue and associate a promise with it that should be completed when all the buffer ' s bytes have been consumed from the queue and written

public final void add ( byte buf buf , channel promise promise ) { / / buffers are added before promises so that we naturally ' consume ' the entire buffer during removal / / before we complete it ' s promise add ( buf , to channel future listener ( promise ) ) ; }


public static string generate flow name tag ( string flow name ) { return flow name tag prefix + " : " + flow name ; }


public final builder add transitive ( extra link time libraries dep ) { for ( extra link time library dep library : dep get extra libraries ( ) ) { class < ? extends extra link time library > c = dep library get class ( ) ; libraries compute if absent ( c , k - > dep library get builder ( ) ) ; libraries get ( c ) add transitive ( dep library ) ; } return this ; }


receive a message from the given destination

message < ? > receive ( d destination ) throws messaging exception ;


instruct the safari driver to enable the automatic profiling if true , otherwise disable the automatic profiling defaults to disabling the automatic profiling

public safari options set automatic profiling ( boolean automatic profiling ) { set capability ( option automatic profiling , automatic profiling ) ; return this ; }


public path get base path ( ) { return base path ; }


private void select all ( ) { for ( j check box checkboxe : checkboxes ) { checkboxe set selected ( true ) ; } list panel repaint ( ) ; }


accumulates a new reading by keeping a running account of the area under the piecewise linear curve marked by pairs of { @ code new progress , new value }

protected void extend internal ( double new progress , int new value ) { if ( state = = null ) { return ; } / / the effective height of this trapezoid if rectangularized double mean = ( ( double ) new value + ( double ) state old value ) / 2 0d ; / / conceptually mean * ( new progress - state old progress ) / ( 1 / count ) state current accumulation + = mean * ( new progress - state old progress ) * count ; }


public void update pet test ( ) throws api exception { pet body = null ; / / api update pet ( body ) ; / / todo : test validations }


returns the oem information ; e oemid specific

public short e oeminfo ( ) { return e oeminfo ; }


set the suffix that gets appended to view names when building a url

public void set suffix ( @ nullable string suffix ) { this suffix = ( suffix ! = null ? suffix : " " ) ; }


filter create filter ( collection < description > test descriptions , int shard index , int total shards ) ;


tests playback of a source that exposes three periods

public void play multi period timeline ( ) throws exception { timeline timeline = new fake timeline ( / * window count = * / 3 ) ; fake renderer renderer = new fake renderer ( c track type video ) ; simple exo player player = new test exo player builder ( context ) set renderers ( renderer ) build ( ) ; event listener mock event listener = mock ( event listener class ) ; player add listener ( mock event listener ) ; player set media source ( new fake media source ( timeline , exo player test runner video format ) ) ; player prepare ( ) ; player play ( ) ; run until playback state ( player , player state ended ) ; in order in order = mockito in order ( mock event listener ) ; in order verify ( mock event listener ) on timeline changed ( arg that ( no uid ( new fake media source initial timeline ( timeline ) ) ) , eq ( player discontinuity reason period transition ) ) ; in order verify ( mock event listener ) on timeline changed ( arg that ( no uid ( timeline ) ) , eq ( player timeline change reason source update ) ) ; in order verify ( mock event listener , times ( 2 ) ) on position discontinuity ( player discontinuity reason period transition ) ; assert that ( renderer get formats read ( ) ) contains exactly ( exo player test runner video format , exo player test runner video format , exo player test runner video format ) ; assert that ( renderer sample buffer read count ) is equal to ( 3 ) ; assert that ( renderer is ended ) is true ( ) ; }


gets the element at the given index it is an error to call this with the index for an element which was never set ; if you do that , this will throw { @ code null pointer exception }

public insn get ( int n ) { return ( insn ) get 0 ( n ) ; }


returns the data , additional information that this entry represents , or null , if no data has been specified

public object get data ( ) { return m data ; }


returns a new list with the idl libs added to the given list if necessary , or the same list

public static immutable list < transitive info collection > maybe add support libs ( rule context rule context , immutable list < transitive info collection > deps ) { if ( ! has idl srcs ( rule context ) ) { return deps ; } transitive info collection aidl lib = android sdk provider from rule context ( rule context ) get aidl lib ( ) ; if ( aidl lib = = null ) { return deps ; } return immutable list < transitive info collection > builder ( ) add all ( deps ) add ( aidl lib ) build ( ) ; }


gets a key for an injection type and an annotation type

public static < t > key < t > get ( class < t > type , class < ? extends annotation > annotation type ) { return new key < > ( type , strategy for ( annotation type ) ) ; }


helper method than can be used to add error messages to an existing { @ link query validation exception } when passing { @ code null } as the initial exception , a new exception is created

public static query validation exception add validation errors ( list < string > validation errors , query validation exception validation exception ) { if ( validation exception = = null ) { validation exception = new query validation exception ( ) ; } validation exception add validation errors ( validation errors ) ; return validation exception ; }


initialize the { @ link flash map manager } used by this servlet instance if no implementation is configured then we default to { @ code org springframework web servlet support default flash map manager }

private void init flash map manager ( application context context ) { try { this flash map manager = context get bean ( flash map manager bean name , flash map manager class ) ; if ( logger is trace enabled ( ) ) { logger trace ( " detected " + this flash map manager get class ( ) get simple name ( ) ) ; } else if ( logger is debug enabled ( ) ) { logger debug ( " detected " + this flash map manager ) ; } } catch ( no such bean definition exception ex ) { / / we need to use the default this flash map manager = get default strategy ( context , flash map manager class ) ; if ( logger is trace enabled ( ) ) { logger trace ( " no flash map manager ' " + flash map manager bean name + " ' : using default [ " + this flash map manager get class ( ) get simple name ( ) + " ] " ) ; } } }


specify the ( potentially vendor - specific ) entity manager factory interface that this entity manager factory proxy is supposed to implement the default will be taken from the specific jpa vendor adapter , if any , or set to the standard { @ code javax persistence entity manager factory } interface else

public void set entity manager factory interface ( class < ? extends entity manager factory > emf interface ) { this entity manager factory interface = emf interface ; }


write all the offsets following the version 0 format without any verification ( eg enforcing offsets > = 0 )

static void write version 0 ( final map < topic partition , long > offsets , final file file ) throws i o exception { final file output stream file output stream = new file output stream ( file ) ; try ( final buffered writer writer = new buffered writer ( new output stream writer ( file output stream , standard charsets utf 8 ) ) ) { write int line ( writer , 0 ) ; write int line ( writer , offsets size ( ) ) ; for ( final map entry < topic partition , long > entry : offsets entry set ( ) ) { final topic partition tp = entry get key ( ) ; final long offset = entry get value ( ) ; write entry ( writer , tp , offset ) ; } writer flush ( ) ; file output stream get f d ( ) sync ( ) ; } }


post storeorder : place an order for a pet

default mono < response entity < order > > place order ( @ api param ( value = " order placed for purchasing the pet " , required = true ) @ valid @ request body mono < order > body , @ api ignore final server web exchange exchange ) { return get delegate ( ) place order ( body , exchange ) ; }


type of this scm exposed so that the client of the remote api can tell what scm this is

public string get type ( ) { return get class ( ) get name ( ) ; }


query the current tree digest from data tree or outstanding changes list

private long get current tree digest ( ) { long digest ; synchronized ( zks outstanding changes ) { if ( zks outstanding changes is empty ( ) ) { digest = zks get z k database ( ) get data tree ( ) get tree digest ( ) ; log debug ( " digest got from data tree is : { } " , digest ) ; } else { digest = zks outstanding changes peek last ( ) precalculated digest tree digest ; log debug ( " digest got from outstanding changes is : { } " , digest ) ; } } return digest ; }


whether the decoder supports video with a given width , height and frame rate must not be called if the device sdk version is less than 21

public boolean is video size and rate supported v 2 1 ( int width , int height , double frame rate ) { if ( capabilities = = null ) { log no support ( " size and rate caps " ) ; return false ; } video capabilities video capabilities = capabilities get video capabilities ( ) ; if ( video capabilities = = null ) { log no support ( " size and rate v caps " ) ; return false ; } if ( ! are size and rate supported v 2 1 ( video capabilities , width , height , frame rate ) ) { if ( width > = height | | ! enable rotated vertical resolution workaround ( name ) | | ! are size and rate supported v 2 1 ( video capabilities , height , width , frame rate ) ) { log no support ( " size and rate support , " + width + " x " + height + " x " + frame rate ) ; return false ; } log assumed support ( " size and rate rotated , " + width + " x " + height + " x " + frame rate ) ; } return true ; }


public builder put tag ( string key , string value ) { if ( tags = = null ) tags = new tree map < string , string > ( ) ; if ( key = = null ) throw new null pointer exception ( " key = = null " ) ; if ( value = = null ) throw new null pointer exception ( " value of " + key + " = = null " ) ; this tags put ( key , value ) ; return this ; }


all tests run as a an administrative user but use < code > es - security - runas - user < code > to become a less privileged user when needed

protected settings rest client settings ( ) { return rest sql i t security settings ( ) ; }


use this to initialize an encrypted s q l cipher database

public database get encrypted readable db ( char [ ] password ) { encrypted helper encrypted helper = check encrypted helper ( ) ; return encrypted helper get encrypted readable db ( password ) ; }


public final pipeline aggregator create ( ) { pipeline aggregator aggregator = create internal ( this metadata ) ; return aggregator ; }


public application id get application id ( ) { return application id ; }


returns if the default setting in question affects the specific target


public void namespace number test ( ) { / / todo : test namespace number }


should the runnable force its execution in case it gets rejected ?

public boolean is force execution ( ) { return false ; }


public cache get cache ( ) { return this cache ; }


gets the value of the current boolean option boolean options are not required to have explicitly specified values

public boolean get optional boolean value ( boolean default value ) throws options exception { if ( m last option value ! = null ) { / / - - option = value form string string value = m last option value ; m last option value = null ; if ( " true " equals ( string value ) ) { return true ; } else if ( " false " equals ( string value ) ) { return false ; } throw new options exception ( " unsupported value for " + m last option original form + " : " + string value + " only true or false supported " ) ; } / / - - option ( true | false ) form or just - - option if ( m index > = m params length ) { return default value ; } string string value = m params [ m index ] ; if ( " true " equals ( string value ) ) { m index + + ; return true ; } else if ( " false " equals ( string value ) ) { m index + + ; return false ; } else { return default value ; } }


returns the sum of this float value and the given particular float value

public float value add ( particular float value other ) { return add ( ( specific float value ) other ) ; }


clear pending events by generating aborted events for all their requisits

private synchronized void clear pending events ( ) { while ( ! pending events is empty ( ) ) { build event id id = pending events key set ( ) iterator ( ) next ( ) ; build event ( new aborted event ( id , get last abort reason ( ) , get abort reason details ( ) ) ) ; } }


returns total number of files in the snapshot

public int get total file count ( ) { return total file count ; }


return true if this read only first object is equal to o

public boolean equals ( object o ) { if ( this = = o ) { return true ; } if ( o = = null | | get class ( ) ! = o get class ( ) ) { return false ; } read only first read only first = ( read only first ) o ; return objects equals ( this bar , read only first bar ) & & objects equals ( this baz , read only first baz ) ; }


convert the given object to string with each line indented by 4 spaces ( except the first line )

private string to indented string ( object o ) { if ( o = = null ) { return " null " ; } return o to string ( ) replace ( " \ n " , " \ n " ) ; }


obtain a jms session that is synchronized with the current transaction , if any

public static session get transactional session ( final connection factory cf , @ nullable final connection existing con , final boolean synched local transaction allowed ) throws j m s exception { return do get transactional session ( cf , new resource factory ( ) { @ override @ nullable public session get session ( jms resource holder holder ) { return holder get session ( session class , existing con ) ; } @ override @ nullable public connection get connection ( jms resource holder holder ) { return ( existing con ! = null ? existing con : holder get connection ( ) ) ; } @ override public connection create connection ( ) throws j m s exception { return cf create connection ( ) ; } @ override public session create session ( connection con ) throws j m s exception { return con create session ( synched local transaction allowed , session auto acknowledge ) ; } @ override public boolean is synched local transaction allowed ( ) { return synched local transaction allowed ; } } , true ) ; }


indicates if this request is handled or not

public boolean is handled ( ) { return this handled ; }


get the swing rotation and twist rotation for the specified axis the twist rotation represents the rotation around the specified axis the swing rotation represents the rotation of the specified axis itself , which is the rotation around an axis perpendicular to the specified axis the swing and twist rotation can be used to reconstruct the original quaternion : this = swing twist

public void get swing twist ( final vector 3 axis , final quaternion swing , final quaternion twist ) { get swing twist ( axis x , axis y , axis z , swing , twist ) ; }


this method verifies that the given { @ code metadata } holds sane values to create an { @ link index service } this method tries to update the meta data of the created { @ link index service } if the given { @ code metadata update } is different from the given { @ code metadata } this method will throw an exception if the creation or the update fails the created { @ link index service } will not be registered and will be closed immediately

public synchronized void verify index metadata ( index metadata metadata , index metadata metadata update ) throws i o exception { final list < closeable > closeables = new array list < > ( ) ; try { indices field data cache indices field data cache = new indices field data cache ( settings , new index field data cache listener ( ) { } ) ; closeables add ( indices field data cache ) ; indices query cache indices query cache = new indices query cache ( settings ) ; closeables add ( indices query cache ) ; / / this will also fail if some plugin fails etc which is nice since we can verify that early final index service service = create index service ( metadata verification , metadata , indices query cache , indices field data cache , empty list ( ) ) ; closeables add ( ( ) - > service close ( " metadata verification " , false ) ) ; service mapper service ( ) merge ( metadata , mapper service merge reason mapping recovery ) ; if ( metadata equals ( metadata update ) = = false ) { service update metadata ( metadata , metadata update ) ; } } finally { i o utils close ( closeables ) ; } }


when read on socket failed , this is typically because client closed the connection in most cases , the client does this when the server doesn ' t respond within 23 of session timeout this possibly indicates server healthperformance issue , so we need to log and keep track of stat

private void handle failed read ( ) throws end of stream exception { set stale ( ) ; server metrics get metrics ( ) connection drop count add ( 1 ) ; throw new end of stream exception ( " unable to read additional data from client , " + " it probably closed the socket : " + " address = " + sock socket ( ) get remote socket address ( ) + " , " + " session = 0x " + long to hex string ( session id ) , disconnect reason unable to read from client ) ; }


parse the given value into a days of months { @ code cron field } , the fourth entry of a cron expression

public static cron field parse days of month ( string value ) { if ( ! quartz cron field is quartz days of month field ( value ) ) { return bits cron field parse days of month ( value ) ; } else { return parse list ( value , type day of month , ( field , type ) - > { if ( quartz cron field is quartz days of month field ( field ) ) { return quartz cron field parse days of month ( field ) ; } else { return bits cron field parse days of month ( field ) ; } } ) ; } }


get the user supplied s q l exception override class name

public string get exception override class name ( ) { return this exception override class name ; }


tests the creating of a file where the path is same as mount link path

public void test create file where the path is same as its mount link path ( ) throws exception { configuration conf = new configuration ( ) ; path fallback target = new path ( target test root , " fallback dir " ) ; fs target mkdirs ( fallback target ) ; config util add link ( conf , " / user 1 / hive / " , new path ( target test root to string ( ) ) to uri ( ) ) ; config util add link fallback ( conf , fallback target to uri ( ) ) ; abstract file system vfs = abstract file system get ( view fs default cluster uri , conf ) ; path vfs test dir = new path ( " / user 1 / hive " ) ; assert false ( fs target exists ( path merge paths ( fallback target , vfs test dir ) ) ) ; vfs create ( vfs test dir , enum set of ( create ) , options create opts perms ( fs permission get default ( ) ) ) close ( ) ; }


creates list of users with given input array

public void create users with list input test ( ) { / / todo : test validations list < user > body = null ; / / void response = api create users with list input ( body ) ; / / assert not null ( response ) ; }


an optional timeout to control how long search is allowed to take

public search source builder timeout ( time value timeout ) { this timeout = timeout ; return this ; }


a shortcut for { @ link # wait for active shards ( active shard count ) } where the numerical shard count is passed in , instead of having to first call { @ link active shard count # from ( int ) } to get the active shard count

public update request wait for active shards ( final int wait for active shards ) { return wait for active shards ( active shard count from ( wait for active shards ) ) ; }


records the eviction of an entry from the cache this should only been called when an entry is evicted due to the cache ' s eviction strategy , and not as a result of manual { @ link cache # invalidate invalidations }


set the order for this result handler relative to others by default set to 0 it is generally safe to place it early in the order as it looks for a concrete return type

public void set order ( int order ) { this order = order ; }


mark the occurrence of a given number of events

public void mark ( long n ) { moving averages tick if necessary ( ) ; count add ( n ) ; moving averages update ( n ) ; }


returns the results from default dfs ( fallback ) if you want the results from specific clusters , please invoke them on child fs instance directly

public remote iterator < encryption zone > list encryption zones ( ) throws i o exception { if ( this vfs = = null ) { return super list encryption zones ( ) ; } check default d f s ( default d f s , " list encryption zones " ) ; return default d f s list encryption zones ( ) ; }


public void user status test ( ) { / / todo : test user status }


public < t > t execute ( function < response , t > handler ) { return handler apply ( rest assured given ( ) spec ( req spec build ( ) ) expect ( ) spec ( resp spec build ( ) ) when ( ) request ( req method , req uri ) ) ; }


private string to indented string ( object o ) { if ( o = = null ) { return " null " ; } return o to string ( ) replace ( " \ n " , " \ n " ) ; }


gets the given program ' s analysis properties and returns a hash map of the program ' s analysis options to current values ( values represented as strings ) the string " ( default ) " is appended to the value if it represents the default value for the option it is assigned to

public map < string , string > get current analysis options and values ( program program ) { map < string , string > available options = new hash map < > ( ) ; options options = program get options ( program analysis properties ) ; for ( string property name : options get option names ( ) ) { option type property type = options get type ( property name ) ; object property value = null ; switch ( property type ) { case int type : property value = integer value of ( options get int ( property name , - 1 ) ) ; break ; case long type : property value = long value of ( options get long ( property name , - 1l ) ) ; break ; case string type : property value = options get string ( property name , " " ) ; break ; case double type : property value = double value of ( options get double ( property name , - 1 0d ) ) ; break ; case boolean type : property value = boolean value of ( options get boolean ( property name , false ) ) ; break ; case float type : property value = float value of ( options get float ( property name , 0f ) ) ; break ; case date type : case byte array type : case color type : case custom type : case file type : case font type : case keystroke type : / / do nothing ; don ' t allow user to set these options ( doesn ' t make any sense ) break ; case no type : break ; case enum type : property value = options get object ( property name , null ) ; break ; default : / / do nothing } if ( property value ! = null ) { available options put ( property name , property value to string ( ) ) ; } } return available options ; }


return { @ code true } if this bounds is the same kind as the specified bounds

public boolean is same kind ( wildcard bounds bounds ) { return this kind = = bounds kind ; }


return { @ code true } if { @ code null } references should be automatically grown

public boolean is auto grow null references ( ) { return this auto grow null references ; }


for a given identifier , add a mapping to the nodetype for the parse tree and to the composable record reader to be created , including the formals required to invoke the constructor the nodetype and constructor signature should be filled in from the child node

protected static void add identifier ( string ident , class < ? > [ ] mcstr sig , class < ? extends node > nodetype , class < ? extends composable record reader > cl ) throws no such method exception { constructor < ? extends node > ncstr = nodetype get declared constructor ( ncstr sig ) ; ncstr set accessible ( true ) ; node cstr map put ( ident , ncstr ) ; constructor < ? extends composable record reader > mcstr = cl get declared constructor ( mcstr sig ) ; mcstr set accessible ( true ) ; rr cstr map put ( ident , mcstr ) ; }


returns the cleanup time for a window , which is { @ code window max timestamp + allowed lateness } in case this leads to a value greated than { @ link long # max value } then a cleanup time of { @ link long # max value } is returned

private long cleanup time ( w window ) { if ( window assigner is event time ( ) ) { long cleanup time = window max timestamp ( ) + allowed lateness ; return cleanup time > = window max timestamp ( ) ? cleanup time : long max value ; } else { return window max timestamp ( ) ; } }


update replica with the new generation stamp and length

public string update replica under recovery ( final extended block old block , final long recovery id , final long new block id , final long new length ) throws i o exception { final replica r = data update replica under recovery ( old block , recovery id , new block id , new length ) ; / / notify the namenode of the updated block info this is important / / for ha , since otherwise the standby node may lose track of the / / block locations until the next block report extended block new block = new extended block ( old block ) ; new block set generation stamp ( recovery id ) ; new block set block id ( new block id ) ; new block set num bytes ( new length ) ; final string storage i d = r get storage uuid ( ) ; notify namenode received block ( new block , null , storage i d , r is on transient storage ( ) ) ; return storage i d ; }


validate offsets for all assigned partitions for which a leader change has been detected

public void validate offsets if needed ( ) { runtime exception exception = cached offset for leader exception get and set ( null ) ; if ( exception ! = null ) throw exception ; / / validate each partition against the current leader and epoch / / if we see a new metadata version , check all partitions validate positions on metadata change ( ) ; / / collect positions needing validation , with backoff map < topic partition , fetch position > partitions to validate = subscriptions partitions needing validation ( time milliseconds ( ) ) stream ( ) filter ( tp - > subscriptions position ( tp ) ! = null ) collect ( collectors to map ( function identity ( ) , subscriptions : : position ) ) ; validate offsets async ( partitions to validate ) ; }


sets the settings and mappings as a single source note that the mapping definition should not be nested under a type name

public create index request source ( bytes reference source , x content type x content type ) { objects require non null ( x content type ) ; source ( x content helper convert to map ( source , false , x content type ) v 2 ( ) ) ; return this ; }


calls { @ code on is intermediate result expected } on each element of the list does nothing if list = = null

public static void call on is intermediate result expected changed ( @ nullable list < producer context callbacks > callbacks ) { if ( callbacks = = null ) { return ; } for ( producer context callbacks callback : callbacks ) { callback on is intermediate result expected changed ( ) ; } }


resolves { @ code path name } relative to the working directory note that this will not create any entity in the filesystem ; i e , the file that the object is describing may not exist in the filesystem

public path resolve ( path fragment path name ) { return working dir get relative ( path name ) ; }


tbody tbody ( string selector ) ; / / $ summary , width , border , frame , rules , cellpadding , cellspacing omitted / / use css instead


return the metadata { @ code mime type } selected for the underlying r socket at connection time on the client side this is configured via { @ link r socket requester builder # metadata mime type ( mime type ) } while on the server side it ' s obtained from the { @ link connection setup payload }


public string execute ( file system fs ) throws i o exception { fs server defaults sds = null ; if ( fs instanceof distributed file system ) { distributed file system dfs = ( distributed file system ) fs ; sds = dfs get server defaults ( ) ; } else { throw new unsupported operation exception ( " get server defaults is " + " not supported for http fs on " + fs get class ( ) + " please check your fs default f s configuration " ) ; } return json util to json string ( sds ) ; }


updates { @ link # required classpath } to include dependencies from the given output artifact

private void collect dependencies from artifact ( path path ) throws i o exception { try ( buffered input stream bis = new buffered input stream ( files new input stream ( path ) ) ) { dependencies deps = dependencies parse from ( bis ) ; / / quick check to make sure we have a valid proto if ( ! deps has rule label ( ) ) { throw new i o exception ( " could not parse deps dependencies message from proto " ) ; } for ( dependency dep : deps get dependency list ( ) ) { if ( dep get kind ( ) = = kind explicit | | dep get kind ( ) = = kind implicit | | dep get kind ( ) = = kind incomplete ) { required classpath add ( paths get ( dep get path ( ) ) ) ; } } } catch ( i o exception e ) { throw new i o exception ( string format ( " error reading deps artifact : % s " , path ) , e ) ; } }


report an error for each label that appears more than once in the given attribute of the given rule

private static void check for duplicate labels ( rule rule , attribute attribute , event handler event handler ) { set < label > duplicates = aggregating attribute mapper of ( rule ) check for duplicate labels ( attribute ) ; for ( label label : duplicates ) { rule report error ( string format ( " label ' % s ' is duplicated in the ' % s ' attribute of rule ' % s ' " , label , attribute get name ( ) , rule get name ( ) ) , event handler ) ; } }


method useful for suppressing sysout printing

public static void pipe system out to null ( ) { system set out ( new print stream ( new blackhole output steam ( ) ) ) ; }


gets the registry for aggregators for the iteration

public aggregator registry get aggregators ( ) { return this aggregators ; }


convert the given object to string with each line indented by 4 spaces ( except the first line )

private string to indented string ( object o ) { if ( o = = null ) { return " null " ; } return o to string ( ) replace ( " \ n " , " \ n " ) ; }


prevent set of in sync allocation ids to grow unboundedly this can happen for example if we don ' t write to a primary but repeatedly shut down nodes that have active replicas we use number of replicas + 1 ( = possible active shard copies ) to bound the in sync allocation ids set

public void test in sync ids not growing without bounds ( ) throws exception { cluster state cluster state = create one primary one replica cluster state ( allocation ) ; set < string > in sync set = cluster state metadata ( ) index ( " test " ) in sync allocation ids ( 0 ) ; assert that ( in sync set size ( ) , equal to ( 2 ) ) ; index shard routing table shard routing table = cluster state routing table ( ) index ( " test " ) shard ( 0 ) ; shard routing primary shard = shard routing table primary shard ( ) ; shard routing replica shard = shard routing table replica shards ( ) get ( 0 ) ; logger info ( " remove a node " ) ; cluster state = cluster state builder ( cluster state ) nodes ( discovery nodes builder ( cluster state nodes ( ) ) remove ( replica shard current node id ( ) ) ) build ( ) ; cluster state = allocation disassociate dead nodes ( cluster state , true , " reroute " ) ; / / in - sync allocation ids should not be updated assert equals ( in sync set , cluster state metadata ( ) index ( " test " ) in sync allocation ids ( 0 ) ) ; / / check that in sync allocation ids can not grow without bounds for ( int i = 0 ; i < 5 ; i + + ) { logger info ( " add back node " ) ; cluster state = cluster state builder ( cluster state ) nodes ( discovery nodes builder ( cluster state nodes ( ) ) add ( new node ( replica shard current node id ( ) ) ) ) build ( ) ; cluster state = allocation reroute ( cluster state , " reroute " ) ; logger info ( " start replica shards " ) ; cluster state = start initializing shards and reroute ( allocation , cluster state ) ; logger info ( " remove the node " ) ; cluster state = cluster state builder ( cluster state ) nodes ( discovery nodes builder ( cluster state nodes ( ) ) remove ( replica shard current node id ( ) ) ) build ( ) ; cluster state = allocation disassociate dead nodes ( cluster state , true , " reroute " ) ; } / / in - sync allocation set is bounded set < string > new in sync set = cluster state metadata ( ) index ( " test " ) in sync allocation ids ( 0 ) ; assert that ( new in sync set size ( ) , equal to ( 2 ) ) ; / / only allocation id of replica was changed assert false ( sets have empty intersection ( in sync set , new in sync set ) ) ; assert that ( new in sync set , has item ( primary shard allocation id ( ) get id ( ) ) ) ; }


get the actual instance of ` triangle ` if the actual instanct is not ` triangle ` , the class cast exception will be thrown

public triangle get triangle ( ) throws class cast exception { return ( triangle ) super get actual instance ( ) ; }


allows to retrieve the { @ link process instance history log } for one process instance

process instance history log query create process instance history log query ( string process instance id ) ;


this test checks edge cases , when trying to increasedecrease the lfu cache fraction to more than 1less than 0 ( of the cache size ) the expected behaviour is not to update the lfu fraction

public void test l f u fraction overflow ( ) { final int adaptive rate = 700 ; / / in order to cause an overflow m cache = create dummy adaptive counting memory cache ( m params supplier , m cache trim strategy , m value descriptor , adaptive rate , 1 , 2 , initial l f u cache fraction promil ) ; / / add item 1 to lfu closeable reference < integer > original ref 1 = new reference ( 10 ) ; closeable reference < integer > value ref 1 = m cache cache ( keys [ 1 ] , original ref 1 ) ; original ref 1 close ( ) ; value ref 1 close ( ) ; assert l f u exclusively owned ( keys [ 1 ] , 10 ) ; / / add item 2 to lfu closeable reference < integer > original ref 2 = new reference ( 20 ) ; closeable reference < integer > value ref 2 = m cache cache ( keys [ 2 ] , original ref 2 ) ; original ref 2 close ( ) ; value ref 2 close ( ) ; assert l f u exclusively owned ( keys [ 1 ] , 10 ) ; assert l f u exclusively owned ( keys [ 2 ] , 20 ) ; / / add item 3 to lfu , item 1 will be evicted from lfu and will be inserted to the lfu ghost list closeable reference < integer > original ref 3 = new reference ( 30 ) ; closeable reference < integer > value ref 3 = m cache cache ( keys [ 3 ] , original ref 3 ) ; original ref 3 close ( ) ; value ref 3 close ( ) ; assert l f u exclusively owned ( keys [ 2 ] , 20 ) ; assert l f u exclusively owned ( keys [ 3 ] , 30 ) ; assert not cached ( keys [ 1 ] , 10 ) ; / / item 1 in the lfu ghost list assert key is in l f u ghost list ( keys [ 1 ] , 1 ) ; / / try to access item 1 , which was already evicted , which will result in updating the lfu / / fraction assert equals ( initial l f u cache fraction promil , m cache m l f u fraction promil ) ; closeable reference < integer > value ref 1a = m cache get ( keys [ 1 ] ) ; assert null ( value ref 1a ) ; / / make sure the lfu cache fraction was not updated , because if we do it will cause in overflow assert equals ( initial l f u cache fraction promil , m cache m l f u fraction promil ) ; / / make item 2 and item 3 " frequently used " by accessing them more than m frequently used threshiold closeable reference < integer > value ref 2a = m cache get ( keys [ 2 ] ) ; closeable reference < integer > value ref 3a = m cache get ( keys [ 3 ] ) ; value ref 2a close ( ) ; value ref 3a close ( ) ; assert m f u exclusively owned ( keys [ 2 ] , 20 ) ; assert m f u exclusively owned ( keys [ 3 ] , 30 ) ; / / insert item 4 to mfu , item 2 will be evicted from mfu and inserted in the mfu ghost list closeable reference < integer > original ref 4 = new reference ( 40 ) ; closeable reference < integer > value ref 4 = m cache cache ( keys [ 4 ] , original ref 4 ) ; closeable reference < integer > value ref 4a = m cache get ( keys [ 4 ] ) ; original ref 4 close ( ) ; value ref 4 close ( ) ; value ref 4a close ( ) ; assert equals ( initial l f u cache fraction promil , m cache m l f u fraction promil ) ; closeable reference < integer > value ref 2b = m cache get ( keys [ 2 ] ) ; assert null ( value ref 2b ) ; / / make sure the lfu cache fraction was not updated , because if we do it will cause in overflow assert equals ( initial l f u cache fraction promil , m cache m l f u fraction promil ) ; }


public synchronized list < string > get groups ( string user ) throws i o exception { set < string > group set = new tree set < string > ( ) ; for ( group mapping service provider provider : providers list ) { list < string > groups = collections empty list ( ) ; try { groups = provider get groups ( user ) ; } catch ( exception e ) { log warn ( " unable to get groups for user { } via { } because : { } " , user , provider get class ( ) get simple name ( ) , e to string ( ) ) ; log debug ( " stacktrace : " , e ) ; } if ( ! groups is empty ( ) ) { group set add all ( groups ) ; if ( ! combined ) break ; } } return new array list < > ( group set ) ; }


public mono < void > render ( @ nullable map < string , ? > model , @ nullable media type content type , server web exchange exchange ) { if ( logger is debug enabled ( ) ) { logger debug ( exchange get log prefix ( ) + " view " + format view name ( ) + " , model " + ( model ! = null ? model : collections empty map ( ) ) ) ; } if ( content type ! = null ) { exchange get response ( ) get headers ( ) set content type ( content type ) ; } return get model attributes ( model , exchange ) flat map ( merged model - > { / / expose request context ? if ( this request context attribute ! = null ) { merged model put ( this request context attribute , create request context ( exchange , merged model ) ) ; } return render internal ( merged model , content type , exchange ) ; } ) ; }


find the predecessor node for the given key at the given level the key is in the memory segment positioning at the given offset

private long find predecessor ( memory segment key segment , int key offset , int level ) { return skip list utils find predecessor ( key segment , key offset , level , level index header , space allocator ) ; }


returns the index in the selection of the track with the specified format the format is located by identity so , for example , { @ code selection index of ( selection get format ( index ) ) = = index } even if multiple selected tracks have formats that contain the same values


public input split get ( int i ) { return splits [ i ] ; }


the set of values defined for this entry , each corresponding to a different configurationvariant < code > repeated aapt pb config value config value = 4 ; < code >

public builder set config value ( int index , com android aapt resources config value value ) { copy on write ( ) ; instance set config value ( index , value ) ; return this ; }


the name of the symbol ( in the form package : typename ) < code > optional string resource name = 1 ; < code >

public com google protobuf byte string get resource name bytes ( ) { return instance get resource name bytes ( ) ; }


public final long compute file size ( ) { return compute file size ( current state id ) ; }


if somebody is unlucky enough to have to serialize one of these , serialize it as a linked hash map so that they won ' t need gson on the other side to deserialize it using serialization defeats our do s defence , so most apps shouldn ' t use it

private object write replace ( ) throws object stream exception { return new linked hash map < k , v > ( this ) ; }


returns true if field corresponding to field i d is set ( has been assigned a value ) and false otherwise

public boolean is set ( fields field ) { if ( field = = null ) { throw new illegal argument exception ( ) ; } switch ( field ) { case success : return is set success ( ) ; } throw new illegal state exception ( ) ; }


get the composite caret location , omitting the given separator

public int get global caret ( int omit sep ) { int caret = 0 ; for ( int i = 0 ; i < which focus ; i + + ) { if ( i > 0 & & omit sep ! = i - 1 ) { caret + = linked fields get ( i - 1 ) sep length ( ) ; } caret + = field states get ( i ) text length ( ) ; } if ( which focus > 0 & & omit sep ! = which focus - 1 ) { caret + = linked fields get ( which focus - 1 ) sep length ( ) ; } field state fs = field states get ( which focus ) ; caret + = fs clamped caret ( ) ; return caret ; }


sets the g l texture view which will display the preview

public void set g l texture view ( final g l texture view view ) { surface type = surface type texture view ; gl texture view = view ; gl texture view set e g l context client version ( 2 ) ; gl texture view set e g l config chooser ( 8 , 8 , 8 , 8 , 16 , 0 ) ; gl texture view set opaque ( false ) ; gl texture view set renderer ( renderer ) ; gl texture view set render mode ( g l surface view rendermode when dirty ) ; gl texture view request render ( ) ; }


ensure that { @ link reconfigurable base # reconfigure property } unsets the property in its parent ' s configuration when the new value is null

public void test conf is unset ( ) throws reconfiguration exception { final string property = " foo " ; final string value 1 = " value 1 " ; final configuration conf = new configuration ( ) ; conf set ( property , value 1 ) ; final configuration new conf = new configuration ( ) ; final reconfigurable base reconfigurable = make reconfigurable ( conf , new conf , arrays as list ( property ) ) ; reconfigurable reconfigure property ( property , null ) ; assert null ( reconfigurable get conf ( ) get ( property ) ) ; }


public static immutable int array of ( ) { return empty ; }


returns pet inventories by status returns a map of status codes to quantities

public map < string , integer > get inventory ( ) ;


emits a synthetic overloaded constructor which delegates the construction logic to the source constructor for example , < code > class foo { private foo ( a a ) { } & # 047 ; & # 047 ; synthetic overloaded constructor foo ( a a , nest c c var ) { this ( a ) ; } } < code >

public method visitor visit class constructor ( method decl info method decl info , class visitor cv ) { class name nest companion = nest digest nest companion ( method decl info owner ( ) ) ; method decl info constructor bridge = method decl info bridge of constructor ( nest companion ) ; method visitor mv = constructor bridge accept ( cv ) ; mv visit code ( ) ; mv visit var insn ( opcodes aload , 0 ) ; immutable list < type > constructor bridge arg types = constructor bridge argument types ( ) ; / / exclude last placeholder element loading for ( int i = 0 , slot offset = 1 ; i < constructor bridge arg types size ( ) - 1 ; i + + ) { mv visit var insn ( constructor bridge arg types get ( i ) get opcode ( opcodes iload ) , slot offset ) ; slot offset + = constructor bridge arg types get ( i ) get size ( ) ; } mv visit method insn ( opcodes invokespecial , method decl info owner name ( ) , method decl info name ( ) , method decl info descriptor ( ) , / * is interface = * / false ) ; mv visit insn ( opcodes return ) ; int slot = 0 ; for ( type bridge constructor arg type : constructor bridge arg types ) { slot + = bridge constructor arg type get size ( ) ; } mv visit maxs ( slot , slot ) ; mv visit end ( ) ; return mv ; }


parse raw http request line to a { @ link command request }

protected static command request process query string ( string line ) { command request request = new command request ( ) ; if ( string util is blank ( line ) ) { return request ; } int start = line index of ( ' / ' ) ; int ask = line index of ( ' ? ' ) = = - 1 ? line last index of ( ' ' ) : line index of ( ' ? ' ) ; int space = line last index of ( ' ' ) ; string target = line substring ( start ! = - 1 ? start + 1 : 0 , ask ! = - 1 ? ask : line length ( ) ) ; request add metadata ( http command utils request target , target ) ; if ( ask = = - 1 | | ask = = space ) { return request ; } string parameter str = line substring ( ask ! = - 1 ? ask + 1 : 0 , space ! = - 1 ? space : line length ( ) ) ; parse params ( parameter str , request ) ; return request ; }


converts an array of { @ link abstract insn node } s to their { @ link instruction filter } counterparts

public static instruction filter [ ] translate ( abstract insn node [ ] ains ) { instruction filter [ ] filters = new instruction filter [ ains length ] ; for ( int i = 0 ; i < ains length ; i + + ) { filters [ i ] = translate ( ains [ i ] ) ; } return filters ; }


public void on attachment progress ( long total , long progress ) ;


add the given , single header value under the given name

s header ( string header name , string header values ) ;


suitable for { @ link job # get nearest build }

public final run t get nearest build ( int n ) { return builds search ( n , abstract lazy load run map direction asc ) ; }


sets the version , which will cause the get operation to only be performed if a matching version exists and no changes happened on the doc since then

public long version ( ) { return version ; }


finishing reading the b c file release all resources

public void close ( ) { / / nothing to be done now }


return a { @ link sorted numeric double values } instance that returns the distances to a list of geo - points for each document

public static sorted numeric double values distance values ( final geo distance distance , final distance unit unit , final multi geo point values geo point values , final geo point from points ) { final geo point values single values = field data unwrap singleton ( geo point values ) ; if ( single values ! = null & & from points length = = 1 ) { return field data singleton ( new numeric double values ( ) { @ override public boolean advance exact ( int doc ) throws i o exception { return single values advance exact ( doc ) ; } @ override public double double value ( ) throws i o exception { final geo point from = from points [ 0 ] ; final geo point to = single values geo point value ( ) ; return distance calculate ( from lat ( ) , from lon ( ) , to lat ( ) , to lon ( ) , unit ) ; } } ) ; } else { return new sorting numeric double values ( ) { @ override public boolean advance exact ( int target ) throws i o exception { if ( geo point values advance exact ( target ) ) { resize ( geo point values doc value count ( ) * from points length ) ; int v = 0 ; for ( int i = 0 ; i < geo point values doc value count ( ) ; + + i ) { final geo point point = geo point values next value ( ) ; for ( geo point from : from points ) { values [ v ] = distance calculate ( from lat ( ) , from lon ( ) , point lat ( ) , point lon ( ) , unit ) ; v + + ; } } sort ( ) ; return true ; } else { return false ; } } } ; } }


shortens the body of { @ code response } but not the corresponding headers only useful to test how clients respond to the premature conclusion of the http body

private mock response truncate violently ( mock response response , int num bytes to keep ) { response set socket policy ( disconnect at end ) ; headers headers = response get headers ( ) ; buffer truncated body = new buffer ( ) ; truncated body write ( response get body ( ) , num bytes to keep ) ; response set body ( truncated body ) ; response set headers ( headers ) ; return response ; }


installs the safeguard shutdown hook the maximum time that the jvm is allowed to spend on shutdown before being killed is the given number of milliseconds

public static void install as shutdown hook ( logger logger , long delay millis ) { check argument ( delay millis > = 0 , " delay must be > = 0 " ) ; / / install the blocking shutdown hook thread shutdown hook = new jvm shutdown safeguard ( delay millis ) ; shutdown hook util add shutdown hook thread ( shutdown hook , jvm shutdown safeguard class get simple name ( ) , logger ) ; }


finds pets by tags multiple tags can be provided with comma separated strings use tag 1 , tag 2 , tag 3 for testing

set < pet > find pets by tags ( @ param ( " tags " ) set < string > tags ) ;


public void upload file test ( ) { long pet id = null ; string additional metadata = null ; file file = null ; / / model api response response = api upload file ( pet id , additional metadata , file ) ; / / todo : test validations }


public void color test ( ) { / / todo : test color }


public void add ( extra data entry ) { if ( get length ( ) + entry get length ( ) > 0xffff ) { throw new illegal argument exception ( " adding entry will make the extra field be too long " ) ; } entries put ( entry get id ( ) , entry ) ; }


evaluate the specified bean shell script based on the given script source , keeping a returned script class or script object as - is the script may either be a simple script that needs a corresponding proxy generated ( implementing the specified interfaces ) , or declare a full class or return an actual instance of the scripted object ( in which case the specified interfaces , if any , need to be implemented by that classinstance )

static object evaluate bsh script ( string script source , @ nullable class < ? > [ ] script interfaces , @ nullable class loader class loader ) throws eval error { assert has text ( script source , " script source must not be empty " ) ; interpreter interpreter = new interpreter ( ) ; interpreter set class loader ( class loader ) ; object result = interpreter eval ( script source ) ; if ( result ! = null ) { return result ; } else { / / simple bean shell script : let ' s create a proxy for it , implementing the given interfaces if ( object utils is empty ( script interfaces ) ) { throw new illegal argument exception ( " given script requires a script proxy : " + " at least one script interface is required \ n script : " + script source ) ; } x this xt = ( x this ) interpreter eval ( " return this " ) ; return proxy new proxy instance ( class loader , script interfaces , new bsh object invocation handler ( xt ) ) ; } }


public static member lookup create look up ( server member manager member manager ) throws nacos exception { if ( ! env util get standalone mode ( ) ) { string lookup type = env util get property ( lookup mode type ) ; lookup type type = choose lookup ( lookup type ) ; look up = find ( type ) ; current lookup type = type ; } else { look up = new standalone member lookup ( ) ; } look up inject member manager ( member manager ) ; loggers cluster info ( " current addressing mode selection : { } " , look up get class ( ) get simple name ( ) ) ; return look up ; }


ensures the truth of an expression involving one or more parameters to the calling method see { @ link # check argument ( boolean , string , object ) } for details

public static void check argument ( boolean b , @ nullable decl string error message template , @ nullable decl object p 1 , @ nullable decl object p 2 ) { if ( ! b ) { throw new illegal argument exception ( lenient format ( error message template , p 1 , p 2 ) ) ; } }


post user : create user this can only be done by the logged in user

default response entity < void > create user ( @ api param ( value = " created user object " , required = true ) @ valid @ request body user body ) { return new response entity < > ( http status not implemented ) ; }


manually trigger dump of a local configuration file

public string update local cache from store ( ) { logger info ( " start to dump all data from store " ) ; dump service dump all ( ) ; logger info ( " finish to dump all data from store " ) ; return http servlet response sc ok + " " ; }


delete purchase order by id for valid response try integer i ds with value & lt ; 1000 anything above 1000 or nonintegers will generate api errors

public void delete order ( string order id , api client auth info auth info , handler < async result < void > > result handler ) { delegate delete order ( order id , auth info , result handler ) ; }


called after the build is loaded and the object is added to the build list because { @ link run action } s are persisted with { @ link run } , the implementation can keep a reference to { @ link run } in a field ( which is set via { @ link # on attached ( run ) } )


model tests for additional properties class

public void test additional properties class ( ) { / / todo : test additional properties class }


public response request post ( string url , string body , map < string , string > headers ) { return request http method ( url , body , headers , " post " ) ; }


called after the invocation of the listener ' s mock if it returned normally exceptions caused by this invocation listener will raise a { @ link org mockito exceptions base mockito exception }

void report invocation ( method invocation report method invocation report ) ;


the base file system implementation generally has no knowledge of the capabilities of actual implementations unless it has a way to explicitly determine the capabilities , this method returns false { @ inherit doc }

public boolean has path capability ( final path path , final string capability ) throws i o exception { switch ( validate path capability args ( make qualified ( path ) , capability ) ) { case common path capabilities fs symlinks : / / delegate to the existing supports symlinks ( ) call return supports symlinks ( ) & & are symlinks enabled ( ) ; default : / / the feature is not implemented return false ; } }


removes the route specified by the path pattern

public void remove path pattern ( string path pattern ) { for ( methodless router < t > router : routers values ( ) ) { router remove path pattern ( path pattern ) ; } any method router remove path pattern ( path pattern ) ; }


returns the dash path effect that is set for this limit line

public dash path effect get dash path effect ( ) { return m dash path effect ; }


public void add ( a w s credentials provider p ) { providers add ( p ) ; }


get user { username } : get user by user name

default response entity < user > get user by name ( @ api param ( value = " the name that needs to be fetched use user 1 for testing " , required = true ) @ path variable ( " username " ) string username ) { get request ( ) if present ( request - > { for ( media type media type : media type parse media types ( request get header ( " accept " ) ) ) { if ( media type is compatible with ( media type value of ( " application / json " ) ) ) { string example string = " { \ " first name \ " : \ " first name \ " , \ " last name \ " : \ " last name \ " , \ " password \ " : \ " password \ " , \ " user status \ " : 6 , \ " phone \ " : \ " phone \ " , \ " id \ " : 0 , \ " email \ " : \ " email \ " , \ " username \ " : \ " username \ " } " ; api util set example response ( request , " application / json " , example string ) ; break ; } if ( media type is compatible with ( media type value of ( " application / xml " ) ) ) { string example string = " < user > < id > 123456789 < / id > < username > aeiou < / username > < first name > aeiou < / first name > < last name > aeiou < / last name > < email > aeiou < / email > < password > aeiou < / password > < phone > aeiou < / phone > < user status > 123 < / user status > < / user > " ; api util set example response ( request , " application / xml " , example string ) ; break ; } } } ) ; return new response entity < > ( http status not implemented ) ; }


create orc { @ link bulk writer factory } for different hive versions

bulk writer factory < row data > create orc bulk writer factory ( configuration conf , string schema , logical type [ ] field types ) ;


populate the given bean instance through applying after - instantiation callbacks and bean property post - processing ( e g for annotation - driven injection ) note : this is essentially intended for ( re - ) populating annotated fields and methods , either for new instances or for deserialized instances it does not imply traditional by - name or by - type autowiring of properties ; use { @ link # autowire bean properties } for those purposes

void autowire bean ( object existing bean ) throws beans exception ;


determines if every alternative subset in { @ code altsets } contains more than one alternative

public static boolean all subsets conflict ( collection < bit set > altsets ) { return ! has non conflicting alt set ( altsets ) ; }


computes the cluster state resulting from removing a given snapshot create operation from the given state

private static cluster state state without snapshot ( cluster state state , snapshot snapshot ) { snapshots in progress snapshots = state custom ( snapshots in progress type , snapshots in progress empty ) ; cluster state result = state ; boolean changed = false ; array list < snapshots in progress entry > entries = new array list < > ( ) ; for ( snapshots in progress entry entry : snapshots entries ( ) ) { if ( entry snapshot ( ) equals ( snapshot ) ) { changed = true ; } else { entries add ( entry ) ; } } if ( changed ) { result = cluster state builder ( state ) put custom ( snapshots in progress type , snapshots in progress of ( unmodifiable list ( entries ) ) ) build ( ) ; } return ready deletions ( result ) v 1 ( ) ; }


hook for further processing of on subscribe ' s subscription implement this method to call { @ link # request ( long ) } as an initial request values other than the unbounded { @ code long max value } imply that you ' ll also call request in { @ link # hook on next ( object ) } defaults to request unbounded long max value as in { @ link # request unbounded ( ) }

protected void hook on subscribe ( subscription subscription ) { subscription request ( long max value ) ; }


sometimes a client has identified precisely which snapshot is to be restored via a separate mechanism and wishes to guarantee that this is the snapshot that this request restores if the client can only identify a snapshot by its name then there is a risk that the desired snapshot may be deleted and replaced by a new snapshot with the same name which is inconsistent with the original one this method lets us fail the restore if the precise snapshot we want is not available this is for internal use only and is not exposed in the rest layer

public restore snapshot request snapshot uuid ( string snapshot uuid ) { this snapshot uuid = snapshot uuid ; return this ; }


public string get property class ( ) { return property class ; }


public task type get task type ( ) { return task type value of ( datum get task type ( ) to string ( ) ) ; }


set whether the framework should use the new api for the mapper this is the default for jobs submitted with the new job api

public void set use new mapper ( boolean flag ) { set boolean ( " mapred mapper new - api " , flag ) ; }


returns the execution info from the tags declared on the target these include only some tags { @ link # legal exec info keys } as keys with empty values

public static map < string , string > get execution info ( rule rule ) { / / tags may contain duplicate values map < string , string > map = new hash map < > ( ) ; for ( string tag : nonconfigurable attribute mapper of ( rule ) get ( constraints attr , type string list ) ) { if ( legal exec info keys ( tag ) ) { map put ( tag , " " ) ; } } return immutable map copy of ( map ) ; }


post pet { pet id } : updates a pet in the store with form data

default response entity < void > update pet with form ( @ api param ( value = " id of pet that needs to be updated " , required = true ) @ path variable ( " pet id " ) long pet id , @ api param ( value = " updated name of the pet " ) @ valid @ request part ( value = " name " , required = false ) string name , @ api param ( value = " updated status of the pet " ) @ valid @ request part ( value = " status " , required = false ) string status ) { return new response entity < > ( http status not implemented ) ; }


creates a new comment to indicate a new group { @ link identity link } has been created or deleted , if history is enabled

void create group identity link comment ( string task id , string group id , string type , boolean create ) ;


test that the variable rejects a particular cell value

public void is skipped ( string input ) { cell cell = new cell ( input , null ) ; is skipped ( cell ) ; }


public list < integer > get name array ( ) { return name array ; }


flush out all write operations scheduled via { @ link # write ( object , channel promise ) }


returns the current state of this decoder

protected s state ( ) { return state ; }


atomically removes the given subscriber if it is subscribed to the subject

void remove ( publish disposable < t > ps ) { for ( ; ; ) { publish disposable < t > [ ] a = subscribers get ( ) ; if ( a = = terminated | | a = = empty ) { return ; } int n = a length ; int j = - 1 ; for ( int i = 0 ; i < n ; i + + ) { if ( a [ i ] = = ps ) { j = i ; break ; } } if ( j < 0 ) { return ; } publish disposable < t > [ ] b ; if ( n = = 1 ) { b = empty ; } else { b = new publish disposable [ n - 1 ] ; system arraycopy ( a , 0 , b , 0 , j ) ; system arraycopy ( a , j + 1 , b , j , n - j - 1 ) ; } if ( subscribers compare and set ( a , b ) ) { return ; } } }


query given sql to create a prepared statement from sql and a list of arguments to bind to the query , expecting a result list the results will be mapped to a list ( one entry for each row ) of result objects , each of them matching the specified element type

< t > list < t > query for list ( string sql , @ nullable object [ ] args , class < t > element type ) throws data access exception ;


flushes any buffered data in the framer to the sink

public void flush ( ) { if ( buffer ! = null & & buffer readable bytes ( ) > 0 ) { commit to sink ( false , true ) ; } }


parses the specified string as a signed integer value using the specified radix the ascii character { @ code ' - ' } ( < code > ' & # 92 ; u 0 0 2 d ' < code > ) is recognized as the minus sign unlike { @ link integer # parse int ( string , int ) } , this method returns { @ code null } instead of throwing an exception if parsing fails additionally , this method only accepts ascii digits , and returns { @ code null } if non - ascii digits are present in the string note that strings prefixed with ascii { @ code ' + ' } are rejected , even under jdk 7 , despite the change to { @ link integer # parse int ( string , int ) } for that version

public static integer try parse ( string string , int radix ) { long result = longs try parse ( string , radix ) ; if ( result = = null | | result long value ( ) ! = result int value ( ) ) { return null ; } else { return result int value ( ) ; } }


convert the given object to string with each line indented by 4 spaces ( except the first line )

private string to indented string ( object o ) { if ( o = = null ) { return " null " ; } return o to string ( ) replace ( " \ n " , " \ n " ) ; }


sets the default value to use for a rule ' s { @ link rule class # compatible environment attr } attribute when not explicitly specified by the rule records a package error if any labels are duplicated

void set default compatible with ( list < label > environments , string attr name , location location ) { if ( has duplicate labels ( environments , " package " + pkg get name ( ) , attr name , location , this : : add event ) ) { set contains errors ( ) ; } pkg set default compatible with ( immutable set copy of ( environments ) ) ; }


serialize a double as the ieee 754 double format output the resultant array will be 8 bytes long

public static byte [ ] to bytes ( final double d ) { / / encode it as a long return longs to byte array ( double double to raw long bits ( d ) ) ; }


package deserialize ( deserialization context context , coded input stream coded in ) throws i o exception , interrupted exception , serialization exception ;


delegates to { @ link collection # contains } returns { @ code false } if the { @ code contains } method throws a { @ code class cast exception } or { @ code null pointer exception }

static boolean safe contains ( collection < ? > collection , @ nullable object object ) { check not null ( collection ) ; try { return collection contains ( object ) ; } catch ( class cast exception | null pointer exception e ) { return false ; } }


like { @ code scratch file } , but the file is first deleted if it already exists

public path overwrite file ( string path name , charset charset , string lines ) throws i o exception { path old file = resolve ( path name ) ; long new m time = old file exists ( ) ? old file get last modified time ( ) + 1 : - 1 ; old file delete ( ) ; path new file = file ( path name , charset , lines ) ; new file set last modified time ( new m time ) ; return new file ; }


the last arg is expected to be a remote path , if only one argument is given then the destination will be the remote user ' s directory

protected void get remote destination ( linked list < string > args ) throws i o exception { if ( args size ( ) < 2 ) { dst = new path data ( path cur dir , get conf ( ) ) ; } else { string path string = args remove last ( ) ; / / if the path is a glob , then it must match one and only one path path data [ ] items = path data expand as glob ( path string , get conf ( ) ) ; switch ( items length ) { case 0 : throw new path not found exception ( path string ) ; case 1 : dst = items [ 0 ] ; break ; default : throw new path i o exception ( path string , " too many matches " ) ; } } }


@ t c description : , ， @ test step : @ expect result :

public void multiple tenant group cluster deregister instance ( ) throws exception { string service name = random domain name ( ) ; naming 1 register instance ( service name , " 11 11 11 11 " , test port , " c 1 " ) ; naming 1 register instance ( service name , " 22 22 22 22 " , test port , " c 2 " ) ; list < instance > instances = naming 1 get all instances ( service name ) ; verify instance list for naming ( naming 1 , 2 , service name ) ; assert assert equals ( 2 , naming 1 get all instances ( service name ) size ( ) ) ; naming 1 deregister instance ( service name , " 22 22 22 22 " , test port ) ; time unit seconds sleep ( 3l ) ; assert assert equals ( 2 , naming 1 get all instances ( service name ) size ( ) ) ; naming 1 deregister instance ( service name , " 11 11 11 11 " , test port , " c 1 " ) ; naming 1 deregister instance ( service name , " 22 22 22 22 " , test port , " c 2 " ) ; }


computes the differences between program 1 and program 2 that are displayed in the browser it allows the user to specify the diff settings to use

void diff ( address set view p 1 limit set ) { if ( task in progress ) { msg show info ( get class ( ) , tool get tool frame ( ) , " can ' t start another diff " , " a diff or apply is already in progress " ) ; return ; } boolean reload = diff control ! = null ; if ( reload ) { reload diff ( p 1 limit set ) ; } else { create diff ( p 1 limit set ) ; } }


public object get actual instance ( ) { return instance ; }


private int write legacy compressed wrapper header ( ) { ensure open for record batch write ( ) ; byte buffer buffer = buffer stream buffer ( ) ; int pos = buffer position ( ) ; buffer position ( initial position ) ; int wrapper size = pos - initial position - records log overhead ; int written compressed = wrapper size - legacy record record overhead ( magic ) ; abstract legacy record batch write header ( buffer , last offset , wrapper size ) ; long timestamp = timestamp type = = timestamp type log append time ? log append time : max timestamp ; legacy record write compressed record header ( buffer , magic , wrapper size , timestamp , compression type , timestamp type ) ; buffer position ( pos ) ; return written compressed ; }


return true if this enum test object is equal to o

public boolean equals ( object o ) { if ( this = = o ) { return true ; } if ( o = = null | | get class ( ) ! = o get class ( ) ) { return false ; } enum test enum test = ( enum test ) o ; return objects equals ( this enum string , enum test enum string ) & & objects equals ( this enum string required , enum test enum string required ) & & objects equals ( this enum integer , enum test enum integer ) & & objects equals ( this enum number , enum test enum number ) & & objects equals ( this outer enum , enum test outer enum ) & & objects equals ( this outer enum integer , enum test outer enum integer ) & & objects equals ( this outer enum default value , enum test outer enum default value ) & & objects equals ( this outer enum integer default value , enum test outer enum integer default value ) ; }


test that a union can ' t contain another union that contains a typedef to it

public void test cyclic dependency problem 5 ( ) { union another union = create union ( " another union " ) ; type def type def = create type def ( union ) ; another union add ( type def ) ; try { union add ( another union ) ; assert fail ( " shouldn ' t be able to add another union , which contains a typedef of this union , to this union " ) ; } catch ( illegal argument exception e ) { / / should get an exception from adding the union to itself } try { union insert ( 0 , another union ) ; assert fail ( " shouldn ' t be able to insert another union , which contains a typedef of this union , to this union " ) ; } catch ( illegal argument exception e ) { / / should get an exception from inserting the union to itself } }


finds the first conflicting address in the given address range

public static address find first conflicting address ( program program , address addr , int length , boolean ignore undefined data ) { address set addr set = new address set ( addr , addr add ( length - 1 ) ) ; data iterator defined data iter = program get listing ( ) get defined data ( addr set , true ) ; data data = null ; while ( defined data iter has next ( ) ) { data d = defined data iter next ( ) ; if ( ! ignore undefined data | | ! undefined is undefined ( d get data type ( ) ) ) { data = d ; break ; } } instruction iterator instruction iter = program get listing ( ) get instructions ( addr set , true ) ; instruction instruction = instruction iter has next ( ) ? instruction iter next ( ) : null ; if ( data = = null & & instruction = = null ) { return null ; } if ( data = = null ) { return instruction get min address ( ) ; } if ( instruction = = null ) { return data get min address ( ) ; } address data addr = data get min address ( ) ; address instruction addr = instruction get address ( ) ; if ( data addr compare to ( instruction addr ) < 0 ) { return data addr ; } return instruction addr ; }


/ * package * / static hystrix thread pool properties setter get unit test properties builder ( ) { return hystrix thread pool properties setter ( ) with core size ( 10 ) / / core size of thread pool with maximum size ( 15 ) / / maximum size of thread pool with keep alive time minutes ( 1 ) / / minutes to keep a thread alive ( though in practice this doesn ' t get used as by default we set a fixed size ) with max queue size ( 100 ) / / size of queue ( but we never allow it to grow this big this can ' t be dynamically changed so we use ' queue size rejection threshold ' to artificially limit and reject ) with queue size rejection threshold ( 10 ) / / number of items in queue at which point we reject ( this can be dyamically changed ) with metrics rolling statistical window in milliseconds ( 10000 ) / / milliseconds for rolling number with metrics rolling statistical window buckets ( 10 ) ; / / number of buckets in rolling number ( 10 1 - second buckets ) }


returns the { @ link # get base color ( ) } in the " # rrggbb " format

public string get html base color ( ) { return string format ( " # % 06x " , base color get r g b ( ) & 0x f f f f f f ) ; }


create a new { @ code date time formatter } using this factory if no specific pattern or style has been defined , the supplied { @ code fallback formatter } will be used

public date time formatter create date time formatter ( date time formatter fallback formatter ) { date time formatter date time formatter = null ; if ( string utils has length ( this pattern ) ) { / / using strict parsing to align with joda - time and standard date format behavior : / / otherwise , an overflow like e g feb 29 for a non - leap - year wouldn ' t get rejected / / however , with strict parsing , a year digit needs to be specified as ' u ' string pattern to use = string utils replace ( this pattern , " yy " , " uu " ) ; date time formatter = date time formatter of pattern ( pattern to use ) with resolver style ( resolver style strict ) ; } else if ( this iso ! = null & & this iso ! = iso none ) { switch ( this iso ) { case date : date time formatter = date time formatter iso date ; break ; case time : date time formatter = date time formatter iso time ; break ; case date time : date time formatter = date time formatter iso date time ; break ; default : throw new illegal state exception ( " unsupported iso format : " + this iso ) ; } } else if ( this date style ! = null & & this time style ! = null ) { date time formatter = date time formatter of localized date time ( this date style , this time style ) ; } else if ( this date style ! = null ) { date time formatter = date time formatter of localized date ( this date style ) ; } else if ( this time style ! = null ) { date time formatter = date time formatter of localized time ( this time style ) ; } if ( date time formatter ! = null & & this time zone ! = null ) { date time formatter = date time formatter with zone ( this time zone to zone id ( ) ) ; } return ( date time formatter ! = null ? date time formatter : fallback formatter ) ; }


assume that a condition is met if not : log at warn and then throw an { @ link assumption violated exception }

public static void assume ( string message , boolean condition ) { if ( ! condition ) { log warn ( message ) ; } assume assume true ( message , condition ) ; }


public rectangle set height ( float height ) { this height = height ; return this ; }


destroy and then close ( ) a metastore instance exceptions are caught and logged at debug

private static void destroy ( final dynamo d b metadata store ddbms ) { if ( ddbms ! = null ) { try { ddbms destroy ( ) ; i o utils close stream ( ddbms ) ; } catch ( i o exception e ) { log debug ( " on ddbms shutdown " , e ) ; } } }


returns true if field success is set ( has been assigned a value ) and false otherwise

public boolean is set success ( ) { return this success ! = null ; }


public inet socket address get remote address ( ) { return remote address ; }


protected string get delegation binding ( ) { return delegation token session binding ; }


this creates a vanilla { @ link jdbi } instance based on the specified data source ; this can be overridden if required

protected jdbi new instance ( final managed data source data source ) { return jdbi create ( data source ) ; }


evaluate this expression in the given environment ( bindings )

public object evaluate ( properties bindings ) ;


counts the number of dots " " in a string

public static int count dots ( final string s ) { int count = 0 ; for ( int i = 0 ; i < s length ( ) ; i + + ) { if ( s char at ( i ) = = ' ' ) { count + + ; } } return count ; }


set the value for prepared statements specified parameter index using the passed in value this method can be overridden by sub - classes if needed

protected void do set value ( prepared statement ps , int parameter position , object arg value ) throws s q l exception { if ( arg value instanceof sql parameter value ) { sql parameter value param value = ( sql parameter value ) arg value ; statement creator utils set parameter value ( ps , parameter position , param value , param value get value ( ) ) ; } else { statement creator utils set parameter value ( ps , parameter position , sql type value type unknown , arg value ) ; } }


returns { @ code true } if this x content generator has been closed a closed generator can not do any more output


seek to an offset if the data is already in the buffer , move to it

public synchronized void seek ( long target pos ) throws i o exception { if ( target pos < 0 ) { throw new e o f exception ( f s exception messages negative seek ) ; } / / there ' s some special handling of near - local data / / as the seek can be omitted if it is in / adjacent long offset = target pos - pos ; if ( log is debug enabled ( ) ) { log debug ( " seek to " + target pos + " ; current pos = " + pos + " ; offset = " + offset ) ; } if ( offset = = 0 ) { log debug ( " seek is no - op " ) ; return ; } if ( offset < 0 ) { log debug ( " seek is backwards " ) ; } else if ( ( range offset + offset < buffer size ) ) { / / if the seek is in range of that requested , scan forwards / / instead of closing and re - opening a new http connection swift utils debug ( log , " seek is within current stream " + " ; pos = % d ; target pos = % d ; " + " offset = % d ; buffer offset = % d " , pos , target pos , offset , range offset ) ; try { log debug ( " chomping " ) ; chomp bytes ( offset ) ; } catch ( i o exception e ) { / / this is assumed to be recoverable with a seek - or more likely to fail log debug ( " while chomping " , e ) ; } if ( target pos - pos = = 0 ) { log trace ( " chomping successful " ) ; return ; } log trace ( " chomping failed " ) ; } else { if ( log is debug enabled ( ) ) { log debug ( " seek is beyond buffer size of " + buffer size ) ; } } inner close ( " seeking to " + target pos ) ; fill buffer ( target pos ) ; }


public string get cluster id ( ) { return this cluster id ; }


public void reset channel and authentication ( final j e e context web context ) { val session store = web context get session store ( ) ; session store set ( web context , session attribute channel , null ) ; session store set ( web context , session attribute original authentication , null ) ; }


test normal record storage within a leaf node chained - buffers will not be utilized

public void test get small long key record ( ) throws i o exception { insert one long key record ( false , true , 1 ) ; }


get the number of return bytes , i e , the number of bytes immediately before ( and including ) a return instruction

public int get num return bytes ( ) { return num return bytes ; }


checks that the given argument is neither null nor empty if it is , throws { @ link null pointer exception } or { @ link illegal argument exception } otherwise , returns the argument

public static < t extends collection < ? > > t check non empty ( t collection , string name ) { check not null ( collection , name ) ; check positive ( collection size ( ) , name + " size " ) ; return collection ; }


< code > optional string uri = 2 ; < code >

private void clear uri ( ) { bit field 0 = ( bit field 0 & ~ 0x 0 0 0 0 0 0 0 2 ) ; uri = get default instance ( ) get uri ( ) ; }


protected set < string > resolve full group names ( string group names ) { string tokenizer tokenizer = new string tokenizer ( group names , shell token separator regex ) ; set < string > groups = new linked hash set < > ( ) ; while ( tokenizer has more tokens ( ) ) { groups add ( tokenizer next token ( ) ) ; } return groups ; }


fulfills { @ link com google devtools build lib actions abstract action # get mnemonic ( ) }


default implementation that does nothing

public boolean prebuild ( build build , build listener listener ) { return true ; }


load the values defined from a configuration file including the delta progress and the maximum time between each log message

public static void set task log progress delta thresholds ( final configuration conf ) { if ( progress min delta threshold = = null ) { progress min delta threshold = new double ( progress min delta factor * conf get double ( m r job config task log progress delta threshold , m r job config task log progress delta threshold default ) ) ; } if ( progress max wait delta time threshold = = null ) { progress max wait delta time threshold = time unit seconds to millis ( conf get long ( m r job config task log progress wait interval seconds , m r job config task log progress wait interval seconds default ) ) ; } }


atomically clones an existing retention lease to a new id

retention lease clone retention lease ( string source lease id , string target lease id , action listener < replication response > listener ) { objects require non null ( listener ) ; final retention lease retention lease ; final retention leases current retention leases ; synchronized ( this ) { assert primary mode ; if ( get retention leases ( ) contains ( source lease id ) = = false ) { throw new retention lease not found exception ( source lease id ) ; } final retention lease source lease = get retention leases ( ) get ( source lease id ) ; retention lease = inner add retention lease ( target lease id , source lease retaining sequence number ( ) , source lease source ( ) ) ; current retention leases = retention leases ; } / / syncing here may not be strictly necessary , because this new lease isn ' t retaining any extra history that wasn ' t previously / / retained by the source lease ; however we prefer to sync anyway since we expect to do so whenever creating a new lease on sync retention leases accept ( current retention leases , listener ) ; return retention lease ; }