corners bug spr - 9273 , which reported the fact that following the changes made in spr - 7591 , { @ link http status code exception } and subtypes became no longer serializable due to the addition of a non - serializable { @ code charset } field

public void test serializability ( ) throws i o exception , class not found exception { http status code exception ex 1 = new http client error exception ( http status bad request , null , null , standard charsets us ascii ) ; byte array output stream out = new byte array output stream ( ) ; new object output stream ( out ) write object ( ex 1 ) ; byte array input stream in = new byte array input stream ( out to byte array ( ) ) ; http status code exception ex 2 = ( http status code exception ) new object input stream ( in ) read object ( ) ; assert that ( ex 2 get response body as string ( ) ) is equal to ( ex 1 get response body as string ( ) ) ; }


collection of data for the build tool logs event this may only be modified until the build complete event is posted ; any changes after that event is handled will not be included in the build tool logs event

public build tool log collection get build tool log collection ( ) { return build tool log collection ; }


copies the content of a jar zip archive into the receiver archive < p > an optional { @ link i zip entry filter } allows to selectively choose which files to copy over

public void write zip ( input stream input , i zip entry filter filter ) throws i o exception , i zip entry filter zip abort exception { zip input stream zis = new zip input stream ( input ) ; try { / / loop on the entries of the intermediary package and put them in the final package zip entry entry ; while ( ( entry = zis get next entry ( ) ) ! = null ) { string name = entry get name ( ) ; / / do not take directories or anything inside a potential meta - inf folder if ( entry is directory ( ) | | name starts with ( " meta - inf / " ) ) { continue ; } / / if we have a filter , we check the entry against it if ( filter ! = null & & filter check entry ( name ) = = false ) { continue ; } jar entry new entry ; / / preserve the stored method of the input entry if ( entry get method ( ) = = jar entry stored ) { new entry = new jar entry ( entry ) ; } else { / / create a new entry so that the compressed len is recomputed new entry = new jar entry ( name ) ; } write entry ( zis , new entry ) ; zis close entry ( ) ; } } finally { zis close ( ) ; } }


update the database with the specified bookmark record

void update record ( d b record rec ) throws i o exception { throw new unsupported operation exception ( " bookmarks are read - only and may not be modified " ) ; }


return whether return type is { @ code java util optional }

public boolean returns optional ( ) { return returns optional ; }


reads two code units , treating them as a little - endian { @ code int }

public int read int ( ) throws e o f exception ;


the specified service is subscribe or not

public boolean is subscribed service ( string service name ) { return do get subscribed services ( ) contains ( service name ) ; }


convert the given request object to serialized form , possibly using a { @ link org springframework messaging converter message converter } , wrap it as a message with the given headers , apply the given post processor and send the resulting { @ link message } to the specified destination , receive the reply and convert its body of the given target class

< t > t convert send and receive ( string destination name , object request , map < string , object > headers , class < t > target class , message post processor request post processor ) throws messaging exception ;


the reason for resetting the stream represented as an http2 error code


public sub cluster id get home subcluster ( application submission context app submission context , list < sub cluster id > black list sub clusters ) throws yarn exception { / / run standard validation , as error might differ validate ( app submission context ) ; throw new federation policy exception ( " the policy configured for this queue " + " ( " + app submission context get queue ( ) + " ) reject all routing " + " requests by construction application " + app submission context get application id ( ) + " cannot be routed to any rm " ) ; }


sets the bundle locale this method is private because a bundle can ' t change the locale during its life

private void set locale ( locale locale ) { this locale = locale ; this formatter = new text formatter ( locale , ! simple formatter ) ; }


public attribute statement new attribute statement ( final map < string , object > attributes , final saml 2 0 attribute builder builder , final saml registered service saml registered service ) { val attr statement = saml utils new saml object ( attribute statement class ) ; val resp = saml id p properties get response ( ) ; val name formats = new hash map < > ( resp configure attribute name formats ( ) ) ; name formats put all ( saml registered service get attribute name formats ( ) ) ; val global friendly names = saml id p properties get attribute friendly names ( ) ; val friendly names = new hash map < > ( collection utils convert directed list to map ( global friendly names ) ) ; attribute definition store get attribute definitions ( ) stream ( ) filter ( defn - > defn instanceof saml id p attribute definition ) map ( saml id p attribute definition class : : cast ) filter ( defn - > string utils is not blank ( defn get friendly name ( ) ) ) for each ( defn - > friendly names put ( defn get key ( ) , defn get friendly name ( ) ) ) ; friendly names put all ( saml registered service get attribute friendly names ( ) ) ; for ( val e : attributes entry set ( ) ) { if ( e get value ( ) instanceof collection < ? > & & ( ( collection < ? > ) e get value ( ) ) is empty ( ) ) { logger info ( " skipping attribute [ { } ] because it does not have any values " , e get key ( ) ) ; continue ; } val friendly name = friendly names get or default ( e get key ( ) , null ) ; val name = attribute definition store locate attribute definition ( e get key ( ) ) map ( attribute definition : : get name ) filter ( string utils : : is not blank ) or else get ( e : : get key ) ; logger trace ( " creating saml attribute [ { } ] with value [ { } ] , friendly name [ { } ] " , name , e get value ( ) , friendly name ) ; val attribute = new attribute ( friendly name , name , e get value ( ) , name formats , resp get default attribute name format ( ) , saml registered service get attribute value types ( ) ) ; logger trace ( " created saml attribute [ { } ] with nameid - format [ { } ] " , attribute get name ( ) , attribute get name format ( ) ) ; builder build ( attr statement , attribute ) ; } return attr statement ; }


creates a allocated persistent task for communicating with task manager

protected allocated persistent task create task ( long id , string type , string action , task id parent task id , persistent task < params > task in progress , map < string , string > headers ) { return new allocated persistent task ( id , type , action , get description ( task in progress ) , parent task id , headers ) ; }


gather all the semantics that can be used as state transitions currently , only semantics from { @ code : ^ instruction } constructors are taken

protected void gather semantics ( ) { assembly production rec = grammar get pure recursion ( grammar get non terminal ( grammar get start name ( ) ) ) ; if ( rec = = null ) { return ; } for ( assembly constructor semantic sem : grammar get semantics ( rec ) ) { semantics get ( grammar get start name ( ) ) add ( sem ) ; } }


return the expected name of the matrix variable

public final string get variable name ( ) { return this variable name ; }


test a semaphore command execution timeout where the command implemented get fallback

public void test semaphore isolated execution timeout with successful fallback ( ) { test execution timeout with successful fallback ( execution isolation strategy semaphore ) ; }


returns the { @ link iterator } that enumerates all { @ link channel future } s which are associated with this future please note that the returned { @ link iterator } is is unmodifiable , which means a { @ link channel future } cannot be removed from this future

iterator < channel future > iterator ( ) ;


decodes a string from base 6 4 format no blanks or line breaks are allowed within the base 6 4 encoded input data

public static string decode string ( string s ) { return decode string ( s , false ) ; }


model tests for additional properties number

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


whether to jar sign the apk with the apksigner tool

public boolean sign v 1 ( ) { return sign v 1 ; }


get the resource owner for this { @ link http resource }

public string get resource owner name ( ) { return resource owner name ; }


public void test indexed ( ) throws exception { directory dir = new directory ( ) ; index writer config iwc = new index writer config ( null ) ; index writer iw = new index writer ( dir , iwc ) ; / / add document with 2 fields document doc = new document ( ) ; doc add ( new string field ( " field a " , " test " , field store no ) ) ; doc add ( new string field ( " field b " , " test " , field store no ) ) ; iw add document ( doc ) ; / / open reader directory reader ir = field subset reader wrap ( directory reader open ( iw ) , new character run automaton ( automata make string ( " field a " ) ) ) ; / / see only one field leaf reader segment reader = ir leaves ( ) get ( 0 ) reader ( ) ; set < string > seen fields = new hash set < > ( ) ; for ( field info info : segment reader get field infos ( ) ) { seen fields add ( info name ) ; } assert equals ( collections singleton ( " field a " ) , seen fields ) ; assert not null ( segment reader terms ( " field a " ) ) ; assert null ( segment reader terms ( " field b " ) ) ; test util check reader ( ir ) ; i o utils close ( ir , iw , dir ) ; }


true if the connector only supports write statements in independent transactions

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


adds the provided { @ link handler interceptor }

public interceptor registration add interceptor ( handler interceptor interceptor ) { interceptor registration registration = new interceptor registration ( interceptor ) ; this registrations add ( registration ) ; return registration ; }


public synchronized long get samples ( ) { return samples ; }


uses an { @ link array list } to store value collections

public list multimap builder < k0 , object > array list values ( ) { return array list values ( default expected values per key ) ; }


strict locality requests shouldn ' t reserve resources on another node

