returns the entry with the given name , or null if it does not exist

public zip file entry get entry ( @ nullable string name ) { return entries get ( name ) ; }


sets the alignment of the selected item in the select box see { @ link # get list ( ) } and { @ link list # set alignment ( int ) } to set the alignment in the list shown when the select box is open

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


test that we can parse the set of permissions correctly for a complex policy

public void test parse two permissions ( ) throws exception { assume true ( " test cannot run with security manager enabled " , system get security manager ( ) = = null ) ; path scratch = create temp dir ( ) ; plugin policy info info = make dummy plugin ( " security / complex - plugin - security policy " ) ; set < string > actual = plugin security get permission descriptions ( info , scratch ) ; assert that ( actual , contains in any order ( plugin security format permission ( new runtime permission ( " get class loader " ) ) , plugin security format permission ( new runtime permission ( " create class loader " ) ) ) ) ; }


bazel maintains a host configuration cache that stores configurations instantiated outside of skyframe we shouldn ' t , in general , instantiate configurations outside of { @ link build configuration value } but in this specific case bazel performance suffers through the skyframe interface and maintaining a local cache is much faster see { @ link skyframe build view } for details one consequence of this is that requesting a config that would be a skyframe cache hit can still produce a distinct instance meaning you can get cases where { @ code config 1 equals ( config 2 ) & & config 1 ! = config 2 } this test checks for such a case : perform three consecutive bazel builds the first builds with default options , producing top - level host config h1 and configured target < host generated file producer , h1 > the second builds with { @ code - - host copt = a = b } , producing host config h2 ( and clearing the top - level host config cache since the host config changed ) the third builds back with default options this once again clears the host config cache , since the host config changed again so that cache creates a new config h3 where h3 equals ( h1 ) and instantiates new configured target < host src 3 cc , h3 > it then requests dependency < host generated file producer , h3 > from skyframe , but the skyframe sky key interner reduces this to the previously seen < host generated file producer , h1 > and returns that instead this produces the expected scenario where the output file ' s config is value - equal but not reference - equal to its generating rule ' s config

public void host config switch ( ) throws exception { scratch file ( " foo / build " , " genrule ( " , " name = ' host generated file producer ' , " , " srcs = [ ] , " , " outs = [ " , " ' host src 1 cc ' , " , " ' host src 2 cc ' , " , " ' host src 3 cc ' , " , " ] , " , " cmd = ' echo hi > $ ( location host src 1 cc ) ; echo hi > $ ( location host src 2 cc ) ; " + " echo hi > $ ( location host src 3 cc ) ' ) " , " " , " cc binary ( name = ' host generated file consumer 1 ' , srcs = [ ' host src 1 cc ' ] ) " , " cc binary ( name = ' host generated file consumer 2 ' , srcs = [ ' host src 2 cc ' ] ) " , " cc binary ( name = ' host generated file consumer 3 ' , srcs = [ ' host src 3 cc ' ] ) " , " " , " genrule ( name = ' gen 1 ' , srcs = [ ] , outs = [ ' gen 1 out ' ] , cmd = ' echo hi > $ @ ' , " , " tools = [ ' : host generated file consumer 1 ' ] ) " , " genrule ( name = ' gen 2 ' , srcs = [ ] , outs = [ ' gen 2 out ' ] , cmd = ' echo hi > $ @ ' , " , " tools = [ ' : host generated file consumer 2 ' ] ) " , " genrule ( name = ' gen 3 ' , srcs = [ ] , outs = [ ' gen 3 out ' ] , cmd = ' echo hi > $ @ ' , " , " tools = [ ' : host generated file consumer 3 ' ] ) " ) ; use configuration ( ) ; update ( " / / foo : gen 1 " ) ; use configuration ( " - - host copt " , " a = b " ) ; update ( " / / foo : gen 2 " ) ; use configuration ( ) ; update ( " / / foo : gen 3 " ) ; configured target and data host src 3 = get configured target and data ( " / / foo : host src 3 cc " , get host configuration ( ) ) ; configured target host generated file consumer 3 = ( ( output file configured target ) host src 3 get configured target ( ) ) get generating rule ( ) ; assert that ( host src 3 get configuration ( ) ) is equal to ( get configuration ( host generated file consumer 3 ) ) ; / / todo ( gregce ) : enable below for bazel tests , which for some reason realize the same instance / / assert that ( host src 3 get configuration ( ) ) / / is not same as ( host generated file consumer 3 get configuration ( ) ) ; }


skips bytes until the position is aligned to a multiple of 4

public void align to four bytes ( ) { data position ( ( data position ( ) + 3 ) & ~ 3 ) ; }


returns the string representation of the current value

public string to string ( ) { return double to string ( get ( ) ) ; }


returns how many volumes are in the data node

public int get volume count ( ) { return volume count ; }


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


processes { @ link # output buffer } by rendering it , skipping it or doing nothing , and returns whether it may be possible to process another output buffer

private boolean process output buffer ( long position us , long elapsed realtime us ) throws exo playback exception , decoder exception { if ( initial position us = = c time unset ) { initial position us = position us ; } long early us = output buffer time us - position us ; if ( ! has output ( ) ) { / / skip frames in sync with playback , so we ' ll be at the right frame if the mode changes if ( is buffer late ( early us ) ) { skip output buffer ( output buffer ) ; return true ; } return false ; } long presentation time us = output buffer time us - output stream offset us ; format format = format queue poll floor ( presentation time us ) ; if ( format ! = null ) { output format = format ; } long elapsed realtime now us = system clock elapsed realtime ( ) * 1000 ; long elapsed since last render us = elapsed realtime now us - last render time us ; boolean is started = get state ( ) = = state started ; boolean should render first frame = ! rendered first frame after enable ? ( is started | | may render first frame after enable if not started ) : ! rendered first frame after reset ; / / todo : we shouldn ' t force render while we are joining an ongoing playback if ( should render first frame | | ( is started & & should force render output buffer ( early us , elapsed since last render us ) ) ) { render output buffer ( output buffer , presentation time us , output format ) ; return true ; } if ( ! is started | | position us = = initial position us ) { return false ; } / / todo : treat dropped buffers as skipped while we are joining an ongoing playback if ( should drop buffers to keyframe ( early us , elapsed realtime us ) & & maybe drop buffers to keyframe ( position us ) ) { return false ; } else if ( should drop output buffer ( early us , elapsed realtime us ) ) { drop output buffer ( output buffer ) ; return true ; } if ( early us < 30000 ) { render output buffer ( output buffer , presentation time us , output format ) ; return true ; } return false ; }


a sensible definition of { @ link # to array ( ) } in terms of { @ link # to array ( object [ ] ) } if you override { @ link # to array ( object [ ] ) } , you may wish to override { @ link # to array } to forward to this implementation

protected object [ ] standard to array ( ) { object [ ] new array = new object [ size ( ) ] ; return to array ( new array ) ; }


public short get reserved ( ) { return reserved ; } / / @ override / / public data type to data type ( ) throws duplicate name exception , i o exception { / / return struct converter util to data type ( this ) ; / / }


configure the indentation settings for the supplied { @ link transformer }

protected final void configure indentation ( transformer transformer ) { if ( this indent ) { transformer utils enable indenting ( transformer ) ; } else { transformer utils disable indenting ( transformer ) ; } }


set up hdfs to run securely in secure mode , hdfs goes out of its way to refuse to start if it doesn ' t consider the configuration safe this is good in production , and it stops an hdfs cluster coming up where things can ' t reliably talk to each other but it does complicate test setup look at { @ code org apache hadoop hdfs test d f s inotify event input stream kerberized } and { @ code org apache hadoop hdfs qjournal test secure n n with q j m } for the details on what options to set here

protected void patch config with h d f s bindings ( final configuration conf ) { preconditions check state ( is in state ( state started ) ) ; enable kerberos ( conf ) ; string path = get keytab path ( ) ; string spnego principal = " * " ; string localhost = localhost name ; string instance = get krb instance ( ) ; string hdfs principal = get login principal ( ) ; patch config at init ( conf ) ; conf set long ( common configuration keys fs du interval key , long max value ) ; conf set ( dfs namenode kerberos principal key , hdfs principal ) ; conf set ( dfs namenode keytab file key , path ) ; conf set ( dfs datanode kerberos principal key , hdfs principal ) ; conf set ( dfs datanode keytab file key , path ) ; conf set ( dfs web authentication kerberos principal key , spnego principal ) ; conf set ( dfs journalnode keytab file key , path ) ; conf set ( dfs journalnode kerberos principal key , hdfs principal ) ; conf set ( dfs journalnode kerberos internal spnego principal key , spnego principal ) ; conf set boolean ( dfs block access token enable key , true ) ; conf set ( dfs data transfer protection key , " authentication " ) ; conf set ( dfs http policy key , http config policy https only name ( ) ) ; conf set ( dfs namenode https address key , " localhost : 0 " ) ; conf set ( dfs datanode https address key , " localhost : 0 " ) ; conf set ( dfs http policy key , http config policy https only name ( ) ) ; conf set ( dfs client https keystore resource key , key store test util get client s s l config file name ( ) ) ; conf set ( dfs server https keystore resource key , key store test util get server s s l config file name ( ) ) ; }


simulates branch insns , if possible adds reachable successor blocks to the cfg worklists

private void simulate branch ( ssa insn insn ) { rop opcode = insn get opcode ( ) ; register spec list sources = insn get sources ( ) ; boolean constant branch = false ; boolean constant successor = false ; / / check if the insn is a branch with a constant condition if ( opcode get branchingness ( ) = = rop branch if ) { constant c a = null ; constant c b = null ; register spec spec a = sources get ( 0 ) ; int reg a = spec a get reg ( ) ; if ( ! ssa meth is reg a local ( spec a ) & & lattice values [ reg a ] = = constant ) { c a = lattice constants [ reg a ] ; } if ( sources size ( ) = = 2 ) { register spec spec b = sources get ( 1 ) ; int reg b = spec b get reg ( ) ; if ( ! ssa meth is reg a local ( spec b ) & & lattice values [ reg b ] = = constant ) { c b = lattice constants [ reg b ] ; } } / / calculate the result of the condition if ( c a ! = null & & sources size ( ) = = 1 ) { switch ( ( ( typed constant ) c a ) get basic type ( ) ) { case type bt int : constant branch = true ; int v a = ( ( cst integer ) c a ) get value ( ) ; switch ( opcode get opcode ( ) ) { case reg ops if eq : constant successor = ( v a = = 0 ) ; break ; case reg ops if ne : constant successor = ( v a ! = 0 ) ; break ; case reg ops if lt : constant successor = ( v a < 0 ) ; break ; case reg ops if ge : constant successor = ( v a > = 0 ) ; break ; case reg ops if le : constant successor = ( v a < = 0 ) ; break ; case reg ops if gt : constant successor = ( v a > 0 ) ; break ; default : throw new runtime exception ( " unexpected op " ) ; } break ; default : / / not yet supported } } else if ( c a ! = null & & c b ! = null ) { switch ( ( ( typed constant ) c a ) get basic type ( ) ) { case type bt int : constant branch = true ; int v a = ( ( cst integer ) c a ) get value ( ) ; int v b = ( ( cst integer ) c b ) get value ( ) ; switch ( opcode get opcode ( ) ) { case reg ops if eq : constant successor = ( v a = = v b ) ; break ; case reg ops if ne : constant successor = ( v a ! = v b ) ; break ; case reg ops if lt : constant successor = ( v a < v b ) ; break ; case reg ops if ge : constant successor = ( v a > = v b ) ; break ; case reg ops if le : constant successor = ( v a < = v b ) ; break ; case reg ops if gt : constant successor = ( v a > v b ) ; break ; default : throw new runtime exception ( " unexpected op " ) ; } break ; default : / / not yet supported } } } / * * if condition is constant , add only the target block to the * worklist otherwise , add all successors to the worklist * / ssa basic block block = insn get block ( ) ; if ( constant branch ) { int successor block ; if ( constant successor ) { successor block = block get successor list ( ) get ( 1 ) ; } else { successor block = block get successor list ( ) get ( 0 ) ; } add block to worklist ( ssa meth get blocks ( ) get ( successor block ) ) ; branch worklist add ( insn ) ; } else { for ( int i = 0 ; i < block get successor list ( ) size ( ) ; i + + ) { int successor block = block get successor list ( ) get ( i ) ; add block to worklist ( ssa meth get blocks ( ) get ( successor block ) ) ; } } }


returns an immutable map containing a single entry this map behaves and performs comparably to { @ link collections # singleton map } but will not accept a null key or value it is preferable mainly for consistency and maintainability of your code

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


initializes default values for the cluster

private void init default configurations ( ) { long default scanner volume time out = conf get long ( dfs block scanner volume join timeout msec key , default scanner volume join timeout msec ) ; conf set long ( dfs block scanner volume join timeout msec key , default scanner volume time out ) ; / / default is false do not consider load factor when selecting a / / datanode conf set boolean ( dfs namenode redundancy considerload key , default dfs namenode redundancy considerload ) ; this storages per datanode = fs dataset test utils factory get factory ( conf ) get default num of data dirs ( ) ; }


overridden to ensure that we only place block comments on the first { @ link code unit } of the block

public field location get field location ( listing field listing field , big integer index , int field num , program location program loc ) { / / only handle this if it ' s the right kind of location object if ( ! ( program loc instanceof memory block start field location ) ) { return null ; } memory block start field location block location = ( memory block start field location ) program loc ; object obj = listing field get proxy ( ) get object ( ) ; if ( obj instanceof code unit ) { code unit cu = ( code unit ) obj ; memory block block = cu get memory ( ) get block ( cu get address ( ) ) ; if ( block = = null ) { return null ; } / / if the code unit does not rest at the beginning of a memory block , no need / / to handle this if ( cu get min address ( ) equals ( block get start ( ) ) ) { if ( listing field instanceof listing text field ) { listing text field listing text field = ( listing text field ) listing field ; row col location location = listing text field data to screen location ( block location get row ( ) , block location get char offset ( ) ) ; return new field location ( index , field num , location row ( ) , location col ( ) ) ; } } } return null ; }


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

public boolean is set arg ( ) { return isset bit vector get ( arg isset id ) ; }


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


public boolean get attribute boolean ( ) { return attribute boolean ; }


builds a comma - separated list of class names

public static < t extends class < ? > > string build class list string ( list < t > classes ) { string builder sb = new string builder ( ) ; for ( int i = 0 ; i < classes size ( ) ; + + i ) { if ( i > 0 ) { sb append ( ' , ' ) ; } sb append ( classes get ( i ) get name ( ) ) ; } return sb to string ( ) ; }


gets the segment that the view currently writes to

public memory segment get current segment ( ) { return this current segment ; }


gets the data type of the index into the string stream will be either { @ link d word data type } or { @ link word data type }

public data type get string index data type ( ) { return ( ( heap sizes & 0x 0 1 ) ! = 0 ) ? d word data type data type : word data type data type ; }


put user { username } : updated user this can only be done by the logged in user

default mono < response entity < void > > update user ( @ api param ( value = " name that need to be deleted " , required = true ) @ path variable ( " username " ) string username , @ api param ( value = " updated user object " , required = true ) @ valid @ request body mono < user > body , @ api ignore final server web exchange exchange ) { return get delegate ( ) update user ( username , body , exchange ) ; }


sleep a bit between the tests ( we are re - using the yarn cluster for the tests )

public void shutdown yarn client ( ) { yarn client stop ( ) ; }


public void date time test ( ) { / / todo : test date time }


extracts the param in { @ code path params } first , then falls back to the first matching param in { @ code query params }

public string param ( string name ) { string path value = path params get ( name ) ; return ( path value = = null ) ? query param ( name ) : path value ; }


returns the largest sample timestamp that has been read since the last { @ link # reset }

public final synchronized long get largest read timestamp us ( ) { return max ( largest discarded timestamp us , get largest timestamp ( read position ) ) ; }


returns true if there are more bytes remaining in the pdb byte reader

public boolean has more ( ) { return ( index < limit ) ; }


public void set program ( program d b program ) { this program = program ; try { reload all ( ) ; } catch ( i o exception e ) { db error ( e ) ; } }


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 " java - vertx " ; }


construct a lite pal d b instance from the default configuration by litepal xml but database name must be different than the default

public static lite pal d b from default ( string db name ) { lite pal config config = lite pal parser parse lite pal configuration ( ) ; lite pal d b lite pal d b = new lite pal d b ( db name , config get version ( ) ) ; lite pal d b set storage ( config get storage ( ) ) ; lite pal d b set class names ( config get class names ( ) ) ; return lite pal d b ; }


analyze and load storage directories recover from previous transitions if required the block pool storages are either all analyzed or none of them is loaded therefore , a failure on loading any block pool storage results a faulty data volume

list < storage directory > load bp storage directories ( namespace info ns info , storage location location , startup option start opt , list < callable < storage directory > > callables , configuration conf ) throws i o exception { list < storage directory > succeed dirs = lists new array list ( ) ; try { if ( contains storage dir ( location , ns info get block pool i d ( ) ) ) { throw new i o exception ( " block pool slice storage recover transition read : " + " attempt to load an used block storage : " + location ) ; } final storage directory sd = load storage directory ( ns info , location , start opt , callables , conf ) ; succeed dirs add ( sd ) ; } catch ( i o exception e ) { log warn ( " failed to analyze storage directories for block pool { } " , ns info get block pool i d ( ) , e ) ; throw e ; } return succeed dirs ; }


deserializes accumulators from a task state update this method never throws an exception !

private map < string , accumulator < ? , ? > > deserialize accumulators ( task execution state transition state ) { accumulator snapshot serialized accumulators = state get accumulators ( ) ; if ( serialized accumulators ! = null ) { try { return serialized accumulators deserialize user accumulators ( user class loader ) ; } catch ( throwable t ) { / / we catch throwable here to include all form of linking errors that may / / occur if user classes are missing in the classpath log error ( " failed to deserialize final accumulator results " , t ) ; } } return null ; }


specify the delayed duration when the procedures need to retry

public builder set delay duration ( long value ) { this delay duration = value ; return this ; }


gets the number of memory segments used by this partition , which includes build side memory buffers and overflow memory segments

public int get num occupied memory segments ( ) { / / either the number of memory segments , or one for spilling final int num partition buffers = this partition buffers ! = null ? this partition buffers length : this build side write buffer get num occupied memory segments ( ) ; return num partition buffers + num overflow segments ; }


public static int write string ( data output out , string s ) throws i o exception { if ( s length ( ) > 0xffff / 3 ) { / / maybe too long log warn ( " truncating long string : " + s length ( ) + " chars , starting with " + s substring ( 0 , 20 ) ) ; s = s substring ( 0 , 0xffff / 3 ) ; } int len = utf 8 length ( s ) ; if ( len > 0xffff ) / / double - check length throw new i o exception ( " string too long ! " ) ; out write short ( len ) ; write chars ( out , s , 0 , s length ( ) ) ; return len ; }


public void small camel test ( ) { / / todo : test small camel }


returns an immutable list containing the given elements , in order

public static < e > immutable list < e > of ( e e 1 , e e 2 , e e 3 , e e 4 , e e 5 , e e 6 , e e 7 , e e 8 , e e 9 , e e 1 0 , e e 1 1 ) { return construct ( e 1 , e 2 , e 3 , e 4 , e 5 , e 6 , e 7 , e 8 , e 9 , e 1 0 , e 1 1 ) ; } / / these go up to eleven after that , you just get the varargs form , and / / whatever warnings might come along with it : (


searches a method with a similar signature as desired using { @ link # is similar signature ( java lang reflect method , string , class [ ] ) } first public methods are searched in the class hierarchy , then private methods on the declaring class if a method could be found , it is returned , otherwise a { @ code no such method exception } is thrown

private method similar method ( string name , class < ? > [ ] types ) throws no such method exception { class < ? > t = type ( ) ; / / first priority : find a public method with a " similar " signature in class hierarchy / / similar interpreted in when primitive argument types are converted to their wrappers for ( method method : t get methods ( ) ) { if ( is similar signature ( method , name , types ) ) { return method ; } } / / second priority : find a non - public method with a " similar " signature on declaring class do { for ( method method : t get declared methods ( ) ) { if ( is similar signature ( method , name , types ) ) { return method ; } } t = t get superclass ( ) ; } while ( t ! = null ) ; throw new no such method exception ( " no similar method " + name + " with params " + arrays to string ( types ) + " could be found on type " + type ( ) + " " ) ; }


test whether resource manager passes user - provided conf to user group information class if it reads this ( incorrect ) authentication method enum an exception is thrown

public void test user provided u g i conf ( ) throws exception { thrown expect ( illegal argument exception class ) ; thrown expect message ( " invalid attribute value for " + common configuration keys public hadoop security authentication + " of dummyauth " ) ; configuration dummy conf = new yarn configuration ( ) ; dummy conf set ( common configuration keys public hadoop security authentication , " dummyauth " ) ; resource manager dummy resource manager = new resource manager ( ) ; try { dummy resource manager init ( dummy conf ) ; } finally { dummy resource manager stop ( ) ; } }


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 1 2 3number test ( ) { / / todo : test 1 2 3number }


returns an ( optionally cached ) project file instance if there is no such file , or if the file cannot be parsed , then it throws an exception

project file get project file ( path working directory , list < root > package path , path fragment path , options parser options parser ) throws options parsing exception , interrupted exception ;


gets the value of the activation status property this accessor method returns a reference to the live list , not a snapshot therefore any modification you make to the returned list will be present inside the jaxb object this is why there is not a < code > set < code > method for the activation status property for example , to add a new item , do as follows : get activation status ( ) add ( new item ) ; objects of the following type ( s ) are allowed in the list { @ link long }

public list < long > get activation status ( ) { if ( activation status = = null ) { activation status = new array list < long > ( ) ; } return this activation status ; }


exit a parse tree produced by { @ link sql base parser # predicated }

void exit predicated ( sql base parser predicated context ctx ) ;


returns the { @ code long } value of a header with the specified name if there is more than one value for the specified name , the first value in insertion order is returned


tests that get file status on raw and non raw resolve to the same file

public void test get file status ( ) throws exception { final path zone = new path ( " zone " ) ; final path slash zone = new path ( " / " , zone ) ; fs mkdirs ( slash zone ) ; dfs admin create encryption zone ( slash zone , test key , no trash ) ; final path base = new path ( " base " ) ; final path reserved raw = new path ( " / reserved / raw " ) ; final path base raw = new path ( reserved raw , base ) ; final int len = 8192 ; d f s test util create file ( fs , base raw , len , ( short ) 1 , 0x f e e d ) ; assert path equals ( new path ( " / " , base ) , base raw ) ; / * repeat the test for a file in an ez * / final path ez enc file = new path ( slash zone , base ) ; final path ez raw enc file = new path ( new path ( reserved raw , zone ) , base ) ; d f s test util create file ( fs , ez enc file , len , ( short ) 1 , 0x f e e d ) ; assert path equals ( ez enc file , ez raw enc file ) ; }


process elf symbol if it has a versioned name attempt to establish as comment on associated external symbol

private boolean process versioned external ( elf symbol elf symbol ) { string sym name = elf symbol get name as string ( ) ; int index = sym name index of ( " @ " ) ; if ( index < 0 ) { return false ; } / / todo : versioned symbols may also exist on real addresses / / corresponding to external linkages in the got , plt and / / other memory locations which may relate to external functions / / unsure if this approach is appropriate since we are not / / handling these versioned symbols in a consistent fashion , / / however their existence can interfere with demangling for / / externals and related thunks if ( last external block entry address = = null ) { return false ; } int alt index = sym name index of ( " @ @ " ) ; if ( alt index > 0 ) { index = alt index ; } string real name = sym name substring ( 0 , index ) ; / / find real symbol ( assumes real symbol is always processed first ) symbol s = find external block symbol ( real name , external block limits get min address ( ) , last external block entry address ) ; if ( s = = null ) { return false ; } / / add versioned symbol as comment only address address = s get address ( ) ; string comment = listing get comment ( code unit pre comment , address ) ; if ( comment = = null | | comment length ( ) = = 0 ) { comment = sym name ; } else { comment + = " \ n " + sym name ; } listing set comment ( address , code unit pre comment , comment ) ; set elf symbol address ( elf symbol , address ) ; return true ; }


public long get $ special property name ( ) { return $ special property name ; }


tests that pending slot requests are rejected if a slot report with a different allocation is received

public void test slot report while active slot request ( ) throws exception { final resource manager id resource manager id = resource manager id generate ( ) ; final resource actions resource manager actions = new testing resource actions builder ( ) build ( ) ; final job i d job id = new job i d ( ) ; final allocation i d allocation id = new allocation i d ( ) ; final resource profile resource profile = resource profile from resources ( 42 0 , 1337 ) ; final slot request slot request = new slot request ( job id , allocation id , resource profile , " foobar " ) ; final completable future < acknowledge > slot request future 1 = new completable future < > ( ) ; final iterator < completable future < acknowledge > > slot request future iterator = arrays as list ( slot request future 1 , completable future completed future ( acknowledge get ( ) ) ) iterator ( ) ; final array blocking queue < slot i d > slot ids = new array blocking queue < > ( 2 ) ; final testing task executor gateway task executor gateway = new testing task executor gateway builder ( ) set request slot function ( function utils unchecked function ( request slot parameters - > { slot ids put ( request slot parameters f 0 ) ; return slot request future iterator next ( ) ; } ) ) create testing task executor gateway ( ) ; final resource i d resource id = resource i d generate ( ) ; final task executor connection task manager connection = new task executor connection ( resource id , task executor gateway ) ; final slot i d slot id 1 = new slot i d ( resource id , 0 ) ; final slot i d slot id 2 = new slot i d ( resource id , 1 ) ; final slot status slot status 1 = new slot status ( slot id 1 , resource profile ) ; final slot status slot status 2 = new slot status ( slot id 2 , resource profile ) ; final slot report slot report = new slot report ( arrays as list ( slot status 1 , slot status 2 ) ) ; final scheduled executor main thread executor = testing utils default scheduled executor ( ) ; final slot manager impl slot manager = create slot manager builder ( ) set scheduled executor ( main thread executor ) build ( ) ; try { slot manager start ( resource manager id , main thread executor , resource manager actions ) ; completable future < void > registration future = completable future supply async ( ( ) - > { slot manager register task manager ( task manager connection , slot report , resource profile any , resource profile any ) ; return null ; } , main thread executor ) then accept ( ( object value ) - > { try { slot manager register slot request ( slot request ) ; } catch ( resource manager exception e ) { throw new runtime exception ( " could not register slots " , e ) ; } } ) ; / / check that no exception has been thrown registration future get ( ) ; final slot i d requested slot id = slot ids take ( ) ; final slot i d free slot id = requested slot id equals ( slot id 1 ) ? slot id 2 : slot id 1 ; final slot status new slot status 1 = new slot status ( requested slot id , resource profile , new job i d ( ) , new allocation i d ( ) ) ; final slot status new slot status 2 = new slot status ( free slot id , resource profile ) ; final slot report new slot report = new slot report ( arrays as list ( new slot status 1 , new slot status 2 ) ) ; completable future < boolean > report slot status future = completable future supply async ( / / this should update the slot with the pending slot request triggering / / the reassignment of it ( ) - > slot manager report slot status ( task manager connection get instance i d ( ) , new slot report ) , main thread executor ) ; assert true ( report slot status future get ( ) ) ; final slot i d requested slot id 2 = slot ids take ( ) ; assert equals ( free slot id , requested slot id 2 ) ; } finally { completable future run async ( throwing runnable unchecked ( slot manager : : close ) , main thread executor ) ; } }


gets authentication handlers by a filter

default set < authentication handler > get authentication handlers by ( final predicate < authentication handler > filter ) { return get authentication handlers ( ) stream ( ) filter ( filter ) collect ( collectors to set ( ) ) ; }


< b > note : < b > this method is not presently used

public int [ ] get registers by frequency ( ) { int reg count = ssa meth get reg count ( ) ; integer [ ] ret = new integer [ reg count ] ; for ( int i = 0 ; i < reg count ; i + + ) { ret [ i ] = i ; } arrays sort ( ret , new comparator < integer > ( ) { public int compare ( integer o 1 , integer o 2 ) { return ssa meth get use list for register ( o 2 ) size ( ) - ssa meth get use list for register ( o 1 ) size ( ) ; } } ) ; int result [ ] = new int [ reg count ] ; for ( int i = 0 ; i < reg count ; i + + ) { result [ i ] = ret [ i ] ; } return result ; }


tests that idle task managers time out after the configured timeout a timed out task manager will be removed from the slot manager and the resource manager will be notified about the timeout , if it can be released

public void test task manager timeout ( ) throws exception { check task manager timeout ( 0 ) ; }


public void write to ( annotated output out , dalv insn insn ) { register spec list regs = insn get registers ( ) ; int cpi = ( ( cst insn ) insn ) get index ( ) ; int first reg = ( regs size ( ) = = 0 ) ? 0 : regs get ( 0 ) get reg ( ) ; int count = regs get word count ( ) ; write ( out , opcode unit ( insn , count ) , ( short ) cpi , ( short ) first reg ) ; }


remove all references that have the " to " address as the given address note : this method relies on the use of the to refs list ! beyond version - 12 of program d b , stack and register addresses are no longer stored in the to refs list

private int remove all to ( address to addr ) throws i o exception { ref list to refs = get to refs ( to addr ) ; if ( to refs = = null ) { return 0 ; } int cnt = to refs get num refs ( ) ; reference [ ] refs = to refs get all refs ( ) ; for ( reference ref : refs ) { ref list from refs = get from refs ( ref get from address ( ) ) ; from refs remove ref ( to addr , ref get operand index ( ) ) ; if ( from refs is empty ( ) ) { from cache delete ( from refs get key ( ) ) ; } reference removed ( ref ) ; } to refs remove all ( ) ; to cache delete ( to refs get key ( ) ) ; return cnt ; }


public void test model 2 0 0 response ( ) { / / todo : test model 2 0 0 response }


create a protected asynchronous resource

async entry async entry ( string name , entry type traffic type , int batch count , object args ) throws block exception ;


reads a signed long value in this { @ link class reader } this method is intended for { @ link attribute } sub classes , and is normally not needed by class generators or adapters

public long read long ( final int offset ) { long l 1 = read int ( offset ) ; long l 0 = read int ( offset + 4 ) & 0x f f f f f f f f l ; return ( l 1 < < 32 ) | l 0 ; }


indicate whether or not a listener is set


returns a substring of the given string , representing the ' length ' most - right characters

public static string right str ( string str , int length ) { return str substring ( math max ( 0 , str length ( ) - length ) ) ; }


returns the number of times { @ link cache } lookup methods failed to load a new value , either because no value was found or an exception was thrown while loading this is always incremented in conjunction with { @ code miss count } , though { @ code miss count } is also incremented when cache loading completes successfully ( see { @ link # load success count } ) multiple concurrent misses for the same key will result in a single load operation

public long load failure count ( ) { return load failure count ; }


find the fields constant that matches field id , or null if its not found

public static fields find by thrift id ( int field id ) { switch ( field id ) { case 0 : / / success return success ; default : return null ; } }


sets a new value for the stack depth change at the indicated address

public static void set stack depth change ( program program , address address , int stack depth change ) throws duplicate name exception { property map manager pmm = program get usr property manager ( ) ; int property map ipm = pmm get int property map ( stack depth change name ) ; if ( ipm = = null ) { ipm = pmm create int property map ( stack depth change name ) ; } ipm add ( address , stack depth change ) ; }


generate method config for service discovery metadata < p > make { @ link metadata service } support argument callback , used to notify { @ link org apache dubbo registry client service instance } ' s metadata change event

private list < method config > generate method config ( ) { method config method config = new method config ( ) ; method config set name ( " get and listen service discovery metadata " ) ; argument config argument config = new argument config ( ) ; argument config set index ( 1 ) ; argument config set callback ( true ) ; method config set arguments ( collections singleton list ( argument config ) ) ; return collections singleton list ( method config ) ; }


sets the maximum parallelism for the task

public void set max parallelism ( int max parallelism ) { this max parallelism = max parallelism ; }


public completable future < void > delete pet ( long pet id , string api key ) throws api exception { try { http request builder local var request builder = delete pet request builder ( pet id , api key ) ; return member var http client send async ( local var request builder build ( ) , http response body handlers of string ( ) ) then compose async ( local var response - > { if ( local var response status code ( ) / 100 ! = 2 ) { return completable future failed future ( get api exception ( " delete pet " , local var response ) ) ; } return completable future completed future ( null ) ; } ) ; } catch ( api exception e ) { return completable future failed future ( e ) ; } }


sets the authenticated state this is set by the server - side callback handler by matching the client provided password with the expected password

public void authenticated ( boolean authenticated ) { this authenticated = authenticated ; }


public immutable list < label > get translation targets ( ) { return translation targets ; }


return the application ' s width of screen , in pixel

public static int get app screen width ( ) { window manager wm = ( window manager ) utils get app ( ) get system service ( context window service ) ; if ( wm = = null ) return - 1 ; point point = new point ( ) ; wm get default display ( ) get size ( point ) ; return point x ; }


launches the task built by this builder , using a non - blocking dialog the task will be run in the current thread if in a headless environment

public void launch non modal ( ) { validate ( ) ; boolean is modal = false ; task t = new task builder task ( is modal ) ; if ( system utilities is in headless mode ( ) ) { t monitored run ( task monitor dummy ) ; return ; } / / note : just calling the launcher will trigger the work int delay = get delay ( launch delay , is modal ) ; new task launcher ( t , parent , delay , dialog width ) ; }


return ' false ' to cancel this animation and keep it from starting

boolean should start ( animation binding binding ) ;


invoke the given bean factory post processor beans

private static void invoke bean factory post processors ( collection < ? extends bean factory post processor > post processors , configurable listable bean factory bean factory ) { for ( bean factory post processor post processor : post processors ) { startup step post process bean factory = bean factory get application startup ( ) start ( " spring context bean - factory post - process " ) tag ( " post processor " , post processor : : to string ) ; post processor post process bean factory ( bean factory ) ; post process bean factory end ( ) ; } }


applies an aggregation that gives the current sum of the data stream at the given field by the given key an independent aggregate is kept per key

public single output stream operator < t > sum ( string field ) { return aggregate ( new sum aggregator < > ( field , get type ( ) , get execution config ( ) ) ) ; }


public int read bits ( int num bits ) { int return value = 0 ; bit offset + = num bits ; while ( bit offset > 8 ) { bit offset - = 8 ; return value | = ( data [ byte offset ] & 0x f f ) < < bit offset ; byte offset + = should skip byte ( byte offset + 1 ) ? 2 : 1 ; } return value | = ( data [ byte offset ] & 0x f f ) > > ( 8 - bit offset ) ; return value & = 0x f f f f f f f f > > > ( 32 - num bits ) ; if ( bit offset = = 8 ) { bit offset = 0 ; byte offset + = should skip byte ( byte offset + 1 ) ? 2 : 1 ; } assert valid offset ( ) ; return return value ; }


parse the first " forwarded : for = " or " x - forwarded - for " header value to an { @ code inet socket address } representing the address of the client

public static inet socket address parse forwarded for ( http request request , @ nullable inet socket address remote address ) { int port = ( remote address ! = null ? remote address get port ( ) : " https " equals ( request get u r i ( ) get scheme ( ) ) ? 443 : 80 ) ; string forwarded header = request get headers ( ) get first ( " forwarded " ) ; if ( string utils has text ( forwarded header ) ) { string forwarded to use = string utils tokenize to string array ( forwarded header , " , " ) [ 0 ] ; matcher matcher = forwarded for pattern matcher ( forwarded to use ) ; if ( matcher find ( ) ) { string value = matcher group ( 1 ) trim ( ) ; string host = value ; int port separator idx = value last index of ( ' : ' ) ; if ( port separator idx > value last index of ( ' ] ' ) ) { host = value substring ( 0 , port separator idx ) ; port = integer parse int ( value substring ( port separator idx + 1 ) ) ; } return new inet socket address ( host , port ) ; } } string for header = request get headers ( ) get first ( " x - forwarded - for " ) ; if ( string utils has text ( for header ) ) { string host = string utils tokenize to string array ( for header , " , " ) [ 0 ] ; return new inet socket address ( host , port ) ; } return null ; }


creates a { @ code listenable future task } that will upon running , execute the given { @ code runnable } , and arrange that { @ code get } will return the given result on successful completion

static < v > trusted listenable future task < v > create ( runnable runnable , @ nullable decl v result ) { return new trusted listenable future task < v > ( executors callable ( runnable , result ) ) ; } / * * in certain circumstances , this field might theoretically not be visible to an after done ( ) call * triggered by cancel ( ) for details , see the comments on the fields of timeout future * * < p > { @ code volatile }


get storeorder { order id } : find purchase order by id for valid response try integer i ds with value & lt ; & # x 3 d ; 5 or & gt ; 10 other values will generated exceptions

default response entity < order > get order by id ( @ min ( 1l ) @ max ( 5l ) @ api param ( value = " id of pet that needs to be fetched " , required = true ) @ path variable ( " order id " ) long order id ) { get request ( ) if present ( request - > { for ( media type media type : media type parse media types ( request get header ( " accept " ) ) ) { if ( media type is compatible with ( media type value of ( " application / json " ) ) ) { string example string = " { \ " pet id \ " : 6 , \ " quantity \ " : 1 , \ " id \ " : 0 , \ " ship date \ " : \ " 2000 - 01 - 23t04 : 56 : 07 000 + 00 : 00 \ " , \ " complete \ " : false , \ " status \ " : \ " placed \ " } " ; api util set example response ( request , " application / json " , example string ) ; break ; } if ( media type is compatible with ( media type value of ( " application / xml " ) ) ) { string example string = " < order > < id > 123456789 < / id > < pet id > 123456789 < / pet id > < quantity > 123 < / quantity > < ship date > 2000 - 01 - 23t04 : 56 : 07 000z < / ship date > < status > aeiou < / status > < complete > true < / complete > < / order > " ; api util set example response ( request , " application / xml " , example string ) ; break ; } } } ) ; return new response entity < > ( http status not implemented ) ; }


test if the { @ link advanced wizard } smokes whatever instance of { @ link tobacco } is passed to him through the constructor parameter

public void test smoke every thing ( ) throws exception { list < tobacco > tobaccos = list of ( new old toby tobacco ( ) , new rivendell tobacco ( ) , new second breakfast tobacco ( ) ) ; / / verify if the wizard is smoking the correct tobacco tobaccos for each ( tobacco - > { final advanced wizard advanced wizard = new advanced wizard ( tobacco ) ; advanced wizard smoke ( ) ; string last message = appender get last message ( ) ; assert equals ( " advanced wizard smoking " + tobacco get class ( ) get simple name ( ) , last message ) ; } ) ; / / and nothing else is happening assert equals ( tobaccos size ( ) , appender get log size ( ) ) ; }


private void initialize script paths ( ) { string buffer buf = new string buffer ( " headless script paths : " ) ; for ( resource file dir : ghidra script util get script source directories ( ) ) { buf append ( " \ n " ) ; buf append ( dir get absolute path ( ) ) ; } msg info ( headless analyzer class , buf to string ( ) ) ; }


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


asserts that the specified file is a jar file with a manifest containing a non - empty classpath attribute

private static void assert jar ( file file ) throws i o exception { jar file jar file = null ; try { jar file = new jar file ( file ) ; manifest manifest = jar file get manifest ( ) ; assert not null ( manifest ) ; attributes main attributes = manifest get main attributes ( ) ; assert not null ( main attributes ) ; assert true ( main attributes contains key ( attributes name class path ) ) ; string class path attr = main attributes get value ( attributes name class path ) ; assert not null ( class path attr ) ; assert false ( class path attr is empty ( ) ) ; } finally { / / it ' s too bad jar file doesn ' t implement closeable if ( jar file ! = null ) { try { jar file close ( ) ; } catch ( i o exception e ) { log warn ( " exception closing jar file : " + jar file , e ) ; } } } }


bind multiple views with an { @ link com marshalchen ultimaterecyclerview swipe swipe layout on reveal listener }

public void add reveal listener ( int [ ] child ids , on reveal listener l ) { for ( int i : child ids ) add reveal listener ( i , l ) ; }


specify a custom hessian connection factory to use for the hessian client

public void set connection factory ( hessian connection factory connection factory ) { this proxy factory set connection factory ( connection factory ) ; }


add a group to cache , only netgroups are cached

public void cache groups add ( list < string > groups ) throws i o exception { for ( string group : groups ) { if ( group length ( ) = = 0 ) { / / better safe than sorry ( should never happen ) } else if ( group char at ( 0 ) = = ' @ ' ) { if ( ! netgroup cache is cached ( group ) ) { netgroup cache add ( group , get users for netgroup ( group ) ) ; } } else { / / unix group , not caching } } }


create a builder with the given http status

static body builder status ( int status ) { return new default server response builder ( status ) ; }


sets the ports that this { @ link cookie } can be accessed on


specifies that the entry should be automatically removed from the cache once the duration has elapsed after its last read to indicate no expiration an entry may be given an excessively long period , such as { @ code long # max value } the { @ code current duration } may be returned to not modify the expiration time < b > note : < b > the { @ code current time } is supplied by the configured { @ link ticker } and by default does not relate to system or wall - clock time when calculating the duration based on a time stamp , the current time should be obtained independently

long expire after read ( @ non null k key , @ non null v value , long current time , @ non negative long current duration ) ;


checks that in a streaming use case where checkpointing is enabled and the number of execution retries is set to 0 , restarting is deactivated

public void test no restarting when checkpointing and explicit execution retries zero ( ) throws exception { stream execution environment env = stream execution environment get execution environment ( ) ; env enable checkpointing ( 500 ) ; env set number of execution retries ( 0 ) ; env from elements ( 1 ) print ( ) ; stream graph graph = env get stream graph ( ) ; job graph job graph = graph get job graph ( ) ; restart strategies restart strategy configuration restart strategy = job graph get serialized execution config ( ) deserialize value ( get class ( ) get class loader ( ) ) get restart strategy ( ) ; assert assert not null ( restart strategy ) ; assert assert true ( restart strategy instanceof restart strategies no restart strategy configuration ) ; }


sets the static partition into the { @ link table sink } the static partition may be partial of all partition columns see the class javadoc for more details the static partition is represented as a { @ code map < string , string > } which maps from partition field name to partition value the partition values are all encoded as strings , i e encoded using string value of ( ) for example , if we have a static partition { @ code f 0 = 1024 , f 1 = " foo " , f 2 = " bar " } f 0 is an integer type , f 1 and f 2 are string types they will all be encoded as strings : " 1024 " , " foo " , " bar " and can be decoded to original literals based on the field types

void set static partition ( map < string , string > partitions ) ;


this test checks that the rocks d b native code loader still responds to resetting the init flag

public void test reset init flag ( ) throws exception { rocks d b state backend reset rocks d b loaded flag ( ) ; }


test the property ' map of enum string '

public void map of enum string test ( ) { / / todo : test map of enum string }


public static void nearby ( team team , float x , float y , float width , float height , cons < unit > cons ) { team data ( ) tree ( ) intersect ( x , y , width , height , cons ) ; }


create a shell command executor object using the user ' s name

protected shell command executor create group executor ( string user name ) { return new shell command executor ( get groups for user command ( user name ) , null , null , timeout ) ; }


returns the media start time of the chunk , in microseconds


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


extract a map from the given { @ link map message }

protected map < string , object > extract map from message ( map message message ) throws j m s exception { map < string , object > map = new hash map < > ( ) ; enumeration < string > en = message get map names ( ) ; while ( en has more elements ( ) ) { string key = en next element ( ) ; map put ( key , message get object ( key ) ) ; } return map ; }


returns the char array which this buffer is based on , if there is one

public final char [ ] array ( ) { return protected array ( ) ; }


formats a string to the equate error format given the value used for rendering formatted equates that do not point back to a datatype

public static string format name for equate error ( long equate value ) { return " 0x " + long to string ( equate value , 16 ) + " " + equate manager error tag ; }


public boolean get attribute boolean ( ) { return attribute boolean ; }


alternative to { @ link # annotation introspector ( annotation introspector ) } that allows combining with rather than replacing the currently set introspector , e g via { @ link annotation introspector pair # pair ( annotation introspector , annotation introspector ) }

public jackson 2 object mapper builder annotation introspector ( function < annotation introspector , annotation introspector > pairing function ) { this annotation introspector = pairing function apply ( this annotation introspector ) ; return this ; }


public model api response upload file with required file ( long pet id , file required file , string additional metadata ) throws api exception { return upload file with required file with http info ( pet id , required file , additional metadata ) get data ( ) ; }


a variant of { @ link # set allowed origins ( string ) } that accepts flexible domain patterns , e g { @ code " https : domain 1 com " } furthermore it always sets the { @ code access - control - allow - origin } response header to the matched origin and never to { @ code " " } , nor to any other pattern

stomp web socket endpoint registration set allowed origin patterns ( string origin patterns ) ;


used to record the modification of a symlink node

public i node save child 2 snapshot ( i node directory current i node , final i node child , final int latest snapshot id , final i node snapshot copy ) { preconditions check argument ( ! child is directory ( ) , " child is a directory , child = % s " , child ) ; preconditions check argument ( latest snapshot id ! = snapshot current state id ) ; final directory diff diff = diffs check and add latest snapshot diff ( latest snapshot id , current i node ) ; if ( diff get child ( child get local name bytes ( ) , false , current i node ) ! = null ) { / / it was already saved in the latest snapshot earlier return child ; } diff diff modify ( snapshot copy , child ) ; return child ; }


decrement number of markers , resetting buffer if we hit 0

public void release ( int marker ) { int expected mark = - num markers ; if ( marker ! = expected mark ) { throw new illegal state exception ( " release ( ) called with an invalid marker " ) ; } num markers - - ; if ( num markers = = 0 & & p > 0 ) { / / release buffer when we can , but don ' t do unnecessary work / / copy data [ p ] data [ n - 1 ] to data [ 0 ] data [ ( n - 1 ) - p ] , reset ptrs / / p is last valid char ; move nothing if p = = n as we have no valid char system arraycopy ( data , p , data , 0 , n - p ) ; / / shift n - p char from p to 0 n = n - p ; p = 0 ; last char buffer start = last char ; } }


returns the remainder of this long value divided by the given particular long value

public long value remainder ( particular long value other ) { return remainder ( ( specific long value ) other ) ; }


public static byte [ ] byte array and ( byte [ ] mask , byte [ ] bytes ) { byte [ ] result = new byte [ bytes length ] ; if ( mask length ! = bytes length ) { throw new illegal argument exception ( " inappropriate mask " ) ; } for ( int i = 0 ; i < bytes length ; i + + ) { result [ i ] = ( byte ) ( mask [ i ] & bytes [ i ] ) ; } return result ; }


return the result value returned by a successful invocation of the target method , if any

public object get value ( ) { return this value ; }


reads the next token in backward direction from the heuristic scanner and sets the fields < code > f token , f previous position < code > and < code > f position < code > accordingly

private void next token ( ) { next token ( position ) ; }


default mono < response entity < void > > add pet ( @ api param ( value = " pet object that needs to be added to the store " , required = true ) @ valid @ request body mono < pet > body , @ api ignore final server web exchange exchange ) { return get delegate ( ) add pet ( body , exchange ) ; }


returns { @ code true } if and only if the end of the compressed stream has been reached

public boolean is closed ( ) { return current state = = state finished ; }


if the string consists of a single variable , returns the expansion of that variable otherwise , returns null syntax errors are reported

public string expand single make variable ( string attr name , string expression ) { try { return template expander expand single variable ( expression , template context ) ; } catch ( expansion exception e ) { rule context attribute error ( attr name , e get message ( ) ) ; return expression ; } }


returns task temporary paths in this checkpoint

public static list < path > list task temporary paths ( file system fs , path base path , long checkpoint id ) throws exception { list < path > task tmp paths = new array list < > ( ) ; for ( file status task status : fs list status ( new path ( base path , checkpoint name ( checkpoint id ) ) ) ) { if ( is task dir ( task status get path ( ) get name ( ) ) ) { task tmp paths add ( task status get path ( ) ) ; } } return task tmp paths ; }


browser service performance related source

browser app perf to browser app perf ( ) { browser app perf perf = new browser app perf ( ) ; perf set name ( service ) ; to browser app perf source ( perf ) ; return perf ; }


public void set num return instructions ( int return instructions ) { this num return instructions = return instructions ; }


path to a file within the apk ( typically restype - configentry ext ) < code > optional string path = 1 ; < code >

public builder set path bytes ( com google protobuf byte string value ) { copy on write ( ) ; instance set path bytes ( value ) ; return this ; }


given a list of path components returns a byte array

public static byte [ ] byte array 2bytes ( byte [ ] [ ] path components ) { if ( path components length = = 0 | | ( path components length = = 1 & & ( path components [ 0 ] = = null | | path components [ 0 ] length = = 0 ) ) ) { return empty bytes ; } int length = 0 ; for ( int i = 0 ; i < path components length ; i + + ) { length + = path components [ i ] length ; if ( i < path components length - 1 ) { length + + ; / / for separator } } byte [ ] path = new byte [ length ] ; int index = 0 ; for ( int i = 0 ; i < path components length ; i + + ) { system arraycopy ( path components [ i ] , 0 , path , index , path components [ i ] length ) ; index + = path components [ i ] length ; if ( i < path components length - 1 ) { path [ index ] = ( byte ) path separator char ; index + + ; } } return path ; }


the value assigned to this element < code > optional aapt pb item item = 3 ; < code >

private void set item ( com android aapt resources item value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } item = value ; bit field 0 | = 0x 0 0 0 0 0 0 0 4 ; }


private void register invalid name report ( ) throws i o exception { string ns 0 = cluster get nameservices ( ) get ( 0 ) ; list < ? extends federation namenode context > origin = resolver get namenodes for nameservice id ( ns 0 ) ; federation namenode context nn info = origin get ( 0 ) ; namenode status report report = new namenode status report ( ns 0 , nn info get namenode id ( ) , nn info get rpc address ( ) , nn info get service address ( ) , nn info get lifeline address ( ) , nn info get web scheme ( ) , nn info get web address ( ) ) ; report set registration valid ( false ) ; assert true ( resolver register namenode ( report ) ) ; resolver load cache ( true ) ; }


public float get scale x ( ) { return m scale x ; }


add a filter for specific url patterns this is delegated to { @ link configurable mock mvc builder # add filter ( filter , string ) }

< t extends b > t filter ( filter filter , string url patterns ) ;


creates list of users with given input array

public void create users with list input test ( test context context ) { async async = context async ( ) ; list < user > user = null ; api create users with list input ( user , result - > { / / todo : test validations async complete ( ) ; } ) ; }


the analysis function used e g count , rare , min etc

public detector function get function ( ) { return function ; }


returns the index of the last operation that is not a nop

public int get last active op index ( ) { return last active op index ; }


phrase abbr ( string selector , string cdata ) ; / / acronym omitted , use abbr


save a specific version as the last execute version

static void save last exec version ( @ non null string version ) { file last exec version file = get last exec version file ( ) ; try { file utils write ( last exec version file , version , charset default charset ( ) ) ; } catch ( i o exception e ) { logger log ( severe , " failed to save " + last exec version file get absolute path ( ) , e ) ; } }


get an array of object inspector from the give array of args and their types

public static object inspector [ ] to inspectors ( hive shim hive shim , object [ ] args , data type [ ] arg types ) { assert args length = = arg types length ; object inspector [ ] argument inspectors = new object inspector [ arg types length ] ; for ( int i = 0 ; i < arg types length ; i + + ) { object constant = args [ i ] ; if ( constant = = null ) { argument inspectors [ i ] = type info utils get standard java object inspector from type info ( hive type util to hive type info ( arg types [ i ] , false ) ) ; } else { primitive type info primitive type info = ( primitive type info ) hive type util to hive type info ( arg types [ i ] , false ) ; constant = get conversion ( get object inspector ( primitive type info ) , arg types [ i ] get logical type ( ) , hive shim ) to hive object ( constant ) ; argument inspectors [ i ] = get object inspector for primitive constant ( primitive type info , constant , hive shim ) ; } } return argument inspectors ; }


do the actual work of walking epsilon edges

protected void closure ( a t n config config , a t n config set configs , set < a t n config > closure busy , boolean collect predicates , boolean full ctx , int depth , boolean treat eof as epsilon ) { a t n state p = config state ; / / optimization if ( ! p only has epsilon transitions ( ) ) { configs add ( config , merge cache ) ; / / make sure to not return here , because eof transitions can act as / / both epsilon transitions and non - epsilon transitions / / if ( debug ) system out println ( " added config " + configs ) ; } for ( int i = 0 ; i < p get number of transitions ( ) ; i + + ) { if ( i = = 0 & & can drop loop entry edge in left recursive rule ( config ) ) continue ; transition t = p transition ( i ) ; boolean continue collecting = ! ( t instanceof action transition ) & & collect predicates ; a t n config c = get epsilon target ( config , t , continue collecting , depth = = 0 , full ctx , treat eof as epsilon ) ; if ( c ! = null ) { int new depth = depth ; if ( config state instanceof rule stop state ) { assert ! full ctx ; / / target fell off end of rule ; mark resulting c as having dipped into outer context / / we can ' t get here if incoming config was rule stop and we had context / / track how far we dip into outer context might / / come in handy and we avoid evaluating context dependent / / preds if this is > 0 if ( dfa ! = null & & dfa is precedence dfa ( ) ) { int outermost precedence return = ( ( epsilon transition ) t ) outermost precedence return ( ) ; if ( outermost precedence return = = dfa atn start state rule index ) { c set precedence filter suppressed ( true ) ; } } c reaches into outer context + + ; if ( ! closure busy add ( c ) ) { / / avoid infinite recursion for right - recursive rules continue ; } configs dips into outer context = true ; / / todo : can remove ? only care when we add to set per middle of this method assert new depth > integer min value ; new depth - - ; if ( debug ) system out println ( " dips into outer ctx : " + c ) ; } else { if ( ! t is epsilon ( ) & & ! closure busy add ( c ) ) { / / avoid infinite recursion for eof * and eof + continue ; } if ( t instanceof rule transition ) { / / latch when new depth goes negative - once we step out of the entry context we can ' t return if ( new depth > = 0 ) { new depth + + ; } } } closure checking stop state ( c , configs , closure busy , continue collecting , full ctx , new depth , treat eof as epsilon ) ; } } }


public path get path ( ) { return path ; }


sets the maximum allowed number of dns queries to send when resolving a host name

public dns name resolver builder max queries per resolve ( int max queries per resolve ) { this max queries per resolve = max queries per resolve ; return this ; }


case in - sensitive find of the first index within a char sequence from the specified position this method optimized and works correctly for ascii char sequences only a { @ code null } char sequence will return { @ code - 1 } a negative start position is treated as zero an empty ( " " ) search char sequence always matches a start position greater than the string length only matches an empty search char sequence ascii string index of ignore case ( null , , ) = - 1 ascii string index of ignore case ( , null , ) = - 1 ascii string index of ignore case ( " " , " " , 0 ) = 0 ascii string index of ignore case ( " aabaabaa " , " a " , 0 ) = 0 ascii string index of ignore case ( " aabaabaa " , " b " , 0 ) = 2 ascii string index of ignore case ( " aabaabaa " , " ab " , 0 ) = 1 ascii string index of ignore case ( " aabaabaa " , " b " , 3 ) = 5 ascii string index of ignore case ( " aabaabaa " , " b " , 9 ) = - 1 ascii string index of ignore case ( " aabaabaa " , " b " , - 1 ) = 2 ascii string index of ignore case ( " aabaabaa " , " " , 2 ) = 2 ascii string index of ignore case ( " abc " , " " , 9 ) = - 1

public static int index of ignore case ascii ( final char sequence str , final char sequence search str , int start pos ) { if ( str = = null | | search str = = null ) { return index not found ; } if ( start pos < 0 ) { start pos = 0 ; } int search str len = search str length ( ) ; final int end limit = str length ( ) - search str len + 1 ; if ( start pos > end limit ) { return index not found ; } if ( search str len = = 0 ) { return start pos ; } for ( int i = start pos ; i < end limit ; i + + ) { if ( region matches ascii ( str , true , i , search str , 0 , search str len ) ) { return i ; } } return index not found ; }


report whether the last column read had a value of sql { @ code null } note that you must first call one of the getter methods and then call the { @ code was null ( ) } method

boolean was null ( ) throws invalid result set access exception ;


gets called after the { @ link byte to message decoder } was removed from the actual context and it doesn ' t handle events anymore

protected void handler removed 0 ( channel handler context ctx ) throws exception { }


public pet get pet by id ( long pet id ) throws api exception { return get pet by id with http info ( pet id ) get data ( ) ; }


determine whether the given response indicates a gzip response the default implementation checks whether the http " content - encoding " header contains " gzip " ( in any casing )

protected boolean is gzip response ( http response http response ) { header encoding header = http response get first header ( http header content encoding ) ; return ( encoding header ! = null & & encoding header get value ( ) ! = null & & encoding header get value ( ) to lower case ( ) contains ( encoding gzip ) ) ; }


return the maximum number of rows specified for this jdbc template

public int get max rows ( ) { return this max rows ; }


compute the " weighting " to give to a sublcuster based on the configured policy weights ( for the active subclusters )

private float get policy config weighting ( sub cluster id target id , allocation bookkeeper allocation bookkeeper ) { float tot weight = allocation bookkeeper tot policy weight ; float local weight = allocation bookkeeper policy weights get ( target id ) ; return ( local weight ! = null & & tot weight > 0 ) ? local weight / tot weight : 0 ; }


reads a big - endian signed integer from the buffer

static int get signed int ( byte buf buf , int offset ) { return ( buf get byte ( offset ) & 0x f f ) < < 24 | ( buf get byte ( offset + 1 ) & 0x f f ) < < 16 | ( buf get byte ( offset + 2 ) & 0x f f ) < < 8 | buf get byte ( offset + 3 ) & 0x f f ; }


interprets the command - line arguments by expanding each pattern to targets and populating the list of { @ code failed patterns }

private static list < expanded pattern > get targets to build ( environment env , target pattern phase key options , immutable map < repository name , repository name > repo mapping , list < string > failed patterns ) throws interrupted exception { immutable list builder < string > canonical patterns = new immutable list builder < > ( ) ; for ( string raw pattern : options get target patterns ( ) ) { canonical patterns add ( target pattern rename repository ( raw pattern , repo mapping ) ) ; } list < target pattern key > pattern sky keys = new array list < > ( options get target patterns ( ) size ( ) ) ; for ( target pattern sky key or exception key or exception : target pattern value keys ( canonical patterns build ( ) , options get build manual tests ( ) ? filtering policies no filter : filtering policies filter manual , options get offset ( ) ) ) { try { pattern sky keys add ( key or exception get sky key ( ) ) ; } catch ( target parsing exception e ) { failed patterns add ( key or exception get original pattern ( ) ) ; / / we post a pattern expanding error here - the pattern could not be parsed , so we don ' t even / / get to run target pattern function env get listener ( ) post ( pattern expanding error failed ( key or exception get original pattern ( ) , e get message ( ) ) ) ; / / we generally skip patterns that don ' t parse we report a parsing failed exception to the / / event bus here , but not in determine tests below , which goes through the same list note / / that the target pattern function otherwise reports these events ( but only if the target / / pattern could be parsed successfully ) env get listener ( ) post ( new parsing failed event ( key or exception get original pattern ( ) , e get message ( ) ) ) ; try { env get value or throw ( target pattern error function key ( e get message ( ) ) , target parsing exception class ) ; } catch ( target parsing exception ignore ) { / / we ignore this keep going is active } env get listener ( ) handle ( event error ( " skipping ' " + key or exception get original pattern ( ) + " ' : " + e get message ( ) ) ) ; } } map < sky key , value or exception < target parsing exception > > resolved patterns = env get values or throw ( pattern sky keys , target parsing exception class ) ; list < expanded pattern > expanded patterns = new array list < > ( pattern sky keys size ( ) ) ; for ( target pattern key pattern : pattern sky keys ) { target pattern value value ; try { value = ( target pattern value ) resolved patterns get ( pattern ) get ( ) ; } catch ( target parsing exception e ) { string raw pattern = pattern get pattern ( ) ; string error message = e get message ( ) ; failed patterns add ( raw pattern ) ; env get listener ( ) post ( pattern expanding error failed ( raw pattern , error message ) ) ; env get listener ( ) handle ( event error ( " skipping ' " + raw pattern + " ' : " + error message ) ) ; continue ; } if ( value = = null ) { continue ; } / / todo ( ulfjack ) : this is terribly inefficient resolved targets < target > as targets = tests for target pattern function labels to targets ( env , value get targets ( ) get targets ( ) , value get targets ( ) has error ( ) ) ; if ( as targets = = null ) { continue ; } expanded patterns add ( expanded pattern of ( pattern , as targets ) ) ; } return expanded patterns ; }


adds or removes the necessary occurrences of an element such that the element attains the desired count

public builder < e > set count ( e element , int count ) { super set count ( element , count ) ; return this ; }


thread - safe call to update disk stats update occurs if the thread is able to acquire the lock ( i e , no other thread is updating it at the same time ) , and it has been at least restat interval ms since the last update assumes that initialization has been completed before this method is called

private void maybe update stats ( ) { / / update the free space if able to get the lock , / / with a frequency of once in restat interval ms if ( lock try lock ( ) ) { try { if ( ( system clock uptime millis ( ) - m last restat time ) > restat interval ms ) { update stats ( ) ; } } finally { lock unlock ( ) ; } } }


the set of arityplural mappings < code > repeated aapt pb plural entry entry = 1 ; < code >

public java util list < com android aapt resources plural entry > get entry list ( ) { return java util collections unmodifiable list ( instance get entry list ( ) ) ; }


public show block name get show block name ( ) { return options show block name ; }


public boolean replace ( k key , v old value , v new value ) { return false ; }


joins a multicast group and notifies the { @ link channel future } once the operation completes

channel future join group ( inet address multicast address ) ;


the creation timestamp of the resource < code > google protobuf timestamp create time = 2 ; < code >

public builder set create time ( com google protobuf timestamp builder builder for value ) { if ( create time builder = = null ) { create time = builder for value build ( ) ; on changed ( ) ; } else { create time builder set message ( builder for value build ( ) ) ; } return this ; }


releases an output buffer back to the decoder

protected void release output buffer ( o output buffer ) { synchronized ( lock ) { release output buffer internal ( output buffer ) ; maybe notify decode loop ( ) ; } }


invoked when the user has set a new target state ( e g paused )

void on connector target state change ( string connector ) ;


public static map < string , string > convert directed list to map ( final list < string > input list ) { val mappings = new tree map < string , string > ( ) ; input list stream ( ) map ( s - > { val bits = splitter on ( " - > " ) split to list ( s ) ; return pair of ( bits get ( 0 ) , bits size ( ) > 1 ? bits get ( 1 ) : string utils empty ) ; } ) for each ( p - > mappings put ( p get key ( ) , p get value ( ) ) ) ; return mappings ; }


returns all variations of this policy based on the configuration parameters

public static set < policy > policies ( config config ) { s 4 window tiny lfu settings settings = new s 4 window tiny lfu settings ( config ) ; return settings percent main ( ) stream ( ) map ( percent main - > new s 4 window tiny lfu policy ( percent main , settings ) ) collect ( to set ( ) ) ; }


turn an html href reference into an absolute path this will locate files based upon relative references , specialized help system references ( i e , helptopics ) , and absolute u r ls

public static path locate reference ( path source file , string ref ) throws u r i syntax exception { uri resolved = resolve ( source file , ref ) ; if ( is remote ( resolved ) ) { return null ; } / / non - remote / local path path ref path = create path from u r i ( source file , resolved ) ; return ref path ; }


convert the select clause if it contains invalid column names which conflict with s q lite keywords

public static string [ ] convert select clause to valid names ( string [ ] columns ) { if ( columns ! = null & & columns length > 0 ) { string [ ] converted columns = new string [ columns length ] ; for ( int i = 0 ; i < columns length ; i + + ) { converted columns [ i ] = convert to valid column name ( columns [ i ] ) ; } return converted columns ; } return null ; }


causes the contents to be clipped if they exceed the table ' s bounds enabling clipping sets { @ link # set transform ( boolean ) } to true

public void set clip ( boolean enabled ) { clip = enabled ; set transform ( enabled ) ; invalidate ( ) ; }


get the current number of nodes in the cluster a valid values is available after a call to allocate has been made

public int get cluster node count ( ) { return client get cluster node count ( ) ; }


configure the host name verification for this handler this method is introduced only for unit testing and should never be used in production

public void set disable host name verification ( boolean disable host name verification ) { this disable host name verification = disable host name verification ; }


finds pets by status multiple status values can be provided with comma separated strings

public completable future < api response < list < pet > > > find pets by status with http info ( list < string > status ) throws api exception { try { http request builder local var request builder = find pets by status request builder ( status ) ; return member var http client send async ( local var request builder build ( ) , http response body handlers of string ( ) ) then compose async ( local var response - > { if ( local var response status code ( ) / 100 ! = 2 ) { return completable future failed future ( get api exception ( " find pets by status " , local var response ) ) ; } try { return completable future completed future ( new api response < list < pet > > ( local var response status code ( ) , local var response headers ( ) map ( ) , member var object mapper read value ( local var response body ( ) , new type reference < list < pet > > ( ) { } ) ) ) ; } catch ( i o exception e ) { return completable future failed future ( new api exception ( e ) ) ; } } ) ; } catch ( api exception e ) { return completable future failed future ( e ) ; } }


public void inject ( object thiz ) { a router inject ( thiz ) ; }


according to the custom enhancement file , return lass description nodes in the file

private node list resolver file class desc ( file file ) throws parser configuration exception , i o exception , s a x exception { document builder factory factory = document builder factory new instance ( ) ; document builder builder = factory new document builder ( ) ; document doc = builder parse ( file ) ; return doc get elements by tag name ( constants xml element class ) ; }


specify a { @ link supplier sql supplier } that provides sql to run contract for specifying an sql call along with options leading to the execution the sql string can contain either native parameter bind markers or named parameters ( e g { @ literal : foo , : bar } ) when { @ link named parameter expander } is enabled accepts { @ link prepared operation } as sql and binding { @ link supplier }

generic execute spec sql ( supplier < string > sql supplier ) ; / / static factory methods


static boolean equals variable time ( char sequence s 1 , char sequence s 2 ) { return ascii string content equals ( s 1 , s 2 ) ; }


append tokens from list of files in local filesystem , saving to last file

public static void append token files ( array list < file > token files , string file format , configuration conf ) throws i o exception { credentials new creds = new credentials ( ) ; file last token file = null ; for ( file token file : token files ) { last token file = token file ; credentials creds = credentials read token storage file ( token file , conf ) ; for ( token < ? > token : creds get all tokens ( ) ) { new creds add token ( token get service ( ) , token ) ; } } do formatted write ( last token file , file format , new creds , conf ) ; }


regression test for hdfs - 2742 the issue in this bug was : - dn does a block report while file is open this br contains the block in rbw state - standby queues the rbw state in pending datanode messages - standby processes edit logs during failover before fixing this bug , it was mistakenly applying the rbw reported state after the block had been completed , causing the block to get marked corrupt instead , we should now be applying the rbw message on op add , and then the finalized message on op close

public void test block reports while file being written ( ) throws exception { f s data output stream out = fs create ( test file path ) ; try { append test util write ( out , 0 , 10 ) ; out hflush ( ) ; / / block report will include the rbw replica , but will be / / queued on the standby node cluster trigger block reports ( ) ; } finally { i o utils close stream ( out ) ; } cluster transition to standby ( 0 ) ; cluster transition to active ( 1 ) ; / / verify that no replicas are marked corrupt , and that the / / file is readable from the failed - over standby block manager test util update state ( nn 1 get namesystem ( ) get block manager ( ) ) ; block manager test util update state ( nn 2 get namesystem ( ) get block manager ( ) ) ; assert equals ( 0 , nn 1 get namesystem ( ) get corrupt replica blocks ( ) ) ; assert equals ( 0 , nn 2 get namesystem ( ) get corrupt replica blocks ( ) ) ; d f s test util read file ( fs , test file path ) ; }


writes this dependency set object for a specified output file under the root dir , and with a given suffix

public void write ( path out file , string suffix ) throws i o exception { path dotd file = out file get relative ( file system utils replace extension ( out file as fragment ( ) , suffix ) ) ; try ( print stream out = new print stream ( dotd file get output stream ( ) ) ) { out print ( out file relative to ( root ) + " : " ) ; for ( path d : dependencies ) { out print ( " \ \ \ n " + d get path string ( ) ) ; / / should already be root relative } out println ( ) ; } }


returns a new instance that writes utf - 8 encoded json to { @ code sink }

public static json writer of ( buffered sink sink ) { return new json utf 8 writer ( sink ) ; }


path to a file within the apk ( typically restype - configentry ext ) < code > optional string path = 1 ; < code >

public com google protobuf byte string get path bytes ( ) { return com google protobuf byte string copy from utf 8 ( path ) ; }


generate salted md5 hash for specified message supplied salt is returned as prefix to returned hash

public static char [ ] get salted m d 5 hash ( char [ ] salt , char [ ] msg ) { return hash utilities get salted hash ( hash utilities md5 algorithm , salt , msg ) ; }


return matches for the given url path not thread - safe

public list < t > get mappings by direct path ( server web exchange exchange ) { string path = exchange get request ( ) get path ( ) path within application ( ) value ( ) ; return this path lookup get ( path ) ; }


private static placement rule create rule ( element element ) throws allocation configuration exception { string rule name = element get attribute ( " name " ) ; if ( " " equals ( rule name ) ) { throw new allocation configuration exception ( " no name provided for a " + " rule element " ) ; } class < ? extends placement rule > rule class = null ; if ( rules contains key ( rule name ) ) { rule class = rules get ( rule name ) rule class ; } if ( rule class = = null ) { throw new allocation configuration exception ( " no rule class found for " + rule name ) ; } return get placement rule ( rule class , element ) ; }


generates a class object from the generated byte code

class < ? > define factory ( string name , byte [ ] bytes ) { return define class ( name , bytes , 0 , bytes length , codesource ) ; }


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


check whether this exception contains an exception of the given type : either it is of the given class itself or it contains a nested cause of the given type

public boolean contains ( @ nullable class < ? > ex type ) { if ( ex type = = null ) { return false ; } if ( ex type is instance ( this ) ) { return true ; } throwable cause = get cause ( ) ; if ( cause = = this ) { return false ; } if ( cause instanceof nested checked exception ) { return ( ( nested checked exception ) cause ) contains ( ex type ) ; } else { while ( cause ! = null ) { if ( ex type is instance ( cause ) ) { return true ; } if ( cause get cause ( ) = = cause ) { break ; } cause = cause get cause ( ) ; } return false ; } }


create a readable and parseable audit log string for a failed event

public static void log failure ( string user , string operation , string perm , string target , string description , application id app id , container id container id , resource resource ) { if ( log is warn enabled ( ) ) { log warn ( create failure log ( user , operation , perm , target , description , app id , null , container id , resource ) ) ; } }


given an index , return a string to use as the filename

public static string filename of index ( final int i ) { return string format ( " % s % 0 3d " , prefix , i ) ; }


create a new { @ link channel future } which is marked as succeeded already so { @ link channel future # is success ( ) } will return { @ code true } all { @ link future listener } added to it will be notified directly also every call of blocking methods will just return without blocking

channel future new succeeded future ( ) ;


configure a limit on the number of bytes that can be buffered whenever the input stream needs to be aggregated this can be a result of decoding to a single { @ code data buffer } , { @ link java nio byte buffer byte buffer } , { @ code byte [ ] } , { @ link org springframework core io resource resource } , { @ code string } , etc it can also occur when splitting the input stream , e g delimited text , in which case the limit applies to data buffered between delimiters by default this is set to 256k

public void set max in memory size ( int byte count ) { this string decoder set max in memory size ( byte count ) ; }


return all the files that match file pattern and are not checksum files results are sorted by their names a filename pattern is composed of regular characters and special pattern matching characters , which are : < dl > < dd > < dl > < dt > < tt > ? < tt > < dd > matches any single character < dt > < tt > < tt > < dd > matches zero or more characters < dt > < tt > [ abc ] < tt > < dd > matches a single character from character set < tt > { a , b , c } < tt > < dt > < tt > [ a - b ] < tt > < dd > matches a single character from the character range < tt > { a b } < tt > note : character < tt > a < tt > must be lexicographically less than or equal to character < tt > b < tt > < dt > < tt > [ ^ a ] < tt > < dd > matches a single char that is not from character set or range < tt > { a } < tt > note that the < tt > ^ < tt > character must occur immediately to the right of the opening bracket < dt > < tt > \ c < tt > < dd > removes ( escapes ) any special meaning of character c < dt > < tt > { ab , cd } < tt > < dd > matches a string from the string set < tt > { ab , cd } < tt > < dt > < tt > { ab , c { de , fh } } < tt > < dd > matches a string from string set < tt > { ab , cde , cfh } < tt > < dl > < dd > < dl >

public file status [ ] glob status ( path path pattern ) throws access control exception , unsupported file system exception , i o exception { return new globber ( file context this , path pattern , default filter ) glob ( ) ; }


adds a parameter annotations item to this class

public void add parameter annotations ( cst method ref method , annotations list list , dex file dex file ) { annotations directory add parameter annotations ( method , list , dex file ) ; }


set the name of the script engine for evaluating the scripts ( e g " groovy " ) , as exposed by the jsr - 223 script engine factory

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


specify whether parameters should be bound by name

public void set named binding ( boolean named binding ) { this named binding = named binding ; }


public static void main ( string [ ] args ) { var mw = new array transpose master worker ( ) ; var rows = 10 ; var columns = 20 ; var input matrix = array utility methods create random int matrix ( rows , columns ) ; var input = new array input ( input matrix ) ; var result = ( array result ) mw get result ( input ) ; if ( result ! = null ) { array utility methods print matrix ( input matrix ) ; array utility methods print matrix ( result data ) ; } else { logger info ( " please enter non - zero input " ) ; } }


clears the caches for the given shard id if the shard is still allocated on this node

public void clear index shard cache ( shard id shard id , boolean query cache , boolean field data cache , boolean request cache , string fields ) { final index service service = index service ( shard id get index ( ) ) ; if ( service ! = null ) { index shard shard = service get shard or null ( shard id id ( ) ) ; final boolean cleared at least one = service clear caches ( query cache , field data cache , fields ) ; if ( ( request cache | | ( cleared at least one = = false & & fields length = = 0 ) ) & & shard ! = null ) { indices request cache clear ( new index shard cache entity ( shard ) ) ; } } }


test that program diff correctly ignores addresses

public void test ignore address set ( ) throws exception { program builder 1 create memory ( " d 1 " , " 0x 1 0 0 " , 0x 1 0 0 , null , ( byte ) 0x a c ) ; program builder 1 create memory ( " d 2 " , " 0x 2 0 0 " , 0x 1 0 0 ) ; program builder 1 create label ( " 0x 0 1 0 0 6 4 2 0 " , " function 1 " ) ; program builder 1 create comment ( " 0x 0 1 0 0 5 9a 3 " , " here we are " , code unit eol comment ) ; program builder 2 create memory ( " d 1 " , " 0x 1 0 0 " , 0x 1 0 0 , null , ( byte ) 0x a f ) ; program builder 2 create memory ( " d 4 " , " 0x 4 0 0 " , 0x 1 0 0 ) ; program builder 2 create label ( " 0x 0 1 0 0 6 4 2 0 " , " function 2 " ) ; program builder 2 create comment ( " 0x 0 1 0 0 5 9a 3 " , " there you have it " , code unit eol comment ) ; program diff = new program diff ( p 1 , p 2 ) ; program diff set filter ( new program diff filter ( program diff filter all diffs ) ) ; address set view diffs ; / / before ignore it should detect diffs diffs = program diff get differences ( task monitor adapter dummy monitor ) ; assert true ( diffs contains ( addr ( p 1 , 0x 0 1 0 0 6 4 2 0 ) ) ) ; assert true ( diffs contains ( addr ( p 1 , 0x 0 1 0 0 5 9a 3 ) ) ) ; / / ignore is initially empty assert equals ( new address set ( ) , program diff get ignore address set ( ) ) ; / / ignore returns what has been ignored program diff ignore ( new address set ( addr ( p 1 , 0x 0 1 0 0 6 4 2 0 ) , addr ( p 1 , 0x 0 1 0 0 6 5 8 0 ) ) ) ; program diff ignore ( new address set ( addr ( p 1 , 0x 0 1 0 0 5 9a 3 ) , addr ( p 1 , 0x 0 1 0 0 5c 6d ) ) ) ; address set as = new address set ( ) ; as add range ( addr ( p 1 , 0x 0 1 0 0 6 4 2 0 ) , addr ( p 1 , 0x 0 1 0 0 6 5 8 0 ) ) ; as add range ( addr ( p 1 , 0x 0 1 0 0 5 9a 3 ) , addr ( p 1 , 0x 0 1 0 0 5c 6d ) ) ; assert equals ( as , program diff get ignore address set ( ) ) ; / / ignore set is used by the diff diffs = program diff get differences ( new program diff filter ( program diff filter all diffs ) , task monitor adapter dummy monitor ) ; assert true ( ! diffs contains ( addr ( p 1 , 0x 0 1 0 0 6 4 2 0 ) ) & & ! diffs contains ( addr ( p 1 , 0x 0 1 0 0 5 9a 3 ) ) ) ; / / ignore set can be cleared program diff clear ignore address set ( ) ; assert equals ( new address set ( ) , program diff get ignore address set ( ) ) ; }


build the { @ link url u r ls } from the specified { @ link service instance }

list < url > build ( service instance service instance ) ;


assert that lstrip ( ) , rstrip ( ) , and strip ( ) produce the expected result for a given input string and chars argument if chars is null no argument is passed

private void check strip ( string input , object chars , string exp left , string exp right , string exp both ) throws exception { if ( chars = = null ) { ev new scenario ( ) update ( " s " , input ) test expression ( " s lstrip ( ) " , exp left ) test expression ( " s rstrip ( ) " , exp right ) test expression ( " s strip ( ) " , exp both ) ; } else { ev new scenario ( ) update ( " s " , input ) update ( " chars " , chars ) test expression ( " s lstrip ( chars ) " , exp left ) test expression ( " s rstrip ( chars ) " , exp right ) test expression ( " s strip ( chars ) " , exp both ) ; } }


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


gets the { @ link standard socket options # so reuseaddr } option

datagram channel config set reuse address ( boolean reuse address ) ;


find the fields constant that matches field id , or null if its not found

public static fields find by thrift id ( int field id ) { switch ( field id ) { case 1 : / / name return name ; case 2 : / / uploaded jar location return uploaded jar location ; case 3 : / / json conf return json conf ; case 4 : / / topology return topology ; case 5 : / / options return options ; default : return null ; } }


count how many bytes would be written if all records were directly serialized

public void calc raw data size ( ) throws i o exception { int record index = 0 ; for ( int file index = 0 ; file index < this parallelism ; file index + + ) { byte counter byte counter = new byte counter ( ) ; for ( int file count = 0 ; file count < this get number of tuples per file ( file index ) ; file count + + , record index + + ) { write record ( this get record ( record index ) , new data output view stream wrapper ( byte counter ) ) ; } this raw data sizes [ file index ] = byte counter get length ( ) ; } }


call org jenkinsci plugins dependencytest depender depender get value ( )

private string call depender value ( ) throws exception { class < ? > c = r jenkins get plugin manager ( ) uber class loader load class ( " org jenkinsci plugins dependencytest depender depender " ) ; method m = c get method ( " get value " ) ; return ( string ) m invoke ( null ) ; }


public void set background ( color color ) { root panel set background ( color ) ; }


invalidate all managed texture arrays this is an internal method do not use it !

public static void invalidate all texture arrays ( application app ) { array < texture array > managed texture array = managed texture arrays get ( app ) ; if ( managed texture array = = null ) return ; for ( int i = 0 ; i < managed texture array size ; i + + ) { texture array texture array = managed texture array get ( i ) ; texture array reload ( ) ; } }


add anonymous parameters , specifying only their sql types as defined in the { @ code java sql types } class parameter ordering is significant this method is an alternative to the { @ link # declare parameter } method , which should normally be preferred

public void set types ( @ nullable int [ ] types ) throws invalid data access api usage exception { if ( is compiled ( ) ) { throw new invalid data access api usage exception ( " cannot add parameters once query is compiled " ) ; } if ( types ! = null ) { for ( int type : types ) { declare parameter ( new sql parameter ( type ) ) ; } } }


disposes any pixmap pages which don ' t have a texture page pixmaps that have a texture will not be disposed until their texture is disposed

public synchronized void dispose ( ) { for ( page page : pages ) { if ( page texture = = null ) { page image dispose ( ) ; } } disposed = true ; }


configures the scanner with the given sequence of rules

public void set rules ( t p rule [ ] rules ) { if ( rules ! = null ) { f rules = new t p rule [ rules length ] ; system arraycopy ( rules , 0 , f rules , 0 , rules length ) ; } else f rules = null ; }


deletes users after every test just in case any test adds any

public void delete users ( ) throws exception { client yaml test response response = get admin execution context ( ) call api ( " security get user " , empty map ( ) , empty list ( ) , empty map ( ) ) ; @ suppress warnings ( " unchecked " ) map < string , object > users = ( map < string , object > ) response get body ( ) ; for ( string user : users key set ( ) ) { map < ? , ? > metadata map = ( map < ? , ? > ) ( ( map < ? , ? > ) users get ( user ) ) get ( " metadata " ) ; boolean reserved = metadata map = = null ? null : ( boolean ) metadata map get ( " reserved " ) ; if ( reserved = = null | | reserved = = false ) { logger warn ( " deleting leftover user { } " , user ) ; get admin execution context ( ) call api ( " security delete user " , singleton map ( " username " , user ) , empty list ( ) , empty map ( ) ) ; } } }


return the files in the target directory if retrieving the list of files requires specific access rights , that access will happen as the specified user the list will not include entries for " " or " "

protected file [ ] read dir as user ( string user , path dir ) { return new file ( dir to string ( ) ) list files ( ) ; }


visit a parse tree produced by { @ link painless parser # declaration }

t visit declaration ( painless parser declaration context ctx ) ;


on a concurrent computation that throws a checked exception , all threads should get the ( wrapped ) exception , with the loader called only once the result should not be cached ( a later request should call the loader again )

private static void test concurrent loading checked exception ( cache builder < object , object > builder ) throws interrupted exception { int count = 10 ; final atomic integer call count = new atomic integer ( ) ; final count down latch start signal = new count down latch ( count + 1 ) ; final i o exception e = new i o exception ( ) ; loading cache < string , string > cache = builder build ( new cache loader < string , string > ( ) { @ override public string load ( string key ) throws i o exception , interrupted exception { call count increment and get ( ) ; start signal await ( ) ; throw e ; } } ) ; list < object > result = do concurrent get ( cache , " bar " , count , start signal ) ; assert equals ( 1 , call count get ( ) ) ; for ( int i = 0 ; i < count ; i + + ) { / / do concurrent get alternates between calling get unchecked and calling get if we call get ( ) , / / we should get an execution exception ; if we call get unchecked ( ) , we should get an / / unchecked execution exception int mod = i % 3 ; if ( mod = = 0 | | mod = = 2 ) { assert that ( result get ( i ) ) is instance of ( execution exception class ) ; assert that ( ( execution exception ) result get ( i ) ) has cause that ( ) is same instance as ( e ) ; } else { assert that ( result get ( i ) ) is instance of ( unchecked execution exception class ) ; assert that ( ( unchecked execution exception ) result get ( i ) ) has cause that ( ) is same instance as ( e ) ; } } / / subsequent calls should call the loader again , not get the old exception try { cache get unchecked ( " bar " ) ; fail ( ) ; } catch ( unchecked execution exception expected ) { } assert equals ( 2 , call count get ( ) ) ; }