recursively finds all domain objects that are program files under a domain folder

protected void find programs ( array list < domain file > programs , domain folder my folder , task monitor monitor ) throws cancelled exception { if ( my folder = = null ) { return ; } domain file [ ] files = my folder get files ( ) ; for ( domain file domain file : files ) { monitor check canceled ( ) ; monitor increment progress ( 1 ) ; if ( domain file get content type ( ) equals ( program content handler program content type ) ) { programs add ( domain file ) ; } } domain folder [ ] folders = my folder get folders ( ) ; for ( domain folder domain folder : folders ) { monitor check canceled ( ) ; monitor increment progress ( 1 ) ; find programs ( programs , domain folder , monitor ) ; } }


given a byte buffer that contains protocol metadata return the deserialized form of the metadata

public static extended worker state deserialize metadata ( byte buffer buffer ) { struct header = connect protocol header schema read ( buffer ) ; short version = header get short ( version key name ) ; check version compatibility ( version ) ; struct config state = config state v1 read ( buffer ) ; long config offset = config state get long ( config offset key name ) ; string url = config state get string ( url key name ) ; struct allocation = allocation v1 read ( buffer ) ; / / protocol version is embedded with the assignment in the metadata extended assignment assignment = deserialize assignment ( allocation get bytes ( allocation key name ) ) ; return new extended worker state ( url , config offset , assignment ) ; }


private static boolean match ( char sequence string , char sequence pattern , final int s ndx const , final int p ndx const ) { int p len = pattern length ( ) ; if ( p len = = 1 ) { if ( pattern char at ( 0 ) = = ' * ' ) { / / speed - up return true ; } } int s len = string length ( ) ; boolean next is not wildcard = false ; int s ndx = s ndx const ; int p ndx = p ndx const ; while ( true ) { / / check if end of string and / or pattern occurred if ( ( s ndx > = s len ) ) { / / end of string still may have pending ' * ' in pattern while ( ( p ndx < p len ) & & ( pattern char at ( p ndx ) = = ' * ' ) ) { p ndx + + ; } return p ndx > = p len ; } if ( p ndx > = p len ) { / / end of pattern , but not end of the string return false ; } char p = pattern char at ( p ndx ) ; / / pattern char / / perform logic if ( ! next is not wildcard ) { if ( p = = ' \ \ ' ) { p ndx + + ; next is not wildcard = true ; continue ; } if ( p = = ' ? ' ) { s ndx + + ; p ndx + + ; continue ; } if ( p = = ' * ' ) { char p next = 0 ; / / next pattern char if ( p ndx + 1 < p len ) { p next = pattern char at ( p ndx + 1 ) ; } if ( p next = = ' * ' ) { / / double ' * ' have the same effect as one ' * ' p ndx + + ; continue ; } int i ; p ndx + + ; / / find recursively if there is any substring from the end of the / / line that matches the rest of the pattern ! ! ! for ( i = string length ( ) ; i > = s ndx ; i - - ) { if ( match ( string , pattern , i , p ndx ) ) { return true ; } } return false ; } } else { next is not wildcard = false ; } / / check if pattern char and string char are equals if ( p ! = string char at ( s ndx ) ) { return false ; } / / everything matches for now , continue s ndx + + ; p ndx + + ; } }


returns a disk balancer work status object from the json

public static disk balancer work status parse json ( string json ) throws i o exception { return reader workstatus read value ( json ) ; }


handle the given exception that arose during listener execution the default implementation logs the exception at warn level , not propagating it to the jms provider & mdash ; assuming that all handling of acknowledgement andor transactions is done by this listener container this can be overridden in subclasses

protected void handle listener exception ( throwable ex ) { if ( ex instanceof message rejected while stopping exception ) { / / internal exception - has been handled before return ; } if ( ex instanceof j m s exception ) { invoke exception listener ( ( j m s exception ) ex ) ; } if ( is active ( ) ) { / / regular case : failed while active / / invoke error handler if available invoke error handler ( ex ) ; } else { / / rare case : listener thread failed after container shutdown / / log at debug level , to avoid spamming the shutdown log logger debug ( " listener exception after container shutdown " , ex ) ; } }


called by log 4j 2 to initialize this converter

public static custom map fields converter new instance ( final configuration config , final string [ ] options ) { return new custom map fields converter ( ) ; }


set the suffix to append to field names for phrase matching

public void quote field suffix ( string suffix ) { this quote field suffix = suffix ; }


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 void set comment ( string comment ) ;