public void test reservations strict locality ( ) throws i o exception { scheduler init ( conf ) ; scheduler start ( ) ; scheduler reinitialize ( conf , resource manager get r m context ( ) ) ; / / add two nodes r m node node 1 = mock nodes new node info ( 1 , resources create resource ( 1024 , 1 ) ) ; node added scheduler event node event 1 = new node added scheduler event ( node 1 ) ; scheduler handle ( node event 1 ) ; r m node node 2 = mock nodes new node info ( 1 , resources create resource ( 1024 , 1 ) ) ; node added scheduler event node event 2 = new node added scheduler event ( node 2 ) ; scheduler handle ( node event 2 ) ; / / submit application without container requests application attempt id att id = create scheduling request ( 1024 , " queue 1 " , " user 1 " , 0 ) ; f s app attempt app = scheduler get scheduler app ( att id ) ; / / request a container on node 2 resource request node request = create resource request ( 1024 , node 2 get host name ( ) , 1 , 1 , true ) ; resource request rack request = create resource request ( 1024 , " rack 1 " , 1 , 1 , false ) ; resource request any request = create resource request ( 1024 , resource request any , 1 , 1 , false ) ; create scheduling request existing application ( node request , att id ) ; create scheduling request existing application ( rack request , att id ) ; create scheduling request existing application ( any request , att id ) ; scheduler update ( ) ; / / heartbeat from node 1 app shouldn ' t get an allocation or reservation node update scheduler event node update event = new node update scheduler event ( node 1 ) ; scheduler handle ( node update event ) ; assert equals ( " app assigned a container on the wrong node " , 0 , app get live containers ( ) size ( ) ) ; scheduler handle ( node update event ) ; assert equals ( " app reserved a container on the wrong node " , 0 , app get reserved containers ( ) size ( ) ) ; }


removes a pending slot request identified by the given allocation id from a slot identified by the given slot id

private void remove slot request from slot ( slot i d slot id , allocation i d allocation id ) { task manager slot task manager slot = slots get ( slot id ) ; if ( null ! = task manager slot ) { if ( task manager slot get state ( ) = = slot state pending & & objects equals ( allocation id , task manager slot get assigned slot request ( ) get allocation id ( ) ) ) { task manager registration task manager registration = task manager registrations get ( task manager slot get instance id ( ) ) ; if ( task manager registration = = null ) { throw new illegal state exception ( " trying to remove slot request from slot for which there is no task manager " + task manager slot get instance id ( ) + " is registered " ) ; } / / clear the pending slot request task manager slot clear pending slot request ( ) ; update slot state ( task manager slot , task manager registration , null , null ) ; } else { log debug ( " ignore slot request removal for slot { } " , slot id ) ; } } else { log debug ( " there was no slot with { } registered probably this slot has been already freed " , slot id ) ; } }


join records of this { @ code k table } with another { @ code k table } ' s records using non - windowed inner equi join , with default serializers , deserializers , and state store the join is a primary key join with join attribute { @ code this k table key = = other k table key } the result is an ever updating { @ code k table } that represents the current ( i e , processing time ) result of the join the join is computed by ( 1 ) updating the internal state of one { @ code k table } and ( 2 ) performing a lookup for a matching record in the current ( i e , processing time ) internal state of the other { @ code k table } this happens in a symmetric way , i e , for each update of either { @ code this } or the { @ code other } input { @ code k table } the result gets updated for each { @ code k table } record that finds a corresponding record in the other { @ code k table } the provided { @ link value joiner } will be called to compute a value ( with arbitrary type ) for the result record the key of the result record is the same as for both joining input records note that { @ link key value records } with { @ code null } values ( so - called tombstone records ) have delete semantics thus , for input tombstones the provided value - joiner is not called but a tombstone record is forwarded directly to delete a record in the result { @ code k table } if required ( i e , if there is anything to be deleted ) input records with { @ code null } key will be dropped and no join computation is performed example : < table border = ' 1 ' > < tr > < th > this k table < th > < th > this state < th > < th > other k table < th > < th > other state < th > < th > result updated record < th > < tr > < tr > < td > & lt ; k1 : a & gt ; < td > < td > & lt ; k1 : a & gt ; < td > < td > < td > < td > < td > < td > < td > < tr > < tr > < td > < td > < td > & lt ; k1 : a & gt ; < td > < td > & lt ; k1 : b & gt ; < td > < td > & lt ; k1 : b & gt ; < td > < td > & lt ; k1 : value joiner ( a , b ) & gt ; < td > < tr > < tr > < td > & lt ; k1 : c & gt ; < td > < td > & lt ; k1 : c & gt ; < td > < td > < td > < td > & lt ; k1 : b & gt ; < td > < td > & lt ; k1 : value joiner ( c , b ) & gt ; < td > < tr > < tr > < td > < td > < td > & lt ; k1 : c & gt ; < td > < td > & lt ; k1 : null & gt ; < td > < td > < td > < td > & lt ; k1 : null & gt ; < td > < tr > < table > both input streams ( or to be more precise , their underlying source topics ) need to have the same number of partitions

< vo , vr > k table < k , vr > join ( final k table < k , vo > other , final value joiner < ? super v , ? super vo , ? extends vr > joiner , final named named ) ;


create a shared connection for this container the default implementation creates a standard connection and prepares it through { @ link # prepare shared connection }

protected connection create shared connection ( ) throws j m s exception { connection con = create connection ( ) ; try { prepare shared connection ( con ) ; return con ; } catch ( j m s exception ex ) { jms utils close connection ( con ) ; throw ex ; } }


public generic drawee hierarchy builder set pressed state overlay ( @ nullable drawable drawable ) { if ( drawable = = null ) { m pressed state overlay = null ; } else { state list drawable state list drawable = new state list drawable ( ) ; state list drawable add state ( new int [ ] { android r attr state pressed } , drawable ) ; m pressed state overlay = state list drawable ; } return this ; }


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

public static fields find by thrift id ( int field id ) { switch ( field id ) { case 1 : / / fields return fields ; case 2 : / / shuffle return shuffle ; case 3 : / / all return all ; case 4 : / / none return none ; case 5 : / / direct return direct ; case 6 : / / custom object return custom object ; case 7 : / / custom serialized return custom serialized ; case 8 : / / local or shuffle return local or shuffle ; default : return null ; } }


opens the the program by the given name the path can be a simple name or a relative or absolute path to the file within the project

public program open program ( string file path ) throws exception { domain file df = get domain file ( file path ) ; if ( df = = null ) { throw new illegal argument exception ( " domain file not in project you must first call add domain file ( name ) " ) ; } program p = open program ( df ) ; return p ; }


checks whether or not the application is in " single jar " mode

public static boolean in single jar mode ( ) { check app initialized ( ) ; return app layout in single jar mode ( ) ; }


returns the original element list , unchanged

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


set the { @ link org apache tiles preparer factory preparer factory } implementation to use default is { @ link org apache tiles preparer factory basic preparer factory } , creating shared instances for specified preparer classes specify { @ link simple spring preparer factory } to autowire { @ link org apache tiles preparer view preparer } instances based on specified preparer classes , applying spring ' s container callbacks as well as applying configured spring bean post processors if spring ' s context - wide annotation - config has been activated , annotations in view preparer classes will be automatically detected and applied specify { @ link spring bean preparer factory } to operate on specified preparer names instead of classes , obtaining the corresponding spring bean from the dispatcher servlet ' s application context the full bean creation process will be in the control of the spring application context in this case , allowing for the use of scoped beans etc note that you need to define one spring bean definition per preparer name ( as used in your tiles definitions )

public void set preparer factory class ( class < ? extends preparer factory > preparer factory class ) { this preparer factory class = preparer factory class ; }


append an input count to the progress message , e g " 2 source jars " if an input count has already been appended , prefix with " , "

private static boolean append count ( string builder sb , boolean first , int count , string name ) { if ( count > 0 ) { if ( ! first ) { sb append ( " , " ) ; } else { first = false ; } sb append ( count ) append ( ' ' ) append ( name ) ; if ( count > 1 ) { sb append ( ' s ' ) ; } } return first ; }


public void att n a m e test ( ) { / / todo : test att name }


protected int make press color ( ) { return color parse color ( " # 88dddddd " ) ; }


dispatches { @ link # on load completed ( int , media period id , load event info , media load data ) }

public void load completed ( load event info load event info , int data type , int track type , @ nullable format track format , int track selection reason , @ nullable object track selection data , long media start time us , long media end time us ) { load completed ( load event info , new media load data ( data type , track type , track format , track selection reason , track selection data , adjust media time ( media start time us ) , adjust media time ( media end time us ) ) ) ; }


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


if { @ code code point from } and { @ code code point to } are both < = u + ffff , returns a new { @ link range transition } otherwise , returns a new { @ link set transition }

public static transition create with code point range ( a t n state target , int code point from , int code point to ) { if ( character is supplementary code point ( code point from ) | | character is supplementary code point ( code point to ) ) { return new set transition ( target , interval set of ( code point from , code point to ) ) ; } else { return new range transition ( target , code point from , code point to ) ; } }


sets the given producer value for the specified variable , without disturbing it

public void set producer value ( int index , value value ) { producer variables store ( index , value ) ; }


public user group information get owner ( ) { return owner ; }


true iff the build request has been successfully completed

public boolean get success ( ) { return detailed exit code ! = null & & detailed exit code is success ( ) ; }


write a portion of an array , flushing to the underlying stream at most once if necessary

private int write 1 ( byte b [ ] , int off , int len ) throws i o exception { if ( count = = 0 & & len > = buf length ) { / / local buffer is empty and user buffer size > = local buffer size , so / / simply checksum the user buffer and send it directly to the underlying / / stream final int length = buf length ; write checksum chunks ( b , off , length ) ; return length ; } / / copy user data to local buffer int bytes to copy = buf length - count ; bytes to copy = ( len < bytes to copy ) ? len : bytes to copy ; system arraycopy ( b , off , buf , count , bytes to copy ) ; count + = bytes to copy ; if ( count = = buf length ) { / / local buffer is full flush buffer ( ) ; } return bytes to copy ; }


set the { @ code mono < principal > } to return for this exchange

builder principal ( mono < principal > principal mono ) ;


creates an empty { @ code linked blocking deque } with the given ( fixed ) capacity

public static < e > linked blocking deque < e > new linked blocking deque ( int capacity ) { return new linked blocking deque < e > ( capacity ) ; }


if the field name is conflicted with s q lite keywords return true if conflicted , return false otherwise

public static boolean is field name conflict with s q lite keywords ( string field name ) { if ( ! text utils is empty ( field name ) ) { string field name with comma = " , " + field name to lower case ( locale us ) + " , " ; return sqlite keywords contains ( field name with comma ) ; } return false ; }


public static void finish all activities ( @ anim res final int enter anim , @ anim res final int exit anim ) { list < activity > activity list = utils bridge get activity list ( ) ; for ( activity act : activity list ) { / / s activity list remove the index activity at on activity destroyed act finish ( ) ; act override pending transition ( enter anim , exit anim ) ; } }


specify whether to enforce the read - only nature of a transaction ( as indicated by { @ link transaction definition # is read only ( ) } through an explicit statement on the transactional connection : " set transaction read only " as understood by oracle , my s q l and postgres the exact treatment , including any sql statement executed on the connection , can be customized through { @ link # prepare transactional connection } this mode of read - only handling goes beyond the { @ link connection # set read only } hint that spring applies by default in contrast to that standard jdbc hint , " set transaction read only " enforces an isolation - level - like connection mode where data manipulation statements are strictly disallowed also , on oracle , this read - only mode provides read consistency for the entire transaction note that older oracle jdbc drivers ( 9i , 1 0g ) used to enforce this read - only mode even for { @ code connection set read only ( true } however , with recent drivers , this strong enforcement needs to be applied explicitly , e g through this flag

public void set enforce read only ( boolean enforce read only ) { this enforce read only = enforce read only ; }


sets the streaming context environment to a test stream environment that runs its programs on the given cluster with the given default parallelism and the specified jar files and class paths

public static void set as context ( final mini cluster mini cluster , final int parallelism , final collection < path > jar files , final collection < url > classpaths ) { stream execution environment factory factory = conf - > { test stream environment env = new test stream environment ( mini cluster , parallelism , jar files , classpaths ) ; env configure ( conf , env get user classloader ( ) ) ; return env ; } ; initialize context environment ( factory ) ; }


public void send ( message msg , message queue selector selector , object arg , send callback send callback ) throws m q client exception , remoting exception , interrupted exception { send ( msg , selector , arg , send callback , this default m q producer get send msg timeout ( ) ) ; }


delete any left over machine learning datafeeds and jobs

private void clear ml state ( ) throws exception { if ( is machine learning test ( ) ) { new ml rest test state cleaner ( logger , admin client ( ) ) clear ml metadata ( ) ; } }


returns all built - in float data - types

public static abstract float data type [ ] get float data types ( data type manager dtm ) { tree map < integer , abstract float data type > float map = get float types ( ) ; tree map < integer , abstract float data type > new float map = float map ; if ( dtm ! = null ) { data organization data organization = dtm get data organization ( ) ; if ( data organization ! = null ) { new float map = new tree map < integer , abstract float data type > ( ) ; new float map put ( data organization get float size ( ) , ( abstract float data type ) float data type data type clone ( dtm ) ) ; if ( ! new float map contains key ( data organization get double size ( ) ) ) { new float map put ( data organization get double size ( ) , ( abstract float data type ) double data type data type clone ( dtm ) ) ; } if ( ! new float map contains key ( data organization get long double size ( ) ) ) { new float map put ( data organization get long double size ( ) , ( abstract float data type ) long double data type data type clone ( dtm ) ) ; } for ( int size : float map key set ( ) ) { if ( ! new float map contains key ( size ) ) { new float map put ( size , ( abstract float data type ) float map get ( size ) clone ( dtm ) ) ; } } } } abstract float data type [ ] float type array = new abstract float data type [ new float map size ( ) ] ; new float map values ( ) to array ( float type array ) ; return float type array ; }


convert a value given in meters to a value of this unit

public double from meters ( double distance ) { return convert ( distance , distance unit meters , this ) ; }


try to mark the { @ link promise } as failure and log if { @ code logger } is not { @ code null } in case this fails

public static void try failure ( promise < ? > p , throwable cause , internal logger logger ) { if ( ! p try failure ( cause ) & & logger ! = null ) { throwable err = p cause ( ) ; if ( err = = null ) { logger warn ( " failed to mark a promise as failure because it has succeeded already : { } " , p , cause ) ; } else if ( logger is warn enabled ( ) ) { logger warn ( " failed to mark a promise as failure because it has failed already : { } , unnotified cause : { } " , p , throwable util stack trace to string ( err ) , cause ) ; } } }


set the list of components that depend optionally on this plugin

public void set optional dependents ( @ non null set < string > optional dependents ) { this optional dependents = optional dependents ; }


returns if the required cache matches the provided type

private static boolean has cache of type ( method test method , class < ? > cache type ) { return arrays stream ( test method get parameter types ( ) ) any match ( cache type : : is assignable from ) ; }


overridden to translate the internal value to a hex representation

public string value to string ( object value ) throws parse exception { string value string = super value to string ( value ) ; if ( " " equals ( value string ) ) { return value string ; } return long to hex string ( long value of ( value string ) ) ; }


factory method to instantiate the remote rpc service

protected rpc service create remote rpc service ( configuration configuration , string bind address , int bind port ) throws exception { return akka rpc service utils remote service builder ( configuration , bind address , string value of ( bind port ) ) with bind address ( bind address ) with bind port ( bind port ) with custom config ( akka utils test dispatcher config ( ) ) create and start ( ) ; }


checks for the { @ link reader context } if it exists and compares the { @ link authentication } object from the scroll context with the current authentication context

public void validate reader context ( reader context reader context , transport request request ) { if ( license state is security enabled ( ) ) { if ( reader context scroll context ( ) ! = null ) { final authentication original auth = reader context get from context ( authentication field authentication key ) ; final authentication current = security context get authentication ( ) ; final thread context thread context = security context get thread context ( ) ; final string action = thread context get transient ( originating action key ) ; ensure authenticated user is same ( original auth , current , audit trail service , reader context id ( ) , action , request , audit util extract request id ( thread context ) , thread context get transient ( authorization info key ) ) ; / / piggyback on context validation to assert the dls / fls permissions on the thread context of the scroll search handler if ( null = = security context get thread context ( ) get transient ( authorization service field indices permissions key ) ) { / / fill in the dls and fls permissions for the scroll search action from the scroll context indices access control scroll indices access control = reader context get from context ( authorization service field indices permissions key ) ; assert scroll indices access control ! = null : " scroll does not contain index access control " ; security context get thread context ( ) put transient ( authorization service field indices permissions key , scroll indices access control ) ; } } } }


merges two environments the properties of the first environment might be overwritten by the second one

public static environment merge ( environment env 1 , environment env 2 ) { final environment merged env = new environment ( ) ; / / merge modules final map < string , module entry > modules = new linked hash map < > ( env 1 get modules ( ) ) ; modules put all ( env 2 get modules ( ) ) ; merged env modules = modules ; / / merge catalogs final map < string , catalog entry > catalogs = new hash map < > ( env 1 get catalogs ( ) ) ; catalogs put all ( env 2 get catalogs ( ) ) ; merged env catalogs = catalogs ; / / merge tables final map < string , table entry > tables = new linked hash map < > ( env 1 get tables ( ) ) ; tables put all ( env 2 get tables ( ) ) ; merged env tables = tables ; / / merge functions final map < string , function entry > functions = new hash map < > ( env 1 get functions ( ) ) ; functions put all ( env 2 get functions ( ) ) ; merged env functions = functions ; / / merge execution properties merged env execution = execution entry merge ( env 1 get execution ( ) , env 2 get execution ( ) ) ; / / merge configuration properties merged env configuration = configuration entry merge ( env 1 get configuration ( ) , env 2 get configuration ( ) ) ; / / merge deployment properties merged env deployment = deployment entry merge ( env 1 get deployment ( ) , env 2 get deployment ( ) ) ; return merged env ; }


set a description of the resource that this bean definition came from ( for the purpose of showing context in case of errors )

public void set resource description ( @ nullable string resource description ) { this resource = ( resource description ! = null ? new descriptive resource ( resource description ) : null ) ; }


should this request wait for all found tasks to complete ?

public final list tasks request builder set wait for completion ( boolean wait for completion ) { request set wait for completion ( wait for completion ) ; return this ; }


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


default response entity < void > delete pet ( @ api param ( value = " pet id to delete " , required = true ) @ path variable ( " pet id " ) long pet id , @ api param ( value = " " ) @ request header ( value = " api key " , required = false ) string api key ) { return new response entity < > ( http status not implemented ) ; }


gets whether the loaded local has info in the local variable table

protected final boolean get local info ( ) { return local info ; }


public void test block location setters ( ) throws exception { block location loc ; loc = new block location ( ) ; / / test that null sets the empty array loc set hosts ( null ) ; loc set cached hosts ( null ) ; loc set names ( null ) ; loc set topology paths ( null ) ; check block location ( loc ) ; / / test that not - null gets set properly string [ ] names = new string [ ] { " name " } ; string [ ] hosts = new string [ ] { " host " } ; string [ ] cached hosts = new string [ ] { " cached host " } ; string [ ] topology paths = new string [ ] { " path " } ; string [ ] storage ids = new string [ ] { " storage id " } ; storage type [ ] storage types = new storage type [ ] { storage type disk } ; loc set names ( names ) ; loc set hosts ( hosts ) ; loc set cached hosts ( cached hosts ) ; loc set topology paths ( topology paths ) ; loc set storage ids ( storage ids ) ; loc set storage types ( storage types ) ; loc set offset ( 1 ) ; loc set length ( 2 ) ; loc set corrupt ( true ) ; check block location ( loc , names , hosts , cached hosts , topology paths , storage ids , storage types , 1 , 2 , true ) ; }


create files at the target path with some known data in them each file will have the same content : & quot ; extra stuff & quot ; if the test run is happening within 20 seconds of the top of the hour , this method will sleep until the top of the hour

protected void pre create log file ( string path , int num files ) throws i o exception , interrupted exception , u r i syntax exception { calendar now = get now not top of hour ( ) ; file system fs = file system get ( new uri ( path ) , new configuration ( ) ) ; path dir = new path ( path , date format format ( now get time ( ) ) + " 00 " ) ; fs mkdirs ( dir ) ; path file = new path ( dir , get log filename ( ) ) ; / / create the log file to force the sink to append try ( f s data output stream out = fs create ( file ) ) { out write ( " extra stuff \ n " get bytes ( ) ) ; out flush ( ) ; } if ( num files > 1 ) { int count = 1 ; while ( count < num files ) { file = new path ( dir , get log filename ( ) + " " + count ) ; / / create the log file to force the sink to append try ( f s data output stream out = fs create ( file ) ) { out write ( " extra stuff \ n " get bytes ( ) ) ; out flush ( ) ; } count + = 1 ; } } }


public void next key ( ) throws i o exception { / / read until we find a new key while ( has next ) { read next key ( ) ; } + + ctr ; / / move the next key to the current one key tmp key = key ; key = next key ; next key = tmp key ; has next = more ; }


this test makes sure that when an action encounters an error it should not be subject to throttling also , the ack status of the action in the watch should remain awaits successful execution as long as the execution fails

public void test error in action ( ) throws exception { create index ( " foo " ) ; client ( ) admin ( ) indices ( ) prepare update settings ( " foo " ) set settings ( settings builder ( ) put ( " index blocks write " , true ) ) get ( ) ; put watch response put watch response = new put watch request builder ( client ( ) , " id " ) set source ( watch builder ( ) trigger ( schedule ( interval ( " 1 0m " ) ) ) / / adding an action that throws an error and is associated with a 60 minute throttle period / / with such a period , on successful execution we other executions of the watch will be / / throttled within the hour but on failed execution there should be no throttling add action ( " action " , time value time value minutes ( 60 ) , index action builder ( " foo " ) ) ) get ( ) ; assert that ( put watch response is created ( ) , is ( true ) ) ; time warp ( ) trigger ( " id " ) ; flush ( ) ; / / there should be a single history record with a failure status for the action : assert busy ( ( ) - > { long count = watch record count ( query builders bool query ( ) must ( terms query ( " result actions id " , " action " ) ) must ( terms query ( " result actions status " , " failure " ) ) ) ; assert that ( count , is ( 1l ) ) ; } ) ; / / now we ' ll trigger the watch again and make sure that it ' s not throttled and instead / / writes another record to the history / / within the 60 minute throttling period time warp ( ) clock ( ) fast forward ( time value time value minutes ( random int between ( 1 , 50 ) ) ) ; time warp ( ) trigger ( " id " ) ; flush ( ) ; / / there should be a single history record with a failure status for the action : assert busy ( ( ) - > { long count = watch record count ( query builders bool query ( ) must ( terms query ( " result actions id " , " action " ) ) must ( terms query ( " result actions status " , " failure " ) ) ) ; assert that ( count , is ( 2l ) ) ; } ) ; / / now lets confirm that the ack status of the action is awaits successful execution get watch response get watch response = new get watch request builder ( client ( ) , " id " ) get ( ) ; x content source watch = get watch response get source ( ) ; watch get value ( " status actions action ack awaits successful execution " ) ; }


determine whether to trigger a commit after no message has been received this is a good idea on any modern - day jms provider

protected boolean should commit after no message received ( session session ) { return true ; }


public int get phase ( ) { return this phase ; }


public double get ( long key ) throws no value exception { int index = indexer get ( key ) ; if ( index < 0 ) { throw new no value exception ( ) ; } return values [ index ] ; }


tests that n h m w e s makes hash maps large enough that adding the expected number of elements won ' t cause a rehash as of jdk 7u 4 0 , hash map has an empty - map optimization the argument to new hash map ( int ) is noted , but the initial table is a zero - length array this test may fail miserably on non - open j d k environments

public void test new hash map with expected size wont grow ( ) throws exception { / / before jdk 7u 4 0 : creates one - bucket table / / after jdk 7u 4 0 : creates empty table assert true ( buckets of ( maps new hash map with expected size ( 0 ) ) < = 1 ) ; for ( int size = 1 ; size < 200 ; size + + ) { assert wont grow ( size , maps new hash map with expected size ( size ) , maps new hash map with expected size ( size ) ) ; } }


returns the null value singleton instance

public static null value get instance ( ) { return instance ; }


public void test execution success with multiple events ( ) { try { test command with multiple values command = new test command with multiple values ( ) ; assert equals ( arrays as list ( true , false , true ) , command observe ( ) to list ( ) to blocking ( ) single ( ) ) ; assert equals ( null , command get failed execution exception ( ) ) ; assert true ( command get execution time in milliseconds ( ) > - 1 ) ; assert true ( command is successful execution ( ) ) ; assert command execution events ( command , hystrix event type emit , hystrix event type emit , hystrix event type emit , hystrix event type success ) ; assert equals ( 0 , command metrics get current concurrent execution count ( ) ) ; assert sane hystrix request log ( 1 ) ; / / semaphore isolated assert false ( command is executed in thread ( ) ) ; } catch ( exception e ) { e print stack trace ( ) ; fail ( " we received an exception " ) ; } }


runs equals and serialization test on the return values test fails if default value cannot be determined for a constructor or factory method parameter , or if the constructor or factory method throws exception

public factory method return value tester test equals and serializable ( ) throws exception { for ( invokable < ? , ? > factory : get factories to test ( ) ) { try { test equals using ( factory ) ; } catch ( factory method returns null exception e ) { / / if the factory returns null , we just skip it } object instance = instantiate ( factory ) ; if ( instance ! = null ) { try { serializable tester reserialize and assert ( instance ) ; } catch ( runtime exception e ) { assertion error error = new assertion failed error ( " serialization failed on return value of " + factory ) ; error init cause ( e get cause ( ) ) ; throw error ; } catch ( assertion failed error e ) { assertion error error = new assertion failed error ( " return value of " + factory + " reserialized to an unequal value " ) ; error init cause ( e ) ; throw error ; } } } return this ; }


tests nested repeatable and use of @ data bound constructor to process form data

public void test nested enabled top button inner ( ) throws exception { html page p = create web client ( ) go to ( " self / test nested top button inner " ) ; html form f = p get form by name ( " config " ) ; try { click button ( p , f , " add " , true ) ; f get input by value ( " " ) set value attribute ( " title one " ) ; click button ( p , f , " add foo " , true ) ; f get input by value ( " " ) set value attribute ( " txt one " ) ; click button ( p , f , " add foo " , false ) ; f get input by value ( " " ) set value attribute ( " txt two " ) ; f get inputs by name ( " bool " ) get ( 1 ) click ( ) ; click button ( p , f , " add " , false ) ; f get input by value ( " " ) set value attribute ( " title two " ) ; f get elements by tag name ( " button " ) get ( 2 ) click ( ) ; / / 2nd " add foo " button f get input by value ( " " ) set value attribute ( " txt 2 1 " ) ; } catch ( exception e ) { system err println ( " html at time of failure : \ n " + p get body ( ) as xml ( ) ) ; throw e ; } bind class = foo list class ; submit ( f ) ; assert equals ( " [ foo list : title one : [ foo : txt one : false , foo : txt two : true ] , " + " foo list : title two : [ foo : txt 2 1 : false ] ] " , bind result to string ( ) ) ; }


the source that caused this searcher to be acquired

public string source ( ) { return source ; }


waits for the first window of the given class this method assumes that the desired dialog is parented by < code > parent window < code >

public static < t extends dialog component provider > t wait for dialog component ( window parent window , class < t > clazz , int timeout m s ) { if ( ! dialog component provider class is assignable from ( clazz ) ) { throw new illegal argument exception ( clazz get name ( ) + " does not extend " + dialog component provider class get simple name ( ) ) ; } int total time = 0 ; while ( total time < = default wait timeout ) { t provider = get dialog component ( parent window , clazz ) ; if ( provider ! = null ) { return provider ; } total time + = sleep ( default wait delay ) ; } throw new assertion failed error ( " timed - out waiting for window of class : " + clazz ) ; }


returns the start position of the first occurrence of the specified { @ code target } within { @ code array } , or { @ code - 1 } if there is no such occurrence more formally , returns the lowest index { @ code i } such that { @ code arrays copy of range ( array , i , i + target length ) } contains exactly the same elements as { @ code target }

public static int index of ( short [ ] array , short [ ] target ) { check not null ( array , " array " ) ; check not null ( target , " target " ) ; if ( target length = = 0 ) { return 0 ; } outer : for ( int i = 0 ; i < array length - target length + 1 ; i + + ) { for ( int j = 0 ; j < target length ; j + + ) { if ( array [ i + j ] ! = target [ j ] ) { continue outer ; } } return i ; } return - 1 ; }


invoked when the mock mvc instance is about to be created with the mock mvc builder and the spring web application context that will be passed to the { @ code dispatcher servlet }

default request post processor before mock mvc created ( configurable mock mvc builder < ? > builder , web application context context ) { return null ; }


private static void setup class ( string class name , color default color , string description ) { try { class < ? > klass = class for name ( class name ) ; classes add ( klass ) ; class to color map put ( klass , default color ) ; simple name to class put ( get simple name ( klass ) , klass ) ; class description put ( klass , description ) ; } catch ( class not found exception cnfe ) { msg debug ( python code completion factory class , " unable to find class : " + class name , cnfe ) ; } }


sets the number of bytes that should be loaded between each invocation of { @ link media period callback # on continue loading requested ( sequenceable loader ) } the default value is { @ link # default loading check interval bytes }

public factory set continue loading check interval bytes ( int continue loading check interval bytes ) { this continue loading check interval bytes = continue loading check interval bytes ; return this ; }


allows for special handling for ignored missing placeholders that may be resolved elsewhere

boolean should remove missing placeholder ( string placeholder name ) ;


the interface used by clients to get a report of applications matching the filters defined by { @ link get applications request } in the cluster from the < code > resource manager < code > or < code > application history server < code > the < code > resource manager < code > or < code > application history server < code > responds with a { @ link get applications response } which includes the { @ link application report } for the applications if the user does not have < code > view app < code > access for an application then the corresponding report will be filtered as described in { @ link # get application report ( get application report request ) }

public get applications response get applications ( get applications request request ) throws yarn exception , i o exception ;


returns an instance which specifies that the ordering of the elements is guaranteed to be determined by { @ code comparator }

public static < s > element order < s > sorted ( comparator < s > comparator ) { return new element order < s > ( type sorted , check not null ( comparator ) ) ; }


call routines to encode " - le - " , in proper order

void encode le cases ( int save current ) { if ( encode vowel le transposition ( save current ) ) { return ; } else { if ( encode vowel preserve vowel after l ( save current ) ) { return ; } else { metaph add ( " l " ) ; } } }


appends the given element value to the given array of element values , creating a new array if necessary

private element value [ ] add element value ( int element values count , element value [ ] element values , element value element value ) { / / is the array too small to contain the additional element value ? if ( element values length < = element values count ) { / / create a new array and copy the element values into it element value [ ] new element values = new element value [ element values count + 1 ] ; system arraycopy ( element values , 0 , new element values , 0 , element values count ) ; element values = new element values ; } / / append the element value element values [ element values count ] = element value ; return element values ; }


< b > warning : < b > this is a dangerous method and should only be used for testing convenience a method that blocks until availability does not go together well with the concept of asynchronous notifications and non - blocking polling get and remove the first element from the queue the call blocks if the queue is empty the problem with this method is that it may loop internally until an element is available and that way eagerly reset the availability future if a consumer thread is blocked in taking an element , it will receive availability notifications from { @ link # notify available ( ) } and immediately reset them by calling { @ link # poll ( ) } and finding the queue empty

public t take ( ) throws interrupted exception { t next ; while ( ( next = poll ( ) ) = = null ) { / / use the future to wait for availability to avoid busy waiting try { get availability future ( ) get ( ) ; } catch ( execution exception | completion exception e ) { / / this should never happen , but we propagate just in case throw new flink runtime exception ( " exception in queue future completion " , e ) ; } } return next ; }


returns the items as an array note the array is typed , so the { @ link # array ( class ) } constructor must have been used otherwise use { @ link # to array ( class ) } to specify the array type

public t [ ] to array ( ) { return ( t [ ] ) to array ( items get class ( ) get component type ( ) ) ; }


given the path fragment of a java source file , returns the java root relative path or ' null ' if no java root can be determined for example , " { workspace } javafoobarwiz " and " { workspace } javatestsfoobarwiz " both result in " foobarwiz " todo ( bazel - team ) : ( 2011 ) we need to have a more robust way to determine the java root of a relative path rather than simply trying to find the " java " or " javatests " directory

public static path fragment get java path ( path fragment path ) { int index = java segment index ( path ) ; if ( index > = 0 ) { return path sub fragment ( index + 1 ) ; } return null ; }


assign the generated id value to { @ link lite pal support # base obj id } this value will be used as identify of this model for system use

protected void give base obj id value ( lite pal support base obj , long id ) throws security exception , no such field exception , illegal argument exception , illegal access exception { if ( id > 0 ) { dynamic executor set ( base obj , " base obj id " , id , lite pal support class ) ; } }


get the role of this token ; subclasses should override this for better logging

protected string binding name ( ) { return " session " ; }


optional , max retry times for jdbc connector

public builder set max retry times ( int max retry times ) { execution options builder with max retries ( max retry times ) ; return this ; }


protected void with bind holder ( ultimate recyclerview view holder holder , t data , int position ) { m item manger update convert view ( holder , position ) ; }


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


public void visit switch insn ( switch insn insn ) { visit ( insn ) ; }


the workspace file parsing is cut in several parts and this function returns the index of the part of the workspace file that this value holds for the first part , this index will be 0 , for the second part , it will be 1 and so on

public int get index ( ) { return idx ; }


test create , update and delete events of model entities

public void test model events ( ) throws exception { model model = null ; try { model = repository service new model ( ) ; model set name ( " my model " ) ; model set key ( " key " ) ; repository service save model ( model ) ; / / check create event assert that ( listener get events received ( ) ) has size ( 2 ) ; assert that ( listener get events received ( ) get ( 0 ) get type ( ) ) is equal to ( activiti event type entity created ) ; assert that ( ( ( model ) ( ( activiti entity event ) listener get events received ( ) get ( 0 ) ) get entity ( ) ) get id ( ) ) is equal to ( model get id ( ) ) ; assert that ( listener get events received ( ) get ( 1 ) get type ( ) ) is equal to ( activiti event type entity initialized ) ; assert that ( ( ( model ) ( ( activiti entity event ) listener get events received ( ) get ( 1 ) ) get entity ( ) ) get id ( ) ) is equal to ( model get id ( ) ) ; listener clear events received ( ) ; / / update model model = repository service get model ( model get id ( ) ) ; model set name ( " updated " ) ; repository service save model ( model ) ; assert that ( listener get events received ( ) ) has size ( 1 ) ; assert that ( listener get events received ( ) get ( 0 ) get type ( ) ) is equal to ( activiti event type entity updated ) ; assert that ( ( ( model ) ( ( activiti entity event ) listener get events received ( ) get ( 0 ) ) get entity ( ) ) get id ( ) ) is equal to ( model get id ( ) ) ; listener clear events received ( ) ; / / test additional update - methods ( source and extra - source ) repository service add model editor source ( model get id ( ) , " test " get bytes ( ) ) ; repository service add model editor source extra ( model get id ( ) , " test extra " get bytes ( ) ) ; assert that ( listener get events received ( ) ) has size ( 2 ) ; assert that ( listener get events received ( ) get ( 0 ) get type ( ) ) is equal to ( activiti event type entity updated ) ; assert that ( listener get events received ( ) get ( 1 ) get type ( ) ) is equal to ( activiti event type entity updated ) ; listener clear events received ( ) ; / / delete model events repository service delete model ( model get id ( ) ) ; assert that ( listener get events received ( ) ) has size ( 1 ) ; assert that ( listener get events received ( ) get ( 0 ) get type ( ) ) is equal to ( activiti event type entity deleted ) ; assert that ( ( ( model ) ( ( activiti entity event ) listener get events received ( ) get ( 0 ) ) get entity ( ) ) get id ( ) ) is equal to ( model get id ( ) ) ; listener clear events received ( ) ; } finally { if ( model ! = null & & repository service get model ( model get id ( ) ) ! = null ) { repository service delete model ( model get id ( ) ) ; } } }


return the principal associated with the handshake http request

public mono < principal > get principal ( ) { return this principal mono ; }


delete purchase order by id for valid response try integer i ds with value & lt ; 1000 anything above 1000 or nonintegers will generate api errors < b > 400 < b > - invalid id supplied < b > 404 < b > - order not found

public mono < void > delete order ( string order id ) throws web client response exception { object post body = null ; / / verify the required parameter ' order id ' is set if ( order id = = null ) { throw new web client response exception ( " missing the required parameter ' order id ' when calling delete order " , http status bad request value ( ) , http status bad request get reason phrase ( ) , null , null , null ) ; } / / create path and map variables final map < string , object > path params = new hash map < string , object > ( ) ; path params put ( " order id " , order id ) ; final multi value map < string , string > query params = new linked multi value map < string , string > ( ) ; final http headers header params = new http headers ( ) ; final multi value map < string , string > cookie params = new linked multi value map < string , string > ( ) ; final multi value map < string , object > form params = new linked multi value map < string , object > ( ) ; final string [ ] local var accepts = { } ; final list < media type > local var accept = api client select header accept ( local var accepts ) ; final string [ ] local var content types = { } ; final media type local var content type = api client select header content type ( local var content types ) ; string [ ] local var auth names = new string [ ] { } ; parameterized type reference < void > local var return type = new parameterized type reference < void > ( ) { } ; return api client invoke a p i ( " / store / order / { order id } " , http method delete , path params , query params , post body , header params , cookie params , form params , local var accept , local var content type , local var auth names , local var return type ) ; }


returns the values of done deps in { @ code dep keys } , by looking in order at : { @ link # bubble error info } { @ link # previously requested deps values } { @ link # newly requested deps values } { @ link # old deps entries } { @ link # evaluator context } ' s graph accessing methods any key whose { @ link node entry } - - or absence thereof - - had to be read from the graph will also be entered into { @ link # newly requested deps values } with its value or a { @ link # null marker } this asserts that only keys in { @ link # newly registered deps } require reading from the graph , because this node is done , and so all other deps must have been previously or newly requested if { @ code assert done } , this asserts that all deps in { @ code dep keys } are done

private collection < sky value > get dep values for done node from error or deps or graph ( iterable < sky key > dep keys , boolean assert done , int key size ) throws interrupted exception { list < sky value > result = new array list < > ( key size ) ; / / dep keys may contain keys in newly registered deps whose values have not yet been retrieved from / / the graph during this environment ' s lifetime int expected missing keys = newly registered deps size ( ) ; array list < sky key > missing keys = expected missing keys > 0 ? new array list < > ( expected missing keys ) : null ; array list < sky key > unexpectedly missing keys = null ; for ( sky key key : dep keys ) { sky value value = maybe get value from error or deps ( key ) ; if ( value = = null ) { if ( key = = error transience value key ) { continue ; } if ( ! newly registered deps contains ( key ) ) { if ( unexpectedly missing keys = = null ) { unexpectedly missing keys = new array list < > ( ) ; } unexpectedly missing keys add ( key ) ; if ( missing keys = = null ) { missing keys = new array list < > ( ) ; } } missing keys add ( key ) ; } else if ( value = = null marker ) { preconditions check state ( ! assert done , " % s had not done % s " , sky key , key ) ; } else { result add ( value ) ; } } if ( unexpectedly missing keys ! = null & & ! unexpectedly missing keys is empty ( ) ) { / / this may still crash below , if the dep is not done in the graph , but at least it gives the / / dep until now to complete its computation , as opposed to the start of this node ' s / / evaluation , which is when most of the structures used by # maybe get value from error or deps were / / created evaluator context get graph inconsistency receiver ( ) note inconsistency and maybe throw ( sky key , unexpectedly missing keys , inconsistency already declared child missing ) ; } if ( missing keys = = null | | missing keys is empty ( ) ) { return result ; } map < sky key , ? extends node entry > missing entries = evaluator context get batch values ( sky key , reason dep requested , missing keys ) ; for ( sky key key : missing keys ) { node entry dep entry = missing entries get ( key ) ; sky value value or null marker = get value or null marker ( dep entry ) ; newly requested deps values put ( key , value or null marker ) ; if ( value or null marker = = null marker ) { / / todo ( mschaller ) : handle registered deps that transitioned from done to dirty during eval / / but how ? restarting the current node may not help , because this dep was * registered * , not / / requested for now , no node that gets registered as a dep is eligible for / / intra - evaluation dirtying , so let it crash preconditions check state ( ! assert done , " % s had not done : % s " , sky key , key ) ; continue ; } maybe update max child version ( dep entry ) ; result add ( value or null marker ) ; } return result ; }


upgrades to another protocol from http removes the { @ link http request decoder } and { @ link http response encoder } from the pipeline

public void upgrade from ( channel handler context ctx ) { ctx pipeline ( ) remove ( this ) ; }


set the maximum number of undo transaction checkpoints maintained by the underlying buffer manager

public synchronized void set max undos ( int max undos ) { buffer mgr set max undos ( max undos ) ; }


expands the size of the control by 1 pixel in each direction

public void relocate ( cell editor celleditor ) { border border = figure get border ( ) ; / / insets insets = border get insets ( figure ) ; dimension border size = border get preferred size ( figure ) ; text text = ( text ) celleditor get control ( ) ; rectangle rect = figure get bounds ( ) get copy ( ) ; figure translate to absolute ( rect ) ; text set background ( figure get background color ( ) ) ; text set bounds ( rect x + border size width , rect y + border size height , rect width - border size width * 2 , rect height - border size height * 2 ) ; }


lookup the context for an already resolved field type

public final field context build field context ( mapped field type ft ) { return new field context ( ft name ( ) , build field data ( ft ) , ft ) ; }


delete purchase order by id for valid response try integer i ds with value & lt ; 1000 anything above 1000 or nonintegers will generate api errors

public void delete order ( @ path param ( " order id " ) string order id ) ;


although http url prefers percent - encodings in uppercase , it should preserve the exact structure of the original encoding

@ test public void raw encoding retained ( ) throws exception { string url string = " http : / / % 6d % 6d : % 6d % 6d @ host / % 6d % 6d ? % 6d % 6d # % 6d % 6d " ; http url url = parse ( url string ) ; assert that ( url encoded username ( ) ) is equal to ( " % 6d % 6d " ) ; assert that ( url encoded password ( ) ) is equal to ( " % 6d % 6d " ) ; assert that ( url encoded path ( ) ) is equal to ( " / % 6d % 6d " ) ; assert that ( url encoded path segments ( ) ) contains exactly ( " % 6d % 6d " ) ; assert that ( url encoded query ( ) ) is equal to ( " % 6d % 6d " ) ; assert that ( url encoded fragment ( ) ) is equal to ( " % 6d % 6d " ) ; assert that ( url to string ( ) ) is equal to ( url string ) ; assert that ( url new builder ( ) build ( ) to string ( ) ) is equal to ( url string ) ; assert that ( url resolve ( " " ) to string ( ) ) is equal to ( " http : / / % 6d % 6d : % 6d % 6d @ host / % 6d % 6d ? % 6d % 6d " ) ; }


< code > replace function var args < code > changes whether the function has var args in program 1 if it doesn ' t match the use of var args in the function in program 2 at the specified entry point address

public void replace function var args ( address entry 2 , task monitor monitor ) { address entry = origin to result translator get address ( entry 2 ) ; function f 1 = result program get function manager ( ) get function at ( entry ) ; function f 2 = origin program get function manager ( ) get function at ( entry 2 ) ; if ( f 1 ! = null & & f 2 ! = null ) { boolean has var args 1 = f 1 has var args ( ) ; boolean has var args 2 = f 2 has var args ( ) ; if ( has var args 1 ! = has var args 2 ) { f 1 set var args ( has var args 2 ) ; } } }


add the given model attribute with the supplied name

b model attribute ( string name , object value ) ;


execute the runnable in the execution context of this rpc service , as returned by { @ link # get executor ( ) } , after a scheduled delay

scheduled future < ? > schedule runnable ( runnable runnable , long delay , time unit unit ) ;


guaranteed to throw an exception and leave the map unmodified

public final entry < k , v > poll last entry ( ) { throw new unsupported operation exception ( ) ; }


compress ( tar ) the input files to the output file

public static file compress files ( collection < file > files , file output , string bundle root ) throws i o exception { try ( file output stream fos = new file output stream ( output ) ; tar archive output stream taos = new tar archive output stream ( new buffered output stream ( fos ) ) ) { taos set long file mode ( tar archive output stream longfile gnu ) ; for ( file f : files ) { add files to compression ( taos , f , " sysfs " , bundle root ) ; } } return output ; }


returns true if this { @ code test observer } received a subscription

public final boolean has subscription ( ) { return upstream get ( ) ! = null ; }


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


sets the requests optional " timeout " parameter

public void timeout ( time value timeout ) { this timeout = timeout ; }


the given block is considered as low redundancy when the block locations length is less than expected replication factor for ec blocks , redundancy is the summation of data + parity blocks

private boolean is low redundancy block ( located block block info , int replication , erasure coding policy ec policy ) { boolean has low redundancy block = false ; if ( block info is striped ( ) ) { / / for ec blocks , redundancy is the summation of data + parity blocks replication = ec policy get num data units ( ) + ec policy get num parity units ( ) ; } / / block is considered as low redundancy when the block locations length is / / less than expected replication factor has low redundancy block = block info get locations ( ) length < replication ? true : false ; return has low redundancy block ; }


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 a doc id set per segments containing the matching docs for the specified slice

private doc id set build ( leaf reader reader ) throws i o exception { final doc id set builder builder = new doc id set builder ( reader max doc ( ) ) ; final terms terms = reader terms ( get field ( ) ) ; if ( terms = = null ) { return doc id set empty ; } final terms enum te = terms iterator ( ) ; postings enum docs enum = null ; for ( bytes ref term = te next ( ) ; term ! = null ; term = te next ( ) ) { / / use a fixed seed instead of term hash code ( ) otherwise this query may return inconsistent results when / / running on another replica ( string helper sets its default seed at startup with current time ) int hash code = string helper murmurhash 3 x 8 6 32 ( term , seed ) ; if ( contains ( hash code ) ) { docs enum = te postings ( docs enum , postings enum none ) ; builder add ( docs enum ) ; } } return builder build ( ) ; }


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

public static fields find by name ( string name ) { return by name get ( name ) ; }


create a new directory in the passed filesystem this wrapper method exists so that it can be overriddenstubbed during testing

boolean mkdirs ( file system fs , path dir , fs permission permission ) throws i o exception { return file system mkdirs ( fs , dir , permission ) ; }


create a { @ link request mapping info } from the supplied { @ link request mapping @ request mapping } annotation , which is either a directly declared annotation , a meta - annotation , or the synthesized result of merging annotation attributes within an annotation hierarchy

protected request mapping info create request mapping info ( request mapping request mapping , @ nullable request condition < ? > custom condition ) { request mapping info builder builder = request mapping info paths ( resolve embedded values in patterns ( request mapping path ( ) ) ) methods ( request mapping method ( ) ) params ( request mapping params ( ) ) headers ( request mapping headers ( ) ) consumes ( request mapping consumes ( ) ) produces ( request mapping produces ( ) ) mapping name ( request mapping name ( ) ) ; if ( custom condition ! = null ) { builder custom condition ( custom condition ) ; } return builder options ( this config ) build ( ) ; }


return the number of thread - bound objects created


returns an immutable range map mapping a single range to a single value

public static < k extends comparable < ? > , v > immutable range map < k , v > of ( range < k > range , v value ) { return new immutable range map < > ( immutable list of ( range ) , immutable list of ( value ) ) ; }


adds this node as child to specified parent node , synonym for : < code > parent add child ( this ) < code >

public < t extends node > void attach to ( t parent ) { parent add child ( this ) ; }


public static local container entity manager factory bean new entity manager factory bean ( final jpa configuration context config ) { val bean = new local container entity manager factory bean ( ) ; bean set jpa vendor adapter ( config get jpa vendor adapter ( ) ) ; if ( config get persistence provider ( ) ! = null ) { bean set persistence provider ( config get persistence provider ( ) ) ; } if ( string utils is not blank ( config get persistence unit name ( ) ) ) { bean set persistence unit name ( config get persistence unit name ( ) ) ; } if ( ! config get packages to scan ( ) is empty ( ) ) { bean set packages to scan ( config get packages to scan ( ) to array ( array utils empty string array ) ) ; } if ( config get data source ( ) ! = null ) { bean set data source ( config get data source ( ) ) ; } bean get jpa property map ( ) put all ( config get jpa properties ( ) ) ; return bean ; }


set the { @ link # size ( ) } and ensure that the { @ link # values } array can store at least that many entries

protected void resize ( int new size ) { count = new size ; if ( new size > values length ) { int old length = values length ; values = array util grow ( values , count ) ; for ( int i = old length ; i < values length ; + + i ) { values [ i ] = new geo point ( ) ; } } }


public map < string , list < integer > > get map array integer ( ) { return map array integer ; }


b context path ( string context path ) ;


public journal set get journal set ( ) { return journal set ; }


update operation : open the limination of capacity management and it will check the size of content

private object do 4 update ( proceeding join point pjp , http servlet request request , http servlet response response , string data id , string group , string tenant , string content ) throws throwable { if ( ! property util is capacity limit check ( ) ) { return pjp proceed ( ) ; } try { boolean has tenant = has tenant ( tenant ) ; capacity capacity = get capacity ( group , tenant , has tenant ) ; if ( is size limited ( group , tenant , get current size ( content ) , has tenant , false , capacity ) ) { return response 4 limit ( request , response , limit type over max size ) ; } } catch ( exception e ) { logger error ( " [ capacity management ] do 4 update " , e ) ; } return pjp proceed ( ) ; }


test serialization of outer boolean types

public void fake outer boolean serialize test ( ) throws api exception { boolean body = null ; boolean response = api fake outer boolean serialize ( body ) ; / / todo : test validations }


public map < string , integer > get map integer ( ) { return map integer ; }


public destination order get destination order ( ) { return this dest order ; }


public static list < string > check md 5 ( ) { list < string > diff list = new array list < string > ( ) ; long start time = system current time millis ( ) ; for ( entry < string / * group key * / , cache item > entry : cache entry set ( ) ) { string group key = entry get key ( ) ; string [ ] dg = group key parse key ( group key ) ; string data id = dg [ 0 ] ; string group = dg [ 1 ] ; string tenant = dg [ 2 ] ; try { string loacal md 5 = disk util get local config md 5 ( data id , group , tenant ) ; if ( ! entry get value ( ) md 5 equals ( loacal md 5 ) ) { default log warn ( " [ md 5 - different ] data id : { } , group : { } " , data id , group ) ; diff list add ( group key ) ; } } catch ( i o exception e ) { default log error ( " get local config md 5 fail , data id : { } , group : { } " , data id , group ) ; } } long end time = system current time millis ( ) ; default log warn ( " check md 5 cost : { } ; diff count : { } " , end time - start time , diff list size ( ) ) ; return diff list ; }


attaches the first { @ link sasl extensions } found in the public credentials of the subject

private static void handle callback ( sasl extensions callback extensions callback , subject subject ) { if ( subject ! = null & & ! subject get public credentials ( sasl extensions class ) is empty ( ) ) { sasl extensions extensions = subject get public credentials ( sasl extensions class ) iterator ( ) next ( ) ; extensions callback extensions ( extensions ) ; } }


public immutable map < aspect key , configured aspect > get aspects map ( ) { return aspects ; }


public static bitmap to round corner ( final bitmap src , final float radius ) { return to round corner ( src , radius , 0 , 0 , false ) ; }


key providers must implement this method given a list of configuration parameters for the specified azure storage account , retrieve the plaintext storage account key

string get storage account key ( string account name , configuration conf ) throws key provider exception ;


configures trust store related settings in ssl context factory

protected static void configure ssl context factory trust store ( ssl context factory ssl , map < string , object > ssl config values ) { ssl set trust store type ( ( string ) get or default ( ssl config values , ssl configs ssl truststore type config , ssl configs default ssl truststore type ) ) ; string ssl truststore location = ( string ) ssl config values get ( ssl configs ssl truststore location config ) ; if ( ssl truststore location ! = null ) ssl set trust store path ( ssl truststore location ) ; password ssl truststore password = ( password ) ssl config values get ( ssl configs ssl truststore password config ) ; if ( ssl truststore password ! = null ) ssl set trust store password ( ssl truststore password value ( ) ) ; }


modifies a function instance by removing any reference to outer classes this enables non - static inner function classes

private static void clean function ( readable config config , user defined function function ) { final closure cleaner level level = config get ( pipeline options closure cleaner level ) ; try { closure cleaner clean ( function , level , true ) ; } catch ( throwable t ) { throw new validation exception ( string format ( " function class ' % s ' is not serializable make sure that the class is self - contained " + " ( i e no references to outer classes ) and all inner fields are serializable as well " , function get class ( ) ) , t ) ; } }


set the joint limits , usually in meters

public void set limits ( float lower , float upper ) { jni set limits ( addr , lower , upper ) ; }


set the username that the request applies to must not be { @ code null }

public void username ( string username ) { this username = username ; }


helper method to configure the token endpoint of the first oauth found in the api authorizations ( there should be only one )

public token request builder get token end point ( ) { for ( authentication api auth : authentications values ( ) ) { if ( api auth instanceof retrying o auth ) { retrying o auth retrying o auth = ( retrying o auth ) api auth ; return retrying o auth get token request builder ( ) ; } } return null ; }


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

public completable future < void > create user ( user body ) throws api exception { try { http request builder local var request builder = create user request builder ( body ) ; return member var http client send async ( local var request builder build ( ) , http response body handlers of string ( ) ) then compose async ( local var response - > { if ( local var response status code ( ) / 100 ! = 2 ) { return completable future failed future ( get api exception ( " create user " , local var response ) ) ; } return completable future completed future ( null ) ; } ) ; } catch ( api exception e ) { return completable future failed future ( e ) ; } }


get { @ link cluster node } of the resource name

public static cluster node get cluster node ( string id ) { if ( id = = null ) { return null ; } cluster node cluster node = null ; for ( entry type node type : entry type values ( ) ) { cluster node = cluster node map get ( new string resource wrapper ( id , node type ) ) ; if ( cluster node ! = null ) { break ; } } return cluster node ; }


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


returns an immutable map containing a single entry

public static < k extends comparable < ? super k > , v > immutable sorted map < k , v > of ( k k 1 , v v 1 ) { return of ( ordering natural ( ) , k 1 , v 1 ) ; }


returns whether the subtitle button is shown

public boolean get show subtitle button ( ) { return control view layout manager get show button ( subtitle button ) ; }


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


note : returns null if engine is not yet started ( e g recovery phase 1 , copying over index files , is still running ) , or if engine is closed

protected engine get engine or null ( ) { return this current engine reference get ( ) ; }


return the { @ link method parameter } from which { @ link # get return type ( ) return type } was created

public method parameter get return type source ( ) { return ( method parameter ) this return type get source ( ) ; }


call when the screen moves so that the shape can be updated

void reset shape ( ) { arrow body = null ; arrow head = null ; clickable shapes clear ( ) ; }


allows determining the " data " property without the need to load plugins , but does this purely based on naming conventions prefer using { @ link # is data node ( settings ) } if possible

public static boolean is data node based on naming convention ( final settings settings ) { return discovery node has role ( settings , discovery node role data role ) | | settings get as list ( " node roles " ) stream ( ) any match ( discovery node role : : is data role based on naming convention ) ; }


blocks the current thread until a condition becomes true if the current thread is interrupted while waiting for the condition to become true , this method will restore the interrupt < b > after < b > the condition became true

private synchronized void wait uninterruptibly ( supplier < boolean > condition ) { boolean was interrupted = false ; while ( ! condition get ( ) ) { try { wait ( ) ; } catch ( interrupted exception e ) { was interrupted = true ; } } if ( was interrupted ) { / / restore the interrupted status thread current thread ( ) interrupt ( ) ; } }


ensures that at least < code > n < code > data nodes are present in the cluster if more nodes than < code > n < code > are present this method will not stop any of the running nodes

public synchronized void ensure at least num data nodes ( int n ) { int size = num data nodes ( ) ; if ( size < n ) { logger info ( " increasing cluster size from { } to { } " , size , n ) ; if ( num shared dedicated master nodes > 0 ) { start data only nodes ( n - size ) ; } else { start nodes ( n - size ) ; } validate cluster formed ( ) ; } }


returns the low - level memory address that point to the first byte of ths backing data

public abstract long memory address ( ) ;


from the given list , incrementally remove the blocks from block manager writelock is dropped and reacquired every block deletion increment to ensure that other waiters on the lock can get in see hdfs - 2938

void remove blocks ( blocks map update info blocks ) { list < block info > to delete list = blocks get to delete list ( ) ; iterator < block info > iter = to delete list iterator ( ) ; while ( iter has next ( ) ) { write lock ( ) ; try { for ( int i = 0 ; i < block deletion increment & & iter has next ( ) ; i + + ) { block manager remove block ( iter next ( ) ) ; } } finally { write unlock ( " remove blocks " ) ; } } }


reads the next { @ code length } bytes as characters in the specified { @ link charset }

public string read string ( int length , charset charset ) { string result = new string ( data , position , length , charset ) ; position + = length ; return result ; }


tests the simple operations inside the builder

public void test ( ) { tree string builder b = new tree string builder ( ) ; verify ( " foo " , b intern ( " foo " ) ) ; tree string s = b intern ( " foo / bar / zot " ) ; verify ( " foo / bar / zot " , s ) ; verify ( " " , b intern ( " " ) ) ; verify ( " foo / bar / xxx " , b intern ( " foo / bar / xxx " ) ) ; / / this will create new / / middle node verify ( " foo / bar / zot " , s ) ; / / make sure existing strings aren ' t affected }


returns the network address the instance ' s task manager binds its sockets to

public inet address address ( ) { return inet address ; }


public long get number of triplets ( ) { return triplet count ; }


he did the bash , he did the future bash the future bash , it was a concurrency smash he did the bash , it caught on in a flash he did the bash , he did the future bash

public void test future bash ( ) { final cyclic barrier barrier = new cyclic barrier ( 6 / / for the setter threads + 50 / / for the listeners + 50 / / for the blocking get threads , + 1 ) ; / / for the main thread final executor service executor = executors new fixed thread pool ( barrier get parties ( ) ) ; final atomic reference < abstract future < string > > current future = atomics new reference ( ) ; final atomic integer num successful set calls = new atomic integer ( ) ; callable < void > complete successfully runnable = new callable < void > ( ) { @ override public void call ( ) { if ( current future get ( ) set ( " set " ) ) { num successful set calls increment and get ( ) ; } await unchecked ( barrier ) ; return null ; } } ; callable < void > complete exceptionally runnable = new callable < void > ( ) { exception failure cause = new exception ( " set exception " ) ; @ override public void call ( ) { if ( current future get ( ) set exception ( failure cause ) ) { num successful set calls increment and get ( ) ; } await unchecked ( barrier ) ; return null ; } } ; callable < void > cancel runnable = new callable < void > ( ) { @ override public void call ( ) { if ( current future get ( ) cancel ( true ) ) { num successful set calls increment and get ( ) ; } await unchecked ( barrier ) ; return null ; } } ; callable < void > set future complete successfully runnable = new callable < void > ( ) { listenable future < string > future = futures immediate future ( " set future " ) ; @ override public void call ( ) { if ( current future get ( ) set future ( future ) ) { num successful set calls increment and get ( ) ; } await unchecked ( barrier ) ; return null ; } } ; callable < void > set future complete exceptionally runnable = new callable < void > ( ) { listenable future < string > future = futures immediate failed future ( new exception ( " set future " ) ) ; @ override public void call ( ) { if ( current future get ( ) set future ( future ) ) { num successful set calls increment and get ( ) ; } await unchecked ( barrier ) ; return null ; } } ; callable < void > set future cancel runnable = new callable < void > ( ) { listenable future < string > future = futures immediate cancelled future ( ) ; @ override public void call ( ) { if ( current future get ( ) set future ( future ) ) { num successful set calls increment and get ( ) ; } await unchecked ( barrier ) ; return null ; } } ; final set < object > final results = collections synchronized set ( sets new identity hash set ( ) ) ; runnable collect results runnable = new runnable ( ) { @ override public void run ( ) { try { string result = uninterruptibles get uninterruptibly ( current future get ( ) ) ; final results add ( result ) ; } catch ( execution exception e ) { final results add ( e get cause ( ) ) ; } catch ( cancellation exception e ) { final results add ( cancellation exception class ) ; } finally { await unchecked ( barrier ) ; } } } ; runnable collect results timed get runnable = new runnable ( ) { @ override public void run ( ) { future < string > future = current future get ( ) ; while ( true ) { try { string result = uninterruptibles get uninterruptibly ( future , 0 , time unit seconds ) ; final results add ( result ) ; break ; } catch ( execution exception e ) { final results add ( e get cause ( ) ) ; break ; } catch ( cancellation exception e ) { final results add ( cancellation exception class ) ; break ; } catch ( timeout exception e ) { / / loop } } await unchecked ( barrier ) ; } } ; list < callable < ? > > all tasks = new array list < > ( ) ; all tasks add ( complete successfully runnable ) ; all tasks add ( complete exceptionally runnable ) ; all tasks add ( cancel runnable ) ; all tasks add ( set future complete successfully runnable ) ; all tasks add ( set future complete exceptionally runnable ) ; all tasks add ( set future cancel runnable ) ; for ( int k = 0 ; k < 50 ; k + + ) { / / for each listener we add a task that submits it to the executor directly for the blocking / / get usecase and another task that adds it as a listener to the future to exercise both / / racing add listener calls and add listener calls completing after the future completes final runnable listener = k % 2 = = 0 ? collect results runnable : collect results timed get runnable ; all tasks add ( executors callable ( listener ) ) ; all tasks add ( new callable < void > ( ) { @ override public void call ( ) throws exception { current future get ( ) add listener ( listener , executor ) ; return null ; } } ) ; } assert equals ( all tasks size ( ) + 1 , barrier get parties ( ) ) ; for ( int i = 0 ; i < 1000 ; i + + ) { collections shuffle ( all tasks ) ; final abstract future < string > future = new abstract future < string > ( ) { } ; current future set ( future ) ; for ( callable < ? > task : all tasks ) { @ suppress warnings ( " unused " ) / / https : / / errorprone info / bugpattern / future return value ignored future < ? > possibly ignored error = executor submit ( task ) ; } await unchecked ( barrier ) ; assert that ( future is done ( ) ) is true ( ) ; / / inspect state and ensure it is correct ! / / asserts that all get calling threads received the same value object result = iterables get only element ( final results ) ; if ( result = = cancellation exception class ) { assert true ( future is cancelled ( ) ) ; if ( future was interrupted ( ) ) { / / we were cancelled , it is possible that set future could have succeeded too assert that ( num successful set calls get ( ) ) is in ( range closed ( 1 , 2 ) ) ; } else { assert that ( num successful set calls get ( ) ) is equal to ( 1 ) ; } } else { assert that ( num successful set calls get ( ) ) is equal to ( 1 ) ; } / / reset for next iteration num successful set calls set ( 0 ) ; final results clear ( ) ; } executor shutdown ( ) ; }


callback for { @ link job graph } instances removed by a different { @ link job graph store } instance

void on removed job graph ( job i d job id ) ;


public static void close ( final collection < master trigger restore hook < ? > > hooks , final logger log ) { for ( master trigger restore hook < ? > hook : hooks ) { try { hook close ( ) ; } catch ( throwable t ) { log warn ( " failed to cleanly close a checkpoint master hook ( " + hook get identifier ( ) + " ) " , t ) ; } } }


called when a drm error occurs these errors are just for informational purposes and the player may recover

default void on drm session manager error ( event time event time , exception error ) { }


any comment associated with the value < code > optional string comment = 2 ; < code >

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


returns a new , empty builder for { @ link immutable int array } instances , with a default initial capacity the returned builder is not thread - safe < b > performance note : < b > the { @ link immutable int array } that is built will very likely occupy more memory than necessary ; to trim memory usage , build using { @ code builder build ( ) trimmed ( ) }

public static builder builder ( ) { return new builder ( 10 ) ; }


invalidates the current foreground notification and causes { @ link # get foreground notification ( list ) } to be invoked again if the service isn ' t stopped

protected final void invalidate foreground notification ( ) { if ( foreground notification updater ! = null & & ! is destroyed ) { foreground notification updater invalidate ( ) ; } }


public static list < string > get source paths ( context context ) throws package manager name not found exception , i o exception { application info application info = context get package manager ( ) get application info ( context get package name ( ) , 0 ) ; file source apk = new file ( application info source dir ) ; list < string > source paths = new array list < > ( ) ; source paths add ( application info source dir ) ; / / add the default apk path / / the prefix of extracted file , ie : test classes string extracted file prefix = source apk get name ( ) + extracted name ext ; / / ， classesx ， / / ， ， if ( ! is v m multidex capable ( ) ) { / / the total dex numbers int total dex number = get multi dex preferences ( context ) get int ( key dex number , 1 ) ; file dex dir = new file ( application info data dir , secondary folder name ) ; for ( int secondary number = 2 ; secondary number < = total dex number ; secondary number + + ) { / / for each dex file , ie : test classes 2 zip , test classes 3 zip string file name = extracted file prefix + secondary number + extracted suffix ; file extracted file = new file ( dex dir , file name ) ; if ( extracted file is file ( ) ) { source paths add ( extracted file get absolute path ( ) ) ; / / we ignore the verify zip part } else { throw new i o exception ( " missing extracted secondary dex file ' " + extracted file get path ( ) + " ' " ) ; } } } if ( a router debuggable ( ) ) { / / search instant run support only debuggable source paths add all ( try load instant run dex file ( application info ) ) ; } return source paths ; }


returns a list of files that are referenced in the protobuf representation returned by { @ link # as stream proto ( build event context ) } this method is different from { @ code event reporting artifacts # reported artifacts ( ) } in that it only returns files directly referenced in the protobuf returned by { @ link # as stream proto ( build event context ) } note the consistency requirement - you must not attempt to pass path objects to the { @ link path converter } unless you have returned a corresponding { @ link local file } object here

default collection < local file > referenced local files ( ) { return immutable list of ( ) ; }


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


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


returns an unspecified hash code for the contents of this immutable array

public int hash code ( ) { int hash = 1 ; for ( int i = start ; i < end ; i + + ) { hash * = 31 ; hash + = ints hash code ( array [ i ] ) ; } return hash ; }


sets whether or not the script editor feature is enabled

public static void set script editor enabled ( boolean enabled ) { i preference store prefs = activator get default ( ) get preference store ( ) ; prefs set value ( ghidra script editor enabled , enabled ) ; }


collects all log file metadata based on the complex query defined in { @ code user logs request }

public list < container log meta > collect ( log aggregation file controller file controller ) throws i o exception { list < container log meta > containers log meta = new array list < > ( ) ; remote iterator < file status > app dirs = file controller get application directories of user ( logs request get user ( ) ) ; while ( app dirs has next ( ) ) { file status current app dir = app dirs next ( ) ; if ( logs request get app id ( ) = = null | | logs request get app id ( ) equals ( current app dir get path ( ) get name ( ) ) ) { application id app id = application id from string ( current app dir get path ( ) get name ( ) ) ; remote iterator < file status > node files = file controller get node files of application directory ( current app dir ) ; while ( node files has next ( ) ) { file status current node file = node files next ( ) ; if ( ! logs request get node id ( ) match ( current node file get path ( ) get name ( ) ) ) { continue ; } if ( current node file get path ( ) get name ( ) equals ( logs request get app id ( ) + " har " ) ) { path p = new path ( " har : / / / " + current node file get path ( ) to uri ( ) get raw path ( ) ) ; node files = har fs get ( p to uri ( ) , conf ) list status iterator ( p ) ; continue ; } try { map < string , list < container log file info > > meta files = file controller get log meta files of node ( logs request , current node file , app id ) ; if ( meta files = = null ) { continue ; } meta files entry set ( ) remove if ( entry - > ! ( logs request get container id ( ) = = null | | logs request get container id ( ) equals ( entry get key ( ) ) ) ) ; containers log meta add all ( create container log metas ( current node file get path ( ) get name ( ) , meta files ) ) ; } catch ( i o exception ioe ) { log warn ( " can not get log meta from the log file : " + current node file get path ( ) + " \ n " + ioe get message ( ) ) ; } } } } return containers log meta ; }


public int get quiet period ( ) { return quiet period ! = null ? quiet period : 5 ; }


always returns the specified target class , or { @ code null } if none

public class < ? > get target class ( ) { return this target class ; }


public big integer get size ( ) { return size ; }


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


invokes { @ code future } { @ link future # get ( ) get ( ) } uninterruptibly similar methods : to retrieve a result from a { @ code future } that is already done , use { @ link futures # get done futures get done } to treat { @ link interrupted exception } uniformly with other exceptions , use { @ link futures # get checked ( future , class ) futures get checked } to get uninterruptibility and remove checked exceptions , use { @ link futures # get unchecked }

public static < v > v get uninterruptibly ( future < v > future ) throws execution exception { boolean interrupted = false ; try { while ( true ) { try { return future get ( ) ; } catch ( interrupted exception e ) { interrupted = true ; } } } finally { if ( interrupted ) { thread current thread ( ) interrupt ( ) ; } } }


get the value of the home dir conf value for specified mount table

public static string get home dir value ( final configuration conf , final string mount table name ) { return conf get ( get config view fs prefix ( mount table name ) + " " + constants config viewfs homedir ) ; }


determines the addresses within the two programs where bytes differ if a byte difference is found , the entire code unit is added to the address set this also indicates addresses in program 1 that are not in program 2 as well as program 2 addresses that are compatible with program 1 but not in program 1 memory

private address set get byte differences ( address set view addrs , task monitor monitor ) throws cancelled exception { address set differences = new address set ( ) ; differences add ( get non common address set ( addrs ) ) ; differences add ( get initialization differs address set ( addrs ) ) ; / / check each address range from the address set for differences address set in common = get addresses in common ( ) ; if ( addrs ! = null ) { in common = in common intersect ( addrs ) ; } monitor initialize ( in common get num addresses ( ) ) ; address range iterator iter = in common get address ranges ( ) ; while ( iter has next ( ) ) { address range range = iter next ( ) ; try { compare bytes ( range , differences , monitor ) ; } catch ( memory access exception e ) { / / do nothing shouldn ' t happen both should have bytes } check cancelled ( monitor ) ; } check cancelled ( monitor ) ; return differences ; }


test the property ' prefix namespace wrapped array '

public void prefix namespace wrapped array test ( ) { / / todo : test prefix namespace wrapped array }


public synchronized void close ( ) throws i o exception { cluster close ( ) ; }


returns a unicode string of < code > length < code > bytes starting at < code > index < code > this method does not care about null - terminators

public string read unicode string ( long index , int length ) throws i o exception { string buffer buffer = new string buffer ( ) ; char c = 0 ; for ( int i = 0 ; i < length * 2 ; i + = 2 ) { c = ( char ) ( ( provider read byte ( index + + ) & 0xff ) ) ; c + = ( char ) ( ( provider read byte ( index + + ) & 0xff ) < < 8 ) ; buffer append ( c ) ; } return buffer to string ( ) trim ( ) ; }


public optional < duration > get wall execution time ( ) { return wall execution time ; }