encode vowel - encoding cases where " - le - " is pronounced " - el - "

boolean encode vowel le transposition ( int save current ) { / / transposition of vowel sound and l occurs in many words , / / e g " bristle " , " dazzle " , " goggle " = > kakal if ( m encode vowels & & ( save current > 1 ) & & ! is vowel ( save current - 1 ) & & ( char at ( save current + 1 ) = = ' e ' ) & & ( char at ( save current - 1 ) ! = ' l ' ) & & ( char at ( save current - 1 ) ! = ' r ' ) / / lots of exceptions to this : & & ! is vowel ( save current + 2 ) & & ! string at ( 0 , 7 , " ecclesi " , " complec " , " complej " , " robledo " , " " ) & & ! string at ( 0 , 5 , " mccle " , " mclel " , " " ) & & ! string at ( 0 , 6 , " emblem " , " kadlec " , " " ) & & ! ( ( ( save current + 2 ) = = m last ) & & string at ( save current , 3 , " let " , " " ) ) & & ! string at ( save current , 7 , " letting " , " " ) & & ! string at ( save current , 6 , " letely " , " letter " , " letion " , " letian " , " leting " , " letory " , " " ) & & ! string at ( save current , 5 , " letus " , " letiv " , " " ) & & ! string at ( save current , 4 , " less " , " lesq " , " lect " , " ledg " , " lete " , " leth " , " lets " , " lett " , " " ) & & ! string at ( save current , 3 , " leg " , " ler " , " lex " , " " ) / / e g " complement " ! = > kampalment & & ! ( string at ( save current , 6 , " lement " , " " ) & & ! ( string at ( ( m current - 5 ) , 6 , " battle " , " tangle " , " puzzle " , " rabble " , " babble " , " " ) | | string at ( ( m current - 4 ) , 5 , " table " , " " ) ) ) & & ! ( ( ( save current + 2 ) = = m last ) & & string at ( ( save current - 2 ) , 5 , " ocles " , " acles " , " akles " , " " ) ) & & ! string at ( ( save current - 3 ) , 5 , " lisle " , " aisle " , " " ) & & ! string at ( 0 , 4 , " isle " , " " ) & & ! string at ( 0 , 6 , " robles " , " " ) & & ! string at ( ( save current - 4 ) , 7 , " problem " , " resplen " , " " ) & & ! string at ( ( save current - 3 ) , 6 , " replen " , " " ) & & ! string at ( ( save current - 2 ) , 4 , " sple " , " " ) & & ( char at ( save current - 1 ) ! = ' h ' ) & & ( char at ( save current - 1 ) ! = ' w ' ) ) { metaph add ( " al " ) ; flag al inversion = true ; / / eat redundant ' l ' if ( char at ( save current + 2 ) = = ' l ' ) { m current = save current + 3 ; } return true ; } return false ; }


visit a terminal node , and return a user - defined result of the operation

t visit terminal ( terminal node node ) ;


set the extension value for the plug - in , set special dependency entry

public atlas extension create extendsion ( ) { this atlas extension = atlas build context s builder adapter extension factory create extendsion ( project , instantiator ) ; return atlas extension ; } / / public void hook atlas dependency manager ( ) { / / / / try { / / this app plugin hook replace task manager ( ) ; / / } catch ( exception e ) { / / throw new gradle exception ( e get message ( ) , e ) ; / / } / / }


void on track selection changed ( boolean is disabled , list < selection override > overrides ) ;


asserts that the subtitle ' s cues ( which are all part of the event at t = 0 ) are equal to the expected cues

private void assert mp 4 webvtt subtitle equals ( subtitle subtitle , cue expected cues ) { assert that ( subtitle get event time count ( ) ) is equal to ( 1 ) ; assert that ( subtitle get event time ( 0 ) ) is equal to ( 0 ) ; list < cue > subtitle cues = subtitle get cues ( 0 ) ; assert that ( subtitle cues ) has size ( expected cues length ) ; for ( int i = 0 ; i < subtitle cues size ( ) ; i + + ) { assert cues equal ( expected cues [ i ] , subtitle cues get ( i ) ) ; } }


the set of arityplural mappings < code > repeated aapt pb plural entry entry = 1 ; < code >

public java util list < com android aapt resources plural entry > get entry list ( ) { return java util collections unmodifiable list ( instance get entry list ( ) ) ; }


adds { @ code element } to the { @ code immutable list }

public builder < e > add ( e element ) { check not null ( element ) ; get ready to expand to ( size + 1 ) ; contents [ size + + ] = element ; return this ; }


complete in - progress write to the given file

boolean complete file ( final string src , string holder , extended block last , long file id ) throws i o exception { boolean success = false ; check operation ( operation category write ) ; final f s permission checker pc = get permission checker ( ) ; f s permission checker set operation type ( null ) ; write lock ( ) ; try { check operation ( operation category write ) ; check name node safe mode ( " cannot complete file " + src ) ; success = f s dir write file op complete file ( this , pc , src , holder , last , file id ) ; } finally { write unlock ( " complete file " ) ; } get edit log ( ) log sync ( ) ; if ( success ) { name node state change log info ( " dir * complete file : " + src + " is closed by " + holder ) ; } return success ; }


print indentation for the current level @ exception org xml sax s a x exception if there is an error writing the indentation characters , or if a filter further down the chain raises an exception

private void do indent ( ) throws x m l stream exception { if ( depth > 0 ) { for ( int i = 0 ; i < depth ; i + + ) super write characters ( indent step ) ; } }


indicates whether the parser supports unknown fields or not in case it does , such behaviour will be tested by inserting random fields before parsing and checking that they don ' t make parsing fail

protected boolean supports unknown fields ( ) { return false ; }


set the response as an error response plus some data

public static http response error j s o n ( @ non null string message , @ non null map < ? , ? > data ) { return new j s o n object response ( data ) error ( message ) ; }


creates a fresh entry with the specified object at the specified position in the entry arrays

void insert entry ( int entry index , @ nullable decl k key , @ nullable decl v value , int hash , int mask ) { this entries [ entry index ] = compact hashing mask combine ( hash , unset , mask ) ; this keys [ entry index ] = key ; this values [ entry index ] = value ; }


public void unary rpc ( io grpc testing protobuf simple request request , io grpc stub stream observer < io grpc testing protobuf simple response > response observer ) { io grpc stub client calls async unary call ( get channel ( ) new call ( get unary rpc method ( ) , get call options ( ) ) , request , response observer ) ; }


public void add ( int value ) { indexer put ( value ) ; }


creates new { @ link completion result }

static completion result wrap ( completion result completion result , lookup element lookup ) { return completion result wrap ( lookup , completion result get prefix matcher ( ) , completion result get sorter ( ) ) ; }


optional < committer < comm t > > create committer ( ) throws i o exception ;


called when a unit of work is about to be scheduled

runnable decorate runnable ( runnable runnable , string tag ) ;


public color set ( float r , float g , float b , float a ) { this r = r ; this g = g ; this b = b ; this a = a ; return clamp ( ) ; }


public int get num failed cleanups ( ) { return num failed cleanups ; }


generate a unique name to be used as the default when a module or fragment is created

string get new folder name ( ) { return get new name ( " new folder " ) ; }


returns suffix of cipher suite configuration

public string get config suffix ( ) { string [ ] parts = name split ( " / " ) ; string builder suffix = new string builder ( ) ; for ( string part : parts ) { suffix append ( " " ) append ( string utils to lower case ( part ) ) ; } return suffix to string ( ) ; }


returns the resize type or null if this is an ordinary create index request

public resize type resize type ( ) { return resize type ; }


adds additional execution platform constraints that apply for all targets from this rule please note that this value is inherited by child rules

public builder add execution platform constraints ( iterable < label > constraints ) { iterables add all ( this execution platform constraints , constraints ) ; return this ; }


shift , i e , increase the offset of , this pattern block

public assembly pattern block shift ( int amt ) { if ( amt = = 0 ) { return this ; } return new assembly pattern block ( this offset + amt , mask , vals ) ; }


public float get max force ( ) { return joint get max force ( ) ; }


returns a string representation of this multiset entry the string representation consists of the associated element if the associated count is one , and otherwise the associated element followed by the characters " x " ( space , x and space ) followed by the count elements and counts are converted to strings as by { @ code string value of }

public string to string ( ) { string text = string value of ( get element ( ) ) ; int n = get count ( ) ; return ( n = = 1 ) ? text : ( text + " x " + n ) ; }


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


{ @ inherit doc } the default implementation does nothing

@ override public void enter string query ( sql base parser string query context ctx ) { }


