tests that if space is a safe character you cannot also specify ' plus for space ' ( throws { @ link illegal argument exception } )

public void test bad arguments plusforspace ( ) { try { new percent escaper ( " " , false ) ; } catch ( illegal argument exception e ) { fail ( " space can be a ' safe ' character if plus for space is false " ) ; } string msg = " plus for space cannot be specified when space is a ' safe ' character " ; try { new percent escaper ( " " , true ) ; fail ( msg ) ; } catch ( illegal argument exception expected ) { assert that ( expected ) has message that ( ) is equal to ( msg ) ; } }


only for histogram order : backwards compatibility logic to write a { @ link bucket order } to a stream

public static void write histogram order ( bucket order order , stream output out ) throws i o exception { order write to ( out ) ; }


return the set of keys that collide from { @ code this } and { @ code other }

public set < string > intersection ( attribute dict other ) { if ( other = = null | | other size ( ) = = 0 | | size ( ) = = 0 ) { return collections empty set ( ) ; } set < string > result = new hash set < string > ( attributes key set ( ) ) ; result retain all ( other attributes key set ( ) ) ; return result ; }


a method to initialize the fields that depend on a configuration must be called before use kerberos or groups is used

private static void ensure initialized ( ) { if ( ! is initialized ( ) ) { synchronized ( user group information class ) { if ( ! is initialized ( ) ) { / / someone might have beat us initialize ( new configuration ( ) , false ) ; } } } }


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


publish a { @ link prepare test instance event } to the { @ code application context } for the supplied { @ link test context }

public void prepare test instance ( test context test context ) { test context publish event ( prepare test instance event : : new ) ; }


register multifactor trusted authentication into webflow

protected void register multifactor trusted authentication ( ) { this multifactor authentication flow definition registries for each ( this : : register multifactor trusted authentication ) ; }


public acknowledged response create data stream ( create data stream request create data stream request , request options options ) throws i o exception { return rest high level client perform request and parse entity ( create data stream request , indices request converters : : put data stream , options , acknowledged response : : from x content , empty set ( ) ) ; }


the specified type is primitive type or simple type

public static boolean is primitive ( class < ? > type ) { return type ! = null & & ( type is primitive ( ) | | is simple type ( type ) ) ; }


public job get job ( job i d job id ) throws i o exception , interrupted exception { job status status = client get job status ( job id ) ; if ( status ! = null ) { job conf conf ; try { conf = new job conf ( status get job file ( ) ) ; } catch ( runtime exception ex ) { / / if job file doesn ' t exist it means we can ' t find the job if ( ex get cause ( ) instanceof file not found exception ) { return null ; } else { throw ex ; } } return job get instance ( this , status , conf ) ; } return null ; }


given a property value , return a value , resolving any references to other beans in the factory if necessary the value could be : a bean definition , which leads to the creation of a corresponding new bean instance singleton flags and names of such " inner beans " are always ignored : inner beans are anonymous prototypes a runtime bean reference , which must be resolved a managed list this is a special collection that may contain runtime bean references or collections that will need to be resolved a managed set may also contain runtime bean references or collections that will need to be resolved a managed map in this case the value may be a runtime bean reference or collection that will need to be resolved an ordinary object or { @ code null } , in which case it ' s left alone

public object resolve value if necessary ( object arg name , @ nullable object value ) { / / we must check each value to see whether it requires a runtime reference / / to another bean to be resolved if ( value instanceof runtime bean reference ) { runtime bean reference ref = ( runtime bean reference ) value ; return resolve reference ( arg name , ref ) ; } else if ( value instanceof runtime bean name reference ) { string ref name = ( ( runtime bean name reference ) value ) get bean name ( ) ; ref name = string value of ( do evaluate ( ref name ) ) ; if ( ! this bean factory contains bean ( ref name ) ) { throw new bean definition store exception ( " invalid bean name ' " + ref name + " ' in bean reference for " + arg name ) ; } return ref name ; } else if ( value instanceof bean definition holder ) { / / resolve bean definition holder : contains bean definition with name and aliases bean definition holder bd holder = ( bean definition holder ) value ; return resolve inner bean ( arg name , bd holder get bean name ( ) , bd holder get bean definition ( ) ) ; } else if ( value instanceof bean definition ) { / / resolve plain bean definition , without contained name : use dummy name bean definition bd = ( bean definition ) value ; string inner bean name = " ( inner bean ) " + bean factory utils generated bean name separator + object utils get identity hex string ( bd ) ; return resolve inner bean ( arg name , inner bean name , bd ) ; } else if ( value instanceof dependency descriptor ) { set < string > autowired bean names = new linked hash set < > ( 4 ) ; object result = this bean factory resolve dependency ( ( dependency descriptor ) value , this bean name , autowired bean names , this type converter ) ; for ( string autowired bean name : autowired bean names ) { if ( this bean factory contains bean ( autowired bean name ) ) { this bean factory register dependent bean ( autowired bean name , this bean name ) ; } } return result ; } else if ( value instanceof managed array ) { / / may need to resolve contained runtime references managed array array = ( managed array ) value ; class < ? > element type = array resolved element type ; if ( element type = = null ) { string element type name = array get element type name ( ) ; if ( string utils has text ( element type name ) ) { try { element type = class utils for name ( element type name , this bean factory get bean class loader ( ) ) ; array resolved element type = element type ; } catch ( throwable ex ) { / / improve the message by showing the context throw new bean creation exception ( this bean definition get resource description ( ) , this bean name , " error resolving array type for " + arg name , ex ) ; } } else { element type = object class ; } } return resolve managed array ( arg name , ( list < ? > ) value , element type ) ; } else if ( value instanceof managed list ) { / / may need to resolve contained runtime references return resolve managed list ( arg name , ( list < ? > ) value ) ; } else if ( value instanceof managed set ) { / / may need to resolve contained runtime references return resolve managed set ( arg name , ( set < ? > ) value ) ; } else if ( value instanceof managed map ) { / / may need to resolve contained runtime references return resolve managed map ( arg name , ( map < ? , ? > ) value ) ; } else if ( value instanceof managed properties ) { properties original = ( properties ) value ; properties copy = new properties ( ) ; original for each ( ( prop key , prop value ) - > { if ( prop key instanceof typed string value ) { prop key = evaluate ( ( typed string value ) prop key ) ; } if ( prop value instanceof typed string value ) { prop value = evaluate ( ( typed string value ) prop value ) ; } if ( prop key = = null | | prop value = = null ) { throw new bean creation exception ( this bean definition get resource description ( ) , this bean name , " error converting properties key / value pair for " + arg name + " : resolved to null " ) ; } copy put ( prop key , prop value ) ; } ) ; return copy ; } else if ( value instanceof typed string value ) { / / convert value to target type here typed string value typed string value = ( typed string value ) value ; object value object = evaluate ( typed string value ) ; try { class < ? > resolved target type = resolve target type ( typed string value ) ; if ( resolved target type ! = null ) { return this type converter convert if necessary ( value object , resolved target type ) ; } else { return value object ; } } catch ( throwable ex ) { / / improve the message by showing the context throw new bean creation exception ( this bean definition get resource description ( ) , this bean name , " error converting typed string value for " + arg name , ex ) ; } } else if ( value instanceof null bean ) { return null ; } else { return evaluate ( value ) ; } }


creates a channel builder with a target string and credentials the target can be either a valid { @ link name resolver } - compliant uri , or an authority string a { @ code name resolver } - compliant uri is an absolute hierarchical uri as defined by { @ link java net uri } example u r is : { @ code " dns : foo googleapis com : 8080 " } { @ code " dns : foo googleapis com " } { @ code " dns : % 5b2001 : db 8 : 8 5a 3 : 8d 3 : 1319 : 8a 2e : 370 : 7348 % 5d : 443 " } { @ code " dns : 8 8 8 8foo googleapis com : 8080 " } { @ code " dns : 8 8 8 8foo googleapis com " } { @ code " zookeeper : zk example com : 9 9 0 0example service " } an authority string will be converted to a { @ code name resolver } - compliant uri , which has the scheme from the name resolver with the highest priority ( e g { @ code " dns " } ) , no authority , and the original authority string as its path after properly escaped we recommend libraries to specify the schema explicitly if it is known , since libraries cannot know which name resolver will be default during runtime example authority strings : { @ code " localhost " } { @ code " 127 0 0 1 " } { @ code " localhost : 8080 " } { @ code " foo googleapis com : 8080 " } { @ code " 127 0 0 1 : 8080 " } { @ code " [ 2001 : db 8 : 8 5a 3 : 8d 3 : 1319 : 8a 2e : 370 : 7348 ] " } { @ code " [ 2001 : db 8 : 8 5a 3 : 8d 3 : 1319 : 8a 2e : 370 : 7348 ] : 443 " }

public static managed channel builder < ? > new channel builder ( string target , channel credentials creds ) { return managed channel registry get default registry ( ) new channel builder ( target , creds ) ; }


allows the precise disabling of the filter operation for example , when the user sorts , no filtering is needed if the filter has changed , then a filter will take place , regardless of the state of this variable

protected void set force filter ( boolean force ) { this do force filter = force ; }


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 " ) ; }


synchronized void retain jobs ( list < string > active jobs ) { jobs key set ( ) retain all ( active jobs ) ; }


returns { @ link list } such that its { @ code get ( end ) } returns the concatenation of [ token start , , token end ] ( both end inclusive )

public list < string > sub sequence ( final int start ) { return new abstract list < string > ( ) { public string get ( int index ) { string builder buf = new string builder ( ) ; for ( int i = start ; i < = start + index ; i + + ) buf append ( tokens [ i ] ) ; return buf to string ( ) trim ( ) ; } public int size ( ) { return tokens length - start ; } } ; }


simply verify invocation structure in memory : entrance node ( default context name ) - - interface node ( interface name ) - - - - method node ( resource name )

