handler for an inbound http2 rst stream frame , terminating a stream

private void on rst stream read ( int stream id , long error code ) { netty client stream transport state stream = client stream ( connection ( ) stream ( stream id ) ) ; if ( stream ! = null ) { perf mark event ( " netty client handler on rst stream read " , stream tag ( ) ) ; status status = status from h 2 error ( null , " rst stream closed stream " , error code , null ) ; stream transport report status ( status , error code = = http 2 error refused stream code ( ) ? rpc progress refused : rpc progress processed , false / * stop delivery * / , new metadata ( ) ) ; if ( keep alive manager ! = null ) { keep alive manager on data received ( ) ; } } }


private void assert task kill wait state ( ) { assert equals ( task state internal kill wait , mock task get internal state ( ) ) ; }


read 3 byte fixed length integer from byte buffers

public int read int 3 ( ) { return byte buf read unsigned medium l e ( ) ; }


public < t > api response < t > execute ( call call ) throws api exception { return execute ( call , null ) ; }


public has privileges response has privileges ( has privileges request request , request options options ) throws i o exception { return rest high level client perform request and parse entity ( request , security request converters : : has privileges , options , has privileges response : : from x content , empty set ( ) ) ; }


public void set max a m share ( resource resource ) { max a m share m b set ( resource get memory size ( ) ) ; max a m share v cores set ( resource get virtual cores ( ) ) ; if ( custom resources ! = null ) { custom resources set max a m share ( resource ) ; } }


public void set z ( float z ) { this position z = z ; updated = false ; }


get the < b > signed < b > value from the given byte array using the specified integer size , returned as a long values with a size less than sizeof ( long ) will have their sign bit extended

default long get signed value ( byte [ ] b , int offset , int size ) { long val = get value ( b , offset , size ) ; int shift bits = ( 8 / * sizeof ( long ) * / - size ) * 8 ; / / this little bit of magic will sign - extend the value val = val < < shift bits ; val = val > > shift bits ; return val ; }


