ensure that there is waiting ( sleep duration ! = 0 ) if the metrics have only been updated with both successful and failed requests also ensure that the sleep duration decreases over time

public void test success and errors and waiting ( ) { client throttling analyzer analyzer = new client throttling analyzer ( " test " , analysis period ) ; validate ( 0 , analyzer get sleep duration ( ) ) ; analyzer add bytes transferred ( 8 * megabyte , false ) ; analyzer add bytes transferred ( 2 * megabyte , true ) ; sleep ( analysis period plus 10 percent ) ; nano timer timer = new nano timer ( ) ; analyzer suspend if necessary ( ) ; final int expected elapsed time = 126 ; fuzzy validate ( expected elapsed time , timer elapsed time ms ( ) , max acceptable percent difference ) ; sleep ( 10 * analysis period ) ; final int expected sleep duration = 110 ; validate less than or equal ( expected sleep duration , analyzer get sleep duration ( ) ) ; }


parse a serialized metadata value from an ascii string

t parse ascii string ( string serialized ) ;


connect failures do not show up as { @ link # channel inactive } or { @ link # exception caught } , so it needs to be watched

public void connect ( channel handler context ctx , socket address remote address , socket address local address , channel promise promise ) throws exception { final class connect listener implements channel future listener { @ override public void operation complete ( channel future future ) { if ( ! future is success ( ) ) { fail writes ( future cause ( ) ) ; } } } super connect ( ctx , remote address , local address , promise ) ; promise add listener ( new connect listener ( ) ) ; }


reads a potentially huffman encoded byte string

byte string read byte string ( ) throws i o exception { int first byte = read byte ( ) ; boolean huffman decode = ( first byte & 0x 8 0 ) = = 0x 8 0 ; / / 1nnnnnnn int length = read int ( first byte , prefix 7 bits ) ; if ( huffman decode ) { return byte string of ( io grpc okhttp internal framed huffman get ( ) decode ( source read byte array ( length ) ) ) ; } else { return source read byte string ( length ) ; } }


add a bunch of subnets and i p ss to the whitelist check for inclusion in whitelist check for exclusion from whitelist

public void test fixed and local white list ( ) throws i o exception { string [ ] fixed ips = { " 10 119 103 112 " , " 10 221 102 0 / 23 " } ; test file based i p list create file with entries ( " fixedwhitelist txt " , fixed ips ) ; string [ ] variable ips = { " 10 222 0 0 / 16 " , " 10 113 221 221 " } ; test file based i p list create file with entries ( " variablewhitelist txt " , variable ips ) ; configuration conf = new configuration ( ) ; conf set ( whitelist based resolver hadoop security sasl fixedwhitelist file , " fixedwhitelist txt " ) ; conf set boolean ( whitelist based resolver hadoop security sasl variablewhitelist enable , false ) ; conf set long ( whitelist based resolver hadoop security sasl variablewhitelist cache secs , 100 ) ; conf set ( whitelist based resolver hadoop security sasl variablewhitelist file , " variablewhitelist txt " ) ; whitelist based resolver wqr = new whitelist based resolver ( ) ; wqr set conf ( conf ) ; assert equals ( wqr get default properties ( ) , wqr get server properties ( inet address get by name ( " 10 119 103 112 " ) ) ) ; assert equals ( sasl privacy props , wqr get server properties ( " 10 119 103 113 " ) ) ; assert equals ( wqr get default properties ( ) , wqr get server properties ( " 10 221 103 121 " ) ) ; assert equals ( sasl privacy props , wqr get server properties ( " 10 221 104 0 " ) ) ; assert equals ( sasl privacy props , wqr get server properties ( " 10 222 103 121 " ) ) ; assert equals ( sasl privacy props , wqr get server properties ( " 10 223 104 0 " ) ) ; assert equals ( sasl privacy props , wqr get server properties ( " 10 113 221 221 " ) ) ; assert equals ( sasl privacy props , wqr get server properties ( " 10 113 221 222 " ) ) ; assert equals ( wqr get default properties ( ) , wqr get server properties ( " 127 0 0 1 " ) ) ; ; test file based i p list remove file ( " fixedwhitelist txt " ) ; test file based i p list remove file ( " variablewhitelist txt " ) ; }


public boolean is resource change ( ) { return container event is resource change ( ) ; }


option to organize imported datatypes into sub - folders based on their source file name

public void set organize types by source file ( boolean organize types by source file ) { this organize types by source file = organize types by source file ; }


returns the enumeration of the nested set { " c " , " a " , " b " } in the implementation ' s enumeration order

protected list < string > simple result ( ) { return immutable list of ( " c " , " a " , " b " ) ; }


creates a new set of mappings to sandbox the given inputs

private static void create sandbox ( sandboxfs process process , string sandbox name , path fragment root fragment , path scratch dir , sandbox inputs inputs , boolean sandboxfs map symlink targets ) throws i o exception { / / path to the empty file used as the target of mappings that don ' t provide one this is / / lazily created and initialized only when we need such a mapping it ' s safe to share the / / same empty file across all such mappings because this file is exposed as read - only / / / / we cannot use / dev / null , as we used to do in the past , because exposing devices via a / / fuse file system ( which sandboxfs is ) requires root privileges path fragment empty file = null ; / / collection of extra mappings needed to represent the targets of relative symlinks lazily / / created once we encounter the first symlink in the list of inputs map < path fragment , path fragment > symlinks = null ; for ( map entry < path fragment , path > entry : inputs get files ( ) entry set ( ) ) { if ( entry get value ( ) = = null ) { if ( empty file = = null ) { path empty file path = scratch dir get relative ( " empty " ) ; file system utils create empty file ( empty file path ) ; empty file = empty file path as fragment ( ) ; } } else { if ( sandboxfs map symlink targets & & entry get value ( ) is symbolic link ( ) ) { if ( symlinks = = null ) { symlinks = new hash map < > ( ) ; } compute symlink mappings ( entry get key ( ) , entry get value ( ) , symlinks ) ; } } } / / important : keep the code in the lambda passed to create sandbox ( ) free from any operations / / that may block this includes doing any kind of i / o we used to include the loop above in / / this call and doing so cost 2 - 3 % of the total build time measured on an i o s build with many / / actions that have thousands of inputs each @ nullable final path fragment final empty file = empty file ; @ nullable final map < path fragment , path fragment > final symlinks = symlinks ; process create sandbox ( sandbox name , ( mapper ) - > { mapper map ( root fragment , scratch dir as fragment ( ) , true ) ; for ( map entry < path fragment , path > entry : inputs get files ( ) entry set ( ) ) { path fragment target ; if ( entry get value ( ) = = null ) { check not null ( final empty file , " must have been initialized above by matching logic " ) ; target = final empty file ; } else { target = entry get value ( ) as fragment ( ) ; } mapper map ( root fragment get relative ( entry get key ( ) ) , target , false ) ; } if ( final symlinks ! = null ) { for ( map entry < path fragment , path fragment > entry : final symlinks entry set ( ) ) { if ( ! inputs get files ( ) contains key ( entry get key ( ) ) ) { mapper map ( root fragment get relative ( entry get key ( ) ) , entry get value ( ) , false ) ; } } } } ) ; / / sandboxfs probably doesn ' t support symlinks / / todo ( jmmv ) : this claim is simply not true figure out why this code snippet was added and / / address the real problem if ( ! inputs get symlinks ( ) is empty ( ) ) { throw new i o exception ( " sandboxfs sandbox does not support unresolved symlinks " + joiner on ( " , " ) join ( inputs get symlinks ( ) key set ( ) ) ) ; } }


public date get ship date ( ) { return ship date ; }


create a { @ link environment } with random path home and path repo

private environment create environment ( string node name ) { return test environment new environment ( settings builder ( ) put ( node name setting get key ( ) , node name ) put ( path home setting get key ( ) , temp dir resolve ( node name ) to absolute path ( ) ) put ( environment path repo setting get key ( ) , temp dir resolve ( " repo " ) to absolute path ( ) ) put list ( cluster bootstrap service initial master nodes setting get key ( ) , cluster bootstrap service initial master nodes setting get ( settings empty ) ) put ( mapping updated action indices max in flight updates setting get key ( ) , 1000 ) / / o w some tests might block build ( ) ) ; }


determines whether the given method takes a time and unit as its last two parameters

private static boolean is long time unit based ( method method ) { class < ? > [ ] parameter types = method get parameter types ( ) ; return parameter types length > = 2 & & parameter types [ parameter types length - 2 ] = = long class & & parameter types [ parameter types length - 1 ] = = time unit class ; }


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

public map < string , integer > get inventory ( ) throws api exception { api response < map < string , integer > > local var resp = get inventory with http info ( ) ; return local var resp get data ( ) ; }


displays the given file in an editor using the java perspective if something goes wrong , this method has no effect

public static void display in editor ( i file file , i workbench workbench ) { new u i job ( " display in editor " ) { @ override public i status run in u i thread ( i progress monitor m ) { try { i workbench window window = workbench get active workbench window ( ) ; ide open editor ( window get active page ( ) , file ) ; workbench show perspective ( " org eclipse jdt ui java perspective " , window ) ; return status ok status ; } catch ( null pointer exception | workbench exception e ) { return status cancel status ; } } } schedule ( ) ; }


convenience method to indicate if this provider is the active provider ( has focus )

public boolean is active ( ) { return docking tool is active ( this ) ; }


where the entry was defined < code > optional aapt pb source source = 1 ; < code >

public builder clear source ( ) { copy on write ( ) ; instance clear source ( ) ; return this ; }


private void activate ( ) { this active = true ; for ( advised support listener listener : this listeners ) { listener activated ( this ) ; } }


start a full duplex call which the server will not respond , and verify the deadline expires

public void timeout on sleeping server ( ) throws exception { test service grpc test service stub stub = async stub with deadline after ( 1 , time unit milliseconds ) ; stream recorder < streaming output call response > response observer = stream recorder create ( ) ; stream observer < streaming output call request > request observer = stub full duplex call ( response observer ) ; streaming output call request request = streaming output call request new builder ( ) set payload ( payload new builder ( ) set body ( byte string copy from ( new byte [ 27182 ] ) ) ) build ( ) ; try { request observer on next ( request ) ; } catch ( illegal state exception expected ) { / / this can happen if the stream has already been terminated due to deadline exceeded } assert true ( response observer await completion ( operation timeout millis ( ) , time unit milliseconds ) ) ; assert equals ( 0 , response observer get values ( ) size ( ) ) ; assert equals ( status deadline exceeded get code ( ) , status from throwable ( response observer get error ( ) ) get code ( ) ) ; if ( metrics expected ( ) ) { / / census stream tracer module record final status in the interceptor , thus is guaranteed to be / / recorded the tracer stats rely on the stream being created , which is not always the case / / in this test , thus we will not check that metrics record client start record = client stats recorder poll record ( 5 , time unit seconds ) ; check start tags ( client start record , " grpc testing test service / full duplex call " , true ) ; metrics record client end record = client stats recorder poll record ( 5 , time unit seconds ) ; check end tags ( client end record , " grpc testing test service / full duplex call " , status deadline exceeded get code ( ) , true ) ; } }


returns whether the underlying library is available , loading it if necessary

public static boolean is available ( ) { return loader is available ( ) ; }


verifies that { @ code row key } , { @ code column key } and { @ code value } are non - null , and returns a new entry with those values

static < r , c , v > cell < r , c , v > cell of ( r row key , c column key , v value ) { return tables immutable cell ( check not null ( row key , " row key " ) , check not null ( column key , " column key " ) , check not null ( value , " value " ) ) ; }


whether to use registered suffixes for pattern matching

public boolean use suffix pattern match ( ) { return this use suffix pattern match ; }


returns an index > = 0 and < = { @ link # mask } for the specified { @ code item } the default implementation uses fibonacci hashing on the item ' s { @ link object # hash code ( ) } : the hashcode is multiplied by a long constant ( 2 to the 6 4th , divided by the golden ratio ) then the uppermost bits are shifted into the lowest positions to obtain an index in the desired range multiplication by a long may be slower than int ( eg on gwt ) but greatly improves rehashing , allowing even very poor hashcodes , such as those that only differ in their upper bits , to be used without high collision rates fibonacci hashing has increased collision rates when all or most hashcodes are multiples of larger fibonacci numbers ( see < a href = " https : probablydance com 2 0 1 8 0 6 1 6fibonacci - hashing - the - optimization - that - the - world - forgot - or - a - better - alternative - to - integer - modulo " > malte skarupke ' s blog post ) this method can be overriden to customizing hashing this may be useful eg in the unlikely event that most hashcodes are fibonacci numbers , if keys provide poor or incorrect hashcodes , or to simplify hashing if keys provide high quality hashcodes and don ' t need fibonacci hashing : { @ code return item hash code ( ) & mask ; }

protected int place ( long item ) { return ( int ) ( ( item ^ item > > > 32 ) * 0x 9 e 3 7 7 9 b 9 7 f 4 a 7 c 1 5 l > > > shift ) ; }


return the type of a specific file this may be answered using stat ( ) or readdir ( ) returns null if the path does not exist

dirent type get type ( path path , symlinks symlinks ) throws i o exception ;


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


get next offset for reading if current < 0 then choose initial offset according to the read type

private long next offset ( long current ) { if ( skip size = = 0 ) return rnd next long ( file size ) ; if ( skip size > 0 ) return ( current < 0 ) ? 0 : ( current + buffer size + skip size ) ; / / skip size < 0 return ( current < 0 ) ? math max ( 0 , file size - buffer size ) : math max ( 0 , current + skip size ) ; }


public template file type get template type ( ) { return template file type supporting files ; }


performs required initialization of this class , needed before trying to read any streams initialization includes deserializing the remainder of the header as well as stream directory information

protected void deserialize ( task monitor monitor ) throws i o exception , pdb exception , cancelled exception { byte [ ] bytes = new byte [ get page size ( ) ] ; file reader read ( get header page number ( ) , 0 , get page size ( ) , bytes , 0 ) ; pdb byte reader reader = new pdb byte reader ( bytes ) ; reader set index ( get page size offset ( ) ) ; page size = reader parse int ( ) ; parse free page map page number ( reader ) ; parse current num pages ( reader ) ; configure parameters ( ) ; directory stream deserialize stream info ( reader , monitor ) ; / / do not need free page map for just reading files free page map deserialize ( monitor ) ; / / for debug : free page map dump ( ) ; stream table deserialize ( directory stream , monitor ) ; }


drops underlying database table using d a os

public static void drop all tables ( database db , boolean if exists ) { minimal entity dao drop table ( db , if exists ) ; }


convenience shorthand for { @ link # delete user identity link ( string , string , string ) } ; with type { @ link identity link type # candidate }

void delete candidate user ( string task id , string user id ) ;


closes the connection with the socket server

public void close ( ) throws exception { / / flag this as not running any more is running = false ; / / clean up in locked scope , so there is no concurrent change to the stream and client synchronized ( lock ) { / / we notify first ( this statement cannot fail ) the notified thread will not continue / / anyways before it can re - acquire the lock lock notify all ( ) ; try { if ( output stream ! = null ) { output stream close ( ) ; } } finally { if ( client ! = null ) { client close ( ) ; } } } }


public boolean contains key ( short key ) { if ( ( key < 0 ) | | ( key > = size ) ) { return false ; } return is bit set ( power 2 + key ) ; }


formats a { @ code long } as an 8 - byte signed hex value

public static string s 8 ( long v ) { char [ ] result = new char [ 17 ] ; if ( v < 0 ) { result [ 0 ] = ' - ' ; v = - v ; } else { result [ 0 ] = ' + ' ; } for ( int i = 0 ; i < 16 ; i + + ) { result [ 16 - i ] = character for digit ( ( int ) v & 0x 0f , 16 ) ; v > > = 4 ; } return new string ( result ) ; }


< code > optional aapt pb config description config = 1 ; < code >

public builder merge config ( com android aapt resources config description value ) { copy on write ( ) ; instance merge config ( value ) ; return this ; }


returns a view of this immutable list in reverse order for example , { @ code immutable list of ( 1 , 2 , 3 ) reverse ( ) } is equivalent to { @ code immutable list of ( 3 , 2 , 1 ) }

public immutable list < e > reverse ( ) { return ( size ( ) < = 1 ) ? this : new reverse immutable list < e > ( this ) ; }


package - private non - final implementation of and then ( ) so only we can override it

< c > converter < a , c > do and then ( converter < b , c > second converter ) { return new converter composition < > ( this , check not null ( second converter ) ) ; }


public task i d get task id ( ) { return attempt id get task i d ( ) ; }


public static string local host i p ( ) { if ( prefer ipv6 addresses ) { return local host ip v6 ; } return local host ip v4 ; }


returns a quoted version of the given string , if necessary

private static string quoted string ( string string ) { return string length ( ) = = 0 | | string index of ( ' ' ) > = 0 | | string index of ( ' @ ' ) > = 0 | | string index of ( ' { ' ) > = 0 | | string index of ( ' } ' ) > = 0 | | string index of ( ' ( ' ) > = 0 | | string index of ( ' ) ' ) > = 0 | | string index of ( ' : ' ) > = 0 | | string index of ( ' ; ' ) > = 0 | | string index of ( ' , ' ) > = 0 ? ( " ' " + string + " ' " ) : ( string ) ; }


public synchronized void start ( ) { monitor running = true ; timer thread = new daemon ( new blocks storage movement attempt monitor ( ) ) ; timer thread set name ( " blocks storage movement attempt monitor " ) ; timer thread start ( ) ; }


returns true if the build is not completed yet this includes " not started yet " state

public boolean is building ( ) { return state compare to ( state post production ) < 0 ; }


starting a name with underscore , so that the user cannot access this function directly through a script it is only used within predefined painless functions

public int get doc base id ( ) { return doc base + doc id ; }


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


public void close ( ) throws exception { log info ( " closing the slot manager " ) ; suspend ( ) ; slot manager metric group close ( ) ; }


returns the zero based index of the column of the cell being tracked by this editor

public int get column ( ) { return column ; }


creates and returns an exit code that has the same numeric code as another exit code this is to allow the duplicate error codes listed above to be registered , but is private to prevent other users from creating duplicate error codes in the future

private static exit code create unregistered ( int code , string name ) { return new exit code ( code , name , / * infrastructure failure = * / false , / * register = * / false ) ; }


configures ssltls for https jetty client

public static ssl context factory create client side ssl context factory ( worker config config ) { map < string , object > ssl config values = config values with prefix all or nothing ( " listeners https " ) ; final ssl context factory client ssl = new ssl context factory client ( ) ; configure ssl context factory key store ( ssl , ssl config values ) ; configure ssl context factory trust store ( ssl , ssl config values ) ; configure ssl context factory algorithms ( ssl , ssl config values ) ; configure ssl context factory endpoint identification ( ssl , ssl config values ) ; return ssl ; }


returns the offset of the source file name in the strings table

public int get source file name offset ( ) { return source file name string offset ; }


return whether the config value is sensitive the value is always set to null by the broker if the config value is sensitive

public boolean is sensitive ( ) { return is sensitive ; }


public static int check tinker package ( context context , int tinker flag , file patch file , share security check security check ) { int return code = check signature and tinker i d ( context , patch file , security check ) ; if ( return code = = share constants error package check ok ) { return code = check package and tinker flag ( security check , tinker flag ) ; } return return code ; }


get { @ link script info } for { @ code script } under the assumption that it ' s already managed

public script info get existing script info ( resource file script ) { if ( script = = null ) { return null ; } script info info = script file to info map get ( script ) ; if ( info = = null ) { string error = ( script exists ( ) ? " " : " non " ) + " existing script " + script to string ( ) + " is missing expected script info " ; msg show error ( ghidra script info manager class , null , " script info lookup " , error ) ; } return info ; }


returns the number of headers in this object


adds all elements in the array to the given collection

public static < e > void add all ( collection < e > collection , e [ ] elements ) { if ( collection = = null | | elements = = null | | elements length = = 0 ) return ; collection add all ( arrays as list ( elements ) ) ; }


returns a future that will be completed when the page source becomes unblocked if the page source is not blocked , this method should return { @ code not blocked }

default completable future < ? > is blocked ( ) { return not blocked ; }


returns if the component is reserved note that some components are only reserved under certain directories , e g " reserved " is reserved , while " hadoop reserved " is not

public static boolean is reserved path component ( string component ) { for ( string reserved : hdfs server constants reserved path components ) { if ( component equals ( reserved ) ) { return true ; } } return false ; }


tests the deleting of functions via the { @ link delete function cmd }

public void test delete function ( ) { / / create a function at an address that has a valid code unit address address = addr ( 0x 0 ) ; / / get a function from the program with a default name string default name = symbol utilities get default function name ( address ) ; int transaction i d = program start transaction ( " test " ) ; function function = create function ( default name , address , new address set ( address , address add ( 200l ) ) ) ; assert not null ( " the test function was not created as expected " , function ) ; / / create and call the delete the command to remove the function delete function cmd delete function cmd = new delete function cmd ( address ) ; delete function cmd apply to ( program ) ; / / ensure the function is deleted function = program get listing ( ) get function at ( address ) ; assert null ( " the function was not deleted as expected " , function ) ; / / make sure that there is no label where that function existed symbol [ ] symbols = program get symbol table ( ) get symbols ( address ) ; assert true ( " the symbol where the function was removed has the " + " default name of the function when it should not " , ! contains matching symbol name ( symbols , default name ) ) ; / / / / repeat above steps for another function that has a user - defined name / / string custom name = " custom function name " ; function = create function ( custom name , address , new address set ( address , address add ( 200l ) ) ) ; assert not null ( " the test function was not created as expected " , function ) ; / / create and call the delete the command to remove the function delete function cmd = new delete function cmd ( address ) ; delete function cmd apply to ( program ) ; / / make sure that after the function is deleted that there is a symbol / / at that address with the same name as the function function = program get listing ( ) get function at ( address ) ; assert null ( " the function was not deleted as expected " , function ) ; symbols = program get symbol table ( ) get symbols ( address ) ; assert true ( " a label with the same name as the function was not " + " created when that function was deleted " , contains matching symbol name ( symbols , custom name ) ) ; program end transaction ( transaction i d , false ) ; }


this run ( ) method simply sets up the default output container and adds in a data member to keep track of the number of operations that occurred

list < operation output > run ( file system fs ) { list < operation output > out = new linked list < operation output > ( ) ; out add ( new operation output ( output type long , get type ( ) , report writer op count , 1l ) ) ; return out ; }


builds an array of coordinates to a { @ link x content builder }

protected x content builder coordinates to xcontent ( x content builder builder , boolean closed ) throws i o exception { builder start array ( ) ; for ( coordinate coord : coordinates ) { to x content ( builder , coord ) ; } if ( closed ) { coordinate start = coordinates get ( 0 ) ; coordinate end = coordinates get ( coordinates size ( ) - 1 ) ; if ( start x ! = end x | | start y ! = end y ) { to x content ( builder , coordinates get ( 0 ) ) ; } } builder end array ( ) ; return builder ; }


adds the flags that apply to this action to { @ code command line }

private void expand command line ( cc toolchain variables variables , set < string > enabled feature names , @ nullable artifact expander expander , list < string > command line ) throws expansion exception { for ( flag set flag set : flag sets ) { flag set expand command line ( action name , variables , enabled feature names , expander , command line ) ; } }


since the alternatives within any lexer decision are ordered by preference , this method stops pursuing the closure as soon as an accept state is reached after the first accept state is reached by depth - first search from { @ code config } , all other ( potentially reachable ) states for this rule would have a lower priority

protected boolean closure ( char stream input , lexer a t n config config , a t n config set configs , boolean current alt reached accept state , boolean speculative , boolean treat eof as epsilon ) { if ( debug ) { system out println ( " closure ( " + config to string ( recog , true ) + " ) " ) ; } if ( config state instanceof rule stop state ) { if ( debug ) { if ( recog ! = null ) { system out format ( locale get default ( ) , " closure at % s rule stop % s \ n " , recog get rule names ( ) [ config state rule index ] , config ) ; } else { system out format ( locale get default ( ) , " closure at rule stop % s \ n " , config ) ; } } if ( config context = = null | | config context has empty path ( ) ) { if ( config context = = null | | config context is empty ( ) ) { configs add ( config ) ; return true ; } else { configs add ( new lexer a t n config ( config , config state , prediction context empty ) ) ; current alt reached accept state = true ; } } if ( config context ! = null & & ! config context is empty ( ) ) { for ( int i = 0 ; i < config context size ( ) ; i + + ) { if ( config context get return state ( i ) ! = prediction context empty return state ) { prediction context new context = config context get parent ( i ) ; / / " pop " return state a t n state return state = atn states get ( config context get return state ( i ) ) ; lexer a t n config c = new lexer a t n config ( config , return state , new context ) ; current alt reached accept state = closure ( input , c , configs , current alt reached accept state , speculative , treat eof as epsilon ) ; } } } return current alt reached accept state ; } / / optimization if ( ! config state only has epsilon transitions ( ) ) { if ( ! current alt reached accept state | | ! config has passed through non greedy decision ( ) ) { configs add ( config ) ; } } a t n state p = config state ; for ( int i = 0 ; i < p get number of transitions ( ) ; i + + ) { transition t = p transition ( i ) ; lexer a t n config c = get epsilon target ( input , config , t , configs , speculative , treat eof as epsilon ) ; if ( c ! = null ) { current alt reached accept state = closure ( input , c , configs , current alt reached accept state , speculative , treat eof as epsilon ) ; } } return current alt reached accept state ; }


set the angle to set minimum size for slices , you must call { @ link # notify data set changed ( ) } and { @ link # invalidate ( ) } when changing this , only works if there is enough room for all slices to have the minimum angle

public void set min angle for slices ( float min angle ) { if ( min angle > ( m max angle / 2f ) ) min angle = m max angle / 2f ; else if ( min angle < 0 ) min angle = 0f ; this m min angle for slices = min angle ; }


moves the camera by the given amount on each axis

public void translate ( float x , float y ) { translate ( x , y , 0 ) ; }


we don ' t need any filter for this { @ link security realm }

public filter create filter ( filter config filter config ) { return new chained servlet filter ( ) ; }


public void test vectors ( ) throws exception { directory dir = new directory ( ) ; index writer config iwc = new index writer config ( null ) ; index writer iw = new index writer ( dir , iwc ) ; / / add document with 2 fields document doc = new document ( ) ; field type ft = new field type ( string field type not stored ) ; ft set store term vectors ( true ) ; doc add ( new field ( " field a " , " test a " , ft ) ) ; doc add ( new field ( " field b " , " test b " , ft ) ) ; iw add document ( doc ) ; / / open reader directory reader ir = field subset reader wrap ( directory reader open ( iw ) , new character run automaton ( automata make string ( " field a " ) ) ) ; / / see only one field fields vectors = ir get term vectors ( 0 ) ; set < string > seen fields = new hash set < > ( ) ; for ( string field : vectors ) { seen fields add ( field ) ; } assert equals ( collections singleton ( " field a " ) , seen fields ) ; test util check reader ( ir ) ; i o utils close ( ir , iw , dir ) ; }


return a { @ link resolvable type } for the specified { @ link type } backed by a given { @ link variable resolver }

static resolvable type for type ( @ nullable type type , @ nullable variable resolver variable resolver ) { return for type ( type , null , variable resolver ) ; }


verify that there is no late - data side output if the { @ code window assigner } does not assign any windows

public void test no late side output for skipped windows ( ) throws exception { output tag < integer > late output tag = new output tag < integer > ( " late " ) { } ; window assigner < integer , time window > mock assigner = mock time window assigner ( ) ; trigger < integer , time window > mock trigger = mock trigger ( ) ; internal window function < iterable < integer > , void , integer , time window > mock window function = mock window function ( ) ; one input stream operator test harness < integer , void > test harness = create window operator ( mock assigner , mock trigger , 0l , mock window function , late output tag ) ; test harness open ( ) ; when ( mock assigner assign windows ( any int ( ) , any long ( ) , any assigner context ( ) ) ) then return ( collections < time window > empty list ( ) ) ; test harness process watermark ( 0 ) ; test harness process element ( new stream record < > ( 0 , 5l ) ) ; verify ( mock assigner , times ( 1 ) ) assign windows ( eq ( 0 ) , eq ( 5l ) , any assigner context ( ) ) ; assert true ( test harness get side output ( late output tag ) = = null | | test harness get side output ( late output tag ) is empty ( ) ) ; }


compares based on the support , which is the number of sequences which contain the item

public int compare to ( frequent sequence item arg 0 ) { int item compare = get item ( ) compare to ( arg 0 get item ( ) ) ; if ( item compare = = 0 ) { return support - arg 0 get support ( ) ; } return item compare ; }


cancels the request created by this request factory

public void cancel run ( ) { stop ( true ) ; }


returns the total number of nanoseconds the cache has spent loading new values this can be used to calculate the miss penalty this value is increased every time { @ code load success count } or { @ code load failure count } is incremented

public long total load time ( ) { return total load time ; }


sets the current thread ' s context loader to this classloader , storing the current loader value for later resetting

public void set thread context loader ( ) { if ( is context loader saved ) { throw new build exception ( " context loader has not been reset " ) ; } if ( loader utils is context loader available ( ) ) { saved context loader = loader utils get context class loader ( ) ; class loader loader = this ; if ( project ! = null & & " only " equals ( project get property ( " build sysclasspath " ) ) ) { loader = this get class ( ) get class loader ( ) ; } loader utils set context class loader ( loader ) ; is context loader saved = true ; } }


manages the state of the scrollbars when new items are added or the bounds are changed

public void update scrollbars ( ) { point preferred size = get table size ( ) ; rectangle client area = get client area ( ) ; / / first , figure out if the scrollbars should be visible and turn them / / on right away / / this will allow the computations further down to accommodate the / / correct client / / area / / turn the scrollbars on if necessary and do it all over again if / / necessary this ensures / / that if a scrollbar is turned on / off , the other scrollbars / / visibility may be affected ( more / / area may have been added / removed for ( int double pass = 1 ; double pass < = 2 ; double pass + + ) { if ( preferred size y > client area height ) { v scroll set visible ( true ) ; } else { v scroll set visible ( false ) ; v scroll set values ( 0 , 0 , 1 , 1 , 1 , 1 ) ; } if ( preferred size x > client area width ) { h scroll set visible ( true ) ; } else { h scroll set visible ( false ) ; h scroll set values ( 0 , 0 , 1 , 1 , 1 , 1 ) ; } / / get the client area again with the now visible / invisible / / scrollbars client area = get client area ( ) ; } / / if the scrollbar is visible set its values if ( v scroll get visible ( ) ) { int max = get item count ( ) + 1 ; int thumb = ( get visible grid height ( client area ) + 1 ) / ( get item height ( ) + 1 ) ; / / if possible , remember selection , if selection is too large , just / / make it the max you can int selection = math min ( v scroll get selection ( ) , max ) ; v scroll set values ( selection , 0 , max , thumb , 1 , thumb ) ; } / / if the scrollbar is visible set its values if ( h scroll get visible ( ) ) { if ( ! column scrolling ) { / / horizontal scrolling works pixel by pixel int hidden area = preferred size x - client area width + 1 + ( v scroll get visible ( ) ? v scroll get width ( ) : 0 ) ; / / if possi / / ble , remember selection , if selection is too large , / / just / / make it the max you can int selection = math min ( h scroll get selection ( ) , hidden area - 1 ) ; h scroll set values ( selection , 0 , hidden area + client area width - 1 , client area width , horz scroll increment , client area width ) ; } else { / / horizontal scrolling is column by column int hidden area = preferred size x - client area width + 1 ; int max = 0 ; int i = 0 ; while ( hidden area > 0 & & i < get column count ( ) ) { grid column col = columns get ( i ) ; i + + ; hidden area - = col get width ( ) ; max + + ; } max + + ; / / max should never be greater than the number of visible cols int vis cols = columns size ( ) ; max = math min ( vis cols , max ) ; / / if possible , remember selection , if selection is too large , / / just / / make it the max you can int selection = math min ( h scroll get selection ( ) , max ) ; h scroll set values ( selection , 0 , max , 1 , 1 , 1 ) ; } } }


public void record start ( ) { start counter increment and get ( ) ; restart latches for each ( start and stop latch : : record start ) ; }


serializes and deserializes the specified object

static < t > t reserialize ( t object ) { check not null ( object ) ; byte array output stream bytes = new byte array output stream ( ) ; try { object output stream out = new object output stream ( bytes ) ; out write object ( object ) ; object input stream in = new object input stream ( new byte array input stream ( bytes to byte array ( ) ) ) ; return ( t ) in read object ( ) ; } catch ( i o exception | class not found exception e ) { throw new runtime exception ( e ) ; } }


get the parent path elements of the magic path the list may be immutable or may be a view of the underlying list both the parameter list and the returned list must not be modified

public static list < string > magic path parents ( list < string > elements ) { return elements sub list ( 0 , magic element index ( elements ) ) ; }


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


static file handle read handle ( xdr xdr ) throws i o exception { file handle handle = new file handle ( ) ; if ( ! handle deserialize ( xdr ) ) { throw new i o exception ( " can ' t deserialize file handle " ) ; } return handle ; }


add the supplied attribute to this { @ code map } using a { @ link org springframework core conventions # get variable name generated name } note : empty { @ link collection collections } are not added to the model when using this method because we cannot correctly determine the true convention name view code should check for { @ code null } rather than for empty collections as is already done by jstl tags

public concurrent model add attribute ( object attribute value ) { assert not null ( attribute value , " model attribute value must not be null " ) ; if ( attribute value instanceof collection & & ( ( collection < ? > ) attribute value ) is empty ( ) ) { return this ; } return add attribute ( conventions get variable name ( attribute value ) , attribute value ) ; }


checks if the queue is clogged , and if so , activate { @ link administrative monitor impl }

public void clog check ( ) { administrative monitor all ( ) get ( administrative monitor impl class ) on = is clogged ( ) ; }


returns the system time taken by the { @ link spawn } ' s execution

optional < duration > get system time ( ) ;


checks whether an index name matches the system index name pattern for this descriptor

public boolean matches index pattern ( string index ) { return index pattern automaton run ( index ) ; }


trim leading whitespace from the given { @ code string }

public static string trim leading whitespace ( string str ) { if ( ! has length ( str ) ) { return str ; } int begin idx = 0 ; while ( begin idx < str length ( ) & & character is whitespace ( str char at ( begin idx ) ) ) { begin idx + + ; } return str substring ( begin idx ) ; }


register a listener that will be called when this model is bound to a view the listener will contribute to this model ' s hash code state per the { @ link com airbnb epoxy epoxy attribute option # do not hash } rules you may clear the listener by setting a null value , or by calling { @ link # reset ( ) }

public model with private field with same as field getter and setter name on bind ( on model bound listener < model with private field with same as field getter and setter name , object > listener ) { on mutation ( ) ; this on model bound listener epoxy generated model = listener ; return this ; }


returns the list of options to add to a command line

public list < string > get options ( ) { return options list ; }


exit a parse tree produced by { @ link sql base parser # query no with }

void exit query no with ( sql base parser query no with context ctx ) ;


returns whether this data entry is a dex file

public boolean is dex ( ) { return has extension ( " dex " ) ; }


gets a registered { @ link catalog } by name

optional < catalog > get catalog ( string catalog name ) ;


perform a dependency check that all properties exposed have been set , if desired dependency checks can be objects ( collaborating beans ) , simple ( primitives and string ) , or all ( both )

protected void check dependencies ( string bean name , abstract bean definition mbd , property descriptor [ ] pds , @ nullable property values pvs ) throws unsatisfied dependency exception { int dependency check = mbd get dependency check ( ) ; for ( property descriptor pd : pds ) { if ( pd get write method ( ) ! = null & & ( pvs = = null | | ! pvs contains ( pd get name ( ) ) ) ) { boolean is simple = bean utils is simple property ( pd get property type ( ) ) ; boolean unsatisfied = ( dependency check = = abstract bean definition dependency check all ) | | ( is simple & & dependency check = = abstract bean definition dependency check simple ) | | ( ! is simple & & dependency check = = abstract bean definition dependency check objects ) ; if ( unsatisfied ) { throw new unsatisfied dependency exception ( mbd get resource description ( ) , bean name , pd get name ( ) , " set this property value or disable dependency checking for this bean " ) ; } } } }


public api response < health check result > fake health get with http info ( ) throws api exception { object local var post body = null ; / / create path and map variables string local var path = " / fake / health " ; / / query params list < pair > local var query params = new array list < pair > ( ) ; map < string , string > local var header params = new hash map < string , string > ( ) ; map < string , string > local var cookie params = new hash map < string , string > ( ) ; map < string , object > local var form params = new hash map < string , object > ( ) ; final string [ ] local var accepts = { " application / json " } ; final string local var accept = api client select header accept ( local var accepts ) ; final string [ ] local var content types = { } ; final string local var content type = api client select header content type ( local var content types ) ; string [ ] local var auth names = new string [ ] { } ; generic type < health check result > local var return type = new generic type < health check result > ( ) { } ; return api client invoke a p i ( " fake api fake health get " , local var path , " get " , local var query params , local var post body , local var header params , local var cookie params , local var form params , local var accept , local var content type , local var auth names , local var return type , false ) ; }


public builder set options ( jdbc options options ) { this options = options ; return this ; }


make sure loading cache correctly wraps execution exceptions and unchecked execution exceptions

public void test loading exception with cause ( ) throws execution exception { final exception cause = new exception ( ) ; final unchecked execution exception uee = new unchecked execution exception ( cause ) ; final execution exception ee = new execution exception ( cause ) ; loading cache < object , object > cache unchecked = caffeinated guava build ( caffeine new builder ( ) , exception loader ( uee ) ) ; loading cache < object , object > cache checked = caffeinated guava build ( caffeine new builder ( ) , exception loader ( ee ) ) ; try { cache unchecked get ( new object ( ) ) ; fail ( ) ; } catch ( unchecked execution exception caught ee ) { assert same ( uee , caught ee get cause ( ) ) ; } try { cache unchecked get unchecked ( new object ( ) ) ; fail ( ) ; } catch ( unchecked execution exception caught uee ) { assert same ( uee , caught uee get cause ( ) ) ; } cache unchecked refresh ( new object ( ) ) ; check logged cause ( uee ) ; try { cache unchecked get all ( as list ( new object ( ) ) ) ; fail ( ) ; } catch ( unchecked execution exception caught ee ) { assert same ( uee , caught ee get cause ( ) ) ; } try { cache checked get ( new object ( ) ) ; fail ( ) ; } catch ( execution exception caught ee ) { assert same ( ee , caught ee get cause ( ) ) ; } try { cache checked get unchecked ( new object ( ) ) ; fail ( ) ; } catch ( unchecked execution exception caught uee ) { assert same ( ee , caught uee get cause ( ) ) ; } cache checked refresh ( new object ( ) ) ; check logged cause ( ee ) ; try { cache checked get all ( as list ( new object ( ) ) ) ; fail ( ) ; } catch ( execution exception caught ee ) { assert same ( ee , caught ee get cause ( ) ) ; } }


returns this tile ' s position as a packed point

public int pos ( ) { return point 2 pack ( x , y ) ; }


get a partial listing of the indicated directory no block locations need to be fetched

public directory listing list paths ( string src , byte [ ] start after ) throws i o exception { return list paths ( src , start after , false ) ; }


holds information about call frame activations

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


convert a string to an int treating empty strings as the default value

private static int convert to int ( string value , int default value ) { string trim = value trim ( ) ; if ( trim length ( ) = = 0 ) { return default value ; } return integer parse int ( trim ) ; }


create a codegen parameter for a form property we have a custom version of this method so we can invoke set parameter example value ( codegen parameter , parameter ) rather than set parameter example value ( codegen parameter ) this ensures that all of our samples are generated in to example value recursive

public codegen parameter from form property ( string name , schema property schema , set < string > imports ) { codegen parameter cp = super from form property ( name , property schema , imports ) ; parameter p = new parameter ( ) ; p set schema ( property schema ) ; p set name ( cp param name ) ; set parameter example value ( cp , p ) ; return cp ; }


get the informational messages that resulted from doing the merge

public string get info message ( ) { info msg append ( merger get info message ( ) ) ; merger clear info message ( ) ; return info msg to string ( ) ; }


create a socket address with the given host and port the hostname might be replaced with another host that was set via { @ link # add static resolution ( string , string ) } the value of hadoop security token service use ip will determine whether the standard java host resolver is used , or if the fully qualified resolver is used

public static inet socket address create socket addr for host ( string host , int port ) { string static host = get static resolution ( host ) ; string resolve host = ( static host ! = null ) ? static host : host ; inet socket address addr ; try { inet address iaddr = security util get by name ( resolve host ) ; / / if there is a static entry for the host , make the returned / / address look like the original given host if ( static host ! = null ) { iaddr = inet address get by address ( host , iaddr get address ( ) ) ; } addr = new inet socket address ( iaddr , port ) ; } catch ( unknown host exception e ) { addr = inet socket address create unresolved ( host , port ) ; } return addr ; }


public static set < string > checkpoint topics ( map < string , object > properties ) throws interrupted exception , timeout exception { try ( mirror client client = new mirror client ( properties ) ) { return client checkpoint topics ( ) ; } }


returns { @ code true } if the collection { @ code self } contains all of the elements in the collection { @ code c } this method iterates over the specified collection { @ code c } , checking each element returned by the iterator in turn to see if it is contained in the specified collection { @ code self } if all elements are so contained , { @ code true } is returned , otherwise { @ code false }

static boolean contains all impl ( collection < ? > self , collection < ? > c ) { for ( object o : c ) { if ( ! self contains ( o ) ) { return false ; } } return true ; }


gets the id of the job that the dataflow plan belongs to if this id is not set , then the dataflow represents its own independent job

public job i d get job id ( ) { return job id ; }


public okhttp 3 call delete order call ( string order id , final api callback callback ) throws api exception { object local var post body = null ; / / create path and map variables string local var path = " / store / order / { order id } " replace all ( " \ \ { " + " order id " + " \ \ } " , local var api client escape string ( order id to string ( ) ) ) ; list < pair > local var query params = new array list < pair > ( ) ; list < pair > local var collection query params = new array list < pair > ( ) ; map < string , string > local var header params = new hash map < string , string > ( ) ; map < string , string > local var cookie params = new hash map < string , string > ( ) ; map < string , object > local var form params = new hash map < string , object > ( ) ; final string [ ] local var accepts = { } ; final string local var accept = local var api client select header accept ( local var accepts ) ; if ( local var accept ! = null ) { local var header params put ( " accept " , local var accept ) ; } final string [ ] local var content types = { } ; final string local var content type = local var api client select header content type ( local var content types ) ; local var header params put ( " content - type " , local var content type ) ; string [ ] local var auth names = new string [ ] { } ; return local var api client build call ( local var path , " delete " , local var query params , local var collection query params , local var post body , local var header params , local var cookie params , local var form params , local var auth names , callback ) ; }


creates a subchannel , which is a logical connection to the given group of addresses which are considered equivalent the { @ code attrs } are custom attributes associated with this subchannel , and can be accessed later through { @ link subchannel # get attributes subchannel get attributes ( ) } the load balancer is responsible for closing unused subchannels , and closing all subchannels within { @ link # shutdown } it must be called from { @ link # get synchronization context the synchronization context }

public subchannel create subchannel ( create subchannel args args ) { throw new unsupported operation exception ( ) ; }


scans this location and returns all scanned resources this file and jar files from " class - path " entry in the scanned manifest files will be added to { @ code scanned files } a file will be scanned at most once even if specified multiple times by one or multiple jar files ' " class - path " manifest entries particularly , if a jar file from the " class - path " manifest entry is already in { @ code scanned files } , either because it was scanned earlier , or it was intentionally added to the set by the caller , it will not be scanned again note that when you call { @ code location scan resources ( scanned files ) } , the location will always be scanned even if { @ code scanned files } already contains it

public immutable set < resource info > scan resources ( set < file > scanned files ) throws i o exception { immutable set builder < resource info > builder = immutable set builder ( ) ; scanned files add ( home ) ; scan ( home , scanned files , builder ) ; return builder build ( ) ; }


public i node file attributes load i node file attributes ( data input in ) throws i o exception { final int layout version = get layout version ( ) ; if ( ! name node layout version supports ( layout version feature optimize snapshot inodes , layout version ) ) { return load i node with local name ( true , in , false ) as file ( ) ; } final byte [ ] name = f s image serialization read local name ( in ) ; final permission status permissions = permission status read ( in ) ; final long modification time = in read long ( ) ; final long access time = in read long ( ) ; final short replication = namesystem get block manager ( ) adjust replication ( in read short ( ) ) ; final long preferred block size = in read long ( ) ; return new i node file attributes snapshot copy ( name , permissions , null , modification time , access time , replication , null , preferred block size , ( byte ) 0 , null , block type contiguous ) ; }


whether this status code is in the http series { @ link org springframework http http status series # client error } this is a shortcut for checking the value of { @ link # series ( ) }

public boolean is 4xx client error ( ) { return ( series ( ) = = series client error ) ; }


find the first { @ link class } in the inheritance hierarchy of the specified { @ code clazz } ( including the specified { @ code clazz } itself ) on which an annotation of the specified { @ code annotation type } is directly present if the supplied { @ code clazz } is an interface , only the interface itself will be checked ; the inheritance hierarchy for interfaces will not be traversed meta - annotations will not be searched the standard { @ link class } api does not provide a mechanism for determining which class in an inheritance hierarchy actually declares an { @ link annotation } , so we need to handle this explicitly

public static class < ? > find annotation declaring class ( class < ? extends annotation > annotation type , @ nullable class < ? > clazz ) { if ( clazz = = null ) { return null ; } return ( class < ? > ) merged annotations from ( clazz , search strategy superclass ) get ( annotation type , merged annotation : : is directly present ) get source ( ) ; }


public void test type holder example ( ) { / / todo : test type holder example }


public static collection < string > get requested scopes ( final http servlet request context ) { val map = get request parameters ( collection utils wrap ( o auth 2 0 constants scope ) , context ) ; if ( map = = null | | map is empty ( ) ) { return new array list < > ( 0 ) ; } return ( collection < string > ) map get ( o auth 2 0 constants scope ) ; }


rename the base directory , expect the source files to move whether or not the marker itself is copied depends on whether the release ' s rename operation explicitly skips markers on renames

public void test rename base ( ) throws throwable { describe ( " rename base directory " ) ; path src = base path ; path dest = new path ( method path ( ) , " dest " ) ; assert renamed ( src , dest ) ; assert path does not exist ( " source " , src ) ; assert path does not exist ( " source " , file path under marker ) ; assert path exists ( " dest not found " , dest ) ; / / all the paths dest relative path dest marker dir = new path ( dest , marker ) ; / / peer path has the same initial name to make sure there / / is no confusion there path dest marker peer = new path ( dest , marker peer ) ; string dest marker key = to key ( dest marker dir ) ; string dest marker key slash = dest marker key + " / " ; string dest file key under marker = dest marker key slash + filename ; path dest file path under marker = new path ( dest marker dir , filename ) ; assert is file ( dest file path under marker ) ; assert is file ( dest marker peer ) ; head ( dest file key under marker ) ; / / probe for the marker based on expected rename / / behavior if ( rename copies markers ) { head ( dest marker key slash ) ; } else { head 4 0 4 ( dest marker key slash ) ; } }


set the progress value ; used in subsequent searches to update the monitor

void set progress ( int progress ) { this progress = progress ; }


validates and packages merged resources specifically , validates that : there are no conflicts between resources ( though currently we just warn ) each reference to a resource in resources and manifest are satisfied and packs resources into : r java and r txt files a resource - only apk ( deprecated ) when building with aapt 2 , aapt 2 equivalents of the above when building with aapt 2 , a compiled symbols zip

public static validated android resources validate from ( android data context data context , merged android resources merged ) throws interrupted exception { artifact r txt out = data context create output artifact ( android rule classes android r txt ) ; artifact source jar out = data context create output artifact ( android rule classes android java source jar ) ; artifact apk out = data context create output artifact ( android rule classes android library apk ) ; busy box action builder create ( data context , " link static library " ) add aapt ( ) add input ( " - - libraries " , data context get sdk ( ) get android jar ( ) ) add input ( " - - compiled " , merged get compiled symbols ( ) ) add input ( " - - manifest " , merged get manifest ( ) ) / / sets an alternative java package for the generated r java / / this allows android rules to generate resources outside of the java { , tests } tree maybe add flag ( " - - package for r " , merged get java package ( ) ) add transitive vectored input ( " - - compiled dep " , merged get resource dependencies ( ) get transitive compiled symbols ( ) ) add output ( " - - source jar out " , source jar out ) add output ( " - - r txt out " , r txt out ) add output ( " - - static library out " , apk out ) build and register ( " linking static android resource library " , " android resource link " ) ; return of ( merged , r txt out , source jar out , apk out , / / todo : remove below three when incompatible prohibit aapt 1 is on by default r txt out , source jar out , apk out , data context get android config ( ) use r txt from merged resources ( ) ) ; }


given the { @ link configuration } and { @ link acl } s used ( source a c ls ) for zoo keeper access , construct the { @ link acl } s for the store ' s root node in the constructed { @ link acl } , all the users allowed by source a c ls are given read - write - admin access , while the current rm has exclusive create - delete access to be called only when ha is enabled and the configuration doesn ' t set an acl for the root node

protected list < acl > construct zk root node a c l ( configuration conf , list < acl > source a c ls ) throws no such algorithm exception { list < acl > zk root node acl list = new array list < > ( ) ; for ( acl acl : source a c ls ) { zk root node acl list add ( new acl ( z k util remove specific perms ( acl get perms ( ) , create delete perms ) , acl get id ( ) ) ) ; } zk root node username = h a util get conf value for r m instance ( yarn configuration rm address , yarn configuration default rm address , conf ) ; id rm id = new id ( zk root node auth scheme , digest authentication provider generate digest ( zk root node username + " : " + resource manager get zk root node password ( ) ) ) ; zk root node acl list add ( new acl ( create delete perms , rm id ) ) ; return zk root node acl list ; }


opens the specified sevenzip container file and initializes this file system with the contents

public void mount ( file container file , task monitor monitor ) throws cancelled exception , i o exception { random access file = new random access file ( container file , " r " ) ; try { archive = seven zip open in archive ( null , new random access file in stream ( random access file ) ) ; archive interface = archive get simple interface ( ) ; i simple in archive item [ ] items = archive interface get archive items ( ) ; for ( i simple in archive item item : items ) { if ( monitor is cancelled ( ) ) { throw new cancelled exception ( ) ; } string item path = item get path ( ) ; if ( items length = = 1 & & item path is blank ( ) ) { / / special case when there is a single unnamed file / / use the name of the 7zip file itself , minus the extension item path = filename utils get base name ( fsrl get container ( ) get name ( ) ) ; } fs index helper store file ( item path , item get item index ( ) , item is folder ( ) , get size ( item ) , item ) ; } pre cache all ( monitor ) ; } catch ( seven zip exception e ) { throw new i o exception ( " failed to open archive : " + fsrl , e ) ; } }


returns the { @ code tcp info } for the current socket see < a href = " https : linux die netman 7tcp " > man 7 tcp

public epoll tcp info tcp info ( ) { return tcp info ( new epoll tcp info ( ) ) ; }


abstract void generate inputs ( int [ ] ops per thread ) throws i o exception ;


get the results of a { @ link criteria query } query

protected list < e > list ( criteria query < e > criteria ) throws hibernate exception { return current session ( ) create query ( require non null ( criteria ) ) get result list ( ) ; }


test serialization of outer boolean types

boolean fake outer boolean serialize ( boolean body ) ;


{ @ inherit doc } the default implementation does nothing

@ override public void enter when clause ( sql base parser when clause context ctx ) { }


wait until the federated cluster is up and ready

public void wait cluster up ( ) throws i o exception { cluster wait cluster up ( ) ; register namenodes ( ) ; try { wait namenode registration ( ) ; } catch ( exception e ) { throw new i o exception ( " cannot wait for the namenodes " , e ) ; } }


method that returns whether we can rollup from inner time unit to outer time unit

private static boolean can roll up ( time unit outer , time unit inner ) { / / special handling for quarter as it is not in the expected / / order in time unit switch ( outer ) { case year : case month : case day : case hour : case minute : case second : case millisecond : case microsecond : switch ( inner ) { case year : case quarter : case month : case day : case hour : case minute : case second : case millisecond : case microsecond : if ( inner = = time unit quarter ) { return outer = = time unit year ; } return outer ordinal ( ) < = inner ordinal ( ) ; } break ; case quarter : switch ( inner ) { case quarter : case month : case day : case hour : case minute : case second : case millisecond : case microsecond : return true ; } } return false ; }


returns the { @ link type } values corresponding to the argument types of the given method descriptor

public static type [ ] get argument types ( final string method descriptor ) { / / first step : compute the number of argument types in method descriptor int num argument types = 0 ; / / skip the first character , which is always a ' ( ' int current offset = 1 ; / / parse the argument types , one at a each loop iteration while ( method descriptor char at ( current offset ) ! = ' ) ' ) { while ( method descriptor char at ( current offset ) = = ' [ ' ) { current offset + + ; } if ( method descriptor char at ( current offset + + ) = = ' l ' ) { / / skip the argument descriptor content int semi column offset = method descriptor index of ( ' ; ' , current offset ) ; current offset = math max ( current offset , semi column offset + 1 ) ; } + + num argument types ; } / / second step : create a type instance for each argument type type [ ] argument types = new type [ num argument types ] ; / / skip the first character , which is always a ' ( ' current offset = 1 ; / / parse and create the argument types , one at each loop iteration int current argument type index = 0 ; while ( method descriptor char at ( current offset ) ! = ' ) ' ) { final int current argument type offset = current offset ; while ( method descriptor char at ( current offset ) = = ' [ ' ) { current offset + + ; } if ( method descriptor char at ( current offset + + ) = = ' l ' ) { / / skip the argument descriptor content int semi column offset = method descriptor index of ( ' ; ' , current offset ) ; current offset = math max ( current offset , semi column offset + 1 ) ; } argument types [ current argument type index + + ] = get type internal ( method descriptor , current argument type offset , current offset ) ; } return argument types ; }


protected abstract pipeline aggregator create ( ) ;


public create users with list input oper resp spec ( consumer < response spec builder > resp spec customizer ) { resp spec customizer accept ( resp spec ) ; return this ; }


subtracts decrement from this resource counter value and returns the new value

public resource counter subtract ( map < resource profile , integer > decrement ) { return internal subtract ( decrement entry set ( ) ) ; }


executed on the node that should be running the task to find and return the running task falls back to { @ link # get finished task from index ( task , get task request , action listener ) } if the task isn ' t still running

void get running task from node ( task this task , get task request request , action listener < get task response > listener ) { task running task = task manager get task ( request get task id ( ) get id ( ) ) ; if ( running task = = null ) { / / task isn ' t running , go look in the task index get finished task from index ( this task , request , listener ) ; } else { if ( request get wait for completion ( ) ) { / / shift to the generic thread pool and let it wait for the task to complete so we don ' t block any important threads thread pool generic ( ) execute ( new abstract runnable ( ) { @ override protected void do run ( ) { task manager wait for task completion ( running task , wait for completion timeout ( request get timeout ( ) ) ) ; waited for completion ( this task , request , running task task info ( cluster service local node ( ) get id ( ) , true ) , listener ) ; } @ override public void on failure ( exception e ) { listener on failure ( e ) ; } } ) ; } else { task info info = running task task info ( cluster service local node ( ) get id ( ) , true ) ; listener on response ( new get task response ( new task result ( false , info ) ) ) ; } } }


tests the convert method of the wrapped converter class , verifying the properties listed in the javadoc listed for { @ link # add equality group }

public converter tester test convert ( ) { tester test equals ( ) ; test items ( ) ; return this ; }


ensures that { @ code index } specifies a valid element in an array , list or string of size { @ code size } an element index may range from zero , inclusive , to { @ code size } , exclusive

public static int check element index ( int index , int size , @ nullable string desc ) { / / carefully optimized for execution by hotspot ( explanatory comment above ) if ( index < 0 | | index > = size ) { throw new index out of bounds exception ( bad element index ( index , size , desc ) ) ; } return index ; }


reload datanode membership and the desired admin operations from host files if a node isn ' t allowed , host config manager is included returns false and the node can ' t be used if a node is allowed and the desired admin operation is defined , it will transition to the desired admin state if a node is allowed and upgrade domain is defined , the upgrade domain will be set on the node to use maintenance mode or upgrade domain , set dfs namenode hosts provider classname key to combined host file manager class

private void refresh datanodes ( ) { final map < string , datanode descriptor > copy ; synchronized ( this ) { copy = new hash map < > ( datanode map ) ; } for ( datanode descriptor node : copy values ( ) ) { / / check if not include if ( ! host config manager is included ( node ) ) { node set disallowed ( true ) ; } else { long maintenance expire time in m s = host config manager get maintenance expiration time in m s ( node ) ; if ( node maintenance not expired ( maintenance expire time in m s ) ) { datanode admin manager start maintenance ( node , maintenance expire time in m s ) ; } else if ( host config manager is excluded ( node ) ) { datanode admin manager start decommission ( node ) ; } else { datanode admin manager stop maintenance ( node ) ; datanode admin manager stop decommission ( node ) ; } } node set upgrade domain ( host config manager get upgrade domain ( node ) ) ; } }


public void get pet by id test ( ) { long pet id = null ; / / pet response = api get pet by id ( pet id ) ; / / todo : test validations }


called when the component is attached to the { @ link component tree }

protected void on attached ( component context c ) { }


public coordinates builder coordinate ( coordinate coordinate ) { int expected dims ; int actual dims ; if ( points is empty ( ) = = false & & ( expected dims = double is na n ( points get ( 0 ) z ) ? 2 : 3 ) ! = ( actual dims = double is na n ( coordinate z ) ? 2 : 3 ) ) { throw new elasticsearch exception ( " unable to add coordinate to coordinate builder : " + " coordinate dimensions do not match expected [ { } ] but found [ { } ] " , expected dims , actual dims ) ; } else { this points add ( coordinate ) ; } return this ; }


uploads a byte array to a server which cannot create any files via the { @ link blob cache service } file transfers should fail

private void test put buffer fails ( @ nullable final job i d job id , blob key blob type blob type ) throws i o exception { assume true ( ! operating system is windows ( ) ) ; / / set writable doesn ' t work on windows final configuration config = new configuration ( ) ; config set string ( blob server options storage directory , temporary folder new folder ( ) get absolute path ( ) ) ; file temp file dir = null ; try ( blob server server = new blob server ( config , new void blob store ( ) ) ; blob cache service cache = new blob cache service ( config , new void blob store ( ) , new inet socket address ( " localhost " , server get port ( ) ) ) ) { server start ( ) ; / / make sure the blob server cannot create any files in its storage dir temp file dir = server create temporary filename ( ) get parent file ( ) get parent file ( ) ; assert true ( temp file dir set executable ( true , false ) ) ; assert true ( temp file dir set readable ( true , false ) ) ; assert true ( temp file dir set writable ( false , false ) ) ; byte [ ] data = new byte [ 2000000 ] ; rnd next bytes ( data ) ; / / upload the file to the server via the cache exception expect ( i o exception class ) ; exception expect message ( " put operation failed : " ) ; put ( cache , job id , data , blob type ) ; } finally { / / set writable again to make sure we can remove the directory if ( temp file dir ! = null ) { / / noinspection result of method call ignored temp file dir set writable ( true , false ) ; } } }


change socket bind error handler used for testing

void set socket bind error handler ( runnable error handler ) { this socket bind error handler = error handler ; }


build credential for metadata signature validation basic credential

private static basic credential build credential for metadata signature validation ( final resource resource ) throws exception { try { val x 5 0 9 factory bean = new basic x 5 0 9 credential factory bean ( ) ; x 5 0 9 factory bean set certificate resources ( collection utils wrap ( resource ) ) ; return x 5 0 9 factory bean get object ( ) ; } catch ( final exception e ) { logger trace ( e get message ( ) , e ) ; logger debug ( " credential cannot be extracted from [ { } ] via x 509 treating it as a public key to locate credential " , resource ) ; val credential factory bean = new basic resource credential factory bean ( ) ; credential factory bean set public key info ( resource ) ; return credential factory bean get object ( ) ; } }


adds the given sink to this environment only sinks that have been added will be executed once the { @ link # execute ( ) } or { @ link # execute ( string ) } method is called

void register data sink ( data sink < ? > sink ) { this sinks add ( sink ) ; }


public void set max lifetime ( long max lifetime ms ) { this max lifetime = max lifetime ms ; }


get the configured message buffer size limit in bytes

public int get message size limit ( ) { return this message size limit ; }


strict locality requests shouldn ' t reserve resources on another node

public void test reservations strict locality ( ) throws i o exception { scheduler init ( conf ) ; scheduler start ( ) ; scheduler reinitialize ( conf , resource manager get r m context ( ) ) ; / / add two nodes r m node node 1 = mock nodes new node info ( 1 , resources create resource ( 1024 , 1 ) ) ; node added scheduler event node event 1 = new node added scheduler event ( node 1 ) ; scheduler handle ( node event 1 ) ; r m node node 2 = mock nodes new node info ( 1 , resources create resource ( 1024 , 1 ) ) ; node added scheduler event node event 2 = new node added scheduler event ( node 2 ) ; scheduler handle ( node event 2 ) ; / / submit application without container requests application attempt id att id = create scheduling request ( 1024 , " queue 1 " , " user 1 " , 0 ) ; f s app attempt app = scheduler get scheduler app ( att id ) ; / / request a container on node 2 resource request node request = create resource request ( 1024 , node 2 get host name ( ) , 1 , 1 , true ) ; resource request rack request = create resource request ( 1024 , " rack 1 " , 1 , 1 , false ) ; resource request any request = create resource request ( 1024 , resource request any , 1 , 1 , false ) ; create scheduling request existing application ( node request , att id ) ; create scheduling request existing application ( rack request , att id ) ; create scheduling request existing application ( any request , att id ) ; scheduler update ( ) ; / / heartbeat from node 1 app shouldn ' t get an allocation or reservation node update scheduler event node update event = new node update scheduler event ( node 1 ) ; scheduler handle ( node update event ) ; assert equals ( " app assigned a container on the wrong node " , 0 , app get live containers ( ) size ( ) ) ; scheduler handle ( node update event ) ; assert equals ( " app reserved a container on the wrong node " , 0 , app get reserved containers ( ) size ( ) ) ; }


public put index template request source ( map < string , object > template source ) { map < string , object > source = template source ; for ( map entry < string , object > entry : source entry set ( ) ) { string name = entry get key ( ) ; if ( name equals ( " index patterns " ) ) { if ( entry get value ( ) instanceof string ) { patterns ( collections singleton list ( ( string ) entry get value ( ) ) ) ; } else if ( entry get value ( ) instanceof list ) { list < string > elements = ( ( list < ? > ) entry get value ( ) ) stream ( ) map ( object : : to string ) collect ( collectors to list ( ) ) ; patterns ( elements ) ; } else { throw new illegal argument exception ( " malformed [ index patterns ] value , should be a string or a list of strings " ) ; } } else if ( name equals ( " order " ) ) { order ( x content map values node integer value ( entry get value ( ) , order ( ) ) ) ; } else if ( " version " equals ( name ) ) { if ( ( entry get value ( ) instanceof integer ) = = false ) { throw new illegal argument exception ( " malformed [ version ] value , should be an integer " ) ; } version ( ( integer ) entry get value ( ) ) ; } else if ( name equals ( " settings " ) ) { if ( ( entry get value ( ) instanceof map ) = = false ) { throw new illegal argument exception ( " malformed [ settings ] section , should include an inner object " ) ; } settings ( ( map < string , object > ) entry get value ( ) ) ; } else if ( name equals ( " mappings " ) ) { map < string , object > mappings = ( map < string , object > ) entry get value ( ) ; for ( map entry < string , object > entry 1 : mappings entry set ( ) ) { if ( ! ( entry 1 get value ( ) instanceof map ) ) { throw new illegal argument exception ( " malformed [ mappings ] section for type [ " + entry 1 get key ( ) + " ] , should include an inner object describing the mapping " ) ; } mapping ( ( map < string , object > ) entry 1 get value ( ) ) ; } } else if ( name equals ( " aliases " ) ) { aliases ( ( map < string , object > ) entry get value ( ) ) ; } else { throw new elasticsearch parse exception ( " unknown key [ { } ] in the template " , name ) ; } } return this ; }


this method will always throw { @ link java lang exception }

public static void simple try with resources ( ) throws exception { / / throwable add suppressed ( throwable ) should be called in the following block try ( simple resource resource = new simple resource ( ) ) { resource call ( true ) ; } }


get the user defined { @ link writable comparable } comparator for grouping keys of inputs to the reduce

public raw comparator get output value grouping comparator ( ) { class < ? extends raw comparator > the class = get class ( job context group comparator class , null , raw comparator class ) ; if ( the class = = null ) { return get output key comparator ( ) ; } return reflection utils new instance ( the class , this ) ; }


parses a subtitling segment , as defined by etsi en 300 743 7 2 the { @ link subtitle service } is updated with the parsed segment data

private static void parse subtitling segment ( parsable bit array data , subtitle service service ) { int segment type = data read bits ( 8 ) ; int page id = data read bits ( 16 ) ; int data field length = data read bits ( 16 ) ; int data field limit = data get byte position ( ) + data field length ; if ( ( data field length * 8 ) > data bits left ( ) ) { log w ( tag , " data field length exceeds limit " ) ; / / skip to the very end data skip bits ( data bits left ( ) ) ; return ; } switch ( segment type ) { case segment type display definition : if ( page id = = service subtitle page id ) { service display definition = parse display definition ( data ) ; } break ; case segment type page composition : if ( page id = = service subtitle page id ) { @ nullable page composition current = service page composition ; page composition page composition = parse page composition ( data , data field length ) ; if ( page composition state ! = page state normal ) { service page composition = page composition ; service regions clear ( ) ; service cluts clear ( ) ; service objects clear ( ) ; } else if ( current ! = null & & current version ! = page composition version ) { service page composition = page composition ; } } break ; case segment type region composition : @ nullable page composition page composition = service page composition ; if ( page id = = service subtitle page id & & page composition ! = null ) { region composition region composition = parse region composition ( data , data field length ) ; if ( page composition state = = page state normal ) { @ nullable region composition existing region composition = service regions get ( region composition id ) ; if ( existing region composition ! = null ) { region composition merge from ( existing region composition ) ; } } service regions put ( region composition id , region composition ) ; } break ; case segment type clut definition : if ( page id = = service subtitle page id ) { clut definition clut definition = parse clut definition ( data , data field length ) ; service cluts put ( clut definition id , clut definition ) ; } else if ( page id = = service ancillary page id ) { clut definition clut definition = parse clut definition ( data , data field length ) ; service ancillary cluts put ( clut definition id , clut definition ) ; } break ; case segment type object data : if ( page id = = service subtitle page id ) { object data object data = parse object data ( data ) ; service objects put ( object data id , object data ) ; } else if ( page id = = service ancillary page id ) { object data object data = parse object data ( data ) ; service ancillary objects put ( object data id , object data ) ; } break ; default : / / do nothing break ; } / / skip to the next segment data skip bytes ( data field limit - data get byte position ( ) ) ; }


check if the rsrc is localized on a good dir

boolean check local resource ( localized resource rsrc ) { list < string > local dirs = dirs handler get local dirs for read ( ) ; for ( string dir : local dirs ) { if ( is parent ( rsrc get local path ( ) to uri ( ) get path ( ) , dir ) ) { return true ; } else { continue ; } } return false ; }


called by internal mechanisms , do not call yourself

public void set dao session ( dao session dao session ) { this dao session = dao session ; my dao = dao session ! = null ? dao session get an active entity dao ( ) : null ; }


public connector type type ( ) { return type ; }


public void add finalize block op ( long latency ) { finalize block op add ( latency ) ; }


set a click listener that will provide the parent view , model , and adapter position of the clicked view this will clear the normal view on click listener if one has been set

public all types model view model on click listener ( @ non null final on model click listener < all types model view model , all types model view > on click listener ) { assigned attributes epoxy generated model set ( 11 ) ; on mutation ( ) ; if ( on click listener = = null ) { this on click listener on click listener = null ; } else { this on click listener on click listener = new wrapped epoxy model click listener ( on click listener ) ; } return this ; }


lookup a value from the stash adding support for a special key ( { @ code $ path } ) which returns a string that is the location in the path of the of the object currently being unstashed this is useful during documentation testing

private object get value ( list < object > path , string key ) throws i o exception { matcher matcher = path matcher ( key ) ; if ( false = = matcher find ( ) ) { return get value ( key ) ; } string builder path builder = new string builder ( ) ; iterator < object > element = path iterator ( ) ; if ( element has next ( ) ) { path builder append ( element next ( ) to string ( ) replace ( " " , " \ \ " ) ) ; while ( element has next ( ) ) { path builder append ( ' ' ) ; path builder append ( element next ( ) to string ( ) replace ( " " , " \ \ " ) ) ; } } string built path = matcher quote replacement ( path builder to string ( ) ) ; string buffer new key = new string buffer ( key length ( ) ) ; do { matcher append replacement ( new key , built path ) ; } while ( matcher find ( ) ) ; matcher append tail ( new key ) ; return get value ( new key to string ( ) ) ; }


public query profiler get current query profiler ( ) { return query profilers get ( query profilers size ( ) - 1 ) ; }


case 5 : destination name changed , source name and content changed

private void name contents changed ( program module source root , string source tree name , string dest tree name , string orig tree name , int conflict index ) throws cancelled exception { if ( only source structure choice = = ask user & & conflict option = = ask user & & merge manager ! = null ) { wait for user input ( source tree name , dest tree name , orig tree name , conflict index , true , false , true , true ) ; if ( conflict option = = canceled ) { throw new cancelled exception ( ) ; } / / if the " use for all " check box is selected / / then save the option chosen for this conflict type if ( merge panel get use for all ( ) ) { only source structure choice = conflict option ; } } int option to use = ( only source structure choice = = ask user ) ? conflict option : only source structure choice ; switch ( option to use ) { case keep other name : / / delete and add back in using source tree result listing remove tree ( dest tree name ) ; create tree ( result listing , dest tree name , source root ) ; break ; case keep private name : / / delete other name result listing remove tree ( dest tree name ) ; create tree ( result listing , source tree name , source root ) ; break ; case add new tree : create tree ( result listing , source tree name , source root ) ; break ; case rename private : create tree ( result listing , get unique tree name ( source tree name ) , source root ) ; break ; case original name : try { result listing rename tree ( dest tree name , get unique tree name ( orig tree name ) ) ; } catch ( duplicate name exception e ) { } break ; case canceled : throw new cancelled exception ( ) ; } conflict option = ask user ; }


destroy a subtree under a dst reference node

public static void destroy dst subtree ( i node reclaim context reclaim context , i node inode , final int snapshot , final int prior ) { preconditions check argument ( prior ! = no snapshot id ) ; if ( inode is reference ( ) ) { if ( inode instanceof i node reference with name & & snapshot ! = snapshot current state id ) { / / this inode has been renamed before the deletion of the dst reference / / subtree inode clean subtree ( reclaim context , snapshot , prior ) ; } else { / / for dst reference node , continue this process to its subtree destroy dst subtree ( reclaim context , inode as reference ( ) get referred i node ( ) , snapshot , prior ) ; } } else if ( inode is file ( ) ) { inode clean subtree ( reclaim context , snapshot , prior ) ; } else if ( inode is directory ( ) ) { map < i node , i node > excluded nodes = null ; i node directory dir = inode as directory ( ) ; directory with snapshot feature sf = dir get directory with snapshot feature ( ) ; if ( sf ! = null ) { directory diff list diff list = sf get diffs ( ) ; directory diff prior diff = diff list get diff by id ( prior ) ; if ( prior diff ! = null & & prior diff get snapshot id ( ) = = prior ) { list < i node > d list = prior diff diff get deleted unmodifiable ( ) ; excluded nodes = clone diff list ( d list ) ; } if ( snapshot ! = snapshot current state id ) { diff list delete snapshot diff ( reclaim context , snapshot , prior , dir ) ; } prior diff = diff list get diff by id ( prior ) ; if ( prior diff ! = null & & prior diff get snapshot id ( ) = = prior ) { prior diff diff destroy created list ( reclaim context , dir ) ; } } for ( i node child : inode as directory ( ) get children list ( prior ) ) { if ( excluded nodes ! = null & & excluded nodes contains key ( child ) ) { continue ; } destroy dst subtree ( reclaim context , child , snapshot , prior ) ; } } }


read an object of the given type from the given input message , and returns it

t read ( class < ? extends t > clazz , http input message input message ) throws i o exception , http message not readable exception ;


public codegen type get tag ( ) { return codegen type server ; }


list < object error > get global errors ( ) ;


sets the original query score mode the default is { @ link query rescore mode # total }

public query rescorer builder set score mode ( query rescore mode score mode ) { this score mode = score mode ; return this ; }


when this property is configured only messages to destinations matching one of the configured prefixes are eligible for handling when there is a match the prefix is removed and only the remaining part of the destination is used for method - mapping purposes by default , no prefixes are configured in which case all messages are eligible for handling

public void set destination prefixes ( @ nullable collection < string > prefixes ) { this destination prefixes clear ( ) ; if ( prefixes ! = null ) { for ( string prefix : prefixes ) { prefix = prefix trim ( ) ; this destination prefixes add ( prefix ) ; } } }


given the path fragment of a java source file , returns the java root relative path or ' null ' if no java root can be determined for example , " { workspace } javafoobarwiz " and " { workspace } javatestsfoobarwiz " both result in " foobarwiz " todo ( bazel - team ) : ( 2011 ) we need to have a more robust way to determine the java root of a relative path rather than simply trying to find the " java " or " javatests " directory

public static path fragment get java path ( path fragment path ) { int index = java segment index ( path ) ; if ( index > = 0 ) { return path sub fragment ( index + 1 ) ; } return null ; }


writes the authentication to the thread context

private void set authentication ( authentication authentication ) { try { authentication write to context ( thread context ) ; } catch ( i o exception e ) { throw new assertion error ( " how can we have a i o exception with a user we set " , e ) ; } }


reads a single character from this reader and returns it as an integer with the two higher - order bytes set to 0 returns - 1 if the end of the reader has been reached

public int read ( ) throws i o exception { synchronized ( lock ) { char char array [ ] = new char [ 1 ] ; if ( read ( char array , 0 , 1 ) ! = - 1 ) { return char array [ 0 ] ; } return - 1 ; } }


form parameter enum test ( string array )

public list < enum form string array enum > get enum form string array ( ) { return enum form string array ; }


specifies whether the graph will allow self - loops ( edges that connect a node to itself ) attempting to add a self - loop to a graph that does not allow them will throw an { @ link unsupported operation exception } the default value is { @ code false }

public graph builder < n > allows self loops ( boolean allows self loops ) { this allows self loops = allows self loops ; return this ; }


the operation sequence number generated by primary note : { @ link sequence numbers # unassigned seq no } indicates sequence number was not generated by primary

public long get seq no ( ) { return seq no ; }


to string contains to string of elements

public void test to string ( ) { concurrent map map = map 5 ( ) ; string s = map to string ( ) ; for ( int i = 1 ; i < = 5 ; + + i ) { assert true ( s contains ( string value of ( i ) ) ) ; } }


if the { @ code default servlet name } property has not been explicitly set , attempts to locate the default servlet using the known common container - specific names

public void set servlet context ( servlet context servlet context ) { this servlet context = servlet context ; if ( ! string utils has text ( this default servlet name ) ) { if ( this servlet context get named dispatcher ( common default servlet name ) ! = null ) { this default servlet name = common default servlet name ; } else if ( this servlet context get named dispatcher ( gae default servlet name ) ! = null ) { this default servlet name = gae default servlet name ; } else if ( this servlet context get named dispatcher ( resin default servlet name ) ! = null ) { this default servlet name = resin default servlet name ; } else if ( this servlet context get named dispatcher ( weblogic default servlet name ) ! = null ) { this default servlet name = weblogic default servlet name ; } else if ( this servlet context get named dispatcher ( websphere default servlet name ) ! = null ) { this default servlet name = websphere default servlet name ; } else { throw new illegal state exception ( " unable to locate the default servlet for serving static content " + " please set the ' default servlet name ' property explicitly " ) ; } } }


create a rest endpoint from a list of u r is

public static endpoint rest endpoint ( string api , uri uris ) { return url endpoint ( api , protocol types protocol rest , uris ) ; }


returns a new set containing the first n elements in this grouped and sorted { @ link data set }


returns a string containing the string representation of each entry in { @ code entries } , using the previously configured separator and key - value separator

public string join ( iterable < ? extends entry < ? , ? > > entries ) { return join ( entries iterator ( ) ) ; }


creates the specified number of concurrent consumers , in the form of a jms session plus associated message consumer running in a separate thread

protected void do initialize ( ) throws j m s exception { synchronized ( this lifecycle monitor ) { for ( int i = 0 ; i < this concurrent consumers ; i + + ) { schedule new invoker ( ) ; } } }


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 ) { default : return null ; } }


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


return the value for the ' auto startup ' property if " true " , this endpoint manager will start upon a context refreshed event

public boolean is auto startup ( ) { return this auto startup ; }


the predicted outermost alternative for the rule associated with this context object if this node left recursive , the true original outermost alternative is returned

public int get outer alt num ( ) { return outer alt num ; }


public void test void return def ( ) { assert equals ( 2 , exec ( " def list = new array list ( ) ; " + " list add ( 2 ) ; " + " list list 2 = new array list ( ) ; " + " list for each ( x - > list 2 add ( x ) ) ; " + " return list [ 0 ] " ) ) ; }


creates a mutable { @ code linked list } instance containing the given elements ; a very thin shortcut for creating an empty list then calling { @ link iterables # add all } < b > note : < b > if mutability is not required and the elements are non - null , use { @ link immutable list # copy of ( iterable ) } instead ( or , change { @ code elements } to be a { @ link fluent iterable } and call { @ code elements to list ( ) } ) < b > performance note : < b > { @ link array list } and { @ link java util array deque } consistently outperform { @ code linked list } except in certain rare and specific situations unless you have spent a lot of time benchmarking your specific needs , use one of those instead < b > note for java 7 and later : < b > if { @ code elements } is a { @ link collection } , you don ' t need this method use the { @ code linked list } { @ linkplain linked list # linked list ( collection ) constructor } directly , taking advantage of the new < a href = " http : goo gliz 2 wi " > " diamond " syntax

public static < e > linked list < e > new linked list ( iterable < ? extends e > elements ) { linked list < e > list = new linked list ( ) ; iterables add all ( list , elements ) ; return list ; }


read { @ code byte count } bytes of headers from the source stream this implementation does not propagate the never indexed flag of a header

void read headers ( ) throws i o exception { while ( ! source exhausted ( ) ) { int b = source read byte ( ) & 0xff ; if ( b = = 0x 8 0 ) { / / 10000000 throw new i o exception ( " index = = 0 " ) ; } else if ( ( b & 0x 8 0 ) = = 0x 8 0 ) { / / 1nnnnnnn int index = read int ( b , prefix 7 bits ) ; read indexed header ( index - 1 ) ; } else if ( b = = 0x 4 0 ) { / / 01000000 read literal header with incremental indexing new name ( ) ; } else if ( ( b & 0x 4 0 ) = = 0x 4 0 ) { / / 01nnnnnn int index = read int ( b , prefix 6 bits ) ; read literal header with incremental indexing indexed name ( index - 1 ) ; } else if ( ( b & 0x 2 0 ) = = 0x 2 0 ) { / / 001nnnnn max dynamic table byte count = read int ( b , prefix 5 bits ) ; if ( max dynamic table byte count < 0 | | max dynamic table byte count > header table size setting ) { throw new i o exception ( " invalid dynamic table size update " + max dynamic table byte count ) ; } adjust dynamic table byte count ( ) ; } else if ( b = = 0x 1 0 | | b = = 0 ) { / / 000 ? 0000 - ignore never indexed bit read literal header without indexing new name ( ) ; } else { / / 000 ? nnnn - ignore never indexed bit int index = read int ( b , prefix 4 bits ) ; read literal header without indexing indexed name ( index - 1 ) ; } } }


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

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


returns the cache from disk , or null if the file doesn ' t exist or if there is an error

private test result data maybe read cache status ( ) { try { return read cache status ( ) ; } catch ( i o exception expected ) { return null ; } }


remove given datanode from dead node detector

public void remove node from dead node detector ( d f s input stream dfs input stream , datanode info datanode info ) { if ( ! is dead node detection enabled ( ) ) { log debug ( " dead node detection is not enabled , skip to remove node { } " , datanode info ) ; return ; } client context get dead node detector ( ) remove node from dead node detector ( dfs input stream , datanode info ) ; }


guaranteed to throw an exception and leave the multimap unmodified

public boolean remove ( object key , object value ) { throw new unsupported operation exception ( ) ; }


sets the fields to < code > null < code > using the given bit mask the bits correspond to the individual columns : < code > ( 1 = = nullify , 0 = = keep ) < code >

public void set null ( long [ ] mask ) { for ( int mask pos = 0 , i = 0 ; i < this num fields ; ) { long curr mask = mask [ mask pos ] ; for ( int k = 64 ; i < this num fields & & k > 0 ; - - k , i + + , curr mask > > > = 1 ) { if ( ( curr mask & 0x 1 ) ! = 0 ) { internally set field ( i , null ) ; } } } }


return whether the binding has a value associated with it


filter on method arguments with annotations see { @ link org springframework web method mvc annotation predicates }

public final arg resolver annot ( predicate < method parameter > filters ) { this filters add all ( arrays as list ( filters ) ) ; return this ; }