execute the command specified by { @ link # add arguments ( iterable ) }

starlark execution result execute ( ) throws eval exception , interrupted exception { preconditions check argument ( timeout > 0 , " timeout must be set prior to calling execute ( ) " ) ; preconditions check argument ( ! args is empty ( ) , " no command specified " ) ; preconditions check state ( ! executed , " command was already executed , cannot re - use builder " ) ; preconditions check not null ( directory , " directory must be set before calling execute ( ) " ) ; executed = true ; delegating out err delegator = new delegating out err ( ) ; recording out err recorder = new recording out err ( ) ; / / todo ( dmarting ) : if a lot of data is sent to stdout , this will use all the memory and / / bazel will crash maybe we should use custom output streams that throw an appropriate / / exception when reaching a specific size delegator add sink ( recorder ) ; if ( ! quiet ) { delegator add sink ( out err create ( system err , system err ) ) ; } try { string [ ] args array = new string [ args size ( ) ] ; for ( int i = 0 ; i < args size ( ) ; i + + ) { args array [ i ] = args get ( i ) ; } command command = new command ( args array , env builder , directory , duration of millis ( timeout ) ) ; command result result = command execute ( delegator get output stream ( ) , delegator get error stream ( ) ) ; return new starlark execution result ( result get termination status ( ) get exit code ( ) , recorder out as latin 1 ( ) , recorder err as latin 1 ( ) ) ; } catch ( bad exit status exception e ) { return new starlark execution result ( e get result ( ) get termination status ( ) get exit code ( ) , recorder out as latin 1 ( ) , recorder err as latin 1 ( ) ) ; } catch ( abnormal termination exception e ) { termination status status = e get result ( ) get termination status ( ) ; if ( status timed out ( ) ) { / / signal a timeout by an exit code outside the normal range return new starlark execution result ( 256 , " " , e get message ( ) ) ; } else if ( status exited ( ) ) { return new starlark execution result ( status get exit code ( ) , to string ( e get result ( ) get stdout stream ( ) ) , to string ( e get result ( ) get stderr stream ( ) ) ) ; } else if ( status get terminating signal ( ) = = 15 ) { / / we have a bit of a problem here : we cannot distingusih between the case where / / the sigterm was sent by something that the calling rule wants to legitimately handle , / / and the case where it was sent by bazel to abort the build , e g , because something / / else failed / / / / we just assume the latter to correctly handle aborts , accepting that rule authors have / / to write their rules without relying on the ability to handle termination by signal 15 throw new interrupted exception ( ) ; } else { return new starlark execution result ( status get raw exit code ( ) , to string ( e get result ( ) get stdout stream ( ) ) , to string ( e get result ( ) get stderr stream ( ) ) ) ; } } catch ( command exception e ) { / / 256 is outside of the standard range for exit code on unixes we are not guaranteed that / / on all system it would be outside of the standard range return new starlark execution result ( 256 , " " , e get message ( ) ) ; } }


get the value of a field , returning the default value if no value has been set yet and a default value is specified in the field ' s schema because this handles fields of all types , the value is returned as an { @ link object } and must be cast to a more specific type

public object get ( field field ) { object val = values [ field index ( ) ] ; if ( val = = null & & field schema ( ) default value ( ) ! = null ) { val = field schema ( ) default value ( ) ; } return val ; }


public a p itest group parameters request required int 6 4 group ( long required int 6 4 group ) { this required int 6 4 group = required int 6 4 group ; return this ; }


return the number of failed volumes in the f s dataset

public int get num failed volumes ( ) { return volumes get volume failure infos ( ) length ; }


returns an array of data types that make up this data type could return null if there are no subcomponents if this is an array , then only one element will be returned which is the data prototype for the elements in the array will return null if this is a subcomponent that doesn ' t fit in it ' s alloted space

public final data type component [ ] get components ( mem buffer buf ) { return get comps ( buf ) ; }


parse the given value into a days of week { @ code bits cron field } , the sixth entry of a cron expression

public static bits cron field parse days of week ( string value ) { bits cron field result = parse date ( value , type day of week ) ; if ( result get bit ( 0 ) ) { / / cron supports 0 for sunday ; we use 7 like java time result set bit ( 7 ) ; result clear bit ( 0 ) ; } return result ; }


calls { @ link channel handler context # fire channel registered ( ) } to forward to the next { @ link channel inbound handler } in the { @ link channel pipeline } sub - classes may override this method to change behavior

public void channel registered ( channel handler context ctx ) throws exception { ctx fire channel registered ( ) ; }


processes android data ( assets , resources , and manifest ) for android binary targets

public static processed android data process binary data from ( android data context data context , rule error consumer error consumer , stamped android manifest manifest , boolean conditional keep rules , map < string , string > manifest values , android resources resources , android assets assets , resource dependencies resource deps , asset dependencies asset deps , resource filter factory resource filter factory , list < string > no compress extensions , boolean crunch png , data binding context data binding context ) throws rule error exception , interrupted exception { android resources processor builder builder = builder for non incremental top level target ( data context , manifest , manifest values ) set manifest out ( data context create output artifact ( android rule classes android processed manifest ) ) set merged resources out ( data context create output artifact ( android rule classes android resources zip ) ) set main dex proguard out ( android binary create main dex proguard spec ( data context get label ( ) , data context get action construction context ( ) ) ) conditional keep rules ( conditional keep rules ) ; data binding context supply layout info ( builder : : set data binding info zip ) ; return build action for binary ( data context , data binding context , error consumer , builder , manifest , resources , assets , resource deps , asset deps , resource filter factory , no compress extensions , crunch png ) ; }


returns a { @ link query task future } representing the given computation { @ code callable } being performed after the successful completion of the computation encapsulated by the given { @ code future } has completed successfully the returned { @ link query task future } is considered " successful " for purposes of { @ link # when succeeds call } , { @ link # when all succeed } , and { @ link query task future # get if successful } iff { @ code future } is successful and { @ code callable # call } does not throw an exception

< r > query task future < r > when succeeds call ( query task future < ? > future , query task callable < r > callable ) ;


create a { @ link consumer record } with default topic name and { @ code null } - key was well as given value the timestamp will be generated based on the constructor provided start time and time will auto advance

public consumer record < byte [ ] , byte [ ] > create ( final v value ) { return create ( value , new record headers ( ) ) ; }


return whether there currently is an actual transaction active this indicates whether the current thread is associated with an actual transaction rather than just with active transaction synchronization to be called by resource management code that wants to discriminate between active transaction synchronization ( with or without backing resource transaction ; also on propagation supports ) and an actual transaction being active ( with backing resource transaction ; on propagation required , propagation requires new , etc )

public static boolean is actual transaction active ( ) { return ( actual transaction active get ( ) ! = null ) ; }


returns { @ code true } if { @ code x } is exactly equal to { @ code 2 ^ k } for some finite integer { @ code k }

public static boolean is power of two ( double x ) { if ( x > 0 0 & & is finite ( x ) ) { long significand = get significand ( x ) ; return ( significand & ( significand - 1 ) ) = = 0 ; } return false ; }


check queue label expression , check if node label in queue ' s node - label - expression existed in cluster node labels if rm context ! = null

public static boolean check queue label expression ( set < string > queue labels , string label expression , r m context rm context ) { / / if label expression is empty , we can allocate container on any node if ( label expression = = null ) { return true ; } for ( string str : label expression split ( " & & " ) ) { str = str trim ( ) ; if ( ! str trim ( ) is empty ( ) ) { / / check queue label if ( queue labels = = null ) { return false ; } else { if ( ! queue labels contains ( str ) & & ! queue labels contains ( r m node labels manager any ) ) { return false ; } } } } return true ; }


private boolean update memory reservation ( ) { / / operator / driver will be blocked on memory after we call local user memory context set bytes ( ) / / if memory is not available , once we return , this operator will be blocked until memory is available long memory size in bytes = group by hash map ( group by hash : : get estimated size ) or else ( 0l ) + partition row count size of ( ) ; local user memory context set bytes ( memory size in bytes ) ; / / if memory is not available , inform the caller that we cannot proceed for allocation return operator context is waiting for memory ( ) is done ( ) ; }


returns the result of dividing { @ code p } by { @ code q } , rounding using the specified { @ code rounding mode }

public static long divide ( long p , long q , rounding mode mode ) { check not null ( mode ) ; long div = p / q ; / / throws if q = = 0 long rem = p - q * div ; / / equals p % q if ( rem = = 0 ) { return div ; } / * * normal java division rounds towards 0 , consistently with rounding mode down we just have to * deal with the cases where rounding towards 0 is wrong , which typically depends on the sign of * p / q * * signum is 1 if p and q are both nonnegative or both negative , and - 1 otherwise * / int signum = 1 | ( int ) ( ( p ^ q ) > > ( long size - 1 ) ) ; boolean increment ; switch ( mode ) { case unnecessary : check rounding unnecessary ( rem = = 0 ) ; / / fall through case down : increment = false ; break ; case up : increment = true ; break ; case ceiling : increment = signum > 0 ; break ; case floor : increment = signum < 0 ; break ; case half even : case half down : case half up : long abs rem = abs ( rem ) ; long cmp rem to half divisor = abs rem - ( abs ( q ) - abs rem ) ; / / subtracting two nonnegative longs can ' t overflow / / cmp rem to half divisor has the same sign as compare ( abs ( rem ) , abs ( q ) / 2 ) if ( cmp rem to half divisor = = 0 ) { / / exactly on the half mark increment = ( mode = = half up | ( mode = = half even & ( div & 1 ) ! = 0 ) ) ; } else { increment = cmp rem to half divisor > 0 ; / / closer to the up value } break ; default : throw new assertion error ( ) ; } return increment ? div + signum : div ; }


returns a new { @ link wildcard type } with { @ code upper bound }

static wildcard type subtype of ( type upper bound ) { return new wildcard type impl ( new type [ 0 ] , new type [ ] { upper bound } ) ; }


add a built path set map to the provided bundle

private static void add path set map to bundle ( map < string , map < string , string > > path set map , map < string , object > bundle ) { / / we previously built a mapping from path to path id and regular / / expression - see from operation for details sort it and add an / / index , and then add it to the objects that we ' re about to pass to / / the templates to process list < map entry < string , map < string , string > > > path set entry list = new array list ( path set map entry set ( ) ) ; collections sort ( path set entry list , new comparator < map entry < string , map < string , string > > > ( ) { public int compare ( map entry < string , map < string , string > > a , map entry < string , map < string , string > > b ) { return a get value ( ) get ( " path " ) compare to ( b get value ( ) get ( " path " ) ) ; } } ) ; list path set = new array list < map < string , string > > ( ) ; int index = 0 ; for ( map entry < string , map < string , string > > path set entry : path set entry list ) { map < string , string > path set entry value = path set entry get value ( ) ; path set entry value put ( " index " , integer to string ( index ) ) ; index + + ; path set add ( path set entry value ) ; } bundle put ( " path set " , path set ) ; }


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 and send it to the given destination

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


when we load a new patch , we need to rewrite the patch info file but patch info corrupted , we can ' t recover from it

void on patch info corrupted ( file patch file , string old version , string new version ) ;


constructor with empty array has size 0 and contains no elements

public void test constructor empty array ( ) { atomic double array aa = new atomic double array ( new double [ 0 ] ) ; assert equals ( 0 , aa length ( ) ) ; try { aa get ( 0 ) ; fail ( ) ; } catch ( index out of bounds exception success ) { } }


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


returns the name of the current application - level protocol

public string application protocol ( ) { s s l engine engine = engine ( ) ; if ( ! ( engine instanceof application protocol accessor ) ) { return null ; } return ( ( application protocol accessor ) engine ) get negotiated application protocol ( ) ; }


this blits the pixel data from src to dest the destination bitmap must have both a height and a width equal to the source for maximum speed stride should be equal as well both bitmaps must use the same { @ link android graphics bitmap config } format if the src is purgeable , it will be decoded as part of this operation if it was purged the dest should not be purgeable if it is , the copy will still take place , but will be lost the next time the dest gets purged , without warning the dest must be mutable

public static void copy bitmap ( bitmap dest , bitmap src ) { preconditions check argument ( src get config ( ) = = dest get config ( ) ) ; preconditions check argument ( dest is mutable ( ) ) ; preconditions check argument ( dest get width ( ) = = src get width ( ) ) ; preconditions check argument ( dest get height ( ) = = src get height ( ) ) ; native copy bitmap ( dest , dest get row bytes ( ) , src , src get row bytes ( ) , dest get height ( ) ) ; }


when linking a shared library fully or mostly static then we need to link in all dependent files , not just what the shared library needs for its own code this is done by wrapping all objectslibraries with - wl , - whole - archive and - wl , - no - whole - archive for this case the global need whole archive parameter must be set to true otherwise only library objects ( lo ) need to be wrapped with - wl , - whole - archive and - wl , - no - whole - archive todo : factor out of the bazel binary into build variables for crosstool action configs

public collected libraries to link collect libraries to link ( ) { nested set builder < string > library search directories = nested set builder link order ( ) ; nested set builder < string > runtime library search directories = nested set builder link order ( ) ; immutable set builder < string > rpath roots for explicit so deps = immutable set builder ( ) ; nested set builder < linker input > expanded linker inputs builder = nested set builder link order ( ) ; / / list of command line parameters that need to be placed * outside * of / / - - whole - archive - - no - whole - archive sequence builder libraries to link = new sequence builder ( ) ; string toolchain libraries solib name = toolchain libraries solib dir ! = null ? toolchain libraries solib dir get base name ( ) : null ; if ( is native deps & & cpp configuration share native deps ( ) ) { if ( need toolchain libraries rpath ) { runtime library search directories add ( " / " + toolchain libraries solib name + " / " ) ; } } else { / / for all other links , calculate the relative path from the output file to solib [ arch ] / / ( the directory where all shared libraries are stored , which resides under the blaze - bin / / directory in other words , given blaze - bin / my / package / binary , rpath root would be / / " / / solib [ arch ] " if ( need toolchain libraries rpath ) { runtime library search directories add ( strings repeat ( " / " , output artifact get root relative path ( ) segment count ( ) - 1 ) + toolchain libraries solib name + " / " ) ; } if ( is native deps ) { / / we also retain the $ origin / path to solibs that are in solib < arch > , as opposed to / / the package directory ) if ( need toolchain libraries rpath ) { runtime library search directories add ( " / " + toolchain libraries solib name + " / " ) ; } } } if ( need toolchain libraries rpath ) { if ( is native deps ) { runtime library search directories add ( " " ) ; } runtime library search directories add ( toolchain libraries solib name + " / " ) ; } pair < boolean , boolean > include solibs pair = add linker inputs ( library search directories , rpath roots for explicit so deps , libraries to link , expanded linker inputs builder ) ; boolean include solib dir = include solibs pair first ; boolean include toolchain libraries solib dir = include solibs pair second ; preconditions check state ( lto map = = null | | lto map is empty ( ) , " still have lto objects left : % s " , lto map ) ; nested set builder < string > all runtime library search directories = nested set builder link order ( ) ; / / rpath ordering matters for performance ; first add the one where most libraries are found if ( include solib dir ) { all runtime library search directories add ( rpath root ) ; } all runtime library search directories add all ( rpath roots for explicit so deps build ( ) ) ; if ( include toolchain libraries solib dir ) { all runtime library search directories add transitive ( runtime library search directories build ( ) ) ; } return new collected libraries to link ( libraries to link , expanded linker inputs builder build ( ) , library search directories build ( ) , all runtime library search directories build ( ) ) ; }


ensures the given array has a given size

public static int [ ] ensure array size ( int [ ] array , int size , int initial value ) { / / is the existing array large enough ? if ( array length > = size ) { / / reinitialize the existing array arrays fill ( array , 0 , size , initial value ) ; } else { / / otherwise create and initialize a new array array = new int [ size ] ; if ( initial value ! = 0 ) { arrays fill ( array , 0 , size , initial value ) ; } } return array ; }


computes or retrieves the values corresponding to { @ code keys } this method is called by { @ link loading cache # get all } if the returned map doesn ' t contain all requested { @ code keys } then the entries it does contain will be cached , but { @ code get all } will throw an exception if the returned map contains extra keys not present in { @ code keys } then all returned entries will be cached , but only the entries for { @ code keys } will be returned from { @ code get all } this method should be overridden when bulk retrieval is significantly more efficient than many individual lookups note that { @ link loading cache # get all } will defer to individual calls to { @ link loading cache # get } if this method is not overridden

public map < k , v > load all ( iterable < ? extends k > keys ) throws exception { / / this will be caught by get all ( ) , causing it to fall back to multiple calls to / / loading cache get throw new unsupported loading operation exception ( ) ; }


set this body to have fixed rotation this causes the mass to be reset

public void set fixed rotation ( boolean flag ) { jni set fixed rotation ( addr , flag ) ; }


determine the hibernate database dialect class for the given target database

protected class < ? > determine database dialect class ( database database ) { switch ( database ) { case db2 : return d b 2 dialect class ; case derby : return derby ten seven dialect class ; case h2 : return h 2 dialect class ; case hana : return h a n a column store dialect class ; case hsql : return h s q l dialect class ; case informix : return informix 1 0 dialect class ; case mysql : return my s q l 5 7 dialect class ; case oracle : return oracle 1 2c dialect class ; case postgresql : return postgre s q l 9 5 dialect class ; case sql server : return s q l server 2 0 1 2 dialect class ; case sybase : return sybase dialect class ; default : return null ; } }


{ @ link mockito # verify no more interactions ( object ) }


returns all lost input records that will cause the failed action to rewind

private immutable list < lost input record > check if action lost input too many times ( action lookup data action lookup data , action failed action , lost inputs action execution exception lost inputs exception ) throws action execution exception { immutable map < string , action input > lost inputs by digest = lost inputs exception get lost inputs ( ) ; immutable list builder < lost input record > lost input records this action = immutable list builder ( ) ; for ( map entry < string , action input > entry : lost inputs by digest entry set ( ) ) { / / the same action losing the same input more than once is unexpected [ * ] the action should / / have waited until the depended - on action which generates the lost input is ( re ) run before / / trying again / / / / note that we could enforce a stronger check : if action a , which depends on an input n / / previously detected as lost ( by any action , not just a ) , discovers that n is still lost , / / and action a started after the re - evaluation of n ' s generating action , then something has / / gone wrong administering that check would be more complex ( e g , the start / completion / / times of actions would need tracking ) , so we punt on it for now / / / / [ * ] , todo ( b / 123993876 ) : to mitigate a race condition ( believed to be ) caused by / / non - topological skyframe dirtying of depended - on nodes , this check fails the build only if / / the same input is repeatedly lost string digest = entry get key ( ) ; lost input record lost input record = lost input record create ( action lookup data , digest , entry get value ( ) get exec path string ( ) ) ; lost input records this action add ( lost input record ) ; int prior losses = lost input records add ( lost input record , / * occurrences = * / 1 ) ; if ( max repeated lost inputs < = prior losses ) { string message = string format ( " lost input too many times ( # % s ) for the same action lost input : % s , " + " lost input digest : % s , failed action : % 1 0 0 0 0s " , prior losses + 1 , lost inputs by digest get ( digest ) , digest , failed action ) ; bug report send bug report ( new illegal state exception ( message ) ) ; throw create action execution exception ( lost inputs exception , failed action , message , code lost input too many times ) ; } else if ( 0 < prior losses ) { logger at info ( ) log ( " lost input again ( # % s ) for the same action lost input : % s , " + " lost input digest : % s , failed action : % 1 0 0 0 0s " , prior losses + 1 , lost inputs by digest get ( digest ) , digest , failed action ) ; } } return lost input records this action build ( ) ; }


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

public single < client > rx test classname ( client body ) { return single create ( new io vertx rx java single on subscribe adapter < > ( fut - > delegate test classname ( body , fut ) ) ) ; }


return a read - only copy of the configured default uri variables

public map < string , ? > get default uri variables ( ) { return collections unmodifiable map ( this default uri variables ) ; }


set a custom x stream { @ link marshalling strategy } to use

public void set marshalling strategy ( marshalling strategy marshalling strategy ) { this marshalling strategy = marshalling strategy ; }


returns and removes any content that is dependent on the provided message id

public optional < list < signal service content > > retrieve ( @ non null recipient id sender , long sent timestamp ) { return optional from nullable ( cache remove ( new message id ( sender , sent timestamp ) ) ) ; }


set input ( ) takes a custom query and a separate " bounding query " to use instead of the custom " count query " used by d b input format

public static void set input ( job job , class < ? extends d b writable > input class , string input query , string input bounding query ) { d b input format set input ( job , input class , input query , " " ) ; job get configuration ( ) set ( d b configuration input bounding query , input bounding query ) ; job set input format class ( data driven d b input format class ) ; }


the text representation of the primary i pv 4 address associated with this a connection ex 192 168 99 100 absent if unknown

@ nullable public string ipv 4 ( ) { return ipv 4 ; }


should use the client environment ' s temp envvar if tmp is unspecified

public void test rewrite env without client tmp with client temp ( ) throws exception { windows local env provider p = new windows local env provider ( immutable map of ( " temp " , " client - env / temp " ) ) ; assert that ( rewrite env ( p , immutable map of ( " key 1 " , " value 1 " , " tmp " , " ignore " , " temp " , " ignore " ) ) ) is equal to ( immutable map of ( " key 1 " , " value 1 " , " tmp " , " client - env \ \ temp " , " temp " , " client - env \ \ temp " ) ) ; assert that ( rewrite env ( p , immutable map of ( " key 1 " , " value 1 " , " tmp " , " ignore " ) ) ) is equal to ( immutable map of ( " key 1 " , " value 1 " , " tmp " , " client - env \ \ temp " , " temp " , " client - env \ \ temp " ) ) ; assert that ( rewrite env ( p , immutable map of ( " key 1 " , " value 1 " ) ) ) is equal to ( immutable map of ( " key 1 " , " value 1 " , " tmp " , " client - env \ \ temp " , " temp " , " client - env \ \ temp " ) ) ; }


create and return a new { @ link standard servlet environment } subclasses may override this in order to configure the environment or specialize the environment type returned

protected configurable environment create environment ( ) { return new standard servlet environment ( ) ; }


get userlogout : logs out current logged in user session

response entity < void > logout user ( ) ;


execute a closure , expecting an exception verify the metrics after the exception has been caught and validated

public < t , e extends throwable > e intercepting ( class < e > clazz , string text , callable < t > eval , expected probe expected ) throws exception { return exec ( ( ) - > intercept ( clazz , text , eval ) , expected ) ; }


public byte [ ] get vals ( ) { return vals ; }


gets the current y coordinates for the all pointers mutable array is exposed for performance reasons and is not to be modified by the callers

public float [ ] get current y ( ) { return m current y ; }


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


avoid using read object , always try to pass the target class type for the data you want to read

public object read object ( ) { throw new unsupported operation exception ( " provide the protobuf message type you want to read " ) ; }


tests that the slot request fails if we cannot allocate more resources

public void test slot request with resource allocation failure ( ) throws exception { final resource manager id resource manager id = resource manager id generate ( ) ; final resource profile resource profile = resource profile from resources ( 42 0 , 1337 ) ; final slot request slot request = new slot request ( new job i d ( ) , new allocation i d ( ) , resource profile , " localhost " ) ; resource actions resource manager actions = new testing resource actions builder ( ) set allocate resource function ( value - > false ) build ( ) ; try ( slot manager slot manager = create slot manager ( resource manager id , resource manager actions ) ) { slot manager register slot request ( slot request ) ; fail ( " the slot request should have failed with a resource manager exception " ) ; } catch ( resource manager exception e ) { / / expected exception } }


list all of the current partition reassignments the following exceptions can be anticipated when calling { @ code get ( ) } on the futures obtained from the returned { @ code list partition reassignments result } : { @ link org apache kafka common errors cluster authorization exception } if the authenticated user doesn ' t have alter access to the cluster { @ link org apache kafka common errors unknown topic or partition exception } if a given topic or partition does not exist { @ link org apache kafka common errors timeout exception } if the request timed out before the controller could list the current reassignments

default list partition reassignments result list partition reassignments ( list partition reassignments options options ) { return list partition reassignments ( optional empty ( ) , options ) ; }


sorts the array of keyed objects by their values of this attribute

public keyed object [ ] to sorted array ( keyed object [ ] keyed objects ) { keyed object [ ] clone = keyed objects clone ( ) ; arrays sort ( clone , new long comparator ( ) ) ; return clone ; }


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


returns whether the device time offset has already been loaded if { @ code false } , use { @ link # initialize ( loader , initialization callback ) } to start the initialization

public static boolean is initialized ( ) { synchronized ( value lock ) { return is initialized ; } }


public void test access ( ) throws exception { assume windows ( ) ; file test file = new file ( test dir , " testfileaccess " ) ; assert true ( test file create new file ( ) ) ; / / validate access read file util set readable ( test file , false ) ; assert false ( native i o windows access ( test file get absolute path ( ) , native i o windows access right access read ) ) ; file util set readable ( test file , true ) ; assert true ( native i o windows access ( test file get absolute path ( ) , native i o windows access right access read ) ) ; / / validate access write file util set writable ( test file , false ) ; assert false ( native i o windows access ( test file get absolute path ( ) , native i o windows access right access write ) ) ; file util set writable ( test file , true ) ; assert true ( native i o windows access ( test file get absolute path ( ) , native i o windows access right access write ) ) ; / / validate access execute file util set executable ( test file , false ) ; assert false ( native i o windows access ( test file get absolute path ( ) , native i o windows access right access execute ) ) ; file util set executable ( test file , true ) ; assert true ( native i o windows access ( test file get absolute path ( ) , native i o windows access right access execute ) ) ; / / validate that access checks work as expected for long paths / / assemble a path longer then 260 chars ( max path ) string test file relative path = " " ; for ( int i = 0 ; i < 15 ; + + i ) { test file relative path + = " testfileaccessfolder \ \ " ; } test file relative path + = " testfileaccess " ; test file = new file ( test dir , test file relative path ) ; assert true ( test file get parent file ( ) mkdirs ( ) ) ; assert true ( test file create new file ( ) ) ; / / validate access read file util set readable ( test file , false ) ; assert false ( native i o windows access ( test file get absolute path ( ) , native i o windows access right access read ) ) ; file util set readable ( test file , true ) ; assert true ( native i o windows access ( test file get absolute path ( ) , native i o windows access right access read ) ) ; / / validate access write file util set writable ( test file , false ) ; assert false ( native i o windows access ( test file get absolute path ( ) , native i o windows access right access write ) ) ; file util set writable ( test file , true ) ; assert true ( native i o windows access ( test file get absolute path ( ) , native i o windows access right access write ) ) ; / / validate access execute file util set executable ( test file , false ) ; assert false ( native i o windows access ( test file get absolute path ( ) , native i o windows access right access execute ) ) ; file util set executable ( test file , true ) ; assert true ( native i o windows access ( test file get absolute path ( ) , native i o windows access right access execute ) ) ; }


sets the transitive set of protos used to produce the generated extension registry

public builder set inputs ( nested set < artifact > inputs ) { this inputs = inputs ; return this ; }


protected void close channel ( channel channel ) { channel close ( ) await uninterruptibly ( ) ; all channels remove ( channel ) ; }


return a savepoint manager for the underlying transaction , if possible default implementation always throws a nested transaction not supported exception

protected savepoint manager get savepoint manager ( ) { throw new nested transaction not supported exception ( " this transaction does not support savepoints " ) ; }


public t left outer join ( string joins ) { sql ( ) left outer join add all ( arrays as list ( joins ) ) ; return get self ( ) ; }


hijack the current instance of this field < b > the instance must not be null at the time of hijacking < b > , or an illegal state exception will be thrown

public void hijack ( final c instance , final interception handler < ? > handler ) { final object delegatee = get ( instance ) ; if ( delegatee = = null ) throw new illegal state exception ( " cannot hijack null " ) ; final class < ? > [ ] interfaces = delegatee get class ( ) get interfaces ( ) ; set ( instance , interception proxy ( delegatee , handler , interfaces ) ) ; }


default : null an array of { @ link configuration } objects that will overlay the global mini d f s cluster configuration for the corresponding data node useful for setting specific per - data node configuration parameters

public builder data node conf overlays ( configuration [ ] dn conf overlays ) { this dn conf overlays = dn conf overlays ; return this ; }


returns the serializer for the keys in the map

public type serializer < k > get key serializer ( ) { return key serializer ; }


a filter for iterable < ? extends has file type > that returns only those of the specified file type

public static < t extends has file type > iterable < t > filter ( final iterable < t > items , file type file type ) { return iterables filter ( items , type matching predicate for ( file type ) ) ; }


test result new cached test result ( path exec root , test runner action action , test result data cached ) throws i o exception ;


returns whether this integer value is less than or equal to the given unknown integer value : < code > never < code > , < code > maybe < code > , or < code > always < code >

public int less than or equal ( unknown integer value other ) { return less than or equal ( ( integer value ) other ) ; }


build a { @ link send } for direct transmission of the provided response over the network

public send build response send ( abstract response body ) { return body to send ( header to response header ( ) , api version ( ) ) ; }


converts a list of numbers to a literal union for representing enum values as a type example output : 3 | 9 | 55

protected string numeric enum values to enum type union ( list < number > values ) { list < string > string values = new array list < > ( ) ; for ( number value : values ) { string values add ( value to string ( ) ) ; } return enum values to enum type union ( string values , " number " ) ; }


called by internal mechanisms , do not call yourself

public void set dao session ( dao session dao session ) { this dao session = dao session ; my dao = dao session ! = null ? dao session get tree entity dao ( ) : null ; }


public path get path ( ) { return path ; }


returns a list of tag names the user has entered in the input ` field note : this assumes that multiple entries are comma - delimited

private list < string > get input names ( ) { / / first split the string on the delimiter to get all the entries string [ ] names = tag input field get text ( ) split ( input delimiter ) ; / / trim each item to remove any leading / trailing whitespace and add to the return list list < string > name list = new array list < > ( ) ; for ( string name : names ) { if ( ! string utils is blank ( name ) ) { name list add ( name trim ( ) ) ; } } return name list ; }


appends the node to the tail of the list

public void append to tail ( node head ) { node tail = head prev ; head prev = this ; tail next = this ; next = head ; prev = tail ; }


public static < t > t invoke method ( final object obj , final string method name , final object [ ] args , final class < ? > [ ] parameter types ) { method method = get method ( obj get class ( ) , method name , parameter types ) ; if ( method = = null ) { throw new illegal argument exception ( " could not find method [ " + method name + " ] with parameter types : " + object util to pretty string ( parameter types ) + " on class [ " + obj get class ( ) + ' ] ' ) ; } return invoke method ( obj , method , args ) ; }


returns an { @ link escaper } instance that escapes strings so they can be safely included in < a href = " https : goo glm 2 m if 0 " > url path segments the returned escaper escapes all non - ascii characters , even though < a href = " https : goo gle 7 e 0 in " > many of these are accepted in modern u r ls ( < a href = " https : goo gljf vx x w " > if the escaper were to leave these characters unescaped , they would be escaped by the consumer at parse time , anyway ) additionally , the escaper escapes the slash character ( " " ) while slashes are acceptable in url paths , they are considered by the specification to be separators between " path segments " this implies that , if you wish for your path to contain slashes , you must escape each segment separately and then join them when escaping a string , the following rules apply : the alphanumeric characters " a " through " z " , " a " through " z " and " 0 " through " 9 " remain the same the unreserved characters " " , " - " , " ~ " , and " " remain the same the general delimiters " @ " and " : " remain the same the subdelimiters " ! " , " $ " , " & amp ; " , " ' " , " ( " , " ) " , " " , " + " , " , " , " ; " , and " = " remain the same the space character " " is converted into % 20 all other characters are converted into one or more bytes using utf - 8 encoding and each byte is then represented by the 3 - character string " % xy " , where " xy " is the two - digit , uppercase , hexadecimal representation of the byte value < b > note : < b > unlike other escapers , url escapers produce < a href = " https : url spec whatwg org # percent - encode " > uppercase hexadecimal sequences

public static escaper url path segment escaper ( ) { return url path segment escaper ; }


tests that if the remote end closes connection ungracefully during ssl handshake while reading data , the disconnection is not treated as an authentication failure

public void test ungraceful remote close during handshake read ( args args ) throws exception { server = create echo server ( args , security protocol ssl ) ; test i o exceptions during handshake ( args , server : : close socket channels , failure action no op ) ; }


wraps the given { @ link connection } with a proxy that delegates every method call to it but delegates { @ code close ( ) } calls to { @ link connection factory utils }

protected mono < connection > get transaction aware connection proxy ( connection factory target connection factory ) { return connection factory utils get connection ( target connection factory ) map ( connection - > proxy connection ( connection , target connection factory ) ) ; }


compares the keys , values , headers , and timestamp of two { @ link producer record } ' s and throws an { @ link assertion error } if the keys , values , headers , or timestamps are not equal to each other

public static < k , v > void compare key value headers timestamp ( final producer record < k , v > record , final producer record < k , v > expected record ) throws assertion error { objects require non null ( expected record ) ; compare key value headers timestamp ( record , expected record key ( ) , expected record value ( ) , expected record headers ( ) , expected record timestamp ( ) ) ; }


reconstitute the < tt > concurrent hash map < tt > instance from a stream ( i e , deserialize it )

private void read object ( java io object input stream s ) throws i o exception , class not found exception { / / don ' t call default read object ( ) object input stream get field ois fields = s read fields ( ) ; final segment < k , v > [ ] ois segments = ( segment < k , v > [ ] ) ois fields get ( " segments " , null ) ; final int ssize = ois segments length ; if ( ssize < 1 | | ssize > max segments | | ( ssize & ( ssize - 1 ) ) ! = 0 ) { throw new java io invalid object exception ( " bad number of segments : " + ssize ) ; } int sshift = 0 , ssize tmp = ssize ; while ( ssize tmp > 1 ) { + + sshift ; ssize tmp > > > = 1 ; } unsafe put int volatile ( this , segshift offset , 32 - sshift ) ; unsafe put int volatile ( this , segmask offset , ssize - 1 ) ; unsafe put object volatile ( this , segments offset , ois segments ) ; / / set hash mask unsafe put int volatile ( this , hashseed offset , random hash seed ( this ) ) ; / / re - initialize segments to be minimally sized , and let grow int cap = min segment table capacity ; final segment < k , v > [ ] segments = this segments ; for ( int k = 0 ; k < segments length ; + + k ) { segment < k , v > seg = segments [ k ] ; if ( seg ! = null ) { seg threshold = ( int ) ( cap * seg load factor ) ; seg table = new hash entry [ cap ] ; } } / / read the keys and values , and put the mappings in the table for ( ; ; ) { k key = ( k ) s read object ( ) ; v value = ( v ) s read object ( ) ; if ( key = = null ) { break ; } put ( key , value ) ; } }


does additional work required when placing an instance the default implementation of this method is a no - op if a particular class needs to do something special , then it should override this method in particular , if this instance did not know its write size up - front , then this method is responsible for setting it

protected void place 0 ( section added to , int offset ) { / / this space intentionally left blank }


localize the given job conf to be specific for this task

public void localize configuration ( job conf conf ) throws i o exception { conf set ( job context task id , task id get task i d ( ) to string ( ) ) ; conf set ( job context task attempt id , task id to string ( ) ) ; conf set boolean ( job context task ismap , is map task ( ) ) ; conf set int ( job context task partition , partition ) ; conf set ( job context id , task id get job i d ( ) to string ( ) ) ; }


clear associated models ' save state after this method , the associated models of base obj which data is removed from database will become unsaved

private void clear associated model save state ( lite pal support base obj , collection < associations info > association infos ) { try { for ( associations info association info : association infos ) { if ( association info get association type ( ) = = const model many to one & & ! base obj get class name ( ) equals ( association info get class holds foreign key ( ) ) ) { collection < lite pal support > associated models = get associated models ( base obj , association info ) ; if ( associated models ! = null & & ! associated models is empty ( ) ) { for ( lite pal support model : associated models ) { if ( model ! = null ) { model clear saved state ( ) ; } } } } else if ( association info get association type ( ) = = const model one to one ) { lite pal support model = get associated model ( base obj , association info ) ; if ( model ! = null ) { model clear saved state ( ) ; } } } } catch ( exception e ) { throw new lite pal support exception ( e get message ( ) , e ) ; } }


return the { @ link cache resolver } bean to use to resolve regular caches for annotation - driven cache management this is an alternative and more powerful option of specifying the { @ link cache manager } to use if both a { @ link # cache manager ( ) } and { @ code # cache resolver ( ) } are set , the cache manager is ignored implementations must explicitly declare { @ link org springframework context annotation bean @ bean } , e g < pre class = " code " > & # 064 ; configuration & # 064 ; enable caching public class app config extends caching configurer support { & # 064 ; bean important ! & # 064 ; override public cache resolver cache resolver ( ) { configure and return cache resolver instance } } see { @ link enable caching } for more complete examples


sets the timeout for re - issuing a block recovery

public void set block recovery timeout ( long timeout ) { for ( int nn index = 0 ; nn index < get num name nodes ( ) ; nn index + + ) { get namesystem ( nn index ) get block manager ( ) set block recovery timeout ( timeout ) ; } }


public void check block ( extended block b , long min length , replica state state ) throws replica not found exception , unexpected replica state exception , file not found exception , e o f exception , i o exception { final replica info replica info = volume map get ( b get block pool id ( ) , b get local block ( ) ) ; if ( replica info = = null ) { throw new replica not found exception ( b ) ; } if ( replica info get state ( ) ! = state ) { throw new unexpected replica state exception ( b , state ) ; } if ( ! replica info block data exists ( ) ) { throw new file not found exception ( replica info get block u r i ( ) to string ( ) ) ; } long on disk length = get length ( b ) ; if ( on disk length < min length ) { throw new e o f exception ( b + " ' s on - disk length " + on disk length + " is shorter than min length " + min length ) ; } }


add the given { @ code response cookie }

void add cookie ( response cookie cookie ) ;


indicates whether some other object is " equal to " this one

public boolean equals ( object obj ) { if ( this = = obj ) { return true ; } if ( obj = = null | | get class ( ) ! = obj get class ( ) ) { return false ; } memory byte block mb = ( memory byte block ) obj ; return block = = mb block ; }


adds all elements in { @ code iterator } to { @ code collection } the iterator will be left exhausted : its { @ code has next ( ) } method will return { @ code false }

public static < t > boolean add all ( collection < t > add to , iterator < ? extends t > iterator ) { check not null ( add to ) ; check not null ( iterator ) ; boolean was modified = false ; while ( iterator has next ( ) ) { was modified | = add to add ( iterator next ( ) ) ; } return was modified ; }


whether the underlying operation is deferred and needs to be started explicitly , e g via subscribing ( or similar ) , or whether it is triggered without the consumer having any control

public boolean is deferred ( ) { return this deferred ; }


to - many relationship , resolved on first access ( and after reset ) changes to to - many relations are not persisted , make changes to the target entity

public list < order > get orders ( ) { if ( orders = = null ) { final dao session dao session = this dao session ; if ( dao session = = null ) { throw new dao exception ( " entity is detached from dao context " ) ; } order dao target dao = dao session get order dao ( ) ; list < order > orders new = target dao query customer orders ( id ) ; synchronized ( this ) { if ( orders = = null ) { orders = orders new ; } } } return orders ; }


public string value ( ) { return value ; }


static block factory create factory ( final o b s file system owner , final string name ) { switch ( name ) { case o b s constants fast upload buffer array : return new byte array block factory ( owner ) ; case o b s constants fast upload buffer disk : return new disk block factory ( owner ) ; case o b s constants fast upload bytebuffer : return new byte buffer block factory ( owner ) ; default : throw new illegal argument exception ( " unsupported block buffer " + " \ " " + name + ' " ' ) ; } }


template method for obtaining a ( potentially cached ) session the default implementation always returns { @ code null } subclasses may override this for exposing specific session handles , possibly delegating to { @ link # create session } for the creation of raw session objects that will then get wrapped and returned from here

protected session get session ( connection con , integer mode ) throws j m s exception { return null ; }


reads the short at the current index and then increments the current index by < code > sizeof short < code >

public short read next short ( ) throws i o exception { short s = read short ( current index ) ; current index + = sizeof short ; return s ; }


void encode h ( ) { if ( encode initial silent h ( ) | | encode initial hs ( ) | | encode initial hu hw ( ) | | encode non initial silent h ( ) ) { return ; } / / only keep if first & before vowel or btw 2 vowels if ( ! encode h pronounced ( ) ) { / / also takes care of ' hh ' m current + + ; } }


public void write ( byte [ ] b , int off , int len ) throws i o exception { sum update ( b , off , len ) ; out write ( b , off , len ) ; }


public boolean get bool item ( ) { return bool item ; }


retrieves , but does not remove , the head of the queue represented by this deque ( in other words , the first element of this deque ) this method differs from { @ link # peek peek } only in that it throws an exception if this deque is empty this method is equivalent to { @ link # get first ( ) }


implicit coercions are added when mapping an expression to symbol in { @ link translation map } coercions for expression are obtained from { @ link analysis } by identity comparison create a copy of subquery in order to get a subquery expression that does not have any coercion assigned to it { @ link analysis }

private subquery expression uncoerced subquery ( subquery expression subquery ) { return new subquery expression ( subquery get query ( ) ) ; }


public void dump tree recursively ( print writer out , string builder prefix , int snapshot id ) { out print ( prefix ) ; out print ( " " ) ; final string name = get local name ( ) ; out print ( name is empty ( ) ? " / " : name ) ; out print ( " ( " ) ; out print ( get object string ( ) ) ; out print ( " ) , " ) ; out print ( get parent string ( ) ) ; out print ( " , " + get permission status ( snapshot id ) ) ; }


returns a range that contains all bytes of the target range which are absent ( possibly pending ) the returned range may include some ranges of present bytes it tries to return the smallest possible range , but does so on a best - effort basis this method does not acquire anything , which means that another thread may concurrently fill in some of the returned range

public tuple < long , long > get absent range within ( final long start , final long end ) { synchronized ( mutex ) { / / find the first absent byte in the range final sorted set < range > start ranges = ranges head set ( new range ( start , start , null ) , true ) ; / / ranges which start < = ' start ' long result start ; if ( start ranges is empty ( ) ) { result start = start ; } else { final range last start range = start ranges last ( ) ; / / last range which starts < = ' start ' and which therefore may contain the first byte of the range if ( last start range end < start ) { result start = start ; } else if ( last start range is pending ( ) ) { result start = start ; } else { result start = last start range end ; } } assert result start > = start ; / / find the last absent byte in the range final sorted set < range > end ranges = ranges head set ( new range ( end , end , null ) , false ) ; / / ranges which start < ' end ' final long result end ; if ( end ranges is empty ( ) ) { result end = end ; } else { final range last end range = end ranges last ( ) ; / / last range which starts < ' end ' and which therefore may contain the last byte of the range if ( last end range end < end ) { result end = end ; } else if ( last end range is pending ( ) ) { result end = end ; } else { result end = last end range start ; } } assert result end < = end ; return result start < result end ? tuple tuple ( result start , result end ) : null ; } }


resolves the method in the given type hierarchy

public final hierarchical type query in type hierarchy ( type hierarchy type hierarchy ) { return type hierarchy query ( this ) ; }


save the symbol description as a tag to the xml stream this does not save the mappings

public void save x m l ( string builder buf ) { buf append ( " < symbol " ) ; save x m l header ( buf ) ; buf append ( " > \ n " ) ; buf append ( dtmanage build type ref ( type , get size ( ) ) ) ; buf append ( " < / symbol > \ n " ) ; }


creates a user agent prefix for flink this can be used by http clients

public static string format flink user agent prefix ( ) { return string format ( user agent format , environment information get version ( ) , environment information get revision information ( ) commit id ) ; }


set the path to the sequence file storing the sorted partition keyset it must be the case that for < tt > r < tt > reduces , there are < tt > r - 1 < tt > keys in the sequence file

public static void set partition file ( configuration conf , path p ) { conf set ( partitioner path , p to string ( ) ) ; }


copies all of the mappings from the specified map to this map these mappings will replace any mappings that this map had for any of the keys currently in the specified map

public void put all ( long key map < value > t ) { / / expand enough to hold t ' s elements without resizing int n = t size ( ) ; if ( n = = 0 ) return ; if ( n > = threshold ) { n = ( int ) ( n / load factor + 1 ) ; if ( n > maximum capacity ) n = maximum capacity ; int capacity = table length ; while ( capacity < n ) capacity < < = 1 ; resize ( capacity ) ; } for ( iterator < long entry < value > > i = t entry set ( ) iterator ( ) ; i has next ( ) ; ) { long entry < value > e = i next ( ) ; put ( e key , e value ) ; } }


uses the given scanner on ' this ' directory to list up files and then archive it to a tar stream

public int tar ( output stream out , dir scanner scanner ) throws i o exception , interrupted exception { return archive ( archiver factory tar , out , scanner ) ; }


makes sure that every path starts with a " "

private static string normalize path ( string path ) { if ( path starts with ( " / " ) ) { return path ; } else { return ' / ' + path ; } }


check validity of aggregate group by this rule is needed for multiple reasons : 1 a user might specify an invalid aggregate ( select foo group by bar ) 2 the order byhaving might contain a non - grouped attribute this is typically caught by the analyzer however if wrapped in a function ( abs ( ) ) it gets resolved ( because the expression gets resolved little by little without being pushed down , without the analyzer modifying anything 2a having also requires an aggregate function 3 composite agg ( used for group by ) allows ordering only on the group keys

private static boolean check group by ( logical plan p , set < failure > local failures , attribute map < expression > attribute refs , set < logical plan > grouping failures ) { return check group by inexact field ( p , local failures ) & & check group by agg ( p , local failures , attribute refs ) & & check group by order ( p , local failures , grouping failures , attribute refs ) & & check group by having ( p , local failures , grouping failures , attribute refs ) & & check group by time ( p , local failures ) ; }


< code > optional second msg blah = 2 ; < code >

private com google protobuf single field builder < org springframework protobuf second msg , org springframework protobuf second msg builder , org springframework protobuf second msg or builder > get blah field builder ( ) { if ( blah builder = = null ) { blah builder = new com google protobuf single field builder < > ( blah , get parent for children ( ) , is clean ( ) ) ; blah = null ; } return blah builder ; }


adds the given element value to the target

public void add element value ( element value element value ) { / / what ' s the target ? if ( target annotation ! = null ) { / / try to replace an existing element value if ( ! replace element values | | ! replace element value ( target annotation u 2element values count , target annotation element values , element value ) ) { / / otherwise append the element value target annotation element values = add element value ( target annotation u 2element values count , target annotation element values , element value ) ; target annotation u 2element values count + + ; } } else { / / try to replace an existing element value if ( ! replace element values | | ! replace element value ( target array element value u 2element values count , target array element value element values , element value ) ) { / / otherwise append the element value target array element value element values = add element value ( target array element value u 2element values count , target array element value element values , element value ) ; target array element value u 2element values count + + ; } } }


returns the first queue item if the owner is scheduled for execution in the queue

public item get queued item ( ) { return jenkins get ( ) get queue ( ) get item ( owner ) ; }


append specified length of bytes to a given file

private static void append file ( path p , int length ) throws i o exception { byte [ ] to append = new byte [ length ] ; random random = new random ( ) ; random next bytes ( to append ) ; f s data output stream out = cluster get file system ( ) append ( p ) ; try { out write ( to append ) ; } finally { i o utils close stream ( out ) ; } }


returns addresses for the given interface ( it must be marked up )

static inet address [ ] get addresses for interface ( string setting value , string suffix , string interface name ) throws socket exception { optional < network interface > network interface = maybe get interface by name ( get interfaces ( ) , interface name ) ; if ( network interface is present ( ) = = false ) { throw new illegal argument exception ( " setting [ " + setting value + " ] matched no network interfaces ; valid values include [ " + get interfaces ( ) stream ( ) map ( other interface - > " " + other interface get name ( ) + suffix + " " ) collect ( collectors joining ( " , " ) ) + " ] " ) ; } if ( ! network interface get ( ) is up ( ) ) { throw new illegal argument exception ( " setting [ " + setting value + " ] matched network interface [ " + network interface get ( ) get name ( ) + " ] but this interface is not up and running " ) ; } list < inet address > list = collections list ( network interface get ( ) get inet addresses ( ) ) ; if ( list is empty ( ) ) { throw new illegal argument exception ( " setting [ " + setting value + " ] matched network interface [ " + network interface get ( ) get name ( ) + " ] but this interface has no internet addresses " ) ; } return list to array ( new inet address [ list size ( ) ] ) ; }


reads this file from the specific offset

public input stream read from offset ( final long offset ) throws i o exception , interrupted exception { if ( channel = = null ) { final random access file raf = new random access file ( new file ( remote ) , " r " ) ; try { raf seek ( offset ) ; } catch ( i o exception e ) { try { raf close ( ) ; } catch ( i o exception e 1 ) { / / ignore } throw e ; } return new input stream ( ) { @ override public int read ( ) throws i o exception { return raf read ( ) ; } @ override public void close ( ) throws i o exception { raf close ( ) ; } @ override public int read ( byte [ ] b , int off , int len ) throws i o exception { return raf read ( b , off , len ) ; } @ override public int read ( byte [ ] b ) throws i o exception { return raf read ( b ) ; } } ; } final pipe p = pipe create remote to local ( ) ; act async ( new offset pipe secure file callable ( p , offset ) ) ; return new java util zip g z i p input stream ( p get in ( ) ) ; }


public boolean get bool item ( ) { return bool item ; }


for all expanded descendants in source node , expand the corresponding nodes in dest node

void match expansion state ( program node source node , program node dest node ) { if ( ! source node get allows children ( ) ) { return ; } if ( ! dest node was visited ( ) ) { visit node ( dest node ) ; } if ( is expanded ( source node get tree path ( ) ) ) { expand path ( dest node get tree path ( ) ) ; } int nchild = source node get child count ( ) ; for ( int i = 0 ; i < nchild ; i + + ) { program node s node = ( program node ) source node get child at ( i ) ; if ( ! s node get allows children ( ) ) { continue ; } program node d node = ( program node ) dest node get child at ( i ) ; if ( is expanded ( s node get tree path ( ) ) ) { expand path ( d node get tree path ( ) ) ; } match expansion state ( s node , d node ) ; } }


starts new mocking session ! creates new { @ code mockito session } instance to initialize the session at this point annotated fields are initialized per { @ link # init mocks ( object ) } method when you are done with the session it is required to invoke { @ link mockito session # finish mocking ( ) } this will trigger stubbing validation , cleaning up the internal state like removal of internal listeners mockito tracks created sessions internally and prevents the user from creating new sessions without using { @ link mockito session # finish mocking ( ) } when you run tests concurrently in multiple threads , it is legal for each thread to have single active mockito session when you attempt to start new session in a thread that already has an unfinished session { @ link unfinished mocking session exception } will be triggered see examples in { @ link mockito session }

mockito session start mocking ( ) throws unfinished mocking session exception ;


tests basic correctness of buffer - or - event interleaving and correct < code > null < code > return value after receiving all end - of - partition events

public void test basic get next logic ( ) throws exception { / / setup final single input gate input gate = create input gate ( ) ; final test input channel [ ] input channels = new test input channel [ ] { new test input channel ( input gate , 0 ) , new test input channel ( input gate , 1 ) } ; input gate set input channels ( input channels ) ; / / test input channels [ 0 ] read buffer ( ) ; input channels [ 0 ] read buffer ( ) ; input channels [ 1 ] read buffer ( ) ; input channels [ 1 ] read end of partition event ( ) ; input channels [ 0 ] read end of partition event ( ) ; input gate notify channel non empty ( input channels [ 0 ] ) ; input gate notify channel non empty ( input channels [ 1 ] ) ; verify buffer or event ( input gate , true , 0 , true ) ; verify buffer or event ( input gate , true , 1 , true ) ; verify buffer or event ( input gate , true , 0 , true ) ; verify buffer or event ( input gate , false , 1 , true ) ; verify buffer or event ( input gate , false , 0 , false ) ; / / return null when the input gate has received all end - of - partition events assert true ( input gate is finished ( ) ) ; for ( test input channel ic : input channels ) { ic assert returned events are recycled ( ) ; } }


the user will be asked on permission if the feature is tried to access


configures schema to fail when parsing json failed by default , an exception will be thrown when parsing json fails

public builder ignore parse errors ( ) { this ignore parse errors = true ; return this ; }


pushes block of instructions to be executed in this partial evaluator

private void push instruction block ( traced variables variables , traced stack stack , int start offset ) { instruction block stack push ( new my instruction block ( variables , stack , start offset ) ) ; }


see { @ link commit operations # revert commit ( single pending commit , bulk operation state ) }

public void revert commit ( final single pending commit commit ) throws i o exception { commit operations this revert commit ( commit , operation state ) ; }


returns the index for the given key , or - 1 if key is not in the table

public int get ( long key ) { return find key ( key ) ; }


public final int get access flags ( ) { return access flags ; }


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


returns true if this context represents a type that can be null

boolean can be null ( ) { return ! ( type instanceof primitive type ) ; }


public static string req common ( string path , map < string , string > params , string cur server , boolean is post ) throws exception { try { list < string > headers = arrays as list ( " client - version " , utils and commons server version , " user - agent " , utils and commons server version , " accept - encoding " , " gzip , deflate , sdch " , " connection " , " keep - alive " , " content - encoding " , " gzip " ) ; rest result < string > result ; if ( ! i p util contains port ( cur server ) ) { cur server = cur server + i p util ip port spliter + env util get port ( ) ; } if ( is post ) { result = http client http post ( " http : / / " + cur server + env util get context path ( ) + utils and commons nacos naming context + path , headers , params ) ; } else { result = http client http get ( " http : / / " + cur server + env util get context path ( ) + utils and commons nacos naming context + path , headers , params ) ; } if ( result ok ( ) ) { return result get data ( ) ; } if ( http u r l connection http not modified = = result get code ( ) ) { return string utils empty ; } throw new i o exception ( " failed to req api : " + " http : / / " + cur server + env util get context path ( ) + utils and commons nacos naming context + path + " code : " + result get code ( ) + " msg : " + result get message ( ) ) ; } catch ( exception e ) { loggers srv log warn ( " naming proxy " , e ) ; } return string utils empty ; }


returns all the providers of the specified type that are listed under the specified attribute of this target in the build file , and that contain the specified provider

public < c extends info > iterable < ? extends transitive info collection > get prerequisites if ( string attribute name , builtin provider < c > class type ) { return analysis utils filter by provider ( get prerequisites ( attribute name ) , class type ) ; }


convenience method to create a variable matcher which matches against the submitted application ' s name

public static mapping rule matcher create application name matcher ( string name ) { return new variable matcher ( " % application " , name ) ; }


static grouping context group by ( list < ? extends expression > groupings ) { if ( groupings is empty ( ) ) { return null ; } map < integer , group by key > agg map = new linked hash map < > ( ) ; for ( expression exp : groupings ) { group by key key = null ; integer hash = integer value of ( exp hash code ( ) ) ; string agg id = expressions id ( exp ) ; / / change analyzed to non non - analyzed attributes if ( exp instanceof field attribute ) { field attribute field = ( field attribute ) exp ; field = field exact attribute ( ) ; key = new group by value ( agg id , field name ( ) ) ; } / / handle functions else if ( exp instanceof function ) { / / dates are handled differently because of date histograms if ( exp instanceof date time histogram function ) { date time histogram function dthf = ( date time histogram function ) exp ; expression field = dthf field ( ) ; if ( field instanceof field attribute ) { if ( dthf calendar interval ( ) ! = null ) { key = new group by date histogram ( agg id , query translator name of ( exp ) , dthf calendar interval ( ) , dthf zone id ( ) ) ; } else { key = new group by date histogram ( agg id , query translator name of ( exp ) , dthf fixed interval ( ) , dthf zone id ( ) ) ; } } / / use scripting for functions else if ( field instanceof function ) { script template script = ( ( function ) field ) as script ( ) ; if ( dthf calendar interval ( ) ! = null ) { key = new group by date histogram ( agg id , script , dthf calendar interval ( ) , dthf zone id ( ) ) ; } else { key = new group by date histogram ( agg id , script , dthf fixed interval ( ) , dthf zone id ( ) ) ; } } } / / all other scalar functions become a script else if ( exp instanceof scalar function ) { scalar function sf = ( scalar function ) exp ; key = new group by value ( agg id , sf as script ( ) ) ; } / / histogram else if ( exp instanceof grouping function ) { if ( exp instanceof histogram ) { histogram h = ( histogram ) exp ; expression field = h field ( ) ; / / date histogram if ( is date based ( h data type ( ) ) ) { object value = h interval ( ) value ( ) ; / / interval of exactly 1 year or 1 month if ( value instanceof interval year month & & ( ( ( interval year month ) value ) interval ( ) equals ( period of years ( 1 ) ) | | ( ( interval year month ) value ) interval ( ) equals ( period of months ( 1 ) ) ) ) { period year month = ( ( interval year month ) value ) interval ( ) ; string calendar interval = year month equals ( period of years ( 1 ) ) ? year interval : month interval ; / / when the histogram is ` interval ' 1 ' year ` or ` interval ' 1 ' month ` , the interval used in / / the es date histogram will be a calendar interval with value " 1y " or " 1m " respectively if ( field instanceof field attribute ) { key = new group by date histogram ( agg id , query translator name of ( field ) , calendar interval , h zone id ( ) ) ; } else if ( field instanceof function ) { key = new group by date histogram ( agg id , ( ( function ) field ) as script ( ) , calendar interval , h zone id ( ) ) ; } } / / interval of exactly 1 day else if ( value instanceof interval day time & & ( ( interval day time ) value ) interval ( ) equals ( duration of days ( 1 ) ) ) { / / when the histogram is ` interval ' 1 ' day ` the interval used in / / the es date histogram will be a calendar interval with value " 1d " if ( field instanceof field attribute ) { key = new group by date histogram ( agg id , query translator name of ( field ) , day interval , h zone id ( ) ) ; } else if ( field instanceof function ) { key = new group by date histogram ( agg id , ( ( function ) field ) as script ( ) , day interval , h zone id ( ) ) ; } } / / all other intervals will be fixed intervals expressed in ms else { long interval as millis = intervals in millis ( h interval ( ) ) ; / / when the histogram in sql is applied on date type instead of datetime , the interval / / specified is truncated to the multiple of a day if the interval specified is less / / than 1 day , then the interval used will be ` interval ' 1 ' day ` if ( h data type ( ) = = date ) { interval as millis = date utils min day interval ( interval as millis ) ; } if ( field instanceof field attribute ) { key = new group by date histogram ( agg id , query translator name of ( field ) , interval as millis , h zone id ( ) ) ; } else if ( field instanceof function ) { key = new group by date histogram ( agg id , ( ( function ) field ) as script ( ) , interval as millis , h zone id ( ) ) ; } } } / / numeric histogram else { if ( field instanceof field attribute | | field instanceof function ) { double interval = ( double ) sql data type converter convert ( foldables value of ( h interval ( ) ) , data types double ) ; if ( field instanceof field attribute ) { key = new group by numeric histogram ( agg id , query translator name of ( field ) , interval ) ; } else { key = new group by numeric histogram ( agg id , ( ( function ) field ) as script ( ) , interval ) ; } } } if ( key = = null ) { throw new sql illegal argument exception ( " unsupported histogram field { } " , field ) ; } } else { throw new sql illegal argument exception ( " unsupproted grouping function { } " , exp ) ; } } / / bumped into into an invalid function ( which should be caught by the verifier ) else { throw new sql illegal argument exception ( " cannot group by function { } " , exp ) ; } } / / catch corner - case else { throw new sql illegal argument exception ( " cannot group by { } " , exp ) ; } agg map put ( hash , key ) ; } return new grouping context ( agg map ) ; }


checks whether { @ code method } is thread - safe , as indicated by the presence of the { @ link allow concurrent events } annotation

private static boolean is declared thread safe ( method method ) { return method get annotation ( allow concurrent events class ) ! = null ; }


returns the component , if any , that should receive focus when this panel is shown

public component get default focus component ( ) ;


public boolean is repeatable ( ) { return true ; }


apply the x path expression and assert the resulting content as a string

public void assert string ( byte [ ] content , @ nullable string encoding , string expected value ) throws exception { string actual = evaluate xpath ( content , encoding , string class ) ; assertion errors assert equals ( " x path " + this expression , expected value , actual ) ; }


public static string bytes 2base 6 4 ( byte [ ] b , int offset , int length ) { return bytes 2base 6 4 ( b , offset , length , base64 ) ; }


unmap the provided mapped or direct byte buffer this buffer cannot be referenced after this call , so it ' s highly recommended that any fields referencing it should be set to null

public static void unmap ( string resource description , byte buffer buffer ) throws i o exception { if ( ! buffer is direct ( ) ) throw new illegal argument exception ( " unmapping only works with direct buffers " ) ; if ( unmap = = null ) throw unmap not supported exception ; try { unmap invoke exact ( buffer ) ; } catch ( throwable throwable ) { throw new i o exception ( " unable to unmap the mapped buffer : " + resource description , throwable ) ; } }


{ @ link extended bean info } should behave exactly like { @ link bean info } in strange edge cases

public void read method returns supertype of write method parameter ( ) throws introspection exception { @ suppress warnings ( " unused " ) class c { public number get foo ( ) { return null ; } public void set foo ( integer foo ) { } } bean info bi = introspector get bean info ( c class ) ; bean info ebi = new extended bean info ( bi ) ; assert that ( has read method for property ( bi , " foo " ) ) is true ( ) ; assert that ( has read method for property ( ebi , " foo " ) ) is true ( ) ; assert that ( has write method for property ( ebi , " foo " ) ) is equal to ( has write method for property ( bi , " foo " ) ) ; }


this takes an array holding the values of the pdf 417

private static bit matrix bit matrix from bit array ( byte [ ] [ ] input , int margin ) { / / creates the bit matrix with extra space for whitespace bit matrix output = new bit matrix ( input [ 0 ] length + 2 * margin , input length + 2 * margin ) ; output clear ( ) ; for ( int y = 0 , y output = output get height ( ) - margin - 1 ; y < input length ; y + + , y output - - ) { byte [ ] input y = input [ y ] ; for ( int x = 0 ; x < input [ 0 ] length ; x + + ) { / / zero is white in the byte matrix if ( input y [ x ] = = 1 ) { output set ( x + margin , y output ) ; } } } return output ; }


post - translates to the specified points less performant

public matrix translate ( final float [ ] transformed pts ) { matrix save = new matrix ( ) ; translate ( transformed pts , save ) ; return save ; }


returns the { @ link task manager metric store } for the given taskmanager id

public synchronized task manager metric store get task manager metric store ( string tm i d ) { return tm i d = = null ? null : task manager metric store unmodifiable ( task managers get ( tm i d ) ) ; }


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


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


public long get pet id ( ) { return pet id ; }


encode some exceptions for initial ' t '

boolean encode t initial ( ) { if ( m current = = 0 ) { / / americans usually pronounce " tzar " as " zar " if ( string at ( ( m current + 1 ) , 3 , " sar " , " zar " , " " ) ) { m current + + ; return true ; } / / old ' école française d ' extrême - orient ' chinese pinyin where ' ts - ' = > ' x ' if ( ( ( m length = = 3 ) & & string at ( ( m current + 1 ) , 2 , " so " , " sa " , " su " , " " ) ) | | ( ( m length = = 4 ) & & string at ( ( m current + 1 ) , 3 , " sao " , " sai " , " " ) ) | | ( ( m length = = 5 ) & & string at ( ( m current + 1 ) , 4 , " sing " , " sang " , " " ) ) ) { metaph add ( " x " ) ; advance counter ( 3 , 2 ) ; return true ; } / / " ts < vowel > - " at start can be pronounced both with and without ' t ' if ( string at ( ( m current + 1 ) , 1 , " s " , " " ) & & is vowel ( m current + 2 ) ) { metaph add ( " ts " , " s " ) ; advance counter ( 3 , 2 ) ; return true ; } / / e g " tjaarda " if ( string at ( ( m current + 1 ) , 1 , " j " , " " ) ) { metaph add ( " x " ) ; advance counter ( 3 , 2 ) ; return true ; } / / cases where initial " th - " is pronounced as t and not 0 ( " th " ) if ( ( string at ( ( m current + 1 ) , 2 , " hu " , " " ) & & ( m length = = 3 ) ) | | string at ( ( m current + 1 ) , 3 , " hai " , " huy " , " hao " , " " ) | | string at ( ( m current + 1 ) , 4 , " hyme " , " hymy " , " hanh " , " " ) | | string at ( ( m current + 1 ) , 5 , " heres " , " " ) ) { metaph add ( " t " ) ; advance counter ( 3 , 2 ) ; return true ; } } return false ; }


copies the values from the provided affine matrix to this matrix the last row is set to ( 0 , 0 , 1 )

public matrix 3 set ( affine 2 affine ) { float [ ] val = this val ; val [ m00 ] = affine m 0 0 ; val [ m10 ] = affine m 1 0 ; val [ m20 ] = 0 ; val [ m01 ] = affine m 0 1 ; val [ m11 ] = affine m 1 1 ; val [ m21 ] = 0 ; val [ m02 ] = affine m 0 2 ; val [ m12 ] = affine m 1 2 ; val [ m22 ] = 1 ; return this ; }


returns the difference of { @ code a } and { @ code b } , provided it does not overflow

public static long checked subtract ( long a , long b ) { long result = a - b ; check no overflow ( ( a ^ b ) > = 0 | ( a ^ result ) > = 0 , " checked subtract " , a , b ) ; return result ; }


public static long get next value pointer ( memory segment memory segment , int offset ) { return memory segment get long ( offset + next value pointer offset ) ; }


creates a new workspace rule event for a file event

public static workspace rule event new file event ( string path , string content , boolean executable , string rule label , location location ) { file event e = workspace log protos file event new builder ( ) set path ( path ) set content ( content ) set executable ( executable ) build ( ) ; workspace log protos workspace event builder result = workspace log protos workspace event new builder ( ) ; result = result set file event ( e ) ; if ( location ! = null ) { result = result set location ( location to string ( ) ) ; } if ( rule label ! = null ) { result = result set rule ( rule label ) ; } return new workspace rule event ( result build ( ) ) ; }


public token < test delegation token identifier > get delegation token ( text renewer ) throws i o exception ;


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


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


tells whether there are overloaded operators

public boolean has overloaded operators ( ) { return overloaded operators present ; }


a filter for a field based on several terms matching on any of them

public static terms query builder terms query ( string name , collection < ? > values ) { return new terms query builder ( name , values ) ; }


test verifies that configuration is passed to the metrics provider

public void test metrics provider configuration ( ) throws exception { client base setup test env ( ) ; base test metrics provider metrics provider with configuration http port set ( 0 ) ; / / setup the logger to capture all logs byte array output stream os = new byte array output stream ( ) ; writer appender appender = get console appender ( os , level warn ) ; logger qlogger = logger get logger ( " org apache zookeeper server quorum " ) ; qlogger add appender ( appender ) ; try { final int client port qp1 = port assignment unique ( ) ; final int client port qp2 = port assignment unique ( ) ; string quorum cfg section server = " server 1 = 127 0 0 1 : " + port assignment unique ( ) + " : " + port assignment unique ( ) + " ; " + client port qp1 + " \ n " + " server 2 = 127 0 0 1 : " + port assignment unique ( ) + " : " + port assignment unique ( ) + " ; " + client port qp2 + " \ n " ; / / server 1 boots with a metrics provider string quorum cfg section server 1 = quorum cfg section server + " metrics provider class name = " + base test metrics provider metrics provider with configuration class get name ( ) + " \ n " + " metrics provider http port = 1234 " ; main thread q 1 = new main thread ( 1 , client port qp1 , quorum cfg section server 1 ) ; main thread q 2 = new main thread ( 2 , client port qp2 , quorum cfg section server ) ; q 1 start ( ) ; q 2 start ( ) ; boolean isup 1 = client base wait for server up ( " 127 0 0 1 : " + client port qp1 , 30000 ) ; boolean isup 2 = client base wait for server up ( " 127 0 0 1 : " + client port qp2 , 30000 ) ; assert true ( isup 1 , " server 1 never came up " ) ; assert true ( isup 2 , " server 2 never came up " ) ; q 1 shutdown ( ) ; q 2 shutdown ( ) ; assert true ( client base wait for server down ( " 127 0 0 1 : " + client port qp1 , client base connection timeout ) , " waiting for server 1 down " ) ; assert true ( client base wait for server down ( " 127 0 0 1 : " + client port qp2 , client base connection timeout ) , " waiting for server 2 down " ) ; } finally { qlogger remove appender ( appender ) ; } assert equals ( 1234 , base test metrics provider metrics provider with configuration http port get ( ) ) ; }


stores the results of the latest operation into the given frame if there is a local target ( see { @ link # local target } ) , then the sole result is stored to that target ; otherwise any results are pushed onto the stack

protected final void store results ( frame frame ) { if ( result count < 0 ) { throw new sim exception ( " results never set " ) ; } if ( result count = = 0 ) { / / nothing to do return ; } if ( local target ! = null ) { / * * note : get local target ( ) doesn ' t necessarily return * local target directly * / frame get locals ( ) set ( get local target ( false ) ) ; } else { execution stack stack = frame get stack ( ) ; for ( int i = 0 ; i < result count ; i + + ) { if ( local info ) { stack set local ( ) ; } stack push ( results [ i ] ) ; } } }


public static long get time span by now ( final string time , @ non null final date format format , @ time constants unit final int unit ) { return get time span ( time , get now string ( format ) , format , unit ) ; }


convert word like { @ code } or { @ code id } or { @ code expr } to a path element { @ code anywhere } is { @ code true } if { @ code } precedes the word

protected x path element get x path element ( token word token , boolean anywhere ) { if ( word token get type ( ) = = token eof ) { throw new illegal argument exception ( " missing path element at end of path " ) ; } string word = word token get text ( ) ; int ttype = parser get token type ( word ) ; int rule index = parser get rule index ( word ) ; switch ( word token get type ( ) ) { case x path lexer wildcard : return anywhere ? new x path wildcard anywhere element ( ) : new x path wildcard element ( ) ; case x path lexer token ref : case x path lexer string : if ( ttype = = token invalid type ) { throw new illegal argument exception ( word + " at index " + word token get start index ( ) + " isn ' t a valid token name " ) ; } return anywhere ? new x path token anywhere element ( word , ttype ) : new x path token element ( word , ttype ) ; default : if ( rule index = = - 1 ) { throw new illegal argument exception ( word + " at index " + word token get start index ( ) + " isn ' t a valid rule name " ) ; } return anywhere ? new x path rule anywhere element ( word , rule index ) : new x path rule element ( word , rule index ) ; } }


resolve the { @ link transaction definition # get isolation level ( ) isolation level constant } to a r2dbc { @ link isolation level } if you ' d like to extend isolation level translation for vendor - specific { @ link isolation level } s , override this method accordingly

protected isolation level resolve isolation level ( int isolation level ) { switch ( isolation level ) { case transaction definition isolation read committed : return isolation level read committed ; case transaction definition isolation read uncommitted : return isolation level read uncommitted ; case transaction definition isolation repeatable read : return isolation level repeatable read ; case transaction definition isolation serializable : return isolation level serializable ; } return null ; }


add the corresponding files as public textual header files these files will not be compiled into a target ' s header module , but will be made visible as textual includes to dependent rules

public cc compilation helper add public textual headers ( nested set < artifact > textual headers ) { return add public textual headers ( textual headers to list ( ) ) ; }


creates an { @ link sql source } that will hold the statement read from an annotation it is called during startup , when the mapped statement is read from a class or an xml file

sql source create sql source ( configuration configuration , string script , class < ? > parameter type ) ;


fake endpoint for testing various parameters 가짜 엔드 포인트 fake endpoint for testing various parameters 가짜 엔드 포인트

public void test endpoint parameters ( big decimal number , double double , string pattern without delimiter , byte [ ] byte , integer integer , integer int 3 2 , long int 6 4 , float float , string string , file binary , local date date , offset date time date time , string password , string param callback ) throws api exception { test endpoint parameters with http info ( number , double , pattern without delimiter , byte , integer , int 3 2 , int 6 4 , float , string , binary , date , date time , password , param callback ) ; }


get the time at which the key was generated

public long creation timestamp ( ) { return creation timestamp ; }


this method expects a failure while invoking set permission call and validates whether the failure is as expected

private void execute set permission failure ( user group information test user , path test path , fs permission old permission , fs permission new permission , boolean is invalid setup ) throws throwable { test user do as ( new privileged exception action < void > ( ) { @ override public void run ( ) throws exception { try { / / read access required for get file status fs set permission ( test path , new permission ) ; fail ( " failing test because set permission was expected to throw " ) ; } catch ( illegal argument exception iex ) { if ( ! is invalid setup ) { / / fail if illegal argument exception is not expected fail ( " failing test because illegal argument exception " + " is not expected to throw " ) ; } / / check that the file permission is not modified assert permission equals ( test path , old permission ) ; } catch ( wasb authorization exception wex ) { if ( is invalid setup ) { / / fail if wasb authorization exception is not expected fail ( " failing test because wasb authorization exception " + " is not expected to throw " ) ; } / / check that the file permission is not modified assert permission equals ( test path , old permission ) ; } return null ; } } ) ; }


public static data base transaction store manager get instance ( ) { if ( instance = = null ) { synchronized ( data base transaction store manager class ) { if ( instance = = null ) { instance = new data base transaction store manager ( ) ; } } } return instance ; }


get the map of local resources to be used for launching this container

private map < string , local resource > get local resources ( ) { map < string , local resource > local resources = new hash map < > ( ) ; map < string , string > envs = system getenv ( ) ; add as local resource from env ( dyno constants conf zip , local resources , envs ) ; add as local resource from env ( dyno constants start script , local resources , envs ) ; add as local resource from env ( dyno constants hadoop binary , local resources , envs ) ; add as local resource from env ( dyno constants version , local resources , envs ) ; add as local resource from env ( dyno constants dyno dependencies , local resources , envs ) ; if ( is name node launcher ) { add as local resource from env ( dyno constants fs image , local resources , envs ) ; add as local resource from env ( dyno constants fs image md5 , local resources , envs ) ; } else { int block files to localize = math max ( 1 , am options get data nodes per cluster ( ) ) ; for ( int i = 0 ; i < block files to localize ; i + + ) { try { local resources put ( dyno constants block list resource path prefix + i , block list files remove ( 0 ) ) ; } catch ( index out of bounds exception e ) { break ; } } } return local resources ; }


removes all mappings from this hash map , leaving it empty

public void clear ( ) { if ( element count > 0 ) { element count = 0 ; arrays fill ( element data , null ) ; mod count + + ; } }


determine whether the given bean definition qualifies as an autowire candidate for the given dependency the default implementation checks { @ link org springframework beans factory config bean definition # is autowire candidate ( ) }

default boolean is autowire candidate ( bean definition holder bd holder , dependency descriptor descriptor ) { return bd holder get bean definition ( ) is autowire candidate ( ) ; }


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


names of resources that have been deleted and to be removed from the mcp sink node removed resources for missing resources can be ignored when ` incremental ` is true , this contains an array of resource names to remove for the specified collection this modifies the existing resource collection at the sink when ` incremental ` is false , this field should be ignored < code > repeated string removed resources = 4 ; < code >

public builder add removed resources ( java lang string value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } ensure removed resources is mutable ( ) ; removed resources add ( value ) ; on changed ( ) ; return this ; }


runs < code > bazel build & lt ; args & gt ; < code > and returns the result asserts that the process exit code is zero does not assert that the error stream is empty

public process result build ( string args ) throws exception { return run binary ( " build " , args ) ; }


the optional resource name < code > optional string name = 3 ; < code >

private void set name bytes ( com google protobuf byte string value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } bit field 0 | = 0x 0 0 0 0 0 0 0 4 ; name = value to string utf 8 ( ) ; }


attempts to determine and set the start ( f start pos ) and end ( f end pos ) of the word that was double - clicked

protected boolean match word ( ) { i document doc = f text get document ( ) ; try { int pos = cur pos ; char c ; / / scan backwards for the start of the word while ( pos > = 0 ) { c = doc get char ( pos ) ; / / yes we know this isn ' t java code we are parsing but the / / java identifier rule is close enough for now if ( ! character is java identifier part ( c ) ) break ; - - pos ; } start pos = pos ; / / scan forward for the end of the word pos = cur pos ; int length = doc get length ( ) ; while ( pos < length ) { c = doc get char ( pos ) ; if ( ! character is java identifier part ( c ) ) break ; + + pos ; } end pos = pos ; return true ; } catch ( bad location exception x ) { log debug ( x ) ; } return false ; }


simulate a transaction infrastructure failure shouldn ' t invoke target method

public void cannot create transaction ( ) throws exception { transaction attribute txatt = new default transaction attribute ( ) ; method m = get name method ; map transaction attribute source tas = new map transaction attribute source ( ) ; tas register ( m , txatt ) ; reactive transaction manager rtm = mock ( reactive transaction manager class ) ; / / expect a transaction cannot create transaction exception ex = new cannot create transaction exception ( " foobar " , null ) ; given ( rtm get reactive transaction ( txatt ) ) will throw ( ex ) ; default test bean tb = new default test bean ( ) { @ override public mono < string > get name ( ) { throw new unsupported operation exception ( " shouldn ' t have invoked target method when couldn ' t create transaction for transactional method " ) ; } } ; test bean itb = ( test bean ) advised ( tb , rtm , tas ) ; itb get name ( ) as ( step verifier : : create ) expect error ( cannot create transaction exception class ) verify ( ) ; }


update the data file from the given url if the file does not exist , or is otherwise due for update accepted formats are jsonp or html with { @ code post message } , not raw json

public @ check for null future < form validation > update directly ( final boolean signature check ) { if ( ! get data file ( ) exists ( ) | | is due ( ) ) { return jenkins get ( ) get update center ( ) update service submit ( new callable < form validation > ( ) { @ override public form validation call ( ) throws exception { return update directly now ( signature check ) ; } } ) ; } else { return null ; } }


calculates the optimal load factor for the filter , given the number of entries per bucket will return 0 84 , 0 955 or 0 98 depending on b

private double get load factor ( int b ) { if ( ( b = = 2 | | b = = 4 | | b = = 8 ) = = false ) { throw new illegal argument exception ( " b must be one of [ 2 , 4 , 8 ] " ) ; } / * empirical constants from the paper : " with k = 2 hash functions , the load factor α is 50 % when bucket size b = 1 ( i e the hash table is directly mapped ) , but increases to 84 % , 95 % , 98 % respectively using bucket size b = 2 , 4 , 8 " * / if ( b = = 2 ) { return 0 84d ; } else if ( b = = 4 ) { return 0 955d ; } else { return 0 98d ; } }


create a script factory bean definition based on the given script definition , extracting only the definition data that is relevant for the script factory ( that is , only bean class and constructor arguments )

protected bean definition create script factory bean definition ( bean definition bd ) { generic bean definition script bd = new generic bean definition ( ) ; script bd set bean class name ( bd get bean class name ( ) ) ; script bd get constructor argument values ( ) add argument values ( bd get constructor argument values ( ) ) ; return script bd ; }


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


helper for { @ link # visit constant } where the constant is a { @ code long }

private void visit literal long ( int opcode , int offset , int length , long value ) { string comment or lit = ( length = = 1 ) ? " / / " : " # " ; string value str ; if ( length = = 1 ) { value str = hex s 1 ( ( int ) value ) ; } else { value str = hex s 8 ( value ) ; } observer parsed ( bytes , offset , length , header ( offset ) + comment or lit + value str ) ; }


protected list < object > run ( ) throws exception { object [ ] args = to args ( get collapsed requests ( ) ) ; return ( list ) process ( args ) ; }