this method is intended for handling moving to different steps from { @ link transport action } executions for this reason , it is reasonable to throw { @ link illegal argument exception } when state is not as expected

static cluster state move cluster state to step ( index index , cluster state state , step step key new step key , long supplier now supplier , policy steps registry step registry , boolean force phase definition refresh ) { index metadata idx meta = state get metadata ( ) index ( index ) ; step step key current step key = lifecycle execution state get current step key ( lifecycle execution state from index metadata ( idx meta ) ) ; validate transition ( idx meta , current step key , new step key , step registry ) ; settings index settings = idx meta get settings ( ) ; string policy = lifecycle settings lifecycle name setting get ( index settings ) ; logger info ( " moving index [ { } ] from [ { } ] to [ { } ] in policy [ { } ] " , index get name ( ) , current step key , new step key , policy ) ; index lifecycle metadata ilm meta = state metadata ( ) custom ( index lifecycle metadata type ) ; lifecycle policy metadata policy metadata = ilm meta get policy metadatas ( ) get ( lifecycle settings lifecycle name setting get ( idx meta get settings ( ) ) ) ; lifecycle execution state lifecycle state = lifecycle execution state from index metadata ( idx meta ) ; lifecycle execution state new lifecycle state = update execution state to step ( policy metadata , lifecycle state , new step key , now supplier , force phase definition refresh ) ; cluster state builder new cluster state builder = new cluster state with lifecycle state ( index , state , new lifecycle state ) ; return new cluster state builder build ( ) ; }


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


