compares the two specified { @ code float } values using { @ link float # compare ( float , float ) } you may prefer to invoke that method directly ; this method exists only for consistency with the other utilities in this package < b > note : < b > this method simply delegates to the jdk method { @ link float # compare } it is provided for consistency with the other primitive types , whose compare methods were not added to the jdk until jdk 7

public static int compare ( float a , float b ) { return float compare ( a , b ) ; }


set storage policies according to the corresponding scheme

void set storage policy ( distributed file system dfs ) throws exception { for ( map entry < path , block storage policy > entry : policy map entry set ( ) ) { dfs set storage policy ( entry get key ( ) , entry get value ( ) get name ( ) ) ; } }


public void parameter names are omitted on default method companions ( ) throws exception { method method = interface method with param method invocations inspect companion method of default method ( ) ; assert that ( method get parameters ( ) ) has length ( 2 ) ; assert that ( method get parameters ( ) [ 1 ] get name ( ) ) is not equal to ( " v 1 2 5 2 5d 6 1e 4b 1 0b 3e 2 7bc 2 8 0dd 6 1e 5 6 7 2 8e 3e 8c 2 7 " ) ; }


find a custom property editor for the given type and property

property editor find editor ( @ nullable string field , @ nullable class < ? > value type ) ;


public void set uuid ( string id ) { this uuid = id ; }


test various scheduling combinations to ensure scheduling and throttling behave as expected

public void test scheduler ( ) throws exception { final no op checkable target 1 = new no op checkable ( ) ; final no op checkable target 2 = new no op checkable ( ) ; final fake timer timer = new fake timer ( ) ; throttled async checker < boolean , boolean > checker = new throttled async checker < > ( timer , min error check gap , 0 , get executor service ( ) ) ; / / check target 1 and ensure we get back the expected result assert true ( checker schedule ( target 1 , true ) is present ( ) ) ; wait test checkable check count ( target 1 , 1l ) ; / / check target 1 again without advancing the timer target 1 should not / / be checked again assert false ( checker schedule ( target 1 , true ) is present ( ) ) ; wait test checkable check count ( target 1 , 1l ) ; / / schedule target 2 scheduled without advancing the timer / / target 2 should be checked as it has never been checked before assert true ( checker schedule ( target 2 , true ) is present ( ) ) ; wait test checkable check count ( target 2 , 1l ) ; / / advance the timer but just short of the min gap / / neither target 1 nor target 2 should be checked again timer advance ( min error check gap - 1 ) ; assert false ( checker schedule ( target 1 , true ) is present ( ) ) ; wait test checkable check count ( target 1 , 1l ) ; assert false ( checker schedule ( target 2 , true ) is present ( ) ) ; wait test checkable check count ( target 2 , 1l ) ; / / advance the timer again / / both targets should be checked now timer advance ( min error check gap ) ; assert true ( checker schedule ( target 1 , true ) is present ( ) ) ; wait test checkable check count ( target 1 , 2l ) ; assert true ( checker schedule ( target 2 , true ) is present ( ) ) ; wait test checkable check count ( target 2 , 2l ) ; }


test that the cached quota remains correct when the block has been written to but not yet committed , even if the replication factor is updated during this time

private void test quota issues before committing ( short initial replication , short final replication ) throws exception { final string log stmt = " bug : inconsistent storagespace for directory " ; final path dir = new path ( get parent ( generic test utils get method name ( ) ) , string format ( " % d - % d " , initial replication , final replication ) ) ; final path file = new path ( dir , " testfile " ) ; log capturer logs = log capturer capture logs ( name node log ) ; get d f s ( ) mkdirs ( dir ) ; get d f s ( ) set quota ( dir , long max value - 1 , long max value - 1 ) ; f s data output stream out = test file creation create file ( get d f s ( ) , file , initial replication ) ; test file creation write file ( out , blocksize / 2 ) ; out hflush ( ) ; get d f s ( ) get content summary ( dir ) ; if ( final replication ! = initial replication ) { / / while the block is visible to the nn but has not yet been committed , / / change the replication get d f s ( ) set replication ( file , final replication ) ; } out close ( ) ; get d f s ( ) get content summary ( dir ) ; assert false ( logs get output ( ) contains ( log stmt ) ) ; }


returns the header size in bytes this value can be used as the offset of the first translog operation see { @ link base translog reader # get first operation offset ( ) }

public int size in bytes ( ) { return header size in bytes ; }


adds an aggregation to the search operation

public search request builder add aggregation ( pipeline aggregation builder aggregation ) { source builder ( ) aggregation ( aggregation ) ; return this ; }


the latency interval during which out - of - order records should be handled

public time value get latency ( ) { return latency ; }


this method serves to force sub classes to " hide " this static factory

public static managed channel builder < ? > for target ( string target ) { throw new unsupported operation exception ( " subclass failed to hide static factory " ) ; }


returns whether or not any layers in this composition has masks

public boolean has masks ( ) { return composition layer ! = null & & composition layer has masks ( ) ; }


visits a catch statement and defines a variable for the caught exception checks : control flow , type validation

public void visit catch ( s catch user catch node , semantic scope semantic scope ) { script scope script scope = semantic scope get script scope ( ) ; string symbol = user catch node get symbol ( ) ; if ( script scope get painless lookup ( ) is valid canonical class name ( symbol ) ) { throw user catch node create error ( new illegal argument exception ( " invalid catch declaration : type [ " + symbol + " ] cannot be a name " ) ) ; } string canonical type name = user catch node get canonical type name ( ) ; class < ? > type = script scope get painless lookup ( ) canonical type name to type ( canonical type name ) ; if ( type = = null ) { throw user catch node create error ( new illegal argument exception ( " invalid catch declaration : cannot resolve type [ " + canonical type name + " ] " ) ) ; } location location = user catch node get location ( ) ; variable variable = semantic scope define variable ( location , type , symbol , false ) ; semantic scope put decoration ( user catch node , new semantic variable ( variable ) ) ; class < ? > base exception = user catch node get base exception ( ) ; if ( user catch node get base exception ( ) is assignable from ( type ) = = false ) { throw user catch node create error ( new class cast exception ( " cannot cast from [ " + painless lookup utility type to canonical type name ( type ) + " ] " + " to [ " + painless lookup utility type to canonical type name ( base exception ) + " ] " ) ) ; } s block user block node = user catch node get block node ( ) ; if ( user block node ! = null ) { semantic scope replicate condition ( user catch node , user block node , last source class ) ; semantic scope replicate condition ( user catch node , user block node , in loop class ) ; semantic scope replicate condition ( user catch node , user block node , last loop class ) ; visit ( user block node , semantic scope ) ; semantic scope replicate condition ( user block node , user catch node , method escape class ) ; semantic scope replicate condition ( user block node , user catch node , loop escape class ) ; semantic scope replicate condition ( user block node , user catch node , all escape class ) ; semantic scope replicate condition ( user block node , user catch node , any continue class ) ; semantic scope replicate condition ( user block node , user catch node , any break class ) ; } }


encodes a starlark value as json an application - defined subclass of starlark value may define its own json encoding by implementing the { @ link encodable } interface otherwise , the encoder tests for the { @ link map } , { @ link starlark iterable } , and { @ link structure } interfaces , in that order , resulting in dict - like , list - like , and struct - like encoding , respectively see the starlark documentation annotation for more detail encoding any other value yields an error

public string encode ( object x ) throws eval exception { encoder enc = new encoder ( ) ; try { enc encode ( x ) ; } catch ( stack overflow error unused ) { throw starlark errorf ( " nesting depth limit exceeded " ) ; } return enc out to string ( ) ; }


get the { @ link sub cluster info } encapsulating the information about the sub - cluster

public abstract sub cluster info get sub cluster info ( ) ;


register a metrics source ( deriving name and description from the object )

public < t > t register ( t source ) { return register ( null , null , source ) ; }


sets the upper boundary for the query ( inclusive ) can be removed through null

public boxed query request to ( ordinal end ) { to = end ; timestamp range lte ( end ! = null ? end timestamp ( ) : null ) ; return this ; }


reads the next chunk in the file past the last one specified in the { @ link chunk model }

public synchronized list < string > read next chunk ( ) throws file not found exception , i o exception { if ( raf = = null ) { return collections < string > empty list ( ) ; } / / need to figure out the position of the last read , and the last corresponding line long read pos = 0 ; / / get end file pos of the last visible chunk , if there is one ; if there isn ' t , just / / stay at 0 if ( model get size ( ) > 0 ) { chunk last = model get ( model get size ( ) - 1 ) ; if ( last = = null ) { return collections < string > empty list ( ) ; } read pos = last end ; } / / seek to the point in the file indicated by the chunk , and start reading raf seek ( read pos ) ; return read chunk ( raf get file pointer ( ) ) ; } / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * private methods * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /


returns the ( immutable ) list of targets to build in commandline form

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


set the source path to the specified erasure coding policy

public void set erasure coding policy ( final path path , final string ec policy name ) throws i o exception { statistics increment write ops ( 1 ) ; storage statistics increment op counter ( op type set ec policy ) ; path abs f = fix relative part ( path ) ; new file system link resolver < void > ( ) { @ override public void do call ( final path p ) throws i o exception { dfs set erasure coding policy ( get path name ( p ) , ec policy name ) ; return null ; } @ override public void next ( final file system fs , final path p ) throws i o exception { if ( fs instanceof distributed file system ) { distributed file system my dfs = ( distributed file system ) fs ; my dfs set erasure coding policy ( p , ec policy name ) ; return null ; } throw new unsupported operation exception ( " cannot set erasure coding policy through a symlink to a " + " non - distributed file system : " + path + " - > " + p ) ; } } resolve ( this , abs f ) ; }


test that by default we check block - level md5

public void test check block md 5 ( ) throws exception { test account = azure blob storage test account create ( ) ; test check block md 5 ( true ) ; }


set the entity tag of the body , as specified by the { @ code e tag } header


records the elements executed by { @ code modules }

public static list < element > get elements ( iterable < ? extends module > modules ) { return get elements ( stage development , modules ) ; }


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


convert the specified value to the desired scalar value type

protected static long as long ( object value , schema from schema , throwable error ) { try { if ( value instanceof number ) { number number = ( number ) value ; return number long value ( ) ; } if ( value instanceof string ) { return new big decimal ( value to string ( ) ) long value ( ) ; } } catch ( number format exception e ) { error = e ; / / fall through } if ( from schema ! = null ) { string schema name = from schema name ( ) ; if ( value instanceof java util date ) { if ( date logical name equals ( schema name ) ) { return date from logical ( from schema , ( java util date ) value ) ; } if ( time logical name equals ( schema name ) ) { return time from logical ( from schema , ( java util date ) value ) ; } if ( timestamp logical name equals ( schema name ) ) { return timestamp from logical ( from schema , ( java util date ) value ) ; } } throw new data exception ( " unable to convert " + value + " ( " + value get class ( ) + " ) to " + from schema , error ) ; } throw new data exception ( " unable to convert " + value + " ( " + value get class ( ) + " ) to a number " , error ) ; }


locates and decodes a barcode in some format within an image

result decode ( binary bitmap image ) throws not found exception , checksum exception , format exception ;


check if the throwable was thrown by the class and the method specified

private static boolean called from ( @ non null throwable throwable , @ non null string clazz , @ non null string method ) { stack trace element [ ] trace = throwable get stack trace ( ) ; for ( stack trace element el : trace ) { / / if the exception has the class and method searched , it ' s called from there if ( clazz equals ( el get class name ( ) ) & & el get method name ( ) equals ( method ) ) { return true ; } } return false ; }


create a { @ link subscriber } with the given parameters

public static < t , r > subscriber < t > subscribe ( subscriber < ? super r > downstream , function < ? super t , ? extends iterable < ? extends r > > mapper , int prefetch ) { return new flatten iterable subscriber < > ( downstream , mapper , prefetch ) ; }


check whether a group name is a name of a framework group ( including the filesystem group )

public static synchronized boolean is framework group ( string name ) { return s 2i get ( name ) ! = null | | name equals ( fs group name ) ; }


provide a standard method for splitting a symbol path into its various namespace and symbol name elements while the current implementation uses a very simplistic approach , this may be improved upon in the future to handle various grouping concepts

public static list < string > split namespace path ( string path ) { return arrays as list ( path trim ( ) split ( namespace delimiter ) ) ; }


public void flush ( ) { if ( text infos is empty ( ) ) { return ; } comparator < text info > point comparator = ( o 1 , o 2 ) - > { text info t 1 = o 1 ; text info t 2 = o 2 ; int diff = t 1 point y - t 2 point y ; if ( diff ! = 0 ) { return diff ; } diff = t 1 point x - t 2 point x ; return diff ; } ; comparator < text info > row comparator = ( o 1 , o 2 ) - > { text info t 1 = o 1 ; text info t 2 = o 2 ; int diff = t 1 row - t 2 row ; if ( diff ! = 0 ) { return diff ; } diff = t 1 point x - t 2 point x ; return diff ; } ; text info [ ] sorted text infos = new text info [ text infos size ( ) ] ; text infos to array ( sorted text infos ) ; / / sort the text by y position , then by x position arrays sort ( sorted text infos , point comparator ) ; / / group the text into rows based on font height and y position / / todo - ideally , it would be nice if there was a good way to group text that / / varied in height in a nice way int last pos = sorted text infos [ 0 ] point y ; int cur row = 0 ; for ( int i = 0 ; i < sorted text infos length ; i + + ) { if ( sorted text infos [ i ] point y ! = last pos ) { cur row + + ; last pos = sorted text infos [ i ] point y ; } sorted text infos [ i ] row = cur row ; } / / sort the text by row , then by x position arrays sort ( sorted text infos , row comparator ) ; / / render the text into a string int last row = 0 ; int last x pos = 0 ; / / the x co - ordinate of the end of the last string for ( text info sorted text info : sorted text infos ) { / / insert newlines as appropriate for ( int j = last row ; j < sorted text info row ; j + + ) { buffer append ( ' \ n ' ) ; } / / if we started a new row , reset the x position if ( last row ! = sorted text info row ) { last x pos = 0 ; } last row = sorted text info row ; / / insert spaces to account for distance past last field in row font metrics metrics = component get font metrics ( sorted text info font ) ; int space width = metrics char width ( ' ' ) ; if ( space width = = 0 ) { / / some environments report 0 for some fonts space width = 4 ; } int fill spaces = math round ( ( float ) ( sorted text info point x - last x pos ) / ( float ) space width ) ; / / account for the case where there ' s a very small amount of space between fields if ( fill spaces = = 0 & & sorted text info point x > last x pos ) { fill spaces = 1 ; } for ( int j = 0 ; j < fill spaces ; j + + ) { buffer append ( ' ' ) ; } last x pos = sorted text info point x + metrics string width ( sorted text info text ) ; / / append the text buffer append ( sorted text info text ) ; } buffer append ( ' \ n ' ) ; text infos clear ( ) ; }


public map < string , collection < string > > get data source mapper ( ) { map < string , collection < string > > result = new hash map < > ( 1 , 1 ) ; collection < string > actual data source names = new linked list < > ( ) ; actual data source names add ( primary data source name ) ; actual data source names add all ( replica data source names ) ; result put ( name , actual data source names ) ; return result ; }


public final int get int bits ( ) { return bits ; }


test replica placement policy in case of boundary topology rack 2 has only 1 node group & can ' t be placed with two replicas the 1st replica will be placed on writer the 2nd replica should be placed on a different rack the 3rd replica should be placed on the same rack with writer , but on a different node group

public void test choose targets on boundary topology ( ) throws exception { for ( int i = 0 ; i < data nodes length ; i + + ) { cluster remove ( data nodes [ i ] ) ; } for ( int i = 0 ; i < data nodes in boundary case length ; i + + ) { cluster add ( data nodes in boundary case [ i ] ) ; } for ( int i = 0 ; i < data nodes in boundary case length ; i + + ) { update heartbeat with usage ( data nodes in boundary case [ i ] , 2 * hdfs server constants min blocks for write * block size , 0l , 2 * hdfs server constants min blocks for write * block size , 0l , 0l , 0l , 0 , 0 ) ; } datanode storage info [ ] targets ; targets = choose target ( 0 , data nodes in boundary case [ 0 ] ) ; assert equals ( targets length , 0 ) ; targets = choose target ( 1 , data nodes in boundary case [ 0 ] ) ; assert equals ( targets length , 1 ) ; targets = choose target ( 2 , data nodes in boundary case [ 0 ] ) ; assert equals ( targets length , 2 ) ; assert false ( is on same rack ( targets [ 0 ] , targets [ 1 ] ) ) ; targets = choose target ( 3 , data nodes in boundary case [ 0 ] ) ; assert equals ( targets length , 3 ) ; assert true ( check targets on different node group ( targets ) ) ; }


only performs this indexing request if the document was last modification was assigned the given primary term must be used in combination with { @ link # set if seq no ( long ) } if the document last modification was assigned a different term a { @ link org elasticsearch index engine version conflict engine exception } will be thrown

public index request set if primary term ( long term ) { if ( term < 0 ) { throw new illegal argument exception ( " primary term must be non negative got [ " + term + " ] " ) ; } if primary term = term ; return this ; }


public void test list get ( ) { assert equals ( 5 , exec ( " def x = new array list ( ) ; x add ( 5 ) ; return x get ( 0 ) ; " ) ) ; assert equals ( 5 , exec ( " def x = new array list ( ) ; x add ( 5 ) ; def index = 0 ; return x get ( index ) ; " ) ) ; }


picks the given vertex , but signals that the pick is really just to make sure that the vertex is picked in order to match the graph ' s notion of the current location to pick a vertex and signal that the location has changed , call { @ link # pick ( object , boolean ) }

public void pick to sync ( v vertex , boolean add to selection ) { pending event source = event source external ; if ( ! add to selection ) { picked state delegate clear ( ) ; } picked state delegate pick ( vertex , true ) ; pending event source = null ; }


assume that a particular { @ link test group } is active

private static void assume group ( test group group ) { set < test group > test groups = test group load test groups ( ) ; assume true ( test groups contains ( group ) , ( ) - > " requires inactive test group " + group + " ; active test groups : " + test groups ) ; }


returns true if the task has started , false in case it didn ' t start ( yet ? ) or it was skipped

boolean has started ( ) { return task state get ( ) = = task state started ; }


test the lock logs warning when lock held time is greater than threshold and not log warning otherwise

public void test lock long holding report ( ) throws exception { string testname = name get method name ( ) ; final atomic long time = new atomic long ( 0 ) ; timer mclock = new timer ( ) { @ override public long monotonic now ( ) { return time get ( ) ; } } ; lock mlock = mock ( lock class ) ; final atomic long wlogged = new atomic long ( 0 ) ; final atomic long wsuppresed = new atomic long ( 0 ) ; final atomic long w max wait = new atomic long ( 0 ) ; instrumented lock lock = new instrumented lock ( testname , log , mlock , 2000 , 300 , mclock ) { @ override void log warning ( long lock held time , suppressed snapshot stats ) { wlogged increment and get ( ) ; wsuppresed set ( stats get suppressed count ( ) ) ; w max wait set ( stats get max suppressed wait ( ) ) ; } } ; / / do not log warning when the lock held time is short lock lock ( ) ; / / t = 0 time set ( 200 ) ; lock unlock ( ) ; / / t = 200 assert equals ( 0 , wlogged get ( ) ) ; assert equals ( 0 , wsuppresed get ( ) ) ; assert equals ( 0 , w max wait get ( ) ) ; lock lock ( ) ; / / t = 200 time set ( 700 ) ; lock unlock ( ) ; / / t = 700 assert equals ( 1 , wlogged get ( ) ) ; assert equals ( 0 , wsuppresed get ( ) ) ; assert equals ( 0 , w max wait get ( ) ) ; / / despite the lock held time is greater than threshold / / suppress the log warning due to the logging gap / / ( not recorded in wsuppressed until next log message ) lock lock ( ) ; / / t = 700 time set ( 1100 ) ; lock unlock ( ) ; / / t = 1100 assert equals ( 1 , wlogged get ( ) ) ; assert equals ( 0 , wsuppresed get ( ) ) ; assert equals ( 0 , w max wait get ( ) ) ; / / log a warning message when the lock held time is greater the threshold / / and the logging time gap is satisfied also should display suppressed / / previous warnings time set ( 2400 ) ; lock lock ( ) ; / / t = 2400 time set ( 2800 ) ; lock unlock ( ) ; / / t = 2800 assert equals ( 2 , wlogged get ( ) ) ; assert equals ( 1 , wsuppresed get ( ) ) ; assert equals ( 400 , w max wait get ( ) ) ; }


public server stats build ( ) { return new server stats ( calls started , calls succeeded , calls failed , last call started nanos , listen sockets ) ; }


short - circuit ? : no threadsemaphore : thread thread pool full ? : no thread pool queue full ? : no timeout : no execution result : synchronous hystrix runtime exception fallback : success

public void test execution hook thread exception successful fallback ( ) { assert hooks on success ( new func 0 < test hystrix command < integer > > ( ) { @ override public test hystrix command < integer > call ( ) { return get command ( execution isolation strategy thread , abstract test hystrix command execution result failure , 0 , abstract test hystrix command fallback result success ) ; } } , new action 1 < test hystrix command < integer > > ( ) { @ override public void call ( test hystrix command < integer > command ) { testable execution hook hook = command get builder ( ) execution hook ; assert true ( hook command emissions match ( 1 , 0 , 1 ) ) ; assert true ( hook execution events match ( 0 , 1 , 0 ) ) ; assert true ( hook fallback events match ( 1 , 0 , 1 ) ) ; assert equals ( runtime exception class , hook get execution exception ( ) get class ( ) ) ; assert equals ( " on start - on thread start - ! on run start - on execution start - on execution error - ! on run error - on thread complete - on fallback start - on fallback emit - ! on fallback success - ! on complete - on emit - on fallback success - on success - " , hook execution sequence to string ( ) ) ; } } ) ; }


begins encoding a new array each call to this method must be paired with a call to { @ link # end array }

public json writer begin array ( ) throws i o exception { write deferred name ( ) ; return open ( empty array , ' [ ' ) ; }


public span utils set line height ( @ int range ( from = 0 ) final int line height ) { return set line height ( line height , align center ) ; }


destroy a fixture this removes the fixture from the broad - phase and destroys all contacts associated with this fixture this will automatically adjust the mass of the body if the body is dynamic and the fixture has positive density all fixtures attached to a body are implicitly destroyed when the body is destroyed

public final void destroy fixture ( fixture fixture ) { assert ( m world is locked ( ) = = false ) ; if ( m world is locked ( ) = = true ) { return ; } assert ( fixture m body = = this ) ; / / remove the fixture from this body ' s singly linked list assert ( m fixture count > 0 ) ; fixture node = m fixture list ; fixture last = null ; / / java change boolean found = false ; while ( node ! = null ) { if ( node = = fixture ) { node = fixture m next ; found = true ; break ; } last = node ; node = node m next ; } / / you tried to remove a shape that is not attached to this body assert ( found ) ; / / java change , remove it from the list if ( last = = null ) { m fixture list = fixture m next ; } else { last m next = fixture m next ; } / / destroy any contacts associated with the fixture contact edge edge = m contact list ; while ( edge ! = null ) { contact c = edge contact ; edge = edge next ; fixture fixture a = c get fixture a ( ) ; fixture fixture b = c get fixture b ( ) ; if ( fixture = = fixture a | | fixture = = fixture b ) { / / this destroys the contact and removes it from / / this body ' s contact list m world m contact manager destroy ( c ) ; } } if ( ( m flags & e active flag ) = = e active flag ) { broad phase broad phase = m world m contact manager m broad phase ; fixture destroy proxies ( broad phase ) ; } fixture destroy ( ) ; fixture m body = null ; fixture m next = null ; fixture = null ; - - m fixture count ; / / reset the mass data reset mass data ( ) ; }


returns the artifacts needed on the runtime classpath of this target see also { @ link # get runtime class path for archive ( ) }

public nested set < artifact > get runtime class path ( ) { return runtime class path ; }


set the list of acceptable { @ linkplain media type media types } , as specified by the { @ code accept } header

s accept ( media type acceptable media types ) ;


removes the local variables and creates a new { @ link historic variable update } for each of them

void remove variables local ( collection < string > variable names ) ;


public void write to ( annotated output out , dalv insn insn ) { register spec list regs = insn get registers ( ) ; long value = ( ( cst literal 6 4 ) ( ( cst insn ) insn ) get constant ( ) ) get long bits ( ) ; write ( out , opcode unit ( insn , regs get ( 0 ) get reg ( ) ) , value ) ; }


source line and column info < code > optional aapt pb source position source = 4 ; < code >


find a type by name the name may or may not be fully qualified ( e g { @ code string } or { @ code java lang string } )

class < ? > find type ( string type name ) throws evaluation exception ;


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

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


sets a maximum threshold in number of documents a suggest text token can exist in order to be corrected can be a relative percentage number ( e g 0 4 ) or an absolute number to represent document frequencies if an value higher than 1 is specified then fractional can not be specified defaults to { @ code 0 01 } this can be used to exclude high frequency terms from being suggested high frequency terms are usually spelled correctly on top of this this also improves the suggest performance

public term suggestion builder max term freq ( float max term freq ) { if ( max term freq < 0 0f ) { throw new illegal argument exception ( " max term freq must be positive " ) ; } if ( max term freq > 1 0f & & max term freq ! = math floor ( max term freq ) ) { throw new illegal argument exception ( " if max term freq is greater than 1 , it must not be a fraction " ) ; } this max term freq = max term freq ; return this ; }


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


public static void put ticket granting ticket ( final request context context , final ticket granting ticket ticket ) { context get flow scope ( ) put ( " ticket granting ticket " , ticket ) ; }


get the number of bytes of current block

long get bytes cur block ( ) { return bytes cur block ; }


return whether this listener container is currently in a recovery attempt may be used to detect recovery phases but also the end of a recovery phase , with { @ code is recovering ( ) } switching to { @ code false } after having been found to return { @ code true } before


return true if the given group path is expanded

boolean is expanded ( group path gp ) { tree path path = get tree path from group ( gp ) ; if ( path ! = null ) { return is expanded ( path ) ; } return false ; }


public sock js frame type get type ( ) { return this type ; }


adds a string argument to the command line if the value is null , neither the arg nor the value is added

public builder add ( @ compile time constant string arg , @ nullable string value ) { return add object internal ( arg , value ) ; }


configures gson to apply a specific serialization policy for { @ code long } and { @ code long } objects

public gson builder set long serialization policy ( long serialization policy serialization policy ) { this long serialization policy = serialization policy ; return this ; }


returns the built - in list of system include paths for the toolchain compiler all paths in this list should be relative to the exec directory they may be absolute if they are also installed on the remote build nodes or for local compilation

list < path fragment > get built in include directories ( ) ;


private static boolean copy ( file system src f s , file status src status , file dst , boolean delete source , configuration conf ) throws i o exception { path src = src status get path ( ) ; if ( src status is directory ( ) ) { if ( ! dst mkdirs ( ) ) { return false ; } file status contents [ ] = src f s list status ( src ) ; for ( int i = 0 ; i < contents length ; i + + ) { copy ( src f s , contents [ i ] , new file ( dst , contents [ i ] get path ( ) get name ( ) ) , delete source , conf ) ; } } else { input stream in = src f s open ( src ) ; i o utils copy bytes ( in , files new output stream ( dst to path ( ) ) , conf ) ; } if ( delete source ) { return src f s delete ( src , true ) ; } else { return true ; } }


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


public int get pool size ( ) { if ( this thread pool executor = = null ) { / / not initialized yet : assume core pool size return this core pool size ; } return this thread pool executor get pool size ( ) ; }


adds to the input the union of the given operators

public void add inputs ( list < ? extends operator < in > > inputs ) { check not null ( inputs , " the inputs may not be null " ) ; this input = create union cascade ( this input , ( operator < in > [ ] ) inputs to array ( new operator [ inputs size ( ) ] ) ) ; }


gets a local point relative to the body ' s origin given a world point note that the same vector 2 instance is returned each time this method is called

public vector 2 get local point ( vector 2 world point ) { jni get local point ( addr , world point x , world point y , tmp ) ; local point 2 x = tmp [ 0 ] ; local point 2 y = tmp [ 1 ] ; return local point 2 ; }


performs an exclusive check - out of the given file

public boolean checkout exclusively ( domain file df ) throws i o exception { assert file in project ( df ) ; try { return df checkout ( true , task monitor dummy ) ; } catch ( cancelled exception e ) { / / cannot happen as long as we use the dummy } return false ; }


returns a description of the task that was run

public string get description ( ) { return description ; }


whether to show only one media type if choosing medias are only images or videos

public selection creator show single media type ( boolean show single media type ) { m selection spec show single media type = show single media type ; return this ; }


returns the index of the first appearance of the value { @ code target } in { @ code array } note that this always returns { @ code - 1 } when { @ code target } is { @ code na n }

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


public static < t , v > string get property name ( final class < t > clazz , final typed property getter < t , v > supplier ) { return property utils get property name ( clazz , supplier ) ; }


convert string value to long value if parameter value is legal and it automatically defaults to 0 if parameter value is null or blank str

public static long to long ( string val ) { return to long ( val , 0l ) ; }


enabledisable the expand updown actions according to the selected block

private void enable expand actions ( int num selected ) { if ( num selected ! = 1 ) { expand up action set enabled ( false ) ; expand down action set enabled ( false ) ; } else { memory block block = get selected block ( ) ; if ( block get type ( ) ! = memory block type default ) { expand down action set enabled ( false ) ; expand up action set enabled ( false ) ; return ; } if ( block get start ( ) get offset ( ) = = 0 ) { expand up action set enabled ( false ) ; } else { expand up action set enabled ( true ) ; } address end addr = block get end ( ) ; if ( end addr equals ( end addr get address space ( ) get max address ( ) ) ) { expand down action set enabled ( false ) ; } else { expand down action set enabled ( true ) ; } } }


find the currently running { @ code kafka streams } instance ( potentially remotely ) that use the same { @ link streams config # application id config application id } as this instance ( i e , all instances that belong to the same kafka streams application ) and that contain a { @ link state store } with the given { @ code store name } and the { @ link state store } contains the given { @ code key } and return { @ link streams metadata } for it this will use the default kafka streams partitioner to locate the partition if a { @ link stream partitioner custom partitioner } has been { @ link producer config # partitioner class config configured } via { @ link streams config } or { @ link k stream # repartition ( repartitioned ) } , or if the original { @ link k table } ' s input { @ link streams builder # table ( string ) topic } is partitioned differently , please use { @ link # metadata for key ( string , object , stream partitioner ) } note : this is a point in time view and it may change due to partition reassignment the key may not exist in the { @ link state store } ; this method provides a way of finding which host it would exist on if this is for a window store the serializer should be the serializer for the record key , not the window serializer

public < k > streams metadata metadata for key ( final string store name , final k key , final serializer < k > key serializer ) { validate is running or rebalancing ( ) ; return streams metadata state get metadata with key ( store name , key , key serializer ) ; }


in federation configuration is set for a set of namenode and secondary namenodebackupcheckpointer , which are grouped under a logical nameservice id the configuration keys specific to them have suffix set to configured nameservice id this method copies the value from specific key of format key nameservice id to key , to set up the generic configuration once this is done , only generic version of the configuration is read in rest of the code , for backward compatibility and simpler code changes

public static void initialize generic keys ( configuration conf , string nameservice id , string namenode id ) { if ( ( nameservice id ! = null & & ! nameservice id is empty ( ) ) | | ( namenode id ! = null & & ! namenode id is empty ( ) ) ) { if ( nameservice id ! = null ) { conf set ( dfs nameservice id , nameservice id ) ; } if ( namenode id ! = null ) { conf set ( dfs ha namenode id key , namenode id ) ; } d f s util set generic conf ( conf , nameservice id , namenode id , namenode specific keys ) ; d f s util set generic conf ( conf , nameservice id , null , nameservice specific keys ) ; } / / if the rpc address is set use it to ( re - ) configure the default fs if ( conf get ( dfs namenode rpc address key ) ! = null ) { uri default uri = uri create ( hdfs constants hdfs uri scheme + " : / / " + conf get ( dfs namenode rpc address key ) ) ; conf set ( fs default name key , default uri to string ( ) ) ; log debug ( " setting { } to { } " , fs default name key , default uri ) ; } }


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


set a key that is local to the parent of this component

void set key ( string key ) { m has manual key = true ; m key = key ; }


returns an initialized , thread - safe c groups handler instance

private static c groups handler get initialized c groups handler ( configuration conf ) throws resource handler exception { if ( c groups handler = = null ) { synchronized ( c groups handler class ) { if ( c groups handler = = null ) { c groups handler = new c groups handler impl ( conf , privileged operation executor get instance ( conf ) ) ; log debug ( " value of c groups handler is : { } " , c groups handler ) ; } } } return c groups handler ; }


clears the code unit ( instruction or data ) defined at the address

public final void clear listing ( address address ) throws cancelled exception { clear listing ( address , address ) ; }


only select jobs that do not have a tenant id


returns an iterator for the values in the map remove is supported if { @ link collections # allocate iterators } is false , the same iterator instance is returned each time this method is called use the { @ link entries } constructor for nested or multithreaded iteration

public values values ( ) { if ( collections allocate iterators ) return new values ( this ) ; if ( values 1 = = null ) { values 1 = new values ( this ) ; values 2 = new values ( this ) ; } if ( ! values 1 valid ) { values 1 reset ( ) ; values 1 valid = true ; values 2 valid = false ; return values 1 ; } values 2 reset ( ) ; values 2 valid = true ; values 1 valid = false ; return values 2 ; }


write to the status file the status file will contain a string describing the exit status of the test it will be success if the test returned success ( return code 0 ) , a numerical code if it returned a non - zero status , or in progress or timed out

private void write status file ( string status ) throws i o exception { file output stream fos = new file output stream ( new file ( results , test name + " pstatus " ) ) ; buffered writer out = null ; try { out = new buffered writer ( new output stream writer ( fos , " utf8 " ) ) ; out write ( status + " \ n " ) ; } finally { if ( out ! = null ) { out close ( ) ; } else { fos close ( ) ; } } }


adds a given volume into this volume set

public void add volume ( disk balancer volume volume ) throws exception { preconditions check not null ( volume , " volume cannot be null " ) ; preconditions check state ( is transient ( ) = = volume is transient ( ) , " mismatch in volume set and volume ' s transient " + " properties " ) ; if ( this storage type = = null ) { preconditions check state ( volumes size ( ) = = 0l , " storage type is null but " + " volume size is " + volumes size ( ) ) ; this storage type = volume get storage type ( ) ; } else { preconditions check state ( this storage type equals ( volume get storage type ( ) ) , " adding wrong type of disk to this volume set " ) ; } volumes add ( volume ) ; compute volume data density ( ) ; }


cleanup expired state while rocksdb compaction is running rocks d b compaction filter will query current timestamp , used to check expiration , from flink every time after processing { @ code query time after num entries } number of state entries updating the timestamp more often can improve cleanup speed but it decreases compaction performance because it uses jni call from native code

public builder cleanup in rocksdb compact filter ( long query time after num entries ) { strategies put ( cleanup strategies strategies rocksdb compaction filter , new rocksdb compact filter cleanup strategy ( query time after num entries ) ) ; return this ; }


updates a pet in the store with form data

public void update pet with form ( long pet id , string name , string status ) throws api exception { object local var post body = null ; / / verify the required parameter ' pet id ' is set if ( pet id = = null ) { throw new api exception ( 400 , " missing the required parameter ' pet id ' when calling update pet with form " ) ; } / / create path and map variables string local var path = " / pet / { pet id } " replace all ( " \ \ { " + " pet id " + " \ \ } " , api client escape string ( pet id to string ( ) ) ) ; / / query params list < pair > local var query params = new array list < pair > ( ) ; list < pair > local var collection query params = new array list < pair > ( ) ; map < string , string > local var header params = new hash map < string , string > ( ) ; map < string , string > local var cookie params = new hash map < string , string > ( ) ; map < string , object > local var form params = new hash map < string , object > ( ) ; if ( name ! = null ) local var form params put ( " name " , name ) ; if ( status ! = null ) local var form params put ( " status " , status ) ; final string [ ] local var accepts = { } ; final string local var accept = api client select header accept ( local var accepts ) ; final string [ ] local var content types = { " application / x - www - form - urlencoded " } ; final string local var content type = api client select header content type ( local var content types ) ; string [ ] local var auth names = new string [ ] { " petstore auth " } ; api client invoke a p i ( local var path , " post " , local var query params , local var collection query params , local var post body , local var header params , local var cookie params , local var form params , local var accept , local var content type , local var auth names , null ) ; }


public boolean is rolling upgrade ( ) { return rolling upgrade info ! = null & & ! rolling upgrade info is finalized ( ) ; }


public static void e ( string tag , string message , exception exception ) { if ( s is log enabled ) { log e ( tag , get content ( get current stack trace element ( ) ) + " \ n > " + exception get message ( ) + " \ n > " + exception get stack trace ( ) + " " + message ) ; exception print stack trace ( ) ; } }


create a { @ link function } that acts as a factory an { @ link org elasticsearch common settings setting affix setting } the { @ code function } takes the realm - type as an argument

public static < t > function < string , setting affix setting < t > > affix setting ( string suffix , function < string , setting < t > > delegate factory ) { return realm type - > setting affix key setting ( realm setting prefix ( realm type ) , suffix , delegate factory ) ; }


returns the number of dimensions of the given external type

public static int external array type dimension count ( string external type ) { int dimensions = 0 ; int length = java constants type array length ( ) ; int offset = external type length ( ) - length ; while ( external type region matches ( offset , java constants type array , 0 , length ) ) { dimensions + + ; offset - = length ; } return dimensions ; }


{ @ inherit doc } memoized in order to avoid re - preparing statements

@ override public span store span store ( ) { if ( span store = = null ) { synchronized ( this ) { if ( span store = = null ) { span store = new cassandra span store ( this ) ; } } } return span store ; }


looks up the value of this path against a set of aggregation results

public double resolve value ( internal aggregations aggregations ) { try { iterator < path element > path = path elements iterator ( ) ; assert path has next ( ) ; return aggregations sort value ( path next ( ) , path ) ; } catch ( illegal argument exception e ) { throw new illegal argument exception ( " invalid aggregation order path [ " + this + " ] " + e get message ( ) , e ) ; } }


the topic and partition to which the record was appended

public topic partition topic partition ( ) { return topic partition ; }


instrument a { @ litho handler } or returns the same given { @ litho handler } if the { @ litho handler } given as input is null , the return value will be null too

litho handler instrument litho handler ( litho handler litho handler ) ;


waits until all nodes have no pending tasks

public void wait no pending tasks on all ( ) throws exception { assert no timeout ( client ( ) admin ( ) cluster ( ) prepare health ( ) set wait for events ( priority languid ) get ( ) ) ; assert busy ( ( ) - > { for ( client client : clients ( ) ) { cluster health response cluster health = client admin ( ) cluster ( ) prepare health ( ) set local ( true ) get ( ) ; assert that ( " client " + client + " still has in flight fetch " , cluster health get number of in flight fetch ( ) , equal to ( 0 ) ) ; pending cluster tasks response pending tasks = client admin ( ) cluster ( ) prepare pending cluster tasks ( ) set local ( true ) get ( ) ; assert that ( " client " + client + " still has pending tasks " + pending tasks , pending tasks , matchers empty iterable ( ) ) ; cluster health = client admin ( ) cluster ( ) prepare health ( ) set local ( true ) get ( ) ; assert that ( " client " + client + " still has in flight fetch " , cluster health get number of in flight fetch ( ) , equal to ( 0 ) ) ; } } ) ; assert no timeout ( client ( ) admin ( ) cluster ( ) prepare health ( ) set wait for events ( priority languid ) get ( ) ) ; }


tests that { @ link composite sequenceable loader # get buffered position us ( ) } returns { @ link c # time end of source } when all sub - loaders have buffered till end - of - source

public void get buffered position us returns end of source when all loader buffered till end of source ( ) { fake sequenceable loader loader 1 = new fake sequenceable loader ( / * buffered position us * / c time end of source , / * next load position us * / c time end of source ) ; fake sequenceable loader loader 2 = new fake sequenceable loader ( / * buffered position us * / c time end of source , / * next load position us * / c time end of source ) ; composite sequenceable loader composite sequenceable loader = new composite sequenceable loader ( new sequenceable loader [ ] { loader 1 , loader 2 } ) ; assert that ( composite sequenceable loader get buffered position us ( ) ) is equal to ( c time end of source ) ; }


evaluate an expression and check that the actual result matches the expected value and the class of the result matches the expected class of result this method can also check if the expression is writable ( for example , it is a variable or property reference )

public void evaluate ( string expression , object expected value , class < ? > expected class of result , boolean should be writable ) { expression expr = parser parse expression ( expression ) ; assert that ( expr ) as ( " expression " ) is not null ( ) ; if ( debug ) { spel utilities print abstract syntax tree ( system out , expr ) ; } object value = expr get value ( context ) ; if ( value = = null ) { if ( expected value = = null ) { return ; / / no point doing other checks } assert that ( expected value ) as ( " expression returned null value , but expected ' " + expected value + " ' " ) is null ( ) ; } class < ? extends object > result type = value get class ( ) ; if ( expected value instanceof string ) { assert that ( abstract expression tests string value of ( value ) ) as ( " did not get expected value for expression ' " + expression + " ' " ) is equal to ( expected value ) ; } else { assert that ( value ) as ( " did not get expected value for expression ' " + expression + " ' " ) is equal to ( expected value ) ; } assert that ( expected class of result equals ( result type ) ) as ( " type of the result was not as expected expected ' " + expected class of result + " ' but result was of type ' " + result type + " ' " ) is true ( ) ; assert that ( expr is writable ( context ) ) as ( " is writable " ) is equal to ( should be writable ) ; }


tests list serialization and deserialization match

public void test list serialization ( ) throws exception { final long key = 0l ; final rocks d b keyed state backend < long > long heap keyed state backend = rocks d b test utils builder for test defaults ( temporary folder get root ( ) , long serializer instance ) build ( ) ; long heap keyed state backend set current key ( key ) ; final internal list state < long , void namespace , long > list state = long heap keyed state backend create internal state ( void namespace serializer instance , new list state descriptor < > ( " test " , long serializer instance ) ) ; kv state request serializer test test list serialization ( key , list state ) ; long heap keyed state backend dispose ( ) ; }


ticket update ticket ( ticket ticket ) ;


represents the upper bound in bytes for a set of headers before a { @ code go away } should be sent this will be { @ code < = } < a href = " https : tools ietf orghtmlrfc 7 5 4 0 # section - 6 5 2 " > settings max header list size


public void test d c g at six missing ratings ( ) { list < rated document > rated = new array list < > ( ) ; integer [ ] relevance ratings = new integer [ ] { 3 , 2 , 3 , null , 1 } ; search hit [ ] hits = new search hit [ 6 ] ; for ( int i = 0 ; i < 6 ; i + + ) { if ( i < relevance ratings length ) { if ( relevance ratings [ i ] ! = null ) { rated add ( new rated document ( " index " , integer to string ( i ) , relevance ratings [ i ] ) ) ; } } hits [ i ] = new search hit ( i , integer to string ( i ) , collections empty map ( ) , collections empty map ( ) ) ; hits [ i ] shard ( new search shard target ( " testnode " , new shard id ( " index " , " uuid " , 0 ) , null , original indices none ) ) ; } discounted cumulative gain dcg = new discounted cumulative gain ( ) ; eval query quality result = dcg evaluate ( " id " , hits , rated ) ; assert equals ( 12 779642067948913 , result metric score ( ) , delta ) ; assert equals ( 2 , filter unrated documents ( result get hits and ratings ( ) ) size ( ) ) ;


returns the timestamp for the first sample in the last decoded frame

public long get last frame timestamp ( ) { return flac get last frame timestamp ( native decoder context ) ; }


return the time to live for this object in milliseconds

public long get time to live in millis ( ) throws transaction timed out exception { if ( this deadline = = null ) { throw new illegal state exception ( " no timeout specified for this resource holder " ) ; } long time to live = this deadline get time ( ) - system current time millis ( ) ; check transaction timeout ( time to live < = 0 ) ; return time to live ; }


tells this service to find all places where the given datatype is defined < b > and < b > will display the results of the search

public void find and display applied data type addresses ( composite data type , string field name ) ;


return error message with details from the response body , possibly truncated : 404 not found : [ { ' id ' : 123 , ' message ' : ' my very long ( 500 bytes ) ]

private string get error message ( int raw status code , string status text , @ nullable byte [ ] response body , @ nullable charset charset ) { string preface = raw status code + " " + status text + " : " ; if ( object utils is empty ( response body ) ) { return preface + " [ no body ] " ; } if ( charset = = null ) { charset = standard charsets utf 8 ; } int max chars = 200 ; if ( response body length < max chars * 2 ) { return preface + " [ " + new string ( response body , charset ) + " ] " ; } try { reader reader = new input stream reader ( new byte array input stream ( response body ) , charset ) ; char buffer buffer = char buffer allocate ( max chars ) ; reader read ( buffer ) ; reader close ( ) ; buffer flip ( ) ; return preface + " [ " + buffer to string ( ) + " ( " + response body length + " bytes ) ] " ; } catch ( i o exception ex ) { / / should never happen throw new illegal state exception ( ex ) ; } }


public source type [ ] get stack variable sources ( ) { return stack var sources ; }


set whether this bean definition is ' synthetic ' , that is , not defined by the application itself ( for example , an infrastructure bean such as a helper for auto - proxying , created through { @ code < aop : config > } )

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


returns the row object for the given row this is the row in the ui for models that know how to filter , the model row value will not match the view row value for non - filtering models the view and model rows will always be the same

public t get row object ( int view row ) ;


sample size controlling subsampling , see { @ link gif options # set in sample size ( int ) } for more details note that this call will overwrite sample size set previously by { @ link # options ( gif options ) }

public t sample size ( @ int range ( from = 1 , to = character max value ) final int sample size ) { m options set in sample size ( sample size ) ; return self ( ) ; }


validate a all of schema can be deserialized into the expected class

public void test all of schema ( ) throws exception { { string str = " { \ " class name \ " : \ " dog \ " , \ " color \ " : \ " white \ " , \ " breed \ " : \ " siberian husky \ " } " ; / / we should be able to deserialize a dog into a dog dog d = json get context ( null ) read value ( str , dog class ) ; assert not null ( d ) ; assert equals ( " white " , d get color ( ) ) ; } { string str = " { \ " pet type \ " : \ " child cat \ " , \ " name \ " : \ " fluffy \ " , " + " \ " stuff 1 \ " : \ " the value \ " , " + / / additional , undeclared property of type string " \ " stuff 2 \ " : { \ " p 1 \ " : 123 } , " + / / additional , undeclared property of type object " \ " stuff 3 \ " : null , " + / / additional , undeclared property with null value " \ " stuff 4 \ " : [ 12 , \ " abc \ " ] " + / / additional , undeclared property of type array " } " ; grandparent animal o = json get context ( null ) read value ( str , grandparent animal class ) ; assert not null ( o ) ; assert true ( o instanceof parent pet ) ; assert true ( o instanceof child cat ) ; child cat c = ( child cat ) o ; assert equals ( " fluffy " , c get name ( ) ) ; assert not null ( c get additional properties ( ) ) ; assert equals ( 4 , c get additional properties ( ) size ( ) ) ; assert true ( c get additional properties ( ) contains key ( " stuff 1 " ) ) ; assert true ( c get additional properties ( ) contains key ( " stuff 2 " ) ) ; assert true ( c get additional properties ( ) contains key ( " stuff 3 " ) ) ; assert true ( c get additional properties ( ) contains key ( " stuff 4 " ) ) ; assert equals ( " the value " , c get additional properties ( ) get ( " stuff 1 " ) ) ; assert not null ( c get additional properties ( ) get ( " stuff 2 " ) ) ; assert true ( c get additional properties ( ) get ( " stuff 2 " ) instanceof map ) ; assert null ( c get additional properties ( ) get ( " stuff 3 " ) ) ; assert not null ( c get additional properties ( ) get ( " stuff 4 " ) ) ; assert true ( c get additional properties ( ) get ( " stuff 4 " ) instanceof list ) ; } { string str = " { \ " pet type \ " : \ " child cat \ " , \ " name \ " : \ " fluffy \ " } " ; parent pet o = json get context ( null ) read value ( str , parent pet class ) ; assert not null ( o ) ; assert true ( o instanceof child cat ) ; child cat c = ( child cat ) o ; assert equals ( " fluffy " , c get name ( ) ) ; } { / / wrong discriminator value in the payload string str = " { \ " pet type \ " : \ " garbage \ " , \ " name \ " : \ " fluffy \ " } " ; exception exception = assert throws ( json mapping exception class , ( ) - > { json get context ( null ) read value ( str , grandparent animal class ) ; } ) ; assert true ( exception get message ( ) contains ( " could not resolve type id ' garbage ' " ) ) ; } }


public void test status values ( ) throws exception { checkpoint stats status in progress = checkpoint stats status in progress ; assert true ( in progress is in progress ( ) ) ; assert false ( in progress is completed ( ) ) ; assert false ( in progress is failed ( ) ) ; checkpoint stats status completed = checkpoint stats status completed ; assert false ( completed is in progress ( ) ) ; assert true ( completed is completed ( ) ) ; assert false ( completed is failed ( ) ) ; checkpoint stats status failed = checkpoint stats status failed ; assert false ( failed is in progress ( ) ) ; assert false ( failed is completed ( ) ) ; assert true ( failed is failed ( ) ) ; }


public span utils set foreground color ( @ color int final int color ) { this foreground color = color ; return this ; }


programmatic schema update on a given connection returning feedback about what happened

string database schema upgrade ( connection connection , string catalog , string schema ) ;


public boolean delete config ( http servlet request request , http servlet response response , @ request param ( " namespace id " ) string namespace id ) { persist service remove tenant info atomic ( " 1 " , namespace id ) ; return true ; }


for each checkpoint we create new { @ link flink kafka internal producer } so that new transactions will not clash with transactions created during previous checkpoints ( { @ code producer init transactions ( ) } assures that we obtain new producer id and epoch counters )

private flink kafka internal producer < byte [ ] , byte [ ] > create transactional producer ( ) throws flink kafka exception { string transactional id = available transactional ids poll ( ) ; if ( transactional id = = null ) { throw new flink kafka exception ( flink kafka error code producers pool empty , " too many ongoing snapshots increase kafka producers pool size or decrease number of concurrent checkpoints " ) ; } flink kafka internal producer < byte [ ] , byte [ ] > producer = init transactional producer ( transactional id , true ) ; producer init transactions ( ) ; return producer ; }


path key to path ( string key ) { return new path ( " / " + key ) ; }


test timer fired event for intermediate timer bpmn event

public void test timer fired for intermediate timer ( ) throws exception { runtime service start process instance by key ( " test timer fired for intermediate timer " ) ; / / force timer to start the process calendar tomorrow = calendar get instance ( ) ; tomorrow add ( calendar day of year , 1 ) ; process engine configuration get clock ( ) set current time ( tomorrow get time ( ) ) ; wait for job executor to process all jobs ( 2000 , 100 ) ; check event count ( 1 , activiti event type timer scheduled ) ; check event count ( 0 , activiti event type job canceled ) ; check event count ( 1 , activiti event type timer fired ) ; }


drops a temporary catalog function registered in the given path if a permanent function with the given path exists , it will be used from now on for any queries that reference this path

boolean drop temporary function ( string path ) ;


returns the first principal from subject

public static string first principal ( subject subject ) { set < principal > principals = subject get principals ( ) ; synchronized ( principals ) { iterator < principal > iterator = principals iterator ( ) ; if ( iterator has next ( ) ) return iterator next ( ) get name ( ) ; else throw new kafka exception ( " principal could not be determined from subject , this may be a transient failure due to kerberos re - login " ) ; } }


private boolean insert branch transaction d o ( branch transaction d o branch transaction d o ) { string branch key = build branch key ( branch transaction d o get branch id ( ) ) ; string branch list key = build branch list key by xid ( branch transaction d o get xid ( ) ) ; try ( jedis jedis = jedis pooled factory get jedis instance ( ) ) { date now = new date ( ) ; branch transaction d o set gmt create ( now ) ; branch transaction d o set gmt modified ( now ) ; pipeline pipelined = jedis pipelined ( ) ; pipelined hmset ( branch key , bean utils object to map ( branch transaction d o ) ) ; pipelined rpush ( branch list key , branch key ) ; pipelined sync ( ) ; return true ; } catch ( exception ex ) { throw new redis exception ( ex ) ; } }


process the supplied , newly instantiated { @ link merged context configuration } instance the returned { @ link merged context configuration } instance may be a wrapper around or a replacement for the original the default implementation simply returns the supplied instance unmodified concrete subclasses may choose to return a specialized subclass of { @ link merged context configuration } based on properties in the supplied instance

protected merged context configuration process merged context configuration ( merged context configuration merged config ) { return merged config ; }


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

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


tests compatibility with pre - 0 21 versions of tuple writable

public void test pre version 2 1 compatibility ( ) throws exception { writable [ ] many writs = make random writables ( 64 ) ; pre version 2 1 tuple writable old tuple = new pre version 2 1 tuple writable ( many writs ) ; for ( int i = 0 ; i < many writs length ; i + + ) { if ( i % 3 = = 0 ) { old tuple set written ( i ) ; } } byte array output stream out = new byte array output stream ( ) ; old tuple write ( new data output stream ( out ) ) ; byte array input stream in = new byte array input stream ( out to byte array ( ) ) ; tuple writable d tuple = new tuple writable ( ) ; d tuple read fields ( new data input stream ( in ) ) ; assert true ( " tuple writable is unable to read pre - 0 21 versions of tuple writable " , old tuple is compatible ( d tuple ) ) ; assert equals ( " all tuple data has not been read from the stream " , - 1 , in read ( ) ) ; }


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

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


void handle method exception ( enhanced instance obj inst , method method , object [ ] all arguments , class < ? > [ ] arguments types , throwable t ) ;


public boolean remove ( object key , object value ) { int hash = hash ( key ) ; segment < k , v > s ; return value ! = null & & ( s = segment for hash ( hash ) ) ! = null & & s remove ( key , hash , value ) ! = null ; }


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

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


public builder add providers ( transitive info provider providers ) { return add providers ( arrays as list ( providers ) ) ; }


load the param information only when needed

protected void lazy load arguments ( ) { / / shortcut if no args need to be loaded if ( object utils is empty ( this arguments ) ) { return ; } / / expose indexed variables as well as parameter names ( if discoverable ) string [ ] param names = this parameter name discoverer get parameter names ( this method ) ; int param count = ( param names ! = null ? param names length : this method get parameter count ( ) ) ; int args count = this arguments length ; for ( int i = 0 ; i < param count ; i + + ) { object value = null ; if ( args count > param count & & i = = param count - 1 ) { / / expose remaining arguments as vararg array for last parameter value = arrays copy of range ( this arguments , i , args count ) ; } else if ( args count > i ) { / / actual argument found - otherwise left as null value = this arguments [ i ] ; } set variable ( " a " + i , value ) ; set variable ( " p " + i , value ) ; if ( param names ! = null & & param names [ i ] ! = null ) { set variable ( param names [ i ] , value ) ; } } }


public void test chain submission ( ) throws exception { configuration conf = create job conf ( ) ; job job = map reduce test util create job ( conf , in dir , out dir , 0 , 0 , input ) ; job set job name ( " chain " ) ; throwable th = null ; / / output key , value classes of first map are not same as that of second map try { chain mapper add mapper ( job , mapper class , long writable class , text class , int writable class , text class , null ) ; chain mapper add mapper ( job , mapper class , long writable class , text class , long writable class , text class , null ) ; } catch ( illegal argument exception iae ) { th = iae ; } assert true ( th ! = null ) ; th = null ; / / output key , value classes of reducer are not / / same as that of mapper in the chain try { chain reducer set reducer ( job , reducer class , long writable class , text class , int writable class , text class , null ) ; chain mapper add mapper ( job , mapper class , long writable class , text class , long writable class , text class , null ) ; } catch ( illegal argument exception iae ) { th = iae ; } assert true ( th ! = null ) ; }


return the time that the file was last modified

public static long get file last modified ( final file file ) { if ( file = = null ) return - 1 ; return file last modified ( ) ; }


updates the index an iterator is pointing to after a call to remove : returns the index of the entry that should be looked at after a removal on index removed , with index before remove as the index that was the next entry that would be looked at

int adjust after remove ( int index before remove , @ suppress warnings ( " unused " ) int index removed ) { return index before remove - 1 ; }


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


remove the object identified by the given name

public void remove ( string name ) { map remove ( name ) ; }


visits a conditional expression checks : type validation

public void visit conditional ( e conditional user conditional node , semantic scope semantic scope ) { if ( semantic scope get condition ( user conditional node , write class ) ) { throw user conditional node create error ( new illegal argument exception ( " invalid assignment : cannot assign a value to conditional operation [ ? : ] " ) ) ; } if ( semantic scope get condition ( user conditional node , read class ) = = false ) { throw user conditional node create error ( new illegal argument exception ( " not a statement : result not used from conditional operation [ ? : ] " ) ) ; } a expression user condition node = user conditional node get condition node ( ) ; semantic scope set condition ( user condition node , read class ) ; semantic scope put decoration ( user condition node , new target type ( boolean class ) ) ; checked visit ( user condition node , semantic scope ) ; decorate with cast ( user condition node , semantic scope ) ; a expression user true node = user conditional node get true node ( ) ; semantic scope set condition ( user true node , read class ) ; semantic scope copy decoration ( user conditional node , user true node , target type class ) ; semantic scope replicate condition ( user conditional node , user true node , explicit class ) ; semantic scope replicate condition ( user conditional node , user true node , internal class ) ; checked visit ( user true node , semantic scope ) ; class < ? > left value type = semantic scope get decoration ( user true node , value type class ) get value type ( ) ; a expression user false node = user conditional node get false node ( ) ; semantic scope set condition ( user false node , read class ) ; semantic scope copy decoration ( user conditional node , user false node , target type class ) ; semantic scope replicate condition ( user conditional node , user false node , explicit class ) ; semantic scope replicate condition ( user conditional node , user false node , internal class ) ; checked visit ( user false node , semantic scope ) ; class < ? > right value type = semantic scope get decoration ( user false node , value type class ) get value type ( ) ; target type target type = semantic scope get decoration ( user conditional node , target type class ) ; class < ? > value type ; if ( target type = = null ) { class < ? > promote = analyzer caster promote conditional ( left value type , right value type ) ; if ( promote = = null ) { throw user conditional node create error ( new class cast exception ( " cannot apply the conditional operator [ ? : ] to the types " + " [ " + painless lookup utility type to canonical type name ( left value type ) + " ] and " + " [ " + painless lookup utility type to canonical type name ( right value type ) + " ] " ) ) ; } semantic scope put decoration ( user true node , new target type ( promote ) ) ; semantic scope put decoration ( user false node , new target type ( promote ) ) ; value type = promote ; } else { value type = target type get target type ( ) ; } decorate with cast ( user true node , semantic scope ) ; decorate with cast ( user false node , semantic scope ) ; semantic scope put decoration ( user conditional node , new value type ( value type ) ) ; }


returns and nulls out the aggregation for this search results this allows to free up memory once the aggregation is consumed

public delayable writeable < internal aggregations > consume aggs ( ) { if ( aggregations = = null ) { throw new illegal state exception ( " aggs already consumed " ) ; } delayable writeable < internal aggregations > aggs = aggregations ; aggregations = null ; return aggs ; }


creates a new buffer which wraps the specified nio buffer ' s current slice a modification on the specified buffer ' s content will be visible to the returned buffer

public static byte buf wrapped buffer ( byte buffer buffer ) { if ( ! buffer has remaining ( ) ) { return empty buffer ; } if ( ! buffer is direct ( ) & & buffer has array ( ) ) { return wrapped buffer ( buffer array ( ) , buffer array offset ( ) + buffer position ( ) , buffer remaining ( ) ) order ( buffer order ( ) ) ; } else if ( platform dependent has unsafe ( ) ) { if ( buffer is read only ( ) ) { if ( buffer is direct ( ) ) { return new read only unsafe direct byte buf ( alloc , buffer ) ; } else { return new read only byte buffer buf ( alloc , buffer ) ; } } else { return new unpooled unsafe direct byte buf ( alloc , buffer , buffer remaining ( ) ) ; } } else { if ( buffer is read only ( ) ) { return new read only byte buffer buf ( alloc , buffer ) ; } else { return new unpooled direct byte buf ( alloc , buffer , buffer remaining ( ) ) ; } } }


set the names of the beans that should automatically get wrapped with proxies a name can specify a prefix to match by ending with " " , e g " my bean , tx " will match the bean named " my bean " and all beans whose name start with " tx " < b > note : < b > in case of a factory bean , only the objects created by the factory bean will get proxied this default behavior applies as of spring 2 0 if you intend to proxy a factory bean instance itself ( a rare use case , but spring 1 2 ' s default behavior ) , specify the bean name of the factory bean including the factory - bean prefix " & " : e g " & my factory bean "

public void set bean names ( string bean names ) { assert not empty ( bean names , " ' bean names ' must not be empty " ) ; this bean names = new array list < > ( bean names length ) ; for ( string mapped name : bean names ) { this bean names add ( string utils trim whitespace ( mapped name ) ) ; } }


implementation of the actual value retrieval will return the value on success , an exception on failure , a cancellation on cancellation , or an illegal state if the synchronizer is in an invalid state

private v get value ( ) throws cancellation exception , execution exception { int state = get state ( ) ; switch ( state ) { case completed : if ( exception ! = null ) { throw new execution exception ( exception ) ; } else { return value ; } case cancelled : case interrupted : throw cancellation exception with cause ( " task was cancelled " , exception ) ; default : throw new illegal state exception ( " error , synchronizer in invalid state : " + state ) ; } }


public static list < fragment > get fragments ( @ non null final fragment manager fm ) { list < fragment > fragments = fm get fragments ( ) ; if ( fragments = = null | | fragments is empty ( ) ) return collections empty list ( ) ; return fragments ; }


public synchronized boolean add child ( node child ) { if ( child parent ! = null ) { throw new illegal argument exception ( " the child is already under another node : " + child parent ) ; } check children ( ) ; boolean retval = children add ( child ) ; if ( retval ) child parent = this ; return retval ; }


atomically removes the given inner subscription from the subscribers array

void remove ( inner subscription < t > p ) { / / the state can change so we do a cas loop to achieve atomicity for ( ; ; ) { / / let ' s read the current subscribers array inner subscription < t > [ ] c = subscribers get ( ) ; int len = c length ; / / if it is either empty or terminated , there is nothing to remove so we quit if ( len = = 0 ) { return ; } / / let ' s find the supplied producer in the array / / although this is o ( n ) , we don ' t expect too many child subscribers in general int j = - 1 ; for ( int i = 0 ; i < len ; i + + ) { if ( c [ i ] equals ( p ) ) { j = i ; break ; } } / / we didn ' t find it so just quit if ( j < 0 ) { return ; } / / we do copy - on - write logic here inner subscription < t > [ ] u ; / / we don ' t create a new empty array if producer was the single inhabitant / / but rather reuse an empty array if ( len = = 1 ) { u = empty ; } else { / / otherwise , create a new array one less in size u = new inner subscription [ len - 1 ] ; / / copy elements being before the given producer system arraycopy ( c , 0 , u , 0 , j ) ; / / copy elements being after the given producer system arraycopy ( c , j + 1 , u , j , len - j - 1 ) ; } / / try setting this new array as if ( subscribers compare and set ( c , u ) ) { return ; } / / if we failed , it means something else happened / / ( a concurrent add / remove or termination ) , we need to retry } }


post pet { pet id } : updates a pet in the store with form data

response entity < void > update pet with form ( @ api param ( value = " id of pet that needs to be updated " , required = true ) @ path variable ( " pet id " ) long pet id , @ api param ( value = " updated name of the pet " ) @ request param ( value = " name " , required = false ) string name , @ api param ( value = " updated status of the pet " ) @ request param ( value = " status " , required = false ) string status ) ;


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


normalize the path and , if it is absolute , make it relative ( e g , foobar becomes foobar )

private static path fragment relativize ( string path ) { path fragment entry path = path fragment create ( path ) ; if ( entry path is absolute ( ) ) { entry path = entry path to relative ( ) ; } return entry path ; }


public int get dependency check ( ) { return this dependency check ; }


specify that value that the dynamic value will be animated from

public animation builder from ( float from ) { m from = from ; return this ; }


forwards item created callback to all listeners within this list

public void item created ( string parent path , string item name ) { if ( enable asynchronous dispatching ) { add ( new item created event ( parent path , item name ) ) ; } else { for ( file system listener l : listener list ) { l item created ( parent path , item name ) ; } } }


adds key value pairs as " - dkey = value - dkey = value " { @ code - d } portion is configurable as the ' prefix ' parameter

public argument list builder add key value pairs ( string prefix , map < string , string > props ) { for ( entry < string , string > e : props entry set ( ) ) add key value pair ( prefix , e get key ( ) , e get value ( ) , false ) ; return this ; }


asserts that two objects are equal if they are not , an { @ link assertion error } is thrown

protected void assert original equals to unmarshalled ( r expected , r actual ) { assert assert equals ( expected , actual ) ; }


gets the same thing as the ' this ' list represents , except as { @ link extension component } s

public list < extension component < t > > get components ( ) { return collections unmodifiable list ( ensure loaded ( ) ) ; }


inverts this matrix given that the determinant is ! = 0

public matrix 3 inv ( ) { float det = det ( ) ; if ( det = = 0 ) throw new gdx runtime exception ( " can ' t invert a singular matrix " ) ; float inv det = 1 0f / det ; float [ ] tmp = this tmp , val = this val ; tmp [ m00 ] = val [ m11 ] * val [ m22 ] - val [ m21 ] * val [ m12 ] ; tmp [ m10 ] = val [ m20 ] * val [ m12 ] - val [ m10 ] * val [ m22 ] ; tmp [ m20 ] = val [ m10 ] * val [ m21 ] - val [ m20 ] * val [ m11 ] ; tmp [ m01 ] = val [ m21 ] * val [ m02 ] - val [ m01 ] * val [ m22 ] ; tmp [ m11 ] = val [ m00 ] * val [ m22 ] - val [ m20 ] * val [ m02 ] ; tmp [ m21 ] = val [ m20 ] * val [ m01 ] - val [ m00 ] * val [ m21 ] ; tmp [ m02 ] = val [ m01 ] * val [ m12 ] - val [ m11 ] * val [ m02 ] ; tmp [ m12 ] = val [ m10 ] * val [ m02 ] - val [ m00 ] * val [ m12 ] ; tmp [ m22 ] = val [ m00 ] * val [ m11 ] - val [ m10 ] * val [ m01 ] ; val [ m00 ] = inv det * tmp [ m00 ] ; val [ m10 ] = inv det * tmp [ m10 ] ; val [ m20 ] = inv det * tmp [ m20 ] ; val [ m01 ] = inv det * tmp [ m01 ] ; val [ m11 ] = inv det * tmp [ m11 ] ; val [ m21 ] = inv det * tmp [ m21 ] ; val [ m02 ] = inv det * tmp [ m02 ] ; val [ m12 ] = inv det * tmp [ m12 ] ; val [ m22 ] = inv det * tmp [ m22 ] ; return this ; }


returns true iff this graph is a subgraph of the argument this means that this graph ' s nodes are a subset of those of the argument ; moreover , for each node of this graph the set of successors is a subset of those of the corresponding node in the argument graph this algorithm is o ( n ^ 2 ) , but linear in the total sizes of the graphs

public boolean is subgraph ( object that object ) { if ( this = = that object ) { return true ; } if ( ! ( that object instanceof digraph ) ) { return false ; } @ suppress warnings ( " unchecked " ) digraph < t > that = ( digraph < t > ) that object ; if ( this get node count ( ) > that get node count ( ) ) { return false ; } for ( node < t > n 1 : nodes values ( ) ) { node < t > n 2 = that get node maybe ( n 1 get label ( ) ) ; if ( n 2 = = null ) { return false ; / / ' that ' is missing a node } / / now compare the successor relations / / careful : / / - we can ' t do simple equality on the succs - sets because the / / nodes belong to two different graphs ! / / - there ' s no need to check both predecessor and successor / / relations , either one is sufficient collection < node < t > > n 1succs = n 1 get successors ( ) ; collection < node < t > > n 2succs = n 2 get successors ( ) ; if ( n 1succs size ( ) > n 2succs size ( ) ) { return false ; } / / foreach successor of n 1 , ensure n 2 has a similarly - labeled succ for ( node < t > succ 1 : n 1succs ) { node < t > succ 2 = that get node maybe ( succ 1 get label ( ) ) ; if ( succ 2 = = null ) { return false ; } if ( ! n 2succs contains ( succ 2 ) ) { return false ; } } } return true ; }


get the upper joint limit , usually in meters

public float get upper limit ( ) { return jni get upper limit ( addr ) ; }


return the entity resolver to use , building a default resolver if none specified

protected entity resolver get entity resolver ( ) { if ( this entity resolver = = null ) { / / determine default entity resolver to use resource loader resource loader = get resource loader ( ) ; if ( resource loader ! = null ) { this entity resolver = new resource entity resolver ( resource loader ) ; } else { this entity resolver = new delegating entity resolver ( get bean class loader ( ) ) ; } } return this entity resolver ; }


executes the given closure on each element in the array if the input array or closure is null , there is no change made

public static < e > void for all do ( object array , closure < e > closure ) { if ( array = = null | | closure = = null ) return ; if ( array instanceof object [ ] ) { object [ ] objects = ( object [ ] ) array ; for ( int i = 0 , length = objects length ; i < length ; i + + ) { object ele = objects [ i ] ; closure execute ( i , ( e ) ele ) ; } } else if ( array instanceof boolean [ ] ) { boolean [ ] booleans = ( boolean [ ] ) array ; for ( int i = 0 , length = booleans length ; i < length ; i + + ) { boolean ele = booleans [ i ] ; closure execute ( i , ( e ) ( ele ? boolean true : boolean false ) ) ; } } else if ( array instanceof byte [ ] ) { byte [ ] bytes = ( byte [ ] ) array ; for ( int i = 0 , length = bytes length ; i < length ; i + + ) { byte ele = bytes [ i ] ; closure execute ( i , ( e ) byte value of ( ele ) ) ; } } else if ( array instanceof char [ ] ) { char [ ] chars = ( char [ ] ) array ; for ( int i = 0 , length = chars length ; i < length ; i + + ) { char ele = chars [ i ] ; closure execute ( i , ( e ) character value of ( ele ) ) ; } } else if ( array instanceof short [ ] ) { short [ ] shorts = ( short [ ] ) array ; for ( int i = 0 , length = shorts length ; i < length ; i + + ) { short ele = shorts [ i ] ; closure execute ( i , ( e ) short value of ( ele ) ) ; } } else if ( array instanceof int [ ] ) { int [ ] ints = ( int [ ] ) array ; for ( int i = 0 , length = ints length ; i < length ; i + + ) { int ele = ints [ i ] ; closure execute ( i , ( e ) integer value of ( ele ) ) ; } } else if ( array instanceof long [ ] ) { long [ ] longs = ( long [ ] ) array ; for ( int i = 0 , length = longs length ; i < length ; i + + ) { long ele = longs [ i ] ; closure execute ( i , ( e ) long value of ( ele ) ) ; } } else if ( array instanceof float [ ] ) { float [ ] floats = ( float [ ] ) array ; for ( int i = 0 , length = floats length ; i < length ; i + + ) { float ele = floats [ i ] ; closure execute ( i , ( e ) float value of ( ele ) ) ; } } else if ( array instanceof double [ ] ) { double [ ] doubles = ( double [ ] ) array ; for ( int i = 0 , length = doubles length ; i < length ; i + + ) { double ele = doubles [ i ] ; closure execute ( i , ( e ) double value of ( ele ) ) ; } } else { throw new illegal argument exception ( " not an array : " + array get class ( ) ) ; } }


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


bind the side , making it active to render on should be called in between a call to { @ link # begin ( ) } and { @ link # end ( ) }

protected void bind side ( final cubemap cubemap side side ) { gdx gl 2 0 gl framebuffer texture 2 d ( gl20 gl framebuffer , gl20 gl color attachment0 , side gl enum , get color buffer texture ( ) get texture object handle ( ) , 0 ) ; }


returns true if this array contains the specified element

public boolean contains ( json element element ) { return elements contains ( element ) ; }


public void test delete non empty dir ( ) throws exception { path file = touch ( local fs , name get method name ( ) to lower case ( ) ) ; sftp fs delete ( local dir , false ) ; assert that ( ( ( s f t p file system ) sftp fs ) get connection pool ( ) get live conn count ( ) , is ( 1 ) ) ; }


returns an initialized test harness for { @ link keyed process function }

public static < k , in , out > keyed one input stream operator test harness < k , in , out > for keyed process function ( final keyed process function < k , in , out > function , final key selector < in , k > key selector , final type information < k > key type ) throws exception { keyed one input stream operator test harness < k , in , out > test harness = new keyed one input stream operator test harness < > ( new keyed process operator < > ( preconditions check not null ( function ) ) , key selector , key type , 1 , 1 , 0 ) ; test harness open ( ) ; return test harness ; }


launch two tasks which can only complete by running do run ( ) concurrently

public void timers arent blocked ( ) throws interrupted exception { final count down latch start latch = new count down latch ( 1 ) ; final count down latch stop latch = new count down latch ( 1 ) ; safe timer task task 1 = new safe timer task ( ) { @ override protected void do run ( ) throws exception { start latch count down ( ) ; stop latch await ( ) ; } } ; safe timer task task 2 = new safe timer task ( ) { @ override protected void do run ( ) { stop latch count down ( ) ; } } ; timer get ( ) schedule ( task 1 , 1 , time unit milliseconds ) ; start latch await ( ) ; timer get ( ) schedule ( task 2 , 2 , time unit milliseconds ) ; if ( ! stop latch await ( 10000 , time unit milliseconds ) ) { fail ( " failed to run the two tasks simultaneously " ) ; } }


convert an exception object to a json string

public static string to json string ( final exception e ) { final map < string , object > m = new tree map < string , object > ( ) ; m put ( " exception " , e get class ( ) get simple name ( ) ) ; m put ( " message " , e get message ( ) ) ; m put ( " java class name " , e get class ( ) get name ( ) ) ; return to json string ( remote exception class , m ) ; }


gets the attributes associated with the addresses resolved by name resolution if there are no attributes , { @ link attributes # empty } will be returned

public attributes get attributes ( ) { return attributes ; }


resets the state of the reader subsequent calls to { @ link # read ( extractor input ) } will start reading a new ebml structure from scratch


rewrites the underlying aggregation builders into their primitive form if the builder did not change the identity reference must be returned otherwise the builder will be rewritten infinitely

public builder rewrite ( query rewrite context context ) throws i o exception { boolean changed = false ; builder new builder = new builder ( ) ; for ( aggregation builder builder : aggregation builders ) { aggregation builder result = rewriteable rewrite ( builder , context ) ; new builder add aggregator ( result ) ; changed | = result ! = builder ; } for ( pipeline aggregation builder builder : pipeline aggregator builders ) { pipeline aggregation builder result = rewriteable rewrite ( builder , context ) ; new builder add pipeline aggregator ( result ) ; changed | = result ! = builder ; } return changed ? new builder : this ; }


creates the start { @ link state } of the resulting nfa graph

private state < t > create start state ( state < t > sink state ) { final state < t > beginning state = convert pattern ( sink state ) ; beginning state make start ( ) ; return beginning state ; }


whether to raise a fatal bind exception on validation errors

protected boolean is bind exception required ( web data binder binder , method parameter parameter ) { int i = parameter get parameter index ( ) ; class < ? > [ ] param types = parameter get executable ( ) get parameter types ( ) ; boolean has binding result = ( param types length > ( i + 1 ) & & errors class is assignable from ( param types [ i + 1 ] ) ) ; return ! has binding result ; }


deactivate throttling , which switches the lock to be an always - acquirable no op lock

public void deactivate ( ) { assert lock ! = noop lock : " throttling deactivated but not active " ; lock = noop lock ; assert start of throttle n s > 0 : " bad state of start of throttle n s " ; long throttle time n s = system nano time ( ) - start of throttle n s ; if ( throttle time n s > = 0 ) { / / paranoia ( system nano time ( ) is supposed to be monotonic ) : time slip may have occurred but never want / / to add a negative number throttle time millis metric inc ( time value nsec to m sec ( throttle time n s ) ) ; } }


todo check to make sure programs are disjoint and contiguous memory spaces


public redis connection config builder with database ( int database ) { assert util is true ( database > = 0 , " invalid database number : " + database ) ; this database = database ; return this ; }


public void clear ( ) { log info ( " clearing all mount location caches " ) ; write lock lock ( ) ; try { if ( this location cache ! = null ) { this location cache invalidate all ( ) ; } this tree clear ( ) ; } finally { write lock unlock ( ) ; } }


add a component to be position over the given location

protected void add component ( field location loc , component comp ) { loc = new field location ( loc get index ( ) , loc get field num ( ) ) ; components by location put ( loc , comp ) ; locations by component put ( comp , loc ) ; }


retrieves , but does not remove , the greatest element of this queue , or returns { @ code null } if the queue is empty

public e peek last ( ) { return is empty ( ) ? null : element data ( get max element index ( ) ) ; }


gets principal resolver linked to the handler if any

protected principal resolver get principal resolver linked to handler if any ( final authentication handler handler , final authentication transaction transaction ) { return this authentication event execution plan get principal resolver ( handler , transaction ) ; }


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


called when there ' s a change in the aspect ratio of the content being displayed the default implementation sets the aspect ratio of the content frame to that of the content , unless the content view is a { @ link spherical g l surface view } in which case the frame ' s aspect ratio is cleared

protected void on content aspect ratio changed ( float content aspect ratio , @ nullable aspect ratio frame layout content frame , @ nullable view content view ) { if ( content frame ! = null ) { content frame set aspect ratio ( content view instanceof spherical g l surface view ? 0 : content aspect ratio ) ; } }


a 3 wants a 2 , a 2 wants a 1 , a 1 wants no one , path is a 1 , a 2 , a 3

public void linear aspect path 2 ( ) throws exception { aspect a 1 = create aspect ( " a 1 " ) ; aspect a 2 = create aspect ( " a 2 " , " a 1 " ) ; aspect a 3 = create aspect ( " a 3 " , " a 2 " ) ; aspect collection collection = aspect collection create ( immutable list of ( a 1 , a 2 , a 3 ) ) ; validate aspect collection ( collection , immutable list of ( a 1 , a 2 , a 3 ) , expect deps ( a 3 , a 2 ) , expect deps ( a 2 , a 1 ) , expect deps ( a 1 ) ) ; }


check that the expected targets were exactly those visited , and that the packages of these expected targets were exactly those packages visited

protected void assert expected targets ( set < string > expected labels , set < label > starting labels ) throws exception { set < label > visited labels = get visited labels ( starting labels , get skyframe executor ( ) ) ; assert that ( visited labels ) contains exactly elements in ( as label set ( expected labels ) ) ; }


redirects any http request of type get on ' from path ' to ' to path '

public void get ( string from path , string to path ) { get ( from path , to path , null ) ; }


public int get connect timeout ( ) { return connection timeout ; }


uses the given service and its { @ link data type manager } s to find the data type represented by this url

public data type get data type ( data type manager service service ) { data type manager manager = find manager ( service ) ; if ( manager = = null ) { return null ; } if ( data type id = = null ) { / / the id will be null for built - in types in that case , the name will not be / / null further , built - in types live at the root , so we can just ask for the / / type by name return manager get data type ( new data type path ( category path root , data type name ) ) ; } data type dt = manager find data type for i d ( data type id ) ; return dt ; }


void new column ( grid column column , int index ) { if ( index = = - 1 ) { columns add ( column ) ; } else { columns add ( index , column ) ; } }


first data source failed with intermediate results , second succeeded with intermediate results

public void test lifecycle i1 f1 i2 s2 c ( ) { data source < object > data source = get and subscribe ( ) ; data subscriber < object > subscriber 1 = verify get and subscribe ( m data source supplier 1 , m src 1 ) ; object val 1 = mock ( object class ) ; set state ( m src 1 , not closed , not finished , with result , val 1 , not failed , null ) ; subscriber 1 on new result ( m src 1 ) ; verify subscriber ( data source , m src 1 , on new result ) ; verify state ( data source , m src 1 , not closed , not finished , with result , val 1 , not failed , null ) ; set state ( m src 1 , not closed , finished , with result , val 1 , failed , mock ( throwable class ) ) ; subscriber 1 on failure ( m src 1 ) ; data subscriber < object > subscriber 2 = verify get and subscribe ( m data source supplier 2 , m src 2 ) ; verify state ( data source , m src 1 , not closed , not finished , with result , val 1 , not failed , null ) ; / / i2 gets ignored because we already have i1 object val 2 = mock ( object class ) ; set state ( m src 2 , not closed , not finished , with result , val 2 , not failed , null ) ; subscriber 2 on new result ( m src 2 ) ; verify subscriber ( data source , m src 2 , no interactions ) ; verify state ( data source , m src 1 , not closed , not finished , with result , val 1 , not failed , null ) ; object val = mock ( object class ) ; set state ( m src 2 , not closed , finished , with result , val , not failed , null ) ; subscriber 2 on new result ( m src 2 ) ; m in order verify ( m src 1 ) close ( ) ; verify subscriber ( data source , m src 2 , on new result ) ; verify state ( data source , m src 2 , not closed , finished , with result , val , not failed , null ) ; test close ( data source , m src 2 ) ; verify state ( data source , null , closed , finished , without result , null , not failed , null ) ; }


public void clear ( ) { ( ( f v table model ) get model ( ) ) clear ( ) ; }


mark the index with step info explaining that the policy doesn ' t exist

private void mark policy does not exist ( string policy name , index index , lifecycle execution state execution state ) { mark policy retrieval error ( policy name , index , execution state , new illegal argument exception ( " policy [ " + policy name + " ] does not exist " ) ) ; }


public void set custom load more view ( view customview ) { custom load more view = customview ; }


similar to { @ link # activate process definition by key ( string , boolean , date ) } , but only applicable for the given tenant identifier

void activate process definition by key ( string process definition key , boolean activate process instances , date activation date , string tenant id ) ;


indicates whether this marshaller can marshal instances of the supplied generic type

boolean supports ( type generic type ) ;


release the given resource ( after it has been unbound from the thread )

protected void release resource ( h resource holder , k resource key ) { }


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


resolves { @ code path name } relative to the working directory note that this will not create any entity in the filesystem ; i e , the file that the object is describing may not exist in the filesystem

public path resolve ( string path name ) { return working dir get relative ( path name ) ; }


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


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

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