returns a sun misc unsafe suitable for use in a 3rd party package replace with a simple call to unsafe get unsafe when integrating into a jdk

private static sun misc unsafe get unsafe ( ) { try { return sun misc unsafe get unsafe ( ) ; } catch ( security exception try reflection instead ) { } try { return java security access controller do privileged ( new java security privileged exception action < sun misc unsafe > ( ) { @ override public sun misc unsafe run ( ) throws exception { class < sun misc unsafe > k = sun misc unsafe class ; for ( java lang reflect field f : k get declared fields ( ) ) { f set accessible ( true ) ; object x = f get ( null ) ; if ( k is instance ( x ) ) return k cast ( x ) ; } throw new no such field error ( " the unsafe " ) ; } } ) ; } catch ( java security privileged action exception e ) { throw new runtime exception ( " could not initialize intrinsics " , e get cause ( ) ) ; } }


subclasses should implement this method to test { @ link encoder # can encode }

public abstract void can encode ( ) throws exception ;


tests audio track selection when there are multiple audio renderers

public void select preferred text track multiple renderers ( ) throws exception { format builder format builder = text format build upon ( ) ; format english = format builder set id ( " en " ) set language ( " en " ) build ( ) ; format german = format builder set id ( " de " ) set language ( " de " ) build ( ) ; / / first renderer handles english map < string , integer > first renderer mapped capabilities = new hash map < > ( ) ; first renderer mapped capabilities put ( english id , format handled ) ; first renderer mapped capabilities put ( german id , format unsupported subtype ) ; renderer capabilities first renderer capabilities = new fake mapped renderer capabilities ( c track type text , first renderer mapped capabilities ) ; / / second renderer handles german map < string , integer > second renderer mapped capabilities = new hash map < > ( ) ; second renderer mapped capabilities put ( english id , format unsupported subtype ) ; second renderer mapped capabilities put ( german id , format handled ) ; renderer capabilities second renderer capabilities = new fake mapped renderer capabilities ( c track type text , second renderer mapped capabilities ) ; renderer capabilities [ ] renderer capabilities = new renderer capabilities [ ] { first renderer capabilities , second renderer capabilities } ; track group array track groups = wrap formats ( english , german ) ; / / without an explicit language preference , nothing should be selected track selector result result = track selector select tracks ( renderer capabilities , track groups , period id , timeline ) ; assert no selection ( result selections get ( 0 ) ) ; assert no selection ( result selections get ( 1 ) ) ; / / explicit language preference for english first renderer should be used track selector set parameters ( default parameters build upon ( ) set preferred text language ( " en " ) ) ; result = track selector select tracks ( renderer capabilities , track groups , period id , timeline ) ; assert fixed selection ( result selections get ( 0 ) , track groups , english ) ; assert no selection ( result selections get ( 1 ) ) ; / / explicit language preference for german second renderer should be used track selector set parameters ( default parameters build upon ( ) set preferred text language ( " de " ) ) ; result = track selector select tracks ( renderer capabilities , track groups , period id , timeline ) ; assert no selection ( result selections get ( 0 ) ) ; assert fixed selection ( result selections get ( 1 ) , track groups , german ) ; }


returns the checksum with the given name

checksum algorithm get checksum for ( string checksum name ) { for ( checksum algorithm res : checksum list ) { if ( res get name ( ) equals ( checksum name ) ) { return res ; } } return null ; }


assert that the required number of errors are produced by a connector config validation

public void assert exactly num errors on connector config validation ( string connector class , map < string , string > conn config , int num errors , string detail message ) throws interrupted exception { try { wait for condition ( ( ) - > check validation errors ( connector class , conn config , num errors , ( actual , expected ) - > actual = = expected ) or else ( false ) , validation duration ms , " didn ' t meet the exact requested number of validation errors : " + num errors ) ; } catch ( assertion error e ) { throw new assertion error ( detail message , e ) ; } }


returns the primary viewer of the graph ( as opposed to the satellite viewer ) the viewer returned is responsible for maintaining view information for a given graph

public graph viewer < v , e > get primary graph viewer ( ) { if ( graph component = = null ) { return null ; } return graph component get primary viewer ( ) ; }


wait till all data nodes are transitioned to the expected state

protected void wait node state ( list < datanode info > nodes , admin states state ) { for ( datanode info node : nodes ) { boolean done = ( state = = node get admin state ( ) ) ; while ( ! done ) { log info ( " waiting for node " + node + " to change state to " + state + " current state : " + node get admin state ( ) ) ; try { thread sleep ( heartbeat interval * 500 ) ; } catch ( interrupted exception e ) { / / nothing } done = ( state = = node get admin state ( ) ) ; } log info ( " node " + node + " reached the state " + state ) ; } }


verify that the read at a specific offset in a stream matches that expected

public static void verify read ( f s data input stream stm , byte [ ] file contents , int seek off , int to read ) throws i o exception { byte [ ] out = new byte [ to read ] ; stm seek ( seek off ) ; stm read fully ( out ) ; byte [ ] expected = arrays copy of range ( file contents , seek off , seek off + to read ) ; compare byte arrays ( expected , out , to read ) ; }


returns the name filter that is applied to ear files in this entry , if any

public list get ear filter ( ) { return ear filter ; }


public rounding params get rounding params ( ) { return m rounding params ; }


creates a { @ link gif image } from a byte buffer containing the image this will throw if it fails to create

public static gif image create from byte buffer ( byte buffer byte buffer ) { return create from byte buffer ( byte buffer , image decode options defaults ( ) ) ; }


set the timeout to use for receiving the response message for a request ( in milliseconds ) the default is 0 , which indicates a blocking receive without timeout

public void set receive timeout ( long receive timeout ) { this receive timeout = receive timeout ; }


sets the < code > prefix ns wrapped array < code > property

public void set prefix ns wrapped array ( list < integer > prefix ns wrapped array ) { this prefix ns wrapped array = prefix ns wrapped array ; }


returns the path separator for the host platform this is basically the same as { @ link java io file # path separator } , except that that returns the value for this jvm , which may or may not match the host platform you should only use this when invoking tools that are known to use the native path separator , i e , the path separator for the machine that they run on

string get host path separator ( ) { / / todo ( bazel - team ) : maybe do this in the constructor instead ? this isn ' t serialization - safe return os get current ( ) = = os windows ? " ; " : " : " ; }


apply mask penalty rule 4 and return the penalty calculate the ratio of dark cells and give penalty if the ratio is far from 50 % it gives 10 penalty for 5 % distance

static int apply mask penalty rule 4 ( byte matrix matrix ) { int num dark cells = 0 ; byte [ ] [ ] array = matrix get array ( ) ; int width = matrix get width ( ) ; int height = matrix get height ( ) ; for ( int y = 0 ; y < height ; y + + ) { byte [ ] array y = array [ y ] ; for ( int x = 0 ; x < width ; x + + ) { if ( array y [ x ] = = 1 ) { num dark cells + + ; } } } int num total cells = matrix get height ( ) * matrix get width ( ) ; int five percent variances = math abs ( num dark cells * 2 - num total cells ) * 10 / num total cells ; return five percent variances * n4 ; }


public static boolean is metadata found for entity id ( final metadata resolver adapter metadata adapter , final string entity id ) { return metadata adapter get entity descriptor for entity id ( entity id ) ! = null ; }


a main method for testing configuration parsing

public static void main ( string [ ] args ) { try { configuration parser parser = new configuration parser ( args , system get properties ( ) ) ; try { parser parse ( new configuration ( ) ) ; } catch ( parse exception ex ) { ex print stack trace ( ) ; } finally { parser close ( ) ; } } catch ( i o exception ex ) { ex print stack trace ( ) ; } }


public web test client response spec reason equals ( string reason ) { string actual = this exchange result get status ( ) get reason phrase ( ) ; string message = " response status reason " ; this exchange result assert with diagnostics ( ( ) - > assertion errors assert equals ( message , reason , actual ) ) ; return this response spec ; }


public rollup job config get job ( ) { return job ; }


public static void main ( string [ ] args ) { var service = new asynchronous service ( new linked blocking queue < > ( ) ) ; / * * a new task to calculate sum is received but as this is main thread , it should not block so * it passes it to the asynchronous task layer to compute and proceeds with handling other * incoming requests this is particularly useful when main thread is waiting on socket to * receive new incoming requests and does not wait for particular request to be completed before * responding to new request * / service execute ( new arithmetic sum task ( 1000 ) ) ; / * * new task received , lets pass that to async layer for computation so both requests will be * executed in parallel * / service execute ( new arithmetic sum task ( 500 ) ) ; service execute ( new arithmetic sum task ( 2000 ) ) ; service execute ( new arithmetic sum task ( 1 ) ) ; service close ( ) ; }


public void stop ( ) throws i o exception { if ( mr ! = null ) { mr stop ( ) ; } if ( dfs ! = null ) { dfs shutdown ( ) ; } }


method used to start the disk health monitoring , if enabled

protected void service start ( ) throws exception { if ( is disk health checker enabled ) { dirs handler scheduler = new timer ( " disk health monitor - timer " , true ) ; dirs handler scheduler schedule at fixed rate ( monitoring timer task , disk health check interval , disk health check interval ) ; } super service start ( ) ; }


captures the end of the continuation for stolen work

void on end work continuation ( object token ) ;


filter on method arguments that don ' t have the given annotation type ( s )

public final arg resolver annot not present ( class < ? extends annotation > annotation types ) { return new arg resolver ( ) annot not present ( annotation types ) ; }


style the specified value according to default conventions

public static string style ( object value ) { return default value styler style ( value ) ; }


invoked when a { @ code future } computation fails or is canceled if the future ' s { @ link future # get ( ) get } method throws an { @ link execution exception } , then the cause is passed to this method any other thrown object is passed unaltered


returns the wait for active shard count or null if the default should be used

public active shard count wait for active shards ( ) { return wait for active shards ; }


adds the specified class to the list of { @ link vfs } implementations classes added in this manner are tried in the order they are added and before any of the built - in implementations

public static void add impl class ( class < ? extends vfs > clazz ) { if ( clazz ! = null ) { user implementations add ( clazz ) ; } }


public element request security token response ( final string applies to , final string action , final string request type , final security token target ) throws exception { val response = issue ( applies to , action , " / issue " , null ) ; return get document element ( response get response ( ) ) ; }


shortcut to same property on the underlying { @ code url path helper } note : this property is mutually exclusive with and ignored when { @ link # set pattern parser ( path pattern parser ) } is set

public void set url decode ( boolean url decode ) { this url path helper set url decode ( url decode ) ; if ( this cors configuration source instanceof url based cors configuration source ) { ( ( url based cors configuration source ) this cors configuration source ) set url decode ( url decode ) ; } }


public static boolean parse args ( string [ ] argv , job job ) throws i o exception { if ( argv length < 1 ) { return 0 = = print usage ( ) ; } for ( int i = 0 ; i < argv length ; + + i ) { if ( argv length = = i + 1 ) { system out println ( " error : required parameter missing from " + argv [ i ] ) ; return 0 = = print usage ( ) ; } try { if ( " - r " equals ( argv [ i ] ) ) { job set num reduce tasks ( integer parse int ( argv [ + + i ] ) ) ; } else if ( " - in format " equals ( argv [ i ] ) ) { job set input format class ( class for name ( argv [ + + i ] ) as subclass ( input format class ) ) ; } else if ( " - out format " equals ( argv [ i ] ) ) { job set output format class ( class for name ( argv [ + + i ] ) as subclass ( output format class ) ) ; } else if ( " - out key " equals ( argv [ i ] ) ) { job set output key class ( class for name ( argv [ + + i ] ) as subclass ( writable comparable class ) ) ; } else if ( " - out value " equals ( argv [ i ] ) ) { job set output value class ( class for name ( argv [ + + i ] ) as subclass ( writable class ) ) ; } else if ( " - keepmap " equals ( argv [ i ] ) ) { job get configuration ( ) set ( map preserve percent , argv [ + + i ] ) ; } else if ( " - keepred " equals ( argv [ i ] ) ) { job get configuration ( ) set ( reduce preserve percent , argv [ + + i ] ) ; } else if ( " - outdir " equals ( argv [ i ] ) ) { file output format set output path ( job , new path ( argv [ + + i ] ) ) ; } else if ( " - indir " equals ( argv [ i ] ) ) { file input format add input paths ( job , argv [ + + i ] ) ; } else if ( " - in format indirect " equals ( argv [ i ] ) ) { job get configuration ( ) set class ( indirect input format , class for name ( argv [ + + i ] ) as subclass ( input format class ) , input format class ) ; job set input format class ( indirect input format class ) ; } else { system out println ( " unexpected argument : " + argv [ i ] ) ; return 0 = = print usage ( ) ; } } catch ( number format exception except ) { system out println ( " error : integer expected instead of " + argv [ i ] ) ; return 0 = = print usage ( ) ; } catch ( exception e ) { throw ( i o exception ) new i o exception ( ) init cause ( e ) ; } } return true ; }


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

response entity < list < pet > > find pets by tags ( @ not null @ api param ( value = " tags to filter by " , required = true ) @ valid @ request param ( value = " tags " , required = true ) list < string > tags , @ api ignore final pageable pageable ) ;


< code > optional uint 3 2 line number = 1 ; < code >

public builder set line number ( int value ) { copy on write ( ) ; instance set line number ( value ) ; return this ; }


create a { @ link k stream } from the specified topic pattern the { @ code " auto offset reset " } strategy , { @ link timestamp extractor } , key and value deserializers are defined by the options in { @ link consumed } are used if multiple topics are matched by the specified pattern , the created { @ link k stream } will read data from all of them and there is no ordering guarantee between records from different topics this also means that the work will not be parallelized for multiple topics , and the number of tasks will scale with the maximum partition count of any matching topic rather than the total number of partitions across all topics note that the specified input topics must be partitioned by key if this is not the case it is the user ' s responsibility to repartition the data before any key based operation ( like aggregation or join ) is applied to the returned { @ link k stream }

public synchronized < k , v > k stream < k , v > stream ( final pattern topic pattern , final consumed < k , v > consumed ) { objects require non null ( topic pattern , " topic pattern can ' t be null " ) ; objects require non null ( consumed , " consumed can ' t be null " ) ; return internal streams builder stream ( topic pattern , new consumed internal < > ( consumed ) ) ; }


retrieves and casts { @ link constraint value info } providers from the given targets

public static iterable < constraint value info > constraint values ( iterable < ? extends provider collection > targets ) { return iterables transform ( targets , platform provider utils : : constraint value ) ; }


the total number of threads in the cluster

public long get threads ( ) { return threads ; }


sets the character set used for this parser

public void set charset ( charset charset ) { this charset = charset ; }


assert the response status code is { @ code http status request uri too long } ( 414 )

public result matcher is request uri too long ( ) { return matcher ( http status request uri too long ) ; }


callback after a failed execution of bulk request note that in case an instance of < code > interrupted exception < code > is passed , which means that request processing has been cancelled externally , the thread ' s interruption status has been restored prior to calling this method

void after bulk ( long execution id , bulk request request , throwable failure ) ;


return a function that takes a template path as input and returns the template content as a string

public function < string , string > get template loader ( ) { return this template loader ; }


sets the name of the profile , which must exist in the - profiles location directory , to use for this browser session

public browser configuration options set profile ( string profile ) { put ( profile name , profile ) ; return this ; }


public type get type ( ) { return type get type ( ) ; }


upon successful creation , the { @ link injector } will inject instance fields and methods of the given object

void request injection ( object instance ) ;


returns the name of the service that sent this error response

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


public table pad bottom ( value pad bottom ) { if ( pad bottom = = null ) throw new illegal argument exception ( " pad bottom cannot be null " ) ; this pad bottom = pad bottom ; size invalid = true ; return this ; }


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

protected mono < void > release resource ( o resource holder , k resource key ) { return mono empty ( ) ; }


public string action ( ) { return action ; }


get the next position and length of a matching literal

public number [ ] get next match ( ) throws i o exception { stop searching = false ; populate part ( ) ; find all matches ( ) ; while ( current part found < 0 ) { / / end of part if ( next part ( ) = = null | | stop searching ) { stop searching = false ; return null ; / / end of file } find all matches ( ) ; } long result position = buffer position + current part found ; int length = current part found is unicode ? literal byte length : byte find sequence length ; set new start ( result position + ( direction forward ? 1 : length - 1 ) ) ; return new number [ ] { result position , length } ; }


get the { @ link map } of { @ link data source data sources } maintained by this object the returned { @ link map } is { @ link collections # unmodifiable map ( java util map ) unmodifiable }

public map < string , data source > get data sources ( ) { return collections unmodifiable map ( this data sources ) ; }


views the array as an immutable list the array must have only { @ code e } elements the array must be internally created

static < e > immutable list < e > as immutable list ( object [ ] elements ) { return unsafe delegate list ( ( list ) arrays as list ( elements ) ) ; }


public void dirty with own error depends on transient error turning good ( ) throws exception { sky key error = graph tester non hermetic key ( " error " ) ; tester get or create ( error ) set has transient error ( true ) ; sky key top key = graph tester to sky key ( " top " ) ; sky function error function = new sky function ( ) { @ override public sky value compute ( sky key sky key , environment env ) throws generic function exception , interrupted exception { try { return env get value or throw ( error , some error exception class ) ; } catch ( some error exception e ) { throw new generic function exception ( e , transience persistent ) ; } } @ override public string extract tag ( sky key sky key ) { throw new unsupported operation exception ( ) ; } } ; tester get or create ( top key ) set builder ( error function ) ; evaluation result < string value > result = tester eval ( / * keep going = * / false , top key ) ; tester invalidate transient errors ( ) ; assert that evaluation result ( result ) has singleton error that ( top key ) ; tester get or create ( error ) set has transient error ( false ) ; string value reformed = new string value ( " reformed " ) ; tester set ( error , reformed ) ; tester get or create ( top key , / * mark as modified = * / false ) set builder ( null ) add dependency ( error ) set computed value ( copy ) ; tester invalidate ( ) ; tester invalidate transient errors ( ) ; result = tester eval ( / * keep going = * / false , top key ) ; assert that evaluation result ( result ) has entry that ( top key ) is equal to ( reformed ) ; assert that evaluation result ( result ) has no error ( ) ; }


public boolean server healthy ( ) { try { string result = req api ( util and coms nacos url base + " / operator / metrics " , new hash map < string , string > ( 2 ) , http method get ) ; json node json = jackson utils to obj ( result ) ; string server status = json get ( " status " ) as text ( ) ; return " up " equals ( server status ) ; } catch ( exception e ) { return false ; } }


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 { update pet with form with http info ( pet id , name , status ) ; }


internal method which is called by the rpc service implementation to start the rpc endpoint

public final void internal call on start ( ) throws exception { validate runs in main thread ( ) ; is running = true ; on start ( ) ; }


returns the number of bytes that have been input , but will not be processed until more input data is provided

public int get pending input bytes ( ) { return input frame count * channel count * bytes per sample ; }


creates a fixture from a shape and attach it to this body this is a convenience function use b 2 fixture def if you need to set parameters like friction , restitution , user data , or filtering if the density is non - zero , this function automatically updates the mass of the body

public fixture create fixture ( shape shape , float density ) { org jbox 2d dynamics fixture f = body create fixture ( shape shape , density ) ; fixture fixture = new fixture ( this , f ) ; fixtures add ( fixture ) ; world fixtures put ( f , fixture ) ; return fixture ; }


protected void erase data from block ( test block the block ) { erase data from chunks ( the block chunks ) ; the block set erased ( true ) ; }


while in insert mode , deletes the selection

public void do delete ( ) { hex edit control delete selected ( ) ; }


set the response status according to the { @ link response status } annotation

private void set response status ( servlet web request web request ) throws i o exception { http status status = get response status ( ) ; if ( status = = null ) { return ; } http servlet response response = web request get response ( ) ; if ( response ! = null ) { string reason = get response status reason ( ) ; if ( string utils has text ( reason ) ) { response send error ( status value ( ) , reason ) ; } else { response set status ( status value ( ) ) ; } } / / to be picked up by redirect view web request get request ( ) set attribute ( view response status attribute , status ) ; }


gets the indicated element it is an error to call this with the index for an element which was never set ; if you do that , this will throw { @ code null pointer exception } this method is protected so that subclasses may offer a safe type - checked public interface to their clients

protected final object get 0 ( int n ) { try { object result = arr [ n ] ; if ( result = = null ) { throw new null pointer exception ( " unset : " + n ) ; } return result ; } catch ( array index out of bounds exception ex ) { / / translate the exception return throw index ( n ) ; } }


returns an immutable map containing a single entry

public static < k extends comparable < ? super k > , v > immutable sorted map < k , v > of ( k k 1 , v v 1 ) { return of ( ordering natural ( ) , k 1 , v 1 ) ; }


create aop advice for method validation purposes , to be applied with a pointcut for the specified ' validated ' annotation

protected advice create method validation advice ( @ nullable validator validator ) { return ( validator ! = null ? new method validation interceptor ( validator ) : new method validation interceptor ( ) ) ; }


suitable for { @ link job # remove run }

public final void remove run ( run t run ) { if ( ! builds remove ( run ) ) { logger log ( level warning , " { 0 } did not contain { 1 } to begin with " , new object [ ] { as job ( ) , run } ) ; } }


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


public cst string get name ( ) { return spec get local item ( ) get name ( ) ; }


public long count by user id ( final string user id ) { val view = create query ( " count by user id " ) key ( user id ) ; val rows = db query view ( view ) get rows ( ) ; if ( rows is empty ( ) ) { return 0 ; } return rows get ( 0 ) get value as int ( ) ; }


creates a { @ code striped < semaphore > } with eagerly initialized , strongly referenced semaphores , with the specified number of permits

public static striped < semaphore > semaphore ( int stripes , final int permits ) { return custom ( stripes , new supplier < semaphore > ( ) { @ override public semaphore get ( ) { return new padded semaphore ( permits ) ; } } ) ; }


private boolean paste node ( program node dest node , program node node to paste ) { program module target module = dest node get module ( ) ; / / make sure we have something to paste program module module = node to paste get module ( ) ; program fragment fragment = node to paste get fragment ( ) ; if ( module = = null & & fragment = = null ) { node to paste set deleted ( false ) ; tree model reload ( node to paste ) ; msg show error ( this , null , " paste from clipboard failed " , " could not paste " + node to paste + " at " + target module get name ( ) ) ; return false ; } boolean paste o k = false ; try { if ( module ! = null ) { paste o k = paste module ( dest node , node to paste , target module , module ) ; } else { paste o k = paste fragment ( node to paste , target module , fragment ) ; } / / don ' t match the expansion state unless the destination / / node is already expanded if ( tree is expanded ( dest node get tree path ( ) ) ) { program node newnode = tree get child ( dest node , node to paste get name ( ) ) ; if ( newnode ! = null ) { tree match expansion state ( node to paste , newnode ) ; } } return paste o k ; } catch ( circular dependency exception e ) { remove from clipboard ( node to paste ) ; msg show error ( this , null , " paste from clipboard failed " , e get message ( ) ) ; } catch ( duplicate group exception e ) { node to paste set deleted ( false ) ; tree reload node ( node to paste ) ; } catch ( not found exception e ) { remove from clipboard ( node to paste ) ; node to paste set deleted ( false ) ; msg show error ( this , null , " paste from clipboard failed " , e get message ( ) ) ; } return false ; }


see { @ link stream tracer # stream closed } this may be called multiple times , and only the first value will be taken called from abstract stream implementations

public void stream closed ( status status ) { if ( closed compare and set ( false , true ) ) { for ( stream tracer tracer : tracers ) { tracer stream closed ( status ) ; } } }


public task i d get task i d ( ) { return task i d downgrade ( super get task i d ( ) ) ; }


the item has left the queue , either by getting { @ link queue # cancel ( item ) cancelled } or by getting picked up by an executor and starts running

public void on left ( left item li ) { }


public void set duplicate ( boolean is duplicate ) { this is duplicate = is duplicate ; }


create a new context with the given key value set the new context will cascade cancellation from its parent

public < v1 , v2 > context with values ( key < v1 > k 1 , v1 v 1 , key < v2 > k 2 , v2 v 2 ) { node < key < ? > , object > new key value entries = persistent hash array mapped trie put ( key value entries , k 1 , v 1 ) ; new key value entries = persistent hash array mapped trie put ( new key value entries , k 2 , v 2 ) ; return new context ( this , new key value entries ) ; }


returns the source of the wrapped { @ link cronet engine }

public int get cronet engine source ( ) { return cronet engine source ; }


public string get status ( ) { if ( status = = null ) { return null ; } return status value ( ) ; }


returns the handler object created by the application


public int get num modules ( ) { return module information list size ( ) ; }


adds extra runfiles for a { @ code java binary } rule

void add runfiles for binary ( rule context rule context , artifact launcher , runfiles builder runfiles builder ) ;


tries to catch a different type of exception

public void test no catch ( ) { runtime exception exception = expect script throws ( runtime exception class , ( ) - > { exec ( " try { if ( params param = = ' true ' ) throw new runtime exception ( ' test ' ) ; } " + " catch ( arithmetic exception e ) { return 1 ; } return 2 ; " , collections singleton map ( " param " , " true " ) , true ) ; } ) ; assert equals ( " test " , exception get message ( ) ) ; }


public static process engine get process engine ( string process engine name ) { if ( ! is initialized ( ) ) { init ( ) ; } return process engines get ( process engine name ) ; }


traverses the reference queue and removes garbage - collected soft value objects from the backing map by looking them up using the soft value key data member

private void process queue ( ) { soft value sv ; while ( ( sv = ( soft value ) queue poll ( ) ) ! = null ) { / / noinspection suspicious method calls map remove ( sv key ) ; / / we can access private data ! } }


returns a string representation of the current elapsed time

public string to string ( ) { long nanos = elapsed nanos ( ) ; time unit unit = choose unit ( nanos ) ; double value = ( double ) nanos / nanoseconds convert ( 1 , unit ) ; / / too bad this functionality is not exposed as a regular method call return platform format compact 4 digits ( value ) + " " + abbreviate ( unit ) ; }


fully read up to { @ code length } bytes from the given { @ link input stream }

private static int read fully ( input stream input stream , final byte buffer b , int length , checked runnable < i o exception > on e o f ) throws i o exception { int total read = 0 ; final byte [ ] buffer = new byte [ math min ( length , copy buffer size ) ] ; while ( total read < length ) { final int len = math min ( length - total read , copy buffer size ) ; final int read = input stream read ( buffer , 0 , len ) ; if ( read = = - 1 ) { on e o f run ( ) ; break ; } b put ( buffer , 0 , read ) ; total read + = read ; } return total read > 0 ? total read : - 1 ; }


test edit log with different initial buffer size

private void test edit log ( int initial size ) throws i o exception { / / start a cluster configuration conf = get conf ( ) ; mini d f s cluster cluster = null ; file system file sys = null ; try { cluster = new mini d f s cluster builder ( conf ) num data nodes ( num data nodes ) build ( ) ; cluster wait active ( ) ; file sys = cluster get file system ( ) ; final f s namesystem namesystem = cluster get namesystem ( ) ; for ( iterator < uri > it = cluster get name dirs ( 0 ) iterator ( ) ; it has next ( ) ; ) { file dir = new file ( it next ( ) get path ( ) ) ; system out println ( dir ) ; } f s image fsimage = namesystem get f s image ( ) ; f s edit log edit log = fsimage get edit log ( ) ; / / set small size of flush buffer edit log set output buffer capacity ( initial size ) ; / / roll log so new output buffer size takes effect / / we should now be writing to edits inprogress 3 fsimage roll edit log ( name node layout version current layout version ) ; / / remember the current last inode id and will reset it back to test / / loading editlog segments the transactions in the following allocate new / / inode id to write to editlogs but doesn ' t create ionde in namespace long original last inode id = namesystem dir get last inode id ( ) ; / / create threads and make them run transactions concurrently thread thread id [ ] = new thread [ num threads ] ; for ( int i = 0 ; i < num threads ; i + + ) { transactions trans = new transactions ( namesystem , num transactions , i * num transactions ) ; thread id [ i ] = new thread ( trans , " transaction thread - " + i ) ; thread id [ i ] start ( ) ; } / / wait for all transactions to get over for ( int i = 0 ; i < num threads ; i + + ) { try { thread id [ i ] join ( ) ; } catch ( interrupted exception e ) { i - - ; / / retry } } / / reopen some files as for append transactions trans = new transactions ( namesystem , num transactions , num transactions / 2 ) ; trans run ( ) ; / / roll another time to finalize edits inprogress 3 fsimage roll edit log ( name node layout version current layout version ) ; long expected txns = ( ( num threads + 1 ) * 2 * num transactions ) + 2 ; / / + 2 for start / end txns / / verify that we can read in all the transactions that we have written / / if there were any corruptions , it is likely that the reading in / / of these transactions will throw an exception / / namesystem dir reset last inode id without checking ( original last inode id ) ; for ( iterator < storage directory > it = fsimage get storage ( ) dir iterator ( name node dir type edits ) ; it has next ( ) ; ) { f s edit log loader loader = new f s edit log loader ( namesystem , 0 ) ; file edit file = n n storage get finalized edits file ( it next ( ) , 3 , 3 + expected txns - 1 ) ; assert true ( " expect " + edit file + " exists " , edit file exists ( ) ) ; system out println ( " verifying file : " + edit file ) ; long num edits = loader load f s edits ( new edit log file input stream ( edit file ) , 3 ) ; int num leases = namesystem lease manager count lease ( ) ; system out println ( " number of outstanding leases " + num leases ) ; assert equals ( 0 , num leases ) ; assert true ( " verification for " + edit file + " failed " + " expected " + expected txns + " transactions " + " found " + num edits + " transactions " , num edits = = expected txns ) ; } } finally { try { if ( file sys ! = null ) file sys close ( ) ; if ( cluster ! = null ) cluster shutdown ( ) ; } catch ( throwable t ) { log error ( " couldn ' t shut down cleanly " , t ) ; } } }


sets the default strategies to use if none are supplied by the user replaces any previously set default strategies

public test executor builder set default strategies ( string strategies ) { strategy registry builder set default strategies ( immutable list copy of ( strategies ) ) ; return this ; }


returns true if field corresponding to field i d is set ( has been assigned a value ) and false otherwise

public boolean is set ( fields field ) { if ( field = = null ) { throw new illegal argument exception ( ) ; } switch ( field ) { case success : return is set success ( ) ; } throw new illegal state exception ( ) ; }


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


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


if authorization is enabled , checks whether the user ( in the caller u g i ) is authorized to perform the operation specified by ' job operation ' on the job by checking if the user is job owner or part of job acl for the specific job operation the owner of the job can do any operation on the job for all other usersgroups job - acls are checked

public boolean check access ( user group information caller u g i , job a c l job operation , string job owner , access control list job a c l ) { if ( log is debug enabled ( ) ) { log debug ( " check access job acls , job owner : " + job owner + " jobacl : " + job operation to string ( ) + " user : " + caller u g i get short user name ( ) ) ; } string user = caller u g i get short user name ( ) ; if ( ! are a c ls enabled ( ) ) { return true ; } / / allow job - owner for any operation on the job if ( is m r admin ( caller u g i ) | | user equals ( job owner ) | | ( null ! = job a c l & & job a c l is user allowed ( caller u g i ) ) ) { return true ; } return false ; }


creates a new double buffer by wrapping the given double array the new buffer ' s position will be { @ code start } , limit will be { @ code start + len } , capacity will be the length of the array

public static double buffer wrap ( double [ ] array , int start , int len ) { int length = array length ; if ( start < 0 | | len < 0 | | ( long ) start + ( long ) len > length ) { throw new index out of bounds exception ( ) ; } double buffer buf = buffer factory new double buffer ( array ) ; buf position = start ; buf limit = start + len ; return buf ; }


public string to string ( ) { return statename ; }


return the compressed bitmap using scale

public static bitmap compress by scale ( final bitmap src , final float scale width , final float scale height , final boolean recycle ) { return scale ( src , scale width , scale height , recycle ) ; }


get the metric registry instance to use for registration of metrics used by hikari c p default is { @ code null }

public object get metric registry ( ) { return metric registry ; }


defines that the value of the option should be of { @ link memory size } type

public typed config option builder < memory size > memory type ( ) { return new typed config option builder < > ( key , memory size class ) ; }


recurse through a series of preceding exchange nodes and project nodes to find the preceding partial aggregation

private optional < plan node > recurse to partial ( plan node node , lookup lookup , plan node id allocator id allocator , type provider types ) { if ( node instanceof aggregation node & & ( ( aggregation node ) node ) get step ( ) = = partial ) { return optional of ( add gathering intermediate ( ( aggregation node ) node , id allocator , types ) ) ; } if ( ! ( node instanceof exchange node ) & & ! ( node instanceof project node ) ) { return optional empty ( ) ; } immutable list builder < plan node > builder = immutable list builder ( ) ; for ( plan node source : node get sources ( ) ) { optional < plan node > plan node = recurse to partial ( lookup resolve ( source ) , lookup , id allocator , types ) ; if ( ! plan node is present ( ) ) { return optional empty ( ) ; } builder add ( plan node get ( ) ) ; } return optional of ( node replace children ( builder build ( ) ) ) ; }


applies a process function to the detected pattern sequence for each pattern sequence the provided { @ link pattern process function } is called in order to process timed out partial matches as well one can use { @ link timed out partial match handler } as additional interface

public < r > single output stream operator < r > process ( final pattern process function < t , r > pattern process function ) { final type information < r > return type = type extractor get unary operator return type ( pattern process function , pattern process function class , 0 , 1 , type extractor no index , builder get input type ( ) , null , false ) ; return process ( pattern process function , return type ) ; }


creates an array of build requests from a schematic ' s data , centered on the provided x + y coordinates

public seq < build plan > to requests ( schematic schem , int x , int y ) { return schem tiles map ( t - > new build plan ( t x + x - schem width / 2 , t y + y - schem height / 2 , t rotation , t block , t config ) original ( t x , t y , schem width , schem height ) ) remove all ( s - > ( ! s block is visible ( ) & & ! ( s block instanceof core block ) ) | | ! s block unlocked now ( ) ) ; }


randomly permutes the specified list using a default source of randomness

public static < t > void shuffle ( list < t > list ) { collections shuffle ( list ) ; }


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

@ override public t visit bool ( painless parser bool context ctx ) { return visit children ( ctx ) ; }


constructs a starlark info from an array of alternating keyvalue pairs as provided by starlark fastcall checks that each key is provided at most once , and is defined by the optional schema , which must be sorted this optimized zero - allocation function exists solely for the starlark provider constructor

static starlark info create from named args ( provider provider , object [ ] table , @ nullable immutable list < string > schema , location loc ) throws eval exception { / / permute fastcall form ( k , v , , k , v ) into table form ( k , k , , v , v ) permute ( table ) ; int n = table length > > 1 ; / / number of k / v pairs / / sort keys , permuting values in parallel if ( n > 1 ) { sort pairs ( table , 0 , n - 1 ) ; } / / check for duplicate keys , which are now adjacent for ( int i = 0 ; i < n - 1 ; i + + ) { if ( table [ i ] equals ( table [ i + 1 ] ) ) { throw starlark errorf ( " got multiple values for parameter % s in call to instantiate provider % s " , table [ i ] , provider get printable name ( ) ) ; } } / / check that schema is a superset of the table ' s keys if ( schema ! = null ) { list < string > unexpected = unexpected keys ( schema , table , n ) ; if ( unexpected ! = null ) { throw starlark errorf ( " unexpected keyword % s % s in call to instantiate provider % s " , unexpected size ( ) > 1 ? " s " : " " , joiner on ( " , " ) join ( unexpected ) , provider get printable name ( ) ) ; } } return new starlark info ( provider , table , loc , / * unknown field error = * / null ) ; }


returns the total number of translog operations recovered so far

public synchronized int recovered operations ( ) { return recovered ; }


shows the given dialog component provider using the given tool ' s { @ link plugin tool # show dialog ( dialog component provider ) } method

public static dialog component provider show dialog without blocking ( plugin tool tool , dialog component provider provider ) { execute on swing without blocking ( ( ) - > tool show dialog ( provider ) ) ; / / this call waits for the dialog to be shown dialog component provider dialog = wait for dialog component ( provider get class ( ) ) ; wait for swing ( ) ; return dialog ; }


take a snapshot of the statistics which can be returned to the driver

stats client stats get stats ( ) { histogram interval histogram = recorder get interval histogram ( ) ; stats client stats builder stats builder = stats client stats new builder ( ) ; stats histogram data builder latencies builder = stats builder get latencies builder ( ) ; double resolution = 1 0 + math max ( config get histogram params ( ) get resolution ( ) , 0 01 ) ; logarithmic iterator log iterator = new logarithmic iterator ( interval histogram , 1 , resolution ) ; double base = 1 ; while ( log iterator has next ( ) ) { latencies builder add bucket ( ( int ) log iterator next ( ) get count added in this iteration step ( ) ) ; base = base * resolution ; } / / driver expects values for all buckets in the range , not just the range of buckets that / / have values while ( base < config get histogram params ( ) get max possible ( ) ) { latencies builder add bucket ( 0 ) ; base = base * resolution ; } latencies builder set max seen ( interval histogram get max value ( ) ) ; latencies builder set min seen ( interval histogram get min non zero value ( ) ) ; latencies builder set count ( interval histogram get total count ( ) ) ; latencies builder set sum ( interval histogram get mean ( ) * interval histogram get total count ( ) ) ; / / todo : no support for sum of squares stats builder set time elapsed ( ( interval histogram get end time stamp ( ) - interval histogram get start time stamp ( ) ) / 1000 0 ) ; if ( os bean ! = null ) { / / report all the cpu time as user - time ( which is intentionally incorrect ) long now cpu = os bean get process cpu time ( ) ; stats builder set time user ( ( ( double ) now cpu - last mark cpu time ) / 1000000000 0 ) ; last mark cpu time = now cpu ; } return stats builder build ( ) ; }


test that if we have fewer fsimages than the configured retention , we don ' t purge any of them

public void test purge less than retention ( ) throws i o exception { test case description tc = new test case description ( ) ; tc add root ( " / foo 1 " , name node dir type image and edits ) ; tc add image ( " / foo 1 / current / " + get image file name ( 100 ) , false ) ; tc add log ( " / foo 1 / current / " + get finalized edits file name ( 101 , 200 ) , false ) ; tc add log ( " / foo 1 / current / " + get finalized edits file name ( 201 , 300 ) , false ) ; tc add log ( " / foo 1 / current / " + get finalized edits file name ( 301 , 400 ) , false ) ; tc add log ( " / foo 1 / current / " + get in progress edits file name ( 401 ) , false ) ; run test ( tc ) ; }


gets the root vertices of the given graph if this is a top - down navigator , then the sources are returned ; otherwise , the sinks are returned

public set < v > get sources ( g directed graph < v , e > graph ) { if ( is top down ) { return as set ( graph algorithms get sources ( graph ) ) ; } return as set ( graph algorithms get sinks ( graph ) ) ; }


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


to test class name in snake case to test class name in snake case

public void test classname test ( ) throws api exception { client client = null ; client response = api test classname ( client ) ; / / todo : test validations }


response entity < void > update pet ( pet body ) ;


guarded by { @ link f s namesystem # read lock ( ) }

private void check traverse ( i node attributes [ ] inode attrs , i node [ ] inodes , byte [ ] [ ] components , int last ) throws access control exception , unresolved path exception , parent not directory exception { for ( int i = 0 ; i < = last ; i + + ) { check is directory ( inodes [ i ] , components , i ) ; check ( inode attrs , components , i , fs action execute ) ; } }


starts executing the plan , exits when the plan is done executing

private void execute plan ( ) { preconditions check state ( lock is held by current thread ( ) ) ; this block mover set runnable ( ) ; if ( this scheduler is shutdown ( ) ) { this scheduler = executors new single thread executor ( ) ; } this future = scheduler submit ( new runnable ( ) { @ override public void run ( ) { thread current thread ( ) set name ( " disk balancer thread " ) ; log info ( " executing disk balancer plan plan file : { } , plan id : { } " , plan file , plan i d ) ; for ( map entry < volume pair , disk balancer work item > entry : work map entry set ( ) ) { block mover set runnable ( ) ; block mover copy blocks ( entry get key ( ) , entry get value ( ) ) ; } } } ) ; }


set a custom response interceptor this is useful for logging , monitoring or extraction of header variables

public api client set response interceptor ( consumer < http response < input stream > > interceptor ) { this response interceptor = interceptor ; return this ; }


updated user this can only be done by the logged in user

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


make sure that a request using a deterministic script or not using a script get cached ensure requests using nondeterministic scripts do not get cached

public void test script caching ( ) throws exception { assert acked ( prepare create ( " cache test idx " ) set mapping ( " s " , " type = long " , " t " , " type = text " ) set settings ( settings builder ( ) put ( " requests cache enable " , true ) put ( " number of shards " , 1 ) put ( " number of replicas " , 1 ) ) get ( ) ) ; index random ( true , client ( ) prepare index ( " cache test idx " ) set id ( " 1 " ) set source ( " s " , 1 , " t " , " foo " ) , client ( ) prepare index ( " cache test idx " ) set id ( " 2 " ) set source ( " s " , 2 , " t " , " bar " ) ) ; / / make sure we are starting with a clear cache assert that ( client ( ) admin ( ) indices ( ) prepare stats ( " cache test idx " ) set request cache ( true ) get ( ) get total ( ) get request cache ( ) get hit count ( ) , equal to ( 0l ) ) ; assert that ( client ( ) admin ( ) indices ( ) prepare stats ( " cache test idx " ) set request cache ( true ) get ( ) get total ( ) get request cache ( ) get miss count ( ) , equal to ( 0l ) ) ; / / test that a request using a nondeterministic script does not get cached script heuristic script heuristic = new script heuristic ( new script ( script type inline , " mockscript " , " math random ( ) " , collections empty map ( ) ) ) ; boolean use sig text = random boolean ( ) ; search response r ; if ( use sig text ) { r = client ( ) prepare search ( " cache test idx " ) set size ( 0 ) add aggregation ( significant text ( " foo " , " t " ) significance heuristic ( script heuristic ) ) get ( ) ; } else { r = client ( ) prepare search ( " cache test idx " ) set size ( 0 ) add aggregation ( significant terms ( " foo " ) field ( " s " ) significance heuristic ( script heuristic ) ) get ( ) ; } assert search response ( r ) ; assert that ( client ( ) admin ( ) indices ( ) prepare stats ( " cache test idx " ) set request cache ( true ) get ( ) get total ( ) get request cache ( ) get hit count ( ) , equal to ( 0l ) ) ; assert that ( client ( ) admin ( ) indices ( ) prepare stats ( " cache test idx " ) set request cache ( true ) get ( ) get total ( ) get request cache ( ) get miss count ( ) , equal to ( 0l ) ) ; / / test that a request using a deterministic script gets cached script heuristic = get script significance heuristic ( ) ; use sig text = random boolean ( ) ; if ( use sig text ) { r = client ( ) prepare search ( " cache test idx " ) set size ( 0 ) add aggregation ( significant text ( " foo " , " t " ) significance heuristic ( script heuristic ) ) get ( ) ; } else { r = client ( ) prepare search ( " cache test idx " ) set size ( 0 ) add aggregation ( significant terms ( " foo " ) field ( " s " ) significance heuristic ( script heuristic ) ) get ( ) ; } assert search response ( r ) ; assert that ( client ( ) admin ( ) indices ( ) prepare stats ( " cache test idx " ) set request cache ( true ) get ( ) get total ( ) get request cache ( ) get hit count ( ) , equal to ( 0l ) ) ; assert that ( client ( ) admin ( ) indices ( ) prepare stats ( " cache test idx " ) set request cache ( true ) get ( ) get total ( ) get request cache ( ) get miss count ( ) , equal to ( 1l ) ) ; / / ensure that non - scripted requests are cached as normal if ( use sig text ) { r = client ( ) prepare search ( " cache test idx " ) set size ( 0 ) add aggregation ( significant text ( " foo " , " t " ) ) get ( ) ; } else { r = client ( ) prepare search ( " cache test idx " ) set size ( 0 ) add aggregation ( significant terms ( " foo " ) field ( " s " ) ) get ( ) ; } assert search response ( r ) ; assert that ( client ( ) admin ( ) indices ( ) prepare stats ( " cache test idx " ) set request cache ( true ) get ( ) get total ( ) get request cache ( ) get hit count ( ) , equal to ( 0l ) ) ; assert that ( client ( ) admin ( ) indices ( ) prepare stats ( " cache test idx " ) set request cache ( true ) get ( ) get total ( ) get request cache ( ) get miss count ( ) , equal to ( 2l ) ) ; }


asynchronously fulfills the request into the specified { @ link remote views } object with the given { @ code view id } this is used for loading bitmaps into all instances of a widget

public void into ( @ non null remote views remote views , @ id res int view id , @ non null int [ ] app widget ids ) { into ( remote views , view id , app widget ids , null ) ; }


return a file status object that represents the path

public file status get file status ( path path ) throws i o exception { path absolute path = make absolute ( path ) ; return store get object metadata ( absolute path ) ; }


configure the registry for adapting various reactive types by default this is an instance of { @ link reactive adapter registry } with default settings

public void set reactive adapter registry ( reactive adapter registry registry ) { this invocable helper set reactive adapter registry ( registry ) ; }


protected int get attribute context ( ) { return attribute factory ctx field ; }


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

public model for testing duplicate r values on visibility state changed ( on model visibility state changed listener < model for testing duplicate r values , object > listener ) { on mutation ( ) ; this on model visibility state changed listener epoxy generated model = listener ; return this ; }


returns true if this timer is set to repeating

public boolean is repeats ( ) { return repeats ; }


verify that the partitions in an incremental fetch response are contained in the session

string verify incremental fetch response partitions ( fetch response < ? > response ) { set < topic partition > extra = find missing ( response response data ( ) key set ( ) , session partitions key set ( ) ) ; if ( ! extra is empty ( ) ) { string builder bld = new string builder ( ) ; bld append ( " extra = ( " ) append ( utils join ( extra , " , " ) ) append ( " ) , " ) ; bld append ( " response = ( " ) append ( utils join ( response response data ( ) key set ( ) , " , " ) ) append ( " ) , " ) ; return bld to string ( ) ; } return null ; }


public static boolean remove ( @ non null final string key ) { return remove ( key , get default cache disk utils ( ) ) ; }


returns all the registered { @ link build step listener } s

public static extension list < build step listener > all ( ) { / / todo should have a null - safe version when jenkins get instance or null ( ) is null ; would require changes in extension list return extension list lookup ( build step listener class ) ; }


retrieve the last element of the given set , using { @ link sorted set # last ( ) } or otherwise iterating over all elements ( assuming a linked set )

public static < t > t last element ( @ nullable set < t > set ) { if ( is empty ( set ) ) { return null ; } if ( set instanceof sorted set ) { return ( ( sorted set < t > ) set ) last ( ) ; } / / full iteration necessary iterator < t > it = set iterator ( ) ; t last = null ; while ( it has next ( ) ) { last = it next ( ) ; } return last ; }


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


if set to true , drawing the web is enabled , if set to false , drawing the whole web is disabled default : true

public void set draw web ( boolean enabled ) { m draw web = enabled ; }


add a transition end handler that would get a callback whenever the transition finishes

public auto bounds transition builder transition end handler ( function < void > transition end handler ) { m transition end handler = transition end handler ; return this ; }


public void test dog all of ( ) { / / todo : test dog all of }


unpack the data in a packed section calling this method is only valid on a packed section

public byte [ ] get unpacked data ( task monitor monitor ) throws i o exception { if ( get section kind ( ) ! = section kind packed data ) { throw new i o exception ( " attempt to unpack a section that is not packed " ) ; } try ( input stream input = get data ( ) ) { byte [ ] data = new byte [ get unpacked length ( ) ] ; int index = 0 ; while ( index < data length ) { if ( monitor is cancelled ( ) ) { break ; } int value = input read ( ) ; if ( value = = - 1 ) { throw new illegal state exception ( ) ; } int count = value & 0x 1f ; / / count is the lower 5 bits if ( count = = 0 ) { count = unpack next value ( input ) ; } packed data opcodes opcode = packed data opcodes get ( value > > 5 ) ; if ( opcode = = packed data opcodes k p e f pk data zero ) { index + = count ; } else if ( opcode = = packed data opcodes k p e f pk data block ) { byte [ ] raw data = new byte [ count ] ; int n read = input read ( raw data ) ; if ( n read ! = count ) { throw new illegal state exception ( " unable to read enough bytes for " + opcode ) ; } system arraycopy ( raw data , 0 , data , index , raw data length ) ; index + = raw data length ; } else if ( opcode = = packed data opcodes k p e f pk data repeat ) { int repeat count = unpack next value ( input ) ; byte [ ] raw data = new byte [ count ] ; int n read = input read ( raw data ) ; if ( n read ! = raw data length ) { throw new illegal state exception ( " unable to read enough bytes for " + opcode ) ; } for ( int i = 0 ; i < repeat count - 1 ; + + i ) { system arraycopy ( raw data , 0 , data , index , raw data length ) ; index + = raw data length ; } } else if ( opcode = = packed data opcodes k p e f pk data repeat block ) { int common size = count ; int custom size = unpack next value ( input ) ; int repeat count = unpack next value ( input ) ; byte [ ] common data = new byte [ common size ] ; int n common read = input read ( common data ) ; if ( n common read ! = common data length ) { throw new illegal state exception ( " unable to read enough common data bytes for " + opcode ) ; } for ( int i = 0 ; i < repeat count ; + + i ) { system arraycopy ( common data , 0 , data , index , common data length ) ; index + = common data length ; byte [ ] custom data = new byte [ custom size ] ; int n custom read = input read ( custom data ) ; if ( n custom read ! = custom data length ) { throw new illegal state exception ( " unable to read enough custom data bytes for " + opcode ) ; } system arraycopy ( custom data , 0 , data , index , custom data length ) ; index + = custom data length ; } / / a final common data pattern is added at end system arraycopy ( common data , 0 , data , index , common data length ) ; index + = common data length ; } else if ( opcode = = packed data opcodes k p e f pk data repeat zero ) { int common size = count ; int custom size = unpack next value ( input ) ; int repeat count = unpack next value ( input ) ; for ( int i = 0 ; i < repeat count ; + + i ) { index + = common size ; / / skip common size of zero bytes byte [ ] custom data = new byte [ custom size ] ; int n custom read = input read ( custom data ) ; if ( n custom read ! = custom data length ) { throw new illegal state exception ( " unable to read enough custom data bytes for " + opcode ) ; } system arraycopy ( custom data , 0 , data , index , custom data length ) ; index + = custom data length ; } index + = common size ; / / a final common size of zero bytes } else { msg error ( this , " unrecognized packed data opcode : " + opcode ) ; } } return data ; } }


creates a new async stub that supports all call types for the service

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


public void write short ( int value ) { int write at = cursor ; int end = write at + 2 ; if ( stretchy ) { ensure capacity ( end ) ; } else if ( end > data length ) { throw bounds ( ) ; return ; } data [ write at ] = ( byte ) value ; data [ write at + 1 ] = ( byte ) ( value > > 8 ) ; cursor = end ; }


returns whether translations were explicitly disabled

public boolean is translations disabled ( ) { return bundle translations = = tri state no ; }


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


returns true if copy special actions should be enabled ;

public boolean enable copy special ( ) ;


public void add ( int element ) { for ( int i = 0 ; i < size ; i + + ) { if ( reg [ i ] = = element ) { count [ i ] + + ; return ; } } reg [ size ] = element ; count [ size ] = 1 ; size + + ; }


returns a maximum input size for a given codec , mime type , width and height

private static int get codec max input size ( media codec info codec info , string sample mime type , int width , int height ) { if ( width = = format no value | | height = = format no value ) { / / we can ' t infer a maximum input size without video dimensions return format no value ; } / / attempt to infer a maximum input size from the format int max pixels ; int min compression ratio ; switch ( sample mime type ) { case mime types video h263 : case mime types video mp4v : max pixels = width * height ; min compression ratio = 2 ; break ; case mime types video h264 : if ( " bravia 4k 2015 " equals ( util model ) / / sony bravia 4k | | ( " amazon " equals ( util manufacturer ) & & ( " kfsowi " equals ( util model ) / / kindle soho | | ( " afts " equals ( util model ) & & codec info secure ) ) ) ) { / / fire tv gen 2 / / use the default value for cases where platform limitations may prevent buffers of the / / calculated maximum input size from being allocated return format no value ; } / / round up width / height to an integer number of macroblocks max pixels = util ceil divide ( width , 16 ) * util ceil divide ( height , 16 ) * 16 * 16 ; min compression ratio = 2 ; break ; case mime types video vp8 : / / vpx does not specify a ratio so use the values from the platform ' s soft v p x cpp max pixels = width * height ; min compression ratio = 2 ; break ; case mime types video h265 : case mime types video vp9 : max pixels = width * height ; min compression ratio = 4 ; break ; default : / / leave the default max input size return format no value ; } / / estimate the maximum input size assuming three channel 4 : 2 : 0 subsampled input frames return ( max pixels * 3 ) / ( 2 * min compression ratio ) ; }


as above but with an additional ' should ' phrase narrative used in the event of the condition failing to become true

void wait for ( string narrative , condition condition ) ;


model tests for additional properties integer

public void test additional properties integer ( ) { / / todo : test additional properties integer }


ndk 15 and above the headers have been unified into ndksysroot

public string create builtin sysroot ( ) { / / this location does not exist prior to ndk 15 preconditions check state ( major revision > = 15 ) ; return " external / % repository name % / ndk / sysroot " replace ( " % repository name % " , repository name ) ; }


called by the { @ link transport } implementation after an exception was sent as a response to an incoming request

public void on response sent ( long request id , string action , exception e ) { if ( tracer log is trace enabled ( ) & & should trace action ( action ) ) { tracer log trace ( ( ) - > new parameterized message ( " [ { } ] [ { } ] sent error response " , request id , action ) , e ) ; } message listener on response sent ( request id , action , e ) ; }


mixin interface and delegates all class must be public

public static mixin mixin ( class < ? > [ ] ics , class < ? > dc ) { return mixin ( ics , new class [ ] { dc } ) ; }


public list < integer > get namespace wrapped array ( ) { return namespace wrapped array ; }


create a builder with an { @ linkplain http status # unprocessable entity 422 unprocessable entity } status

static body builder unprocessable entity ( ) { return status ( http status unprocessable entity ) ; }


receives the elapsed time of the lifetime of an { @ link auto profiler } instance note that system # nano time isn ' t guaranteed to be non - decreasing , so implementations should check for non - positive { @ code elapsed time nanos } if they care about this sort of thing

void accept ( long elapsed time nanos ) ;


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


flag if the entity ' s code generation should be skipped e g if you need to change the class after initial generation

public void set skip generation ( boolean skip generation ) { this skip generation = skip generation ; }


public list < integer > get prefix array ( ) { return prefix array ; }


this method can be used to signal this metric fetcher that the metrics are still in use and should be updated

public void update ( ) { synchronized ( this ) { long current time = system current time millis ( ) ; if ( current time - last update time > update interval ) { last update time = current time ; fetch metrics ( ) ; } } }


see { @ link mockito # verify ( object ) }

default void verify ( verification verification ) { verify ( times ( 1 ) , verification ) ; }


public final u convert from dto ( final t dto ) { return from dto apply ( dto ) ; }


copies all files from go runtime to a temporary folder that is inside a valid gopath project structure

public static void group set up ( ) throws exception { tmp gopath = new file ( system get property ( " java io tmpdir " ) , " antlr - goruntime - tmpgopath - " + long to hex string ( system current time millis ( ) ) ) ; array list < string > pathsegments = new array list < string > ( ) ; pathsegments add ( " src " ) ; pathsegments add all ( arrays as list ( go runtime import path split ( " / " ) ) ) ; file tmp package dir = tmp gopath ; for ( string pathsegment : pathsegments ) { tmp package dir = new file ( tmp package dir , pathsegment ) ; } if ( ! tmp package dir mkdirs ( ) ) { throw new exception ( " could not create temp go runtime package dirs ! " ) ; } file [ ] runtime files = locate runtime ( ) list files ( ) ; if ( runtime files = = null ) { throw new exception ( " go runtime file list is empty " ) ; } for ( file runtime file : runtime files ) { file dest = new file ( tmp package dir , runtime file get name ( ) ) ; copy file ( runtime file , dest ) ; } cache go runtime ( tmp package dir ) ; }


set the indices options for controlling unavailable indices

public update by query request set indices options ( indices options indices options ) { get search request ( ) indices options ( indices options ) ; return this ; }


returns the instruction defined before the specified instruction or null if no instruction exists the instruction that is returned does not have to be contiguous

public final instruction get instruction before ( instruction instruction ) { return get instruction before ( instruction get min address ( ) ) ; }


determines whether < code > type < code > is an internal realm - type that is provided by x - pack , excluding the { @ link reserved realm } and realms that have extensive interaction with third party sources

static boolean is standard realm ( string type ) { return standard types contains ( type ) ; }


protected located block refresh located block ( located block block ) throws i o exception { return get block at ( block get start offset ( ) ) ; }


set the value for a parameter the method used is based on the sql type of the parameter and we can handle complex types like arrays and l o bs

public static void set parameter value ( prepared statement ps , int param index , int sql type , string type name , @ nullable object in value ) throws s q l exception { set parameter value internal ( ps , param index , sql type , type name , null , in value ) ; }


public void assert cursor ( int expected cursor ) { if ( cursor ! = expected cursor ) { throw new exception with context ( " expected cursor " + expected cursor + " ; actual value : " + cursor ) ; } }


retrieve the state of all activities known by the group for activities that have previously run and are now stopped or finished , the last saved state is used for the current running activity , its { @ link activity # on save instance state } is called to retrieve its current state

public bundle save instance state ( ) { bundle state = null ; / / fixme : child activities will freeze as part of on paused do we / / need to do this here ? final int n = m activity array size ( ) ; for ( int i = 0 ; i < n ; i + + ) { final local activity record r = m activity array get ( i ) ; if ( state = = null ) { state = new bundle ( ) ; } if ( ( r instance state ! = null | | r cur state = = resumed ) & & r activity ! = null ) { / / we need to save the state now , if we don ' t currently / / already have it or the activity is currently resumed final bundle child state = new bundle ( ) ; / / r activity perform save instance state ( child state ) ; try { activity perform save instance state invoke ( r activity , child state ) ; } catch ( invocation target exception e ) { throw new runtime exception ( e get target exception ( ) ) ; } r instance state = child state ; } if ( r instance state ! = null ) { state put bundle ( r id , r instance state ) ; } } return state ; }


loads all dependency jars from the default path

public static void add all dependency jars ( map < string , local resource > provider resources , slider file system slider file system , path temp path , string lib dir , string lib local src dir ) throws i o exception , slider exception { if ( service utils is set ( lib local src dir ) ) { file file = new file ( lib local src dir ) ; if ( ! file exists ( ) | | ! file is directory ( ) ) { throw new bad command arguments exception ( " supplied lib src dir % s is not valid " , lib local src dir ) ; } } service utils put all jars ( provider resources , slider file system , temp path , lib dir , lib local src dir ) ; }


public string get capital snake ( ) { return capital snake ; }


validate that test methods and test lifecycle methods in the supplied test class are not annotated with { @ link autowired @ autowired }

private void validate autowired config ( extension context context ) { / / we save the result in the extension context store so that we don ' t / / re - validate all methods for the same test class multiple times store store = context get store ( autowired validation namespace ) ; string error message = store get or compute if absent ( context get required test class ( ) , test class - > { method [ ] methods with errors = reflection utils get unique declared methods ( test class , autowired test or lifecycle method filter ) ; return ( methods with errors length = = 0 ? no autowired violations detected : string format ( " test methods and test lifecycle methods must not be annotated with @ autowired " + " you should instead annotate individual method parameters with @ autowired , " + " @ qualifier , or @ value offending methods in test class % s : % s " , test class get name ( ) , arrays to string ( methods with errors ) ) ) ; } , string class ) ; if ( error message ! = no autowired violations detected ) { throw new illegal state exception ( error message ) ; } }


authenticates the given token in an asynchronous fashion a successful authentication will call { @ link action listener # on response } with a { @ link authentication result # success successful } result , which includes the user associated with the given token < br > if the realm does not support , or cannot handle the token , it will call { @ link action listener # on response } with a { @ link authentication result # not handled not - handled } result this can include cases where the token identifies as user that is not known by this realm < br > if the realm can handle the token , but authentication failed it will typically call { @ link action listener # on response } with a { @ link authentication result # unsuccessful failure } result , which includes a diagnostic message regarding the failure this can include cases where the token identifies a valid user , but has an invalid password < br > if the realm wishes to assert that it has the exclusive right to handle the provided token , but authentication was not successful it typically call { @ link action listener # on response } with a { @ link authentication result # terminate termination } result , which includes a diagnostic message regarding the failure this can include cases where the token identifies a valid user , but has an invalid password and no other realm is allowed to authenticate that user the remote address should be { @ code null } if the request initiated from the local node

public abstract void authenticate ( authentication token token , action listener < authentication result > listener ) ;


{ @ inherit doc } this implementation is correct for single consumer thread use only

public e peek ( ) { final e [ ] buffer = consumer buffer ; final long index = consumer index ; final long mask = consumer mask ; final long offset = modified calc element offset ( index , mask ) ; object e = lv element ( buffer , offset ) ; / / load load if ( e = = null & & index ! = lv producer index ( ) ) { / / peek ( ) = = null iff queue is empty , null element is not strong enough indicator , so we must / / check the producer index if the queue is indeed not empty we spin until element is / / visible while ( ( e = lv element ( buffer , offset ) ) = = null ) { ; } } if ( e = = jump ) { return new buffer peek ( get next buffer ( buffer , mask ) , index ) ; } return ( e ) e ; }


only select executions which have a local variable value like the given value ( case insensitive ) this be used on string variables only

execution query variable value like ignore case ( string name , string value ) ;


get a pattern block with the given ( fully - included ) values at the given offset

public static assembly pattern block from bytes ( int offset , byte [ ] vals ) { byte [ ] mask = new byte [ vals length ] ; for ( int i = 0 ; i < mask length ; i + + ) { mask [ i ] = - 1 ; } assembly pattern block res = new assembly pattern block ( offset , mask , vals ) ; return res ; }


set if the user can open an item with long press on cell

public void set swipe open on long press ( boolean swipe open on long press ) { this swipe open on long press = swipe open on long press ; }


apply the strategy to figure out whether this authentication attempt can proceed

boolean apply ( request context request context , string user agent , geo location request location ) ;


wait until an attempt has reached a specified state the timeout is 40 seconds

public static void wait for state ( r m app attempt attempt , r m app attempt state final state ) throws interrupted exception { wait for state ( attempt , final state , timeout ms for attempt ) ; }


decode { @ code } len value bytes in big - endian format , beginning at { @ code start }

public long read val bytes ( int start , int len ) { long res = 0 ; for ( int i = 0 ; i < len ; i + + ) { res < < = 8 ; int index = start + i - offset ; if ( 0 < = index & & index < vals length ) { res | = 0xff & vals [ index ] ; } } return res ; }


computes the action key for this action by computing the fingerprint for the file contents

protected void compute key ( action key context action key context , @ nullable artifact expander artifact expander , fingerprint fp ) { fp add string ( guid ) ; fp add boolean ( include derived artifacts ) ; fp add string ( get contents ( ) ) ; }


get an existing buffer that uses a shadow buffer for byte values if they haven ' t been explicitly changed in this buffer this method should be used with care to avoid providing an improper id a database transaction must be in progress when invoking the various put , delete and set size methods on the returned buffer

public d b buffer get buffer ( int id , d b buffer shadow buffer ) throws i o exception { return new d b buffer ( this , new chained buffer ( buffer mgr , id , shadow buffer buf , 0 ) ) ; }


groups the records of a table by assigning them to windows defined by a time or row interval for streaming tables of infinite size , grouping into windows is required to define finite groups on which group - based aggregates can be computed for batch tables of finite size , windowing essentially provides shortcuts for time - based group by < b > note < b > : computing windowed aggregates on a streaming table is only a parallel operation if additional grouping attributes are added to the { @ code group by ( ) } clause if the { @ code group by ( ) } only references a group window alias , the streamed table will be processed by a single task , i e , with parallelism 1

group windowed table window ( group window group window ) ;


create platform transaction manager bean

public platform transaction manager tx manager ( final data source data source ) { return new data source transaction manager ( data source ) ; }


attempt to write multiple { @ link byte buf } objects

private int do write multiple ( channel outbound buffer in ) throws exception { final long max bytes per gathering write = config ( ) get max bytes per gathering write ( ) ; iov array array = ( ( epoll event loop ) event loop ( ) ) clean iov array ( ) ; array max bytes ( max bytes per gathering write ) ; in for each flushed message ( array ) ; if ( array count ( ) > = 1 ) { / / todo : handle the case where cnt = = 1 specially return write bytes multiple ( in , array ) ; } / / cnt = = 0 , which means the outbound buffer contained empty buffers only in remove bytes ( 0 ) ; return 0 ; }


in this case the introduction will be made

void introduction on target not implementing interface ( ) { not lockable not lockable target = new not lockable ( ) ; assert that ( not lockable target instanceof lockable ) is false ( ) ; not lockable not lockable 1 = ( not lockable ) create proxy ( not lockable target , get fixture ( ) get advisors ( new singleton metadata aware aspect instance factory ( new make lockable ( ) , " some bean " ) ) , not lockable class ) ; assert that ( not lockable 1 instanceof lockable ) is true ( ) ; lockable lockable = ( lockable ) not lockable 1 ; assert that ( lockable locked ( ) ) is false ( ) ; lockable lock ( ) ; assert that ( lockable locked ( ) ) is true ( ) ; not lockable not lockable 2 target = new not lockable ( ) ; not lockable not lockable 2 = ( not lockable ) create proxy ( not lockable 2 target , get fixture ( ) get advisors ( new singleton metadata aware aspect instance factory ( new make lockable ( ) , " some bean " ) ) , not lockable class ) ; assert that ( not lockable 2 instanceof lockable ) is true ( ) ; lockable lockable 2 = ( lockable ) not lockable 2 ; assert that ( lockable 2 locked ( ) ) is false ( ) ; not lockable 2 set int value ( 1 ) ; lockable 2 lock ( ) ; assert that illegal state exception ( ) is thrown by ( ( ) - > not lockable 2 set int value ( 32 ) ) ; assert that ( lockable 2 locked ( ) ) is true ( ) ; }


get a list of newly instantiated { @ link test execution listener test execution listeners } for the test class in the { @ link bootstrap context } associated with this bootstrapper if { @ link test execution listeners @ test execution listeners } is not present on the test class in the { @ code bootstrap context } , default listeners should be returned furthermore , default listeners must be sorted using { @ link org springframework core annotation annotation aware order comparator annotation aware order comparator } concrete implementations are free to determine what comprises the set of default listeners however , by default , the spring test context framework will use the { @ link org springframework core io support spring factories loader spring factories loader } mechanism to look up all { @ code test execution listener } class names configured in all { @ code meta - i n fspring factories } files on the classpath the { @ link test execution listeners # inherit listeners ( ) inherit listeners } flag of { @ link test execution listeners @ test execution listeners } must be taken into consideration specifically , if the { @ code inherit listeners } flag is set to { @ code true } , listeners declared for a given test class must be appended to the end of the list of listeners declared in superclasses

list < test execution listener > get test execution listeners ( ) ;


registers a task to be executed repeatedly at a fixed rate this call behaves similar to { @ link org apache flink runtime concurrent scheduled executor # schedule at fixed rate ( runnable , long , long , time unit ) }

scheduled future < ? > schedule at fixed rate ( processing time callback callback , long initial delay , long period ) ;


verifies that nested directories are properly copied with a < tt > hdfs : < tt > file system ( from a < tt > file : absolutepath < tt > source path )

public void test copy from local recursive with scheme ( ) throws exception { final file system target file system = hdfs root path get file system ( hadoop config ) ; final path target dir = target file system get working directory ( ) ; test register multiple local resources ( target file system , target dir , local resource directory , temp folder , true , false ) ; }


returns true if this section has read permissions

public boolean is read ( ) { return true ; }


clips the specified screen aligned rectangle , specified relative to the transform matrix of the stage ' s batch the transform matrix and the stage ' s camera must not have rotational components calling this method must be followed by a call to { @ link # clip end ( ) } if true is returned

public boolean clip begin ( float x , float y , float width , float height ) { if ( width < = 0 | | height < = 0 ) return false ; stage stage = this stage ; if ( stage = = null ) return false ; rectangle table bounds = rectangle tmp ; table bounds x = x ; table bounds y = y ; table bounds width = width ; table bounds height = height ; rectangle scissor bounds = pools obtain ( rectangle class ) ; stage calculate scissors ( table bounds , scissor bounds ) ; if ( scissor stack push scissors ( scissor bounds ) ) return true ; pools free ( scissor bounds ) ; return false ; }


void registry by resources ( resource [ ] resources , string tenant id ) throws i o exception ;


execute work as part of a test , against the created job after the execution , { @ link # abort job quietly ( job data ) } is called for abortcleanup

public void execute work ( string name , job data job data , action to test action ) throws exception { try ( duration info d = new duration info ( log , " executing % s " , name ) ) { action exec ( job data job , job data j context , job data t context , job data committer ) ; } finally { abort job quietly ( job data ) ; } }


fixes up the original name and category because a program restoration may have changed the original composite

protected void fixup original path ( composite composite ) { string new name = composite get name ( ) ; category path new cat path = composite get category path ( ) ; category path old cat path = view composite get category path ( ) ; data type path new dt path = new data type path ( new cat path , composite get name ( ) ) ; data type path old dt path = new data type path ( old cat path , view composite get name ( ) ) ; if ( ! old cat path equals ( new cat path ) ) { data type moved ( view d t m , old dt path , new dt path ) ; } if ( ! original data type path get data type name ( ) equals ( new name ) ) { data type renamed ( view d t m , old dt path , new dt path ) ; } }


removes all highlights from this container

public void clear ( ) { highlights by token clear ( ) ; }


set the value of the { @ linkplain # authorization authorization } header to basic authentication based on the given username and password

public void set basic auth ( string username , string password , @ nullable charset charset ) { set basic auth ( encode basic auth ( username , password , charset ) ) ; }


sets the lower boundary for the query ( inclusive ) can be removed ( when the query in unbounded ) through null

public boxed query request from ( ordinal begin ) { from = begin ; timestamp range gte ( begin ! = null ? begin timestamp ( ) : null ) ; return this ; }


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


public v create value ( ) { if ( null = = valueclass ) { final class < ? > cls = kids [ 0 ] create value ( ) get class ( ) ; for ( record reader < k , ? extends v > rr : kids ) { if ( ! cls equals ( rr create value ( ) get class ( ) ) ) { throw new class cast exception ( " child value classes fail to agree " ) ; } } valueclass = cls as subclass ( writable class ) ; ivalue = create internal value ( ) ; } return ( v ) reflection utils new instance ( valueclass , null ) ; }


checks whether the provided path matches the suffix pattern , i e " foobar " will match the pattern " bar "

public boolean is suffix match ( string path ) { return pattern matcher ( path ) matches ( ) ; }


returns the quotient of this long value and the given specific long value

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


restores the function comparison providers components to the indicated saved configuration state

public void read config state ( save state save state ) { function comparison panel read config state ( get name ( ) , save state ) ; }


builds a byte array without the final string delimiter

public byte [ ] get bytes ( ) { / / check the last valid entry to see the final length int bytes length = length ; if ( use separator [ index - 1 ] ) { bytes length = length - 1 ; } byte [ ] bytes = new byte [ bytes length ] ; int cur pos = 0 ; for ( int i = 0 ; i < index ; i + + ) { system arraycopy ( b [ i ] , 0 , bytes , cur pos , b [ i ] length ) ; cur pos + = b [ i ] length ; if ( i < index - 1 & & use separator [ i ] ) { bytes [ cur pos + + ] = 0x 0 ; } } return bytes ; }


public list < integer > get array item ( ) { return array item ; }


sets the human readable name of the user if the input parameter is empty , the user ' s id will be set

public void set full name ( string name ) { if ( util fix empty and trim ( name ) = = null ) name = id ; this full name = name ; }


template method that determines the scheduler to operate on to be implemented by subclasses

protected abstract scheduler get scheduler ( ) ;


public short get revision ( ) { return ne rev ; }


test cases when the destination is fixed paths

public void test conf link regex fixed dest mapping ( ) throws exception { / / config : / / < property > / / < name > fs viewfs mounttable test view file system link regex cluster / / link regex ^ / ( ? < first dir > \ w + ) < / name > / / < value > / target test root / $ { first dir } < / value > / / < / property > / / dir path to test : / misc 1 / / expect path : / target test root / test conf link regex fixed dest mapping file / / dir path to test : / misc 2 / / expect path : / target test root / test conf link regex fixed dest mapping file string regex str = " ^ / \ \ w + " ; string dst path str = target test root + " test conf link regex fixed dest mapping file " ; path expected resolve result = new path ( dst path str ) ; test regex mountpoint ( new configuration ( conf ) , regex str , dst path str , null , new path ( " / misc 1 " ) , expected resolve result , 5 ) ; test regex mountpoint ( new configuration ( conf ) , regex str , dst path str , null , new path ( " / misc 2 " ) , expected resolve result , 6 ) ; }


returns the data - path root for this shard the root is a parent of { @ link # get data path ( ) } without the index name and the shard id

public path get root data path ( ) { path no index shard id = get data path ( ) get parent ( ) get parent ( ) ; return is custom data path ? no index shard id : no index shard id get parent ( ) ; / / also strip the indices folder }


copies moves the downloaded outputs from their download location to their declared location

private void move outputs to final location ( list < listenable future < file metadata > > downloads ) throws i o exception , interrupted exception { list < file metadata > finished downloads = new array list < > ( downloads size ( ) ) ; for ( listenable future < file metadata > finished download : downloads ) { file metadata output file = get from future ( finished download ) ; if ( output file ! = null ) { finished downloads add ( output file ) ; } } / * * sort the list lexicographically based on its temporary download path in order to avoid * filename clashes when moving the files : * * consider an action that produces two outputs foo and foo tmp these outputs would initially * be downloaded to foo tmp and foo tmp tmp when renaming them to foo and foo tmp we need to * ensure that rename ( foo tmp , foo ) happens before rename ( foo tmp tmp , foo tmp ) we ensure this * by doing the renames in lexicographical order of the download names * / collections sort ( finished downloads , comparator comparing ( f - > to tmp download path ( f path ( ) ) ) ) ; / / move the output files from their temporary name to the actual output file name for ( file metadata output file : finished downloads ) { file system utils move file ( to tmp download path ( output file path ( ) ) , output file path ( ) ) ; output file path ( ) set executable ( output file is executable ( ) ) ; } }


encodes all the information needed to identify a batch of rows to return to presto for a basic scan , includes schema name , table name , and output constraint for an index scan , includes schema name , table name , set of keys to lookup and output constraint

public presto thrift id get split id ( ) { return split id ; }


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


returns the { @ link rule class provider } of this { @ link package factory }

public rule class provider get rule class provider ( ) { return rule class provider ; }


pull a string entry from a stanza , or null

public string get value or null ( string name ) throws invalid xml exception { if ( ! subtrees contains key ( name ) ) { return null ; } linked list < stanza > l = subtrees get ( name ) ; if ( l size ( ) ! = 1 ) { throw new invalid xml exception ( " more than one value found for " + name ) ; } return l get ( 0 ) get value ( ) ; }


checks out specified revision or reference

void checkout ( string ref ) throws exception { run git ( " checkout " , ref ) ; }


set the route for the setup payload the rules for formatting and encoding the route are the same as those for a request route as described in { @ link # route ( string , object ) } by default this is not set

r socket requester builder setup route ( string route , object route vars ) ;


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


read a remote invocation from the given http request delegates to { @ link # read remote invocation ( http exchange , input stream ) } with the { @ link http exchange # get request body ( ) } request ' s input stream }

protected remote invocation read remote invocation ( http exchange exchange ) throws i o exception , class not found exception { return read remote invocation ( exchange , exchange get request body ( ) ) ; }


manipulate the part headers through the given consumer

part builder headers ( consumer < http headers > headers consumer ) ;


can this { @ link token filter } be used in multi - term queries ?

public boolean should use filter for multiterm queries ( ) { return use filter for multiterm queries ; }


updated user this can only be done by the logged in user

completion stage < response < void > > update user ( @ retrofit 2 http path ( " username " ) string username , @ retrofit 2 http body user body ) ;


get the world particle group list with the returned group , use particle group : : get next to get the next group in the world list a null group indicates the end of the list

public particle group [ ] get particle group list ( ) { return m particle system get particle group list ( ) ; }


find the fields constant that matches field id , throwing an exception if it is not found

public static fields find by thrift id or throw ( int field id ) { fields fields = find by thrift id ( field id ) ; if ( fields = = null ) throw new illegal argument exception ( " field " + field id + " doesn ' t exist ! " ) ; return fields ; }


how should a token be displayed in an error message ? the default is to display just the text , but during development you might want to have a lot of information spit out override in that case to use t to string ( ) ( which , for common token , dumps everything about the token ) this is better than forcing you to override a method in your token objects because you don ' t have to go modify your lexer so that it creates a new java type

public string get token error display ( token t ) { if ( t = = null ) return " < no token > " ; string s = t get text ( ) ; if ( s = = null ) { if ( t get type ( ) = = token eof ) { s = " < eof > " ; } else { s = " < " + t get type ( ) + " > " ; } } s = s replace ( " \ n " , " \ \ n " ) ; s = s replace ( " \ r " , " \ \ r " ) ; s = s replace ( " \ t " , " \ \ t " ) ; return " ' " + s + " ' " ; }


builds and returns the formatted error message

public error message build ( ) { string builder sb = new string builder ( message ) ; if ( exception ! = null ) { sb append ( " \ n \ n - - - 8 < - - - 8 < - - - exception details - - - 8 < - - - 8 < - - - \ n " ) ; sb append ( throwables get stack trace as string ( exception ) trim ( ) ) ; sb append ( " \ n - - - 8 < - - - 8 < - - - end of exception details - - - 8 < - - - 8 < - - - " ) ; } if ( ! log text is empty ( ) ) { sb append ( " \ n \ n - - - 8 < - - - 8 < - - - start of log " ) ; if ( log text length ( ) > log size limit ) { sb append ( " snippet " ) ; } if ( log file ! = null ) { sb append ( " , file at " ) ; sb append ( log file get path string ( ) ) ; } sb append ( " - - - 8 < - - - 8 < - - - \ n " ) ; / / if the length of the log is longer than the limit , print only the last part if ( log text length ( ) > log size limit ) { sb append ( " [ truncated ] \ n " ) ; sb append ( log text , log text length ( ) - log size limit , log text length ( ) ) ; sb append ( " \ n - - - 8 < - - - 8 < - - - end of log snippet , " ) ; sb append ( log text length ( ) - log size limit ) ; sb append ( " chars omitted - - - 8 < - - - 8 < - - - " ) ; } else { sb append ( log text ) ; sb append ( " \ n - - - 8 < - - - 8 < - - - end of log - - - 8 < - - - 8 < - - - " ) ; } } return new auto value error message ( sb to string ( ) ) ; }


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


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

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


turns on or off the faded text that indicates if the field is in month or day mode

public void set show field mode ( boolean show ) { this show field decoration = show ; text field repaint ( ) ; }


verifies that { @ code invokable } produces a { @ link null pointer exception } or { @ link unsupported operation exception } when the parameter in position { @ code param index } is null if this parameter is marked nullable , this method does nothing

private void test parameter ( object instance , invokable < ? , ? > invokable , int param index , class < ? > tested class ) { if ( is primitive or nullable ( invokable get parameters ( ) get ( param index ) ) ) { return ; / / there ' s nothing to test } object [ ] params = build param list ( invokable , param index ) ; try { @ suppress warnings ( " unchecked " ) / / we ' ll get a runtime exception if the type is wrong invokable < object , ? > unsafe = ( invokable < object , ? > ) invokable ; unsafe invoke ( instance , params ) ; assert fail ( " no exception thrown for parameter at index " + param index + " from " + invokable + arrays to string ( params ) + " for " + tested class ) ; } catch ( invocation target exception e ) { throwable cause = e get cause ( ) ; if ( policy is expected type ( cause ) ) { return ; } assertion failed error error = new assertion failed error ( string format ( " wrong exception thrown from % s when passing null to % s parameter at index % s % n " + " full parameters : % s % n " + " actual exception message : % s " , invokable , invokable get parameters ( ) get ( param index ) get type ( ) , param index , arrays to string ( params ) , cause ) ) ; error init cause ( cause ) ; throw error ; } catch ( illegal access exception e ) { throw new runtime exception ( e ) ; } }