replaces the local symbols in to func with the local symbols that are in the from func

private void replace locals ( function to func , function from func , task monitor monitor ) throws cancelled exception { variable [ ] old locals = to func get local variables ( ) ; variable [ ] from locals = from func get local variables ( ) ; if ( arrays equals ( old locals , from locals ) ) { return ; } / / remove all locals in the to func that don ' t have a comparable local in the from func for ( variable local : old locals ) { monitor check canceled ( ) ; variable from var = diff utility get variable ( local , from func ) ; if ( from var = = null ) { to func remove variable ( local ) ; } } for ( variable from local : from locals ) { monitor check canceled ( ) ; replace variable ( from func , from local , to func ) ; } }


clean up state associated with the connection and close it any exception arising from closing the connection are propagated

public void clear connection ( ) { if ( logger is debug enabled ( ) ) { logger debug ( " cleaning up connection state for session " + this session id ) ; } if ( this is remote client session ) { stomp broker relay message handler this connection handlers remove ( this session id ) ; } this is stomp connected = false ; tcp connection < byte [ ] > conn = this tcp connection ; this tcp connection = null ; if ( conn ! = null ) { if ( logger is debug enabled ( ) ) { logger debug ( " closing tcp connection in session " + this session id ) ; } conn close ( ) ; } }


creates a variant for a given media playlist url

public static variant create media playlist variant url ( uri url ) { format format = new format builder ( ) set id ( " 0 " ) set container mime type ( mime types application m3u8 ) build ( ) ; return new variant ( url , format , / * video group id = * / null , / * audio group id = * / null , / * subtitle group id = * / null , / * caption group id = * / null ) ; }


build an atom with all possible values in its label

public handle wildcard ( grammar a s t node ) { a t n state left = new state ( node ) ; a t n state right = new state ( node ) ; left add transition ( new wildcard transition ( right ) ) ; node atn state = left ; return new handle ( left , right ) ; }


returns an open { @ link program } instance that matches the specified { @ link fsrl } , either from the set of currently open programs , or by requesting the specified { @ link program manager } to open a { @ link domain file } that was found to match this g file

public static program find matching program open if needed ( fsrl fsrl , domain file domain file , object consumer , program manager program manager , int open state ) { program program = find matching open program ( fsrl , consumer ) ; if ( program ! = null ) { program manager open program ( program , open state ) ; return program ; } domain file df = ( domain file = = null ) ? get cached domain file for ( fsrl ) : domain file ; if ( df = = null | | program manager = = null ) { return null ; } program = program manager open program ( df , domain file default version , open state ) ; if ( program ! = null ) { program add consumer ( consumer ) ; } return program ; }


retrieves and removes the head of the queue represented by this deque ( in other words , the first element of this deque ) , or returns < tt > null < tt > if this deque is empty < p > this method is equivalent to { @ link # poll first ( ) }


does the processing to uncrushify the png idat chunks

private void process i d a t chunks ( i h d r chunk ihdr chunk , byte [ ] decompressed result ) throws p n g format exception { int width ; int height ; if ( ihdr chunk get interlace method ( ) = = crushed p n g constants adam7 interlace ) { / / msg debug ( this , " checking adam 7 unpacking " ) ; int y = 0 ; for ( int pass = 0 ; pass < crushed p n g constants starting col length ; pass + + ) { width = ( ihdr chunk get img width ( ) - crushed p n g constants starting col [ pass ] + crushed p n g constants col increment [ pass ] - 1 ) / crushed p n g constants col increment [ pass ] ; height = ( ihdr chunk get img height ( ) - crushed p n g constants starting row [ pass ] + crushed p n g constants row increment [ pass ] - 1 ) / crushed p n g constants row increment [ pass ] ; int row = 0 ; while ( row < height ) { if ( decompressed result [ y ] > 4 ) { throw new p n g format exception ( " unknown row filter type " + decompressed result [ y ] ) ; } / / skip row filter byte y + + ; / / skip rest of row y + = width * ihdr chunk get bytes per palette ( ) ; row + + ; } } y = 0 ; for ( int pass = 0 ; pass < crushed p n g constants starting col length ; pass + + ) { / / formula taken from pngcheck width = ( ihdr chunk get img width ( ) - crushed p n g constants starting col [ pass ] + crushed p n g constants col increment [ pass ] - 1 ) / crushed p n g constants col increment [ pass ] ; height = ( ihdr chunk get img height ( ) - crushed p n g constants starting row [ pass ] + crushed p n g constants row increment [ pass ] - 1 ) / crushed p n g constants row increment [ pass ] ; int start at = y ; int row = 0 ; while ( row < height ) { / / skip row filter byte y + + ; / / swap all bytes in this row int x = 0 ; while ( x < width ) { byte tmp byte = decompressed result [ y + 2 ] ; decompressed result [ y + 2 ] = decompressed result [ y ] ; decompressed result [ y ] = tmp byte ; y + = ihdr chunk get bytes per palette ( ) ; x + + ; } row + + ; } / / rgba if ( ihdr chunk get color type ( ) = = 6 ) { remove row filters ( width , height , decompressed result , start at ) ; demultiply alpha ( width , height , decompressed result , start at ) ; apply row filters ( width , height , decompressed result , start at ) ; } } } else { / / check row filters int y = 0 ; while ( y < ( ihdr chunk get bytes per line ( ) * ihdr chunk get img height ( ) + ihdr chunk get row filter bytes ( ) ) ) { if ( decompressed result [ y ] > 4 ) { throw new p n g format exception ( " unkown row filter type " + decompressed result [ y ] ) ; } / / skip row filter byte y + + ; / / skip entire row y + = ihdr chunk get bytes per line ( ) ; } y = 0 ; while ( y < ( ihdr chunk get bytes per line ( ) * ihdr chunk get img height ( ) + ihdr chunk get row filter bytes ( ) ) ) { / / skip row filter byte y + + ; / / swap all bytes in this row int x = 0 ; while ( x < ihdr chunk get img width ( ) ) { byte tmp byte = decompressed result [ y + 2 ] ; decompressed result [ y + 2 ] = decompressed result [ y ] ; decompressed result [ y ] = tmp byte ; y + = ihdr chunk get bytes per palette ( ) ; x + + ; } } if ( ihdr chunk get color type ( ) = = 6 ) { / / rgba remove row filters ( ihdr chunk get img width ( ) , ihdr chunk get img height ( ) , decompressed result , 0 ) ; demultiply alpha ( ihdr chunk get img width ( ) , ihdr chunk get img height ( ) , decompressed result , 0 ) ; apply row filters ( ihdr chunk get img width ( ) , ihdr chunk get img height ( ) , decompressed result , 0 ) ; } } }


sets { @ link format # exo media crypto type } the default value is { @ code null }

public builder set exo media crypto type ( @ nullable class < ? extends exo media crypto > exo media crypto type ) { this exo media crypto type = exo media crypto type ; return this ; }


spherically interpolates between this vector and the target vector by alpha which is in the range [ 0 , 1 ] the result is stored in this vector

public vector 3 slerp ( final vector 3 target , float alpha ) { final float dot = dot ( target ) ; / / if the inputs are too close for comfort , simply linearly interpolate if ( dot > 0 9995 | | dot < - 0 9995 ) return lerp ( target , alpha ) ; / / theta 0 = angle between input vectors final float theta 0 = ( float ) math acos ( dot ) ; / / theta = angle between this vector and result final float theta = theta 0 * alpha ; final float st = ( float ) math sin ( theta ) ; final float tx = target x - x * dot ; final float ty = target y - y * dot ; final float tz = target z - z * dot ; final float l 2 = tx * tx + ty * ty + tz * tz ; final float dl = st * ( ( l 2 < 0 0 0 0 1f ) ? 1f : 1f / ( float ) math sqrt ( l 2 ) ) ; return scl ( ( float ) math cos ( theta ) ) add ( tx * dl , ty * dl , tz * dl ) nor ( ) ; }


public string get name ( ) { return name ; }


< code > repeated org apache dubbo metadata definition protobuf model phone number phone = 8 ; < code >

public builder add phone ( org apache dubbo metadata definition protobuf model google p b phone number builder builder for value ) { if ( phone builder = = null ) { ensure phone is mutable ( ) ; phone add ( builder for value build ( ) ) ; on changed ( ) ; } else { phone builder add message ( builder for value build ( ) ) ; } return this ; }


set the reader ( andor reader group ) list string

public void set readers ( string readers ) { this readers = readers ; }


saves the model < br > person person = new person ( ) ; person set name ( & quot ; tom & quot ; ) ; person set age ( 22 ) ; person save ( ) ; if the model is a new record gets created in the database , otherwise the existing record gets updated < br > if saving process failed by any accident , the whole action will be cancelled and your database will be < b > rolled back < b > < br > if the model has a field named id or id and field type is int or long , the id value generated by database will assign to it after the model is saved < br > note that if the associated models of this model is already saved the associations between them will be built automatically in database after it saved

public boolean save ( ) { try { save throws ( ) ; return true ; } catch ( exception e ) { e print stack trace ( ) ; return false ; } }


list < localization status > get localization statuses ( ) ;


decorates the given { @ link readable buffer } to ignore calls to { @ link readable buffer # close }

public static readable buffer ignore close ( readable buffer buffer ) { return new forwarding readable buffer ( buffer ) { @ override public void close ( ) { / / ignore } } ; }


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

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


tests a series of three nested boolean queries with a single " leaf " match query the rewrite process will " collapse " this down to a single bool , so this tests to make sure nothing catastrophic happens during that fairly substantial rewrite

public void test collapsing bool ( ) throws exception { create index ( " test " ) ; ensure green ( ) ; int num docs = random int between ( 100 , 150 ) ; index request builder [ ] docs = new index request builder [ num docs ] ; for ( int i = 0 ; i < num docs ; i + + ) { docs [ i ] = client ( ) prepare index ( " test " ) set id ( string value of ( i ) ) set source ( " field 1 " , english int to english ( i ) , " field 2 " , i ) ; } index random ( true , docs ) ; refresh ( ) ; query builder q = query builders bool query ( ) must ( query builders bool query ( ) must ( query builders bool query ( ) must ( query builders match query ( " field 1 " , " one " ) ) ) ) ; logger info ( " query : { } " , q ) ; search response resp = client ( ) prepare search ( ) set query ( q ) set profile ( true ) set search type ( search type query then fetch ) get ( ) ; assert not null ( " profile response element should not be null " , resp get profile results ( ) ) ; assert that ( " profile response should not be an empty array " , resp get profile results ( ) size ( ) , not ( 0 ) ) ; for ( map entry < string , profile shard result > shard result : resp get profile results ( ) entry set ( ) ) { for ( query profile shard result search profiles : shard result get value ( ) get query profile results ( ) ) { for ( profile result result : search profiles get query results ( ) ) { assert not null ( result get query name ( ) ) ; assert not null ( result get lucene description ( ) ) ; assert that ( result get time ( ) , greater than ( 0l ) ) ; assert not null ( result get time breakdown ( ) ) ; } collector result result = search profiles get collector result ( ) ; assert that ( result get name ( ) , is ( not ( empty or null string ( ) ) ) ) ; assert that ( result get time ( ) , greater than ( 0l ) ) ; } } }


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


sets the chaining strategy of this { @ code transformation }

public abstract void set chaining strategy ( chaining strategy strategy ) ;


creates a dummy artifact with the given path , that actually resides in out < path >

private artifact derived artifact ( string path ) { artifact derived artifact derived artifact = new artifact derived artifact ( derived root , derived root get exec path ( ) get relative ( path ) , actions test util null artifact owner ) ; derived artifact set generating action key ( actions test util null action lookup data ) ; return derived artifact ; }


void add event listener ( handler event handler , event listener event listener ) ;


test open files under snapshot directories are getting captured in snapshots as a truly immutable copy verify open files outside of snapshot directory not getting affected \ - level 0 a \ - level 1 c + - app a log ( open file , not under snap root ) \ - level 2 e ( snapshottable dir ) \ - level 3 g + - flume log ( open file , under snap root ) \ - level 0 b + - app b log ( open file , not under snap root ) \ - level 2 d ( snapshottable dir ) + - hbase log ( open file , under snap root )

public void test point in time snapshot copies for open files ( ) throws exception { / / construct the directory tree final path level 0 a = new path ( " / level 0 a " ) ; final path level 0 b = new path ( " / level 0 b " ) ; final path level 1 c = new path ( level 0 a , " level 1 c " ) ; final path level 1 d = new path ( level 0 b , " level 1 d " ) ; final path level 2 e = new path ( level 1 c , " level 2 e " ) ; final path level 3 g = new path ( level 2 e , " level 3 g " ) ; set < path > dir paths = new hash set < > ( arrays as list ( level 0 a , level 0 b , level 1 c , level 1 d , level 2 e , level 3 g ) ) ; for ( path dir path : dir paths ) { fs mkdirs ( dir path ) ; } / / string constants final path flume snap root dir = level 2 e ; final path hbase snap root dir = level 1 d ; final string flume file name = " flume log " ; final string hbase file name = " hbase log " ; final string app a file name = " app a log " ; final string app b file name = " app b log " ; final string flume snap 1 name = " flume snap s 1 " ; final string flume snap 2 name = " flume snap s 2 " ; final string flume snap 3 name = " flume snap s 3 " ; final string hbase snap 1 name = " hbase snap s 1 " ; final string hbase snap 2 name = " hbase snap s 2 " ; final string hbase snap 3 name = " hbase snap s 3 " ; final string flume rel path from snap dir = " level 3 g / " + flume file name ; / / create files and open a stream final path flume file = new path ( level 3 g , flume file name ) ; create file ( flume file ) ; f s data output stream flume output stream = fs append ( flume file ) ; final path hbase file = new path ( level 1 d , hbase file name ) ; create file ( hbase file ) ; f s data output stream hbase output stream = fs append ( hbase file ) ; final path app a file = new path ( level 1 c , app a file name ) ; create file ( app a file ) ; f s data output stream app a output stream = fs append ( app a file ) ; final path app b file = new path ( level 0 b , app b file name ) ; create file ( app b file ) ; f s data output stream app b output stream = fs append ( app b file ) ; final long app a file initial length = fs get file status ( app a file ) get len ( ) ; final long app b file initial length = fs get file status ( app b file ) get len ( ) ; / / create snapshot s1 final path flume s 1 dir = snapshot test helper create snapshot ( fs , flume snap root dir , flume snap 1 name ) ; final path flume s 1 path = new path ( flume s 1 dir , flume rel path from snap dir ) ; final path hbase s 1 dir = snapshot test helper create snapshot ( fs , hbase snap root dir , hbase snap 1 name ) ; final path hbase s 1 path = new path ( hbase s 1 dir , hbase file name ) ; final long flume file length after s 1 = fs get file status ( flume file ) get len ( ) ; final long hbase file length after s 1 = fs get file status ( hbase file ) get len ( ) ; / / verify if snap s1 file lengths are same as the the live ones assert assert equals ( flume file length after s 1 , fs get file status ( flume s 1 path ) get len ( ) ) ; assert assert equals ( hbase file length after s 1 , fs get file status ( hbase s 1 path ) get len ( ) ) ; assert assert equals ( app a file initial length , fs get file status ( app a file ) get len ( ) ) ; assert assert equals ( app b file initial length , fs get file status ( app b file ) get len ( ) ) ; long flume file written data length = flume file length after s 1 ; long hbase file written data length = hbase file length after s 1 ; long app a file written data length = app a file initial length ; int new write length = ( int ) ( blocksize * 1 5 ) ; byte [ ] buf = new byte [ new write length ] ; random random = new random ( ) ; random next bytes ( buf ) ; / / write more data to flume and hbase files only flume file written data length + = write to stream ( flume output stream , buf ) ; hbase file written data length + = write to stream ( hbase output stream , buf ) ; / / create snapshot s2 final path flume s 2 dir = snapshot test helper create snapshot ( fs , flume snap root dir , flume snap 2 name ) ; final path flume s 2 path = new path ( flume s 2 dir , flume rel path from snap dir ) ; final path hbase s 2 dir = snapshot test helper create snapshot ( fs , hbase snap root dir , hbase snap 2 name ) ; final path hbase s 2 path = new path ( hbase s 2 dir , hbase file name ) ; / / verify live files lengths are same as all data written till now final long flume file length after s 2 = fs get file status ( flume file ) get len ( ) ; final long hbase file length after s 2 = fs get file status ( hbase file ) get len ( ) ; assert assert equals ( flume file written data length , flume file length after s 2 ) ; assert assert equals ( hbase file written data length , hbase file length after s 2 ) ; / / verify if snap s2 file lengths are same as the live ones assert assert equals ( flume file length after s 2 , fs get file status ( flume s 2 path ) get len ( ) ) ; assert assert equals ( hbase file length after s 2 , fs get file status ( hbase s 2 path ) get len ( ) ) ; assert assert equals ( app a file initial length , fs get file status ( app a file ) get len ( ) ) ; assert assert equals ( app b file initial length , fs get file status ( app b file ) get len ( ) ) ; / / write more data to app a file only new write length = ( int ) ( blocksize * 2 5 ) ; buf = new byte [ new write length ] ; random next bytes ( buf ) ; app a file written data length + = write to stream ( app a output stream , buf ) ; / / verify other open files are not affected in their snapshots assert assert equals ( flume file length after s 2 , fs get file status ( flume s 2 path ) get len ( ) ) ; assert assert equals ( app a file written data length , fs get file status ( app a file ) get len ( ) ) ; / / write more data to flume file only new write length = ( int ) ( blocksize * 2 5 ) ; buf = new byte [ new write length ] ; random next bytes ( buf ) ; flume file written data length + = write to stream ( flume output stream , buf ) ; / / create snapshot s3 final path flume s 3 dir = snapshot test helper create snapshot ( fs , flume snap root dir , flume snap 3 name ) ; final path flume s 3 path = new path ( flume s 3 dir , flume rel path from snap dir ) ; final path hbase s 3 dir = snapshot test helper create snapshot ( fs , hbase snap root dir , hbase snap 3 name ) ; final path hbase s 3 path = new path ( hbase s 3 dir , hbase file name ) ; / / verify live files lengths are same as all data written till now final long flume file length after s 3 = fs get file status ( flume file ) get len ( ) ; final long hbase file length after s 3 = fs get file status ( hbase file ) get len ( ) ; assert assert equals ( flume file written data length , flume file length after s 3 ) ; assert assert equals ( hbase file written data length , hbase file length after s 3 ) ; / / verify if snap s3 file lengths are same as the live ones assert assert equals ( flume file length after s 3 , fs get file status ( flume s 3 path ) get len ( ) ) ; assert assert equals ( hbase file length after s 3 , fs get file status ( hbase s 3 path ) get len ( ) ) ; assert assert equals ( app a file written data length , fs get file status ( app a file ) get len ( ) ) ; assert assert equals ( app b file initial length , fs get file status ( app b file ) get len ( ) ) ; / / verify old flume snapshots have point - in - time / frozen file lengths / / even after the live file have moved forward assert assert equals ( flume file length after s 1 , fs get file status ( flume s 1 path ) get len ( ) ) ; assert assert equals ( flume file length after s 2 , fs get file status ( flume s 2 path ) get len ( ) ) ; assert assert equals ( flume file length after s 3 , fs get file status ( flume s 3 path ) get len ( ) ) ; / / verify old hbase snapshots have point - in - time / frozen file lengths / / even after the live files have moved forward assert assert equals ( hbase file length after s 1 , fs get file status ( hbase s 1 path ) get len ( ) ) ; assert assert equals ( hbase file length after s 2 , fs get file status ( hbase s 2 path ) get len ( ) ) ; assert assert equals ( hbase file length after s 3 , fs get file status ( hbase s 3 path ) get len ( ) ) ; flume output stream close ( ) ; hbase output stream close ( ) ; app a output stream close ( ) ; app b output stream close ( ) ; }


set the given object as target will create a singleton target source for the object

public void set target ( object target ) { set target source ( new singleton target source ( target ) ) ; }


return the list of mime types this encoder supports

list < mime type > get encodable mime types ( ) ;


merges the properties of the two commands

public mergeable background command merge commands ( mergeable background command command ) { system utilities assert true ( command instanceof analysis background command , " this code assumes that the " + " two commands are both analysis background commands and this is not the case " ) ; analysis background command abc = ( analysis background command ) command ; system utilities assert true ( mgr = = abc mgr , " this code assumes that the " + " managers of the two commands are the same instance and this is not the case " ) ; / / once we encounter a mark as analyzed value that is true , then leave it on mark as analyzed = mark as analyzed | abc mark as analyzed ; return this ; }


void add key listener ( on key listener listener ) ;


create the test filesystem with or without multipart purging if the test fs s 3a name property is not set , this will trigger a j unit failure

public static s 3 a file system create test file system ( configuration conf , boolean purge ) throws i o exception { string fsname = conf get trimmed ( test fs s3a name , " " ) ; boolean live test = ! string utils is empty ( fsname ) ; uri test u r i = null ; if ( live test ) { test u r i = uri create ( fsname ) ; live test = test u r i get scheme ( ) equals ( constants fs s3a ) ; } / / this doesn ' t work with our j unit 3 style test cases , so instead we ' ll / / make this whole class not run by default assume assume true ( " no test filesystem in " + test fs s3a name , live test ) ; / / patch in s 3 guard options maybe enable s 3 guard ( conf ) ; s 3 a file system fs 1 = new s 3 a file system ( ) ; / / enable purging in tests if ( purge ) { / / purge with but a delay so that parallel multipart tests don ' t / / suddenly start timing out enable multipart purge ( conf , purge delay seconds ) ; } fs 1 initialize ( test u r i , conf ) ; return fs 1 ; }


forget what happened so far and start measuring once again

void init instrumentation ( final string tag , perf listener perf listener ) ;


returns a key - value mapping associated with the greatest value strictly less than the given value , or { @ code null } if there is no such value

entry < k , v > lower entry by value ( v value ) ;


returns set of non - configurable attribute names defined for this class of rule

public list < string > get non configurable attributes ( ) { return non configurable attributes ; }


test that , even if the other node is not active , we are able to bootstrap standby from it

public void test other node not active ( ) throws exception { cluster transition to standby ( 0 ) ; assert successful bootstrap from index ( 1 ) ; }


public string get application data ( ) { return application data ; }


resolve the given error code into message codes for the given field calls the configured { @ link message codes resolver } with appropriate parameters

string [ ] resolve message codes ( string error code , string field ) ;


do the move operation called from the drag source adapter when the drop completes and the user action was a dn d constants move


the total free memory both unallocated and in the free list

public long available memory ( ) { lock lock ( ) ; try { return this non pooled available memory + free size ( ) * ( long ) this poolable size ; } finally { lock unlock ( ) ; } }


adds data which is useful for the time when the dependency graph is built up all this data will be cleaned once the dependency graph creation has finished

public < t > void put computational data ( class < t > key , t value ) { this computational data put ( key , value ) ; }


calls get ( ) repeatedly from many different threads , and tests that all of the removed entries ( removed because of size limits or expiration ) trigger appropriate removal notifications

public void test removal notification get basher ( ) throws interrupted exception { int n tasks = 1000 ; int n threads = 100 ; final int gets per task = 1000 ; final int n unique keys = 10000 ; final random random = new random ( ) ; / / randoms insecure random ( ) ; queuing removal listener < string , string > removal listener = queuing removal listener ( ) ; final atomic integer compute count = new atomic integer ( ) ; final atomic integer exception count = new atomic integer ( ) ; final atomic integer compute null count = new atomic integer ( ) ; cache loader < string , string > counting identity loader = new cache loader < string , string > ( ) { @ override public string load ( string key ) throws interrupted exception { int behavior = random next int ( 4 ) ; if ( behavior = = 0 ) { / / throw an exception exception count increment and get ( ) ; throw new runtime exception ( " fake exception for test " ) ; } else if ( behavior = = 1 ) { / / return null compute null count increment and get ( ) ; return null ; } else if ( behavior = = 2 ) { / / slight delay before returning thread sleep ( 5 ) ; compute count increment and get ( ) ; return key ; } else { compute count increment and get ( ) ; return key ; } } } ; final loading cache < string , string > cache = cache builder new builder ( ) record stats ( ) concurrency level ( 2 ) expire after write ( 100 , milliseconds ) removal listener ( removal listener ) maximum size ( 5000 ) build ( counting identity loader ) ; executor service thread pool = executors new fixed thread pool ( n threads ) ; for ( int i = 0 ; i < n tasks ; i + + ) { @ suppress warnings ( " unused " ) / / https : / / errorprone info / bugpattern / future return value ignored future < ? > possibly ignored error = thread pool submit ( new runnable ( ) { @ override public void run ( ) { for ( int j = 0 ; j < gets per task ; j + + ) { try { cache get unchecked ( " key " + random next int ( n unique keys ) ) ; } catch ( runtime exception e ) { } } } } ) ; } thread pool shutdown ( ) ; thread pool await termination ( 300 , seconds ) ; / / since we ' re not doing any more cache operations , and the cache only expires / evicts when doing / / other operations , the cache and the removal queue won ' t change from this point on / / verify that each received removal notification was valid for ( removal notification < string , string > notification : removal listener ) { assert equals ( " invalid removal notification " , notification get key ( ) , notification get value ( ) ) ; } cache stats stats = cache stats ( ) ; assert equals ( removal listener size ( ) , stats eviction count ( ) ) ; assert equals ( compute count get ( ) , stats load success count ( ) ) ; assert equals ( exception count get ( ) + compute null count get ( ) , stats load exception count ( ) ) ; / / each computed value is still in the cache , or was passed to the removal listener assert equals ( compute count get ( ) , cache size ( ) + removal listener size ( ) ) ; }


creates an ndk release pre - r 1 1 ( used release txt )

private static ndk release create from release txt ( string revision string ) { / / ndk release should be of the format " r \ d + \ w ? ( - rc \ d + ) ? ( \ ( 64 - bit \ ) ) ? " , eg : / / r 8 / / r 1 0 / / r 1 0 ( 64 - bit ) / / r 1 0e / / r 1 0e - rc 4 / / r 1 0e - rc 4 ( 64 - bit ) pattern revision regex = pattern compile ( " r ( ? < mrev > \ \ d + ) ( ? < mrev > \ \ w ) ? ( - ( ? < rc > rc \ \ d + ) ) ? ( ? < s 4 > \ \ ( 64 - bit \ \ ) ) ? " ) ; matcher matcher = revision regex matcher ( revision string ) ; boolean is valid = matcher matches ( ) ; if ( is valid ) { return new ndk release ( revision string , is valid , integer parse int ( matcher group ( " mrev " ) ) , / * major revision * / matcher group ( " mrev " ) , / * minor revision * / / * release candidate = * / matcher group ( " rc " ) , / * is 6 4 bit = * / matcher group ( " s 4 " ) ! = null ) ; } else { return new ndk release ( revision string , false , android ndk crosstools latest known revision get key ( ) , / / assume latest ndk revision null , null , false ) ; } }


public double get double ( ) { return double ; }


public cancellable evaluate data frame async ( evaluate data frame request request , request options options , action listener < evaluate data frame response > listener ) { return rest high level client perform request async and parse entity ( request , m l request converters : : evaluate data frame , options , evaluate data frame response : : from x content , listener , collections empty set ( ) ) ; }


gets a marker margin or overview margin context object if the mouse event occurred on one of the gui components for the indicated listing panel ' s marker margin ( left edge of listing ) or overview margin ( right edge of listing )

public object get context object for margin panels ( listing panel lp , mouse event event ) { object source = event get source ( ) ; / / is event source a marker margin provider on the left side of the listing ? list < margin provider > margin providers = lp get margin providers ( ) ; for ( margin provider margin provider : margin providers ) { j component c = margin provider get component ( ) ; if ( c = = source ) { marker location loc = margin provider get marker location ( event get x ( ) , event get y ( ) ) ; if ( loc ! = null ) { return loc ; / / return the marker margin location that was clicked } return source ; / / return the margin provider that was clicked } } / / is event source an overview provider on the right side of the listing ? list < overview provider > overview providers = lp get overview providers ( ) ; for ( overview provider overview provider : overview providers ) { j component c = overview provider get component ( ) ; if ( c = = source ) { return source ; / / return the overview provider that was clicked } } return null ; / / not one of the listing panel ' s margin panels }


type of resource collection that is being requested , e g istionetworkingv 1alpha 3 virtual service k 8s & lt ; api version & gt ; & lt ; kind & gt ; < code > string collection = 2 ; < code >

public com google protobuf byte string get collection bytes ( ) { java lang object ref = collection ; 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 ) ; collection = b ; return b ; } else { return ( com google protobuf byte string ) ref ; } }


returns { @ code true } if each element in { @ code iterable } after the first is strictly greater than the element that preceded it , according to this ordering note that this is always true when the iterable has fewer than two elements < b > java 8 users : < b > use the equivalent { @ link comparators # is in strict order ( iterable , comparator ) } instead , since the rest of { @ code ordering } is mostly obsolete ( as explained in the class documentation )

public boolean is strictly ordered ( iterable < ? extends t > iterable ) { iterator < ? extends t > it = iterable iterator ( ) ; if ( it has next ( ) ) { t prev = it next ( ) ; while ( it has next ( ) ) { t next = it next ( ) ; if ( compare ( prev , next ) > = 0 ) { return false ; } prev = next ; } } return true ; }


get the id set of nodes which are in connecting state

set < string > connecting nodes ( ) { return this connecting nodes ; }


public static date get date ( final date date , final long time span , @ time constants unit final int unit ) { return millis 2 date ( date 2 millis ( date ) + time span 2 millis ( time span , unit ) ) ; }


returns the cardinality of the given field or { @ code null } if there is no cardinality for that field


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

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


get the size of the positive portion of the stack ( including 0 )

private int get positive size ( ) { if ( variables is empty ( ) ) { return ( grows negative ( ) ? param start : 0 ) ; } variable var = variables get ( variables size ( ) - 1 ) ; int stack offset = var get stack offset ( ) ; if ( stack offset < 0 ) { return ( grows negative ( ) ? param start : 0 ) ; } return stack offset + var get length ( ) ; }


a version of rename to that throws a descriptive exception when it fails

public static void rename to ( file src , file dst ) throws i o exception { if ( ! native loaded ) { if ( ! src rename to ( dst ) ) { throw new i o exception ( " rename to ( src = " + src + " , dst = " + dst + " ) failed " ) ; } } else { rename to 0 ( src get absolute path ( ) , dst get absolute path ( ) ) ; } }


utility method supporting both possible digest formats : base 6 4 and hex

private boolean digest matches ( byte [ ] digest , string provided digest ) { return provided digest equals ignore case ( hex encode hex string ( digest ) ) | | provided digest equals ignore case ( new string ( base 6 4 get encoder ( ) encode ( digest ) ) ) ; }


private static string [ ] log record preformat ( log record r ) { string source ; if ( r get source class name ( ) = = null ) { source = r get logger name ( ) ; } else { if ( r get source method name ( ) = = null ) { source = r get source class name ( ) ; } else { source = r get source class name ( ) + " " + r get source method name ( ) ; } } string message = new simple formatter ( ) format message ( r ) + " \ n " ; throwable x = r get thrown ( ) ; return new string [ ] { string format ( " % 1 $ tb % 1 $ td , % 1 $ t y % 1 $ tl : % 1 $ t m : % 1 $ t s % 1 $ tp " , new date ( r get millis ( ) ) ) , source , r get level ( ) get localized name ( ) , x = = null ? message : message + print throwable ( x ) + " \ n " } ; }


this is called when recoverable exceptions happen at runtime they can be ignored and epoxy will recover , but you can override this to be aware of when they happen for example , you could choose to rethrow the exception in development builds , or log them in production

void on exception ( @ non null epoxy controller controller , @ non null runtime exception exception ) ;


sets an icon that will be drawn to the left of the actor

public void set icon ( @ null drawable icon ) { this icon = icon ; }


returns a { @ link kafka resource } instance if the instance could not be instantiated ( for example , because a mandatory parameter was missing ) , then an empty { @ link optional } should be returned

kafka resource create ( string kafka version ) throws exception ;


sets the given transform matrix on each controller

public void set transform ( matrix 4 transform ) { for ( int i = 0 , n = controllers size ; i < n ; i + + ) controllers get ( i ) set transform ( transform ) ; }


verifies that once all shard copies on the new version , we should turn off the translog retention for indices with soft - deletes

public void test turn off translog retention after upgraded ( ) throws exception { if ( is running against old cluster ( ) ) { create index ( index , settings builder ( ) put ( index metadata index number of shards setting get key ( ) , 1 ) put ( index metadata index number of replicas setting get key ( ) , 1 ) put ( index settings index soft deletes setting get key ( ) , true ) build ( ) ) ; ensure green ( index ) ; int num docs = random int between ( 10 , 100 ) ; for ( int i = 0 ; i < num docs ; i + + ) { index document ( integer to string ( random int between ( 1 , 100 ) ) ) ; if ( rarely ( ) ) { flush ( index , random boolean ( ) ) ; } } } else { ensure green ( index ) ; flush ( index , true ) ; assert empty translog ( index ) ; ensure peer recovery retention leases renewed and synced ( index ) ; } }


retrieves the next job that is eligible for execution to be ' eligible ' means that the job : - has no dependencies - has no unmet constraints this method will block until a job is available when the job returned from this method has been run , you must call { @ link # on job finished ( job ) }

synchronized @ non null job pull next eligible job for execution ( @ non null job predicate predicate ) { try { job job ; while ( ( job = get next eligible job for execution ( predicate ) ) = = null ) { if ( running jobs is empty ( ) ) { debouncer publish ( callback : : on empty ) ; } wait ( ) ; } job storage update job running state ( job get id ( ) , true ) ; running jobs put ( job get id ( ) , job ) ; job tracker on state change ( job , job tracker job state running ) ; return job ; } catch ( interrupted exception e ) { log e ( tag , " interrupted " ) ; throw new assertion error ( e ) ; } }


mark this { @ link buffer builder } and associated { @ link buffer consumer } as finished - no new data writes will be allowed this method should be idempotent to handle failures and task interruptions check flink - 8948 for more details

public int finish ( ) { int written bytes = position marker mark finished ( ) ; commit ( ) ; return written bytes ; }


prepare a storage directory it creates a builder which can be used to add to the volume if the volume cannot be added , it is ok to discard the builder later

public volume builder prepare volume ( data node datanode , storage location location , list < namespace info > ns infos ) throws i o exception { if ( contains storage dir ( location ) ) { final string error message = " storage directory is in use " ; log warn ( error message ) ; throw new i o exception ( error message ) ; } storage directory sd = load storage directory ( datanode , ns infos get ( 0 ) , location , startup option hotswap , null ) ; volume builder builder = new volume builder ( this , sd ) ; for ( namespace info ns info : ns infos ) { location make block pool dir ( ns info get block pool i d ( ) , null ) ; final block pool slice storage bp storage = get block pool slice storage ( ns info ) ; final list < storage directory > dirs = bp storage load bp storage directories ( ns info , location , startup option hotswap , null , datanode get conf ( ) ) ; builder add bp storage directories ( ns info get block pool i d ( ) , dirs ) ; } return builder ; }


boolean dispatch fast forward ( player player ) ;


public static configuration create client s s l config ( string client k s , string password , string key password , string trust k s , string trust password ) { return create s s l config ( s s l factory mode client , client k s , password , key password , trust k s , trust password , " " ) ; }


collector metrics delegate ( ) { collector metrics result = delegate ; if ( result ! = null ) return delegate ; / / synchronization is not needed as redundant calls have no ill effects return delegate = factory get bean ( collector metrics class ) for transport ( " local " ) ; }


cleanup resources after transaction completion called after { @ code do commit } and { @ code do rollback } execution , on any outcome the default implementation does nothing should not throw any exceptions but just issue warnings on errors

protected mono < void > do cleanup after completion ( transaction synchronization manager synchronization manager , object transaction ) { return mono empty ( ) ; }


gets the stream this state is associated with


traverse the specified tilesets , optionally lookup the used ids and pass every tile image to the { @ link texture packer } , optionally ignoring unused tile ids

private void pack tilesets ( file handle input dir handle , settings texture packer settings ) throws i o exception { buffered image tile ; vector 2 tile location ; graphics g ; packer = new texture packer ( texture packer settings ) ; for ( tiled map tile set set : tilesets to pack values ( ) ) { string tileset name = set get name ( ) ; system out println ( " processing tileset " + tileset name ) ; int array used ids = this settings strip unused tiles ? get used ids bucket ( tileset name , - 1 ) : null ; int tile width = set get properties ( ) get ( " tilewidth " , integer class ) ; int tile height = set get properties ( ) get ( " tileheight " , integer class ) ; int firstgid = set get properties ( ) get ( " firstgid " , integer class ) ; string image name = set get properties ( ) get ( " imagesource " , string class ) ; tile set layout layout = new tile set layout ( firstgid , set , input dir handle ) ; for ( int gid = layout firstgid , i = 0 ; i < layout num tiles ; gid + + , i + + ) { boolean verbose = this settings verbose ; if ( used ids ! = null & & ! used ids contains ( gid ) ) { if ( verbose ) { system out println ( " stripped id # " + gid + " from tileset \ " " + tileset name + " \ " " ) ; } continue ; } tile location = layout get location ( gid ) ; tile = new buffered image ( tile width , tile height , buffered image type 4byte abgr ) ; g = tile create graphics ( ) ; g draw image ( layout image , 0 , 0 , tile width , tile height , ( int ) tile location x , ( int ) tile location y , ( int ) tile location x + tile width , ( int ) tile location y + tile height , null ) ; if ( verbose ) { system out println ( " adding " + tile width + " x " + tile height + " ( " + ( int ) tile location x + " , " + ( int ) tile location y + " ) " ) ; } / / atlas tmx map loader expects every tileset ' s index to begin at zero for the first tile in every tileset / / so the region ' s adjusted gid is ( gid - layout firstgid ) firstgid will be added back in atlas tmx map loader on load int adjusted gid = gid - layout firstgid ; final string separator = " " ; string region name = tileset name + separator + adjusted gid ; packer add image ( tile , region name ) ; } } string tileset output dir = output dir to string ( ) + " / " + this settings tileset output directory ; file relative tileset output dir = new file ( tileset output dir ) ; file output dir tilesets = new file ( relative tileset output dir get canonical path ( ) ) ; output dir tilesets mkdirs ( ) ; packer pack ( output dir tilesets , this settings atlas output name + " atlas " ) ; }


persist the current state on to a stack , must be complimented by a call to { @ link # restore ( ) }

public void save ( ) { canvas matrix save ( ) ; }


public void clear ( ) { classes clear ( ) ; }


returns the minimal range that { @ linkplain range # contains ( comparable ) contains } all of the given values the returned range is { @ linkplain bound type # closed closed } on both ends

public static < c extends comparable < ? > > range < c > enclose all ( iterable < c > values ) { check not null ( values ) ; if ( values instanceof sorted set ) { sorted set < ? extends c > set = cast ( values ) ; comparator < ? > comparator = set comparator ( ) ; if ( ordering natural ( ) equals ( comparator ) | | comparator = = null ) { return closed ( set first ( ) , set last ( ) ) ; } } iterator < c > value iterator = values iterator ( ) ; c min = check not null ( value iterator next ( ) ) ; c max = min ; while ( value iterator has next ( ) ) { c value = check not null ( value iterator next ( ) ) ; min = ordering natural ( ) min ( min , value ) ; max = ordering natural ( ) max ( max , value ) ; } return closed ( min , max ) ; }


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


statistics about the execution of the job

public rollup indexer job stats get stats ( ) { return stats ; }


sets the < code > array number < code > property

public void set array number ( list < big decimal > array number ) { this array number = array number ; }


add a header row ( no icon , no url , rendered in header style )

public context menu add header ( string title ) { final menu item item = new menu item ( ) with display name ( title ) ; item header = true ; return add ( item ) ; }


public void cmdb get instance list 1 ( ) throws exception { string service name = random domain name ( ) ; system out println ( service name ) ; naming service create ( service name , constants default namespace id , constants default group ) ; instance register ( service name , constants default namespace id , constants default group , " 11 11 11 11 " , string value of ( test port 4 dom 1 ) , " c 1 " ) ; instance register ( service name , constants default namespace id , constants default group , " 22 22 22 22 " , string value of ( test port 4 dom 1 ) , " c 1 " ) ; instance register ( service name , constants default namespace id , constants default group , " 33 33 33 33 " , string value of ( test port 4 dom 1 ) , " c 2 " ) ; instance register ( service name , constants default namespace id , constants default group , " 44 44 44 44 " , string value of ( test port 4 dom 1 ) , " c 2 " ) ; instance register ( service name , constants default namespace id , constants default group , " 55 55 55 55 " , string value of ( test port 4 dom 1 ) , " c 1 " ) ; instance register ( service name , constants default namespace id , constants default group , " 66 66 66 66 " , string value of ( test port 4 dom 1 ) , " c 1 " ) ; string service name 2 = random domain name ( ) ; naming service create ( service name 2 , constants default namespace id , constants default group ) ; instance register ( service name 2 , constants default namespace id , constants default group , " 77 77 77 77 " , string value of ( test port 4 dom 1 ) , " c 2 " ) ; instance register ( service name 2 , constants default namespace id , constants default group , " 88 88 88 88 " , string value of ( test port 4 dom 1 ) , " c 2 " ) ; time unit seconds sleep ( 5l ) ; object node json = jackson utils create empty json node ( ) ; json put ( " type " , " label " ) ; json put ( " expression " , " consumer label label 1 = provider label label 1 " ) ; response entity < string > http result = request ( " / nacos / v 1 / ns / service " , params new params ( ) append param ( " service name " , service name ) append param ( " protect threshold " , " 0 " ) append param ( " selector " , json to string ( ) ) done ( ) , string class , http method put ) ; assert assert equals ( http u r l connection http ok , http result get status code value ( ) ) ; http result = request ( " / nacos / v 1 / ns / instance / list " , params new params ( ) append param ( " service name " , service name ) append param ( " client i p " , " 11 11 11 11 " ) done ( ) , string class , http method get ) ; assert assert equals ( http u r l connection http ok , http result get status code value ( ) ) ; json node result = jackson utils to obj ( http result get body ( ) ) ; assert assert equals ( 1 , result get ( " hosts " ) size ( ) ) ; }


{ @ inherit doc } the default implementation does nothing

@ override public void exit dereference ( eql base parser dereference context ctx ) { }


return the bitmap with the specified color

public static bitmap draw color ( @ non null final bitmap src , @ color int final int color , final boolean recycle ) { if ( is empty bitmap ( src ) ) return null ; bitmap ret = recycle ? src : src copy ( src get config ( ) , true ) ; canvas canvas = new canvas ( ret ) ; canvas draw color ( color , porter duff mode darken ) ; return ret ; }


translate an exception raised in an operation into an i o exception http error codes are examined and can be used to build a more specific response

static i o exception translate exception ( final string operation , final string path , final obs exception exception ) { string message = string format ( " % s % s : status [ % d ] - request id [ % s ] " + " - error code [ % s ] - error message [ % s ] - trace : % s " , operation , path ! = null ? " on " + path : " " , exception get response code ( ) , exception get error request id ( ) , exception get error code ( ) , exception get error message ( ) , exception ) ; i o exception ioe ; int status = exception get response code ( ) ; switch ( status ) { case moved permanently code : message = string format ( " received permanent redirect response , " + " status [ % d ] - request id [ % s ] - " + " error code [ % s ] - message [ % s ] " , exception get response code ( ) , exception get error request id ( ) , exception get error code ( ) , exception get error message ( ) ) ; ioe = new o b s i o exception ( message , exception ) ; break ; / / permissions case unauthorized code : case forbidden code : ioe = new access denied exception ( path , null , message ) ; ioe init cause ( exception ) ; break ; / / the object isn ' t there case not found code : case gone code : ioe = new file not found exception ( message ) ; ioe init cause ( exception ) ; break ; / / out of range this may happen if an object is overwritten with / / a shorter one while it is being read case eof code : ioe = new e o f exception ( message ) ; break ; default : / / no specific exit code choose an ioe subclass based on the / / class / / of the caught exception ioe = new o b s i o exception ( message , exception ) ; break ; } return ioe ; }


delay channel close on authentication failure this will remove all readwrite operations from the channel until { @ link # complete close on authentication failure ( ) } is called to finish up the channel close

private void delay close on authentication failure ( ) { transport layer remove interest ops ( selection key op write ) ; }


public list < list < big decimal > > get array array number ( ) { return array array number ; }


public list < object > get encrypt assisted query values ( final string logic table , final string logic column , final list < object > original values ) { optional < encrypt algorithm > encryptor = find encryptor ( logic table , logic column ) ; preconditions check argument ( encryptor is present ( ) & & encryptor get ( ) instanceof query assisted encrypt algorithm , string format ( " can not find query assisted encrypt algorithm by % s % s " , logic table , logic column ) ) ; return original values stream ( ) map ( input - > null = = input ? null : ( ( query assisted encrypt algorithm ) encryptor get ( ) ) query assisted encrypt ( input to string ( ) ) ) collect ( collectors to list ( ) ) ; }


returns the new { @ link platform info } instance

public platform info build ( ) throws duplicate constraint exception , exec properties exception { check remote execution properties ( ) ; / / merge the remote execution properties string remote execution properties = merge remote execution properties ( parent , this remote execution properties ) ; immutable map < string , string > exec properties = merge exec properties ( parent , this exec properties ) ; if ( exec properties = = null ) { exec properties = immutable map of ( ) ; } return new platform info ( label , constraints build ( ) , remote execution properties , exec properties , creation location ) ; }


test that when access time updates are not needed , the f s namesystem write lock is not taken by get block locations regression test for hdfs - 3981

public void test get block locations only uses read lock ( ) throws i o exception { configuration conf = new hdfs configuration ( ) ; conf set int ( d f s config keys dfs namenode accesstime precision key , 100 * 1000 ) ; mini d f s cluster cluster = new mini d f s cluster builder ( conf ) num data nodes ( 0 ) build ( ) ; reentrant read write lock spy lock = name node adapter spy on fs lock ( cluster get namesystem ( ) ) ; try { / / create empty file in the fsn path p = new path ( " / empty - file " ) ; d f s test util create file ( cluster get file system ( ) , p , 0 , ( short ) 1 , 0l ) ; / / get block locations ( ) should not need the write lock , since we just created / / the file ( and thus its access time is already within the 100 - second / / accesstime precision configured above ) mockito util do throw when call stack matches ( new assertion error ( " should not need write lock " ) , " * get block locations * " ) when ( spy lock ) write lock ( ) ; cluster get file system ( ) get file block locations ( p , 0 , 100 ) ; } finally { cluster shutdown ( ) ; } }


helper method to configure authentications which respects aliases of api keys

public api client configure api keys ( map < string , string > secrets ) { for ( map entry < string , authentication > auth entry : authentications entry set ( ) ) { authentication auth = auth entry get value ( ) ; if ( auth instanceof api key auth ) { string name = auth entry get key ( ) ; / / respect x - auth - id - alias property name = authentication lookup contains key ( name ) ? authentication lookup get ( name ) : name ; if ( secrets contains key ( name ) ) { ( ( api key auth ) auth ) set api key ( secrets get ( name ) ) ; } } } return this ; }


returns the array of base relocations defined in this base relocation data directory

public base relocation [ ] get base relocations ( ) { return relocs ; }


add an attribute to the model using a { @ link org springframework core conventions # get variable name generated name }


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


public void add location ( string location , int num virtual nodes ) { write lock lock ( ) ; try { entry to virtual nodes put ( location , num virtual nodes ) ; for ( int i = 0 ; i < num virtual nodes ; i + + ) { string key = string format ( virtual node format , location , i ) ; string hash = get hash ( key ) ; ring put ( hash , key ) ; } } finally { write lock unlock ( ) ; } }


compare logical range , st i , j mod offset capacity compare by partition , then by key

public int compare ( final int mi , final int mj ) { final int kvi = offset for ( mi % max rec ) ; final int kvj = offset for ( mj % max rec ) ; final int kvip = kvmeta get ( kvi + partition ) ; final int kvjp = kvmeta get ( kvj + partition ) ; / / sort by partition if ( kvip ! = kvjp ) { return kvip - kvjp ; } / / sort by key return comparator compare ( kvbuffer , kvmeta get ( kvi + keystart ) , kvmeta get ( kvi + valstart ) - kvmeta get ( kvi + keystart ) , kvbuffer , kvmeta get ( kvj + keystart ) , kvmeta get ( kvj + valstart ) - kvmeta get ( kvj + keystart ) ) ; }


clears the current selection calling this method is equivalent to calling { @ link # set current selection ( address set view ) } with a null or empty address set

public void remove selection ( ) { set current selection ( null ) ; }


void load into ( map < string , route meta > providers ) ;


generates a random object { " first field " : " foo " , " marked field " : { random } , " last field " : " bar } returns the number of tokens in the marked field

private static int generate random object for marking ( x content builder builder ) throws i o exception { builder start object ( ) field ( " first field " , " foo " ) field ( " marked field " ) ; int number of tokens = generate random object ( builder , 0 ) ; builder field ( " last field " , " bar " ) end object ( ) ; return number of tokens ; }


location where the file containing the spec will be generated in the output folder

public void set open api spec file location ( string location ) { this open api spec file location = location ; }


public long get deletion timestamp ( ) { return deletion timestamp ; }


set whether or not this definition is abstract

public bean definition builder set abstract ( boolean flag ) { this bean definition set abstract ( flag ) ; return this ; }


read resolve ( ) preserves the singleton property of the default value

protected final object read resolve ( ) throws object stream exception { return encoded reference = = null ? default : this ; }


{ @ inherit doc } this method returns a { @ link sorted set } , instead of the { @ code set } specified in the { @ link table } interface


private void emit unsigned leb 1 2 8 ( int n ) throws i o exception { / / we ' ll never need the top end of the unsigned range anyway if ( n < 0 ) { throw new runtime exception ( " signed value where unsigned required : " + n ) ; } output write uleb 1 2 8 ( n ) ; }


public static void remove storage ( block info block , datanode storage info storage ) { block remove storage ( storage ) ; }


public void set value ( object value ) { this value = value ; }


tests that if an i o exception occurs in an output stream , the exception will be recorded and thrown when we call wait for completion

public void test asynchronous i o exception in consumer output stream ( ) { output stream out = new output stream ( ) { @ override public void write ( int b ) throws i o exception { throw new i o exception ( secret message ) ; } } ; out err consumers out err = consumers create streaming consumers ( out , out ) ; byte array input stream out input = new byte array input stream ( new byte [ ] { ' a ' } ) ; byte array input stream err input = new byte array input stream ( new byte [ 0 ] ) ; out err register inputs ( out input , err input , false ) ; i o exception e = assert throws ( i o exception class , ( ) - > out err wait for completion ( ) ) ; assert that ( e ) has message that ( ) is equal to ( secret message ) ; }


check that dangling indices can be deleted since this requires that we add an entry to the index graveyard , the graveyard size must be greater than 1 to test deletes , we set the index graveyard size to 1 , then create two indices and delete them both while one node in the cluster is stopped the deletion of the second pushes the deletion of the first out of the graveyard when the stopped node is resumed , only the second index will be found into the graveyard and the the other will be considered dangling , and can therefore be listed and deleted through the api

public void test dangling index can be deleted ( ) throws exception { final settings settings = build settings ( 1 , true ) ; internal cluster ( ) start nodes ( 3 , settings ) ; final string stopped node name = create dangling indices ( index name , other index name ) ; final string dangling index u u i d = find dangling index for node ( stopped node name , index name ) ; client ( ) admin ( ) cluster ( ) delete dangling index ( new delete dangling index request ( dangling index u u i d , true ) ) action get ( ) ; / / the dangling index that we deleted ought to have been removed from disk check by / / creating and deleting another index , which creates a new tombstone entry , which should / / not cause the deleted dangling index to be considered " live " again , just because its / / tombstone has been pushed out of the graveyard create index ( " additional " ) ; assert acked ( client ( ) admin ( ) indices ( ) prepare delete ( " additional " ) ) ; assert that ( list dangling indices ( ) , is ( empty ( ) ) ) ; }


public big decimal get number item ( ) { return number item ; }


returns the { @ code char } nearest in value to { @ code value }

public static char saturated cast ( long value ) { if ( value > character max value ) { return character max value ; } if ( value < character min value ) { return character min value ; } return ( char ) value ; }


public builder set arc enabled ( boolean enabled ) { this arc enabled = enabled ; return this ; }


public delete user oper req spec ( consumer < request spec builder > req spec customizer ) { req spec customizer accept ( req spec ) ; return this ; }


test on the allow engine the evaluation result of all the cel expressions is set to true , so the g r p c authorization returns allow

public void test allow engine with all matched policies ( ) throws interpreter exception { setup engine single rbac allow ( ) ; / / policy 1 - matched ; policy 2 - matched ; policy 3 - matched do return ( true ) when ( spy engine ) matches ( eq ( condition 1 ) , any ( activation class ) ) ; do return ( true ) when ( spy engine ) matches ( eq ( condition 2 ) , any ( activation class ) ) ; do return ( true ) when ( spy engine ) matches ( eq ( condition 3 ) , any ( activation class ) ) ; evaluate result = spy engine evaluate ( args ) ; assert that ( evaluate result get decision ( ) ) is equal to ( authorization decision output allow ) ; assert that ( evaluate result get policy names ( ) ) has size ( 1 ) ; assert that ( evaluate result get policy names ( ) ) contains ( " policy 1 " ) ; }


check if there are any states handles present notice that this can be true even if { @ link # get length ( ) } is greater than zero , because state handles can be null

public boolean is empty ( ) { for ( t state : operator state handles ) { if ( state ! = null ) { return false ; } } return true ; }


decodes lzw image data into pixel array adapted from john cristy ' s bitmap magick

private void decode bitmap data ( gif frame frame ) { if ( frame ! = null ) { / / jump to the frame start position raw data position ( frame buffer frame start ) ; } int npix = ( frame = = null ) ? header width * header height : frame iw * frame ih ; int available , clear , code mask , code size , end of information , in code , old code , bits , code , count , i , datum , data size , first , top , bi , pi ; if ( main pixels = = null | | main pixels length < npix ) { / / allocate new pixel array main pixels = bitmap provider obtain byte array ( npix ) ; } byte [ ] main pixels = this main pixels ; if ( prefix = = null ) { prefix = new short [ max stack size ] ; } short [ ] prefix = this prefix ; if ( suffix = = null ) { suffix = new byte [ max stack size ] ; } byte [ ] suffix = this suffix ; if ( pixel stack = = null ) { pixel stack = new byte [ max stack size + 1 ] ; } byte [ ] pixel stack = this pixel stack ; / / initialize gif data stream decoder data size = read byte ( ) ; clear = 1 < < data size ; end of information = clear + 1 ; available = clear + 2 ; old code = null code ; code size = data size + 1 ; code mask = ( 1 < < code size ) - 1 ; for ( code = 0 ; code < clear ; code + + ) { / / xxx array index out of bounds exception prefix [ code ] = 0 ; suffix [ code ] = ( byte ) code ; } byte [ ] block = this block ; / / decode gif pixel stream i = datum = bits = count = first = top = pi = bi = 0 ; while ( i < npix ) { / / read a new data block if ( count = = 0 ) { count = read block ( ) ; if ( count < = 0 ) { status = status partial decode ; break ; } bi = 0 ; } datum + = ( ( ( int ) block [ bi ] ) & mask int lowest byte ) < < bits ; bits + = 8 ; + + bi ; - - count ; while ( bits > = code size ) { / / get the next code code = datum & code mask ; datum > > = code size ; bits - = code size ; / / interpret the code if ( code = = clear ) { / / reset decoder code size = data size + 1 ; code mask = ( 1 < < code size ) - 1 ; available = clear + 2 ; old code = null code ; continue ; } else if ( code = = end of information ) { break ; } else if ( old code = = null code ) { main pixels [ pi ] = suffix [ code ] ; + + pi ; + + i ; old code = code ; first = code ; continue ; } in code = code ; if ( code > = available ) { pixel stack [ top ] = ( byte ) first ; + + top ; code = old code ; } while ( code > = clear ) { pixel stack [ top ] = suffix [ code ] ; + + top ; code = prefix [ code ] ; } first = ( ( int ) suffix [ code ] ) & mask int lowest byte ; main pixels [ pi ] = ( byte ) first ; + + pi ; + + i ; while ( top > 0 ) { / / pop a pixel off the pixel stack main pixels [ pi ] = pixel stack [ - - top ] ; + + pi ; + + i ; } / / add a new string to the string table if ( available < max stack size ) { prefix [ available ] = ( short ) old code ; suffix [ available ] = ( byte ) first ; + + available ; if ( ( ( available & code mask ) = = 0 ) & & ( available < max stack size ) ) { + + code size ; code mask + = available ; } } old code = in code ; } } / / clear missing pixels arrays fill ( main pixels , pi , npix , ( byte ) color transparent black ) ; }


public int get tree balance ( ) { return m contact manager m broad phase get tree balance ( ) ; }


gets the underlying netty { @ link http 2 stream } for this stream

public http 2 stream http 2 stream ( ) { return http 2 stream ; }


tests the making of a new directory which is not matching to any of internal directory

public void test create new file with out matching to mount dir or fallback dir path ( ) throws exception { configuration conf = new configuration ( ) ; config util add link ( conf , " / user 1 / hive / warehouse / partition - 0 " , new path ( target test root to string ( ) ) to uri ( ) ) ; path fallback target = new path ( target test root , " fallback dir " ) ; fs target mkdirs ( fallback target ) ; config util add link fallback ( conf , fallback target to uri ( ) ) ; try ( file system vfs = file system get ( view fs default cluster uri , conf ) ) { path vfs test file = new path ( " / user 2 / test file " ) ; path test file in fallback = path merge paths ( fallback target , vfs test file ) ; assert false ( fs target exists ( test file in fallback ) ) ; / / user 2 does not exist in fallback assert false ( fs target exists ( test file in fallback get parent ( ) ) ) ; vfs create ( vfs test file ) close ( ) ; / / / user 2 / test file should be created in fallback assert true ( fs target exists ( test file in fallback ) ) ; } }


returns an immutable array containing a single value

public static immutable int array of ( int e 0 ) { return new immutable int array ( new int [ ] { e 0 } ) ; }


create an instance with the given { @ link org springframework messaging simp simp message type }

public static simp message header accessor create ( simp message type message type ) { return new simp message header accessor ( message type , null ) ; }


note : test code must be compiled with " - g " ( debug symbols ) or " - parameters " in order for the parameter name to be used as the qualifier ; otherwise , use { @ code @ qualifier ( " wally " ) }

void autowired parameter with implicit qualifier based on parameter name ( @ autowired person wally ) { assert that ( wally ) as ( " wally should have been @ autowired by spring " ) is not null ( ) ; assert that ( wally get name ( ) ) as ( " person ' s name " ) is equal to ( " wally " ) ; }


returns type variable equivalent to { @ code type }

public static type variable name get ( java lang reflect type variable < ? > type ) { return get ( type , new linked hash map < > ( ) ) ; }


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

set < pet > find pets by tags ( @ param ( " tags " ) set < string > tags ) ;


the passed in { @ link path fragment } s can be associated uniquely to a { @ link file state value } with the following logic ( the same logic that ' s in { @ link containing package lookup function } ) : for each given file path , we look for the nearest ancestor directory ( starting with its parent directory ) , if any , that has a package the { @ link package lookup value } for this package tells us the package root that we should use for the { @ link rooted path } for the { @ link file state value } key for the reverse graph traversal , we are looking for all packages that are transitively reverse dependencies of those { @ link file state value } keys this function returns a collection of sky keys whose transitive reverse dependencies must contain the exact same set of packages note that there may not be nodes in the graph corresponding to the returned sky keys

private static collection < sky key > get sky keys for file fragments ( walkable graph graph , iterable < path fragment > path fragments ) throws interrupted exception { set < sky key > result = new hash set < > ( ) ; multimap < path fragment , path fragment > current to original = array list multimap create ( ) ; for ( path fragment path fragment : path fragments ) { current to original put ( path fragment , path fragment ) ; } while ( ! current to original is empty ( ) ) { multimap < sky key , path fragment > package lookup keys to original = array list multimap create ( ) ; multimap < sky key , path fragment > package lookup keys to current = array list multimap create ( ) ; for ( map entry < path fragment , path fragment > entry : current to original entries ( ) ) { path fragment current = entry get key ( ) ; path fragment original = entry get value ( ) ; for ( sky key package lookup key : get pkg lookup keys for file ( current ) ) { package lookup keys to original put ( package lookup key , original ) ; package lookup keys to current put ( package lookup key , current ) ; } / / the workspace file is a transitive dependency of every package unfortunately , there is / / no specific sky value that we can use to figure out under which package path entries it / / lives so we add a dependency on the workspace name value key if ( original equals ( current ) & & workspace file helper match workspace file name ( original ) ) { / / todo ( mschaller ) : this should not be checked at runtime these are constants ! preconditions check state ( label constants workspace file name get parent directory ( ) equals ( path fragment empty fragment ) , label constants workspace file name ) ; result add ( workspace name value key ( ) ) ; } } map < sky key , sky value > lookup values = graph get successful values ( package lookup keys to original key set ( ) ) ; for ( map entry < sky key , sky value > entry : lookup values entry set ( ) ) { sky key package lookup key = entry get key ( ) ; package lookup value package lookup value = ( package lookup value ) entry get value ( ) ; if ( package lookup value package exists ( ) ) { collection < path fragment > original files = package lookup keys to original get ( package lookup key ) ; preconditions check state ( ! original files is empty ( ) , entry ) ; for ( path fragment file name : original files ) { result add ( file state value key ( rooted path to rooted path ( package lookup value get root ( ) , file name ) ) ) ; } for ( path fragment current : package lookup keys to current get ( package lookup key ) ) { current to original remove all ( current ) ; } } } multimap < path fragment , path fragment > new current to original = array list multimap create ( ) ; for ( path fragment path fragment : current to original key set ( ) ) { path fragment parent = path fragment get parent directory ( ) ; if ( parent ! = null ) { new current to original put all ( parent , current to original get ( path fragment ) ) ; } } current to original = new current to original ; } return result ; }


specifies the window on which the join operation works

public < w extends window > with window < t1 , t2 , key , w > window ( window assigner < ? super tagged union < t1 , t2 > , w > assigner ) { return new with window < > ( input 1 , input 2 , key selector 1 , key selector 2 , key type , assigner , null , null , null ) ; }


signals that the client expected the system under test ( sut ) to report errors use this when you wish to verify that errors are reported and you do not want those errors to fail the test the default value for this setting is false , which means that any errors reported will fail the running test


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


return the set of { @ link property descriptor property descriptors } from the wrapped { @ link bean info } object as well as { @ code property descriptors } for each non - void returning setter method found during construction

public property descriptor [ ] get property descriptors ( ) { return this property descriptors to array ( new property descriptor [ 0 ] ) ; }


public big decimal get number ( ) { return number ; }


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


test the audit log format for failure events with the various parameters

private void test failure log format ( boolean check i p ) { test failure log format helper ( check i p , null , null , null ) ; test failure log format helper ( check i p , appid , null , null ) ; test failure log format helper ( check i p , null , null , containerid ) ; test failure log format helper ( check i p , null , attemptid , null ) ; test failure log format helper ( check i p , appid , attemptid , null ) ; test failure log format helper ( check i p , appid , null , containerid ) ; test failure log format helper ( check i p , null , attemptid , containerid ) ; test failure log format helper ( check i p , appid , attemptid , containerid ) ; test failure log format helper ( check i p , appid , attemptid , containerid , new caller context builder ( null ) set signature ( null ) build ( ) , resource ) ; test failure log format helper ( check i p , appid , attemptid , containerid , new caller context builder ( caller context ) set signature ( null ) build ( ) , resource ) ; test failure log format helper ( check i p , appid , attemptid , containerid , new caller context builder ( null ) set signature ( caller signature ) build ( ) , resource ) ; test failure log format helper ( check i p , appid , attemptid , containerid , new caller context builder ( caller context ) set signature ( caller signature ) build ( ) , resource ) ; test failure log format helper ( check i p , appid , attemptid , containerid , new caller context builder ( caller context ) set signature ( caller signature ) build ( ) , resource , queue , null , null ) ; test failure log format helper ( check i p , appid , attemptid , containerid , new caller context builder ( caller context ) set signature ( caller signature ) build ( ) , resource , queue , partition , null ) ; r m audit logger args builder args = new r m audit logger args builder ( ) append ( keys queuename , queue ) append ( keys recursive , " true " ) ; test failure log format helper ( check i p , null , null , null , null , null , null , null , args ) ; }


sets the is status bar theme of this m t config object

public void set status bar theme ( final boolean is status bar theme ) { status bar theme = is status bar theme ; }


test if two < code > object < code > s are equal using their < code > equals < code > method

public equals builder append ( object lhs , object rhs ) { if ( ! is equals ) { return this ; } if ( lhs = = rhs ) { return this ; } if ( lhs = = null | | rhs = = null ) { this set equals ( false ) ; return this ; } class < ? > lhs class = lhs get class ( ) ; if ( ! lhs class is array ( ) ) { if ( lhs instanceof java math big decimal & & rhs instanceof java math big decimal ) { is equals = ( ( ( java math big decimal ) lhs ) compare to ( ( java math big decimal ) rhs ) = = 0 ) ; } else { / / the simple case , not an array , just test the element is equals = lhs equals ( rhs ) ; } } else if ( lhs get class ( ) ! = rhs get class ( ) ) { / / here when we compare different dimensions , for example : a boolean [ ] [ ] to a boolean [ ] this set equals ( false ) ; / / ' switch ' on type of array , to dispatch to the correct handler / / this handles multi dimensional arrays of the same depth } else if ( lhs instanceof long [ ] ) { append ( ( long [ ] ) lhs , ( long [ ] ) rhs ) ; } else if ( lhs instanceof int [ ] ) { append ( ( int [ ] ) lhs , ( int [ ] ) rhs ) ; } else if ( lhs instanceof short [ ] ) { append ( ( short [ ] ) lhs , ( short [ ] ) rhs ) ; } else if ( lhs instanceof char [ ] ) { append ( ( char [ ] ) lhs , ( char [ ] ) rhs ) ; } else if ( lhs instanceof byte [ ] ) { append ( ( byte [ ] ) lhs , ( byte [ ] ) rhs ) ; } else if ( lhs instanceof double [ ] ) { append ( ( double [ ] ) lhs , ( double [ ] ) rhs ) ; } else if ( lhs instanceof float [ ] ) { append ( ( float [ ] ) lhs , ( float [ ] ) rhs ) ; } else if ( lhs instanceof boolean [ ] ) { append ( ( boolean [ ] ) lhs , ( boolean [ ] ) rhs ) ; } else { / / not an array of primitives append ( ( object [ ] ) lhs , ( object [ ] ) rhs ) ; } return this ; }


protected void record commit failure ( long duration , throwable error ) { task metrics group record commit ( duration , error ) ; }


true if the connector only supports write statements in independent transactions

default boolean is single statement writes only ( ) { return false ; }


return true if this method call does need to be synced , false otherwise sync meaning server state needs to have caught up with client state

boolean is coordinated call ( string protocol name , string method ) ;


returns all nodes in this graph adjacent to { @ code node } which can be reached by traversing { @ code node } ' s outgoing edges in the direction ( if any ) of the edge this is not the same as " all nodes reachable from { @ code node } by following outgoing edges " for that functionality , see { @ link graphs # reachable nodes ( graph , object ) } some algorithms that operate on a { @ code successors function } may produce undesired results if the returned { @ link iterable } contains duplicate elements implementations of such algorithms should document their behavior in the presence of duplicates the elements of the returned { @ code iterable } must each be : non - null usable as { @ code map } keys ( see the guava user guide ' s section on < a href = " https : github comgoogleguavawiki graphs explained # graph - elements - nodes - and - edges " > graph elements for details )

iterable < ? extends n > successors ( n node ) ;


returns the value of the option denoted by { @ code key }

public < t > t get ( key < t > key ) { @ suppress warnings ( " unchecked " ) / / safe , if key names are unique t v = ( t ) map get ( key name ) ; return v ! = null ? v : key default value ; }


public static < t > weak set < t > create copy on write weak set ( ) { return new copy on write weak set < t > ( ) ; }


set an external quartz { @ link scheduler factory } instance to use default is an internal { @ link std scheduler factory } instance if this method is called , it overrides any class specified through { @ link # set scheduler factory class } as well as any settings specified through { @ link # set config location } , { @ link # set quartz properties } , { @ link # set task executor } or { @ link # set data source } < b > note : < b > with an externally provided { @ code scheduler factory } instance , local settings such as { @ link # set config location } or { @ link # set quartz properties } will be ignored here in { @ code scheduler factory bean } , expecting the external { @ code scheduler factory } instance to get initialized on its own

public void set scheduler factory ( scheduler factory scheduler factory ) { this scheduler factory = scheduler factory ; }


void set font metrics ( font metrics fm ) { this fm = fm ; for ( int i = 0 ; i < view list size ( ) ; i + + ) { byte viewer component c = view list get ( i ) ; c set font metrics ( fm ) ; } index factory = new index field factory ( fm ) ; int char width = fm char width ( ' w ' ) ; index factory set start x ( char width ) ; index panel width = byte viewer component provider default number of chars * char width + ( 2 * char width ) ; if ( blocks ! = null ) { index panel width = get index panel width ( blocks ) ; } index factory set index map ( index map , index panel width ) ; index panel model size changed ( index mapper identity mapper ) ; }


hashes ( v2 ) { @ link string } , using unsigned 3 2 bit mod , which the user should ensure is < = 0xffffffff returns an unsigned integer value ( 32 - bit ) returned as a long

public long hash ( string string , long unsigned 3 2 bit mod ) throws pdb exception { byte [ ] bytes = string get bytes ( ) ; pdb byte reader reader = new pdb byte reader ( bytes ) ; int count = bytes length ; long hash = 0xb 1 7 0a 1bf l ; / / represents unsigned 32 - bit while ( count > = 4 ) { count - = 4 ; hash + = reader parse unsigned int val ( ) ; hash + = ( hash < < 10 ) ; hash ^ = ( hash > > 6 ) ; } / / hash remaining bytes while ( reader has more ( ) ) { hash + = reader parse unsigned byte val ( ) ; hash + = ( hash < < 10 ) ; hash ^ = ( hash > > 6 ) ; } / / mask down to 32 - bits hash & = 0xffffffff ; / / apply modulus return hash unsigned 3 2 bit ( hash ) % unsigned 3 2 bit mod ; }


gets called when the user clicks on the cancel action for the dialog

protected void cancel callback ( ) { close ( ) ; }


test that the sort builder mode gets transferred correctly to the sort field

public void test multi value mode ( ) throws i o exception { query shard context shard context mock = create mock shard context ( ) ; geo distance sort builder geo distance sort builder = new geo distance sort builder ( " field name " , 1 0 , 1 0 ) ; geo distance sort builder sort mode ( sort mode max ) ; sort field sort field = geo distance sort builder build ( shard context mock ) field ; assert that ( sort field get comparator source ( ) , instance of ( x field comparator source class ) ) ; x field comparator source comparator source = ( x field comparator source ) sort field get comparator source ( ) ; assert equals ( multi value mode max , comparator source sort mode ( ) ) ; / / also use multi value mode max if no mode set but order is desc geo distance sort builder = new geo distance sort builder ( " field name " , 1 0 , 1 0 ) ; geo distance sort builder order ( sort order desc ) ; sort field = geo distance sort builder build ( shard context mock ) field ; assert that ( sort field get comparator source ( ) , instance of ( x field comparator source class ) ) ; comparator source = ( x field comparator source ) sort field get comparator source ( ) ; assert equals ( multi value mode max , comparator source sort mode ( ) ) ; / / use multi value mode min if no mode and order is asc geo distance sort builder = new geo distance sort builder ( " field name " , 1 0 , 1 0 ) ; / / need to use distance unit other than meters to not get back a lat lon point sort field geo distance sort builder order ( sort order asc ) unit ( distance unit inch ) ; sort field = geo distance sort builder build ( shard context mock ) field ; assert that ( sort field get comparator source ( ) , instance of ( x field comparator source class ) ) ; comparator source = ( x field comparator source ) sort field get comparator source ( ) ; assert equals ( multi value mode min , comparator source sort mode ( ) ) ; geo distance sort builder = new geo distance sort builder ( " field name " , 1 0 , 1 0 ) ; / / need to use distance unit other than meters to not get back a lat lon point sort field geo distance sort builder sort mode ( sort mode min ) unit ( distance unit inch ) ; sort field = geo distance sort builder build ( shard context mock ) field ; assert that ( sort field get comparator source ( ) , instance of ( x field comparator source class ) ) ; comparator source = ( x field comparator source ) sort field get comparator source ( ) ; assert equals ( multi value mode min , comparator source sort mode ( ) ) ; geo distance sort builder sort mode ( sort mode avg ) ; sort field = geo distance sort builder build ( shard context mock ) field ; assert that ( sort field get comparator source ( ) , instance of ( x field comparator source class ) ) ; comparator source = ( x field comparator source ) sort field get comparator source ( ) ; assert equals ( multi value mode avg , comparator source sort mode ( ) ) ; geo distance sort builder sort mode ( sort mode median ) ; sort field = geo distance sort builder build ( shard context mock ) field ; assert that ( sort field get comparator source ( ) , instance of ( x field comparator source class ) ) ; comparator source = ( x field comparator source ) sort field get comparator source ( ) ; assert equals ( multi value mode median , comparator source sort mode ( ) ) ; }


sets the number of times to repeat serialization and deserialization

public serialization tester set repetitions ( int repetitions ) { this repetitions = repetitions ; return this ; }


execute a query given static sql , mapping a single result row to a result object via a row mapper uses a jdbc statement , not a prepared statement if you want to execute a static query with a prepared statement , use the overloaded { @ link # query for object ( string , row mapper , object ) } method with { @ code null } as argument array

< t > t query for object ( string sql , row mapper < t > row mapper ) throws data access exception ;


returns true if inst is an instance of model class in the open a p i model hierarchy the java class hierarchy is not implemented the same way as the open a p i model hierarchy , so it ' s not possible to use the instanceof keyword

public static boolean is instance of ( class < ? > model class , object inst , set < class < ? > > visited classes ) { if ( model class is instance ( inst ) ) { / / this handles the ' all of ' use case with single parent inheritance return true ; } if ( visited classes contains ( model class ) ) { / / this is to prevent infinite recursion when the composed schemas have / / a circular dependency return false ; } visited classes add ( model class ) ; / / traverse the one of / any of composed schemas map < string , generic type > descendants = model descendants get ( model class ) ; if ( descendants ! = null ) { for ( generic type child type : descendants values ( ) ) { if ( is instance of ( child type get raw type ( ) , inst , visited classes ) ) { return true ; } } } return false ; }


public alts server builder direct executor ( ) { delegate direct executor ( ) ; return this ; }


returns a cached thread - local { @ link charset decoder } for the specified { @ link charset }

public static charset decoder decoder ( charset charset ) { check not null ( charset , " charset " ) ; map < charset , charset decoder > map = internal thread local map get ( ) charset decoder cache ( ) ; charset decoder d = map get ( charset ) ; if ( d ! = null ) { d reset ( ) on malformed input ( coding error action replace ) on unmappable character ( coding error action replace ) ; return d ; } d = decoder ( charset , coding error action replace , coding error action replace ) ; map put ( charset , d ) ; return d ; }


a method for clients to use as a callback for completion this method will be called in the swing thread , after the value has been set

public synchronized void done ( ) { / / for clients to override }


public program get program ( ) { return program ref get ( ) ; }


handle the given runtime exception thrown by the cache provider when retrieving an item with the specified { @ code key } , possibly rethrowing it as a fatal exception

void handle cache get error ( runtime exception exception , cache cache , object key ) ;


checks the scale of all types that define a scale implicitly or explicitly

public static boolean has scale ( logical type logical type , int scale ) { return get scale ( logical type ) = = scale ; }


make sure we have ' need ' elements from current position { @ link # p p } last valid { @ code p } index is { @ code data length - 1 } { @ code p + need - 1 } is the char index ' need ' elements ahead if we need 1 element , { @ code ( p + 1 - 1 ) = = p } must be less than { @ code data length }

protected void sync ( int want ) { int need = ( p + want - 1 ) - n + 1 ; / / how many more elements we need ? if ( need > 0 ) { fill ( need ) ; } }


get an iterable over all the possible fillings of the instruction pattern given a context this is meant to be used idiomatically , as in an enhanced for loop : { @ code for ( byte [ ] ins : rcon possible ins vals ( ctx ) ) { system out println ( format ( ins ) ) ; } } this is similar to calling { @ link # get instruction ( ) } { @ link assembly pattern block # possible vals ( ) } , but with forbidden patterns removed a context is required so that only those forbidden patterns matching the given context are actually removed this method should always be preferred to the sequence mentioned above , since { @ link assembly pattern block # possible vals ( ) } on its own may yield bytes that do not produce the desired instruction note : the implementation is based on { @ link assembly pattern block # possible vals ( ) } , so be aware that a single array is reused for each iterate you should not retain a pointer to the array , but rather make a copy

public iterable < byte [ ] > possible ins vals ( assembly pattern block for ctx ) { predicate < byte [ ] > remove forbidden = ( byte [ ] val ) - > { for ( assembly resolved constructor f : forbids ) { / / if the forbidden length is larger than us , we can ignore it if ( f get defined instruction length ( ) > val length ) { continue ; } / / check if the context matches , if not , we can let it pass if ( null = = f get context ( ) combine ( for ctx ) ) { continue ; } / / if the context matches , now check the instruction assembly pattern block i = f get instruction ( ) ; assembly pattern block vi = assembly pattern block from bytes ( ins length ( ) - val length , val ) ; if ( null = = i combine ( vi ) ) { continue ; } return false ; } return true ; } ; return new iterable < byte [ ] > ( ) { @ override public iterator < byte [ ] > iterator ( ) { return iterator utils filtered iterator ( ins possible vals ( ) iterator ( ) , remove forbidden ) ; } } ; }


disconnected from the given node , if not connected , will do nothing

public void disconnect from node ( discovery node node ) { transport connection node channels = connected nodes remove ( node ) ; if ( node channels ! = null ) { / / if we found it and removed it we close node channels close ( ) ; } }


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

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


get and return the record of specified client ip

private static client record get client record ( string client ip ) { client record record = client records get ( client ip ) ; if ( null ! = record ) { return record ; } client record client record = new client record ( client ip ) ; client records put if absent ( client ip , client record ) ; return client record ; }


convert the given object to serialized form , possibly using a { @ link org springframework messaging converter message converter } , wrap it as a message with the given headers , apply the given post processor , and send the resulting message to the given destination

void convert and send ( string destination name , object payload , @ nullable map < string , object > headers , @ nullable message post processor post processor ) throws messaging exception ;


post fakeouternumber test serialization of outer number types

default response entity < big decimal > fake outer number serialize ( @ api param ( value = " input number as post body " ) @ valid @ request body ( required = false ) big decimal body ) { return new response entity < > ( http status not implemented ) ; }


model tests for additional properties any type

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


true if the children for this node have been loaded yet some g tree nodes are lazy in that they don ' t load their children until needed nodes that have the in progress node as it child is considered loaded if in the swing thread , otherwise they are considered not loaded

public synchronized boolean is loaded ( ) { if ( children = = null ) { return false ; } if ( swing is swing thread ( ) ) { return true ; } return ! is in progress ( children ) ; }


public void end phase ( phase phase ) { if ( ! is complete ( ) ) { phases get ( phase ) end time = monotonic now ( ) ; } }


returns whether the most recently returned class name was a recomposed inner class name from a signature

public boolean is inner class name ( ) { return is inner class name ; }


in this method we finally remove the mount item from the drawing pass

void finalise disappearing item ( mount item mount item ) ;


public final cancellable explore async ( graph explore request graph explore request , request options options , action listener < graph explore response > listener ) { return rest high level client perform request async and parse entity ( graph explore request , graph request converters : : explore , options , graph explore response : : from x content , listener , empty set ( ) ) ; }


tests that saslplain clients with invalid password fail authentication

public void test invalid password sasl plain ( ) throws exception { string node = " 0 " ; security protocol security protocol = security protocol sasl ssl ; test jaas config jaas config = configure mechanisms ( " plain " , arrays as list ( " plain " ) ) ; jaas config set client options ( " plain " , test jaas config username , " invalidpassword " ) ; server = create echo server ( security protocol ) ; create and check client authentication failure ( security protocol , node , " plain " , " authentication failed : invalid username or password " ) ; server verify authentication metrics ( 0 , 1 ) ; server verify reauthentication metrics ( 0 , 0 ) ; }


forget all finished downloads , but , doesn ' t delete any file

public void forget finished downloads ( ) { synchronized ( this ) { for ( finished mission mission : m missions finished ) { m finished mission store delete mission ( mission ) ; } m missions finished clear ( ) ; } }


returns whether the legend will draw inside the chart or outside

public boolean is draw inside enabled ( ) { return m draw inside ; }


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


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


stores the users ' selection for how to handle a conflict

public void set conflict resolution ( int option ) { this conflict option = option ; this tag choice = option ; }


initiate the open or select operation this is invoked from both the file system and file context a p is

public completable future < f s data input stream > open file with options ( final path raw path , final open file parameters parameters ) throws i o exception { final path path = qualify ( raw path ) ; configuration options = parameters get options ( ) ; set < string > mandatory keys = parameters get mandatory keys ( ) ; string sql = options get ( select constants select sql , null ) ; boolean is select = sql ! = null ; / / choice of keys depends on open type if ( is select ) { reject unknown mandatory keys ( mandatory keys , internal select constants select options , " for " + path + " in s3 select operation " ) ; } else { reject unknown mandatory keys ( mandatory keys , internal constants standard openfile keys , " for " + path + " in non - select file i / o " ) ; } file status provided status = parameters get status ( ) ; s 3 a file status file status ; if ( provided status ! = null ) { preconditions check argument ( path equals ( provided status get path ( ) ) , " file status parameter is not for the path % s : % s " , path , provided status ) ; if ( provided status instanceof s 3 a file status ) { / / can use this status to skip our own probes , / / including etag and version log debug ( " file was opened with a supplied s 3 a file status ; " + " skipping get file status call in open ( ) operation : { } " , provided status ) ; file status = ( s 3 a file status ) provided status ; } else if ( provided status instanceof s 3 a located file status ) { log debug ( " file was opened with a supplied s 3 a located file status ; " + " skipping get file status call in open ( ) operation : { } " , provided status ) ; file status = ( ( s 3 a located file status ) provided status ) to s 3 a file status ( ) ; } else { log debug ( " ignoring file status { } " , provided status ) ; file status = null ; } } else { file status = null ; } optional < s 3 a file status > ost = optional of nullable ( file status ) ; completable future < f s data input stream > result = new completable future < > ( ) ; if ( ! is select ) { / / normal path unbounded thread pool submit ( ( ) - > lambda utils eval ( result , ( ) - > open ( path , optional of ( options ) , ost ) ) ) ; } else { / / it is a select statement / / fail fast if the operation is not available require select support ( path ) ; / / submit the query unbounded thread pool submit ( ( ) - > lambda utils eval ( result , ( ) - > select ( path , sql , options , ost ) ) ) ; } return result ; }


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


validate a schema with special characters can be deserialized

public void test schema with special characters ( ) throws exception { string str = " { \ " $ special [ property name ] \ " : 12345 } " ; / / the name of the open a p i schema is ' special model name ' / / after sanitization rules are applied the name of the class is ' special model name ' / / the class deserialization should be successful because / / of the @ json sub types annotation special model name o = json get context ( null ) read value ( str , special model name class ) ; assert not null ( o ) ; assert equals ( ( long ) 12345 , ( long ) o get $ special property name ( ) ) ; }