recreate a symbol with the function symbol ' s name because deleting the function does not mean that we want to lose the function name ( that is our policy )

private boolean create label for deleted function name ( address entry point , string sym name , string data 3 , namespace namespace , source type source , boolean pinned ) { if ( is external ( ) ) { symbol d b parent = ( symbol d b ) namespace get symbol ( ) ; if ( parent is deleting ( ) ) { return false ; / / don ' t recreate external } } try { symbol d b new sym ; try { new sym = symbol mgr create special symbol ( entry point , sym name , namespace , symbol type label , - 1 , - 1 , data 3 , source ) ; if ( pinned ) { new sym set pinned ( true ) ; } } catch ( invalid input exception e ) { program d b program = symbol mgr get program ( ) ; new sym = ( symbol d b ) symbol mgr create label ( entry point , sym name , program get global namespace ( ) , source ) ; } new sym set symbol data 3 ( data 3 ) ; / / reserved for external location use new sym set primary ( ) ; return true ; } catch ( duplicate name exception e ) { / / this should ' t happen msg error ( this , " unexpected exception : " + e get message ( ) , e ) ; } catch ( invalid input exception e ) { / / this shouldn ' t happen msg error ( this , " unexpected exception : " + e get message ( ) , e ) ; } return false ; }


for each specified string , get the default parameter values whose names contain the string then check whether any of these default values collide this is , for example , useful to make sure there is no collision of default ports across different services

public void test default value collision ( ) { for ( string filter : filters for default value collision check ) { log info ( " checking if any of the default values whose name " + " contains string \ " { } \ " collide " , filter ) ; / / map from filtered default value to name of the corresponding parameter map < string , string > filtered values = new hash map < > ( ) ; int values checked = 0 ; for ( map entry < string , string > ent : configuration default variables entry set ( ) ) { / / apply the name filter to the default parameters if ( ent get key ( ) contains ( filter ) ) { / / check only for numerical values if ( string utils is numeric ( ent get value ( ) ) ) { string crt value = filtered values put if absent ( ent get value ( ) , ent get key ( ) ) ; assert null ( " parameters " + ent get key ( ) + " and " + crt value + " are using the same default value ! " , crt value ) ; } values checked + + ; } } log info ( " checked { } default values for collision " , values checked ) ; } }


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


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

private void validate ( ) throws i o exception { if ( local file system is refresh required ( ) ) { checkouts = null ; } if ( checkouts = = null ) { long old next checkout id = next checkout id ; boolean success = false ; try { read checkouts file ( ) ; success = true ; } finally { if ( ! success ) { next checkout id = old next checkout id ; checkouts = null ; } } } }


tracks number of dimensions for this shape

public abstract int num dimensions ( ) ;


public void test health check result ( ) { / / todo : test health check result }


public insn with new registers ( register spec result , register spec list sources ) { return new switch insn ( get opcode ( ) , get position ( ) , result , sources , cases ) ; }


adds a line to the log with cache statistics

private static void log stats ( string message , cache stats stats ) { logger at info ( ) log ( " % s : hit count = % d , miss count = % d , hit rate = % g , eviction count = % d " , message , stats hit count ( ) , stats miss count ( ) , stats hit rate ( ) , stats eviction count ( ) ) ; }


public void test verify observer state ( ) throws exception { cluster start ( 3 ) ; dummy h a service svc 2 = cluster get service ( 2 ) ; svc 2 state = h a service state observer ; / / verify svc 2 is observer log info ( " waiting for svc 2 to enter observer state " ) ; cluster wait for h a state ( 2 , h a service state observer ) ; }


sets the boost a specific index or alias will receive when the query is executed against it

public search source builder index boost ( string index , float index boost ) { objects require non null ( index , " index must not be null " ) ; this index boosts add ( new index boost ( index , index boost ) ) ; return this ; }


check if there is a resource for the given key bound to the current thread

public static boolean has resource ( object key ) { object actual key = transaction synchronization utils unwrap resource if necessary ( key ) ; object value = do get resource ( actual key ) ; return ( value ! = null ) ; }


returns an immutable multiset containing all the keys in this multimap , in the same order and with the same frequencies as they appear in this multimap ; to get only a single occurrence of each key , use { @ link # key set }

public immutable multiset < k > keys ( ) { return ( immutable multiset < k > ) super keys ( ) ; }


returns true if the field is stored separately

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


returns a newly - created immutable multimap

public immutable multimap < k , v > build ( ) { collection < map entry < k , collection < v > > > map entries = builder map entry set ( ) ; if ( key comparator ! = null ) { map entries = ordering from ( key comparator ) < k > on keys ( ) immutable sorted copy ( map entries ) ; } return immutable list multimap from map entries ( map entries , value comparator ) ; }


test the order we get the containers to kill it should respect the order described in { @ link scheduler node # get containers to kill ( ) }

public void test get running containers to kill ( ) { final scheduler node node = new mock scheduler node ( ) ; assert equals ( collections empty list ( ) , node get containers to kill ( ) ) ; / / am0 r m container am 0 = new mock r m container ( true , execution type guaranteed , " am0 " ) ; node allocate container ( am 0 ) ; assert equals ( arrays as list ( am 0 ) , node get containers to kill ( ) ) ; / / opportunistic0 , am0 r m container opp 0 = new mock r m container ( false , execution type opportunistic , " opportunistic0 " ) ; node allocate container ( opp 0 ) ; assert equals ( arrays as list ( opp 0 , am 0 ) , node get containers to kill ( ) ) ; / / opportunistic0 , guaranteed0 , am0 r m container regular 0 = new mock r m container ( false , execution type guaranteed , " guaranteed0 " ) ; node allocate container ( regular 0 ) ; assert equals ( arrays as list ( opp 0 , regular 0 , am 0 ) , node get containers to kill ( ) ) ; / / opportunistic1 , opportunistic0 , guaranteed0 , am0 r m container opp 1 = new mock r m container ( false , execution type opportunistic , " opportunistic1 " ) ; node allocate container ( opp 1 ) ; assert equals ( arrays as list ( opp 1 , opp 0 , regular 0 , am 0 ) , node get containers to kill ( ) ) ; / / opportunistic1 , opportunistic0 , guaranteed0 , am1 , am0 r m container am 1 = new mock r m container ( true , execution type guaranteed , " am1 " ) ; node allocate container ( am 1 ) ; assert equals ( arrays as list ( opp 1 , opp 0 , regular 0 , am 1 , am 0 ) , node get containers to kill ( ) ) ; / / opportunistic1 , opportunistic0 , guaranteed1 , guaranteed0 , am1 , am0 r m container regular 1 = new mock r m container ( false , execution type guaranteed , " guaranteed1 " ) ; node allocate container ( regular 1 ) ; assert equals ( arrays as list ( opp 1 , opp 0 , regular 1 , regular 0 , am 1 , am 0 ) , node get containers to kill ( ) ) ; }


the maximum possible used { @ code owning bucket ord }

public abstract long max owning bucket ord ( ) ;


a sensible , albeit inefficient , definition of { @ link # size } in terms of { @ link # entry set } if you override { @ link # entry set } , you may wish to override { @ link # size } to forward to this implementation

protected int standard size ( ) { return multisets linear time size impl ( this ) ; }


the source file information of the parent inheritance declaration < code > optional aapt pb source parent source = 2 ; < code >

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


returns a new { @ code path fragment } formed by adding the extension to the last path segment of { @ code path } null is returned if { @ code path } has zero segments

public static path fragment append extension ( path fragment path , string new extension ) { return path replace name ( path get base name ( ) + new extension ) ; }


create a new controller listener wrapper or return null if the listener is null

public static controller listener wrapper create ( @ nullable controller listener < image info > controller listener ) { return controller listener = = null ? null : new controller listener wrapper ( controller listener ) ; }


boolean encode nger ( ) { if ( ( m current > 1 ) & & string at ( ( m current - 1 ) , 4 , " nger " , " " ) ) { / / default ' g ' = > j such as ' ranger ' , ' stranger ' , ' manger ' , ' messenger ' , ' orangery ' , ' granger ' / / ' boulanger ' , ' challenger ' , ' danger ' , ' changer ' , ' harbinger ' , ' lounger ' , ' ginger ' , ' passenger ' / / except for these the following if ( ! ( root or inflections ( m in word , " anger " ) | | root or inflections ( m in word , " linger " ) | | root or inflections ( m in word , " malinger " ) | | root or inflections ( m in word , " finger " ) | | ( string at ( ( m current - 3 ) , 4 , " hung " , " fing " , " bung " , " wing " , " ring " , " ding " , " zeng " , " zing " , " jung " , " long " , " ping " , " cong " , " mong " , " bang " , " gang " , " hang " , " lang " , " sang " , " sing " , " wang " , " zang " , " " ) / / exceptions to above where ' g ' = > j & & ! ( string at ( ( m current - 6 ) , 7 , " boulang " , " slesing " , " kissing " , " derring " , " " ) | | string at ( ( m current - 8 ) , 9 , " schlesing " , " " ) | | string at ( ( m current - 5 ) , 6 , " saling " , " belang " , " " ) | | string at ( ( m current - 6 ) , 7 , " barring " , " " ) | | string at ( ( m current - 6 ) , 9 , " phalanger " , " " ) | | string at ( ( m current - 4 ) , 5 , " chang " , " " ) ) ) | | string at ( ( m current - 4 ) , 5 , " sting " , " young " , " " ) | | string at ( ( m current - 5 ) , 6 , " strong " , " " ) | | string at ( 0 , 3 , " ung " , " eng " , " ing " , " " ) | | string at ( m current , 6 , " gerich " , " " ) | | string at ( 0 , 6 , " senger " , " " ) | | string at ( ( m current - 3 ) , 6 , " wenger " , " munger " , " songer " , " kinger " , " " ) | | string at ( ( m current - 4 ) , 7 , " flinger " , " slinger " , " stanger " , " stenger " , " klinger " , " clinger " , " " ) | | string at ( ( m current - 5 ) , 8 , " springer " , " sprenger " , " " ) | | string at ( ( m current - 3 ) , 7 , " lingerf " , " " ) | | string at ( ( m current - 2 ) , 7 , " angerly " , " angerbo " , " ingerso " , " " ) ) ) { metaph add exact approx ( " j " , " g " , " j " , " k " ) ; } else { metaph add exact approx ( " g " , " j " , " k " , " j " ) ; } advance counter ( 2 , 1 ) ; return true ; } return false ; }


public synchronized static language service get language service ( ) { return default language service get language service ( ) ; }


return the configured passcode to use for connections to the stomp broker on behalf of connected clients

public string get client passcode ( ) { return this client passcode ; }


public boolean completed ( ) { return this latch get count ( ) = = 0l ; }


this method will throw an { @ link unsupported operation exception }

public string read line ( ) { throw new unsupported operation exception ( " read line is not supported " ) ; }


public void test process execution ( ) throws exception { assume true ( " test requires security manager " , system get security manager ( ) ! = null ) ; try { runtime get runtime ( ) exec ( " ls " ) ; fail ( " didn ' t get expected exception " ) ; } catch ( security exception expected ) { } }


return the configured { @ link zk client a c l mode }

public static zk client a c l mode from config ( configuration config ) { string acl mode = config get string ( high availability options zookeeper client acl ) ; if ( acl mode = = null | | acl mode equals ignore case ( zk client a c l mode open name ( ) ) ) { return zk client a c l mode open ; } else if ( acl mode equals ignore case ( zk client a c l mode creator name ( ) ) ) { return zk client a c l mode creator ; } else { string message = " unsupported acl option : [ " + acl mode + " ] provided " ; log error ( message ) ; throw new illegal configuration exception ( message ) ; } }


asserts that a unicode escaper escapes the given hilo surrogate pair into the expected string

public static void assert unicode escaping ( unicode escaper escaper , string expected , char hi , char lo ) { int cp = character to code point ( hi , lo ) ; string escaped = compute replacement ( escaper , cp ) ; assert assert not null ( escaped ) ; assert assert equals ( expected , escaped ) ; }


reads some bytes from an input stream and stores them into the buffer array { @ code b } this method blocks until { @ code len } bytes of input data have been read into the array , or end of file is detected the number of bytes read is returned , possibly zero does not close the stream a caller can detect eof if the number of bytes read is less than { @ code len } all subsequent calls on the same stream will return zero if { @ code b } is null , a { @ code null pointer exception } is thrown if { @ code off } is negative , or { @ code len } is negative , or { @ code off + len } is greater than the length of the array { @ code b } , then an { @ code index out of bounds exception } is thrown if { @ code len } is zero , then no bytes are read otherwise , the first byte read is stored into element { @ code b [ off ] } , the next one into { @ code b [ off + 1 ] } , and so on the number of bytes read is , at most , equal to { @ code len }

public static int read ( input stream in , byte [ ] b , int off , int len ) throws i o exception { check not null ( in ) ; check not null ( b ) ; if ( len < 0 ) { throw new index out of bounds exception ( string format ( " len ( % s ) cannot be negative " , len ) ) ; } check position indexes ( off , off + len , b length ) ; int total = 0 ; while ( total < len ) { int result = in read ( b , off + total , len - total ) ; if ( result = = - 1 ) { break ; } total + = result ; } return total ; }


returns the size in bytes of the " initialized " part of the contents

public int get unpacked length ( ) { return unpacked length ; }


register m beans for hikari config and hikari pool

void handle m beans ( final hikari pool hikari pool , final boolean register ) { if ( ! config is register mbeans ( ) ) { return ; } try { final m bean server m bean server = management factory get platform m bean server ( ) ; object name bean config name , bean pool name ; if ( " true " equals ( system get property ( " hikaricp jmx register 2 0 " ) ) ) { bean config name = new object name ( " com zaxxer hikari : type = pool config , name = " + pool name ) ; bean pool name = new object name ( " com zaxxer hikari : type = pool , name = " + pool name ) ; } else { bean config name = new object name ( " com zaxxer hikari : type = pool config ( " + pool name + " ) " ) ; bean pool name = new object name ( " com zaxxer hikari : type = pool ( " + pool name + " ) " ) ; } if ( register ) { if ( ! m bean server is registered ( bean config name ) ) { m bean server register m bean ( config , bean config name ) ; m bean server register m bean ( hikari pool , bean pool name ) ; } else { logger error ( " { } - jmx name ( { } ) is already registered " , pool name , pool name ) ; } } else if ( m bean server is registered ( bean config name ) ) { m bean server unregister m bean ( bean config name ) ; m bean server unregister m bean ( bean pool name ) ; } } catch ( exception e ) { logger warn ( " { } - failed to { } management beans " , pool name , ( register ? " register " : " unregister " ) , e ) ; } }


creates a crosstool release proto for the android ndk , given the api level to use and the release revision the crosstools are generated through code rather than checked in as a flat file to reduce the amount of templating needed ( for parameters like the release name and certain paths ) , to reduce duplication , and to make it easier to support future versions of the ndk todo ( bazel - team ) : eventually we should move this into starlark so the crosstools can be updated independently of bazel itself

static crosstool release create ( ndk paths ndk paths , stl impl stl impl , string host platform , string clang version ) { return crosstool release new builder ( ) set major version ( " android " ) set minor version ( " " ) set default target cpu ( " armeabi " ) add all toolchain ( create toolchains ( ndk paths , stl impl , host platform , clang version ) ) build ( ) ; }


checks to see if the given class is an extension point of interest

public static boolean is class of interest ( class < ? > c ) { if ( modifier is abstract ( c get modifiers ( ) ) ) { return false ; } if ( c get enclosing class ( ) ! = null & & ! modifier is static ( c get modifiers ( ) ) ) { return false ; } if ( ! modifier is public ( c get modifiers ( ) ) ) { return false ; } if ( extension point properties util is excluded ( c ) ) { return false ; } for ( class < ? > filter classe : filter classes ) { if ( filter classe is assignable from ( c ) ) { return true ; } } return false ; }


public void remove last ( ) { data list remove ( data list size ( ) - 1 ) ; }


reads a big - endian signed integer from the buffer

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


adds element to the priority queue in log ( size ) time if either the priority queue is not full , or not less than ( element , top ( ) )

public boolean offer ( t element ) { if ( size < capacity ) { put ( element ) ; return true ; } else if ( size > 0 & & ! less than ( element , peek ( ) ) ) { heap [ 1 ] = element ; adjust top ( ) ; return true ; } else { return false ; } }


public void place order test ( ) { order order = null ; / / order response = api place order ( order ) ; / / todo : test validations }


assigns timestamps to the elements in the data stream and periodically creates watermarks to signal event time progress this method uses the deprecated watermark generator interfaces please switch to { @ link # assign timestamps and watermarks ( watermark strategy ) } to use the new interfaces instead the new interfaces support watermark idleness and no longer need to differentiate between " periodic " and " punctuated " watermarks

public single output stream operator < t > assign timestamps and watermarks ( assigner with periodic watermarks < t > timestamp and watermark assigner ) { final assigner with periodic watermarks < t > cleaned assigner = clean ( timestamp and watermark assigner ) ; final watermark strategy < t > wms = new assigner with periodic watermarks adapter strategy < > ( cleaned assigner ) ; return assign timestamps and watermarks ( wms ) ; }


get the current position in the input stream

public long get pos ( ) throws i o exception { return ( ( seekable ) in ) get pos ( ) ; }


{ @ inherit doc } the default implementation returns the result of calling { @ link # visit children } on { @ code ctx }

@ override public t visit process check ( eql base parser process check context ctx ) { return visit children ( ctx ) ; }


runs the application using the provided { @ code dispatcher gateway }

list < job i d > run ( final dispatcher gateway dispatcher gateway , final packaged program program , final configuration configuration ) ;


obtain the task to release the next message , if found

public static runnable get next message task ( message < ? > message ) { return ( runnable ) message get headers ( ) get ( ordered message channel decorator next message task header ) ; }


tells if stack ordering couldn ' t be done on the function even though it has gs buffer checks

public boolean could not do stack ordering with gs buffer security checks ( ) { return could not do stack ordering with gs buffer security checks ; }


perform a language fallback , server - side

static object node merge languages ( object node preferred , object node fallback ) { object node results = parsing utilities mapper create object node ( ) ; iterator < entry < string , json node > > iterator = fallback fields ( ) ; while ( iterator has next ( ) ) { entry < string , json node > entry = iterator next ( ) ; string code = entry get key ( ) ; json node value = preferred get ( code ) ; if ( value = = null ) { ; value = entry get value ( ) ; } results set ( code , value ) ; } return results ; }


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


single - sided unbounded streaming from server to client the server repeatedly returns the client payload as - is

public java util iterator < io grpc benchmarks proto messages simple response > streaming from server ( io grpc benchmarks proto messages simple request request ) { return io grpc stub client calls blocking server streaming call ( get channel ( ) , get streaming from server method ( ) , get call options ( ) , request ) ; }


return the storage directory corresponding to the passed uri

public storage directory get storage directory ( uri uri ) { try { uri = util file as u r i ( new file ( uri ) ) ; iterator < storage directory > it = dir iterator ( ) ; while ( it has next ( ) ) { storage directory sd = it next ( ) ; if ( util file as u r i ( sd get root ( ) ) equals ( uri ) ) { return sd ; } } } catch ( i o exception ioe ) { log warn ( " error converting file to uri " , ioe ) ; } return null ; }


get or create a task handle for a given task id the task need not be created when this method is called if the handle is called before the task is created , the task will bind to the handle once it starts ( or restarts )

public task handle task handle ( string task id ) { return task handle ( task id , null ) ; }


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

public void find pets by tags test ( ) { set < string > tags = null ; list < pet > response = api find pets by tags ( tags ) collect list ( ) block ( ) ; / / todo : test validations }


getter for the { @ link # elf original image base property } property

public static long get elf original image base ( program program ) { options props = program get options ( program program info ) ; string oib str = props get string ( elf loader elf original image base property , null ) ; return ( oib str ! = null ) ? numeric utilities parse hex long ( oib str ) : null ; }


return the version of the assignor which indicates how the user metadata encodings and the assignment algorithm gets evolved

default short version ( ) { return ( short ) 0 ; }


where the attribute was defined within the & lt ; declare - styleable & gt ; block < code > optional aapt pb source source = 1 ; < code >

public boolean has source ( ) { return instance has source ( ) ; }


get the byte block range at the given index

public byte block range get range ( int index ) { return list get ( index ) ; }


public collection < nt > non terminals ( ) { return collections unmodifiable collection ( nonterminals values ( ) ) ; }


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

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


namespaces defined on this element < code > repeated aapt pb xml namespace namespace declaration = 1 ; < code >

public java util list < com android aapt resources xml namespace > get namespace declaration list ( ) { return namespace declaration ; }


return the jackson filter provider to use

public filter provider get filters ( ) { return this filters ; }


authenticates the user based on the contents of the token that is provided as parameter this will not look at the values in the thread context for authentication

public void authenticate ( string action , transport request transport request , authentication token token , action listener < authentication > listener ) { new authenticator ( action , transport request , should fallback to anonymous ( true ) , listener ) authenticate token ( token ) ; }


used by { @ code < f : password > } so that we send an encrypted value to the client

public string get password value ( object o ) { if ( o = = null ) { return null ; } / * return plain value if it ' s the default value for password parameter definition this needs to work even when the user doesn ' t have configure permission * / if ( o equals ( password parameter definition default value ) ) { return o to string ( ) ; } / * mask from extended read * / stapler request req = stapler get current request ( ) ; if ( o instanceof secret | | secret blank nonsecret password fields without item configure ) { if ( req ! = null ) { item item = req find ancestor object ( item class ) ; if ( item ! = null & & ! item has permission ( item configure ) ) { return " * * * * * * * * " ; } computer computer = req find ancestor object ( computer class ) ; if ( computer ! = null & & ! computer has permission ( computer configure ) ) { return " * * * * * * * * " ; } } } / * return encrypted value if it ' s a secret * / if ( o instanceof secret ) { return ( ( secret ) o ) get encrypted value ( ) ; } / * log a warning if we ' re in development mode ( core or plugin ) : there ' s an f : password backed by a non - secret * / if ( req ! = null & & ( boolean get boolean ( " hudson hpi run " ) | | boolean get boolean ( " hudson main development " ) ) ) { logger log ( level warning , ( ) - > " < f : password / > form control in " + get jelly views information for current request ( ) + " is not backed by hudson util secret learn more : https : / / jenkins io / redirect / hudson util secret " ) ; } / * return plain value if it ' s not a secret and the escape hatch is set * / if ( ! secret auto encrypt password control ) { return o to string ( ) ; } / * make it a secret and return its encrypted value * / return secret from string ( o to string ( ) ) get encrypted value ( ) ; }


6 : bral 12 - - + ( start 1 w nfctx = 2 @ 12 ) | 10 : nfctx # 3 | ( start 2 ) 12 : cop 3 < - - + ( conflict due to varying context ) 14 : ret test use of non - flow context in disassembly with expected parse error

public void test disassembler inconsistent mid block in program ( ) throws exception { program get program context ( ) set value ( program get register ( " nfctx " ) , addr ( 12 ) , addr ( 12 ) , big integer value of ( 2 ) ) ; program builder add bytes branch ( 6 , 12 ) ; program builder add bytes fallthrough set no flow context ( 10 , 3 ) ; program builder add bytes cop instruction ( 12 ) ; program builder add bytes return ( 14 ) ; address set view dis addrs = disassembler disassemble ( addr ( 6 ) , null ) ; assert equals ( addrset ( range ( 6 , 7 ) , range ( 12 , 15 ) ) , dis addrs ) ; dis addrs = disassembler disassemble ( addr ( 10 ) , null ) ; assert equals ( addrset ( range ( 10 , 11 ) ) , dis addrs ) ; verify instruction presence ( ) ; verify error bookmark ( addr ( 12 ) , " inconsistent instruction prototype " ) ; } / / public void test disassembler multiple conflicts within block ( ) throws exception { / / / / todo : having difficult time coming up with valid test case / / }


adds an item to this history list < code > null < code > values are ignored calls to this method during selection notification will have no effect if you need to update the history during a notification , then you must do so at a later time , perhaps by using { @ link system utilities # run swing later ( runnable ) }

public void add ( t t ) { if ( is broadcasting ) { return ; } if ( ignore item ( t ) ) { return ; } drop null ( ) ; / / once we add a new item , any old history that was after this item needs to be / / removed , as that is old alternate timeline that no longer makes sense trim history to current index ( ) ; handle duplicate ( t ) ; history stack push ( t ) ; / / ' - 1 ' because we want to be at the new item history index = history stack size ( ) - 1 ; }


the id of the type this may be 0 , which indicates no id is set < code > optional uint 3 2 id = 1 ; < code >

public int get id ( ) { return instance get id ( ) ; }


returns a string containing the string representation of each of { @ code parts } , using the previously configured separator between each

public final string join ( object [ ] parts ) { return join ( arrays as list ( parts ) ) ; }


returns an { @ link annotation } object reflecting the annotation provided , or null if this class doesn ' t have such an annotation this is a convenience function if the caller knows already which annotation type he ' s looking for

static public annotation get declared annotation ( class c , class < ? extends java lang annotation annotation > annotation type ) { java lang annotation annotation [ ] annotations = c get declared annotations ( ) ; for ( java lang annotation annotation annotation : annotations ) { if ( annotation annotation type ( ) equals ( annotation type ) ) return new annotation ( annotation ) ; } return null ; }


public list < string > get groups ( string user ) { return collections empty list ( ) ; }


creates a { @ link variable with value } from a { @ link starlark info }

static variable with value variable with value from starlark ( starlark info variable with value struct ) throws eval exception { check right provider type ( variable with value struct , " variable with value " ) ; string name = get mandatory field from starlark provider ( variable with value struct , " name " , string class ) ; string value = get mandatory field from starlark provider ( variable with value struct , " value " , string class ) ; if ( name = = null | | name is empty ( ) ) { throw info error ( variable with value struct , " ' name ' parameter of variable with value must be a nonempty string " ) ; } if ( value = = null | | value is empty ( ) ) { throw info error ( variable with value struct , " ' value ' parameter of variable with value must be a nonempty string " ) ; } return new variable with value ( name , value ) ; }


validate the given response as contained in the { @ link http u r l connection } object , throwing an exception if it does not correspond to a successful http response default implementation rejects any http status code beyond 2xx , to avoid parsing the response body and trying to deserialize from a corrupted stream

protected void validate response ( http invoker client configuration config , http u r l connection con ) throws i o exception { if ( con get response code ( ) > = 300 ) { throw new i o exception ( " did not receive successful http response : status code = " + con get response code ( ) + " , status message = [ " + con get response message ( ) + " ] " ) ; } }


get the elf symbol which corresponds to the specified index each relocation table corresponds to a specific symbol table to which the specified symbol index will be applied

public final elf symbol get symbol ( int symbol index ) { return symbols [ symbol index ] ; }


check if this symbol consumes an operand index of its constructor

public boolean takes operand index ( ) { return true ; }


sends the opening request to the server : get chat http1 1 host : server example com upgrade : websocket connection : upgrade sec - web socket - key : d ghl i h nhb x bs z s bub 2 5j z q = = sec - web socket - origin : http : example com sec - web socket - protocol : chat , superchat sec - web socket - version : 8

protected full http request new handshake request ( ) { uri ws u r l = uri ( ) ; / / get 16 bit nonce and base 64 encode it byte [ ] nonce = web socket util random bytes ( 16 ) ; string key = web socket util base 6 4 ( nonce ) ; string accept seed = key + magic guid ; byte [ ] sha 1 = web socket util sha 1 ( accept seed get bytes ( charset util us ascii ) ) ; expected challenge response string = web socket util base 6 4 ( sha 1 ) ; if ( logger is debug enabled ( ) ) { logger debug ( " web socket version 08 client handshake key : { } , expected response : { } " , key , expected challenge response string ) ; } / / format request full http request request = new default full http request ( http version http 1 1 , http method get , upgrade url ( ws u r l ) , unpooled empty buffer ) ; http headers headers = request headers ( ) ; if ( custom headers ! = null ) { headers add ( custom headers ) ; if ( ! headers contains ( http header names host ) ) { / / only add host header if custom headers did not contain it / / / / see https : / / github com / netty / netty / issues / 10101 headers set ( http header names host , websocket host value ( ws u r l ) ) ; } } else { headers set ( http header names host , websocket host value ( ws u r l ) ) ; } headers set ( http header names upgrade , http header values websocket ) set ( http header names connection , http header values upgrade ) set ( http header names sec websocket key , key ) ; if ( ! headers contains ( http header names sec websocket origin ) ) { headers set ( http header names sec websocket origin , websocket origin value ( ws u r l ) ) ; } string expected subprotocol = expected subprotocol ( ) ; if ( expected subprotocol ! = null & & ! expected subprotocol is empty ( ) ) { headers set ( http header names sec websocket protocol , expected subprotocol ) ; } headers set ( http header names sec websocket version , version ( ) to ascii string ( ) ) ; return request ; }


an " java lang illegal argument exception : comparison method violates its general contract ! " is triggered by this test with a previous version of levenshtein comparator it is triggered by a certain condition in tim sort that only happens if 32 or more values are in an array as such , it may not be a thorough test it depends on the specifics of the environment jvm

public void test levenshtein comparator sort ( ) { / / no assertions , just making sure we don ' t violate the compare contract arrays sort ( new string [ ] { " y " , " w " , " y " , " e " , " s " , " u " , " h " , " o " , " d " , " t " , " d " , " f " , " z " , " j " , " c " , " k " , " f " , " z " , " o " , " e " , " r " , " t " , " v " , " d " , " l " , " r " , " w " , " u " , " v " , " a " , " m " , " o " } , c ) ; }


public void set ( vector 2 v 1 , vector 2 v 2 ) { set ( v 1 x , v 1 y , v 2 x , v 2 y ) ; }


ensures we don ' t release with forced values which is intended for local development only

public void no values are forced ( ) { assert true ( feature flags forced values is empty ( ) ) ; }


public map < string , list < object > > get map array anytype ( ) { return map array anytype ; }


set default views associated with any view name and selected based on the best match for the requested content type use { @ link http message writer view http message writer view } to adapt and use any existing { @ code http message writer } ( e g json , xml ) as a { @ code view }

public void default views ( view default views ) { this default views add all ( arrays as list ( default views ) ) ; }


compute the safe length given the internal block lengths

public static long get safe length ( erasure coding policy ec policy , long [ ] block lens ) { final int cell size = ec policy get cell size ( ) ; final int data blk num = ec policy get num data units ( ) ; preconditions check argument ( block lens length > = data blk num ) ; final int stripe size = data blk num * cell size ; long [ ] cpy = arrays copy of ( block lens , block lens length ) ; arrays sort ( cpy ) ; / / full stripe is a stripe has at least data blk num full cells / / last full stripe idx is the index of the last full stripe int last full stripe idx = ( int ) ( cpy [ cpy length - data blk num ] / cell size ) ; return last full stripe idx * stripe size ; / / return the safe length / / todo : include last full stripe idx + 1 stripe in safe length , if there exists / / such a stripe ( and it must be partial ) }


this is a fast , native implementation of an iterative box blur the algorithm runs in - place on the provided bitmap and therefore has a very small memory footprint the iterative box blur has the nice property that it approximates the gaussian blur very quickly usually iterations = 3 is sufficient such that the casual observer cannot tell the difference the edge pixels are repeated such that the bitmap still has a well - defined border asymptotic runtime : o ( width height iterations ) asymptotic memory : o ( radius + max ( width , height ) )

public static void iterative box blur ( bitmap bitmap , int iterations , int blur radius ) { preconditions check not null ( bitmap ) ; preconditions check argument ( iterations > 0 ) ; preconditions check argument ( blur radius > 0 ) ; native iterative box blur ( bitmap , iterations , blur radius ) ; }


gets a model name suffix for generated models this name will be appended to a model name this option is often used to circumvent compilation issues where models match keywords example : suffix < code > gen < code > applied to < code > object < code > results in a generated class named < code > object gen < code >

public string get model name suffix ( ) { return model name suffix ; }


notify the strategy about the task failure cause


public string insn comment string ( dalv insn insn , boolean note indices ) { / / this format has no comment return " " ; }


test the undo section of rename before the rename , we create the renamed filedir after taking the snapshot

public void test rename undo 2 ( ) throws exception { final path sdir 1 = new path ( " / dir 1 " ) ; final path sdir 2 = new path ( " / dir 2 " ) ; hdfs mkdirs ( sdir 1 ) ; hdfs mkdirs ( sdir 2 ) ; final path dir 2file = new path ( sdir 2 , " file " ) ; d f s test util create file ( hdfs , dir 2file , blocksize , repl , seed ) ; snapshot test helper create snapshot ( hdfs , sdir 1 , " s 1 " ) ; / / create foo after taking snapshot final path foo = new path ( sdir 1 , " foo " ) ; final path bar = new path ( foo , " bar " ) ; d f s test util create file ( hdfs , bar , blocksize , repl , seed ) ; i node directory dir 2 = fsdir get i node 4 write ( sdir 2 to string ( ) ) as directory ( ) ; i node directory mock dir 2 = spy ( dir 2 ) ; do return ( false ) when ( mock dir 2 ) add child ( any ( ) , any boolean ( ) , any int ( ) ) ; i node directory root = fsdir get i node 4 write ( " / " ) as directory ( ) ; root replace child ( dir 2 , mock dir 2 , fsdir get i node map ( ) ) ; final path newfoo = new path ( sdir 2 , " foo " ) ; boolean result = hdfs rename ( foo , newfoo ) ; assert false ( result ) ; / / check the current internal details i node directory dir 1 node = fsdir get i node 4 write ( sdir 1 to string ( ) ) as directory ( ) ; snapshot s 1 = dir 1 node get snapshot ( d f s util string 2 bytes ( " s 1 " ) ) ; read only list < i node > dir 1 children = dir 1 node get children list ( snapshot current state id ) ; assert equals ( 1 , dir 1 children size ( ) ) ; assert equals ( foo get name ( ) , dir 1 children get ( 0 ) get local name ( ) ) ; diff list < directory diff > dir 1 diffs = dir 1 node get diffs ( ) as list ( ) ; assert equals ( 1 , dir 1 diffs size ( ) ) ; assert equals ( s 1 get id ( ) , dir 1 diffs get ( 0 ) get snapshot id ( ) ) ; / / after the undo of rename , the created list of sdir 1 should contain / / 1 element children diff children diff = dir 1 diffs get ( 0 ) get children diff ( ) ; assert sizes ( 1 , 0 , children diff ) ; i node foo node = fsdir get i node 4 write ( foo to string ( ) ) ; assert true ( foo node instanceof i node directory ) ; assert true ( children diff get created unmodifiable ( ) get ( 0 ) = = foo node ) ; final path foo s 1 = snapshot test helper get snapshot path ( sdir 1 , " s 1 " , " foo " ) ; assert false ( hdfs exists ( foo s 1 ) ) ; / / check sdir 2 assert false ( hdfs exists ( newfoo ) ) ; i node directory dir 2 node = fsdir get i node 4 write ( sdir 2 to string ( ) ) as directory ( ) ; assert false ( dir 2 node is with snapshot ( ) ) ; read only list < i node > dir 2 children = dir 2 node get children list ( snapshot current state id ) ; assert equals ( 1 , dir 2 children size ( ) ) ; assert equals ( dir 2file get name ( ) , dir 2 children get ( 0 ) get local name ( ) ) ; }


returns the list of { @ link update center job } representing scheduled installation attempts

public list < update center job > get jobs ( ) { synchronized ( jobs ) { return new array list < > ( jobs ) ; } }


get a jta transaction object for the given current user transaction subclasses can override this to provide a jta transaction object subclass , for example holding some additional jta handle needed

protected jta transaction object do get jta transaction ( user transaction ut ) { return new jta transaction object ( ut ) ; }


positive test to verify that create succeeds when trying to overwrite an existing file when proper write permissions on the file being overwritten are provided

public void test create access with overwrite check positive ( ) throws throwable { path parent dir = new path ( " / " ) ; path test path = new path ( parent dir , " test dat " ) ; authorizer add auth rule for owner ( " / " , write , true ) ; authorizer add auth rule for owner ( test path to string ( ) , write , true ) ; fs update wasb authorizer ( authorizer ) ; try { fs create ( test path ) ; contract test utils assert path exists ( fs , " test path was not created " , test path ) ; fs create ( test path , true ) ; } finally { fs delete ( test path , false ) ; } }


returns the base url to the location where the open a p i document is being served

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


public static byte [ ] copy to bytes ( memory segment [ ] segments , int offset , int num bytes ) { return copy to bytes ( segments , offset , new byte [ num bytes ] , 0 , num bytes ) ; }


public builder set diff threshold ( int value ) { this diff threshold = value ; return this ; }


set a query parameter , adding to existing values if present the implementation will ensure that the name and value are properly encoded

public http request add query parameter ( string name , string value ) { query parameters put ( require non null ( " name " , name ) , require non null ( " value " , value ) ) ; return this ; }


get the address u r ls guranteed to return at least one address

public static list < url > retrieve address u r ls ( endpoint epr ) throws invalid record exception , malformed u r l exception { if ( epr = = null ) { throw new invalid record exception ( " " , " null endpoint " ) ; } list < string > addresses = retrieve addresses uri type ( epr ) ; list < url > results = new array list < url > ( addresses size ( ) ) ; for ( string address : addresses ) { results add ( new url ( address ) ) ; } return results ; }


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


public memory size get network memory ( ) { throw unsupported operation execption if unknown ( ) ; return network memory ; }


registers an instance of { @ link service instance }

void register ( service instance service instance ) throws runtime exception ;


returns and removes application - defined data if any was associated with this stream

< v > v remove property ( http 2 connection property key key ) ;


this test checks whether timers are assigned to correct key groups and whether snapshotrestore respects key groups

public void test snapshot and rebalancing restore ( ) throws exception { test snapshot and rebalancing restore ( internal timer service serialization proxy version ) ; }


return the request data value processor instance to use obtained from the web application context under the name { @ code " request data value processor " } or { @ code null } if no matching bean was found

public request data value processor get request data value processor ( ) { return this request data value processor ; }


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

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


decode an image using the state set up by calling set hints ( ) previously continuous scan clients will get a < b > large < b > speed increase by using this instead of decode ( )

public result decode with state ( binary bitmap image ) throws not found exception { / / make sure to set up the default state so we don ' t crash if ( readers = = null ) { set hints ( null ) ; } return decode internal ( image ) ; }


returns the set of live - out registers valid after register interference graph has been generated , otherwise empty

public int set get live out regs ( ) { if ( live out = = null ) { live out = set factory make liveness set ( parent get reg count ( ) ) ; } return live out ; }


private void create ( ) { set layout ( new border layout ( ) ) ; add ( create image panel ( ) , border layout center ) ; add ( create south panel ( ) , border layout south ) ; set background ( bg color ) ; }


shut down the instance make sure to call this method to release its internal resources


public int get char position in line ( ) { if ( i < tokens size ( ) ) { return tokens get ( i ) get char position in line ( ) ; } else if ( eof token ! = null ) { return eof token get char position in line ( ) ; } else if ( tokens size ( ) > 0 ) { / / have to calculate the result from the line / column of the previous / / token , along with the text of the token token last token = tokens get ( tokens size ( ) - 1 ) ; string token text = last token get text ( ) ; if ( token text ! = null ) { int last new line = token text last index of ( ' \ n ' ) ; if ( last new line > = 0 ) { return token text length ( ) - last new line - 1 ; } } return last token get char position in line ( ) + last token get stop index ( ) - last token get start index ( ) + 1 ; } / / only reach this if tokens is empty , meaning eof occurs at the first / / position in the input return 0 ; }


check whether the given resource transaction managers refers to the given ( underlying ) resource factory

public static boolean same resource factory ( resource transaction manager tm , object resource factory ) { return unwrap resource if necessary ( tm get resource factory ( ) ) equals ( unwrap resource if necessary ( resource factory ) ) ; }


creates a { @ link byte buf } of the given length , filled with random bytes

private static byte buf random bytes ( int length ) { final byte [ ] bytes = new byte [ length ] ; new random ( ) next bytes ( bytes ) ; return unpooled wrapped buffer ( bytes ) ; }


compare this location ' s address with another location ' s given that they are both within the same address space

private int compare address same space ( address based location other location ) { if ( address is external address ( ) | | address is variable address ( ) | | address is register address ( ) ) { / / these address types have meaningless address offsets return string representation compare to ( other location string representation ) ; } / / for most space types use space specific sort of address when space is the same int rc = address compare to ( other location address ) ; if ( rc = = 0 ) { / / for the same memory offset , after normal addresses and memory references / / are shifted references followed by offset references if ( is shifted address ( ) ) { if ( other location is offset address ( ) ) { rc = - 1 ; } else if ( other location is shifted address ( ) ) { rc = string representation compare to ( other location string representation ) ; } else { rc = 1 ; } } else if ( is offset address ( ) ) { if ( ! other location is offset address ( ) ) { rc = 1 ; } } else if ( other location is offset address ( ) | | other location is shifted address ( ) ) { rc = - 1 ; } } return rc ; }


start this connector this method will only be called on a clean connector , i e it has either just been instantiated and initialized or { @ link # stop ( ) } has been invoked

public abstract void start ( map < string , string > props ) ;


configure the path matcher to use to match url paths with against include and exclude patterns this is an advanced property that should be used only when a customized { @ link ant path matcher } or a custom path matcher is required by default this is { @ link ant path matcher } note : setting { @ code path matcher } enforces use of string pattern matching even when a { @ link servlet request path utils # parse and cache parsed } { @ code request path } is available

public interceptor registration path matcher ( path matcher path matcher ) { this path matcher = path matcher ; return this ; }


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

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


returns the { @ link # sum } as a { @ code float } after a widening primitive conversion

public float float value ( ) { return ( float ) sum ( ) ; }


get application container and resource usage information

application resource usage report get application resource usage report ( ) ;


public string get prefix ns string ( ) { return prefix ns string ; }


public object get anytype 3 ( ) { return anytype 3 ; }


public long get int 6 4 ( ) { return int 6 4 ; }


returns an unhealthy { @ link result } with the given error

public static result unhealthy ( throwable error ) { return new result ( false , error get message ( ) , error ) ; }


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

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


return an { @ linkplain enumeration enumeration } of the preferred { @ linkplain locale locales } configured in this mock request if no locales have been explicitly configured , the default , preferred { @ link locale } for the server mocked by this request is { @ link locale # english } in contrast to the servlet specification , this mock implementation does not take into consideration any locales specified via the { @ code accept - language } header

public enumeration < locale > get locales ( ) { return collections enumeration ( this locales ) ; }


equality means interfaces , advisors and target source are equal the compared object may be a jdk dynamic aop proxy instance itself or a dynamic proxy wrapping a jdk dynamic aop proxy instance

public boolean equals ( @ nullable object other ) { if ( other = = this ) { return true ; } if ( other = = null ) { return false ; } jdk dynamic aop proxy other proxy ; if ( other instanceof jdk dynamic aop proxy ) { other proxy = ( jdk dynamic aop proxy ) other ; } else if ( proxy is proxy class ( other get class ( ) ) ) { invocation handler ih = proxy get invocation handler ( other ) ; if ( ! ( ih instanceof jdk dynamic aop proxy ) ) { return false ; } other proxy = ( jdk dynamic aop proxy ) ih ; } else { / / not a valid comparison return false ; } / / if we get here , other proxy is the other aop proxy return aop proxy utils equals in proxy ( this advised , other proxy advised ) ; }


option to control a feature that copies anonymous types into a structure ' s " namespace " category path and giving that anonymous type a new name based on the structure ' s field ' s name

public boolean is copy rename anon types ( ) { return copy rename anon types ; }


consume all the body submitted and parse params into { @ link command request }

protected static void parse params ( string query string , command request request ) { if ( query string = = null | | query string length ( ) < 1 ) { return ; } int offset = 0 , pos = - 1 ; / / check anchor query string = remove anchor ( query string ) ; while ( true ) { offset = pos + 1 ; pos = query string index of ( ' & ' , offset ) ; if ( offset = = pos ) { / / empty continue ; } parse single param ( query string substring ( offset , pos = = - 1 ? query string length ( ) : pos ) , request ) ; if ( pos < 0 ) { / / reach the end break ; } } }


constructs a host - port pair from the given string , defaulting to the indicated port if absent

public static host and port from string ( string host port , int default port ) { if ( host port = = null ) throw new null pointer exception ( " host port = = null " ) ; string host = host port ; int end host index = host port length ( ) ; if ( host port starts with ( " [ " ) ) { / / bracketed i pv 6 end host index = host port last index of ( ' ] ' ) + 1 ; host = host port substring ( 1 , end host index = = 0 ? 1 : end host index - 1 ) ; if ( ! endpoint new builder ( ) parse ip ( host ) ) { / / reuse our i pv 6 validator throw new illegal argument exception ( host port + " contains an invalid i pv 6 literal " ) ; } } else { int colon index = host port index of ( ' : ' ) , next colon index = host port last index of ( ' : ' ) ; if ( colon index > = 0 ) { if ( colon index = = next colon index ) { / / only 1 colon host = host port substring ( 0 , colon index ) ; end host index = colon index ; } else if ( ! endpoint new builder ( ) parse ip ( host port ) ) { / / reuse our i pv 6 validator throw new illegal argument exception ( host port + " is an invalid i pv 6 literal " ) ; } } } if ( host is empty ( ) ) throw new illegal argument exception ( host port + " has an empty host " ) ; if ( end host index + 1 < host port length ( ) & & host port char at ( end host index ) = = ' : ' ) { return new host and port ( host , validate port ( host port substring ( end host index + 1 ) , host port ) ) ; } return new host and port ( host , default port ) ; }


set the connection to be secure , using the specified keystore and truststore this has to be called before any route mapping is done you have to supply a keystore file , truststore file is optional ( keystore will be reused ) this method is only relevant when using embedded jetty servers it should not be used if you are using servlets , where you will need to secure the connection in the servlet container

public static void secure ( string keystore file , string keystore password , string truststore file , string truststore password , boolean needs client cert ) { get instance ( ) secure ( keystore file , keystore password , truststore file , truststore password , needs client cert ) ; }


returns the global checkpoint for the shard

public long get last known global checkpoint ( ) { return replication tracker get global checkpoint ( ) ; }


public start message deployed event impl build ( ) { return new start message deployed event impl ( this ) ; }


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


returns a new resource set with the provided values for memory mb and cpu usage , and with 0 0 for io usage and local test count use this method in action resource definitions when they aren ' t local tests

public static resource set create with ram cpu ( double memory mb , double cpu usage ) { if ( memory mb = = 0 & & cpu usage = = 0 ) { return zero ; } return new resource set ( memory mb , cpu usage , 0 ) ; }


quick validation on the input to check some obvious fail conditions ( fail fast ) check if the provided { @ link delete application home sub cluster request } for deleting an application is valid or not

public static void validate ( delete application home sub cluster request request ) throws federation state store invalid input exception { if ( request = = null ) { string message = " missing delete application home sub cluster request " + " please try again by specifying " + " an application home sub cluster information " ; log warn ( message ) ; throw new federation state store invalid input exception ( message ) ; } / / validate application id check application id ( request get application id ( ) ) ; }


probe for hdfs encryption being enabled ; this uses the value of the option { @ link common configuration keys public # hadoop security key provider path } , returning true if that property contains a non - empty , non - whitespace string

public static boolean is h d f s encryption enabled ( configuration conf ) { return ! ( conf get trimmed ( common configuration keys public hadoop security key provider path , " " ) is empty ( ) ) ; }


sorts the given list of local variables and trims their code blocks when necessary the block is trimmed at the end , which is a bit arbitrary

private void trim local variables ( local variable info [ ] local variable infos , int local variable info count , int max locals ) { / / sort the local variable entries arrays sort ( local variable infos , 0 , local variable info count ) ; int [ ] start p cs = create max array ( max locals ) ; / / trim the local variable entries , starting at the last one for ( int index = local variable info count - 1 ; index > = 0 ; index - - ) { local variable info local variable info = local variable infos [ index ] ; / / make sure the variable ' s code block doesn ' t overlap with the / / next one for the same variable int max length = start p cs [ local variable info u 2index ] - local variable info u 2start p c ; if ( local variable info u 2length > max length ) { local variable info u 2length = max length ; } start p cs [ local variable info u 2index ] = local variable info u 2start p c ; } }


get the value object associated with a key

public object get ( string key ) throws j s o n exception { object o = opt ( key ) ; if ( o = = null ) { throw new j s o n exception ( " j s o n object [ " + quote ( key ) + " ] not found " ) ; } return o ; }


assert that the name node has checkpoints at the expected transaction i ds

public static void assert n n has checkpoints ( mini d f s cluster cluster , list < integer > txids ) { assert n n has checkpoints ( cluster , 0 , txids ) ; }


private void remove descendants from view ( tree path parent path ) { remove from view ( parent path ) ; program node node = ( program node ) parent path get last path component ( ) ; for ( int i = 0 ; i < node get child count ( ) ; i + + ) { program node child = ( program node ) node get child at ( i ) ; if ( child get allows children ( ) ) { remove descendants from view ( child get tree path ( ) ) ; } else { remove from view ( child get tree path ( ) ) ; } } }


compare two configurations to see that they both have the same values the yarn configuration rm ha id property is ignored , as it as expected to change and be tested external to this method

private void assert same conf ( configuration master , yarn configuration copy ) { set < string > seen = new hash set < > ( ) ; iterator < entry < string , string > > itr = master iterator ( ) ; / / always ignore the rm ha id , because we expect it to change seen add ( yarn configuration rm ha id ) ; while ( itr has next ( ) ) { entry < string , string > property = itr next ( ) ; string key = property get key ( ) ; if ( ! seen add ( key ) ) { / / here we use master get ( ) instead of property get value ( ) because / / they ' re not the same thing assert equals ( " new configuration changed the value of " + key , master get ( key ) , copy get ( key ) ) ; } } itr = copy iterator ( ) ; while ( itr has next ( ) ) { entry < string , string > property = itr next ( ) ; string key = property get key ( ) ; if ( ! seen contains ( property get key ( ) ) ) { assert equals ( " new configuration changed the value of " + key , copy get ( key ) , master get ( key ) ) ; } } }


sets the hovering variables ( hover item , hovering column ) as well as hover detail by talking to the cell renderers triggers a redraw if necessary

private boolean handle cell hover ( int x , int y ) { point point = new point ( x , y ) ; final grid column col = get column ( point ) ; final int row = get row ( point ) ; integer detail = ( hovering on column sorter ? 1000000 : 0 ) + ( hovering on column filter ? 1000000 : 0 ) + y ; boolean hover change = false ; if ( hovering item ! = row | | ! common utils equal objects ( hovering detail , detail ) | | hovering column ! = col | | y < = header height ) { hovering item = row ; hovering detail = detail ; hovering column = col ; hover change = true ; } / / check for link boolean over link = false ; if ( col ! = null & & row > = 0 ) { if ( cell renderer is over link ( col , row , x , y ) ) { over link = true ; } } if ( over link ) { if ( ! hovering on link ) { set cursor ( sort cursor ) ; } } else if ( hovering on link ) { set cursor ( null ) ; } hovering on link = over link ; / / do normal cell specific tooltip stuff if ( hover change ) { / / check tooltip string new tip = null ; if ( ( hovering item > = 0 ) & & ( hovering column ! = null ) ) { if ( over link ) { new tip = get content provider ( ) get cell link text ( column elements [ col get index ( ) ] , row elements [ row ] ) ; } if ( common utils is empty ( new tip ) ) { / / get cell specific tooltip new tip = get cell tool tip ( hovering column , hovering item ) ; } } else if ( column headers visible & & hovering column ! = null & & y < = header height ) { / / get column header specific tooltip if ( hovering on column sorter ) { new tip = nls bind ( data editors messages grid tooltip sort by column , get label provider ( ) get text ( hovering column get element ( ) ) ) ; } else if ( hovering on column filter ) { new tip = nls bind ( data editors messages grid tooltip filter by column , get label provider ( ) get text ( hovering column get element ( ) ) ) ; } else { new tip = hovering column get header tooltip ( ) ; } } else if ( row header visible & & hovering item > = 0 & & x < = row header width ) { new tip = get label provider ( ) get tool tip text ( get row element ( hovering item ) ) ; } / / avoid unnecessarily resetting tooltip - this will cause the tooltip to jump around if ( new tip ! = null & & ! new tip equals ( displayed tool tip text ) ) { tool tip handler update tool tip text ( new tip ) ; } else if ( new tip = = null & & displayed tool tip text ! = null ) { tool tip handler update tool tip text ( null ) ; } displayed tool tip text = new tip ; } return hover change ; }


override superclass so as to add statistic collection { @ inherit doc }

public boolean exists ( path f ) throws i o exception { entry point ( invocation exists ) ; return super exists ( f ) ; }


< code > optional org apache dubbo metadata definition protobuf model p b request type c dubbo p b request type = 3 ; < code >


set the scheduled executor service ' s pool size default is 1

public void set pool size ( int pool size ) { assert is true ( pool size > 0 , " ' pool size ' must be 1 or higher " ) ; this pool size = pool size ; }


return the { @ link entry } currently at the top of the { @ link array deque } or { @ code null } if the { @ link array deque } is empty

public entry peek ( ) { return this state peek ( ) ; }


reader has fields with upper case characters , writer has same names downcased

public void test reader lower cases field names from type ( ) throws i o exception { list < string > reader fields = new array list < > ( arrays as list ( " field a " , " field b " , " field c " ) ) ; list < string > writer fields = new array list < > ( arrays as list ( " field a " , " field b " , " field c " ) ) ; list < string > writer data = new array list < > ( arrays as list ( " field a value " , " field b value " , " field c value " ) ) ; type reader type = get type ( reader fields ) ; type writer type = get type ( writer fields ) ; write ( temp file , writer type , writer data ) ; row block read block = read ( temp file , reader type ) ; list actual = ( list ) reader type get object value ( session get sql function properties ( ) , read block , 0 ) ; assert equals ( actual size ( ) , reader fields size ( ) ) ; assert equals ( actual get ( 0 ) , " field a value " ) ; assert equals ( actual get ( 1 ) , " field b value " ) ; assert equals ( actual get ( 2 ) , " field c value " ) ; }


public string get application name ( ) { string app name = get property ( application properties application name property ) ; if ( app name = = null | | app name trim ( ) is empty ( ) ) { return " " ; } return app name ; }


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


checks if the given operation has been processed in this engine or not

protected final boolean has been processed before ( operation op ) { if ( assertions enabled ) { assert op seq no ( ) ! = sequence numbers unassigned seq no : " operation is not assigned seq no " ; if ( op operation type ( ) = = operation type no op ) { assert no op keyed lock is held by current thread ( op seq no ( ) ) ; } else { assert version map assert keyed lock held by current thread ( op uid ( ) bytes ( ) ) ; } } return local checkpoint tracker has processed ( op seq no ( ) ) ; }


discards the insertion process if resource was already committed the call is ignored


the name of the type this corresponds to the ' type ' part of a full resource name of the form package : typeentry the set of legal type names is listed in resource cpp < code > optional string name = 2 ; < code >

public builder set name ( java lang string value ) { copy on write ( ) ; instance set name ( value ) ; return this ; }


public static list < string > read file 2 list ( final string file path ) { return read file 2 list ( utils bridge get file by path ( file path ) , null ) ; }


sends a savepoint trigger message to the job manager

private void trigger savepoint ( cluster client < ? > cluster client , job i d job id , string savepoint directory ) throws flink exception { log and sysout ( " triggering savepoint for job " + job id + ' ' ) ; completable future < string > savepoint path future = cluster client trigger savepoint ( job id , savepoint directory ) ; log and sysout ( " waiting for response " ) ; try { final string savepoint path = savepoint path future get ( client timeout to millis ( ) , time unit milliseconds ) ; log and sysout ( " savepoint completed path : " + savepoint path ) ; log and sysout ( " you can resume your program from this savepoint with the run command " ) ; } catch ( exception e ) { throwable cause = exception utils strip execution exception ( e ) ; throw new flink exception ( " triggering a savepoint for the job " + job id + " failed " , cause ) ; } }


obtains all the instances of { @ link node monitor } s that are alive

public static list < node monitor > get all ( ) { return computer set get monitors ( ) to list ( ) ; }


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

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


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


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

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


serialize the given java object into string according the given content - type ( only json , http form is supported for now )

public string serialize to string ( object obj , map < string , object > form params , string content type , boolean is body nullable ) throws api exception { try { if ( content type starts with ( " multipart / form - data " ) ) { throw new api exception ( " multipart / form - data not yet supported for serialize to string ( http signature authentication ) " ) ; } else if ( content type starts with ( " application / x - www - form - urlencoded " ) ) { string form string = " " ; for ( entry < string , object > param : form params entry set ( ) ) { form string = param get key ( ) + " = " + u r l encoder encode ( parameter to string ( param get value ( ) ) , " utf - 8 " ) + " & " ; } if ( form string length ( ) = = 0 ) { / / empty string return form string ; } else { return form string substring ( 0 , form string length ( ) - 1 ) ; } } else { if ( is body nullable ) { return obj = = null ? " null " : json get mapper ( ) write value as string ( obj ) ; } else { return obj = = null ? " " : json get mapper ( ) write value as string ( obj ) ; } } } catch ( exception ex ) { throw new api exception ( " failed to perform serialize to string : " + ex to string ( ) ) ; } }


get the name of the local state store used that can be used to query this { @ code k table }


test for { @ link light weight g set # compute capacity ( double , string ) } with invalid percent less than 0

public void test compute capacity negative percent ( ) { light weight g set compute capacity ( 1024 , - 1 0 , " test map " ) ; }


public map < string , scheduler assignment > get assignments ( ) { map < string , scheduler assignment > ret = new hash map < string , scheduler assignment > ( this assignments size ( ) ) ; for ( string topology id : this assignments key set ( ) ) { ret put ( topology id , this assignments get ( topology id ) ) ; } return ret ; }


calculate goal nano time from start time and current tick number , then wait until that goal has been reached

private long wait for next tick ( ) { long deadline = tick duration * ( tick + 1 ) ; for ( ; ; ) { final long current time = system nano time ( ) - start time ; long sleep time ms = ( deadline - current time + 999999 ) / 1000000 ; if ( sleep time ms < = 0 ) { if ( current time = = long min value ) { return - long max value ; } else { return current time ; } } / / check if we run on windows , as if thats the case we will need / / to round the sleep time as workaround for a bug that only affect / / the jvm if it runs on windows / / / / see https : / / github com / netty / netty / issues / 356 if ( platform dependent is windows ( ) ) { sleep time ms = sleep time ms / 10 * 10 ; if ( sleep time ms = = 0 ) { sleep time ms = 1 ; } } try { thread sleep ( sleep time ms ) ; } catch ( interrupted exception ignored ) { if ( worker state updater get ( hashed wheel timer this ) = = worker state shutdown ) { return long min value ; } } } }


creates a mutable copy of { @ code graph } with the same nodes and edges

public static < n > mutable graph < n > copy of ( graph < n > graph ) { mutable graph < n > copy = graph builder from ( graph ) expected node count ( graph nodes ( ) size ( ) ) build ( ) ; for ( n node : graph nodes ( ) ) { copy add node ( node ) ; } for ( endpoint pair < n > edge : graph edges ( ) ) { copy put edge ( edge node u ( ) , edge node v ( ) ) ; } return copy ; }


set the queue name of the job queue info

public void set queue name ( string queue name ) { super set queue name ( queue name ) ; }


half closes the currently opened stream this method does not block callers should block on the future returned by { @ link # get status ( ) } in order to make sure that all { @ code ack callback } calls have been received


return all persistent instances of the given entity class note : use queries or criteria for retrieving a specific subset

< t > list < t > load all ( class < t > entity class ) throws data access exception ;


public builder add temps ( iterable < artifact > artifacts ) { temps add all ( artifacts ) ; return this ; }


free the given slot from the given allocation if the slot is still allocated by the given allocation id , then the slot will be marked as free and will be subject to new slot requests


adds a directed edge between the nodes labelled ' from ' and ' to ' , creating them if necessary

public boolean add edge ( t from , t to ) { node < t > from node = create node ( from ) ; node < t > to node = create node ( to ) ; return add edge ( from node , to node ) ; }


public static string io statistics to string ( @ nullable final i o statistics statistics ) { if ( statistics ! = null ) { string builder sb = new string builder ( ) ; map to string ( sb , " counters " , statistics counters ( ) , " " ) ; map to string ( sb , " gauges " , statistics gauges ( ) , " " ) ; map to string ( sb , " minimums " , statistics minimums ( ) , " " ) ; map to string ( sb , " maximums " , statistics maximums ( ) , " " ) ; map to string ( sb , " means " , statistics mean statistics ( ) , " " ) ; return sb to string ( ) ; } else { return " " ; } }


public file get snap dir ( ) { return snap dir ; }


request to revert to the interpreter for expression evaluation any compiled form is discarded but can be recreated by later recompiling again

public static void revert to interpreted ( expression expression ) { if ( expression instanceof spel expression ) { ( ( spel expression ) expression ) revert to interpreted ( ) ; } }


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

public builder clear create time ( ) { if ( create time builder = = null ) { create time = null ; on changed ( ) ; } else { create time = null ; create time builder = null ; } return this ; }


this method is deprecated use set use value color for line ( ) instead

public void set using slice color as value line color ( boolean enabled ) { set use value color for line ( enabled ) ; }


sets the vertex attribute to whatever was attached via { @ link # set buffer ( float [ ] , int ) } should be called before each drawing call

public void bind ( ) { buffer buffer = assertions check not null ( this buffer , " call set buffer before bind " ) ; gles20 gl bind buffer ( gles20 gl array buffer , 0 ) ; gles20 gl vertex attrib pointer ( location , size , / / count gles20 gl float , / / type false , / / normalize 0 , / / stride buffer ) ; gles20 gl enable vertex attrib array ( index ) ; check gl error ( ) ; }


public static bitmap clip ( final bitmap src , final int x , final int y , final int width , final int height ) { return clip ( src , x , y , width , height , false ) ; }


low level conf value extraction test just to make sure that all works at the lower level

public void test conf extraction ( ) throws throwable { exit tracking service launcher < service > launcher = new exit tracking service launcher < > ( running service name ) ; launcher bind command options ( ) ; configuration conf = new conf ( " propagated " , " true " ) ; assert equals ( " true " , conf get ( " propagated " , " unset " ) ) ; configuration extracted = new configuration ( false ) ; list < string > args list = as list ( " name " , arg conf prefixed , config file ( conf ) ) ; list < string > args = launcher extract command options ( extracted , args list ) ; if ( ! args is empty ( ) ) { assert equals ( " args beginning with " + args get ( 0 ) , 0 , args size ( ) ) ; } assert equals ( " true " , extracted get ( " propagated " , " unset " ) ) ; }


closes the concrete data type if necessary note - we can ' t rely on the closeable interface because it was added after our min api level see issue # 157

protected abstract void close ( t data ) throws i o exception ;


public object get anytype 2 ( ) { return anytype 2 ; }


public set < string > get allowed methods ( ) { set < string > result = new linked hash set < > ( ) ; for ( partial match match : this partial matches ) { for ( request method method : match get info ( ) get methods condition ( ) get methods ( ) ) { result add ( method name ( ) ) ; } } return result ; }


returns the int at the current position and increases the position by 1


finds the local directories that logs for the given container are stored on

public static list < file > get container log dirs ( container id container id , string remote user , context context ) throws yarn exception { container container = context get containers ( ) get ( container id ) ; application application = get application for container ( container id , context ) ; check access ( remote user , application , context ) ; / / it is not required to have null check for container ( container = = null ) / / and throw back exception because when container is completed , node manager / / remove container information from its n m context configuring log / / aggregation to false , container log view request is forwarded to nm nm / / does not have completed container information , but still nm serve request for / / reading container logs if ( container ! = null ) { check state ( container get container state ( ) ) ; } return get container log dirs ( container id , context get local dirs handler ( ) ) ; }


void close ( ) { if ( journal writer ! = null ) { journal writer close ( ) ; journal writer = null ; } if ( journal count > = index rewrite journal limit ) { flush index ( ) ; } }


public zipkin dependencies rename ( string name ) { return new zipkin dependencies ( dsl name ( name ) , null ) ; }


a convenience method to directly run a { @ link monitored runnable } in a separate thread as a { @ link task } , displaying a non - modal progress dialog < code > task launcher launch non modal ( " my task " , < br > & nbsp ; & nbsp ; null , parent < br > & nbsp ; & nbsp ; monitor - & gt ; { while ( ! monitor is canceled ( ) ) { long running work ( ) ; } } < br > ) ; < code > note : the task created by this call will be both cancellable and have progress if you task cannot be cancelled or does not have progress , then do not use this convenience method , but rather call one of the constructors of this class see < a href = " # modal usage " > notes on non - modal usage

public static void launch non modal ( string title , monitored runnable runnable ) { new task launcher ( new task ( title , true , true , false ) { @ override public void run ( task monitor monitor ) { runnable monitored run ( monitor ) ; } } , null , initial delay ms ) ; }


public d b p image get plain icon ( ) { return icon plain ; }


invoke the rewrite logic recursively on children of the given node and swap it out with an identical copy with the rewritten children

public plan node default rewrite ( plan node node , c context ) { list < plan node > children = node get sources ( ) stream ( ) map ( child - > rewrite ( child , context ) ) collect ( to immutable list ( ) ) ; return replace children ( node , children ) ; }


call to register a call trace at the current call location

public static void register call ( ) { / / all of this is totally thread - unsafe for speed / / the worst that can happen is we occasionally over - sample if ( current sample count increment and get ( ) < next sample count get ( ) ) { return ; } long count = 0 ; synchronized ( callcounts class ) { / / check again if somebody else already got here first / / this greatly improves performance compared to eager locking if ( current sample count get ( ) < next sample count get ( ) ) { return ; } count = current sample count get ( ) ; reset sample target ( ) ; } stack trace element [ ] stack trace = thread current thread ( ) get stack trace ( ) ; int skip = 2 ; / / otherwise we show up ourselves int len = math min ( stack trace length - skip , max callstack depth ) ; if ( len < = 0 ) { return ; } stack trace element [ ] entries = new stack trace element [ len ] ; for ( int i = 0 ; i < len ; + + i ) { entries [ i ] = stack trace [ i + skip ] ; } callstack callstack = new callstack ( entries ) ; callstack = callstacks intern ( callstack ) ; callstack counts put ( callstack , callstack counts get or default ( callstack , 0l ) + count ) ; }


returns the non - negative index value of the alpha character { @ code c } , regardless of case ie , ' a ' ' a ' returns 0 and ' z ' ' z ' returns 25 non - alpha characters return a value of 26 or greater

private static int get alpha index ( char c ) { / / fold upper - case ascii to lower - case and make zero - indexed and unsigned ( by casting to char ) return ( char ) ( ( c | case mask ) - ' a ' ) ; }


adjusts a locals array to account for a merged subroutines list if a frame merge results in , effectively , a subroutine return through a throw then the current locals will be a locals array set that will need to be trimmed of all one locals array elements that relevent to the subroutine that is returning

private static locals array adjust locals for subroutines ( locals array locals , int list subroutines ) { if ( ! ( locals instanceof locals array set ) ) { / / nothing to see here return locals ; } locals array set la set = ( locals array set ) locals ; if ( subroutines size ( ) = = 0 ) { / * * we ' ve merged from a subroutine context to a non - subroutine * context , likely via a throw our successor will only need * to consider the primary locals state , not the state of * all possible subroutine paths * / return la set get primary ( ) ; } / * * it ' s unclear to me if the locals set needs to be trimmed here * if it does , then i believe it is all of the calling blocks * in the subroutine at the end of " subroutines " passed into * this method that should be removed * / return la set ; }


returns the transitive portable proto filter files from a list of objc proto providers

static nested set < artifact > get transitive portable proto filters ( iterable < objc proto provider > objc proto providers ) { nested set builder < artifact > portable proto filters = nested set builder stable order ( ) ; for ( objc proto provider objc proto provider : objc proto providers ) { portable proto filters add transitive ( objc proto provider get portable proto filters ( ) ) ; } return portable proto filters build ( ) ; }


protected string human access flags ( int access flags ) { return access flags field string ( access flags ) ; }


returns the { @ link # max } as an { @ code int } after a narrowing primitive conversion

public int int value ( ) { return ( int ) max ( ) ; }


public static string get name ( object obj ) { objects require non null ( obj , " obj " ) ; return obj get class ( ) get name ( ) ; }


returns an immutable array containing the same values as { @ code this } array this is logically a no - op , and in some circumstances { @ code this } itself is returned however , if this instance is a { @ link # sub array } view of a larger array , this method will copy only the appropriate range of values , resulting in an equivalent array with a smaller memory footprint

public immutable long array trimmed ( ) { return is partial view ( ) ? new immutable long array ( to array ( ) ) : this ; }


returns a predicate that returns the result of { @ link file # is file } on input files

public static predicate < file > is file ( ) { return file predicate is file ; }


notification to the action manager that a program was opened as the second program to the program diff actions are adjusted accordingly

void second program opened ( ) { open close program 2 action set selected ( true ) ; open close program 2 action set description ( " close diff view " ) ; program first program = plugin get first program ( ) ; program second program = plugin get second program ( ) ; string first name = first program get name ( ) ; string second name = second program get name ( ) ; / / @ formatter : off open close program 2 action set description ( " < html > < center > close diff view < / center > < br > " + " current diff : " + " < b > " + h t m l utilities escape h t m l ( first name ) + " < / b > to < b > " + h t m l utilities escape h t m l ( second name ) + " < / b > " ) ; / / @ formatter : on }


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


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


overrides the protected download only method in { @ code com bumptech glide request builder } to return our generated subclass instead

private method spec generate download only request method ( ) { parameterized type name generated request builder of file = parameterized type name get ( generated request builder class name , class name get ( file class ) ) ; return method spec method builder ( " get download only request " ) add annotation ( override class ) add annotation ( processor util check result ( ) ) add annotation ( processor util non null ( ) ) returns ( generated request builder of file ) add modifiers ( modifier protected ) add statement ( " return new $ t < > ( $ t class , $ n ) apply ( $ n ) " , generated request builder class name , file class , " this " , " download only options " ) build ( ) ; }


{ @ inherit doc } the default implementation does nothing

@ override public void enter time unit ( eql base parser time unit context ctx ) { }


returns the length of this source in chars , even if doing so requires opening and traversing an entire stream to avoid a potentially expensive operation , see { @ link # length if known } the default implementation calls { @ link # length if known } and returns the value if present if absent , it will fall back to a heavyweight operation that will open a stream , { @ link reader # skip ( long ) skip } to the end of the stream , and return the total number of chars that were skipped note that for sources that implement { @ link # length if known } to provide a more efficient implementation , it is possible that this method will return a different number of chars than would be returned by reading all of the chars in either case , for mutable sources such as files , a subsequent read may return a different number of chars if the contents are changed

public long length ( ) throws i o exception { optional < long > length if known = length if known ( ) ; if ( length if known is present ( ) ) { return length if known get ( ) ; } closer closer = closer create ( ) ; try { reader reader = closer register ( open stream ( ) ) ; return count by skipping ( reader ) ; } catch ( throwable e ) { throw closer rethrow ( e ) ; } finally { closer close ( ) ; } }


public long get space consumed ( ) { return space consumed ; }


load tinker j a rs and add them to the application class loader

public static boolean load tinker jars ( final tinker application application , string directory , string oat dir , intent intent result , boolean is system o t a , boolean is protected app ) { if ( load dex list is empty ( ) & & class n dex info is empty ( ) ) { share tinker log w ( tag , " there is no dex to load " ) ; return true ; } class loader class loader = tinker dex loader class get class loader ( ) ; if ( class loader ! = null ) { share tinker log i ( tag , " classloader : " + class loader to string ( ) ) ; } else { share tinker log e ( tag , " classloader is null " ) ; share intent util set intent return code ( intent result , share constants error load patch version dex classloader null ) ; return false ; } string dex path = directory + " / " + dex path + " / " ; array list < file > legal files = new array list < > ( ) ; for ( share dex diff patch info info : load dex list ) { / / for dalvik , ignore art support dex if ( is just art support dex ( info ) ) { continue ; } string path = dex path + info real name ; file file = new file ( path ) ; if ( application is tinker load verify flag ( ) ) { long start = system current time millis ( ) ; string check md 5 = get info md 5 ( info ) ; if ( ! share patch file util verify dex file md 5 ( file , check md 5 ) ) { / / it is good to delete the mismatch file share intent util set intent return code ( intent result , share constants error load patch version dex md5 mismatch ) ; intent result put extra ( share intent util intent patch mismatch dex path , file get absolute path ( ) ) ; return false ; } share tinker log i ( tag , " verify dex file : " + file get path ( ) + " md 5 , use time : " + ( system current time millis ( ) - start ) ) ; } legal files add ( file ) ; } / / verify merge class n apk if ( is vm art & & ! class n dex info is empty ( ) ) { file class n file = new file ( dex path + share constants class n apk name ) ; long start = system current time millis ( ) ; if ( application is tinker load verify flag ( ) ) { for ( share dex diff patch info info : class n dex info ) { if ( ! share patch file util verify dex file md 5 ( class n file , info raw name , info dest md 5 in art ) ) { share intent util set intent return code ( intent result , share constants error load patch version dex md5 mismatch ) ; intent result put extra ( share intent util intent patch mismatch dex path , class n file get absolute path ( ) ) ; return false ; } } } share tinker log i ( tag , " verify dex file : " + class n file get path ( ) + " md 5 , use time : " + ( system current time millis ( ) - start ) ) ; legal files add ( class n file ) ; } file optimize dir = new file ( directory + " / " + oat dir ) ; if ( is system o t a ) { final boolean [ ] parallel o t a result = { true } ; final throwable [ ] parallel o t a throwable = new throwable [ 1 ] ; string target i s a ; try { target i s a = share tinker internals get current instruction set ( ) ; } catch ( throwable throwable ) { share tinker log i ( tag , " get current instruction set fail : " + throwable ) ; / / try { / / target i s a = share oat util get oat file instruction set ( test opt dex file ) ; / / } catch ( throwable throwable ) { / / don ' t ota on the front delete out of date o a t file ( directory ) ; intent result put extra ( share intent util intent patch interpret exception , throwable ) ; share intent util set intent return code ( intent result , share constants error load patch get ota instruction set exception ) ; return false ; / / } } delete out of date o a t file ( directory ) ; share tinker log w ( tag , " system o t a , try parallel oat dexes , target i s a : " + target i s a ) ; / / change dir optimize dir = new file ( directory + " / " + interpret dex optimize path ) ; tinker dex optimizer optimize all ( application , legal files , optimize dir , true , application is use delegate last class loader ( ) , target i s a , new tinker dex optimizer result callback ( ) { long start ; @ override public void on start ( file dex file , file optimized dir ) { start = system current time millis ( ) ; share tinker log i ( tag , " start to optimize dex : " + dex file get path ( ) ) ; } @ override public void on success ( file dex file , file optimized dir , file optimized file ) { / / do nothing share tinker log i ( tag , " success to optimize dex " + dex file get path ( ) + " , use time " + ( system current time millis ( ) - start ) ) ; } @ override public void on failed ( file dex file , file optimized dir , throwable thr ) { parallel o t a result [ 0 ] = false ; parallel o t a throwable [ 0 ] = thr ; share tinker log i ( tag , " fail to optimize dex " + dex file get path ( ) + " , use time " + ( system current time millis ( ) - start ) ) ; } } ) ; if ( ! parallel o t a result [ 0 ] ) { share tinker log e ( tag , " parallel oat dexes failed " ) ; intent result put extra ( share intent util intent patch interpret exception , parallel o t a throwable [ 0 ] ) ; share intent util set intent return code ( intent result , share constants error load patch ota interpret only exception ) ; return false ; } } try { final boolean use d l c = application is use delegate last class loader ( ) ; system class loader adder install dexes ( application , class loader , optimize dir , legal files , is protected app , use d l c ) ; } catch ( throwable e ) { share tinker log e ( tag , " install dexes failed " ) ; intent result put extra ( share intent util intent patch exception , e ) ; share intent util set intent return code ( intent result , share constants error load patch version dex load exception ) ; return false ; } return true ; }


check that the manager won ' t try to upgrade unhealthy indices

public void test manager skips indices with red status ( ) { system indices system indices = new system indices ( map of ( " my index " , list of ( descriptor ) ) ) ; system index manager manager = new system index manager ( system indices , client ) ; final cluster state builder cluster state builder = create cluster state ( ) ; mark shards unavailable ( cluster state builder ) ; assert that ( manager get upgrade status ( cluster state builder build ( ) , descriptor ) , equal to ( upgrade status unhealthy ) ) ; }


execute sql scripts configured via { @ link sql @ sql } for the supplied { @ link test context } after the current test method

public void after test method ( test context test context ) { execute sql scripts ( test context , execution phase after test method ) ; }


the " bulk " version of the remainder warning : this function will modify the " dividend " inputs

public void remainder ( byte [ ] [ ] dividend , int [ ] divisor ) { for ( int i = dividend length - divisor length ; i > = 0 ; i - - ) { for ( int j = 0 ; j < divisor length ; j + + ) { for ( int k = 0 ; k < dividend [ i ] length ; k + + ) { int ratio = div table [ dividend [ i + divisor length - 1 ] [ k ] & 0x 0 0 f f ] [ divisor [ divisor length - 1 ] ] ; dividend [ j + i ] [ k ] = ( byte ) ( ( dividend [ j + i ] [ k ] & 0x 0 0 f f ) ^ mul table [ ratio ] [ divisor [ j ] ] ) ; } } } }


returns { @ code true } if the shard is allowed to be rebalanced to another node in the cluster , returns { @ code false } otherwise if { @ link # get cluster rebalance decision ( ) } returns { @ code null } , then the result of this method is meaningless , as no rebalance decision was taken if { @ link # is decision taken ( ) } returns { @ code false } , then invoking this method will throw an { @ code illegal state exception }

public boolean can rebalance cluster ( ) { check decision state ( ) ; return cluster rebalance decision ! = null & & cluster rebalance decision type ( ) = = type yes ; }


returns a string representation for this map maker instance the exact form of the returned string is not specified

public string to string ( ) { more objects to string helper s = more objects to string helper ( this ) ; if ( initial capacity ! = unset int ) { s add ( " initial capacity " , initial capacity ) ; } if ( concurrency level ! = unset int ) { s add ( " concurrency level " , concurrency level ) ; } if ( key strength ! = null ) { s add ( " key strength " , ascii to lower case ( key strength to string ( ) ) ) ; } if ( value strength ! = null ) { s add ( " value strength " , ascii to lower case ( value strength to string ( ) ) ) ; } if ( key equivalence ! = null ) { s add value ( " key equivalence " ) ; } return s to string ( ) ; }


checks the user does not exist in the users or users roles files

void assert no user ( string username ) throws i o exception { list < string > lines = files read all lines ( conf dir resolve ( " users " ) , standard charsets utf 8 ) ; for ( string line : lines ) { string [ ] username hash = line split ( " : " , 2 ) ; if ( username hash length ! = 2 ) { fail ( " corrupted users file , line : " + line ) ; } assert not equals ( username , username hash [ 0 ] ) ; } lines = files read all lines ( conf dir resolve ( " users roles " ) , standard charsets utf 8 ) ; for ( string line : lines ) { string [ ] role users = line split ( " : " , 2 ) ; if ( role users length ! = 2 ) { fail ( " corrupted users roles file , line : " + line ) ; } string [ ] users = role users [ 1 ] split ( " , " ) ; for ( string user : users ) { assert not equals ( user , username ) ; } } }


sets new search start point in the file inclusive in forward finds , exclusive in backward ones

public void set new start ( long start point ) { if ( start point < 0l | | start point > get content length ( ) ) return ; current position = start point ; buffer position = start point ; if ( ! direction forward ) { buffer position = start point - map size ; } if ( buffer position < 0l ) buffer position = 0l ; }


read bytes from the stream at eof , checksum is validated and sent back as the last four bytes of the buffer the caller should handle these bytes appropriately

public int read with checksum ( byte [ ] b , int off , int len ) throws i o exception { if ( current offset = = length ) { return - 1 ; } else if ( current offset > = data length ) { / / if the previous read drained off all the data , then just return / / the checksum now note that checksum validation would have / / happened in the earlier read int len to copy = ( int ) ( checksum size - ( current offset - data length ) ) ; if ( len < len to copy ) { len to copy = len ; } system arraycopy ( csum , ( int ) ( current offset - data length ) , b , off , len to copy ) ; current offset + = len to copy ; return len to copy ; } int bytes read = do read ( b , off , len ) ; if ( current offset = = data length ) { if ( len > = bytes read + checksum size ) { system arraycopy ( csum , 0 , b , off + bytes read , checksum size ) ; bytes read + = checksum size ; current offset + = checksum size ; } } return bytes read ; }


sets host and target configuration using the specified options , falling back to the default options for unspecified ones , and recreates the build view

public final void use configuration ( string args ) throws exception { options parser = options parser builder ( ) options classes ( iterables concat ( arrays as list ( execution options class , package options class , build language options class , build request options class , analysis options class , keep going option class , loading phase threads option class , loading options class ) , rule class provider get configuration options ( ) ) ) build ( ) ; if ( default flags ( ) contains ( flag public visibility ) ) { options parser parse ( " - - default visibility = public " ) ; } if ( default flags ( ) contains ( flag cpu k8 ) ) { options parser parse ( " - - cpu = k 8 " , " - - host cpu = k 8 " ) ; } if ( default flags ( ) contains ( flag product specific flags ) ) { options parser parse ( test constants product specific flags ) ; } options parser parse ( args ) ; if ( default flags ( ) contains ( flag trimmed configurations ) ) { options parser parse ( " - - experimental dynamic configs = on " ) ; } build options = rule class provider create build options ( options parser ) ; }


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


returns a java io file that represents this file handle note the returned file will only be usable for { @ link file type # absolute } and { @ link file type # external } file handles

public file file ( ) { if ( type = = file type external ) return new file ( gdx files get external storage path ( ) , file get path ( ) ) ; return file ; }


returns an immutable range set containing the single range { @ link range # all ( ) }

static < c extends comparable > immutable range set < c > all ( ) { return ( immutable range set < c > ) all ; }


notifies the tracker of dropped video frames for the current playback

public void on dropped video frames ( int dropped frames ) { this dropped frames + = dropped frames ; }