handshake timeout in mills , when handshake timeout , will trigger user event { @ link client handshake state event # handshake timeout }

public builder handshake timeout millis ( long handshake timeout millis ) { this handshake timeout millis = handshake timeout millis ; return this ; }


turns the given items into a set if there is only a single item and it is null , then an empty set will be returned

public static < t > set < t > as set ( t items ) { set < t > set = new hash set < > ( ) ; if ( items = = null ) { return set ; } if ( items length = = 1 & & items [ 0 ] = = null ) { return set ; } for ( t e : items ) { set add ( e ) ; } return set ; } @ suppress warnings ( { " rawtypes " , " unchecked " }


public void set start state id ( final string id ) { this flow model set start state id ( id ) ; }


public string get response body ( ) { return response body ; }


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


updates the app widget after the image view has loaded the bitmap

private void update ( ) { app widget manager app widget manager = app widget manager get instance ( this context ) ; if ( this component name ! = null ) { app widget manager update app widget ( this component name , this remote views ) ; } else { app widget manager update app widget ( this widget ids , this remote views ) ; } }


public string to string ( ) { return literals ; }


settle the captured view at the given ( left , top ) position the appropriate velocity from prior motion will be taken into account if this method returns true , the caller should invoke { @ link # continue settling ( boolean ) } on each subsequent frame to continue the motion until it returns false if this method returns false there is no further work to do to complete the movement

public boolean settle captured view at ( int final left , int final top ) { if ( ! m release in progress ) { throw new illegal state exception ( " cannot settle captured view at outside of a call to " + " callback # on view released " ) ; } return force settle captured view at ( final left , final top , ( int ) velocity tracker compat get x velocity ( m velocity tracker , m active pointer id ) , ( int ) velocity tracker compat get y velocity ( m velocity tracker , m active pointer id ) ) ; }


public async search client async search ( ) { return async search client ; }


writes a new line to the file , if it doesn ' t exist it will automatically create it

public static synchronized void write new line ( string filename , byte [ ] file contents , boolean debug ) { print writer writer = null ; string original = filename ; int counter = 0 ; boolean saved = false ; while ( ! saved ) { try { writer = new print writer ( new buffered writer ( new file writer ( filename , true ) ) ) ; writer println ( file contents ) ; if ( debug ) system out println ( " saved " + filename + " to disk " ) ; saved = true ; } catch ( exception e ) { if ( debug ) system out println ( " failed saving , trying to save as " + filename ) ; if ( original contains ( " " ) ) { filename = insert file name ( original , " " + counter ) ; } else filename = original + counter ; counter + + ; } } writer close ( ) ; }


helper method that draws the given bitmap on the canvas respecting the bounds ( if set ) if rendering was successful , it notifies the cache that the frame has been rendered with the given bitmap in addition , it will notify the { @ link frame listener } if set

private boolean draw bitmap and cache ( int frame number , @ nullable closeable reference < bitmap > bitmap reference , canvas canvas , @ frame type int frame type ) { if ( ! closeable reference is valid ( bitmap reference ) ) { return false ; } if ( m bounds = = null ) { canvas draw bitmap ( bitmap reference get ( ) , 0f , 0f , m paint ) ; } else { canvas draw bitmap ( bitmap reference get ( ) , null , m bounds , m paint ) ; } / / notify the cache that a frame has been rendered / / we should not cache fallback frames since they do not represent the actual frame if ( frame type ! = frame type fallback ) { m bitmap frame cache on frame rendered ( frame number , bitmap reference , frame type ) ; } if ( m frame listener ! = null ) { m frame listener on frame drawn ( this , frame number , frame type ) ; } return true ; }


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


removes any path that is a descendant of a path in the selection

protected tree path [ ] adjust selection paths ( tree path [ ] paths ) { hash set < g tree node > set = new hash set < > ( ) ; for ( tree path tree path : paths ) { set add ( ( g tree node ) tree path get last path component ( ) ) ; } hash set < g tree node > remove set = new hash set < > ( ) ; for ( g tree node node : set ) { if ( any parents in set ( set , node ) ) { remove set add ( node ) ; } } set remove all ( remove set ) ; tree path [ ] new paths = new tree path [ set size ( ) ] ; int index = 0 ; for ( g tree node node : set ) { new paths [ index + + ] = node get tree path ( ) ; } return new paths ; }


returns the number of elements currently stored in the priority queue

public final int size ( ) { return size ; }


public static boolean stop service ( @ non null intent intent ) { try { return utils get app ( ) stop service ( intent ) ; } catch ( exception e ) { e print stack trace ( ) ; return false ; } }


returns the results that this pipelined region consumes

iterable < ? extends r > get consumed results ( ) ;


similar to a runnable except that is given a monitor to report progress and check for cancellation

public void monitored run ( task monitor monitor ) ;


closes the job services this method is called once the { @ link job table job } is being closed


time spend by the execution framework on processing outputs

public duration process outputs time ( ) { return process outputs time ; }


invoked when the fallback method in { @ link hystrix invokable } emits a value

public < t > t on fallback emit ( hystrix invokable < t > command instance , t value ) { return value ; / / by default , just pass through }


return the path of storageemulated 0 androiddatapackagefiles

public static string get external app files path ( ) { if ( ! utils bridge is s d card enable by environment ( ) ) return " " ; return get absolute path ( utils get app ( ) get external files dir ( null ) ) ; }


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


override this method if you want to do something when the dialog is made visible

protected void dialog shown ( ) { / / may be overridden by subclasses }


explodes the plugin into a directory , if necessary

private static void explode ( file archive , file dest dir ) throws i o exception { dest dir mkdirs ( ) ; / / timestamp check file explode time = new file ( dest dir , " timestamp 2 " ) ; if ( explode time exists ( ) & & explode time last modified ( ) = = archive last modified ( ) ) return ; / / no need to expand / / delete the contents so that old files won ' t interfere with new files util delete recursive ( dest dir ) ; try { project prj = new project ( ) ; unzip except classes ( archive , dest dir , prj ) ; create class jar from web inf classes ( archive , dest dir , prj ) ; } catch ( build exception x ) { throw new i o exception ( " failed to expand " + archive , x ) ; } try { new file path ( explode time ) touch ( archive last modified ( ) ) ; } catch ( interrupted exception e ) { throw new assertion error ( e ) ; / / impossible } }


returns a suitable replacement base data - type for pointers and arrays when exporting to c code

data type get replacement base type ( ) ;


notepad pdb is here : < teexe notepad pdb xml does not exist repo location set to default location special case : even if repo location is set to a location that doesn ' t contain a pdb or pdb xml file , it will still be found if there is a file in the same folder as the binary on windows , pdb file should be found on non - windows , pdb file should be found

public void test find pdb 1 6 ( ) throws exception { created files = create files ( pdb location same as exe no subdir , pdb xml location none ) ; file pdb = pdb parser find p d b ( test program , false , no such symbols repo dir ) ; assert not null ( pdb ) ; assert equals ( pdb file , pdb ) ; }


protected int compare to 0 ( constant other ) { cst nat other nat = ( cst nat ) other ; int cmp = name compare to ( other nat name ) ; if ( cmp ! = 0 ) { return cmp ; } return descriptor compare to ( other nat descriptor ) ; }


creates hadoop cluster and dfs before a test case is run

public void set up ( ) throws exception { start cluster ( true , null ) ; }


test for the case when the application tag based placement is enabled and there is no placement rule defined for the user from the application tag expected behaviour : the placement is done for the submitting user ' user 1 '

public void test get user name for placement no rule defined ( ) throws yarn exception { string user = " user 1 " ; string expected user = user ; string user name from app tag = " user 2 " ; string wrong user id tag = user id prefix + user name from app tag ; set application tags ( " tag 1 " , wrong user id tag , " tag 2 " ) ; enable application tag placement ( true , user ) ; placement manager placement mgr = mock ( placement manager class ) ; when ( placement mgr place application ( as context , user name from app tag ) ) then return ( null ) ; string user name for placement = app monitor get user name for placement ( user , as context , placement mgr ) ; assert assert equals ( expected user , user name for placement ) ; }


returns the list of shutdown hooks in order of execution , highest priority first

list < hook entry > get shutdown hooks in order ( ) { list < hook entry > list ; synchronized ( hooks ) { list = new array list < > ( hooks ) ; } collections sort ( list , new comparator < hook entry > ( ) { / / reversing comparison so highest priority hooks are first @ override public int compare ( hook entry o 1 , hook entry o 2 ) { return o 2 priority - o 1 priority ; } } ) ; return list ; }


partitions the data into key - groups and returns the result via { @ link partitioning result }

public state snapshot state key group writer partition by key group ( ) { if ( computed result = = null ) { report all element key groups ( ) ; int output number of elements = build histogram by accumulating counts ( ) ; execute partitioning ( output number of elements ) ; } return computed result ; }


whether retry is supported when operation fails

boolean should retry ( int retried , long elapsed , boolean sleep ) ;


returns whether the object is the primary label at the address

public final boolean is primary ( ) { return is primary ; }


creates a writer for each output creates an output collector which forwards its input to all writers the output collector applies the configured shipping strategy

private void init outputs ( user code class loader cl ) throws exception { this chained tasks = new array list < chained driver < ? , ? > > ( ) ; this eventual outputs = new array list < record writer < ? > > ( ) ; this output = batch task init outputs ( this , cl , this config , this chained tasks , this eventual outputs , get execution config ( ) , get environment ( ) get accumulator registry ( ) get user map ( ) ) ; }


refreshes the value associated with { @ code key } , unless another thread is already doing so returns the newly refreshed value associated with { @ code key } if it was refreshed inline , or { @ code null } if another thread is performing the refresh or if an error occurs during refresh

v refresh ( k key , int hash , cache loader < ? super k , v > loader , boolean check time ) { final loading value reference < k , v > loading value reference = insert loading value reference ( key , hash , check time ) ; if ( loading value reference = = null ) { return null ; } listenable future < v > result = load async ( key , hash , loading value reference , loader ) ; if ( result is done ( ) ) { try { return uninterruptibles get uninterruptibly ( result ) ; } catch ( throwable t ) { / / don ' t let refresh exceptions propagate ; error was already logged } } return null ; }


test the property ' map of enum string '

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


mono < void > handle return value ( @ nullable object return value , method parameter return type , message < ? > message ) ;


< code > optional aapt pb string str = 2 ; < code >


returns the unique instance corresponding to the type with the given descriptor see vmspec - 2 sec 4 3 2 for details on the field descriptor syntax this method does not allow { @ code " v " } ( that is , type { @ code void } ) as a valid descriptor

public static type intern ( string descriptor ) { type result ; synchronized ( intern table ) { result = intern table get ( descriptor ) ; } if ( result ! = null ) { return result ; } char first char ; try { first char = descriptor char at ( 0 ) ; } catch ( index out of bounds exception ex ) { / / translate the exception throw new illegal argument exception ( " descriptor is empty " ) ; } catch ( null pointer exception ex ) { / / elucidate the exception throw new null pointer exception ( " descriptor = = null " ) ; } if ( first char = = ' [ ' ) { / * * recursively strip away array markers to get at the underlying * type , and build back on to form the result * / result = intern ( descriptor substring ( 1 ) ) ; return result get array type ( ) ; } / * * if the first character isn ' t ' [ ' and it wasn ' t found in the * intern cache , then it had better be the descriptor for a class * / int length = descriptor length ( ) ; if ( ( first char ! = ' l ' ) | | ( descriptor char at ( length - 1 ) ! = ' ; ' ) ) { throw new illegal argument exception ( " bad descriptor : " + descriptor ) ; } / * * validate the characters of the class name itself note that * vmspec - 2 does not have a coherent definition for valid * internal - form class names , and the definition here is fairly * liberal : a name is considered valid as long as it doesn ' t * contain any of ' [ ' ' ; ' ' ' ' ( ' ' ) ' , and it has no more than one * ' / ' in a row , and no ' / ' at either end * / int limit = ( length - 1 ) ; / / skip the final ' ; ' for ( int i = 1 ; i < limit ; i + + ) { char c = descriptor char at ( i ) ; switch ( c ) { case ' [ ' : case ' ; ' : case ' ' : case ' ( ' : case ' ) ' : { throw new illegal argument exception ( " bad descriptor : " + descriptor ) ; } case ' / ' : { if ( ( i = = 1 ) | | ( i = = ( length - 1 ) ) | | ( descriptor char at ( i - 1 ) = = ' / ' ) ) { throw new illegal argument exception ( " bad descriptor : " + descriptor ) ; } break ; } } } result = new type ( descriptor , bt object ) ; return put intern ( result ) ; }


public list < list < read only first > > get array array of model ( ) { return array array of model ; }


note : it should be guaranteed that { @ link # create result partition writer ( int ) } has been called before creating the receiver otherwise it might cause unexpected behaviors when { @ link org apache flink runtime io network partition partition not found exception } happens in { @ link single input gate benchmark factory test remote input channel }

public serializing long receiver create receiver ( ) throws exception { task manager location sender location = new task manager location ( resource i d generate ( ) , local address , data port ) ; input gate receiver gate = create input gate ( sender location ) ; serializing long receiver receiver = new serializing long receiver ( receiver gate , channels * partition ids length ) ; receiver start ( ) ; return receiver ; }


verifies bug fix for < a href = " https : jira spring iobrowse s p r - 11626 " > spr - 11626

void ensure mocks are reinjected between tests 2 ( ) { assert injected servlet request equals request in request context holder ( ) ; }


register m beans with the given { @ link m bean server }

public builder register with ( m bean server m bean server ) { this m bean server = m bean server ; return this ; }


private boolean r ( error e ) throws exception { throw e ; }


this setter exists since the aggregator ' s circuit - breaking accounting needs to be accessible from within the values - source problem is that this values - source needs to be created and passed to the aggregator before we have access to this functionality

public void set circuit breaker consumer ( long consumer circuit breaker consumer ) { this circuit breaker consumer = circuit breaker consumer ; }


public void wait active namespaces ( ) throws exception { for ( router context r : this routers ) { router router = r router ; final active namenode resolver resolver = router get namenode resolver ( ) ; for ( federation namespace info ns : resolver get namespaces ( ) ) { final string ns id = ns get nameservice id ( ) ; wait namenode registered ( resolver , ns id , federation namenode service state active ) ; } } }


adds mapping that will be added when the index gets created note that the definition should not be nested under a type name

public create index request mapping ( map < string , ? > source ) { try { x content builder builder = x content factory content builder ( x content type json ) ; builder map ( source ) ; return mapping ( bytes reference bytes ( builder ) , builder content type ( ) ) ; } catch ( i o exception e ) { throw new elasticsearch generation exception ( " failed to generate [ " + source + " ] " , e ) ; } }


see { @ link # friendly encode h t m l ( string ) }

private static string friendly encode h t m l ( string text , boolean skip leading whitespace ) { string builder buffer = new string builder ( ) ; int i = 0 ; int col = 0 ; if ( skip leading whitespace ) { for ( i = 0 ; i < text length ( ) ; i + + ) { / / skip leading spaces if ( ! character is whitespace ( text char at ( i ) ) ) { break ; } } } for ( ; i < text length ( ) ; i + + ) { char c = text char at ( i ) ; if ( c = = ' \ r ' ) { / / strip cr and reset column col = 0 ; continue ; } else if ( c = = ' \ n ' ) { buffer append ( c ) ; col = 0 ; continue ; } else if ( c = = ' \ t ' ) { int cnt = tab size - ( col % tab size ) ; for ( int k = 0 ; k < cnt ; k + + ) { buffer append ( html space ) ; } col = 0 ; continue ; } else if ( c = = ' ' ) { buffer append ( html space ) ; } else if ( c < ' ' ) { / / strip other non - printing chars continue ; } else if ( c > 0x 7 f ) { buffer append ( " & # x " ) ; buffer append ( integer to string ( c , 16 ) to upper case ( ) ) ; buffer append ( " ; " ) ; } else { switch ( c ) { case ' & ' : buffer append ( " & amp ; " ) ; break ; case ' < ' : buffer append ( " & lt ; " ) ; break ; case ' > ' : buffer append ( " & gt ; " ) ; break ; case 0x 7 f : break ; default : buffer append ( c ) ; break ; } } + + col ; } return buffer to string ( ) ; }


equivalent to using { @ link # negotiation type ( negotiation type ) } with { @ code plaintext }

public netty channel builder use plaintext ( ) { negotiation type ( negotiation type plaintext ) ; return this ; }


returns if the cache expires entries after a variable time threshold

protected boolean expires variable ( ) { return false ; }


public void 1 2 3number test ( ) { / / todo : test 1 2 3number }


checks that the given options allow an insecure delete , throwing an exception if not

private static void check allows insecure ( path path , recursive delete option [ ] options ) throws insecure recursive delete exception { if ( ! arrays as list ( options ) contains ( recursive delete option allow insecure ) ) { throw new insecure recursive delete exception ( path to string ( ) ) ; } }


schedules a set media items action to be executed

public builder set media sources ( media source media sources ) { return apply ( new action set media items ( tag , / * window index = * / c index unset , / * position ms = * / c time unset , media sources ) ) ; }


public void test string field with empty value serialization ( ) { class with empty string fields target = new class with empty string fields ( ) ; target a = " 5794749 " ; string json = gson to json ( target ) ; assert true ( json contains ( " \ " a \ " : \ " 5794749 \ " " ) ) ; assert true ( json contains ( " \ " b \ " : \ " \ " " ) ) ; assert true ( json contains ( " \ " c \ " : \ " \ " " ) ) ; }


adds a new element to the appropriate place in the elements array

int add internal ( element new element , element [ ] add elements ) { int slot = slot ( add elements , new element ) ; for ( int seen = 0 ; seen < add elements length ; seen + + ) { element element = add elements [ slot ] ; if ( element = = null ) { add elements [ slot ] = new element ; return slot ; } if ( element = = new element ) { return invalid index ; } slot = ( slot + 1 ) % add elements length ; } throw new runtime exception ( " not enough hash table slots to add a new element " ) ; }


draws a circle outline with the center at x , y and a radius using the current color and stroke width

public void draw circle ( int x , int y , int radius ) { pixmap draw circle ( x , y , radius , color ) ; }


get the value of the < code > name < code > property as a < code > boolean < code > if no such property is specified , or if the specified value is not a valid < code > boolean < code > , then < code > default value < code > is returned

public boolean get boolean ( string name , boolean default value ) { string value string = get trimmed ( name ) ; if ( null = = value string | | value string is empty ( ) ) { return default value ; } if ( string utils equals ignore case ( " true " , value string ) ) return true ; else if ( string utils equals ignore case ( " false " , value string ) ) return false ; else { log warn ( " invalid value for boolean : " + value string + " , choose default value : " + default value + " for " + name ) ; return default value ; } }


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


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

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


public http response do snooze ( ) throws i o exception { jenkins get ( ) check permission ( jenkins administer ) ; file f = setup wizard get update state file ( ) ; file utils touch ( f ) ; f set last modified ( system current time millis ( ) + time unit days to millis ( 1 ) ) ; logger log ( fine , " snoozed the upgrade wizard notice " ) ; return http responses redirect to context root ( ) ; }


detects the socket mode , see comments at the top of the class for more details this operation will block for up to { @ link x 5 0 9 util # get ssl handshake timeout millis ( ) } milliseconds and should not be called in the accept ( ) thread if possible

private void detect mode ( ) throws i o exception { byte [ ] litmus = new byte [ 5 ] ; int old timeout = - 1 ; int bytes read = 0 ; int new timeout = x 5 0 9 util get ssl handshake timeout millis ( ) ; try { old timeout = prependable socket get so timeout ( ) ; prependable socket set so timeout ( new timeout ) ; bytes read = prependable socket get input stream ( ) read ( litmus , 0 , litmus length ) ; } catch ( socket timeout exception e ) { / / didn ' t read anything within the timeout , fallthrough and assume the connection is plaintext log warn ( " socket mode detection timed out after { } ms , assuming plaintext " , new timeout ) ; } finally { / / restore socket timeout to the old value try { if ( old timeout ! = - 1 ) { prependable socket set so timeout ( old timeout ) ; } } catch ( exception e ) { log warn ( " failed to restore old socket timeout value of { } ms " , old timeout , e ) ; } } if ( bytes read < 0 ) { / / got a eof right away , definitely not using tls fallthrough bytes read = 0 ; } if ( bytes read = = litmus length & & ssl handler is encrypted ( unpooled wrapped buffer ( litmus ) ) ) { try { ssl socket = x 5 0 9 util create s s l socket ( prependable socket , litmus ) ; } catch ( x 5 0 9 exception e ) { throw new i o exception ( " failed to create ssl context " , e ) ; } prependable socket = null ; mode = mode tls ; log info ( " accepted tls connection from { } - { } - { } " , ssl socket get remote socket address ( ) , ssl socket get session ( ) get protocol ( ) , ssl socket get session ( ) get cipher suite ( ) ) ; } else if ( allow insecure connection ) { prependable socket prepend to input stream ( litmus , 0 , bytes read ) ; mode = mode plaintext ; log info ( " accepted plaintext connection from { } " , prependable socket get remote socket address ( ) ) ; } else { prependable socket close ( ) ; mode = mode plaintext ; throw new i o exception ( " blocked insecure connection attempt " ) ; } }


resolves the given parameter type and value name into an argument value

protected abstract object resolve argument internal ( method parameter parameter , message < ? > message , string name ) throws exception ;


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


visits information about an inner class this inner class is not necessarily a member of the class being visited

public void visit inner class ( final string name , final string outer name , final string inner name , final int access ) { if ( cv ! = null ) { cv visit inner class ( name , outer name , inner name , access ) ; } }


returns true if this highlight object is equal to the other ( compares x index and data set index )

public boolean equal to ( highlight h ) { if ( h = = null ) return false ; else { if ( this m data set index = = h m data set index & & this m x = = h m x & & this m stack index = = h m stack index & & this m data index = = h m data index ) return true ; else return false ; } }


void delete references ( program program , reference [ ] refs ) { compound cmd cmd = new compound cmd ( " remove reference ( s ) " ) ; for ( reference ref : refs ) { cmd add ( new remove reference cmd ( ref ) ) ; } tool execute ( cmd , program ) ; }


public void set heap usage ( long usage ) { heap usage = usage ; }


sets a listener for program location changes for the right side ' s listing panel

public void set right program location listener ( program location listener program location listener ) { listing panels [ right ] set program location listener ( program location listener ) ; }


outputs the formatted help to standard out

void output help ( ) { if ( ! should output help ( ) ) { return ; } if ( source ! = null ) { help formatter hlp = new help formatter ( ) ; hlp print help ( constants prog name + " " + constants prog version , source get option list ( ) ) ; } }


authenticates the provided credentials on success , an { @ link authentication } object is returned containing metadata about the result of each authenticated credential note that a particular implementation may require some or all credentials to be successfully authenticated failure to authenticate is considered an exceptional case , and an authentication exception is thrown

authentication authenticate ( authentication transaction authentication transaction ) throws authentication exception ;


applies a touch down event to the stage and returns true if an actor in the scene { @ link event # handle ( ) handled } the event

public boolean touch down ( int screen x , int screen y , int pointer , int button ) { if ( ! is inside viewport ( screen x , screen y ) ) return false ; pointer touched [ pointer ] = true ; pointer screen x [ pointer ] = screen x ; pointer screen y [ pointer ] = screen y ; screen to stage coordinates ( temp coords set ( screen x , screen y ) ) ; input event event = pools obtain ( input event class ) ; event set type ( type touch down ) ; event set stage ( this ) ; event set stage x ( temp coords x ) ; event set stage y ( temp coords y ) ; event set pointer ( pointer ) ; event set button ( button ) ; actor target = hit ( temp coords x , temp coords y , true ) ; if ( target = = null ) { if ( root get touchable ( ) = = touchable enabled ) root fire ( event ) ; } else target fire ( event ) ; boolean handled = event is handled ( ) ; pools free ( event ) ; return handled ; }


add a path - prefix to the routes declared in the route group the path ( ) method adds a path - fragment to a path - stack , adds routes from the route group , then pops the path - fragment again it ' s used for separating routes into groups , for example : path ( " apiemail " , ( ) - > { post ( " add " , email api : : add email ) ; put ( " change " , email api : : change email ) ; etc } ) ; multiple path ( ) calls can be nested

public void path ( string path , route group route group ) { path deque add last ( path ) ; route group add routes ( ) ; path deque remove last ( ) ; }


parse geotile hash as zoom , x , y integers

private static int [ ] parse hash ( long hash ) { final int zoom = ( int ) ( hash > > > zoom shift ) ; final int x tile = ( int ) ( ( hash > > > max zoom ) & x y value mask ) ; final int y tile = ( int ) ( hash & x y value mask ) ; return new int [ ] { zoom , x tile , y tile } ; }


remove resources ( already identified by { @ link # shrink ( path ) } ) this task will copy all remaining used resources over from the full resource directory to a new reduced resource directory and removes unused values from all value xml files

private void remove unused ( path destination ) throws i o exception , parser configuration exception , s a x exception { assert unused ! = null ; / / should always call analyze ( ) first int resource count = unused size ( ) * 4 ; / / * 4 : account for some resource folder repetition set < file > skip = sets new hash set with expected size ( resource count ) ; set < file > rewrite = sets new hash set with expected size ( resource count ) ; set < resource > deleted = sets new hash set with expected size ( resource count ) ; for ( resource resource : unused ) { if ( resource declarations ! = null ) { for ( file file : resource declarations ) { string folder = file get parent file ( ) get name ( ) ; resource folder type folder type = resource folder type get folder type ( folder ) ; if ( folder type ! = null & & folder type ! = resource folder type values ) { list < resource type > types = folder type relationship get related resource types ( folder type ) ; resource type type = types get ( 0 ) ; assert type ! = resource type id : folder type ; resource file resource = model get resource ( type , lint utils get base name ( file get name ( ) ) ) ; / / only delete the file if there is no owning resource or this is the owning resource of / / the file , i e not an id declared within it , because id declarations are not / / considered uses and would otherwise cause deletion of the file if ( file resource = = null | | file resource equals ( resource ) ) { logger fine ( " deleted unused file " + file + " for resource " + resource ) ; assert skip ! = null ; skip add ( file ) ; deleted add ( resource ) ; } } else { / / can ' t delete values immediately ; there can be many resources / / in this file , so we have to process them all rewrite add ( file ) ; } } } else { / / not declared anywhere ; mark as deleted covers the case of inline resources / / https : / / developer android com / guide / topics / resources / complex - xml - resources html deleted add ( resource ) ; } } / / special case the base values xml folder file values = new file ( merged resource dir to file ( ) , fd res values + file separator char + " values xml " ) ; if ( values exists ( ) ) { rewrite add ( values ) ; } map < file , string > rewritten = maps new hash map with expected size ( rewrite size ( ) ) ; rewrite xml ( rewrite , rewritten , deleted ) ; / / todo ( apell ) : the graph traversal does not mark i ds as reachable or not , so they cannot be / / accurately removed from public xml , but the definitions may be deleted if they occur in / / other files i ds should be added to values xml so that there are no declarations in / / public xml without definitions file public xml = new file ( merged resource dir to file ( ) , fd res values + file separator char + " public xml " ) ; create stub ids ( values , rewritten , public xml ) ; trim public resources ( public xml , deleted , rewritten ) ; filtered copy ( merged resource dir to file ( ) , destination , skip , rewritten ) ; }


public static bitmap rotate ( final bitmap src , final int degrees , final float px , final float py , final boolean recycle ) { if ( is empty bitmap ( src ) ) return null ; if ( degrees = = 0 ) return src ; matrix matrix = new matrix ( ) ; matrix set rotate ( degrees , px , py ) ; bitmap ret = bitmap create bitmap ( src , 0 , 0 , src get width ( ) , src get height ( ) , matrix , true ) ; if ( recycle & & ! src is recycled ( ) & & ret ! = src ) src recycle ( ) ; return ret ; }


pop up a dialog to expand the block either up or down ; " up " means make a block have a lesser starting address ; " down " means to make the block have a greater ending address

private void expand block ( int dialog type ) { memory block block = get selected block ( ) ; if ( block = = null ) { return ; } if ( block is overlay ( ) ) { msg show info ( get class ( ) , get component ( ) , " expand overlay block not allowed " , " overlay blocks cannot be expanded " ) ; } else { show expand block dialog ( dialog type , block ) ; } }


{ @ inherit doc } the default implementation returns the result of calling { @ link # visit children } on { @ code ctx }

@ override public t visit trailer ( painless parser trailer context ctx ) { return visit children ( ctx ) ; }


matches if the expected { @ code type serializer schema compatibility } has the same compatibility as { @ code expected compatibility }

public static < t > matcher < type serializer schema compatibility < t > > has same compatibility as ( type serializer schema compatibility < t > expected compatibility ) { return new schema compatibility same as < > ( expected compatibility ) ; }


returns the current age of the response , in milliseconds the calculation is specified by rfc 2616 , 13 2 3 age calculations

private long compute age ( long now millis ) { long apparent received age = served date ! = null ? math max ( 0 , received response millis - served date get time ( ) ) : 0 ; long received age = age seconds ! = - 1 ? math max ( apparent received age , time unit seconds to millis ( age seconds ) ) : apparent received age ; long response duration = received response millis - sent request millis ; long resident duration = now millis - received response millis ; return received age + response duration + resident duration ; }


run the fsck command using the specified params

public static string run fsck ( configuration conf , int expected err code , boolean check error code , string path ) throws exception { byte array output stream b stream = new byte array output stream ( ) ; print stream out = new print stream ( b stream , true ) ; int err code = tool runner run ( new d f sck ( conf , out ) , path ) ; if ( check error code ) { assert equals ( expected err code , err code ) ; } return b stream to string ( ) ; }


set the < code > container retry context < code > to relaunch container

public abstract void set container retry context ( container retry context container retry context ) ;


public void test proc time temporal join ( ) throws exception { temporal process time join operator join operator = new temporal process time join operator ( row type , join condition , 0 , 0 , false ) ; keyed two input stream operator test harness < row data , row data , row data , row data > test harness = create test harness ( join operator ) ; test harness open ( ) ; test harness set processing time ( 1 ) ; test harness process element 1 ( insert record ( 1l , " 1a 1 " ) ) ; test harness set processing time ( 2 ) ; test harness process element 2 ( insert record ( 2l , " 2a 2 " ) ) ; test harness set processing time ( 3 ) ; test harness process element 1 ( insert record ( 2l , " 2a 3 " ) ) ; test harness set processing time ( 4 ) ; test harness process element 2 ( insert record ( 1l , " 1a 4 " ) ) ; test harness set processing time ( 5 ) ; test harness process element 1 ( insert record ( 1l , " 1a 5 " ) ) ; list < object > expected output = new array list < > ( ) ; expected output add ( insert record ( 2l , " 2a 3 " , 2l , " 2a 2 " ) ) ; expected output add ( insert record ( 1l , " 1a 5 " , 1l , " 1a 4 " ) ) ; assertor assert output equals ( " output wrong " , expected output , test harness get output ( ) ) ; test harness close ( ) ; }


get the merged active bean definition profiles for the { @ linkplain # get test class ( ) test class }

public string [ ] get active profiles ( ) { return this active profiles ; }


public string get asc or desc ( ) { return asc or desc ; }


optional : default value is ( char sequence ) null

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


returns variables assigned by each iteration may be a compound target such as { @ code ( a [ b ] , c d ) }

public expression get vars ( ) { return vars ; }


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

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


send a { @ link android util log # warn } log message


calculate the { @ link bounding box } of the specified part

public bounding box calculate bounding box ( final bounding box out , int offset , int count , final matrix 4 transform ) { return extend bounding box ( out inf ( ) , offset , count , transform ) ; }


public void get user by name test ( ) { string username = null ; / / user response = api get user by name ( username ) ; / / todo : test validations }


public int get pending data node message count ( ) { return pending d n messages count ( ) ; }


invokes { @ code executor } { @ link executor service # await termination ( long , time unit ) await termination ( long , time unit ) } uninterruptibly

public static boolean await termination uninterruptibly ( executor service executor , long timeout , time unit unit ) { boolean interrupted = false ; try { long remaining nanos = unit to nanos ( timeout ) ; long end = system nano time ( ) + remaining nanos ; while ( true ) { try { return executor await termination ( remaining nanos , nanoseconds ) ; } catch ( interrupted exception e ) { interrupted = true ; remaining nanos = end - system nano time ( ) ; } } } finally { if ( interrupted ) { thread current thread ( ) interrupt ( ) ; } } }


public void test gauge ( gauge gauge , string name , string [ ] tags , double val ) { / / check meter name assert assert equals ( name , gauge get name ( ) ) ; / / check tags if ( tags ! = null & & tags length > 0 ) { for ( int inx = 0 ; inx < tags length ; inx + = 2 ) { assert assert equals ( tags [ inx + 1 ] , gauge get tag ( tags [ inx ] ) ) ; } } / / check current value assert assert equals ( val , gauge get ( ) , 0 0 ) ; }


checks if there are overlapping entries in the given logs

private static boolean has overlapping log entries ( log entries first log , log entries second log ) { for ( log entry first entry : first log ) { for ( log entry second entry : second log ) { if ( first entry get level ( ) get name ( ) equals ( second entry get level ( ) get name ( ) ) & & first entry get message ( ) equals ( second entry get message ( ) ) & & first entry get timestamp ( ) = = second entry get timestamp ( ) ) { return true ; } } } return false ; }


check if there is a disk failure asynchronously and if so , handle the error

public void check disk error async ( fs volume spi volume ) { volume checker check volume ( volume , ( healthy volumes , failed volumes ) - > { if ( failed volumes size ( ) > 0 ) { log warn ( " check disk error async callback got { } failed volumes : { } " , failed volumes size ( ) , failed volumes ) ; } else { log debug ( " check disk error async : no volume failures detected " ) ; } last disk error check = time monotonic now ( ) ; handle volume failures ( failed volumes ) ; } ) ; }


void blocked ( http servlet request request , http servlet response response , block exception ex ) throws i o exception ;


any message that enters this { @ link org springframework messaging message handler } containing a { @ code execution id } parameter will trigger a { @ link org activiti engine runtime service # signal event received ( string ) }

public static message handler signalling message handler ( final process engine process engine ) { return new message handler ( ) { @ override public void handle message ( message < ? > message ) throws messaging exception { string execution id = message get headers ( ) contains key ( " execution id " ) ? ( string ) message get headers ( ) get ( " execution id " ) : ( string ) null ; if ( null ! = execution id ) process engine get runtime service ( ) trigger ( execution id ) ; } } ; }


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

public com google protobuf byte string get comment bytes ( ) { return com google protobuf byte string copy from utf 8 ( comment ) ; }


we need to override the renderer for the following cases : italicize tags that cannot be edited disable rows in the source table that have already been added to the selected function

public table cell renderer get cell renderer ( int row , int col ) { return renderer ; }


public object get anytype 1 ( ) { return anytype 1 ; }


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

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


add terminalreturn ( consumes 2 - bytes )

public void add bytes return ( long offset ) throws memory access exception { add bytes return ( to hex ( offset ) ) ; }


public flow executor build ( ) { if ( webflow properties get session ( ) is storage ( ) ) { return build flow executor via server session binding execution ( ) ; } return build flow executor via client flow execution ( ) ; }


this implementation returns { @ code true } if a property with the given name or any underscoreuppercase variant thereof exists in this property source

public object get property ( string name ) { string actual name = resolve property name ( name ) ; if ( logger is debug enabled ( ) & & ! name equals ( actual name ) ) { logger debug ( " property source ' " + get name ( ) + " ' does not contain property ' " + name + " ' , but found equivalent ' " + actual name + " ' " ) ; } return super get property ( actual name ) ; }


create a new initialized { @ link open ssl x 5 0 9 key manager factory } which loads its { @ link private key } directly from an { @ code open s s l engine } via the < a href = " https : www openssl orgdocsman 1 1 0crypto e n g i n e load private key html " > engine load private key function

public static open ssl x 5 0 9 key manager factory new engine based ( file certificate chain , string password ) throws certificate exception , i o exception , key store exception , no such algorithm exception , unrecoverable key exception { return new engine based ( ssl context to x 5 0 9 certificates ( certificate chain ) , password ) ; }


pause ( stop ) polling polling can be started again with < code > start < code > as long as < code > shutdown < code > is not called

public synchronized void pause ( ) { / / use compare and set to make sure it stops only once and when running if ( running compare and set ( true , false ) ) { logger debug ( " stopping the hystrix metrics poller " ) ; scheduled task cancel ( true ) ; } else { logger debug ( " attempted to pause a stopped poller " ) ; } }


check whether a temporary system function is already registered

public boolean has temporary system function ( string function name ) { return temp system functions contains key ( function name ) ; }


loads the given pro guard configuration into the gui

private void load configuration ( file file ) { / / set the default directory and file in the file choosers configuration chooser set selected file ( file get absolute file ( ) ) ; file chooser set current directory ( file get absolute file ( ) get parent file ( ) ) ; try { / / parse the configuration file configuration parser parser = new configuration parser ( file , system get properties ( ) ) ; configuration configuration = new configuration ( ) ; try { parser parse ( configuration ) ; / / let the gui reflect the configuration set pro guard configuration ( configuration ) ; } catch ( parse exception ex ) { j option pane show message dialog ( get content pane ( ) , msg ( " cant parse configuration file " , file get path ( ) ) , msg ( " warning " ) , j option pane error message ) ; } finally { parser close ( ) ; } } catch ( i o exception ex ) { j option pane show message dialog ( get content pane ( ) , msg ( " cant open configuration file " , file get path ( ) ) , msg ( " warning " ) , j option pane error message ) ; } }


private d add last ( d diff ) { create diffs if needed ( ) ; final d last = get last ( ) ; diffs add last ( diff ) ; if ( last ! = null ) { last set posterior ( diff ) ; } return diff ; }


performs the post - build action this method is called after { @ linkplain # run ( build listener ) the main portion of the build is completed } this is a good opportunity to do notifications based on the result of the build when this method is called , the build is not really finalized yet , and the build is still considered in progress - - - for example , even if the build is successful , this build still won ' t be picked up by { @ link job # get last successful build ( ) }

public abstract void post ( @ non null build listener listener ) throws exception ;


returns a new instance configured with a default encode set for the ascii range the specific rules vary per - component : for example , ' ? ' may be identity - encoded in a fragment , but must be percent - encoded in a path see https : url spec whatwg org # percent - encoded - bytes

public static url component encoding tester new instance ( ) { return new url component encoding tester ( ) all ascii ( encoding identity ) non printable ascii ( encoding percent ) override ( encoding skip , ' \ t ' , ' \ n ' , ' \ f ' , ' \ r ' ) override ( encoding percent , ' ' , ' " ' , ' # ' , ' < ' , ' > ' , ' ? ' , ' ` ' ) override ( encoding percent , unicode 2 , unicode 3 , unicode 4 ) ; }


adds a field as having only unique values

public void add unique field ( int field ) { if ( this unique fields = = null ) { this unique fields = new hash set < field set > ( ) ; } this unique fields add ( new field set ( field ) ) ; }


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


public string to human ( ) { throw new runtime exception ( " unsupported " ) ; }


tests that if a non idempotent operation fails at every attempt after socket timeout exception , then socket timeout exception is thrown

public void test client retries idempotent op with socket timeout exception fails ( ) throws exception { configuration conf = new configuration ( ) ; conf set int ( common configuration keys public kms client failover max retries key , 2 ) ; final string key name = " test " ; final string exception message = " p 1 exception message " ; k m s client provider p 1 = mock ( k m s client provider class ) ; exception original ex = new socket timeout exception ( exception message ) ; when ( p 1 get key versions ( mockito any string ( ) ) ) then throw ( original ex ) ; k m s client provider p 2 = mock ( k m s client provider class ) ; when ( p 2 get key versions ( mockito any string ( ) ) ) then throw ( new socket timeout exception ( " p 2 exception message " ) ) ; when ( p 1 get k m s url ( ) ) then return ( " p 1 " ) ; when ( p 2 get k m s url ( ) ) then return ( " p 2 " ) ; load balancing k m s client provider kp = new load balancing k m s client provider ( new k m s client provider [ ] { p 1 , p 2 } , 0 , conf ) ; exception intercepted ex = intercept ( socket timeout exception class , " socket timeout exception : " + exception message , ( ) - > kp get key versions ( key name ) ) ; assert equals ( original ex , intercepted ex ) ; verify ( p 1 , mockito times ( 2 ) ) get key versions ( mockito eq ( key name ) ) ; verify ( p 2 , mockito times ( 1 ) ) get key versions ( mockito eq ( key name ) ) ; }


public http headers get headers ( ) { return this headers ; }


sorts the elements of { @ code array } between { @ code from index } inclusive and { @ code to index } exclusive in descending order , interpreting them as unsigned 8 - bit integers

public static void sort descending ( byte [ ] array , int from index , int to index ) { check not null ( array ) ; check position indexes ( from index , to index , array length ) ; for ( int i = from index ; i < to index ; i + + ) { array [ i ] ^ = byte max value ; } arrays sort ( array , from index , to index ) ; for ( int i = from index ; i < to index ; i + + ) { array [ i ] ^ = byte max value ; } }


notification callback when server connection state changes

public void connection state changed ( object adapter ) { synchronized ( server adapter ) { if ( ! server adapter is connected ( ) ) { disconnect ( server adapter had unexpected disconnect ( ) , true ) ; } else { try { connect ( ) ; } catch ( i o exception e ) { / / todo : handle failed connect ? } } } }


required if mode is ` simple ` or ` mutual ` the path to the file holding the server - side tls certificate to use < code > string server certificate = 3 ; < code >

public com google protobuf byte string get server certificate bytes ( ) { java lang object ref = server certificate ; if ( ref instanceof string ) { com google protobuf byte string b = com google protobuf byte string copy from utf 8 ( ( java lang string ) ref ) ; server certificate = b ; return b ; } else { return ( com google protobuf byte string ) ref ; } }


creates a field with " xref [ m , n ] : " < br > where : < br > m is the number of cross references < br > n is the number of off - cut cross references < br > < br >

private string get x ref header string ( object obj ) { if ( obj = = null | | ! ( obj instanceof variable ) ) { return null ; } variable var = ( variable ) obj ; int xref count = 0 ; int offcut count = 0 ; varnode varnode = var get first storage varnode ( ) ; if ( varnode = = null ) { return null ; } address var addr = varnode get address ( ) ; program program = var get function ( ) get program ( ) ; reference manager ref mgr = program get reference manager ( ) ; reference [ ] vrefs = ref mgr get references to ( var ) ; for ( reference vref : vrefs ) { if ( vref get to address ( ) equals ( var addr ) ) { xref count + + ; } else { offcut count + + ; } } if ( xref count > 0 | | offcut count > 0 ) { if ( offcut count > 0 ) { return " xref [ " + xref count + " , " + offcut count + " ] : " ; } return " xref [ " + xref count + " ] : " ; } return null ; }


looks up the { @ link scheduling result partition } for the given { @ link intermediate result partition i d }

scheduling result partition get result partition ( intermediate result partition i d intermediate result partition id ) ;


returns the appropriate instantiation of a local folder item based upon a specified property file which resides within a local file system

static local folder item get folder item ( local file system file system , property file property file ) { int file type = property file get int ( file type , unknown file type ) ; try { if ( file type = = datafile file type ) { return new local data file ( file system , property file ) ; } else if ( file type = = database file type ) { return new local database item ( file system , property file ) ; } } catch ( file not found exception e ) { log error ( " item may be corrupt due to missing file : " + property file get path ( ) , e ) ; } catch ( i o exception e ) { log error ( " item may be corrupt : " + property file get path ( ) , e ) ; } return new unknown folder item ( file system , property file ) ; }


return the { @ link counter } registered under this name ; or create and register a new { @ link counter } using the provided metric supplier if none is registered

public counter counter ( string name , final metric supplier < counter > supplier ) { return get or add ( name , new metric builder < counter > ( ) { @ override public counter new metric ( ) { return supplier new metric ( ) ; } @ override public boolean is instance ( metric metric ) { return counter class is instance ( metric ) ; } } ) ; }


protected abstract int allocate shard ( final data data ) ;


add a listener which will be listening for changes in this view ( i e collapsed or expanded )

public void add listener ( final state listener listener ) { if ( listeners contains ( listener ) ) { throw new illegal state exception ( " trying to add the same listener multiple times " ) ; } listeners add ( listener ) ; }


sets the width used for drawing borders around the bars if border width = = 0 , no border will be drawn

public void set bar border width ( float width ) { m bar border width = width ; }


utility method for asserting that a list contains the elements of a sublist this is useful for checking that a list of arguments contains a particular set of arguments

protected void assert contains sublist ( list < string > list , list < string > sublist ) { assert contains sublist ( null , list , sublist ) ; }


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


public long count ( ) { long current second = time unit nanoseconds to seconds ( system nano time ( ) ) ; return count ( current second ) ; }


start a list of containers on this node manager

public start containers response start containers ( start containers request requests ) throws yarn exception , i o exception { user group information remote ugi = get remote ugi ( ) ; string remote user = remote ugi get user name ( ) ; n m token identifier nm token identifier = select n m token identifier ( remote ugi ) ; authorize user ( remote ugi , nm token identifier ) ; list < container id > succeeded containers = new array list < container id > ( ) ; map < container id , serialized exception > failed containers = new hash map < container id , serialized exception > ( ) ; / / synchronize with node status updater impl # register with r m / / to avoid race condition during nm - rm resync ( due to rm restart ) while a / / container is being started , in particular when the container has not yet / / been added to the containers map in n m context synchronized ( this context ) { for ( start container request request : requests get start container requests ( ) ) { container id container id = null ; try { if ( request get container token ( ) = = null | | request get container token ( ) get identifier ( ) = = null ) { throw new i o exception ( invalid containertoken msg ) ; } container token identifier container token identifier = builder utils new container token identifier ( request get container token ( ) ) ; verify and get container token identifier ( request get container token ( ) , container token identifier ) ; container id = container token identifier get container i d ( ) ; / / initialize the a m r m proxy service instance only if the container is of / / type am and if the a m r m proxy service is enabled if ( amrm proxy enabled & & container token identifier get container type ( ) equals ( container type application master ) ) { this get a m r m proxy service ( ) process application start request ( request ) ; } perform container pre start checks ( nm token identifier , request , container token identifier ) ; start container internal ( container token identifier , request , remote user ) ; succeeded containers add ( container id ) ; } catch ( yarn exception e ) { failed containers put ( container id , serialized exception new instance ( e ) ) ; } catch ( invalid token ie ) { failed containers put ( container id , serialized exception new instance ( ie ) ) ; throw ie ; } catch ( i o exception e ) { throw r p c util get remote exception ( e ) ; } } return start containers response new instance ( get aux service meta data ( ) , succeeded containers , failed containers ) ; } }


public void auto dreg dom clusters test ( ) throws exception { string service name = random domain name ( ) ; naming register instance ( service name , " 127 0 0 1 " , test port , " c 1 " ) ; naming register instance ( service name , " 127 0 0 2 " , test port , " c 2 " ) ; time unit seconds sleep ( 5 ) ; list < instance > instances ; instances = naming get all instances ( service name ) ; assert assert equals ( 2 , instances size ( ) ) ; nacos naming service naming service impl = ( nacos naming service ) naming ; naming service impl get beat reactor ( ) remove beat info ( constants default group + constants service info spliter + service name , " 127 0 0 1 " , test port ) ; verify instance list ( instances , 1 , service name ) ; instances = naming get all instances ( service name ) ; assert assert equals ( 1 , instances size ( ) ) ; instances = naming get all instances ( service name , arrays as list ( " c 2 " ) ) ; assert assert equals ( 1 , instances size ( ) ) ; instances = naming get all instances ( service name , arrays as list ( " c 1 " ) ) ; assert assert equals ( 0 , instances size ( ) ) ; }


this private method normalizes the key by stripping the container name from the path and returns a path relative to the root directory of the container

private string normalize key ( uri key uri ) { string norm key ; / / strip the container name from the path and return the path / / relative to the root directory of the container int parts = is storage emulator ? 4 : 3 ; norm key = key uri get path ( ) split ( " / " , parts ) [ ( parts - 1 ) ] ; / / return the fixed key return norm key ; }


return the target class behind the implementing object ( typically a proxy configuration or an actual proxy )


creates a new data set that contains the given elements the framework will determine the type according to the based type user supplied the elements should be the same or be the subclass to the based type the sequence of elements must not be empty note that this operation will result in a non - parallel data source , i e a data source with a parallelism of one

public final < x > data source < x > from elements ( class < x > type , x data ) { if ( data = = null ) { throw new illegal argument exception ( " the data must not be null " ) ; } if ( data length = = 0 ) { throw new illegal argument exception ( " the number of elements must not be zero " ) ; } type information < x > type info ; try { type info = type extractor get for class ( type ) ; } catch ( exception e ) { throw new runtime exception ( " could not create type information for type " + type get name ( ) + " ; please specify the type information manually via " + " execution environment # from elements ( collection , type information ) " , e ) ; } return from collection ( arrays as list ( data ) , type info , utils get call location name ( ) ) ; }


returns the { @ code bnd addr } field of this response


calculates the y - coordinate in the tile grid for the specified longitude given the number of tile rows for pre - determined zoom - level

public static int get y tile ( double latitude , long tiles ) { double lat sin = sloppy math cos ( pi div 2 - math to radians ( normalize lat ( latitude ) ) ) ; int y tile = ( int ) math floor ( ( 0 5 - ( math log ( ( 1 + lat sin ) / ( 1 - lat sin ) ) / ( 4 * math pi ) ) ) * tiles ) ; if ( y tile < 0 ) { y tile = 0 ; } if ( y tile > = tiles ) { return ( int ) tiles - 1 ; } return y tile ; }


variant of { @ link # metadata to extract ( mime type , class , string ) } that allows custom logic to be used to map the decoded value to any number of values in the output map

< t > void metadata to extract ( mime type mime type , class < t > target type , bi consumer < t , map < string , object > > mapper ) ;


ensures the actor has been laid out calls { @ link # layout ( ) } if { @ link # invalidate ( ) } has been called since the last time { @ link # validate ( ) } was called , or if the actor otherwise needs to be laid out this method is usually called in { @ link actor # draw ( batch , float ) } by the actor itself before drawing is performed


merge byte ranges on each internal block into a set of inclusive { @ link aligned stripe } instances

private static aligned stripe [ ] merge ranges for internal blocks ( erasure coding policy ec policy , vertical range [ ] ranges , located striped block block group , int cell size ) { int data blk num = ec policy get num data units ( ) ; int parity blk num = ec policy get num parity units ( ) ; list < aligned stripe > stripes = new array list < > ( ) ; sorted set < long > stripe points = new tree set < > ( ) ; for ( vertical range r : ranges ) { if ( r ! = null ) { stripe points add ( r offset in block ) ; stripe points add ( r offset in block + r span in block ) ; } } / / add block group last cell offset in stripe points if it is fall in to read / / offset range int last cell idx in b g = ( int ) ( block group get block size ( ) / cell size ) ; int idx in internal blk = last cell idx in b g / ec policy get num data units ( ) ; long last cell end offset = ( idx in internal blk * ( long ) cell size ) + ( block group get block size ( ) % cell size ) ; if ( stripe points first ( ) < last cell end offset & & stripe points last ( ) > last cell end offset ) { stripe points add ( last cell end offset ) ; } long prev = - 1 ; for ( long point : stripe points ) { if ( prev > = 0 ) { stripes add ( new aligned stripe ( prev , point - prev , data blk num + parity blk num ) ) ; } prev = point ; } return stripes to array ( new aligned stripe [ stripes size ( ) ] ) ; }


returns the file system based { @ link file fingerprint storage } configured on the system

public static fingerprint storage get file fingerprint storage ( ) { return extension list lookup ( fingerprint storage class ) get ( extension list lookup ( fingerprint storage class ) size ( ) - 1 ) ; }


perform parsing and applying of enum datatypes

static void apply to ( xml pull parser xml parser , pdb parser pdb parser , task monitor monitor , message log log ) throws cancelled exception { monitor set message ( " applying enums " ) ; while ( xml parser has next ( ) ) { monitor check canceled ( ) ; xml element elem = xml parser next ( ) ; if ( elem is end ( ) & & elem get name ( ) equals ( " enums " ) ) { break ; } string name = symbol utilities replace invalid chars ( elem get attribute ( " name " ) , false ) ; int length = xml utilities parse int ( elem get attribute ( " length " ) ) ; enum data type enumdt = pdb parser create enum ( name , length ) ; while ( xml parser has next ( ) ) { if ( monitor is cancelled ( ) ) { break ; } elem = xml parser next ( ) ; if ( elem is end ( ) & & elem get name ( ) equals ( " enum " ) ) { break ; } apply enum member ( enumdt , elem , monitor , log ) ; xml parser next ( ) ; / / member end element } pdb parser cache data type ( name , enumdt ) ; / / cache with namespace - based name pdb parser get program data type manager ( ) resolve ( enumdt , data type conflict handler replace empty structs or rename and add handler ) ; } }


public final boolean is public ( ) { return modifier is public ( get modifiers ( ) ) ; }


returns the signed int 3 2 value of this starlark int , or fails if not exactly representable

public int to int ( string what ) throws eval exception { throw starlark errorf ( " got % s for % s , want value in signed 32 - bit range " , this , what ) ; }


compute the crc32c ( castagnoli ) of a byte buffer from a given offset ( relative to the buffer ' s current position )

public static long compute ( byte buffer buffer , int offset , int size ) { checksum crc = create ( ) ; checksums update ( crc , buffer , offset , size ) ; return crc get value ( ) ; }


public long get symbol index ( ) { return r symndx ; }


public pet get pet by id ( long pet id ) { try { pet response = cache get object ( " / get pet by id / response " , pet class ) ; return response ; } catch ( cache exception e ) { throw new runtime exception ( e ) ; } }


initalize the filesystem store - this creates the rest client binding

public void initialize ( uri fs u r i , configuration configuration ) throws i o exception { this uri = fs u r i ; this swift rest client = swift rest client get instance ( fs u r i , configuration ) ; }


creates a new dewey number from this such that a 0 is appended as new last digit

public dewey number add stage ( ) { int [ ] new dewey number = arrays copy of ( dewey number , dewey number length + 1 ) ; return new dewey number ( new dewey number ) ; }


converts a { @ link type } to { @ link class } if possible , { @ code null } otherwise

static @ nullable class < ? > to class ( type type ) { if ( type instanceof class ) { return ( class < ? > ) type ; } else if ( type instanceof parameterized type ) { / / this is always a class return ( class < ? > ) ( ( parameterized type ) type ) get raw type ( ) ; } / / unsupported : generic arrays , type variables , wildcard types return null ; }


get the path variable with the given name , if present

default string path variable ( string name ) { map < string , string > path variables = path variables ( ) ; if ( path variables contains key ( name ) ) { return path variables ( ) get ( name ) ; } else { throw new illegal argument exception ( " no path variable with name \ " " + name + " \ " available " ) ; } }


modify default initialization to include a " homesubcluster " which we will use as the default for when nodes or racks are unknown

private void add home sub cluster as active ( ) { sub cluster info sci = mock ( sub cluster info class ) ; when ( sci get state ( ) ) then return ( sub cluster state sc running ) ; when ( sci get sub cluster id ( ) ) then return ( get home sub cluster ( ) ) ; get active subclusters ( ) put ( get home sub cluster ( ) , sci ) ; sub cluster id info sc = new sub cluster id info ( get home sub cluster ( ) get id ( ) ) ; get policy info ( ) get router policy weights ( ) put ( sc , 0 1f ) ; get policy info ( ) get a m r m policy weights ( ) put ( sc , 0 1f ) ; }


test that deep stubbing works for one intermediate level

public void one level deep ( ) throws exception { output stream out = new byte array output stream ( ) ; socket factory socket factory = mock ( socket factory class , returns deep stubs ) ; when ( socket factory create socket ( ) get output stream ( ) ) then return ( out ) ; assert same ( out , socket factory create socket ( ) get output stream ( ) ) ; }


visits any type of ref constant of the given class

public void visit any ref constant ( clazz clazz , ref constant ref constant ) { visit any constant ( clazz , ref constant ) ; }


protected string determine principal id from ( final common profile profile , final base client client ) { var id = profile get id ( ) ; val properties = client ! = null ? client get custom properties ( ) : new hash map < > ( 0 ) ; if ( client ! = null & & properties contains key ( client custom property constants client custom property principal attribute id ) ) { val attr object = properties get ( client custom property constants client custom property principal attribute id ) ; if ( attr object ! = null ) { val principal attribute = attr object to string ( ) ; if ( profile contains attribute ( principal attribute ) ) { val first attribute = collection utils first element ( profile get attribute ( principal attribute ) ) ; if ( first attribute is present ( ) ) { id = first attribute get ( ) to string ( ) ; id = type principal id ( id , profile ) ; } logger debug ( " authentication indicates usage of client principal attribute [ { } ] for the identifier [ { } ] " , principal attribute , id ) ; } else { logger warn ( " authentication cannot find attribute [ { } ] to use as principal id " , principal attribute ) ; } } else { logger warn ( " no custom principal attribute was provided by the client [ { } ] using the default id [ { } ] " , client , id ) ; } } else if ( string utils is not blank ( principal attribute id ) ) { if ( profile contains attribute ( principal attribute id ) ) { val first attribute = collection utils first element ( profile get attribute ( principal attribute id ) ) ; if ( first attribute is present ( ) ) { id = first attribute get ( ) to string ( ) ; id = type principal id ( id , profile ) ; } } else { logger warn ( " cas cannot use [ { } ] as the principal attribute id , since the profile attributes do not contain the attribute " + " either adjust the cas configuration to use a different attribute , or contact the authentication provider noted by [ { } ] " + " to release the expected attribute to cas " , principal attribute id , profile get attributes ( ) ) ; } logger debug ( " authentication indicates usage of attribute [ { } ] for the identifier [ { } ] " , principal attribute id , id ) ; } else if ( is typed id used ) { id = profile get typed id ( ) ; logger debug ( " authentication indicates usage of typed profile id [ { } ] " , id ) ; } logger debug ( " final principal id determined based on client [ { } ] and user profile [ { } ] is [ { } ] " , profile , client , id ) ; return id ; }


attempt to cancel this asynchronous operation


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


build an xml document string representing the type information for a data type

public string builder build type ( data type type , int size ) { if ( type ! = null & & type get data type manager ( ) ! = prog data types ) { type = type clone ( prog data types ) ; } string builder res buf = new string builder ( ) ; if ( ( type instanceof void data type ) | | ( type = = null ) ) { return res buf append ( " < void / > " ) ; } res buf append ( " < type " ) ; res buf append ( build type internal ( type , size ) ) ; res buf append ( " < / type > " ) ; return res buf ; }


public void visit ( int value 1 ) { throw new runtime exception ( ) ; }


see { @ link visibility events test # test multiple visible and invisible events ( ) }

public void test multiple inc items ( ) { incremental item impl item 1 = new incremental item impl ( left , 0 , right , 5 , " id 1 " ) ; incremental item impl item 2 = new incremental item impl ( left , 5 , right , 10 , " id 2 " ) ; incremental item impl item 3 = new incremental item impl ( left , 10 , right , 15 , " id 3 " ) ; final list < incremental module item > items = new array list < > ( ) ; items add ( item 1 ) ; items add ( item 2 ) ; items add ( item 3 ) ; m incremental module perform incremental mount ( new rect ( left , 0 , right , 15 ) , items ) ; assert that ( item 1 m enter range called ) is true ( ) ; assert that ( item 2 m enter range called ) is true ( ) ; assert that ( item 3 m enter range called ) is true ( ) ; assert that ( item 1 m exit range called ) is false ( ) ; assert that ( item 2 m exit range called ) is false ( ) ; assert that ( item 3 m exit range called ) is false ( ) ; m incremental module perform incremental mount ( new rect ( left , 0 , right , 15 ) , items ) ; assert that ( item 1 m enter range called ) is false ( ) ; assert that ( item 2 m enter range called ) is false ( ) ; assert that ( item 3 m enter range called ) is false ( ) ; assert that ( item 1 m exit range called ) is false ( ) ; assert that ( item 2 m exit range called ) is false ( ) ; assert that ( item 3 m exit range called ) is false ( ) ; m incremental module perform incremental mount ( new rect ( left , 0 , right , 0 ) , items ) ; assert that ( item 1 m enter range called ) is false ( ) ; assert that ( item 2 m enter range called ) is false ( ) ; assert that ( item 3 m enter range called ) is false ( ) ; assert that ( item 1 m exit range called ) is true ( ) ; assert that ( item 2 m exit range called ) is true ( ) ; assert that ( item 3 m exit range called ) is true ( ) ; m incremental module perform incremental mount ( new rect ( left , 0 , right , 0 ) , items ) ; assert that ( item 1 m enter range called ) is false ( ) ; assert that ( item 2 m enter range called ) is false ( ) ; assert that ( item 3 m enter range called ) is false ( ) ; assert that ( item 1 m exit range called ) is false ( ) ; assert that ( item 2 m exit range called ) is false ( ) ; assert that ( item 3 m exit range called ) is false ( ) ; m incremental module perform incremental mount ( new rect ( left , 0 , right , 3 ) , items ) ; assert that ( item 1 m enter range called ) is true ( ) ; assert that ( item 2 m enter range called ) is false ( ) ; assert that ( item 3 m enter range called ) is false ( ) ; assert that ( item 1 m exit range called ) is false ( ) ; assert that ( item 2 m exit range called ) is false ( ) ; assert that ( item 3 m exit range called ) is false ( ) ; m incremental module perform incremental mount ( new rect ( left , 3 , right , 11 ) , items ) ; assert that ( item 1 m enter range called ) is false ( ) ; assert that ( item 2 m enter range called ) is true ( ) ; assert that ( item 3 m enter range called ) is true ( ) ; assert that ( item 1 m exit range called ) is false ( ) ; assert that ( item 2 m exit range called ) is false ( ) ; assert that ( item 3 m exit range called ) is false ( ) ; m incremental module perform incremental mount ( new rect ( left , 5 , right , 11 ) , items ) ; assert that ( item 1 m enter range called ) is false ( ) ; assert that ( item 2 m enter range called ) is false ( ) ; assert that ( item 3 m enter range called ) is false ( ) ; assert that ( item 1 m exit range called ) is true ( ) ; assert that ( item 2 m exit range called ) is false ( ) ; assert that ( item 3 m exit range called ) is false ( ) ; }


sees if the class file header magic has the good value

private boolean is good magic ( int magic ) { return magic = = class file magic ; }


return a set of account types specified by the intent as well as supported by the account manager

private set < string > get relevent account types ( final intent intent ) { / / an account type is relevant iff it is allowed by the caller and supported by the account / / manager set < string > set of relevant account types ; final string [ ] allowed account types = intent get string array extra ( extra allowable account types string array ) ; authenticator description [ ] descs = v account manager get ( ) get authenticator types ( ) ; set < string > supported account types = new hash set < string > ( descs length ) ; for ( authenticator description desc : descs ) { supported account types add ( desc type ) ; } if ( allowed account types ! = null ) { set of relevant account types = new hash set < > ( ) ; collections add all ( set of relevant account types , allowed account types ) ; set of relevant account types retain all ( supported account types ) ; } else { set of relevant account types = supported account types ; } return set of relevant account types ; }


creates a new instance of this gesture detector

public static gesture detector new instance ( context context ) { return new gesture detector ( context ) ; }


returns an address range iterator for those ranges which contain the specified value this method may only be invoked for indexed maps

public address range iterator get value ranges ( field value ) { return new value range iterator ( value ) ; }


global option to specify a cookie to be added to every request , if the request does not already contain such a cookie

builder default cookie ( string cookie , string values ) ;


removes any casts that change nullability but not type for example , { @ code cast ( 1 = 0 as boolean ) } becomes { @ code 1 = 0 }

public rex node remove nullability cast ( rex node e ) { return rex util remove nullability cast ( rex builder get type factory ( ) , e ) ; }


closes the current edit log and opens a new one the call fails if the file system is in safe mode

public checkpoint signature roll edit log ( ) throws i o exception ;


receive a message synchronously from the specified destination , but only wait up to a specified time for delivery this method should be used carefully , since it will block the thread until the message becomes available or until the timeout value is exceeded


public void restore from xml ( element root ) { in restore mode = true ; try { hash map < string , plugin tool > tool map = new hash map < > ( ) ; string active w s name = root get attribute value ( " active workspace " ) ; workspace make me active = null ; list < ? > l = root get children ( " workspace " ) ; iterator < ? > it = l iterator ( ) ; while ( it has next ( ) ) { element elem = ( element ) it next ( ) ; workspace impl ws = new workspace impl ( " temp " , this ) ; ws restore from xml ( elem ) ; workspaces add ( ws ) ; ws map put ( ws get name ( ) , ws ) ; if ( ws get name ( ) equals ( active w s name ) ) { make me active = ws ; } plugin tool [ ] tools = ws get tools ( ) ; for ( plugin tool tool : tools ) { tool map put ( tool get name ( ) , tool ) ; } } if ( make me active ! = null ) { make me active set active ( ) ; } it = root get children ( " connection " ) iterator ( ) ; while ( it has next ( ) ) { element elem = ( element ) it next ( ) ; string producer name = elem get attribute value ( " producer " ) ; string consumer name = elem get attribute value ( " consumer " ) ; / / get the tools plugin tool producer = tool map get ( producer name ) ; plugin tool consumer = tool map get ( consumer name ) ; if ( producer ! = null & & consumer ! = null ) { tool connection impl tc = new tool connection impl ( producer , consumer ) ; tc restore from xml ( elem ) ; connect map put ( producer name + " + " + consumer name , tc ) ; } } } finally { in restore mode = false ; } }


find a specific named symbol within the fake external block note : it is assumed that elf will never produced duplicate names

private symbol find external block symbol ( string name , address ext min , address ext max ) { / / try direct global name lookup first symbol table symbol table = program get symbol table ( ) ; symbol iterator symbols = symbol table get symbols ( name ) ; for ( symbol symbol : symbols ) { if ( is symbol in range ( symbol , ext min , ext max ) ) { return symbol ; } } / / since we can ' t do a direct lookup of default thunk names / / we must iterate over all symbols in the block to find a match symbol iterator symbol iter = symbol table get symbol iterator ( ext min , true ) ; while ( symbol iter has next ( ) ) { symbol s = symbol iter next ( ) ; if ( ! is symbol in range ( s , ext min , ext max ) ) { break ; } if ( name equals ( s get name ( ) ) ) { return s ; } } return null ; }


look up a field id type index from a field index cheaper than : { @ code field ids ( ) get ( field dex index ) get type index ( ) ; }

public int type index from field index ( int field index ) { check bounds ( field index , table of contents field ids size ) ; int position = table of contents field ids off + ( size of member id item * field index ) ; position + = size of ushort ; / / declaring class index return data get short ( position ) & 0x f f f f ; / / type index }


returns true if the environment supports long adder in other words , we are running in > = jdk8

static boolean is available ( ) { return initialization exception = = null ; }


return the proxy object to expose the default implementation uses a { @ code get proxy } call with the factory ' s bean class loader can be overridden to specify a custom class loader

protected object get proxy ( aop proxy aop proxy ) { return aop proxy get proxy ( this proxy class loader ) ; }


return the protocol scheme for the file system

public string get scheme ( ) { return " s 3n " ; }


creates a new { @ link inbound http 2 to http adapter } with the specified properties

protected abstract t build ( http 2 connection connection , int max content length , boolean validate http headers , boolean propagate settings ) throws exception ;


private int partition ( producer record < k , v > record , cluster cluster ) { integer partition = record partition ( ) ; string topic = record topic ( ) ; if ( partition ! = null ) { list < partition info > partitions = cluster partitions for topic ( topic ) ; int num partitions = partitions size ( ) ; / / they have given us a partition , use it if ( partition < 0 | | partition > = num partitions ) throw new illegal argument exception ( " invalid partition given with record : " + partition + " is not in the range [ 0 " + num partitions + " ] " ) ; return partition ; } byte [ ] key bytes = key serializer serialize ( topic , record headers ( ) , record key ( ) ) ; byte [ ] value bytes = value serializer serialize ( topic , record headers ( ) , record value ( ) ) ; return this partitioner partition ( topic , record key ( ) , key bytes , record value ( ) , value bytes , cluster ) ; }


returns the live view of the filesystem under the package path entry

view get current view ( options provider options ) throws broken diff awareness exception ;


get a string parameter , throwing an exception if it isn ' t found

public static string get required string parameter ( servlet request request , string name ) throws servlet request binding exception { return string parser validate required string ( name , request get parameter ( name ) ) ; }


creates a new music instance from the provided file descriptor it is the caller ' s responsibility to close the file descriptor it is safe to do so as soon as this call returns

public music new music ( file descriptor fd ) { if ( sound pool = = null ) { throw new gdx runtime exception ( " android audio is not enabled by the application config " ) ; } media player media player = new media player ( ) ; try { media player set data source ( fd ) ; media player prepare ( ) ; android music music = new android music ( this , media player ) ; synchronized ( musics ) { musics add ( music ) ; } return music ; } catch ( exception ex ) { throw new gdx runtime exception ( " error loading audio from file descriptor " , ex ) ; } }


sets the { @ link key selector } that must be used for partitioning keyed state of this operation

public void set state key selector ( key selector < in , ? > state key selector ) { this state key selector = state key selector ; update managed memory state backend use case ( state key selector ! = null ) ; }


an expectation for the url of the current page to contain specific text

public static expected condition < boolean > url contains ( final string fraction ) { return new expected condition < boolean > ( ) { private string current url = " " ; @ override public boolean apply ( web driver driver ) { current url = driver get current url ( ) ; return current url ! = null & & current url contains ( fraction ) ; } @ override public string to string ( ) { return string format ( " url to contain \ " % s \ " current url : \ " % s \ " " , fraction , current url ) ; } } ; }


starts the tracking of the given partition for the given key

public void start tracking partitions ( k key , collection < result partition i d > new partition ids ) { preconditions check not null ( key ) ; preconditions check not null ( new partition ids ) ; if ( new partition ids is empty ( ) ) { return ; } tracked partitions per key compute ( key , ( ignored , partition ids ) - > { if ( partition ids = = null ) { partition ids = new hash set < > ( 8 ) ; } partition ids add all ( new partition ids ) ; return partition ids ; } ) ; }


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


reads characters from this buffer and puts them into { @ code target } the number of chars that are copied is either the number of remaining chars in this buffer or the number of remaining chars in { @ code target } , whichever is smaller

public int read ( char buffer target ) throws i o exception { if ( target = = this ) { throw new illegal argument exception ( ) ; } if ( remaining ( ) = = 0 ) { return target remaining ( ) = = 0 ? 0 : - 1 ; } int result = math min ( target remaining ( ) , remaining ( ) ) ; char [ ] chars = new char [ result ] ; get ( chars ) ; target put ( chars ) ; return result ; }


invoked when an incoming request exceeds the maximum content length the default behvaior is to trigger an { @ code exception caught ( ) } event with a { @ link too long frame exception }

protected void handle oversized message ( channel handler context ctx , s oversized ) throws exception { ctx fire exception caught ( new too long frame exception ( " content length exceeded " + max content length ( ) + " bytes " ) ) ; }


public object node distro status ( @ request param ( default value = " view " ) string action ) { object node result = jackson utils create empty json node ( ) ; if ( string utils equals ( switch entry action view , action ) ) { result replace ( " status " , jackson utils transfer to json node ( member manager all members ( ) ) ) ; return result ; } return result ; }


invokes the given runnable in the awt event dispatching thread , and waits for it to finish this method may be called from any thread , including the event dispatching thread itself

public static void invoke and wait ( runnable runnable ) throws interrupted exception , invocation target exception { try { if ( swing utilities is event dispatch thread ( ) ) { runnable run ( ) ; } else { swing utilities invoke and wait ( runnable ) ; } } catch ( exception ex ) { / / ignore any exceptions } }


creates a mutable { @ code array list } instance containing the given elements < b > note : < b > essentially the only reason to use this method is when you will need to add or remove elements later otherwise , for non - null elements use { @ link immutable list # of ( ) } ( for varargs ) or { @ link immutable list # copy of ( object [ ] ) } ( for an array ) instead if any elements might be null , or you need support for { @ link list # set ( int , object ) } , use { @ link arrays # as list } note that even when you do need the ability to add or remove , this method provides only a tiny bit of syntactic sugar for { @ code new array list ( } { @ link arrays # as list as list } { @ code ( ) ) } , or for creating an empty list then calling { @ link collections # add all } this method is not actually very useful and will likely be deprecated in the future

public static < e > array list < e > new array list ( e elements ) { check not null ( elements ) ; / / for gwt / / avoid integer overflow when a large array is passed in int capacity = compute array list capacity ( elements length ) ; array list < e > list = new array list < > ( capacity ) ; collections add all ( list , elements ) ; return list ; }


an overloaded method that uses the conversion service created at construction

public void contribute method argument ( method parameter parameter , object value , uri components builder builder , map < string , object > uri variables ) { this contribute method argument ( parameter , value , builder , uri variables , this conversion service ) ; }


actually create the entity manager proxy

private static entity manager create proxy ( entity manager raw entity manager , entity manager factory info emf info , boolean container managed , boolean synchronized with transaction ) { assert not null ( emf info , " entity manager factory info must not be null " ) ; jpa dialect jpa dialect = emf info get jpa dialect ( ) ; persistence unit info pui = emf info get persistence unit info ( ) ; boolean jta = ( pui ! = null ? pui get transaction type ( ) = = persistence unit transaction type jta : null ) ; return create proxy ( raw entity manager , emf info get entity manager interface ( ) , emf info get bean class loader ( ) , jpa dialect , jta , container managed , synchronized with transaction ) ; }


returns whether this code unit is marked as having the name property

public boolean get void property ( string name ) { throw new unsupported operation exception ( ) ; }


remove all listeners registered with this multicaster after a remove call , the multicaster will perform no action on event notification until new listeners are registered


test request scoped caching with a mixture of commands

public void test no request cache 3 using thread isolation ( ) { test circuit breaker circuit breaker = new test circuit breaker ( ) ; successful cacheable command < string > command 1 = new successful cacheable command < string > ( circuit breaker , false , " a " ) ; successful cacheable command < string > command 2 = new successful cacheable command < string > ( circuit breaker , false , " b " ) ; successful cacheable command < string > command 3 = new successful cacheable command < string > ( circuit breaker , false , " a " ) ; assert true ( command 1 is command running in thread ( ) ) ; future < string > f 1 = command 1 observe ( ) to blocking ( ) to future ( ) ; future < string > f 2 = command 2 observe ( ) to blocking ( ) to future ( ) ; future < string > f 3 = command 3 observe ( ) to blocking ( ) to future ( ) ; try { assert equals ( " a " , f 1 get ( ) ) ; assert equals ( " b " , f 2 get ( ) ) ; assert equals ( " a " , f 3 get ( ) ) ; } catch ( exception e ) { throw new runtime exception ( e ) ; } assert true ( command 1 executed ) ; / / both should execute as they are different assert true ( command 2 executed ) ; / / this should also execute since we disabled the cache assert true ( command 3 executed ) ; assert command execution events ( command 1 , hystrix event type emit , hystrix event type success ) ; assert command execution events ( command 2 , hystrix event type emit , hystrix event type success ) ; assert command execution events ( command 3 , hystrix event type emit , hystrix event type success ) ; assert equals ( 0 , circuit breaker metrics get current concurrent execution count ( ) ) ; assert sane hystrix request log ( 3 ) ; / / thread isolated assert true ( command 1 is executed in thread ( ) ) ; assert true ( command 2 is executed in thread ( ) ) ; assert true ( command 3 is executed in thread ( ) ) ; }


returns the value of a header with the specified name in milliseconds if there is more than one value for the specified name , the first value in insertion order is returned


constructs a deadline that is a given duration after now

public static deadline from now ( duration duration ) { return new deadline ( math add exact ( system nano time ( ) , duration to nanos ( ) ) ) ; }


configures this { @ code builder } to order entries by value according to the specified comparator the sort order is stable , that is , if two entries have values that compare as equivalent , the entry that was inserted first will be first in the built map ' s iteration order

public builder < k , v > order entries by value ( comparator < ? super v > value comparator ) { super order entries by value ( value comparator ) ; return this ; }


public geo bounding box query builder set corners ( final string geohash ) { / / get the bounding box of the geohash and set top left and bottom right rectangle gh b box = geohash to bounding box ( geohash ) ; return set corners ( new geo point ( gh b box get max y ( ) , gh b box get min x ( ) ) , new geo point ( gh b box get min y ( ) , gh b box get max x ( ) ) ) ; }


the color to be replaced is specified using individual red , green , and blue components ( normalized to 1 0 ) the default is green : ( 0 0 , 1 0 , 0 0 )

public void set color to replace ( float red component , float green component , float blue component ) { color to replace = new float [ ] { red component , green component , blue component } ; set float vec 3 ( color to replace location , color to replace ) ; }


sets the line height , which is the distance from one line of text to the next

public void set line height ( float height ) { line height = height * scale y ; down = flipped ? line height : - line height ; }


sets the < code > kind < code > property

public void set kind ( kind enum kind ) { this kind = kind ; }


get the current timeout value specified through { @ link # reset ( long ) } or { @ link # reset deadline ( long ) } this value is constant until altered by one of these api calls

public long timeout ms ( ) { return timeout ms ; }


returns all variables , as instances of the { @ link variable instance } interface , which gives more information than only the value ( type , execution id , etc )

map < string , variable instance > get variable instances ( ) ;


tests the specifying job manager total process memory with config default value for job manager and task manager

public void test job manager memory property with config default value ( ) throws exception { int proc memory = 2048 ; final configuration configuration = create configuration with jm and tm total memory ( proc memory ) ; final flink yarn session cli flink yarn session cli = create flink yarn session cli ( configuration ) ; final command line command line = flink yarn session cli parse command line options ( new string [ 0 ] , false ) ; configuration add all ( flink yarn session cli to configuration ( command line ) ) ; final cluster client factory < application id > client factory = get cluster client factory ( configuration ) ; final cluster specification cluster specification = client factory get cluster specification ( configuration ) ; assert that ( cluster specification get master memory m b ( ) , is ( proc memory ) ) ; assert that ( cluster specification get task manager memory m b ( ) , is ( proc memory ) ) ; }


returns true if field msg is set ( has been assigned a value ) and false otherwise

public boolean is set msg ( ) { return this msg ! = null ; }


reads a { @ code float } as specified by { @ link data input stream # read float ( ) } , except using little - endian byte order

public float read float ( ) throws i o exception { return float int bits to float ( read int ( ) ) ; }


refresh the given application context , if necessary

protected void refresh application context ( application context context ) { if ( context instanceof configurable application context ) { configurable application context cac = ( configurable application context ) context ; if ( ! cac is active ( ) ) { cac refresh ( ) ; } } }