stop the executor if it is not null this uses { @ link executor service # shutdown now ( ) } and so does not block until they have completed

protected synchronized void stop executor ( ) { if ( executor ! = null ) { executor shutdown now ( ) ; } }


creates a resource manager id that corresponds to the given uuid

public static resource manager id from uuid ( uuid uuid ) { return new resource manager id ( uuid ) ; }


visit a parse tree produced by { @ link sql base parser # single statement }

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


construct a { @ code serialized } instance with the provided key { @ link serde } if the { @ link serde } params are null the default serdes defined in the configs will be used

public serialized < k , v > with key serde ( final serde < k > key serde ) { return new serialized < > ( key serde , null ) ; }


the first character position this span applies to , in utf - 16 offset < code > optional uint 3 2 first char = 2 ; < code >


returns true if there is at least one of the provided domain files can be or is version controlled

public boolean is add to popup ( domain file context context ) { if ( ! context is in active project ( ) ) { return false ; } check repository ( ) ; list < domain file > domain files = context get selected files ( ) ; for ( domain file domain file : domain files ) { if ( domain file get version ( ) > 0 ) { return true ; / / has at least one domain file that can be or is version controlled } } return false ; }


get the package id for the manifest file

public static string get application id ( file manifest file ) { s a x reader reader = new s a x reader ( ) ; if ( manifest file exists ( ) ) { document document = null ; / / read the xml file try { document = reader read ( manifest file ) ; element root = document get root element ( ) ; / / get the root node string package name = root attribute value ( " package " ) ; return package name ; } catch ( document exception e ) { e print stack trace ( ) ; } } return null ; } / / / /


public void test nested commit ( ) throws throwable { transactional template template = new transactional template ( ) ; template execute ( new abstract transactional executor ( ) { @ override public object execute ( ) throws throwable { transactional template template = new transactional template ( ) ; template execute ( new abstract transactional executor ( ) { @ override public object execute ( ) throws throwable { transactional template template = new transactional template ( ) ; template execute ( new abstract transactional executor ( ) { @ override public object execute ( ) throws throwable { return null ; } } ) ; return null ; } } ) ; return null ; } } ) ; }


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


called when the processor is flushed , directly or as part of resetting

protected void on flush ( ) { / / do nothing }


returns whether the end of the configuration has been reached

private boolean configuration end ( boolean expecting at character ) { return next word = = null | | next word starts with ( configuration constants option prefix ) | | ( ! expecting at character & & next word equals ( configuration constants at directive ) ) ; }


update property for array ( list ) container

protected void update property for array ( codegen property property , codegen property inner property ) { if ( inner property = = null ) { logger warn ( " skipping invalid array property " + json pretty ( property ) ) ; return ; } property data format = inner property data format ; if ( ! language specific primitives contains ( inner property base type ) ) { property complex type = inner property base type ; } else { property is primitive type = true ; } property items = inner property ; / / inner item is enum if ( is property inner most enum ( property ) ) { / / we use the data type instead of the enum class / / at the moment is not supported / / is enum is set to true when the type is an enum / / or the inner type of an array / map is an enum / / property is enum = true ; / / update datatype with enum and default value for array / / e g list < string > = > list < status enum > / / update data type with enum for array ( property ) ; / / set allowable values to enum values ( including array / map of enum ) / / property allowable values = get inner enum allowable values ( property ) ; } }


applies an aggregation that that gives the maximum element of the pojo data stream by the given field expression for every window a field expression is either the name of a public field or a getter method with parentheses of the { @ link data stream } s underlying type a dot can be used to drill down into objects , as in { @ code " field 1 get inner field 2 ( ) " }

public single output stream operator < t > max by ( string field , boolean first ) { return aggregate ( new comparable aggregator < > ( field , input get type ( ) , aggregation function aggregation type maxby , first , input get execution config ( ) ) ) ; }


order by process definition id ( needs to be followed by { @ link # asc ( ) } or { @ link # desc ( ) } )

historic activity instance query order by process definition id ( ) ;


create a new admin with the given configuration

public static admin client create ( properties props ) { return ( admin client ) admin create ( props ) ; }


returns pet inventories by status returns a map of status codes to quantities

public void get inventory test ( ) { / / todo : test validations / / map < string , integer > response = api get inventory ( ) ; / / assert not null ( response ) ; }


the position of the filter in the chain execution is done from lowest order to highest


checks that the statistics agreement popup has been displayed

private static boolean is agreement shown ( ) { return properties component get instance ( ) is value set ( m t statistics notification show statistics agreement ) ; }


changes one of the insn ' s sources new source should be of same type and category

public final void change one source ( int index , register spec new spec ) { register spec list orig sources = insn get sources ( ) ; int sz = orig sources size ( ) ; register spec list new sources = new register spec list ( sz ) ; for ( int i = 0 ; i < sz ; i + + ) { new sources set ( i , i = = index ? new spec : orig sources get ( i ) ) ; } new sources set immutable ( ) ; register spec orig spec = orig sources get ( index ) ; if ( orig spec get reg ( ) ! = new spec get reg ( ) ) { / * * if the register remains unchanged , we ' re only changing * the type or local var name so don ' t update use list * / get block ( ) get parent ( ) on source changed ( this , orig spec , new spec ) ; } insn = insn with new registers ( get result ( ) , new sources ) ; }


returns the minimal range which { @ linkplain range # encloses ( range ) encloses } all ranges in this range set


set the default destroy - method setting for the document that ' s currently parsed

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


public boolean is array ( ) { return get type ( ) is array ( ) ; }


this implementation searches for a unique { @ link org springframework core task task executor } bean in the context , or for an { @ link executor } bean named " task executor " otherwise if neither of the two is resolvable ( e g if no { @ code bean factory } was configured at all ) , this implementation falls back to a newly created { @ link simple async task executor } instance for local use if no default could be found

protected executor get default executor ( @ nullable bean factory bean factory ) { executor default executor = super get default executor ( bean factory ) ; return ( default executor ! = null ? default executor : new simple async task executor ( ) ) ; }


returns the { @ link event executor } which is used to execute an arbitrary task


this method is used when a reservation id is required attempt to use rest api if authentication is not enabled , ensure that the response status is unauthorized and generate a reservation id because downstream components require a reservation id for testing

private reservation id get reservation id test helper ( int fallback reservation id ) throws exception { thread sleep ( 1000 ) ; client response response = construct web resource ( get new reservation path ) type ( media type application json ) accept ( media type application json ) post ( client response class ) ; if ( ! this is authentication enabled ( ) ) { assert response status code ( status unauthorized , response get status info ( ) ) ; return reservation id new instance ( clock get time ( ) , fallback reservation id ) ; } system out println ( " response : " + response ) ; assert equals ( media type application json type + " ; " + jetty utils utf 8 , response get type ( ) to string ( ) ) ; j s o n object json = response get entity ( j s o n object class ) ; assert equals ( " incorrect number of elements " , 1 , json length ( ) ) ; reservation id rid = null ; try { rid = reservation id parse reservation id ( json get string ( " reservation - id " ) ) ; } catch ( j s o n exception j ) { / / failure is possible and is checked outside } return rid ; }


returns the first item in the heap this is the item with the lowest value ( or highest value if this heap is configured as a max heap )

public t peek ( ) { if ( size = = 0 ) throw new illegal state exception ( " the heap is empty " ) ; return ( t ) nodes [ 0 ] ; }


exchange the given request for a response mono

mono < client response > exchange ( client request request ) ;


parse a value , ref or collection sub - element of a property or constructor - arg element

public object parse property sub element ( element ele , @ nullable bean definition bd , @ nullable string default value type ) { if ( ! is default namespace ( ele ) ) { return parse nested custom element ( ele , bd ) ; } else if ( node name equals ( ele , bean element ) ) { bean definition holder nested bd = parse bean definition element ( ele , bd ) ; if ( nested bd ! = null ) { nested bd = decorate bean definition if required ( ele , nested bd , bd ) ; } return nested bd ; } else if ( node name equals ( ele , ref element ) ) { / / a generic reference to any name of any bean string ref name = ele get attribute ( bean ref attribute ) ; boolean to parent = false ; if ( ! string utils has length ( ref name ) ) { / / a reference to the id of another bean in a parent context ref name = ele get attribute ( parent ref attribute ) ; to parent = true ; if ( ! string utils has length ( ref name ) ) { error ( " ' bean ' or ' parent ' is required for < ref > element " , ele ) ; return null ; } } if ( ! string utils has text ( ref name ) ) { error ( " < ref > element contains empty target attribute " , ele ) ; return null ; } runtime bean reference ref = new runtime bean reference ( ref name , to parent ) ; ref set source ( extract source ( ele ) ) ; return ref ; } else if ( node name equals ( ele , idref element ) ) { return parse id ref element ( ele ) ; } else if ( node name equals ( ele , value element ) ) { return parse value element ( ele , default value type ) ; } else if ( node name equals ( ele , null element ) ) { / / it ' s a distinguished null value let ' s wrap it in a typed string value / / object in order to preserve the source location typed string value null holder = new typed string value ( null ) ; null holder set source ( extract source ( ele ) ) ; return null holder ; } else if ( node name equals ( ele , array element ) ) { return parse array element ( ele , bd ) ; } else if ( node name equals ( ele , list element ) ) { return parse list element ( ele , bd ) ; } else if ( node name equals ( ele , set element ) ) { return parse set element ( ele , bd ) ; } else if ( node name equals ( ele , map element ) ) { return parse map element ( ele , bd ) ; } else if ( node name equals ( ele , props element ) ) { return parse props element ( ele ) ; } else { error ( " unknown property sub - element : [ " + ele get node name ( ) + " ] " , ele ) ; return null ; } }


initializes debugging support , setting up any debugging - specific overrides , then opens the debug server socket and blocks waiting for an incoming connection

static starlark debug server create and wait for connection ( event handler event handler , server socket server socket , boolean verbose logging ) throws i o exception { debug server transport transport = debug server transport create and wait for client ( event handler , server socket , verbose logging ) ; return new starlark debug server ( event handler , transport , verbose logging ) ; }


fake endpoint to test group parameters ( optional ) fake endpoint to test group parameters ( optional )

public void test group parameters test ( ) { integer required string group = null ; boolean required boolean group = null ; long required int 6 4 group = null ; integer string group = null ; boolean boolean group = null ; long int 6 4 group = null ; / / api test group parameters ( required string group , required boolean group , required int 6 4 group , string group , boolean group , int 6 4 group ) ; / / todo : test validations }


whether the symbol can be merged into another resource table without there being an existing definition to override used for overlays and set to true when & lt ; add - resource & gt ; is specified < code > optional bool allow new = 4 ; < code >

private void clear allow new ( ) { bit field 0 = ( bit field 0 & ~ 0x 0 0 0 0 0 0 0 8 ) ; allow new = false ; }


returns whether this node is marked as deleted

public boolean is cut ( ) { return is cut ; }


runs { @ link # test method } on every instance method of the class of { @ code instance } with at least { @ code minimal visibility } , including those inherited from superclasses of the same package

public void test instance methods ( object instance , visibility minimal visibility ) { for ( method method : get instance methods to test ( instance get class ( ) , minimal visibility ) ) { test method ( instance , method ) ; } }


create a config validating only structure , not exact analyzertokenizerfilter names

public categorization analyzer config build ( ) { if ( analyzer = = null & & tokenizer = = null ) { throw new illegal argument exception ( categorization analyzer + " that is not a global analyzer must specify a [ " + tokenizer + " ] field " ) ; } if ( analyzer ! = null & & char filters is empty ( ) = = false ) { throw new illegal argument exception ( categorization analyzer + " that is a global analyzer cannot also specify a [ " + char filters + " ] field " ) ; } if ( analyzer ! = null & & tokenizer ! = null ) { throw new illegal argument exception ( categorization analyzer + " that is a global analyzer cannot also specify a [ " + tokenizer + " ] field " ) ; } if ( analyzer ! = null & & token filters is empty ( ) = = false ) { throw new illegal argument exception ( categorization analyzer + " that is a global analyzer cannot also specify a [ " + token filters + " ] field " ) ; } return new categorization analyzer config ( analyzer , char filters , tokenizer , token filters ) ; }


can be used to skip intermediate keys on the cycle itself

protected boolean should skip intermediate key on cycle ( sky key key ) { return false ; }


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


public void configure ( ) throws exception { / / main route from ( " { { entry } } " ) wire tap ( " direct : wire tap " ) to ( " { { endpoint } } " ) ; / / wire tap route from ( " direct : wire tap " ) log ( " message : $ { body } " ) to ( " { { wire tap endpoint } } " ) ; }


public eclipse connection get connection ( ) { return connection ; }


get the amount of data ; if there is no buffer then the size is 0

int data size ( ) { return data size ! = null ? data size : buffer capacity used ( ) ; }


creates a graph from csv input without vertex values or edge values

public < k > graph < k , null value , null value > key type ( class < k > vertex key ) { if ( edge reader = = null ) { throw new runtime exception ( " the edge input file cannot be null ! " ) ; } data set < edge < k , null value > > edges = edge reader types ( vertex key , vertex key ) name ( graph csv reader class get name ( ) ) map ( new tuple 2 to edge map < > ( ) ) name ( " type conversion " ) ; return graph from data set ( edges , execution context ) ; }


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


public static < t > stream recorder < t > create ( ) { return new stream recorder < > ( ) ; }


specify the phase in which this endpoint manager should be started and stopped the startup order proceeds from lowest to highest , and the shutdown order is the reverse of that by default this value is integer max value meaning that this endpoint manager starts as late as possible and stops as soon as possible

public void set phase ( int phase ) { this phase = phase ; }


apply different functions to known and unknown { @ link shuffle descriptor } s also casts known { @ link shuffle descriptor }

public static < t , sd extends shuffle descriptor > t apply with shuffle type check ( class < sd > shuffle descriptor class , shuffle descriptor shuffle descriptor , function < unknown shuffle descriptor , t > function of unknown descriptor , function < sd , t > function of known descriptor ) { if ( shuffle descriptor is unknown ( ) ) { return function of unknown descriptor apply ( ( unknown shuffle descriptor ) shuffle descriptor ) ; } else if ( shuffle descriptor class equals ( shuffle descriptor get class ( ) ) ) { return function of known descriptor apply ( ( sd ) shuffle descriptor ) ; } else { throw new illegal argument exception ( string format ( " unsupported shuffle descriptor type < % s > , only < % s > is supported " , shuffle descriptor get class ( ) get name ( ) , shuffle descriptor class get name ( ) ) ) ; } }


public static void drop table ( database db , boolean if exists ) { string sql = " drop table " + ( if exists ? " if exists " : " " ) + " \ " an active entity \ " " ; db exec s q l ( sql ) ; }


test that a function raising an ioe can be wrapped

public void test duration function i o e ( ) throws throwable { function raising i o e < integer , integer > fn = track function duration ( stats , requests , ( integer x ) - > invocation counter get and set ( x ) ) ; assert that ( fn apply ( 1 ) ) is equal to ( 0 ) ; assert counter value ( 1 ) ; assert summary values ( fetch success summary ( stats , requests ) , 1 , 0 , 0 ) ; }


boolean encode mr and mrs ( ) { if ( ( m current = = 0 ) & & string at ( m current , 2 , " mr " , " " ) ) { / / exceptions for " mr " and " mrs " if ( ( m length = = 2 ) & & string at ( m current , 2 , " mr " , " " ) ) { if ( m encode vowels ) { metaph add ( " mastar " ) ; } else { metaph add ( " mstr " ) ; } m current + = 2 ; return true ; } else if ( ( m length = = 3 ) & & string at ( m current , 3 , " mrs " , " " ) ) { if ( m encode vowels ) { metaph add ( " masas " ) ; } else { metaph add ( " mss " ) ; } m current + = 3 ; return true ; } } return false ; }


public static int get applicable node count for a m ( r m context rm context , configuration conf , list < resource request > am reqs ) { / / determine the list of nodes that are eligible based on the strict / / resource requests set < node id > nodes for reqs = new hash set < > ( ) ; for ( resource request am req : am reqs ) { if ( am req get relax locality ( ) & & ! am req get resource name ( ) equals ( resource request any ) ) { nodes for reqs add all ( rm context get scheduler ( ) get node ids ( am req get resource name ( ) ) ) ; } } if ( yarn configuration are node labels enabled ( conf ) ) { / / determine the list of nodes that are eligible based on the node label string am node label expression = am reqs get ( 0 ) get node label expression ( ) ; set < node id > nodes for labels = get node ids for label ( rm context , am node label expression ) ; if ( nodes for labels ! = null & & ! nodes for labels is empty ( ) ) { / / if only node labels , strip out any wildcard node ids and return if ( nodes for reqs is empty ( ) ) { for ( iterator < node id > it = nodes for labels iterator ( ) ; it has next ( ) ; ) { if ( it next ( ) get port ( ) = = 0 ) { it remove ( ) ; } } return nodes for labels size ( ) ; } else { / / the node ids common to both the strict resource requests and the / / node label is the eligible set return sets intersection ( nodes for reqs , nodes for labels ) size ( ) ; } } } / / if no strict resource request node ids nor node label node ids , then just / / return the entire cluster if ( nodes for reqs is empty ( ) ) { return rm context get scheduler ( ) get num cluster nodes ( ) ; } / / no node label node ids , so return the strict resource request node ids return nodes for reqs size ( ) ; }


invoke { @ link test context manager # before test execution ( object , method ) } and then evaluate the next { @ link statement } in the execution chain ( typically an instance of { @ link org junit internal runners statements invoke method invoke method } )

public void evaluate ( ) throws throwable { this test context manager before test execution ( this test instance , this test method ) ; this next evaluate ( ) ; }


protected static secret key create secret key ( byte [ ] key ) { return new secret key spec ( key , default hmac algorithm ) ; }


set a custom rmi server socket factory to use for exporting the service only needs to be specified when the client socket factory does not implement { @ code java rmi server r m i server socket factory } already

public void set server socket factory ( r m i server socket factory server socket factory ) { this server socket factory = server socket factory ; }


public vector 3 scl ( float vx , float vy , float vz ) { return this set ( this x * vx , this y * vy , this z * vz ) ; }


public boolean is done ( ) { return false ; }


return the current write counter of this { @ link channel flush promise notifier }

public long write counter ( ) { return write counter ; }


expires entries in the access - order queue

void expire after access entries ( long now ) { if ( ! expires after access ( ) ) { return ; } expire after access entries ( access order window deque ( ) , now ) ; if ( evicts ( ) ) { expire after access entries ( access order probation deque ( ) , now ) ; expire after access entries ( access order protected deque ( ) , now ) ; } }


the supplied multimap will be mutated and an unmodifiable instance used in its stead if the multimap does not support null keys or values , alternatives may be specified for tests involving nulls

private static void check unmodifiable multimap ( multimap < string , integer > multimap , boolean permits duplicates , @ nullable decl string null key , @ nullable decl integer null value ) { multimap < string , integer > unmodifiable = prepare unmodifiable tests ( multimap , permits duplicates , null key , null value ) ; unmodifiable collection tests assert multimap is unmodifiable ( unmodifiable , " test " , 123 ) ; assert unmodifiable iterable in tandem ( unmodifiable keys ( ) , multimap keys ( ) ) ; assert unmodifiable iterable in tandem ( unmodifiable key set ( ) , multimap key set ( ) ) ; assert unmodifiable iterable in tandem ( unmodifiable entries ( ) , multimap entries ( ) ) ; assert unmodifiable iterable in tandem ( unmodifiable as map ( ) entry set ( ) , multimap as map ( ) entry set ( ) ) ; assert equals ( multimap to string ( ) , unmodifiable to string ( ) ) ; assert equals ( multimap hash code ( ) , unmodifiable hash code ( ) ) ; assert equals ( multimap , unmodifiable ) ; assert that ( unmodifiable as map ( ) get ( " bar " ) ) contains exactly ( 5 , - 1 ) ; assert null ( unmodifiable as map ( ) get ( " missing " ) ) ; assert false ( unmodifiable entries ( ) instanceof serializable ) ; }


returns true if the array has one or more items

public boolean not empty ( ) { return size > 0 ; }


create test data in my s q l table name : test data

public void generate my s q l test data ( int sample size , int batch size ) throws database service exception , s q l exception { mnc map = new hash map < integer , integer > ( ) ; mcc map = new hash map < integer , integer > ( ) ; mcc map put ( 0 , 302 ) ; mcc map put ( 1 , 311 ) ; mcc map put ( 2 , 730 ) ; mcc map put ( 1 , 622 ) ; mnc map put ( 0 , 006 ) ; mnc map put ( 1 , 140 ) ; mnc map put ( 2 , 380 ) ; mnc map put ( 3 , 710 ) ; database configuration dc = new database configuration ( ) ; dc set database host ( default mysql host ) ; dc set database name ( default mysql db name ) ; dc set database password ( default mysql password ) ; dc set database port ( default mysql port ) ; dc set database type ( mysql db name ) ; dc set database user ( default mysql user ) ; dc set use s s l ( false ) ; string truncate table s q l = " truncate test data " ; string insert table s q l = " insert into test data ( " + " id , ue id , start time , end date , bytes upload , bytes download , cell id , mcc , mnc , lac , imei ) " + " values ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? ) ; " ; connection conn = database service get ( mysql db name ) get connection ( dc ) ; statement truncate stmt = conn create statement ( ) ; int result = truncate stmt execute update ( truncate table s q l ) ; system out println ( " truncate table result : : " + result ) ; truncate stmt close ( ) ; conn set auto commit ( false ) ; prepared statement stmt = conn prepare statement ( insert table s q l ) ; int counter = 1 ; for ( int i = 0 ; i < sample size ; i + + ) { stmt set long ( 1 , i ) ; stmt set string ( 2 , get next ue id ( ) ) ; stmt set date ( 3 , get next start date ( ) ) ; stmt set date ( 4 , get next end date ( ) ) ; stmt set int ( 5 , rand next int ( ) ) ; stmt set int ( 6 , rand next int ( ) ) ; stmt set int ( 7 , rand next int ( 10 ) ) ; stmt set int ( 8 , get m c c ( ) ) ; stmt set int ( 9 , get m n c ( ) ) ; stmt set int ( 10 , rand next int ( 100 ) ) ; stmt set string ( 11 , get next i m e i ( ) ) ; stmt add batch ( ) ; / / execute batch of 1000 records if ( i % batch size = = 0 ) { stmt execute batch ( ) ; conn commit ( ) ; system out println ( " batch " + ( counter + + ) + " executed successfully " ) ; } } / / execute final batch stmt execute batch ( ) ; system out println ( " final batch executed " + ( counter + + ) + " executed successfully " ) ; conn commit ( ) ; conn close ( ) ; }


fail is a static factory method builds failed result based on { @ link throwable }

public static result fail ( final throwable throwable ) { return new result ( false , true , throwable get message ( ) , sample family empty ) ; }


receive a message from this channel , blocking indefinitely if necessary


public static void main ( string [ ] args ) { if ( args length = = 0 ) { system out println ( version ) ; system out println ( " usage : java proguard pro guard [ options ] " ) ; system exit ( 1 ) ; } / / create the default options configuration configuration = new configuration ( ) ; try { / / parse the options specified in the command line arguments configuration parser parser = new configuration parser ( args , system get properties ( ) ) ; try { parser parse ( configuration ) ; } finally { parser close ( ) ; } / / execute pro guard with these options new pro guard ( configuration ) execute ( ) ; } catch ( exception ex ) { if ( configuration verbose ) { / / print a verbose stack trace ex print stack trace ( ) ; } else { / / print just the stack trace message system err println ( " error : " + ex get message ( ) ) ; } system exit ( 1 ) ; } system exit ( 0 ) ; }


not - null value ; ensure this value is available before it is saved to the database

public void set text ( @ not null string text ) { this text = text ; }


test the property ' namespace wrapped array '

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


protected void create redirect end state ( final flow flow ) { create end state ( flow , cas webflow constants state id redirect view , " request scope url " , true ) ; }


updates current aux services based on changes found in the manifest

protected synchronized void load manifest ( configuration conf , boolean start services ) throws i o exception { if ( ! manifest enabled ) { throw new i o exception ( " dynamic reloading is not enabled via " + yarn configuration nm aux services manifest enabled ) ; } if ( manifest = = null ) { return ; } if ( ! manifest f s exists ( manifest ) ) { if ( service map is empty ( ) ) { return ; } log info ( " manifest file " + manifest + " doesn ' t exist , stopping " + " auxiliary services " ) ; set < string > services to remove = new hash set < > ( service map key set ( ) ) ; for ( string s name : services to remove ) { maybe remove aux service ( s name ) ; } return ; } aux service records services = maybe read manifest file ( ) ; load services ( services , conf , start services ) ; }


public void run ( ) { final var executor service = executors new single thread scheduled executor ( ) ; executor service schedule at fixed rate ( new runnable ( ) { final world world = new world ( ) ; @ override public void run ( ) { var countries = world fetch ( ) ; logger info ( " our world currently has the following countries : - " ) ; countries stream ( ) map ( country - > " \ t " + country ) for each ( logger : : info ) ; } } , 0 , 15 , time unit seconds ) ; / / run at every 15 seconds }


set the content - length header applies to the send , message , and error frames

public void set content length ( long content length ) { set ( content length , long to string ( content length ) ) ; }


variant of { @ link # set accept language ( list ) } using { @ link locale } ' s

public void set accept language as locales ( list < locale > locales ) { set accept language ( locales stream ( ) map ( locale - > new locale language range ( locale to language tag ( ) ) ) collect ( collectors to list ( ) ) ) ; }


the sock j s protocol requires a server to respond to the initial " info " request from clients with a " cookie needed " boolean property that indicates whether the use of a jsessionid cookie is required for the application to function correctly , e g for load balancing or in java servlet containers for the use of an http session this is especially important for ie 8 , 9 that support x domain request - - a modified ajaxxhr - - that can do requests across domains but does not send any cookies in those cases , the sock j s client prefers the " iframe - htmlfile " transport over " xdr - streaming " in order to be able to send cookies the default value is " true " to maximize the chance for applications to work correctly in ie 8 , 9 with support for cookies ( and the jsessionid cookie in particular ) however , an application can choose to set this to " false " if the use of cookies ( and http session ) is not required

public sock js service registration set session cookie needed ( boolean session cookie needed ) { this session cookie needed = session cookie needed ; return this ; }


public boolean is empty ( ) { return size = = 0 ; }


public void set debug ( boolean debug ) { this debug = debug ; this buffer set debug ( debug ) ; }


tests that extra slots are kept by the { @ link slot pool impl }

public void test extra slots are kept ( ) throws exception { final completable future < allocation i d > allocation id future = new completable future < > ( ) ; testing resource manager gateway resource manager gateway = new testing resource manager gateway ( ) ; resource manager gateway set request slot consumer ( ( slot request slot request ) - > allocation id future complete ( slot request get allocation id ( ) ) ) ; try ( testing slot pool impl pool = new slot pool builder ( test main thread executor get main thread executor ( ) ) set resource manager gateway ( resource manager gateway ) build ( ) ) { final completable future < slot request id > slot request timeout future = new completable future < > ( ) ; pool set timeout pending slot request consumer ( slot request timeout future : : complete ) ; final completable future < physical slot > future = test main thread executor execute ( ( ) - > pool request new allocated slot ( new slot request id ( ) , resource profile unknown , fast timeout ) ) ; try { future get ( ) ; fail ( " we expected a timeout exception " ) ; } catch ( execution exception e ) { assert true ( exception utils strip execution exception ( e ) instanceof timeout exception ) ; } / / wait until we have timed out the slot request slot request timeout future get ( ) ; assert equals ( 0l , pool get number of pending requests ( ) ) ; allocation i d allocation id = allocation id future get ( ) ; final slot offer slot offer = new slot offer ( allocation id , 0 , resource profile any ) ; final task manager location task manager location = new local task manager location ( ) ; final task manager gateway task manager gateway = new simple acking task manager gateway ( ) ; test main thread executor execute ( ( ) - > pool register task manager ( task manager location get resource i d ( ) ) ) ; assert true ( test main thread executor execute ( ( ) - > pool offer slot ( task manager location , task manager gateway , slot offer ) ) ) ; assert true ( pool contains available slot ( allocation id ) ) ; } }


this procedure creates the preloader panel and returns a preloader callback to update it < br > you can override it to construct your own preloader animation you can adjust the progress bar colors to your needs by overriding { @ link # adjust meter panel ( panel , style ) } < br > example to use an own image ( width should be around 3 0 0px ) placed in webapp folder : public preloader callback get preloader callback ( ) { return create preloader panel ( gwt get host page base u r l ( ) + " logo preload png " ) ; }

public preloader callback get preloader callback ( ) { return create preloader panel ( gwt get module base u r l ( ) + " logo png " ) ; }


create a readable and parseable audit log string for a successful event

public static void log success ( string user , string operation , string target ) { if ( log is info enabled ( ) ) { log info ( create success log ( user , operation , target ) ) ; } }


not supported < b > you are attempting to create a set that may contain a non - { @ code comparable } element < b > proper calls will resolve to the version in { @ code immutable sorted set } , not this dummy version

public static < e > immutable sorted set < e > of ( e e 1 , e e 2 , e e 3 , e e 4 ) { throw new unsupported operation exception ( ) ; }


private put item outcome put item ( item item ) { log debug ( " putting item { } " , item ) ; return table put item ( item ) ; }


get total interval length of the sliding window

public double get interval in second ( ) { return interval in second ; }


set up a decompiler interface for recovering data - flow

private decomp interface set up decompiler ( ) { decomp interface decomplib = new decomp interface ( ) ; decompile options options ; options = new decompile options ( ) ; options service service = tool get service ( options service class ) ; if ( service ! = null ) { tool options opt = service get options ( " decompiler " ) ; options grab from tool and program ( null , opt , current program ) ; } decomplib set options ( options ) ; decomplib toggle c code ( true ) ; decomplib toggle syntax tree ( true ) ; decomplib set simplification style ( " decompile " ) ; return decomplib ; }


for a bunch of artifacts , gets the exec paths and accumulates them in a list

public static list < string > exec paths ( iterable < artifact > artifacts ) { return transform ( artifacts , artifact : : get exec path string ) ; }


tests that label parsing is greedy ( always extracting the longest possible label ) this means that if a label is a substring of another label , it should not be expanded but be treated as part of the longer one

public void test label is substring of valid label ( ) throws exception { setup dummy ( ) ; assert expansion ( " x 3 = foo / bar / x 3 " , " x 3 = bar / x 3 " , immutable map < label , iterable < artifact > > of ( label for ( " bar / x 3 " ) , immutable list of ( artifact for ( " bar / x 3 " ) ) ) ) ; assert expansion ( " foo / x 1 , foo / x 1 1 , foo / xx 1 , foo / xx 1 1 " , " x 1 , x 1 1 , xx 1 , xx 1 1 " , immutable map < label , iterable < artifact > > of ( label for ( " x 1 " ) , immutable list of ( artifact for ( " x 1 " ) ) , label for ( " x 1 1 " ) , immutable list of ( artifact for ( " x 1 1 " ) ) , label for ( " xx 1 " ) , immutable list of ( artifact for ( " xx 1 " ) ) , label for ( " xx 1 1 " ) , immutable list of ( artifact for ( " xx 1 1 " ) ) ) ) ; assert expansion ( " / / x 1 " , " / / x 1 " , immutable map < label , iterable < artifact > > of ( label for ( " x 1 " ) , immutable list of ( artifact for ( " x 1 " ) ) ) ) ; }


list of writers that are associated with this output collector

public list < record writer < serialization delegate < t > > > get writers ( ) { return collections unmodifiable list ( arrays as list ( this writers ) ) ; }


returns the inverted mat 2 2 - does not invert the matrix locally !

public final mat 2 2 invert ( ) { final float a = ex x , b = ey x , c = ex y , d = ey y ; final mat 2 2 b = new mat 2 2 ( ) ; float det = a * d - b * c ; if ( det ! = 0 ) { det = 1 0f / det ; } b ex x = det * d ; b ey x = - det * b ; b ex y = - det * c ; b ey y = det * a ; return b ; }


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


this method separates the parameters as strings this is more complicated then one might initially think reason being , you need to take into account nested templates and function pointers

private list < demangled data type > parse parameters ( string parameter string ) { list < string > parameter strings = tokenize parameters ( parameter string ) ; list < demangled data type > parameters = convert into parameters ( parameter strings ) ; return parameters ; }


creates an xml item this route creates an xml item

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


poll for new events this allows the client to handle inbound requests and send any needed outbound requests

public void poll ( ) throws i o exception { poll listeners ( ) ; long current time ms = time milliseconds ( ) ; if ( maybe complete shutdown ( current time ms ) ) { return ; } long poll timeout ms = poll current state ( current time ms ) ; kafka raft metrics update poll start ( current time ms ) ; raft message message = message queue poll ( poll timeout ms ) ; current time ms = time milliseconds ( ) ; kafka raft metrics update poll end ( current time ms ) ; if ( message ! = null ) { handle inbound message ( message , current time ms ) ; } }


judge if the field is char or character type

private boolean is char type ( field field ) { string type = field get type ( ) get name ( ) ; return type equals ( " char " ) | | type ends with ( " character " ) ; }


sets this matrix to a concatenation of translation , rotation and scale it is a more efficient form for : < code > idt ( ) translate ( x , y ) rotate rad ( radians ) scale ( scale x , scale y ) < code >

public affine 2 set to trn rot rad scl ( float x , float y , float radians , float scale x , float scale y ) { m 0 2 = x ; m 1 2 = y ; if ( radians = = 0 ) { m 0 0 = scale x ; m 0 1 = 0 ; m 1 0 = 0 ; m 1 1 = scale y ; } else { float sin = math utils sin ( radians ) ; float cos = math utils cos ( radians ) ; m 0 0 = cos * scale x ; m 0 1 = - sin * scale y ; m 1 0 = sin * scale x ; m 1 1 = cos * scale y ; } return this ; }


gets the index of the given type , which must have been added to this instance

public int index of ( type type ) { if ( type = = null ) { throw new null pointer exception ( " type = = null " ) ; } throw if not prepared ( ) ; type id item item = type ids get ( type ) ; if ( item = = null ) { throw new illegal argument exception ( " not found : " + type ) ; } return item get index ( ) ; }


draws a rectangle with the bottom left corner at x , y having the given width and height in pixels the portion of the { @ link texture } given by src x , src y and src width , src height are used these coordinates and sizes are given in texels

public void draw ( texture texture , float x , float y , int src x , int src y , int src width , int src height ) ;


when compiling with modules , the c + + compile action only has the { @ code pcm } files on its inputs , which is not enough for extra actions that parse header files thus , re - run include scanning and add headers to the inputs of the extra action , too this method returns null when a required sky value is missing and a skyframe restart is required

public nested set < artifact > get input files for extra action ( action execution context action execution context ) throws action execution exception , interrupted exception { if ( ! should scan includes ) { return nested set builder from nested set ( cc compilation context get declared include srcs ( ) ) add transitive ( additional prunable headers ) build ( ) ; } try { include scanning header data builder include scanning header data = cc compilation context create include scanning header data ( action execution context get environment for discovering inputs ( ) , use pic , use header modules ) ; if ( include scanning header data = = null ) { return null ; } return find used headers ( action execution context , include scanning header data set system include dirs ( get system include dirs ( ) ) set cmdline includes ( get cmdline includes ( get compiler options ( ) ) ) build ( ) ) ; } catch ( command line expansion exception e ) { string message = string format ( " failed to generate compile environment variables for rule ' % s : % s " , get owner ( ) get label ( ) , e get message ( ) ) ; detailed exit code code = create detailed exit code ( message , code command generation failure ) ; throw new action execution exception ( message , this , / * catastrophe = * / false , code ) ; } }


returns the discrete domain for values of type { @ code long }

public static discrete domain < long > longs ( ) { return long domain instance ; }


mirror ' s { @ link g file system # get listing ( g file ) } interface

public list < g file > get listing ( g file directory ) throws i o exception { if ( is closed ( ) ) { throw new i o exception ( " invalid state , index already closed " ) ; } if ( directory = = null | | root dir equals ( directory ) ) { return arrays as list ( payload file ) ; } return collections empty list ( ) ; }


private void write connection header ( ipc streams streams ) throws i o exception { / / write out the header , version and authentication method / / the output stream is buffered but we must not flush it yet the / / connection setup protocol requires the client to send multiple / / messages before reading a response / / / / insecure : send header + context + call , read / / secure : send header + negotiate , read , ( sasl ) , context + call , read / / / / the client must flush only when it ' s prepared to read otherwise / / " broken pipe " exceptions occur if the server closes the connection / / before all messages are sent final data output stream out = streams out ; synchronized ( out ) { out write ( rpc constants header array ( ) ) ; out write ( rpc constants current version ) ; out write ( service class ) ; out write ( auth protocol call id ) ; } }


cross udf method called once per pair of elements in the cartesian product of the inputs

out cross ( in1 val 1 , in2 val 2 ) throws exception ;


get current { @ link service instance service instance }

public service instance get service instance ( ) { return service instance ; }


public void close ( ) throws i o exception { i o utils cleanup with logger ( log , base f s , store ) ; base f s = null ; filesystem = null ; store = null ; }


check whether there has been at least one record appended to the batch

public boolean non empty ( ) { return num records ( ) > 0 ; }


test for { @ link light weight g set # compute capacity ( double , string ) } with invalid negative max memory

public void test compute capacity invalid memory ( ) { light weight g set compute capacity ( - 1 , 50 0 , " test map " ) ; }


public proxy set no proxy ( string no proxy ) { verify proxy type compatibility ( proxy type manual ) ; this proxy type = proxy type manual ; this no proxy = no proxy ; return this ; }


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


public void add ( @ non null job job ) { new chain ( this , collections singleton list ( job ) ) enqueue ( ) ; }


encodes the given response as a http response message this method is guaranteed not to throw

public http response encode ( supplier < http response > factory , response response ) { int status = response get status ( ) = = error codes success ? http ok : http internal error ; byte [ ] data = json to json ( get value to encode ( response ) ) get bytes ( utf 8 ) ; http response http response = factory get ( ) ; http response set status ( status ) ; http response set header ( cache control , " no - cache " ) ; http response set header ( expires , " thu , 01 jan 1970 00 : 00 : 00 gmt " ) ; http response set header ( content length , string value of ( data length ) ) ; http response set header ( content type , json utf 8 to string ( ) ) ; http response set content ( bytes ( data ) ) ; return http response ; }


optional : default value is ( char sequence ) null

public test many types view model title ( @ nullable char sequence title ) { on mutation ( ) ; title string attribute data set value ( title ) ; return this ; }


called when a publisher has published an event to the { @ link ring buffer } the { @ link batch event processor } will read messages from the { @ link ring buffer } in batches , where a batch is all of the events available to be processed without having to wait for any new event to arrive this can be useful for event handlers that need to do slower operations like io as they can group together the data from multiple events into a single operation implementations should ensure that the operation is always performed when end of batch is true as the time between that message and the next one is indeterminate

void on event ( t event , long sequence , boolean end of batch ) throws exception ;


get number of data bytes and number of error correction bytes for block id " block i d " store the result in " num data bytes in block " , and " num e c bytes in block " see table 12 in 8 5 1 of jisx0510 : 2004 ( p 30 )

static void get num data bytes and num e c bytes for block i d ( int num total bytes , int num data bytes , int num r s blocks , int block i d , int [ ] num data bytes in block , int [ ] num e c bytes in block ) throws writer exception { if ( block i d > = num r s blocks ) { throw new writer exception ( " block id too large " ) ; } / / num rs blocks in group 2 = 196 % 5 = 1 int num rs blocks in group 2 = num total bytes % num r s blocks ; / / num rs blocks in group 1 = 5 - 1 = 4 int num rs blocks in group 1 = num r s blocks - num rs blocks in group 2 ; / / num total bytes in group 1 = 196 / 5 = 39 int num total bytes in group 1 = num total bytes / num r s blocks ; / / num total bytes in group 2 = 39 + 1 = 40 int num total bytes in group 2 = num total bytes in group 1 + 1 ; / / num data bytes in group 1 = 66 / 5 = 13 int num data bytes in group 1 = num data bytes / num r s blocks ; / / num data bytes in group 2 = 13 + 1 = 14 int num data bytes in group 2 = num data bytes in group 1 + 1 ; / / num ec bytes in group 1 = 39 - 13 = 26 int num ec bytes in group 1 = num total bytes in group 1 - num data bytes in group 1 ; / / num ec bytes in group 2 = 40 - 14 = 26 int num ec bytes in group 2 = num total bytes in group 2 - num data bytes in group 2 ; / / sanity checks / / 26 = 26 if ( num ec bytes in group 1 ! = num ec bytes in group 2 ) { throw new writer exception ( " ec bytes mismatch " ) ; } / / 5 = 4 + 1 if ( num r s blocks ! = num rs blocks in group 1 + num rs blocks in group 2 ) { throw new writer exception ( " rs blocks mismatch " ) ; } / / 196 = ( 13 + 26 ) * 4 + ( 14 + 26 ) * 1 if ( num total bytes ! = ( ( num data bytes in group 1 + num ec bytes in group 1 ) * num rs blocks in group 1 ) + ( ( num data bytes in group 2 + num ec bytes in group 2 ) * num rs blocks in group 2 ) ) { throw new writer exception ( " total bytes mismatch " ) ; } if ( block i d < num rs blocks in group 1 ) { num data bytes in block [ 0 ] = num data bytes in group 1 ; num e c bytes in block [ 0 ] = num ec bytes in group 1 ; } else { num data bytes in block [ 0 ] = num data bytes in group 2 ; num e c bytes in block [ 0 ] = num ec bytes in group 2 ; } }


adds a start tag and end tag around the entire text

public final void wrap by ( string start tag , string end tag ) { add markup ( 0 , length ( ) , start tag , end tag ) ; }


returns the component that will receive focus when the dialog is shown

public component get focus component ( ) { return focus component ; }


standard method that must be overridden when creating custom renderers the primary changes here are to change the attributes of the cell based on the contents of the underlying { @ link instruction table data object }

public component get table cell renderer component ( g table cell rendering data data ) { object value = data get value ( ) ; j table table = data get table ( ) ; int column = data get column view index ( ) ; boolean is selected = data is selected ( ) ; boolean has focus = data has focus ( ) ; / / do a null check on the input here to protect ourselves this value can be null / / in certain cases ( eg : change resolution on the screen [ ctrl - + on mac ] , then move the / / instruction window to a different monitor , then click on a cell ) if ( value = = null ) { return this ; } / / get the data object backing the cell instruction table data object data object = ( instruction table data object ) value ; string str data = data object get data ( ) ; g table cell rendering data render data = data copy with new value ( str data ) ; j label the renderer = ( j label ) super get table cell renderer component ( render data ) ; set text attributes ( table , value , column ) ; set background attributes ( is selected , has focus , data object ) ; set border attributes ( data object , the renderer ) ; set foreground attributes ( data object , the renderer ) ; return this ; }


private static void build transparent colors ( ) { final set < string > colors = collections unmodifiable set ( sets new hash set ( " scroll bar hover track color " , " scroll bar track color " , " scroll bar mac hover track color " , " scroll bar mac track color " , " scroll bar transparent hover track color " , " scroll bar transparent track color " , " scroll bar mac transparent hover track color " , " scroll bar mac transparent track color " ) ) ; final color transparent background = mtui panel get transparent background ( ) ; m t ui utils build resources ( colors , transparent background ) ; }


< code > optional aapt pb file reference file = 5 ; < code >


if the query source is a template , then parses the script , compiles the script with user details parameters and then executes it to return the query string note : this method always enforces " mustache " script language for the template

public static string evaluate template ( final string query source , final script service script service , final user user ) { / / empty is safe here because we never use named object try ( x content parser parser = x content factory x content ( query source ) create parser ( named x content registry empty , logging deprecation handler instance , query source ) ) { x content parser token token = parser next token ( ) ; if ( token ! = x content parser token start object ) { throw new elasticsearch parse exception ( " unexpected token [ " + token + " ] " ) ; } token = parser next token ( ) ; if ( token ! = x content parser token field name ) { throw new elasticsearch parse exception ( " unexpected token [ " + token + " ] " ) ; } if ( " template " equals ( parser current name ( ) ) ) { token = parser next token ( ) ; if ( token ! = x content parser token start object ) { throw new elasticsearch parse exception ( " unexpected token [ " + token + " ] " ) ; } map < string , object > user model = new hash map < > ( ) ; user model put ( " username " , user principal ( ) ) ; user model put ( " full name " , user full name ( ) ) ; user model put ( " email " , user email ( ) ) ; user model put ( " roles " , arrays as list ( user roles ( ) ) ) ; user model put ( " metadata " , collections unmodifiable map ( user metadata ( ) ) ) ; map < string , object > extra params = collections singleton map ( " user " , user model ) ; return mustache template evaluator evaluate ( script service , parser , extra params ) ; } else { return query source ; } } catch ( i o exception ioe ) { throw new elasticsearch parse exception ( " failed to parse query " , ioe ) ; } }


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


all unit of work operations are batched and executed together on commit only

public void commit ( ) { if ( context = = null | | context size ( ) = = 0 ) { return ; } logger info ( " commit started " ) ; if ( context contains key ( unit actions insert get action value ( ) ) ) { commit insert ( ) ; } if ( context contains key ( unit actions modify get action value ( ) ) ) { commit modify ( ) ; } if ( context contains key ( unit actions delete get action value ( ) ) ) { commit delete ( ) ; } logger info ( " commit finished " ) ; }


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


if delivery is not poison nor null , return it if delivery , shutdown and cancelled are all null , return null if delivery is poison re - insert poison into the queue and throw an exception if p o i s o ned for no reason otherwise , if we are in shutdown mode or cancelled , throw a corresponding exception

private delivery handle ( delivery delivery ) { if ( delivery = = poison | | delivery = = null & & ( shutdown ! = null | | cancelled ! = null ) ) { if ( delivery = = poison ) { queue add ( poison ) ; if ( shutdown = = null & & cancelled = = null ) { throw new illegal state exception ( " poison in queue , but null shutdown and null cancelled " + " this should never happen , please report as a bug " ) ; } } if ( null ! = shutdown ) { throw utility fix stack trace ( shutdown ) ; } if ( null ! = cancelled ) { throw utility fix stack trace ( cancelled ) ; } } return delivery ; }


unregisters the kv state instance identified by the given kv state i d

public void unregister kv state ( job i d job id , job vertex i d job vertex id , key group range key group range , string registration name , kv state i d kv state id ) { kv state entry < ? , ? , ? > entry = registered kv states remove ( kv state id ) ; if ( entry ! = null ) { entry clear ( ) ; final kv state registry listener listener = get kv state registry listener ( job id ) ; if ( listener ! = null ) { listener notify kv state unregistered ( job id , job vertex id , key group range , registration name ) ; } } }


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


a test for non - trust , non - key configurations these are straight forward and can all be tested together

public void test basic configuration options ( ) { final ssl verification mode verification mode = random from ( ssl verification mode values ( ) ) ; final ssl client authentication mode client auth = random from ( ssl client authentication mode values ( ) ) ; final string [ ] ciphers = generate random string array ( 8 , 12 , false , false ) ; final string [ ] protocols = generate random string array ( 4 , 5 , false , false ) ; settings = settings builder ( ) put ( " test ssl verification mode " , verification mode name ( ) to lower case ( locale root ) ) put ( " test ssl client authentication " , client auth name ( ) to lower case ( locale root ) ) put list ( " test ssl cipher suites " , ciphers ) put list ( " test ssl supported protocols " , protocols ) build ( ) ; final ssl configuration configuration = loader load ( cert root ) ; assert that ( configuration get client auth ( ) , is ( client auth ) ) ; assert that ( configuration get verification mode ( ) , is ( verification mode ) ) ; assert that ( configuration get cipher suites ( ) , equal to ( arrays as list ( ciphers ) ) ) ; assert that ( configuration get supported protocols ( ) , equal to ( arrays as list ( protocols ) ) ) ; if ( verification mode = = ssl verification mode none ) { final ssl trust config trust config = configuration get trust config ( ) ; assert that ( trust config , instance of ( trust everything config class ) ) ; } }


get the { @ link annotation } from the specified { @ link annotated element the annotated element } and { @ link annotation annotation } class name

static < a extends annotation > a get annotation ( annotated element annotated element , string annotation class name ) throws class cast exception { class < ? extends annotation > annotation type = resolve annotation type ( annotated element , annotation class name ) ; if ( annotation type = = null ) { return null ; } return ( a ) annotated element get annotation ( annotation type ) ; }


the transport completed shutting down all resources have been released


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


return whether the request payload ( body ) should be included in the log message

protected boolean is include payload ( ) { return this include payload ; }


return the executors covered by this assignments

public set < executor details > get executors ( ) { return this executor to slot key set ( ) ; }


public static string to string ( map map ) { if ( map = = null ) return " null " ; return map to string ( ) ; }


waits for long delay ms milliseconds for the thread to terminate ( using { @ link thread # join ( long ) } ) , else interrupts the thread ( in the hope that it may terminate later ) and fails

void await termination ( thread t ) { await termination ( t , long delay ms ) ; }


tests that the gateway retrieval is retried in case of a failure

public void test gateway retrieval failures ( ) throws exception { final string address = " localhost " ; final uuid leader id = uuid random u u i d ( ) ; rpc gateway rpc gateway = mock ( rpc gateway class ) ; testing leader gateway retriever leader gateway retriever = new testing leader gateway retriever ( rpc gateway ) ; settable leader retrieval service settable leader retrieval service = new settable leader retrieval service ( ) ; settable leader retrieval service start ( leader gateway retriever ) ; completable future < rpc gateway > gateway future = leader gateway retriever get future ( ) ; / / this triggers the first gateway retrieval attempt settable leader retrieval service notify listener ( address , leader id ) ; / / check that the first future has been failed try { gateway future get ( ) ; fail ( " the first future should have been failed " ) ; } catch ( execution exception ignored ) { / / that ' s what we expect } / / the second attempt should fail as well assert false ( ( leader gateway retriever get now ( ) is present ( ) ) ) ; / / the third attempt should succeed assert equals ( rpc gateway , leader gateway retriever get now ( ) get ( ) ) ; }


public static http response execute get ( final string url ) { return execute get ( url , null , null , new linked hash map < > ( map size ) ) ; }


< t > mono < t > body to mono ( parameterized type reference < t > type reference ) ;


set the type of this body this may alter the mass and velocity

public void set type ( body type type ) { org jbox 2d dynamics body type t = org jbox 2d dynamics body type dynamic ; if ( type = = body type dynamic body ) t = org jbox 2d dynamics body type dynamic ; if ( type = = body type kinematic body ) t = org jbox 2d dynamics body type kinematic ; if ( type = = body type static body ) t = org jbox 2d dynamics body type static ; body set type ( t ) ; }


public static string get file m d 5 to string ( final string file path ) { file file = utils bridge is space ( file path ) ? null : new file ( file path ) ; return get file m d 5 to string ( file ) ; }


returns whether the given class would introduce any unwanted fields in the target class

private boolean introduces unwanted fields ( program class program class , program class target class ) { / / it ' s ok if the target class is never instantiated , without any other / / subclasses except for maybe the source class if ( ! instantiation class marker is instantiated ( target class ) & & ( target class sub classes = = null | | is only sub class ( program class , target class ) ) ) { return false ; } member counter counter = new member counter ( ) ; / / count all non - static fields in the the source class program class fields accept ( new member access filter ( 0 , class constants acc static , counter ) ) ; return counter get count ( ) > 0 ; }


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

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


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


private static boolean is valid port ( int port ) { return port > = 0 & & port < = 65535 ; }


returns the { @ link chunk source } used by this stream

public t get chunk source ( ) { return chunk source ; }


requests that signed a p ks are zipaligned

public apk actions builder set zipalign apk ( boolean zipalign ) { this zipalign apk = zipalign ; return this ; }


removes and returns the value associated with { @ code key } if { @ code key } is not in the map , this method has no effect and returns zero

public long remove ( k key ) { atomic long atomic = map get ( key ) ; if ( atomic = = null ) { return 0l ; } while ( true ) { long old value = atomic get ( ) ; if ( old value = = 0l | | atomic compare and set ( old value , 0l ) ) { / / only remove after setting to zero , to avoid concurrent updates map remove ( key , atomic ) ; / / succeed even if the remove fails , since the value was already adjusted return old value ; } } }


creates a new { @ link time } of the given duration and { @ link time unit }

public static time of ( long size , time unit unit ) { return new time ( size , unit ) ; }


utility method that takes the topic partitions and creates the topic partition state holders , depending on the timestamp watermark mode

private list < kafka topic partition state < t , kph > > create partition state holders ( map < kafka topic partition , long > partitions to initial offsets , int timestamp watermark mode , serialized value < watermark strategy < t > > watermark strategy , class loader user code class loader ) throws i o exception , class not found exception { / / copy on write as adding discovered partitions could happen in parallel / / while different threads iterate the partitions list list < kafka topic partition state < t , kph > > partition states = new copy on write array list < > ( ) ; switch ( timestamp watermark mode ) { case no timestamps watermarks : { for ( map entry < kafka topic partition , long > partition entry : partitions to initial offsets entry set ( ) ) { / / create the kafka version specific partition handle kph kafka handle = create kafka partition handle ( partition entry get key ( ) ) ; kafka topic partition state < t , kph > partition state = new kafka topic partition state < > ( partition entry get key ( ) , kafka handle ) ; partition state set offset ( partition entry get value ( ) ) ; partition states add ( partition state ) ; } return partition states ; } case with watermark generator : { for ( map entry < kafka topic partition , long > partition entry : partitions to initial offsets entry set ( ) ) { final kafka topic partition kafka topic partition = partition entry get key ( ) ; kph kafka handle = create kafka partition handle ( kafka topic partition ) ; watermark strategy < t > deserialized watermark strategy = watermark strategy deserialize value ( user code class loader ) ; / / the format of the id does not matter , as long as it is unique final string partition id = kafka topic partition get topic ( ) + ' - ' + kafka topic partition get partition ( ) ; watermark output multiplexer register new output ( partition id ) ; watermark output immediate output = watermark output multiplexer get immediate output ( partition id ) ; watermark output deferred output = watermark output multiplexer get deferred output ( partition id ) ; kafka topic partition state with watermark generator < t , kph > partition state = new kafka topic partition state with watermark generator < > ( partition entry get key ( ) , kafka handle , deserialized watermark strategy create timestamp assigner ( ( ) - > consumer metric group ) , deserialized watermark strategy create watermark generator ( ( ) - > consumer metric group ) , immediate output , deferred output ) ; partition state set offset ( partition entry get value ( ) ) ; partition states add ( partition state ) ; } return partition states ; } default : / / cannot happen , add this as a guard for the future throw new runtime exception ( ) ; } }


returns an { @ link exo media drm } instance with an incremented reference count when the caller no longer needs to use the instance , it must call { @ link exo media drm # release ( ) } to decrement the reference count

exo media drm acquire exo media drm ( uuid uuid ) ;


see original { @ link stubber # do throw ( throwable ) }

b d d stubber will throw ( throwable to be thrown ) ;


load bean definitions into the supplied { @ link generic application context context } from the locations in the supplied { @ code merged context configuration } using a { @ link groovy bean definition reader }

protected void load bean definitions ( generic application context context , merged context configuration merged config ) { new groovy bean definition reader ( context ) load bean definitions ( merged config get locations ( ) ) ; }


executes the given closure on each element in the collection if the input collection or closure is null , there is no change made

public static < e > void for all do ( collection < e > collection , closure < e > closure ) { if ( collection = = null | | closure = = null ) return ; int index = 0 ; for ( e e : collection ) { closure execute ( index + + , e ) ; } }


called by { @ link # visit directory } to compute the { @ code t return } value it returns , as a function of { @ code consumer } and the { @ link sky value } s computed for subdirectories of the directory specified by { @ code recursive pkg key } , contained in { @ code subdirectory sky values }

protected abstract t return aggregate with subdirectory sky values ( t consumer consumer , map < sky key , sky value > subdirectory sky values ) ;


gets the url path name for example , if this method returns " xyz " , and if the parent object ( that this action is associated with ) is bound to foobarzot , then this action object will be exposed to foobarzotxyz this method should return a string that ' s unique among other { @ link action } s the returned string can be an absolute url , like " http : www sun com " , which is useful for directly connecting to external systems if the returned string starts with ' ' , like ' foo ' , then it ' s assumed to be relative to the context path of the jenkins webapp

@ check for null string get url name ( ) ;


writes the index state this method is public for testing purposes

public long write index ( string reason , index metadata index metadata ) throws write state exception { final index index = index metadata get index ( ) ; logger trace ( " [ { } ] writing state , reason [ { } ] " , index , reason ) ; try { long generation = index metadata format write ( index metadata , node env index paths ( index metadata get index ( ) ) ) ; logger trace ( " [ { } ] state written " , index ) ; return generation ; } catch ( write state exception ex ) { throw new write state exception ( false , " [ " + index + " ] : failed to write index state " , ex ) ; } }


attempts to memory map this file android files must not be compressed

public byte buffer map ( file channel map mode mode ) { if ( type = = file type classpath ) throw new gdx runtime exception ( " cannot map a classpath file : " + this ) ; random access file raf = null ; try { raf = new random access file ( file , mode = = map mode read only ? " r " : " rw " ) ; file channel file channel = raf get channel ( ) ; byte buffer map = file channel map ( mode , 0 , file length ( ) ) ; map order ( byte order native order ( ) ) ; return map ; } catch ( exception ex ) { throw new gdx runtime exception ( " error memory mapping file : " + this + " ( " + type + " ) " , ex ) ; } finally { stream utils close quietly ( raf ) ; } }


indicates whether the user has an hdfs delegation token

public static boolean has h d f s delegation token ( user group information ugi ) { collection < token < ? extends token identifier > > usr tok = ugi get tokens ( ) ; for ( token < ? extends token identifier > token : usr tok ) { if ( token get kind ( ) equals ( hdfs delegation token kind ) ) { return true ; } } return false ; }


gets the lookup cache manager from memory

public lookup cache manager get lookup cache manager ( ) { return lookup cache manager ; }


set drawable checked ( only swipe action choice )

protected void set swipe drawable checked ( int swipe drawable checked ) { this swipe drawable checked = swipe drawable checked ; }


returns number of parameters in { @ link parameter tool }

public int get number of parameters ( ) { return data size ( ) ; }


string get source file name ( ) { if ( ms type instanceof user defined type source and line ms type ) { return ( ( user defined type source and line ms type ) ms type ) get source file name ( ) ; } return ( ( user defined type module source and line ms type ) ms type ) get source file name ( ) ; }


returns true if the check is valid , false if not

private boolean is focus valid ( section location info section location info , int index ) { if ( index > = section location info m section get count ( ) | | index < 0 ) { string error message = " you are trying to request focus with offset on an index that is out of bounds : " + " requested " + index + " , total " + section location info m section get count ( ) ; components reporter emit message ( components reporter log level error , out of bounds request focus , error message ) ; return false ; } return true ; }


takes a string with keys and values separated by ' = ' and each key value pair separated by ' , ' for example max block ms = 5000 , retries = 6 , request timeout ms = 6000

private static map < string , string > updated configs ( final string formatted configs ) { final string [ ] parts = formatted configs split ( " , " ) ; final map < string , string > updated configs = new hash map < > ( ) ; for ( final string part : parts ) { final string [ ] key value = part split ( " = " ) ; updated configs put ( key value [ key ] , key value [ value ] ) ; } return updated configs ; }


default void parser data binary ( string data binary base 6 4 , list < key value > tags ) { try { log tags log tags = log tags parse from ( base 6 4 get decoder ( ) decode ( data binary base 6 4 ) ) ; log tags get data list ( ) for each ( pair - > tags add ( new key value ( pair get key ( ) , pair get value ( ) ) ) ) ; } catch ( invalid protocol buffer exception e ) { throw new runtime exception ( e ) ; } }


set the query parameter name to use when { @ link # set favor parameter } is on the default parameter name is { @ code " format " }

public void set parameter name ( string parameter name ) { assert not null ( parameter name , " parameter name is required " ) ; this parameter name = parameter name ; }


builds an { @ link internal aggregation reduce context builder } that is valid and nearly empty except that it contain { @ link pipeline aggregator } s

public static internal aggregation reduce context builder empty reduce context builder ( pipeline tree pipeline tree ) { return new internal aggregation reduce context builder ( ) { @ override public internal aggregation reduce context for partial reduction ( ) { return internal aggregation reduce context for partial reduction ( big arrays non recycling instance , null , ( ) - > pipeline tree ) ; } @ override public reduce context for final reduction ( ) { return internal aggregation reduce context for final reduction ( big arrays non recycling instance , null , b - > { } , pipeline tree ) ; } } ; }


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


hash bytes in memory segment , length must be aligned to 4 bytes

public static int hash bytes by words ( memory segment segment , int offset , int length in bytes ) { return hash bytes by words ( segment , offset , length in bytes , default seed ) ; }


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

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


sets various paint properties on the drawable

public static void set drawable properties ( @ nullable drawable drawable , @ nullable drawable properties properties ) { if ( drawable = = null | | properties = = null ) { return ; } properties apply to ( drawable ) ; }


sets the < code > map boolean < code > property

public additional properties class map boolean ( map < string , boolean > map boolean ) { this map boolean = map boolean ; return this ; }


specify the call factory to be used for network requests note : calling { @ link # client } overwrites this value

public builder call factory ( @ non null call factory factory ) { check not null ( factory , " factory = = null " ) ; call factory = factory ; return this ; }


if the callback handler handles the ` o auth bearer extensions validator callback ` and finds an invalid extension , sasl server should throw an authentication exception

public void throws authentication exception on invalid extensions ( ) { o auth bearer unsecured validator callback handler invalid handler = new o auth bearer unsecured validator callback handler ( ) { @ override public void handle ( callback [ ] callbacks ) throws unsupported callback exception { for ( callback callback : callbacks ) { if ( callback instanceof o auth bearer validator callback ) { o auth bearer validator callback validation callback = ( o auth bearer validator callback ) callback ; validation callback token ( new o auth bearer token mock ( ) ) ; } else if ( callback instanceof o auth bearer extensions validator callback ) { o auth bearer extensions validator callback extensions callback = ( o auth bearer extensions validator callback ) callback ; extensions callback error ( " first key " , " is not valid " ) ; extensions callback error ( " second key " , " is not valid either " ) ; } else throw new unsupported callback exception ( callback ) ; } } } ; sasl server = new o auth bearer sasl server ( invalid handler ) ; map < string , string > custom extensions = new hash map < > ( ) ; custom extensions put ( " first key " , " value " ) ; custom extensions put ( " second key " , " value " ) ; assert throws ( sasl authentication exception class , ( ) - > sasl server evaluate response ( client initial response ( null , false , custom extensions ) ) ) ; }


a shortcut for { @ link # set wait for active shards ( active shard count ) } where the numerical shard count is passed in , instead of having to first call { @ link active shard count # from ( int ) } to get the active shard count

public request builder set wait for active shards ( final int wait for active shards ) { return set wait for active shards ( active shard count from ( wait for active shards ) ) ; }


scrolls the view to the currently selected item

public void scroll to selected row ( ) { int [ ] selected rows = table get selected rows ( ) ; if ( selected rows = = null | | selected rows length = = 0 ) { return ; } / / just make sure that the first row is visible int row = selected rows [ 0 ] ; / / update the cell rectangle to be the entire row so that if the user is horizontally / / scrolled , then we do not change that rectangle visible rect = get visible rect ( ) ; rectangle cell rect = table get cell rect ( row , 0 , true ) ; cell rect x = visible rect x ; cell rect width = visible rect width ; table scroll rect to visible ( cell rect ) ; }


gets a 32 - bit floating point number at the current { @ code reader index } and increases the { @ code reader index } by { @ code 4 } in this buffer


using trace method to visit admin server

private void trace admin server ( int port ) throws i o exception { trace admin server ( string format ( url format , port ) ) ; trace admin server ( string format ( https url format , port ) ) ; }


public void test 1 0 install archive distribution ( ) throws exception { assume true ( distribution ( ) is archive ( ) ) ; installation = install archive ( sh , distribution ) ; verify archive installation ( installation , distribution ( ) ) ; final installation executables bin = installation executables ( ) ; shell result r = sh run ignore exit code ( bin keystore tool to string ( ) + " has - passwd " ) ; assert false ( " has - passwd should fail " , r is success ( ) ) ; assert that ( " has - passwd should indicate missing keystore " , r stderr , contains string ( error keystore not found ) ) ; }


public task type get task type ( ) { return task type ; }


returns true iff this link type is a transitive dynamic library

public boolean is transitive dynamic library ( ) { return this = = dynamic library ; }


get the md 5 for the file , using less memory

public static string get m d 5 ( final string file ) { if ( file = = null ) { return null ; } file f = new file ( file ) ; if ( f exists ( ) ) { return get m d 5 ( f , 1024 * 100 ) ; } return null ; }


the list of subject alternate names allowed for workload instances that implement this service this information is used to enforce [ secure - naming ] ( https : istio iodocsconceptssecurity # secure - naming ) if specified , the proxy will verify that the server certificate ' s subject alternate name matches one of the specified values < code > repeated string subject alt names = 8 ; < code >

public builder add subject alt names bytes ( com google protobuf byte string value ) { if ( value = = null ) { throw new null pointer exception ( ) ; } check byte string is utf 8 ( value ) ; ensure subject alt names is mutable ( ) ; subject alt names add ( value ) ; on changed ( ) ; return this ; }


performs auto scaling of the axis by recalculating the minimum and maximum y - values based on the entries currently in view

protected void auto scale ( ) { final float from x = get lowest visible x ( ) ; final float to x = get highest visible x ( ) ; m data calc min max y ( from x , to x ) ; m x axis calculate ( m data get x min ( ) , m data get x max ( ) ) ; / / calculate axis range ( min / max ) according to provided data if ( m axis left is enabled ( ) ) m axis left calculate ( m data get y min ( axis dependency left ) , m data get y max ( axis dependency left ) ) ; if ( m axis right is enabled ( ) ) m axis right calculate ( m data get y min ( axis dependency right ) , m data get y max ( axis dependency right ) ) ; calculate offsets ( ) ; }


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


determine the type of the bean with the given name more specifically , determine the type of object that { @ link # get bean } would return for the given name for a { @ link factory bean } , return the type of object that the factory bean creates , as exposed by { @ link factory bean # get object type ( ) } depending on the { @ code allow factory bean init } flag , this may lead to the initialization of a previously uninitialized { @ code factory bean } if no early type information is available translates aliases back to the corresponding canonical bean name will ask the parent factory if the bean cannot be found in this factory instance

class < ? > get type ( string name , boolean allow factory bean init ) throws no such bean definition exception ;


test that deletion of a symlink works as expected

public void test symlink delete ( ) throws exception { file file = new file ( del , file ) ; file create new file ( ) ; file link = new file ( del , " link " ) ; / / create the symlink file util sym link ( file get absolute path ( ) , link get absolute path ( ) ) ; assert assert true ( file exists ( ) ) ; assert assert true ( link exists ( ) ) ; / / make sure that deleting a symlink works properly assert assert true ( link delete ( ) ) ; assert assert false ( link exists ( ) ) ; assert assert true ( file exists ( ) ) ; }


sets the state of the action so it can be run again


returns a retained copy with separate indexes this allows to read from the same { @ link memory segment } twice warning : the newly returned { @ link buffer consumer } will have its reader index copied from the original buffer in other words , data already consumed before copying will not be visible to the returned copies

public buffer consumer copy ( ) { return new buffer consumer ( buffer retain buffer ( ) , writer position position marker , current reader position ) ; }


creates an out - of - band channel for load balancer ' s own rpc needs , e g , talking to an external load - balancer service , that is specified by a target string see the documentation on { @ link managed channel builder # for target } for the format of a target string the target string will be resolved by a { @ link name resolver } created according to the target string the load balancer is responsible for closing unused oob channels , and closing all oob channels within { @ link # shutdown }

public managed channel create resolving oob channel ( string target ) { return create resolving oob channel builder ( target ) build ( ) ; }


sets the initial value for a state or transfers the previous state value to the new component , then applies all the states updates that have been enqueued for the new component ' s global key assumed thread - safe because the one write is before all the reads

void apply state updates for component ( layout state context layout state context , component component , string key ) { maybe init state containers ( ) ; maybe init needed state containers ( ) ; if ( ! component has state ( ) ) { return ; } final state container current state container ; final component context scoped context = component get scoped context ( layout state context , key ) ; synchronized ( this ) { current state container = m state containers get ( key ) ; m needed state containers add ( key ) ; } if ( current state container ! = null ) { component transfer state ( current state container , component get state container ( scoped context ) ) ; } else { final component tree component tree = scoped context get component tree ( ) ; if ( component tree ! = null & & component tree get initial state container ( ) ! = null ) { component tree get initial state container ( ) create or get initial state for component ( component , scoped context ) ; } else { component create initial state ( scoped context ) ; } } final list < state update > state updates for key ; synchronized ( this ) { state updates for key = m pending state updates = = null ? null : m pending state updates get ( key ) ; } list < transition > transitions from state update = null ; / / if there are no state updates pending for this component , simply store its current state if ( state updates for key ! = null ) { for ( state update update : state updates for key ) { final state container state container = component get state container ( scoped context ) ; state container apply state update ( update ) ; final transition transition = obtain transition from state container ( state container ) ; if ( transition ! = null ) { if ( transitions from state update = = null ) { transitions from state update = new array list < > ( ) ; } transitions from state update add ( transition ) ; } } litho stats increment component applied state update count by ( state updates for key size ( ) ) ; synchronized ( this ) { m pending state updates remove ( key ) ; / / remove from pending if ( m pending lazy state updates ! = null ) { m pending lazy state updates remove ( key ) ; / / remove from pending lazy } m applied state updates put ( key , state updates for key ) ; / / add to applied } } synchronized ( this ) { final state container state container = component get state container ( scoped context ) ; m state containers put ( key , state container ) ; if ( transitions from state update ! = null & & ! transitions from state update is empty ( ) ) { maybe init pending state update transitions ( ) ; m pending state update transitions put ( key , transitions from state update ) ; } } }


public void search ( string search , boolean next ) { try { j text area area = text area ; if ( search is empty ( ) ) { highlight ( area , " " ) ; return ; } int start line = area get document ( ) get default root element ( ) get element index ( area get caret position ( ) ) + 1 ; int current line = 1 ; boolean can search = false ; string [ ] test = null ; if ( area get text ( ) split ( " \ n " ) length > = 2 ) test = area get text ( ) split ( " \ n " ) ; else test = area get text ( ) split ( " \ r " ) ; int last good line = - 1 ; int first pos = - 1 ; boolean found = false ; if ( next ) { for ( string s : test ) { if ( ! check is selected ( ) ) { s = s to lower case ( ) ; search = search to lower case ( ) ; } if ( current line = = start line ) { can search = true ; } else if ( s contains ( search ) ) { if ( can search ) { area set caret position ( area get document ( ) get default root element ( ) get element ( current line - 1 ) get start offset ( ) ) ; can search = false ; found = true ; } if ( first pos = = - 1 ) first pos = current line ; } current line + + ; } if ( ! found & & first pos ! = - 1 ) { area set caret position ( area get document ( ) get default root element ( ) get element ( first pos - 1 ) get start offset ( ) ) ; } } else { can search = true ; for ( string s : test ) { if ( ! check is selected ( ) ) { s = s to lower case ( ) ; search = search to lower case ( ) ; } if ( s contains ( search ) ) { if ( last good line ! = - 1 & & can search ) area set caret position ( area get document ( ) get default root element ( ) get element ( last good line - 1 ) get start offset ( ) ) ; last good line = current line ; if ( current line > = start line ) can search = false ; } current line + + ; } if ( last good line ! = - 1 & & area get document ( ) get default root element ( ) get element index ( area get caret position ( ) ) + 1 = = start line ) { area set caret position ( area get document ( ) get default root element ( ) get element ( last good line - 1 ) get start offset ( ) ) ; } } highlight ( area , search ) ; } catch ( exception e ) { new the bytecode club bytecodeviewer api exception u i ( e ) ; } }


assert that when we abort a multipart upload , the resulting file does not show up

public void test multipart upload abort ( ) throws exception { describe ( " upload and then abort it before completing " ) ; path file = method path ( ) ; upload handle upload handle = start upload ( file ) ; map < integer , part handle > part handles = new hash map < > ( ) ; for ( int i = 12 ; i > 10 ; i - - ) { part handles put ( i , build and put part ( file , upload handle , i , null ) ) ; } abort upload ( upload handle , file ) ; string contents = " this is part 4 9 \ n " ; int len = contents get bytes ( charsets utf 8 ) length ; input stream is = i o utils to input stream ( contents , " utf - 8 " ) ; intercept ( i o exception class , ( ) - > await future ( uploader 0 put part ( upload handle , 49 , file , is , len ) ) ) ; intercept ( i o exception class , ( ) - > complete ( uploader 0 , upload handle , file , part handles ) ) ; assert path does not exist ( " uploaded file should not exist " , file ) ; / / a second abort should be an file not found exception if the upload handle is / / consumed by finalization operations ( complete , abort ) if ( finalize consumes upload id immediately ( ) ) { intercept ( file not found exception class , ( ) - > abort upload ( upload handle , file ) ) ; } else { abort upload ( upload handle , file ) ; } }


public string get target index ( ) { return target index ; }