gets whether the state backend is configured to use a fixed amount of memory shared between all rocks d b instances ( in all tasks and operators ) of a slot see { @ link rocks d b options # use managed memory } for details

public boolean is using fixed memory per slot ( ) { return fixed memory per slot ! = null ; }


expressions for retracting the mutable aggregation buffer based on an input row

public abstract expression [ ] retract expressions ( ) ;


synchronized override of { @ link constrained executor service # execute ( runnable ) } to ensure that view of memory is consistent between different threads executing tasks serially

public synchronized void execute ( runnable runnable ) { super execute ( runnable ) ; }


wrapper of { @ link pl droidsonroids gif gif drawable # gif drawable ( byte [ ] ) }

public t from ( byte [ ] bytes ) { m input source = new input source byte array source ( bytes ) ; return self ( ) ; }


returns an array containing all of the elements in this queue , in proper sequence ; the runtime type of the returned array is that of the specified array if the queue fits in the specified array , it is returned therein otherwise , a new array is allocated with the runtime type of the specified array and the size of this queue if this queue fits in the specified array with room to spare ( i e , the array has more elements than this queue ) , the element in the array immediately following the end of the queue is set to < tt > null < tt > like the { @ link # to array ( ) } method , this method acts as bridge between array - based and collection - based a p is further , this method allows precise control over the runtime type of the output array , and may , under certain circumstances , be used to save allocation costs suppose < tt > x < tt > is a queue known to contain only strings the following code can be used to dump the queue into a newly allocated array of < tt > string < tt > : string [ ] y = x to array ( new string [ 0 ] ) ; note that < tt > to array ( new object [ 0 ] ) < tt > is identical in function to < tt > to array ( ) < tt >

public < t > t [ ] to array ( t [ ] a ) { final e [ ] items = this items ; final monitor monitor = this monitor ; monitor enter ( ) ; try { if ( a length < count ) a = object arrays new array ( a , count ) ; int k = 0 ; int i = take index ; while ( k < count ) { / / this cast is not itself safe , but the following statement / / will fail if the runtime type of items [ i ] is not assignable / / to the runtime type of a [ k + + ] , which is all that the method / / contract requires ( see @ throws array store exception above ) @ suppress warnings ( " unchecked " ) t t = ( t ) items [ i ] ; a [ k + + ] = t ; i = inc ( i ) ; } if ( a length > count ) a [ count ] = null ; return a ; } finally { monitor leave ( ) ; } }


generate the config option key for the configuration key of external resource in the deploying system

public static string get system config key config option for resource ( string resource name , string suffix ) { return key with resource name and suffix ( resource name , suffix ) ; }


given an output filename , write a bunch of random records to it

public void map ( text key , text value , context context ) throws i o exception , interrupted exception { int item count = 0 ; while ( num bytes to write > 0 ) { / / generate the key / value int no words key = min words in key + ( words in key range ! = 0 ? random next int ( words in key range ) : 0 ) ; int no words value = min words in value + ( words in value range ! = 0 ? random next int ( words in value range ) : 0 ) ; text key words = generate sentence ( no words key ) ; text value words = generate sentence ( no words value ) ; / / write the sentence context write ( key words , value words ) ; num bytes to write - = ( key words get length ( ) + value words get length ( ) ) ; / / update counters , progress etc context get counter ( counters bytes written ) increment ( key words get length ( ) + value words get length ( ) ) ; context get counter ( counters records written ) increment ( 1 ) ; if ( + + item count % 200 = = 0 ) { context set status ( " wrote record " + item count + " " + num bytes to write + " bytes left " ) ; } } context set status ( " done with " + item count + " records " ) ; }


gets the total instruction count for this instance , ignoring mark - local instructions which are not actually emitted

public int get effective instruction count ( ) { int sz = size ( ) ; int result = 0 ; for ( int i = 0 ; i < sz ; i + + ) { basic block one = ( basic block ) get or null 0 ( i ) ; if ( one ! = null ) { insn list insns = one get insns ( ) ; int insns sz = insns size ( ) ; for ( int j = 0 ; j < insns sz ; j + + ) { insn insn = insns get ( j ) ; if ( insn get opcode ( ) get opcode ( ) ! = reg ops mark local ) { result + + ; } } } } return result ; }


private static long byte array to long ( byte [ ] ba , int offset ) { long l = 0 ; for ( int i = 0 ; i < size of long ; + + i ) { l | = ( ba [ offset + size of long - 1 - i ] & 0xff l ) < < ( i < < 3 ) ; } return l ; }


public collection < ? extends item > items ( ) { return list ; }


creates a consumer which only consumes power when the condition is met

public < t extends building > consume power power cond ( float usage , boolf < t > cons ) { return add ( new conditional consume power ( usage , ( boolf < building > ) cons ) ) ; }


this is technically invalid json , and we don ' t want to simply ignore the blank entry

public void should fail to parse string of map with int values with blank entries ( ) { assert throws ( data exception class , ( ) - > values convert to map ( schema string schema , " { \ " foo \ " : \ " 1234567890 \ " , , \ " bar \ " : \ " 0 \ " , \ " baz \ " : \ " boz \ " } " ) ) ; }


public int get call site table length ( ) { return call site table length ; }


apply the given properties to the given bean factory

protected abstract void process properties ( configurable listable bean factory bean factory , properties props ) throws beans exception ;


return true if this additional properties number object is equal to o

public boolean equals ( object o ) { if ( this = = o ) { return true ; } if ( o = = null | | get class ( ) ! = o get class ( ) ) { return false ; } additional properties number additional properties number = ( additional properties number ) o ; return objects equals ( this name , additional properties number name ) & & objects equals ( this additional properties , additional properties number additional properties ) & & super equals ( o ) ; }


generate repository change event following the status change of an item

public void item changed ( string parent path , string item name ) { boolean sync err = true ; repository folder parent folder ; try { parent folder = get folder ( null , parent path , false ) ; if ( parent folder ! = null ) { repository file rf = parent folder get file ( item name ) ; if ( rf ! = null ) { rf item changed ( ) ; sync err = false ; } } } catch ( invalid name exception e ) { throw new assert exception ( ) ; } catch ( i o exception e ) { repository manager log ( name , repository folder make pathname ( parent path , item name ) , " error ! " + e get message ( ) , null ) ; } if ( sync err ) { repository manager log ( name , null , " error ! repository instance may be out - of - sync " , null ) ; return ; } repository change event event = new repository change event ( repository change event rep item changed , parent path , item name , null , null ) ; send change event ( event ) ; }


initialize a web data binder with { @ code @ init binder } methods if the { @ code @ init binder } annotation specifies attributes names , it is invoked only if the names include the target object name

public void init binder ( web data binder data binder , native web request request ) throws exception { for ( invocable handler method binder method : this binder methods ) { if ( is binder method applicable ( binder method , data binder ) ) { object return value = binder method invoke for request ( request , null , data binder ) ; if ( return value ! = null ) { throw new illegal state exception ( " @ init binder methods must not return a value ( should be void ) : " + binder method ) ; } } } }


private void enable protocol ( protocol protocol ) { enable tls ( ) ; client = client new builder ( ) protocols ( as list ( protocol , protocol http 1 1 ) ) build ( ) ; server set protocols ( client protocols ( ) ) ; }


returns random capacity , if the size is smaller than 10 they are t bs otherwise the size is assigned to gb range

private long get random capacity ( ) { int size = disk sizes [ rand next int ( disk sizes length ) ] ; if ( size < 10 ) { return size * tb ; } else { return size * gb ; } }


handles a mouse click for the given program location on an { @ link ghidra util bean field annotated text field element }

public boolean handle mouse click ( program location location , mouse event mouse event , service provider service provider ) ;


set the underlying output format for lazy output format

public static void set output format class ( job conf job , class < ? extends output format > the class ) { job set output format ( lazy output format class ) ; job set class ( " mapreduce output lazyoutputformat outputformat " , the class , output format class ) ; }


disposes the { @ link client request interceptor }

public void shutdown ( ) { if ( this next interceptor ! = null ) { this next interceptor shutdown ( ) ; } }


returns the y screen location of the popup point


return if the there are no more path elements in the pattern

protected final boolean is no more pattern ( ) { return this next = = null ; }


private int load resource ( string name ) { url url = get resource ( name ) ; if ( url = = null ) { err ( " resource not found : % s " , name ) ; return e not found ; } out ( " % s : % s " , name , url ) ; return success ; }


emits a bridge method for a field with a { @ link opcodes putfield } access

public method visitor visit put field ( field key field key , class visitor cv ) { method key bridge method key = field key bridge of instance write ( ) ; method visitor mv = cv visit method ( acc synthetic | acc static , bridge method key name ( ) , bridge method key descriptor ( ) , / * signature = * / null , / * exceptions = * / null ) ; mv visit code ( ) ; mv visit var insn ( opcodes aload , 0 ) ; type field type = field key get field type ( ) ; mv visit var insn ( field type get opcode ( opcodes iload ) , 1 ) ; mv visit insn ( lang model helper get type size aligned dup opcode ( immutable list of ( field key get field type ( ) ) , immutable list of ( type get type ( object class ) ) ) ) ; mv visit field insn ( opcodes putfield , field key owner name ( ) , field key name ( ) , field key descriptor ( ) ) ; mv visit insn ( field type get opcode ( opcodes ireturn ) ) ; int field type size = field type get size ( ) ; mv visit maxs ( field type size , field type size ) ; mv visit end ( ) ; return mv ; }


resets the color map to the predefined colors

public static void reset ( ) { map clear ( ) ; map put ( " clear " , color clear ) ; map put ( " black " , color black ) ; map put ( " white " , color white ) ; map put ( " light gray " , color light gray ) ; map put ( " gray " , color gray ) ; map put ( " dark gray " , color dark gray ) ; map put ( " blue " , color blue ) ; map put ( " navy " , color navy ) ; map put ( " royal " , color royal ) ; map put ( " slate " , color slate ) ; map put ( " sky " , color sky ) ; map put ( " cyan " , color cyan ) ; map put ( " teal " , color teal ) ; map put ( " green " , color green ) ; map put ( " chartreuse " , color chartreuse ) ; map put ( " lime " , color lime ) ; map put ( " forest " , color forest ) ; map put ( " olive " , color olive ) ; map put ( " yellow " , color yellow ) ; map put ( " gold " , color gold ) ; map put ( " goldenrod " , color goldenrod ) ; map put ( " orange " , color orange ) ; map put ( " brown " , color brown ) ; map put ( " tan " , color tan ) ; map put ( " firebrick " , color firebrick ) ; map put ( " red " , color red ) ; map put ( " scarlet " , color scarlet ) ; map put ( " coral " , color coral ) ; map put ( " salmon " , color salmon ) ; map put ( " pink " , color pink ) ; map put ( " magenta " , color magenta ) ; map put ( " purple " , color purple ) ; map put ( " violet " , color violet ) ; map put ( " maroon " , color maroon ) ; }


get decoding hints based on the server request or annotations on the target controller method parameter

default map < string , object > get encode hints ( resolvable type actual type , resolvable type element type , @ nullable media type media type , server http request request , server http response response ) { return hints none ( ) ; }


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


this implementation checks the timestamp of the underlying file , if available

public long last modified ( ) throws i o exception { file file to check = get file for last modified check ( ) ; long last modified = file to check last modified ( ) ; if ( last modified = = 0l & & ! file to check exists ( ) ) { throw new file not found exception ( get description ( ) + " cannot be resolved in the file system for checking its last - modified timestamp " ) ; } return last modified ; }


public void test single thread serialization ( ) { my object my obj = new my object ( ) ; for ( int i = 0 ; i < 10 ; i + + ) { gson to json ( my obj ) ; } }


public int write size ( ) { return size of proto id item ; }


this test verifies that checkpoint barriers and barrier buffers work correctly with concurrent checkpoint barriers where one checkpoint is " overtaking " another checkpoint , i e some inputs receive barriers from an earlier checkpoint , thereby blocking , then all inputs receive barriers from a later checkpoint

public void test overtaking checkpoint barriers ( ) throws exception { final one input stream task test harness < string , string > test harness = new one input stream task test harness < > ( one input stream task : : new , 2 , 2 , basic type info string type info , basic type info string type info ) ; test harness setup output for singleton operator chain ( ) ; stream config stream config = test harness get stream config ( ) ; stream map < string , string > map operator = new stream map < > ( new identity map ( ) ) ; stream config set stream operator ( map operator ) ; stream config set operator i d ( new operator i d ( ) ) ; concurrent linked queue < object > expected output = new concurrent linked queue < > ( ) ; long initial time = 0l ; test harness invoke ( ) ; test harness wait for task running ( ) ; test harness process event ( new checkpoint barrier ( 0 , 0 , checkpoint options for checkpoint with default location ( ) ) , 0 , 0 ) ; / / these elements should be forwarded , since we did not yet receive a checkpoint barrier / / on that input , only add to same input , otherwise we would not know the ordering / / of the output since the task might read the inputs in any order test harness process element ( new stream record < > ( " hello - 1 - 1 " , initial time ) , 1 , 1 ) ; test harness process element ( new stream record < > ( " ciao - 1 - 1 " , initial time ) , 1 , 1 ) ; expected output add ( new stream record < > ( " hello - 1 - 1 " , initial time ) ) ; expected output add ( new stream record < > ( " ciao - 1 - 1 " , initial time ) ) ; test harness wait for input processing ( ) ; / / we should not yet see the barrier , only the two elements from non - blocked input test harness util assert output equals ( " output was not correct " , expected output , test harness get output ( ) ) ; / / now give a later barrier to all inputs , this should unblock the first channel test harness process event ( new checkpoint barrier ( 1 , 1 , checkpoint options for checkpoint with default location ( ) ) , 0 , 1 ) ; test harness process event ( new checkpoint barrier ( 1 , 1 , checkpoint options for checkpoint with default location ( ) ) , 0 , 0 ) ; test harness process event ( new checkpoint barrier ( 1 , 1 , checkpoint options for checkpoint with default location ( ) ) , 1 , 0 ) ; test harness process event ( new checkpoint barrier ( 1 , 1 , checkpoint options for checkpoint with default location ( ) ) , 1 , 1 ) ; expected output add ( new cancel checkpoint marker ( 0 ) ) ; expected output add ( new checkpoint barrier ( 1 , 1 , checkpoint options for checkpoint with default location ( ) ) ) ; test harness wait for input processing ( ) ; test harness util assert output equals ( " output was not correct " , expected output , test harness get output ( ) ) ; / / then give the earlier barrier , these should be ignored test harness process event ( new checkpoint barrier ( 0 , 0 , checkpoint options for checkpoint with default location ( ) ) , 0 , 1 ) ; test harness process event ( new checkpoint barrier ( 0 , 0 , checkpoint options for checkpoint with default location ( ) ) , 1 , 0 ) ; test harness process event ( new checkpoint barrier ( 0 , 0 , checkpoint options for checkpoint with default location ( ) ) , 1 , 1 ) ; test harness wait for input processing ( ) ; test harness end input ( ) ; test harness wait for task completion ( ) ; test harness util assert output equals ( " output was not correct " , expected output , test harness get output ( ) ) ; }


public completable future < model api response > upload file ( long pet id , string additional metadata , file file ) throws api exception { try { http request builder local var request builder = upload file request builder ( pet id , additional metadata , file ) ; return member var http client send async ( local var request builder build ( ) , http response body handlers of string ( ) ) then compose async ( local var response - > { if ( local var response status code ( ) / 100 ! = 2 ) { return completable future failed future ( get api exception ( " upload file " , local var response ) ) ; } try { return completable future completed future ( member var object mapper read value ( local var response body ( ) , new type reference < model api response > ( ) { } ) ) ; } catch ( i o exception e ) { return completable future failed future ( new api exception ( e ) ) ; } } ) ; } catch ( api exception e ) { return completable future failed future ( e ) ; } }


tests an invalid dependency including environments from different groups

public void invalid multigroup constraints ( ) throws exception { new environment group maker ( " buildenv / foo " ) set environments ( " a " , " b " , " c " ) set defaults ( " a " ) make ( ) ; new environment group maker ( " buildenv / bar " ) set environments ( " d " , " e " , " f " ) set defaults ( " d " ) make ( ) ; scratch file ( " hello / build " , get dependency rule ( constrained to ( " / / buildenv / foo : c " ) , compatible with ( " / / buildenv / bar : e " ) ) , get depending rule ( constrained to ( " / / buildenv / foo : b " , " / / buildenv / foo : c " ) , compatible with ( " / / buildenv / bar : e " ) ) ) ; reporter remove handler ( fail fast handler ) ; assert that ( get configured target ( " / / hello : main " ) ) is null ( ) ; assert contains event ( " dependency / / hello : dep doesn ' t support expected environment : / / buildenv / foo : b " ) ; }


returns { @ code true } if the element might have been put in this bloom filter , { @ code false } if this is definitely not the case

public boolean might contain ( t object ) { return strategy might contain ( object , funnel , num hash functions , bits ) ; }


tests that a single document survives super basic smoke test

public void test single doc ( ) throws i o exception { string doc location = " / " + index + " / doc / 1 " ; string doc = " { \ " test \ " : \ " test \ " } " ; if ( is running against old cluster ( ) ) { request create doc = new request ( " put " , doc location ) ; create doc set json entity ( doc ) ; client ( ) perform request ( create doc ) ; } request request = new request ( " get " , doc location ) ; assert that ( to str ( client ( ) perform request ( request ) ) , contains string ( doc ) ) ; }


produce the signing key used to sign tokens in this cipher

default key get signing key ( ) { return null ; }


parses the optional specified string as a decimal number , returning its integer value , or default value if the string is null

public static int parse optional bounded int ( string int str , int default value , int min value , int max value ) throws number format exception { if ( int str ! = null ) { long tmp = parse long ( int str ) ; if ( tmp < min value | | tmp > max value ) { throw new number format exception ( " integer value " + tmp + " out of range : [ " + min value + " " + max value + " ] " ) ; } return ( int ) tmp ; } return default value ; }


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

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


public final int capacity ( ) { return capacity ; }


returns the { @ link platform type } with given name ( case insensitive )

public static platform type from string ( string name ) throws unsupported platform type exception { for ( platform type platform type : platform type values ( ) ) { if ( name equals ignore case ( platform type to string ( ) ) ) { return platform type ; } } throw new unsupported platform type exception ( string format ( " unsupported platform type \ " % s \ " " , name ) ) ; }


check that the container logs contain the expected content for elasticsearch itself

public void test 1 2 0 docker logs include elasticsearch logs ( ) throws exception { wait for elasticsearch ( installation ) ; final result container logs = get container logs ( ) ; assert that ( " container logs should contain full class names " , container logs stdout , contains string ( " org elasticsearch node node " ) ) ; assert that ( " container logs don ' t contain info level messages " , container logs stdout , contains string ( " info " ) ) ; }


issues a cache clear and waits 30 seconds for the field data breaker to be cleared

public void clear field data ( ) throws exception { client ( ) admin ( ) indices ( ) prepare clear cache ( ) set field data cache ( true ) execute ( ) action get ( ) ; assert busy ( ( ) - > { nodes stats response resp = client ( ) admin ( ) cluster ( ) prepare nodes stats ( ) clear ( ) set breaker ( true ) get ( new time value ( 15 , time unit seconds ) ) ; for ( node stats n stats : resp get nodes ( ) ) { assert that ( " fielddata breaker never reset back to 0 " , n stats get breaker ( ) get stats ( circuit breaker fielddata ) get estimated ( ) , equal to ( 0l ) ) ; } } , 30 , time unit seconds ) ; }


test pseudo local file system methods like get file status ( ) , create ( ) , open ( ) , exists ( ) for valid file paths and invalid file paths

public void test pseudo local fs file names ( ) throws i o exception { pseudo local fs pfs = new pseudo local fs ( ) ; configuration conf = new configuration ( ) ; conf set class ( " fs pseudo impl " , pseudo local fs class , file system class ) ; path path = new path ( " pseudo : / / / my psedo file 1234 " ) ; file system test fs = path get file system ( conf ) ; assert equals ( " failed to obtain a pseudo local file system object from path " , pfs get uri ( ) get scheme ( ) , test fs get uri ( ) get scheme ( ) ) ; / / validate pseudo local f s operations on uri of some other file system path = new path ( " file : / / / my psedo file 12345 " ) ; validate get file status ( pfs , path , false ) ; validate create ( pfs , path , false ) ; validate open ( pfs , path , false ) ; validate exists ( pfs , path , false ) ; path = new path ( " pseudo : / / / my psedo file " ) ; / / < file size > missing validate get file status ( pfs , path , false ) ; validate create ( pfs , path , false ) ; validate open ( pfs , path , false ) ; validate exists ( pfs , path , false ) ; / / thing after final ' ' is not a number path = new path ( " pseudo : / / / my psedo file txt " ) ; validate get file status ( pfs , path , false ) ; validate create ( pfs , path , false ) ; validate open ( pfs , path , false ) ; validate exists ( pfs , path , false ) ; / / generate valid file name ( relative path ) and validate operations on it long file size = 231456 ; path = pseudo local fs generate file path ( " my psedo file " , file size ) ; / / validate the above generate file path ( ) assert equals ( " generate file path ( ) failed " , file size , pfs validate file name format ( path ) ) ; validate get file status ( pfs , path , true ) ; validate create ( pfs , path , true ) ; validate open ( pfs , path , true ) ; validate exists ( pfs , path , true ) ; / / validate operations on valid qualified path path = new path ( " my psedo file 1237 " ) ; path = pfs make qualified ( path ) ; validate get file status ( pfs , path , true ) ; validate create ( pfs , path , true ) ; validate open ( pfs , path , true ) ; validate exists ( pfs , path , true ) ; }


throws { @ link unsupported operation exception } because this service is not designed to be bound

public final i binder on bind ( intent intent ) { throw new unsupported operation exception ( ) ; }


register a session factory with the given name

public void register session factory ( string name , session factory session factory ) { session factories put ( name , session factory ) ; }


returns a buffered reader for reading this file as characters using the platform ' s default charset

public buffered reader reader ( int buffer size ) { return new buffered reader ( new input stream reader ( read ( ) ) , buffer size ) ; }


retrieves the configurations needed for the given deps if { @ link build configuration # trim configurations ( ) } is true , trims their fragments to only those needed by their transitive closures else unconditionally includes all fragments skips targets with loading phase errors

public configurations result get configurations ( extended event handler event handler , build options from options , iterable < dependency key > keys ) throws invalid configuration exception , interrupted exception { configurations result builder builder = configurations result new builder ( ) ; set < dependency key > deps to evaluate = new hash set < > ( ) ; immutable sorted set < class < ? extends fragment > > all fragments = null ; if ( use untrimmed configs ( from options ) ) { all fragments = rule class provider get all fragments ( ) ; } / / get the fragments needed for dynamic configuration nodes final list < sky key > transitive fragment sky keys = new array list < > ( ) ; map < label , immutable sorted set < class < ? extends fragment > > > fragments map = new hash map < > ( ) ; set < label > labels with errors = new hash set < > ( ) ; for ( dependency key key : keys ) { if ( use untrimmed configs ( from options ) ) { fragments map put ( key get label ( ) , all fragments ) ; } else { deps to evaluate add ( key ) ; transitive fragment sky keys add ( transitive target key of ( key get label ( ) ) ) ; } } evaluation result < sky value > fragments result = evaluate sky keys ( event handler , transitive fragment sky keys , / * keep going = * / true ) ; for ( map entry < sky key , error info > entry : fragments result error map ( ) entry set ( ) ) { report cycles ( event handler , entry get value ( ) get cycle info ( ) , entry get key ( ) ) ; } for ( dependency key key : keys ) { if ( ! deps to evaluate contains ( key ) ) { / / no fragments to compute here } else if ( fragments result get error ( transitive target key of ( key get label ( ) ) ) ! = null ) { labels with errors add ( key get label ( ) ) ; builder set has error ( ) ; } else { transitive target value ttv = ( transitive target value ) fragments result get ( transitive target key of ( key get label ( ) ) ) ; fragments map put ( key get label ( ) , immutable sorted set copy of ( build configuration lexical fragment sorter , ttv get transitive config fragments ( ) to set ( ) ) ) ; } } platform mapping value platform mapping value = get platform mapping value ( event handler , from options ) ; / / now get the configurations final list < sky key > config sky keys = new array list < > ( ) ; for ( dependency key key : keys ) { if ( labels with errors contains ( key get label ( ) ) ) { continue ; } immutable sorted set < class < ? extends fragment > > dep fragments = fragments map get ( key get label ( ) ) ; if ( dep fragments ! = null ) { configuration transition transition = key get transition ( ) ; if ( transition = = null transition instance ) { continue ; } collection < build options > to options = collections singleton list ( from options ) ; try { map < package value key , package value > build setting packages = get build setting packages ( transition , event handler ) ; to options = configuration resolver apply transition ( from options , transition , build setting packages , event handler ) values ( ) ; } catch ( transition exception e ) { event handler handle ( event error ( e get message ( ) ) ) ; builder set has error ( ) ; continue ; } for ( build options to option : to options ) { config sky keys add ( to configuration key ( platform mapping value , dep fragments , to option ) ) ; } } } evaluation result < sky value > configs result = evaluate sky keys ( event handler , config sky keys , / * keep going = * / true ) ; for ( dependency key key : keys ) { if ( labels with errors contains ( key get label ( ) ) ) { continue ; } immutable sorted set < class < ? extends fragment > > dep fragments = fragments map get ( key get label ( ) ) ; if ( dep fragments ! = null ) { if ( key get transition ( ) = = null transition instance ) { builder put ( key , null ) ; continue ; } collection < build options > to options = collections singleton list ( from options ) ; try { map < package value key , package value > build setting packages = get build setting packages ( key get transition ( ) , event handler ) ; to options = configuration resolver apply transition ( from options , key get transition ( ) , build setting packages , event handler ) values ( ) ; } catch ( transition exception e ) { event handler handle ( event error ( e get message ( ) ) ) ; builder set has error ( ) ; continue ; } for ( build options to option : to options ) { build configuration value key config key = to configuration key ( platform mapping value , dep fragments , to option ) ; build configuration value config value = ( ( build configuration value ) configs result get ( config key ) ) ; if ( config value ! = null ) { builder put ( key , config value get configuration ( ) ) ; } else if ( configs result error map ( ) contains key ( config key ) ) { error info config error = configs result get error ( config key ) ; if ( config error get exception ( ) instanceof invalid configuration exception ) { / / wrap underlying exception to make it clearer to developers which line of code / / actually threw exception invalid configuration exception underlying = ( invalid configuration exception ) config error get exception ( ) ; throw new invalid configuration exception ( underlying get detailed exit code ( ) , underlying ) ; } } } } } return builder build ( ) ; }


creates new file text content for the given fully qualified name

public string create file content ( string fqn ) { final pair < string , string > content = component generate service get instance ( ) create litho file content ( component f q n to spec get ( fqn ) ) ; if ( content = = null ) return null ; return content second ; }


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 : / / name return name ; case 2 : / / options return options ; default : return null ; } }


guaranteed to throw an exception and leave the { @ code range set } unmodified

public void remove ( range < c > range ) { throw new unsupported operation exception ( ) ; }


returns the { @ link method } instance for { @ link # test create with null key unsupported ( ) } so that tests can suppress it with { @ code feature specific test suite builder suppressing ( ) } until < a href = " http : bugs sun combugdatabaseview bug do ? bug id = 5045147 " > sun bug 5045147 is fixed

public static method get create with null key unsupported method ( ) { return helpers get method ( map creation tester class , " test create with null key unsupported " ) ; }


creates a plugin wrapper , which provides a management interface for the plugin

plugin wrapper create plugin wrapper ( file archive ) throws i o exception ;


executes the section passing in the execution context

void execute ( client yaml test execution context execution context ) throws i o exception ;


set the aggregated fields to include in the pivot config

public builder set aggregations ( aggregator factories builder aggregations ) { this aggregation config = new aggregation config ( aggregations ) ; return this ; }


returns { @ code true } if this range is of the form { @ code [ v v ) } or { @ code ( v v ] } ( this does not encompass ranges of the form { @ code ( v v ) } , because such ranges are invalid and can ' t be constructed at all ) note that certain discrete ranges such as the integer range { @ code ( 3 4 ) } are < b > not < b > considered empty , even though they contain no actual values in these cases , it may be helpful to preprocess ranges with { @ link # canonical ( discrete domain ) }

public boolean is empty ( ) { return lower bound equals ( upper bound ) ; }


returns the number of shards that are unassigned and currently being delayed

public static int get number of delayed unassigned ( cluster state state ) { int count = 0 ; for ( shard routing shard : state routing table ( ) shards with state ( shard routing state unassigned ) ) { if ( shard unassigned info ( ) is delayed ( ) ) { count + + ; } } return count ; }


public builder add request handler ( @ non null request handler request handler ) { check not null ( request handler , " request handler = = null " ) ; request handlers add ( request handler ) ; return this ; }


@ test public void tls timeouts not retried ( ) throws exception { enable tls ( ) ; server enqueue ( new mock response ( ) set socket policy ( socket policy no response ) ) ; server enqueue ( new mock response ( ) set body ( " unreachable ! " ) ) ; client = client new builder ( ) read timeout ( duration of millis ( 100 ) ) build ( ) ; request request = new request builder ( ) url ( server url ( " / " ) ) build ( ) ; try { / / if this succeeds , too many requests were made client new call ( request ) execute ( ) ; fail ( ) ; } catch ( interrupted i o exception expected ) { } }


this method has to be called in the { @ link activity # on create ( bundle ) } method it sets up all the things necessary to get input , render via open g l and so on uses a default { @ link android application configuration }

public void initialize ( application listener listener ) { android application configuration config = new android application configuration ( ) ; initialize ( listener , config ) ; }


helper method , to get the starts for a index , throwing the right exception for range problems

private register spec set get starts 0 ( int index ) { try { return block starts [ index ] ; } catch ( array index out of bounds exception ex ) { / / translate the exception throw new illegal argument exception ( " bogus index " ) ; } }


public string insn comment string ( dalv insn insn , boolean note indices ) { / / this format has no comment return " " ; }


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


drops capabilities that we shouldn ' t send over the wire used for capabilities which aren ' t bean to json - convertable , and are only used by the local launcher

private static capabilities drop capabilities ( capabilities capabilities ) { if ( capabilities = = null ) { return new immutable capabilities ( ) ; } mutable capabilities caps ; if ( is legacy ( capabilities ) ) { final set < string > to remove = sets new hash set ( capability binary , capability profile ) ; caps = new mutable capabilities ( maps filter keys ( capabilities as map ( ) , key - > ! to remove contains ( key ) ) ) ; } else { caps = new mutable capabilities ( capabilities ) ; } / / ensure that the proxy is in a state fit to be sent to the extension proxy proxy = proxy extract from ( capabilities ) ; if ( proxy ! = null ) { caps set capability ( proxy , proxy ) ; } return caps ; }


private void build free index list ( int first free buffer index ) throws i o exception { array list < integer > free index list = new array list < > ( ) ; int next index = first free buffer index ; while ( next index > = 0 ) { / / push index on stack free index list add ( new integer ( next index ) ) ; / / read block to get next index seek buffer block ( next index ) ; / / read version 1 buffer prefix and next empty index byte flags = raf read byte ( ) ; if ( ( flags & empty buffer ) = = 0 ) { throw new i o exception ( " corrupt file " ) ; } next index = raf read int ( ) ; } int [ ] new free indexes = new int [ free index list size ( ) ] ; for ( int i = 0 ; i < new free indexes length ; i + + ) { new free indexes [ i ] = free index list get ( i ) int value ( ) ; } set free indexes ( new free indexes ) ; }


returns the primary term associated with the current translog writer of the given translog

public static long get current term ( translog translog ) { return translog get current ( ) get primary term ( ) ; }


get a wrapped { @ link mapper context } for custom implementations

public mapper < keyin , valuein , keyout , valueout > context get map context ( map context < keyin , valuein , keyout , valueout > map context ) { return new context ( map context ) ; }


gets the type of the priority queue state it will fallback to the default value , if it is not explicitly set

public priority queue state type get priority queue state type ( ) { return priority queue state type = = null ? timer service factory default value ( ) : priority queue state type ; }


this is the jvm entry point for the service launcher converts the arguments to a list , then invokes { @ link # service main ( list , abstract s 3 guard dynamo d b diagnostic ) }

public static void main ( string [ ] args ) { try { service main ( arrays as list ( args ) , new dump s 3 guard dynamo table ( ) ) ; } catch ( exit util exit exception e ) { exit util terminate ( e ) ; } }


return the blur bitmap fast zoom out , blur , zoom in

public static bitmap fast blur ( final bitmap src , @ float range ( from = 0 , to = 1 , from inclusive = false ) final float scale , @ float range ( from = 0 , to = 25 , from inclusive = false ) final float radius , final boolean recycle , final boolean is return scale ) { if ( is empty bitmap ( src ) ) return null ; int width = src get width ( ) ; int height = src get height ( ) ; matrix matrix = new matrix ( ) ; matrix set scale ( scale , scale ) ; bitmap scale bitmap = bitmap create bitmap ( src , 0 , 0 , src get width ( ) , src get height ( ) , matrix , true ) ; paint paint = new paint ( paint filter bitmap flag | paint anti alias flag ) ; canvas canvas = new canvas ( ) ; porter duff color filter filter = new porter duff color filter ( color transparent , porter duff mode src atop ) ; paint set color filter ( filter ) ; canvas scale ( scale , scale ) ; canvas draw bitmap ( scale bitmap , 0 , 0 , paint ) ; if ( build version sdk int > = build version codes jelly bean mr1 ) { scale bitmap = render script blur ( scale bitmap , radius , recycle ) ; } else { scale bitmap = stack blur ( scale bitmap , ( int ) radius , recycle ) ; } if ( scale = = 1 | | is return scale ) { if ( recycle & & ! src is recycled ( ) & & scale bitmap ! = src ) src recycle ( ) ; return scale bitmap ; } bitmap ret = bitmap create scaled bitmap ( scale bitmap , width , height , true ) ; if ( ! scale bitmap is recycled ( ) ) scale bitmap recycle ( ) ; if ( recycle & & ! src is recycled ( ) & & ret ! = src ) src recycle ( ) ; return ret ; }


finds generic method for the given bridge method

public method unbride ( final method bridge method , class < ? > a class ) throws i o exception , no such method exception , class not found exception { if ( bridge method is bridge ( ) & & bridge method is synthetic ( ) ) { if ( cache contains key ( bridge method ) ) { return cache get ( bridge method ) ; } class reader class reader = new class reader ( a class get name ( ) ) ; final method signature method signature = new method signature ( ) ; class reader accept ( new class visitor ( asm5 ) { @ override public method visitor visit method ( int access , string name , string desc , string signature , string [ ] exceptions ) { boolean bridge = ( access & acc bridge ) ! = 0 & & ( access & acc synthetic ) ! = 0 ; if ( bridge & & bridge method get name ( ) equals ( name ) & & get parameter count ( desc ) = = bridge method get parameter types ( ) length ) { return new method finder ( method signature ) ; } return super visit method ( access , name , desc , signature , exceptions ) ; } } , 0 ) ; method method = a class get declared method ( method signature name , method signature get parameter types ( ) ) ; cache put ( bridge method , method ) ; return method ; } else { return bridge method ; } }


specifies a predicate returns false for classes we want to exclude

public test suite builder match classes ( predicate < class < ? > > predicate ) { match class predicate = predicate ; return this ; }


returns the root dataset for this data and all its ancestors

table data < row object > get root data ( ) { if ( source = = null ) { return this ; } return source get root data ( ) ; }


in this test , we verify that each stream is allocated a minimum chunk size when bytes run out , the remaining streams will be next in line for the next iteration

public void min chunk should be allocated per stream ( ) throws http 2 exception { / / re - assign weights set priority ( stream a , 0 , ( short ) 50 , false ) ; set priority ( stream b , 0 , ( short ) 200 , false ) ; set priority ( stream c , stream a , ( short ) 100 , false ) ; set priority ( stream d , stream a , ( short ) 100 , false ) ; / / update the streams init state ( stream a , allocation quantum , true ) ; init state ( stream b , allocation quantum , true ) ; init state ( stream c , allocation quantum , true ) ; init state ( stream d , allocation quantum , true ) ; / / only write 3 * chunk size , so that we ' ll only write to the first 3 streams int written = 3 * allocation quantum ; assert true ( write ( written ) ) ; assert equals ( allocation quantum , capture writes ( stream a ) ) ; assert equals ( allocation quantum , capture writes ( stream b ) ) ; assert equals ( allocation quantum , capture writes ( stream c ) ) ; verify write ( at most ( 1 ) , stream d , 0 ) ; / / now write again and verify that the last stream is written to assert false ( write ( allocation quantum ) ) ; assert equals ( allocation quantum , capture writes ( stream a ) ) ; assert equals ( allocation quantum , capture writes ( stream b ) ) ; assert equals ( allocation quantum , capture writes ( stream c ) ) ; assert equals ( allocation quantum , capture writes ( stream d ) ) ; }


private void dump recorded out err ( event handler event handler , event prefix event , file out err out err buffer ) { / / only print the output if we ' re not winding down if ( is builder aborting ( ) ) { return ; } if ( out err buffer ! = null & & out err buffer has recorded output ( ) ) { / / bind the output to the prefix event event handler handle ( prefix event with stdout stderr ( out err buffer ) ) ; } else { event handler handle ( prefix event ) ; } }


finds pets by status multiple status values can be provided with comma separated strings

public api response < list < pet > > find pets by status with http info ( list < string > status ) throws api exception { http request builder local var request builder = find pets by status request builder ( status ) ; try { http response < input stream > local var response = member var http client send ( local var request builder build ( ) , http response body handlers of input stream ( ) ) ; if ( member var response interceptor ! = null ) { member var response interceptor accept ( local var response ) ; } if ( local var response status code ( ) / 100 ! = 2 ) { throw new api exception ( local var response status code ( ) , " find pets by status call received non - success response " , local var response headers ( ) , local var response body ( ) = = null ? null : new string ( local var response body ( ) read all bytes ( ) ) ) ; } return new api response < list < pet > > ( local var response status code ( ) , local var response headers ( ) map ( ) , member var object mapper read value ( local var response body ( ) , new type reference < list < pet > > ( ) { } ) ) ; } catch ( i o exception e ) { throw new api exception ( e ) ; } catch ( interrupted exception e ) { thread current thread ( ) interrupt ( ) ; throw new api exception ( e ) ; } }


close resources associated with this execution context , e g catalogs

public void close ( ) { wrap class loader ( ( ) - > get catalogs ( ) values ( ) for each ( catalog : : close ) ) ; try { class loader close ( ) ; } catch ( i o exception e ) { log debug ( " error while closing class loader " , e ) ; } }


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

default response entity < void > test endpoint parameters ( @ api param ( value = " none " , required = true ) @ valid @ request part ( value = " number " , required = true ) big decimal number , @ api param ( value = " none " , required = true ) @ valid @ request part ( value = " double " , required = true ) double double , @ api param ( value = " none " , required = true ) @ valid @ request part ( value = " pattern without delimiter " , required = true ) string pattern without delimiter , @ api param ( value = " none " , required = true ) @ valid @ request part ( value = " byte " , required = true ) byte [ ] byte , @ api param ( value = " none " ) @ valid @ request part ( value = " integer " , required = false ) integer integer , @ api param ( value = " none " ) @ valid @ request part ( value = " int 3 2 " , required = false ) integer int 3 2 , @ api param ( value = " none " ) @ valid @ request part ( value = " int 6 4 " , required = false ) long int 6 4 , @ api param ( value = " none " ) @ valid @ request part ( value = " float " , required = false ) float float , @ api param ( value = " none " ) @ valid @ request part ( value = " string " , required = false ) string string , @ api param ( value = " none " ) @ valid @ request part ( value = " binary " , required = false ) multipart file binary , @ api param ( value = " none " ) @ valid @ request part ( value = " date " , required = false ) local date date , @ api param ( value = " none " ) @ valid @ request part ( value = " date time " , required = false ) offset date time date time , @ api param ( value = " none " ) @ valid @ request part ( value = " password " , required = false ) string password , @ api param ( value = " none " ) @ valid @ request part ( value = " callback " , required = false ) string param callback ) { return new response entity < > ( http status not implemented ) ; }


instruments the given { @ link ehcache } instance with get and put timers and a set of gauges for ehcache ' s built - in statistics : < table > < caption > ehcache timered metrics < caption > < tr > < td > { @ code hits } < td > < td > the number of times a requested item was found in the cache < td > < tr > < tr > < td > { @ code in - memory - hits } < td > < td > number of times a requested item was found in the memory store < td > < tr > < tr > < td > { @ code off - heap - hits } < td > < td > number of times a requested item was found in the off - heap store < td > < tr > < tr > < td > { @ code on - disk - hits } < td > < td > number of times a requested item was found in the disk store < td > < tr > < tr > < td > { @ code misses } < td > < td > number of times a requested item was not found in the cache < td > < tr > < tr > < td > { @ code in - memory - misses } < td > < td > number of times a requested item was not found in the memory store < td > < tr > < tr > < td > { @ code off - heap - misses } < td > < td > number of times a requested item was not found in the off - heap store < td > < tr > < tr > < td > { @ code on - disk - misses } < td > < td > number of times a requested item was not found in the disk store < td > < tr > < tr > < td > { @ code objects } < td > < td > number of elements stored in the cache < td > < tr > < tr > < td > { @ code in - memory - objects } < td > < td > number of objects in the memory store < td > < tr > < tr > < td > { @ code off - heap - objects } < td > < td > number of objects in the off - heap store < td > < tr > < tr > < td > { @ code on - disk - objects } < td > < td > number of objects in the disk store < td > < tr > < tr > < td > { @ code mean - get - time } < td > < td > the average get time because ehcache support jdk1 4 2 , each get time uses { @ link system # current time millis ( ) } , rather than nanoseconds the accuracy is thus limited < td > < tr > < tr > < td > { @ code mean - search - time } < td > < td > the average execution time ( in milliseconds ) within the last sample period < td > < tr > < tr > < td > { @ code eviction - count } < td > < td > the number of cache evictions , since the cache was created , or statistics were cleared < td > < tr > < tr > < td > { @ code searches - per - second } < td > < td > the number of search executions that have completed in the last second < td > < tr > < tr > < td > { @ code accuracy } < td > < td > a human readable description of the accuracy setting one of " none " , " best effort " or " guaranteed " < td > < tr > < table > < b > n b : this enables ehcache ' s sampling statistics with an accuracy level of " none " < b >

public static ehcache instrument ( metric registry registry , final ehcache cache ) { final string prefix = name ( cache get class ( ) , cache get name ( ) ) ; registry register ( name ( prefix , " hits " ) , ( gauge < long > ) ( ) - > cache get statistics ( ) cache hit count ( ) ) ; registry register ( name ( prefix , " in - memory - hits " ) , ( gauge < long > ) ( ) - > cache get statistics ( ) local heap hit count ( ) ) ; registry register ( name ( prefix , " off - heap - hits " ) , ( gauge < long > ) ( ) - > cache get statistics ( ) local off heap hit count ( ) ) ; registry register ( name ( prefix , " on - disk - hits " ) , ( gauge < long > ) ( ) - > cache get statistics ( ) local disk hit count ( ) ) ; registry register ( name ( prefix , " misses " ) , ( gauge < long > ) ( ) - > cache get statistics ( ) cache miss count ( ) ) ; registry register ( name ( prefix , " in - memory - misses " ) , ( gauge < long > ) ( ) - > cache get statistics ( ) local heap miss count ( ) ) ; registry register ( name ( prefix , " off - heap - misses " ) , ( gauge < long > ) ( ) - > cache get statistics ( ) local off heap miss count ( ) ) ; registry register ( name ( prefix , " on - disk - misses " ) , ( gauge < long > ) ( ) - > cache get statistics ( ) local disk miss count ( ) ) ; registry register ( name ( prefix , " objects " ) , ( gauge < long > ) ( ) - > cache get statistics ( ) get size ( ) ) ; registry register ( name ( prefix , " in - memory - objects " ) , ( gauge < long > ) ( ) - > cache get statistics ( ) get local heap size ( ) ) ; registry register ( name ( prefix , " off - heap - objects " ) , ( gauge < long > ) ( ) - > cache get statistics ( ) get local off heap size ( ) ) ; registry register ( name ( prefix , " on - disk - objects " ) , ( gauge < long > ) ( ) - > cache get statistics ( ) get local disk size ( ) ) ; registry register ( name ( prefix , " mean - get - time " ) , ( gauge < double > ) ( ) - > cache get statistics ( ) cache get operation ( ) latency ( ) average ( ) value ( ) ) ; registry register ( name ( prefix , " mean - search - time " ) , ( gauge < double > ) ( ) - > cache get statistics ( ) cache search operation ( ) latency ( ) average ( ) value ( ) ) ; registry register ( name ( prefix , " eviction - count " ) , ( gauge < long > ) ( ) - > cache get statistics ( ) cache eviction operation ( ) count ( ) value ( ) ) ; registry register ( name ( prefix , " searches - per - second " ) , ( gauge < double > ) ( ) - > cache get statistics ( ) cache search operation ( ) rate ( ) value ( ) ) ; registry register ( name ( prefix , " writer - queue - size " ) , ( gauge < long > ) ( ) - > cache get statistics ( ) get writer queue length ( ) ) ; return new instrumented ehcache ( registry , cache ) ; }


{ @ inherit doc } by default , returns the supplied elements in their given order ; however , generators for containers with a known order other than insertion order must override this method note : this default implementation is overkill ( but valid ) for an unordered container an equally valid implementation for an unordered container is to throw an exception the chosen implementation , however , has the advantage of working for insertion - ordered containers , as well

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


method that checks if the welcome message to be returned is the enhanced version for this instance as the logic is driven by the user group this method is a little redundant however can be used to show that there is an enhanced version available

public boolean is enhanced ( ) { return true ; }


private void test restore committed log ( int total transactions , byte [ ] data , int min expected snapshots ) throws exception { file tmp dir = client base create tmp dir ( ) ; client base setup test env ( ) ; zoo keeper server zks = new zoo keeper server ( tmp dir , tmp dir , 3000 ) ; final int port = integer parse int ( hostport split ( " : " ) [ 1 ] ) ; server cnxn factory f = server cnxn factory create factory ( port , - 1 ) ; f startup ( zks ) ; assert true ( client base wait for server up ( hostport , connection timeout ) , " waiting for server being up " ) ; zoo keeper zk = client base create z k client ( hostport ) ; try { for ( int i = 0 ; i < total transactions ; i + + ) { zk create ( " / invalidsnap - " + i , data , ids open acl unsafe , create mode persistent ) ; } } finally { zk close ( ) ; } final int num snaps = zks get txn log factory ( ) find n recent snapshots ( 10 * min expected snapshots ) size ( ) ; log info ( " number of snapshots taken { } " , num snaps ) ; f shutdown ( ) ; zks shutdown ( ) ; assert true ( client base wait for server down ( hostport , connection timeout ) , " waiting for server to shutdown " ) ; assert true ( num snaps > min expected snapshots , " too few snapshot files " ) ; assert true ( num snaps < = min expected snapshots * 2 , " too many snapshot files " ) ; / / start server again zks = new zoo keeper server ( tmp dir , tmp dir , 3000 ) ; zks startdata ( ) ; collection < proposal > committed log = zks get z k database ( ) get committed log ( ) ; int logsize = committed log size ( ) ; log info ( " committed log size = { } " , logsize ) ; assert true ( ( logsize ! = 0 ) , " log size ! = 0 " ) ; zks shutdown ( ) ; }


return the rmi stub to use called for each invocation the default implementation returns the stub created on initialization , if any else , it invokes { @ link # lookup stub } to get a new stub for each invocation this can be overridden in subclasses , for example in order to cache a stub for a given amount of time before recreating it , or to test the stub whether it is still alive

protected object get stub ( ) throws naming exception , remote lookup failure exception { if ( ! this cache stub | | ( this lookup stub on startup & & ! this refresh stub on connect failure ) ) { return ( this cached stub ! = null ? this cached stub : lookup stub ( ) ) ; } else { synchronized ( this stub monitor ) { if ( this cached stub = = null ) { this cached stub = lookup stub ( ) ; } return this cached stub ; } } }


size ( # bytes of the serialized data ) of the rpc invocation message

public long get size ( ) { return serialized method invocation get byte array ( ) length ; }


create a task attempt context for a job , creating a random job i d to do this

protected task attempt context create task attempt context ( final job conf conf ) throws exception { string id = abstract commit i test random job id ( ) ; return new task attempt context impl ( conf , task attempt i d for name ( " attempt " + id + " m 000000 0 " ) ) ; }


return the formatted time string differ time span

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


an implementation of { @ link multiset # set count ( object , int ) }

static < e > int set count impl ( multiset < e > self , e element , int count ) { check nonnegative ( count , " count " ) ; int old count = self count ( element ) ; int delta = count - old count ; if ( delta > 0 ) { self add ( element , delta ) ; } else if ( delta < 0 ) { self remove ( element , - delta ) ; } return old count ; }


private synchronized void clear active block ( ) { if ( active block ! = null ) { log debug ( " clearing active block " ) ; } active block = null ; }


throws an exception if the given { @ link table schema } contains any non - physical columns

public static table schema check only physical columns ( table schema schema ) { preconditions check not null ( schema ) ; if ( ! contains physical columns only ( schema ) ) { throw new validation exception ( " the given schema contains non - physical columns , schema : \ n " + schema to string ( ) ) ; } return schema ; }


public static nfsproc3 from value ( int value ) { if ( value < 0 | | value > = values ( ) length ) { return null ; } return values ( ) [ value ] ; }


like { @ link # resolve } but returns null rather than a fallback url in case there is no special avatar

public static @ check for null string resolve or null ( user u , string avatar size ) { matcher matcher = icon size regex matcher ( avatar size ) ; if ( matcher matches ( ) & & matcher group count ( ) = = 2 ) { int width = integer parse int ( matcher group ( 1 ) ) ; int height = integer parse int ( matcher group ( 2 ) ) ; for ( user avatar resolver r : all ( ) ) { string name = r find avatar for ( u , width , height ) ; if ( name ! = null ) return name ; } } else { logger warning ( string format ( " could not split up the avatar size ( % s ) into a width and height " , avatar size ) ) ; } return null ; }


sorts { @ link org apache flink api java tuple tuple } or pojo elements within a group on the specified field in the specified { @ link order } < b > note : only groups of tuple or pojo elements can be sorted < b > groups can be sorted by multiple fields by chaining { @ link # sort group ( string , order ) } calls

public sorted grouping < t > sort group ( string field , order order ) { if ( group sort selector function key ! = null ) { throw new invalid program exception ( " chaining sort group with key selector sorting is not supported " ) ; } if ( ! keys expression keys is sort key ( field , input data set get type ( ) ) ) { throw new invalid program exception ( " selected sort key is not a sortable type " ) ; } expression keys < t > ek = new expression keys < > ( field , input data set get type ( ) ) ; add sort group internal ( ek , order ) ; return this ; }


creates a critical path component for an action

private critical path component create component ( action action , long relative start nanos ) { return new critical path component ( id generator get and increment ( ) , action , relative start nanos ) ; }


retrieve a resource for the given key that is bound to the current thread

public static object get resource ( object key ) { object actual key = transaction synchronization utils unwrap resource if necessary ( key ) ; object value = do get resource ( actual key ) ; if ( value ! = null & & logger is trace enabled ( ) ) { logger trace ( " retrieved value [ " + value + " ] for key [ " + actual key + " ] bound to thread [ " + thread current thread ( ) get name ( ) + " ] " ) ; } return value ; }


protected x m l object new attribute value ( final object value , final string value type , final q name element name ) { logger trace ( " creating new attribute value x m l object for value : [ { } ] , value type : [ { } ] , q name : [ { } ] " , value , value type , element name ) ; if ( x s string class get simple name ( ) equals ignore case ( value type ) ) { val builder = new x s string builder ( ) ; val attr value obj = builder build object ( element name , x s string type name ) ; attr value obj set value ( value to string ( ) ) ; logger trace ( log message attr created , attr value obj ) ; return attr value obj ; } if ( xsuri class get simple name ( ) equals ignore case ( value type ) ) { val builder = new x s u r i builder ( ) ; val attr value obj = builder build object ( element name , xsuri type name ) ; attr value obj set u r i ( value to string ( ) ) ; logger trace ( log message attr created , attr value obj ) ; return attr value obj ; } if ( x s boolean class get simple name ( ) equals ignore case ( value type ) ) { val builder = new x s boolean builder ( ) ; val attr value obj = builder build object ( element name , x s boolean type name ) ; attr value obj set value ( x s boolean value value of ( value to string ( ) to lower case ( ) ) ) ; logger trace ( log message attr created , attr value obj ) ; return attr value obj ; } if ( x s integer class get simple name ( ) equals ignore case ( value type ) ) { val builder = new x s integer builder ( ) ; val attr value obj = builder build object ( element name , x s integer type name ) ; attr value obj set value ( integer value of ( value to string ( ) ) ) ; logger trace ( log message attr created , attr value obj ) ; return attr value obj ; } if ( x s date time class get simple name ( ) equals ignore case ( value type ) ) { val builder = new x s date time builder ( ) ; val attr value obj = builder build object ( element name , x s date time type name ) ; attr value obj set value ( zoned date time parse ( value to string ( ) ) to instant ( ) ) ; logger trace ( log message attr created , attr value obj ) ; return attr value obj ; } if ( x s base 6 4 binary class get simple name ( ) equals ignore case ( value type ) ) { val builder = new x s base 6 4 binary builder ( ) ; val attr value obj = builder build object ( element name , x s base 6 4 binary type name ) ; attr value obj set value ( value to string ( ) ) ; logger trace ( log message attr created , attr value obj ) ; return attr value obj ; } if ( x s object class get simple name ( ) equals ignore case ( value type ) ) { val mapper = new jackson xml serializer ( ) ; val builder = new x s any builder ( ) ; val attr value obj = builder build object ( element name ) ; attr value obj set text content ( mapper write value as string ( value ) ) ; logger trace ( log message attr created , attr value obj ) ; return attr value obj ; } val builder = new x s any builder ( ) ; val attr value obj = builder build object ( element name ) ; attr value obj set text content ( value to string ( ) ) ; logger trace ( log message attr created , attr value obj ) ; return attr value obj ; }


creates corresponding negotiator according to whether on android

static ok http protocol negotiator create negotiator ( class loader loader ) { boolean android = true ; try { / / attempt to find android 2 3 + a p is loader load class ( " com android org conscrypt open s s l socket impl " ) ; } catch ( class not found exception e 1 ) { logger log ( level fine , " unable to find conscrypt skipping " , e 1 ) ; try { / / older platform before being unbundled loader load class ( " org apache harmony xnet provider jsse open s s l socket impl " ) ; } catch ( class not found exception e 2 ) { logger log ( level fine , " unable to find any open s s l socket impl skipping " , e 2 ) ; android = false ; } } return android ? new android negotiator ( default platform ) : new ok http protocol negotiator ( default platform ) ; }


select the given row object no selection will be made if the object is filtered out of view

public void set selected item ( row object t ) { int view row = text filter model get view index ( t ) ; if ( view row > = 0 ) { table set row selection interval ( view row , view row ) ; scroll to selected row ( ) ; } }


remove a user defined reference to the operand at op index

public void remove operand reference ( int op index , address ref addr ) { if ( ref mgr = = null ) throw new unsupported operation exception ( ) ; reference ref = ref mgr get reference ( address , ref addr , op index ) ; if ( ref ! = null ) { ref mgr delete ( ref ) ; } }


get the { @ link http 2 frame listener } which will be notified when frames are decoded

http 2 frame listener frame listener ( ) ;


returns whether this monitor is occupied by any thread this method is designed for use in monitoring of the system state , not for synchronization control

public boolean is occupied ( ) { return lock is locked ( ) ; }


the set of attribute declarations < code > repeated aapt pb styleable entry entry = 1 ; < code >

public builder clear entry ( ) { copy on write ( ) ; instance clear entry ( ) ; return this ; }


gets the executor which executes in the main thread of the resource manager


{ @ inherit doc } the default implementation does nothing

@ override public void enter param literal ( sql base parser param literal context ctx ) { }


returns whether the visited class is declared in the scope of a lambda in that case { @ link lambda desugaring } will want to rewrite the enclosing method attribute of the class

public boolean need outer class rewrite ( ) { return need outer class rewrite ; }


resource definitions corresponding to an android package < code > repeated aapt pb package package = 2 ; < code >

private void add package ( com android aapt resources package value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } ensure package is mutable ( ) ; package add ( value ) ; }


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


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


public final void set access time ( long access time ) { this access time = access time ; }


protected void block allocated ( ) { if ( statistics ! = null ) { statistics block allocated ( ) ; } }


public long get token sequence no ( ) { return token sequence no get ( ) ; }


calls { @ link media source # create period ( media period id , allocator , long ) } on the wrapped source then prepares it if { @ link # prepare ( callback , long ) } has been called call { @ link # release period ( ) } to release the period

public void create period ( media period id id ) { long prepare position us = get prepare position with override ( this prepare position us ) ; media period = check not null ( media source ) create period ( id , allocator , prepare position us ) ; if ( callback ! = null ) { media period prepare ( / * callback = * / this , prepare position us ) ; } }


get the archive entries in classpath as an array of path

public path [ ] get archive class paths ( ) { return distributed cache get archive class paths ( conf ) ; }


set the { @ linkplain media type media type } of the body , as specified by the { @ code content - type } header

body builder content type ( media type content type ) ;


this tests the overload of the method that uses a map for query parameters instead of listing them out individually

public void test body with query params test query map ( ) { user body = null ; fake api test body with query params query params query params = new fake api test body with query params query params ( ) query ( null ) ; / / api test body with query params ( body , query params ) ; / / todo : test validations }


returns the current position in the input

public int get position ( ) { return buffer get position ( ) ; }


like gallop left , except that if the range contains an element equal to key , gallop right returns the index after the rightmost equal element

private static < t > int gallop right ( t key , t [ ] a , int base , int len , int hint , comparator < ? super t > c ) { if ( debug ) assert len > 0 & & hint > = 0 & & hint < len ; int ofs = 1 ; int last ofs = 0 ; if ( c compare ( key , a [ base + hint ] ) < 0 ) { / / gallop left until a [ b + hint - ofs ] < = key < a [ b + hint - last ofs ] int max ofs = hint + 1 ; while ( ofs < max ofs & & c compare ( key , a [ base + hint - ofs ] ) < 0 ) { last ofs = ofs ; ofs = ( ofs < < 1 ) + 1 ; if ( ofs < = 0 ) / / int overflow ofs = max ofs ; } if ( ofs > max ofs ) ofs = max ofs ; / / make offsets relative to b int tmp = last ofs ; last ofs = hint - ofs ; ofs = hint - tmp ; } else { / / a [ b + hint ] < = key / / gallop right until a [ b + hint + last ofs ] < = key < a [ b + hint + ofs ] int max ofs = len - hint ; while ( ofs < max ofs & & c compare ( key , a [ base + hint + ofs ] ) > = 0 ) { last ofs = ofs ; ofs = ( ofs < < 1 ) + 1 ; if ( ofs < = 0 ) / / int overflow ofs = max ofs ; } if ( ofs > max ofs ) ofs = max ofs ; / / make offsets relative to b last ofs + = hint ; ofs + = hint ; } if ( debug ) assert - 1 < = last ofs & & last ofs < ofs & & ofs < = len ; / * * now a [ b + last ofs ] < = key < a [ b + ofs ] , so key belongs somewhere to the right of last ofs but no farther right than ofs * do a binary search , with invariant a [ b + last ofs - 1 ] < = key < a [ b + ofs ] * / last ofs + + ; while ( last ofs < ofs ) { int m = last ofs + ( ( ofs - last ofs ) > > > 1 ) ; if ( c compare ( key , a [ base + m ] ) < 0 ) ofs = m ; / / key < a [ b + m ] else last ofs = m + 1 ; / / a [ b + m ] < = key } if ( debug ) assert last ofs = = ofs ; / / so a [ b + ofs - 1 ] < = key < a [ b + ofs ] return ofs ; }


whether the decoder supports audio with a given sample rate must not be called if the device sdk version is less than 21

public boolean is audio sample rate supported v 2 1 ( int sample rate ) { if ( capabilities = = null ) { log no support ( " sample rate caps " ) ; return false ; } audio capabilities audio capabilities = capabilities get audio capabilities ( ) ; if ( audio capabilities = = null ) { log no support ( " sample rate a caps " ) ; return false ; } if ( ! audio capabilities is sample rate supported ( sample rate ) ) { log no support ( " sample rate support , " + sample rate ) ; return false ; } return true ; }


returns whether the key has just been pressed

public boolean is key just pressed ( int key ) ;


binds the underlying { @ link vertex buffer object } and { @ link index buffer object } if indices where given use this with open g l es 2 0 and when auto - bind is disabled

public void bind ( final shader program shader , final int [ ] locations ) { vertices bind ( shader , locations ) ; if ( instances ! = null & & instances get num instances ( ) > 0 ) instances bind ( shader , locations ) ; if ( indices get num indices ( ) > 0 ) indices bind ( ) ; }


adds the given plugin to the tool and then returns the instance of the plugin that was added

public static < t extends plugin > t add plugin ( plugin tool tool , class < t > c ) throws plugin exception { tool add plugin ( c get name ( ) ) ; return get plugin ( tool , c ) ; }


returns the request line that generated this response

public request line get request line ( ) { return request line ; }


determines the starting index of the stack trace , after method calls made by this class

private int get stack offset ( @ non null stack trace element [ ] trace ) { check not null ( trace ) ; for ( int i = min stack offset ; i < trace length ; i + + ) { stack trace element e = trace [ i ] ; string name = e get class name ( ) ; if ( ! name equals ( logger printer class get name ( ) ) & & ! name equals ( logger class get name ( ) ) ) { return - - i ; } } return - 1 ; }


convenience method to sort nodes nodes can change while being sorted using a standard sort will fail without locking each node , the tree set handles this without locks

public tree set < n > sorted node set ( comparator < n > comparator ) { tree set < n > sorted set = new tree set < > ( comparator ) ; read lock lock ( ) ; try { sorted set add all ( nodes values ( ) ) ; } finally { read lock unlock ( ) ; } return sorted set ; }


this does actual copy it should be called only when we hold locks on both this and other objects

private void do copy ( final int offset , final memory chunk other , final int other offset , final int count ) { if ( ! ( other instanceof buffer memory chunk ) ) { throw new illegal argument exception ( " cannot copy two incompatible memory chunks " ) ; } preconditions check state ( ! is closed ( ) ) ; preconditions check state ( ! other is closed ( ) ) ; memory chunk util check bounds ( offset , other get size ( ) , other offset , count , m size ) ; m buffer position ( offset ) ; / / byte buffer can ' t be null at this point other get byte buffer ( ) position ( other offset ) ; / / recover the necessary part to be copied as a byte array / / this requires a copy , for now there is not a more efficient alternative byte [ ] b = new byte [ count ] ; m buffer get ( b , 0 , count ) ; other get byte buffer ( ) put ( b , 0 , count ) ; }


in this scenario : 1 network inputs are processed until checkpoint barriers are processed 2 there are no source records to be processed 3 checkpoint is triggered on first received checkpoint barrier 4 unaligned checkpoint is performed at some point of time blocking the source 5 more source records are added , that shouldn ' t be processed

public void test source checkpoint last unaligned ( ) throws exception { boolean unaligned = true ; try ( stream task mailbox test harness < string > test harness = build test harness ( unaligned ) ) { test harness set auto process ( false ) ; array deque < object > expected output = new array deque < > ( ) ; add network records ( test harness ) ; checkpoint barrier barrier = create barrier ( test harness ) ; add barriers ( test harness , barrier ) ; test harness process all ( ) ; add source records ( test harness , 1 , 1337 , 1337 , 1337 ) ; test harness process all ( ) ; expected output add ( new stream record < > ( " 44 " , timestamp assigner no timestamp ) ) ; expected output add ( new stream record < > ( " 44 " , timestamp assigner no timestamp ) ) ; expected output add ( new stream record < > ( " 47 0 " , timestamp assigner no timestamp ) ) ; expected output add ( new stream record < > ( " 47 0 " , timestamp assigner no timestamp ) ) ; expected output add ( barrier ) ; assert that ( test harness get output ( ) , contains in any order ( expected output to array ( ) ) ) ; } }


public object current metric value ( metric name metric name ) { kafka metric metric = metrics by name get ( metric name ) ; return metric ! = null ? metric metric value ( ) : null ; }


validates the status of an < code > http u r l connection < code > against an expected http status code if the current status code is not the expected one it throws an exception with a detail message using server side error messages if available < b > note : < b > this method will throw the deserialized exception even if not declared in the < code > throws < code > of the method signature

public static void validate response ( http u r l connection conn , int expected status ) throws i o exception { if ( conn get response code ( ) ! = expected status ) { exception to throw ; input stream es = null ; try { es = conn get error stream ( ) ; map json = json serialization map reader ( ) read value ( es ) ; json = ( map ) json get ( error json ) ; string ex class = ( string ) json get ( error classname json ) ; string ex msg = ( string ) json get ( error message json ) ; if ( ex class ! = null ) { try { class loader cl = http exception utils class get class loader ( ) ; class klass = cl load class ( ex class ) ; constructor constr = klass get constructor ( string class ) ; to throw = ( exception ) constr new instance ( ex msg ) ; } catch ( exception ex ) { to throw = new i o exception ( string format ( " http status [ % d ] , exception [ % s ] , message [ % s ] , url [ % s ] " , conn get response code ( ) , ex class , ex msg , conn get u r l ( ) ) ) ; } } else { string msg = ( ex msg ! = null ) ? ex msg : conn get response message ( ) ; to throw = new i o exception ( string format ( " http status [ % d ] , message [ % s ] , url [ % s ] " , conn get response code ( ) , msg , conn get u r l ( ) ) ) ; } } catch ( exception ex ) { to throw = new i o exception ( string format ( " http status [ % d ] , message [ % s ] , url [ % s ] , exception [ % s ] " , conn get response code ( ) , conn get response message ( ) , conn get u r l ( ) , ex to string ( ) ) , ex ) ; } finally { if ( es ! = null ) { try { es close ( ) ; } catch ( i o exception ex ) { / / ignore } } } throw ex ( to throw ) ; } }


returns all { @ link dead letter job entity } instances related to on { @ link execution entity }

list < dead letter job entity > find jobs by execution id ( string id ) ;


returns the metadata for this input if available null otherwise

default file artifact value get metadata ( ) throws i o exception { return null ; }


construct a mirror client config from properties of the form cluster x y z use to connect to a cluster based on the mirror maker top - level config file

public mirror client config client config ( string cluster ) { map < string , string > props = new hash map < > ( ) ; props put all ( originals strings ( ) ) ; props put all ( cluster props ( cluster ) ) ; return new mirror client config ( transform ( props ) ) ; }


returns the { @ link help location } for this service

public help location get help location ( ) ;


the format of time bucket in minute unit is " yyyy m mdd h hmmss " , so which means the time bucket must be between 10000000000000 and 99999999999999

public static boolean is second bucket ( long time bucket ) { return time bucket < 99999999999999l & & time bucket > 10000000000000l ; }


tests when two structs in the same namespace have the same name and one includes the other ( gcc linking options can cause types from different namespaces to be forced into the root namespace ) currently this produces two structures one renamed with conflict if this test starts failing it means this behavior in ghidra ' s dtm has changed and the dwarf logic needs to be examined in light of those changes

public void test struct member with same name as struct ( ) throws cancelled exception , i o exception , d w a r f exception { add int ( cu ) ; add float ( cu ) ; debug info entry struct 1a d i e = new struct ( " mystruct " , 1 ) create ( cu ) ; debug info entry struct 1b d i e = new struct ( " mystruct " , 4 ) create ( cu ) ; new member ( struct 1b d i e , " f 1 " , struct 1a d i e , 0 ) create ( cu ) ; import all data types ( ) ; data type dt 1a = dwarf d t m get data type ( struct 1a d i e get offset ( ) , null ) ; data type dt 1b = dwarf d t m get data type ( struct 1b d i e get offset ( ) , null ) ; assert equals ( " mystruct " , dt 1a get name ( ) ) ; assert equals ( " mystruct conflict " , dt 1b get name ( ) ) ; }


create a new { @ link merged annotation } instance of the specified annotation type with attribute values supplied by a map

static < a extends annotation > merged annotation < a > of ( @ nullable class loader class loader , @ nullable object source , class < a > annotation type , @ nullable map < string , ? > attributes ) { return type mapped annotation of ( class loader , source , annotation type , attributes ) ; }


helper method that creates a input stream to validate exceptions for various scenarios

private void setup input stream to test ( azure blob storage test account test account ) throws exception { file system fs = test account get file system ( ) ; / / step 1 : create a file and write dummy data path base = method path ( ) ; path test file path 1 = new path ( base , " test 1 dat " ) ; path test file path 2 = new path ( base , " test 2 dat " ) ; f s data output stream output stream = fs create ( test file path 1 ) ; string test string = " this is a test string " ; output stream write ( test string get bytes ( ) ) ; output stream close ( ) ; / / step 2 : open a read stream on the file input stream = fs open ( test file path 1 ) ; / / step 3 : rename the file fs rename ( test file path 1 , test file path 2 ) ; }


sets the minimum total size for the internal hash tables for example , if the initial capacity is { @ code 60 } , and the concurrency level is { @ code 8 } , then eight segments are created , each having a hash table of size eight providing a large enough estimate at construction time avoids the need for expensive resizing operations later , but setting this value unnecessarily high wastes memory

public cache builder < k , v > initial capacity ( int initial capacity ) { check state ( this initial capacity = = unset int , " initial capacity was already set to % s " , this initial capacity ) ; check argument ( initial capacity > = 0 ) ; this initial capacity = initial capacity ; return this ; }


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


this type - parameterized method solves a problem where a { @ code properties get instance ( key ) } expression would have type { @ link object } when { @ code key } is a wildcard - parameterized { @ link class } that { @ link object } - typed expression would then fail to type check in a { @ code builder put ( key , properties get instance ( key ) ) } statement

private < t > void add to builder ( immutable class to instance map builder < object > builder , class < t > key ) { builder put ( key , check not null ( properties get instance ( key ) ) ) ; }


issues a asynchronous write request to the writer

public void write block ( memory segment segment ) throws i o exception { add request ( new segment write request ( this , segment ) ) ; }


public cancellable get ssl certificates async ( request options options , action listener < get ssl certificates response > listener ) { return rest high level client perform request async and parse entity ( get ssl certificates request instance , get ssl certificates request : : get request , options , get ssl certificates response : : from x content , listener , empty set ( ) ) ; }


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


get a key that is unique to this component within its tree

static string get global key ( @ nullable component context scoped context , component component ) { if ( component m use stateless component ) { if ( scoped context = = null ) { throw new illegal state exception ( " trying to access layout scoped information with a scoped context " ) ; } return scoped context get global key ( ) ; } return component m global key ; }


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


protected string get user ( ) { string user = config get config ( configuration keys store db user ) ; if ( string utils is blank ( user ) ) { throw new store exception ( string format ( " the { % s } can ' t be empty " , configuration keys store db user ) ) ; } return user ; }


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


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


same as { @ link application # attach base context ( context context ) }

void on base context attached ( context base ) ;


restore the request attributes after an include

private void restore attributes after include ( http servlet request request , map < ? , ? > attributes snapshot ) { / / need to copy into separate collection here , to avoid side effects / / on the enumeration when removing attributes set < string > attrs to check = new hash set < > ( ) ; enumeration < ? > attr names = request get attribute names ( ) ; while ( attr names has more elements ( ) ) { string attr name = ( string ) attr names next element ( ) ; if ( this cleanup after include | | attr name starts with ( default strategies prefix ) ) { attrs to check add ( attr name ) ; } } / / add attributes that may have been removed attrs to check add all ( ( set < string > ) attributes snapshot key set ( ) ) ; / / iterate over the attributes to check , restoring the original value / / or removing the attribute , respectively , if appropriate for ( string attr name : attrs to check ) { object attr value = attributes snapshot get ( attr name ) ; if ( attr value = = null ) { request remove attribute ( attr name ) ; } else if ( attr value ! = request get attribute ( attr name ) ) { request set attribute ( attr name , attr value ) ; } } }


{ @ link action } to be displayed in the job page

public action get project action ( abstract project job ) { return null ; }


get all inherited types from the specified type

public static set < class < ? > > get all inherited types ( class < ? > type , predicate < class < ? > > type filters ) { / / add all super classes set < class < ? > > types = new linked hash set < > ( get all super classes ( type , type filters ) ) ; / / add all interface classes types add all ( get all interfaces ( type , type filters ) ) ; return unmodifiable set ( types ) ; }


set the first outgoing edge of v to be e it is assumed that v has already been added to the graph

void set first outgoing edge ( vertex v , edge e ) { try { first outgoing edge [ index ( v ) ] = e ; } catch ( array index out of bounds exception exc ) { msg error ( this , " no value exception in set first outgoing edge ( ) " + " \ t vertex : " + v to string ( ) + " \ t edge : " + e to string ( ) , exc ) ; } }


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


parse the specified string representation of a value into its schema and value

public static schema and value parse string ( string value ) { if ( value = = null ) { return null schema and value ; } if ( value is empty ( ) ) { return new schema and value ( schema string schema , value ) ; } parser parser = new parser ( value ) ; return parse ( parser , false ) ; }


handle the web socket handshake for the web socket specification < a href = " https : tools ietf orghtmldraft - ietf - hybi - thewebsocketprotocol - 00 " > hy bi version 0 and lower this standard is really a rehash of < a href = " https : tools ietf orghtmldraft - hixie - thewebsocketprotocol - 76 " > hixie - 76 and < a href = " https : tools ietf orghtmldraft - hixie - thewebsocketprotocol - 75 " > hixie - 75 browser request to the server : get demo http1 1 upgrade : web socket connection : upgrade host : example com origin : http : example com sec - web socket - protocol : chat , sample sec - web socket - key 1 : 4 @ 1 4 6 5 4 6x w % 0l 1 5 sec - web socket - key 2 : 12998 5 y3 1 p00 ^ n : ds [ 4u server response : http1 1 101 web socket protocol handshake upgrade : web socket connection : upgrade sec - web socket - origin : http : example com sec - web socket - location : ws : example comdemo sec - web socket - protocol : sample 8j k s ' y : g co , wxa -

protected full http response new handshake response ( full http request req , http headers headers ) { / / serve the web socket handshake request if ( ! req headers ( ) contains value ( http header names connection , http header values upgrade , true ) | | ! http header values websocket content equals ignore case ( req headers ( ) get ( http header names upgrade ) ) ) { throw new web socket server handshake exception ( " not a web socket handshake request : missing upgrade " , req ) ; } / / hixie 75 does not contain these headers while hixie 76 does boolean is hixie 7 6 = req headers ( ) contains ( http header names sec websocket key1 ) & & req headers ( ) contains ( http header names sec websocket key2 ) ; string origin = req headers ( ) get ( http header names origin ) ; / / throw before allocating full http response if ( origin = = null & & ! is hixie 7 6 ) { throw new web socket server handshake exception ( " missing origin header , got only " + req headers ( ) names ( ) , req ) ; } / / create the web socket handshake response full http response res = new default full http response ( http 1 1 , new http response status ( 101 , is hixie 7 6 ? " web socket protocol handshake " : " web socket protocol handshake " ) , req content ( ) alloc ( ) buffer ( 0 ) ) ; if ( headers ! = null ) { res headers ( ) add ( headers ) ; } res headers ( ) set ( http header names upgrade , http header values websocket ) set ( http header names connection , http header values upgrade ) ; / / fill in the headers and contents depending on handshake get method if ( is hixie 7 6 ) { / / new handshake get method with a challenge : res headers ( ) add ( http header names sec websocket origin , origin ) ; res headers ( ) add ( http header names sec websocket location , uri ( ) ) ; string subprotocols = req headers ( ) get ( http header names sec websocket protocol ) ; if ( subprotocols ! = null ) { string selected subprotocol = select subprotocol ( subprotocols ) ; if ( selected subprotocol = = null ) { if ( logger is debug enabled ( ) ) { logger debug ( " requested subprotocol ( s ) not supported : { } " , subprotocols ) ; } } else { res headers ( ) set ( http header names sec websocket protocol , selected subprotocol ) ; } } / / calculate the answer of the challenge string key 1 = req headers ( ) get ( http header names sec websocket key1 ) ; string key 2 = req headers ( ) get ( http header names sec websocket key2 ) ; int a = ( int ) ( long parse long ( beginning digit matcher ( key 1 ) replace all ( " " ) ) / beginning space matcher ( key 1 ) replace all ( " " ) length ( ) ) ; int b = ( int ) ( long parse long ( beginning digit matcher ( key 2 ) replace all ( " " ) ) / beginning space matcher ( key 2 ) replace all ( " " ) length ( ) ) ; long c = req content ( ) read long ( ) ; byte buf input = unpooled wrapped buffer ( new byte [ 16 ] ) set index ( 0 , 0 ) ; input write int ( a ) ; input write int ( b ) ; input write long ( c ) ; res content ( ) write bytes ( web socket util md 5 ( input array ( ) ) ) ; } else { / / old hixie 75 handshake get method with no challenge : res headers ( ) add ( http header names websocket origin , origin ) ; res headers ( ) add ( http header names websocket location , uri ( ) ) ; string protocol = req headers ( ) get ( http header names websocket protocol ) ; if ( protocol ! = null ) { res headers ( ) set ( http header names websocket protocol , select subprotocol ( protocol ) ) ; } } return res ; }


set whether to schedule as fixed - rate execution , rather than fixed - delay execution default is " false " , i e fixed delay see timer manager javadoc for details on those execution modes

public void set fixed rate ( boolean fixed rate ) { this fixed rate = fixed rate ; }


public boolean is zero ( ) { if ( ! is full mask ( ) ) { return false ; } for ( byte val : vals ) { if ( val ! = 0 ) { return false ; } } return true ; }


computes or retrieves a replacement value corresponding to an already - cached { @ code key } this method is called when an existing cache entry is refreshed by { @ link cache builder # refresh after write } , or through a call to { @ link loading cache # refresh } this implementation synchronously delegates to { @ link # load } it is recommended that it be overridden with an asynchronous implementation when using { @ link cache builder # refresh after write } < b > note : < b > all exceptions thrown by this method will be logged and then swallowed

public listenable future < v > reload ( k key , v old value ) throws exception { check not null ( key ) ; check not null ( old value ) ; return futures immediate future ( load ( key ) ) ; }


return the set of properties marked as required but not present upon validation

public set < string > get missing required properties ( ) { return this missing required properties ; }


get the do as user name ' actual u g i ' is the ugi of the user creating the client it is possible that the creator of the k m s client provier calls this method on behalf of a proxy user ( the do as user ) in which case this call has to be made as the proxy user

private string get do as user ( ) throws i o exception { user group information current ugi = user group information get current user ( ) ; return ( current ugi get authentication method ( ) = = user group information authentication method proxy ) ? current ugi get short user name ( ) : null ; }


connect to database with given parameters

public void connect ( string db name , string events collection name ) { if ( mongo client ! = null ) { mongo client close ( ) ; } mongo client = new mongo client ( system get property ( " mongo - host " ) , integer parse int ( system get property ( " mongo - port " ) ) ) ; database = mongo client get database ( db name ) ; events collection = database get collection ( events collection name ) ; }


public void remove all ( ) { size = 0 ; root = null ; }


records a new test run result and incrementally updates the target status this event is sent upon completion of executed test runs

public void test event ( test result result ) { action owner test owner = result get test action ( ) get owner ( ) ; configured target key configured target key = configured target key builder ( ) set label ( test owner get label ( ) ) set configuration ( result get test action ( ) get configuration ( ) ) build ( ) ; aggregators get ( configured target key ) test event ( result ) ; }


< code > repeated io netty example worldclock location location = 1 ; < code >

public io netty example worldclock world clock protocol location builder get location builder ( int index ) { return get location field builder ( ) get builder ( index ) ; }


get a configured instance of the give class specified by the given configuration key if the object implements configurable configure it using the configuration

public < t > t get configured instance ( string key , class < t > t , map < string , object > config overrides ) { class < ? > c = get class ( key ) ; return get configured instance ( c , t , originals ( config overrides ) ) ; }


public static string format ( float value , int min integer digits , int fraction digits , boolean is half up ) { return format ( value , false , min integer digits , fraction digits , is half up ) ; }


returns a { @ code path } from name components this works just like { @ code paths get ( ) } remember : just like { @ code paths get ( ) } this is not a string concatenation utility function remember : this should almost never be used usually resolve a path against an existing one !

public static path get ( string first , string more ) { return default get path ( first , more ) ; }


matches java logging configuration behavior ; " true " and " 1 " are true , " false " and " 0 " are false

private static boolean get configured boolean property ( boolean builder value , string configured name , boolean fallback value ) { boolean value = get configured property ( builder value , configured name , val - > { val = val trim ( ) to lower case ( ) ; if ( " true " equals ( val ) | | " 1 " equals ( val ) ) { return true ; } else if ( " false " equals ( val ) | | " 0 " equals ( val ) ) { return false ; } else if ( val length ( ) = = 0 ) { return null ; } throw new illegal argument exception ( " cannot parse boolean property value " ) ; } , null ) ; return value ! = null ? value boolean value ( ) : fallback value ; }


check service name , clusters is subscribed

public boolean is subscribed ( string service name , string clusters ) { string key = service info get key ( service name , clusters ) ; concurrent hash set < event listener > event listeners = listener map get ( key ) ; return collection utils is not empty ( event listeners ) ; }


reset one analysis option to its default value

public void reset analysis option ( program program , string analysis option ) { options options = program get options ( program analysis properties ) ; options restore default value ( analysis option ) ; }


get and set for out of bound indices throw index out of bounds exception

public void test indexing ( ) { atomic double array aa = new atomic double array ( size ) ; for ( int index : new int [ ] { - 1 , size } ) { try { aa get ( index ) ; fail ( ) ; } catch ( index out of bounds exception success ) { } try { aa set ( index , 1 0 ) ; fail ( ) ; } catch ( index out of bounds exception success ) { } try { aa lazy set ( index , 1 0 ) ; fail ( ) ; } catch ( index out of bounds exception success ) { } try { aa compare and set ( index , 1 0 , 2 0 ) ; fail ( ) ; } catch ( index out of bounds exception success ) { } try { aa weak compare and set ( index , 1 0 , 2 0 ) ; fail ( ) ; } catch ( index out of bounds exception success ) { } try { aa get and add ( index , 1 0 ) ; fail ( ) ; } catch ( index out of bounds exception success ) { } try { aa add and get ( index , 1 0 ) ; fail ( ) ; } catch ( index out of bounds exception success ) { } } }


returns the { @ link timer job entity } instances that are elegible to execute , meaning the due date of the timer has been passed

list < timer job entity > find timer jobs to execute ( page page ) ;


test for the case when no a c ls are defined , so the default values are used expected result : the default a c ls for the root queue is " " ( all ) and for the other queues are " " ( none ) , so the user will have access to all the queues because they will have permissions from the root

public void test queue acl default values ( ) throws i o exception { update config with d and d 1 queues ( null , null , null ) ; check access ( true , true , true ) ; }