call a method by its name this is roughly equivalent to { @ link method # invoke ( object , object ) } if the wrapped object is a { @ link class } , then this will invoke a static method if the wrapped object is any other { @ link object } , then this will invoke an instance method just like { @ link method # invoke ( object , object ) } , this will try to wrap primitive types or unwrap primitive type wrappers if applicable if several methods are applicable , by that rule , the first one encountered is called i e when calling < code > on ( ) call ( " method " , 1 , 1 ) ; < code > the first of the following methods will be called : < code > public void method ( int param 1 , integer param 2 ) ; public void method ( integer param 1 , int param 2 ) ; public void method ( number param 1 , number param 2 ) ; public void method ( number param 1 , object param 2 ) ; public void method ( int param 1 , object param 2 ) ; < code > the best matching method is searched for with the following strategy : public method with exact signature match in class hierarchy non - public method with exact signature match on declaring class public method with similar signature in class hierarchy non - public method with similar signature on declaring class

public reflect call ( string name , object args ) throws reflect exception { class < ? > [ ] types = types ( args ) ; / / try invoking the " canonical " method , i e the one with exact / / matching argument types try { method method = exact method ( name , types ) ; return on ( method , object , args ) ; } / / if there is no exact match , try to find a method that has a " similar " / / signature if primitive argument types are converted to their wrappers catch ( no such method exception e ) { try { method method = similar method ( name , types ) ; return on ( method , object , args ) ; } catch ( no such method exception e 1 ) { throw new reflect exception ( e 1 ) ; } } }


add a bdo ( bidirectional override ) element

special bdo ( dir dir , string cdata ) ;


create a new { @ link x content builder } from the x content object underlying this { @ link object path } this only works for { @ link object path } instances created from an x content object , not from nested substructures we throw an { @ link unsupported operation exception } in those cases

public x content builder to x content builder ( x content x content ) throws i o exception { x content builder builder = x content builder builder ( x content ) ; if ( this object instanceof map ) { builder map ( ( map < string , object > ) this object ) ; } else { throw new unsupported operation exception ( " only object path created from a map supported " ) ; } return builder ; }


public void set shadow height ( int val ) { m shadow height = val ; if ( ! m first layout ) { invalidate ( ) ; } }


determines the set of property resolvers that should be used to try and access a property on the specified target type the resolvers are considered to be in an ordered list , however in the returned list any that are exact matches for the input target type ( as opposed to ' general ' resolvers that could work for any type ) are placed at the start of the list in addition , there are specific resolvers that exactly name the class in question and resolvers that name a specific class but it is a supertype of the class we have these are put at the end of the specific resolvers set and will be tried after exactly matching accessors but before generic accessors

public static list < property accessor > get property accessors to try ( @ nullable class < ? > target type , list < property accessor > property accessors ) { list < property accessor > specific accessors = new array list < > ( ) ; list < property accessor > general accessors = new array list < > ( ) ; for ( property accessor resolver : property accessors ) { class < ? > [ ] targets = resolver get specific target classes ( ) ; if ( targets = = null ) { / / generic resolver that says it can be used for any type general accessors add ( resolver ) ; } else { if ( target type ! = null ) { for ( class < ? > clazz : targets ) { if ( clazz = = target type ) { / / put exact matches on the front to be tried first ? specific accessors add ( resolver ) ; } else if ( clazz is assignable from ( target type ) ) { / / put supertype matches at the end of the / / specific accessor list general accessors add ( resolver ) ; } } } } } list < property accessor > resolvers = new array list < > ( specific accessors size ( ) + general accessors size ( ) ) ; resolvers add all ( specific accessors ) ; resolvers add all ( general accessors ) ; return resolvers ; }


protected model and view handle request internal ( http servlet request request , http servlet response response ) throws exception { assert state ( this servlet instance ! = null , " no servlet instance " ) ; this servlet instance service ( request , response ) ; return null ; }


clean up of the builder for interrupted workflow this does nothing if { @ link # close ( ) } was called successfully

public void clean up ( ) { if ( m output jar ! = null ) { try { m output jar close ( ) ; } catch ( i o exception e ) { / / pass } } }


get the float array contained with this field

public float [ ] get float array ( ) { if ( float array ! = data [ data type offset ] ) { throw new illegal field access exception ( ) ; } if ( data [ data offset ] < 0 ) { return null ; } float [ ] values = new float [ ( data length - 2 ) / 4 ] ; binary data buffer buffer = new binary data buffer ( data ) ; int offset = data offset + 1 ; for ( int i = 0 ; i < values length ; i + + ) { values [ i ] = float int bits to float ( buffer get int ( offset ) ) ; offset + = 4 ; } return values ; }


public string to string ( t value ) throws illegal argument exception { if ( value = = null ) { throw new illegal argument exception ( localization messages method parameter cannot be null ( " value " ) ) ; } return value to string ( ) ; }


shortens a domain path to make it as readable as possible without flying off the screen

private static string shorten ( string domain path ) { string [ ] splits = domain path split ( " / " ) ; string builder sb = new string builder ( ) ; for ( int ii = splits length - 1 ; ii > = 0 ; - - ii ) { sb insert ( 0 , splits [ ii ] ) ; if ( ii ! = 0 ) { sb insert ( 0 , " / " ) ; } if ( sb length ( ) > = magic maximum length ) { break ; } } string result = sb to string ( ) ; if ( result length ( ) < domain path length ( ) ) { result = " " + result ; } return result ; }


add an async wait operator the order to process input records is guaranteed to be the same as input ones

public static < in , out > single output stream operator < out > ordered wait ( data stream < in > in , async function < in , out > func , long timeout , time unit time unit ) { return add operator ( in , func , time unit to millis ( timeout ) , default queue capacity , output mode ordered ) ; }


returns the set of all types referenced in the method header , i e all types in the method return type and argument types

public immutable set < class name > get header type name set ( ) { return immutable set < class name > builder ( ) add ( get return type name ( ) ) add all ( get argument type names ( ) ) build ( ) ; }


tests that { @ link checkpoint coordinator # abort pending checkpoints ( checkpoint exception ) } called on job failover could handle the { @ code current periodic trigger } null case well

public void test abort pending checkpoints with trigger validation ( ) { final int max concurrent checkpoints = thread local random current ( ) next int ( 10 ) + 1 ; execution vertex execution vertex = mock execution vertex ( ) ; checkpoint coordinator configuration checkpoint coordinator configuration = new checkpoint coordinator configuration ( integer max value , integer max value , 0 , max concurrent checkpoints , checkpoint retention policy never retain after termination , true , false , false , 0 ) ; checkpoint coordinator checkpoint coordinator = new checkpoint coordinator ( new job i d ( ) , checkpoint coordinator configuration , new execution vertex [ ] { execution vertex } , new execution vertex [ ] { execution vertex } , new execution vertex [ ] { execution vertex } , collections empty list ( ) , new standalone checkpoint i d counter ( ) , new standalone completed checkpoint store ( 1 ) , new memory state backend ( ) , executors direct executor ( ) , new checkpoints cleaner ( ) , manual thread executor , shared state registry default factory , mock ( checkpoint failure manager class ) ) ; / / switch current execution ' s state to running to allow checkpoint could be triggered mock execution running ( execution vertex ) ; checkpoint coordinator start checkpoint scheduler ( ) ; assert true ( checkpoint coordinator is current periodic trigger available ( ) ) ; / / only trigger the periodic scheduling / / we can ' t trigger all scheduled task , because there is also a cancellation scheduled manual thread executor trigger periodic scheduled tasks ( ) ; manual thread executor trigger all ( ) ; assert equals ( 1 , checkpoint coordinator get number of pending checkpoints ( ) ) ; for ( int i = 1 ; i < max concurrent checkpoints ; i + + ) { checkpoint coordinator trigger checkpoint ( false ) ; manual thread executor trigger all ( ) ; assert equals ( i + 1 , checkpoint coordinator get number of pending checkpoints ( ) ) ; assert true ( checkpoint coordinator is current periodic trigger available ( ) ) ; } / / as we only support limited concurrent checkpoints , after checkpoint triggered more than / / the limits , / / the current periodic trigger would been assigned as null checkpoint coordinator trigger checkpoint ( false ) ; manual thread executor trigger all ( ) ; assert equals ( max concurrent checkpoints , checkpoint coordinator get number of pending checkpoints ( ) ) ; checkpoint coordinator abort pending checkpoints ( new checkpoint exception ( checkpoint failure reason job failover region ) ) ; / / after aborting checkpoints , we ensure current periodic trigger still available assert true ( checkpoint coordinator is current periodic trigger available ( ) ) ; assert equals ( 0 , checkpoint coordinator get number of pending checkpoints ( ) ) ; }


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


determine if an exception is security - related we need to handle these exceptions differently than other i o exceptions they don ' t indicate a communication problem instead , they mean that there is some action the client needs to take , such as refetching block tokens , renewing encryption keys , etc

private static boolean is security exception ( i o exception ioe ) { return ( ioe instanceof invalid token ) | | ( ioe instanceof invalid encryption key exception ) | | ( ioe instanceof invalid block token exception ) | | ( ioe instanceof access control exception ) ; }


returns true if this reader will extract values in little endian , otherwise in big endian

public boolean is little endian ( ) { return converter instanceof little endian data converter ; }


delete a service ' s registered endpoints if the operation returns without an error then the entry has been deleted

void delete ( string path , service record record ) throws i o exception ;


grants the specified privilege to the specified user on the specified table

default void grant table privileges ( connector session session , schema table name table name , set < privilege > privileges , presto principal grantee , boolean grant option ) { throw new presto exception ( not supported , " this connector does not support grants " ) ; }


note that overloaded methods are supported

public static factory methods new instance ( test bean tb ) { return new factory methods ( tb , " default " , 0 ) ; }


return a translated exception if this is appropriate , otherwise return the given exception as - is

public static runtime exception translate if necessary ( runtime exception raw exception , persistence exception translator pet ) { assert not null ( pet , " persistence exception translator must not be null " ) ; data access exception dae = pet translate exception if possible ( raw exception ) ; return ( dae ! = null ? dae : raw exception ) ; }


get the stack editor provider that is currently editing the stack frame of the named function

stack editor provider get provider ( program program , string function name ) { iterator < function > iter = editor map key set ( ) iterator ( ) ; while ( iter has next ( ) ) { function function = iter next ( ) ; if ( program = = function get program ( ) & & function get name ( ) equals ( function name ) ) { return editor map get ( function ) ; } } return null ; }


tests if the given component is one of a known list of component classes that we don ' t ever want to get keyboard focus currently excluded is j scroll pane

static boolean exclude focus ( component c ) { return ( c instanceof j scroll pane ) | | ( c instanceof j scroll bar ) | | ( c instanceof j tabbed pane ) ; }


sets the seed based on which the random number will be generated using the same seed is guaranteed to generate the same random number for a specific doc

public random score function builder seed ( int seed ) { this seed = seed ; return this ; }


set the { @ link # is executed ( ) executed } flag to { @ code true } and return the configured { @ link # set response ( client http response ) response }

public final client http response execute ( ) throws i o exception { this executed = true ; return execute internal ( ) ; }


adjust unaligned structure following member reconstruction

private void adjust size ( int preferred size ) { if ( ! is structure container ( ) ) { return ; } structure struct = ( structure ) get data type ( ) ; if ( struct is not yet defined ( ) & & preferred size > 0 ) { / / handle special case of empty structure struct grow structure ( preferred size ) ; return ; } if ( struct get length ( ) < preferred size ) { struct grow structure ( preferred size - struct get length ( ) ) ; return ; } data type component dtc = struct get component at ( preferred size ) ; if ( dtc = = null ) { return ; } int start ordinal = dtc get ordinal ( ) ; if ( dtc get offset ( ) ! = preferred size ) { + + start ordinal ; } for ( int i = struct get num components ( ) - 1 ; i > = start ordinal ; i - - ) { data type component comp = struct get component ( i ) ; if ( comp get data type ( ) ! = data type default ) { break ; } struct delete ( i ) ; } }


returns a list of name matchers for header extract keys from all listed headers for g r p c , it is an error to specify " required match " on the name matcher protos , and we ignore it if set

immutable list < name matcher > get headers ( ) { return headers ; }


path to a file within the apk ( typically restype - configentry ext ) < code > optional string path = 1 ; < code >

public java lang string get path ( ) { return instance get path ( ) ; }


returns the subset of the given dexopts that are blacklisted from using incremental dexing by default

static iterable < string > blacklisted dexopts ( rule context rule context , list < string > dexopts ) { return iterables filter ( dexopts , new flag matcher ( get android config ( rule context ) get target dexopts that prevent incremental dexing ( ) ) ) ; }


returns the after value set for this source

t get after ( ) { return after value ; }


returns the reason text as per < a href = " https : tools ietf orghtmlrfc 6 4 5 5 # section - 7 4 " > rfc 6455 if a reason text is not supplied , an empty string is returned

public string reason text ( ) { byte buf binary data = content ( ) ; if ( binary data = = null | | binary data capacity ( ) < = 2 ) { return " " ; } binary data reader index ( 2 ) ; string reason text = binary data to string ( charset util utf 8 ) ; binary data reader index ( 0 ) ; return reason text ; }


returns a java util set containing the edges in this graph

public set < edge > get edges ( ) { return this edges ( ) to set ( ) ; }


return the phase that this lifecycle object is supposed to run in the default implementation returns { @ link # default phase } in order to let { @ code stop ( ) } callbacks execute after regular { @ code lifecycle } implementations

default int get phase ( ) { return default phase ; }


allocate the slot with the given index for the given job and allocation id if negative index is given , a new auto increasing index will be generated returns true if the slot could be allocated otherwise it returns false

boolean allocate slot ( int index , job i d job id , allocation i d allocation id , resource profile resource profile , time slot timeout ) ;


the implementation of the stack trace cleaner

public static stack trace cleaner provider get stack trace cleaner provider ( ) { return registry get stack trace cleaner provider ( ) ; }


returns the allowed set of request headers the header names returned from this method will be used to set the cors ' access - control - allow - headers ' response header

public set < string > allowed request headers ( ) { return collections unmodifiable set ( allowed request headers ) ; }


called during setup for this class to register its options with the given { @ link options } object

public void register options ( options options ) ;


an " java lang illegal argument exception : comparison method violates its general contract ! " is triggered by this test with a previous version of levenshtein comparator it is triggered by a certain condition in tim sort that only happens if 32 or more values are in an array as such , it may not be a thorough test it depends on the specifics of the environment jvm

public void test levenshtein comparator sort ( ) { / / no assertions , just making sure we don ' t violate the compare contract arrays sort ( new string [ ] { " y " , " w " , " y " , " e " , " s " , " u " , " h " , " o " , " d " , " t " , " d " , " f " , " z " , " j " , " c " , " k " , " f " , " z " , " o " , " e " , " r " , " t " , " v " , " d " , " l " , " r " , " w " , " u " , " v " , " a " , " m " , " o " } , c ) ; }


cancels a task after starting cancellation on the parent task , the task manager tries to cancel all children tasks of the current task once cancellation of the children tasks is done , the listener is triggered if the task is completed or unregistered from task manager , then the listener is called immediately

public void cancel ( cancellable task task , string reason , runnable listener ) { cancellable task holder holder = cancellable tasks get ( task get id ( ) ) ; if ( holder ! = null ) { logger trace ( " cancelling task with id { } " , task get id ( ) ) ; holder cancel ( reason , listener ) ; } else { listener run ( ) ; } }


returns inline mock maker , an optional mock maker that is bundled with mockito distribution this method is needed because { @ link # get default plugin ( class ) } does not provide an instance of inline mock maker creates new instance each time is called so it is recommended to keep hold of the resulting object for future invocations for more information about inline mock maker see the javadoc for main { @ link mockito } class


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


helper method to update the chown allowed users in tests

void update chown allowed users ( list < string > chown allowed users ) { this chown allowed users = chown allowed users ; }


part ii of get additional block ( ) should repeat the same analysis of the file state as in part 1 , but under the write lock if the conditions still hold , then allocate a new block with the new targets , add it to the i node and to the blocks map

static located block store allocated block ( f s namesystem fsn , string src , long file id , string client name , extended block previous , datanode storage info [ ] targets ) throws i o exception { long offset ; / / run the full analysis again , since things could have changed / / while choose target ( ) was executing located block [ ] on retry block = new located block [ 1 ] ; i nodes in path iip = fsn dir resolve path ( null , src , file id ) ; file state file state = analyze file state ( fsn , iip , file id , client name , previous , on retry block ) ; final i node file pending file = file state inode ; src = file state path ; if ( on retry block [ 0 ] ! = null ) { if ( on retry block [ 0 ] get locations ( ) length > 0 ) { / / this is a retry just return the last block if having locations return on retry block [ 0 ] ; } else { / / add new chosen targets to already allocated block and return block info last block in file = pending file get last block ( ) ; last block in file get under construction feature ( ) set expected locations ( last block in file , targets , pending file get block type ( ) ) ; offset = pending file compute file size ( ) ; return make located block ( fsn , last block in file , targets , offset ) ; } } / / commit the last block and complete it if it has minimum replicas fsn commit or complete last block ( pending file , file state iip , extended block get local block ( previous ) ) ; / / allocate new block , record block locations in i node final block type block type = pending file get block type ( ) ; / / allocate new block , record block locations in i node block new block = fsn create new block ( block type ) ; i nodes in path inodes in path = i nodes in path from i node ( pending file ) ; save allocated block ( fsn , src , inodes in path , new block , targets , block type ) ; persist new block ( fsn , src , pending file ) ; offset = pending file compute file size ( ) ; / / return located block return make located block ( fsn , fsn get stored block ( new block ) , targets , offset ) ; }


given an index in the range < code > 0 size ( ) - 1 < code > , returns the value from the < code > index < code > th key - value mapping that this sparse int array stores the values corresponding to indices in ascending order are guaranteed to be associated with keys in ascending order , e g , < code > value at ( 0 ) < code > will return the value associated with the smallest key and < code > value at ( size ( ) - 1 ) < code > will return the value associated with the largest key

public boolean value at ( int index ) { return m values [ index ] ; }


sets an integer attribute ( like cc binary linkstatic ) for this target

public scratch attribute writer set ( string name , int value ) { new integer attribute ( name , value ) append line ( this build string ) ; return this ; }


determine if the supplied { @ code test class } is enabled in the current environment , as specified by the { @ link if profile value & # 064 ; if profile value } annotation at the class level defaults to { @ code true } if no { @ link if profile value & # 064 ; if profile value } annotation is declared

public static boolean is test enabled in this environment ( class < ? > test class ) { if profile value if profile value = annotated element utils find merged annotation ( test class , if profile value class ) ; return is test enabled in this environment ( retrieve profile value source ( test class ) , if profile value ) ; }


sort nodes array by network distance to reader with secondary sort using network location this is used when the reader is not a datanode sorting the nodes based on network distance from the reader reduces network traffic and improves performance

public void sort by distance using network location ( node reader , node [ ] nodes , int active len ) { / * * this method is called if the reader is not a datanode , * so non data node reader flag is set to true * / sort by distance using network location ( reader , nodes , active len , null ) ; }


start concurrent request processing and initialize the given { @ link deferred result } with a { @ link deferred result handler } that saves the result and dispatches the request to resume processing of that result the { @ code async web request } is also updated with a completion handler that expires the { @ code deferred result } and a timeout handler assuming the { @ code deferred result } has a default timeout result

public void start deferred result processing ( final deferred result < ? > deferred result , object processing context ) throws exception { assert not null ( deferred result , " deferred result must not be null " ) ; assert state ( this async web request ! = null , " async web request must not be null " ) ; long timeout = deferred result get timeout value ( ) ; if ( timeout ! = null ) { this async web request set timeout ( timeout ) ; } list < deferred result processing interceptor > interceptors = new array list < > ( ) ; interceptors add ( deferred result get interceptor ( ) ) ; interceptors add all ( this deferred result interceptors values ( ) ) ; interceptors add ( timeout deferred result interceptor ) ; final deferred result interceptor chain interceptor chain = new deferred result interceptor chain ( interceptors ) ; this async web request add timeout handler ( ( ) - > { try { interceptor chain trigger after timeout ( this async web request , deferred result ) ; } catch ( throwable ex ) { set concurrent result and dispatch ( ex ) ; } } ) ; this async web request add error handler ( ex - > { if ( ! this error handling in progress ) { try { if ( ! interceptor chain trigger after error ( this async web request , deferred result , ex ) ) { return ; } deferred result set error result ( ex ) ; } catch ( throwable interceptor ex ) { set concurrent result and dispatch ( interceptor ex ) ; } } } ) ; this async web request add completion handler ( ( ) - > interceptor chain trigger after completion ( this async web request , deferred result ) ) ; interceptor chain apply before concurrent handling ( this async web request , deferred result ) ; start async processing ( processing context ) ; try { interceptor chain apply pre process ( this async web request , deferred result ) ; deferred result set result handler ( result - > { result = interceptor chain apply post process ( this async web request , deferred result , result ) ; set concurrent result and dispatch ( result ) ; } ) ; } catch ( throwable ex ) { set concurrent result and dispatch ( ex ) ; } }


sets the local strategy comparator for this channel

public void set local strategy comparator ( type comparator factory < ? > local strategy comparator ) { this local strategy comparator = local strategy comparator ; }


returns an immutable multiset entry with the specified element and count the entry will be serializable if { @ code e } is

public static < e > multiset entry < e > immutable entry ( @ nullable e e , int n ) { return new immutable entry < e > ( e , n ) ; }


merge the given properties instance into the given map , copying all properties ( key - value pairs ) over uses { @ code properties property names ( ) } to even catch default properties linked into the original properties instance

public static < k , v > void merge properties into map ( @ nullable properties props , map < k , v > map ) { if ( props ! = null ) { for ( enumeration < ? > en = props property names ( ) ; en has more elements ( ) ; ) { string key = ( string ) en next element ( ) ; object value = props get ( key ) ; if ( value = = null ) { / / allow for defaults fallback or potentially overridden accessor value = props get property ( key ) ; } map put ( ( k ) key , ( v ) value ) ; } } }


evaluates the schema on a project , returning a list of item updates generated by the schema some warnings will be emitted in the warning store : those are only the ones that are generated at evaluation time ( such as invalid formats for dates ) issues detected on candidate statements ( such as constraint violations ) are not included at this stage

public list < item update > evaluate ( project project , engine engine , q a warning store warning store ) { list < item update > result = new array list < > ( ) ; filtered rows filtered rows = engine get all filtered rows ( ) ; filtered rows accept ( project , new evaluating row visitor ( result , warning store ) ) ; return result ; }


finds object by its name ( case insensitive )

public static < t extends d b p named object > t find object ( @ nullable collection < t > the list , string object name , boolean case insensitive ) { if ( the list ! = null & & ! the list is empty ( ) ) { for ( t object : the list ) { if ( case insensitive ? object get name ( ) equals ignore case ( object name ) : object get name ( ) equals ( object name ) ) { return object ; } } } return null ; }


for the lower rpc layers to set the async return value

public static void set lower layer async return ( async get < ? , exception > async return ) { lower layer async return set ( async return ) ; }


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


quickselects the top k elements from the 2k elements in the buffer o ( k ) expected time , o ( k log k ) worst case

private void trim ( ) { int left = 0 ; int right = 2 * k - 1 ; int min threshold position = 0 ; / / the leftmost position at which the greatest of the k lower elements / / - - the new value of threshold - - might be found int iterations = 0 ; int max iterations = int math log 2 ( right - left , rounding mode ceiling ) * 3 ; while ( left < right ) { int pivot index = ( left + right + 1 ) > > > 1 ; int pivot new index = partition ( left , right , pivot index ) ; if ( pivot new index > k ) { right = pivot new index - 1 ; } else if ( pivot new index < k ) { left = math max ( pivot new index , left + 1 ) ; min threshold position = pivot new index ; } else { break ; } iterations + + ; if ( iterations > = max iterations ) { / / we ' ve already taken o ( k log k ) , let ' s make sure we don ' t take longer than o ( k log k ) arrays sort ( buffer , left , right , comparator ) ; break ; } } buffer size = k ; threshold = buffer [ min threshold position ] ; for ( int i = min threshold position + 1 ; i < k ; i + + ) { if ( comparator compare ( buffer [ i ] , threshold ) > 0 ) { threshold = buffer [ i ] ; } } }


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


create the most appropriate map for the given map type warning : since the parameterized type { @ code k } is not bound to the supplied { @ code key type } , type safety cannot be guaranteed if the desired { @ code map type } is { @ link enum map } in such scenarios , the caller is responsible for ensuring that the { @ code key type } is an enum type matching type { @ code k } as an alternative , the caller may wish to treat the return value as a raw map or map keyed by { @ link object } similarly , type safety cannot be enforced if the desired { @ code map type } is { @ link multi value map }

public static < k , v > map < k , v > create map ( class < ? > map type , @ nullable class < ? > key type , int capacity ) { assert not null ( map type , " map type must not be null " ) ; if ( map type is interface ( ) ) { if ( map class = = map type ) { return new linked hash map < > ( capacity ) ; } else if ( sorted map class = = map type | | navigable map class = = map type ) { return new tree map < > ( ) ; } else if ( multi value map class = = map type ) { return new linked multi value map ( ) ; } else { throw new illegal argument exception ( " unsupported map interface : " + map type get name ( ) ) ; } } else if ( enum map class = = map type ) { assert not null ( key type , " cannot create enum map for unknown key type " ) ; return new enum map ( as enum type ( key type ) ) ; } else { if ( ! map class is assignable from ( map type ) ) { throw new illegal argument exception ( " unsupported map type : " + map type get name ( ) ) ; } try { return ( map < k , v > ) reflection utils accessible constructor ( map type ) new instance ( ) ; } catch ( throwable ex ) { throw new illegal argument exception ( " could not instantiate map type : " + map type get name ( ) , ex ) ; } } }


public string get property class ( ) { return property class ; }


returns the choices for the set identified by < code > key < code >

public object [ ] get choices ( object key ) { return f value map get ( key ) ; }


writes the given json to a filename based on the given qualified class name

private void write json to file ( json object json , name qualified name ) { file json file = new file ( dest dir , qualified name to string ( ) replace ( ' ' , ' / ' ) + " json " ) ; json file get parent file ( ) mkdirs ( ) ; try ( print writer writer = new print writer ( new file writer ( json file ) ) ) { writer println ( gson to json ( json ) ) ; } catch ( i o exception e ) { e print stack trace ( ) ; } }


if set to true the restore procedure will restore partially snapshotted indices

public restore snapshot request builder set partial ( boolean partial ) { request partial ( partial ) ; return this ; }


this test validates the correctness of { @ link r m web service protocol # get app ( ) } inside router

public void test app x m l ( ) throws exception { string app id = submit application ( ) ; list < app info > responses = perform get calls ( rm web service path + format ( apps appid , app id ) , app info class , null , null ) ; app info router response = responses get ( 0 ) ; app info rm response = responses get ( 1 ) ; assert not null ( router response ) ; assert not null ( rm response ) ; assert equals ( rm response get a m host http address ( ) , router response get a m host http address ( ) ) ; }


this implementation returns the underlying file path length

public long content length ( ) throws i o exception { if ( this file ! = null ) { long length = this file length ( ) ; if ( length = = 0l & & ! this file exists ( ) ) { throw new file not found exception ( get description ( ) + " cannot be resolved in the file system for checking its content length " ) ; } return length ; } else { try { return files size ( this file path ) ; } catch ( no such file exception ex ) { throw new file not found exception ( ex get message ( ) ) ; } } }


this and target are equivalent really instanceof pointcuts

private void test this or target ( string which ) throws security exception , no such method exception { string matches test bean = which + " ( org springframework beans testfixture beans test bean ) " ; string matches i other = which + " ( org springframework beans testfixture beans i other ) " ; aspect j expression pointcut test bean pc = new aspect j expression pointcut ( ) ; test bean pc set expression ( matches test bean ) ; aspect j expression pointcut i other pc = new aspect j expression pointcut ( ) ; i other pc set expression ( matches i other ) ; assert that ( test bean pc matches ( test bean class ) ) is true ( ) ; assert that ( test bean pc matches ( get age , test bean class ) ) is true ( ) ; assert that ( i other pc matches ( other i other class get method ( " absquatulate " ) , other i other class ) ) is true ( ) ; assert that ( test bean pc matches ( other i other class get method ( " absquatulate " ) , other i other class ) ) is false ( ) ; }


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


public int byte length ( ) { return 8 + inner classes size ( ) * 8 ; }


resets the component to the initial state

public void reset ( ) { m detector reset ( ) ; }


checks if the given session has watches set

public boolean has paths ( long session id ) { return id 2paths contains key ( session id ) ; }


this is when you would hide certain megaphones based on { @ link feature flags } you could conditionally set a { @ link forever schedule } set to false for disabled features

private static map < event , megaphone schedule > build display order ( @ non null context context ) { return new linked hash map < event , megaphone schedule > ( ) { { put ( event reactions , always ) ; put ( event pins for all , new pins for all schedule ( ) ) ; put ( event pin reminder , new signal pin reminder schedule ( ) ) ; put ( event message requests , should show message requests megaphone ( ) ? always : never ) ; put ( event link previews , should show link previews megaphone ( context ) ? always : never ) ; put ( event client deprecated , signal store misc ( ) is client deprecated ( ) ? always : never ) ; put ( event research , should show research megaphone ( context ) ? show for duration schedule show for days ( 7 ) : never ) ; put ( event donate , should show donate megaphone ( context ) ? show for duration schedule show for days ( 7 ) : never ) ; put ( event group calling , should show group calling megaphone ( ) ? always : never ) ; put ( event onboarding , should show onboarding megaphone ( context ) ? always : never ) ; } } ; }


determines which windows ( if any ) should be merged


checks whether the provided history is linearizable with respect to the given sequential specification

public boolean is linearizable ( sequential spec spec , history history , function < object , object > missing response generator , boolean supplier terminate early ) { history = history clone ( ) ; / / clone history before completing it history complete ( missing response generator ) ; / / complete history final collection < list < event > > partitions = spec partition ( history copy events ( ) ) ; return partitions stream ( ) all match ( h - > is linearizable ( spec , h , terminate early ) ) ; }


public void set increasing paint style ( paint style paint style ) { this m increasing paint style = paint style ; }


writes a data stream to the standard output stream ( stderr ) for each element of the data stream the result of { @ link object # to string ( ) } is written note : this will print to stderr on the machine where the code is executed , i e the flink worker

public data stream sink < t > print to err ( string sink identifier ) { print sink function < t > print function = new print sink function < > ( sink identifier , true ) ; return add sink ( print function ) name ( " print to std err " ) ; }


public api response < model api response > upload file with http info ( long pet id , string additional metadata , file file ) throws api exception { okhttp 3 call local var call = upload file validate before call ( pet id , additional metadata , file , null ) ; type local var return type = new type token < model api response > ( ) { } get type ( ) ; return local var api client execute ( local var call , local var return type ) ; }


collects the child relations of a function in a child row array

private void add child relations ( function function , fid hasher hasher , map < function , function row > record map , array list < child row > children ) throws cancelled exception { hash set < address > already done = new hash set < > ( ) ; program program = function get program ( ) ; function manager function manager = program get function manager ( ) ; reference manager reference manager = program get reference manager ( ) ; symbol table symbol table = program get symbol table ( ) ; address iterator reference iterator = reference manager get reference source iterator ( function get body ( ) , true ) ; for ( address address : reference iterator ) { monitor check canceled ( ) ; instruction instruction = program get listing ( ) get instruction at ( address ) ; if ( instruction ! = null & & instruction get flow type ( ) is call ( ) ) { reference [ ] references from = reference manager get references from ( address ) ; for ( reference reference : references from ) { monitor check canceled ( ) ; address to address = reference get to address ( ) ; if ( ! already done contains ( to address ) ) { function relation = function manager get function containing ( to address ) ; if ( relation ! = null & & relation is thunk ( ) ) { relation = relation get thunked function ( true ) ; } if ( relation = = null | | function is external ( relation ) ) { child row child row = new child row ( ) ; child row to row = null ; child row symbol name = grab symbol ( symbol table , to address ) ; child row to address = to address ; children add ( child row ) ; search child reference by name ( child row , child row symbol name ) ; } else { function row relation row = record map get ( relation ) ; if ( relation row ! = null ) { child row child row = new child row ( ) ; child row to row = relation row ; child row symbol name = null ; child row to address = to address ; children add ( child row ) ; search child reference by name ( child row , relation row name ) ; } / / if the relation record was null , 99 99 % sure that the / / relation is too small to hash , so it will appear in the / / additional labels section } already done add ( to address ) ; } } } } }


all tests run as a superuser but use < code > es - security - runas - user < code > to become a less privileged user

protected settings rest client settings ( ) { return secure client settings ( ) ; }


obtain a jms session that is synchronized with the current transaction , if any

public static session get transactional session ( final connection factory cf , @ nullable final connection existing con , final boolean synched local transaction allowed ) throws j m s exception { return do get transactional session ( cf , new resource factory ( ) { @ override @ nullable public session get session ( jms resource holder holder ) { return holder get session ( session class , existing con ) ; } @ override @ nullable public connection get connection ( jms resource holder holder ) { return ( existing con ! = null ? existing con : holder get connection ( ) ) ; } @ override public connection create connection ( ) throws j m s exception { return cf create connection ( ) ; } @ override public session create session ( connection con ) throws j m s exception { return con create session ( synched local transaction allowed , session auto acknowledge ) ; } @ override public boolean is synched local transaction allowed ( ) { return synched local transaction allowed ; } } , true ) ; }


exit with the usage exit code { @ link # exit usage } and message { @ link # usage message }

protected static void exit with usage message ( ) { exit with message ( exit usage , usage message ) ; }


public static < t > t execute groovy script ( final resource groovy script , final string method name , final class < t > clazz , final object args ) { return execute groovy script ( groovy script , method name , args , clazz , false ) ; }


create the most appropriate collection for the given collection type delegates to { @ link # create collection ( class , class , int ) } with a { @ code null } element type

public static < e > collection < e > create collection ( class < ? > collection type , int capacity ) { return create collection ( collection type , null , capacity ) ; }


public void set qid ( long id , string qid ) { map put ( id , qid ) ; }


increases the size of the keys array and the indexer this method needs to be very careful ! it is very important that the keys get mapped to the same key index even though they are stored in a different list in the indexer class ( which is indexed based on the hashcode ( mod capacity ) of the key since this method can only be called when the indexer is full , we can assume that there are no gaps ( freed indexes ) in the keys array therefore , if we clear everything and add them back in the same order that they were stored in the old keys array , they should be assigned the same index this is important since other containing classes may be storing lots of information based on this index and we don ' t want the indexing to change just because we had to grow

private void grow ( ) { int new capacity = prime next prime ( indexer get new capacity ( ) ) ; indexer grow capacity ( new capacity ) ; indexer grow num lists ( new capacity ) ; indexer clear ( ) ; long [ ] old keys = keys ; keys = new long [ new capacity ] ; capacity = new capacity ; for ( long old key : old keys ) { put ( old key ) ; } }


for compatibility reason , this method may not return a { @ link list view column descriptor } and instead return a plain { @ link descriptor } instance

public descriptor < list view column > get descriptor ( ) { return jenkins get ( ) get descriptor or die ( get class ( ) ) ; }


returns a set that matches only the provided { @ code file types } if { @ code file types } is empty , the returned predicate will match no files

public static file type set of ( iterable < file type > file types ) { if ( iterables is empty ( file types ) ) { return file type set no file ; } else { return new file type set ( file types ) ; } }


test exceptions after the run of date format runnalbe a correct run should deliver 5 times the same exception

public void test exceptions ( ) { assert equals ( expected exceptions , result get exception list ( ) ) ; }


public alts server builder fallback handler registry ( handler registry fallback registry ) { delegate fallback handler registry ( fallback registry ) ; return this ; }


moves the cursor to the next editable field

protected boolean locate next edit field ( int current row ) { int row = current row ; int model column = model get column ( ) ; boolean found editable = false ; / / get the current row ( index ) and column ( field num ) int index = row ; int field num = table convert column index to view ( model column ) ; int num fields = model get column count ( ) ; int num comps = model get row count ( ) ; do { / / determine the new location for the cursor if ( index < num comps ) { / / on component row if ( + + field num < ( num fields ) ) { / / not on last field if ( model is cell editable ( index , table convert column index to model ( field num ) ) ) { found editable = true ; } } else if ( ( + + index < num comps ) / / on last field for other than last component | | ( index = = num comps ) ) { / / last field and row but unlocked field num = 0 ; / / set it to first field if ( model is cell editable ( index , table convert column index to model ( field num ) ) ) { found editable = true ; } } else { break ; } } else { break ; } } while ( ! found editable ) ; if ( found editable ) { row = index ; model column = table convert column index to model ( field num ) ; table set row selection interval ( row , row ) ; model set row ( row ) ; model set column ( model column ) ; } return found editable ; }


creates a { @ link dirty building state } for the case where this node is done and is being marked dirty

protected dirty building state create dirty building state for done node ( dirty type dirty type , grouped list < sky key > direct deps , sky value value ) { return dirty building state create ( dirty type , direct deps , value ) ; }


specify the jdbc data sources that the jpa persistence provider is supposed to use for accessing the database , resolving data source names in { @ code persistence xml } against spring - managed data sources the specified map needs to define data source names for specific data source objects , matching the data source names used in { @ code persistence xml } if not specified , data source names will be resolved as jndi names instead ( as defined by standard jpa )

public void set data sources ( map < string , data source > data sources ) { this data source lookup = new map data source lookup ( data sources ) ; }


return the session attribute value if present

default < t > t get attribute ( string name ) { return ( t ) get attributes ( ) get ( name ) ; }


attempts to demangle the given string using the default options ( { @ link # create default options ( ) }

public default demangled object demangle ( string mangled ) throws demangled exception { return demangle ( mangled , create default options ( ) ) ; }


returns the number of array elements that use names and that follow this structure

public int get number of named entries ( ) { return number of named entries ; }


private static void set animators enabled ( ) { if ( build version sdk int > = build version codes o & & value animator are animators enabled ( ) ) { return ; } try { / / noinspection java reflection member access field s duration scale field = value animator class get declared field ( " s duration scale " ) ; s duration scale field set accessible ( true ) ; / / noinspection constant conditions float s duration scale = ( float ) s duration scale field get ( null ) ; if ( s duration scale = = 0f ) { s duration scale field set ( null , 1f ) ; log i ( " utils activity lifecycle " , " set animators enabled : animators are enabled now ! " ) ; } } catch ( no such field exception e ) { e print stack trace ( ) ; } catch ( illegal access exception e ) { e print stack trace ( ) ; } }


writes one code unit to the given output destination

protected static void write ( annotated output out , short c 0 ) { out write short ( c 0 ) ; }


rewrites the given { @ link rewriteable } into its primitive form rewriteables that for instance fetch resources from remote hosts or can simplify optimize itself should do their heavy lifting during { @ link # rewrite and fetch ( rewriteable , query rewrite context , action listener ) } ( query rewrite context ) } this method rewrites the rewriteable until it doesn ' t change anymore

static < t extends rewriteable < t > > t rewrite ( t original , query rewrite context context , boolean assert no async tasks ) throws i o exception { t builder = original ; int iteration = 0 ; for ( t rewritten builder = builder rewrite ( context ) ; rewritten builder ! = builder ; rewritten builder = builder rewrite ( context ) ) { if ( assert no async tasks & & context has async actions ( ) ) { throw new illegal state exception ( " async actions are left after rewrite " ) ; } builder = rewritten builder ; if ( iteration + + > = max rewrite rounds ) { / / this is some protection against user provided queries if they don ' t obey the contract of rewrite we allow 16 rounds / / and then we fail to prevent infinite loops throw new illegal state exception ( " too many rewrite rounds , rewriteable might return new objects even if they are not " + " rewritten " ) ; } } return builder ; }


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

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


sets the number of occurrences of { @ code element } to { @ code new count } , but only if the count is currently { @ code expected old count } if { @ code element } does not appear in the multiset exactly { @ code expected old count } times , no changes will be made

public boolean set count ( e element , int expected old count , int new count ) { check not null ( element ) ; check nonnegative ( expected old count , " old count " ) ; check nonnegative ( new count , " new count " ) ; atomic integer existing counter = maps safe get ( count map , element ) ; if ( existing counter = = null ) { if ( expected old count ! = 0 ) { return false ; } else if ( new count = = 0 ) { return true ; } else { / / if our write lost the race , it must have lost to a nonzero value , so we can stop return count map put if absent ( element , new atomic integer ( new count ) ) = = null ; } } int old value = existing counter get ( ) ; if ( old value = = expected old count ) { if ( old value = = 0 ) { if ( new count = = 0 ) { / / just observed a 0 ; try to remove the entry to clean up the map count map remove ( element , existing counter ) ; return true ; } else { atomic integer new counter = new atomic integer ( new count ) ; return ( count map put if absent ( element , new counter ) = = null ) | | count map replace ( element , existing counter , new counter ) ; } } else { if ( existing counter compare and set ( old value , new count ) ) { if ( new count = = 0 ) { / / just c a sed to 0 ; remove the entry to clean up the map if the removal fails , / / another thread has already replaced it with a new counter , which is fine count map remove ( element , existing counter ) ; } return true ; } } } return false ; }


public static string encode ( object parameter ) { if ( parameter = = null ) { return null ; } try { return u r l encoder encode ( parameter to string ( ) , " utf - 8 " ) replace all ( " \ \ + " , " % 20 " ) ; } catch ( unsupported encoding exception e ) { / / should never happen , utf - 8 is always supported throw new runtime exception ( e ) ; } }


public void test complex flush ( ) throws i o exception { configuration conf = new hdfs configuration ( ) ; file contents = append test util init buffer ( append test util file size ) ; file builder base dir = new file ( generic test utils get randomized temp path ( ) ) ; mini d f s cluster cluster = new mini d f s cluster builder ( conf , builder base dir ) build ( ) ; distributed file system fs = cluster get file system ( ) ; try { / / create a new file path file 1 = new path ( " / complex flush dat " ) ; f s data output stream stm = append test util create file ( fs , file 1 , 1 ) ; system out println ( " created file complex flush dat " ) ; int start = 0 ; for ( start = 0 ; ( start + 29 ) < append test util file size ; ) { stm write ( file contents , start , 29 ) ; stm hflush ( ) ; start + = 29 ; } stm write ( file contents , start , append test util file size - start ) ; / / need to make sure we completely write out all full blocks before / / the check file ( ) call ( see f s output summer # flush ) stm flush ( ) ; / / verify that full blocks are sane check file ( fs , file 1 , 1 ) ; stm close ( ) ; / / verify that entire file is good append test util check full file ( fs , file 1 , append test util file size , file contents , " read 2 " ) ; } catch ( i o exception e ) { system out println ( " exception : " + e ) ; throw e ; } catch ( throwable e ) { system out println ( " throwable : " + e ) ; e print stack trace ( ) ; throw new i o exception ( " throwable : " + e ) ; } finally { fs close ( ) ; cluster shutdown ( ) ; } }


public string get uuid ( ) { return uuid ; }


returns a table source matching the descriptor

public static < t > table source < t > find and create table source ( table source factory context context ) { try { return table factory service find ( table source factory class , context get table ( ) to properties ( ) ) create table source ( context ) ; } catch ( throwable t ) { throw new table exception ( " find and create table source failed " , t ) ; } }


returns the hash code of this cell the hash code of a table cell is equal to { @ link objects # hash code } { @ code ( e get row key ( ) , e get column key ( ) , e get value ( ) ) }


returns a string containing the supplied { @ code short } values separated by { @ code separator } for example , { @ code join ( " - " , ( short ) 1 , ( short ) 2 , ( short ) 3 ) } returns the string { @ code " 1 - 2 - 3 " }

public static string join ( string separator , short array ) { check not null ( separator ) ; if ( array length = = 0 ) { return " " ; } / / for pre - sizing a builder , just get the right order of magnitude string builder builder = new string builder ( array length * 6 ) ; builder append ( array [ 0 ] ) ; for ( int i = 1 ; i < array length ; i + + ) { builder append ( separator ) append ( array [ i ] ) ; } return builder to string ( ) ; }


returns a map of environment variables ( derived from configuration ) that should be propagated for actions pertaining to building applications for apple platforms these environment variables are needed to use apple toolkits keys are variable names and values are their corresponding values

public static immutable map < string , string > apple target platform env ( apple platform platform , dotted version sdk version ) { immutable map builder < string , string > builder = immutable map builder ( ) ; builder put ( apple configuration apple sdk version env name , sdk version to string with minimum components ( 2 ) ) put ( apple configuration apple sdk platform env name , platform get name in plist ( ) ) ; return builder build ( ) ; }


public int get sort ( ) { return sort = = internal ? object : sort ; }


get the view type to associate with this model in the recyclerview for models that use a layout resource , the view type is simply the layout resource value by default if this returns 0 epoxy will assign a unique view type for this model at run time

protected int get view type ( ) { return get layout ( ) ; }


nameservice for a p is that cannot be resolved to a specific one

private void init default name service ( configuration conf ) { this default n s enable = conf get boolean ( dfs router default nameservice enable , dfs router default nameservice enable default ) ; if ( ! this default n s enable ) { log warn ( " default name service is disabled " ) ; return ; } this default name service = conf get ( dfs router default nameservice , " " ) ; if ( this default name service equals ( " " ) ) { this default n s enable = false ; log warn ( " default name service is not set " ) ; } else { log info ( " default name service : { } , enabled to read or write " , this default name service ) ; } }


returns a newly - created { @ code immutable graph } based on the contents of this { @ code builder }

public immutable graph < n > build ( ) { return immutable graph copy of ( mutable graph ) ; }


private void layout changed ( string layout name ) { if ( layout transition manager ! = null ) { new task launcher ( new set layout task ( viewer , layout transition manager , layout name ) , null , 1000 ) ; } }


post fakeouterboolean test serialization of outer boolean types

default response entity < boolean > fake outer boolean serialize ( @ api param ( value = " input boolean as post body " ) @ valid @ request body ( required = false ) boolean body ) { return get delegate ( ) fake outer boolean serialize ( body ) ; }


acquires a lock on the translog files and lucene soft - deleted documents to prevent them from being trimmed

public abstract closeable acquire history retention lock ( ) ;


adds a mapping that maps the specified ( optionally wildcard ) host name to the specified output value < a href = " https : en wikipedia orgwiki wildcard dns record " > dns wildcard is supported as hostname for example , you can use { @ code netty io } to match { @ code netty io } and { @ code downloads netty io }

public domain name mapping < v > add ( string hostname , v output ) { map put ( normalize hostname ( check not null ( hostname , " hostname " ) ) , check not null ( output , " output " ) ) ; return this ; }


returns the type of the relocation to perform

public int get type ( ) { return type ; }


returns the string representation of the < code > cron expression < code >

public string to string ( ) { return expression ; }


creates a media type with the " font " type and the given subtype

static media type create font type ( string subtype ) { return create ( font type , subtype ) ; }


public void test void return ( ) { assert equals ( 2 , exec ( " list list = new array list ( ) ; " + " list add ( 2 ) ; " + " list list 2 = new array list ( ) ; " + " list for each ( x - > list 2 add ( x ) ) ; " + " return list [ 0 ] " ) ) ; }


required : service discovery mode for the hosts care must be taken when setting the resolution mode to none for a tcp port without accompanying ip addresses in such cases , traffic to any ip on said port will be allowed ( i e 0 0 0 0 : & lt ; port & gt ; ) < code > istio networking v 1alpha 3 service entry resolution resolution = 5 ; < code >

public builder set resolution value ( int value ) { resolution = value ; on changed ( ) ; return this ; }


parse a data - type string specification with category path if category is not null , the data type manager service will not be queried

public data type parse ( string data type string , category path category ) throws invalid data type exception , cancelled exception { data type string = data type string replace all ( " \ \ s + " , " " ) trim ( ) ; string data type name = get base string ( data type string ) ; data type named dt = get named data type ( data type name , category ) ; if ( named dt = = null ) { throw new invalid data type exception ( " valid data - type not specified " ) ; } return parse data type modifiers ( named dt , data type string substring ( data type name length ( ) ) ) ; }


returns true if this type does not correspond to a non - existent path

public boolean exists ( ) { return this ! = nonexistent ; }


ensures that upon connection to a read - only server client receives connected read only state notification

public void test connection events ( ) throws exception { qu enable local session ( true ) ; qu start quorum ( ) ; countdown watcher watcher = new countdown watcher ( ) ; zoo keeper zk = new zoo keeper ( qu get conn string ( ) , connection timeout , watcher , true ) ; boolean success = false ; for ( int i = 0 ; i < 30 ; i + + ) { try { zk create ( " / test " , " test " get bytes ( ) , zoo defs ids open acl unsafe , create mode persistent ) ; success = true ; break ; } catch ( keeper exception connection loss exception e ) { thread sleep ( 1000 ) ; } } assert true ( success , " did not succeed in connecting in 3 0s " ) ; assert false ( watcher read only connected , " the connection should not be read - only yet " ) ; / / kill peer and wait no more than 5 seconds for read - only server / / to be started ( which should take one tick time ( 2 seconds ) ) qu shutdown ( 2 ) ; / / re - connect the client ( in case we were connected to the shut down / / server and the local session was not persisted ) zk = new zoo keeper ( qu get conn string ( ) , connection timeout , watcher , true ) ; long start = time current elapsed time ( ) ; while ( ! ( zk get state ( ) = = states connectedreadonly ) ) { thread sleep ( 200 ) ; / / todo this was originally 5 seconds , but realistically , on random / slow / virt hosts , there is no way to guarantee this assert true ( time current elapsed time ( ) - start < 30000 , " can ' t connect to the server " ) ; } watcher wait for read only connected ( 5000 ) ; zk close ( ) ; }


retrieve the innermost cause of the given exception , if any

public static throwable get root cause ( @ nullable throwable original ) { if ( original = = null ) { return null ; } throwable root cause = null ; throwable cause = original get cause ( ) ; while ( cause ! = null & & cause ! = root cause ) { root cause = cause ; cause = cause get cause ( ) ; } return root cause ; }


ask this shard to refresh , in the background , to free up heap

protected void write indexing buffer async ( index shard shard ) { thread pool executor ( thread pool names refresh ) execute ( new abstract runnable ( ) { @ override public void do run ( ) { shard write indexing buffer ( ) ; } @ override public void on failure ( exception e ) { logger warn ( ( ) - > new parameterized message ( " failed to write indexing buffer for shard [ { } ] ; ignoring " , shard shard id ( ) ) , e ) ; } } ) ; }


public boolean increment usage with default quota limit ( tenant capacity tenant capacity ) { string sql = " update tenant capacity set ` usage ` = ` usage ` + 1 , gmt modified = ? where tenant id = ? and ` usage ` < " + " ? and quota = 0 " ; try { int affect row = jdbc template update ( sql , tenant capacity get gmt modified ( ) , tenant capacity get tenant ( ) , tenant capacity get quota ( ) ) ; return affect row = = 1 ; } catch ( cannot get jdbc connection exception e ) { fatal log error ( " [ db - error ] " , e ) ; throw e ; } }


creates new fix , that adds static method call as an argument to the original method call

static intention action create add method call fix ( psi method call expression original method call , string cls name , string method name , psi element factory element factory ) { psi expression list new argument list = create argument list ( original method call get context ( ) , cls name , method name , element factory ) ; string fix description = " add " + method name + " ( ) " + get capitalized metho name ( original method call ) ; return new add argument fix ( original method call , new argument list , fix description ) ; }


to test \ & quot ; client \ & quot ; model to test \ & quot ; client \ & quot ; model

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


shuts { @ link image pipeline factory } down

public static synchronized void shut down ( ) { if ( s instance ! = null ) { s instance get bitmap memory cache ( ) remove all ( android predicates < cache key > true ( ) ) ; s instance get encoded memory cache ( ) remove all ( android predicates < cache key > true ( ) ) ; s instance = null ; } }


searches for the first occurrence of a { @ link component provider } that is an instance of the given < code > provider class < code >

public static < t extends component provider > t get component provider ( class < t > clazz ) { docking window manager dwm = find active docking window manager ( ) ; assert not null ( " unable to find a docking window manager - is there a tool showing ? " , dwm ) ; return get component provider ( dwm , clazz ) ; }


file [ ] list all task directories ( ) { final file [ ] task directories ; if ( ! has persistent stores | | ! state dir exists ( ) ) { task directories = new file [ 0 ] ; } else { task directories = state dir list files ( pathname - > pathname is directory ( ) & & path name matcher ( pathname get name ( ) ) matches ( ) ) ; } return task directories = = null ? new file [ 0 ] : task directories ; }


get capacity at time based on periodic repetition

public resource get capacity at time ( long tick ) { long converted time = ( tick % time period ) ; return super get capacity at time ( converted time ) ; }


returns whether it ' s allowed to create runfile symlinks in the { @ code runfiles dir } also returns { @ code false } if the runfiles supplier doesn ' t know about the directory

boolean is runfile links enabled ( path fragment runfiles dir ) ;


protected void set gesture detector ( @ nullable gesture detector gesture detector ) { m gesture detector = gesture detector ; if ( m gesture detector ! = null ) { m gesture detector set click listener ( this ) ; } }


writes a portion of a { @ code byte [ ] } to this instance

public void write ( byte [ ] bytes , int offset , int length ) ;


return the description of the resource that the bean definition came from

public string get resource description ( ) { return string value of ( super get resource description ( ) ) ; }


public a p itest group parameters request required string group ( integer required string group ) { this required string group = required string group ; return this ; }


skip a test because the client is using fault injection this should only be done for those tests which are measuring the cost of operations or otherwise cannot handle retries

public static void skip during fault injection ( s 3 a file system fs ) { assume assume false ( " skipping as filesystem has fault injection " , is fault injecting ( fs ) ) ; }


public static drawable get activity icon ( @ non null final component name activity name ) { package manager pm = utils get app ( ) get package manager ( ) ; try { return pm get activity icon ( activity name ) ; } catch ( package manager name not found exception e ) { e print stack trace ( ) ; return null ; } }


public void test big cat ( ) { / / todo : test big cat }


extract a byte array from the given { @ link bytes message }

protected byte [ ] extract byte array from message ( bytes message message ) throws j m s exception { byte [ ] bytes = new byte [ ( int ) message get body length ( ) ] ; message read bytes ( bytes ) ; return bytes ; }


parse the given input into millis - since - epoch

default long parse millis ( string input ) { return date formatters from ( parse ( input ) ) to instant ( ) to epoch milli ( ) ; }


ends processing of an async task blocks the current thread if necessary and returns the evaluated value of the completed task

< t > t end process ( async result < t > async result ) throws execution exception , interrupted exception ;


assert that a file system list status on a dir finds the subdirchild entry

public static void assert list status finds ( file system fs , path dir , path subdir ) throws i o exception { file status [ ] stats = fs list status ( dir ) ; boolean found = false ; string builder builder = new string builder ( ) ; for ( file status stat : stats ) { builder append ( stat to string ( ) ) append ( ' \ n ' ) ; if ( stat get path ( ) equals ( subdir ) ) { found = true ; } } assert true ( " path " + subdir + " not found in directory " + dir + " : " + builder , found ) ; }


return a future which can be used to check the result for a given partition

public kafka future < void > partition result ( final topic partition partition ) { final kafka future impl < void > result = new kafka future impl < > ( ) ; this future when complete ( new bi consumer < map < topic partition , errors > , throwable > ( ) { @ override public void accept ( final map < topic partition , errors > topic partitions , final throwable throwable ) { if ( throwable ! = null ) { result complete exceptionally ( throwable ) ; } else if ( ! topic partitions contains key ( partition ) ) { result complete exceptionally ( new illegal argument exception ( " alter offset for partition \ " " + partition + " \ " was not attempted " ) ) ; } else { final errors error = topic partitions get ( partition ) ; if ( error = = errors none ) { result complete ( null ) ; } else { result complete exceptionally ( error exception ( ) ) ; } } } } ) ; return result ; }


finds the least loaded node that satisfies the selector criteria

protected discovery node select least loaded node ( cluster state cluster state , predicate < discovery node > selector ) { long min load = long max value ; discovery node min loaded node = null ; persistent tasks custom metadata persistent tasks = cluster state get metadata ( ) custom ( persistent tasks custom metadata type ) ; for ( discovery node node : cluster state get nodes ( ) ) { if ( selector test ( node ) ) { if ( persistent tasks = = null ) { / / we don ' t have any task running yet , pick the first available node return node ; } long number of tasks = persistent tasks get number of tasks on node ( node get id ( ) , task name ) ; if ( min load > number of tasks ) { min load = number of tasks ; min loaded node = node ; } } } return min loaded node ; }


private void refresh reference key list ( ) { active reference key = null ; reference keys clear ( ) ; u i utils sync exec ( ( ) - > { data viewer clear data ( ) ; fk combo remove all ( ) ; data viewer show empty presentation ( ) ; } ) ; list < d b d attribute binding > visible attributes = parent controller get model ( ) get visible attributes ( ) ; if ( visible attributes is empty ( ) ) { return ; } parent data container = parent controller get data container ( ) ; if ( parent data container = = null ) { return ; } set < d b s entity > all entities = new linked hash set < > ( ) ; for ( d b d attribute binding attr : visible attributes ) { d b s entity attribute entity attribute = attr get entity attribute ( ) ; if ( entity attribute ! = null ) { all entities add ( entity attribute get parent object ( ) ) ; } } if ( all entities is empty ( ) & & parent data container instanceof d b s entity ) { all entities add ( ( d b s entity ) parent data container ) ; } list < reference key memo > ref key memos = new array list < > ( ) ; { d b v entity v entity owner = d b v utils get virtual entity ( parent data container , false ) ; if ( v entity owner ! = null ) { object active associations = v entity owner get property ( v prop active associations ) ; if ( active associations instanceof collection ) { for ( object ref key memo map : ( collection ) active associations ) { if ( ref key memo map instanceof map ) { ref key memos add ( new reference key memo ( ( map ) ref key memo map ) ) ; } } } } } if ( ! all entities is empty ( ) ) { new abstract job ( " load reference keys " ) { @ override protected i status run ( d b r progress monitor monitor ) { monitor begin task ( " load references " , all entities size ( ) ) ; try { list < reference key > refs = new array list < > ( ) ; for ( d b s entity entity : all entities ) { monitor sub task ( entity get name ( ) ) ; if ( entity instanceof d b v entity ) { / / skip virtual entities continue ; } / / foreign keys collection < ? extends d b s entity association > associations = d b v utils get all associations ( monitor , entity ) ; for ( d b s entity association assoc : associations ) { if ( assoc instanceof d b s entity referrer ) { list < ? extends d b s entity attribute ref > attrs = ( ( d b s entity referrer ) assoc ) get attribute references ( monitor ) ; if ( ! common utils is empty ( attrs ) ) { reference key reference key = new reference key ( monitor , false , assoc get associated entity ( ) , assoc , attrs ) ; refs add ( reference key ) ; } } } / / references collection < ? extends d b s entity association > references = d b v utils get all references ( monitor , entity ) ; { for ( d b s entity association assoc : references ) { if ( assoc instanceof d b s entity referrer ) { list < ? extends d b s entity attribute ref > attrs = ( ( d b s entity referrer ) assoc ) get attribute references ( monitor ) ; if ( ! common utils is empty ( attrs ) ) { reference key reference key = new reference key ( monitor , true , entity , assoc , attrs ) ; refs add ( reference key ) ; } } } } monitor worked ( 1 ) ; } synchronized ( reference keys ) { reference keys clear ( ) ; reference keys add all ( refs ) ; / / detect active ref key from memo if ( ! reference keys is empty ( ) ) { if ( ! ref key memos is empty ( ) ) { for ( reference key key : reference keys ) { for ( reference key memo memo : ref key memos ) { if ( key matches ( memo ) ) { active reference key = key ; break ; } } if ( active reference key ! = null ) break ; } } if ( active reference key = = null ) { active reference key = reference keys get ( 0 ) ; } } } u i utils sync exec ( ( ) - > fill keys combo ( ) ) ; } catch ( d b exception e ) { log debug ( " error reading references " , e ) ; / / do not show errors references or f ks may be unsupported by current database } finally { monitor done ( ) ; } return status ok status ; } } schedule ( ) ; } }


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

public static fields find by thrift id ( int field id ) { switch ( field id ) { case 1 : / / e return e ; default : return null ; } }


the subset of the replicas that are offline

public node [ ] offline replicas ( ) { return offline replicas ; }


starts a jnlp agent and makes sure it successfully connects to jenkins

public void test launch ( ) throws exception { assume assume false ( " skipping j n l p launcher test test launch because we are running headless " , graphics environment is headless ( ) ) ; computer c = add test agent ( false ) ; launch jnlp and verify ( c , build jnlp args ( c ) ) ; }


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


handle the error in the given response with the given resolved status code the default implementation throws : { @ link http client error exception } if the status code is in the 4xx series , or one of its sub - classes such as { @ link http client error exception bad request } and others { @ link http server error exception } if the status code is in the 5xx series , or one of its sub - classes such as { @ link http server error exception internal server error } and others { @ link unknown http status code exception } for error status codes not in the { @ link http status } enum range

public void handle error ( client http response response ) throws i o exception { http status status code = http status resolve ( response get raw status code ( ) ) ; if ( status code = = null ) { byte [ ] body = get response body ( response ) ; string message = get error message ( response get raw status code ( ) , response get status text ( ) , body , get charset ( response ) ) ; throw new unknown http status code exception ( message , response get raw status code ( ) , response get status text ( ) , response get headers ( ) , body , get charset ( response ) ) ; } handle error ( response , status code ) ; }


helper method to create a content chunk indicating a invalid decoding result

private memcache content invalid chunk ( exception cause ) { state = state bad message ; memcache content chunk = new default last memcache content ( unpooled empty buffer ) ; chunk set decoder result ( decoder result failure ( cause ) ) ; return chunk ; }


checks whether a string matches a given wildcard pattern

public static boolean match ( char sequence string , char sequence pattern ) { return match ( string , pattern , 0 , 0 ) ; }


returns the { @ link method } instance for { @ link # test add supported null present ( ) } so that tests can suppress it see { @ link collection add tester # get add null supported method ( ) } for details

public static method get add supported null present method ( ) { return helpers get method ( set add tester class , " test add supported null present " ) ; }


tries to allocate slots for the given requirement if there are not enough slots available , the resource manager is informed to allocate more resources

private int internal try allocate slots ( job i d job id , string target address , resource requirement resource requirement ) { final resource profile required resource = resource requirement get resource profile ( ) ; collection < task manager slot information > free slots = slot tracker get free slots ( ) ; int num unfulfilled = 0 ; for ( int x = 0 ; x < resource requirement get number of required slots ( ) ; x + + ) { final optional < task manager slot information > reserved slot = slot matching strategy find matching slot ( required resource , free slots , this : : get number registered slots of ) ; if ( reserved slot is present ( ) ) { / / we do not need to modify free slots because it is indirectly modified by the / / allocation allocate slot ( reserved slot get ( ) , job id , target address , required resource ) ; } else { / / exit loop early ; we won ' t find a matching slot for this requirement int num remaining = resource requirement get number of required slots ( ) - x ; num unfulfilled + = num remaining ; break ; } } return num unfulfilled ; }


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

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


temporary files they get moved to the finalized block directory when the block is finalized

file create tmp file ( string bpid , block b ) throws i o exception { check reference ( ) ; reserve space for replica ( b get num bytes ( ) ) ; try { return get block pool slice ( bpid ) create tmp file ( b ) ; } catch ( i o exception exception ) { release reserved space ( b get num bytes ( ) ) ; throw exception ; } }


cancel an existing delegation { @ link token }

public cancel delegation token response cancel delegation token ( cancel delegation token request request ) throws yarn exception , i o exception ;


returns the extended tcp keepinterval socket option , if available on this jdk

public static socket option < integer > get tcp keep interval socket option or null ( ) { return get extended socket option or null ( " tcp keepinterval " ) ; }


check if the configuration contains the specified key

default boolean contains key ( string key ) { return get property ( key ) ! = null ; }


an integer that contains the value of this symbol the format of this value is different for each type of symbol

public long get value ( ) { return n value ; }


helper function which puts a given s 3 a file status into the metadata store and returns the same s 3 a file status instrumentation monitors the put operation

public static s 3 a file status put and return ( metadata store ms , s 3 a file status status , i ttl time provider time provider ) throws i o exception { return put and return ( ms , status , time provider , null ) ; }


follow code flow and identify address set to be cleared if offcut code is encountered , it will be cleared immediately

private address set view find instruction flow ( program program , address first addr , address set view clear set , stack < address > todo starts , task monitor monitor ) throws cancelled exception { address set block set = new address set ( ) ; listing listing = program get listing ( ) ; symbol table symbol table = program get symbol table ( ) ; if ( clear offcut ) { / / check for initial offcut instruction instruction prev instr = listing get instruction before ( first addr ) ; if ( prev instr ! = null & & first addr compare to ( prev instr get max address ( ) ) < = 0 ) { clear offcut flow ( listing get instruction at ( first addr ) , todo starts , monitor ) ; return block set ; } } hashtable < address , block vertex > vertex map = new hashtable < > ( ) ; simple block model block model = new simple block model ( program ) ; stack < block vertex > todo vertices = new stack < > ( ) ; set < address > dest addrs = new hash set < > ( ) ; / / re - usable set for collecting block destination addrs / / establish start vertex within flow graph code block start block = block model get first code block containing ( first addr , monitor ) ; block set add ( start block ) ; block vertex start vertex = new block vertex ( start block ) ; vertex map put ( start block get min address ( ) , start vertex ) ; todo vertices push ( start vertex ) ; boolean never snip start block = ( start addrs contains ( first addr ) ) ; / / follow start block flow and build graph while ( ! todo vertices is empty ( ) ) { monitor check canceled ( ) ; block vertex from vertex = todo vertices pop ( ) ; code block from block = from vertex block ; if ( protected set contains ( from block get min address ( ) ) ) { continue ; } from block = adjust block for split protected block ( program , block model , from block get first start address ( ) , from block ) ; / / hot spot - get destinations ( ) code block reference iterator block ref iter = from block get destinations ( monitor ) ; if ( clear offcut ) { find dest addrs ( from block , dest addrs ) ; / / needed for detecting offcut flows } while ( block ref iter has next ( ) ) { monitor check canceled ( ) ; code block reference cb ref = block ref iter next ( ) ; address block addr = cb ref get reference ( ) ; if ( protected set contains ( block addr ) ) { continue ; } if ( clear set contains ( block addr ) ) { continue ; } code block dest block = cb ref get destination block ( ) ; if ( block addr equals ( dest block get first start address ( ) ) ) { dest block = adjust block for split protected block ( program , block model , block addr , dest block ) ; } if ( never snip start block & & dest block equals ( start block ) ) { continue ; / / do not allow incoming edges to start block vertex } block vertex dest vertex = vertex map get ( block addr ) ; if ( dest vertex = = null ) { if ( listing get instruction at ( block addr ) = = null ) { continue ; / / do not include data } symbol s = symbol table get primary symbol ( block addr ) ; if ( s ! = null & & s get symbol type ( ) = = symbol type function ) { source type source = s get source ( ) ; if ( source = = source type user defined | | source = = source type imported ) { continue ; / / keep imported or user - defined function } } if ( clear offcut & & ! dest addrs contains ( block addr ) ) { / / offcut flow was cleared - skip this block if ( clear offcut flow ( dest block , todo starts , monitor ) ) { continue ; } } / / todo : check disassembly hint block set add ( dest block ) ; dest vertex = new block vertex ( dest block ) ; vertex map put ( block addr , dest vertex ) ; todo vertices push ( dest vertex ) ; } / / hot spot - hash set add ( ) from vertex dest vertices add ( dest vertex ) ; dest vertex src vertices add ( from vertex ) ; } } / / if start address not start of block , never clear the first part of the block if ( ! first addr equals ( start block get min address ( ) ) ) { block set delete range ( start block get min address ( ) , first addr previous ( ) ) ; } reference manager ref mgr = program get reference manager ( ) ; function manager function manager = program get function manager ( ) ; iterator < block vertex > vertex iter = vertex map values ( ) iterator ( ) ; while ( vertex iter has next ( ) ) { monitor check canceled ( ) ; block vertex v = vertex iter next ( ) ; if ( v = = start vertex | | v src vertices is empty ( ) ) { continue ; } address addr = v block get min address ( ) ; instruction instr = listing get instruction at ( addr ) ; address fall from = instr get fall from ( ) ; if ( fall from ! = null & & ! block set contains ( fall from ) ) { prune ( v , block set ) ; } else { reference iterator ref iter = ref mgr get references to ( addr ) ; / / if there are no references , and there is a defined function inside this block / / that starts in this block , with no references to it , then this bad flow couldn ' t / / have created it / / todo : maybe even just symbols with no refs to them should be snipped / / code starts at the symbol someone might have disassembled there if ( ! ref iter has next ( ) & & function manager get function at ( addr ) ! = null ) { prune ( v , block set ) ; continue ; } while ( ref iter has next ( ) ) { monitor check canceled ( ) ; reference ref = ref iter next ( ) ; address from addr = ref get from address ( ) ; ref type ref type = ref get reference type ( ) ; if ( ref type is flow ( ) & & ! block set contains ( from addr ) & & ! clear set contains ( from addr ) ) { prune ( v , block set ) ; break ; } / / any addr which corresponds to a entry - point function should be snipped if ( ref type = = ref type external ref & & function manager get function at ( addr ) ! = null ) { prune ( v , block set ) ; break ; } } } } if ( repair ) { clear bad bookmarks ( program , block set , monitor ) ; } return block set ; }


like { @ code scratch file } , but the lines are added to the end if the file already exists

public path append file ( string path name , charset charset , string lines ) throws i o exception { path path = resolve ( path name ) ; string builder content = new string builder ( ) ; if ( path exists ( ) ) { content append ( read file ( path name ) ) ; content append ( " \ n " ) ; } content append ( lines as string ( lines ) ) ; return overwrite file ( path name , content to string ( ) ) ; }


returns a class value with the given class name

private static < t > flink kafka partitioner < t > initialize partitioner ( string name , class loader class loader ) { try { class < ? > clazz = class for name ( name , true , class loader ) ; if ( ! flink kafka partitioner class is assignable from ( clazz ) ) { throw new validation exception ( string format ( " sink partitioner class ' % s ' should extend from the required class % s " , name , flink kafka partitioner class get name ( ) ) ) ; } @ suppress warnings ( " unchecked " ) final flink kafka partitioner < t > kafka partitioner = instantiation util instantiate ( name , flink kafka partitioner class , class loader ) ; return kafka partitioner ; } catch ( class not found exception | flink exception e ) { throw new validation exception ( string format ( " could not find and instantiate partitioner class ' % s ' " , name ) , e ) ; } }


< code > optional int 6 4 num = 4 ; < code >

public builder clear num ( ) { bit field 0 = ( bit field 0 & ~ 0x 0 0 0 0 0 0 0 8 ) ; num = 0l ; on changed ( ) ; return this ; }


returns a serializable converter object that converts between strings and shorts using { @ link short # decode } and { @ link short # to string ( ) } the returned converter throws { @ link number format exception } if the input string is invalid < b > warning : < b > please see { @ link short # decode } to understand exactly how strings are parsed for example , the string { @ code " 0123 " } is treated as octal and converted to the value { @ code 83 }

public static converter < string , short > string converter ( ) { return short converter instance ; }


override this to replace the animation text with something dynamic this can be used for translations or custom data

private string get text ( string input ) { return input ; }


public void capital snake test ( ) { / / todo : test capital snake }


returns the major version of the host java runtime ( e g ' 8 ' for jdk 8 ) , using { @ link runtime # version } if it is available , and otherwise falling back to the { @ code java class version } system property

static int host major version ( ) { try { method version method = runtime class get method ( " version " ) ; object version = version method invoke ( null ) ; return ( int ) version get class ( ) get method ( " major " ) invoke ( version ) ; } catch ( reflective operation exception e ) { / / runtime version ( ) isn ' t available on jdk 8 ; continue below } int version = ( int ) double parse double ( system get property ( " java class version " ) ) ; if ( 49 < = version & & version < = 52 ) { return version - ( 49 - 5 ) ; } throw new illegal state exception ( " unknown java version : " + system get property ( " java specification version " ) ) ; }


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


determine whether to suppress { @ link system # getenv ( ) } { @ link system # getenv ( string ) } access for the purposes of { @ link # get system environment ( ) } if this method returns { @ code true } , an empty dummy map will be used instead of the regular system environment map , never even trying to call { @ code getenv } and therefore avoiding security manager warnings ( if any ) the default implementation checks for the " spring getenv ignore " system property , returning { @ code true } if its value equals " true " in any case

protected boolean suppress getenv access ( ) { return spring properties get flag ( ignore getenv property name ) ; }


partition the model - m subroutine graph using the model - p algorythm the method create block graph ( ) must first be called to generate the initial model - m graph

private void partition graph ( task monitor monitor ) throws cancelled exception { / / make entry point list and set their source number attribute linked list < vertex > entry list = new linked list < > ( ) ; vertex [ ] sources = g get sources ( ) ; for ( vertex source : sources ) { entry list add last ( source ) ; } linked list < vertex > todo stack = new linked list < > ( ) ; boolean source list is growing = true ; while ( source list is growing ) { source list is growing = false ; integer attribute < vertex > source number = ( integer attribute < vertex > ) vertex attributes create attribute ( source number , attribute type ) ; int cnt = entry list size ( ) ; for ( int i = 0 ; i < cnt ; i + + ) { todo stack add last ( entry list get ( i ) ) ; / / initialize stack with entry point while ( ! todo stack is empty ( ) ) { / / traverse the graph from source if ( monitor is cancelled ( ) ) { throw new cancelled exception ( ) ; } vertex v = todo stack remove last ( ) ; / / pop vertex off todo stack source number set value ( v , i + 1 ) ; set < vertex > children = g get children ( v ) ; if ( children is empty ( ) ) { continue ; } iterator < vertex > child iter = children iterator ( ) ; while ( child iter has next ( ) ) { vertex child = child iter next ( ) ; / / check to see if child has already been labeled / / if not , give it label of current source int source value = 0 ; try { source value = source number get value ( child ) ; if ( source value = = i + 1 ) { / / there ' s a cycle - - need to break out continue ; } } catch ( no value exception n v e ) { source value = i + 1 ; } / / if child ' s label is the same as the source , continue traversing graph / / if child ' s label differs from source , we found a new entry point ! / / in later case , don ' t traverse graph - - removing incoming edges / / and add to entry list if ( source value = = i + 1 ) { todo stack add last ( child ) ; } else { / / remove all edges going into child set < edge > incoming edges = g get incoming edges ( child ) ; iterator < edge > edge iter = incoming edges iterator ( ) ; while ( edge iter has next ( ) ) { g remove ( edge iter next ( ) ) ; } / / add child to entry list entry list add last ( child ) ; / / child has entry point ent attribute set value ( child , 0 ) ; source list is growing = true ; } } } } } }


post usercreate with list : creates list of users with given input array

default response entity < void > create users with list input ( @ api param ( value = " list of user object " , required = true ) @ valid @ request body list < user > body ) { return new response entity < > ( http status not implemented ) ; }


create a target source for bean instances uses any target source creators if set returns { @ code null } if no custom target source should be used this implementation uses the " custom target source creators " property subclasses can override this method to use a different mechanism

protected target source get custom target source ( class < ? > bean class , string bean name ) { / / we can ' t create fancy target sources for directly registered singletons if ( this custom target source creators ! = null & & this bean factory ! = null & & this bean factory contains bean ( bean name ) ) { for ( target source creator tsc : this custom target source creators ) { target source ts = tsc get target source ( bean class , bean name ) ; if ( ts ! = null ) { / / found a matching target source if ( logger is trace enabled ( ) ) { logger trace ( " target source creator [ " + tsc + " ] found custom target source for bean with name ' " + bean name + " ' " ) ; } return ts ; } } } / / no custom target source found return null ; }


here we override the super method to avoid test error from ` describe statement ` supported in original calcite

public void test describe statement ( ) { }


public float get float ( ) { return float ; }


public void set initialized ( boolean ini ) { this initialized = ini ; }


validate that the provided name is a valid application , or a wildcard pattern for an application and throws an exception otherwise

public static void validate application name or wildcard ( string application ) { validate application name ( application , true ) ; }


adds an unnamed value to the formatted output it is strongly encouraged to use { @ link # add ( string , char ) } instead and give value a readable name

public to string helper add value ( char value ) { return add holder ( string value of ( value ) ) ; }


public void triangle type test ( ) { / / todo : test triangle type }


calculate score authentication risk score

protected big decimal calculate score ( final http servlet request request , final authentication authentication , final registered service service , final collection < ? extends cas event > events ) { return highest risk score ; }


create the highlighters ( { @ code paintable } s to show which vertices have been selected or focused )

private void build highlighers ( ) { / / for highlighting of multiple selected vertices multi selected vertex paintable < attributed vertex , attributed edge > multi selected vertex paintable = multi selected vertex paintable builder ( viewer ) selection stroke min ( 4 f ) selection paint ( color red ) use bounds ( false ) build ( ) ; / / manages highlight painting of a single selected vertex single selected vertex paintable < attributed vertex , attributed edge > single selected vertex paintable = single selected vertex paintable builder ( viewer ) selection stroke min ( 4 f ) selection paint ( color red ) selected vertex function ( vs - > this focused vertex ) build ( ) ; / / draws the selection highlights viewer add post render paintable ( multi selected vertex paintable ) ; / / draws the location arrow viewer add post render paintable ( single selected vertex paintable ) ; }


sets a new position and size for this ellipse

public void set ( float x , float y , float width , float height ) { this x = x ; this y = y ; this width = width ; this height = height ; }


simpler variant of { @ link # expected output ( string [ ] , string ) } that converts the { @ link checksum } to a string and ignores leading and trailing newlines

protected void expected checksum ( string [ ] parameters , long expected count , long expected checksum ) throws exception { checksum checksum = new checksum ( expected count , expected checksum ) ; expected output ( parameters , " \ n * " + checksum to string ( ) + " \ n * " ) ; }


get the location under the build directory to store the file parameter

private file get location under build ( abstract build build ) { return new file ( get file parameter folder under build ( build ) , location ) ; }