read the version information from the the resource file

private void get about info ( ) { string release name = application get application release name ( ) ; string build info = " " ; if ( release name ! = null ) { build info = " \ n build " + release name ; } / / set some default values in case we don ' t have the resource file version = " version " + application get application version ( ) + ( system utilities is in development mode ( ) ? " - development " : " " ) + build info + " \ n " + application get build date ( ) ; marking = application get application property ( application properties release marking property ) ; distribution info = load splash screen h t m l ( ) ; }


return the value of meta - data in activity

public static string get meta data in activity ( @ non null final activity activity , @ non null final string key ) { return get meta data in activity ( activity get class ( ) , key ) ; }


parses the classpath into a set of u r ls for testing

static set < url > parse class path ( string class path ) { string path separator = system get property ( " path separator " ) ; string file separator = system get property ( " file separator " ) ; string elements [ ] = class path split ( path separator ) ; set < url > url elements = new linked hash set < > ( ) ; / / order is already lost , but some filesystems have it for ( string element : elements ) { / / technically empty classpath element behaves like cwd / / so below is the " correct " code , however in practice with es , this is usually just a misconfiguration , / / from old shell scripts left behind or something : / / if ( element is empty ( ) ) { / / element = system get property ( " user dir " ) ; / / } / / instead we just throw an exception , and keep it clean if ( element is empty ( ) ) { throw new illegal state exception ( " classpath should not contain empty elements ! ( outdated shell script from a previous " + " version ? ) classpath = ' " + class path + " ' " ) ; } / / we should be able to just paths get ( ) each element , but unfortunately this is not the / / whole story on how classpath parsing works : if you want to know , start at sun misc launcher , / / be sure to stop before you tear out your eyes we just handle the " alternative " filename / / specification which java seems to allow , explicitly , right here if ( element starts with ( " / " ) & & " \ \ " equals ( file separator ) ) { / / " correct " the entry to become a normal entry / / change to correct file separators element = element replace ( " / " , " \ \ " ) ; / / if there is a drive letter , nuke the leading separator if ( element length ( ) > = 3 & & element char at ( 2 ) = = ' : ' ) { element = element substring ( 1 ) ; } } / / now just parse as ordinary file try { if ( element equals ( " / " ) ) { / / eclipse adds this to the classpath when running unit tests continue ; } url url = path utils get ( element ) to uri ( ) to u r l ( ) ; / / junit 4 childvm count if ( url elements add ( url ) = = false & & element ends with ( " jar " ) ) { throw new illegal state exception ( " jar hell ! " + system line separator ( ) + " duplicate jar [ " + element + " ] on classpath : " + class path ) ; } } catch ( malformed u r l exception e ) { / / should not happen , as we use the filesystem api throw new runtime exception ( e ) ; } } return collections unmodifiable set ( url elements ) ; }


runs the given { @ code runnable } if an exception happens during that , the given closable is quietly closed

public static void do with cleanup on exception ( final closeable to clean up , final throwing runnable < i o exception > code ) throws i o exception { do with cleanup on exception ( to clean up , ( supplier with exception < void , i o exception > ) ( ) - > { code run ( ) ; return null ; } ) ; }


check whether the given { @ code char sequence } contains any whitespace characters

public static boolean contains whitespace ( @ nullable char sequence str ) { if ( ! has length ( str ) ) { return false ; } int str len = str length ( ) ; for ( int i = 0 ; i < str len ; i + + ) { if ( character is whitespace ( str char at ( i ) ) ) { return true ; } } return false ; }


removes all instances of the same type , then add the new one

public void replace ( t item ) throws i o exception { remove all ( ( class ) item get class ( ) ) ; data add ( item ) ; on modified ( ) ; }


public int get char position in line ( ) { if ( i < tokens size ( ) ) { return tokens get ( i ) get char position in line ( ) ; } else if ( eof token ! = null ) { return eof token get char position in line ( ) ; } else if ( tokens size ( ) > 0 ) { / / have to calculate the result from the line / column of the previous / / token , along with the text of the token token last token = tokens get ( tokens size ( ) - 1 ) ; string token text = last token get text ( ) ; if ( token text ! = null ) { int last new line = token text last index of ( ' \ n ' ) ; if ( last new line > = 0 ) { return token text length ( ) - last new line - 1 ; } } return last token get char position in line ( ) + last token get stop index ( ) - last token get start index ( ) + 1 ; } / / only reach this if tokens is empty , meaning eof occurs at the first / / position in the input return 0 ; }


reverses the elements of { @ code array } between { @ code from index } inclusive and { @ code to index } exclusive this is equivalent to { @ code collections reverse ( shorts as list ( array ) sub list ( from index , to index ) ) } , but is likely to be more efficient

public static void reverse ( short [ ] array , int from index , int to index ) { check not null ( array ) ; check position indexes ( from index , to index , array length ) ; for ( int i = from index , j = to index - 1 ; i < j ; i + + , j - - ) { short tmp = array [ i ] ; array [ i ] = array [ j ] ; array [ j ] = tmp ; } }


adds a hint that null values are expected in the data for this type ( default behavior ) this method exists for explicit declaration of the default behavior or for invalidation of a previous call to { @ link # not null ( ) }


checks for a { @ link create table operation } you can provide additional matchers as parameters all of the provided nested matchers must match example : { @ code assert that ( operation , create table operation ( has schema ( table schema builder ( ) field ( " f 0 " , data types int ( ) not null ( ) ) field ( " f 1 " , data types timestamp ( 3 ) ) field ( " a " , data types int ( ) ) watermark ( " f 1 " , " ` f 1 ` - interval ' 5 ' second " , data types timestamp ( 3 ) ) build ( ) ) , has options ( entry ( " connector type " , " kafka " ) , entry ( " format type " , " json " ) ) , has partition ( " a " , " f 0 " ) ) ) ; }

public static matcher < operation > is create table operation ( matcher < create table operation > nested matchers ) { return new create table operation matcher ( nested matchers ) ; }


search through bytes of a memory block using the finite state machine - root - apply any additional rules for matching patterns

private void search block ( sequence search state root state , program program , memory block block , address set view restrict set , task monitor monitor ) throws i o exception , cancelled exception { / / if no restricted set , make restrict set the full block address set done set ; if ( restrict set = = null | | restrict set is empty ( ) ) { done set = new address set ( block get start ( ) , block get end ( ) ) ; } else { done set = restrict set intersect range ( block get start ( ) , block get end ( ) ) ; } long num in done set = done set get num addresses ( ) ; long num in block = block get size ( ) ; address block start addr = block get start ( ) ; / / pull each range off the restricted set long progress = monitor get progress ( ) ; address range iterator address ranges = done set get address ranges ( ) ; long num done = 0 ; while ( address ranges has next ( ) ) { monitor check canceled ( ) ; monitor set message ( search name + " search " ) ; monitor set progress ( progress + ( long ) ( num in block * ( ( float ) num done / num in done set ) ) ) ; address range address range = address ranges next ( ) ; long num addresses in range = address range get length ( ) ; array list < match > mymatches = new array list < > ( ) ; long streamoffset = block start addr get offset ( ) ; / / give block a starting / ending point before this address to search / / patterns might start before , since they have a pre - pattern / / todo : this is dangerous , since pattern might be very big , but the set should be restricted / / normally only when we are searching for more matching patterns that had a postrule that didn ' t satisfy / / normally the whole memory blocks will get searched long block offset = address range get min address ( ) subtract ( block start addr ) ; block offset = block offset - restricted pattern byte range ; if ( block offset < = 0 ) { / / don ' t go before the block start block offset = 0 ; } / / compute number of bytes in the range + 1 , and don ' t search more than that long max block search length = address range get max address ( ) subtract ( block start addr ) - block offset + 1 ; input stream data = block get data ( ) ; data skip ( block offset ) ; root state apply ( data , max block search length , mymatches , monitor ) ; monitor check canceled ( ) ; monitor set message ( search name + " ( examine matches ) " ) ; / / todo : danger there is much offset < - - > address calculation here / / should be ok , since they are all relative to the block long match progress = progress + ( long ) ( num in block * ( ( float ) num done / num in done set ) ) ; for ( int i = 0 ; i < mymatches size ( ) ; + + i ) { monitor check canceled ( ) ; monitor set progress ( match progress + ( long ) ( num addresses in range * ( ( float ) i / mymatches size ( ) ) ) ) ; match match = mymatches get ( i ) ; address addr = block start addr add ( match get mark offset ( ) + block offset ) ; if ( ! match check post rules ( streamoffset + block offset ) ) { continue ; } match action [ ] matchactions = match get match actions ( ) ; pre match apply ( matchactions , addr ) ; for ( match action matchaction : matchactions ) { matchaction apply ( program , addr , match ) ; } post match apply ( matchactions , addr ) ; } num done + = num addresses in range ; } }


this implementation creates a class path resource , applying the given path relative to the path of the underlying resource of this descriptor

public resource create relative ( string relative path ) { string path to use = string utils apply relative path ( this path , relative path ) ; return ( this clazz ! = null ? new class path resource ( path to use , this clazz ) : new class path resource ( path to use , this class loader ) ) ; }


creates stream descriptor which is a copy of this one with the value of sequence changed to the value passed in recursively calls itself on the nested streams

private static stream descriptor copy stream descriptor with sequence ( stream descriptor stream descriptor , int sequence ) { list < stream descriptor > stream descriptors = stream descriptor get nested streams ( ) stream ( ) map ( stream - > copy stream descriptor with sequence ( stream , sequence ) ) collect ( to immutable list ( ) ) ; return new stream descriptor ( stream descriptor get stream name ( ) , stream descriptor get stream id ( ) , stream descriptor get field name ( ) , stream descriptor get orc type ( ) , stream descriptor get orc data source ( ) , stream descriptors , sequence ) ; }


set the name of the logger to use the name will be passed to the underlying logger implementation through commons logging , getting interpreted as log category according to the logger ' s configuration this can be specified to not log into the category of a class ( whether this interceptor ' s class or the class getting called ) but rather into a specific named category < b > note : < b > specify either this property or " use dynamic logger " , not both

public void set logger name ( string logger name ) { this default logger = log factory get log ( logger name ) ; }


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


return the domain for cookies created by this generator , if any

public string get cookie domain ( ) { return this cookie domain ; }


returns the function signature or prototype ( eg , " int foo ( double d ) " )

public string get signature ( ) { return signature ; }


guaranteed to throw an exception and leave the map unmodified

public void put all ( map < ? extends type token < ? extends b > , ? extends b > map ) { throw new unsupported operation exception ( ) ; }


adds { @ code elem } as a candidate for the top { @ code k } elements this operation takes amortized o ( 1 ) time

public void offer ( @ nullable decl t elem ) { if ( k = = 0 ) { return ; } else if ( buffer size = = 0 ) { buffer [ 0 ] = elem ; threshold = elem ; buffer size = 1 ; } else if ( buffer size < k ) { buffer [ buffer size + + ] = elem ; if ( comparator compare ( elem , threshold ) > 0 ) { threshold = elem ; } } else if ( comparator compare ( elem , threshold ) < 0 ) { / / otherwise , we can ignore elem ; we ' ve seen k better elements buffer [ buffer size + + ] = elem ; if ( buffer size = = 2 * k ) { trim ( ) ; } } }


returns the glibc version used by the abi we ' re using this is a glibc version number ( e g , " 2 2 2 " ) note that in practice we might be using glibc 2 2 2 as abi even when compiling with gcc - 4 2 2 , gcc - 4 3 1 , or gcc - 4 4 0 ( which use glibc 2 3 6 ) , because a b is are backwards compatible

public string get abi glibc version ( ) { return abi glibc version ; }


creates an { @ link incremental file merger input } from a { @ link directory input } all files in the directory will be reported in the incremental input this method assumes the input does not contain incremental information all files will be reported as new

public static incremental file merger input to non incremental input ( @ non null directory input directory input , @ nullable map < incremental file merger input , qualified content > content map ) { file dir file = directory input get file ( ) ; if ( ! dir file is directory ( ) ) { return null ; } incremental file merger input input = lazy incremental file merger inputs from new ( dir file get absolute path ( ) , immutable set of ( dir file ) ) ; if ( content map ! = null ) { content map put ( input , directory input ) ; } return input ; }


public member get member ( ) { return this executable ; }


get the { @ link unmarshaller } for the given { @ link channel handler context }

unmarshaller get unmarshaller ( channel handler context ctx ) throws exception ;


public remote info response remote info ( remote info request request , request options options ) throws i o exception { return rest high level client perform request and parse entity ( request , cluster request converters : : remote info , options , remote info response : : from x content , singleton ( rest status request timeout get status ( ) ) ) ; }


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


read the next key in a set into < code > key < code > returns true if such a key exists and false when at the end of the set

public boolean next ( writable comparable key ) throws i o exception { return next ( key , null writable get ( ) ) ; }


build a { @ linkplain function definition } for a one - argument function that is not aware of time zone , does not support { @ code distinct } and needs the configuration object

protected static < t extends function > function definition def ( class < t > function , unary configuration aware function builder < t > ctor ref , string names ) { function builder builder = ( source , children , distinct , cfg ) - > { if ( children size ( ) > 1 ) { throw new ql illegal argument exception ( " expects exactly one argument " ) ; } if ( distinct ) { throw new ql illegal argument exception ( " does not support distinct yet it was specified " ) ; } expression ex = children size ( ) = = 1 ? children get ( 0 ) : null ; return ctor ref build ( source , ex , cfg ) ; } ; return def ( function , builder , false , names ) ; }


shorthand for { @ link query builder # build ( ) build ( ) } { @ link query # internal rx ( ) }

public rx query < t > rx ( ) { return build ( ) internal rx ( ) ; }


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


returns whether or not this is a category 2 type

public boolean is category 2 ( ) { switch ( basic type ) { case bt long : case bt double : { return true ; } } return false ; }


concatenate the given { @ code string } arrays into one , with overlapping array elements included twice the order of elements in the original arrays is preserved

public static string [ ] concatenate string arrays ( @ nullable string [ ] array 1 , @ nullable string [ ] array 2 ) { if ( object utils is empty ( array 1 ) ) { return array 2 ; } if ( object utils is empty ( array 2 ) ) { return array 1 ; } string [ ] new arr = new string [ array 1 length + array 2 length ] ; system arraycopy ( array 1 , 0 , new arr , 0 , array 1 length ) ; system arraycopy ( array 2 , 0 , new arr , array 1 length , array 2 length ) ; return new arr ; }


to test the collection format in query parameters

public void test query parameter collection format ( list < string > pipe , list < string > ioutil , list < string > http , list < string > url , list < string > context ) throws api exception { test query parameter collection format with http info ( pipe , ioutil , http , url , context ) ; }


find a custom property editor for the given type and property

property editor find editor ( @ nullable string field , @ nullable class < ? > value type ) ;


sets the specified byte at the current { @ code writer index } and increases the { @ code writer index } by { @ code 1 } in this buffer the 24 high - order bits of the specified value are ignored


puts the type path jvms structure corresponding to the given type path into the given byte vector

static void put ( final type path type path , final byte vector output ) { if ( type path = = null ) { output put byte ( 0 ) ; } else { int length = type path type path container [ type path type path offset ] * 2 + 1 ; output put byte array ( type path type path container , type path type path offset , length ) ; } }


public static void remove acl feature ( acl feature acl feature ) { unique acl features remove ( acl feature ) ; }


exit a parse tree produced by { @ link sql base parser # when clause }

void exit when clause ( sql base parser when clause context ctx ) ;


base 6 4 version of the commit id ( see { @ link segment infos # get id ( ) }

public string get id ( ) { return id ; }


for given ' www - authenticate ' header value returns the priority based on the auth - scheme lower number denotes more secure and preferred auth - scheme than the higher number

private static integer auth scheme priority ( final string header value ) { if ( header value region matches ( true , 0 , " negotiate " , 0 , " negotiate " length ( ) ) ) { return 0 ; } else if ( header value region matches ( true , 0 , " bearer " , 0 , " bearer " length ( ) ) ) { return 1 ; } else if ( header value region matches ( true , 0 , " apikey " , 0 , " apikey " length ( ) ) ) { return 2 ; } else if ( header value region matches ( true , 0 , " basic " , 0 , " basic " length ( ) ) ) { return 3 ; } else { return 4 ; } }


tests that - - features = - thin lto overrides - - features = autofdo implicit thinlto and prevents enabling thin l t o for afdo with llvm

public void test auto fdo implicit thin lto disabled option ( ) throws exception { scratch file ( " pkg / build " , " " , " cc binary ( name = ' bin ' , " , " srcs = [ ' binfile cc ' , ] , " , " malloc = ' / / base : system malloc ' ) " ) ; scratch file ( " pkg / binfile cc " , " int main ( ) { } " ) ; scratch file ( " pkg / profile afdo " , " " ) ; setup auto fdo thin lto crosstool ( ) ; use configuration ( " - - fdo optimize = pkg / profile afdo " , " - - compilation mode = opt " , " - - features = autofdo implicit thinlto " , " - - features = - thin lto " ) ; artifact bin artifact = get files to build ( get configured target ( " / / pkg : bin " ) ) get singleton ( ) ; cpp link action link action = ( cpp link action ) get generating action ( bin artifact ) ; assert that ( link action get outputs ( ) ) contains exactly ( bin artifact ) ; lto backend action backend action = ( lto backend action ) get predecessor by input name ( link action , " pkg / bin lto / pkg / objs / bin / binfile o " ) ; / / we should not have a thin l t o backend action assert that ( backend action ) is null ( ) ; }


a helper method to find all actions with the given name

public static set < docking action if > get actions by name ( tool tool , string name ) { set < docking action if > result = new hash set < > ( ) ; set < docking action if > tool actions = tool get all actions ( ) ; for ( docking action if action : tool actions ) { if ( action get name ( ) equals ( name ) ) { result add ( action ) ; } } return result ; }


creates a { @ link leader election driver factory } implemented by zoo keeper

public static zoo keeper leader election driver factory create leader election driver factory ( final curator framework client , final configuration configuration , final string path suffix ) { final string latch path = configuration get string ( high availability options ha zookeeper latch path ) + path suffix ; final string leader path = configuration get string ( high availability options ha zookeeper leader path ) + path suffix ; return new zoo keeper leader election driver factory ( client , latch path , leader path ) ; }


get the underlying raw value for the field without accounting for default values

public object get without default ( string field name ) { field field = lookup field ( field name ) ; return values [ field index ( ) ] ; } / / note that all getters have to have boxed return types since the fields might be optional


public class locate properties class for type ( final class or interface type type ) { if ( cached properties classes contains key ( type get name as string ( ) ) ) { return cached properties classes get ( type get name as string ( ) ) ; } val package name = configuration metadata generator class get package ( ) get name ( ) ; val reflections = new reflections ( new configuration builder ( ) filter inputs by ( s - > s ! = null & & s contains ( type get name as string ( ) ) ) set urls ( classpath helper for package ( package name ) ) set scanners ( new type elements scanner ( ) include fields ( false ) include methods ( false ) include annotations ( false ) filter results by ( s - > s ! = null & & s ends with ( type get name as string ( ) ) ) , new sub types scanner ( false ) ) ) ; val clz = reflections get sub types of ( serializable class ) stream ( ) filter ( c - > c get simple name ( ) equals ignore case ( type get name as string ( ) ) ) find first ( ) or else throw ( ( ) - > new illegal argument exception ( " cant locate class for " + type get name as string ( ) ) ) ; cached properties classes put ( type get name as string ( ) , clz ) ; return clz ; }


returns a { @ link char source } view of this byte source that decodes bytes read from this source as characters using the given { @ link charset } if { @ link char source # as byte source } is called on the returned source with the same charset , the default implementation of this method will ensure that the original { @ code byte source } is returned , rather than round - trip encoding subclasses that override this method should behave the same way

public char source as char source ( charset charset ) { return new as char source ( charset ) ; }


returns whether or not an open stream was closed


public int get file subtype ( ) { return file subtype ; }


get the address set that the get differences method results are restricted to null indicates no current restrictions the addresses in the returned address set are derived from program 1

synchronized public address set view get restricted address set ( ) { return restrict address set ; }


returns the udptcp source port of this { @ link h a proxy message }

public int source port ( ) { return source port ; }


static void reset buffer manager ( ) { buffer manager = null ; }


protected void init typed writers ( ) { this typed writers clear ( ) ; if ( ! this register defaults ) { return ; } this typed writers add all ( get base typed writers ( ) ) ; extend typed writers ( this typed writers ) ; }


updates the index an iterator is pointing to after a call to remove : returns the index of the entry that should be looked at after a removal on index removed , with index before remove as the index that was the next entry that would be looked at

int adjust after remove ( int index before remove , @ suppress warnings ( " unused " ) int index removed ) { return index before remove - 1 ; }


dump out contents of $ cwd and the environment to stdout for debugging

private void dump out debug info ( ) { log info ( " dump debug output " ) ; map < string , string > envs = system getenv ( ) ; for ( map entry < string , string > env : envs entry set ( ) ) { log info ( " system env : key = " + env get key ( ) + " , val = " + env get value ( ) ) ; system out println ( " system env : key = " + env get key ( ) + " , val = " + env get value ( ) ) ; } buffered reader buf = null ; try { string lines = shell windows ? shell exec command ( " cmd " , " / c " , " dir " ) : shell exec command ( " ls " , " - al " ) ; buf = new buffered reader ( new string reader ( lines ) ) ; string line = " " ; while ( ( line = buf read line ( ) ) ! = null ) { log info ( " system cwd content : " + line ) ; system out println ( " system cwd content : " + line ) ; } } catch ( i o exception e ) { e print stack trace ( ) ; } finally { i o utils cleanup with logger ( log , buf ) ; } }


returns the dash path effect that is used for highlighting

dash path effect get dash path effect highlight ( ) ;


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


domain purchase with user name and item name , with validation for user name

public receipt view model purchase ( string user name , string item name ) { db user user = db get instance ( ) find user by user name ( user name ) ; if ( user = = null ) { return new invalid user ( user name ) ; } db account account = db get instance ( ) find account by user ( user ) ; return purchase ( user , account , item name ) ; }


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


read entity from a db iterator if no information is found in the specified fields for this entity , return null

private static timeline entity get entity ( string entity id , string entity type , long start time , enum set < field > fields , leveldb iterator iterator , byte [ ] prefix , int prefixlen ) throws i o exception { timeline entity entity = new timeline entity ( ) ; boolean events = false ; boolean last event = false ; if ( fields contains ( field events ) ) { events = true ; } else if ( fields contains ( field last event only ) ) { last event = true ; } else { entity set events ( null ) ; } boolean related entities = false ; if ( fields contains ( field related entities ) ) { related entities = true ; } else { entity set related entities ( null ) ; } boolean primary filters = false ; if ( fields contains ( field primary filters ) ) { primary filters = true ; } else { entity set primary filters ( null ) ; } boolean other info = false ; if ( fields contains ( field other info ) ) { other info = true ; } else { entity set other info ( null ) ; } / / iterate through the entity ' s entry , parsing information if it is part / / of a requested field for ( ; iterator has next ( ) ; iterator next ( ) ) { byte [ ] key = iterator peek next ( ) get key ( ) ; if ( ! prefix matches ( prefix , prefixlen , key ) ) { break ; } if ( key length = = prefixlen ) { continue ; } if ( key [ prefixlen ] = = primary filters column [ 0 ] ) { if ( primary filters ) { add primary filter ( entity , key , prefixlen + primary filters column length ) ; } } else if ( key [ prefixlen ] = = other info column [ 0 ] ) { if ( other info ) { entity add other info ( parse remaining key ( key , prefixlen + other info column length ) , generic object mapper read ( iterator peek next ( ) get value ( ) ) ) ; } } else if ( key [ prefixlen ] = = related entities column [ 0 ] ) { if ( related entities ) { add related entity ( entity , key , prefixlen + related entities column length ) ; } } else if ( key [ prefixlen ] = = events column [ 0 ] ) { if ( events | | ( last event & & entity get events ( ) size ( ) = = 0 ) ) { timeline event event = get entity event ( null , key , prefixlen + events column length , iterator peek next ( ) get value ( ) ) ; if ( event ! = null ) { entity add event ( event ) ; } } } else if ( key [ prefixlen ] = = domain id column [ 0 ] ) { byte [ ] v = iterator peek next ( ) get value ( ) ; string domain id = new string ( v , charset for name ( " utf - 8 " ) ) ; entity set domain id ( domain id ) ; } else { if ( key [ prefixlen ] ! = invisible reverse related entities column [ 0 ] ) { log warn ( string format ( " found unexpected column for entity % s of " + " type % s ( 0x % 0 2x ) " , entity id , entity type , key [ prefixlen ] ) ) ; } } } entity set entity id ( entity id ) ; entity set entity type ( entity type ) ; entity set start time ( start time ) ; return entity ; }


animate vertically the toaster the toaster could be moved from bottom to upper or to upper to bottom

protected void animate vertically ( int posx , int from y , int to y ) throws interrupted exception { toaster set location ( posx , from y ) ; if ( to y < from y ) { for ( int i = from y ; i > to y ; i - = step ) { toaster set location ( posx , i ) ; thread sleep ( step time ) ; } } else { for ( int i = from y ; i < to y ; i + = step ) { toaster set location ( posx , i ) ; thread sleep ( step time ) ; } } toaster set location ( posx , to y ) ; }


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


release the given data buffer , if it is a { @ link pooled data buffer } and has been { @ linkplain pooled data buffer # is allocated ( ) allocated }

public static boolean release ( @ nullable data buffer data buffer ) { if ( data buffer instanceof pooled data buffer ) { pooled data buffer pooled data buffer = ( pooled data buffer ) data buffer ; if ( pooled data buffer is allocated ( ) ) { try { return pooled data buffer release ( ) ; } catch ( illegal state exception ex ) { / / avoid dependency on netty : illegal reference count exception if ( logger is debug enabled ( ) ) { logger debug ( " failed to release pooled data buffer : " + data buffer , ex ) ; } return false ; } } } return false ; }


trims the given string if it ends with { @ link # archive file extension }

private static string trim full archive name ( string archive name ) { if ( archive name ends with ( archive file extension ) ) { int end index = archive name index of ( archive file extension ) ; return archive name substring ( 0 , end index ) ; } return archive name ; }


clear { @ linkplain # get concurrent result ( ) concurrent result } and { @ linkplain # get concurrent result context ( ) concurrent result context }

public void clear concurrent result ( ) { synchronized ( web async manager this ) { this concurrent result = result none ; this concurrent result context = null ; } }


remove the object identified by the given name

public void remove ( string name ) { map remove ( name ) ; }


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


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


public all types model view model double value ( double double value ) { on mutation ( ) ; this double value double = double value ; return this ; }


public string get machine name ( ) { if ( is coff level one or two ( ) ) { return " " + f target id ; } return " " + f magic ; }


gets the program ' s memory buffer for this model based on the model ' s address

protected final mem buffer get mem buffer ( ) { return mem buffer ; }


protected boolean is dark ( ) { if ( state teams get ( player team ( ) ) has core ( ) & & state teams get ( player team ( ) ) core ( ) healthf ( ) < 0 8 5f ) { / / core damaged - > dark return true ; } / / it may be dark based on wave if ( mathf chance ( ( float ) ( math log 1 0 ( ( state wave - 1 7f ) / 1 9f ) + 1 ) / 4f ) ) { return true ; } / / dark based on enemies return mathf chance ( state enemies / 7 0f + 0 1f ) ; }


exit a parse tree produced by { @ link sql base parser # table identifier }

void exit table identifier ( sql base parser table identifier context ctx ) ;


create a new { @ link job manager job metric group }

job manager job metric group create ( @ nonnull job graph job graph ) ;


test the property ' enum string required '

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


public list < localization status > get localization statuses ( ) { list < localization status > statuses = new array list < > ( ) ; localized resources for each ( ( key , path ) - > { localization status status = localization status new instance ( key , localization state completed ) ; statuses add ( status ) ; } ) ; pending resources for each ( ( lr req , keys ) - > keys for each ( key - > { localization status status = localization status new instance ( key , localization state pending ) ; statuses add ( status ) ; } ) ) ; synchronized ( resources failed to be localized ) { statuses add all ( resources failed to be localized ) ; } return statuses ; }


returns an object that can be used to query information about targets implementations should create a single instance and return that for all calls a class can implement both { @ code query environment } and { @ code target accessor } at the same time , in which case this method simply returns { @ code this }

target accessor < t > get accessor ( ) ;


private void register n n s m x bean ( ) { name node status bean name = m beans register ( " name node " , " name node status " , this ) ; }


parse mapping parameters from a map of mappings

public final void parse ( string name , parser context parser context , map < string , object > field node ) { map < string , parameter < ? > > params map = new hash map < > ( ) ; map < string , parameter < ? > > deprecated params map = new hash map < > ( ) ; for ( parameter < ? > param : get parameters ( ) ) { params map put ( param name , param ) ; for ( string deprecated name : param deprecated names ) { deprecated params map put ( deprecated name , param ) ; } } string type = ( string ) field node remove ( " type " ) ; for ( iterator < map entry < string , object > > iterator = field node entry set ( ) iterator ( ) ; iterator has next ( ) ; ) { map entry < string , object > entry = iterator next ( ) ; final string prop name = entry get key ( ) ; final object prop node = entry get value ( ) ; if ( objects equals ( " fields " , prop name ) ) { type parsers parse multi field ( multi fields builder : : add , name , parser context , prop name , prop node ) ; iterator remove ( ) ; continue ; } if ( objects equals ( " copy to " , prop name ) ) { type parsers parse copy fields ( prop node ) for each ( copy to : : add ) ; iterator remove ( ) ; continue ; } if ( objects equals ( " boost " , prop name ) ) { if ( parser context index version created ( ) before ( version v 8 0 0 ) ) { deprecation logger deprecate ( " boost " , " parameter [ boost ] on field [ { } ] is deprecated and has no effect " , name ) ; iterator remove ( ) ; continue ; } else { throw new mapper parsing exception ( " unknown parameter [ boost ] on mapper [ " + name + " ] " ) ; } } parameter < ? > parameter = deprecated params map get ( prop name ) ; if ( parameter ! = null ) { deprecation logger deprecate ( prop name , " parameter [ { } ] on mapper [ { } ] is deprecated , use [ { } ] " , prop name , name , parameter name ) ; } else { parameter = params map get ( prop name ) ; } if ( parameter = = null ) { if ( is deprecated parameter ( prop name , parser context index version created ( ) ) ) { deprecation logger deprecate ( prop name , " parameter [ { } ] has no effect on type [ { } ] and will be removed in future " , prop name , type ) ; iterator remove ( ) ; continue ; } throw new mapper parsing exception ( " unknown parameter [ " + prop name + " ] on mapper [ " + name + " ] of type [ " + type + " ] " ) ; } if ( parameter deprecated ) { deprecation logger deprecate ( prop name , " parameter [ { } ] is deprecated and will be removed in a future version " , prop name ) ; } if ( prop node = = null & & parameter accepts null = = false ) { throw new mapper parsing exception ( " [ " + prop name + " ] on mapper [ " + name + " ] of type [ " + type + " ] must not have a [ null ] value " ) ; } parameter parse ( name , parser context , prop node ) ; iterator remove ( ) ; } validate ( ) ; }


removes manifest file , global metadata and all index metadata

public void delete all ( ) throws i o exception { / / to ensure that the metadata is never reimported by load full state b w c in case where the deletions here fail mid - way through , / / we first write an empty manifest file so that the indices become unreferenced , then clean up the indices , and only then delete / / the manifest file unreference all ( ) ; for ( string index folder name : node env available index folders ( ) ) { / / delete meta state directories of indices metadata state format delete meta state ( node env resolve index folder ( index folder name ) ) ; } manifest format cleanup old files ( long max value , node env node data paths ( ) ) ; / / finally delete manifest }


returns the previous ' not aborted ' build ( i e ignores aborted and not built builds ) or null

private static run < ? , ? > get previous non aborted build ( run < ? , ? > build ) { run < ? , ? > previous build = build get previous build ( ) ; while ( previous build ! = null ) { if ( previous build get result ( ) = = null | | previous build get result ( ) = = result aborted | | previous build get result ( ) = = result not built ) { previous build = previous build get previous build ( ) ; } else { return previous build ; } } return previous build ; }


public string get owner ( ) { return owner ; }


the collection of { @ link job } objects found in the query

public list < job > jobs ( ) { return results ; }


gets the list of " local variable " entries associated with this instance

public final local variable list get local variables ( ) { return local variables ; }


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

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


sets rgb components using the specified hue - saturation - value this is a convenient method for { @ link # from hsv ( float , float , float ) } this is the inverse of { @ link # to hsv ( float [ ] ) }

public color from hsv ( float [ ] hsv ) { return from hsv ( hsv [ 0 ] , hsv [ 1 ] , hsv [ 2 ] ) ; }


implementations must implement this method to process the entire result set

t extract data ( result set rs ) throws s q l exception , data access exception ;


compares two vector registers , first by size ( descending ) and then by offset ( ascending )

private static int compare vector registers ( register reg 1 , register reg 2 ) { if ( ! ( reg 1 is vector register ( ) & & reg 2 is vector register ( ) ) ) { throw new illegal argument exception ( " compare vector registers can only be applied to vector registers ! " ) ; } / / want registers sorted in descending order of size int size comp = integer compare ( reg 2 get bit length ( ) , reg 1 get bit length ( ) ) ; if ( size comp ! = 0 ) { return size comp ; } / / want registers sorted in ascending order of offset return integer compare ( reg 1 get offset ( ) , reg 2 get offset ( ) ) ; }


" manual " constructor that requires the caller to pass the set of configurability conditions that trigger this rule ' s configurable attributes if you don ' t know how to do this , you really want to use one of the " do - it - all " constructors

public static configured attribute mapper of ( rule rule , immutable map < label , config matching provider > config conditions ) { return new configured attribute mapper ( rule , config conditions ) ; }


public void remove branch session test ( global session global session , branch session branch session ) throws exception { for ( session manager session manager : session manager list ) { session manager add global session ( global session ) ; session manager add branch session ( global session , branch session ) ; session manager remove branch session ( global session , branch session ) ; session manager remove global session ( global session ) ; } }


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


sets a given function as the comparison source

public void set source ( function function ) { source = function ; }


returns the number of times a version was looked up either from the index note this is only available if assertions are enabled

long get num index versions lookups ( ) { / / for testing return num index versions lookups count ( ) ; }


create a jms message for the specified payload and conversion hint the conversion hint is an extra object passed to the { @ link message converter } , e g the associated { @ code method parameter } ( may be { @ code null } }

protected javax jms message create message for payload ( object payload , session session , @ nullable object conversion hint ) throws j m s exception { return this payload converter to message ( payload , session ) ; }


add the id of an associated model into self model ' s associated ids m 2 m map

void add associated model for join table ( string associated model name , long associated id ) { list < long > associated ids m 2 m set = get associated models map for join table ( ) get ( associated model name ) ; if ( associated ids m 2 m set = = null ) { associated ids m 2 m set = new array list < long > ( ) ; associated ids m 2 m set add ( associated id ) ; associated models map for join table put ( associated model name , associated ids m 2 m set ) ; } else { associated ids m 2 m set add ( associated id ) ; } }


can disable a plugin with a mandatory dependent plugin before its dependent plugin with all strategy

public void can disable dependent plugin wrong order strategy all ( ) { assert that ( disable plugins c li command ( " dependee " , " mandatory - depender " , " - strategy " , " all " ) , succeeded ( ) ) ; assert plugin disabled ( " mandatory - depender " ) ; assert plugin disabled ( " dependee " ) ; }


executes a { @ link hosted test } inside the host

public void run test ( hosted test hosted test , long timeout ms ) { run test ( hosted test , timeout ms , / * fail on timeout or force stop = * / true ) ; }


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


builds a byte array without the final string delimiter

public byte [ ] get bytes ( ) { / / check the last valid entry to see the final length int bytes length = length ; if ( use separator [ index - 1 ] ) { bytes length = length - 1 ; } byte [ ] bytes = new byte [ bytes length ] ; int cur pos = 0 ; for ( int i = 0 ; i < index ; i + + ) { system arraycopy ( b [ i ] , 0 , bytes , cur pos , b [ i ] length ) ; cur pos + = b [ i ] length ; if ( i < index - 1 & & use separator [ i ] ) { bytes [ cur pos + + ] = 0x 0 ; } } return bytes ; }


creates the specific bytes hash map , either { @ link bytes multi map } or { @ link window bytes multi map }

public abstract abstract bytes multi map < k > create bytes multi map ( memory manager memory manager , int memory size , logical type [ ] key types , logical type [ ] value types ) ;


protected boolean send password reset email to account ( final string to , final string url ) { if ( string utils is not blank ( to ) ) { val reset = cas properties get authn ( ) get pm ( ) get reset ( ) get mail ( ) ; val text = reset get formatted body ( url ) ; logger debug ( " sending password reset url [ { } ] via email to [ { } ] " , url , to ) ; return this communications manager email ( reset , to , text ) ; } return false ; }


test modify operations ( create , mkdir , delete , etc ) on the mount file system where the pathname references through the mount points hence these operation will modify the target file system verify the operation via mountfs ( ie fc ) and also via the target file system ( ie fclocal ) that the mount link points - to

public void test operations through mount links ( ) throws i o exception { / / create file file context test helper create file non recursive ( fc view , " / user / foo " ) ; assert assert true ( " create file should be file " , is file ( fc view , new path ( " / user / foo " ) ) ) ; assert assert true ( " target of created file should be type file " , is file ( fc target , new path ( target test root , " user / foo " ) ) ) ; / / delete the created file assert assert true ( " delete should succeed " , fc view delete ( new path ( " / user / foo " ) , false ) ) ; assert assert false ( " file should not exist after delete " , exists ( fc view , new path ( " / user / foo " ) ) ) ; assert assert false ( " target file should not exist after delete " , exists ( fc target , new path ( target test root , " user / foo " ) ) ) ; / / create file with a 2 component dirs file context test helper create file non recursive ( fc view , " / internal dir / link to dir 2 / foo " ) ; assert assert true ( " created file should be type file " , is file ( fc view , new path ( " / internal dir / link to dir 2 / foo " ) ) ) ; assert assert true ( " target of created file should be type file " , is file ( fc target , new path ( target test root , " dir 2 / foo " ) ) ) ; / / delete the created file assert assert true ( " delete should succeed " , fc view delete ( new path ( " / internal dir / link to dir 2 / foo " ) , false ) ) ; assert assert false ( " file should not exist after deletion " , exists ( fc view , new path ( " / internal dir / link to dir 2 / foo " ) ) ) ; assert assert false ( " target should not exist after deletion " , exists ( fc target , new path ( target test root , " dir 2 / foo " ) ) ) ; / / create file with a 3 component dirs file context test helper create file non recursive ( fc view , " / internal dir / internal dir 2 / link to dir 3 / foo " ) ; assert assert true ( " created file should be of type file " , is file ( fc view , new path ( " / internal dir / internal dir 2 / link to dir 3 / foo " ) ) ) ; assert assert true ( " target of created file should also be type file " , is file ( fc target , new path ( target test root , " dir 3 / foo " ) ) ) ; / / recursive create file with missing dirs file context test helper create file ( fc view , " / internal dir / link to dir 2 / missing dir / miss 2 / foo " ) ; assert assert true ( " created file should be of type file " , is file ( fc view , new path ( " / internal dir / link to dir 2 / missing dir / miss 2 / foo " ) ) ) ; assert assert true ( " target of created file should also be type file " , is file ( fc target , new path ( target test root , " dir 2 / missing dir / miss 2 / foo " ) ) ) ; / / delete the created file assert assert true ( " delete should succeed " , fc view delete ( new path ( " / internal dir / internal dir 2 / link to dir 3 / foo " ) , false ) ) ; assert assert false ( " deleted file should not exist " , exists ( fc view , new path ( " / internal dir / internal dir 2 / link to dir 3 / foo " ) ) ) ; assert assert false ( " target of deleted file should not exist " , exists ( fc target , new path ( target test root , " dir 3 / foo " ) ) ) ; / / mkdir fc view mkdir ( file context test helper get test root path ( fc view , " / user / dir x " ) , file context default perm , false ) ; assert assert true ( " new dir should be type dir " , is dir ( fc view , new path ( " / user / dir x " ) ) ) ; assert assert true ( " target of new dir should be of type dir " , is dir ( fc target , new path ( target test root , " user / dir x " ) ) ) ; fc view mkdir ( file context test helper get test root path ( fc view , " / user / dir x / dir y " ) , file context default perm , false ) ; assert assert true ( " new dir should be type dir " , is dir ( fc view , new path ( " / user / dir x / dir y " ) ) ) ; assert assert true ( " target of new dir should be of type dir " , is dir ( fc target , new path ( target test root , " user / dir x / dir y " ) ) ) ; / / delete the created dir assert assert true ( " delete should succeed " , fc view delete ( new path ( " / user / dir x / dir y " ) , false ) ) ; assert assert false ( " deleted file should not exist " , exists ( fc view , new path ( " / user / dir x / dir y " ) ) ) ; assert assert false ( " deleted target should not exist " , exists ( fc target , new path ( target test root , " user / dir x / dir y " ) ) ) ; assert assert true ( " delete should succeed " , fc view delete ( new path ( " / user / dir x " ) , false ) ) ; assert assert false ( " deleted file should not exist " , exists ( fc view , new path ( " / user / dir x " ) ) ) ; assert assert false ( " deleted target should not exist " , exists ( fc target , new path ( target test root , " user / dir x " ) ) ) ; / / rename a file file context test helper create file ( fc view , " / user / foo " ) ; fc view rename ( new path ( " / user / foo " ) , new path ( " / user / foo bar " ) ) ; assert assert false ( " renamed src should not exist " , exists ( fc view , new path ( " / user / foo " ) ) ) ; assert assert false ( exists ( fc target , new path ( target test root , " user / foo " ) ) ) ; assert assert true ( is file ( fc view , file context test helper get test root path ( fc view , " / user / foo bar " ) ) ) ; assert assert true ( is file ( fc target , new path ( target test root , " user / foo bar " ) ) ) ; fc view mkdir ( new path ( " / user / dir foo " ) , file context default perm , false ) ; fc view rename ( new path ( " / user / dir foo " ) , new path ( " / user / dir foo bar " ) ) ; assert assert false ( " renamed src should not exist " , exists ( fc view , new path ( " / user / dir foo " ) ) ) ; assert assert false ( " renamed src should not exist in target " , exists ( fc target , new path ( target test root , " user / dir foo " ) ) ) ; assert assert true ( " renamed dest should exist as dir " , is dir ( fc view , file context test helper get test root path ( fc view , " / user / dir foo bar " ) ) ) ; assert assert true ( " renamed dest should exist as dir in target " , is dir ( fc target , new path ( target test root , " user / dir foo bar " ) ) ) ; / / make a directory under a directory that ' s mounted from the root of another fs fc view mkdir ( new path ( " / target root / dir foo " ) , file context default perm , false ) ; assert assert true ( exists ( fc view , new path ( " / target root / dir foo " ) ) ) ; boolean dir foo present = false ; remote iterator < file status > dir contents = fc view list status ( new path ( " / target root / " ) ) ; while ( dir contents has next ( ) ) { file status file status = dir contents next ( ) ; if ( file status get path ( ) get name ( ) equals ( " dir foo " ) ) { dir foo present = true ; } } assert assert true ( dir foo present ) ; remote iterator < located file status > dir located contents = fc view list located status ( new path ( " / target root / " ) ) ; dir foo present = false ; while ( dir located contents has next ( ) ) { file status file status = dir located contents next ( ) ; if ( file status get path ( ) get name ( ) equals ( " dir foo " ) ) { dir foo present = true ; } } assert assert true ( dir foo present ) ; }


verifies that the specified expected result is always produced by collecting the specified inputs , regardless of how the elements are divided

public final collector tester < t , a , r > expect collects ( @ nullable r expected result , t inputs ) { list < t > list = arrays as list ( inputs ) ; do expect collects ( expected result , list ) ; if ( collector characteristics ( ) contains ( collector characteristics unordered ) ) { collections reverse ( list ) ; do expect collects ( expected result , list ) ; } return this ; }


converts the given boxed boolean to a ternary boolean a null value results in { @ link # undefined } , while a non - null value results in { @ link # true } or { @ link # false } respectively

public static ternary boolean from boxed boolean ( @ nullable boolean bool ) { return bool = = null ? undefined : from boolean ( bool ) ; }


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

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


public datagram channel get java channel ( ) { return ( datagram channel ) super get java channel ( ) ; }


get the name of the instruction corresponding to this node

public string get instruction ( ) { return instruction ; }


returns true if the drop operation is ok a drop is deemed to be okay if < ol > < li > the drop target accepts one of the data flavors that the event ' s transferable provides < li > < li > the drop action ( i e copy , move , etc ) is accepted by the target < li > < li > the drop is accepted by the droppable component < li > < ol >

protected boolean is drop ok ( drop target drag event e ) { / / does this target accept the drop action type being dropped on it ? int da = e get drop action ( ) ; if ( ( da & drop actions ) = = 0 ) { return false ; } / / does the event ' s transferable have a flavor that this drop target accepts ? if ( ! is drag flavor supported ( e ) ) { return false ; } / / does the target component allow the drop if ( ! drop component is drop ok ( e ) ) { return false ; } return true ; }


creates an answer from a functional interface - allows for a strongly typed answer to be created ideally in java 8

public static < a > answer < void > answer void ( void answer 1 < a > answer ) { return to answer ( answer ) ; }


create a url endpoint from a list of u r is

public static endpoint url endpoint ( string api , string protocol type , uri uris ) { return new endpoint ( api , protocol type , uris ) ; }


sets a predicate for dynamically determining if this action is valid for the current { @ link action context } see { @ link docking action if # is valid context ( action context ) }

public void valid context when ( predicate < action context > predicate ) { valid context predicate = predicate ; }


authorized operations for this topic , or null if this is not known

public set < acl operation > authorized operations ( ) { return authorized operations ; }


appends { @ code values } , in order , to the end of the values the built { @ link immutable double array } will contain

public builder add all ( double [ ] values ) { ensure room for ( values length ) ; system arraycopy ( values , 0 , array , count , values length ) ; count + = values length ; return this ; }


< code > optional int 3 2 blah = 1 ; < code >


get the erasure coding policy information for specified path

static erasure coding policy get erasure coding policy ( final f s namesystem fsn , final string src , f s permission checker pc ) throws i o exception , access control exception { assert fsn has read lock ( ) ; if ( f s directory is exact reserved name ( src ) ) { return null ; } f s directory fsd = fsn get f s directory ( ) ; final i nodes in path iip = fsd resolve path ( pc , src , dir op read ) ; if ( fsn is permission enabled ( ) ) { fsn get f s directory ( ) check path access ( pc , iip , fs action read ) ; } erasure coding policy ec policy ; if ( iip is dot snapshot dir ( ) ) { ec policy = null ; } else if ( iip get last i node ( ) = = null ) { throw new file not found exception ( " path not found : " + src ) ; } else { ec policy = get erasure coding policy for path ( fsd , iip ) ; } if ( ec policy ! = null & & ec policy is replication policy ( ) ) { ec policy = null ; } return ec policy ; }


create a file with the provided permission the permission of the file is set to be the provided permission as in set permission , not permission { @ literal & ~ } umask the hdfs implementation is implemented using two r p cs it is understood that it is inefficient , but the implementation is thread - safe the other option is to change the value of umask in configuration to be 0 , but it is not thread - safe

public static f s data output stream create ( file system fs , path file , fs permission permission ) throws i o exception { / / create the file with default permission f s data output stream out = fs create ( file ) ; / / set its permission to the supplied one fs set permission ( file , permission ) ; return out ; }


returns true if the import is ' by name '

public boolean has name ( ) { return name ! = null ; }


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

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


sort the list remove over - lapping subnet sort the list again

private static list < ip subnet filter rule > sort and filter ( list < ip subnet filter rule > rules ) { collections sort ( rules ) ; iterator < ip subnet filter rule > iterator = rules iterator ( ) ; list < ip subnet filter rule > to keep = new array list < ip subnet filter rule > ( ) ; ip subnet filter rule parent rule = iterator has next ( ) ? iterator next ( ) : null ; if ( parent rule ! = null ) { to keep add ( parent rule ) ; } while ( iterator has next ( ) ) { / / grab a potential child rule ip subnet filter rule child rule = iterator next ( ) ; / / if parent rule matches child rule , then there ' s no need to keep the child rule / / otherwise , the rules are distinct and we need both if ( ! parent rule matches ( new inet socket address ( child rule get ip address ( ) , 1 ) ) ) { to keep add ( child rule ) ; / / then we ' ll keep the child rule around as the parent for the next round parent rule = child rule ; } } return to keep ; }


public spawn result get spawn result ( ) { return result ; }


public void get supp matrix ( matrix matrix ) { matrix set ( m supp matrix ) ; }


parse the new dfs datanode data dir value in the configuration to detect changed volumes

changed volumes parse changed volumes ( string new volumes ) throws i o exception { configuration conf = new configuration ( ) ; conf set ( dfs datanode data dir key , new volumes ) ; list < storage location > new storage locations = get storage locations ( conf ) ; if ( new storage locations is empty ( ) ) { throw new i o exception ( " no directory is specified " ) ; } / / use the existing storage locations from the current conf / / to detect new storage additions or removals map < string , storage location > existing storage locations = new hash map < > ( ) ; for ( storage location loc : get storage locations ( get conf ( ) ) ) { existing storage locations put ( loc get normalized uri ( ) to string ( ) , loc ) ; } changed volumes results = new changed volumes ( ) ; results new locations add all ( new storage locations ) ; for ( iterator < storage storage directory > it = storage dir iterator ( ) ; it has next ( ) ; ) { storage storage directory dir = it next ( ) ; boolean found = false ; for ( iterator < storage location > new location itr = results new locations iterator ( ) ; new location itr has next ( ) ; ) { storage location new location = new location itr next ( ) ; if ( new location matches storage directory ( dir ) ) { storage location old location = existing storage locations get ( new location get normalized uri ( ) to string ( ) ) ; if ( old location ! = null & & old location get storage type ( ) ! = new location get storage type ( ) ) { throw new i o exception ( " changing storage type is not allowed " ) ; } / / update the unchanged locations as this location / / from the new conf is really not a new one new location itr remove ( ) ; results unchanged locations add ( new location ) ; found = true ; break ; } } / / new conf doesn ' t have the storage location which available in / / the current storage locations add to the deactivate locations list if ( ! found ) { log info ( " deactivation request received for active volume : { } " , dir get root ( ) ) ; results deactivate locations add ( storage location parse ( dir get root ( ) to string ( ) ) ) ; } } / / use the failed storage locations from the current conf / / to detect removals in the new conf if ( get f s dataset ( ) get num failed volumes ( ) > 0 ) { for ( string failed storage location : get f s dataset ( ) get volume failure summary ( ) get failed storage locations ( ) ) { boolean found = false ; for ( iterator < storage location > new location itr = results new locations iterator ( ) ; new location itr has next ( ) ; ) { storage location new location = new location itr next ( ) ; if ( new location get normalized uri ( ) to string ( ) equals ( failed storage location ) ) { / / the failed storage is being re - added data node # refresh volumes ( ) / / will take care of re - assessing it found = true ; break ; } } / / new conf doesn ' t have this failed storage location / / add to the deactivate locations list if ( ! found ) { log info ( " deactivation request received for failed volume : { } " , failed storage location ) ; results deactivate locations add ( storage location parse ( failed storage location ) ) ; } } } return results ; }


this test checks that the expected mkdirs action for checkpoint storage , only be called when initialize base locations and not called when resolve checkpoint storage location

public void test storage location mkdirs ( ) throws exception { fs checkpoint storage access storage = new fs checkpoint storage access ( random temp path ( ) , null , new job i d ( ) , file size threshold , write buffer size ) ; file base dir = new file ( storage get checkpoints directory ( ) get path ( ) ) ; assert false ( base dir exists ( ) ) ; / / mkdirs would only be called when initialize base locations storage initialize base locations ( ) ; assert true ( base dir exists ( ) ) ; / / mkdir would not be called when resolve checkpoint storage location storage = new fs checkpoint storage access ( random temp path ( ) , null , new job i d ( ) , file size threshold , write buffer size ) ; fs checkpoint storage location location = ( fs checkpoint storage location ) storage resolve checkpoint storage location ( 177 , checkpoint storage location reference get default ( ) ) ; path checkpoint path = location get checkpoint directory ( ) ; file checkpoint dir = new file ( checkpoint path get path ( ) ) ; assert false ( checkpoint dir exists ( ) ) ; }


retain the given data buffer , if it is a { @ link pooled data buffer }

public static < t extends data buffer > t retain ( t data buffer ) { if ( data buffer instanceof pooled data buffer ) { return ( t ) ( ( pooled data buffer ) data buffer ) retain ( ) ; } else { return data buffer ; } }


public final cancellable reindex async ( reindex request reindex request , request options options , action listener < bulk by scroll response > listener ) { return perform request async and parse entity ( reindex request , request converters : : reindex , options , bulk by scroll response : : from x content , listener , singleton ( 409 ) ) ; }


boolean is null ( ) { return null equals ( this ) ; }


returns an index of the { @ link string } name argument in the { @ link name table }

public int get name index from name ( string name ) { return name table get stream number from name ( name ) ; }


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


checks for ( and rejects ) chains of delegation in the provided realms a chain occurs when " realm a " delegates authorization to " realm b " , and realm b also delegates authorization ( to any realm ) since " realm b " does not handle its own authorization , it is not a valid target for delegated authorization

private void check for realm chains ( iterable < realm > delegated realms , settings global settings ) { for ( realm realm : delegated realms ) { setting < list < string > > realm authz setting = authz realms apply ( realm type ( ) ) get concrete setting for namespace ( realm name ( ) ) ; if ( realm authz setting exists ( global settings ) ) { throw new illegal argument exception ( " cannot use realm [ " + realm + " ] as an authorization realm - it is already delegating authorization to [ " + realm authz setting get ( global settings ) + " ] " ) ; } } }


parse the given locale value as coming from a request parameter the default implementation calls { @ link string utils # parse locale ( string ) } , accepting the { @ link locale # to string } format as well as bcp 47 language tags

protected locale parse locale value ( string locale value ) { return string utils parse locale ( locale value ) ; }


public boolean check exists ( string path ) { try { return retry loops invoke with retry ( ( ) - > { required not null ( client , failed ) ; return client get k v client ( ) get ( byte sequence from ( path , utf 8 ) , get option new builder ( ) with count only ( true ) build ( ) ) get ( default request timeout , time unit milliseconds ) get count ( ) > 0 ; } , retry policy ) ; } catch ( exception e ) { throw new illegal state exception ( e get message ( ) , e ) ; } }


public boolean allows multiple ( ) { return option annotation allow multiple ( ) ; }


public class < ? > get target type ( ) { object target type value = this target type ; if ( ! ( target type value instanceof class ) ) { throw new illegal state exception ( " typed string value does not carry a resolved target type " ) ; } return ( class < ? > ) target type value ; }


merges the partitions part of { @ code create table } statement partitioning is a single property of a table , thus there can be at most a single instance of partitioning therefore it is not possible to use { @ link merging strategy # including } with partitioning defined in both source and derived table

public list < string > merge partitions ( merging strategy merging strategy , list < string > source partitions , list < string > derived partitions ) { if ( ! derived partitions is empty ( ) & & ! source partitions is empty ( ) & & merging strategy ! = merging strategy excluding ) { throw new validation exception ( " the base table already has partitions defined you might want to specify " + " excluding partitions " ) ; } if ( ! derived partitions is empty ( ) ) { return derived partitions ; } return source partitions ; }


compares a stack variable offsets one or both objects must be a stack variable

public int compare ( object obj 1 , object obj 2 ) { integer offset 1 = get stack offset ( obj 1 , " obj 1 " ) ; integer offset 2 = get stack offset ( obj 2 , " obj 2 " ) ; if ( offset 1 = = null ) { if ( offset 2 = = null ) { return 0 ; } return 1 ; } if ( offset 2 = = null ) { return - 1 ; } if ( offset 1 < offset 2 ) { return - 1 ; } if ( offset 2 < offset 1 ) { return 1 ; } return 0 ; }


determine whether the given map type is an approximable type , i e a type that { @ link # create approximate map } can approximate

public static boolean is approximable map type ( @ nullable class < ? > map type ) { return ( map type ! = null & & approximable map types contains ( map type ) ) ; }


installs this key event dispatcher into java ' s key event processing system calling this method more than once has no effect

static void install ( ) { if ( instance = = null ) { instance = new key binding override key event dispatcher ( ) ; keyboard focus manager kfm = keyboard focus manager get current keyboard focus manager ( ) ; kfm add key event dispatcher ( instance ) ; } }


test the scheduler could be shutdown correctly

public void test shutdown scheduler ( ) throws exception { balance procedure scheduler scheduler = new balance procedure scheduler ( conf ) ; scheduler init ( true ) ; / / construct job balance job builder builder = new balance job builder < > ( ) ; builder next procedure ( new wait procedure ( " wait " , 1000 , 5 * 1000 ) ) ; balance job job = builder build ( ) ; scheduler submit ( job ) ; thread sleep ( 1000 ) ; / / wait job to be scheduled scheduler shut down and wait ( 30 * 1000 ) ; balance journal journal = reflection utils new instance ( balance journal info h d f s class , conf ) ; journal clear ( job ) ; }


add the given bean to the list of disposable beans in this factory , registering its disposable bean interface andor the given destroy method to be called on factory shutdown ( if applicable ) only applies to singletons

protected void register disposable bean if necessary ( string bean name , object bean , root bean definition mbd ) { access control context acc = ( system get security manager ( ) ! = null ? get access control context ( ) : null ) ; if ( ! mbd is prototype ( ) & & requires destruction ( bean , mbd ) ) { if ( mbd is singleton ( ) ) { / / register a disposable bean implementation that performs all destruction / / work for the given bean : destruction aware bean post processors , / / disposable bean interface , custom destroy method register disposable bean ( bean name , new disposable bean adapter ( bean , bean name , mbd , get bean post processor cache ( ) destruction aware , acc ) ) ; } else { / / a bean with a custom scope scope scope = this scopes get ( mbd get scope ( ) ) ; if ( scope = = null ) { throw new illegal state exception ( " no scope registered for scope name ' " + mbd get scope ( ) + " ' " ) ; } scope register destruction callback ( bean name , new disposable bean adapter ( bean , bean name , mbd , get bean post processor cache ( ) destruction aware , acc ) ) ; } } } / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - / / abstract methods to be implemented by subclasses / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


returns { @ code value } , if non - negative otherwise , returns { @ link long # max value }

private static long negative to max value ( long value ) { return ( value > = 0 ) ? value : long max value ; }


returns the data of the table as a { @ link data set } note : this method is for internal use only for defining a { @ link table source } do not use it in table api programs

data set < t > get data set ( execution environment exec env ) ;


setter factory method containing required values all optional arguments can be set via the chained methods

public static setter with collapser key ( hystrix collapser key collapser key ) { return new setter ( collapser key ) ; }


visits the given runtime visible annotations attribute of any type of class member

public void visit runtime visible annotations attribute ( clazz clazz , member member , runtime visible annotations attribute runtime visible annotations attribute ) { visit runtime visible annotations attribute ( clazz , runtime visible annotations attribute ) ; }


get the address that this function would thunk if it is a valid thunk

public static address get thunked addr ( program program , address entry , boolean check for side effects ) { / / general algorithm : / / / / get function , if has no other calls , and no other flow / / if does no other computation than computing the jump ? ? ? / / simple number of instructions ? specialized for a given processor ? / / danger that side - effects are not found / / all other instruction refs are just reads , and have good addresses ? / / all instructions go into the computation of the jump , simplified away ? / / put it in the patterns file ? / / small number of instructions , look at pcode , all loads , arith / / no branching other than final computed jump / / check if the first instruction is an indirect jump listing listing = program get listing ( ) ; instruction instr = listing get instruction at ( entry ) ; if ( instr = = null ) { return null ; } flow type flow type ; / / treat single jump or call - return as thunk address simple flow addr = get simple flow ( instr ) ; if ( simple flow addr ! = null ) { return simple flow addr ; } / / 8 - bit registers are normally flag registers / / for 16 - bit address spaces , the registers may be too small , so don ' t allow / / non - use of an 8 - bit register boolean allow 8bit non use = true ; if ( program get address factory ( ) get default address space ( ) get size ( ) < = 16 ) { allow 8bit non use = false ; } / / only go three instructions deep / / keep a list of outputs and inputs / / if inputs are used , get rid of them / / if only output is the pc , and small registers , assume ok / / any write to memory is bad int num instr = 1 ; hash set < varnode > set at start registers = new hash set < > ( ) ; hash set < varnode > set registers = new hash set < > ( ) ; hash set < varnode > used registers = new hash set < > ( ) ; / / add in the registers that are set at the beginning of the function add set registers ( program , entry , set at start registers ) ; while ( instr ! = null & & num instr + + < = max number of thunking instructions ) { flow type = instr get flow type ( ) ; / / keep track of any read / writes to registers , need to see if there are any side - effects / / check pcode , any writes to memory are bad pcode op [ ] pcode = instr get pcode ( false ) ; for ( pcode op element : pcode ) { pcode op pcode op = element ; / / storing to a location is not allowed for a thunk / / as a side - effect of the thunk if ( pcode op get opcode ( ) = = pcode op store ) { return null ; } / / record any used registers , checking for use of an unexpected unset register if ( check for side effects & & ! add register usage ( program , set at start registers , set registers , used registers , pcode op , allow 8bit non use ) ) { return null ; } } / / any instruction with a delay slot is actually a branching instruction / / only do this for instructions that aren ' t delay slot instructions if ( instr is fallthrough ( ) & & instr get delay slot depth ( ) = = 0 ) { address fall addr = instr get fall through ( ) ; instr = listing get instruction at ( fall addr ) ; continue ; } / / keep going if flow target is right below , allow only a simple branch if ( is local branch ( listing , instr , flow type ) ) { continue ; } / / reached a flow , end of the line , gotta see what we have return get flowing addr from final state ( program , instr , flow type , check for side effects , set registers , used registers ) ; } return null ; }


determine if this variable storage intersects the specified variable storage

public boolean intersects ( variable storage variable storage ) { varnode [ ] other varnodes = variable storage varnodes ; if ( varnodes = = null | | other varnodes = = null ) { return false ; } for ( int i = 0 ; i < varnodes length ; i + + ) { for ( int j = 0 ; j < other varnodes length ; j + + ) { if ( varnodes [ i ] intersects ( other varnodes [ j ] ) ) { return true ; } } } return false ; }


returns the portion of this domain name that is one level beneath the { @ linkplain # is registry suffix ( ) registry suffix } for example , for { @ code x adwords google co uk } it returns { @ code google co uk } , since { @ code co uk } is a registry suffix similarly , for { @ code myblog blogspot com } it returns { @ code blogspot com } , since { @ code com } is a registry suffix if { @ link # is top domain under registry suffix ( ) } is true , the current domain name instance is returned < b > warning : < b > this method should not be used to determine whether a domain is probably the highest level for which cookies may be set use { @ link # is top private domain ( ) } for that purpose

public internet domain name top domain under registry suffix ( ) { if ( is top domain under registry suffix ( ) ) { return this ; } check state ( is under registry suffix ( ) , " not under a registry suffix : % s " , name ) ; return ancestor ( registry suffix index - 1 ) ; }


interpret test target labels from the command - line arguments and return the corresponding set of targets , handling the filter flags , and expanding test suites

private static resolved targets < target > determine tests ( environment env , list < string > target patterns , path fragment offset , test filter test filter ) throws interrupted exception { list < target pattern key > pattern sky keys = new array list < > ( ) ; for ( target pattern sky key or exception key or exception : target pattern value keys ( target patterns , filtering policies filter tests , offset ) ) { try { pattern sky keys add ( key or exception get sky key ( ) ) ; } catch ( target parsing exception e ) { / / skip } } map < sky key , value or exception < target parsing exception > > resolved patterns = env get values or throw ( pattern sky keys , target parsing exception class ) ; if ( env values missing ( ) ) { return null ; } list < sky key > expanded suite keys = new array list < > ( ) ; for ( target pattern key key : pattern sky keys ) { target pattern value value ; try { value = ( target pattern value ) resolved patterns get ( key ) get ( ) ; } catch ( target parsing exception e ) { / / skip continue ; } expanded suite keys add ( tests for target pattern value key ( value get targets ( ) get targets ( ) ) ) ; } map < sky key , sky value > expanded suites = env get values ( expanded suite keys ) ; if ( env values missing ( ) ) { return null ; } resolved targets builder < target > test targets builder = resolved targets builder ( ) ; for ( target pattern key pattern : pattern sky keys ) { target pattern value value ; try { value = ( target pattern value ) resolved patterns get ( pattern ) get ( ) ; } catch ( target parsing exception e ) { / / this was already reported in get targets to build ( maybe merge the two code paths ? ) continue ; } tests for target pattern value expanded suites value = ( tests for target pattern value ) expanded suites get ( tests for target pattern value key ( value get targets ( ) get targets ( ) ) ) ; if ( pattern is negative ( ) ) { resolved targets < target > negative targets = tests for target pattern function labels to targets ( env , expanded suites value get labels ( ) get targets ( ) , expanded suites value get labels ( ) has error ( ) ) ; test targets builder filter ( predicates not ( predicates in ( negative targets get targets ( ) ) ) ) ; test targets builder merge error ( negative targets has error ( ) ) ; } else { resolved targets < target > positive targets = tests for target pattern function labels to targets ( env , expanded suites value get labels ( ) get targets ( ) , expanded suites value get labels ( ) has error ( ) ) ; test targets builder add all ( positive targets get targets ( ) ) ; test targets builder merge error ( positive targets has error ( ) ) ; } } test targets builder filter ( test filter ) ; return test targets builder build ( ) ; }


opens the file denoted by this path , following symbolic links , for reading , and returns a file channel for it

public readable byte channel create readable byte channel ( ) throws i o exception { return file system create readable byte channel ( this ) ; }


public void test type holder default ( ) { / / todo : test type holder default }


the response resources wrapped in the common mcp resource message these are typed resources that match the type url in the request resources message when ` incremental ` is true , this contains an array of resources to addupdate for the specified collection this modifies the existing collection at the sink when ` incremental ` is false , this contains the full set of resources for the specified collection this replaces any previously delivered resources < code > repeated istio mcp v 1alpha 1 resource resources = 3 ; < code >

public builder add resources ( int index , com alibaba nacos istio model mcp resource value ) { if ( resources builder = = null ) { if ( value = = null ) { throw new null pointer exception ( ) ; } ensure resources is mutable ( ) ; resources add ( index , value ) ; on changed ( ) ; } else { resources builder add message ( index , value ) ; } return this ; }


void receive config info ( final string config info ) ;


update queue statistics : used - capacityabsolute - used - capacity by partition non - partitioned max - avail - resource to queue when node partition is null , all partition of used - capacityabsolute - used - capacity will be updated

public static void update queue statistics ( final resource calculator rc , final resource cluster , final abstract c s queue child queue , final r m node labels manager nlm , final string node partition ) { queue capacities queue capacities = child queue get queue capacities ( ) ; resource usage queue resource usage = child queue get queue resource usage ( ) ; if ( node partition = = null ) { for ( string partition : sets union ( queue capacities get node partitions set ( ) , queue resource usage get node partitions set ( ) ) ) { update used capacity ( rc , nlm get resource by label ( partition , cluster ) , partition , child queue ) ; / / update queue metrics w r t node labels / / in queue metrics , null label is handled the same as no label / / this is because queue metrics for partitions are not tracked / / in the future , will have to change this when / if queue metrics / / for partitions also get tracked child queue get metrics ( ) set available resources to queue ( partition , get max available resource to queue partition ( rc , child queue , cluster , partition ) ) ; } } else { update used capacity ( rc , nlm get resource by label ( node partition , cluster ) , node partition , child queue ) ; / / same as above child queue get metrics ( ) set available resources to queue ( node partition , get max available resource to queue partition ( rc , child queue , cluster , node partition ) ) ; } }


protected void set inner name index ( int index ) { u 2inner name index = index ; }


returns the number of cache hits for bitmaps in the pool

public long hit count ( ) { return hits ; }


creates a mutable { @ code compact hash set } instance containing the elements of the given collection in unspecified order

public static < e > compact hash set < e > create ( collection < ? extends e > collection ) { compact hash set < e > set = create with expected size ( collection size ( ) ) ; set add all ( collection ) ; return set ; }


returns the sql string with identifiers replaced according to the given unparse function

public string substitute ( function < sql node , string > fn ) { final sql shuttle shuttle = new sql shuttle ( ) { @ override public sql node visit ( sql call call ) { sql operator operator = call get operator ( ) ; if ( operator instanceof sql unresolved function ) { final sql unresolved function unresolved function = ( sql unresolved function ) operator ; final sql identifier function i d = unresolved function get sql identifier ( ) ; if ( function i d is simple ( ) & & func name to id contains key ( function i d get simple ( ) ) ) { sql unresolved function new func = new sql unresolved function ( func name to id get ( function i d get simple ( ) ) , unresolved function get return type inference ( ) , unresolved function get operand type inference ( ) , unresolved function get operand type checker ( ) , unresolved function get param types ( ) , unresolved function get function type ( ) ) ; return new func create call ( call get function quantifier ( ) , call get parser position ( ) , call get operand list ( ) to array ( new sql node [ 0 ] ) ) ; } } return super visit ( call ) ; } @ override public sql node visit ( sql identifier id ) { if ( id is star ( ) ) { return id ; } final sql identifier to replace = identifiers map get ( id get parser position ( ) ) ; if ( to replace = = null | | id names size ( ) > = to replace names size ( ) ) { return id ; } return to replace ; } } ; final sql node substituted = this ori node accept ( shuttle ) ; return fn apply ( substituted ) ; }


test case for https : issues apache orgjirabrowse z o o k e e p e r - 3721

public void test parse boolean ( ) throws i o exception , config exception { quorum peer config quorum peer config = new quorum peer config ( ) ; properties zk prop = get default z k properties ( ) ; zk prop set property ( " local sessions enabled " , " true " ) ; quorum peer config parse properties ( zk prop ) ; assert equals ( true , quorum peer config are local sessions enabled ( ) ) ; zk prop set property ( " local sessions enabled " , " false " ) ; quorum peer config parse properties ( zk prop ) ; assert equals ( false , quorum peer config are local sessions enabled ( ) ) ; zk prop set property ( " local sessions enabled " , " true " ) ; quorum peer config parse properties ( zk prop ) ; assert equals ( true , quorum peer config are local sessions enabled ( ) ) ; zk prop set property ( " local sessions enabled " , " false " ) ; quorum peer config parse properties ( zk prop ) ; assert equals ( false , quorum peer config are local sessions enabled ( ) ) ; zk prop set property ( " local sessions enabled " , " yes " ) ; try { quorum peer config parse properties ( zk prop ) ; fail ( " must throw exception as ' yes ' is not accpetable for parse boolean ! " ) ; } catch ( config exception e ) { / / expected } }


overrides the fetch offsets that the consumer will use on the next poll if this api is invoked for the same message queue more than once , the latest offset will be used on the next poll ( ) note that you may lose data if this api is arbitrarily used in the middle of consumption

void seek ( message queue message queue , long offset ) throws m q client exception ;


test the undo section of rename before the rename , we create the renamed filedir after taking the snapshot

public void test rename undo 2 ( ) throws exception { final path sdir 1 = new path ( " / dir 1 " ) ; final path sdir 2 = new path ( " / dir 2 " ) ; hdfs mkdirs ( sdir 1 ) ; hdfs mkdirs ( sdir 2 ) ; final path dir 2file = new path ( sdir 2 , " file " ) ; d f s test util create file ( hdfs , dir 2file , blocksize , repl , seed ) ; snapshot test helper create snapshot ( hdfs , sdir 1 , " s 1 " ) ; / / create foo after taking snapshot final path foo = new path ( sdir 1 , " foo " ) ; final path bar = new path ( foo , " bar " ) ; d f s test util create file ( hdfs , bar , blocksize , repl , seed ) ; i node directory dir 2 = fsdir get i node 4 write ( sdir 2 to string ( ) ) as directory ( ) ; i node directory mock dir 2 = spy ( dir 2 ) ; do return ( false ) when ( mock dir 2 ) add child ( any ( ) , any boolean ( ) , any int ( ) ) ; i node directory root = fsdir get i node 4 write ( " / " ) as directory ( ) ; root replace child ( dir 2 , mock dir 2 , fsdir get i node map ( ) ) ; final path newfoo = new path ( sdir 2 , " foo " ) ; boolean result = hdfs rename ( foo , newfoo ) ; assert false ( result ) ; / / check the current internal details i node directory dir 1 node = fsdir get i node 4 write ( sdir 1 to string ( ) ) as directory ( ) ; snapshot s 1 = dir 1 node get snapshot ( d f s util string 2 bytes ( " s 1 " ) ) ; read only list < i node > dir 1 children = dir 1 node get children list ( snapshot current state id ) ; assert equals ( 1 , dir 1 children size ( ) ) ; assert equals ( foo get name ( ) , dir 1 children get ( 0 ) get local name ( ) ) ; diff list < directory diff > dir 1 diffs = dir 1 node get diffs ( ) as list ( ) ; assert equals ( 1 , dir 1 diffs size ( ) ) ; assert equals ( s 1 get id ( ) , dir 1 diffs get ( 0 ) get snapshot id ( ) ) ; / / after the undo of rename , the created list of sdir 1 should contain / / 1 element children diff children diff = dir 1 diffs get ( 0 ) get children diff ( ) ; assert sizes ( 1 , 0 , children diff ) ; i node foo node = fsdir get i node 4 write ( foo to string ( ) ) ; assert true ( foo node instanceof i node directory ) ; assert true ( children diff get created unmodifiable ( ) get ( 0 ) = = foo node ) ; final path foo s 1 = snapshot test helper get snapshot path ( sdir 1 , " s 1 " , " foo " ) ; assert false ( hdfs exists ( foo s 1 ) ) ; / / check sdir 2 assert false ( hdfs exists ( newfoo ) ) ; i node directory dir 2 node = fsdir get i node 4 write ( sdir 2 to string ( ) ) as directory ( ) ; assert false ( dir 2 node is with snapshot ( ) ) ; read only list < i node > dir 2 children = dir 2 node get children list ( snapshot current state id ) ; assert equals ( 1 , dir 2 children size ( ) ) ; assert equals ( dir 2file get name ( ) , dir 2 children get ( 0 ) get local name ( ) ) ; }


public list < send message result > send message ( list < signal service address > recipients , list < optional < unidentified access pair > > unidentified access , boolean is recipient update , signal service data message message ) throws i o exception , untrusted identity exception { byte [ ] content = create message content ( message ) ; long timestamp = message get timestamp ( ) ; list < send message result > results = send message ( recipients , get target unidentified access ( unidentified access ) , timestamp , content , false , null ) ; boolean needs sync in results = false ; for ( send message result result : results ) { if ( result get success ( ) ! = null & & result get success ( ) is needs sync ( ) ) { needs sync in results = true ; break ; } } if ( needs sync in results | | is multi device get ( ) ) { optional < signal service address > recipient = optional absent ( ) ; if ( ! message get group context ( ) is present ( ) & & recipients size ( ) = = 1 ) { recipient = optional of ( recipients get ( 0 ) ) ; } byte [ ] sync message = create multi device sent transcript content ( content , recipient , timestamp , results , is recipient update ) ; send message ( local address , optional < unidentified access > absent ( ) , timestamp , sync message , false , null ) ; } return results ; }


copies the 4x 3 upper - left sub - matrix into float array the destination array is supposed to be a column major matrix


returns the { @ link java lang reflect method } instance for { @ link # test set null ( ) } so that tests of { @ link java util collections # checked collection ( java util collection , class ) } can suppress it with { @ code feature specific test suite builder suppressing ( ) } until < a href = " http : bugs sun combugdatabaseview bug do ? bug id = 6409434 " > sun bug 6409434 is fixed it ' s unclear whether nulls were to be permitted or forbidden , but presumably the eventual fix will be to permit them , as it seems more likely that code would depend on that behavior than on the other thus , we say the bug is in set ( ) , which fails to support null

public static method get set null supported method ( ) { return helpers get method ( list set tester class , " test set null " ) ; }


adjust the automatic comment display options if the associated options changed

private void adjust automatic comment display options ( options options , string option name , object old value , object new value ) { if ( option name equals ( options gui comment auto get color option name ( ) ) ) { automatic comment color = ( color ) new value ; } string automatic comment style name = options gui comment auto get style option name ( ) ; if ( option name equals ( automatic comment style name ) ) { automatic comment style = options get int ( automatic comment style name , - 1 ) ; } }


version of { @ link # get dynamic library symlink } for the special case of c + + runtime libraries these are handled differently than other libraries : neither their names nor directories are mangled , i e libstdc + + so 6 is symlinked from solib [ arch ] libstdc + + so 6

public static artifact get cpp runtime symlink ( rule context rule context , artifact library , string toolchain provided solib dir , string solib dir override ) { path fragment solib dir = path fragment create ( solib dir override ! = null ? solib dir override : toolchain provided solib dir ) ; path fragment symlink name = solib dir get relative ( library get root relative path ( ) get base name ( ) ) ; return get dynamic library symlink internal ( / * action registry = * / rule context , / * action construction context = * / rule context , library , symlink name ) ; }


renders output buffer to the given surface must only be called when in { @ link c # video output mode surface yuv } mode

public void render to surface ( video decoder output buffer output buffer , surface surface ) throws gav 1 decoder exception { if ( output buffer mode ! = c video output mode surface yuv ) { throw new gav 1 decoder exception ( " invalid output mode " ) ; } if ( gav 1 render frame ( gav 1 decoder context , surface , output buffer ) = = gav1 error ) { throw new gav 1 decoder exception ( " buffer render error : " + gav 1 get error message ( gav 1 decoder context ) ) ; } }


check patch signature , tinker id and meta files

void on load package check fail ( file patch file , int error code ) ;


returns a list of stage execution and schedulers in a postorder representation of the tree

private list < stage execution and scheduler > create streaming linked stage executions ( session session , exchange locations consumer parent , streaming sub plan plan , function < partitioning handle , node partition map > partitioning cache , table write info table write info , optional < sql stage execution > parent stage execution , boolean summarize task info , remote task factory remote task factory , split source factory split source factory , int attempt id ) { immutable list builder < stage execution and scheduler > stage execution and schedulers = immutable list builder ( ) ; plan fragment id fragment id = plan get fragment ( ) get id ( ) ; stage id stage id = new stage id ( session get query id ( ) , fragment id get id ( ) ) ; sql stage execution stage execution = create sql stage execution ( new stage execution id ( stage id , attempt id ) , plan get fragment ( ) , remote task factory , session , summarize task info , node task map , executor , failure detector , scheduler stats , table write info ) ; partitioning handle partitioning handle = plan get fragment ( ) get partitioning ( ) ; list < remote source node > remote source nodes = plan get fragment ( ) get remote source nodes ( ) ; optional < int [ ] > bucket to partition = get bucket to partition ( partitioning handle , partitioning cache , plan get fragment ( ) get root ( ) , remote source nodes ) ; / / create child stages immutable set builder < sql stage execution > child stages builder = immutable set builder ( ) ; for ( streaming sub plan stage plan : plan get children ( ) ) { list < stage execution and scheduler > sub tree = create streaming linked stage executions ( session , stage execution : : add exchange locations , stage plan with bucket to partition ( bucket to partition ) , partitioning cache , table write info , optional of ( stage execution ) , summarize task info , remote task factory , split source factory , attempt id ) ; stage execution and schedulers add all ( sub tree ) ; child stages builder add ( get last ( sub tree ) get stage execution ( ) ) ; } set < sql stage execution > child stage executions = child stages builder build ( ) ; stage execution add state change listener ( new state - > { if ( new state is done ( ) ) { child stage executions for each ( sql stage execution : : cancel ) ; } } ) ; stage linkage stage linkage = new stage linkage ( fragment id , parent , child stage executions ) ; stage scheduler stage scheduler = create stage scheduler ( split source factory , session , plan , partitioning cache , parent stage execution , stage id , stage execution , partitioning handle , table write info , child stage executions ) ; stage execution and schedulers add ( new stage execution and scheduler ( stage execution , stage linkage , stage scheduler ) ) ; return stage execution and schedulers build ( ) ; }


returns the expected content encoding of the decoded content this get method returns { @ code " identity " } by default , which is the case for most decompressors

protected char sequence get target content encoding ( @ suppress warnings ( " unused parameters " ) char sequence content encoding ) throws http 2 exception { return identity ; }


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


public long get bind slot ( ) { return ( ( data high level shader language symbol internals 3 2 extended ) internals ) get bind slot ( ) ; }


turns a path ( relative or otherwise ) into an obs key , adding a trailing " " if the path is not the root and does not already have a " " at the end

static string maybe add trailing slash ( final string key ) { if ( ! string utils is empty ( key ) & & ! key ends with ( " / " ) ) { return key + ' / ' ; } else { return key ; } }