suitable for { @ link job # get nearest old build }

public final run t get nearest old build ( int n ) { return builds search ( n , abstract lazy load run map direction desc ) ; }


invoked when the given model should be loaded , or checked against an existing one to see if it is different ( in which case , it would be loaded )

public static void start new session ( string trigram file , boolean force reload ) throws i o exception { if ( ! initializations done ) { / / set min string length based on thresholds for ( int i = 0 ; i < ng thresholds length ; i + + ) { if ( ng thresholds [ i ] < 0 ) { minimum string length = i ; break ; } } assign descriptions to a s c i i nums ( ) ; initializations done = true ; } if ( force reload | | ( ! last loaded trigram model equals ( trigram file ) ) ) { log probs = new model log probabilities ( ascii char count ) ; load string models ( trigram file ) ; } }


returns an immutable multiset containing the given elements , in the " grouped iteration order " described in the class documentation

public static < e > immutable multiset < e > copy of ( iterable < ? extends e > elements ) { if ( elements instanceof immutable multiset ) { @ suppress warnings ( " unchecked " ) / / all supported methods are covariant immutable multiset < e > result = ( immutable multiset < e > ) elements ; if ( ! result is partial view ( ) ) { return result ; } } immutable multiset builder < e > builder = new immutable multiset builder < e > ( multisets infer distinct elements ( elements ) ) ; builder add all ( elements ) ; return builder build ( ) ; }


test serialization of outer number types

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


public static void create table ( database db , boolean if not exists ) { string constraint = if not exists ? " if not exists " : " " ; db exec s q l ( " create table " + constraint + " \ " tree entity \ " ( " + / / " \ " id \ " integer primary key , " + / / 0 : id " \ " parent id \ " integer ) ; " ) ; / / 1 : parent id }


delegates to { @ link xpath expectations helper # assert node count ( byte [ ] , string , int ) }

public web test client body content spec node count ( int expected count ) { return assert with ( ( ) - > this xpath helper assert node count ( get content ( ) , get charset ( ) , expected count ) ) ; }


reschedule the cleaner if the service is not stopped

protected void on after in lifecycle ( ) { zoned date time start = zoned date time now ( clock system u t c ( ) ) ; time value delay = execution scheduler next execution delay ( start ) ; logger debug ( " scheduling next execution in [ { } ] seconds " , delay seconds ( ) ) ; try { cancellable = thread pool schedule ( this , delay , executor name ( ) ) ; } catch ( es rejected execution exception e ) { if ( e is executor shutdown ( ) ) { logger debug ( " couldn ' t schedule new execution of the cleaner , executor is shutting down " , e ) ; } else { throw e ; } } }


parse build statement dependencies part : output 1 k [ | implicit output 1 k ] : rule input 1 k [ | implicit input 1 k ] [ | | order only input 1 k ]

private map < input output kind , list < ninja variable value > > parse target dependencies part ( ninja target builder builder ) throws generic parsing exception { map < input output kind , list < ninja variable value > > path values map = maps new hash map ( ) ; boolean rule name parsed = false ; ninja target parsing part parsing part = ninja target parsing part outputs ; while ( lexer has next token ( ) & & ! ninja target parsing part variables equals ( parsing part ) ) { if ( ninja target parsing part rule name equals ( parsing part ) ) { rule name parsed = true ; builder set rule name ( as string ( parse expected ( ninja token identifier ) ) ) ; parsing part = ninja target parsing part inputs ; continue ; } list < ninja variable value > paths = parse paths ( ) ; if ( paths is empty ( ) & & ! ninja target parsing part inputs equals ( parsing part ) ) { throw new generic parsing exception ( " expected paths sequence " ) ; } if ( ! paths is empty ( ) ) { path values map put ( preconditions check not null ( parsing part get input output kind ( ) ) , paths ) ; } if ( ! lexer has next token ( ) ) { if ( parsing part is transition required ( ) ) { throw new generic parsing exception ( " unexpected end of target " ) ; } break ; } ninja token lexical separator = lexer next token ( ) ; parsing part = preconditions check not null ( target parts transitions map get ( parsing part ) ) get ( lexical separator ) ; if ( parsing part = = null ) { throw new generic parsing exception ( " unexpected token : " + lexical separator ) ; } } if ( ! rule name parsed ) { throw new generic parsing exception ( " expected rule name " ) ; } preconditions check state ( ! lexer has next token ( ) | | ninja target parsing part variables equals ( parsing part ) ) ; return path values map ; }


returns the null count of the given column

public double get column null count ( rel node rel , int index ) { for ( ; ; ) { try { return column null count handler get column null count ( rel , this , index ) ; } catch ( janino rel metadata provider no handler e ) { column null count handler = revise ( e rel class , flink metadata column null count def ) ; } } }


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


void setup ( configuration job conf ) { string prefix = get prefix ( is map ) ; int index = job conf get int ( prefix + chain mapper size , 0 ) ; for ( int i = 0 ; i < index ; i + + ) { class < ? extends mapper > klass = job conf get class ( prefix + chain mapper class + i , null , mapper class ) ; configuration m conf = get chain element conf ( job conf , prefix + chain mapper config + i ) ; conf list add ( m conf ) ; mapper mapper = reflection utils new instance ( klass , m conf ) ; mappers add ( mapper ) ; } class < ? extends reducer > klass = job conf get class ( prefix + chain reducer class , null , reducer class ) ; if ( klass ! = null ) { r conf = get chain element conf ( job conf , prefix + chain reducer config ) ; reducer = reflection utils new instance ( klass , r conf ) ; } }


public static principal factory new principal factory ( ) { return new default principal factory ( ) ; }


mirror the bit matrix in order to attempt a second reading

void mirror ( ) { for ( int x = 0 ; x < bit matrix get width ( ) ; x + + ) { for ( int y = x + 1 ; y < bit matrix get height ( ) ; y + + ) { if ( bit matrix get ( x , y ) ! = bit matrix get ( y , x ) ) { bit matrix flip ( y , x ) ; bit matrix flip ( x , y ) ; } } } }


returns all of the queue ' s current elements in a list , if the queue is non - empty otherwise , this method returns null the method throws an { @ code illegal state exception } if the queue is closed checking whether the queue is open and removing the elements is one atomic operation this method never blocks

public list < e > poll batch ( ) { lock lock ( ) ; try { if ( open ) { if ( elements size ( ) > 0 ) { array list < e > result = new array list < > ( elements ) ; elements clear ( ) ; return result ; } else { return null ; } } else { throw new illegal state exception ( " queue is closed " ) ; } } finally { lock unlock ( ) ; } }


get authentications ( key : authentication name , value : authentication )

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


public file processor set recursive ( boolean recursive ) { this recursive = recursive ; return this ; }


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 the length of the underlying file

public long length ( ) throws i o exception { return provider length ( ) ; }


validate that generated mapping maintains input order

private void assert maintain order ( collection < string > input , map < string , integer > output ) { assert that ( output key set ( ) ) contains exactly elements in ( input ) in order ( ) ; }


public user get user ( ) throws i o exception { synchronized ( server adapter ) { check repository ( ) ; try { if ( user = = null ) { user = repository get user ( ) ; } return user ; } catch ( not connected exception | remote exception e ) { if ( recover connection ( e ) ) { return get user ( ) ; } throw e ; } } }


creates an { @ code objc library } target writer for the label indicated by the given string

protected scratch attribute writer create library target writer ( string label string ) { return scratch attribute writer from label string ( this , " objc library " , label string ) ; }


creates a comment indicating there is an fde at the address

protected void create fde comment ( address cur address ) { create plate comment ( cur address , " frame descriptor entry " ) ; }


if both flush delay and max max batch size are set ( bigger than 0 ) , flush whenever either condition is hit if only one or the other is set , flush only when the relevant condition is hit

private boolean should flush ( ) { long flush delay = zks get flush delay ( ) ; long max batch size = zks get max batch size ( ) ; if ( ( flush delay > 0 ) & & ( get remaining delay ( ) = = 0 ) ) { return true ; } return ( max batch size > 0 ) & & ( to flush size ( ) > = max batch size ) ; }


returns { @ code true } if the node is accepting tasks needed to allow agents programmatic suspension of task scheduling that does not overlap with being offline called by { @ link computer # is accepting tasks ( ) } this method is distinct from { @ link computer # is accepting tasks ( ) } as sometimes the { @ link node } concrete class may not have control over the { @ link hudson model computer } concrete class associated with it

public boolean is accepting tasks ( ) { return true ; }


public final record reader < null writable , summation writable > create record reader ( input split generic , task attempt context context ) { final summation split split = ( summation split ) generic ; / / return a record reader return new record reader < null writable , summation writable > ( ) { boolean done = false ; / * * { @ inherit doc } * / @ override public void initialize ( input split split , task attempt context context ) { } / * * { @ inherit doc } * / @ override public boolean next key value ( ) { return ! done ? done = true : false ; } / * * { @ inherit doc } * / @ override public null writable get current key ( ) { return null writable get ( ) ; } / * * { @ inherit doc } * / @ override public summation writable get current value ( ) { return new summation writable ( split get element ( ) ) ; } / * * { @ inherit doc } * / @ override public float get progress ( ) { return done ? 1f : 0f ; }


sets the timeout for the command run using the { @ code linux - sandbox } tool

public command line builder set timeout ( duration timeout ) { this timeout = timeout ; return this ; }


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


public static elf symbol create global function symbol ( elf header header , int name , string name as string , long addr , int symbol index , elf symbol table symbol table ) { return new elf symbol ( header , name as string , name , addr , 0 , ( byte ) ( ( stb global < < 4 ) | stt func ) , ( byte ) 0 , ( short ) 0 , symbol index , symbol table ) ; }


unescapes any java literals found in the < code > string < code > for example , it will turn a sequence of < code > ' \ ' < code > and < code > ' n ' < code > into a newline character , unless the < code > ' \ ' < code > is preceded by another < code > ' \ ' < code >

public static string unescape string ( string str ) { return string escape utils unescape java ( str ) ; }


redirects the user to the plugin manager or security configuration

public http response do forward ( @ query parameter string fix , @ query parameter string configure ) { jenkins get ( ) check permission ( jenkins administer ) ; if ( fix ! = null ) { return http responses redirect via context path ( " plugin manager " ) ; } if ( configure ! = null ) { return http responses redirect via context path ( " configure security " ) ; } / / shouldn ' t happen return http responses redirect via context path ( " / " ) ; }


report a required record to the data store the data store uses this to createmaintain storage for the record

public class < r > get record class ( ) { return this record class ; }


get the json content of an exported list of { @ link url u r ls } by the service interface , group and version

string get exported u r ls ( string service interface , string group , string version ) ;


public void pet id test ( ) { / / todo : test pet id }


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


public static byte [ ] copy of ( byte [ ] src , int length ) { byte [ ] dest = new byte [ length ] ; system arraycopy ( src , 0 , dest , 0 , math min ( src length , length ) ) ; return dest ; }


creates a new listenable future - style stub that supports unary calls on the service

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


ensure that the given request is coming from the correct writer and in - order

private synchronized void check request ( request info req info ) throws i o exception { / / invariant 25 from zab paper if ( req info get epoch ( ) < last promised epoch get ( ) ) { throw new i o exception ( " ipc ' s epoch " + req info get epoch ( ) + " is less than the last promised epoch " + last promised epoch get ( ) + " ; journal id : " + journal id ) ; } else if ( req info get epoch ( ) > last promised epoch get ( ) ) { / / a newer client has arrived fence any previous writers by updating / / the promise update last promised epoch ( req info get epoch ( ) ) ; } / / ensure that the i p cs are arriving in - order as expected check sync ( req info get ipc serial number ( ) > current epoch ipc serial , " ipc serial % s from client % s was not higher than prior highest " + " ipc serial % s ; journal id : % s " , req info get ipc serial number ( ) , server get remote ip ( ) , current epoch ipc serial , journal id ) ; current epoch ipc serial = req info get ipc serial number ( ) ; if ( req info has committed tx id ( ) ) { preconditions check argument ( req info get committed tx id ( ) > = committed txn id get ( ) , " client trying to move committed txid backward from " + committed txn id get ( ) + " to " + req info get committed tx id ( ) + " ; journal id : " + journal id ) ; committed txn id set ( req info get committed tx id ( ) ) ; } }


returns the number of bytes one can read from the buffer


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


gets an unsigned byte at the current { @ code reader index } and increases the { @ code reader index } by { @ code 1 } in this buffer

public abstract short read unsigned byte ( ) ;


main loop for each bp thread run until shutdown , forever calling remote name node functions

private void offer service ( ) throws exception { log info ( " for namenode " + nn addr + " using " + " blockreport interval of " + dn conf block report interval + " msecs " + " cachereport interval of " + dn conf cache report interval + " msecs " + " initial delay : " + dn conf initial block report delay ms + " msecs " + " ; heart beat interval = " + dn conf heart beat interval + ( lifeline sender ! = null ? " ; lifeline interval ms = " + dn conf get lifeline interval ms ( ) : " " ) ) ; / / / / now loop for a long time / / while ( should run ( ) ) { try { data node fault injector get ( ) start offer service ( ) ; final long start time = scheduler monotonic now ( ) ; / / / / every so often , send heartbeat or block - report / / final boolean send heartbeat = scheduler is heartbeat due ( start time ) ; heartbeat response resp = null ; if ( send heartbeat ) { / / / / all heartbeat messages include following info : / / - - datanode name / / - - data transfer port / / - - total capacity / / - - bytes remaining / / boolean request block report lease = ( full block report lease id = = 0 ) & & scheduler is block report due ( start time ) ; if ( ! dn are heartbeats disabled for tests ( ) ) { resp = send heart beat ( request block report lease ) ; assert resp ! = null ; if ( resp get full block report lease id ( ) ! = 0 ) { if ( full block report lease id ! = 0 ) { log warn ( nn addr + " sent back a full block report lease " + " id of 0x " + long to hex string ( resp get full block report lease id ( ) ) + " , but we already have a lease id of 0x " + long to hex string ( full block report lease id ) + " " + " overwriting old lease id " ) ; } full block report lease id = resp get full block report lease id ( ) ; } dn get metrics ( ) add heartbeat ( scheduler monotonic now ( ) - start time , get rpc metric suffix ( ) ) ; / / if the state of this nn has changed ( eg standby - > active ) / / then let the b p offer service update itself / / / / important that this happens before process command below , / / since the first heartbeat to a new active might have commands / / that we should actually process bpos update actor states from heartbeat ( this , resp get name node ha state ( ) ) ; state = resp get name node ha state ( ) get state ( ) ; if ( state = = h a service state active ) { handle rolling upgrade status ( resp ) ; } command processing thread enqueue ( resp get commands ( ) ) ; } } if ( ! dn are i b r disabled for tests ( ) & & ( ibr manager send immediately ( ) | | send heartbeat ) ) { ibr manager send i b rs ( bp namenode , bp registration , bpos get block pool id ( ) , get rpc metric suffix ( ) ) ; } list < datanode command > cmds = null ; boolean force full br = scheduler force full block report get and set ( false ) ; if ( force full br ) { log info ( " forcing a full block report to " + nn addr ) ; } if ( ( full block report lease id ! = 0 ) | | force full br ) { cmds = block report ( full block report lease id ) ; full block report lease id = 0 ; } command processing thread enqueue ( cmds ) ; if ( ! dn are cache reports disabled for tests ( ) ) { datanode command cmd = cache report ( ) ; command processing thread enqueue ( cmd ) ; } if ( send heartbeat ) { dn get metrics ( ) add heartbeat total ( scheduler monotonic now ( ) - start time , get rpc metric suffix ( ) ) ; } / / there is no work to do ; sleep until hearbeat timer elapses , / / or work arrives , and then iterate again ibr manager wait till next i b r ( scheduler get heartbeat wait time ( ) ) ; } catch ( remote exception re ) { string re class = re get class name ( ) ; if ( unregistered node exception class get name ( ) equals ( re class ) | | disallowed datanode exception class get name ( ) equals ( re class ) | | incorrect version exception class get name ( ) equals ( re class ) ) { log warn ( this + " is shutting down " , re ) ; should service run = false ; return ; } log warn ( " remote exception in offer service " , re ) ; sleep after exception ( ) ; } catch ( i o exception e ) { log warn ( " i o exception in offer service " , e ) ; sleep after exception ( ) ; } finally { data node fault injector get ( ) end offer service ( ) ; } process queue messages ( ) ; } / / while ( should run ( ) ) }


returns the filter for this model the value returned from this method will not be null , but will instead be an instanceof { @ link null table filter } when no filter is applied the value returned from this method may not actually yet be applied , depending upon when the background thread finishes loading

public table filter < row object > get table filter ( ) { if ( pending table filter ! = null ) { return pending table filter ; } return table filter ; }


create a configuration , possibly patching in s 3 guard options

protected configuration create configuration ( ) { configuration conf = super create configuration ( ) ; / / patch in s 3 guard options maybe enable s 3 guard ( conf ) ; return conf ; }


post pet { pet id } : updates a pet in the store with form data

default response entity < void > update pet with form ( @ api param ( value = " id of pet that needs to be updated " , required = true ) @ path variable ( " pet id " ) long pet id , @ api param ( value = " updated name of the pet " ) @ valid @ request part ( value = " name " , required = false ) string name , @ api param ( value = " updated status of the pet " ) @ valid @ request part ( value = " status " , required = false ) string status ) { return new response entity < > ( http status not implemented ) ; }


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


sets the indentation string to be repeated for each level of indentation in the encoded document if { @ code indent is empty ( ) } the encoded document will be compact otherwise the encoded document will be more human - readable

public final void set indent ( string indent ) { if ( indent length ( ) = = 0 ) { this indent = null ; this separator = " : " ; } else { this indent = indent ; this separator = " : " ; } }


public boolean get name boolean ( ) { return name boolean ; }


called after { @ link field mapper # parse ( parse context ) } on the { @ link root object mapper }

public void post parse ( parse context context ) throws i o exception { / / do nothing }


sets the < code > prefix ns array < code > property

public xml item prefix ns array ( list < integer > prefix ns array ) { this prefix ns array = prefix ns array ; return this ; }


see { @ link visibility events test # test full impression event ( ) }

public void test in range all bounds visible ( ) { incremental item impl item = new incremental item impl ( left , 5 , 10 , 10 , " id 1 " ) ; item enter range height ratio ( 1 0f ) ; m incremental module perform incremental mount ( new rect ( left , 0 , right , 10 ) , item ) ; assert that ( item m enter range called ) is true ( ) ; }


generates a xml response that describe the ec2 instances

private byte [ ] generate describe instances response ( ) { final x m l output factory xml output factory = x m l output factory new factory ( ) ; xml output factory set property ( x m l output factory is repairing namespaces , true ) ; final string writer out = new string writer ( ) ; x m l stream writer sw ; try { sw = xml output factory create x m l stream writer ( out ) ; sw write start document ( ) ; string namespace = " http : / / ec 2 amazonaws com / doc / 2013 - 02 - 01 / " ; sw set default namespace ( namespace ) ; sw write start element ( x m l constants default ns prefix , " describe instances response " , namespace ) ; { sw write start element ( " request id " ) ; sw write characters ( uuid random u u i d ( ) to string ( ) ) ; sw write end element ( ) ; sw write start element ( " reservation set " ) ; { if ( files exists ( nodes ) ) { for ( string address : files read all lines ( nodes ) ) { sw write start element ( " item " ) ; { sw write start element ( " reservation id " ) ; sw write characters ( uuid random u u i d ( ) to string ( ) ) ; sw write end element ( ) ; sw write start element ( " instances set " ) ; { sw write start element ( " item " ) ; { sw write start element ( " instance id " ) ; sw write characters ( uuid random u u i d ( ) to string ( ) ) ; sw write end element ( ) ; sw write start element ( " image id " ) ; sw write characters ( uuid random u u i d ( ) to string ( ) ) ; sw write end element ( ) ; sw write start element ( " instance state " ) ; { sw write start element ( " code " ) ; sw write characters ( " 16 " ) ; sw write end element ( ) ; sw write start element ( " name " ) ; sw write characters ( " running " ) ; sw write end element ( ) ; } sw write end element ( ) ; sw write start element ( " private dns name " ) ; sw write characters ( address ) ; sw write end element ( ) ; sw write start element ( " dns name " ) ; sw write characters ( address ) ; sw write end element ( ) ; sw write start element ( " instance type " ) ; sw write characters ( " m 1 medium " ) ; sw write end element ( ) ; sw write start element ( " placement " ) ; { sw write start element ( " availability zone " ) ; sw write characters ( " use - east - 1e " ) ; sw write end element ( ) ; sw write empty element ( " group name " ) ; sw write start element ( " tenancy " ) ; sw write characters ( " default " ) ; sw write end element ( ) ; } sw write end element ( ) ; sw write start element ( " private ip address " ) ; sw write characters ( address ) ; sw write end element ( ) ; sw write start element ( " ip address " ) ; sw write characters ( address ) ; sw write end element ( ) ; } sw write end element ( ) ; } sw write end element ( ) ; } sw write end element ( ) ; } } sw write end element ( ) ; } sw write end element ( ) ; sw write end document ( ) ; sw flush ( ) ; } } catch ( exception e ) { throw new runtime exception ( e ) ; } return out to string ( ) get bytes ( utf 8 ) ; }


reject out - of - order events that are delayed more than { @ code after window end } after the end of its window delay is defined as ( stream time - record timestamp )

public join windows grace ( final duration after window end ) throws illegal argument exception { final string msg prefix = prepare millis check fail msg prefix ( after window end , " after window end " ) ; final long after window end ms = validate millisecond duration ( after window end , msg prefix ) ; if ( after window end ms < 0 ) { throw new illegal argument exception ( " grace period must not be negative " ) ; } return new join windows ( before ms , after ms , after window end ms , maintain duration ms , segments ) ; }


create a job configuration this creates a new job conf from the yarn cluster configuration then calls { @ link # apply custom config options ( job conf ) } to allow it to be customized

protected job conf new job conf ( ) throws i o exception { job conf job conf = new job conf ( get yarn ( ) get config ( ) ) ; job conf add resource ( get configuration ( ) ) ; apply custom config options ( job conf ) ; return job conf ; }


set the failure channel after a send failure , an { @ link error message } will be sent to this channel with a payload of a { @ link messaging exception } with the failed message and cause

public void set send failure channel ( message channel send failure channel ) { this send failure channel = send failure channel ; }


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 shutdown ( ) throws nacos exception { server list clear ( ) ; member address infos clear ( ) ; info report task shutdown ( ) ; lookup factory destroy ( ) ; }


returns the last modified time in milliseconds for this file zero is returned if the file doesn ' t exist zero is returned for { @ link file type # classpath } files on android , zero is returned for { @ link file type # internal } files on the desktop , zero is returned for { @ link file type # internal } files on the classpath

public long last modified ( ) { return 0 ; }


public synchronized datum load ( string key ) throws exception { long start = system current time millis ( ) ; / / load data for ( file cache : list caches ( ) ) { if ( ! cache is file ( ) ) { loggers raft warn ( " warning : encountered directory in cache dir : { } " , cache get absolute path ( ) ) ; } if ( ! string utils equals ( cache get name ( ) , encode datum key ( key ) ) ) { continue ; } loggers raft info ( " finish loading datum , key : { } cost { } ms " , key , ( system current time millis ( ) - start ) ) ; return read datum ( cache , string utils empty ) ; } return null ; }


returns true if inst is an instance of model class in the open a p i model hierarchy the java class hierarchy is not implemented the same way as the open a p i model hierarchy , so it ' s not possible to use the instanceof keyword

public static boolean is instance of ( class < ? > model class , object inst , set < class < ? > > visited classes ) { if ( model class is instance ( inst ) ) { / / this handles the ' all of ' use case with single parent inheritance return true ; } if ( visited classes contains ( model class ) ) { / / this is to prevent infinite recursion when the composed schemas have / / a circular dependency return false ; } visited classes add ( model class ) ; / / traverse the one of / any of composed schemas map < string , generic type > descendants = model descendants get ( model class ) ; if ( descendants ! = null ) { for ( generic type child type : descendants values ( ) ) { if ( is instance of ( child type get raw type ( ) , inst , visited classes ) ) { return true ; } } } return false ; }


this implementation returns a file reference for the underlying class path resource , provided that it refers to a file in the file system

public file get file ( ) throws i o exception { url url = get u r l ( ) ; return resource utils get file ( url , get description ( ) ) ; }


scan the class path for candidate components

public set < bean definition > find candidate components ( string base package ) { if ( this components index ! = null & & index supports include filters ( ) ) { return add candidate components from index ( this components index , base package ) ; } else { return scan candidate components ( base package ) ; } }


check if a path should be in all subclusters

boolean is path all ( final string path ) { if ( subcluster resolver instanceof mount table resolver ) { try { mount table resolver mount table = ( mount table resolver ) subcluster resolver ; mount table entry = mount table get mount point ( path ) ; if ( entry ! = null ) { return entry is all ( ) ; } } catch ( i o exception e ) { log error ( " cannot get mount point " , e ) ; } } return false ; }


constructs a definition for the attribute used to restrict access to feature flags the allowlist will only be reached if the feature flags attribute is explicitly set

public static attribute builder < label > get allowlist attribute ( rule definition environment env ) { return config feature flag get allowlist attribute ( env , feature flag attr ) ; }


public string get status ( ) { if ( status = = null ) { return null ; } return status value ( ) ; }


this implementation delegates to the { @ code create topic connection ( username , password ) } method of the target topic connection factory , passing in the specified user credentials if the specified username is empty , it will simply delegate to the standard { @ code create topic connection ( ) } method of the target connection factory

protected topic connection do create topic connection ( @ nullable string username , @ nullable string password ) throws j m s exception { connection factory target = obtain target connection factory ( ) ; if ( ! ( target instanceof topic connection factory ) ) { throw new javax jms illegal state exception ( " ' target connection factory ' is not a topic connection factory " ) ; } topic connection factory queue factory = ( topic connection factory ) target ; if ( string utils has length ( username ) ) { return queue factory create topic connection ( username , password ) ; } else { return queue factory create topic connection ( ) ; } }


creates multiple principals in the kdc and adds them to a keytab file

public synchronized void create principal ( final path keytab file , final string principals ) throws exception { simple kdc create principals ( principals ) ; for ( string principal : principals ) { simple kdc get kadmin ( ) export keytab ( keytab file to file ( ) , principal ) ; } }


returns { @ code true } if { @ code target } is present at any index in this array equivalent to { @ code as list ( ) contains ( target ) }

public boolean contains ( int target ) { return index of ( target ) > = 0 ; }


static public int random sign ( ) { return 1 | ( random next int ( ) > > 31 ) ; }


returns the unified map of path fragments to artifacts , taking both artifacts and symlinks into account

public map < path fragment , artifact > as map without root symlinks ( ) { map < path fragment , artifact > result = entries to map ( symlinks , null ) ; / / if multiple artifacts have the same output - dir - relative path , the last one in the list will / / win that is because the runfiles tree cannot contain the same artifact for different / / configurations , because it only uses output - dir - relative paths for ( artifact artifact : artifacts to list ( ) ) { result put ( artifact get output dir relative path ( true ) , artifact ) ; } return result ; }


sets the starting x position for the fields generated by this factory

public void set start x ( int x ) { start x = x ; }


determine if the specified { @ code instance } matches one of the candidates if the candidates collection is { @ code null } , returns { @ code false }

protected boolean match ( t instance , collection < ? extends t > candidates ) { for ( t candidate : candidates ) { if ( match ( instance , candidate ) ) { return true ; } } return false ; }


returns a string containing additional documentation about the method ' s return value returns an empty string by default

public string get return type extra message ( ) { return " " ; }


any non - null < code > set < code > since mockito 2 1 0 , only allow non - null < code > set < code > as this is a nullable reference , the suggested api to match < code > null < code > wrapper would be { @ link # is null ( ) } we felt this change would make tests harness much safer that it was with mockito 1 x see examples in javadoc for { @ link argument matchers } class

public static < t > set < t > any set ( ) { report matcher ( new instance of ( set class , " < any set > " ) ) ; return new hash set < t > ( 0 ) ; }


validates longitude value is within standard + - 180 coordinate bounds

protected void check longitude ( double longitude ) { if ( double is na n ( longitude ) | | longitude < min lon incl | | longitude > max lon incl ) { throw new illegal argument exception ( " invalid longitude " + longitude + " ; must be between " + min lon incl + " and " + max lon incl ) ; } }


gathers transitive py files from { @ code deps } ( not including this target ' s { @ code srcs } and adds them to { @ code builder }

private static void collect transitive python sources from deps ( rule context rule context , nested set builder < artifact > builder ) { for ( transitive info collection dep : rule context get prerequisites ( " deps " ) ) { try { builder add transitive ( py provider utils get transitive sources ( dep ) ) ; } catch ( eval exception e ) { / / either the provider type or field type is bad rule context attribute error ( " deps " , string format ( " in dep ' % s ' : % s " , dep get label ( ) , e get message ( ) ) ) ; } } }


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


this implementation throws a file not found exception , assuming that the resource cannot be resolved to a url

public url get u r l ( ) throws i o exception { throw new file not found exception ( get description ( ) + " cannot be resolved to url " ) ; }


this method clears the input data type list and marks the data as dirty ( all must need recalculated )

public void clear ( ) { input set clear ( ) ; processed = false ; }


public client response response ( ) { return this delegate ; }


public void set newer than ( long newer than ) { if ( older than ! = null ) { throw new unsupported operation exception ( " cannot set ' newer than ' ' older than ' already set " ) ; } this newer than = newer than ; }


set the minimum count of matching documents that buckets need to have and return this builder so that calls can be chained

public date histogram aggregation builder min doc count ( long min doc count ) { if ( min doc count < 0 ) { throw new illegal argument exception ( " [ min doc count ] must be greater than or equal to 0 found [ " + min doc count + " ] in [ " + name + " ] " ) ; } this min doc count = min doc count ; return this ; }


visit a parse tree produced by { @ link painless parser # primordefcasttype }

t visit primordefcasttype ( painless parser primordefcasttype context ctx ) ;


public void set show rewind button ( boolean show rewind button ) { control view layout manager set show button ( rewind button , show rewind button ) ; update navigation ( ) ; }


picks an order for the blocks by doing " trace " analysis

private void pick order ( ) { basic block list blocks = method get blocks ( ) ; int sz = blocks size ( ) ; int max label = blocks get max label ( ) ; int [ ] work set = bits make bit set ( max label ) ; int [ ] traceback set = bits make bit set ( max label ) ; for ( int i = 0 ; i < sz ; i + + ) { basic block one = blocks get ( i ) ; bits set ( work set , one get label ( ) ) ; } int [ ] order = new int [ sz ] ; int at = 0 ; / * * starting with the designated " first label " ( that is , the * first block of the method ) , add that label to the order , * and then pick its first as - yet unordered successor to * immediately follow it , giving top priority to the primary * ( aka default ) successor ( if any ) keep following successors * until the trace runs out of possibilities then , continue * by finding an unordered chain containing the first as - yet * unordered block , and adding it to the order , and so on * / for ( int label = method get first label ( ) ; label ! = - 1 ; label = bits find first ( work set , 0 ) ) { / * * attempt to trace backward from the chosen block to an * as - yet unordered predecessor which lists the chosen * block as its primary successor , and so on , until we * fail to find such an unordered predecessor start the * trace with that block note that the first block in the * method has no predecessors , so in that case this loop * will simply terminate with zero iterations and without * picking a new starter block * / trace back : for ( ; ; ) { int list preds = method label to predecessors ( label ) ; int psz = preds size ( ) ; for ( int i = 0 ; i < psz ; i + + ) { int pred label = preds get ( i ) ; if ( bits get ( traceback set , pred label ) ) { / * * we found a predecessor loop ; stop tracing back * from here * / break ; } if ( ! bits get ( work set , pred label ) ) { / / this one ' s already ordered continue ; } basic block pred = blocks label to block ( pred label ) ; if ( pred get primary successor ( ) = = label ) { / / found one ! label = pred label ; bits set ( traceback set , label ) ; continue trace back ; } } / / failed to find a better block to start the trace break ; } / * * trace a path from the chosen block to one of its * unordered successors ( hopefully the primary ) , and so * on , until we run out of unordered successors * / while ( label ! = - 1 ) { bits clear ( work set , label ) ; bits clear ( traceback set , label ) ; order [ at ] = label ; at + + ; basic block one = blocks label to block ( label ) ; basic block preferred block = blocks preferred successor of ( one ) ; if ( preferred block = = null ) { break ; } int preferred = preferred block get label ( ) ; int primary = one get primary successor ( ) ; if ( bits get ( work set , preferred ) ) { / * * order the current block ' s preferred successor * next , as it has yet to be scheduled * / label = preferred ; } else if ( ( primary ! = preferred ) & & ( primary > = 0 ) & & bits get ( work set , primary ) ) { / * * the primary is available , so use that * / label = primary ; } else { / * * there ' s no obvious candidate , so pick the first * one that ' s available , if any * / int list successors = one get successors ( ) ; int ssz = successors size ( ) ; label = - 1 ; for ( int i = 0 ; i < ssz ; i + + ) { int candidate = successors get ( i ) ; if ( bits get ( work set , candidate ) ) { label = candidate ; break ; } } } } } if ( at ! = sz ) { / / there was a duplicate block label throw new runtime exception ( " shouldn ' t happen " ) ; } this order = order ; }


test that we don ' t scan too many blocks per second

public void test scan rate limit ( ) throws exception { configuration conf = new configuration ( ) ; / / limit scan bytes per second dramatically conf set long ( dfs block scanner volume bytes per second , 4096l ) ; / / scan continuously conf set long ( internal dfs datanode scan period ms , 1l ) ; conf set ( internal volume scanner scan result handler , test scan result handler class get name ( ) ) ; final test context ctx = new test context ( conf , 1 ) ; final int num expected blocks = 5 ; ctx create files ( 0 , num expected blocks , 4096 ) ; final test scan result handler info info = test scan result handler get info ( ctx volumes get ( 0 ) ) ; long start ms = time monotonic now ( ) ; synchronized ( info ) { info should run = true ; info notify ( ) ; } generic test utils wait for ( new supplier < boolean > ( ) { @ override public boolean get ( ) { synchronized ( info ) { return info blocks scanned > 0 ; } } } , 1 , 30000 ) ; thread sleep ( 2000 ) ; synchronized ( info ) { long end ms = time monotonic now ( ) ; / / should scan no more than one block a second long seconds = ( ( end ms + 999 - start ms ) / 1000 ) ; long max blocks scanned = seconds * 1 ; assert true ( " the number of blocks scanned is too large scanned " + info blocks scanned + " blocks ; only expected to scan at most " + max blocks scanned + " in " + seconds + " seconds " , info blocks scanned < = max blocks scanned ) ; } ctx close ( ) ; }


forwards the value from the source future to the target future

public static < t > void forward ( completable future < t > source , completable future < t > target ) { source when complete ( forward to ( target ) ) ; }


creates and returns a rule context to use for starlark tests that is equivalent to the one that was used to create the given configured target

protected rule context get rule context for starlark ( configured target target ) throws exception { / / todo ( bazel - team ) : we need this horrible workaround because caching analysis environment / / only works with stored error event listener despite the fact it accepts the interface / / error event listener , so it ' s not possible to create it with reporter / / see build view get rule context for testing ( ) stored event handler event handler = new stored event handler ( ) { @ override public synchronized void handle ( event e ) { super handle ( e ) ; reporter handle ( e ) ; } } ; return view get rule context for testing ( target , event handler , master config ) ; }


stores a key - value pair in this multimap some multimap implementations allow duplicate key - value pairs , in which case { @ code put } always adds a new key - value pair and increases the multimap size by 1 other implementations prohibit duplicates , and storing a key - value pair that ' s already in the multimap has no effect

boolean put ( @ nullable decl k key , @ nullable decl v value ) ;


gets the store exception when trying to read the store , if there was an error if there was no error , returns { @ code null }

public exception get store exception ( ) { return store exception ; }


returns an estimate of the position up to which data is buffered

public long get buffered position us ( ) { if ( loading finished ) { return c time end of source ; } else if ( is pending reset ( ) ) { return pending reset position us ; } else { long buffered position us = last seek position us ; base media chunk last media chunk = get last media chunk ( ) ; base media chunk last completed media chunk = last media chunk is load completed ( ) ? last media chunk : media chunks size ( ) > 1 ? media chunks get ( media chunks size ( ) - 2 ) : null ; if ( last completed media chunk ! = null ) { buffered position us = max ( buffered position us , last completed media chunk end time us ) ; } return max ( buffered position us , primary sample queue get largest queued timestamp us ( ) ) ; } }


get the actual schema from aliases if the provided schema is not an alias , the schema itself will be returned

public static schema unalias schema ( open a p i open a p i , schema schema , map < string , string > import mappings ) { map < string , schema > all schemas = get schemas ( open a p i ) ; if ( all schemas = = null | | all schemas is empty ( ) ) { / / skip the warning as the spec can have no model defined / / logger warn ( " all schemas cannot be null / empty in unalias schema returned ' schema ' " ) ; return schema ; } if ( schema ! = null & & string utils is not empty ( schema get $ ref ( ) ) ) { string simple ref = model utils get simple ref ( schema get $ ref ( ) ) ; if ( import mappings contains key ( simple ref ) ) { logger debug ( " schema unaliasing of { } omitted because aliased class is to be mapped to { } " , simple ref , import mappings get ( simple ref ) ) ; return schema ; } schema ref = all schemas get ( simple ref ) ; if ( ref = = null ) { once ( logger ) warn ( " { } is not defined " , schema get $ ref ( ) ) ; return schema ; } else if ( ref get enum ( ) ! = null & & ! ref get enum ( ) is empty ( ) ) { / / top - level enum class return schema ; } else if ( is array schema ( ref ) ) { if ( is generate alias as model ( ref ) ) { return schema ; / / generate a model extending array } else { return unalias schema ( open a p i , all schemas get ( model utils get simple ref ( schema get $ ref ( ) ) ) , import mappings ) ; } } else if ( is composed schema ( ref ) ) { return schema ; } else if ( is map schema ( ref ) ) { if ( ref get properties ( ) ! = null & & ! ref get properties ( ) is empty ( ) ) / / has at least one property return schema ; / / treat it as model else { if ( is generate alias as model ( ref ) ) { return schema ; / / generate a model extending map } else { / / treat it as a typical map return unalias schema ( open a p i , all schemas get ( model utils get simple ref ( schema get $ ref ( ) ) ) , import mappings ) ; } } } else if ( is object schema ( ref ) ) { / / model if ( ref get properties ( ) ! = null & & ! ref get properties ( ) is empty ( ) ) { / / has at least one property return schema ; } else { / / free form object ( type : object ) return unalias schema ( open a p i , all schemas get ( model utils get simple ref ( schema get $ ref ( ) ) ) , import mappings ) ; } } else { return unalias schema ( open a p i , all schemas get ( model utils get simple ref ( schema get $ ref ( ) ) ) , import mappings ) ; } } return schema ; }


strategy for a varying function signature like { @ code f ( int , string , numeric ) } using a sequence of { @ link argument type strategy } s the first n - 1 arguments must be constant the n - th argument can occur 0 , 1 , or more times

public static input type strategy varying sequence ( argument type strategy strategies ) { return new varying sequence input type strategy ( arrays as list ( strategies ) , null ) ; }


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

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


creates an ssl context builder with ciphers and apn appropriate for g r p c

public static ssl context builder for client ( ) { return configure ( ssl context builder for client ( ) ) ; }


returns the value reference of the entry if it should be closed , null otherwise

private synchronized closeable reference < v > reference to close ( entry < k , v > entry ) { preconditions check not null ( entry ) ; return ( entry is orphan & & entry client count = = 0 ) ? entry value ref : null ; }


visits an { @ link item } if it is a group , visits the children

public void on item ( item i ) { if ( i instanceof item group ) on item group ( ( item group ) i ) ; }


start tracking a node for decommission or maintenance the given datanode will be queued for later processing in pending nodes this method must be called under the namenode write lock

public void start tracking node ( datanode descriptor dn ) { pending nodes add ( dn ) ; }


set the http status code to the given value ( potentially non - standard and not resolvable through the { @ link http status } enum ) as an integer

default boolean set raw status code ( @ nullable integer value ) { if ( value = = null ) { return set status code ( null ) ; } else { http status http status = http status resolve ( value ) ; if ( http status = = null ) { throw new illegal state exception ( " unresolvable http status for general server http response : " + value ) ; } return set status code ( http status ) ; } }


clicks the button with the given name in the { @ link function tag button panel }

private void click button ( string name ) { function tag button panel btn panel = provider get button panel ( ) ; press button by name ( btn panel , name ) ; wait for swing ( ) ; }


invoke the cache operation defined by this instance wraps any exception that is thrown during the invocation in a { @ link throwable wrapper }

object invoke ( ) throws throwable wrapper ;


does nothing , as the threadpool is already initialized and waiting for work from the upstream factory


check if a given user is configured to bypass external attribute provider

private boolean is user bypassing ext attr provider ( final string user ) { return ( users to bypass ext attr provider ! = null ) & & users to bypass ext attr provider contains ( user ) ; }


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

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


centers an image inside of the bounds specified by { @ link # resize ( int , int ) } this scales the image so that both dimensions are equal to or less than the requested bounds

public request creator center inside ( ) { data center inside ( ) ; return this ; }


returns the height of the backing textures

public int get glyph page height ( ) { return glyph page height ; }


returns all banned i ps this does not include the i ps of id - banned players

public seq < string > get banned i ps ( ) { return banned i ps ; }


public void test non interrupting signal with sub process ( ) { process instance pi = runtime service start process instance by key ( " non interrupting signal with sub process " ) ; list < task > tasks = task service create task query ( ) process instance id ( pi get process instance id ( ) ) list ( ) ; assert that ( tasks ) has size ( 1 ) ; task current task = tasks get ( 0 ) ; assert that ( current task get name ( ) ) is equal to ( " approve " ) ; runtime service signal event received ( " alert " ) ; tasks = task service create task query ( ) process instance id ( pi get process instance id ( ) ) list ( ) ; assert that ( tasks ) has size ( 2 ) ; for ( task task : tasks ) { assert that ( task get name ( ) ) is in ( " approve " , " review " ) ; } task service complete ( task service create task query ( ) task name ( " approve " ) single result ( ) get id ( ) ) ; tasks = task service create task query ( ) process instance id ( pi get process instance id ( ) ) list ( ) ; assert that ( tasks ) has size ( 1 ) ; current task = tasks get ( 0 ) ; assert that ( current task get name ( ) ) is equal to ( " review " ) ; task service complete ( task service create task query ( ) task name ( " review " ) single result ( ) get id ( ) ) ; tasks = task service create task query ( ) process instance id ( pi get process instance id ( ) ) list ( ) ; assert that ( tasks ) has size ( 1 ) ; }


get userlogout : logs out current logged in user session

default response entity < void > logout user ( ) { return new response entity < > ( http status not implemented ) ; }


checks if the state should be persisted , if true do save state is called before continuing inherited classes can override this , to provide a better logic , when state should be saved

protected boolean trigger save state ( ) { / / implementors can overwrite this with something more intelligent than every - 50 return ( stats get num pages ( ) > 0 & & stats get num pages ( ) % 50 = = 0 ) ; }


returns the remainder of the given particular long value divided by this long value

public long value remainder of ( particular long value other ) { return remainder of ( ( specific long value ) other ) ; }


returns a fixed - size list backed by the specified array , similar to { @ link arrays # as list ( object [ ] ) } the list supports { @ link list # set ( int , object ) } , but any attempt to set a value to { @ code null } will result in a { @ link null pointer exception } the returned list maintains the values , but not the identities , of { @ code double } objects written to or read from it for example , whether { @ code list get ( 0 ) = = list get ( 0 ) } is true for the returned list is unspecified the returned list may have unexpected behavior if it contains { @ code na n } , or if { @ code na n } is used as a parameter to any of its methods < b > note : < b > when possible , you should represent your data as an { @ link immutable double array } instead , which has an { @ link immutable double array # as list as list } view

public static list < double > as list ( double backing array ) { if ( backing array length = = 0 ) { return collections empty list ( ) ; } return new double array as list ( backing array ) ; }


returns an ordering that compares objects according to the order in which they appear in the given list only objects present in the list ( according to { @ link object # equals } ) may be compared this comparator imposes a " partial ordering " over the type { @ code t } subsequent changes to the { @ code values in order } list will have no effect on the returned comparator null values in the list are not supported the returned comparator throws a { @ link class cast exception } when it receives an input parameter that isn ' t among the provided values the generated comparator is serializable if all the provided values are serializable

public static < t > ordering < t > explicit ( list < t > values in order ) { return new explicit ordering < t > ( values in order ) ; }


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

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


set the ' enabled ' appearance of the entire icon preserves the underlying enablement state of badges , though the entire icon looks disabled if < code > set enabled ( true ) < code > is called

public void set enabled ( boolean enabled ) { this enabled = enabled ; }


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


extract the content from the given jms message

protected object do convert from message ( @ nullable message message ) { if ( message ! = null ) { try { return get required message converter ( ) from message ( message ) ; } catch ( j m s exception ex ) { throw convert jms access exception ( ex ) ; } } return null ; }


peeks the next frame and returns a { @ link constant bitrate seeker } based on its bitrate

private seeker get constant bitrate seeker ( extractor input input ) throws i o exception { input peek fully ( scratch get data ( ) , 0 , 4 ) ; scratch set position ( 0 ) ; synchronized header set for header data ( scratch read int ( ) ) ; return new constant bitrate seeker ( input get length ( ) , input get position ( ) , synchronized header ) ; } @ ensures non null ( { " extractor output " , " real track output " }


casts { @ link iterator } by taking advantage of its covariant - ness

public static < t > iterator < t > cast ( iterator < ? extends t > itr ) { return ( iterator ) itr ; }


get a suffix for the user agent suffix of http requests , which can be used to identify the principal making abfs requests if the adaptee is a bound d t extension , it is queried for a ua suffix ; otherwise " " is returned

public string get user agent suffix ( ) { string suffix = extension helper get user agent suffix ( adaptee , " " ) ; return suffix ! = null ? suffix : " " ; }


simulates a user click in the code browser plugin

private void simulate button press ( final code browser plugin cbp ) { run swing ( ( ) - > click ( cbp , 1 ) ) ; }


copy or hardlink cached value to a specified directory , if it exists we ' re using hardlinking instead of symlinking because symlinking require weird checks to verify that the symlink still points to an existing artifact e g cleaning up the central cache but not the workspace cache

public synchronized path get ( string cache key , path target path , key type key type , string canonical id ) throws i o exception , interrupted exception { if ( thread interrupted ( ) ) { throw new interrupted exception ( ) ; } preconditions check state ( is enabled ( ) ) ; assert key is valid ( cache key , key type ) ; if ( ! exists ( cache key , key type ) ) { return null ; } path cache entry = key type get cache path ( content addressable path ) get relative ( cache key ) ; path cache value = cache entry get relative ( default cache filename ) ; try { assert file checksum ( cache key , cache value , key type ) ; } catch ( i o exception e ) { / / new lines because this error message gets large printing multiple absolute filepaths throw new i o exception ( e get message ( ) + " \ n \ n " + " please delete the directory " + cache entry + " and try again " ) ; } if ( ! strings is null or empty ( canonical id ) ) { if ( ! has canonical id ( cache key , key type , canonical id ) ) { return null ; } } file system utils create directory and parents ( target path get parent directory ( ) ) ; if ( use hardlinks ) { file system utils create hard link ( target path , cache value ) ; } else { file system utils copy file ( cache value , target path ) ; } try { file system utils touch file ( cache value ) ; } catch ( i o exception e ) { / / ignore , because the cache might be on a read - only volume } return target path ; }


retrieves and casts { @ link constraint value info } providers from the given targets

public static iterable < constraint value info > constraint values ( iterable < ? extends provider collection > targets ) { return iterables transform ( targets , platform provider utils : : constraint value ) ; }


delete node ( s ) from the tree ; called from the action listener on the menu

private void delete ( ) { int transaction i d = tree start transaction ( " delete " ) ; if ( transaction i d < 0 ) { return ; } boolean success = false ; try { synchronized ( root ) { try { success = delete range ( ) ; } catch ( exception e ) { msg show error ( this , null , null , null , e ) ; } } } finally { tree end transaction ( transaction i d , success ) ; } }


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

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


public static string read raw 2 string ( @ raw res final int res id , final string charset name ) { input stream is = utils get app ( ) get resources ( ) open raw resource ( res id ) ; byte [ ] bytes = utils bridge input stream 2 bytes ( is ) ; if ( bytes = = null ) return null ; if ( utils bridge is space ( charset name ) ) { return new string ( bytes ) ; } else { try { return new string ( bytes , charset name ) ; } catch ( unsupported encoding exception e ) { e print stack trace ( ) ; return " " ; } } }


returns true if the edges in this graph are directed directed edges connect a { @ link endpoint pair # source ( ) source node } to a { @ link endpoint pair # target ( ) target node } , while undirected edges connect a pair of nodes to each other


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


register a listener that will be called when this model is unbound from a view the listener will contribute to this model ' s hash code state per the { @ link com airbnb epoxy epoxy attribute option # do not hash } rules you may clear the listener by setting a null value , or by calling { @ link # reset ( ) }

public do not hash view model on unbind ( on model unbound listener < do not hash view model , do not hash view > listener ) { on mutation ( ) ; this on model unbound listener epoxy generated model = listener ; return this ; }


setter method for property < tt > hosts < tt >

public void set hosts ( list < ip address info > hosts ) { this hosts = hosts ; }


sort calls this to generate the final merged output

private int merge pass ( path tmp dir ) throws i o exception { if ( log is debug enabled ( ) ) { log debug ( " running merge pass " ) ; } writer writer = clone file attributes ( out file suffix ( " 0 " ) , out file , null ) ; raw key value iterator r = merge ( out file suffix ( " 0 " ) , out file suffix ( " 0 index " ) , tmp dir ) ; write file ( r , writer ) ; writer close ( ) ; return 0 ; }


set the < code > node label expression < code > of the request

public resource request builder node label expression ( string node label expression ) { resource request set node label expression ( node label expression ) ; return this ; }


public static set < member > select target members ( collection < member > members , predicate < member > filter ) { return members stream ( ) filter ( filter ) collect ( collectors to set ( ) ) ; }


checks if the given filedirectory can be read on posix , this corresponds to the ' r ' permission of the filedirectory itself

public boolean read ( file f ) throws security exception { return false ; }


set the implementation of the { @ code m bean info assembler } interface to use for this exporter default is a { @ code simple reflective m bean info assembler } the passed - in assembler can optionally implement the { @ code autodetect capable m bean info assembler } interface , which enables it to participate in the exporter ' s m bean autodetection process

public void set assembler ( m bean info assembler assembler ) { this assembler = assembler ; }


public void end parsing member ( byte array bytes , int offset , string name , string descriptor , member member ) { if ( ! ( member instanceof method ) ) { return ; } if ( ! should dump method ( name ) ) { return ; } if ( ( member get access flags ( ) & ( access flags acc abstract | access flags acc native ) ) ! = 0 ) { return ; } concrete method meth = new concrete method ( ( method ) member , class file , true , true ) ; translation advice advice = dex translation advice the one ; rop method rmeth = ropper convert ( meth , advice , class file get methods ( ) ) ; ssa method ssa meth = null ; boolean is static = access flags is static ( meth get access flags ( ) ) ; int param width = compute param width ( meth , is static ) ; if ( args ssa step = = null ) { ssa meth = optimizer debug no register allocation ( rmeth , param width , is static , true , advice , enum set all of ( optimizer optional step class ) ) ; } else if ( " edge - split " equals ( args ssa step ) ) { ssa meth = optimizer debug edge split ( rmeth , param width , is static , true , advice ) ; } else if ( " phi - placement " equals ( args ssa step ) ) { ssa meth = optimizer debug phi placement ( rmeth , param width , is static , true , advice ) ; } else if ( " renaming " equals ( args ssa step ) ) { ssa meth = optimizer debug renaming ( rmeth , param width , is static , true , advice ) ; } else if ( " dead - code " equals ( args ssa step ) ) { ssa meth = optimizer debug dead code remover ( rmeth , param width , is static , true , advice ) ; } string buffer sb = new string buffer ( 2000 ) ; sb append ( " first " ) ; sb append ( hex u 2 ( ssa meth block index to rop label ( ssa meth get entry block index ( ) ) ) ) ; sb append ( ' \ n ' ) ; array list < ssa basic block > blocks = ssa meth get blocks ( ) ; array list < ssa basic block > sorted blocks = ( array list < ssa basic block > ) blocks clone ( ) ; collections sort ( sorted blocks , ssa basic block label comparator ) ; for ( ssa basic block block : sorted blocks ) { sb append ( " block " ) append ( hex u 2 ( block get rop label ( ) ) ) append ( ' \ n ' ) ; bit set preds = block get predecessors ( ) ; for ( int i = preds next set bit ( 0 ) ; i > = 0 ; i = preds next set bit ( i + 1 ) ) { sb append ( " pred " ) ; sb append ( hex u 2 ( ssa meth block index to rop label ( i ) ) ) ; sb append ( ' \ n ' ) ; } sb append ( " live in : " + block get live in regs ( ) ) ; sb append ( " \ n " ) ; for ( ssa insn insn : block get insns ( ) ) { sb append ( " " ) ; sb append ( insn to human ( ) ) ; sb append ( ' \ n ' ) ; } if ( block get successors ( ) cardinality ( ) = = 0 ) { sb append ( " returns \ n " ) ; } else { int primary = block get primary successor rop label ( ) ; int list succ label list = block get rop label successor list ( ) ; int sz succ labels = succ label list size ( ) ; for ( int i = 0 ; i < sz succ labels ; i + + ) { sb append ( " next " ) ; sb append ( hex u 2 ( succ label list get ( i ) ) ) ; if ( sz succ labels ! = 1 & & primary = = succ label list get ( i ) ) { sb append ( " * " ) ; } sb append ( ' \ n ' ) ; } } sb append ( " live out : " + block get live out regs ( ) ) ; sb append ( " \ n " ) ; } suppress dump = false ; set at ( bytes , 0 ) ; parsed ( bytes , 0 , bytes size ( ) , sb to string ( ) ) ; suppress dump = true ; }


add the int property at the given offset

void add int ( short offset , int value ) { add key ( offset ) ; int row = get row ( offset , true ) ; table put int ( row , 0 , value ) ; }


creates list of users with given input array

public void create users with list input ( list < user > body ) ;


public static boolean move ( final file src , final file dest ) { return move ( src , dest , null ) ; }


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

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


returns the number of image bound forwarder ref structures that immediately follow this structure

public short get number of module forwarder refs ( ) { return number of module forwarder refs ; }


return the expression string used to create this { @ code cron expression }

public string to string ( ) { return this expression ; }


sorts x , y pairs of values by the x value , then the y value

private void sort ( float [ ] values , int count ) { int lower = 0 ; int upper = count - 1 ; int array stack = quicksort stack ; stack add ( lower ) ; stack add ( upper - 1 ) ; while ( stack size > 0 ) { upper = stack pop ( ) ; lower = stack pop ( ) ; if ( upper < = lower ) continue ; int i = quicksort partition ( values , lower , upper ) ; if ( i - lower > upper - i ) { stack add ( lower ) ; stack add ( i - 2 ) ; } stack add ( i + 2 ) ; stack add ( upper ) ; if ( upper - i > = i - lower ) { stack add ( lower ) ; stack add ( i - 2 ) ; } } }


parse a number that optionally has a postfix that denotes a base

private static long parse human long ( string str ) { char tail = str char at ( str length ( ) - 1 ) ; long base = 1 ; switch ( tail ) { case ' t ' : base * = 1000 * 1000 * 1000 * 1000 ; break ; case ' b ' : base * = 1000 * 1000 * 1000 ; break ; case ' m ' : base * = 1000 * 1000 ; break ; case ' k ' : base * = 1000 ; break ; default : } if ( base ! = 1 ) { str = str substring ( 0 , str length ( ) - 1 ) ; } return long parse long ( str ) * base ; }


returns true if the icon is an animated image < b > warning : < b > this call may block the swing thread for up to { @ link # max image load time } milliseconds the first time it is called !

public boolean is animated ( ) { if ( ! has checked for animated status ) { check animated ( base icon ) ; has checked for animated status = true ; } return is animated ; }


creates inet socket address from the given rpc address

private static inet socket address get inet socket address ( string rpc addr ) { string [ ] rpc addr arr = rpc addr split ( " : " ) ; int port = integer parse int ( rpc addr arr [ 1 ] ) ; string hostname = rpc addr arr [ 0 ] ; return new inet socket address ( hostname , port ) ; }


sets the current field index of the field that corresponds to the start loc program location

private boolean get field for location ( listing field field , int field index ) { field factory ff = field get field factory ( ) ; field location floc = ff get field location ( field , big integer zero , field index , start location ) ; if ( floc = = null ) { return false ; } if ( ! do search field ( ff get field name ( ) ) ) { return false ; } / / now determine where to start searching within the string current field index = field index ; start index = field screen location to text offset ( floc get row ( ) , floc get col ( ) ) ; return true ; }


the strength of the value type in each entry


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


represent a mutual exclusion use case the boolean flag exclude one of the two operation

public long get or put ( object id , boolean flag ) { return this counter get and increment ( ) ; }


{ @ link instrumenter # instrument litho handler ( com facebook litho litho handler ) }

public static litho handler instrument litho handler ( litho handler litho handler ) { final instrumenter instrumenter = s instance ; if ( instrumenter = = null ) { return litho handler ; } return instrumenter instrument litho handler ( litho handler ) ; }


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


get value of adaptive annotation or if empty return splitted simple name

private string [ ] get method adaptive value ( adaptive adaptive annotation ) { string [ ] value = adaptive annotation value ( ) ; / / value is not set , use the value generated from class name as the key if ( value length = = 0 ) { string split name = string utils camel to split name ( type get simple name ( ) , " " ) ; value = new string [ ] { split name } ; } return value ; }


copies the input stream to the writer , while performing variable substitutions the variable substitution processing supports 2 constructs for each key in @ { code substitutions } , any sequence of < code > $ { key } < code > in the input is replaced with the substitution value any line in the input that has the form < code > # if key < code > causes the following block to be output if - only - if key exists with a non - empty value in { @ code substitutions } a block is terminated with { @ code # endif } lines with { @ code # else } are also supported nested blocks are not supported

static void copy with substitutions ( input stream stream , print writer writer , map < string , string > substitutions ) throws i o exception { boolean skip = false ; for ( string line : streams read all lines ( stream ) ) { for ( map entry < string , string > subst : substitutions entry set ( ) ) { line = line replace ( " $ { " + subst get key ( ) + " } " , subst get value ( ) ) ; } if ( line starts with ( " # if " ) ) { final string key = line substring ( 4 ) trim ( ) ; skip = strings is null or empty ( substitutions get ( key ) ) ; continue ; } else if ( line equals ( " # else " ) ) { skip = ! skip ; continue ; } else if ( line equals ( " # endif " ) ) { skip = false ; continue ; } else if ( skip ) { continue ; } writer println ( line ) ; } }


this method is should only be called in tests ! this should never serve as key in a hash map

public boolean equals ( object o ) { if ( this = = o ) { return true ; } if ( o = = null | | get class ( ) ! = o get class ( ) ) { return false ; } incremental remote keyed state handle that = ( incremental remote keyed state handle ) o ; if ( get checkpoint id ( ) ! = that get checkpoint id ( ) ) { return false ; } if ( ! get backend identifier ( ) equals ( that get backend identifier ( ) ) ) { return false ; } if ( ! get key group range ( ) equals ( that get key group range ( ) ) ) { return false ; } if ( ! get shared state ( ) equals ( that get shared state ( ) ) ) { return false ; } if ( ! get private state ( ) equals ( that get private state ( ) ) ) { return false ; } return get meta state handle ( ) equals ( that get meta state handle ( ) ) ; }


sets the stream - id of this frame the stream - id must be positive

spdy stream frame set stream id ( int stream i d ) ;


< code > optional aapt pb attribute attr = 1 ; < code >

public builder set attr ( com android aapt resources attribute value ) { copy on write ( ) ; instance set attr ( value ) ; return this ; }


append a log record using a different offset

public void append with offset ( long offset , record record ) { append with offset ( offset , record timestamp ( ) , record key ( ) , record value ( ) , record headers ( ) ) ; }


set the negative button text for the rationale dialog should it be shown the default is { @ link android r string # cancel }

public builder set negative button text ( @ nullable string negative button text ) { m negative button text = negative button text ; return this ; }


get the { @ link url urls } that { @ link dubbo metadata service } exported by the specified { @ link service instance service instances }

public list < url > get dubbo metadata service u r ls ( list < service instance > service instances , string service interface , string version , string protocol ) { return service instances stream ( ) map ( this : : get dubbo metadata service u r ls ) flat map ( list : : stream ) filter ( url - > protocol = = null | | objects equals ( protocol , url get protocol ( ) ) ) filter ( url - > objects equals ( service interface , url get service interface ( ) ) ) filter ( url - > objects equals ( version , url get parameter ( version key ) ) ) collect ( collectors to list ( ) ) ; }


expands all nodes under and including this node

public void expand all ( ) { set expanded ( true ) ; if ( children size > 0 ) tree expand all ( children ) ; }


sets the aspects that are propagating to the target this dependency points to

builder set aspects ( aspect collection aspect collection ) ;


returns the distance between the given line and point note the specified line is not a line segment

public static float distance line point ( float start x , float start y , float end x , float end y , float point x , float point y ) { float normal length = ( float ) math sqrt ( ( end x - start x ) * ( end x - start x ) + ( end y - start y ) * ( end y - start y ) ) ; return math abs ( ( point x - start x ) * ( end y - start y ) - ( point y - start y ) * ( end x - start x ) ) / normal length ; }


public static object create instance ( string class name ) { object retv = null ; try { class loader class loader = thread current thread ( ) get context class loader ( ) ; class < ? > the filter class = class for name ( class name , true , class loader ) ; constructor < ? > meth = the filter class get declared constructor ( arg array ) ; meth set accessible ( true ) ; retv = meth new instance ( ) ; } catch ( exception e ) { throw new runtime exception ( e ) ; } return retv ; }


applies this function to the given argument


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

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


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


sets the bulk flush interval , in milliseconds

public void set bulk flush interval ( long interval millis ) { this bulk requests config put ( config key bulk flush interval ms , string value of ( interval millis ) ) ; }


returns whether the comments are the same

public boolean is same ( object obj 1 , object obj 2 ) { address a 1 = ( address ) obj 1 ; address a 2 = ( address ) obj 2 ; string c 1 = comparator listing 1 get comment ( type , a 1 ) ; string c 2 = comparator listing 2 get comment ( type , a 2 ) ; return system utilities is equal ( c 1 , c 2 ) ; }


public < t > t execute ( function < response , t > handler ) { return handler apply ( rest assured given ( ) spec ( req spec build ( ) ) expect ( ) spec ( resp spec build ( ) ) when ( ) request ( req method , req uri ) ) ; }


define if a wrapper will be used for indexed ( list , array ) properties or not by default ( only applies to { @ link xml mapper } )

public jackson 2 object mapper builder default use wrapper ( boolean default use wrapper ) { this default use wrapper = default use wrapper ; return this ; }


returns whether this spawn may be executing concurrently under multiple spawn runners if so , { @ link # lock output files } may raise { @ link interrupted exception }


get storeinventory : returns pet inventories by status returns a map of status codes to quantities

default response entity < map < string , integer > > get inventory ( ) { return new response entity < > ( http status not implemented ) ; }


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


notifies each analyzer in the list that the analysis session has ended

public void notify analysis ended ( program program ) { iterator < analysis scheduler > iter = tasks iterator ( ) ; while ( iter has next ( ) ) { analysis scheduler scheduler = iter next ( ) ; scheduler get analyzer ( ) analysis ended ( program ) ; } }


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


ghidra python interpreter get interpreter ( ) { return interpreter ; }


formats the cluster uuid into json fields

public void format ( log event event , string builder to append to ) { if ( node and cluster id state listener node and cluster id get ( ) ! = null ) { to append to append ( node and cluster id state listener node and cluster id get ( ) v 2 ( ) ) ; } / / node id / cluster uuid not received yet , not appending }


encode the url this extends { @ link u r l encoder # encode ( string , string ) } with a replacement of + with % 20

private static string encode url ( string url ) throws swift exception { if ( url matches ( " * \ \ s + * " ) ) { try { url = u r l encoder encode ( url , " utf - 8 " ) ; url = url replace ( " + " , " % 20 " ) ; } catch ( unsupported encoding exception e ) { throw new swift exception ( " failed to encode uri " , e ) ; } } return url ; }


return string representing the parent of the given path

string get parent ( string path ) { return path substring ( 0 , path last index of ( path separator ) ) ; }


add multiple { @ link event listener dubbo event listeners }

default void add event listeners ( iterable < e > listeners ) throws null pointer exception , illegal argument exception { stream ( listeners spliterator ( ) , false ) for each ( this : : add event listener ) ; }


variant of { @ link # metadata to extract ( mime type , class , string ) } that accepts { @ link parameterized type reference } instead of { @ link class } for specifying a target type with generic parameters

default void metadata to extract ( mime type mime type , parameterized type reference < ? > target type , @ nullable string name ) { string key = name ! = null ? name : mime type to string ( ) ; metadata to extract ( mime type , target type , ( value , map ) - > map put ( key , value ) ) ; }


get map property name from setting method < br > ex : put all x x x ( ) ; < br >

private string generate map field name ( string method name ) { return to camel case ( method name substring ( 6 ) ) ; }


boolean encode nger ( ) { if ( ( m current > 1 ) & & string at ( ( m current - 1 ) , 4 , " nger " , " " ) ) { / / default ' g ' = > j such as ' ranger ' , ' stranger ' , ' manger ' , ' messenger ' , ' orangery ' , ' granger ' / / ' boulanger ' , ' challenger ' , ' danger ' , ' changer ' , ' harbinger ' , ' lounger ' , ' ginger ' , ' passenger ' / / except for these the following if ( ! ( root or inflections ( m in word , " anger " ) | | root or inflections ( m in word , " linger " ) | | root or inflections ( m in word , " malinger " ) | | root or inflections ( m in word , " finger " ) | | ( string at ( ( m current - 3 ) , 4 , " hung " , " fing " , " bung " , " wing " , " ring " , " ding " , " zeng " , " zing " , " jung " , " long " , " ping " , " cong " , " mong " , " bang " , " gang " , " hang " , " lang " , " sang " , " sing " , " wang " , " zang " , " " ) / / exceptions to above where ' g ' = > j & & ! ( string at ( ( m current - 6 ) , 7 , " boulang " , " slesing " , " kissing " , " derring " , " " ) | | string at ( ( m current - 8 ) , 9 , " schlesing " , " " ) | | string at ( ( m current - 5 ) , 6 , " saling " , " belang " , " " ) | | string at ( ( m current - 6 ) , 7 , " barring " , " " ) | | string at ( ( m current - 6 ) , 9 , " phalanger " , " " ) | | string at ( ( m current - 4 ) , 5 , " chang " , " " ) ) ) | | string at ( ( m current - 4 ) , 5 , " sting " , " young " , " " ) | | string at ( ( m current - 5 ) , 6 , " strong " , " " ) | | string at ( 0 , 3 , " ung " , " eng " , " ing " , " " ) | | string at ( m current , 6 , " gerich " , " " ) | | string at ( 0 , 6 , " senger " , " " ) | | string at ( ( m current - 3 ) , 6 , " wenger " , " munger " , " songer " , " kinger " , " " ) | | string at ( ( m current - 4 ) , 7 , " flinger " , " slinger " , " stanger " , " stenger " , " klinger " , " clinger " , " " ) | | string at ( ( m current - 5 ) , 8 , " springer " , " sprenger " , " " ) | | string at ( ( m current - 3 ) , 7 , " lingerf " , " " ) | | string at ( ( m current - 2 ) , 7 , " angerly " , " angerbo " , " ingerso " , " " ) ) ) { metaph add exact approx ( " j " , " g " , " j " , " k " ) ; } else { metaph add exact approx ( " g " , " j " , " k " , " j " ) ; } advance counter ( 2 , 1 ) ; return true ; } return false ; }


create the method argument value of the expected parameter type by reading from the given http input message

protected < t > object read with message converters ( http input message input message , method parameter parameter , type target type ) throws i o exception , http media type not supported exception , http message not readable exception { media type content type ; boolean no content type = false ; try { content type = input message get headers ( ) get content type ( ) ; } catch ( invalid media type exception ex ) { throw new http media type not supported exception ( ex get message ( ) ) ; } if ( content type = = null ) { no content type = true ; content type = media type application octet stream ; } class < ? > context class = parameter get containing class ( ) ; class < t > target class = ( target type instanceof class ? ( class < t > ) target type : null ) ; if ( target class = = null ) { resolvable type resolvable type = resolvable type for method parameter ( parameter ) ; target class = ( class < t > ) resolvable type resolve ( ) ; } http method http method = ( input message instanceof http request ? ( ( http request ) input message ) get method ( ) : null ) ; object body = no value ; empty body checking http input message message ; try { message = new empty body checking http input message ( input message ) ; for ( http message converter < ? > converter : this message converters ) { class < http message converter < ? > > converter type = ( class < http message converter < ? > > ) converter get class ( ) ; generic http message converter < ? > generic converter = ( converter instanceof generic http message converter ? ( generic http message converter < ? > ) converter : null ) ; if ( generic converter ! = null ? generic converter can read ( target type , context class , content type ) : ( target class ! = null & & converter can read ( target class , content type ) ) ) { if ( message has body ( ) ) { http input message msg to use = get advice ( ) before body read ( message , parameter , target type , converter type ) ; body = ( generic converter ! = null ? generic converter read ( target type , context class , msg to use ) : ( ( http message converter < t > ) converter ) read ( target class , msg to use ) ) ; body = get advice ( ) after body read ( body , msg to use , parameter , target type , converter type ) ; } else { body = get advice ( ) handle empty body ( null , message , parameter , target type , converter type ) ; } break ; } } } catch ( i o exception ex ) { throw new http message not readable exception ( " i / o error while reading input message " , ex , input message ) ; } if ( body = = no value ) { if ( http method = = null | | ! supported methods contains ( http method ) | | ( no content type & & ! message has body ( ) ) ) { return null ; } throw new http media type not supported exception ( content type , this all supported media types ) ; } media type selected content type = content type ; object the body = body ; log format utils trace debug ( logger , trace on - > { string formatted = log format utils format value ( the body , ! trace on ) ; return " read \ " " + selected content type + " \ " to [ " + formatted + " ] " ; } ) ; return body ; }


set the list of response headers other than " simple " headers , i e { @ code cache - control } , { @ code content - language } , { @ code content - type } , { @ code expires } , { @ code last - modified } , or { @ code pragma } , that an actual response might have and can be exposed the special value { @ code " " } allows all headers to be exposed for non - credentialed requests by default this is not set

public cors registration exposed headers ( string headers ) { this config set exposed headers ( arrays as list ( headers ) ) ; return this ; }


model tests for additional properties integer

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


get the value of the ' { @ code accesskey } ' attribute

protected string get accesskey ( ) { return this accesskey ; }


protected void create remember me authn webflow config ( final flow flow ) { if ( cas properties get ticket ( ) get tgt ( ) get remember me ( ) is enabled ( ) ) { create flow variable ( flow , cas webflow constants var id credential , remember me username password credential class ) ; val state = get state ( flow , cas webflow constants state id view login form , view state class ) ; val cfg = get view state binder configuration ( state ) ; cfg add binding ( new binder configuration binding ( " remember me " , null , false ) ) ; } else { create flow variable ( flow , cas webflow constants var id credential , username password credential class ) ; } }


choose target for web h d f s redirection

public datanode storage info [ ] choose target 4 web h d f s ( string src , datanode descriptor clientnode , set < node > excludes , long blocksize ) { return placement policies get policy ( contiguous ) choose target ( src , 1 , clientnode , collections < datanode storage info > empty list ( ) , false , excludes , blocksize , storage policy suite get default policy ( ) , null ) ; }


set a unique synchronization identifier for this store

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


retrieve instance of { @ link hystrix concurrency strategy } to use based on order of precedence as defined in { @ link hystrix plugins } class header override default by using { @ link # register concurrency strategy ( hystrix concurrency strategy ) } or setting property ( via archaius ) : < code > hystrix plugin hystrix concurrency strategy implementation < code > with the full classname to load

public hystrix concurrency strategy get concurrency strategy ( ) { if ( concurrency strategy get ( ) = = null ) { / / check for an implementation from archaius first object impl = get plugin implementation ( hystrix concurrency strategy class ) ; if ( impl = = null ) { / / nothing set via archaius so initialize with default concurrency strategy compare and set ( null , hystrix concurrency strategy default get instance ( ) ) ; / / we don ' t return from here but call get ( ) again in case of thread - race so the winner will always get returned } else { / / we received an implementation from archaius so use it concurrency strategy compare and set ( null , ( hystrix concurrency strategy ) impl ) ; } } return concurrency strategy get ( ) ; }


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


set the long value for instance settings

public boolean set long settings value ( address data addr , string name , long value ) { return update instance settings ( data addr , name , null , value , null ) ; }


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

public void set unmarshaller ( unmarshaller unmarshaller ) { this unmarshaller = unmarshaller ; }


returns the maximum texture size that will be used by generate data ( ) when creating a texture atlas for the glyphs

public static int get max texture size ( ) { return max texture size ; }


returns { @ code x mod m } , a non - negative value less than { @ code m } this differs from { @ code x % m } , which might be negative for example : { @ code mod ( 7 , 4 ) = = 3 mod ( - 7 , 4 ) = = 1 mod ( - 1 , 4 ) = = 3 mod ( - 8 , 4 ) = = 0 mod ( 8 , 4 ) = = 0 }

public static int mod ( int x , int m ) { if ( m < = 0 ) { throw new arithmetic exception ( " modulus " + m + " must be > 0 " ) ; } int result = x % m ; return ( result > = 0 ) ? result : result + m ; }


test serialization of outer number types

public api response < big decimal > fake outer number serialize with http info ( big decimal body ) throws api exception { okhttp 3 call local var call = fake outer number serialize validate before call ( body , null ) ; type local var return type = new type token < big decimal > ( ) { } get type ( ) ; return local var api client execute ( local var call , local var return type ) ; }


returns the outgoing edges from the given vertex

public set < edge > get outgoing edges ( vertex v ) { set < edge > outgoing edges = new hash set < edge > ( ) ; edge e = vertices get first outgoing edge ( v ) ; while ( e ! = null ) { outgoing edges add ( e ) ; e = edges get next edge with same from ( e ) ; } return outgoing edges ; }


resolve the given string value , for example parsing placeholders

string resolve string value ( string str val ) ;


handle the end of the input by closing down the application

public void close ( ) throws i o exception { / / if we haven ' t started the application , we have nothing to do if ( is ok ) { output collector < k3 , v3 > null collector = new output collector < k3 , v3 > ( ) { public void collect ( k3 key , v3 value ) throws i o exception { / / null } } ; start application ( null collector , reporter null ) ; } try { if ( is ok ) { application get downlink ( ) end of input ( ) ; } else { / / send the abort to the application and let it clean up application get downlink ( ) abort ( ) ; } log info ( " waiting for finish " ) ; application wait for finish ( ) ; log info ( " got done " ) ; } catch ( throwable t ) { application abort ( t ) ; } finally { application cleanup ( ) ; } }


sets the < code > message < code > property

public model api response message ( string message ) { this message = message ; return this ; }


sets the name for the iteration the name is displayed in logs and messages

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


adds a stored field to load and return ( note , it must be stored ) as part of the search request

public search request builder add stored field ( string field ) { source builder ( ) stored field ( field ) ; return this ; }


build a new apache ' s { @ link org apache http client methods http uri request } from jersey ' s { @ link org glassfish jersey client client request } convert a method , uri , body , headers and override a user - agent if necessary

private http uri request build apache request ( client request jersey request ) { final request builder builder = request builder create ( jersey request get method ( ) ) set uri ( jersey request get uri ( ) ) set entity ( get http entity ( jersey request ) ) ; for ( string header name : jersey request get headers ( ) key set ( ) ) { builder add header ( header name , jersey request get header string ( header name ) ) ; } final optional < request config > request config = add jersey request config ( jersey request ) ; request config if present ( builder : : set config ) ; return builder build ( ) ; }


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


returns a hash code for { @ code value } ; equal to the result of invoking { @ code ( ( boolean ) value ) hash code ( ) } < b > java 8 users : < b > use { @ link boolean # hash code ( boolean ) } instead

public static int hash code ( boolean value ) { return value ? 1231 : 1237 ; }


expect a provider to raise an exception on failure

private i o exception expect provider instantiation failure ( class a class , string expected error text ) throws exception { return expect provider instantiation failure ( build class list string ( collections singleton list ( a class ) ) , expected error text ) ; }


cleans up b l o bs which are not referenced anymore

public void run ( ) { synchronized ( job ref counters ) { iterator < map entry < job i d , ref count > > entry iter = job ref counters entry set ( ) iterator ( ) ; final long current time millis = system current time millis ( ) ; while ( entry iter has next ( ) ) { map entry < job i d , ref count > entry = entry iter next ( ) ; ref count ref = entry get value ( ) ; if ( ref references < = 0 & & ref keep until > 0 & & current time millis > = ref keep until ) { job i d job id = entry get key ( ) ; final file local file = new file ( blob utils get storage location path ( storage dir get absolute path ( ) , job id ) ) ; / * * note : normally it is not required to acquire the write lock to delete the job ' s * storage directory since there should be no one accessing it with the ref * counter being 0 - acquire it just in case , to always be on the safe side * / read write lock write lock ( ) lock ( ) ; boolean success = false ; try { file utils delete directory ( local file ) ; success = true ; } catch ( throwable t ) { log warn ( " failed to locally delete job directory " + local file get absolute path ( ) , t ) ; } finally { read write lock write lock ( ) unlock ( ) ; } / / let ' s only remove this directory from cleanup if the cleanup was / / successful / / ( does not need the write lock ) if ( success ) { entry iter remove ( ) ; } } } } }


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


check whether two arrays of types match , converting primitive types to their corresponding wrappers

private boolean match ( class < ? > [ ] declared types , class < ? > [ ] actual types ) { if ( declared types length = = actual types length ) { for ( int i = 0 ; i < actual types length ; i + + ) { if ( actual types [ i ] = = null class ) continue ; if ( wrapper ( declared types [ i ] ) is assignable from ( wrapper ( actual types [ i ] ) ) ) continue ; return false ; } return true ; } else { return false ; } }


generates a new asymmetric key pair of the given type

public static key pair generate key pair ( x 5 0 9 key type key type ) throws general security exception { switch ( key type ) { case rsa : return generate r s a key pair ( ) ; case ec : return generate e c key pair ( ) ; default : throw new illegal argument exception ( " invalid x 5 0 9 key type " ) ; } }


return the time to live for this object in milliseconds

public long get time to live in millis ( ) throws transaction timed out exception { if ( this deadline = = null ) { throw new illegal state exception ( " no timeout specified for this resource holder " ) ; } long time to live = this deadline get time ( ) - system current time millis ( ) ; check transaction timeout ( time to live < = 0 ) ; return time to live ; }


writes a d w a r fv 3 - style unsigned leb128 integer for details , see the " dalvik executable format " document or dwarf v 3 section 7 6

public int write uleb 1 2 8 ( int value ) ;


overridden since spring ' s rule - based j unit support cannot properly integrate with timed execution that is controlled by a third - party runner

public void transactional with j unit timeout ( ) { assert that transaction ( ) is not active ( ) ; }