makes sure security - 218 fix also applies to slaves this test is for jnlp slave

public void jnlp slave ( ) throws exception { dumb slave s = create jnlp slave ( " test " ) ; launch jnlp slave ( s ) ; check ( s ) ; }


tests value deserialization with too many bytes

public void test deserialize value too many 1 ( ) throws exception { / / long + 1 byte kv state serializer deserialize value ( new byte [ ] { 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 2 } , long serializer instance ) ; }


register a listener that will be called when this model visibility has changed the listener will contribute to this model ' s hash code state per the { @ link com airbnb epoxy epoxy attribute option # do not hash } rules

public model with all private field types on visibility changed ( on model visibility changed listener < model with all private field types , object > listener ) { on mutation ( ) ; this on model visibility changed listener epoxy generated model = listener ; return this ; }


delegate to the appropriate method of the underlying logger

public void debug ( string msg ) { if ( ! is debug enabled ( ) | | ! is debug enabled ( marker ) ) return ; if ( should log ( msg ) ) super debug ( marker , msg ) ; }


called when the renderer ' s offset has been changed the default implementation is a no - op

protected void on renderer offset changed ( long offset us ) throws exo playback exception { / / do nothing }


remove the snapshot with the given name from { @ link # snapshots by names } , and delete all the corresponding directory diff

public snapshot remove snapshot ( i node reclaim context reclaim context , i node directory snapshot root , string snapshot name , long now , snapshot manager snapshot manager ) throws snapshot exception { final int i = search snapshot ( d f s util string 2 bytes ( snapshot name ) ) ; if ( i < 0 ) { / / considering a sequence like this with snapshots s1 and s 2 / / 1 ordered snapshot deletion feature is turned on / / 2 delete s2 creating edit log entry for s2 deletion / / 3 delete s1 / / 4 s2 gets deleted by snapshot gc thread creating edit log record for / / s2 deletion again / / 5 disable ordered snapshot deletion feature / / 6 restarting namenode / / in this case , when edit log replay happens actual deletion of s2 / / will happen when first edit log for s2 deletion gets replayed and / / the second edit log record replay for s2 deletion will fail as snapshot / / won ' t exist thereby failing the namenode start / / the idea here is to check during edit log replay , if a certain snapshot / / is not found and the ordered snapshot deletion is off , ignore the error if ( ! snapshot manager is snapshot deletion ordered ( ) & & ! snapshot manager is image loaded ( ) ) { return null ; } throw new snapshot exception ( " cannot delete snapshot " + snapshot name + " from path " + snapshot root get full path name ( ) + " : the snapshot does not exist " ) ; } else { final snapshot snapshot = snapshots by names get ( i ) ; int prior = snapshot find latest snapshot ( snapshot root , snapshot get id ( ) ) ; snapshot manager assert prior ( snapshot root , snapshot name , prior ) ; snapshot root clean subtree ( reclaim context , snapshot get id ( ) , prior ) ; / / remove from snapshots by names after successfully cleaning the subtree snapshots by names remove ( i ) ; snapshot root update modification time ( now , snapshot current state id ) ; return snapshot ; } }


public lexer action type get action type ( ) { return lexer action type channel ; }


gets the address range containing the lsda header

public address range get body ( ) { return table bounds ; }


obtain a { @ code asynchronous file channel } from the given supplier , and read it into a { @ code flux } of { @ code data buffer } s closes the channel when the flux is terminated

public static flux < data buffer > read asynchronous file channel ( callable < asynchronous file channel > channel supplier , data buffer factory buffer factory , int buffer size ) { return read asynchronous file channel ( channel supplier , 0 , buffer factory , buffer size ) ; }


private static string to normalized icon url ( string url ) { return icon to normalized icon url ( url ) ; }


public void set target cache manager ( cache manager target cache manager ) { this target cache manager = target cache manager ; }


is this user logged in from a ticket ( but no keytab ) managed by the ugi ?

private boolean is from ticket ( ) { return has kerberos credentials ( ) & & is hadoop login ( ) & & get keytab ( ) = = null ; }


returns a json adapter equal to this json adapter , but with support for reading and writing nulls

public final json adapter < t > null safe ( ) { if ( this instanceof null safe json adapter ) { return this ; } return new null safe json adapter < > ( this ) ; }


this is to be called when node manager reconnects or goes down this will remove if n m tokens if present for any running application from cache

public void remove node key ( node id node id ) { this write lock lock ( ) ; try { iterator < hash set < node id > > app node key set iterator = this app attempt to node key map values ( ) iterator ( ) ; while ( app node key set iterator has next ( ) ) { app node key set iterator next ( ) remove ( node id ) ; } } finally { this write lock unlock ( ) ; } }


gets the generic type of given matcher for example , for matcher class that extends base matcher [ integer ] this method returns integer

public static class < ? > generic type of matcher ( class < ? > matcher class ) { / / todo sf check if we can reuse it for mockito argument matcher return generic type of ( matcher class , base matcher class , matcher class ) ; }


returns an instance of impersonation provider looks up the configuration to see if there is custom class specified

private static impersonation provider get instance ( configuration conf ) { class < ? extends impersonation provider > clazz = conf get class ( common configuration keys public hadoop security impersonation provider class , default impersonation provider class , impersonation provider class ) ; return reflection utils new instance ( clazz , conf ) ; }


compare to another condition based on header expressions a condition is considered to be a more specific match , if it has : a greater number of expressions a greater number of non - negated expressions with a concrete value it is assumed that both instances have been obtained via { @ link # get matching condition ( http servlet request ) } and each instance contains the matching header expression only or is otherwise empty

public int compare to ( headers request condition other , http servlet request request ) { int result = other expressions size ( ) - this expressions size ( ) ; if ( result ! = 0 ) { return result ; } return ( int ) ( get value match count ( other expressions ) - get value match count ( this expressions ) ) ; }


creates a string representation of the tuple in the form ( f 0 , f 1 , f 2 , f 3 , f 4 , f 5 , f 6 , f 7 , f 8 , f 9 , f 1 0 , f 1 1 , f 1 2 , f 1 3 , f 1 4 , f 1 5 , f 1 6 , f 1 7 , f 1 8 ) , where the individual fields are the value returned by calling { @ link object # to string } on that field

public string to string ( ) { return " ( " + string utils array aware to string ( this f 0 ) + " , " + string utils array aware to string ( this f 1 ) + " , " + string utils array aware to string ( this f 2 ) + " , " + string utils array aware to string ( this f 3 ) + " , " + string utils array aware to string ( this f 4 ) + " , " + string utils array aware to string ( this f 5 ) + " , " + string utils array aware to string ( this f 6 ) + " , " + string utils array aware to string ( this f 7 ) + " , " + string utils array aware to string ( this f 8 ) + " , " + string utils array aware to string ( this f 9 ) + " , " + string utils array aware to string ( this f 1 0 ) + " , " + string utils array aware to string ( this f 1 1 ) + " , " + string utils array aware to string ( this f 1 2 ) + " , " + string utils array aware to string ( this f 1 3 ) + " , " + string utils array aware to string ( this f 1 4 ) + " , " + string utils array aware to string ( this f 1 5 ) + " , " + string utils array aware to string ( this f 1 6 ) + " , " + string utils array aware to string ( this f 1 7 ) + " , " + string utils array aware to string ( this f 1 8 ) + " ) " ; }


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


returns the repeat mode for the given simple exo player ' s repeat mode

public static int get repeat mode ( @ player repeat mode int exo player repeat mode ) { switch ( exo player repeat mode ) { case player repeat mode all : return session player repeat mode all ; case player repeat mode one : return session player repeat mode one ; case player repeat mode off : return session player repeat mode none ; default : throw new illegal argument exception ( ) ; } }


public builder set low res image request ( request low res image request ) { m low res image request = low res image request ; return get this ( ) ; }


the east panel contains the status panel and a spacer

private j panel create east panel ( j panel status panel ) { j panel east panel = new j panel ( new horizontal layout ( 0 ) ) ; east panel add ( status panel ) ; east panel add ( new status bar spacer ( ) ) ; return east panel ; }


specifies whether or not , the executor ( used for reporting ) will be stopped with same time with reporter default value is true setting this parameter to false , has the sense in combining with providing external managed executor via { @ link # schedule on ( scheduled executor service ) }

public builder shutdown executor on stop ( boolean shutdown executor on stop ) { this shutdown executor on stop = shutdown executor on stop ; return this ; }


updates the progress message details associated with this phase of the merge

protected void update progress message ( string message ) { merge manager update progress ( message ) ; }


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

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


get the 8 - bit byte value located at the specified offset

public byte get byte ( int offset ) throws i o exception { synchronized ( dbh ) { return buf get byte ( offset ) ; } }


gets the progress object ; this has a float ( 0 0 - 1 0 ) indicating the bytes processed by the iterator so far


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


check if directory is snapshot enabled or not

public boolean is snapshot enabled ( ) { return attr contains ( attr flags snapshot enabled ) ; }


visit a parse tree produced by the { @ code binary } labeled alternative in { @ link painless parser # noncondexpression }

t visit binary ( painless parser binary context ctx ) ;


registers a compressor for both decompression and message encoding negotiation

public void register ( compressor c ) { string encoding = c get message encoding ( ) ; check argument ( ! encoding contains ( " , " ) , " comma is currently not allowed in message encoding " ) ; compressors put ( encoding , c ) ; }


returns the index of the last appearance of the value { @ code target } in { @ code array }

public static int last index of ( boolean [ ] array , boolean target ) { return last index of ( array , target , 0 , array length ) ; }


public cancellable delete watch async ( delete watch request request , request options options , action listener < delete watch response > listener ) { return rest high level client perform request async and parse entity ( request , watcher request converters : : delete watch , options , delete watch response : : from x content , listener , singleton ( 404 ) ) ; }


convert a long integer to a string with traditional binary prefix

public static string long 2 string ( long n , string unit , int decimal places ) { if ( unit = = null ) { unit = " " ; } / / take care a special case if ( n = = long min value ) { return " - 8 " + exa symbol + unit ; } final string builder b = new string builder ( ) ; / / take care negative numbers if ( n < 0 ) { b append ( ' - ' ) ; n = - n ; } if ( n < kilo value ) { / / no prefix b append ( n ) ; return ( unit is empty ( ) ? b : b append ( " " ) append ( unit ) ) to string ( ) ; } else { / / find traditional binary prefix int i = 0 ; for ( ; i < values ( ) length & & n > = values ( ) [ i ] value ; i + + ) ; traditional binary prefix prefix = values ( ) [ i - 1 ] ; if ( ( n & prefix bit mask ) = = 0 ) { / / exact division b append ( n > > prefix bit shift ) ; } else { final string format = " % " + decimal places + " f " ; string s = format ( format , n / ( double ) prefix value ) ; / / check a special rounding up case if ( s starts with ( " 1024 " ) ) { prefix = values ( ) [ i ] ; s = format ( format , n / ( double ) prefix value ) ; } b append ( s ) ; } return b append ( ' ' ) append ( prefix symbol ) append ( unit ) to string ( ) ; } }


this method always returns { @ code null }

public servlet registration get servlet registration ( string servlet name ) { return null ; }


creates an instance for testing without actually symlinking the tools used for tests that need a set of embedded tools to be present , but not the actual files

public static bin tools for unit testing ( blaze directories directories , iterable < string > tools ) { return new bin tools ( directories , immutable list copy of ( tools ) ) ; }


public long get used ( ) { return used ; }


returns the field factorys on a given row

public field factory [ ] get factorys ( int row ) { return ( rows get ( row ) ) get factorys ( ) ; }


appends the byte sequences at { @ code offset } in the value at { @ code position } to { @ code block builder } this method must be implemented if @ { code get slice } is implemented

default void write bytes to ( int position , int offset , int length , block builder block builder ) { throw new unsupported operation exception ( get class ( ) get name ( ) ) ; }


bind a value and return the related { @ link bind marker } increments { @ link bind markers } state

public bind marker bind ( object value ) { assert not null ( value , " value must not be null " ) ; bind marker marker = next marker ( ) ; get bindings ( ) put ( marker , new value binding ( marker , value ) ) ; return marker ; }


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

public static < t > find executor < t > find async ( final class < t > model class , final long id , final boolean is eager ) { final find executor < t > executor = new find executor < > ( ) ; runnable runnable = new runnable ( ) { @ override public void run ( ) { synchronized ( lite pal support class ) { final t t = find ( model class , id , is eager ) ; if ( executor get listener ( ) ! = null ) { operator get handler ( ) post ( new runnable ( ) { @ override public void run ( ) { executor get listener ( ) on finish ( t ) ; } } ) ; } } } } ; executor submit ( runnable ) ; return executor ; }


start producing results for given context provided consumer is notified whenever progress is made ( new value is ready or error occurs )

void produce results ( consumer < t > consumer , producer context context ) ;


set the metadata store of a filesystem instance to the given store , via a package - private setter method

public static void set metadata store ( s 3 a file system fs , metadata store ms ) { fs set metadata store ( ms ) ; }


public string get text ( ) { return get text ( - 1 ) ; }


the set of xml attributevalue pairs for this style < code > repeated aapt pb style entry entry = 3 ; < code >

public builder add entry ( int index , com android aapt resources style entry value ) { copy on write ( ) ; instance add entry ( index , value ) ; return this ; }


try to parse input spec setting string into url

private url input spec remote url ( ) { try { return new uri ( input spec ) to u r l ( ) ; } catch ( u r i syntax exception | malformed u r l exception | illegal argument exception e ) { return null ; } }


to test special tags to test special tags and operation id starting with number < b > 200 < b > - successful operation

public client call 1 2 3test special tags ( client body ) throws rest client exception { return call 1 2 3test special tags with http info ( body ) get body ( ) ; }


protected abstract r do work ( ) throws e ;


check whether or not the main content is clipped to the top of the panel

public boolean is clip panel ( ) { return m clip panel ; }


marks this node and all ancestors as invalid and needing to be rebuilt

void invalidate ( ) { invalid = true ; if ( parent ! = null ) { parent invalidate ( ) ; } }


indicates that this instance should keep annotations this method may be called only once per instance , and only before any data has been written to the it

public void enable annotations ( int annotation width , boolean verbose ) { if ( ( annotations ! = null ) | | ( cursor ! = 0 ) ) { throw new runtime exception ( " cannot enable annotations " ) ; } if ( annotation width < 40 ) { throw new illegal argument exception ( " annotation width < 40 " ) ; } int hex cols = ( ( ( annotation width - 7 ) / 15 ) + 1 ) & ~ 1 ; if ( hex cols < 6 ) { hex cols = 6 ; } else if ( hex cols > 10 ) { hex cols = 10 ; } this annotations = new array list < annotation > ( 1000 ) ; this annotation width = annotation width ; this hex cols = hex cols ; this verbose = verbose ; }


wraps the given runnable such that for the duration of { @ link runnable # run } the thread that is running with have the given name

static runnable thread renaming ( final runnable task , final supplier < string > name supplier ) { check not null ( name supplier ) ; check not null ( task ) ; return new runnable ( ) { @ override public void run ( ) { thread current thread = thread current thread ( ) ; string old name = current thread get name ( ) ; boolean restore name = try set name ( name supplier get ( ) , current thread ) ; try { task run ( ) ; } finally { if ( restore name ) { boolean unused = try set name ( old name , current thread ) ; } } } } ; }


tests that blocking request of multi local buffer pools can be fulfilled by recycled segments to the global network buffer pool

public void test blocking request from multi local buffer pool ( ) throws i o exception , interrupted exception { final int local pool required size = 5 ; final int local pool max size = 10 ; final int num local buffer pool = 2 ; final int number of segments to request = 10 ; final int num buffers = num local buffer pool * local pool max size ; final executor service executor service = executors new fixed thread pool ( num local buffer pool ) ; final network buffer pool global pool = new network buffer pool ( num buffers , 128 ) ; final list < buffer pool > local buffer pools = new array list < > ( num local buffer pool ) ; try { / / create local buffer pools for ( int i = 0 ; i < num local buffer pool ; + + i ) { final buffer pool local pool = global pool create buffer pool ( local pool required size , local pool max size ) ; local buffer pools add ( local pool ) ; assert true ( local pool get available future ( ) is done ( ) ) ; } / / request some segments from the global pool in two different ways final list < memory segment > segments = new array list < > ( number of segments to request - 1 ) ; for ( int i = 0 ; i < number of segments to request - 1 ; + + i ) { segments add ( global pool request memory segment ( ) ) ; } final list < memory segment > exclusive segments = global pool request memory segments ( global pool get number of available memory segments ( ) - 1 ) ; assert true ( global pool get available future ( ) is done ( ) ) ; for ( final buffer pool local pool : local buffer pools ) { assert true ( local pool get available future ( ) is done ( ) ) ; } / / blocking request buffers form local buffer pools final count down latch latch = new count down latch ( num local buffer pool ) ; final blocking queue < buffer builder > segments requested = new array blocking queue < > ( num buffers ) ; final atomic reference < throwable > cause = new atomic reference < > ( ) ; for ( final buffer pool local pool : local buffer pools ) { executor service submit ( ( ) - > { try { for ( int num = local pool max size ; num > 0 ; - - num ) { segments requested add ( local pool request buffer builder blocking ( ) ) ; } } catch ( exception e ) { cause set ( e ) ; } finally { latch count down ( ) ; } } ) ; } / / wait until all available buffers are requested while ( segments requested size ( ) + segments size ( ) + exclusive segments size ( ) < num buffers ) { thread sleep ( 100 ) ; assert null ( cause get ( ) ) ; } final completable future < ? > global pool available future = global pool get available future ( ) ; assert false ( global pool available future is done ( ) ) ; final list < completable future < ? > > local pool available futures = new array list < > ( num local buffer pool ) ; for ( buffer pool local pool : local buffer pools ) { completable future < ? > local pool available future = local pool get available future ( ) ; local pool available futures add ( local pool available future ) ; assert false ( local pool available future is done ( ) ) ; } / / recycle the previously requested segments for ( memory segment segment : segments ) { global pool recycle ( segment ) ; } global pool recycle memory segments ( exclusive segments ) ; assert true ( global pool available future is done ( ) ) ; for ( completable future < ? > local pool available future : local pool available futures ) { assert true ( local pool available future is done ( ) ) ; } / / wait until all blocking buffer requests finish latch await ( ) ; assert null ( cause get ( ) ) ; assert equals ( 0 , global pool get number of available memory segments ( ) ) ; assert false ( global pool get available future ( ) is done ( ) ) ; for ( buffer pool local pool : local buffer pools ) { assert false ( local pool get available future ( ) is done ( ) ) ; assert equals ( local pool max size , local pool best effort get num of used buffers ( ) ) ; } / / recycle all the requested buffers for ( buffer builder buffer builder : segments requested ) { buffer builder create buffer consumer ( ) close ( ) ; } } finally { for ( buffer pool buffer pool : local buffer pools ) { buffer pool lazy destroy ( ) ; } executor service shutdown ( ) ; global pool destroy ( ) ; } }


public kind get kind ( ) { return generating rule get rule class object ( ) get output file kind ( ) ; }


creates a bit matrix by sampling the provided image top left , top right , bottom right , and bottom left are the centers of the squares on the diagonal just outside the bull ' s eye

private bit matrix sample grid ( bit matrix image , result point top left , result point top right , result point bottom right , result point bottom left ) throws not found exception { grid sampler sampler = grid sampler get instance ( ) ; int dimension = get dimension ( ) ; float low = dimension / 2 0f - nb center layers ; float high = dimension / 2 0f + nb center layers ; return sampler sample grid ( image , dimension , dimension , low , low , / / topleft high , low , / / topright high , high , / / bottomright low , high , / / bottomleft top left get x ( ) , top left get y ( ) , top right get x ( ) , top right get y ( ) , bottom right get x ( ) , bottom right get y ( ) , bottom left get x ( ) , bottom left get y ( ) ) ; }


public static void print ascii art warning ( final logger out , final string additional ) { val ascii = ' \ n ' + " \ n " + " / | / \ \ | \ \ | | \ n " + " \ \ \ \ | | | | | | | ) | | \ n " + " ) | | | | | | | / | | \ n " + " | / | | \ \ / | | ( ) \ n " + " \ n " ; out warn ( ascii art logger marker , ansi cyan ) ; out warn ( ascii art logger marker , " \ n \ n " concat ( ascii ) concat ( additional ) ) ; out warn ( ascii art logger marker , ansi reset ) ; }


protected void configure windows live client ( final collection < indirect client > properties ) { val pac 4j properties = cas properties get authn ( ) get pac 4j ( ) ; val live = pac 4j properties get windows live ( ) ; if ( live is enabled ( ) & & string utils is not blank ( live get id ( ) ) & & string utils is not blank ( live get secret ( ) ) ) { val client = new windows live client ( live get id ( ) , live get secret ( ) ) ; configure client ( client , live ) ; logger debug ( " created client [ { } ] with identifier [ { } ] " , client get name ( ) , client get key ( ) ) ; properties add ( client ) ; } }


removes acl entries from files and directories other acl entries are retained

public void remove acl entries ( final path path , final list < acl entry > acl spec ) throws i o exception { statistics increment write ops ( 1 ) ; list < com microsoft azure datalake store acl acl entry > ms acl entries = new array list < com microsoft azure datalake store acl acl entry > ( ) ; for ( acl entry acl entry : acl spec ) { ms acl entries add ( com microsoft azure datalake store acl acl entry parse acl entry ( acl entry to string ( ) , true ) ) ; } adl client remove acl entries ( to relative file path ( path ) , ms acl entries ) ; }


helper method that creates update entry for the given shard id if such an entry does not exist yet

private updates changes ( shard id shard id ) { return shard changes compute if absent ( shard id , k - > new updates ( ) ) ; }


adds a normalized key containing the normalized number of bits and m s bs of the given record 1 bit determines the sign ( negative , zeropositive ) , 31 bit the bit length of the record remaining bytes contain the most significant bits of the record

public void put normalized key ( big integer record , memory segment target , int offset , int len ) { / / add normalized bit length ( the larger the length , the larger the value ) int bit len = 0 ; if ( len > 0 ) { final int signum = record signum ( ) ; bit len = record bit length ( ) ; / / normalize dependent on sign / / from 0 to integer max / / or from integer max to 0 int norm bit len = signum < 0 ? integer max value - bit len : bit len ; / / add sign if ( signum > = 0 ) { norm bit len | = ( 1 < < 31 ) ; } for ( int i = 0 ; i < 4 & & len > 0 ; i + + , len - - ) { final byte b = ( byte ) ( norm bit len > > > ( 8 * ( 3 - i ) ) ) ; target put ( offset + + , b ) ; } } / / fill remaining bytes with most significant bits int bit pos = bit len - 1 ; for ( ; len > 0 ; len - - ) { byte b = 0 ; for ( int byte pos = 0 ; byte pos < 8 & & bit pos > = 0 ; byte pos + + , bit pos - - ) { b < < = 1 ; if ( record test bit ( bit pos ) ) { b | = 1 ; } } / / the last byte might be partially filled , but that ' s ok within an equal bit length / / no need for padding bits target put ( offset + + , b ) ; } }


writes the contents of this instance as either a binary or a human - readable form , or both

public void write to ( output stream out , writer human out , boolean verbose ) throws i o exception { boolean annotate = ( human out ! = null ) ; byte array annotated output result = to dex 0 ( annotate , verbose ) ; if ( out ! = null ) { out write ( result get array ( ) ) ; } if ( annotate ) { result write annotations to ( human out ) ; } }


static void write int ( int value , data output stream out ) throws i o exception { int writable u int = tl data get ( ) u int ; u int set ( value ) ; u int write ( out ) ; }


returns a list of all selected users in the table

list < string > get selected users ( ) { list < string > users = new array list < > ( ) ; int [ ] selected rows = table get selected rows ( ) ; for ( int i = 0 ; i < selected rows length ; i + + ) { user user = table model get row object ( selected rows [ i ] ) ; users add ( user get name ( ) ) ; } return users ; }


returns an immutable multiset entry with the specified element and count the entry will be serializable if { @ code e } is

public static < e > multiset entry < e > immutable entry ( @ nullable e e , int n ) { return new immutable entry < e > ( e , n ) ; }


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


returns a list of the current script directories

public static list < resource file > get script source directories ( ) { return bundle host get bundle files ( ) stream ( ) filter ( resource file : : is directory ) collect ( collectors to list ( ) ) ; }


releases an instance of the given value the instance must have been obtained from { @ link # get ( object ) } otherwise will throw illegal argument exception caller must not release a reference more than once it ' s advised that you clear the reference to the instance with the null returned by this method

public v release ( k key , v value ) { check not null ( key , " key " ) ; check not null ( value , " value " ) ; return release internal ( key , value ) ; }


specifies what type of requested indices to ignore and how to deal wild wildcard expressions for example indices that don ' t exist

public close index request indices options ( indices options indices options ) { this indices options = indices options ; return this ; }


note that a file was committed increase the counter of files and total size if there is room in the committed files list , the file will be added to the list and so end up in the success file

public synchronized void upload committed ( string key , long size ) { if ( committed objects size ( ) < success marker file limit ) { committed objects add ( key starts with ( " / " ) ? key : ( " / " + key ) ) ; } committed object count + + ; committed bytes + = size ; }


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

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


return the transfer data with the given data flavor

public synchronized object get transfer data ( data flavor f ) throws unsupported flavor exception , i o exception { if ( f equals ( local markup item flavor ) ) { return markup item ; } throw new unsupported flavor exception ( f ) ; }


adds all the given entries to the built map duplicate keys , according to the comparator ( which might be the keys ' natural order ) , are not allowed , and will cause { @ link # build } to fail

public builder < k , v > put all ( iterable < ? extends entry < ? extends k , ? extends v > > entries ) { super put all ( entries ) ; return this ; }


an id that uniquely identifies an allocation

public allocation id allocation id ( ) { return this allocation id ; }


returns indexing routing for the given index

public string resolve index routing ( @ nullable string routing , string alias or index ) { if ( alias or index = = null ) { return routing ; } index abstraction result = get indices lookup ( ) get ( alias or index ) ; if ( result = = null | | result get type ( ) ! = index abstraction type alias ) { return routing ; } if ( result get indices ( ) size ( ) > 1 ) { reject single index operation ( alias or index , result ) ; } return resolve routing ( routing , alias or index , alias metadata get first alias metadata ( result ) ) ; }


return the count of all of the unnamed parameters in the sql statement

int get unnamed parameter count ( ) { return this unnamed parameter count ; }


test passing null to { @ link score sort builder # order ( sort order ) } is illegal

public void test illegal order ( ) { exception e = expect throws ( null pointer exception class , ( ) - > new score sort builder ( ) order ( null ) ) ; assert equals ( " sort order cannot be null " , e get message ( ) ) ; }


public void validate field ( string name , object field ) throws illegal argument exception ;


return true if any storage type consumption information is available

public boolean is type consumed available ( ) { if ( type consumed ! = null ) { for ( storage type t : storage type get types supporting quota ( ) ) { if ( type consumed [ t ordinal ( ) ] > 0l ) { return true ; } } } return false ; }


unregister the { @ link request dispatcher } with the given name

public void unregister named dispatcher ( string name ) { assert not null ( name , " request dispatcher name must not be null " ) ; this named request dispatchers remove ( name ) ; }


public static void modify ldap entry ( final l d a p connection server con , final string dn , final ldap attribute attr , final attribute modification type add , final bind connection initializer conn init ) { val address = " ldap : / / " + server con get connected address ( ) + ' : ' + server con get connected port ( ) ; val config = new connection config ( address ) ; if ( conn init ! = null ) { config set connection initializers ( conn init ) ; } logger debug ( " created modification request connection configuration [ { } ] for [ { } ] " , config , address ) ; val connection factory = new default connection factory ( config ) ; try { val modify = new modify operation ( connection factory ) ; val request = new modify request ( dn , new attribute modification ( add , attr ) ) ; logger debug ( " executing modification request [ { } ] with type [ { } ] for [ { } ] " , request , add , dn ) ; modify execute ( request ) ; } catch ( final exception e ) { logger debug ( e get message ( ) , e ) ; } finally { connection factory close ( ) ; } }


get the default api client , which would be used when creating api instances without providing an api client

public static api client get default api client ( ) { return default api client ; }


enables the helper must be called from the playback thread

public void enable ( ) { have sync = false ; if ( window manager ! = null ) { vsync sampler add observer ( ) ; if ( display listener ! = null ) { display listener register ( ) ; } update default display refresh rate params ( ) ; } }


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


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


the hdfs block pool id for this namespace

public string get block pool id ( ) { return this block pool id ; }


executes a high - level handshake using the given connection and returns the discovery node of the node the connection was established with the handshake will fail if the cluster name on the target node doesn ' t match the local cluster name the action listener will be called on the calling thread or the generic thread pool

public void handshake ( final transport connection connection , final time value handshake timeout , predicate < cluster name > cluster name predicate , final action listener < handshake response > listener ) { final discovery node node = connection get node ( ) ; send request ( connection , handshake action name , handshake request instance , transport request options timeout ( handshake timeout ) , new action listener response handler < > ( new action listener < > ( ) { @ override public void on response ( handshake response response ) { if ( cluster name predicate test ( response cluster name ) = = false ) { listener on failure ( new illegal state exception ( " handshake with [ " + node + " ] failed : remote cluster name [ " + response cluster name value ( ) + " ] does not match " + cluster name predicate ) ) ; } else if ( response version is compatible ( local node get version ( ) ) = = false ) { listener on failure ( new illegal state exception ( " handshake with [ " + node + " ] failed : remote node version [ " + response version + " ] is incompatible with local node version [ " + local node get version ( ) + " ] " ) ) ; } else { listener on response ( response ) ; } } @ override public void on failure ( exception e ) { listener on failure ( e ) ; } } , handshake response : : new , thread pool names generic ) ) ; }


overrides all values in the map by the given map expressions in values will be expanded see { @ link # override ( string , string ) }

public env vars override expanding all ( @ non null map < string , string > all ) { for ( string key : new override order calculator ( this , all ) get ordered variable names ( ) ) { override ( key , expand ( all get ( key ) ) ) ; } return this ; }


< code > optional aapt pb styled string styled str = 4 ; < code >

public builder set styled str ( com android aapt resources styled string builder builder for value ) { copy on write ( ) ; instance set styled str ( builder for value ) ; return this ; }


specify the uri starting with a uri template and finishing off with a { @ link uri builder } created from the template

s uri ( string uri , function < uri builder , uri > uri function ) ;


retrieve a combined result from the field values of the e tag header

protected list < string > get e tag values as list ( string header name ) { list < string > values = get ( header name ) ; if ( values ! = null ) { list < string > result = new array list < > ( ) ; for ( string value : values ) { if ( value ! = null ) { matcher matcher = etag header value pattern matcher ( value ) ; while ( matcher find ( ) ) { if ( " * " equals ( matcher group ( ) ) ) { result add ( matcher group ( ) ) ; } else { result add ( matcher group ( 1 ) ) ; } } if ( result is empty ( ) ) { throw new illegal argument exception ( " could not parse header ' " + header name + " ' with value ' " + value + " ' " ) ; } } } return result ; } return collections empty list ( ) ; }


returns the deadline or { @ code null } if the deadline is not set

public deadline get deadline ( ) { return deadline ; }


a sensible definition of { @ link # poll first entry } in terms of the { @ code iterator } of the { @ code entry set } of { @ code descending map } if you override { @ code descending map } , you may wish to override { @ code poll first entry } to forward to this implementation

protected entry < k , v > standard poll last entry ( ) { return iterators poll next ( descending map ( ) entry set ( ) iterator ( ) ) ; }


updates remaining retries and the restart time when required in the retry context when failures validity interval is { @ literal > } 0 , it also removes time entries from < code > restart times < code > which are outside the validity interval

protected void update retry context ( retry context retry context ) { if ( retry context container retry context get failures validity interval ( ) > 0 ) { container retry context container r c = retry context container retry context ; iterator < long > iterator = retry context get restart times ( ) iterator ( ) ; long current time = clock get time ( ) ; while ( iterator has next ( ) ) { long restart time = iterator next ( ) ; if ( current time - restart time > container r c get failures validity interval ( ) ) { iterator remove ( ) ; } else { break ; } } retry context set remaining retries ( container r c get max retries ( ) - retry context restart times size ( ) ) ; retry context get restart times ( ) add ( current time ) ; } else { retry context remaining retries - - ; } }


uses the { @ link debugger } to get the bytecode output for a script and compare it against an expected bytecode passed in as a string

public void assert bytecode exists ( string script , string bytecode ) { final string asm = debugger to string ( script ) ; assert true ( " bytecode not found , got : \ n " + asm , asm contains ( bytecode ) ) ; }


creates a { @ link fingerprint trust manager factory }

public fingerprint trust manager factory build ( ) { if ( fingerprints is empty ( ) ) { throw new illegal state exception ( " no fingerprints provided " ) ; } return new fingerprint trust manager factory ( this algorithm , fingerprint trust manager factory to fingerprint array ( this fingerprints ) ) ; }


returns whether the comments are the same

public boolean is same ( object obj 1 , object obj 2 ) { address a 1 = ( address ) obj 1 ; address a 2 = ( address ) obj 2 ; string c 1 = comparator listing 1 get comment ( type , a 1 ) ; string c 2 = comparator listing 2 get comment ( type , a 2 ) ; return system utilities is equal ( c 1 , c 2 ) ; }


public static object get internal state ( object target , string field ) { class < ? > c = target get class ( ) ; try { field f = get field from hierarchy ( c , field ) ; f set accessible ( true ) ; return f get ( target ) ; } catch ( exception e ) { throw new runtime exception ( " unable to set internal state on a private field " , e ) ; } }


for internal use within a transport handler and the ( transport handler - specific ) session class

protected void write frame ( sock js frame frame ) throws sock js transport failure exception { if ( logger is trace enabled ( ) ) { logger trace ( " preparing to write " + frame ) ; } try { write frame internal ( frame ) ; } catch ( exception ex ) { log write frame failure ( ex ) ; try { / / force disconnect ( so we won ' t try to send close frame ) disconnect ( close status server error ) ; } catch ( throwable disconnect failure ) { / / ignore } try { close ( close status server error ) ; } catch ( throwable close failure ) { / / nothing of consequence , already forced disconnect } throw new sock js transport failure exception ( " failed to write " + frame , get id ( ) , ex ) ; } }


install tinker with default config , you must install tinker before you use their api or you can just use { @ link tinker application helper } ' s api

public static tinker install ( application like application like ) { tinker tinker = new tinker builder ( application like get application ( ) ) build ( ) ; tinker create ( tinker ) ; tinker install ( application like get tinker result intent ( ) ) ; return tinker ; }


default void bundle built ( ghidra bundle bundle , string summary ) { / / }


unshuffles the current play queue if a backup play queue exists this method undoes shuffling and index will be set to the previously playing item if found , otherwise , the index will reset to 0 will emit a { @ link reorder event } if a backup exists

public synchronized void unshuffle ( ) { if ( backup = = null ) { return ; } final int origin index = get index ( ) ; final play queue item current = get item ( ) ; streams clear ( ) ; streams = backup ; backup = null ; final int new index = streams index of ( current ) ; if ( new index ! = - 1 ) { queue index set ( new index ) ; } else { queue index set ( 0 ) ; } if ( streams size ( ) > queue index get ( ) ) { history add ( streams get ( queue index get ( ) ) ) ; } broadcast ( new reorder event ( origin index , queue index get ( ) ) ) ; }


creates a config option without a default value

public config option < t > no default value ( ) { return new config option < > ( key , clazz , description builder ( ) text ( " " ) build ( ) , null , false ) ; }


called when the given < code > data type manager < code > ' s cache has been invalidated

public void data type manager invalidated ( data type manager data type manager ) ;


public api response < void > test json form data with http info ( string param , string param 2 ) throws api exception { http request builder local var request builder = test json form data request builder ( param , param 2 ) ; try { http response < input stream > local var response = member var http client send ( local var request builder build ( ) , http response body handlers of input stream ( ) ) ; if ( member var response interceptor ! = null ) { member var response interceptor accept ( local var response ) ; } if ( local var response status code ( ) / 100 ! = 2 ) { throw new api exception ( local var response status code ( ) , " test json form data call received non - success response " , local var response headers ( ) , local var response body ( ) = = null ? null : new string ( local var response body ( ) read all bytes ( ) ) ) ; } return new api response < void > ( local var response status code ( ) , local var response headers ( ) map ( ) , null ) ; } catch ( i o exception e ) { throw new api exception ( e ) ; } catch ( interrupted exception e ) { thread current thread ( ) interrupt ( ) ; throw new api exception ( e ) ; } }


indicates if the total hit count for the query should be tracked

public search source builder track total hits ( boolean track total hits ) { this track total hits up to = track total hits ? track total hits accurate : track total hits disabled ; return this ; }


public void add option with value ( string option ) { if ( options contains key ( option ) ) { throw new duplicated option exception ( option ) ; } options with value put ( option , null ) ; }


reads the full contents of this byte source as a byte array

byte [ ] read ( ) throws i o exception ;


unlike { @ link # clazz } , return the parameter type ' t ' , which determines the { @ link descriptor extension list } that this goes to in those situations where subtypes cannot provide the type parameter , this method can be overridden to provide it

public class < t > get t ( ) { type sub typing = types get base class ( get class ( ) , descriptor class ) ; if ( ! ( sub typing instanceof parameterized type ) ) { throw new illegal state exception ( get class ( ) + " doesn ' t extend descriptor with a type parameter " ) ; } return types erasure ( types get type argument ( sub typing , 0 ) ) ; }


returns last { @ link i o exception } occurred during loading or playing gif ( in such case only { @ link gif i o exception } can be returned null is returned when source is not set , surface was not yet created or no error occurred

public i o exception get i o exception ( ) { if ( m render thread m i o exception ! = null ) { return m render thread m i o exception ; } else { return gif i o exception from code ( m render thread m gif info handle get native error code ( ) ) ; } }


public set < multifactor authentication trust record > get record for principal ( final string principal ) { val keys = new hash map < string , attribute value > ( ) ; keys put ( column names principal get column name ( ) , attribute value builder ( ) s ( string value of ( principal ) ) build ( ) ) ; return get records by keys ( keys , comparison operator eq ) ; }


specifies the order of iteration for the elements of { @ link network # edges ( ) } the default value is { @ link element order # insertion ( ) insertion order }

public < e1 extends e > network builder < n , e1 > edge order ( element order < e1 > edge order ) { network builder < n , e1 > new builder = cast ( ) ; new builder edge order = check not null ( edge order ) ; return new builder ; }


returns a { @ link listenable future } representing the asynchronous evaluation of this { @ link target pattern } that feeds the results to the given { @ code callback } if the returned { @ link listenable future } ' s { @ link listenable future # get } throws an { @ link execution exception } , the cause will be an instance of either { @ link target parsing exception } or the given { @ code exception class }

public < t , e extends exception > listenable future < void > eval async ( target pattern resolver < t > resolver , immutable set < path fragment > ignored subdirectories , immutable set < path fragment > excluded subdirectories , batch callback < t , e > callback , class < e > exception class , listening executor service executor ) { return eval adapted for async ( resolver , ignored subdirectories , excluded subdirectories , callback , exception class ) ; }


create a mapping of rules based on rule type and family

private void create rule mapping ( iterable < rule documentation > doc entries , map < string , list multimap < rule type , rule documentation > > rule mapping ) throws build encyclopedia doc exception { for ( rule documentation rule doc : doc entries ) { rule class rule class = rule class provider get rule class map ( ) get ( rule doc get rule name ( ) ) ; if ( rule class ! = null ) { string rule family = rule doc get rule family ( ) ; if ( ! rule mapping contains key ( rule family ) ) { rule mapping put ( rule family , linked list multimap < rule type , rule documentation > create ( ) ) ; } if ( rule class is documented ( ) ) { rule mapping get ( rule family ) put ( rule doc get rule type ( ) , rule doc ) ; } } else { throw rule doc create exception ( " can ' t find rule class for " + rule doc get rule name ( ) ) ; } } }


mask out all but the lowest { @ code n } bits of the value

public masked long unknown extend ( int n ) { long new msk = zero extend ( this msk , n ) ; long new val = zero extend ( this val , n ) ; return from mask and value ( new msk , new val ) ; }


upgrades the generation stamp for the filesystem by reserving a sufficient range for all existing blocks should be invoked only during the first upgrade to sequential block i ds

public long upgrade legacy generation stamp ( ) { preconditions check state ( generation stamp get current value ( ) = = generation stamp last reserved stamp ) ; generation stamp skip to ( legacy generation stamp get current value ( ) + hdfs server constants reserved legacy generation stamps ) ; legacy generation stamp limit = generation stamp get current value ( ) ; return generation stamp get current value ( ) ; }


public void update pet ( pet body ) { / / todo : implement }


{ @ inherit doc } the default implementation does nothing

@ override public void exit query specification ( sql base parser query specification context ctx ) { }


returns the string " expression " after expanding all embedded references to " make " variables if any errors are encountered , they are reported , and " expression " is returned unchanged

public string expand ( @ nullable string attribute name , string expression ) { try { expansion expansion = template expander expand ( expression , template context ) ; looked up variables add all ( expansion looked up variables ( ) ) ; return expansion expansion ( ) ; } catch ( expansion exception e ) { if ( attribute name = = null ) { rule context rule error ( e get message ( ) ) ; } else { rule context attribute error ( attribute name , e get message ( ) ) ; } return expression ; } }


public string to json ( logging event event ) throws i o exception { string writer writer = new string writer ( ) ; to json ( writer , event ) ; return writer to string ( ) ; }


tests that the user cannot set an equate on a scalar that is undefined ( the equate option is not made available )

public void test undefined data ( ) { / / first put the cursor at a location with known scalar data put cursor on operand ( 0x 0 1 0 0 6 2d 6 , 1 ) ; / / verify that the set equate option is available assert true ( set action is enabled for context ( get listing context ( ) ) ) ; / / now call the clear ( ) function to set the data to undefined ( " ? ? " ) clear cmd cmd = new clear cmd ( new address set ( addr ( 0x 0 1 0 0 6 2d 6 ) ) ) ; apply cmd ( program , cmd ) ; / / verify that the menu option for setting an equate is not enabled assert true ( ! set action is enabled for context ( get listing context ( ) ) ) ; }


returns an array containing each value of { @ code collection } , converted to a { @ code long } value in the manner of { @ link number # long value } elements are copied from the argument collection as if by { @ code collection to array ( ) } calling this method is as thread - safe as calling that method

public static long [ ] to array ( collection < ? extends number > collection ) { if ( collection instanceof long array as list ) { return ( ( long array as list ) collection ) to long array ( ) ; } object [ ] boxed array = collection to array ( ) ; int len = boxed array length ; long [ ] array = new long [ len ] ; for ( int i = 0 ; i < len ; i + + ) { / / check not null for gwt ( do not optimize ) array [ i ] = ( ( number ) check not null ( boxed array [ i ] ) ) long value ( ) ; } return array ; }


returns a newly - created immutable bimap the iteration order of the returned bimap is the order in which entries were inserted into the builder , unless { @ link # order entries by value } was called , in which case entries are sorted by value

public immutable bi map < k , v > build ( ) { if ( size = = 0 ) { return of ( ) ; } sort entries ( ) ; entries used = true ; return new regular immutable bi map < k , v > ( alternating keys and values , size ) ; }


public string get data log dir ( ) { return data log dir ; }


binds this index array for rendering with gl draw elements


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

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


public final bulk by scroll response delete by query ( delete by query request delete by query request , request options options ) throws i o exception { return perform request and parse entity ( delete by query request , request converters : : delete by query , options , bulk by scroll response : : from x content , singleton ( 409 ) ) ; }


the { @ link process instance history log } will contain the { @ link historic variable update } instances

process instance history log query include variable updates ( ) ;


creates a new listenable future - style stub that supports unary calls on the service

public static aggregated discovery service future stub new future stub ( io grpc channel channel ) { io grpc stub abstract stub stub factory < aggregated discovery service future stub > factory = new io grpc stub abstract stub stub factory < aggregated discovery service future stub > ( ) { @ java lang override public aggregated discovery service future stub new stub ( io grpc channel channel , io grpc call options call options ) { return new aggregated discovery service future stub ( channel , call options ) ; } } ; return aggregated discovery service future stub new stub ( factory , channel ) ; }


find a { @ link litho view } containing a component with the provided test key note that this finds any { @ link litho view } containing a mounted component with that key and there ' s currently no way to be more specific

public static matcher < view > with test key ( final string test key ) { return litho view ( new type safe matcher < litho view > ( ) { @ override protected boolean matches safely ( litho view litho view ) { return litho view test helper find test item ( litho view , test key ) ! = null ; } @ override public void describe to ( description description ) { description append text ( string format ( " could not find an item with test key ' % s ' within the given litho view " , test key ) ) ; } } ) ; }


return true if undefined data exists at the given address ; return false if code unit exists , thus editing is not allowed

private boolean edit allowed ( address addr , long length ) { listing listing = program get listing ( ) ; address a = addr ; for ( int i = 0 ; i < length ; i + + ) { try { a = a add no wrap ( i ) ; } catch ( address overflow exception e ) { return false ; } code unit cu = listing get code unit containing ( a ) ; if ( cu instanceof data ) { continue ; } return false ; } return true ; }


initiate a duration tracking operation by creatingreturning an object whose { @ code close ( ) } call will update the statistics the statistics counter with the key name will be incremented by the given count the expected use is within a try - with - resources clause

duration tracker track duration ( string key , long count ) ;


puts a keyvalue pair into the array , optimizing for the case where the key is greater than all existing keys in the array

public void append ( int key , e value ) { if ( m size ! = 0 & & key < = m keys [ m size - 1 ] ) { put ( key , value ) ; return ; } if ( m garbage & & m size > = m keys length ) { gc ( ) ; } int pos = m size ; if ( pos > = m keys length ) { int n = container helpers ideal int array size ( pos + 1 ) ; int [ ] nkeys = new int [ n ] ; object [ ] nvalues = new object [ n ] ; / / log e ( " sparse array " , " grow " + m keys length + " to " + n ) ; system arraycopy ( m keys , 0 , nkeys , 0 , m keys length ) ; system arraycopy ( m values , 0 , nvalues , 0 , m values length ) ; m keys = nkeys ; m values = nvalues ; } m keys [ pos ] = key ; m values [ pos ] = value ; m size = pos + 1 ; }


count number of records of the original { @ link k table } that got { @ link k table # group by ( key value mapper ) mapped } to the same key into a new instance of { @ link k table } records with { @ code null } key are ignored the result is written into a local { @ link key value store } ( which is basically an ever - updating materialized view ) that can be queried using the provided { @ code queryable store name } furthermore , updates to the store are sent downstream into a { @ link k table } changelog stream not all updates might get sent downstream , as an internal cache is used to deduplicate consecutive updates to the same key the rate of propagated updates depends on your input data rate , the number of distinct keys , the number of parallel running kafka streams instances , and the { @ link streams config configuration } parameters for { @ link streams config # cache max bytes buffering config cache size } , and { @ link streams config # commit interval ms config commit interval } to query the local { @ link read only key value store } it must be obtained via { @ link kafka streams # store ( store query parameters ) kafka streams # store ( ) } : { @ code kafka streams streams = counting words read only key value store < k , value and timestamp < long > > local store = streams store ( queryable store name , queryable store types < k , value and timestamp < long > > timestamped key value store ( ) ) ; k key = " some - word " ; value and timestamp < long > count for word = local store get ( key ) ; key must be local ( application state is shared over all running kafka streams instances ) } for non - local keys , a custom rpc mechanism must be implemented using { @ link kafka streams # all metadata ( ) } to query the value of the key on a parallel running instance of your kafka streams application for failure and recovery the store will be backed by an internal changelog topic that will be created in kafka therefore , the store name defined by the materialized instance must be a valid kafka topic name and cannot contain characters other than ascii alphanumerics , ' ' , ' ' and ' - ' the changelog topic will be named " $ { application id } - $ { store name } - changelog " , where " application id " is user - specified in { @ link streams config } via parameter { @ link streams config # application id config application id config } , " store name " is the provide store name defined in { @ code materialized } , and " - changelog " is a fixed suffix you can retrieve all generated internal topic names via { @ link topology # describe ( ) }

k table < k , long > count ( final named named , final materialized < k , long , key value store < bytes , byte [ ] > > materialized ) ;


public int get width ( ) { / / if not auto resize , return preset width if ( ! is auto resize ) { return width ; } / / if it ' s auto resize , then calculate the possible max width int max width = 0 ; for ( string data : rows ) { max width = max ( width ( data ) , max width ) ; } return max width ; }


convenient call for { @ link abstract dao # delete ( object ) }

public < t > void delete ( t entity ) { @ suppress warnings ( " unchecked " ) abstract dao < t , ? > dao = ( abstract dao < t , ? > ) get dao ( entity get class ( ) ) ; dao delete ( entity ) ; }


public void reopen probe ( mutable object iterator < v1 > probe input ) throws i o exception { reopen hash table reopen probe ( probe input ) ; }


test a field that has a negative value for value count with ignore malformed = true no exception will be thrown but the field will be ignored

public void test negative value count ignore malformed ( ) throws exception { document mapper mapper = create document mapper ( field mapping ( b - > b field ( " type " , content type ) field ( metrics field , new string [ ] { " value count " } ) field ( " ignore malformed " , true ) ) ) ; parsed document doc = mapper parse ( source ( b - > b start object ( " field " ) field ( " value count " , - 14 ) end object ( ) ) ) ; assert that ( doc root doc ( ) get field ( " field value count " ) , null value ( ) ) ; }


gets the end offset of this constant pool in the { @ code byte [ ] } which it came from

public int get end offset ( ) { parse if necessary ( ) ; return end offset ; }


sync the given { @ link file output stream }

public void sync ( @ nullable fs volume spi volume , file output stream fos ) throws i o exception { final long begin = profiling event hook before file io ( volume , sync , 0 ) ; try { fault injector event hook before file io ( volume , sync , 0 ) ; i o utils fsync ( fos get channel ( ) , false ) ; profiling event hook after file io ( volume , sync , begin , 0 ) ; } catch ( exception e ) { on failure ( volume , begin ) ; throw e ; } }


return a descriptive name for the given object ' s type : usually simply the class name , but component type class name + " [ ] " for arrays , and an appended list of implemented interfaces for jdk proxies

public static string get descriptive type ( @ nullable object value ) { if ( value = = null ) { return null ; } class < ? > clazz = value get class ( ) ; if ( proxy is proxy class ( clazz ) ) { string prefix = clazz get name ( ) + " implementing " ; string joiner result = new string joiner ( " , " , prefix , " " ) ; for ( class < ? > ifc : clazz get interfaces ( ) ) { result add ( ifc get name ( ) ) ; } return result to string ( ) ; } else { return clazz get type name ( ) ; } }


method strip white space removes all blanks and control characters from the original string

public static string strip white space ( string original ) { if ( original = = null ) { return null ; } int length = original length ( ) ; char [ ] result = new char [ length ] ; int orig index = 0 ; int result index = 0 ; for ( ; orig index < length ; orig index + + ) { / / don ' t keep blanks or control characters which are less than a blank char c = original char at ( orig index ) ; if ( c > ' ' ) { result [ result index + + ] = c ; } } return new string ( result , 0 , result index ) ; }


returns the given list of line numbers , without the ones that have empty code blocks or that exceed the code size

private int remove empty line numbers ( line number info [ ] line number infos , int line number info count , int code length ) { / / overwrite all empty line number entries int new index = 0 ; for ( int index = 0 ; index < line number info count ; index + + ) { line number info line number info = line number infos [ index ] ; int start p c = line number info u 2start p c ; if ( start p c < code length & & ( index = = 0 | | start p c > line number infos [ index - 1 ] u 2start p c ) ) { line number infos [ new index + + ] = line number info ; } } return new index ; }


public builder local endpoint ( @ nullable endpoint local endpoint ) { if ( empty endpoint equals ( local endpoint ) ) local endpoint = null ; this local endpoint = local endpoint ; return this ; }


test producer - consumer pattern through the mailbox in a concurrent setting ( n - writer 1 - reader )

private void test put take ( function with exception < task mailbox , mail , interrupted exception > take method ) throws exception { final int num threads = 10 ; final int num mails per thread = 1000 ; final int [ ] results = new int [ num threads ] ; thread [ ] writer threads = new thread [ num threads ] ; for ( int i = 0 ; i < writer threads length ; + + i ) { final int thread id = i ; writer threads [ i ] = new thread ( throwing runnable unchecked ( ( ) - > { for ( int k = 0 ; k < num mails per thread ; + + k ) { task mailbox put ( new mail ( ( ) - > + + results [ thread id ] , default priority , " result " + k ) ) ; } } ) ) ; } for ( thread writer thread : writer threads ) { writer thread start ( ) ; } for ( thread writer thread : writer threads ) { writer thread join ( ) ; } atomic boolean is running = new atomic boolean ( true ) ; task mailbox put ( new mail ( ( ) - > is running set ( false ) , default priority , " poison mail , default priority " ) ) ; while ( is running get ( ) ) { take method apply ( task mailbox ) run ( ) ; } for ( int per thread result : results ) { assert equals ( num mails per thread , per thread result ) ; } }


sets the output buffer to be rendered the renderer is responsible for releasing the buffer

void set output buffer ( video decoder output buffer output buffer ) ;


convert an array of tags to the equivalent proto - generated enum values the proto type is duplicate in order to not burden the options parser with the proto dependency a test guarantees that the two enum types are kept in sync with matching indices

static list < option filters option effect tag > get proto effect tags ( option effect tag [ ] tag array ) { array list < option filters option effect tag > effect tags = new array list < > ( tag array length ) ; for ( option effect tag tag : tag array ) { effect tags add ( option filters option effect tag for number ( tag get value ( ) ) ) ; } return effect tags ; }


show a snack bar and only call { @ link error activity # report error ( context , list , class , view , error info ) } if we a find a valid view ( otherwise the error screen appears )

public void show snack bar error ( final list < throwable > exception , final user action user action , final string service name , final string request , @ string res final int error id ) { if ( debug ) { log d ( tag , " show snack bar error ( ) called with : " + " exception = [ " + exception + " ] , user action = [ " + user action + " ] , " + " request = [ " + request + " ] , error id = [ " + error id + " ] " ) ; } view root view = activity ! = null ? activity find view by id ( android r id content ) : null ; if ( root view = = null & & get view ( ) ! = null ) { root view = get view ( ) ; } if ( root view = = null ) { return ; } error activity report error ( get context ( ) , exception , main activity class , root view , error info make ( user action , service name , request , error id ) ) ; }


returns the strategies applying to the given spawn , in priority order which strategies are returned is based on the precedence as documented on the construction methods of { @ linkplain builder this registry ' s builder } if the reason for selecting the context is worth mentioning to the user , logs a message using the given { @ link reporter }

public list < ? extends spawn strategy > get strategies ( spawn spawn , event handler reporter ) { / / don ' t override test strategies by - - strategy regexp for backwards compatibility if ( spawn get resource owner ( ) ! = null & & ! " test runner " equals ( spawn get mnemonic ( ) ) ) { string description = spawn get resource owner ( ) get progress message ( ) ; if ( description ! = null ) { for ( map entry < regex filter , collection < spawn strategy > > filter strategies : filter to strategies as map ( ) entry set ( ) ) { if ( filter strategies get key ( ) is included ( description ) ) { / / todo ( schmitt ) : why is this done here and not after running can exec ? reporter handle ( event progress ( description + " with context " + filter strategies get value ( ) ) ) ; return immutable list copy of ( filter strategies get value ( ) ) ; } } } } if ( mnemonic to strategies contains key ( spawn get mnemonic ( ) ) ) { return mnemonic to strategies get ( spawn get mnemonic ( ) ) ; } return default strategies ; }


public watcher service request builder start ( ) { request start ( ) ; return this ; }


start an activity this method is defined to allow different methods of activity starting for newer versions of android and for compatibility library

protected void start activity for result ( intent intent , int code ) { if ( fragment = = null ) { activity start activity for result ( intent , code ) ; } else { fragment start activity for result ( intent , code ) ; } }


returns whether this bounding box is valid this means that { @ link # max } is greater than or equal to { @ link # min }

public boolean is valid ( ) { return min x < = max x & & min y < = max y & & min z < = max z ; }


handle an error sending the prepared request when a network error occurs , we close any existing fetch session on our next request , and try to create a new session

public void handle error ( throwable t ) { log info ( " error sending fetch request { } to node { } : " , next metadata , node , t ) ; next metadata = next metadata next close existing ( ) ; }


protected synchronized void close ( ) { long time since last active = time unit milliseconds to seconds ( time now ( ) - get last active time ( ) ) ; log debug ( " shutting down connection pool \ " { } \ " used { } seconds ago " , this connection pool id , time since last active ) ; for ( connection context connection : this connections ) { connection close ( ) ; } this connections clear ( ) ; }


determine if the message { @ code start } ' s content length is known , and if it greater than { @ code max content length }

protected abstract boolean is content length invalid ( s start , int max content length ) throws exception ;


simulates a scenario where the data node has been reconfigured with fewer mover threads , but all of the current treads are busy and therefore the data node is unable to honor this request within a reasonable amount of time the data node eventually gives up and returns a flag indicating that the request was not honored

public void test failed decrease concurrent movers ( ) throws i o exception , reconfiguration exception { final data node [ ] dns = create d ns for test ( 1 ) ; final data node data node = dns [ 0 ] ; try { / / set the current max to 2 data node xserver update balancer max concurrent movers ( 2 ) ; / / simulate grabbing 2 threads data node xserver balance throttler acquire ( ) ; data node xserver balance throttler acquire ( ) ; data node xserver set max reconfigure wait time ( 1 ) ; / / attempt to set new maximum to 1 final boolean success = data node xserver update balancer max concurrent movers ( 1 ) ; assert assert false ( success ) ; } finally { data node shutdown ( ) ; } }


determines whether or not an environment is a default returns false if the environment doesn ' t belong to this group

public boolean is default ( label environment ) { check initialized ( ) ; return defaults contains ( environment ) ; }


returns the generalization of this long value and the given other specific long value

public long value generalize ( specific long value other ) { return this ; }


returns the elements from this fluent iterable that are instances of class { @ code type } < b > { @ code stream } equivalent : < b > { @ code stream filter ( type : : is instance ) map ( type : : cast ) } this does perform a little more work than necessary , so another option is to insert an unchecked cast at some later point : { @ code @ suppress warnings ( " unchecked " ) safe because of : : is instance check immutable list < new type > result = ( immutable list ) stream filter ( new type class : : is instance ) collect ( to immutable list ( ) ) ; }

public final < t > fluent iterable < t > filter ( class < t > type ) { return from ( iterables filter ( get delegate ( ) , type ) ) ; }


apply the given customizers to the underlying bean definition

public bean definition builder apply customizers ( bean definition customizer customizers ) { for ( bean definition customizer customizer : customizers ) { customizer customize ( this bean definition ) ; } return this ; }


verify permission for a mount point when the actual destination is not present it returns the permissions of the mount point

public void test mount table permissions no dest ( ) throws i o exception { mount table add entry ; add entry = mount table new instance ( " / testdir 1 " , collections singleton map ( " ns 0 " , " / tmp / testdir 1 " ) ) ; add entry set group name ( " group 1 " ) ; add entry set owner name ( " owner 1 " ) ; add entry set mode ( fs permission create immutable ( ( short ) 0775 ) ) ; assert true ( add mount table ( add entry ) ) ; file status [ ] list = router fs list status ( new path ( " / " ) ) ; assert equals ( " group 1 " , list [ 0 ] get group ( ) ) ; assert equals ( " owner 1 " , list [ 0 ] get owner ( ) ) ; assert equals ( ( short ) 0775 , list [ 0 ] get permission ( ) to short ( ) ) ; }


public void consume ( ) throws interrupted exception { var item = queue take ( ) ; logger info ( " consumer [ { } ] consume item [ { } ] produced by [ { } ] " , name , item get id ( ) , item get producer ( ) ) ; }


tests saslscram authentication failure over plaintext with old version of server that does not support sasl authenticate headers and new version of client

public void old sasl scram plaintext server without sasl authenticate header failure ( ) throws exception { verify sasl authenticate header interop with failure ( false , true , security protocol sasl plaintext , " scram - sha - 256 " ) ; }


returns true if the given item is in the collection of possible items

public static < t > boolean is one of ( t t , t possibles ) { for ( t possible : possibles ) { if ( objects equals ( possible , t ) ) { return true ; } } return false ; }


remove the record identified by index this will never be the last record within the node

public void remove ( int index ) throws i o exception { if ( index < 0 | | index > = key count ) throw new assert exception ( ) ; if ( has indirect storage ( index ) ) { remove chained buffer ( buffer get int ( get record data offset ( index ) ) ) ; enable indirect storage ( index , false ) ; } int len = get full record length ( index ) ; move records ( index + 1 , len ) ; int start = header size + ( ( index + 1 ) * entry size ) ; len = ( key count - index - 1 ) * entry size ; buffer move ( start , start - entry size , len ) ; set key count ( key count - 1 ) ; }


this implementation delegates to the load time weaver , if specified

public class loader get new temp class loader ( ) { class loader tcl = ( this load time weaver ! = null ? this load time weaver get throwaway class loader ( ) : new simple throwaway class loader ( this class loader ) ) ; string package to exclude = get persistence provider package name ( ) ; if ( package to exclude ! = null & & tcl instanceof decorating class loader ) { ( ( decorating class loader ) tcl ) exclude package ( package to exclude ) ; } return tcl ; }


< code > merge properties < code > merges user defined property differences within the specified address set

public void merge properties ( address set view origin address set , task monitor monitor ) throws cancelled exception , unsupported operation exception { if ( ! origin to result translator is one for one translator ( ) ) { string message = origin to result translator get class ( ) get name ( ) + " is not a one for one translator and can ' t merge properties " ; throw new unsupported operation exception ( message ) ; } monitor set message ( " applying properties " ) ; if ( origin address set is empty ( ) ) { return ; } / / get the addresses in the set address iterator origin iter = origin address set get addresses ( true ) ; / / get each address in the address set and change the property for ( long count = 0 ; origin iter has next ( ) & & ! monitor is cancelled ( ) ; count + + ) { monitor check canceled ( ) ; address origin address = origin iter next ( ) ; if ( count = = progress counter granularity ) { monitor set message ( " applying properties " + origin address to string ( true ) ) ; count = 0 ; } merge properties at address ( origin address ) ; } }


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


public void test equals and hashcode ( ) { check equals and hash code ( create test item ( random int ( 3 ) ) , nested identity tests : : copy , nested identity tests : : mutate ) ; }


get the block containing the target position

public extended block get current block ( ) { return get d f s input stream ( ) get current block ( ) ; }


encapsulate the logic for deciding whether a change to a normalized score is " big " current logic is that a change is considered big if any of the following criteria are met : the change would result in a change of colour in the ui ( e g severity would be changed from warning to minor ) the change is at least 1 5 the change in values is greater than 67 % of the higher of the two values these values have been chosen through a process of experimentation , in particular it was desired to reduce the number of updates written to the results index due to renormalization events for performance reasons while not changing the normalized scores greatly

private static boolean is big update ( double old val , double new val ) { if ( ( int ) ( old val / 25 0 ) ! = ( int ) ( new val / 25 0 ) ) { return true ; } if ( math abs ( old val - new val ) > = 1 5 ) { return true ; } if ( old val > new val ) { if ( old val * 0 33 > new val ) { return true ; } } else { if ( new val * 0 33 > old val ) { return true ; } } return false ; }


if the jenkins url starts from " https " , force the secure session flag

private void update secure session flag ( ) { try { servlet context context = jenkins get ( ) servlet context ; method m ; try { m = context get class ( ) get method ( " get session cookie config " ) ; } catch ( no such method exception x ) { / / 3 0 + logger log ( level fine , " failed to set secure cookie flag " , x ) ; return ; } object session cookie config = m invoke ( context ) ; class scc = class for name ( " javax servlet session cookie config " ) ; method set secure = scc get method ( " set secure " , boolean class ) ; boolean v = fix null ( jenkins url ) starts with ( " https " ) ; set secure invoke ( session cookie config , v ) ; } catch ( invocation target exception e ) { if ( e get target exception ( ) instanceof illegal state exception ) { / / servlet 3 0 spec seems to prohibit this from getting set at runtime , / / though winstone is happy to accept i see jenkins - 25019 return ; } logger log ( level warning , " failed to set secure cookie flag " , e ) ; } catch ( exception e ) { logger log ( level warning , " failed to set secure cookie flag " , e ) ; } }


returns the value for the removed key , or the default value if the key is not in the map

public long remove ( k key , long default value ) { int i = locate key ( key ) ; if ( i < 0 ) return default value ; k [ ] key table = this key table ; long [ ] value table = this value table ; long old value = value table [ i ] ; int mask = this mask , next = i + 1 & mask ; while ( ( key = key table [ next ] ) ! = null ) { int placement = place ( key ) ; if ( ( next - placement & mask ) > ( i - placement & mask ) ) { key table [ i ] = key ; value table [ i ] = value table [ next ] ; i = next ; } next = next + 1 & mask ; } key table [ i ] = null ; size - - ; return old value ; }


creates a bitmap with the specified width and height its initial density is determined from the given display metrics

public closeable reference < bitmap > create bitmap ( int [ ] colors , int width , int height , bitmap config config , @ nullable object caller context ) { closeable reference < bitmap > bitmap ref = create bitmap internal ( width , height , config ) ; bitmap bitmap = bitmap ref get ( ) ; bitmap set pixels ( colors , 0 , width , 0 , 0 , width , height ) ; return bitmap ref ; }


get the total accumulated task time for all task entries in milliseconds

public long get total time ( ) { if ( total time = = null ) { long sum = 0 ; for ( long t : task times values ( ) ) { sum + = t ; } total time = sum ; } return total time ; }


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


returns a new { @ link transition } for the given arguments if is memory cache is { @ code true } or is first image is { @ code false } , returns a { @ link no transition } and otherwise returns a new { @ link view property transition } for the { @ link view property transition animator } provided in the constructor

public transition < r > build ( data source data source , boolean is first resource ) { if ( data source = = data source memory cache | | ! is first resource ) { return no transition get ( ) ; } if ( animation = = null ) { animation = new view property transition < > ( animator ) ; } return animation ; }


public t remove ( ) { if ( is empty ( ) ) { return null ; } final var root = queue [ 0 ] ; queue [ 0 ] = queue [ size - 1 ] ; size - - ; max heapify down ( ) ; return root ; }


returns the integer text field that has been attached to the spinner

public integer text field get text field ( ) { return integer text field ; }


get the url to advertise to other workers and clients this uses the default connector from the embedded jetty server , unless overrides for advertised hostname andor port are provided via configs { @ link # initialize server ( ) } must be invoked successfully before calling this method

public uri advertised url ( ) { uri builder builder = uri builder from uri ( jetty server get u r i ( ) ) ; string advertised security protocol = determine advertised protocol ( ) ; server connector server connector = find connector ( advertised security protocol ) ; builder scheme ( advertised security protocol ) ; string advertised hostname = config get string ( worker config rest advertised host name config ) ; if ( advertised hostname ! = null & & ! advertised hostname is empty ( ) ) builder host ( advertised hostname ) ; else if ( server connector ! = null & & server connector get host ( ) ! = null & & server connector get host ( ) length ( ) > 0 ) builder host ( server connector get host ( ) ) ; integer advertised port = config get int ( worker config rest advertised port config ) ; if ( advertised port ! = null ) builder port ( advertised port ) ; else if ( server connector ! = null & & server connector get port ( ) > 0 ) builder port ( server connector get port ( ) ) ; log info ( " advertised uri : { } " , builder build ( ) ) ; return builder build ( ) ; }


public get rollup job response get rollup job ( get rollup job request request , request options options ) throws i o exception { return rest high level client perform request and parse entity ( request , rollup request converters : : get job , options , get rollup job response : : from x content , collections empty set ( ) ) ; }


gets the constant ' s class index it is only valid to call this after { @ link # set class index } has been called

public int get class index ( ) { if ( class index < 0 ) { throw new runtime exception ( " class index not yet set " ) ; } return class index ; }


return the reason , or { @ code null } if none

public string get reason ( ) { return this reason ; }


visit a parse tree produced by the { @ code integer literal } labeled alternative in { @ link sql base parser # number }

t visit integer literal ( sql base parser integer literal context ctx ) ;


creates a data stream from the given iterator because the iterator will remain unmodified until the actual execution happens , the type of data returned by the iterator must be given explicitly in the form of the type information this method is useful for cases where the type is generic in that case , the type class ( as given in { @ link # from collection ( java util iterator , class ) } does not supply all type information note that this operation will result in a non - parallel data stream source , i e , a data stream source with parallelism one

public < out > data stream source < out > from collection ( iterator < out > data , type information < out > type info ) { preconditions check not null ( data , " the iterator must not be null " ) ; source function < out > function = new from iterator function < > ( data ) ; return add source ( function , " collection source " , type info , boundedness bounded ) ; }


a convenience method to force the image denoted by < code > filename < code > to be read from disk and to not use the cached version

public static image icon reload image ( string filename ) { icon map remove ( filename ) ; return load image ( filename ) ; }


returns whether the attributes of this method can be copied from the attributes of the given method ( assuming there is no method visitor between the given class reader and this method writer ) this method should only be called just after this method writer has been created , and before any content is visited it returns true if the attributes corresponding to the constructor arguments ( at most a signature , an exception , a deprecated and a synthetic attribute ) are the same as the corresponding attributes in the given method

boolean can copy method attributes ( final class reader source , final boolean has synthetic attribute , final boolean has deprecated attribute , final int descriptor index , final int signature index , final int exceptions offset ) { / / if the method descriptor has changed , with more locals than the max locals field of the / / original code attribute , if any , then the original method attributes can ' t be copied a / / conservative check on the descriptor changes alone ensures this ( being more precise is not / / worth the additional complexity , because these cases should be rare - - if a transform changes / / a method descriptor , most of the time it needs to change the method ' s code too ) if ( source ! = symbol table get source ( ) | | descriptor index ! = this descriptor index | | signature index ! = this signature index | | has deprecated attribute ! = ( ( access flags & opcodes acc deprecated ) ! = 0 ) ) { return false ; } boolean need synthetic attribute = symbol table get major version ( ) < opcodes v1 5 & & ( access flags & opcodes acc synthetic ) ! = 0 ; if ( has synthetic attribute ! = need synthetic attribute ) { return false ; } if ( exceptions offset = = 0 ) { if ( number of exceptions ! = 0 ) { return false ; } } else if ( source read unsigned short ( exceptions offset ) = = number of exceptions ) { int current exception offset = exceptions offset + 2 ; for ( int i = 0 ; i < number of exceptions ; + + i ) { if ( source read unsigned short ( current exception offset ) ! = exception index table [ i ] ) { return false ; } current exception offset + = 2 ; } } return true ; }


choose nodes for the calls in the pending calls list

private long maybe drain pending calls ( long now ) { long poll timeout = long max value ; log trace ( " trying to choose nodes for { } at { } " , pending calls , now ) ; iterator < call > pending iter = pending calls iterator ( ) ; while ( pending iter has next ( ) ) { call call = pending iter next ( ) ; / / if the call is being retried , await the proper backoff before finding the node if ( now < call next allowed try ms ) { poll timeout = math min ( poll timeout , call next allowed try ms - now ) ; } else if ( maybe drain pending call ( call , now ) ) { pending iter remove ( ) ; } } return poll timeout ; }


public static boolean write file from i s ( final file file , final input stream is , final boolean append , final on progress update listener listener ) { if ( is = = null | | ! utils bridge create or exists file ( file ) ) { log e ( " file i o utils " , " create file < " + file + " > failed " ) ; return false ; } output stream os = null ; try { os = new buffered output stream ( new file output stream ( file , append ) , s buffer size ) ; if ( listener = = null ) { byte [ ] data = new byte [ s buffer size ] ; for ( int len ; ( len = is read ( data ) ) ! = - 1 ; ) { os write ( data , 0 , len ) ; } } else { double total size = is available ( ) ; int cur size = 0 ; listener on progress update ( 0 ) ; byte [ ] data = new byte [ s buffer size ] ; for ( int len ; ( len = is read ( data ) ) ! = - 1 ; ) { os write ( data , 0 , len ) ; cur size + = len ; listener on progress update ( cur size / total size ) ; } } return true ; } catch ( i o exception e ) { e print stack trace ( ) ; return false ; } finally { try { is close ( ) ; } catch ( i o exception e ) { e print stack trace ( ) ; } try { if ( os ! = null ) { os close ( ) ; } } catch ( i o exception e ) { e print stack trace ( ) ; } } } / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / write file from bytes by stream without progress / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /


whether the request has been handled fully within the handler , e g { @ code @ response body } method , and therefore view resolution is not necessary this flag can also be set when controller methods declare an argument of type { @ code servlet response } or { @ code output stream } ) the default value is { @ code false }

public void set request handled ( boolean request handled ) { this request handled = request handled ; }


get operation id from the operation object , and if it ' s blank , generate a new one from the given parameters

protected string get or generate operation id ( operation operation , string path , string http method ) { string operation id = operation get operation id ( ) ; if ( string utils is blank ( operation id ) ) { string tmp path = path ; tmp path = tmp path replace all ( " \ \ { " , " " ) ; tmp path = tmp path replace all ( " \ \ } " , " " ) ; string [ ] parts = ( tmp path + " / " + http method ) split ( " / " ) ; string builder builder = new string builder ( ) ; if ( " / " equals ( tmp path ) ) { / / must be root tmp path builder append ( " root " ) ; } for ( string part : parts ) { if ( part length ( ) > 0 ) { if ( builder to string ( ) length ( ) = = 0 ) { part = character to lower case ( part char at ( 0 ) ) + part substring ( 1 ) ; } else { part = camelize ( part ) ; } builder append ( part ) ; } } operation id = sanitize name ( builder to string ( ) ) ; logger warn ( " empty operation id found for path : " + http method + " " + path + " renamed to auto - generated operation id : " + operation id ) ; } return operation id ; }


invoke a callable ; wrap all checked exceptions with an assertion error

public static < t > t eval ( callable < t > closure ) { try { return closure call ( ) ; } catch ( runtime exception e ) { throw e ; } catch ( exception e ) { throw new assertion error ( e to string ( ) , e ) ; } }


execute all publishers even one of publishers return false

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


public boolean match strings ( string str , @ nullable map < string , string > uri template variables ) { if ( this exact match ) { return this case sensitive ? this raw pattern equals ( str ) : this raw pattern equals ignore case ( str ) ; } else if ( this pattern ! = null ) { matcher matcher = this pattern matcher ( str ) ; if ( matcher matches ( ) ) { if ( uri template variables ! = null ) { if ( this variable names size ( ) ! = matcher group count ( ) ) { throw new illegal argument exception ( " the number of capturing groups in the pattern segment " + this pattern + " does not match the number of uri template variables it defines , " + " which can occur if capturing groups are used in a uri template regex " + " use non - capturing groups instead " ) ; } for ( int i = 1 ; i < = matcher group count ( ) ; i + + ) { string name = this variable names get ( i - 1 ) ; string value = matcher group ( i ) ; uri template variables put ( name , value ) ; } } return true ; } } return false ; }


get the resident set size ( rss ) memory used by all the processes in the process - tree that are older than the passed in age

public long get rss memory size ( int older than age ) { return unavailable ; }


get the mock core this is used to extend the mock

public namenode protocols get mock ( ) { return mock nn ; }


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


check the framework release version number to decide if it ' s 2 7 0 or higher

public static boolean is release 2 7 0 or higher ( string version ) { if ( string utils is empty ( version ) ) { return false ; } if ( get int version ( version ) > = 2070000 ) { return true ; } return false ; }


returns the key groups which this state backend is responsible for

key group range get key group range ( ) ;


a timeout to wait if the index operation can ' t be performed immediately defaults to { @ code 1m }

public final request timeout ( string timeout ) { return timeout ( time value parse time value ( timeout , null , get class ( ) get simple name ( ) + " timeout " ) ) ; }


tests that track selector will prefer selecting audio track with language that match preferred language given by { @ link parameters } over track with { @ link c # selection flag default }

public void select tracks select preferred audio language over selection flag ( ) throws exception { format builder format builder = audio format build upon ( ) ; format fr default format = format builder set language ( " fra " ) set selection flags ( c selection flag default ) build ( ) ; format en non default format = format builder set language ( " eng " ) set selection flags ( 0 ) build ( ) ; track group array track groups = wrap formats ( fr default format , en non default format ) ; track selector set parameters ( default parameters build upon ( ) set preferred audio language ( " eng " ) ) ; track selector result result = track selector select tracks ( new renderer capabilities [ ] { all audio format supported renderer capabilities } , track groups , period id , timeline ) ; assert fixed selection ( result selections get ( 0 ) , track groups , en non default format ) ; }


public synchronized void clear ( ) { counters clear ( ) ; gauges clear ( ) ; minimums clear ( ) ; maximums clear ( ) ; mean statistics clear ( ) ; }


close all the zoo keeper sessions and remove them from the internal maps

synchronized public static void close all ( ) { set < string > sessions = new tree set < string > ( zk map key set ( ) ) ; for ( string key : sessions ) { close ( key ) ; } }


save the database to the specified buffer file

public synchronized void save as ( file file , boolean associate with new file , task monitor monitor ) throws i o exception , cancelled exception { if ( file exists ( ) ) { throw new duplicate file exception ( " file already exists : " + file ) ; } local buffer file out file = new local buffer file ( file , buffer mgr get buffer size ( ) ) ; boolean success = false ; try { save as ( out file , associate with new file , monitor ) ; success = true ; } finally { if ( ! success ) { out file delete ( ) ; } else if ( ! associate with new file ) { out file dispose ( ) ; } } }


public logical plan create statement ( string sql ) { return create statement ( sql , collections empty list ( ) , utc ) ; }


unregisters all subscribers on the given listener object

void unregister ( object listener ) { multimap < class < ? > , subscriber > listener methods = find all subscribers ( listener ) ; for ( entry < class < ? > , collection < subscriber > > entry : listener methods as map ( ) entry set ( ) ) { class < ? > event type = entry get key ( ) ; collection < subscriber > listener methods for type = entry get value ( ) ; copy on write array set < subscriber > current subscribers = subscribers get ( event type ) ; if ( current subscribers = = null | | ! current subscribers remove all ( listener methods for type ) ) { / / if remove all returns true , all we really know is that at least one subscriber was / / removed however , barring something very strange we can assume that if at least one / / subscriber was removed , all subscribers on listener for that event type were after / / all , the definition of subscribers on a particular class is totally static throw new illegal argument exception ( " missing event subscriber for an annotated method is " + listener + " registered ? " ) ; } / / don ' t try to remove the set if it ' s empty ; that can ' t be done safely without a lock / / anyway , if the set is empty it ' ll just be wrapping an array of length 0 } }


lookup high variable based upon its symbol - id

public high symbol get symbol ( long id ) { return symbol map get ( id ) ; }


public integer get int 3 2 ( ) { return int 3 2 ; }


generate a create table sql by the passed in parameters note that it will always generate a sql with id id column in it as primary key and this id is auto increment as integer if the auto increment id is true , or no primary key will be added

protected string generate create table s q l ( string table name , collection < column model > column models , boolean auto increment id ) { string builder create table s q l = new string builder ( " create table " ) ; create table s q l append ( table name ) append ( " ( " ) ; if ( auto increment id ) { create table s q l append ( " id integer primary key autoincrement , " ) ; } if ( is contains only id field ( column models ) ) { / / remove the last comma when only have id field in model create table s q l delete char at ( create table s q l length ( ) - 1 ) ; } boolean need separator = false ; for ( column model column model : column models ) { if ( column model is id column ( ) ) { continue ; } if ( need separator ) { create table s q l append ( " , " ) ; } need separator = true ; create table s q l append ( column model get column name ( ) ) append ( " " ) append ( column model get column type ( ) ) ; if ( ! column model is nullable ( ) ) { create table s q l append ( " not null " ) ; } if ( column model is unique ( ) ) { create table s q l append ( " unique " ) ; } string default value = column model get default value ( ) ; if ( ! text utils is empty ( default value ) ) { create table s q l append ( " default " ) append ( default value ) ; } } create table s q l append ( " ) " ) ; lite pal log d ( tag , " create table sql is > > " + create table s q l ) ; return create table s q l to string ( ) ; }


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