private void verify invocation structure ( invoker invoker , invocation invocation ) { context context = context util get context ( ) ; assert not null ( context ) ; / / as not call context util enter ( resource name , application ) in sentinel dubbo consumer filter , use default context / / in actual project , a consumer is usually also a provider , the context will be created by / / sentinel dubbo provider filter / / if consumer is on the top of dubbo rpc invocation chain , use default context string resource name = consumer filter get method name ( invoker , invocation , null ) ; assert equals ( com alibaba csp sentinel constants context default name , context get name ( ) ) ; assert equals ( " " , context get origin ( ) ) ; default node entrance node = context get entrance node ( ) ; resource wrapper entrance resource = entrance node get id ( ) ; assert equals ( com alibaba csp sentinel constants context default name , entrance resource get name ( ) ) ; assert same ( entry type in , entrance resource get entry type ( ) ) ; / / as sph u entry ( interface name , entry type out ) ; set < node > child list = entrance node get child list ( ) ; assert equals ( 1 , child list size ( ) ) ; default node interface node = get node ( dubbo utils get interface name ( invoker ) , entrance node ) ; resource wrapper interface resource = interface node get id ( ) ; assert equals ( dubbo utils get interface name ( invoker ) , interface resource get name ( ) ) ; assert same ( entry type out , interface resource get entry type ( ) ) ; / / as sph u entry ( resource name , entry type out ) ; child list = interface node get child list ( ) ; assert equals ( 1 , child list size ( ) ) ; default node method node = get node ( resource name , entrance node ) ; resource wrapper method resource = method node get id ( ) ; assert equals ( resource name , method resource get name ( ) ) ; assert same ( entry type out , method resource get entry type ( ) ) ; / / verify cur entry entry cur entry = context get cur entry ( ) ; assert same ( method node , cur entry get cur node ( ) ) ; assert same ( interface node , cur entry get last node ( ) ) ; assert null ( cur entry get origin node ( ) ) ; / / as context origin is not " " , no origin node should be created in cur entry / / verify cluster node cluster node method cluster node = method node get cluster node ( ) ; cluster node interface cluster node = interface node get cluster node ( ) ; assert not same ( method cluster node , interface cluster node ) ; / / different resource - > different processor slot - > different cluster node / / as context origin is " " , the statistic node should not be created in origin count map of cluster node map < string , statistic node > method origin count map = method cluster node get origin count map ( ) ; assert equals ( 0 , method origin count map size ( ) ) ; map < string , statistic node > interface origin count map = interface cluster node get origin count map ( ) ; assert equals ( 0 , interface origin count map size ( ) ) ; }


returns the remainder of the given unknown integer value divided by this integer value

public integer value remainder of ( unknown integer value other ) { return remainder of ( ( integer value ) other ) ; }


gets the next address indicating the address after this call site table

address get next address ( ) { return next address ; }


private void verify open files ( map < path , f s data output stream > open files ) throws i o exception { verify open files ( open files , open files iterator filter path default ) ; }


checks whether this byte buffer is equal to another object if { @ code other } is not a byte buffer then { @ code false } is returned two byte buffers are equal if and only if their remaining bytes are exactly the same position , limit , capacity and mark are not considered

public boolean equals ( object other ) { if ( ! ( other instanceof byte buffer ) ) { return false ; } byte buffer other buffer = ( byte buffer ) other ; if ( remaining ( ) ! = other buffer remaining ( ) ) { return false ; } int my position = position ; int other position = other buffer position ; boolean equal so far = true ; while ( equal so far & & ( my position < limit ) ) { equal so far = get ( my position + + ) = = other buffer get ( other position + + ) ; } return equal so far ; }


add the options change listener note : the options uses weak references to manage the listeners ; this means that you must supply a listener and maintain a handle to it , or else the listener will be garbage collected and will never get called so for this reason , do not create the listener in an anonymous inner class

public void add options change listener ( options change listener l ) { listeners add ( l ) ; }


