return a { @ code request callback } that sets the request { @ code accept } header based on the given response type , cross - checked against the configured message converters

public < t > request callback accept header request callback ( class < t > response type ) { return new accept header request callback ( response type ) ; }


gets the directory where hudson stores user information

static file get root dir ( ) { return new file ( jenkins get ( ) get root dir ( ) , " users " ) ; }


ensure on next can not be called after on complete

public void on next after on completed ( ) { test observable t = new test observable ( ) ; flowable < string > st = flowable unsafe create ( t ) ; subscriber < string > w = test helper mock subscriber ( ) ; st subscribe ( new safe subscriber < > ( new test subscriber < > ( w ) ) ) ; t send on next ( " one " ) ; t send on completed ( ) ; t send on next ( " two " ) ; verify ( w , times ( 1 ) ) on next ( " one " ) ; verify ( w , mockito never ( ) ) on next ( " two " ) ; verify ( w , times ( 1 ) ) on complete ( ) ; verify ( w , mockito never ( ) ) on error ( any ( throwable class ) ) ; }


set up directories for tests each rolled file is 10 txns long a failed file is 2 txns long

public static n n storage setup edits ( list < uri > edit uris , int numrolls , boolean close on finish , abort spec abort at rolls ) throws i o exception { list < abort spec > aborts = new array list < abort spec > ( arrays as list ( abort at rolls ) ) ; n n storage storage = new n n storage ( get conf ( ) , collections < uri > empty list ( ) , edit uris ) ; storage format ( new namespace info ( ) ) ; / / verify permissions local file system fs = local file system get local ( get conf ( ) ) ; for ( uri uri : edit uris ) { string curr dir = uri get path ( ) + path separator + storage storage dir current ; file status file status = fs get file link status ( new path ( curr dir ) ) ; fs permission permission = file status get permission ( ) ; assert equals ( get conf ( ) get int ( d f s config keys dfs journal edits dir permission key , 700 ) , permission to octal ( ) ) ; } f s edit log editlog = get f s edit log ( storage ) ; / / open the edit log and add two transactions / / log generation stamp is used , simply because it doesn ' t / / require complex arguments editlog init journals for write ( ) ; editlog open for write ( name node layout version current layout version ) ; for ( int i = 2 ; i < txns per roll ; i + + ) { editlog log generation stamp ( ( long ) 0 ) ; } editlog log sync ( ) ; / / go into edit log rolling loop / / on each roll , the abort at rolls abort specs are / / checked to see if an abort is required if so the / / the specified journal is aborted it will be brought / / back into rotation automatically by roll edit log for ( int i = 0 ; i < numrolls ; i + + ) { editlog roll edit log ( name node layout version current layout version ) ; editlog log generation stamp ( ( long ) i ) ; editlog log sync ( ) ; while ( aborts size ( ) > 0 & & aborts get ( 0 ) roll = = ( i + 1 ) ) { abort spec spec = aborts remove ( 0 ) ; editlog get journals ( ) get ( spec logindex ) abort ( ) ; } for ( int j = 3 ; j < txns per roll ; j + + ) { editlog log generation stamp ( ( long ) i ) ; } editlog log sync ( ) ; } if ( close on finish ) { editlog close ( ) ; } f s image test util log storage contents ( log , storage ) ; return storage ; }


default < t extends registered service > t find service by id ( final long id , final class < t > clazz ) { val service = find service by id ( id ) ; if ( service = = null ) { return null ; } if ( ! clazz is assignable from ( service get class ( ) ) ) { throw new class cast exception ( " object [ " + service + " is of type " + service get class ( ) + " when we were expecting " + clazz ) ; } return clazz cast ( service ) ; }


public int code ( ) { return raw response code ( ) ; }


creates a new client - side { @ link ssl context }

public static ssl context new client context ( trust manager factory trust manager factory ) throws s s l exception { return new client context ( null , null , trust manager factory ) ; }


todo determine how to correctly identify toc location

private void process toc symbol ( container header header , program program , import state cache import state , message log log , task monitor monitor ) { symbol table symbol table = program get symbol table ( ) ; list < section header > sections = header get sections ( ) ; if ( sections size ( ) < 2 ) { return ; } section header data section = sections get ( 1 ) ; if ( ! data section is write ( ) ) { / / is not a data section return ; } address toc address = import state get toc address ( ) ; if ( toc address = = null ) { memory block data block = import state get memory block for section ( data section ) ; toc address = data block get start ( ) ; } try { symbol table create label ( toc address , pef constants toc , source type imported ) ; create data cmd cmd = new create data cmd ( toc address , new pointer data type ( ) ) ; cmd apply to ( program ) ; } catch ( exception e ) { log append exception ( e ) ; } }


the set of values defined for this entry , each corresponding to a different configurationvariant < code > repeated aapt pb config value config value = 4 ; < code >

public builder add config value ( int index , com android aapt resources config value builder builder for value ) { copy on write ( ) ; instance add config value ( index , builder for value ) ; return this ; }


execute the runnable in the main thread of the underlying rpc endpoint , with a delay of the given number of milliseconds

protected void schedule run async ( runnable runnable , time delay ) { schedule run async ( runnable , delay get size ( ) , delay get unit ( ) ) ; }


the run method where work can be performed on the given domain object

public void run ( undoable domain object domain object , task monitor monitor ) throws cancelled exception ;


public static int get snap count ( ) { return snap count ; }


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


public scripted metric aggregation builder reduce script ( script reduce script ) { if ( reduce script = = null ) { throw new illegal argument exception ( " [ reduce script ] must not be null : [ " + name + " ] " ) ; } this reduce script = reduce script ; return this ; }


gets the number of streams that are actively in use ( i e { @ code open } or { @ code half closed } )


reinitializes queues ( called on scheduler reinitialize )

public void reinitialize ( final configuration config , final r m context context , final resource scheduler sched ) { / / todo - wire with scheduler reinitialize and remove init queues below ? init queues ( ) ; }


sets the handle to the active project , as well as updating the active data tree to show the new active project ' s data

void set active project ( project project ) { / / clean up before setting the new project to be the active one if ( active project ! = null ) { / / remove the tool chest listener from the closed project tool chest tool chest = active project get local tool chest ( ) ; tool chest remove tool chest change listener ( tool action manager ) ; tool chest remove tool chest change listener ( tool bar ) ; tool chest remove tool chest change listener ( tool chest change listener ) ; / / remove the repository listener repository adapter repository = active project get repository ( ) ; if ( repository ! = null ) { repository remove listener ( this ) ; } } / / set the active project handle to the specified " new " project active project = project ; / / disable the menu entries that apply when no active project enable project menu items ( project ! = null ) ; / / update the rest of the panels with new ( or inactive ) project tool bar set active project ( project ) ; project data panel set active project ( project ) ; file action manager set active project ( active project ) ; project action manager set active project ( active project ) ; tool action manager set active project ( active project ) ; if ( project ! = null ) { generic run info set projects dir path ( project get project locator ( ) get location ( ) ) ; } workspace panel set active project ( project ) ; / / update the title bar and other panel ' s border titles set project name ( ) ; update connection panel ( project ) ; if ( active project ! = null ) { / / add the tool menu as a tool chest listener on the new active project tool chest tool chest = project get local tool chest ( ) ; tool chest add tool chest change listener ( tool action manager ) ; tool chest add tool chest change listener ( tool bar ) ; tool chest add tool chest change listener ( tool chest change listener ) ; create tool specific open actions ( ) ; / / add the repository listener repository adapter repository = active project get repository ( ) ; if ( repository ! = null ) { repository add listener ( this ) ; } } / / gui validate ( ) ; }


sets the time to wait for the http request to be processed , use 0 block until it is done the timeout is used for both the timeout when establishing tcp connection , and the timeout until the first byte of data is received

public void set time out ( int time out ) { this time out = time out ; }


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

public @ check for null future < form validation > update directly ( ) { return update directly ( download service signature check ) ; }


create a jms message producer for the given session and destination , configuring it to disable message ids andor timestamps ( if necessary ) delegates to { @ link # do create producer } for creation of the raw jms message producer

protected queue browser create browser ( session session , queue queue , @ nullable string message selector ) throws j m s exception { return session create browser ( queue , message selector ) ; }


return true if the method includes the { @ code protected } modifier

public boolean is protected ( ) { return method is protected ( ) ; }


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


test that we can parse the set of permissions correctly for a complex policy

public void test parse two permissions ( ) throws exception { assume true ( " test cannot run with security manager enabled " , system get security manager ( ) = = null ) ; path scratch = create temp dir ( ) ; plugin policy info info = make dummy plugin ( " security / complex - plugin - security policy " ) ; set < string > actual = plugin security get permission descriptions ( info , scratch ) ; assert that ( actual , contains in any order ( plugin security format permission ( new runtime permission ( " get class loader " ) ) , plugin security format permission ( new runtime permission ( " create class loader " ) ) ) ) ; }


test attempting to run an executable which doesn ' t exist we use a path which starts with devnull , since that should never be a directory in unix

public void test process not found ( ) throws exception { external command worker worker = new external command worker builder ( " not found task " ) command ( " / dev / null / non / existent / script / path " ) build ( ) ; kafka future impl < string > done future = new kafka future impl < > ( ) ; worker start ( null , new agent worker status tracker ( ) , done future ) ; string error string = done future get ( ) ; assert true ( error string starts with ( " unable to start process " ) ) ; worker stop ( null ) ; }


returns the maximum possible number of writable bytes , which is equal to { @ code ( this max capacity - this writer index ) }

public abstract int max writable bytes ( ) ;


return the configured free marker { @ link object wrapper } , or the { @ link object wrapper # default wrapper default wrapper } if none specified

protected object wrapper get object wrapper ( ) { object wrapper ow = obtain configuration ( ) get object wrapper ( ) ; return ( ow ! = null ? ow : new default object wrapper builder ( configuration default incompatible improvements ) build ( ) ) ; }


invoked when a named value is required , but { @ link # resolve name ( string , method parameter , server web exchange ) } returned { @ code null } and there is no default value subclasses typically throw an exception in this case

protected void handle missing value ( string name , method parameter parameter , server web exchange exchange ) { handle missing value ( name , parameter ) ; }


set the given , single header value under the given name

public void set ( string header name , @ nullable string header value ) { this headers set ( header name , header value ) ; }


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


asserts the given number of subscriptions happened

public void assert subscriptions ( int n ) { assert assert equals ( n , get ( ) ) ; }


creates a new float buffer by wrapping the given float array calling this method has the same effect as { @ code wrap ( array , 0 , array length ) }

public static float buffer wrap ( float [ ] array ) { return wrap ( array , 0 , array length ) ; }


get the map of surplus markers empty if they were not being recorded

public map < path , marker > get surplus markers ( ) { return surplus markers ; }


there are outstanding r p cs on the transport

void on transport active ( ) { is active = true ; shutdown delayed = true ; }


reset ( ) is not supported for hashing input stream

public void reset ( ) throws i o exception { throw new i o exception ( " reset not supported " ) ; }


add a listener to the list of listeners to be notified when there is a change in the content

public void add modify listener ( modify listener listener ) { if ( listeners = = null ) listeners = new array list < > ( ) ; listeners add ( listener ) ; }


invoke the method for the given exchange

public handler result invoke for handler result ( server web exchange exchange , binding context binding context , object provided args ) { completable future < handler result > future = this delegate invoke ( exchange , binding context , provided args ) to future ( ) ; if ( ! future is done ( ) ) { throw new illegal state exception ( " sync invocable handler method should have completed synchronously " ) ; } throwable failure ; try { return future get ( ) ; } catch ( execution exception ex ) { failure = ex get cause ( ) ; } catch ( interrupted exception ex ) { failure = ex ; } throw ( new server error exception ( " failed to invoke : " + get short log message ( ) , get method ( ) , failure ) ) ; }


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


public void set entry points ( boolean b ) { entry points = b ; }


add a component data type onto the end of the dynamic structure

public void add ( data type data , string component name , string component description ) { components add ( components size ( ) , data ) ; component names add ( component names size ( ) , component name ) ; component descs add ( component descs size ( ) , component description ) ; }


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


returns the size in bytes of the file denoted by the current path , following symbolic links the size of a directory or special file is undefined and should not be used

public long get file size ( ) throws i o exception , file not found exception { return file system get file size ( this , true ) ; }


declares the fragments required by this rule for the configuration of the host machine this rule ' s actions execute on this is not the same as the rule ' s configuration the rule ' s configuration is its target configuration , which determines the platform it builds outputs for the actions created by this rule run on a host machine , which is what the host configuration corresponds to in contrast to { @ link # requires host configuration fragments ( class ) } , this method takes starlark module names of fragments instead of their classes

public config aware rule class builder requires host configuration fragments by starlark builtin name ( collection < string > configuration fragment names ) { rule class builder requires configuration fragments by starlark module name ( host transition instance , configuration fragment names ) ; return this ; }


extension hook that subclasses can override to register additional advisors , given the sorted advisors obtained to date the default implementation is empty typically used to add advisors that expose contextual information required by some of the later advisors

protected void extend advisors ( list < advisor > candidate advisors ) { }


resolve the interface name from { @ link annotation attributes }

public static string resolve interface name ( annotation attributes attributes , class < ? > default interface class ) { boolean generic = get attribute ( attributes , " generic " ) ; if ( generic ! = null & & generic ) { / / it ' s a generic reference string interface class name = get attribute ( attributes , " interface name " ) ; assert has text ( interface class name , " @ reference interface name ( ) must be present when reference a generic service ! " ) ; return interface class name ; } return resolve service interface class ( attributes , default interface class ) get name ( ) ; }


invoke api by sending http request with the given options

public < t > void invoke a p i ( string path , string method , list < pair > query params , object body , multi map header params , multi map cookie params , map < string , object > form params , string [ ] accepts , string [ ] content types , string [ ] auth names , auth info auth info , type reference < t > return type , handler < async result < t > > result handler ) { update params for auth ( auth names , auth info , query params , header params , cookie params ) ; if ( accepts ! = null & & accepts length > 0 ) { header params add ( http headers accept , select header accept ( accepts ) ) ; } if ( content types ! = null ) { header params add ( http headers content type , select header content type ( content types ) ) ; } http method http method = http method value of ( method ) ; http request < buffer > request = get web client ( ) request abs ( http method , base path + path ) ; request timeout ( this timeout ) ; if ( http method = = http method patch ) { request put header ( " x - http - method - override " , " patch " ) ; } query params for each ( entry - > { if ( entry get value ( ) ! = null ) { request add query param ( entry get name ( ) , entry get value ( ) ) ; } } ) ; header params for each ( entry - > { if ( entry get value ( ) ! = null ) { request put header ( entry get key ( ) , entry get value ( ) ) ; } } ) ; default headers for each ( entry - > { if ( entry get value ( ) ! = null ) { request put header ( entry get key ( ) , entry get value ( ) ) ; } } ) ; final multi map cookies = multi map case insensitive multi map ( ) add all ( cookie params ) add all ( default cookies ) ; request put header ( " cookie " , build cookie header ( cookies ) ) ; handler < async result < http response < buffer > > > response handler = build response handler ( return type , result handler ) ; if ( body ! = null ) { send body ( request , response handler , body ) ; } else if ( form params ! = null & & ! form params is empty ( ) ) { map < string , string > form map = form params entry set ( ) stream ( ) collect ( to map ( map entry : : get key , entry - > parameter to string ( entry get value ( ) ) ) ) ; multi map form = multi map case insensitive multi map ( ) add all ( form map ) ; request send form ( form , response handler ) ; } else { request send ( response handler ) ; } }


an atn configuration is equal to another if both have the same state , they predict the same alternative , and syntacticsemantic contexts are the same

public boolean equals ( object o ) { if ( ! ( o instanceof a t n config ) ) { return false ; } return this equals ( ( a t n config ) o ) ; }


returns a sun misc unsafe suitable for use in a 3rd party package replace with a simple call to unsafe get unsafe when integrating into a jdk

private static sun misc unsafe get unsafe ( ) { try { return sun misc unsafe get unsafe ( ) ; } catch ( security exception try reflection instead ) { / / we ' ll try reflection instead } try { return java security access controller do privileged ( new java security privileged exception action < sun misc unsafe > ( ) { @ override public sun misc unsafe run ( ) throws exception { class < sun misc unsafe > k = sun misc unsafe class ; for ( java lang reflect field f : k get declared fields ( ) ) { f set accessible ( true ) ; object x = f get ( null ) ; if ( k is instance ( x ) ) { return k cast ( x ) ; } } throw new no such field error ( " the unsafe " ) ; } } ) ; } catch ( java security privileged action exception e ) { throw new runtime exception ( " could not initialize intrinsics " , e get cause ( ) ) ; } }


extracts the authentication from the original headers and checks that it matches the current user this function returns always < code > true < code > if the provided < code > headers < code > do not contain any authentication

boolean ensure authenticated user is same ( map < string , string > origin headers , authentication current ) throws i o exception { if ( origin headers = = null | | origin headers contains key ( authentication key ) = = false ) { / / no authorization attached to the original request return true ; } if ( current = = null ) { / / origin is an authenticated user but current is not return false ; } authentication origin = authentication context serializer decode ( origin headers get ( authentication key ) ) ; return ensure authenticated user is same ( origin , current ) ; }


static factory to retrieve a type 4 ( pseudo randomly generated ) uuid

public static uuid random uuid ( ) { java util uuid uuid = java util uuid random u u i d ( ) ; while ( uuid equals ( sentinel id internal ) | | uuid equals ( zero id internal ) ) { uuid = java util uuid random u u i d ( ) ; } return new uuid ( uuid get most significant bits ( ) , uuid get least significant bits ( ) ) ; }


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


creates a new async stub that supports all call types for the service

public static load balancer stub new stub ( io grpc channel channel ) { io grpc stub abstract stub stub factory < load balancer stub > factory = new io grpc stub abstract stub stub factory < load balancer stub > ( ) { @ java lang override public load balancer stub new stub ( io grpc channel channel , io grpc call options call options ) { return new load balancer stub ( channel , call options ) ; } } ; return load balancer stub new stub ( factory , channel ) ; }


public string get prefix ns string ( ) { return prefix ns string ; }


efficiently adds a flag and a list of values to the command line the values will be joined in execution and separated by commas

public busy box action builder add vectored flag ( @ compile time constant string arg , list < string > values ) { preconditions check not null ( values ) ; command line add all ( arg , vector arg join ( " , " ) each ( values ) ) ; return this ; }


public void call ( throwable e ) { / / handle throwable in case anything is thrown so we don ' t block observers waiting for on error / on completed exception ee ; if ( e instanceof exception ) { ee = ( exception ) e ; } else { ee = new runtime exception ( " throwable caught while executing batch and mapping responses " , e ) ; } logger debug ( " exception mapping responses to requests " , e ) ; / / if a failure occurs we want to pass that exception to all of the futures that we ' ve returned for ( collapsed request < response type , request argument type > request : argument map values ( ) ) { try { ( ( collapsed request subject < response type , request argument type > ) request ) set exception if response not received ( ee ) ; } catch ( illegal state exception e 2 ) { / / if we have partial responses set in map response to requests / / then we may get illegal state exception as we loop over them / / so we ' ll log but continue to the rest logger error ( " partial success of ' map response to requests ' resulted in illegal state exception while setting exception continuing " , e 2 ) ; } } }


delete user this can only be done by the logged in user

public void delete user test ( ) throws api exception { string username = null ; api delete user ( username ) ; / / todo : test validations }


remove all non - any resource requests from the set this is necessary cleanup to avoid request set getting too big

public void cleanup zero non any r r ( ) { iterator < entry < string , resource request > > iter = this asks entry set ( ) iterator ( ) ; while ( iter has next ( ) ) { entry < string , resource request > entry = iter next ( ) ; if ( entry get key ( ) equals ( resource request any ) ) { / / do not delete any rr continue ; } if ( entry get value ( ) get num containers ( ) = = 0 ) { iter remove ( ) ; } } }


dequeue consuming according to { @ link i consumer # consume ( list ) } , this is a serial operation for every work instance

private void on work ( list < metrics > metrics list ) { metrics list for each ( metrics - > { aggregation counter inc ( ) ; merge data cache accept ( metrics ) ; } ) ; merge data cache read ( ) for each ( data - > { if ( log is debug enabled ( ) ) { log debug ( data to string ( ) ) ; } next worker in ( data ) ; } ) ; }


public void set err msg ( string err msg ) { this err msg = err msg ; }


get the value of the < code > name < code > property , < code > null < code > if no such property exists if the key is deprecated , it returns the value of the first key which replaces the deprecated key and is not null values are processed for < a href = " # variable expansion " > variable expansion before being returned as a side effect get loads the properties from the sources if called for the first time as a lazy init

public string get ( string name ) { string [ ] names = handle deprecation ( deprecation context get ( ) , name ) ; string result = null ; for ( string n : names ) { result = substitute vars ( get props ( ) get property ( n ) ) ; } return result ; }


public output stream stderr ( ) { return stderr ; }


returns { @ code true } if and only if the list of nodes is stored in the legacy location

public boolean is legacy ( ) { return ! new file ( jenkins get root dir ( ) , " nodes " ) is directory ( ) ; }


returns a fresh { @ link mutable map } instance with key type { @ code t }

< v > mutable map < t , v > create mutable map ( ) ;


set whether hessian ' s debug mode should be enabled default is " false "

public void set debug ( boolean debug ) { this proxy factory set debug ( debug ) ; }


copies all characters between the { @ link readable } and { @ link appendable } objects does not close or flush either object

public static long copy ( readable from , appendable to ) throws i o exception { / / the most common case is that from is a reader ( like input stream reader or string reader ) so / / take advantage of that if ( from instanceof reader ) { / / optimize for common output types which are optimized to deal with char [ ] if ( to instanceof string builder ) { return copy reader to builder ( ( reader ) from , ( string builder ) to ) ; } else { return copy reader to writer ( ( reader ) from , as writer ( to ) ) ; } } else { check not null ( from ) ; check not null ( to ) ; long total = 0 ; char buffer buf = create buffer ( ) ; while ( from read ( buf ) ! = - 1 ) { java 8 compatibility flip ( buf ) ; to append ( buf ) ; total + = buf remaining ( ) ; java 8 compatibility clear ( buf ) ; } return total ; } } / / todo ( lukes ) : consider allowing callers to pass in a buffer to use , some callers would be able / / to reuse buffers , others would be able to size them more appropriately than the constant / / defaults


classifies resources as publicprivateunknown per https : developer android comstudioprojectsandroid - library # private resources , the { @ code < public > } tag marks a resource as public with all others inferred to be private since { @ code android library } allows mixing directories ( with varying ownership ) in { @ code resource files } ( b 1 4 8 1 1 0 6 8 9 ) , we perform the classification on a per - directory basis , so that marking something in { @ code foores } public has no impact on { @ code barres }

private static visibility registry compute resource visibility ( resource container resource container ) throws unsupported encoding exception { if ( ! resource compiler use visibility from aapt2 ) { return new visibility registry ( immutable set of ( ) , immutable set of ( ) ) ; } / / decode source pools ahead of time to avoid having to repeatedly do so later list < list < string > > source pools = new array list < > ( ) ; for ( resource table resource table : resource container resource tables ( ) ) { source pools add ( decode source pool ( resource table get source pool ( ) get data ( ) to byte array ( ) ) ) ; } public resources public resources = find explicitly public resources ( resource container , source pools ) ; return new visibility registry ( public resources explicitly public resources ( ) , find implied private resources ( resource container , source pools , public resources ) ) ; }


get the job i d of the slot requested for

public job i d get job id ( ) { return job id ; }


returns an array of string value from a node value if the node represents an array the corresponding array of strings is returned otherwise the node is treated as a comma - separated string

public static string [ ] node string array value ( object node ) { if ( is array ( node ) ) { list list = ( list ) node ; string [ ] arr = new string [ list size ( ) ] ; for ( int i = 0 ; i < arr length ; i + + ) { arr [ i ] = node string value ( list get ( i ) , null ) ; } return arr ; } else { return strings split string by comma to array ( node to string ( ) ) ; } }


generalization of { @ link x content map values tests # test prefix ( ) }

public void test filter prefix ( ) throws i o exception { final builder sample = builder - > builder start object ( ) array ( " photos " , " foo " , " bar " ) field ( " photos count " , 2 ) end object ( ) ; builder expected = builder - > builder start object ( ) field ( " photos count " , 2 ) end object ( ) ; test filter ( expected , sample , singleton ( " photos count " ) , empty set ( ) ) ; }


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

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


returns the url of this task relative to the context root of the application when the user clicks an item in the queue , this is the page where the user is taken to hudson expects the current instance to be bound to the url returned by this method


notification that all plugins have had their data states restored

public void data state restore completed ( ) { / / do nothing by default ; subclasses should override as needed }


protected void insert x content type options header ( final http servlet response http servlet response , final http servlet request http servlet request , final string value ) { val uri = http servlet request get request u r i ( ) ; http servlet response add header ( " x - content - type - options " , value ) ; logger trace ( " adding x - content type response headers [ { } ] for [ { } ] " , value , uri ) ; }


unusual code alert ! : this method handles the case where editing of a node triggers a new node to be created in this case , reselecting the node that was edited can leave the tree with a selection that points to a removed node , which has bad consequences to clients we work around this issue by retrieving the node after the edit has finished and been applied

private void reselect node ( ) { string new name = edit node get name ( ) ; g tree node new child = parent get child ( new name ) ; if ( new child = = null ) { throw new assert exception ( " unable to find new node by name : " + new name ) ; } tree set selected node ( new child ) ; }


chooses a blocksize based on the given length of the data to compress

public static int choose block size ( long input length ) { return ( input length > 0 ) ? ( int ) math min ( ( input length / 132000 ) + 1 , 9 ) : max blocksize ; }


public cancellable get script async ( get stored script request request , request options options , action listener < get stored script response > listener ) { return perform request async and parse entity ( request , request converters : : get script , options , get stored script response : : from x content , listener , empty set ( ) ) ; }


return the time zone associated with the given user context , if any , or the system default time zone otherwise this is effectively a replacement for { @ link java util time zone # get default ( ) } , able to optionally respect a user - level time zone setting

public static time zone get time zone ( @ nullable locale context locale context ) { if ( locale context instanceof time zone aware locale context ) { time zone time zone = ( ( time zone aware locale context ) locale context ) get time zone ( ) ; if ( time zone ! = null ) { return time zone ; } } return ( default time zone ! = null ? default time zone : time zone get default ( ) ) ; }


this method handles the deletion of a file in the case of a partial write

private static void fully write file ( path file , writer writer ) throws exception { boolean success = false ; try ( output stream output stream = files new output stream ( file , standard open option create new ) ; zip output stream zip output stream = new zip output stream ( output stream , standard charsets utf 8 ) ; jca p e m writer pem writer = new jca p e m writer ( new output stream writer ( zip output stream , standard charsets utf 8 ) ) ) { writer write ( zip output stream , pem writer ) ; / / set permissions to 600 posix file attribute view view = files get file attribute view ( file , posix file attribute view class ) ; if ( view ! = null ) { view set permissions ( sets new hash set ( posix file permission owner read , posix file permission owner write ) ) ; } success = true ; } finally { if ( success = = false ) { files delete if exists ( file ) ; } } }


guaranteed to throw an exception and leave the map unmodified

public final void replace all ( bi function < ? super k , ? super v , ? extends v > function ) { throw new unsupported operation exception ( ) ; }


returns the node that is adjacent to the origin node along { @ code edge } in the directed case , { @ code edge } is assumed to be an outgoing edge


calculates the minimum value on a given column the value is returned with the same data type of the column lite pal min ( person class , & quot ; age & quot ; , int class ) ; you can also specify a where clause when calculating lite pal where ( & quot ; age & gt ; ? & quot ; , & quot ; 15 & quot ; ) min ( person class , & quot ; age & quot ; , integer type ) ;

public < t > t min ( class < ? > model class , string column name , class < t > column type ) { return min ( base utility change case ( model class get simple name ( ) ) , column name , column type ) ; }


change the value of the auto - pass property on the given function record

public function record set auto pass on function ( function record func rec , boolean value ) throws i o exception { check update allowed ( ) ; return modify function flag ( func rec , function record auto pass flag , value ) ; }


the current time in the same way as other telemetry implementations

static string client date string ( ) { time zone tz = time zone get time zone ( " utc " ) ; date format df = new simple date format ( " yyyy - mm - dd ' t ' hh : mm ' z ' " ) ; df set time zone ( tz ) ; / / strip timezone return df format ( new date ( ) ) ; }


whether user has enabled development settings

public static boolean is development settings enabled ( ) { return settings global get int ( utils get app ( ) get content resolver ( ) , settings global development settings enabled , 0 ) > 0 ; }


public expiration policy to ticket expiration policy ( ) { val simple = cas properties get authn ( ) get mfa ( ) get simple ( ) ; return new hard timeout expiration policy ( simple get time to kill in seconds ( ) ) ; }


public static string post form ( string data , string url ) { return do http action ( data , false , true , url ) ; }


public string get mnemonic representation ( code unit cu ) { string buffer string buffer = new string buffer ( ) ; string mnemonic = cu get mnemonic string ( ) ; if ( options show data mutability & & ( cu instanceof data ) & & mnemonic ! = null ) { data d = ( data ) cu ; if ( d is constant ( ) ) { string buffer append ( " const " ) ; } else if ( d is volatile ( ) ) { string buffer append ( " volatile " ) ; } } string buffer append ( mnemonic ) ; return string buffer to string ( ) ; }


closes the current { @ code zip entry } any entry terminal data is written to the underlying stream

public void close entry ( ) throws i o exception { check open ( ) ; if ( current entry = = null ) { return ; } if ( current entry get method ( ) = = deflated ) { super finish ( ) ; } / / verify values for stored types if ( current entry get method ( ) = = stored ) { if ( crc get value ( ) ! = current entry get crc ( ) ) { throw new zip exception ( " crc mismatch " ) ; } if ( current entry get size ( ) ! = crc data size ) { throw new zip exception ( " size mismatch " ) ; } } int cur offset = lochdr ; / / write the data descriptor if ( current entry get method ( ) ! = stored ) { cur offset + = exthdr ; write long ( out , extsig ) ; current entry set crc ( crc get value ( ) ) ; write long ( out , current entry get crc ( ) ) ; current entry set compressed size ( def get total out ( ) ) ; write long ( out , current entry get compressed size ( ) ) ; current entry set size ( def get total in ( ) ) ; write long ( out , current entry get size ( ) ) ; } / / update the central directory / / http : / / www pkware com / documents / casestudies / appnote txt int flags = current entry get method ( ) = = stored ? 0 : gpbf data descriptor flag ; / / since gingerbread , we always set the utf - 8 flag on individual files / / some tools insist that the central directory also have the utf - 8 flag / / http : / / code google com / p / android / issues / detail ? id = 20214 flags | = gpbf utf8 flag ; write long ( c dir , censig ) ; write short ( c dir , z i p local header version needed ) ; / / version created write short ( c dir , z i p local header version needed ) ; / / version to extract write short ( c dir , flags ) ; write short ( c dir , current entry get method ( ) ) ; write short ( c dir , time const ) ; write short ( c dir , mod date const ) ; write long ( c dir , crc get value ( ) ) ; if ( current entry get method ( ) = = deflated ) { cur offset + = write long ( c dir , def get total out ( ) ) ; write long ( c dir , def get total in ( ) ) ; } else { cur offset + = write long ( c dir , crc data size ) ; write long ( c dir , crc data size ) ; } cur offset + = write short ( c dir , name length ) ; if ( current entry get extra ( ) ! = null ) { cur offset + = write short ( c dir , current entry get extra ( ) length ) ; } else { write short ( c dir , 0 ) ; } string comment = current entry get comment ( ) ; byte [ ] comment bytes = empty byte array ; if ( comment ! = null ) { comment bytes = comment get bytes ( charset for name ( " utf - 8 " ) ) ; } write short ( c dir , comment bytes length ) ; / / comment length write short ( c dir , 0 ) ; / / disk start write short ( c dir , 0 ) ; / / internal file attributes write long ( c dir , 0 ) ; / / external file attributes write long ( c dir , offset ) ; / / relative offset of local file header c dir write ( name bytes ) ; name bytes = null ; if ( current entry get extra ( ) ! = null ) { c dir write ( current entry get extra ( ) ) ; } offset + = cur offset + padding ; padding = 0 ; if ( comment bytes length > 0 ) { c dir write ( comment bytes ) ; } current entry = null ; crc reset ( ) ; crc data size = 0 ; def reset ( ) ; }


creates an { @ link executor service } whose { @ code submit } and { @ code invoke all } methods submit { @ link listenable future task } instances to the given delegate executor those methods , as well as { @ code execute } and { @ code invoke any } , are implemented in terms of calls to { @ code delegate execute } all other methods are forwarded unchanged to the delegate this implies that the returned { @ code listening executor service } never calls the delegate ' s { @ code submit } , { @ code invoke all } , and { @ code invoke any } methods , so any special handling of tasks must be implemented in the delegate ' s { @ code execute } method or by wrapping the returned { @ code listening executor service } if the delegate executor was already an instance of { @ code listening executor service } , it is returned untouched , and the rest of this documentation does not apply

public static listening executor service listening decorator ( executor service delegate ) { return ( delegate instanceof listening executor service ) ? ( listening executor service ) delegate : ( delegate instanceof scheduled executor service ) ? new scheduled listening decorator ( ( scheduled executor service ) delegate ) : new listening decorator ( delegate ) ; }


public int get write buffer low water mark ( ) { return write buffer low water mark ; }


visit a parse tree produced by the { @ code statement default } labeled alternative in { @ link sql base parser # statement }

t visit statement default ( sql base parser statement default context ctx ) ;


create the uri needed to query the location of an object

private uri path to object location ( swift object path path ) throws swift exception { uri uri ; string data location u r i = object location u r i to string ( ) ; try { if ( path to string ( ) starts with ( " / " ) ) { data location u r i = data location u r i concat ( path to uri path ( ) ) ; } else { data location u r i = data location u r i concat ( " / " ) concat ( path to uri path ( ) ) ; } uri = new uri ( data location u r i ) ; } catch ( u r i syntax exception e ) { throw new swift exception ( e ) ; } return uri ; }


reset all indexed colors with the default color from the color theme

public void reset ( ) { system arraycopy ( color scheme m default colors , 0 , m current colors , 0 , text style num indexed colors ) ; }


public final string get script name ( ) { if ( source file = = null ) { return get class ( ) get simple name ( ) + " class " ; } return source file get name ( ) ; }


assert that the value of { @ link # diff ( ) } matches that of another instance

public void assert diff equals ( metric diff that ) { assert assert equals ( this to string ( ) + " ! = " + that , this diff ( ) , that diff ( ) ) ; }


this method can reset the generator to a specific value

public void reset container id counter ( long container id start ) { this container id counter set ( container id start ) ; }


return the name of the missing bean , if it was a lookup by name that failed

public string get bean name ( ) { return this bean name ; }


convenience method for subclasses to create a specific { @ code exception type filter }

protected exception type filter create exception type filter ( class < ? extends throwable > [ ] includes , class < ? extends throwable > [ ] excludes ) { return new exception type filter ( arrays as list ( includes ) , arrays as list ( excludes ) , true ) ; }


notifies the tracker of a change to the playback suppression ( e g due to audio focus loss ) , including all updates while the playback is not in the foreground

public void on is suppressed changed ( event time event time , boolean is suppressed , boolean belongs to playback ) { this is suppressed = is suppressed ; maybe update playback state ( event time , belongs to playback ) ; }


helper method to set jackson ' s { @ link object mapper }

public api client set object mapper ( object mapper mapper ) { this default mapper = mapper ; return this ; }


writes a { @ link tuple } data set as csv file ( s ) to the specified location < b > note : only a tuple data set can written as a csv file < b > for each tuple field the result of { @ link object # to string ( ) } is written tuple fields are separated by the default field delimiter { @ code " comma " ( , ) } tuples are are separated by the newline character ( { @ code \ n } )

public data sink < t > write as csv ( string file path , write mode write mode ) { return internal write as csv ( new path ( file path ) , csv output format default line delimiter , csv output format default field delimiter , write mode ) ; }


creates a state with { @ link state state type # normal } and adds it to the collection of created states should be used instead of instantiating with new operator

private state < t > create state ( string name , state state type state type ) { string state name = state name handler get unique internal name ( name ) ; state < t > state = new state < > ( state name , state type ) ; states add ( state ) ; return state ; }


{ @ linkplain # merge properties merge } , { @ linkplain # convert properties convert } and { @ linkplain # process properties process } properties against the given bean factory

public void post process bean factory ( configurable listable bean factory bean factory ) throws beans exception { try { properties merged props = merge properties ( ) ; / / convert the merged properties , if necessary convert properties ( merged props ) ; / / let the subclass process the properties process properties ( bean factory , merged props ) ; } catch ( i o exception ex ) { throw new bean initialization exception ( " could not load properties " , ex ) ; } }


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 string get class name ( ) { return class name ; }


set the change listener for this component

public void set change listener ( change listener listener ) { this listener = listener ; }


put user { username } : updated user this can only be done by the logged in user

response entity < void > update user ( @ api param ( value = " name that need to be deleted " , required = true ) @ path variable ( " username " ) string username , @ api param ( value = " updated user object " , required = true ) @ valid @ request body user body ) ;


assert whether or not a model attribute is available

public static void assert model attribute available ( model and view mav , string model name ) { map < string , object > model = mav get model ( ) ; assert true ( " model attribute with name ' " + model name + " ' is not available " , model contains key ( model name ) ) ; }


asserts that permission is denied to the given fsuser for the given file

public static void assert file permission denied ( file system fs , user group information user , path path to check ) throws exception { try { d f s test util read file buffer ( fs , path to check ) ; fail ( " expected access control exception for user " + user + " , path = " + path to check ) ; } catch ( access control exception e ) { / / expected } }


turns a path ( relative or otherwise ) into an s3 key

public string path to key ( path path ) { if ( ! path is absolute ( ) ) { path = new path ( working dir , path ) ; } if ( path to uri ( ) get scheme ( ) ! = null & & path to uri ( ) get path ( ) is empty ( ) ) { return " " ; } return path to uri ( ) get path ( ) substring ( 1 ) ; }


tests that the { @ link abstract task manager file handler } serves the requested file

public void test file serving ( ) throws exception { final time cache entry duration = time milliseconds ( 1000l ) ; final queue < completable future < transient blob key > > request file uploads = new array deque < > ( 1 ) ; request file uploads add ( completable future completed future ( transient blob key 1 ) ) ; final test task manager file handler test task manager file handler = create test task manager file handler ( cache entry duration , request file uploads , expected task manager id ) ; final file output file = temporary folder new file ( ) ; final testing channel handler context testing context = new testing channel handler context ( output file ) ; test task manager file handler respond to request ( testing context , http request , handler request , null ) ; assert that ( output file length ( ) , is ( greater than ( 0l ) ) ) ; assert that ( file utils read file utf 8 ( output file ) , is ( equal to ( file content 1 ) ) ) ; }


return true if the provided field may have multiple values per document in the leaf

private boolean is maybe multivalued ( leaf reader context context , sort field sort field ) throws i o exception { sort field type type = index sort config get sort field type ( sort field ) ; switch ( type ) { case string : final sorted set doc values v 1 = context reader ( ) get sorted set doc values ( sort field get field ( ) ) ; return v 1 ! = null & & doc values unwrap singleton ( v 1 ) = = null ; case double : case float : case long : case int : final sorted numeric doc values v 2 = context reader ( ) get sorted numeric doc values ( sort field get field ( ) ) ; return v 2 ! = null & & doc values unwrap singleton ( v 2 ) = = null ; default : / / we have no clue whether the field is multi - valued or not so we assume it is return true ; } }


sets the position of the limit line value label ( either on the right or on the left edge of the chart ) not supported for radar chart

public void set label position ( limit label position pos ) { m label position = pos ; }


check the next instruction within a block of instructions

public boolean exceeds repeat byte pattern ( pseudo instruction inst ) { if ( repeat pattern limit < = 0 ) { return false ; } if ( repeat pattern limit ignored region ! = null & & repeat pattern limit ignored region contains ( inst get address ( ) ) ) { repeat pattern cnt = 0 ; return false ; } byte repeated byte = inst get repeated byte ( ) ; if ( repeated byte = = null ) { repeat pattern cnt = 0 ; } else if ( repeat byte value = = repeated byte ) { if ( + + repeat pattern cnt > repeat pattern limit ) { repeat pattern cnt = 0 ; return true ; } } else { repeat byte value = repeated byte ; repeat pattern cnt = 1 ; } return false ; }


the same as get group name ( snapshot current state id )

public final string get group name ( ) { return get group name ( snapshot current state id ) ; }


returns the x - value of this entry object


set the search string used to narrow the filtered set of builds

public void set search string ( @ non null string search string ) { this search string = search string ; }


public static boolean zip file ( final file src file , final file zip file , final string comment ) throws i o exception { if ( src file = = null | | zip file = = null ) return false ; zip output stream zos = null ; try { zos = new zip output stream ( new file output stream ( zip file ) ) ; return zip file ( src file , " " , zos , comment ) ; } finally { if ( zos ! = null ) { zos close ( ) ; } } }


starts closing all closeable objects captured during the { @ link closing future } ' s asynchronous operation on the { @ link executor } s specified by calls to { @ link deferred closer # eventually close ( closeable , executor ) } if any such calls specified { @ link more executors # direct executor ( ) } , those objects will be closed synchronously idempotent : objects will be closed at most once

public void close async ( ) { closing future close ( ) ; }


return a sequential { @ link stream } containing the property values

default stream < property value > stream ( ) { return stream support stream ( spliterator ( ) , false ) ; }


public void remove ( ) { check state ( key ! = long min value ) ; prev next = next ; next prev = prev ; prev = next = null ; type = null ; }


private void edit tag comment ( program program , string tag name , string new comment ) throws i o exception { function tag manager tag manager = get tag manager ( program ) ; function tag tag = tag manager get function tag ( tag name ) ; assert not null ( tag ) ; tag set comment ( new comment ) ; }


set a resource loader to use for this context if set , the context will delegate all { @ code get resource } calls to the given resource loader if not set , default resource loading will apply the main reason to specify a custom resource loader is to resolve resource paths ( without url prefix ) in a specific fashion the default behavior is to resolve such paths as class path locations to resolve resource paths as file system locations , specify a file system resource loader here you can also pass in a full resource pattern resolver , which will be autodetected by the context and used for { @ code get resources } calls as well else , default resource pattern matching will apply

public void set resource loader ( resource loader resource loader ) { this resource loader = resource loader ; }


return the default file type map of this message , or { @ code null } if none

public final file type map get default file type map ( ) { return this default file type map ; }


attempts to decode a single upcean - encoded digit

static int decode digit ( bit array row , int [ ] counters , int row offset , int [ ] [ ] patterns ) throws not found exception { record pattern ( row , row offset , counters ) ; float best variance = max avg variance ; / / worst variance we ' ll accept int best match = - 1 ; int max = patterns length ; for ( int i = 0 ; i < max ; i + + ) { int [ ] pattern = patterns [ i ] ; float variance = pattern match variance ( counters , pattern , max individual variance ) ; if ( variance < best variance ) { best variance = variance ; best match = i ; } } if ( best match > = 0 ) { return best match ; } else { throw not found exception get not found instance ( ) ; } }


private test case parse test suite ( x m l stream reader parser , string element name ) throws x m l stream exception , test xml output parser exception { test case builder builder = test case new builder ( ) ; builder set type ( test case type test suite ) ; for ( int i = 0 ; i < parser get attribute count ( ) ; i + + ) { string name = parser get attribute local name ( i ) intern ( ) ; string value = parser get attribute value ( i ) ; if ( name equals ( " name " ) ) { builder set name ( value ) ; } else if ( name equals ( " time " ) ) { builder set run duration millis ( parse time ( value ) ) ; } } parse contained elements ( parser , element name , builder ) ; return builder build ( ) ; }


check if we are currently in the handler thread of this handler executor service


get usage statistics for the given shard

public query cache stats get stats ( shard id shard ) { final map < shard id , query cache stats > stats = new hash map < > ( ) ; for ( map entry < shard id , stats > entry : shard stats entry set ( ) ) { stats put ( entry get key ( ) , entry get value ( ) to query cache stats ( ) ) ; } query cache stats shard stats = new query cache stats ( ) ; query cache stats info = stats get ( shard ) ; if ( info = = null ) { info = new query cache stats ( ) ; } shard stats add ( info ) ; / / we also have some shared ram usage that we try to distribute to / / proportionally to their number of cache entries of each shard long total size = 0 ; for ( query cache stats s : stats values ( ) ) { total size + = s get cache size ( ) ; } final double weight = total size = = 0 ? 1d / stats size ( ) : ( ( double ) shard stats get cache size ( ) ) / total size ; final long additional ram bytes used = math round ( weight * shared ram bytes used ) ; shard stats add ( new query cache stats ( additional ram bytes used , 0 , 0 , 0 , 0 ) ) ; return shard stats ; }


gets signing key registered service property

protected registered service properties get signing key registered service property ( ) { return registered service properties token as service ticket signing key ; }


create a { @ link dispatcher servlet } ( or other kind of { @ link framework servlet } - derived dispatcher ) with the specified { @ link web application context } note : this allows for any { @ link framework servlet } subclass as of 4 2 3 previously , it insisted on returning a { @ link dispatcher servlet } or subclass thereof

protected framework servlet create dispatcher servlet ( web application context servlet app context ) { return new dispatcher servlet ( servlet app context ) ; }


adds load image task to execution pool image will be returned with { @ link image loading listener # on loading complete ( string , android view view , android graphics bitmap ) } callback } < br > < b > note : < b > { @ link # init ( image loader configuration ) } method must be called before this method call

public void load image ( string uri , image size target image size , display image options options , image loading listener listener ) { load image ( uri , target image size , options , listener , null ) ; }


location to write api files you can use the api package ( ) as defined when the class is instantiated

public string api file folder ( ) { return output folder + file separator + source folder + file separator + api package ( ) replace ( ' ' , file separator char ) ; }


creates and returns a new " amnesiac " builder based on the amnesiac cache

protected builder with result amnesiac builder ( ) throws exception { return create builder ( amnesiac cache ) ; }


notify listeners about changed files , and release any associated memory afterwards

public void drain changed files ( ) { incremental build monitor alert listeners ( get event bus ( ) ) ; incremental build monitor = null ; }


gets attribute repository ids that should be used to fetch attributes an empty collection indicates that all sources available and defined should be used

default set < string > get attribute repository ids ( ) { return new hash set < > ( 0 ) ; }


set a concurrency for the listener , if any the concurrency limits can be a " lower - upper " string , e g " 5 - 10 " , or a simple upper limit string , e g " 10 " ( the lower limit will be 1 in this case ) the underlying container may or may not support all features for instance , it may not be able to scale : in that case only the upper value is used

public void set concurrency ( @ nullable string concurrency ) { this concurrency = concurrency ; }


returns true if all services are currently in the { @ linkplain state # running running } state users who want more detailed information should use the { @ link # services by state } method to get detailed information about which services are not running

public boolean is healthy ( ) { for ( service service : services ) { if ( ! service is running ( ) ) { return false ; } } return true ; }


public void set used ( long dfs used space ) { if ( dfs used space > this get capacity ( ) ) { log warn ( " volume usage ( " + dfs used space + " ) is greater than capacity ( " + this get capacity ( ) + " ) setting volume usage to the capacity " ) ; this used = this get capacity ( ) ; } else { this used = dfs used space ; } }


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


test the property ' map of map property '

public void map of map property test ( ) { / / todo : test map of map property }


adds a region to the atlas the texture for the specified region will be disposed when the atlas is disposed

public atlas region add region ( string name , texture region texture region ) { textures add ( texture region texture ) ; atlas region region = new atlas region ( texture region ) ; region name = name ; regions add ( region ) ; return region ; }


public double get timing ( long time ) ;


parses a command line that may contain one or more flags before an optional command string

public boolean parse options ( string [ ] args ) { list < string > arg list = arrays as list ( args ) ; iterator < string > it = arg list iterator ( ) ; while ( it has next ( ) ) { string opt = it next ( ) ; try { if ( opt equals ( " - server " ) ) { options put ( " server " , it next ( ) ) ; } else if ( opt equals ( " - timeout " ) ) { options put ( " timeout " , it next ( ) ) ; } else if ( opt equals ( " - r " ) ) { options put ( " readonly " , " true " ) ; } else if ( opt equals ( " - client - configuration " ) ) { options put ( " client - configuration " , it next ( ) ) ; } } catch ( no such element exception e ) { system err println ( " error : no argument found for option " + opt ) ; return false ; } if ( ! opt starts with ( " - " ) ) { command = opt ; cmd args = new array list < string > ( ) ; cmd args add ( command ) ; while ( it has next ( ) ) { cmd args add ( it next ( ) ) ; } return true ; } } return true ; }


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

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


appends the given json value , including all its fields recursively , to the stream

public u b json writer value ( json value value ) throws i o exception { if ( value is object ( ) ) { if ( value name ! = null ) object ( value name ) ; else object ( ) ; for ( json value child = value child ; child ! = null ; child = child next ) value ( child ) ; pop ( ) ; } else if ( value is array ( ) ) { if ( value name ! = null ) array ( value name ) ; else array ( ) ; for ( json value child = value child ; child ! = null ; child = child next ) value ( child ) ; pop ( ) ; } else if ( value is boolean ( ) ) { if ( value name ! = null ) name ( value name ) ; value ( value as boolean ( ) ) ; } else if ( value is double ( ) ) { if ( value name ! = null ) name ( value name ) ; value ( value as double ( ) ) ; } else if ( value is long ( ) ) { if ( value name ! = null ) name ( value name ) ; value ( value as long ( ) ) ; } else if ( value is string ( ) ) { if ( value name ! = null ) name ( value name ) ; value ( value as string ( ) ) ; } else if ( value is null ( ) ) { if ( value name ! = null ) name ( value name ) ; value ( ) ; } else { throw new i o exception ( " unhandled json value type " ) ; } return this ; }


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


updates the result of decoding this object this method is supposed to be invoked by a decoder do not call this method unless you know what you are doing

void set decoder result ( decoder result result ) ;


return the { @ link request upgrade strategy } for web socket requests

public request upgrade strategy get upgrade strategy ( ) { return this upgrade strategy ; }


returns an iterable to obtain input streams for previously stored keyed state partitions that are assigned to this operator

iterable < key group state partition stream provider > get raw keyed state inputs ( ) ;


restricted constructors to ensure v 1 or v 2 , not both

public static s 3 list request v 2 ( list objects v 2 request request ) { return new s 3 list request ( null , request ) ; }


submits a cluster state update task ; submitted updates will be batched across the same instance of executor the exact batching semantics depend on the underlying implementation but a rough guideline is that if the update task is submitted while there are pending update tasks for the same executor , these update tasks will all be executed on the executor in a single batch

public < t > void submit state update task ( string source , t task , cluster state task config config , cluster state task executor < t > executor , cluster state task listener listener ) { submit state update tasks ( source , collections singleton map ( task , listener ) , config , executor ) ; }


returns { @ code true } if every element in { @ code iterable } satisfies the predicate if { @ code iterable } is empty , { @ code true } is returned < b > { @ code stream } equivalent : < b > { @ link stream # all match }

public static < t > boolean all ( iterable < t > iterable , predicate < ? super t > predicate ) { return iterators all ( iterable iterator ( ) , predicate ) ; }


if there is an external add conflict , but it is between a new external function versus a new external data label , we don ' t want to give the user the keep both or merge both options

private boolean is add conflict special function vs data ( external location latest external location , external location my external location , task monitor monitor ) { long my external i d = my external location get symbol ( ) get i d ( ) ; long latest external i d = latest external location get symbol ( ) get i d ( ) ; long result external i d = get result i dfrom latest i d ( latest external i d ) ; symbol latest symbol = symbol tables [ latest ] get symbol ( latest external i d ) ; symbol my symbol = symbol tables [ my ] get symbol ( my external i d ) ; symbol result symbol = symbol tables [ result ] get symbol ( result external i d ) ; external location [ ] external locations = new external location [ 4 ] ; external locations [ latest ] = external managers [ latest ] get external location ( latest symbol ) ; external locations [ my ] = external managers [ my ] get external location ( my symbol ) ; external locations [ original ] = null ; external locations [ result ] = external managers [ result ] get external location ( result symbol ) ; string latest name = get external name ( external locations , latest , true ) ; string my name = get external name ( external locations , my , true ) ; boolean latest is function = external locations [ latest ] is function ( ) ; boolean my is function = external locations [ my ] is function ( ) ; address latest address = external locations [ latest ] get address ( ) ; address my address = external locations [ my ] get address ( ) ; boolean has addresses = latest address ! = null & & my address ! = null ; boolean names match = system utilities is equal ( latest name , my name ) ; boolean addresses match = system utilities is equal ( latest address , my address ) ; boolean types differ = latest is function ! = my is function ; return names match & & types differ & & has addresses & & addresses match ; }


invalidates the given block on the given datanode

private boolean invalidate block ( block to mark corrupt b , datanode info dn , number replicas nr ) throws i o exception { block log debug ( " block * invalidate block : { } on { } " , b , dn ) ; datanode descriptor node = get datanode manager ( ) get datanode ( dn ) ; if ( node = = null ) { throw new i o exception ( " cannot invalidate " + b + " because datanode " + dn + " does not exist " ) ; } / / check how many copies we have of the block if ( nr replicas on stale nodes ( ) > 0 & & ! delete corrupt replica immediately ) { block log debug ( " block * invalidate blocks : postponing " + " invalidation of { } on { } because { } replica ( s ) are located on " + " nodes with potentially out - of - date block reports " , b , dn , nr replicas on stale nodes ( ) ) ; postpone block ( b get corrupted ( ) ) ; return false ; } else { / / we already checked the number of replicas in the caller of this / / function and know there are enough live replicas , so we can delete it add to invalidates ( b get corrupted ( ) , dn ) ; remove stored block ( b get stored ( ) , node ) ; block log debug ( " block * invalidate blocks : { } on { } listed for deletion " , b , dn ) ; return true ; } }


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


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


store the transform configuration in the internal index

void put transform configuration ( transform config transform config , action listener < boolean > listener ) ;


creates a record from an input data string

protected < t extends base record > t new record ( string data , class < t > clazz , boolean include dates ) throws i o exception { return serializer deserialize ( data , clazz ) ; }


inserts timestamps in order into a linked list if timestamps arrive in order ( as in case of using the rocks d b state backend ) this is just an append with o ( 1 )

private void insert to sorted list ( long record timestamp ) { list iterator < long > list iterator = sorted timestamps list iterator ( sorted timestamps size ( ) ) ; boolean is continue = true ; while ( list iterator has previous ( ) & & is continue ) { long timestamp = list iterator previous ( ) ; if ( record timestamp > = timestamp ) { list iterator next ( ) ; list iterator add ( record timestamp ) ; is continue = false ; } } if ( is continue ) { sorted timestamps add first ( record timestamp ) ; } }


public string get storage type ( ) { return storage type ; }


adds all header entries of the specified { @ code headers }

public http headers add ( http headers headers ) { object util check not null ( headers , " headers " ) ; for ( map entry < string , string > e : headers ) { add ( e get key ( ) , e get value ( ) ) ; } return this ; }


diamond case rule r 1 depends or r 0 with aspect a 1 rule r 2 depends or r 0 with aspect a 2 rule rcollect depends on r 1 , r 2 with aspect a 3 aspect a 3 should be applied twice to target r 0 : once in [ a 1 , a 3 ] sequence and once in [ a 2 , a 3 ] sequence

public void aspect on aspect diamond ( ) throws exception { scratch file ( " test / aspect bzl " , " def a 1 impl ( target , ctx ) : " , " return struct ( a 1p = ' text from a 1 ' ) " , " a 1 = aspect ( a 1 impl , attr aspects = [ ' deps ' ] , provides = [ ' a 1p ' ] ) " , " " , " def a 2 impl ( target , ctx ) : " , " return struct ( a 2p = ' text from a 2 ' ) " , " a 2 = aspect ( a 2 impl , attr aspects = [ ' deps ' ] , provides = [ ' a 2p ' ] ) " , " " , " def a 3 impl ( target , ctx ) : " , " value = [ ] " , " f = ctx actions declare file ( ' a 3 out ' ) " , " ctx actions write ( f , ' text ' ) " , " for dep in ctx rule attr deps : " , " if hasattr ( dep , ' a 3p ' ) : " , " value + = dep a 3p " , " s = str ( target label ) + str ( ctx aspect ids ) + ' = ' " , " if hasattr ( target , ' a 1p ' ) : " , " s + = ' a 1p ' " , " if hasattr ( target , ' a 2p ' ) : " , " s + = ' a 2p ' " , " value append ( s ) " , " return struct ( a 3p = value ) " , " a 3 = aspect ( a 3 impl , attr aspects = [ ' deps ' ] , " , " required aspect providers = [ [ ' a 1p ' ] , [ ' a 2p ' ] ] ) " , " def r 1 impl ( ctx ) : " , " pass " , " def rcollect impl ( ctx ) : " , " value = [ ] " , " for dep in ctx attr deps : " , " if hasattr ( dep , ' a 3p ' ) : " , " value + = dep a 3p " , " return struct ( result = value ) " , " r 1 = rule ( r 1 impl , attrs = { ' deps ' : attr label list ( aspects = [ a 1 ] ) } ) " , " r 2 = rule ( r 1 impl , attrs = { ' deps ' : attr label list ( aspects = [ a 2 ] ) } ) " , " rcollect = rule ( rcollect impl , attrs = { ' deps ' : attr label list ( aspects = [ a 3 ] ) } ) " ) ; scratch file ( " test / build " , " load ( ' : aspect bzl ' , ' r 1 ' , ' r 2 ' , ' rcollect ' ) " , " r 1 ( name = ' r 0 ' ) " , " r 1 ( name = ' r 1 ' , deps = [ ' : r 0 ' ] ) " , " r 2 ( name = ' r 2 ' , deps = [ ' : r 0 ' ] ) " , " rcollect ( name = ' rcollect ' , deps = [ ' : r 1 ' , ' : r 2 ' ] ) " ) ; analysis result analysis result = update ( " / / test : rcollect " ) ; configured target target = iterables get only element ( analysis result get targets to build ( ) ) ; sequence < ? > result = ( sequence ) target get ( " result " ) ; assert that ( result ) contains exactly ( " / / test : r 0 [ \ " / / test : aspect bzl % a 1 \ " , \ " / / test : aspect bzl % a 3 \ " ] = a 1p " , " / / test : r 1 [ \ " / / test : aspect bzl % a 3 \ " ] = " , " / / test : r 0 [ \ " / / test : aspect bzl % a 2 \ " , \ " / / test : aspect bzl % a 3 \ " ] = a 2p " , " / / test : r 2 [ \ " / / test : aspect bzl % a 3 \ " ] = " ) ; }


post - process the given object that has been obtained from the factory bean the resulting object will get exposed for bean references the default implementation simply returns the given object as - is subclasses may override this , for example , to apply post - processors

protected object post process object from factory bean ( object object , string bean name ) throws beans exception { return object ; }


returns an immutable list containing the given elements , in order

public static < e > immutable list < e > of ( e e 1 , e e 2 , e e 3 , e e 4 , e e 5 , e e 6 , e e 7 , e e 8 , e e 9 , e e 1 0 , e e 1 1 ) { return construct ( e 1 , e 2 , e 3 , e 4 , e 5 , e 6 , e 7 , e 8 , e 9 , e 1 0 , e 1 1 ) ; } / / these go up to eleven after that , you just get the varargs form , and / / whatever warnings might come along with it : (


public void remove ( ) { prev next = next ; next prev = prev ; next = prev = null ; }


get the erasure coding policy if it ' s set

public erasure coding policy get erasure coding policy ( ) { return ec policy ; }


get the time taken by a named task the names of tasks that have run can be retrieved using get timed tasks

public long get task time ( map < string , long > map , string task name ) { long time = map get ( task name ) ; if ( time = = null ) { return - 1 ; } return time long value ( ) ; }


public string read output file ( configuration conf ) throws i o exception { file system local fs = file system get local ( conf ) ; path file = new path ( output dir , " part - r - 00000 " ) ; return utils for tests slurp hadoop ( file , local fs ) ; }


initializes the throughput benchmark with the given parameters

public void set up ( int record writers , int channels , int flush timeout , boolean broadcast mode , boolean local mode , int sender buffer pool size , int receiver buffer pool size , configuration config ) throws exception { environment = new stream network benchmark environment < > ( ) ; environment set up ( record writers , channels , local mode , sender buffer pool size , receiver buffer pool size , config ) ; writer threads = new long record writer thread [ record writers ] ; for ( int writer = 0 ; writer < record writers ; writer + + ) { result partition writer result partition writer = environment create result partition writer ( writer ) ; record writer builder record writer builder = new record writer builder ( ) set timeout ( flush timeout ) ; set channel selector ( record writer builder , broadcast mode ) ; writer threads [ writer ] = new long record writer thread ( record writer builder build ( result partition writer ) , broadcast mode ) ; writer threads [ writer ] start ( ) ; } receiver = environment create receiver ( ) ; }


required : one or more labels that indicate a specific set of pods v ms on which this gateway configuration should be applied the scope of label search is restricted to the configuration namespace in which the the resource is present in other words , the gateway resource must reside in the same namespace as the gateway workload instance < code > map & lt ; string , string & gt ; selector = 2 ; < code >

public boolean contains selector ( java lang string key ) { if ( key = = null ) { throw new java lang null pointer exception ( ) ; } return internal get selector ( ) get map ( ) contains key ( key ) ; }


this is probably a weird and hacky way to test what we ' re really trying to test , but hey , it caught a bug

public void test trimmed ( ) { immutable long array iia = immutable long array of ( 0 , 1 , 3 ) ; assert doesnt actually trim ( iia ) ; assert doesnt actually trim ( iia sub array ( 0 , 3 ) ) ; assert actually trims ( iia sub array ( 0 , 2 ) ) ; assert actually trims ( iia sub array ( 1 , 3 ) ) ; immutable long array right sized = immutable long array builder ( 3 ) add ( 0 ) add ( 1 ) add ( 3 ) build ( ) ; assert doesnt actually trim ( right sized ) ; immutable long array over sized = immutable long array builder ( 3 ) add ( 0 ) add ( 1 ) build ( ) ; assert actually trims ( over sized ) ; immutable long array under sized = immutable long array builder ( 2 ) add ( 0 ) add ( 1 ) add ( 3 ) build ( ) ; assert actually trims ( under sized ) ; }


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


these test cases test to test the creation of a local folder with correct permission for result of mapper

public void test check dir normal local ( ) throws throwable { check dirs ( true , " 755 " , true ) ; }


performs a selection operation on a flat aggregate table table similar to a sql select statement the field expressions can contain complex expressions < b > note < b > : you have to close the flat aggregate with a select statement and the select statement does not support aggregate functions example : { @ code table aggregate function table agg func = new my table aggregate function ( ) ; table env register function ( " table agg func " , table agg func ) ; tab group by ( $ ( " key " ) ) flat aggregate ( call ( " table agg func " , $ ( " a " ) , $ ( " b " ) ) as ( " x " , " y " , " z " ) ) select ( $ ( " key " ) , $ ( " x " ) , $ ( " y " ) , $ ( " z " ) ) ; } scala example : { @ code val table agg func : table aggregate function = new my table aggregate function tab group by ( $ " key " ) flat aggregate ( table agg func ( $ " a " , $ " b " ) as ( " x " , " y " , " z " ) ) select ( $ " key " , $ " x " , $ " y " , $ " z " ) }


returns true actions that manipulate the satellite viewer should be enabled for this context

public boolean should show satellite actions ( ) { / / these actions should be available generically ; subclasses may override to return false return true ; }


public offset date time get ship date ( ) { return ship date ; }


specifies which version of socks to use ( 4 or 5 )

public proxy set socks version ( integer socks version ) { verify proxy type compatibility ( proxy type manual ) ; this proxy type = proxy type manual ; this socks version = socks version ; return this ; }


set an alternative logger to use than the one based on the class name

public void set logger ( log logger ) { this logger = logger ; }


public final void set job submission time ( final long job submission time config ) { this job submission time = job submission time config ; }


set the { @ link marshaller } to be used by this message converter

public void set marshaller ( marshaller marshaller ) { assert not null ( marshaller , " marshaller must not be null " ) ; this marshaller = marshaller ; }


set the value of the ' { @ code label } ' attribute may be a runtime expression

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


set the thread pool executor ' s keep - alive seconds default is 60 < b > this setting can be modified at runtime , for example through jmx < b >

public void set keep alive seconds ( int keep alive seconds ) { synchronized ( this pool size monitor ) { this keep alive seconds = keep alive seconds ; if ( this thread pool executor ! = null ) { this thread pool executor set keep alive time ( keep alive seconds , time unit seconds ) ; } } }


add the other { @ link runfiles } object transitively

private builder merge ( runfiles runfiles , boolean include artifacts ) { / / propagate the most strict conflict checking from merged - in runfiles if ( runfiles conflict policy compare to ( conflict policy ) > 0 ) { conflict policy = runfiles conflict policy ; } if ( runfiles is empty ( ) ) { return this ; } / / the suffix should be the same within any blaze build , except for the empty runfiles , which / / may have an empty suffix , but that is covered above preconditions check argument ( suffix equals ( runfiles suffix ) , " % s ! = % s " , suffix , runfiles suffix ) ; if ( include artifacts ) { artifacts builder add transitive ( runfiles get artifacts ( ) ) ; } symlinks builder add transitive ( runfiles get symlinks ( ) ) ; root symlinks builder add transitive ( runfiles get root symlinks ( ) ) ; extra middlemen builder add transitive ( runfiles get extra middlemen ( ) ) ; if ( empty files supplier = = dummy empty files supplier ) { empty files supplier = runfiles get empty files provider ( ) ; } else { empty files supplier other supplier = runfiles get empty files provider ( ) ; preconditions check state ( ( other supplier = = dummy empty files supplier ) | | empty files supplier equals ( other supplier ) ) ; } return this ; }


removes a progress listener from this queue all the progress and messages reported by a q worker will be routed to this listener

public synchronized void remove progress listener ( q progress listener < i > listener ) { if ( progress listener = = listener ) { progress listener = null ; } else if ( progress listener instanceof chained progress listener ) { progress listener = ( ( chained progress listener < i > ) progress listener ) remove listener ( listener ) ; } }


indexing operations which entail mapping changes require a blocking request to the master node to update the mapping if the master node is being disrupted or if it cannot commit cluster state changes , it needs to retry within timeout limits this retry logic is implemented in transport master node action and tested by the following master failover scenario

public void test master failover during indexing with mapping changes ( ) throws throwable { logger info ( " - - > start 4 nodes , 3 master , 1 data " ) ; internal cluster ( ) set bootstrap master node index ( 2 ) ; internal cluster ( ) start master only nodes ( 3 , settings empty ) ; string data node = internal cluster ( ) start data only node ( settings empty ) ; logger info ( " - - > wait for all nodes to join the cluster " ) ; ensure stable cluster ( 4 ) ; / / we index data with mapping changes into cluster and have master failover at same time client ( ) admin ( ) indices ( ) prepare create ( " myindex " ) set settings ( settings builder ( ) put ( " index number of shards " , 1 ) put ( " index number of replicas " , 0 ) ) get ( ) ; ensure green ( " myindex " ) ; final cyclic barrier barrier = new cyclic barrier ( 2 ) ; thread indexing thread = new thread ( new runnable ( ) { @ override public void run ( ) { try { barrier await ( ) ; } catch ( interrupted exception e ) { logger warn ( " barrier interrupted " , e ) ; return ; } catch ( broken barrier exception e ) { logger warn ( " broken barrier " , e ) ; return ; } for ( int i = 0 ; i < 10 ; i + + ) { / / index data with mapping changes index response response = client ( data node ) prepare index ( " myindex " ) set source ( " field " + i , " val " ) get ( ) ; assert equals ( doc write response result created , response get result ( ) ) ; } } } ) ; indexing thread set name ( " indexing thread " ) ; indexing thread start ( ) ; barrier await ( ) ; / / interrupt communication between master and other nodes in cluster network disruption partition = isolate master disruption ( network disruption disconnect ) ; internal cluster ( ) set disruption scheme ( partition ) ; logger info ( " - - > disrupting network " ) ; partition start disrupting ( ) ; logger info ( " - - > waiting for new master to be elected " ) ; ensure stable cluster ( 3 , data node ) ; partition stop disrupting ( ) ; logger info ( " - - > waiting to heal " ) ; ensure stable cluster ( 4 ) ; indexing thread join ( ) ; ensure green ( " myindex " ) ; refresh ( ) ; assert that ( client ( ) prepare search ( " myindex " ) get ( ) get hits ( ) get total hits ( ) value , equal to ( 10l ) ) ; }


public string get description ( ) { return description ; }


return true if this danish pig 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 ; } danish pig danish pig = ( danish pig ) o ; return objects equals ( this class name , danish pig class name ) ; }


the hit field matching the given field name

public document field field ( string field name ) { document field result = document fields get ( field name ) ; if ( result ! = null ) { return result ; } else { return meta fields get ( field name ) ; } }


public static < e > array deque < e > new array deque ( ) { return new array deque < e > ( ) ; }


called in doc id order for each hit in a leaf reader

void process ( hit context hit context ) throws i o exception ;


public long next ( ) { if ( has next ( ) ) { does have next = false ; does have previous = true ; return current ; } throw new no such element exception ( " no more indexes " ) ; }


returns whether or not a deprecated name has been warned if the name is not deprecated then always return false

public static boolean has warned deprecation ( string name ) { deprecation context deprecations = deprecation context get ( ) ; if ( deprecations get deprecated key map ( ) contains key ( name ) ) { if ( deprecations get deprecated key map ( ) get ( name ) accessed get ( ) ) { return true ; } } return false ; }


{ @ inherit doc } this method returns a serializable { @ code immutable sorted set } the { @ link sorted set # sub set } documentation states that a subset of a subset throws an { @ link illegal argument exception } if passed a { @ code from element } smaller than an earlier { @ code from element } however , this method doesn ' t throw an exception in that situation , but instead keeps the original { @ code from element } similarly , this method keeps the original { @ code to element } , instead of throwing an exception , if passed a { @ code to element } greater than an earlier { @ code to element }

public immutable sorted set < e > sub set ( e from element , e to element ) { return sub set ( from element , true , to element , false ) ; }


set the handler exception resolver types to use this is delegated to { @ link standalone mock mvc builder # set handler exception resolvers ( handler exception resolver ) }

controller spec handler exception resolvers ( handler exception resolver exception resolvers ) ;


we induce a failure in the last mapper in batch execution mode the part of the pipeline before the rebalance should not be re - executed only the part after that will restart we check that by suffixing the attempt number to records and asserting the correct number

public void batch failover with rebalance barrier ( ) throws exception { final stream execution environment env = get execution environment ( ) ; data stream source < string > source = env from elements ( " foo " , " bar " ) ; single output stream operator < string > mapped = source map ( new suffix attempt id ( " a " ) ) map ( new suffix attempt id ( " b " ) ) rebalance ( ) map ( new suffix attempt id ( " c " ) ) map ( new once failing mapper ( " d " ) ) ; try ( closeable iterator < string > result = mapped execute and collect ( ) ) { / / only the operators after the rebalance " barrier " are restarted and will have the / / " attempt 1 " suffix assert that ( iterator to list ( result ) , contains in any order ( " foo - a 0 - b 0 - c 1 - d 1 " , " bar - a 0 - b 0 - c 1 - d 1 " ) ) ; } }


convert a j s o n object into a well - formed , element - normal xml string

public static string to string ( object o , string tag name ) throws j s o n exception { string builder b = new string builder ( ) ; int i ; j s o n array ja ; j s o n object jo ; string k ; iterator keys ; int len ; string s ; object v ; if ( o instanceof j s o n object ) { / / emit < tag name > if ( tag name ! = null ) { b append ( ' < ' ) ; b append ( tag name ) ; b append ( ' > ' ) ; } / / loop thru the keys jo = ( j s o n object ) o ; keys = jo keys ( ) ; while ( keys has next ( ) ) { k = keys next ( ) to string ( ) ; v = jo opt ( k ) ; if ( v = = null ) { v = " " ; } if ( v instanceof string ) { s = ( string ) v ; } else { s = null ; } / / emit content in body if ( k equals ( " content " ) ) { if ( v instanceof j s o n array ) { ja = ( j s o n array ) v ; len = ja length ( ) ; for ( i = 0 ; i < len ; i + = 1 ) { if ( i > 0 ) { b append ( ' \ n ' ) ; } b append ( escape ( ja get ( i ) to string ( ) ) ) ; } } else { b append ( escape ( v to string ( ) ) ) ; } / / emit an array of similar keys } else if ( v instanceof j s o n array ) { ja = ( j s o n array ) v ; len = ja length ( ) ; for ( i = 0 ; i < len ; i + = 1 ) { v = ja get ( i ) ; if ( v instanceof j s o n array ) { b append ( ' < ' ) ; b append ( k ) ; b append ( ' > ' ) ; b append ( to string ( v ) ) ; b append ( " < / " ) ; b append ( k ) ; b append ( ' > ' ) ; } else { b append ( to string ( v , k ) ) ; } } } else if ( v equals ( " " ) ) { b append ( ' < ' ) ; b append ( k ) ; b append ( " / > " ) ; / / emit a new tag < k > } else { b append ( to string ( v , k ) ) ; } } if ( tag name ! = null ) { / / emit the < / tagname > close tag b append ( " < / " ) ; b append ( tag name ) ; b append ( ' > ' ) ; } return b to string ( ) ; / / xml does not have good support for arrays if an array appears in / / a place / / where xml is lacking , synthesize an < array > element } else if ( o instanceof j s o n array ) { ja = ( j s o n array ) o ; len = ja length ( ) ; for ( i = 0 ; i < len ; + + i ) { v = ja opt ( i ) ; b append ( to string ( v , ( tag name = = null ) ? " array " : tag name ) ) ; } return b to string ( ) ; } else { s = ( o = = null ) ? " null " : escape ( o to string ( ) ) ; return ( tag name = = null ) ? " \ " " + s + " \ " " : ( s length ( ) = = 0 ) ? " < " + tag name + " / > " : " < " + tag name + " > " + s + " < / " + tag name + " > " ; } }


{ @ inherit doc } all elements in the returned list must be { @ link listenable future } instances the easiest way to obtain a { @ code list < listenable future < t > > } from this method is an unchecked ( but safe ) cast : { @ code @ suppress warnings ( " unchecked " ) guaranteed by invoke all contract } { @ code list < listenable future < t > > futures = ( list ) executor invoke all ( tasks ) ; }

< t > list < future < t > > invoke all ( collection < ? extends callable < t > > tasks ) throws interrupted exception ;


returns the size of the preferred size of the inner table

private point get table size ( ) { int x = 0 ; int y = 0 ; if ( column headers visible ) { y + = header height ; } y + = get grid height ( ) ; if ( row header visible ) { x + = row header width ; } for ( grid column column : columns ) { x + = column get width ( ) ; } return new point ( x , y ) ; }


split a freeform string into a host and port , without strict validation note that the host - only formats will leave the port field undefined you can use { @ link # with default port ( int ) } to patch in a default value

public static host and port from string ( string host port string ) { check not null ( host port string ) ; string host ; string port string = null ; boolean has bracketless colons = false ; if ( host port string starts with ( " [ " ) ) { string [ ] host and port = get host and port from bracketed host ( host port string ) ; host = host and port [ 0 ] ; port string = host and port [ 1 ] ; } else { int colon pos = host port string index of ( ' : ' ) ; if ( colon pos > = 0 & & host port string index of ( ' : ' , colon pos + 1 ) = = - 1 ) { / / exactly 1 colon split into host : port host = host port string substring ( 0 , colon pos ) ; port string = host port string substring ( colon pos + 1 ) ; } else { / / 0 or 2 + colons bare hostname or i pv 6 literal host = host port string ; has bracketless colons = ( colon pos > = 0 ) ; } } int port = no port ; if ( ! strings is null or empty ( port string ) ) { / / try to parse the whole port string as a number / / jdk7 accepts leading plus signs we don ' t want to check argument ( ! port string starts with ( " + " ) , " unparseable port number : % s " , host port string ) ; try { port = integer parse int ( port string ) ; } catch ( number format exception e ) { throw new illegal argument exception ( " unparseable port number : " + host port string ) ; } check argument ( is valid port ( port ) , " port number out of range : % s " , host port string ) ; } return new host and port ( host , port , has bracketless colons ) ; }


public void close ( ) { close ( close mode graceful ) ; }


sorts a list of node level decisions by the decision type , then by weight ranking , and finally by node id

public list < node allocation result > sort node decisions ( list < node allocation result > node decisions ) { return collections unmodifiable list ( node decisions stream ( ) sorted ( ) collect ( collectors to list ( ) ) ) ; }


public void update pet ( pet body , handler < async result < void > > result handler ) { update pet ( body , null , result handler ) ; }


get the value of the < code > name < code > property as a trimmed < code > string < code > , < code > default value < code > if no such property exists see @ { configuration # get trimmed } for more details

public string get trimmed ( string name , string default value ) { string ret = get trimmed ( name ) ; return ret = = null ? default value : ret ; }


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


creates a new test { @ link keyed state handle } for the given key - group

public static keyed state handle create new keyed state handle ( key group range key group range ) { return new dummy keyed state handle ( key group range ) ; }


not supported use { @ link immutable sorted set # to immutable sorted set } instead this method exists only to hide { @ link immutable set # to immutable set } from consumers of { @ code immutable sorted set }

public static < e > collector < e , ? , immutable set < e > > to immutable set ( ) { throw new unsupported operation exception ( ) ; }


return the { @ link connection factory } that this client uses

connection factory get connection factory ( ) ;


public string get small snake ( ) { return small snake ; }


protected void on console disconnect ( int session id ) { system out println ( " on console disconnect : " + session id ) ; }


releases all resources and makes this object unusable

public void dispose ( ) { iterator < menu manager > it = menu managers values ( ) iterator ( ) ; while ( it has next ( ) ) { menu manager mgr = it next ( ) ; mgr dispose ( ) ; } menu managers clear ( ) ; }


returns the maximum value a scalar can have for the current program this is used to bound the minmax filters

private int get max scalar value ( ) { / / todo this code is odd - - why calculate the pointer size just to truncate at / / integer min / max value ? this code should default to no value in the field , letting / / the user input min and max values themselves then , just use those values / / directly int default pointer size = program get default pointer size ( ) ; int max = ( int ) math pow ( 2 , ( default pointer size * 8 ) ) ; return filter type = = filter type max ? max : - max ; }


6 : bral 12 - - + ( start w nfctx = 2 @ 12 ) | + - > 10 : nfctx # 3 | | 12 : cop 3 < - - + ( conflict due to varying context ) + - - 14 : bral 10 test use of non - flow context in disassembly with expected parse error

public void test disassembler inconsistent mid block ( ) throws exception { program get program context ( ) set value ( program get register ( " nfctx " ) , addr ( 12 ) , addr ( 12 ) , big integer value of ( 2 ) ) ; program builder add bytes branch ( 6 , 12 ) ; program builder add bytes fallthrough set no flow context ( 10 , 3 ) ; program builder add bytes cop instruction ( 12 ) ; program builder add bytes branch ( 14 , 10 ) ; address set view dis addrs = disassembler disassemble ( addr ( 6 ) , null ) ; assert equals ( addrset ( range ( 6 , 7 ) , range ( 10 , 15 ) ) , dis addrs ) ; verify instruction presence ( ) ; verify error bookmark ( addr ( 12 ) , " inconsistent instruction prototype " ) ; }


get the current sub - process executing the given command

public process get process ( ) { return process ; }


gets the maximum useful alignment for the target machine

public int get machine alignment ( ) { return machine alignment ; }


set the exact list of strategies to use note : use of this method is mutually exclusive with use of all other setters in this class which customize a default , fixed set of strategies see class level doc for more details

public void strategies ( @ nullable list < content negotiation strategy > strategies ) { this factory set strategies ( strategies ) ; }


create a tree using a custom comparator to order the values

public static < k , v > tree value sorted map < k , v > create with comparator ( comparator < v > comparator ) { return new tree value sorted map < > ( comparator ) ; }


remove the specified user from the server access list

public synchronized void remove user ( string username ) throws i o exception { update user list ( true ) ; user entry old entry = user list remove ( username ) ; if ( old entry ! = null ) { if ( old entry x 5 0 0 user ! = null ) { dn lookup map remove ( old entry x 5 0 0 user ) ; } write user list ( ) ; } }


compare two { @ link match status } items , returning the most specific status

public static match status get most specific ( match status a , match status b ) { return ( a ordinal ( ) < b ordinal ( ) ? a : b ) ; }


if < code > f < code > is a file , this method will make a single call to cos if < code > f < code > is a directory , this method will make a maximum of ( n 199 ) + 2 calls to cos , where n is the total number of files and directories contained directly in < code > f < code >

public file status [ ] list status ( path f ) throws i o exception { path absolute path = make absolute ( f ) ; string key = path to key ( absolute path ) ; if ( key length ( ) > 0 ) { file status file status = this get file status ( f ) ; if ( file status is file ( ) ) { return new file status [ ] { file status } ; } } if ( ! key ends with ( path delimiter ) ) { key + = path delimiter ; } uri path uri = absolute path to uri ( ) ; set < file status > status = new tree set < > ( ) ; string prior last key = null ; do { partial listing listing = store list ( key , constants cos max listing length , prior last key , false ) ; for ( file metadata file metadata : listing get files ( ) ) { path sub path = key to path ( file metadata get key ( ) ) ; if ( file metadata get key ( ) equals ( key ) ) { / / this is just the directory we have been asked to list log debug ( " the file list contains the cos key [ { } ] to be listed " , key ) ; } else { status add ( new file ( file metadata , sub path ) ) ; } } for ( file metadata common prefix : listing get common prefixes ( ) ) { path sub path = key to path ( common prefix get key ( ) ) ; string relative path = path uri relativize ( sub path to uri ( ) ) get path ( ) ; status add ( new directory ( common prefix , new path ( absolute path , relative path ) ) ) ; } prior last key = listing get prior last key ( ) ; } while ( prior last key ! = null ) ; return status to array ( new file status [ status size ( ) ] ) ; }


deletes this file or empty directory and returns success will not delete a directory that has children @ throw gdx runtime exception if this file handle is a { @ link file type # classpath } or { @ link file type # internal } file

public boolean delete ( ) { if ( type = = file type classpath ) throw new gdx runtime exception ( " cannot delete a classpath file : " + file ) ; if ( type = = file type internal ) throw new gdx runtime exception ( " cannot delete an internal file : " + file ) ; return file ( ) delete ( ) ; }


mock http servlet request get request ( ) ;