create named { @ link bind markers } using identifiers to bind parameters named bind markers can support { @ link bind markers # next ( string ) name hints } if no { @ link bind markers # next ( string ) hint } is given , named bind markers can use a counter or a random value source to generate unique bind markers allows customization of the bind marker placeholder { @ code prefix } and { @ code name prefix } to represent the bind marker as placeholder within the query

static bind markers factory named ( string prefix , string name prefix , int max length ) { return named ( prefix , name prefix , max length , function identity ( ) ) ; }


tests { @ link network buffer pool # request memory segments ( int ) } , verifying it may be aborted and remains in a defined state even if the waiting is interrupted

public void test request memory segments interruptable 2 ( ) throws exception { final int num buffers = 10 ; network buffer pool global pool = new network buffer pool ( num buffers , 128 ) ; memory segment segment = global pool request memory segment ( ) ; assert not null ( segment ) ; final one shot latch is running = new one shot latch ( ) ; checked thread async request = new checked thread ( ) { @ override public void go ( ) throws i o exception { is running trigger ( ) ; global pool request memory segments ( 10 ) ; } } ; async request start ( ) ; / / we want the destroy call inside the blocking part of the / / global pool request memory segments ( ) / / call above we cannot guarantee this though but make it highly probable : is running await ( ) ; thread sleep ( 10 ) ; async request interrupt ( ) ; global pool recycle ( segment ) ; try { async request sync ( ) ; } catch ( i o exception e ) { assert that ( e , has property ( " cause " , instance of ( interrupted exception class ) ) ) ; / / test indirectly for network buffer pool # num total required buffers being correct : / / - > creating a new buffer pool should not fail global pool create buffer pool ( 10 , 10 ) ; } finally { global pool destroy ( ) ; } }


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


subclasses may override this to perform custom initialization all bean properties of this filter will have been set before this method is invoked note : this method will be called from standard filter initialization as well as filter bean initialization in a spring application context filter name and servlet context will be available in both cases this default implementation is empty

protected void init filter bean ( ) throws servlet exception { }


public void visit throwing cst insn ( throwing cst insn insn ) { / / this space intentionally left blank }


called when reading a headers or priority frame this may be used to change the stream ' s weight from the default ( 16 ) to a new value

void priority ( int stream id , int stream dependency , int weight , boolean exclusive ) ;


advanced application writers can use the { @ link # run ( org apache hadoop mapreduce reducer context ) } method to control how the reduce task works

public void run ( context context ) throws i o exception , interrupted exception { setup ( context ) ; try { while ( context next key ( ) ) { reduce ( context get current key ( ) , context get values ( ) , context ) ; / / if a back up store is used , reset it iterator < valuein > iter = context get values ( ) iterator ( ) ; if ( iter instanceof reduce context value iterator ) { ( ( reduce context value iterator < valuein > ) iter ) reset backup store ( ) ; } } } finally { cleanup ( context ) ; } }


get the current cluster state as a json string representation of the { @ link cluster metrics info }

private void update cluster state ( ) { try { / / get the current state current cluster state get buffer ( ) set length ( 0 ) ; cluster metrics info cluster metrics info = new cluster metrics info ( rs ) ; marshaller marshall to j s o n ( cluster metrics info , current cluster state ) ; capability = current cluster state to string ( ) ; } catch ( exception e ) { log warn ( " exception while trying to generate cluster state , " + " so reverting to last know state " , e ) ; } }


schedule the given { @ link runnable } , invoking it at the specified execution time execution will end once the scheduler shuts down or the returned { @ link scheduled future } gets cancelled

scheduled future < ? > schedule ( runnable task , date start time ) ;


removes the indicated external library from the indicated program version if it is empty

private void remove external library ( program program , string lib name ) throws invalid input exception { external manager ext mgr = program get external manager ( ) ; external location iterator iter = ext mgr get external locations ( lib name ) ; if ( iter has next ( ) ) { throw new invalid input exception ( " didn ' t remove external library " + lib name + " since it isn ' t empty " ) ; } if ( ! ext mgr remove external library ( lib name ) ) { throw new invalid input exception ( " didn ' t remove external library " + lib name ) ; } }


expand the environment variable in platform - agnostic syntax the parameter expansion marker " { { var } } " will be replaced with real parameter expansion marker ( ' % ' for windows and ' $ ' for linux ) by node manager on container launch for example : { { var } } will be replaced as $ var on linux , and % var % on windows

public string $ $ ( ) { return parameter expansion left + variable + parameter expansion right ; }


public void test checkpoint tracking ( ) throws exception { int number of subtasks = 3 ; execution job vertex job vertex = mock ( execution job vertex class ) ; when ( job vertex get job vertex id ( ) ) then return ( new job vertex i d ( ) ) ; when ( job vertex get parallelism ( ) ) then return ( number of subtasks ) ; checkpoint stats tracker tracker = new checkpoint stats tracker ( 10 , collections singleton list ( job vertex ) , mock ( checkpoint coordinator configuration class ) , new unregistered metrics group ( ) ) ; / / completed checkpoint pending checkpoint stats completed 1 = tracker report pending checkpoint ( 0 , 1 , checkpoint properties for checkpoint ( checkpoint retention policy never retain after termination ) ) ; completed 1 report subtask stats ( job vertex get job vertex id ( ) , create subtask stats ( 0 ) ) ; completed 1 report subtask stats ( job vertex get job vertex id ( ) , create subtask stats ( 1 ) ) ; completed 1 report subtask stats ( job vertex get job vertex id ( ) , create subtask stats ( 2 ) ) ; completed 1 report completed checkpoint ( null ) ; / / failed checkpoint pending checkpoint stats failed = tracker report pending checkpoint ( 1 , 1 , checkpoint properties for checkpoint ( checkpoint retention policy never retain after termination ) ) ; failed report failed checkpoint ( 12 , null ) ; / / completed savepoint pending checkpoint stats savepoint = tracker report pending checkpoint ( 2 , 1 , checkpoint properties for savepoint ( true ) ) ; savepoint report subtask stats ( job vertex get job vertex id ( ) , create subtask stats ( 0 ) ) ; savepoint report subtask stats ( job vertex get job vertex id ( ) , create subtask stats ( 1 ) ) ; savepoint report subtask stats ( job vertex get job vertex id ( ) , create subtask stats ( 2 ) ) ; savepoint report completed checkpoint ( null ) ; / / in progress pending checkpoint stats in progress = tracker report pending checkpoint ( 3 , 1 , checkpoint properties for checkpoint ( checkpoint retention policy never retain after termination ) ) ; restored checkpoint stats restored = new restored checkpoint stats ( 81 , checkpoint properties for checkpoint ( checkpoint retention policy never retain after termination ) , 123 , null ) ; tracker report restored checkpoint ( restored ) ; checkpoint stats snapshot snapshot = tracker create snapshot ( ) ; / / counts checkpoint stats counts counts = snapshot get counts ( ) ; assert equals ( 4 , counts get total number of checkpoints ( ) ) ; assert equals ( 1 , counts get number of in progress checkpoints ( ) ) ; assert equals ( 2 , counts get number of completed checkpoints ( ) ) ; assert equals ( 1 , counts get number of failed checkpoints ( ) ) ; / / summary stats completed checkpoint stats summary summary = snapshot get summary stats ( ) ; assert equals ( 2 , summary get state size stats ( ) get count ( ) ) ; assert equals ( 2 , summary get end to end duration stats ( ) get count ( ) ) ; / / history checkpoint stats history history = snapshot get history ( ) ; iterator < abstract checkpoint stats > it = history get checkpoints ( ) iterator ( ) ; assert true ( it has next ( ) ) ; abstract checkpoint stats stats = it next ( ) ; assert equals ( 3 , stats get checkpoint id ( ) ) ; assert true ( stats get status ( ) is in progress ( ) ) ; assert true ( it has next ( ) ) ; stats = it next ( ) ; assert equals ( 2 , stats get checkpoint id ( ) ) ; assert true ( stats get status ( ) is completed ( ) ) ; assert true ( it has next ( ) ) ; stats = it next ( ) ; assert equals ( 1 , stats get checkpoint id ( ) ) ; assert true ( stats get status ( ) is failed ( ) ) ; assert true ( it has next ( ) ) ; stats = it next ( ) ; assert equals ( 0 , stats get checkpoint id ( ) ) ; assert true ( stats get status ( ) is completed ( ) ) ; assert false ( it has next ( ) ) ; / / latest checkpoints assert equals ( completed 1 get checkpoint id ( ) , snapshot get history ( ) get latest completed checkpoint ( ) get checkpoint id ( ) ) ; assert equals ( savepoint get checkpoint id ( ) , snapshot get history ( ) get latest savepoint ( ) get checkpoint id ( ) ) ; assert equals ( failed get checkpoint id ( ) , snapshot get history ( ) get latest failed checkpoint ( ) get checkpoint id ( ) ) ; assert equals ( restored , snapshot get latest restored checkpoint ( ) ) ; }


register a listener that will be called when this model is unbound from 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 generate default layout method next parent layout $ no layout on unbind ( on model unbound listener < generate default layout method next parent layout $ no layout , object > listener ) { on mutation ( ) ; this on model unbound listener epoxy generated model = listener ; return this ; }


lookup returns a target for a single key

public void route lookup ( io grpc lookup v 1 route lookup request request , io grpc stub stream observer < io grpc lookup v 1 route lookup response > response observer ) { io grpc stub client calls async unary call ( get channel ( ) new call ( get route lookup method ( ) , get call options ( ) ) , request , response observer ) ; }


get storeinventory : returns pet inventories by status returns a map of status codes to quantities

response entity < map < string , integer > > get inventory ( ) ;


makes text print on the terminal in yellow

public void text yellow ( ) throws i o exception { set text color ( color yellow ) ; }


returns a joiner with the same behavior as this joiner , except automatically skipping over any provided null elements

public joiner skip nulls ( ) { return new joiner ( this ) { @ override public < a extends appendable > a append to ( a appendable , iterator < ? > parts ) throws i o exception { check not null ( appendable , " appendable " ) ; check not null ( parts , " parts " ) ; while ( parts has next ( ) ) { object part = parts next ( ) ; if ( part ! = null ) { appendable append ( joiner this to string ( part ) ) ; break ; } } while ( parts has next ( ) ) { object part = parts next ( ) ; if ( part ! = null ) { appendable append ( separator ) ; appendable append ( joiner this to string ( part ) ) ; } } return appendable ; } @ override public joiner use for null ( string null text ) { throw new unsupported operation exception ( " already specified skip nulls " ) ; } @ override public map joiner with key value separator ( string kvs ) { throw new unsupported operation exception ( " can ' t use skip nulls ( ) with maps " ) ; } } ; }


makes a user choice on a primary symbol conflict as indicated by option this is equivalent to the user clicking a mouse on a radio button indicating which version ' s primary symbol is desired it can also be used to press the cancel button on the merge

protected void choose radio button ( final string component name , final class < ? extends container > conflict panel class ) throws exception { choose radio button ( component name , conflict panel class , true ) ; }


public model without setter on unbind ( on model unbound listener < model without setter , object > listener ) { on mutation ( ) ; this on model unbound listener epoxy generated model = listener ; return this ; }


creates and writes to file an image of the given component the file will be written to the reports directory ( this differs depending upon how the test was run ) , nested inside a directory structure of the form { test class name } { test name } a console statement will be written indicating the location of the written file

public void capture ( component c , string name ) throws exception { / / old way of grabbing images - - still need this if you want to capture a window ' s / / decorations / / image image = create screen image ( c ) ; image image = create rendered image ( c ) ; write image ( image , name ) ; }


public s 3 a file system get file system ( ) { return ( s 3 a file system ) super get file system ( ) ; }


execute the http method to the given uri template , writing the given request entity to the request , and returns the response as { @ link response entity } the given { @ link parameterized type reference } is used to pass generic type information : < pre class = " code " > parameterized type reference & lt ; list & lt ; my bean & gt ; & gt ; my bean = new parameterized type reference & lt ; list & lt ; my bean & gt ; & gt ; ( ) { } ; response entity & lt ; list & lt ; my bean & gt ; & gt ; response = template exchange ( & quot ; https : example com & quot ; , http method get , null , my bean ) ;

< t > response entity < t > exchange ( uri url , http method method , @ nullable http entity < ? > request entity , parameterized type reference < t > response type ) throws rest client exception ;


tries to allocate slots for the given requirement if there are not enough slots available , the resource manager is informed to allocate more resources

private int internal try allocate slots ( job i d job id , string target address , resource requirement resource requirement ) { final resource profile required resource = resource requirement get resource profile ( ) ; collection < task manager slot information > free slots = slot tracker get free slots ( ) ; int num unfulfilled = 0 ; for ( int x = 0 ; x < resource requirement get number of required slots ( ) ; x + + ) { final optional < task manager slot information > reserved slot = slot matching strategy find matching slot ( required resource , free slots , this : : get number registered slots of ) ; if ( reserved slot is present ( ) ) { / / we do not need to modify free slots because it is indirectly modified by the / / allocation allocate slot ( reserved slot get ( ) , job id , target address , required resource ) ; } else { / / exit loop early ; we won ' t find a matching slot for this requirement int num remaining = resource requirement get number of required slots ( ) - x ; num unfulfilled + = num remaining ; break ; } } return num unfulfilled ; }


used space by the block pool as percentage of present capacity

public float get block pool used percent ( ) { return d f s util client get percent used ( block pool used , capacity ) ; }


contributes environment variables used for a build this method can be called repeatedly for the same { @ link run } , thus the computation of this method needs to be efficient if you have a time - consuming computation , one strategy is to take the hit once and then add the result as { @ link invisible action } to { @ link run } , then reuse those values later on this method gets invoked concurrently for multiple { @ link run } s that are being built at the same time , so it must be concurrent - safe when building environment variables for a build , jenkins will also invoke { @ link # build environment for ( job , env vars , task listener ) } this method only needs to add variables that are scoped to builds

public void build environment for ( @ non null run r , @ non null env vars envs , @ non null task listener listener ) throws i o exception , interrupted exception { }


returns a value that represents a fixed number of options all options are strings

static public value option value ( string name , final string current value , final string [ ] [ ] options , final string description ) { return new default value ( name , current value to string ( ) ) { public void show dialog ( ) { int selected index = - 1 ; default combo box model model = new default combo box model ( ) ; for ( int i = 0 ; i < options length ; i + + ) { model add element ( options [ i ] [ 0 ] ) ; if ( get value ( i ) equals ( current value ) ) selected index = i ; } j combo box combo box = new j combo box ( model ) ; combo box set selected index ( selected index ) ; if ( show value dialog ( combo box , description ) ) value = get value ( combo box get selected index ( ) ) ; } private string get value ( int i ) { if ( options [ i ] length = = 1 ) return options [ i ] [ 0 ] ; return options [ i ] [ 1 ] ; } public string to string ( ) { for ( int i = 0 ; i < options length ; i + + ) if ( get value ( i ) equals ( value ) ) return options [ i ] [ 0 ] to string ( ) ; return " " ; } public object get object ( ) { return value ; } } ; }


sets host and target configuration using the specified options , falling back to the default options for unspecified ones , and recreates the build view todo ( juliexxia ) : when starlark option parsing exists , find a way to combine these parameters into a single parameter so starlarknative options don ' t have to be specified separately

protected void use configuration ( immutable map < string , object > starlark options , string args ) throws exception { immutable list < string > actual args = immutable list < string > builder ( ) add all ( get defaults for configuration ( ) ) add ( args ) build ( ) ; master config = create configurations ( starlark options , actual args to array ( new string [ 0 ] ) ) ; target config = get target configuration ( ) ; target config key = build configuration value key ( target config ) ; configuration args = actual args ; create build view ( ) ; }


this implementation returns the description of this resource

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


verifies if a set is a majority assumes that ack set contains acks only from voting members

public boolean contains quorum ( set < long > ack set ) { return ( ack set size ( ) > half ) ; }


static notification sender no op ( ) { return ( principal , message data ) - > true ; }


check that configuring deprecation settings causes a warning to be added to the response headers

public void test deprecated settings return warnings ( ) throws i o exception { x content builder builder = json x content content builder ( ) start object ( ) start object ( " transient " ) field ( test deprecation header rest action test deprecated setting true1 get key ( ) , ! test deprecation header rest action test deprecated setting true1 get default ( settings empty ) ) field ( test deprecation header rest action test deprecated setting true2 get key ( ) , ! test deprecation header rest action test deprecated setting true2 get default ( settings empty ) ) / / there should be no warning for this field field ( test deprecation header rest action test not deprecated setting get key ( ) , ! test deprecation header rest action test not deprecated setting get default ( settings empty ) ) end object ( ) end object ( ) ; final request request = new request ( " put " , " cluster / settings " ) ; request set json entity ( strings to string ( builder ) ) ; final response response = client ( ) perform request ( request ) ; final list < string > deprecated warnings = get warning headers ( response get headers ( ) ) ; final list < matcher < string > > header matchers = new array list < > ( 2 ) ; for ( setting < boolean > setting : list of ( test deprecation header rest action test deprecated setting true1 , test deprecation header rest action test deprecated setting true2 ) ) { header matchers add ( equal to ( " [ " + setting get key ( ) + " ] setting was deprecated in elasticsearch and will be removed in a future release ! " + " see the breaking changes documentation for the next major version " ) ) ; } assert that ( deprecated warnings , has size ( header matchers size ( ) ) ) ; for ( final string deprecated warning : deprecated warnings ) { assert that ( " header does not conform to expected pattern " , deprecated warning , matches ( header warning warning header pattern pattern ( ) ) ) ; } final list < string > actual warning values = deprecated warnings stream ( ) map ( s - > header warning extract warning value from warning header ( s , true ) ) collect ( collectors to list ( ) ) ; for ( matcher < string > header matcher : header matchers ) { assert that ( actual warning values , has item ( header matcher ) ) ; } }


wraps a { @ code callable } for submission to the underlying executor this method is also applied to any { @ code runnable } passed to the default implementation of { @ link # wrap task ( runnable ) }

protected abstract < t > callable < t > wrap task ( callable < t > callable ) ;


calculates the first day of a year in milliseconds since the epoch ( assuming utc )

static long utc millis at start of year ( final int year ) { / / initial value is just temporary int leap years = year / 100 ; if ( year < 0 ) { / / add 3 before shifting right since / 4 and > > 2 behave differently / / on negative numbers when the expression is written as / / ( year / 4 ) - ( year / 100 ) + ( year / 400 ) , / / it works for both positive and negative values , except this optimization / / eliminates two divisions leap years = ( ( year + 3 ) > > 2 ) - leap years + ( ( leap years + 3 ) > > 2 ) - 1 ; } else { leap years = ( year > > 2 ) - leap years + ( leap years > > 2 ) ; if ( is leap year ( year ) ) { leap years - - ; } } return ( year * 365l + ( leap years - days 0000 to 1970 ) ) * millis per day ; / / millis per day }


confirm that replace values ( ) returns a list implementing random access

public void test replace values random access ( ) { multimap < string , integer > multimap = create ( ) ; multimap put ( " foo " , 1 ) ; multimap put ( " foo " , 3 ) ; assert true ( multimap replace values ( " foo " , as list ( 2 , 4 ) ) instanceof random access ) ; assert true ( multimap replace values ( " bar " , as list ( 2 , 4 ) ) instanceof random access ) ; }


public static void mock resource manager ( branch type branch type , resource manager rm ) { resource managers put ( branch type , rm ) ; }


reduces the size of the backing array to the size of the actual items this is useful to release memory when many items have been removed , or if it is known that more items will not be added

public char [ ] shrink ( ) { if ( items length ! = size ) resize ( size ) ; return items ; }


called by { @ link spatial index builder operator } to provide a { @ link supplier } of spatial indexes for { @ link spatial join operator } s to use returns a future that completes once all the { @ link spatial join operator } s have completed

public listenable future < ? > lend pages spatial index ( supplier < pages spatial index > pages spatial index ) { require non null ( pages spatial index , " pages spatial index is null " ) ; if ( active probe operators get free future ( ) is done ( ) ) { return not blocked ; } list < settable future < pages spatial index > > settable futures ; synchronized ( this ) { verify ( this pages spatial index = = null ) ; this pages spatial index = pages spatial index ; settable futures = immutable list copy of ( pages spatial index futures ) ; pages spatial index futures clear ( ) ; } for ( settable future < pages spatial index > settable future : settable futures ) { settable future set ( pages spatial index get ( ) ) ; } return active probe operators get free future ( ) ; }


returns true if { @ link endpoint # ipv 4 ( ) } or { @ link endpoint # ipv 6 ( ) } could be parsed from the input returns boolean not this for conditional parsing for example : { @ code if ( ! builder parse ip ( input get header ( " x - forwarded - for " ) ) ) { builder parse ip ( input get remote addr ( ) ) ; } }

public final boolean parse ip ( @ nullable string ip string ) { if ( ip string = = null | | ip string is empty ( ) ) return false ; ip family format = detect family ( ip string ) ; if ( format = = ip family i pv 4 ) { ipv 4 = ip string ; ipv 4 bytes = get ipv 4 bytes ( ipv 4 ) ; } else if ( format = = ip family i pv 4 embedded ) { ipv 4 = ip string substring ( ip string last index of ( ' : ' ) + 1 ) ; ipv 4 bytes = get ipv 4 bytes ( ipv 4 ) ; } else if ( format = = ip family i pv 6 ) { byte [ ] address bytes = text to numeric format v 6 ( ip string ) ; if ( address bytes = = null ) return false ; ipv 6 = write ip v 6 ( address bytes ) ; / / ensures consistent format ipv 6 bytes = address bytes ; } else { return false ; } return true ; }


gets the relative name to this item from the specified group

default string get relative name from ( @ check for null item group g ) { return functions get relative name from ( this , g ) ; }


trigger an initial auth operation if some of the needed fields are missing

private void auth if needed ( ) throws i o exception { if ( get endpoint u r i ( ) = = null ) { authenticate ( ) ; } }


test a case where there is a cycle in renaming dirs

public void test sync 6 ( ) throws exception { if ( is src not same as tgt ) { init data 6 ( source ) ; } init data 6 ( target ) ; enable and create first snapshot ( ) ; int num deleted modified = change data 6 ( target ) ; create second snapshot at target ( ) ; test and verify ( num deleted modified ) ; }


create the zone and its related zone associated dns records ( ns , soa )

private zone configure zone ( name zone name , configuration conf ) throws i o exception { bind host = name from string ( inet address get local host ( ) get canonical host name ( ) + " " ) ; s o a record soa record = new s o a record ( zone name , d class in , ttl , bind host , bind host , get serial ( ) , 86000 , 7200 , 1209600 , 600 ) ; n s record ns record = new n s record ( zone name , d class in , ttl , bind host ) ; zone zone = zones get ( zone name ) ; if ( zone = = null ) { zone = new secureable zone ( zone name , new record [ ] { soa record , ns record } ) ; } try { enable d n s s e c if necessary ( zone , conf , soa record , ns record ) ; } catch ( no such algorithm exception e ) { throw new i o exception ( e ) ; } catch ( invalid key spec exception e ) { throw new i o exception ( e ) ; } catch ( dnssec d n s s e c exception e ) { throw new i o exception ( e ) ; } return zone ; }


checks whether the freezable starlark value is frozen or temporarily immutable due to active iterators

public static void check mutable ( mutability freezable x ) throws eval exception { if ( x mutability ( ) is frozen ( ) ) { throw errorf ( " trying to mutate a frozen % s value " , type ( x ) ) ; } if ( x update iterator count ( 0 ) ) { throw errorf ( " % s value is temporarily immutable due to active for - loop iteration " , type ( x ) ) ; } }


private static int [ ] insert ( int [ ] array , int current size , int index , int element ) { if ( current size + 1 < = array length ) { system arraycopy ( array , index , array , index + 1 , current size - index ) ; array [ index ] = element ; return array ; } int [ ] new array = new int [ grow size ( current size ) ] ; system arraycopy ( array , 0 , new array , 0 , index ) ; new array [ index ] = element ; system arraycopy ( array , index , new array , index + 1 , array length - index ) ; return new array ; }


returns the unassigned info for the shard , or { @ code null } if the shard is active

public unassigned info get unassigned info ( ) { return shard routing unassigned info ( ) ; }


register a listener that will be called when this model is unbound from 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 all types model view model on unbind ( on model unbound listener < all types model view model , all types model view > listener ) { on mutation ( ) ; this on model unbound listener epoxy generated model = listener ; return this ; }


set the resource loader to use for resource locations if specifying a resource pattern resolver , the bean definition reader will be capable of resolving resource patterns to resource arrays default is path matching resource pattern resolver , also capable of resource pattern resolving through the resource pattern resolver interface setting this to { @ code null } suggests that absolute resource loading is not available for this bean definition reader

public void set resource loader ( @ nullable resource loader resource loader ) { this resource loader = resource loader ; }


public void put ( @ non null final string key , final int value ) { put ( key , value , false ) ; }


public static void close i o ( final closeable closeables ) { if ( closeables = = null ) return ; for ( closeable closeable : closeables ) { if ( closeable ! = null ) { try { closeable close ( ) ; } catch ( i o exception e ) { e print stack trace ( ) ; } } } }


public void prefix boolean test ( ) { / / todo : test prefix boolean }


completes the xml document and closes the underlying writer

public void close ( ) throws i o exception { while ( ! element stack is empty ( ) ) { end element ( ) ; } writer append ( eol ) ; writer close ( ) ; }


cleanup the job context , including aborting anything pending and destroying the thread pool

protected void cleanup ( job context context , boolean suppress exceptions ) throws i o exception { try ( duration info d = new duration info ( log , " cleanup job % s " , job id string ( context ) ) ) { abort pending uploads in cleanup ( suppress exceptions ) ; } finally { destroy thread pool ( ) ; cleanup staging dirs ( ) ; } }


returns whether the elements of the two given arrays are the same , or both arrays are null

public static boolean equal or null ( object [ ] array 1 , object [ ] array 2 , int size ) { return array 1 = = null ? array 2 = = null : array 2 ! = null & & equal ( array 1 , array 2 , size ) ; }


intersect the set with the elements of the block , eliminating duplicates

public void intersect ( block block ) { current block index + + ; ensure blocks capacity ( current block index + 1 ) ; blocks [ current block index ] = block ; if ( current block index = = 0 ) { / / this set was an empty set , so the result set should also be an empty set positions for blocks add ( empty selected positions ) ; return ; } int position count = block get position count ( ) ; int [ ] positions = ensure capacity ( positions for blocks get ( current block index - 1 ) get positions ( ) , position count ) ; / / we need to create a new hash table because the elements in the set may be removed long [ ] new block position by hash = initialize hash table ( ) ; int positions index = 0 ; for ( int i = 0 ; i < position count ; i + + ) { int hash = get masked hash ( hash position ( element type , block , i ) ) ; int position in block position by hash = get insert position ( block position by hash , hash , block , i ) ; if ( position in block position by hash = = invalid position ) { / / add to the hash table if it exists in block position by hash if ( add element ( new block position by hash , hash , block , i ) ) { positions [ positions index + + ] = i ; } } } block position by hash = new block position by hash ; get positions for blocks ( ) add ( positions list ( positions , 0 , positions index ) ) ; size = positions index ; clear previous blocks ( ) ; }


often , a { @ link web driver } instance needs one or more supporting files or executables to be present ( such as a vendor - provided executable which speaks the web driver protocol ) this means that even though the driver classes might be present in java , it would make no sense to attempt to instantiate the driver itself


whether to parse the path into path segments if the encoding mode is set to { @ link encoding mode # uri component encoding mode uri component }

public boolean should parse path ( ) { return this parse path ; }


assert that a specific number of files were created

private void assert files created ( azure blob storage test account account , string name , int expected ) { assert equals ( " files created in account " + name , expected , get files created ( account ) ) ; }


return the string of decode urlencoded string

public static string url decode ( final string input ) { return url decode ( input , " utf - 8 " ) ; }


retrieve the given annotation ' s attributes as a { @ link map } , preserving all attribute types equivalent to calling { @ link # get annotation attributes ( annotation , boolean , boolean ) } with the { @ code class values as string } and { @ code nested annotations as map } parameters set to { @ code false } note : this method actually returns an { @ link annotation attributes } instance however , the { @ code map } signature has been preserved for binary compatibility

public static map < string , object > get annotation attributes ( annotation annotation ) { return get annotation attributes ( null , annotation ) ; }


sets the < code > property < code > property

public name property ( string property ) { this property = property ; return this ; }


gets the repository browser descriptor by name primarily used for making them web - visible

public descriptor < repository browser < ? > > get repository browser ( string short class name ) { return find descriptor ( short class name , repository browser all ( ) ) ; }


writes two code units to the given output destination

protected static void write ( annotated output out , short c 0 , short c 1 ) { out write short ( c 0 ) ; out write short ( c 1 ) ; }


like using ( ) but overrideable by navigable map test suite builder

sorted map test suite builder < k , v > new builder using ( test sorted map generator < k , v > delegate , bound to , bound from ) { return using ( new sorted map submap test map generator < k , v > ( delegate , to , from ) ) ; }


apply a umask to this permission and return a new one the umask is used by create , mkdir , and other hadoop filesystem operations the mode argument for these operations is modified by removing the bits which are set in the umask thus , the umask limits the permissions which newly created files and directories get

public fs permission apply u mask ( fs permission umask ) { return new fs permission ( useraction and ( umask useraction not ( ) ) , groupaction and ( umask groupaction not ( ) ) , otheraction and ( umask otheraction not ( ) ) ) ; }


extends the bounding box with the bounds of this node this is a potential slow operation , it is advised to cache the result

public bounding box extend bounding box ( final bounding box out , boolean transform ) { final int part count = parts size ; for ( int i = 0 ; i < part count ; i + + ) { final node part part = parts get ( i ) ; if ( part enabled ) { final mesh part mesh part = part mesh part ; if ( transform ) mesh part mesh extend bounding box ( out , mesh part offset , mesh part size , global transform ) ; else mesh part mesh extend bounding box ( out , mesh part offset , mesh part size ) ; } } final int child count = children size ; for ( int i = 0 ; i < child count ; i + + ) children get ( i ) extend bounding box ( out ) ; return out ; }


a hook for subclasses to customize the message channel for inbound messages from web socket clients

protected void configure client inbound channel ( channel registration registration ) { }


exposed to get rid of hardcoding of the url that serves up update - center json in java script

public string get url ( ) { return url ; }


initialize a collection of file system layouts that will be used as the test matrix

private collection < test matrix entry > create test matrix ( ) { collection < test matrix entry > matrix = new array list < test matrix entry > ( ) ; / / single empty unprotected dir matrix add ( test matrix entry get ( ) add unprotected dir ( " / 1 " , true ) ) ; / / single empty protected dir matrix add ( test matrix entry get ( ) add protected dir ( " / 1 " , true ) ) ; / / nested unprotected dirs matrix add ( test matrix entry get ( ) add unprotected dir ( " / 1 " , true ) add unprotected dir ( " / 1 / 2 " , true ) add unprotected dir ( " / 1 / 2 / 3 " , true ) add unprotected dir ( " / 1 / 2 / 3 / 4 " , true ) ) ; / / non - empty protected dir matrix add ( test matrix entry get ( ) add protected dir ( " / 1 " , false ) add unprotected dir ( " / 1 / 2 " , true ) ) ; / / protected empty child of unprotected parent matrix add ( test matrix entry get ( ) add protected dir ( " / 1 / 2 " , true ) add unprotected dir ( " / 1 / 2 " , true ) ) ; / / protected empty child of protected parent / / we should not be able to delete the parent matrix add ( test matrix entry get ( ) add protected dir ( " / 1 " , false ) add protected dir ( " / 1 / 2 " , true ) ) ; / / one of each , non - nested matrix add ( test matrix entry get ( ) add protected dir ( " / 1 " , true ) add unprotected dir ( " / a " , true ) ) ; / / protected non - empty child of unprotected parent / / neither should be deletable matrix add ( test matrix entry get ( ) add protected dir ( " / 1 / 2 " , false ) add unprotected dir ( " / 1 / 2 / 3 " , true ) add unprotected dir ( " / 1 " , false ) ) ; / / protected non - empty child has unprotected siblings matrix add ( test matrix entry get ( ) add protected dir ( " / 1 / 2 2 " , false ) add unprotected dir ( " / 1 / 2 2 / 3 " , true ) add unprotected dir ( " / 1 / 2 1 " , true ) add unprotected dir ( " / 1 / 2 3 " , true ) add unprotected dir ( " / 1 " , false ) ) ; / / deeply nested protected child matrix add ( test matrix entry get ( ) add protected dir ( " / 1 / 2 / 3 / 4 / 5 " , false ) add unprotected dir ( " / 1 / 2 / 3 / 4 / 5 / 6 " , true ) add unprotected dir ( " / 1 " , false ) add unprotected dir ( " / 1 / 2 " , false ) add unprotected dir ( " / 1 / 2 / 3 " , false ) add unprotected dir ( " / 1 / 2 / 3 / 4 " , false ) ) ; / / disjoint trees matrix add ( test matrix entry get ( ) add protected dir ( " / 1 / 2 " , false ) add protected dir ( " / a / b " , false ) add unprotected dir ( " / 1 / 2 / 3 " , true ) add unprotected dir ( " / a / b / c " , true ) ) ; / / the following tests exercise special cases in the path prefix / / checks and handling of trailing separators / / a disjoint non - empty protected dir has the same string prefix as the / / directory we are trying to delete matrix add ( test matrix entry get ( ) add protected dir ( " / a 1 " , false ) add unprotected dir ( " / a 1 / a 2 " , true ) add unprotected dir ( " / a " , true ) ) ; / / the directory we are trying to delete has a non - empty protected / / child and we try to delete it with a trailing separator matrix add ( test matrix entry get ( ) add protected dir ( " / a / b " , false ) add unprotected dir ( " / a / b / c " , true ) add unprotected dir ( " / a / " , false ) ) ; / / the directory we are trying to delete has an empty protected / / child and we try to delete it with a trailing separator matrix add ( test matrix entry get ( ) add protected dir ( " / a / b " , true ) add unprotected dir ( " / a / " , true ) ) ; return matrix ; }


expands the query to another entity type by using a join the given source join ' s property is used to match the given destination property of the given destination entity note that destination entity of the given join is used as the source for the new join to add in this way , it is possible to compose complex " join of joins " across several entities if required

public < j > join < t , j > join ( join < ? , t > source join , property source property , class < j > destination entity class , property destination property ) { abstract dao < j , ? > destination dao = ( abstract dao < j , ? > ) dao get session ( ) get dao ( destination entity class ) ; return add join ( source join table prefix , source property , destination dao , destination property ) ; }


protected model and view get approval model and view ( final map < string , object > model ) { return new model and view ( get approval view name ( ) , model ) ; }


returns the index to the start of the resource table , relative to the beginning of the ne windows header

short get resource table offset ( ) { return ne rsrctab ; }


generate patched dex file ( may wrapped it by a jar if needed )

private static void patch dex file ( zip file base apk , zip file patch pkg , zip entry old dex entry , zip entry patch file entry , share dex diff patch info patch info , file patched dex file ) throws i o exception { input stream old dex stream = null ; input stream patch file stream = null ; try { old dex stream = new buffered input stream ( base apk get input stream ( old dex entry ) ) ; patch file stream = ( patch file entry ! = null ? new buffered input stream ( patch pkg get input stream ( patch file entry ) ) : null ) ; final boolean is raw dex file = share patch file util is raw dex file ( patch info raw name ) ; if ( ! is raw dex file | | patch info is jar mode ) { zip output stream zos = null ; try { zos = new zip output stream ( new buffered output stream ( new file output stream ( patched dex file ) ) ) ; zos put next entry ( new zip entry ( share constants dex in jar ) ) ; / / old dex is not a raw dex file if ( ! is raw dex file ) { zip input stream zis = null ; try { zis = new zip input stream ( old dex stream ) ; zip entry entry ; while ( ( entry = zis get next entry ( ) ) ! = null ) { if ( share constants dex in jar equals ( entry get name ( ) ) ) break ; } if ( entry = = null ) { throw new tinker runtime exception ( " can ' t recognize zip dex format file : " + patched dex file get absolute path ( ) ) ; } new dex patch applier ( zis , patch file stream ) execute and save to ( zos ) ; } finally { i o helper close quietly ( zis ) ; } } else { new dex patch applier ( old dex stream , patch file stream ) execute and save to ( zos ) ; } zos close entry ( ) ; } finally { i o helper close quietly ( zos ) ; } } else { new dex patch applier ( old dex stream , patch file stream ) execute and save to ( patched dex file ) ; } } finally { i o helper close quietly ( old dex stream ) ; i o helper close quietly ( patch file stream ) ; } }


string formatting method that knows how to format dates ( using the default locale ' s date formatter )

public static string to string ( object o ) { / / to replace the date format with java time format date time formatter if ( o instanceof offset date time ) { offset date time odt = ( offset date time ) o ; return parsing utilities date to string ( ( offset date time ) odt ) ; } else if ( o = = null ) { return " " ; } else if ( o instanceof object [ ] ) { return arrays deep to string ( ( object [ ] ) o ) ; } else { return o to string ( ) ; } }


encode cases where " hu - " is pronounced as part of a vowel dipthong

boolean encode initial hu hw ( ) { / / spanish spellings and chinese pinyin transliteration if ( string at ( 0 , 3 , " hua " , " hue " , " hwa " , " " ) ) { if ( ! string at ( m current , 4 , " huey " , " " ) ) { metaph add ( " a " ) ; if ( ! m encode vowels ) { m current + = 3 ; } else { m current + + ; / / don ' t encode vowels twice while ( is vowel ( m current ) | | ( char at ( m current ) = = ' w ' ) ) { m current + + ; } } return true ; } } return false ; }


adds a set of functions to the target list

public void add targets ( set < function > functions ) { targets add all ( functions ) ; }


sets the { @ link load control } that will be used by the player

public builder set load control ( load control load control ) { assertions check state ( ! build called ) ; this load control = load control ; return this ; }


extract a common name for the target database in use even if various driversplatforms provide varying names at runtime

public static string common database name ( @ nullable string source ) { string name = source ; if ( source ! = null & & source starts with ( " db2 " ) ) { name = " db2 " ; } else if ( " maria d b " equals ( source ) ) { name = " my s q l " ; } else if ( " sybase sql server " equals ( source ) | | " adaptive server enterprise " equals ( source ) | | " ase " equals ( source ) | | " sql server " equals ignore case ( source ) ) { name = " sybase " ; } return name ; }


returns the code unit format established for the code browser listing or a default format if no tool ( e g , headless ) this format object may be used to format any code unit ( instructiondata ) using the same option settings

public code unit format get code unit format ( ) { plugin tool tool = state get tool ( ) ; if ( cu format = = null ) { if ( tool ! = null ) { cu format = new browser code unit format ( state get tool ( ) ) ; } else { cu format = new code unit format ( show block name never , show namespace non local ) ; } } return cu format ; }


creates an answer from a functional interface - allows for a strongly typed answer to be created ideally in java 8

public static < a > answer < void > answer void ( void answer 1 < a > answer ) { return to answer ( answer ) ; }


set whether to use a blocking cache that lets read attempts block until the requested element is created if you intend to build a self - populating blocking cache , consider specifying a { @ link # set cache entry factory cache entry factory }

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


public void put ( string path , route route , response transformer transformer ) { add route ( http method put , response transformer route impl create ( path , route , transformer ) ) ; }


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


gets unused stubbings per location this method is less accurate than { @ link # get unused stubbings ( iterable ) } it considers that stubbings with the same location ( e g class file + line number ) are the same this is not completely accurate because a stubbing declared in a setup or constructor is created per each test method because those are different test methods , different mocks are created , different ' invocation ' instance is backing the ' stubbing ' instance in certain scenarios ( detecting unused stubbings by j unit runner ) , we need this exact level of accuracy stubbing declared in constructor but realized in % of test methods is considered as ' used ' stubbing there are high level unit tests that demonstrate this scenario

public collection < invocation > get unused stubbings by location ( iterable < object > mocks ) { set < stubbing > stubbings = all invocations finder find stubbings ( mocks ) ; / / 1st pass , collect all the locations of the stubbings that were used / / note that those are not locations where the stubbings was used set < string > locations of used stubbings = new hash set < string > ( ) ; for ( stubbing s : stubbings ) { if ( ! unused stubbing reporting should be reported ( s ) ) { string location = s get invocation ( ) get location ( ) to string ( ) ; locations of used stubbings add ( location ) ; } } / / 2nd pass , collect unused stubbings by location / / if the location matches we assume the stubbing was used in at least one test method / / also , using map to deduplicate reported unused stubbings / / if unused stubbing appear in the setup method / constructor we don ' t want to report it / / per each test case map < string , invocation > out = new linked hash map < string , invocation > ( ) ; for ( stubbing s : stubbings ) { string location = s get invocation ( ) get location ( ) to string ( ) ; if ( ! locations of used stubbings contains ( location ) ) { out put ( location , s get invocation ( ) ) ; } } return out values ( ) ; }


override the thread context class loader with the environment ' s bean class loader if necessary , i e if the bean class loader is not equivalent to the thread context class loader already

protected class loader override thread context class loader ( ) { return class utils override thread context class loader ( get bean class loader ( ) ) ; }


gets whether this instance ' s type is category 1 this is just a convenient shorthand for { @ code get type ( ) is category 1 ( ) }

public boolean is category 1 ( ) { return type get type ( ) is category 1 ( ) ; }


force the given block in the given file to be marked as complete , regardless of whether enough replicas are present this is necessary when tailing edit logs as a standby

public void force complete block ( final block info block ) throws i o exception { list < replica under construction > stale replicas = block commit block ( block ) ; remove stale replicas ( stale replicas , block ) ; complete block ( block , null , true ) ; }


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

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


checks if the given array contains any elements

public static boolean is empty ( object [ ] array ) { return array = = null | | array length = = 0 ; }


create a file status for object we just uploaded for files , we use current time as modification time , since s 3a uses s3 ' s service - based modification time , which will not be available until we do a get file status ( ) later on

public static s 3 a file status create upload file status ( path key path , boolean is dir , long size , long block size , string owner , string e tag , string version id ) { date date = is dir ? null : new date ( ) ; return create file status ( key path , is dir , size , date , block size , owner , e tag , version id ) ; }


returns the profile name with the same file name as fdo profile and an extension that matches { @ link file type }

private static string get l l v m profile file name ( fdo input file fdo profile , file type type ) { if ( type matches ( fdo profile ) ) { return fdo profile get basename ( ) ; } else { return file system utils remove extension ( fdo profile get basename ( ) ) + type get extensions ( ) get ( 0 ) ; } }


run recoverysynchronization for a specific segment postconditions : this segment will be finalized on a majority of nodes all nodes which contain the finalized segment will agree on the length

private void recover unclosed segment ( long segment tx id ) throws i o exception { preconditions check argument ( segment tx id > 0 ) ; log info ( " beginning recovery of unclosed segment starting at txid " + segment tx id ) ; / / step 1 prepare recovery quorum call < async logger , prepare recovery response proto > prepare = loggers prepare recovery ( segment tx id ) ; map < async logger , prepare recovery response proto > prepare responses = loggers wait for write quorum ( prepare , prepare recovery timeout ms , " prepare recovery ( " + segment tx id + " ) " ) ; log info ( " recovery prepare phase complete responses : \ n " + quorum call map to string ( prepare responses ) ) ; / / determine the logger who either : / / a ) has already accepted a previous proposal that ' s higher than any / / other / / / / or , if no such logger exists : / / / / b ) has the longest log starting at this transaction id / / todo : we should collect any " ties " and pass the url for all of them / / when syncing , so we can tolerate failure during recovery better entry < async logger , prepare recovery response proto > best entry = collections max ( prepare responses entry set ( ) , segment recovery comparator instance ) ; async logger best logger = best entry get key ( ) ; prepare recovery response proto best response = best entry get value ( ) ; / / log the above decision , check invariants if ( best response has accepted in epoch ( ) ) { log info ( " using already - accepted recovery for segment " + " starting at txid " + segment tx id + " : " + best entry ) ; } else if ( best response has segment state ( ) ) { log info ( " using longest log : " + best entry ) ; } else { / / none of the responses to prepare recovery ( ) had a segment at the given / / txid this can happen for example in the following situation : / / - 3 j ns : jn1 , jn2 , jn3 / / - writer starts segment 101 on jn1 , then crashes before / / writing to jn2 and jn3 / / - during new epoch ( ) , we saw the segment on jn1 and decide to / / recover segment 101 / / - before prepare ( ) , jn1 crashes , and we only talk to jn2 and jn3 , / / neither of which has any entry for this log / / in this case , it is allowed to do nothing for recovery , since the / / segment wasn ' t started on a quorum of nodes / / sanity check : we should only get here if none of the responses had / / a log this should be a postcondition of the recovery comparator , / / but a bug in the comparator might cause us to get here for ( prepare recovery response proto resp : prepare responses values ( ) ) { assert ! resp has segment state ( ) : " one of the loggers had a response , but no best logger " + " was found " ; } log info ( " none of the responders had a log to recover : " + quorum call map to string ( prepare responses ) ) ; return ; } segment state proto log to sync = best response get segment state ( ) ; assert segment tx id = = log to sync get start tx id ( ) ; / / sanity check : none of the loggers should be aware of a higher / / txid than the txid we intend to truncate to for ( map entry < async logger , prepare recovery response proto > e : prepare responses entry set ( ) ) { async logger logger = e get key ( ) ; prepare recovery response proto resp = e get value ( ) ; if ( resp has last committed tx id ( ) & & resp get last committed tx id ( ) > log to sync get end tx id ( ) ) { throw new assertion error ( " decided to synchronize log to " + log to sync + " but logger " + logger + " had seen txid " + resp get last committed tx id ( ) + " committed " ) ; } } url sync from url = best logger build u r l to fetch logs ( segment tx id ) ; quorum call < async logger , void > accept = loggers accept recovery ( log to sync , sync from url ) ; loggers wait for write quorum ( accept , accept recovery timeout ms , " accept recovery ( " + text format short debug string ( log to sync ) + " ) " ) ; / / if one of the loggers above missed the synchronization step above , but / / we send a finalize ( ) here , that ' s ok it validates the log before / / finalizing hence , even if it is not " in sync " , it won ' t incorrectly / / finalize quorum call < async logger , void > finalize = loggers finalize log segment ( log to sync get start tx id ( ) , log to sync get end tx id ( ) ) ; loggers wait for write quorum ( finalize , finalize segment timeout ms , string format ( " finalize log segment ( % s - % s ) " , log to sync get start tx id ( ) , log to sync get end tx id ( ) ) ) ; }


indicates whether the given character is in the { @ code sub - delims } set


public world get world ( ) { return world ; }


returns tables for the given schema name

list < presto thrift schema table name > list tables ( @ thrift field ( name = " schema name or null " ) presto thrift nullable schema name schema name or null ) throws presto thrift service exception , t exception ;


returns the next token in the string as a { @ code string } the delimiters used are changed to the specified delimiters

public string next token ( string delims ) { this delimiters = delims ; return next token ( ) ; }


test for https : activiti atlassian netbrowse a c t - 4035

public void test exclusive jobs ( ) { if ( process engine configuration get history level ( ) is at least ( history level audit ) ) { / / the process has two script tasks in parallel , both exclusive / / they should be executed with at least 6 seconds in between ( as they both sleep for 6 seconds ) runtime service start process instance by key ( " test exclusive jobs " ) ; wait for job executor to process all jobs ( 20000l , 500l ) ; historic activity instance script task a instance = history service create historic activity instance query ( ) activity id ( " script task a " ) single result ( ) ; historic activity instance script task b instance = history service create historic activity instance query ( ) activity id ( " script task b " ) single result ( ) ; long end time a = script task a instance get end time ( ) get time ( ) ; long end time b = script task b instance get end time ( ) get time ( ) ; long end time difference = 0 ; if ( end time b > end time a ) { end time difference = end time b - end time a ; } else { end time difference = end time a - end time b ; } assert that ( end time difference > 6000 ) is true ( ) ; / / > 6000 - > jobs were executed in parallel } }


public void put diagnostic info ( string msg ) { diagnostic info = msg ; }


the offset of the transform from the world origin ( which at the time of writing is the ( 0 , 0 ) at the upper left - hand corner of the gui this is for the view transformer , which also potentially has a scale applied to the transform

public point get view translate coordinates ( ) { return view translate coordinates ; }


assert a cookie ' s domain with a hamcrest { @ link matcher }

public result matcher domain ( string name , matcher < ? super string > matcher ) { return result - > { cookie cookie = get cookie ( result , name ) ; assert that ( " response cookie ' " + name + " ' domain " , cookie get domain ( ) , matcher ) ; } ; }


adds new futures to be combined new futures may be added until an aggregate promise is added via the { @ link promise combiner # finish ( promise ) } method

public void add all ( future futures ) { for ( future future : futures ) { this add ( future ) ; } }


specifies the delegate maps going in each direction called by the constructor and by subclasses during deserialization

void set delegates ( map < k , v > forward , map < v , k > backward ) { check state ( delegate = = null ) ; check state ( inverse = = null ) ; check argument ( forward is empty ( ) ) ; check argument ( backward is empty ( ) ) ; check argument ( forward ! = backward ) ; delegate = forward ; inverse = make inverse ( backward ) ; }


creates a bitmap from encoded bytes supports jpeg but callers should use { @ link # decode j p e g from encoded image } for partial j p e gs in addition , a region to decode can be supplied in order to minimize memory usage note : not all platform decoders necessarily support supplying specific regions

closeable reference < bitmap > decode from encoded image with color space ( final encoded image encoded image , bitmap config bitmap config , @ nullable rect region to decode , @ nullable final color space color space ) ;


get the { @ link schema type } associated with the given class

public static type schema type ( class < ? > klass ) { synchronized ( java class schema types ) { type schema type = java class schema types get ( klass ) ; if ( schema type ! = null ) return schema type ; / / since the lookup only checks the class , we need to also try for ( map entry < class < ? > , type > entry : java class schema types entry set ( ) ) { try { klass as subclass ( entry get key ( ) ) ; / / cache this for subsequent lookups java class schema types put ( klass , entry get value ( ) ) ; return entry get value ( ) ; } catch ( class cast exception e ) { / / expected , ignore } } } return null ; }


generates x content without the startend object

public void to x content fragment ( x content builder builder ) throws i o exception { builder field ( user fields username get preferred name ( ) , user principal ( ) ) ; builder array ( user fields roles get preferred name ( ) , user roles ( ) ) ; builder field ( user fields full name get preferred name ( ) , user full name ( ) ) ; builder field ( user fields email get preferred name ( ) , user email ( ) ) ; builder field ( user fields metadata get preferred name ( ) , user metadata ( ) ) ; builder field ( user fields enabled get preferred name ( ) , user enabled ( ) ) ; builder start object ( user fields authentication realm get preferred name ( ) ) ; builder field ( user fields realm name get preferred name ( ) , get authenticated by ( ) get name ( ) ) ; builder field ( user fields realm type get preferred name ( ) , get authenticated by ( ) get type ( ) ) ; builder end object ( ) ; builder start object ( user fields lookup realm get preferred name ( ) ) ; if ( get looked up by ( ) ! = null ) { builder field ( user fields realm name get preferred name ( ) , get looked up by ( ) get name ( ) ) ; builder field ( user fields realm type get preferred name ( ) , get looked up by ( ) get type ( ) ) ; } else { builder field ( user fields realm name get preferred name ( ) , get authenticated by ( ) get name ( ) ) ; builder field ( user fields realm type get preferred name ( ) , get authenticated by ( ) get type ( ) ) ; } builder end object ( ) ; builder field ( user fields authentication type get preferred name ( ) , get authentication type ( ) name ( ) to lower case ( locale root ) ) ; }


set buffer that can be read via the input stream interface and reset the input stream this has the same effect as creating a new byte array input stream with a new buffer

public void set buffer ( byte [ ] buf ) { this buf = buf ; this pos = 0 ; this count = buf length ; }


gets all the key - value pairs that belong to the windows within in the given time range

key value iterator < windowed < k > , v > fetch all ( instant time from , instant time to ) throws illegal argument exception ;


if type is a " ? extends x " wildcard , returns x ; otherwise returns type unchanged

public static type remove subtype wildcard ( type type ) { if ( ! ( type instanceof wildcard type ) ) return type ; type [ ] lower bounds = ( ( wildcard type ) type ) get lower bounds ( ) ; if ( lower bounds length ! = 0 ) return type ; type [ ] upper bounds = ( ( wildcard type ) type ) get upper bounds ( ) ; if ( upper bounds length ! = 1 ) throw new illegal argument exception ( ) ; return upper bounds [ 0 ] ; }


adds a listener to this future if the future has not yet completed , the listener will be notified of a response or exception in a runnable submitted to the executor service provided if the future has completed , the listener will be notified immediately without forking to a different thread it will apply the provided thread context ( if not null ) when executing the listening

public void add listener ( action listener < v > listener , executor service executor , thread context thread context ) { if ( done ) { / / run the callback directly , we don ' t hold the lock and don ' t need to fork ! notify listener ( listener , es executors new direct executor service ( ) ) ; } else { final boolean run ; / / check done under lock since it could have been modified and protect modifications / / to the list under lock synchronized ( this ) { if ( done ) { run = true ; } else { final action listener < v > wrapped listener ; if ( thread context = = null ) { wrapped listener = listener ; } else { wrapped listener = context preserving action listener wrap preserving context ( listener , thread context ) ; } listeners add ( new tuple < > ( wrapped listener , executor ) ) ; run = false ; } } if ( run ) { / / run the callback directly , we don ' t hold the lock and don ' t need to fork ! notify listener ( listener , es executors new direct executor service ( ) ) ; } } }


public void test normalize ( ) { / / requested resources value cannot be an arbitrary number resource ask = resource new instance ( 1111 , 2 ) ; resource min = resource new instance ( 1024 , 1 ) ; resource max = resource new instance ( 8 * 1024 , 8 ) ; resource increment = resource new instance ( 1024 , 4 ) ; if ( resource calculator instanceof default resource calculator ) { resource result = resources normalize ( resource calculator , ask , min , max , increment ) ; assert equals ( 2 * 1024 , result get memory size ( ) ) ; } else if ( resource calculator instanceof dominant resource calculator ) { resource result = resources normalize ( resource calculator , ask , min , max , increment ) ; assert equals ( 2 * 1024 , result get memory size ( ) ) ; assert equals ( 4 , result get virtual cores ( ) ) ; } / / if resources asked are less than minimum resource , then normalize it to / / minimum resource ask = resource new instance ( 512 , 0 ) ; min = resource new instance ( 2 * 1024 , 2 ) ; max = resource new instance ( 8 * 1024 , 8 ) ; increment = resource new instance ( 1024 , 1 ) ; if ( resource calculator instanceof default resource calculator ) { resource result = resources normalize ( resource calculator , ask , min , max , increment ) ; assert equals ( 2 * 1024 , result get memory size ( ) ) ; } else if ( resource calculator instanceof dominant resource calculator ) { resource result = resources normalize ( resource calculator , ask , min , max , increment ) ; assert equals ( 2 * 1024 , result get memory size ( ) ) ; assert equals ( 2 , result get virtual cores ( ) ) ; } / / if resources asked are larger than maximum resource , then normalize it to / / maximum resources ask = resource new instance ( 9 * 1024 , 9 ) ; min = resource new instance ( 2 * 1024 , 2 ) ; max = resource new instance ( 8 * 1024 , 8 ) ; increment = resource new instance ( 1024 , 1 ) ; if ( resource calculator instanceof default resource calculator ) { resource result = resources normalize ( resource calculator , ask , min , max , increment ) ; assert equals ( 8 * 1024 , result get memory size ( ) ) ; } else if ( resource calculator instanceof dominant resource calculator ) { resource result = resources normalize ( resource calculator , ask , min , max , increment ) ; assert equals ( 8 * 1024 , result get memory size ( ) ) ; assert equals ( 8 , result get virtual cores ( ) ) ; } / / if increment is 0 , use minimum resource as the increment resource ask = resource new instance ( 1111 , 2 ) ; min = resource new instance ( 2 * 1024 , 2 ) ; max = resource new instance ( 8 * 1024 , 8 ) ; increment = resource new instance ( 0 , 0 ) ; if ( resource calculator instanceof default resource calculator ) { resource result = resources normalize ( resource calculator , ask , min , max , increment ) ; assert equals ( 2 * 1024 , result get memory size ( ) ) ; } else if ( resource calculator instanceof dominant resource calculator ) { resource result = resources normalize ( resource calculator , ask , min , max , increment ) ; assert equals ( 2 * 1024 , result get memory size ( ) ) ; assert equals ( 2 , result get virtual cores ( ) ) ; } }


performs the initial phases 0 - 2 of the build : setup , loading and analysis postcondition : on success , populates the build request ' s set of targets to build

private static analysis result run analysis phase ( command environment env , build request request , target pattern phase value loading result , build options target options , set < string > multi cpu ) throws interrupted exception , invalid configuration exception , view creation failed exception { stopwatch timer = stopwatch create started ( ) ; env get reporter ( ) handle ( event progress ( " loading complete analyzing " ) ) ; immutable set < string > explicit target patterns = get explicit target patterns ( env , request get targets ( ) ) ; build view view = new build view ( env get directories ( ) , env get runtime ( ) get rule class provider ( ) , env get skyframe executor ( ) , env get runtime ( ) get coverage report action factory ( request ) ) ; analysis result analysis result = view update ( loading result , target options , multi cpu , explicit target patterns , request get aspects ( ) , request get view options ( ) , request get keep going ( ) , request get loading phase thread count ( ) , request get top level artifact context ( ) , env get reporter ( ) , env get event bus ( ) ) ; pair < integer , integer > tcal = view get targets configured and loaded ( ) ; / / todo ( bazel - team ) : merge these into one event env get event bus ( ) post ( new analysis phase complete event ( analysis result get targets to build ( ) , / * targets loaded * / tcal second int value ( ) , / * targets configured * / tcal first int value ( ) , timer stop ( ) elapsed ( time unit milliseconds ) , view get and clear pkg manager statistics ( ) , view get actions constructed ( ) , env get skyframe executor ( ) was analysis cache discarded and reset bit ( ) ) ) ; immutable set < build configuration value key > configuration keys = stream concat ( analysis result get targets to build ( ) stream ( ) map ( configured target : : get configuration key ) distinct ( ) , analysis result get targets to test ( ) = = null ? stream empty ( ) : analysis result get targets to test ( ) stream ( ) map ( configured target : : get configuration key ) distinct ( ) ) filter ( objects : : non null ) distinct ( ) collect ( immutable set to immutable set ( ) ) ; map < build configuration value key , build configuration > configuration map = env get skyframe executor ( ) get configurations ( env get reporter ( ) , configuration keys ) ; env get event bus ( ) post ( new test filtering complete event ( analysis result get targets to build ( ) , analysis result get targets to test ( ) , analysis result get targets to skip ( ) , configuration map ) ) ; return analysis result ; }


gets the information about the queue item for the given project

private list < item > live get items ( task t ) { lock lock ( ) ; try { list < item > result = new array list < > ( ) ; result add all ( blocked projects get all ( t ) ) ; result add all ( buildables get all ( t ) ) ; / / do not include pendings — we have already finalized work unit context actions if ( logger is loggable ( level fine ) ) { list < buildable item > the pendings = pendings get all ( t ) ; if ( ! the pendings is empty ( ) ) { logger log ( level fine , " ignoring { 0 } during schedule internal " , the pendings ) ; } } for ( item item : waiting list ) { if ( item task equals ( t ) ) { result add ( item ) ; } } return result ; } finally { lock unlock ( ) ; } }


sets new values to all fields of the tuple


public boolean delete ( final string path ) throws exception { if ( exists ( path ) ) { curator delete ( ) deleting children if needed ( ) for path ( path ) ; return true ; } return false ; }


public final void aux cst arg ( constant cst ) { if ( cst = = null ) { throw new null pointer exception ( " cst = = null " ) ; } aux cst = cst ; }


returns the edges in this graph whose endpoints include { @ code node } this is equal to the union of incoming and outgoing edges

set < endpoint pair < n > > incident edges ( n node ) ;


this test checks that watches for pending requests do not get triggered , but watches set by previous requests do

public void test watch auto reset with pending ( ) throws exception { my watcher [ ] watches = new my watcher [ count ] ; my stat callback [ ] cbs = new my stat callback [ count ] ; my watcher watcher = new my watcher ( ) ; int [ ] count = new int [ 1 ] ; testable zoo keeper zk = create client ( watcher , host port , 6000 ) ; zoo keeper zk 2 = create client ( watcher , host port , 5000 ) ; zk 2 create ( " / test " , new byte [ 0 ] , ids open acl unsafe , create mode ephemeral ) ; for ( int i = 0 ; i < count / 2 ; i + + ) { watches [ i ] = new my watcher ( ) ; cbs [ i ] = new my stat callback ( ) ; zk exists ( " / test " , watches [ i ] , cbs [ i ] , count ) ; } zk exists ( " / test " , false ) ; assert true ( zk pause cnxn ( 3000 ) , " failed to pause the connection ! " ) ; zk 2 close ( ) ; stop server ( ) ; watches [ 0 ] wait for disconnected ( 60000 ) ; for ( int i = count / 2 ; i < count ; i + + ) { watches [ i ] = new my watcher ( ) ; cbs [ i ] = new my stat callback ( ) ; zk exists ( " / test " , watches [ i ] , cbs [ i ] , count ) ; } start server ( ) ; watches [ count / 2 - 1 ] wait for connected ( 60000 ) ; assert equals ( null , zk exists ( " / test " , false ) ) ; wait for all watchers ( ) ; for ( int i = 0 ; i < count / 2 ; i + + ) { assert equals ( 1 , watches [ i ] events size ( ) , " for " + i ) ; } for ( int i = count / 2 ; i < count ; i + + ) { if ( cbs [ i ] rc = = keeper exception code ok int value ( ) ) { assert equals ( 1 , watches [ i ] events size ( ) , " for " + i ) ; } else { assert equals ( 0 , watches [ i ] events size ( ) , " for " + i ) ; } } assert equals ( count , count [ 0 ] ) ; zk close ( ) ; }


set the property name with the given value for this code unit

public void set property ( string name , int value ) { throw new unsupported operation exception ( ) ; }


public int iterator iterator ( ) { return new int iterator ( ) { private int idx = bits find first ( bits , 0 ) ; / * * @ inherit doc * / public boolean has next ( ) { return idx > = 0 ; }


test that program diff correctly ignores addresses

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


called after successful { @ link spawn } execution , which may or may not store the result in the cache a cache may silently return from a failed store operation we recommend to err on the side of raising an exception rather than returning silently , and to offer command - line flags to tweak this default policy as needed if the current thread is interrupted , then this method should return as quickly as possible with an { @ link interrupted exception }

void store ( spawn result result ) throws exec exception , interrupted exception , i o exception ;


mark the slot as inactiveallocated a slot can only be marked as inactiveallocated if it ' s in state allocated or active

public boolean mark inactive ( ) { if ( task slot state active = = state | | task slot state allocated = = state ) { state = task slot state allocated ; return true ; } else { return false ; } }


determines the read - only nature of a connected resource

public abstract boolean is read only ( ) throws not connected exception ;


returns the mask for all instructions as a binary string

public string get mask string ( ) { return get all masks ( ) get mask as binary string ( ) ; }


public static hosts file entries parse ( reader reader ) throws i o exception { check not null ( reader , " reader " ) ; buffered reader buff = new buffered reader ( reader ) ; try { map < string , inet 4 address > ipv 4 entries = new hash map < string , inet 4 address > ( ) ; map < string , inet 6 address > ipv 6 entries = new hash map < string , inet 6 address > ( ) ; string line ; while ( ( line = buff read line ( ) ) ! = null ) { / / remove comment int comment position = line index of ( ' # ' ) ; if ( comment position ! = - 1 ) { line = line substring ( 0 , comment position ) ; } / / skip empty lines line = line trim ( ) ; if ( line is empty ( ) ) { continue ; } / / split list < string > line parts = new array list < string > ( ) ; for ( string s : whitespaces split ( line ) ) { if ( ! s is empty ( ) ) { line parts add ( s ) ; } } / / a valid line should be [ ip , hostname , alias * ] if ( line parts size ( ) < 2 ) { / / skip invalid line continue ; } byte [ ] ip bytes = net util create byte array from ip address string ( line parts get ( 0 ) ) ; if ( ip bytes = = null ) { / / skip invalid ip continue ; } / / loop over hostname and aliases for ( int i = 1 ; i < line parts size ( ) ; i + + ) { string hostname = line parts get ( i ) ; string hostname lower = hostname to lower case ( locale english ) ; inet address address = inet address get by address ( hostname , ip bytes ) ; if ( address instanceof inet 4 address ) { inet 4 address previous = ipv 4 entries put ( hostname lower , ( inet 4 address ) address ) ; if ( previous ! = null ) { / / restore , we want to keep the first entry ipv 4 entries put ( hostname lower , previous ) ; } } else { inet 6 address previous = ipv 6 entries put ( hostname lower , ( inet 6 address ) address ) ; if ( previous ! = null ) { / / restore , we want to keep the first entry ipv 6 entries put ( hostname lower , previous ) ; } } } } return ipv 4 entries is empty ( ) & & ipv 6 entries is empty ( ) ? hosts file entries empty : new hosts file entries ( ipv 4 entries , ipv 6 entries ) ; } finally { try { buff close ( ) ; } catch ( i o exception e ) { logger warn ( " failed to close a reader " , e ) ; } } }


returns whether some other stack frame is " equivalent to " this one the stack frame is considered equal to another even if they are each part of a different function

public boolean equals ( object obj ) { check is valid ( ) ; if ( obj = = null ) { return false ; } if ( obj = = this ) { return true ; } if ( get class ( ) ! = obj get class ( ) ) { return false ; } function stack frame other frame = ( function stack frame ) obj ; if ( ( this get local size ( ) ! = other frame get local size ( ) ) | | ( this get parameter offset ( ) ! = other frame get parameter offset ( ) ) | | ( this get return address offset ( ) ! = other frame get return address offset ( ) ) | | ( this variables length ! = other frame variables length ) ) { return false ; } for ( int i = 0 ; i < variables length ; i + + ) { if ( ! variables [ i ] equals ( other frame variables [ i ] ) ) { return false ; } } return true ; }


< code > optional int 3 2 blah = 1 ; < code >

public int get blah ( ) { return blah ; }


protected int get relative x ( native event e , canvas element target ) { float x scale ratio = target get width ( ) * 1f / target get client width ( ) ; / / correct for canvas css scaling return math round ( x scale ratio * ( e get client x ( ) - target get absolute left ( ) + target get scroll left ( ) + target get owner document ( ) get scroll left ( ) ) ) ; }


performs deployment for the provided resources , using the provided name as a hint and the provided { @ link repository service } to perform deployment ( s )

void deploy resources ( final string deployment name hint , final resource [ ] resources , final repository service repository service ) ;


this method is deprecated and will be removed in the future releases handle async db operation in your own logic instead

public < t > find executor < t > max async ( final string table name , final string column name , final class < t > column type ) { final find executor < t > executor = new find executor < > ( ) ; runnable runnable = new runnable ( ) { @ override public void run ( ) { synchronized ( lite pal support class ) { final t t = max ( table name , column name , column type ) ; if ( executor get listener ( ) ! = null ) { operator get handler ( ) post ( new runnable ( ) { @ override public void run ( ) { executor get listener ( ) on finish ( t ) ; } } ) ; } } } } ; executor submit ( runnable ) ; return executor ; }


finalizes the snapshot in the repository

private void end snapshot ( snapshots in progress entry entry , metadata metadata , @ nullable repository data repository data ) { if ( entry is clone ( ) & & entry state ( ) = = state failed ) { logger debug ( " removing failed snapshot clone [ { } ] from cluster state " , entry ) ; remove failed snapshot from cluster state ( entry snapshot ( ) , new snapshot exception ( entry snapshot ( ) , entry failure ( ) ) , null ) ; return ; } final boolean new finalization = ending snapshots add ( entry snapshot ( ) ) ; final string repo name = entry repository ( ) ; if ( try enter repo loop ( repo name ) ) { if ( repository data = = null ) { repositories service repository ( repo name ) get repository data ( new action listener < > ( ) { @ override public void on response ( repository data repository data ) { finalize snapshot entry ( entry , metadata , repository data ) ; } @ override public void on failure ( exception e ) { cluster service submit state update task ( " fail repo tasks for [ " + repo name + " ] " , new fail pending repo tasks task ( repo name , e ) ) ; } } ) ; } else { finalize snapshot entry ( entry , metadata , repository data ) ; } } else { if ( new finalization ) { repository operations add finalization ( entry , metadata ) ; } } }


get total sum for provided event in { @ code interval in sec }

public long get sum ( metric event event ) { data current window ( ) ; long sum = 0 ; list < metric bucket > buckets = data values ( ) ; for ( metric bucket bucket : buckets ) { sum + = bucket get ( event ) ; } return sum ; }


enter a parse tree produced by { @ link eql base parser # query }

void enter query ( eql base parser query context ctx ) ;


gets a byte at the specified absolute { @ code index } in this buffer this method does not modify { @ code reader index } or { @ code writer index } of this buffer

public abstract byte get byte ( int index ) ;


public integer get integer ( ) { return integer ; }


returns true if the heap contains the specified node

public boolean contains ( t node , boolean identity ) { if ( node = = null ) throw new illegal argument exception ( " node cannot be null " ) ; if ( identity ) { for ( node n : nodes ) if ( n = = node ) return true ; } else { for ( node other : nodes ) if ( other equals ( node ) ) return true ; } return false ; }


sets the matrix to a rotation matrix representing the quaternion

public matrix 4 set ( float quaternion x , float quaternion y , float quaternion z , float quaternion w ) { return set ( 0f , 0f , 0f , quaternion x , quaternion y , quaternion z , quaternion w ) ; }


build a { @ link type descriptor } object for the wrapped parameterfield

public type descriptor get type descriptor ( ) { type descriptor type descriptor = this type descriptor ; if ( type descriptor = = null ) { type descriptor = ( this field ! = null ? new type descriptor ( get resolvable type ( ) , get dependency type ( ) , get annotations ( ) ) : new type descriptor ( obtain method parameter ( ) ) ) ; this type descriptor = type descriptor ; } return type descriptor ; }


ensure exception if we publish to multicast ipv 6 address

public void test publish multicast v 6 ( ) throws exception { network service service = new network service ( collections empty list ( ) ) ; try { service resolve publish host addresses ( new string [ ] { " ff08 : : 108 " } ) ; fail ( " should have hit exception " ) ; } catch ( illegal argument exception e ) { assert true ( e get message ( ) contains ( " invalid : multicast " ) ) ; } }


add a { @ link runnable } which will be executed on shutdown of this instance

public void add shutdown hook ( final runnable task ) { if ( in event loop ( ) ) { shutdown hooks add ( task ) ; } else { execute ( new runnable ( ) { @ override public void run ( ) { shutdown hooks add ( task ) ; } } ) ; } }


update last update and last update monotonic with some offset

public static void reset last updates with offset ( datanode info dn , long offset ) { dn set last update ( time now ( ) + offset ) ; dn set last update monotonic ( time monotonic now ( ) + offset ) ; }


optional - type declaration this is a string which is used by the templates to instantiate your types there is typically special handling for different property types

public string get type declaration ( schema p ) { if ( model utils is array schema ( p ) ) { array schema ap = ( array schema ) p ; schema inner = ap get items ( ) ; return get schema type ( p ) + " [ " + get type declaration ( inner ) + " ] " ; } else if ( model utils is map schema ( p ) ) { schema inner = get additional properties ( p ) ; return get schema type ( p ) + " [ string , " + get type declaration ( inner ) + " ] " ; } return super get type declaration ( p ) ; }


return id of user which created this agent

public string get user id ( ) { return user id ; }


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

public static fields find by name ( string name ) { return by name get ( name ) ; }


gets the total number of missing blocks on the cluster with replication factor 1

public long get number of missing blocks with replication factor one ( ) { return this number of missing blocks with replication factor one ; }


allocate a { @ link byte buf } which will be used for constructing a datagram packet sub - classes may override this method to return a { @ link byte buf } with a perfect matching initial capacity

protected byte buf allocate buffer ( channel handler context ctx , @ suppress warnings ( " unused " ) addressed envelope < dns response , inet socket address > msg ) throws exception { return ctx alloc ( ) io buffer ( 1024 ) ; }


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


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

t visit parameters ( painless parser parameters context ctx ) ;


returns the flags or ' ed together , indicating the attributes of this section many of these flags can be set with the linker ' s section option common values include those listed in figure 7

public int get characteristics ( ) { return characteristics ; }


specify method overrides for the bean , if any

public void set method overrides ( method overrides method overrides ) { this method overrides = method overrides ; }


resolve a collection of { @ link com google devtools build lib actions action input } s to { @ link path } s

static collection < path > resolve action inputs ( path exec root , collection < ? extends action input > action inputs ) { return action inputs stream ( ) map ( ( inp ) - > exec root get relative ( inp get exec path ( ) ) ) collect ( immutable list to immutable list ( ) ) ; }


waits for the machine learning templates to be created by { @ link org elasticsearch plugins metadata upgrader }

public void wait for templates ( ) throws exception { try { x pack rest test helper wait for templates ( client ( ) , x pack rest test constants ml post v660 templates ) ; } catch ( assertion error e ) { throw new assertion error ( " failure in test setup : failed to initialize ml index templates " , e ) ; } }


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


combines blocks proven identical into one alpha block , re - writing all of the successor links that point to the beta blocks to point to the alpha block instead

private void combine blocks ( int alpha label , int list beta labels ) { int sz betas = beta labels size ( ) ; for ( int i = 0 ; i < sz betas ; i + + ) { int beta label = beta labels get ( i ) ; basic block bb = blocks label to block ( beta label ) ; int list preds = rop method label to predecessors ( bb get label ( ) ) ; int sz preds = preds size ( ) ; for ( int j = 0 ; j < sz preds ; j + + ) { basic block pred block = new blocks label to block ( preds get ( j ) ) ; replace succ ( pred block , beta label , alpha label ) ; } } }


public void add static field ( encoded field field , constant value ) { class data add static field ( field , value ) ; }


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


test that the relative path label parsing behaves as stated in the target - syntax documentation

public void test relative path label ( ) throws exception { scratch file ( " sub / build " , " exports files ( [ ' dir 2 / dir 2 ' ] ) " ) ; scratch file ( " sub / dir / build " , " exports files ( [ ' dir 2 ' ] ) " ) ; scratch file ( " sub / dir / dir / build " , " exports files ( [ ' dir ' ] ) " ) ; / / sub / dir / dir is a package assert that ( parse individual target ( " sub / dir / dir " ) to string ( ) ) is equal to ( " / / sub / dir / dir : dir " ) ; / / sub / dir is a package but not sub / dir / dir 2 assert that ( parse individual target ( " sub / dir / dir 2 " ) to string ( ) ) is equal to ( " / / sub / dir : dir 2 " ) ; / / sub is a package but not sub / dir 2 assert that ( parse individual target ( " sub / dir 2 / dir 2 " ) to string ( ) ) is equal to ( " / / sub : dir 2 / dir 2 " ) ; }


initialization code that can sometimes take a long time

private void ensure initialized ( ) { if ( ! m initialized ) { lock lock ( ) ; try { if ( ! m initialized ) { m internal path = environment get data directory ( ) ; / / whitelisted use of external storage android changes in target sdk 29 and above as it / / only used for getting the available space m external path = environment get external storage directory ( ) ; update stats ( ) ; m initialized = true ; } } finally { lock unlock ( ) ; } } }


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

public void delete order ( @ path param ( " order id " ) string order id ) ;


sets the cursor shape that appropriate for the given location if the location is near a boundary , then the cursor will change to a resize shape , otherwise it will be the default cursor

private void set cursor ( int x , int y ) { int row = y / row height ; cur row = - 1 ; cur col = - 1 ; state = cursor state nowhere ; if ( row < model get num rows ( ) ) { cur row = row ; int start x = 0 ; field factory [ ] fields = model get factorys ( row ) ; for ( int col = 0 ; col < fields length ; col + + ) { int width = fields [ col ] get width ( ) ; if ( x < start x + width ) { state = cursor state over field ; cur col = col ; if ( ( col > 0 ) & & ( x < start x + fudge ) ) { state = cursor state near edge ; edge col = col - 1 ; } else if ( x > start x + width - fudge ) { state = cursor state near edge ; edge col = col ; } break ; } start x + = width ; } } switch ( state ) { case over field : set cursor ( default cursor ) ; break ; case near edge : set cursor ( resize cursor ) ; break ; default : set cursor ( default cursor ) ; break ; } }


returns a random source in a given x content type containing a random number of fields , objects and array , with maximum depth 5 the minimum number of fields per object is provided as an argument

public static bytes reference random source ( random random , x content type x content type , int min num fields ) { try ( x content builder builder = x content factory content builder ( x content type ) ) { builder start object ( ) ; add fields ( random , builder , min num fields , 0 ) ; builder end object ( ) ; return bytes reference bytes ( builder ) ; } catch ( i o exception e ) { throw new runtime exception ( e ) ; } }


increment the count of mount operations ( by one )

public static long increment component mount count ( ) { return s component mount count add and get ( 1 ) ; }


reduces the size of the array to the specified size if the array is already smaller than the specified size , no action is taken

public void truncate ( int new size ) { if ( new size < 0 ) throw new illegal argument exception ( " new size must be > = 0 : " + new size ) ; if ( size < = new size ) return ; for ( int i = new size ; i < size ; i + + ) items [ i ] = null ; size = new size ; }


return { @ code true } if the completion was successful

public final boolean is success ( ) { return cause = = null ; }


returns the largest index for which { @ link # get } returns { @ code target } , or { @ code - 1 } if no such index exists equivalent to { @ code as list ( ) last index of ( target ) }

public int last index of ( int target ) { for ( int i = end - 1 ; i > = start ; i - - ) { if ( array [ i ] = = target ) { return i - start ; } } return - 1 ; }


balance the entries contained within two adjacent child interior nodes one of the two nodes must be half - full or less this could result in the removal of a child node if entries will fit within one node

private fixed key node balance child ( fixed key interior node left node , fixed key interior node right node ) throws i o exception { field right key = right node get key field ( 0 ) ; int left key count = left node key count ; int right key count = right node key count ; int new left key count = left key count + right key count ; / / can right keys fit within left node if ( new left key count < = max key count ) { / / right node is elliminated and all entries stored in left node move keys left ( left node , right node , right key count ) ; node mgr delete node ( right node ) ; return delete child ( right key ) ; } new left key count = new left key count / 2 ; if ( new left key count < left key count ) { move keys right ( left node , right node , left key count - new left key count ) ; } else if ( new left key count > left key count ) { move keys left ( left node , right node , new left key count - left key count ) ; } this key changed ( right key , right node get key ( 0 ) ) ; return get root ( ) ; }


returns a new path fragment formed by appending { @ code new name } to the parent directory null is returned iff this method is called on a path fragment with zero segments if { @ code new name } designates an absolute path , the value of { @ code this } will be ignored and a path fragment corresponding to { @ code new name } will be returned this behavior is consistent with the behavior of { @ link # get relative ( string ) }

public path fragment replace name ( string new name ) { path fragment parent = get parent directory ( ) ; return parent ! = null ? parent get relative ( new name ) : null ; }


move any pending nodes into out of service node blocks to initiate the decommission or maintenance mode process this method must be executed under the namenode write lock to prevent the pending nodes list from being modified externally

private void process pending nodes ( ) { while ( ! pending nodes is empty ( ) & & ( max concurrent tracked nodes = = 0 | | out of service node blocks size ( ) < max concurrent tracked nodes ) ) { out of service node blocks put ( pending nodes poll ( ) , null ) ; } }


public void save ( file file ) throws i o exception { print stream out = new print stream ( file , " utf - 8 " ) ; out println ( " font name = " + font name ) ; out println ( " font size = " + font size ) ; out println ( " font bold = " + bold ) ; out println ( " font italic = " + italic ) ; out println ( " font gamma = " + gamma ) ; out println ( " font mono = " + mono ) ; out println ( ) ; out println ( " font 2 file = " + font 2 file ) ; out println ( " font 2 use = " + font 2 active ) ; out println ( ) ; out println ( " pad top = " + padding top ) ; out println ( " pad right = " + padding right ) ; out println ( " pad bottom = " + padding bottom ) ; out println ( " pad left = " + padding left ) ; out println ( " pad advance x = " + padding advance x ) ; out println ( " pad advance y = " + padding advance y ) ; out println ( ) ; out println ( " glyph native rendering = " + native rendering ) ; out println ( " glyph page width = " + glyph page width ) ; out println ( " glyph page height = " + glyph page height ) ; out println ( " glyph text = " + glyph text ) ; out println ( ) ; out println ( render type + " = " + render type ) ; out println ( ) ; for ( iterator iter = effects iterator ( ) ; iter has next ( ) ; ) { configurable effect effect = ( configurable effect ) iter next ( ) ; out println ( " effect class = " + effect get class ( ) get name ( ) ) ; for ( iterator iter 2 = effect get values ( ) iterator ( ) ; iter 2 has next ( ) ; ) { value value = ( value ) iter 2 next ( ) ; out println ( " effect " + value get name ( ) + " = " + value get string ( ) ) ; } out println ( ) ; } out close ( ) ; }


compares the version of this maven installation to the minimum required version specified

public boolean meets maven req version ( launcher launcher , int maven req version ) throws i o exception , interrupted exception { / / fixme using similar stuff as in the maven plugin could be better / / olamy : but will add a dependency on maven in core - > so not so good string maven version = launcher get channel ( ) call ( new get maven version ( get home ( ) ) ) ; if ( ! maven version equals ( " " ) ) { if ( maven req version = = maven 20 ) { if ( maven version starts with ( " 2 " ) ) return true ; } else if ( maven req version = = maven 21 ) { if ( maven version starts with ( " 2 " ) & & ! maven version starts with ( " 2 0 " ) ) return true ; } else if ( maven req version = = maven 30 ) { if ( maven version starts with ( " 3 " ) ) return true ; } } return false ; }


gets the charset used by this schema for serialization

public charset get charset ( ) { return charset ; }


determines the data application mode for the indicated code

public static dwarf e h data application mode value of ( int code ) { for ( dwarf e h data application mode mod : dwarf e h data application mode values ( ) ) { if ( mod code = = code ) { return mod ; } } return null ; }


gets the first program being compared by the program diff

public program get program one ( ) { return program 1 ; }


creates a zip file from this directory or a file and sends that to the given output stream

public void zip ( output stream os ) throws i o exception , interrupted exception { zip ( os , ( file filter ) null ) ; }


sets the < code > my boolean < code > property

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