returns a new { @ link char sink } for writing character data to the given file using the given character set the given { @ code modes } control how the file is opened for writing when no mode is provided , the file will be truncated before writing when the { @ link file write mode # append append } mode is provided , writes will append to the end of the file without truncating it

public static char sink as char sink ( file file , charset charset , file write mode modes ) { return as byte sink ( file , modes ) as char sink ( charset ) ; }


copy the text to clipboard , and indicate to the user whether the operation was completed successfully using a toast

public static void copy to clipboard ( final context context , final string text ) { final clipboard manager clipboard manager = context compat get system service ( context , clipboard manager class ) ; if ( clipboard manager = = null ) { toast make text ( context , r string permission denied , toast length long ) show ( ) ; return ; } clipboard manager set primary clip ( clip data new plain text ( null , text ) ) ; toast make text ( context , r string msg copied , toast length short ) show ( ) ; }


this method converts dp unit to equivalent pixels , depending on device density needs utils to be initialized before usage

public static float convert dp to pixel ( float dp ) { if ( m metrics = = null ) { log e ( " m p chart lib - utils " , " utils not initialized you need to call utils init ( ) at least once before " + " calling utils convert dp to pixel ( ) otherwise conversion does not " + " take place " ) ; return dp ; } return dp * m metrics density ; }


determine whether the { # link reporter ( ) } created by this apparatus will fail fast , that is , throw an exception whenever we encounter an event of matching { @ link event kind # errors and warnings } default : { @ code true }

public void set fail fast ( boolean fail fast ) { this fail fast = fail fast ; if ( fail fast ) { reporter add handler ( fail fast handler ) ; } else { reporter remove handler ( fail fast handler ) ; } }


close the closeable objects and < b > ignore < b > any { @ link throwable } or null pointers must only be used for cleanup in exception handlers

public static void cleanup with logger ( logger logger , java io closeable closeables ) { for ( java io closeable c : closeables ) { if ( c ! = null ) { try { c close ( ) ; } catch ( throwable e ) { if ( logger ! = null ) { logger debug ( " exception in closing { } " , c , e ) ; } } } } }


calls thread fail with message " should throw " + exception name

public void thread should throw ( string exception name ) { thread fail ( " should throw " + exception name ) ; }


returns the original element list , unchanged

public list < double > order ( list < double > insertion order ) { return insertion order ; }


initialize the binder with the required fields

protected void init binder ( final http servlet request request , final servlet request data binder binder ) { if ( service validate configuration context is renew enabled ( ) ) { binder set required fields ( cas protocol constants parameter renew ) ; } }


return a test record accumulator instance

private record accumulator create test record accumulator ( int delivery timeout ms , int batch size , long total size , compression type type , int linger ms ) { long retry backoff ms = 100l ; string metric grp name = " producer - metrics " ; return new record accumulator ( log context , batch size , type , linger ms , retry backoff ms , delivery timeout ms , metrics , metric grp name , time , new api versions ( ) , null , new buffer pool ( total size , batch size , metrics , time , metric grp name ) ) ; }


this test validates the correctness of submit application in case the cluster is composed of only 1 bad sub cluster and a good one

public void test submit application one bad one good ( ) throws yarn exception , i o exception , interrupted exception { system out println ( " test submit application with one bad , one good sc " ) ; setup cluster ( arrays as list ( good , bad 2 ) ) ; application id app id = application id new instance ( system current time millis ( ) , 1 ) ; application submission context info context = new application submission context info ( ) ; context set application id ( app id to string ( ) ) ; response response = interceptor submit application ( context , null ) ; assert assert equals ( accepted , response get status ( ) ) ; assert assert equals ( good , state store get application home sub cluster ( get application home sub cluster request new instance ( app id ) ) get application home sub cluster ( ) get home sub cluster ( ) ) ; }


attempts to cancel the { @ link timer task } associated with this handle if the task has been executed or cancelled already , it will return with no side effect


get range start for the first integer range

public int get range start ( ) { if ( ranges = = null | | ranges is empty ( ) ) { return - 1 ; } range r = ranges get ( 0 ) ; return r start ; }


this bst iterator manages to use o ( h ) extra space , where h is the height of the tree it achieves this by maintaining a stack of the nodes to handle ( pushing all left nodes first ) , before handling self or right node

private void push path to next smallest ( tree node < t > node ) { while ( node ! = null ) { path stack push ( node ) ; node = node get left ( ) ; } }


gets the accessibility content description


public void add contents ( dex file file ) { for ( offsetted item i : items ) { i add contents ( file ) ; } }


inserts the pixmap if name was not null , you can later retrieve the image ' s position in the output image via { @ link # get rect ( string ) }

public synchronized rectangle pack ( string name , pixmap image ) { if ( disposed ) return null ; if ( name ! = null & & get rect ( name ) ! = null ) throw new gdx runtime exception ( " pixmap has already been packed with name : " + name ) ; pixmap packer rectangle rect ; pixmap pixmap to dispose = null ; if ( name ! = null & & name ends with ( " 9 " ) ) { rect = new pixmap packer rectangle ( 0 , 0 , image get width ( ) - 2 , image get height ( ) - 2 ) ; pixmap to dispose = new pixmap ( image get width ( ) - 2 , image get height ( ) - 2 , image get format ( ) ) ; pixmap to dispose set blending ( blending none ) ; rect splits = get splits ( image ) ; rect pads = get pads ( image , rect splits ) ; pixmap to dispose draw pixmap ( image , 0 , 0 , 1 , 1 , image get width ( ) - 1 , image get height ( ) - 1 ) ; image = pixmap to dispose ; name = name split ( " \ \ " ) [ 0 ] ; } else { if ( strip whitespace x | | strip whitespace y ) { int original width = image get width ( ) ; int original height = image get height ( ) ; / / strip whitespace , manipulate the pixmap and return corrected rect int top = 0 ; int bottom = image get height ( ) ; if ( strip whitespace y ) { outer : for ( int y = 0 ; y < image get height ( ) ; y + + ) { for ( int x = 0 ; x < image get width ( ) ; x + + ) { int pixel = image get pixel ( x , y ) ; int alpha = ( ( pixel & 0x 0 0 0 0 0 0ff ) ) ; if ( alpha > alpha threshold ) break outer ; } top + + ; } outer : for ( int y = image get height ( ) ; - - y > = top ; ) { for ( int x = 0 ; x < image get width ( ) ; x + + ) { int pixel = image get pixel ( x , y ) ; int alpha = ( ( pixel & 0x 0 0 0 0 0 0ff ) ) ; if ( alpha > alpha threshold ) break outer ; } bottom - - ; } } int left = 0 ; int right = image get width ( ) ; if ( strip whitespace x ) { outer : for ( int x = 0 ; x < image get width ( ) ; x + + ) { for ( int y = top ; y < bottom ; y + + ) { int pixel = image get pixel ( x , y ) ; int alpha = ( ( pixel & 0x 0 0 0 0 0 0ff ) ) ; if ( alpha > alpha threshold ) break outer ; } left + + ; } outer : for ( int x = image get width ( ) ; - - x > = left ; ) { for ( int y = top ; y < bottom ; y + + ) { int pixel = image get pixel ( x , y ) ; int alpha = ( ( pixel & 0x 0 0 0 0 0 0ff ) ) ; if ( alpha > alpha threshold ) break outer ; } right - - ; } } int new width = right - left ; int new height = bottom - top ; pixmap to dispose = new pixmap ( new width , new height , image get format ( ) ) ; pixmap to dispose set blending ( blending none ) ; pixmap to dispose draw pixmap ( image , 0 , 0 , left , top , new width , new height ) ; image = pixmap to dispose ; rect = new pixmap packer rectangle ( 0 , 0 , new width , new height , left , top , original width , original height ) ; } else { rect = new pixmap packer rectangle ( 0 , 0 , image get width ( ) , image get height ( ) ) ; } } if ( rect get width ( ) > page width | | rect get height ( ) > page height ) { if ( name = = null ) throw new gdx runtime exception ( " page size too small for pixmap " ) ; throw new gdx runtime exception ( " page size too small for pixmap : " + name ) ; } page page = pack strategy pack ( this , name , rect ) ; if ( name ! = null ) { page rects put ( name , rect ) ; page added rects add ( name ) ; } int rect x = ( int ) rect x , rect y = ( int ) rect y , rect width = ( int ) rect width , rect height = ( int ) rect height ; if ( pack to texture & & ! duplicate border & & page texture ! = null & & ! page dirty ) { page texture bind ( ) ; gdx gl gl tex sub image 2 d ( page texture gl target , 0 , rect x , rect y , rect width , rect height , image get g l format ( ) , image get g l type ( ) , image get pixels ( ) ) ; } else page dirty = true ; page image draw pixmap ( image , rect x , rect y ) ; if ( duplicate border ) { int image width = image get width ( ) , image height = image get height ( ) ; / / copy corner pixels to fill corners of the padding page image draw pixmap ( image , 0 , 0 , 1 , 1 , rect x - 1 , rect y - 1 , 1 , 1 ) ; page image draw pixmap ( image , image width - 1 , 0 , 1 , 1 , rect x + rect width , rect y - 1 , 1 , 1 ) ; page image draw pixmap ( image , 0 , image height - 1 , 1 , 1 , rect x - 1 , rect y + rect height , 1 , 1 ) ; page image draw pixmap ( image , image width - 1 , image height - 1 , 1 , 1 , rect x + rect width , rect y + rect height , 1 , 1 ) ; / / copy edge pixels into padding page image draw pixmap ( image , 0 , 0 , image width , 1 , rect x , rect y - 1 , rect width , 1 ) ; page image draw pixmap ( image , 0 , image height - 1 , image width , 1 , rect x , rect y + rect height , rect width , 1 ) ; page image draw pixmap ( image , 0 , 0 , 1 , image height , rect x - 1 , rect y , 1 , rect height ) ; page image draw pixmap ( image , image width - 1 , 0 , 1 , image height , rect x + rect width , rect y , 1 , rect height ) ; } if ( pixmap to dispose ! = null ) { pixmap to dispose dispose ( ) ; } return rect ; }


returns the providers created by the aspect

public transitive info provider map get providers ( ) { return providers ; }


generate combined md5 message digest hash for all values in the specified values list

public static string get m d 5 hash ( list < string > values ) { return hash utilities get hash ( hash utilities md5 algorithm , values ) ; }


get the block this streamer is writing to

extended block get block ( ) { return block get current block ( ) ; }


invoked after transaction commit can perform further operations right after the main transaction has successfully committed can e g commit further operations that are supposed to follow on a successful commit of the main transaction , like confirmation messages or emails < b > note : < b > the transaction will have been committed already , but the transactional resources might still be active and accessible as a consequence , any data access code triggered at this point will still " participate " in the original transaction , allowing to perform some cleanup ( with no commit following anymore ! ) , unless it explicitly declares that it needs to run in a separate transaction hence : < b > use { @ code propagation requires new } for any transactional operation that is called from here < b >


parses a space andor comma separated sequence of server specifications of the form hostname or hostname : port if the specs string is null , defaults to localhost : default port

public static list < inet socket address > parse ( string specs , int default port ) { list < inet socket address > result = lists new array list ( ) ; if ( specs = = null ) { result add ( new inet socket address ( " localhost " , default port ) ) ; } else { string [ ] spec strings = specs split ( " [ , ] + " ) ; for ( string spec string : spec strings ) { result add ( net utils create socket addr ( spec string , default port ) ) ; } } return result ; }


sets the value of the string value to the given string

public void set value ( char sequence value ) { check not null ( value ) ; set value ( value , 0 , value length ( ) ) ; }


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

public update or delete executor delete async ( ) { final update or delete executor executor = new update or delete executor ( ) ; runnable runnable = new runnable ( ) { @ override public void run ( ) { synchronized ( lite pal support class ) { final int rows affected = delete ( ) ; if ( executor get listener ( ) ! = null ) { operator get handler ( ) post ( new runnable ( ) { @ override public void run ( ) { executor get listener ( ) on finish ( rows affected ) ; } } ) ; } } } } ; executor submit ( runnable ) ; return executor ; }


determine the spring { @ link resource loader } to use for hibernate metadata

public resource loader get resource loader ( ) { if ( this resource pattern resolver = = null ) { this resource pattern resolver = new path matching resource pattern resolver ( ) ; } return this resource pattern resolver ; }


returns an element from the specified key < br > for querystring : < br > < br > user [ name ] = fede < br > < br > get ( " user " ) get ( " name " ) value ( ) # fede < br > or < br > get ( " user " , " name " ) value ( ) # fede

public query params map get ( string keys ) { query params map ret = this ; for ( string key : keys ) { if ( ret query map contains key ( key ) ) { ret = ret query map get ( key ) ; } else { ret = null ; } } return ret ; }


gets a string indicating warnings that occurred during the initial diff of the two programs

public string get warnings ( ) { return program diff get warnings ( ) ; }


returns the left y - axis object in the horizontal bar - chart , this is the top axis

public y axis get axis left ( ) { return m axis left ; }


obtain the type converter from the bean factory that this bean runs in , if possible

protected type converter get default type converter ( ) { if ( this bean factory ! = null ) { return this bean factory get type converter ( ) ; } else { return super get default type converter ( ) ; } }


test verifies that the server shouldn ' t allow minsessiontimeout greater than maxsessiontimeout

public void test with min session timeout greater than max session timeout ( ) throws exception { client base setup test env ( ) ; final int client port = port assignment unique ( ) ; final int tick time = 2000 ; final int min session timeout = 20 * tick time + 1000 ; / / min is higher final int max session timeout = tick time * 2 - 100 ; / / max is lower final string configs = " max session timeout = " + max session timeout + " \ n " + " min session timeout = " + min session timeout + " \ n " ; main thread main = new main thread ( client port , true , configs ) ; string [ ] args = new string [ 1 ] ; args [ 0 ] = main conf file to string ( ) ; try { main main initialize and run ( args ) ; fail ( " must throw exception as " + " minsessiontimeout > maxsessiontimeout " ) ; } catch ( config exception iae ) { / / expected } }


run a s 3 guard tool command from a varags list

protected int run ( configuration conf , object args ) throws exception { return run s 3 guard command ( conf , args ) ; }


required the nonce provides a way for request change to uniquely reference a request resources < code > string nonce = 5 ; < code >

public com google protobuf byte string get nonce bytes ( ) { java lang object ref = nonce ; if ( ref instanceof java lang string ) { com google protobuf byte string b = com google protobuf byte string copy from utf 8 ( ( java lang string ) ref ) ; nonce = b ; return b ; } else { return ( com google protobuf byte string ) ref ; } }


set the class loader to use for loading jackson extension modules

public jackson 2 object mapper builder module class loader ( class loader module class loader ) { this module class loader = module class loader ; return this ; }


returns an unmodifiable set of encapsulated { @ link h a proxy t l v } s

public list < h a proxy t l v > encapsulated t l vs ( ) { return tlvs ; }


postmultiplies this matrix with a ( counter - clockwise ) rotation matrix postmultiplication is also used by open g l es ' 1 x gl translategl rotategl scale

public matrix 4 rotate ( quaternion rotation ) { rotation to matrix ( tmp ) ; mul ( val , tmp ) ; return this ; }


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


materialize this stream to an auto - generated repartition topic and create a new { @ code k stream } from the auto - generated topic using { @ link serde key serde } , { @ link serde value serde } , { @ link stream partitioner } , number of partitions , and topic name part as defined by { @ link repartitioned } the created topic is considered as an internal topic and is meant to be used only by the current kafka streams instance similar to auto - repartitioning , the topic will be created with infinite retention time and data will be automatically purged by kafka streams the topic will be named as " $ { application id } - & lt ; name & gt ; - repartition " , where " application id " is user - specified in { @ link streams config } via parameter { @ link streams config # application id config application id config } , " & lt ; name & gt ; " is either provided via { @ link repartitioned # as ( string ) } or an internally generated name , and " - repartition " is a fixed suffix

k stream < k , v > repartition ( final repartitioned < k , v > repartitioned ) ;


protected void run test ( testable testable ) throws exception { run ( new testable decorator ( setup , testable ) ) ; }


transforms this local resource descriptor to a { @ link local resource }

public local resource to local resource ( ) { return utils register local resource ( path , size , modification time , visibility , resource type ) ; }


gets the current state true if the file exists , false if it doesn ' t

public boolean get ( ) { return state = file exists ( ) ; }


generate an address set which only includes initialized memory

protected address set view get searchable address set ( program program , address start address , program selection selection ) { if ( start address = = null ) { return new address set ( ) ; / / special case if we are at the first address going backwards / / or the last address going forwards } memory memory = program get memory ( ) ; address set view set = include non loaded blocks ? memory get all initialized address set ( ) : memory get loaded and initialized address set ( ) ; if ( search selection & & selection ! = null & & ! selection is empty ( ) ) { set = set intersect ( selection ) ; } address start = forward search ? start address : memory get min address ( ) ; address end = forward search ? memory get max address ( ) : start address ; if ( start compare to ( end ) > 0 ) { return new address set ( ) ; } address set address set = program get address factory ( ) get address set ( start , end ) ; return set intersect ( address set ) ; }


callback method when current resource manager is granted leadership

public void grant leadership ( final uuid new leader session i d ) { final completable future < boolean > accept leadership future = clear state future then compose async ( ( ignored ) - > try accept leadership ( new leader session i d ) , get unfenced main thread executor ( ) ) ; final completable future < void > confirmation future = accept leadership future then accept async ( ( accept leadership ) - > { if ( accept leadership ) { / / confirming the leader session id might be blocking , leader election service confirm leadership ( new leader session i d , get address ( ) ) ; } } , io executor ) ; confirmation future when complete ( ( void ignored , throwable throwable ) - > { if ( throwable ! = null ) { on fatal error ( exception utils strip completion exception ( throwable ) ) ; } } ) ; }


creates and returns a rule context to use for starlark tests that is equivalent to the one that was used to create the given configured target

protected rule context get rule context for starlark ( configured target target ) throws exception { / / todo ( bazel - team ) : we need this horrible workaround because caching analysis environment / / only works with stored error event listener despite the fact it accepts the interface / / error event listener , so it ' s not possible to create it with reporter / / see build view get rule context for testing ( ) stored event handler event handler = new stored event handler ( ) { @ override public synchronized void handle ( event e ) { super handle ( e ) ; reporter handle ( e ) ; } } ; return view get rule context for testing ( target , event handler , master config ) ; }


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


parse a value according to its expected type

public static object parse type ( string name , object value , type type ) { try { if ( value = = null ) return null ; string trimmed = null ; if ( value instanceof string ) trimmed = ( ( string ) value ) trim ( ) ; switch ( type ) { case boolean : if ( value instanceof string ) { if ( trimmed equals ignore case ( " true " ) ) return true ; else if ( trimmed equals ignore case ( " false " ) ) return false ; else throw new config exception ( name , value , " expected value to be either true or false " ) ; } else if ( value instanceof boolean ) return value ; else throw new config exception ( name , value , " expected value to be either true or false " ) ; case password : if ( value instanceof password ) return value ; else if ( value instanceof string ) return new password ( trimmed ) ; else throw new config exception ( name , value , " expected value to be a string , but it was a " + value get class ( ) get name ( ) ) ; case string : if ( value instanceof string ) return trimmed ; else throw new config exception ( name , value , " expected value to be a string , but it was a " + value get class ( ) get name ( ) ) ; case int : if ( value instanceof integer ) { return value ; } else if ( value instanceof string ) { return integer parse int ( trimmed ) ; } else { throw new config exception ( name , value , " expected value to be a 32 - bit integer , but it was a " + value get class ( ) get name ( ) ) ; } case short : if ( value instanceof short ) { return value ; } else if ( value instanceof string ) { return short parse short ( trimmed ) ; } else { throw new config exception ( name , value , " expected value to be a 16 - bit integer ( short ) , but it was a " + value get class ( ) get name ( ) ) ; } case long : if ( value instanceof integer ) return ( ( integer ) value ) long value ( ) ; if ( value instanceof long ) return value ; else if ( value instanceof string ) return long parse long ( trimmed ) ; else throw new config exception ( name , value , " expected value to be a 64 - bit integer ( long ) , but it was a " + value get class ( ) get name ( ) ) ; case double : if ( value instanceof number ) return ( ( number ) value ) double value ( ) ; else if ( value instanceof string ) return double parse double ( trimmed ) ; else throw new config exception ( name , value , " expected value to be a double , but it was a " + value get class ( ) get name ( ) ) ; case list : if ( value instanceof list ) return value ; else if ( value instanceof string ) if ( trimmed is empty ( ) ) return collections empty list ( ) ; else return arrays as list ( comma with whitespace split ( trimmed , - 1 ) ) ; else throw new config exception ( name , value , " expected a comma separated list " ) ; case class : if ( value instanceof class ) return value ; else if ( value instanceof string ) { class loader context or kafka class loader = utils get context or kafka class loader ( ) ; / / use load class here instead of class for name because the name we use here may be an alias / / and not match the name of the class that gets loaded if that happens , class for name can / / throw an exception class < ? > klass = context or kafka class loader load class ( trimmed ) ; / / invoke for name here with the true name of the requested class to cause class / / initialization to take place return class for name ( klass get name ( ) , true , context or kafka class loader ) ; } else throw new config exception ( name , value , " expected a class instance or class name " ) ; default : throw new illegal state exception ( " unknown type " ) ; } } catch ( number format exception e ) { throw new config exception ( name , value , " not a number of type " + type ) ; } catch ( class not found exception e ) { throw new config exception ( name , value , " class " + value + " could not be found " ) ; } }


add some additional overhead to the buffer the rational is that it is better to slightly over allocate and waste some memory , rather than under allocate and require a resizecopy

private static int pad size for accumulation ( int readable bytes ) { return ( readable bytes < < 2 ) / 3 ; }


perform the actual work for { @ link # before test method } and { @ link # after test method } by dirtying the context if appropriate ( i e , according to the required modes )

protected void before or after test method ( test context test context , method mode required method mode , class mode required class mode ) throws exception { assert not null ( test context , " test context must not be null " ) ; assert not null ( required method mode , " required method mode must not be null " ) ; assert not null ( required class mode , " required class mode must not be null " ) ; class < ? > test class = test context get test class ( ) ; method test method = test context get test method ( ) ; assert not null ( test class , " the test class of the supplied test context must not be null " ) ; assert not null ( test method , " the test method of the supplied test context must not be null " ) ; dirties context method ann = annotated element utils find merged annotation ( test method , dirties context class ) ; dirties context class ann = test context annotation utils find merged annotation ( test class , dirties context class ) ; boolean method annotated = ( method ann ! = null ) ; boolean class annotated = ( class ann ! = null ) ; method mode method mode = ( method annotated ? method ann method mode ( ) : null ) ; class mode class mode = ( class annotated ? class ann class mode ( ) : null ) ; if ( logger is debug enabled ( ) ) { string phase = ( required class mode name ( ) starts with ( " before " ) ? " before " : " after " ) ; logger debug ( string format ( " % s test method : context % s , class annotated with @ dirties context [ % s ] " + " with mode [ % s ] , method annotated with @ dirties context [ % s ] with mode [ % s ] " , phase , test context , class annotated , class mode , method annotated , method mode ) ) ; } if ( ( method mode = = required method mode ) | | ( class mode = = required class mode ) ) { hierarchy mode hierarchy mode = ( method annotated ? method ann hierarchy mode ( ) : class ann hierarchy mode ( ) ) ; dirty context ( test context , hierarchy mode ) ; } }


i pv 4 endpoint address packed into 4 bytes or null if unknown

@ nullable public byte [ ] ipv 4 bytes ( ) { return ipv 4 bytes ; }


matching on a wildcard path element is quite straight forward scan the candidate from the candidate index onwards for the next separator or the end of the candidate

public boolean matches ( int path index , matching context matching context ) { string segment data = null ; / / assert if it exists it is a segment if ( path index < matching context path length ) { element element = matching context path elements get ( path index ) ; if ( ! ( element instanceof path container path segment ) ) { / / should not match a separator return false ; } segment data = ( ( path container path segment ) element ) value to match ( ) ; path index + + ; } if ( is no more pattern ( ) ) { if ( matching context determine remaining path ) { matching context remaining path index = path index ; return true ; } else { if ( path index = = matching context path length ) { / / and the path data has run out too return true ; } else { return ( matching context is match optional trailing separator ( ) & & / / if optional slash is on segment data ! = null & & segment data length ( ) > 0 & & / / and there is at least one character to match the * ( path index + 1 ) = = matching context path length & & / / and the next path element is the end of the candidate matching context is separator ( path index ) ) ; / / and the final element is a separator } } } else { / / within a path ( e g / aa / * / bb ) there must be at least one character to match the wildcard if ( segment data = = null | | segment data length ( ) = = 0 ) { return false ; } return ( this next ! = null & & this next matches ( path index , matching context ) ) ; } }


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


this testcase tests whether an illegal argument exception will be thrown when a negative value is retrieved by d f s util # get invalidate work pct per iteration

public void test get invalidate work pct per iteration negative value ( ) { configuration conf = new configuration ( ) ; float blocks invalidate work pct = d f s util get invalidate work pct per iteration ( conf ) ; assert true ( blocks invalidate work pct > 0 ) ; conf set ( d f s config keys dfs namenode invalidate work pct per iteration , " - 0 5f " ) ; exception expect ( illegal argument exception class ) ; blocks invalidate work pct = d f s util get invalidate work pct per iteration ( conf ) ; }


gets the value at the { @ code block } { @ code position } as an object

object get object ( block block , int position ) ;


create a kerberos registry service client

public static registry operations create kerberos instance ( configuration conf , string jaas client entry , string principal , string keytab ) { preconditions check argument ( conf ! = null , " null configuration " ) ; conf set ( key registry client auth , registry client auth kerberos ) ; conf set ( key registry client jaas context , jaas client entry ) ; registry operations client operations = new registry operations client ( " kerberos registry operations " ) ; operations set kerberos principal and keytab ( principal , keytab ) ; operations init ( conf ) ; return operations ; }


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

public immutable map < k , v > build ( ) { / * * if entries is full , then this implementation may end up using the entries array * directly and writing over the entry objects with non - terminal entries , but this is * safe ; if this builder is used further , it will grow the entries array ( so it can ' t * affect the original array ) , and future build ( ) calls will always copy any entry * objects that cannot be safely reused * / sort entries ( ) ; entries used = true ; return regular immutable map create ( size , alternating keys and values ) ; }


set the clipboard contents with the list of tree nodes

private void set clipboard contents ( g tree g tree , clipboard clipboard , final list < g tree node > list ) { g tree transfer handler drag n drop handler = g tree get drag n drop handler ( ) ; transferable contents = new g tree node transferable ( drag n drop handler , list ) ; clipboard set contents ( contents , new clipboard owner ( ) { public void lost ownership ( clipboard current clipboard , transferable transferable ) { / / we don ' t care } } ) ; }


return true if this child cat all of object is equal to o

public boolean equals ( object o ) { if ( this = = o ) { return true ; } if ( o = = null | | get class ( ) ! = o get class ( ) ) { return false ; } child cat all of child cat all of = ( child cat all of ) o ; return objects equals ( this name , child cat all of name ) & & objects equals ( this pet type , child cat all of pet type ) ; }


encode and dump an integer value to the packed byte stream

public void dump offset ( long val ) { while ( val ! = 0 ) { int chunk = ( int ) ( val & 0x 3f ) ; val > > > = 6 ; buf write ( chunk + 0x 2 0 ) ; } buf write ( end tag ) ; }


removes \ \ r characters from query actually this is done specially for oracle due to some bug in it ' s driver

public static string make unified line feeds ( d b p data source data source , string query ) { s q l dialect dialect = s q l utils get dialect from data source ( data source ) ; if ( ! dialect is c r l f broken ( ) ) { return query ; } if ( query index of ( ' \ r ' ) = = - 1 ) { return query ; } string builder result = new string builder ( query length ( ) ) ; for ( int i = 0 ; i < query length ( ) ; i + + ) { char c = query char at ( i ) ; if ( c = = ' \ r ' ) { continue ; } result append ( c ) ; } return result to string ( ) ; }


plays together all animations passed in as parameter once animation is completed , r run ( ) is executed if parameter is reset is set to true , { @ link # m selected card position } is set to { @ link # invalid card position }

private void start animations ( list < animator > animations , final runnable r , final boolean is reset ) { animator set animator set = new animator set ( ) ; animator set play together ( animations ) ; animator set set duration ( anim duration ) ; animator set set interpolator ( new decelerate interpolator ( deceleration factor ) ) ; animator set add listener ( new animator listener adapter ( ) { @ override public void on animation end ( animator animation ) { if ( r ! = null ) r run ( ) ; set screen touchable ( true ) ; if ( is reset ) m selected card position = invalid card position ; } } ) ; animator set start ( ) ; }


returns the optimal number of threads to be used for av1 decoding

private native int gav 1 get threads ( ) ;


retrieves the file corresponding to the m key , if it is in the cache also touches the item , thus changing its lru timestamp if the file is not present in the file cache , returns null this should not be called on the ui thread

public @ nullable binary resource get resource ( final cache key key ) { string resource id = null ; settable cache event cache event = settable cache event obtain ( ) set cache key ( key ) ; try { synchronized ( m lock ) { binary resource resource = null ; list < string > resource ids = cache key util get resource ids ( key ) ; for ( int i = 0 ; i < resource ids size ( ) ; i + + ) { resource id = resource ids get ( i ) ; cache event set resource id ( resource id ) ; resource = m storage get resource ( resource id , key ) ; if ( resource ! = null ) { break ; } } if ( resource = = null ) { m cache event listener on miss ( cache event ) ; m resource index remove ( resource id ) ; } else { preconditions check not null ( resource id ) ; m cache event listener on hit ( cache event ) ; m resource index add ( resource id ) ; } return resource ; } } catch ( i o exception ioe ) { m cache error logger log error ( cache error logger cache error category generic io , tag , " get resource " , ioe ) ; cache event set exception ( ioe ) ; m cache event listener on read exception ( cache event ) ; return null ; } finally { cache event recycle ( ) ; } }


make sure the connection factory has been set

public void after properties set ( ) { if ( get connection factory ( ) = = null ) { throw new illegal argument exception ( " property ' connection factory ' is required " ) ; } }


reads characters into a portion of an array , reading from the underlying stream if necessary

private int read 1 ( char [ ] cbuf , int off , int len ) throws i o exception { if ( next char > = n chars ) { / * * if the requested length is at least as large as the buffer , and * if there is no mark / reset activity , and if line feeds are not * being skipped , do not bother to copy the characters into the * local buffer in this way buffered streams will cascade * harmlessly * / if ( len > = cb length & & marked char < = unmarked & & ! skip l f ) { return in read ( cbuf , off , len ) ; } fill ( ) ; } if ( next char > = n chars ) return - 1 ; if ( skip l f ) { skip l f = false ; if ( cb [ next char ] = = ' \ n ' ) { next char + + ; if ( next char > = n chars ) fill ( ) ; if ( next char > = n chars ) return - 1 ; } } int n = math min ( len , n chars - next char ) ; system arraycopy ( cb , next char , cbuf , off , n ) ; next char + = n ; return n ; }


returns the installed embedded binaries directory , under the shared install base location

public path get embedded binaries root ( ) { return server directories get embedded binaries root ( ) ; }


test if ' b ' is pronounced in this context

boolean test pronounced mb ( ) { if ( string at ( ( m current - 2 ) , 6 , " number " , " " ) | | ( string at ( ( m current + 2 ) , 1 , " a " , " " ) & & ! string at ( ( m current - 2 ) , 7 , " dumbass " , " " ) ) | | string at ( ( m current + 2 ) , 1 , " o " , " " ) | | string at ( ( m current - 2 ) , 6 , " lamben " , " lamber " , " lambet " , " tombig " , " lambre " , " " ) ) { return true ; } return false ; }


returns if the index is under merge throttling control

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


marks the computer as temporarily offline this retains the underlying { @ link channel } connection , but prevent builds from executing

public void set temporarily offline ( boolean temporarily offline , offline cause cause ) { offline cause = temporarily offline ? cause : null ; this temporarily offline = temporarily offline ; node node = get node ( ) ; if ( node ! = null ) { node set temporary offline cause ( offline cause ) ; } synchronized ( status change lock ) { status change lock notify all ( ) ; } for ( computer listener cl : computer listener all ( ) ) { if ( temporarily offline ) cl on temporarily offline ( this , cause ) ; else cl on temporarily online ( this ) ; } }


get the list of pending uploads for this job attempt

protected active commit list pending uploads to commit ( job context context ) throws i o exception { return list pending uploads ( context , false ) ; }


compute precision at k based on provided relevant document i ds

public eval query quality evaluate ( string task id , search hit [ ] hits , list < rated document > rated docs ) { list < rated search hit > rated search hits = join hits with ratings ( hits , rated docs ) ; int relevant retrieved = 0 ; int retrieved = 0 ; for ( rated search hit hit : rated search hits ) { optional int rating = hit get rating ( ) ; if ( rating is present ( ) ) { retrieved + + ; if ( is relevant ( rating get as int ( ) ) ) { relevant retrieved + + ; } } else if ( should count unlabeled ( ) ) { retrieved + + ; } } double precision = 0 0 ; if ( retrieved > 0 ) { precision = ( double ) relevant retrieved / retrieved ; } eval query quality eval query quality = new eval query quality ( task id , precision ) ; eval query quality set metric details ( new precision at k detail ( relevant retrieved , retrieved ) ) ; eval query quality add hits and ratings ( rated search hits ) ; return eval query quality ; }


touch a file in the test store will overwrite any existing file

protected void touch ( path path ) throws i o exception { contract test utils touch ( get file system ( ) , path ) ; }


check whether this component is currently running in the case of a container , this will return { @ code true } only if all components that apply are currently running


retrieves the new name of the given class member

static string new member name ( member member ) { return ( string ) method linker last visitor accepter ( member ) get visitor info ( ) ; }


sets the directory where { @ link preferences } will be stored , as well as the file type to be used to store them defaults to " $ user home prefs " and { @ link file type # external }

public void set preferences config ( string preferences directory , files file type preferences file type ) { this preferences directory = preferences directory ; this preferences file type = preferences file type ; }


check the cache for an entry if it does not exist , add the request as in progress

public cache entry check or add to cache ( inet address client id , int xid ) { client request req = new client request ( client id , xid ) ; cache entry e ; synchronized ( map ) { e = map get ( req ) ; if ( e = = null ) { / / add an inprogress cache entry map put ( req , new cache entry ( ) ) ; } } return e ; }


the standard jca 1 5 version of { @ code create endpoint } this implementation delegates to { @ link # create endpoint internal ( ) } , initializing the endpoint ' s x a resource before the endpoint gets invoked

public message endpoint create endpoint ( x a resource xa resource ) throws unavailable exception { abstract message endpoint endpoint = create endpoint internal ( ) ; endpoint init x a resource ( xa resource ) ; return endpoint ; }


public static byte string sha 1 ( byte string s ) { try { message digest message digest = message digest get instance ( " sha - 1 " ) ; byte [ ] sha 1 bytes = message digest digest ( s to byte array ( ) ) ; return byte string of ( sha 1 bytes ) ; } catch ( no such algorithm exception e ) { throw new assertion error ( e ) ; } }


adds an artifact that is necessary for executing the spawn itself ( e g a compiler ) , in contrast to an artifact that is necessary for the spawn to do its work ( e g source code ) the artifact is implicitly added to the inputs of the action as well

public builder add tool ( artifact tool ) { tools builder add ( tool ) ; return this ; }


returns absolute paths to class files generated since the last call to this method together with a string descriptor of the factory method

public immutable map < path , lambda info > drain ( ) { immutable map < path , lambda info > result = immutable map copy of ( generated classes ) ; generated classes clear ( ) ; return result ; }


public object node push state ( @ request param ( required = false ) boolean detail , @ request param ( required = false ) boolean reset ) { object node result = jackson utils create empty json node ( ) ; list < push service receiver ack entry > failed pushes = push service get failed pushes ( ) ; int failed push count = push service get failed push count ( ) ; result put ( " succeed " , push service get total push ( ) - failed push count ) ; result put ( " total " , push service get total push ( ) ) ; if ( push service get total push ( ) > 0 ) { result put ( " ratio " , ( ( float ) push service get total push ( ) - failed push count ) / push service get total push ( ) ) ; } else { result put ( " ratio " , 0 ) ; } array node data array = jackson utils create empty array node ( ) ; if ( detail ) { for ( push service receiver ack entry entry : failed pushes ) { try { data array add ( new string ( entry origin get data ( ) , " utf - 8 " ) ) ; } catch ( unsupported encoding exception e ) { data array add ( " [ encoding failure ] " ) ; } } result replace ( " data " , data array ) ; } if ( reset ) { push service reset push state ( ) ; } result put ( " reset " , reset ) ; return result ; }


returns the negotiated protocol , or null if no protocol was negotiated

public string get selected protocol ( s s l socket socket ) { return platform get selected protocol ( socket ) ; }


marks that the assignee is done with this task and that it can be send back to the owner can only be called when this task is { @ link delegation state # pending } delegation after this method returns , the { @ link task # get delegation state ( ) delegation state } is set to { @ link delegation state # resolved }


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


protected boolean raw generate and build recognizer ( string grammar file name , string grammar str , string parser name , string lexer name , boolean default listener , string extra options ) { error queue equeue = base runtime test antlr on string ( get tmp dir ( ) , " java " , grammar file name , grammar str , default listener , extra options ) ; if ( ! equeue errors is empty ( ) ) { return false ; } list < string > files = new array list < string > ( ) ; if ( lexer name ! = null ) { files add ( lexer name + " java " ) ; } if ( parser name ! = null ) { files add ( parser name + " java " ) ; set < string > options set = new hash set < string > ( arrays as list ( extra options ) ) ; string grammar name = grammar file name substring ( 0 , grammar file name last index of ( ' ' ) ) ; if ( ! options set contains ( " - no - listener " ) ) { files add ( grammar name + " listener java " ) ; files add ( grammar name + " base listener java " ) ; } if ( options set contains ( " - visitor " ) ) { files add ( grammar name + " visitor java " ) ; files add ( grammar name + " base visitor java " ) ; } } boolean all is well = compile ( files to array ( new string [ files size ( ) ] ) ) ; return all is well ; }


common code for checking that x + width and y + height are within image bounds

private static void check final image bounds ( bitmap source , int x , int y , int width , int height ) { preconditions check argument ( x + width < = source get width ( ) , " x + width must be < = bitmap width ( ) " ) ; preconditions check argument ( y + height < = source get height ( ) , " y + height must be < = bitmap height ( ) " ) ; }


returns the offset , relative the beginning of the bound import table , to the import name

public short get offset module name ( ) { return offset module name ; }


public int get basic type ( ) { return type return address get basic type ( ) ; }


verify that the contents on disk for the given index is deleted ; if not , delete the contents this method assumes that an index is already deleted in the cluster state andor explicitly through index tombstones

public index metadata verify index is deleted ( final index index , final cluster state cluster state ) { / / this method should only be called when we know the index ( name + uuid ) is not part of the cluster state if ( cluster state metadata ( ) index ( index ) ! = null ) { throw new illegal state exception ( " cannot delete index [ " + index + " ] , it is still part of the cluster state " ) ; } if ( node env has node file ( ) & & file system utils exists ( node env index paths ( index ) ) ) { final index metadata metadata ; try { metadata = meta state service load index state ( index ) ; if ( metadata = = null ) { return null ; } } catch ( exception e ) { logger warn ( ( ) - > new parameterized message ( " [ { } ] failed to load state file from a stale deleted index , " + " folders will be left on disk " , index ) , e ) ; return null ; } final index settings index settings = build index settings ( metadata ) ; try { delete index store if deletion allowed ( " stale deleted index " , index , index settings , always true ) ; } catch ( exception e ) { / / we just warn about the exception here because if delete index store if deletion allowed / / throws an exception , it gets added to the list of pending deletes to be tried again logger warn ( ( ) - > new parameterized message ( " [ { } ] failed to delete index on disk " , metadata get index ( ) ) , e ) ; } return metadata ; } return null ; }


apply the given relative path to the given java resource path , assuming standard java folder separation ( i e " " separators )

public static string apply relative path ( string path , string relative path ) { int separator index = path last index of ( folder separator ) ; if ( separator index ! = - 1 ) { string new path = path substring ( 0 , separator index ) ; if ( ! relative path starts with ( folder separator ) ) { new path + = folder separator ; } return new path + relative path ; } else { return relative path ; } }


returns the set of configuration fragments provided by this module

public immutable list < class < ? extends fragment > > get configuration fragments ( ) { return configuration fragment classes ; }


updates a pet in the store with form data

public void update pet with form ( long pet id , string name , string status ) { / / todo : implement }


void on change ( final state new state , final state old state ) ;


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


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


update an existing pet < b > 200 < b > - successful operation < b > 400 < b > - invalid id supplied < b > 404 < b > - pet not found < b > 405 < b > - validation exception

public void update pet ( pet body ) throws rest client exception { update pet with http info ( body ) ; }


continues a project cross transformation and adds fields of the first cross input if the first cross input is a { @ link tuple } { @ link data set } , fields can be selected by their index if the first cross input is not a tuple data set , no parameters should be passed fields of the first and second input can be added by chaining the method calls of { @ link org apache flink api java operators cross operator cross projection # project first ( int ) } and { @ link org apache flink api java operators cross operator cross projection # project second ( int ) }

protected cross projection < i1 , i2 > project first ( int first field indexes ) { boolean is first tuple ; if ( ds 1 get type ( ) instanceof tuple type info & & first field indexes length > 0 ) { is first tuple = true ; } else { is first tuple = false ; } if ( ! is first tuple & & first field indexes length ! = 0 ) { / / field index provided for non - tuple input throw new illegal argument exception ( " input is not a tuple call project first ( ) without arguments to include it " ) ; } else if ( first field indexes length > ( 22 - this field indexes length ) ) { / / to many field indexes provided throw new illegal argument exception ( " you may select only up to twenty - two ( 22 ) fields in total " ) ; } int offset = this field indexes length ; if ( is first tuple ) { / / extend index and flag arrays this field indexes = arrays copy of ( this field indexes , this field indexes length + first field indexes length ) ; this is field in first = arrays copy of ( this is field in first , this is field in first length + first field indexes length ) ; / / copy field indexes int max field index = num fields ds 1 ; for ( int i = 0 ; i < first field indexes length ; i + + ) { / / check if indexes in range preconditions check element index ( first field indexes [ i ] , max field index ) ; this is field in first [ offset + i ] = true ; this field indexes [ offset + i ] = first field indexes [ i ] ; } } else { / / extend index and flag arrays this field indexes = arrays copy of ( this field indexes , this field indexes length + 1 ) ; this is field in first = arrays copy of ( this is field in first , this is field in first length + 1 ) ; / / add input object to output tuple this is field in first [ offset ] = true ; this field indexes [ offset ] = - 1 ; } return this ; }


private pull result pull op msg ( message queue mq , long offset , int nums ) { return transactional message bridge get op message ( mq get queue id ( ) , offset , nums ) ; }


clone the context data , work for capture to cross - thread

public extension context clone ( ) { final extension context context = new extension context ( ) ; context skip analysis = this skip analysis ; context sending timestamp = this sending timestamp ; return context ; }


returns the value associated with the specified key , or { @ code null } if there is no such value specifically , if any range in this range map contains the specified key , the value associated with that range is returned


takes a video and calls the on video saved callback when done

public void start recording ( @ non null video capture output file options output file options , @ non null executor executor , @ non null on video saved callback callback ) { m camera module start recording ( output file options , executor , callback ) ; }


all data sources failed , highest - quality failed last , no intermediate results

public void test lifecycle f2 f3 f1 c ( ) { data source < object > data source = get and subscribe ( ) ; data subscriber < object > subscriber 1 = verify get and subscribe m ( m data source supplier 1 , m src 1 ) ; data subscriber < object > subscriber 2 = verify get and subscribe m ( m data source supplier 2 , m src 2 ) ; data subscriber < object > subscriber 3 = verify get and subscribe ( m data source supplier 3 , m src 3 ) ; set state ( m src 2 , not closed , finished , without result , null , failed , mock ( throwable class ) ) ; subscriber 2 on failure ( m src 2 ) ; m in order verify ( m src 2 ) close ( ) ; verify subscriber ( data source , m src 2 , no interactions ) ; verify state ( data source , null , not closed , not finished , without result , null , not failed , null ) ; set state ( m src 3 , not closed , finished , without result , null , failed , mock ( throwable class ) ) ; subscriber 3 on failure ( m src 3 ) ; m in order verify ( m src 3 ) close ( ) ; verify subscriber ( data source , m src 3 , no interactions ) ; verify state ( data source , null , not closed , not finished , without result , null , not failed , null ) ; throwable throwable = mock ( throwable class ) ; set state ( m src 1 , not closed , finished , without result , null , failed , throwable ) ; subscriber 1 on failure ( m src 1 ) ; m in order verify ( m src 1 ) close ( ) ; verify subscriber ( data source , m src 1 , on failure ) ; verify state ( data source , null , not closed , finished , without result , null , failed , throwable ) ; test close ( data source ) ; verify state ( data source , null , closed , finished , without result , null , failed , throwable ) ; }


determines if the content of the specified buffer is identical to the content of this array ' identical ' here means : the size of the contents of the two buffers are same and every single byte of the content of the two buffers are same please note that it does not compare { @ link # reader index ( ) } nor { @ link # writer index ( ) } this method also returns { @ code false } for { @ code null } and an object which is not an instance of { @ link channel buffer } type


private static coordinate [ ] coordinates ( edge component , coordinate [ ] coordinates , double [ ] partition point ) { for ( int i = 0 ; i < coordinates length ; i + + ) { coordinates [ i ] = ( component = component next ) coordinate ; } / / first and last coordinates must be equal if ( coordinates [ 0 ] equals ( coordinates [ coordinates length - 1 ] ) = = false ) { if ( double is na n ( partition point [ 2 ] ) ) { throw new invalid shape exception ( " self - intersection at or near point [ " + partition point [ 0 ] + " , " + partition point [ 1 ] + " ] " ) ; } else { throw new invalid shape exception ( " self - intersection at or near point [ " + partition point [ 0 ] + " , " + partition point [ 1 ] + " , " + partition point [ 2 ] + " ] " ) ; } } return coordinates ; }


get the storage policy id while computing quota usage

public byte get storage policy i d for quota ( byte parent storage policy id ) { byte local id = is symlink ( ) ? hdfs constants block storage policy id unspecified : get local storage policy i d ( ) ; return local id ! = hdfs constants block storage policy id unspecified ? local id : parent storage policy id ; }


the logger that is used to log errors made by the cache

public builder set cache error logger ( cache error logger cache error logger ) { m cache error logger = cache error logger ; return this ; }


return true if this pet object is equal to o

public boolean equals ( object o ) { if ( this = = o ) { return true ; } if ( o = = null | | get class ( ) ! = o get class ( ) ) { return false ; } pet pet = ( pet ) o ; return objects equals ( this id , pet id ) & & objects equals ( this category , pet category ) & & objects equals ( this name , pet name ) & & objects equals ( this photo urls , pet photo urls ) & & objects equals ( this tags , pet tags ) & & objects equals ( this status , pet status ) ; }


shows { @ link channel # class loading time }

public long get class loading time ( ) throws i o exception , interrupted exception { if ( channel = = null ) { return - 1 ; } return channel call ( new loading time ( false ) ) ; }


delegates to { @ link test context manager # prepare test instance } as of spring framework 5 3 2 , this method also validates that test methods and test lifecycle methods are not annotated with { @ link autowired @ autowired }

public void post process test instance ( object test instance , extension context context ) throws exception { validate autowired config ( context ) ; get test context manager ( context ) prepare test instance ( test instance ) ; }


rewinds the read position to the first sample in the queue

private synchronized void rewind ( ) { read position = 0 ; sample data queue rewind ( ) ; }


stubbings in ascending order , most recent last

public collection < stubbing > get stubbings ascending ( ) { list < stubbing > result = new linked list < stubbing > ( stubbed ) ; collections reverse ( result ) ; return result ; }


for secure connection , provides a connection spec to specify cipher suite and tls versions by default a modern , http2 - compatible spec will be used this method is only used when building a secure connection for plaintext connection , use { @ link # use plaintext ( ) } instead

public ok http channel builder connection spec ( com squareup okhttp connection spec connection spec ) { preconditions check state ( ! freeze security configuration , " cannot change security when using channel credentials " ) ; preconditions check argument ( connection spec is tls ( ) , " plaintext connection spec is not accepted " ) ; this connection spec = utils convert spec ( connection spec ) ; return this ; }


return a local map spill index file created earlier

public path get spill index file ( int spill number ) throws i o exception { return l dir alloc get local path to read ( m r job config output + " / spill " + spill number + " out index " , get conf ( ) ) ; }


launch and initialize an unmanaged am first , it creates a new application on the rm and negotiates a new attempt id then it waits for the rm application attempt state to reach yarn application attempt state launched after which it returns the am - rm token

protected token < a m r m token identifier > initialize unmanaged a m ( application id app id ) throws i o exception , yarn exception { try { user group information app submitter = user group information create remote user ( this submitter ) ; this rm client = create r m proxy ( application client protocol class , this conf , app submitter , null ) ; / / submit the application submit unmanaged app ( app id ) ; / / monitor the application attempt to wait for launch state monitor current app attempt ( app id , enum set of ( yarn application state accepted , yarn application state running , yarn application state killed , yarn application state failed , yarn application state finished ) , yarn application attempt state launched ) ; return get u a m token ( ) ; } finally { this rm client = null ; } }


add the int property at the given offset

void add int ( short offset , int value ) { add key ( offset ) ; int row = get row ( offset , true ) ; table put int ( row , 0 , value ) ; }


creates a new default selenium object and starts it using the specified base url and browser string the port is selected as follows : if the server package ' s remote control configuration class is on the classpath , that class ' default port is used otherwise , if the " server port " system property is specified , that is used - failing that , the default of 4444 is used

public void set up ( string url , string browser string ) throws exception { set up ( url , browser string , get default port ( ) ) ; }


create a { @ link cache key invocation context } based on the specified invocation

protected cache key invocation context < a > create cache key invocation context ( cache operation invocation context < o > context ) { return new default cache key invocation context < > ( context get operation ( ) , context get target ( ) , context get args ( ) ) ; }


register a list of trigger objects with the scheduler that this factory bean creates if the trigger determines the corresponding job detail itself , the job will be automatically registered with the scheduler else , the respective job detail needs to be registered via the " job details " property of this factory bean

public void set triggers ( trigger triggers ) { this triggers = arrays as list ( triggers ) ; }


this code is really only used for dealing with dynamic tag libraries , so no point in implementing this for statically used tag libraries

public tag create tag ( final string name , attributes attributes ) throws jelly exception { return null ; }


public void initialize delegate ( provider < t > delegate ) { if ( this delegate ! = null ) { throw new illegal state exception ( " delegate already initialized " ) ; } this delegate = objects require non null ( delegate , " delegate " ) ; }


determines whether or not this filter is equal to the object that is passed in

public boolean equals ( object obj ) { if ( obj instanceof program diff filter ) { return ( ( program diff filter ) obj ) filter flags = = filter flags ; } return false ; }


returns a new symbol path in which invalid characters are replaced with underscores

public symbol path replace invalid chars ( ) { list < string > mod list = new array list < > ( ) ; for ( string str : as list ( ) ) { mod list add ( symbol utilities replace invalid chars ( str , true ) ) ; } return new symbol path ( mod list ) ; }


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 ) { } throw new illegal state exception ( ) ; }


returns the next defined data whose min address is closest to and less than the specified address

public data get defined data before ( address addr ) { lock acquire ( ) ; try { d b record rec = data adapter get record before ( addr ) ; return get data d b ( rec ) ; } catch ( i o exception e ) { program db error ( e ) ; } finally { lock release ( ) ; } return null ; }


emits a { @ link watermark } from an operator this watermark is broadcast to all downstream operators a watermark specifies that no element with a timestamp lower or equal to the watermark timestamp will be emitted in the future

void emit watermark ( watermark mark ) ;


clones the given serializable object using java serialization

public static < t extends serializable > t clone ( t obj ) throws i o exception , class not found exception { if ( obj = = null ) { return null ; } else { return clone ( obj , obj get class ( ) get class loader ( ) ) ; } }


create a readable and parseable audit log string for a successful event

public static void log success ( string user , string operation , string target , application id app id , application attempt id attempt id ) { if ( log is info enabled ( ) ) { log info ( create success log ( user , operation , target , app id , attempt id , null , null ) ) ; } }


returns the least power of two smaller than or equal to 2 < s 3 0 < s and larger than or equal to < code > math ceil ( expected f ) < code >

public static int array size ( int expected , float f ) { long s = math max ( 2l , next power of two ( ( long ) math ceil ( ( double ) ( ( float ) expected / f ) ) ) ) ; if ( s > ( integer max value / 2 + 1 ) ) { throw new illegal argument exception ( " too large ( " + expected + " expected elements with load factor " + f + " ) " ) ; } else { return ( int ) s ; } }


even on a non - idempotent call , connection failures are considered retryable

public void test connection retry policy non idempotent ( ) throws throwable { assert retry action ( " expected retry on connection timeout " , retry policy , retry policy retry action retry , hadoop connection timeout ex , 1 , false ) ; }


implementations should return an array of { @ link managed notification managed notifications } if the supplied the { @ code class } has the corresponding metadata otherwise should return an empty array

managed notification [ ] get managed notifications ( class < ? > clazz ) throws invalid metadata exception ;


solve a line segment using barycentric coordinates < br > possible regions : < br > - points [ 2 ] < br > - edge points [ 0 ] - points [ 2 ] < br > - edge points [ 1 ] - points [ 2 ] < br > - inside the triangle


links a ( potentially multi - architecture ) binary targeting apple platforms this method comprises a bulk of the logic of the { @ code apple binary } rule , and is statically available so that it may be referenced by starlark a p is that replicate its functionality

public static apple binary output link multi arch binary ( rule context rule context , iterable < string > extra linkopts , iterable < artifact > extra link inputs , boolean is stamping enabled ) throws interrupted exception , rule error exception , action conflict exception { multi arch split transition provider validate minimum os ( rule context ) ; platform type platform type = multi arch split transition provider get platform type ( rule context ) ; apple configuration apple configuration = rule context get fragment ( apple configuration class ) ; apple platform platform = null ; try { platform = apple configuration get multi arch platform ( platform type ) ; } catch ( illegal argument exception e ) { rule context throw with rule error ( e ) ; } immutable list multimap < string , transitive info collection > cpu to deps collection map = multi arch binary support transform map ( rule context get prerequisites by configuration ( " deps " ) ) ; immutable list multimap < string , configured target and data > cpu to c t a t deps collection map = multi arch binary support transform map ( rule context get prerequisite cofigured target and targets by configuration ( " deps " ) ) ; immutable map < build configuration , cc toolchain provider > child configurations and toolchains = multi arch binary support get child configurations and toolchains ( rule context ) ; artifact output artifact = objc rule classes intermediate artifacts ( rule context ) combined architecture binary ( ) ; multi arch binary support multi arch binary support = new multi arch binary support ( rule context ) ; immutable set < dependency specific configuration > dependency specific configurations = multi arch binary support get dependency specific configurations ( child configurations and toolchains , cpu to deps collection map , cpu to c t a t deps collection map , get dylib provider targets ( rule context ) ) ; map < string , nested set < artifact > > output group collector = new tree map < > ( ) ; iterable < artifact > all link inputs = iterables concat ( get required link inputs ( rule context ) , extra link inputs ) ; extra link args all linkopts = new extra link args ( iterables concat ( get required linkopts ( rule context ) , extra linkopts ) ) ; nested set < artifact > binaries to lipo = multi arch binary support register actions ( all linkopts , dependency specific configurations , all link inputs , is stamping enabled , cpu to deps collection map , output group collector ) ; new lipo support ( rule context ) register combine architectures action ( binaries to lipo , output artifact , platform ) ; immutable list multimap < build configuration , output group info > build config to output group info map = rule context get prerequisites by configuration ( " deps " , output group info starlark constructor ) ; nested set builder < artifact > header tokens = nested set builder stable order ( ) ; for ( map entry < build configuration , output group info > entry : build config to output group info map entries ( ) ) { output group info dep = entry get value ( ) ; header tokens add transitive ( dep get output group ( cc compilation helper hidden header tokens ) ) ; } output group collector put ( output group info validation , header tokens build ( ) ) ; objc provider builder objc provider builder = new objc provider native builder ( rule context get analysis environment ( ) get starlark semantics ( ) ) ; for ( dependency specific configuration dependency specific configuration : dependency specific configurations ) { objc provider builder add transitive and propagate ( dependency specific configuration objc provider with dylib symbols ( ) ) ; } objc provider builder add ( multi arch linked binaries , output artifact ) ; objc provider objc provider = objc provider builder build ( ) ; native info binary info provider ; switch ( get binary type ( rule context ) ) { case executable : binary info provider = new apple executable binary info ( output artifact , objc provider ) ; break ; case dylib : binary info provider = new apple dylib binary info ( output artifact , objc provider ) ; break ; case loadable bundle : binary info provider = new apple loadable bundle binary info ( output artifact , objc provider ) ; break ; default : throw rule context throw with rule error ( " unhandled binary type " + get binary type ( rule context ) ) ; } apple debug outputs info builder builder = apple debug outputs info builder create ( ) ; for ( dependency specific configuration dependency specific configuration : dependency specific configurations ) { apple configuration child apple config = dependency specific configuration config ( ) get fragment ( apple configuration class ) ; objc configuration child objc config = dependency specific configuration config ( ) get fragment ( objc configuration class ) ; intermediate artifacts intermediate artifacts = new intermediate artifacts ( rule context , / * archive file name suffix * / " " , / * output prefix * / " " , dependency specific configuration config ( ) ) ; string arch = child apple config get single architecture ( ) ; if ( child apple config get bitcode mode ( ) = = apple bitcode mode embedded ) { artifact bitcode symbol = intermediate artifacts bitcode symbol map ( ) ; builder add output ( arch , output type bitcode symbols , bitcode symbol ) ; } if ( child objc config generate dsym ( ) ) { artifact dsym binary = child objc config should strip binary ( ) ? intermediate artifacts dsym symbol for unstripped binary ( ) : intermediate artifacts dsym symbol for stripped binary ( ) ; builder add output ( arch , output type dsym binary , dsym binary ) ; } if ( child objc config generate linkmap ( ) ) { artifact linkmap = intermediate artifacts linkmap ( ) ; builder add output ( arch , output type linkmap , linkmap ) ; } } return new apple binary output ( binary info provider , builder build ( ) , output group collector ) ; }


removed a single object ( if any ) from the pool


creates a local group from what we know before joining creates as a { @ link groups v 2 state processor # placeholder revision } so that we know not do do a full diff against this group once we learn more about this group as that would create a large update message

private decrypted group create placeholder group ( @ non null decrypted group join info join info , boolean request to join ) { decrypted group builder group = decrypted group new builder ( ) set title ( join info get title ( ) ) set avatar ( join info get avatar ( ) ) set revision ( groups v 2 state processor placeholder revision ) ; recipient self = recipient self ( ) ; byte string self uuid = uuid util to byte string ( self require uuid ( ) ) ; byte string profile key = byte string copy from ( objects require non null ( self get profile key ( ) ) ) ; if ( request to join ) { group add requesting members ( decrypted requesting member new builder ( ) set uuid ( self uuid ) set profile key ( profile key ) ) ; } else { group add members ( decrypted member new builder ( ) set uuid ( self uuid ) set profile key ( profile key ) ) ; } return group build ( ) ; }


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


public csvout newline ( ) throws i o exception { out write ( eol ) ; is start of line = true ; return this ; }


public shards acknowledged response freeze ( freeze index request request , request options options ) throws i o exception { return rest high level client perform request and parse entity ( request , indices request converters : : freeze index , options , shards acknowledged response : : from x content , empty set ( ) ) ; }


fixme check @ parameter ( required = true ) and any conditions that need to match

public boolean is valid ( ) { return true ; }


test to demonstrate the effect of the https : issues apache orgjirabrowse o g n l - 121 issue in ognl on mybatis use the thing mapper for the first time in multiple threads the mapper contains a lot of ognl references to static final class members like : < code > @ org apache ibatis submitted heavy initial load code @ 1 equals ( code ) < code > handling of these references is optimized in ognl ( because they never change ) , but version 2 6 9 has a bug in caching the result as a result the reference is translated to a ' null ' value , which is used to invoke the ' equals ' method on ( hence the ' target is null for method equals ' exception )

void select things concurrently mybatis issue 224 ( ) throws exception { final list < throwable > throwables = collections synchronized list ( new array list < > ( ) ) ; thread [ ] threads = new thread [ thread count ] ; for ( int i = 0 ; i < thread count ; i + + ) { threads [ i ] = new thread ( ( ) - > { try { select thing ( ) ; } catch ( exception exception ) { throwables add ( exception ) ; } } ) ; threads [ i ] start ( ) ; } for ( int i = 0 ; i < thread count ; i + + ) { threads [ i ] join ( ) ; } assertions assert true ( throwables is empty ( ) , " there were exceptions : " + throwables ) ; }


deposits a puddle between tile and source

public static void deposit ( tile tile , tile source , liquid liquid , float amount ) { deposit ( tile , source , liquid , amount , 0 ) ; }


stops engine , cancels all running and scheduled display image tasks clears internal data < br > < b > note : < b > this method doesn ' t shutdown { @ linkplain com nostra 1 3 universalimageloader core image loader configuration builder # task executor ( java util concurrent executor ) custom task executors } if you set them

void stop ( ) { if ( ! configuration custom executor ) { ( ( executor service ) task executor ) shutdown now ( ) ; } if ( ! configuration custom executor for cached images ) { ( ( executor service ) task executor for cached images ) shutdown now ( ) ; } cache keys for image awares clear ( ) ; uri locks clear ( ) ; }


< code > required string number = 1 ; < code >

public builder set number ( string value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } bit field 0 | = 0x 0 0 0 0 0 0 0 1 ; number = value ; on changed ( ) ; return this ; }


return the reactive type for this descriptor

public class < ? > get reactive type ( ) { return this reactive type ; }


enqueue the runnable it is not safe for another thread to queue an runnable directly to the event loop , because it will be out - of - order with writes this method allows the runnable to be processed in - order with writes

void enqueue ( runnable runnable , boolean flush ) { queue add ( new runnable command ( runnable ) ) ; if ( flush ) { schedule flush ( ) ; } }


always returns false as there will be not be any pending writes since we directly write to socket channel

public boolean has pending writes ( ) { return false ; }


default string get value ( final string value ) { return value ; }


exit a parse tree produced by { @ link eql base parser # join keys }

void exit join keys ( eql base parser join keys context ctx ) ;


returns the vertex from where the popup menu was launched

public attributed vertex get clicked vertex ( ) { return clicked vertex ; }


public order place order ( order body ) throws api exception , processing exception ;


called right after { @ link web element # get text ( ) } method is being called

void after get text ( web element element , web driver driver , string text ) ;


deduct unallocated resources from the node this is used when allocating a container

public synchronized void deduct unallocated resource ( resource resource ) { if ( resource = = null ) { log error ( " invalid deduction of null resource for " + rm node get node address ( ) ) ; return ; } resources subtract from ( unallocated resource , resource ) ; resources add to ( allocated resource , resource ) ; }


sets the given { @ link android graphics drawable drawable } on the view using { @ link android widget image view # set image drawable ( android graphics drawable drawable ) }

public void on load cleared ( @ nullable drawable placeholder ) { super on load cleared ( placeholder ) ; if ( animatable ! = null ) { animatable stop ( ) ; } set resource internal ( null ) ; set drawable ( placeholder ) ; }


get authentications ( key : authentication name , value : authentication )

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


tests reading a file that is changed while the reader ' s input stream is open

public void test read file changed stream open ( ) throws throwable { describe ( " tests reading a file that is changed while the reader ' s " + " input stream is open " ) ; final int original length = 8192 ; final byte [ ] original dataset = dataset ( original length , ' a ' , 32 ) ; final int new length = original length + 1 ; final byte [ ] new dataset = dataset ( new length , ' a ' , 32 ) ; final path testpath = path ( " read file to change txt " ) ; / / initial write write dataset ( fs , testpath , original dataset , original dataset length , 1024 , false ) ; try ( f s data input stream instream = fs open ( testpath ) ) { / / seek forward and read successfully instream seek ( 1024 ) ; assert true ( " no data to read " , instream read ( ) > = 0 ) ; / / overwrite write dataset ( fs , testpath , new dataset , new dataset length , 1024 , true ) ; / / here the new file length is larger probe the file to see if this is / / true , with a spin and wait eventually ( 30 * 1000 , 1000 , ( ) - > { assert equals ( new length , fs get file status ( testpath ) get len ( ) ) ; } ) ; / / with the new file version in place , any subsequent s3 read by / / e tag / version id will fail a new read by e tag / version id will occur in / / reopen ( ) on read after a seek ( ) backwards we verify seek backwards / / results in the expected exception and seek ( ) forward works without / / issue / / first check seek forward instream seek ( 2048 ) ; assert true ( " no data to read " , instream read ( ) > = 0 ) ; / / now check seek backward instream seek ( instream get pos ( ) - 100 ) ; if ( expected exception interactions contains ( interaction type read ) ) { expect read failure ( instream ) ; } else { instream read ( ) ; } byte [ ] buf = new byte [ 256 ] ; / / seek backward instream seek ( 0 ) ; if ( expected exception interactions contains ( interaction type read ) ) { expect read failure ( instream ) ; intercept ( remote file changed exception class , " " , " read " , ( ) - > instream read ( 0 , buf , 0 , buf length ) ) ; intercept ( remote file changed exception class , " " , " readfully " , ( ) - > instream read fully ( 0 , buf ) ) ; } else { instream read ( buf ) ; instream read ( 0 , buf , 0 , buf length ) ; instream read fully ( 0 , buf ) ; } / / delete the file reads must fail fs delete ( testpath , false ) ; / / seek backward instream seek ( 0 ) ; if ( expected exception interactions contains ( interaction type read after delete ) ) { intercept ( file not found exception class , " " , " read ( ) " , ( ) - > instream read ( ) ) ; intercept ( file not found exception class , " " , " readfully " , ( ) - > instream read fully ( 2048 , buf ) ) ; } else { instream read ( ) ; instream read fully ( 2048 , buf ) ; } } }


schedules the given runnable on the underlying executor directly and returns its future wrapped into a disposable

public disposable schedule direct ( final runnable run , long delay time , time unit unit ) { scheduled direct task task = new scheduled direct task ( rx java plugins on schedule ( run ) ) ; try { future < ? > f ; if ( delay time < = 0l ) { f = executor submit ( task ) ; } else { f = executor schedule ( task , delay time , unit ) ; } task set future ( f ) ; return task ; } catch ( rejected execution exception ex ) { rx java plugins on error ( ex ) ; return empty disposable instance ; } }


removes all of the elements from this set , and resets the set capacity based on the provided expected number of elements

final public void clear ( int expected num elements ) { if ( expected num elements = = 0 ) { / / optimize away object allocations for empty sets this head = head element empty ; this elements = empty elements ; this size = 0 ; } else { this head = new head element ( ) ; this elements = new element [ calculate capacity ( expected num elements ) ] ; this size = 0 ; } }


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


retrieve the requested field from the { @ code source } of the document

public void add source field ( string field ) { source fields add ( field ) ; }


process a collection of job conf { @ link properties } we do not restrict it to be called once

public void process ( properties conf ) { / / no code }


add resolvers to support custom controller method argument types this does not override the built - in support for resolving handler method arguments to customize the built - in support for argument resolution , configure { @ link request mapping handler adapter } directly

default void add argument resolvers ( list < handler method argument resolver > resolvers ) { }


< code > optional aapt pb primitive prim = 7 ; < code >

public com android aapt resources primitive get prim ( ) { return instance get prim ( ) ; }


find and return the first aspect j annotation on the given method ( there should only be one anyway )

protected static aspect j annotation < ? > find aspect j annotation on method ( method method ) { for ( class < ? > clazz : aspectj annotation classes ) { aspect j annotation < ? > found annotation = find annotation ( method , ( class < annotation > ) clazz ) ; if ( found annotation ! = null ) { return found annotation ; } } return null ; }


uses an { @ link array list } to store value collections

public list multimap builder < k0 , object > array list values ( ) { return array list values ( default expected values per key ) ; }


simpler variant of { @ link # expected output ( string [ ] , string ) } that only compares the count of the number of records in standard output this is intended for use for algorithms where the result cannot be hashed due to approximate results ( typically floating point arithmetic )

protected void expected count ( string [ ] parameters , int records ) throws exception { string output = get system output ( parameters ) ; / / subtract the extra newline int number of records = output split ( system get property ( " line separator " ) ) length - 1 ; assert assert equals ( records , number of records ) ; }


used to avoid http : bugs sun comview bug do ? bug id = 6558557

private static < t > sorted set < t > cast ( iterable < t > iterable ) { return ( sorted set < t > ) iterable ; }


override this to unwrap the transformed value into a notification lite object

object leave transform ( object value ) { return value ; }


gets the names of all the { @ link top level item } s

public collection < string > get top level item names ( ) { list < string > names = new array list < > ( ) ; for ( top level item j : items values ( ) ) names add ( j get name ( ) ) ; return names ; }


sets the scatter shape this data set should be drawn with this will search for an available i shape renderer and set this renderer for the data set

public void set scatter shape ( scatter chart scatter shape shape ) { m shape renderer = get renderer for shape ( shape ) ; }


for use with { @ code merged configured target } and similar , where we create a virtual { @ link configured target } corresponding to the same { @ link target }

public configured target and data from configured target ( configured target maybe new ) { if ( configured target equals ( maybe new ) ) { return this ; } return new configured target and data ( maybe new , target , configuration , transition keys ) ; }


waits for the given { @ link kafka streams } instances to all be in a specific { @ link state } prefer { @ link # start application and wait until running ( list , duration ) } when possible because this method uses polling , which can be more error prone and slightly slower

public static void wait for application state ( final list < kafka streams > streams list , final state state , final duration timeout ) throws interrupted exception { retry on exception with timeout ( timeout to millis ( ) , ( ) - > { final map < kafka streams , state > streams to states = streams list stream ( ) collect ( collectors to map ( stream - > stream , kafka streams : : state ) ) ; final map < kafka streams , state > wrong state map = streams to states entry set ( ) stream ( ) filter ( entry - > entry get value ( ) ! = state ) collect ( collectors to map ( map entry : : get key , map entry : : get value ) ) ; final string reason = string format ( " expected all streams instances in % s to be % s within % d ms , but the following were not : % s " , streams list , state , timeout to millis ( ) , wrong state map ) ; assert that ( reason , wrong state map is empty ( ) ) ; } ) ; }


the nonce provides a way to explicitly ack a specific mesh config response in a following mesh config request additional messages may have been sent by client to the management server for the previous version on the stream prior to this mesh config response , that were unprocessed at response send time the nonce allows the management server to ignore any further mesh config requests for the previous version until a mesh config request bearing the nonce < code > string nonce = 4 ; < code >

public com google protobuf byte string get nonce bytes ( ) { java lang object ref = nonce ; if ( ref instanceof string ) { com google protobuf byte string b = com google protobuf byte string copy from utf 8 ( ( java lang string ) ref ) ; nonce = b ; return b ; } else { return ( com google protobuf byte string ) ref ; } }


paint a 4 - bitpixel code string , as defined by etsi en 300 743 7 2 5 2 , to a canvas

private static int paint 4 bit pixel code string ( parsable bit array data , int [ ] clut entries , @ nullable byte [ ] clut map table , int column , int line , @ nullable paint paint , canvas canvas ) { boolean end of pixel code string = false ; do { int run length = 0 ; int clut index = 0 ; int peek = data read bits ( 4 ) ; if ( peek ! = 0x 0 0 ) { run length = 1 ; clut index = peek ; } else if ( ! data read bit ( ) ) { peek = data read bits ( 3 ) ; if ( peek ! = 0x 0 0 ) { run length = 2 + peek ; clut index = 0x 0 0 ; } else { end of pixel code string = true ; } } else if ( ! data read bit ( ) ) { run length = 4 + data read bits ( 2 ) ; clut index = data read bits ( 4 ) ; } else { switch ( data read bits ( 2 ) ) { case 0x 0 0 : run length = 1 ; break ; case 0x 0 1 : run length = 2 ; break ; case 0x 0 2 : run length = 9 + data read bits ( 4 ) ; clut index = data read bits ( 4 ) ; break ; case 0x 0 3 : run length = 25 + data read bits ( 8 ) ; clut index = data read bits ( 4 ) ; break ; } } if ( run length ! = 0 & & paint ! = null ) { paint set color ( clut entries [ clut map table ! = null ? clut map table [ clut index ] : clut index ] ) ; canvas draw rect ( column , line , column + run length , line + 1 , paint ) ; } column + = run length ; } while ( ! end of pixel code string ) ; return column ; }


if it ' s a pdb file , pass it to the pdb exe executable and get the stream storing the xml output if it ' s a xml file , read the file into a stream and verify that the xml g u i d signature and age match the program ' s g u i d signature and age

private void process pdb contents ( boolean skip validation ) throws pdb exception , i o exception { input stream in = null ; if ( ! is x m l ) { string [ ] cmd = get command line array ( skip validation ) ; runtime runtime = runtime get runtime ( ) ; try { / / note : we can ' t use process wait for ( ) here , because the result of / / ' process get input stream ( ) ' is passed around and manipulated by / / the parser in order for wait for ( ) to work , the stream needs to / / be taken care of immediately so that the process can return currently , / / with the process ' input stream getting passed around , the call to / / wait for ( ) creates a deadlock condition process = runtime exec ( cmd ) ; } catch ( i o exception e ) { if ( e get message ( ) ends with ( " 14001 " ) ) { / / missing runtime dlls , probably throw new pdb exception ( " missing runtime libraries " + " please refer to " + readme filename + " and follow instructions " ) ; } throw e ; } in = process get input stream ( ) ; input stream err = process get error stream ( ) ; thread = new pdb error reader thread ( err ) ; thread start ( ) ; } else { in = new file input stream ( pdb file ) ; } err handler = new pdb error handler ( ) ; try { parser = xml pull parser factory create ( in , pdb file get name ( ) , err handler , false ) ; } catch ( s a x exception e ) { throw new i o exception ( e get message ( ) ) ; } }


returns the appropriate { @ code get - field } rop for the given type the result is a shared instance

public static rop op get field ( type bearer type ) { switch ( type get basic type ( ) ) { case type bt int : return get field int ; case type bt long : return get field long ; case type bt float : return get field float ; case type bt double : return get field double ; case type bt object : return get field object ; case type bt boolean : return get field boolean ; case type bt byte : return get field byte ; case type bt char : return get field char ; case type bt short : return get field short ; } return throw bad type ( type ) ; }


get whether to include a bucket for documents not matching any filter

public boolean other bucket ( ) { return other bucket ; }


resolve the bean definition profiles to use when loading an { @ code application context } for the given { @ linkplain class test class }

string [ ] resolve ( class < ? > test class ) ;


this test verifies that all list state implementations are consistent in not allowing { @ link list state # update ( list ) } to be called with { @ code null }

public void test list state update null ( ) throws exception { checkpointable keyed state backend < string > keyed backend = create keyed backend ( string serializer instance ) ; final list state descriptor < long > state descr = new list state descriptor < > ( " my - state " , long class ) ; try { list state < long > state = keyed backend get partitioned state ( void namespace instance , void namespace serializer instance , state descr ) ; keyed backend set current key ( " abc " ) ; assert null ( state get ( ) ) ; expected exception expect ( null pointer exception class ) ; state update ( null ) ; } finally { keyed backend close ( ) ; keyed backend dispose ( ) ; } }


ensure that there is no waiting ( sleep duration = 0 ) if the metrics have only been updated with successful requests

public void test only success then no waiting ( ) { client throttling analyzer analyzer = new client throttling analyzer ( " test " , analysis period ) ; analyzer add bytes transferred ( 8 * megabyte , false ) ; validate ( 0 , analyzer get sleep duration ( ) ) ; sleep ( analysis period plus 10 percent ) ; validate ( 0 , analyzer get sleep duration ( ) ) ; }


cleans the resources and closes the instance of datanode

public void tear down ( ) throws i o exception { if ( dn ! = null ) { try { dn shutdown ( ) ; } catch ( exception e ) { log error ( " cannot close : " , e ) ; } finally { file dir = new file ( data dir ) ; if ( dir exists ( ) ) assert assert true ( " cannot delete data - node dirs " , file util fully delete ( dir ) ) ; } } dn = null ; }


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


build the { @ link abstract bean definition bean definition }

private abstract bean definition build service bean definition ( annotation service annotation , annotation attributes service annotation attributes , class < ? > interface class , string annotated service bean name ) { bean definition builder builder = root bean definition ( service bean class ) ; abstract bean definition bean definition = builder get bean definition ( ) ; mutable property values property values = bean definition get property values ( ) ; string [ ] ignore attribute names = of ( " provider " , " monitor " , " application " , " module " , " registry " , " protocol " , " interface " , " interface name " , " parameters " ) ; property values add property values ( new annotation property values adapter ( service annotation , environment , ignore attribute names ) ) ; / / references " ref " property to annotated - @ service bean add property reference ( builder , " ref " , annotated service bean name ) ; / / set interface builder add property value ( " interface " , interface class get name ( ) ) ; / / convert parameters into map builder add property value ( " parameters " , convert parameters ( service annotation attributes get string array ( " parameters " ) ) ) ; / / add methods parameters list < method config > method configs = convert method configs ( service annotation attributes get ( " methods " ) ) ; if ( ! method configs is empty ( ) ) { builder add property value ( " methods " , method configs ) ; } / * * * add { @ link org apache dubbo config provider config } bean reference * / string provider config bean name = service annotation attributes get string ( " provider " ) ; if ( string utils has text ( provider config bean name ) ) { add property reference ( builder , " provider " , provider config bean name ) ; } / * * * add { @ link org apache dubbo config monitor config } bean reference * / string monitor config bean name = service annotation attributes get string ( " monitor " ) ; if ( string utils has text ( monitor config bean name ) ) { add property reference ( builder , " monitor " , monitor config bean name ) ; } / * * * add { @ link org apache dubbo config application config } bean reference * / string application config bean name = service annotation attributes get string ( " application " ) ; if ( string utils has text ( application config bean name ) ) { add property reference ( builder , " application " , application config bean name ) ; } / * * * add { @ link org apache dubbo config module config } bean reference * / string module config bean name = service annotation attributes get string ( " module " ) ; if ( string utils has text ( module config bean name ) ) { add property reference ( builder , " module " , module config bean name ) ; } / * * * add { @ link org apache dubbo config registry config } bean reference * / string [ ] registry config bean names = service annotation attributes get string array ( " registry " ) ; list < runtime bean reference > registry runtime bean references = to runtime bean references ( registry config bean names ) ; if ( ! registry runtime bean references is empty ( ) ) { builder add property value ( " registries " , registry runtime bean references ) ; }


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


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

key value iterator < windowed < k > , v > fetch all ( long time from , long time to ) ;


register a callback to be executed on destruction of the specified attribute in the given scope implementations should do their best to execute the callback at the appropriate time : that is , at request completion or session termination , respectively if such a callback is not supported by the underlying runtime environment , the callback must be ignored and a corresponding warning should be logged note that ' destruction ' usually corresponds to destruction of the entire scope , not to the individual attribute having been explicitly removed by the application if an attribute gets removed via this facade ' s { @ link # remove attribute ( string , int ) } method , any registered destruction callback should be disabled as well , assuming that the removed object will be reused or manually destroyed < b > note : < b > callback objects should generally be serializable if they are being registered for a session scope otherwise the callback ( or even the entire session ) might not survive web app restarts

void register destruction callback ( string name , runnable callback , int scope ) ;