returns a { @ link byte source } view of this char source that encodes chars read from this source as bytes using the given { @ link charset } if { @ link byte source # as char source } is called on the returned source with the same charset , the default implementation of this method will ensure that the original { @ code char source } is returned , rather than round - trip encoding subclasses that override this method should behave the same way

public byte source as byte source ( charset charset ) { return new as byte source ( charset ) ; }


return a ' merged ' bean definition for the given bean name , merging a child bean definition with its parent if necessary this { @ code get merged bean definition } considers bean definition in ancestors as well

public bean definition get merged bean definition ( string name ) throws beans exception { string bean name = transformed bean name ( name ) ; / / efficiently check whether bean definition exists in this factory if ( ! contains bean definition ( bean name ) & & get parent bean factory ( ) instanceof configurable bean factory ) { return ( ( configurable bean factory ) get parent bean factory ( ) ) get merged bean definition ( bean name ) ; } / / resolve merged bean definition locally return get merged local bean definition ( bean name ) ; }


sets a tag to use instead of the fully qualifier class name this can make the json easier to read

public void add class tag ( string tag , class type ) { tag to class put ( tag , type ) ; class to tag put ( type , tag ) ; }


provides the list of this plugin ' s custom thread pools , empty if none

public list < executor builder < ? > > get executor builders ( settings settings ) { return collections empty list ( ) ; }


test that non - positive numbers are not counted

public void test add non positive stats ( ) throws exception { min max avg stats mma = new min max avg stats ( ) ; mma add ( - 1 ) ; assert equals ( 0 , mma get minimum ( ) ) ; assert equals ( 0 , mma get maximum ( ) ) ; assert equals ( 0 , mma get sum ( ) ) ; assert equals ( 0 , mma get count ( ) ) ; assert equals ( 0 , mma get average ( ) ) ; mma add ( 0 ) ; assert equals ( 0 , mma get minimum ( ) ) ; assert equals ( 0 , mma get maximum ( ) ) ; assert equals ( 0 , mma get sum ( ) ) ; assert equals ( 1 , mma get count ( ) ) ; assert equals ( 0 , mma get average ( ) ) ; }


make assertions about fields that only appear in file status in hdfs2

protected void extra status assertions ( swift file status stat ) { / / hdfs2 assert true ( " is directory ( ) : not a directory : " + stat , stat is directory ( ) ) ; assert false ( " is file ( ) : declares itself a file : " + stat , stat is file ( ) ) ; assert false ( " is file ( ) : declares itself a file : " + stat , stat is symlink ( ) ) ; }


begins reading the elements of an array , returning the array ' s size the caller must follow up by calling a read method for each element in the array for example , this reads a byte array : { @ code int array size = read array ( ) ; for ( int i = 0 , i < array size ; i + + ) { read byte ( ) ; } }

public int read array ( ) { check type ( encoded array ) ; type = must read ; return leb 1 2 8 read unsigned leb 1 2 8 ( in ) ; }


public long get value ( ) { return value ; }


returns the string representation of an { @ link inet address } for i pv 4 addresses , this is identical to { @ link inet address # get host address ( ) } , but for i pv 6 addresses , the output follows < a href = " http : tools ietf orghtmlrfc 5 9 5 2 " > rfc 5952 section 4 the main difference is that this method uses " : : " for zero compression , while java ' s version uses the uncompressed form this method uses hexadecimal for all i pv 6 addresses , including i pv 4 - mapped i pv 6 addresses such as " : : c 0 0 0 : 201 " the output does not include a scope id

public static string to addr string ( inet address ip ) { if ( ip = = null ) { throw new null pointer exception ( " ip " ) ; } if ( ip instanceof inet 4 address ) { / / for i pv 4 , java ' s formatting is good enough byte [ ] bytes = ip get address ( ) ; return ( bytes [ 0 ] & 0xff ) + " " + ( bytes [ 1 ] & 0xff ) + " " + ( bytes [ 2 ] & 0xff ) + " " + ( bytes [ 3 ] & 0xff ) ; } if ( ! ( ip instanceof inet 6 address ) ) { throw new illegal argument exception ( " ip " ) ; } byte [ ] bytes = ip get address ( ) ; int [ ] hextets = new int [ ipv6 part count ] ; for ( int i = 0 ; i < hextets length ; i + + ) { hextets [ i ] = ( bytes [ 2 * i ] & 255 ) < < 8 | bytes [ 2 * i + 1 ] & 255 ; } compress longest run of zeroes ( hextets ) ; return hextets to i pv 6 string ( hextets ) ; }


called once the { @ link channel inbound handler # channel active ( channel handler context ) } event hit the end of the { @ link channel pipeline }

protected void on unhandled inbound channel active ( ) { }


initialize any state necessary to run benchmark this is run once at start up

protected void set up ( ) { / / default : no - op }


public final void read fields ( final data input in ) throws i o exception { job id = new job id ( ) ; job id read fields ( in ) ; this task id = writable utils read v long ( in ) ; }


model tests for additional properties any type

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


merges runfiles from a given runfiles support

public builder merge ( @ nullable runfiles support runfiles support ) { if ( runfiles support = = null ) { return this ; } merge ( runfiles support get runfiles ( ) ) ; return this ; }


thread - safe call to reset the disk stats if we know that the free space has changed recently ( for example , if we have deleted files ) , use this method to reset the internal state and start tracking disk stats afresh , resetting the internal timer for updating stats

public void reset stats ( ) { / / update the free space if able to get the lock if ( lock try lock ( ) ) { try { ensure initialized ( ) ; update stats ( ) ; } finally { lock unlock ( ) ; } } }


public string insn comment string ( dalv insn insn , boolean note indices ) { return branch comment ( insn ) ; }


initialize lottie with global configuration

public static void initialize ( @ non null final lottie config lottie config ) { l set fetcher ( lottie config network fetcher ) ; l set cache provider ( lottie config cache provider ) ; l set trace enabled ( lottie config enable systrace markers ) ; }


this test validates that an index which is out of bounds throws an index out of bounds exception

public void test out of tuple bounds grouping 3 ( ) { final execution environment env = execution environment get execution environment ( ) ; unsorted grouping < tuple 5 < integer , long , string , long , integer > > group ds = env from collection ( empty tuple data , tuple type info ) group by ( 0 ) ; / / should not work , key out of tuple bounds group ds min by ( 1 , 2 , 3 , 4 , - 1 ) ; }


public void flush undo logs ( connection proxy cp ) throws s q l exception { connection context connection context = cp get context ( ) ; if ( ! connection context has undo log ( ) ) { return ; } string xid = connection context get xid ( ) ; long branch id = connection context get branch id ( ) ; branch undo log branch undo log = new branch undo log ( ) ; branch undo log set xid ( xid ) ; branch undo log set branch id ( branch id ) ; branch undo log set sql undo logs ( connection context get undo items ( ) ) ; undo log parser parser = undo log parser factory get instance ( ) ; byte [ ] undo log content = parser encode ( branch undo log ) ; compressor type compressor type = compressor type none ; if ( need compress ( undo log content ) ) { compressor type = rollback info compress type ; undo log content = compressor factory get compressor ( compressor type get code ( ) ) compress ( undo log content ) ; } if ( logger is debug enabled ( ) ) { logger debug ( " flushing undo log : { } " , new string ( undo log content , constants default charset ) ) ; } insert undo log with normal ( xid , branch id , build context ( parser get name ( ) , compressor type ) , undo log content , cp get target connection ( ) ) ; }


public string section name str ( ) { return prefix + " debug str " ; }


returns the square root of { @ code x } , rounded with the specified rounding mode

public static big integer sqrt ( big integer x , rounding mode mode ) { check non negative ( " x " , x ) ; if ( fits in long ( x ) ) { return big integer value of ( long math sqrt ( x long value ( ) , mode ) ) ; } big integer sqrt floor = sqrt floor ( x ) ; switch ( mode ) { case unnecessary : check rounding unnecessary ( sqrt floor pow ( 2 ) equals ( x ) ) ; / / fall through case floor : case down : return sqrt floor ; case ceiling : case up : int sqrt floor int = sqrt floor int value ( ) ; boolean sqrt floor is exact = ( sqrt floor int * sqrt floor int = = x int value ( ) ) / / fast check mod 2 ^ 32 & & sqrt floor pow ( 2 ) equals ( x ) ; / / slow exact check return sqrt floor is exact ? sqrt floor : sqrt floor add ( big integer one ) ; case half down : case half up : case half even : big integer half square = sqrt floor pow ( 2 ) add ( sqrt floor ) ; / * * we wish to test whether or not x < = ( sqrt floor + 0 5 ) ^ 2 = half square + 0 25 since both x * and half square are integers , this is equivalent to testing whether or not x < = * half square * / return ( half square compare to ( x ) > = 0 ) ? sqrt floor : sqrt floor add ( big integer one ) ; default : throw new assertion error ( ) ; } }


return the aliases for the given bean name , if any all of those aliases point to the same bean when used in a { @ link # get bean } call if the given name is an alias , the corresponding original bean name and other aliases ( if any ) will be returned , with the original bean name being the first element in the array will ask the parent factory if the bean cannot be found in this factory instance

string [ ] get aliases ( string name ) ;


protected void validate path ( string path ) throws invalid pathname exception { / / currently no checks are performed }


public void capital snake test ( ) { / / todo : test capital snake }


build surrogate authentication result optional

public optional < authentication result builder > build surrogate authentication result ( final authentication result builder authentication result builder , final credential credential , final string surrogate target id , final registered service registered service ) { val current authn = authentication result builder get initial authentication ( ) ; if ( current authn is present ( ) ) { val authentication = current authn get ( ) ; var principal = authentication get principal ( ) ; if ( authentication get principal ( ) instanceof surrogate principal ) { principal = surrogate principal class cast ( authentication get principal ( ) ) get primary ( ) ; } if ( ! surrogate authentication service can authenticate as ( surrogate target id , principal , optional empty ( ) ) ) { throw new surrogate authentication exception ( " unable to authorize surrogate authentication request for " + surrogate target id ) ; } val surrogate principal = build surrogate principal ( surrogate target id , principal , registered service ) ; val auth = default authentication builder new instance ( authentication ) set principal ( surrogate principal ) build ( ) ; return optional of ( authentication result builder collect ( auth ) ) ; } return optional empty ( ) ; }


return true if this pig object is equal to o

public boolean equals ( object o ) { return super equals ( o ) & & objects equals ( this additional properties , ( ( pig ) o ) additional properties ) ; }


process an rpc request - the connection headers and context must have been already read - based on the rpc kind , decode the rpc request - a successfully decoded rpc call will be deposited in rpc - q and its response will be sent later when the request is processed

private void process rpc request ( rpc request header proto header , rpc writable buffer buffer ) throws rpc server exception , interrupted exception { class < ? extends writable > rpc request class = get rpc request wrapper ( header get rpc kind ( ) ) ; if ( rpc request class = = null ) { log warn ( " unknown rpc kind " + header get rpc kind ( ) + " from client " + get host address ( ) ) ; final string err = " unknown rpc kind in rpc header " + header get rpc kind ( ) ; throw new fatal rpc server exception ( rpc error code proto fatal invalid rpc header , err ) ; } writable rpc request ; try { / / read the rpc request rpc request = buffer new instance ( rpc request class , conf ) ; } catch ( rpc server exception rse ) { / / lets tests inject failures throw rse ; } catch ( throwable t ) { / / includes runtime exception from new instance log warn ( " unable to read call parameters for client " + get host address ( ) + " on connection protocol " + this protocol name + " for rpc kind " + header get rpc kind ( ) , t ) ; string err = " ipc server unable to read call parameters : " + t get message ( ) ; throw new fatal rpc server exception ( rpc error code proto fatal deserializing request , err ) ; } trace scope trace scope = null ; if ( header has trace info ( ) ) { if ( tracer ! = null ) { / / if the incoming rpc included tracing info , always continue the / / trace span id parent span id = new span id ( header get trace info ( ) get trace id ( ) , header get trace info ( ) get parent id ( ) ) ; trace scope = tracer new scope ( rpc client util to trace name ( rpc request to string ( ) ) , parent span id ) ; trace scope detach ( ) ; } } caller context caller context = null ; if ( header has caller context ( ) ) { caller context = new caller context builder ( header get caller context ( ) get context ( ) ) set signature ( header get caller context ( ) get signature ( ) to byte array ( ) ) build ( ) ; } rpc call call = new rpc call ( this , header get call id ( ) , header get retry count ( ) , rpc request , proto util convert ( header get rpc kind ( ) ) , header get client id ( ) to byte array ( ) , trace scope , caller context ) ; / / save the priority level assignment by the scheduler call set priority level ( call queue get priority level ( call ) ) ; call mark call coordinated ( false ) ; if ( alignment context ! = null & & call rpc request ! = null & & ( call rpc request instanceof protobuf rpc engine 2 rpc protobuf request ) ) { / / if call rpc request is not rpc protobuf request , will skip the following / / step and treat the call as uncoordinated as currently only certain / / client protocol methods request made through rpc protobuf needs to be / / coordinated string method name ; string proto name ; protobuf rpc engine 2 rpc protobuf request req = ( protobuf rpc engine 2 rpc protobuf request ) call rpc request ; try { method name = req get request header ( ) get method name ( ) ; proto name = req get request header ( ) get declaring class protocol name ( ) ; if ( alignment context is coordinated call ( proto name , method name ) ) { call mark call coordinated ( true ) ; long state id ; state id = alignment context receive request state ( header , get max idle time ( ) ) ; call set client state id ( state id ) ; } } catch ( i o exception ioe ) { throw new rpc server exception ( " processing rpc request caught " , ioe ) ; } } try { internal queue call ( call ) ; } catch ( rpc server exception rse ) { throw rse ; } catch ( i o exception ioe ) { throw new fatal rpc server exception ( rpc error code proto error rpc server , ioe ) ; } inc rpc count ( ) ; / / increment the rpc count }


returns a string representation of x , where x is treated as unsigned < b > java 8 users : < b > use { @ link long # to unsigned string ( long ) } instead

public static string to string ( long x ) { return to string ( x , 10 ) ; }


add the given background command to a queue that is processed after the main background command completes

public void schedule follow on command ( background command cmd , undoable domain object obj ) { task mgr schedule follow on command ( cmd , obj ) ; }


returns the current restrictions on pdb applicator processing

public pdb applicator restrictions get restrictions ( ) { return restrictions ; }


returns the empty map this map behaves and performs comparably to { @ link collections # empty map } , and is preferable mainly for consistency and maintainability of your code

public static < k , v > immutable map < k , v > of ( ) { return ( immutable map < k , v > ) regular immutable map empty ; }


public attributes get attributes ( ) { return attrs ; }


get the roll euler angle in degrees , which is the rotation around the z axis requires that this quaternion is normalized

public float get roll ( ) { return get roll rad ( ) * math utils radians to degrees ; }


partition sigma and execute the computations

private summation execute ( string name , summation sigma ) { final summation [ ] summations = sigma partition ( parameters n jobs ) ; final list < computation > computations = new array list < computation > ( ) ; for ( int i = 0 ; i < summations length ; i + + ) computations add ( new computation ( i , name , summations [ i ] ) ) ; try { util execute ( parameters n threads , computations ) ; } catch ( exception e ) { throw new runtime exception ( e ) ; } final list < summation > combined = util combine ( arrays as list ( summations ) ) ; return combined size ( ) = = 1 ? combined get ( 0 ) : null ; }


remove the blocks associated to the given datanode storage info

void remove blocks associated to ( final datanode storage info storage info ) { assert namesystem has write lock ( ) ; final iterator < block info > it = storage info get block iterator ( ) ; datanode descriptor node = storage info get datanode descriptor ( ) ; collection < block info > to remove = new array list < > ( ) ; while ( it has next ( ) ) { to remove add ( it next ( ) ) ; } for ( block info block : to remove ) { remove stored block ( block , node ) ; final block b = get block on storage ( block , storage info ) ; if ( b ! = null ) { invalidate blocks remove ( node , b ) ; } } check safe mode ( ) ; log info ( " removed blocks associated with storage { } from data node { } " , storage info , node ) ; }


sets the < code > name < code > property

public void set name ( integer name ) { this name = name ; }


public synchronized int position ( ) { return byte buffer position ( ) ; }


return the hex string of 3des encryption

public static string encrypt 3 d e s 2 hex string ( final byte [ ] data , final byte [ ] key , final string transformation , final byte [ ] iv ) { return utils bridge bytes 2 hex string ( encrypt 3 d e s ( data , key , transformation , iv ) ) ; }


returns all top level classes whose package name is { @ code package name } or starts with { @ code package name } followed by a ' '

public immutable set < class info > get top level classes recursive ( string package name ) { check not null ( package name ) ; string package prefix = package name + ' ' ; immutable set builder < class info > builder = immutable set builder ( ) ; for ( class info class info : get top level classes ( ) ) { if ( class info get name ( ) starts with ( package prefix ) ) { builder add ( class info ) ; } } return builder build ( ) ; }


public big decimal get prefix number ( ) { return prefix number ; }


if set to true , the gradient will repeat

public void set cyclic ( boolean cyclic ) { this cyclic = cyclic ; }


tries to read as many bytes as possible into supplied buffer , checksumming each chunk if needed < b > preconditions : < b > if checksumming is enabled , buf remaining must be a multiple of bytes per checksum note that this is not a requirement for clients of read ( byte buffer ) - in the case of non - checksum - sized read requests , read ( byte buffer ) will substitute a suitably sized buffer to pass to this method < b > postconditions : < b > buf limit and buf mark are unchanged buf position + = min ( offset from chunk boundary , total bytes read ) - so the requested bytes can be read straight from the buffer

private synchronized int do byte buffer read ( byte buffer buf ) throws i o exception { if ( verify checksum ) { assert buf remaining ( ) % bytes per checksum = = 0 ; } int data read ; int oldpos = buf position ( ) ; / / read as much as we can into the buffer data read = fill buffer ( data in , buf ) ; if ( data read = = - 1 ) { return - 1 ; } if ( verify checksum ) { byte buffer to checksum = buf duplicate ( ) ; to checksum position ( oldpos ) ; to checksum limit ( oldpos + data read ) ; checksum buff clear ( ) ; / / equivalent to / / ( int ) math ceil ( to checksum remaining ( ) * 1 0 / bytes per checksum ) ; int num chunks = ( to checksum remaining ( ) + bytes per checksum - 1 ) / bytes per checksum ; checksum buff limit ( checksum size * num chunks ) ; fill buffer ( checksum in , checksum buff ) ; checksum buff flip ( ) ; checksum verify chunked sums ( to checksum , checksum buff , filename , this start offset ) ; } if ( data read > = 0 ) { buf position ( oldpos + math min ( offset from chunk boundary , data read ) ) ; } if ( data read < offset from chunk boundary ) { / / yikes , didn ' t even get enough bytes to honour offset this can happen / / even if we are verifying checksums if we are at eof offset from chunk boundary - = data read ; data read = 0 ; } else { data read - = offset from chunk boundary ; offset from chunk boundary = 0 ; } return data read ; }


process the record note that record metadata is undefined in cases such as a forward call from a punctuator

void process ( record < k in , v in > record ) ;


finds the next zip file entry , by first invoking { @ link # next header from ( com google devtools build android ziputils directory entry ) } to find its header

public zip entry next from ( directory entry entry ) throws i o exception { int offset = entry = = null ? - 1 : entry get ( cenoff ) ; map entry < integer , directory entry > map entry = cdir map by offset ( ) higher entry ( offset ) ; if ( map entry = = null ) { return entry with ( null ) ; } local file header header = local header at ( map entry get key ( ) ) ; return entry with ( header , map entry get value ( ) ) ; }


return a variant of this { @ code method parameter } which refers to the given containing class

public method parameter with containing class ( @ nullable class < ? > containing class ) { method parameter result = clone ( ) ; result containing class = containing class ; result parameter type = null ; return result ; }


utility method to subtract a { @ link resource } from the { @ link resource utilization }

static void decrease resource utilization ( containers monitor containers monitor , resource utilization resource util , resource resource ) { float v cores = ( float ) resource get virtual cores ( ) ; int vmem = ( int ) ( resource get memory size ( ) * containers monitor get vmem ratio ( ) ) ; resource util subtract from ( ( int ) resource get memory size ( ) , vmem , v cores ) ; }


returns a reader for reading this file as characters @ throw gdx runtime exception if the file handle represents a directory , doesn ' t exist , or could not be read

public reader reader ( string charset ) { try { return new input stream reader ( read ( ) , charset ) ; } catch ( unsupported encoding exception e ) { throw new gdx runtime exception ( " encoding ' " + charset + " ' not supported " , e ) ; } }


returns the { @ link aggregation } s keyed by aggregation name

public final map < string , aggregation > as map ( ) { return get as map ( ) ; }


this test checks an edge case where , if a node had an index ( lets call it a with uuid 1 ) , then deleted it ( so a tombstone entry for a will exist in the cluster state ) , then created a new index a with uuid 2 , then shutdown , when the node comes back online , it will look at the tombstones for deletions , and it should proceed with trying to delete a with uuid 1 and not throw any errors that the index still exists in the cluster state this is a case of ensuring that tombstones that have the same name as current valid indices don ' t cause confusion by trying to delete an index that exists see https : github comelasticelasticsearchissues 1 8 0 5 4

public void test index and tombstone with same name on startup ( ) throws exception { final string index name = " test " ; final index index = new index ( index name , u u i ds random base 6 4 u u i d ( ) ) ; final indices service indices service = get indices service ( ) ; final settings idx settings = settings builder ( ) put ( index metadata setting version created , version current ) put ( index metadata setting index uuid , index get u u i d ( ) ) build ( ) ; final index metadata index metadata = new index metadata builder ( index get name ( ) ) settings ( idx settings ) number of shards ( 1 ) number of replicas ( 0 ) build ( ) ; final index tombstoned index = new index ( index name , u u i ds random base 6 4 u u i d ( ) ) ; final index graveyard graveyard = index graveyard builder ( ) add tombstone ( tombstoned index ) build ( ) ; final metadata metadata = metadata builder ( ) put ( index metadata , true ) index graveyard ( graveyard ) build ( ) ; final cluster state cluster state = new cluster state builder ( new cluster name ( " test cluster " ) ) metadata ( metadata ) build ( ) ; / / if all goes well , this won ' t throw an exception , otherwise , it will throw an illegal state exception indices service verify index is deleted ( tombstoned index , cluster state ) ; }


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 " ) ; }


gets the data type ( as a { @ link type information } ) produced by this function or input format

type information < t > get produced type ( ) ;


this test exercises the case where we invalidate ( mark dirty ) a node in one build command invocation and the revalidation ( because it did not change ) happens in a subsequent build command call - in the first update call we construct a - then we construct b and we make the glob get invalidated we do that by deleting a file because it depends on the directory listing because of that a gets invalidated - then we construct a again the glob gets revalidated because it is still matching just a java and a configured target gets revalidated too at the end of the analysis a java action should be in the action graph

public void test multi build invalidation revalidation ( ) throws exception { if ( default flags ( ) contains ( flag trimmed configurations ) ) { / / todo ( b / 129599328 ) : fix or justify disabling return ; } scratch file ( " java / a / a java " , " bla 1 " ) ; scratch file ( " java / a / c java " , " bla 2 " ) ; scratch file ( " java / a / build " , " java test ( name = ' a ' , " , " srcs = glob ( [ ' a * java ' ] ) ) " , " java test ( name = ' b ' , " , " srcs = [ ' b java ' ] ) " ) ; configured target ct = iterables get only element ( update ( " / / java / a : a " ) get targets to build ( ) ) ; scratch delete file ( " java / a / c java " ) ; update ( " / / java / a : b " ) ; update ( " / / java / a : a " ) ; assert that ( get generating action ( get bin artifact ( " a deploy jar " , ct ) ) ) is not null ( ) ; }


sets the name of the ship strategy for the represented input

public void set ship strategy name ( string ship strategy name ) { this ship strategy name = ship strategy name ; }


some don ' t propagate the server ' s parent id which creates a race condition try to unwind it see https : github comopenzipkinzipkinpull 1 7 4 5

@ test public void backfills missing parent id on shared span ( ) { list < span > trace = as list ( span ( " a " , null , " a " , kind server , " frontend " , null , false ) , span ( " a " , " a " , " b " , kind client , " frontend " , null , false ) , / / below the parent id is null as it wasn ' t propagated span ( " a " , null , " b " , kind server , " backend " , null , true ) ) ; assert that ( trace merge ( trace ) ) using field by field element comparator ( ) contains exactly in any order ( span ( " a " , null , " a " , kind server , " frontend " , null , false ) , span ( " a " , " a " , " b " , kind client , " frontend " , null , false ) , span ( " a " , " a " , " b " , kind server , " backend " , null , true ) ) ; }


inserts the specified element at the end of this queue this method is equivalent to { @ link # offer }

public boolean add ( e e ) { if ( e = = null ) throw new null pointer exception ( " e = = null " ) ; elements [ tail ] = e ; if ( ( tail = ( tail + 1 ) & ( elements length - 1 ) ) = = head ) double capacity ( ) ; return true ; }


set to true if the request should be validated without creating new partitions

public create partitions options validate only ( boolean validate only ) { this validate only = validate only ; return this ; }


handler for out of memory events - no attempt is made here to cleanly shutdown or support halt blocking ; a robust printing of the event to stderr is all that can be done

public static void halt on out of memory ( out of memory error oome ) { / / after catching an oom java says it is undefined behavior , so don ' t / / even try to clean up or we can get stuck on shutdown try { system err println ( " halting due to out of memory error " ) ; } catch ( throwable err ) { / / again we done want to exit because of logging issues } runtime get runtime ( ) halt ( - 1 ) ; }


make sure we have ' need ' elements from current position { @ link # p p } last valid { @ code p } index is { @ code tokens length - 1 } { @ code p + need - 1 } is the tokens index ' need ' elements ahead if we need 1 element , { @ code ( p + 1 - 1 ) = = p } must be less than { @ code tokens length }

protected void sync ( int want ) { int need = ( p + want - 1 ) - n + 1 ; / / how many more elements we need ? if ( need > 0 ) { fill ( need ) ; } }


lookup returns a target for a single key

public io grpc lookup v 1 route lookup response route lookup ( io grpc lookup v 1 route lookup request request ) { return io grpc stub client calls blocking unary call ( get channel ( ) , get route lookup method ( ) , get call options ( ) , request ) ; }


creates a new named mock authentication handler that either successfully validates all credentials or fails to validate all credentials

private static authentication handler new mock handler ( final string name , final boolean success , final boolean error ) { val mock = mock ( authentication handler class ) ; when ( mock get name ( ) ) then return ( name ) ; when ( mock supports ( any ( credential class ) ) ) then return ( true ) ; if ( success ) { val p = principal factory utils new principal factory ( ) create principal ( " nobody " ) ; val result = new default authentication handler execution result ( mock , mock ( credential meta data class ) , p ) ; when ( mock authenticate ( any ( credential class ) ) ) then return ( result ) ; } else if ( ! error ) { when ( mock authenticate ( any ( credential class ) ) ) then throw ( new failed login exception ( ) ) ; } else { when ( mock authenticate ( any ( credential class ) ) ) then throw ( new prevented exception ( " failure " ) ) ; } return mock ; }


perform the least expensive check for a pointcut match

public static boolean matches ( pointcut pointcut , method method , class < ? > target class , object args ) { assert not null ( pointcut , " pointcut must not be null " ) ; if ( pointcut = = pointcut true ) { return true ; } if ( pointcut get class filter ( ) matches ( target class ) ) { / / only check if it gets past first hurdle method matcher mm = pointcut get method matcher ( ) ; if ( mm matches ( method , target class ) ) { / / we may need additional runtime ( argument ) check return ( ! mm is runtime ( ) | | mm matches ( method , target class , args ) ) ; } } return false ; }


convenience method to set the material , mesh , mesh part offset , mesh part size , primitive type and bones members of the specified renderable the other member of the provided { @ link renderable } remain untouched note that the material , mesh and bones members are referenced , not copied any changes made to those objects will be reflected in both the node part and renderable object

public renderable set renderable ( final renderable out ) { out material = material ; out mesh part set ( mesh part ) ; out bones = bones ; return out ; }


construct a client - side proxy that implements the named protocol , talking to a server at the named address

public static < t > t get proxy ( class < t > protocol , long client version , inet socket address addr , user group information ticket , configuration conf , socket factory factory , int rpc timeout ) throws i o exception { return get protocol proxy ( protocol , client version , addr , ticket , conf , factory , rpc timeout , null ) get proxy ( ) ; }


public void set description ( @ nullable string description ) { this description = description ; }


protected boolean combine ( object [ ] srcs , tuple writable dst ) { assert srcs length = = dst size ( ) ; return true ; }


< code > optional aapt pb string str = 2 ; < code >

public com android aapt resources string get str ( ) { return str = = null ? com android aapt resources string get default instance ( ) : str ; }


defines the correct { @ link image transcoder } if a custom { @ link image transcoder } was define in the config , it will be used whenever possible else , if the native code is disabled it uses { @ link simple image transcoder factory } otherwise { @ link multi image transcoder factory } determines the { @ link image transcoder } to use based on the image format

private image transcoder factory get image transcoder factory ( ) { if ( m image transcoder factory = = null ) { if ( m config get image transcoder factory ( ) = = null & & m config get image transcoder type ( ) = = null & & m config get experiments ( ) is native code disabled ( ) ) { m image transcoder factory = new simple image transcoder factory ( m config get experiments ( ) get max bitmap size ( ) ) ; } else { m image transcoder factory = new multi image transcoder factory ( m config get experiments ( ) get max bitmap size ( ) , m config get experiments ( ) get use downsampling ratio for resizing ( ) , m config get image transcoder factory ( ) , m config get image transcoder type ( ) , m config get experiments ( ) is ensure transcoder library loaded ( ) ) ; } } return m image transcoder factory ; }


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 api response < void > delete order with http info ( string order id ) throws api exception { okhttp 3 call local var call = delete order validate before call ( order id , null ) ; return local var api client execute ( local var call ) ; }


return the embedded constant of the given opcode , or 0 if the opcode doesn ' t have one

private static int embedded constant ( byte opcode ) { switch ( opcode ) { case instruction constants op iconst m1 : return - 1 ; case instruction constants op iconst 1 : case instruction constants op lconst 1 : case instruction constants op fconst 1 : case instruction constants op dconst 1 : return 1 ; case instruction constants op iconst 2 : case instruction constants op fconst 2 : return 2 ; case instruction constants op iconst 3 : return 3 ; case instruction constants op iconst 4 : return 4 ; case instruction constants op iconst 5 : return 5 ; default : return 0 ; } }


static set < function template > find result mapping templates ( set < function template > global templates , set < function template > local templates , function < function template , function result template > accessor ) { return stream concat ( global templates stream ( ) , local templates stream ( ) ) filter ( t - > t get signature template ( ) ! = null & & accessor apply ( t ) ! = null ) collect ( collectors to collection ( linked hash set : : new ) ) ; }


returns true if apple binary targets should generate and link objc protos

public boolean enable apple binary native protos ( ) { return enable apple binary native protos ; }


public integer get prefix integer ( ) { return prefix integer ; }


the { @ code to string ( ) } of { @ link component } implementations appear in health check endpoints since these are likely to be exposed in logs and other monitoring tools , care should be taken to ensure { @ code to string ( ) } output is a reasonable length and does not contain sensitive information

@ test void to string contains only summary information ( ) { assert that ( storage ) has to string ( string format ( " elasticsearch storage { initial endpoints = % s , index = zipkin } " , server http uri ( ) ) ) ; }


returns a list of parameters defined within the original beffer file

string [ ] get old parameter names ( ) { array list < string > list = new array list < string > ( ) ; enumeration < string > it = orig parms keys ( ) ; while ( it has more elements ( ) ) { string name = it next element ( ) ; list add ( name ) ; } string [ ] names = new string [ list size ( ) ] ; list to array ( names ) ; return names ; }


validate that all states can be correctly registered at the registry

public void test registry normal ( ) { shared state registry shared state registry = new shared state registry ( ) ; / / register one state test shared state first state = new test shared state ( " first " ) ; shared state registry result result = shared state registry register reference ( first state get registration key ( ) , first state ) ; assert equals ( 1 , result get reference count ( ) ) ; assert true ( first state = = result get reference ( ) ) ; assert false ( first state is discarded ( ) ) ; / / register another state test shared state second state = new test shared state ( " second " ) ; result = shared state registry register reference ( second state get registration key ( ) , second state ) ; assert equals ( 1 , result get reference count ( ) ) ; assert true ( second state = = result get reference ( ) ) ; assert false ( first state is discarded ( ) ) ; assert false ( second state is discarded ( ) ) ; / / attempt to register state under an existing key test shared state first state prime = new test shared state ( first state get registration key ( ) get key string ( ) ) ; result = shared state registry register reference ( first state get registration key ( ) , first state prime ) ; assert equals ( 2 , result get reference count ( ) ) ; assert false ( first state prime = = result get reference ( ) ) ; assert true ( first state = = result get reference ( ) ) ; assert true ( first state prime is discarded ( ) ) ; assert false ( first state is discarded ( ) ) ; / / reference the first state again result = shared state registry register reference ( first state get registration key ( ) , first state ) ; assert equals ( 3 , result get reference count ( ) ) ; assert true ( first state = = result get reference ( ) ) ; assert false ( first state is discarded ( ) ) ; / / unregister the second state result = shared state registry unregister reference ( second state get registration key ( ) ) ; assert equals ( 0 , result get reference count ( ) ) ; assert true ( result get reference ( ) = = null ) ; assert true ( second state is discarded ( ) ) ; / / unregister the first state result = shared state registry unregister reference ( first state get registration key ( ) ) ; assert equals ( 2 , result get reference count ( ) ) ; assert true ( first state = = result get reference ( ) ) ; assert false ( first state is discarded ( ) ) ; }


deprecated use ` fill get gradient colors ( ) `

public int get end color ( ) { return get gradient colors ( ) [ 1 ] ; }


adds arguments to the list of arguments to pass to the command the first argument is expected to be the binary to execute the subsequent arguments are the arguments passed to the binary

builder add arguments ( list < string > args ) { this args add all ( args ) ; return this ; }


util for get a { @ link partition writer factory }

static < t > partition writer factory < t > get ( boolean dynamic partition , boolean grouped , linked hash map < string , string > static partitions ) { if ( dynamic partition ) { return grouped ? grouped partition writer : : new : dynamic partition writer : : new ; } else { return ( partition writer factory < t > ) ( context , manager , computer ) - > new single directory writer < > ( context , manager , computer , static partitions ) ; } }


returns dummy factory arguments that are equal to { @ code args } but may be different instances , to be used to construct a second instance of the same equality group

private list < object > generate equal factory arguments ( invokable < ? , ? > factory , list < parameter > params , list < object > args ) throws parameter not instantiable exception , factory method returns null exception , invocation target exception , illegal access exception { list < object > equal args = lists new array list ( args ) ; for ( int i = 0 ; i < args size ( ) ; i + + ) { parameter param = params get ( i ) ; object arg = args get ( i ) ; / / use new fresh value generator because ' args ' were populated with new fresh generator each / / two new fresh value generator ( ) instances should normally generate equal value sequence object should be equal arg = generate dummy arg ( param , new fresh value generator ( ) ) ; if ( arg ! = should be equal arg & & objects equal ( arg , should be equal arg ) & & hash code insensitive to arg reference ( factory , args , i , should be equal arg ) & & hash code insensitive to arg reference ( factory , args , i , generate dummy arg ( param , new fresh value generator ( ) ) ) ) { / / if the implementation uses identity hash code ( ) , referential equality is / / probably intended so no point in using an equal - but - different factory argument / / we check twice to avoid confusion caused by accidental hash collision equal args set ( i , should be equal arg ) ; } } return equal args ; }


set the { @ link class filter } to use for this pointcut default is { @ link class filter # true }

public void set class filter ( class filter class filter ) { this class filter = class filter ; }


attach this context , thus enter a new scope within which this context is { @ link # current } the previously current context is returned it is allowed to attach contexts where { @ link # is cancelled ( ) } is { @ code true } instead of using { @ code attach ( ) } and { @ link # detach ( context ) } most use - cases are better served by using the { @ link # run ( runnable ) } or { @ link # call ( java util concurrent callable ) } to execute work immediately within a context ' s scope if work needs to be done in other threads it is recommended to use the ' wrap ' methods or to use a propagating executor all calls to { @ code attach ( ) } should have a corresponding { @ link # detach ( context ) } within the same method : { @ code context previous = some context attach ( ) ; try { do work } finally { some context detach ( previous ) ; } }

public context attach ( ) { context prev = storage ( ) do attach ( this ) ; if ( prev = = null ) { return root ; } return prev ; }


public single < order > rx place order ( order body , api client auth info auth info ) { return single create ( new io vertx rx java single on subscribe adapter < > ( fut - > delegate place order ( body , auth info , fut ) ) ) ; }


create a variant of { @ link java util properties } that sorts properties alphanumerically based on their keys this can be useful when storing the { @ link properties } instance in a properties file , since it allows such files to be generated in a repeatable manner with consistent ordering of properties comments in generated properties files can also be optionally omitted

public static properties create sorted properties ( boolean omit comments ) { return new sorted properties ( omit comments ) ; }


configures a friendly name for the generator this will be used by the generator to select the library with the - g flag

public string get name ( ) { return " haskell " ; }


executes the given flush request against the engine

public void flush ( flush request request ) { final boolean wait if ongoing = request wait if ongoing ( ) ; final boolean force = request force ( ) ; logger trace ( " flush with { } " , request ) ; / * * we allow flushes while recovery since we allow operations to happen while recovering and we want to keep the translog under * control ( up to deletes , which we do not gc ) yet , we do not use flush internally to clear deletes and flush the index writer * since we use engine # write indexing buffer for this now * / verify not closed ( ) ; final long time = system nano time ( ) ; get engine ( ) flush ( force , wait if ongoing ) ; flush metric inc ( system nano time ( ) - time ) ; }


register necessary component to distro protocol for http implement

public void do register ( ) { component holder register data storage ( key builder instance list key prefix , new distro data storage impl ( data store , distro mapper ) ) ; component holder register transport agent ( key builder instance list key prefix , new distro http agent ( member manager ) ) ; component holder register failed task handler ( key builder instance list key prefix , new distro http combined key task failed handler ( global config , task engine holder ) ) ; task engine holder register nacos task processor ( key builder instance list key prefix , new distro http delay task processor ( global config , task engine holder ) ) ; component holder register data processor ( consistency service ) ; }


overridable helper method to simply call sock connect ( ) this can be overriden in tests to fake connection successfailure for connect to leader

protected void sock connect ( socket sock , inet socket address addr , int timeout ) throws i o exception { sock connect ( addr , timeout ) ; }


get a new unique { @ link reservation id }

reservation id get new reservation id ( ) ;


public string get charset name ( ) { return charset name ; }


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 " ) ; }


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


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


public enum number enum get enum number ( ) { return enum number ; }


extract from http servlet request the media type in output

protected static < t > string get media type from http servlet request ( http servlet request request , final class < t > return type ) { if ( request = = null ) { / / by default we return xml for rest call without http servlet request return media type application xml ; } / / todo if ( ! return type equals ( response class ) ) { return media type application xml ; } string header = request get header ( http headers accept ) ; if ( header = = null | | header equals ( " * " ) ) { / / by default we return json return media type application json ; } return header ; }


to test \ & quot ; client \ & quot ; model to test \ & quot ; client \ & quot ; model

public void test client model test ( ) throws api exception { client client = null ; client response = api test client model ( client ) ; / / todo : test validations }


opens an f s data input stream at the indicated path

public f s data input stream open ( path f , int buffer size ) throws i o exception , unresolved link exception { return new f s data input stream ( new checksum f s input checker ( this , f , buffer size ) ) ; }


controlleraction : args = > [ controlleraction , controller , action , args ] controller : args = > [ controller , controller , index , args ]

static list < string > parse route ( string path spec ) { list < string > result = lists new array list ( ) ; result add ( get prefix ( check not null ( path spec , " path spec " ) ) ) ; iterable < string > parts = path splitter split ( path spec ) ; string controller = null , action = null ; for ( string s : parts ) { if ( controller = = null ) { if ( s char at ( 0 ) = = ' : ' ) { controller = " default " ; result add ( controller ) ; action = " index " ; result add ( action ) ; } else { controller = s ; } } else if ( action = = null ) { if ( s char at ( 0 ) = = ' : ' ) { action = " index " ; result add ( action ) ; } else { action = s ; } } result add ( s ) ; } if ( controller = = null ) { result add ( " default " ) ; } if ( action = = null ) { result add ( " index " ) ; } return result ; }


delete user this can only be done by the logged in user < b > 400 < b > - invalid username supplied < b > 404 < b > - user not found

public void delete user ( string username ) throws i o exception { delete user for http response ( username ) ; }


discard all editlog segments whose first txid is greater than or equal to the given txid , by renaming them with suffix " trash "

private void discard edit log segments ( long start tx id ) throws i o exception { file current dir = sd get current dir ( ) ; list < edit log file > all log files = match edit logs ( current dir ) ; list < edit log file > to trash = lists new array list ( ) ; log info ( " discard the edit log files , the given start txid is " + start tx id ) ; / / go through the editlog files to make sure the start tx id is right at the / / segment boundary for ( edit log file elf : all log files ) { if ( elf get first tx id ( ) > = start tx id ) { to trash add ( elf ) ; } else { preconditions check state ( elf get last tx id ( ) < start tx id ) ; } } for ( edit log file elf : to trash ) { / / rename these editlog file as trash elf move aside trash file ( start tx id ) ; log info ( " trash the edit log file " + elf ) ; } }


overridable validation step for the policy configuration

public void validate ( weighted policy info new policy info ) throws federation policy initialization exception { if ( new policy info = = null ) { throw new federation policy initialization exception ( " the policy to " + " validate should not be null " ) ; } }


starts async disk service for a new volume

synchronized void add volume ( fs volume impl volume ) { if ( executors = = null ) { throw new runtime exception ( " async disk service is already shutdown " ) ; } if ( volume = = null ) { throw new runtime exception ( " attempt to add a null volume " ) ; } thread pool executor executor = executors get ( volume get storage i d ( ) ) ; if ( executor ! = null ) { throw new runtime exception ( " volume " + volume + " is already existed " ) ; } add executor for volume ( volume ) ; }


set the list of java classes to be recognized by a newly created j a x b context setting either this property , { @ link # set context path " context path " } or { @ link # set packages to scan " packages to scan " } is required

public void set classes to be bound ( @ nullable class < ? > classes to be bound ) { this classes to be bound = classes to be bound ; }


specify the custom scopes that are to be registered the keys indicate the scope names ( of type string ) ; each value is expected to be the corresponding custom { @ link scope } instance or class name

public void set scopes ( map < string , object > scopes ) { this scopes = scopes ; }


public get snapshots request repositories ( string repositories ) { this repositories = repositories ; return this ; }


teardown deletes the objects created before the superclass does the directory cleanup

public void teardown ( ) throws exception { if ( s 3client ! = null ) { delete object ( marker key ) ; delete object ( marker key slash ) ; delete object ( marker peer key ) ; delete object ( file key under marker ) ; } / / do this ourselves to avoid audits teardown failing / / when surplus markers are found delete test dir in teardown ( ) ; super teardown ( ) ; }


public void array item test ( ) { / / todo : test array item }


this method will delegate to the { @ link section } spec method annotated with { @ link on data rendered }

protected void data rendered ( section context c , boolean is data changed , boolean is mounted , long uptime millis , int first visible index , int last visible index , changes info changes info , int global offset ) { }


create a set with all ints within range [ a b ] ( inclusive )

public static interval set of ( int a , int b ) { interval set s = new interval set ( ) ; s add ( a , b ) ; return s ; }


verify if current router state is safe mode

get safe mode response get safe mode ( get safe mode request request ) throws i o exception ;


a filter for iterable < ? extends has file type > that returns only those of the specified file type

public static < t extends has file type > iterable < t > filter ( final iterable < t > items , file type file type ) { return iterables filter ( items , type matching predicate for ( file type ) ) ; }


execute all publishers even one of publishers return false

public void test freestyle with false publisher ( ) throws exception { free style project p = j create free style project ( ) ; p get publishers list ( ) add ( new true false publisher ( true ) ) ; / / noop p get publishers list ( ) add ( new true false publisher ( false ) ) ; / / fail build with false p get publishers list ( ) add ( new result writer publisher ( " result txt " ) ) ; / / catch result to file final artifact archiver artifact archiver = new artifact archiver ( " result txt " ) ; artifact archiver set only if successful ( false ) ; p get publishers list ( ) add ( artifact archiver ) ; / / transfer file to build dir free style build b = p schedule build 2 ( 0 ) get ( ) ; assert equals ( " build must fail , because we used false publisher " , b get result ( ) , result failure ) ; file file = new file ( b get artifacts dir ( ) , " result txt " ) ; assert true ( " artifact archiver is executed even prior publisher fails " , file exists ( ) ) ; assert equals ( " publisher , after publisher with return false status , must see failure status " , file utils read file to string ( file ) , result failure to string ( ) ) ; }


public string connection string ( ) { return connection string ; }


public int show set dialog ( ) { result = canceled ; overwrite existing equates set visible ( true ) ; set title ( " set equate " ) ; tool show dialog ( this ) ; return result ; }


whether the underlying operation is deferred and needs to be started explicitly , e g via subscribing ( or similar ) , or whether it is triggered without the consumer having any control

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


returns whether to preserve the rollup jobs of this test defaults to not preserving them only runs at all if xpack is installed on the cluster being tested

protected boolean preserve rollup jobs upon completion ( ) { return false ; }


indicates whether this domain name ends in a { @ linkplain # is registry suffix ( ) registry suffix } , while not being a registry suffix itself for example , returns { @ code true } for { @ code www google com } , { @ code foo co uk } and { @ code blogspot com } , but not for { @ code com } , { @ code co uk } , or { @ code google invalid }

public boolean is under registry suffix ( ) { return registry suffix index > 0 ; }


tests the registration of the checkpoint metrics

public void test metrics registration ( ) throws exception { final collection < string > registered gauge names = new array list < > ( ) ; metric group metric group = new unregistered metrics group ( ) { @ override public < t , g extends gauge < t > > g gauge ( string name , g gauge ) { if ( gauge ! = null ) { registered gauge names add ( name ) ; } return gauge ; } } ; execution job vertex job vertex = mock ( execution job vertex class ) ; when ( job vertex get job vertex id ( ) ) then return ( new job vertex i d ( ) ) ; when ( job vertex get parallelism ( ) ) then return ( 1 ) ; new checkpoint stats tracker ( 0 , collections singleton list ( job vertex ) , mock ( checkpoint coordinator configuration class ) , metric group ) ; / / make sure this test is adjusted when further metrics are added assert true ( registered gauge names contains all ( arrays as list ( checkpoint stats tracker number of checkpoints metric , checkpoint stats tracker number of in progress checkpoints metric , checkpoint stats tracker number of completed checkpoints metric , checkpoint stats tracker number of failed checkpoints metric , checkpoint stats tracker latest restored checkpoint timestamp metric , checkpoint stats tracker latest completed checkpoint size metric , checkpoint stats tracker latest completed checkpoint duration metric , checkpoint stats tracker latest completed checkpoint processed data metric , checkpoint stats tracker latest completed checkpoint persisted data metric , checkpoint stats tracker latest completed checkpoint external path metric ) ) ) ; assert equals ( 10 , registered gauge names size ( ) ) ; }


e decorate ( simple adapter < e > decoratee , int position ) ;


inspect initial headers to make sure they conform to http and g r p c , returning a { @ code status } on failure

private status validate initial metadata ( metadata headers ) { integer http status = headers get ( http2 status ) ; if ( http status = = null ) { return status internal with description ( " missing http status code " ) ; } string content type = headers get ( grpc util content type key ) ; if ( ! grpc util is grpc content type ( content type ) ) { return grpc util http status to grpc status ( http status ) augment description ( " invalid content - type : " + content type ) ; } return null ; }


notifies the header that an action was removed

void action removed ( docking action if action ) { header action removed ( action ) ; }


register the processors for the spring annotation - driven features

private void register annotation config processors ( bean definition registry registry ) { annotation config utils register annotation config processors ( registry ) ; }


removes a single instance of the specified element from this queue if the queue does not contain the element , it is unchanged more formally , removes the first element < tt > e < tt > such that < tt > o equals ( e ) < tt > ( if such an element exists ) returns < tt > true < tt > if this queue contained the specified element ( or equivalently , if this queue changed as a result of the call )

public boolean remove ( object o ) { if ( o = = null ) return false ; int mask = elements length - 1 ; int i = head ; object x ; while ( ( x = elements [ i ] ) ! = null ) { if ( o equals ( x ) ) { delete ( i ) ; return true ; } i = ( i + 1 ) & mask ; } return false ; }


concatenate two string arrays into a third

public static string [ ] concat string arrays ( string [ ] first , string [ ] second ) { if ( first = = null & & second = = null ) { return strings empty array ; } if ( first = = null | | first length = = 0 ) { return second ; } if ( second = = null | | second length = = 0 ) { return first ; } string [ ] concat = new string [ first length + second length ] ; system arraycopy ( first , 0 , concat , 0 , first length ) ; system arraycopy ( second , 0 , concat , first length , second length ) ; return concat ; }


deregister the { @ link channel } of the { @ link channel promise } from { @ link event loop } and notify the { @ link channel promise } once the operation was complete

void deregister ( channel promise promise ) ;


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

public static form validation validate file mask ( @ check for null file path path , string value ) throws i o exception { return file path validate file mask ( path , value , true ) ; }


public void test cat all of ( ) { / / todo : test cat all of }


invoke the specified validators , if any

public void validate ( ) { object target = get target ( ) ; assert state ( target ! = null , " no target to validate " ) ; binding result binding result = get binding result ( ) ; / / call each validator with the same binding result for ( validator validator : get validators ( ) ) { validator validate ( target , binding result ) ; } }


public void set orientation ( vector 2 orientation ) { this vals [ cos ] = orientation x ; this vals [ sin ] = orientation y ; }


public static node api versions create ( collection < api version > overrides ) { list < api version > api versions = new linked list < > ( overrides ) ; for ( api keys api key : api keys enabled apis ( ) ) { boolean exists = false ; for ( api version api version : api versions ) { if ( api version api key = = api key id ) { exists = true ; break ; } } if ( ! exists ) { api versions add ( new api version ( api key ) ) ; } } return new node api versions ( api versions ) ; }


extracts the subscription from the notification object

public static subscription get subscription ( object o ) { return ( ( subscription notification ) o ) upstream ; }


checks , whether the given number of bytes for a normalized is only a prefix to determine the order of elements of the data type for which this comparator provides the comparison methods for example , if the data type is ordered with respect to an integer value it contains , then this method would return true , if the number of key bytes is smaller than four

public abstract boolean is normalized key prefix only ( int key bytes ) ;


public byte [ ] get source as bytes ( ) { return get result source ( ) ; }


adds a node to this node ' s children at the given index and notifies the tree must be called from the swing thread

protected synchronized void do add node ( int index , g tree node node ) { list < g tree node > kids = children ( ) ; if ( kids contains ( node ) ) { return ; } int insert index = math min ( kids size ( ) , index ) ; kids add ( insert index , node ) ; node set parent ( ( g tree node ) this ) ; do fire node added ( node ) ; }


notification that the g task manager has been suspended or resumed

public void suspended state changed ( boolean suspended ) ;


projects a pair of joined elements to a { @ link tuple } with the previously selected fields requires the classes of the fields of the resulting tuples


when the credentials bear a principal , succeed the authentication

public void verify non null principal ( ) { val credentials = new principal bearing credential ( principal factory utils new principal factory ( ) create principal ( " scott " ) ) ; assert not null ( this handler authenticate ( credentials ) ) ; }


whether all files of interest should be treated as potentially modified

public boolean treat everything as modified ( ) { return modified = = null ; }


get the progress mechanism for reporting progress

public progressable get progressible ( ) { return progress ; }


get the current length of the segment attached to body 1

public float get length 1 ( ) { return jni get length 1 ( addr ) ; }


set the timeout in milliseconds for this operation or { @ code null } if the default api timeout for the admin client should be used

public delete topics options timeout ms ( integer timeout ms ) { this timeout ms = timeout ms ; return this ; }


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

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


create an { @ link in memory sorter } instance with the given memory segments

in memory sorter < t > create ( list < memory segment > sort segments ) ;


parse the string representation of this shard id back to an object we lose index uuid information here , but since we use to string in rest responses , this is the best we can do to reconstruct the object on the client side

public static shard id from string ( string shard id string ) { int split position = shard id string index of ( " ] [ " ) ; if ( split position < = 0 | | shard id string char at ( 0 ) ! = ' [ ' | | shard id string char at ( shard id string length ( ) - 1 ) ! = ' ] ' ) { throw new illegal argument exception ( " unexpected shard id string format , expected [ index name ] [ shard id ] but got " + shard id string ) ; } string index name = shard id string substring ( 1 , split position ) ; int shard id = integer parse int ( shard id string substring ( split position + 2 , shard id string length ( ) - 1 ) ) ; return new shard id ( new index ( index name , index metadata index uuid na value ) , shard id ) ; }


mark a block as " suspect " this means that we should try to rescan it soon note that the volume scanner keeps a list of recently suspicious blocks , which it uses to avoid rescanning the same block over and over in a short time frame

synchronized void mark suspect block ( string storage id , extended block block ) { if ( ! is enabled ( ) ) { log debug ( " not scanning suspicious block { } on { } , because the block " + " scanner is disabled " , block , storage id ) ; return ; } volume scanner scanner = scanners get ( storage id ) ; if ( scanner = = null ) { / / this could happen if the volume is in the process of being removed / / the removal process shuts down the volume scanner , but the volume / / object stays around as long as there are references to it ( which / / should not be that long ) log info ( " not scanning suspicious block { } on { } , because there is no " + " volume scanner for that storage id " , block , storage id ) ; return ; } scanner mark suspect block ( block ) ; }


if " expected sublist " is not a sublist of " arguments " , an informative assertion is failed in the context of the specified test case argument order mnemonic : assert ( x ) contains sublist ( y )

public static < t > void assert contains sublist ( list < t > arguments , t expected sublist ) { list < t > sublist = arrays as list ( expected sublist ) ; try { assert that ( collections index of sub list ( arguments , sublist ) ) is not equal to ( - 1 ) ; } catch ( assertion error e ) { throw new assertion error ( " did not find " + sublist + " as a sublist of " + arguments , e ) ; } }


register a { @ link view resolver composite } that contains a chain of view resolvers to use for view resolution by default this resolver is ordered at 0 unless content negotiation view resolution is used in which case the order is raised to { @ link org springframework core ordered # highest precedence ordered highest precedence } if no other resolvers are configured , { @ link view resolver composite # resolve view name ( string , locale ) } returns null in order to allow other potential { @ link view resolver } beans to resolve views

public view resolver mvc view resolver ( @ qualifier ( " mvc content negotiation manager " ) content negotiation manager content negotiation manager ) { view resolver registry registry = new view resolver registry ( content negotiation manager , this application context ) ; configure view resolvers ( registry ) ; if ( registry get view resolvers ( ) is empty ( ) & & this application context ! = null ) { string [ ] names = bean factory utils bean names for type including ancestors ( this application context , view resolver class , true , false ) ; if ( names length = = 1 ) { registry get view resolvers ( ) add ( new internal resource view resolver ( ) ) ; } } view resolver composite composite = new view resolver composite ( ) ; composite set order ( registry get order ( ) ) ; composite set view resolvers ( registry get view resolvers ( ) ) ; if ( this application context ! = null ) { composite set application context ( this application context ) ; } if ( this servlet context ! = null ) { composite set servlet context ( this servlet context ) ; } return composite ; }


returns a { @ link bytes reference } view of the data

public bytes reference bytes ( ) { if ( bytes = = null ) { bytes = new bytes array ( text get bytes ( standard charsets utf 8 ) ) ; } return bytes ; }


sets the { @ code output dir } and returns a reference to this builder so that the methods can be chained together

public builder with output dir ( string output dir ) { if ( output dir ! = null ) { this output dir = paths get ( output dir ) to absolute path ( ) to string ( ) ; } else { this output dir = default output dir ; } return this ; }


increases the reference count by { @ code 1 }


invoked immediately following import allow byte processing prior to control structure identification note : this method will only be invoked once during the first test setup for all test binaries found this method will not be invoked during subsequent tests since the analyzed program will be cached

protected void post import ( program program ) throws exception { / / optional : may be implemented by test }


gets the accessibility content description


default health check metrics create health checker gauge ( string name , metrics tag keys tag keys , metrics tag values tag values ) { preconditions check argument ( ! strings is null or empty ( name ) , " require non - null or empty metric name " ) ; return new health check metrics ( create gauge ( strings lenient format ( " % s % s " , health metric prefix , name ) , strings lenient format ( " % s health check " , name ) , tag keys , tag values ) ) ; }


public int compare to ( v long writable o ) { long this value = this value ; long that value = o value ; return ( this value < that value ? - 1 : ( this value = = that value ? 0 : 1 ) ) ; }


given a list of delete requests , convert them all to keypaths

public list < key path > keys to key paths ( final collection < delete objects request key version > keys to delete ) { return convert to key paths ( keys to delete , get store context ( ) : : key to path ) ; }


implementation of the actual value retrieval will return the value on success , an exception on failure , a cancellation on cancellation , or an illegal state if the synchronizer is in an invalid state

private v get value ( ) throws cancellation exception , execution exception { int state = get state ( ) ; switch ( state ) { case completed : if ( exception ! = null ) { throw new execution exception ( exception ) ; } else { return value ; } case cancelled : case interrupted : throw cancellation exception with cause ( " task was cancelled " , exception ) ; default : throw new illegal state exception ( " error , synchronizer in invalid state : " + state ) ; } }


test that the sort builder nested object gets created in the sort field

public void test build nested ( ) throws i o exception { query shard context shard context mock = create mock shard context ( ) ; field sort builder sort builder = new field sort builder ( " field name " ) set nested sort ( new nested sort builder ( " path " ) set filter ( query builders term query ( mapped string fieldname , " value " ) ) ) ; sort field sort field = sort builder build ( shard context mock ) field ; assert that ( sort field get comparator source ( ) , instance of ( x field comparator source class ) ) ; x field comparator source comparator source = ( x field comparator source ) sort field get comparator source ( ) ; nested nested = comparator source nested ( ) ; assert not null ( nested ) ; assert equals ( new term query ( new term ( mapped string fieldname , " value " ) ) , nested get inner query ( ) ) ; nested sort builder nested sort = new nested sort builder ( " path " ) ; sort builder = new field sort builder ( " field name " ) set nested sort ( nested sort ) ; sort field = sort builder build ( shard context mock ) field ; assert that ( sort field get comparator source ( ) , instance of ( x field comparator source class ) ) ; comparator source = ( x field comparator source ) sort field get comparator source ( ) ; nested = comparator source nested ( ) ; assert not null ( nested ) ; assert equals ( new term query ( new term ( nested path field mapper name , " path " ) ) , nested get inner query ( ) ) ; nested sort set filter ( query builders term query ( mapped string fieldname , " value " ) ) ; sort builder = new field sort builder ( " field name " ) set nested sort ( nested sort ) ; sort field = sort builder build ( shard context mock ) field ; assert that ( sort field get comparator source ( ) , instance of ( x field comparator source class ) ) ; comparator source = ( x field comparator source ) sort field get comparator source ( ) ; nested = comparator source nested ( ) ; assert not null ( nested ) ; assert equals ( new term query ( new term ( mapped string fieldname , " value " ) ) , nested get inner query ( ) ) ; }


model tests for mixed properties and additional properties class

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


instantiate and invoke all registered bean factory post processor beans , respecting explicit order if given must be called before singleton instantiation

protected void invoke bean factory post processors ( configurable listable bean factory bean factory ) { post processor registration delegate invoke bean factory post processors ( bean factory , get bean factory post processors ( ) ) ; / / detect a load time weaver and prepare for weaving , if found in the meantime / / ( e g through an @ bean method registered by configuration class post processor ) if ( ! in native image & & bean factory get temp class loader ( ) = = null & & bean factory contains bean ( load time weaver bean name ) ) { bean factory add bean post processor ( new load time weaver aware processor ( bean factory ) ) ; bean factory set temp class loader ( new context type match class loader ( bean factory get bean class loader ( ) ) ) ; } }


indicate whether the field was created during the process or not

public boolean field was initialized ( ) { return was initialized ; }


public static string empty to null ( @ nullable string input ) { if ( input = = null | | input is empty ( ) ) { return null ; } return input ; }


in this case the introduction will be made

void introduction on target not implementing interface ( ) { not lockable not lockable target = new not lockable ( ) ; assert that ( not lockable target instanceof lockable ) is false ( ) ; not lockable not lockable 1 = ( not lockable ) create proxy ( not lockable target , get fixture ( ) get advisors ( new singleton metadata aware aspect instance factory ( new make lockable ( ) , " some bean " ) ) , not lockable class ) ; assert that ( not lockable 1 instanceof lockable ) is true ( ) ; lockable lockable = ( lockable ) not lockable 1 ; assert that ( lockable locked ( ) ) is false ( ) ; lockable lock ( ) ; assert that ( lockable locked ( ) ) is true ( ) ; not lockable not lockable 2 target = new not lockable ( ) ; not lockable not lockable 2 = ( not lockable ) create proxy ( not lockable 2 target , get fixture ( ) get advisors ( new singleton metadata aware aspect instance factory ( new make lockable ( ) , " some bean " ) ) , not lockable class ) ; assert that ( not lockable 2 instanceof lockable ) is true ( ) ; lockable lockable 2 = ( lockable ) not lockable 2 ; assert that ( lockable 2 locked ( ) ) is false ( ) ; not lockable 2 set int value ( 1 ) ; lockable 2 lock ( ) ; assert that illegal state exception ( ) is thrown by ( ( ) - > not lockable 2 set int value ( 32 ) ) ; assert that ( lockable 2 locked ( ) ) is true ( ) ; }


adds the given element to this queue if the queue is currently full , the element at the head of the queue is evicted to make room

public boolean add ( e e ) { check not null ( e ) ; / / check before removing if ( max size = = 0 ) { return true ; } if ( size ( ) = = max size ) { delegate remove ( ) ; } delegate add ( e ) ; return true ; }


create a new { @ code k stream } that consists all records of this stream which do not satisfy the given predicate all records that do satisfy the predicate are dropped this is a stateless record - by - record operation

k stream < k , v > filter not ( final predicate < ? super k , ? super v > predicate ) ;


return a file status object that represents the path

public file status get file status ( final path f ) throws i o exception { entry point ( invocation get file status ) ; return inner get file status ( f , false , status probe enum all ) ; }


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 " ) ; }


returns true if this network allows self - loops ( edges that connect a node to itself ) attempting to add a self - loop to a network that does not allow them will throw an { @ link illegal argument exception }


stops the downloads and releases resources waits until the downloads are persisted to the download index the manager must not be accessed after this method has been called

public void release ( ) { synchronized ( internal handler ) { if ( internal handler released ) { return ; } internal handler send empty message ( msg release ) ; boolean was interrupted = false ; while ( ! internal handler released ) { try { internal handler wait ( ) ; } catch ( interrupted exception e ) { was interrupted = true ; } } if ( was interrupted ) { / / restore the interrupted status thread current thread ( ) interrupt ( ) ; } application handler remove callbacks and messages ( / * token = * / null ) ; / / reset state downloads = collections empty list ( ) ; pending messages = 0 ; active task count = 0 ; initialized = false ; not met requirements = 0 ; waiting for requirements = false ; } }


request object metadata ; increments counters in the process retry policy : retry untranslated

object metadata get object metadata ( string key ) throws i o exception { return get object metadata ( key , null , invoker , null ) ; }


finds the first file that exists with the relative path in any module

public static resource file find data file in any module ( string relative path ) { check app initialized ( ) ; return app find module data file ( relative path ) ; }


set whether savepoints are allowed within this transaction the default is { @ code false }

public void set savepoint allowed ( boolean savepoint allowed ) { this savepoint allowed = savepoint allowed ; }


< code > optional float cash = 2 ; < code >


returns an immutable multimap containing the given entries , in order

public static < k , v > immutable list multimap < k , v > of ( k k 1 , v v 1 , k k 2 , v v 2 , k k 3 , v v 3 , k k 4 , v v 4 , k k 5 , v v 5 ) { immutable list multimap builder < k , v > builder = immutable list multimap builder ( ) ; builder put ( k 1 , v 1 ) ; builder put ( k 2 , v 2 ) ; builder put ( k 3 , v 3 ) ; builder put ( k 4 , v 4 ) ; builder put ( k 5 , v 5 ) ; return builder build ( ) ; } / / looking for of ( ) with > 5 entries ? use the builder instead


public static options get help options ( ) { return help options ; }


get the shard store information for the node , if it exists

public shard store info get shard store info ( ) { return shard store info ; }


each language - specific initialization method will call this to construct artifacts representing its protocol compiler outputs

public static immutable list < artifact > get generated outputs ( rule context rule context , immutable list < artifact > proto sources , string extension , boolean python names ) { immutable list builder < artifact > outputs builder = new immutable list builder < > ( ) ; artifact root genfiles = rule context get genfiles directory ( ) ; for ( artifact src : proto sources ) { path fragment src path = src get output dir relative path ( rule context get configuration ( ) is sibling repository layout ( ) ) ; if ( python names ) { src path = src path replace name ( src path get base name ( ) replace ( ' - ' , ' ' ) ) ; } / / note that two proto library rules can have the same source file , so this is actually a / / shared action nb : this can probably result in action conflicts if the proto library rules / / are not the same outputs builder add ( rule context get shareable artifact ( file system utils replace extension ( src path , extension ) , genfiles ) ) ; } return outputs builder build ( ) ; }


called after the main expression evaluation method has been generated , this method will callback any registered field adders or clinit adders to add any extra information to the class representing the compiled expression

public void finish ( ) { if ( this field adders ! = null ) { for ( field adder field adder : this field adders ) { field adder generate field ( this class writer , this ) ; } } if ( this clinit adders ! = null ) { method visitor mv = this class writer visit method ( acc public | acc static , " < clinit > " , " ( ) v " , null , null ) ; mv visit code ( ) ; this next free variable id = 0 ; / / to 0 because there is no ' this ' in a clinit for ( clinit adder clinit adder : this clinit adders ) { clinit adder generate code ( mv , this ) ; } mv visit insn ( return ) ; mv visit maxs ( 0 , 0 ) ; / / not supplied due to compute maxs mv visit end ( ) ; } }


add or replace the address of the given web - service endpoint with the given value

public process engine configuration add ws endpoint address ( q name endpoint name , url address ) { this ws overriden endpoint addresses put ( endpoint name , address ) ; return this ; }


execute a batch insert using the batch of values passed in

int [ ] execute batch ( sql parameter source batch ) ;


returns the most common , more general { @ link logical type } for a given set of types if such a type exists , all given types can be casted to this more general type for example : { @ code [ int , bigint , decimal ( 2 , 2 ) ] } would lead to { @ code decimal ( 21 , 2 ) } this class aims to be compatible with the sql standard it is inspired by apache calcite ' s { @ code sql type factory impl # least restrictive } method

public static optional < logical type > find common type ( list < logical type > types ) { preconditions check argument ( types size ( ) > 0 , " list of types must not be empty " ) ; / / collect statistics first boolean has raw type = false ; boolean has null type = false ; boolean has nullable types = false ; for ( logical type type : types ) { final logical type root type root = type get type root ( ) ; if ( type root = = raw ) { has raw type = true ; } else if ( type root = = null ) { has null type = true ; } if ( type is nullable ( ) ) { has nullable types = true ; } } final list < logical type > normalized types = types stream ( ) map ( t - > t copy ( true ) ) collect ( collectors to list ( ) ) ; logical type found type = find common nullable type ( normalized types , has raw type , has null type ) ; if ( found type = = null ) { found type = find common castable type ( normalized types ) ; } if ( found type ! = null ) { final logical type type with nullability = found type copy ( has nullable types ) ; / / null is reserved for untyped literals only if ( has root ( type with nullability , null ) ) { return optional empty ( ) ; } return optional of ( type with nullability ) ; } return optional empty ( ) ; }