signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class AuthenticatorFactory { /** * Creates an Authenticator that knows how to do Facebook authentication .
* @ param token Facebook access token */
public static Authenticator createFacebookAuthenticator ( String token ) { } } | Map < String , String > params = new HashMap < String , String > ( ) ; params . put ( "access_token" , token ) ; return new TokenAuthenticator ( "_facebook" , params ) ; |
public class Agg { /** * Get a { @ link Collector } that calculates the < code > MODE ( ) < / code > function . */
public static < T , U > Collector < T , ? , Optional < T > > modeBy ( Function < ? super T , ? extends U > function ) { } } | return Collectors . collectingAndThen ( modeAllBy ( function ) , s -> s . findFirst ( ) ) ; |
public class ProGradePolicy { /** * Private method for initializing static policy .
* @ throws Exception when there was any problem during initializing static policy */
private void initializeStaticPolicy ( List < ProGradePolicyEntry > grantEntriesList ) throws Exception { } } | // grant codeBase " file : $ { { java . ext . dirs } } / * " {
// permission java . security . AllPermission ;
ProGradePolicyEntry p1 = new ProGradePolicyEntry ( true , debug ) ; Certificate [ ] certificates = null ; URL url = new URL ( expandStringWithProperty ( "file:${{java.ext.dirs}}/*" ) ) ; CodeSource cs = new Co... |
public class JavaEscape { /** * Perform a Java level 1 ( only basic set ) < strong > escape < / strong > operation
* on a < tt > char [ ] < / tt > input .
* < em > Level 1 < / em > means this method will only escape the Java basic escape set :
* < ul >
* < li > The < em > Single Escape Characters < / em > :
*... | escapeJava ( text , offset , len , writer , JavaEscapeLevel . LEVEL_1_BASIC_ESCAPE_SET ) ; |
public class PortletContextLoader { /** * Obtain the Spring root portlet application context for the current thread
* ( i . e . for the current thread ' s context ClassLoader , which needs to be
* the web application ' s ClassLoader ) .
* @ return the current root web application context , or < code > null < / co... | ClassLoader ccl = Thread . currentThread ( ) . getContextClassLoader ( ) ; if ( ccl != null ) { PortletApplicationContext ccpt = currentContextPerThread . get ( ccl ) ; if ( ccpt != null ) { return ccpt ; } } return currentContext ; |
public class SimpleFormat { /** * Writes a formatted string to the output destination of the { @ code Formatter } .
* @ param format
* a format string .
* @ param args
* the arguments list used in the { @ code format ( ) } method . If there are
* more arguments than those specified by the format string , then... | SimpleFormat f = new SimpleFormat ( ) ; f . doFormat ( format , args ) ; return f . out . toString ( ) ; |
public class ArrayMap { private MapCollections < K , V > getCollection ( ) { } } | @ WeakOuter class InteropMapCollections extends MapCollections < K , V > { @ Override protected int colGetSize ( ) { return mSize ; } @ Override protected Object colGetEntry ( int index , int offset ) { return mArray [ ( index << 1 ) + offset ] ; } @ Override protected int colIndexOfKey ( Object key ) { return key == n... |
public class BshClassPath { /** * Search jar file system for classes .
* @ param the jar : file system url
* @ return array of class names found
* @ throws IOException */
static String [ ] searchJarFSForClasses ( URL url ) throws IOException { } } | try { try { FileSystems . newFileSystem ( url . toURI ( ) , new HashMap < > ( ) ) ; } catch ( FileSystemAlreadyExistsException e ) { /* ignore */
} Path path = FileSystems . getFileSystem ( url . toURI ( ) ) . getPath ( "/" ) ; return Files . walk ( path ) . map ( Path :: toString ) . filter ( BshClassPath :: isClassFi... |
public class Assertions { /** * Assert that value is not null
* @ param < T > type of the object to check
* @ param object the object to check
* @ return the same input parameter if all is ok
* @ throws AssertionError it will be thrown if the value is null
* @ since 1.0 */
@ Nonnull public static < T > T asse... | return assertNotNull ( null , object ) ; |
public class InternalPureXbaseParser { /** * InternalPureXbase . g : 906:1 : entryRuleOpSingleAssign returns [ String current = null ] : iv _ ruleOpSingleAssign = ruleOpSingleAssign EOF ; */
public final String entryRuleOpSingleAssign ( ) throws RecognitionException { } } | String current = null ; AntlrDatatypeRuleToken iv_ruleOpSingleAssign = null ; try { // InternalPureXbase . g : 906:54 : ( iv _ ruleOpSingleAssign = ruleOpSingleAssign EOF )
// InternalPureXbase . g : 907:2 : iv _ ruleOpSingleAssign = ruleOpSingleAssign EOF
{ if ( state . backtracking == 0 ) { newCompositeNode ( grammar... |
public class HomophoneOccurrenceDumper { /** * Get the context ( left and right words ) for the given word ( s ) . This is slow ,
* as it needs to scan the whole index . */
Map < String , Long > getContext ( String ... tokens ) throws IOException { } } | Objects . requireNonNull ( tokens ) ; TermsEnum iterator = getIterator ( ) ; Map < String , Long > result = new HashMap < > ( ) ; BytesRef byteRef ; int i = 0 ; while ( ( byteRef = iterator . next ( ) ) != null ) { String term = new String ( byteRef . bytes , byteRef . offset , byteRef . length ) ; for ( String token :... |
public class MeanVariance { /** * Join the data of another MeanVariance instance .
* @ param other Data to join with */
@ Override public void put ( Mean other ) { } } | if ( ! ( other instanceof MeanVariance ) ) { throw new IllegalArgumentException ( "I cannot combine Mean and MeanVariance to a MeanVariance." ) ; } final MeanVariance mvo = ( MeanVariance ) other ; final double on = mvo . n , osum = mvo . sum ; final double tmp = n * osum - sum * on ; final double oldn = n ; // tmp cop... |
public class ObjectInputStream { /** * Reads { @ code byteCount } bytes from the source stream into the byte array { @ code dst } .
* @ param dst
* the byte array in which to store the bytes read .
* @ param offset
* the initial position in { @ code dst } to store the bytes
* read from the source stream .
*... | primitiveTypes . readFully ( dst , offset , byteCount ) ; |
public class QueryImpl { /** * ( non - Javadoc )
* @ see javax . persistence . Query # getResultList ( ) */
@ Override public List < ? > getResultList ( ) { } } | if ( log . isDebugEnabled ( ) ) log . info ( "On getResultList() executing query: " + getJPAQuery ( ) ) ; // as per JPA post event should happen before fetching data from
// database .
List results = null ; if ( getEntityMetadata ( ) == null ) { // Scalar Query
if ( kunderaQuery . isDeleteUpdate ( ) ) { executeUpdate (... |
public class SchemaGeneratorHelper { /** * builds directives from a type and its extensions */
public GraphQLDirective buildDirective ( Directive directive , Set < GraphQLDirective > directiveDefinitions , DirectiveLocation directiveLocation ) { } } | Optional < GraphQLDirective > directiveDefinition = directiveDefinitions . stream ( ) . filter ( dd -> dd . getName ( ) . equals ( directive . getName ( ) ) ) . findFirst ( ) ; GraphQLDirective . Builder builder = GraphQLDirective . newDirective ( ) . name ( directive . getName ( ) ) . description ( buildDescription ( ... |
public class DynamicAccessModule { /** * Maybe these methods ' exposure needs to be re - thought ? */
public String [ ] getObjectHistory ( Context context , String PID ) throws ServerException { } } | return da . getObjectHistory ( context , PID ) ; |
public class SelectionManager { /** * returns wheher the connector is connected to a shape not in the selection .
* As this could be connected to a nested shape , it iterates from that shape ( not in the selection ) until it finds it ' s parent in the selection or it returns null .
* @ param connector
* @ return ... | WiresShape headShape = null ; WiresShape tailShape = null ; if ( connector . getHeadConnection ( ) . getMagnet ( ) != null ) { headShape = connector . getHeadConnection ( ) . getMagnet ( ) . getMagnets ( ) . getWiresShape ( ) ; } if ( connector . getTailConnection ( ) . getMagnet ( ) != null ) { tailShape = connector .... |
public class NumberUtils { /** * Produces an array with a sequence of integer numbers , using a step .
* @ param from value to start the sequence from
* @ param to value to produce the sequence to
* @ param step the step to be used
* @ return the Integer [ ] sequence
* @ since 2.0.9 */
public static Integer [... | Validate . notNull ( from , "Value to start the sequence from cannot be null" ) ; Validate . notNull ( to , "Value to generate the sequence up to cannot be null" ) ; Validate . notNull ( step , "Step to generate the sequence cannot be null" ) ; final int iFrom = from . intValue ( ) ; final int iTo = to . intValue ( ) ;... |
public class FeatureTokens { /** * indexed getter for beginnings - gets an indexed value -
* @ generated
* @ param i index in the array to get
* @ return value of the element at index i */
public int getBeginnings ( int i ) { } } | if ( FeatureTokens_Type . featOkTst && ( ( FeatureTokens_Type ) jcasType ) . casFeat_beginnings == null ) jcasType . jcas . throwFeatMissing ( "beginnings" , "ch.epfl.bbp.uima.types.FeatureTokens" ) ; jcasType . jcas . checkArrayBounds ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( FeatureTokens_Type ) jcasType ) . ... |
public class DataSet { /** * Applies a Filter transformation on a { @ link DataSet } . < br / >
* The transformation calls a { @ link FilterFunction } for each element of the DataSet
* and retains only those element for which the function returns true . Elements for
* which the function returns false are filtered... | if ( filter == null ) { throw new NullPointerException ( "Filter function must not be null." ) ; } return new FilterOperator < T > ( this , filter ) ; |
public class CommonOps_DDRM { /** * Performs the following operation : < br >
* < br >
* c = & alpha ; * a < sup > T < / sup > * b < sup > T < / sup > < br >
* c < sub > ij < / sub > = & alpha ; & sum ; < sub > k = 1 : n < / sub > { a < sub > ki < / sub > * b < sub > jk < / sub > }
* @ param alpha Scaling facto... | // TODO add a matrix vectory multiply here
if ( a . numCols >= EjmlParameters . MULT_TRANAB_COLUMN_SWITCH ) { MatrixMatrixMult_DDRM . multTransAB_aux ( alpha , a , b , c , null ) ; } else { MatrixMatrixMult_DDRM . multTransAB ( alpha , a , b , c ) ; } |
public class DeepSubtypeAnalysis { /** * Given two JavaClasses , try to estimate the probability that an reference
* of type x is also an instance of type y . Will return 0 only if it is
* impossible and 1 only if it is guaranteed .
* @ param x
* Known type of object
* @ param y
* Type queried about
* @ r... | return Analyze . deepInstanceOf ( x , y ) ; |
public class dnsaction64 { /** * Use this API to add dnsaction64 resources . */
public static base_responses add ( nitro_service client , dnsaction64 resources [ ] ) throws Exception { } } | base_responses result = null ; if ( resources != null && resources . length > 0 ) { dnsaction64 addresources [ ] = new dnsaction64 [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { addresources [ i ] = new dnsaction64 ( ) ; addresources [ i ] . actionname = resources [ i ] . actionname ; addr... |
public class MessageFormat { /** * Sets the Format object to use for the format elements within the
* previously set pattern string that use the given argument
* index .
* The argument index is part of the format element definition and
* represents an index into the < code > arguments < / code > array passed
... | if ( msgPattern . hasNamedArguments ( ) ) { throw new IllegalArgumentException ( "This method is not available in MessageFormat objects " + "that use alphanumeric argument names." ) ; } for ( int partIndex = 0 ; ( partIndex = nextTopLevelArgStart ( partIndex ) ) >= 0 ; ) { if ( msgPattern . getPart ( partIndex + 1 ) . ... |
public class EnumConstantWriterImpl { /** * { @ inheritDoc } */
protected Content getNavSummaryLink ( ClassDoc cd , boolean link ) { } } | if ( link ) { if ( cd == null ) { return writer . getHyperLink ( SectionName . ENUM_CONSTANT_SUMMARY , writer . getResource ( "doclet.navEnum" ) ) ; } else { return writer . getHyperLink ( SectionName . ENUM_CONSTANTS_INHERITANCE , configuration . getClassName ( cd ) , writer . getResource ( "doclet.navEnum" ) ) ; } } ... |
public class SlideShowView { /** * Pause the slide show */
public void pause ( ) { } } | switch ( status ) { case PAUSED : case STOPPED : return ; case PLAYING : status = Status . PAUSED ; // Remove all callbacks
slideHandler . removeCallbacksAndMessages ( null ) ; } |
public class JexlScriptExecutor { /** * 初始化function */
public void initialize ( ) { } } | if ( cacheSize <= 0 ) { // 不考虑cacheSize为0的情况 , 强制使用LRU cache机制
cacheSize = DEFAULT_CACHE_SIZE ; } functions = new HashMap < String , Object > ( ) ; engine = new ScriptJexlEngine ( ) ; engine . setCache ( cacheSize ) ; engine . setSilent ( true ) ; engine . setFunctions ( functions ) ; // 注册functions |
public class Preset { /** * Return the Maestrano API configuration as a hash
* @ param marketplace
* @ return metadata hash */
public Map < String , Object > toMetadataHash ( ) { } } | Map < String , Object > hash = new LinkedHashMap < String , Object > ( ) ; hash . put ( "marketplace" , marketplace ) ; hash . put ( "app" , app . toMetadataHash ( ) ) ; hash . put ( "api" , api . toMetadataHash ( ) ) ; hash . put ( "sso" , sso . toMetadataHash ( ) ) ; hash . put ( "connec" , connec . toMetadataHash ( ... |
public class VirtualMachineScaleSetRollingUpgradesInner { /** * Cancels the current virtual machine scale set rolling upgrade .
* @ param resourceGroupName The name of the resource group .
* @ param vmScaleSetName The name of the VM scale set .
* @ param serviceCallback the async ServiceCallback to handle success... | return ServiceFuture . fromResponse ( cancelWithServiceResponseAsync ( resourceGroupName , vmScaleSetName ) , serviceCallback ) ; |
public class DefaultEngine { /** * Get template .
* @ param name - template name
* @ param locale - template locale
* @ param encoding - template encoding
* @ return template instance
* @ throws IOException - If an I / O error occurs
* @ throws ParseException - If the template cannot be parsed
* @ see # g... | name = UrlUtils . cleanName ( name ) ; locale = cleanLocale ( locale ) ; Map < Object , Object > cache = this . cache ; // safe copy reference
if ( cache == null ) { return parseTemplate ( null , name , locale , encoding , args ) ; } Resource resource = null ; long lastModified ; if ( reloadable ) { resource = loadReso... |
public class TicketGrantingTicketImpl { /** * Update service and track session .
* @ param id the id
* @ param service the service
* @ param onlyTrackMostRecentSession the only track most recent session */
protected void trackServiceSession ( final String id , final Service service , final boolean onlyTrackMostRe... | update ( ) ; service . setPrincipal ( getRoot ( ) . getAuthentication ( ) . getPrincipal ( ) . getId ( ) ) ; if ( onlyTrackMostRecentSession ) { val path = normalizePath ( service ) ; val existingServices = this . services . values ( ) ; existingServices . stream ( ) . filter ( existingService -> path . equals ( normal... |
public class JSDocInfoBuilder { /** * Returns whether this builder is populated with information that can be
* used to { @ link # build } a { @ link JSDocInfo } object that has a
* fileoverview tag . */
public boolean isPopulatedWithFileOverview ( ) { } } | return isPopulated ( ) && ( currentInfo . hasFileOverview ( ) || currentInfo . isExterns ( ) || currentInfo . isNoCompile ( ) || currentInfo . isTypeSummary ( ) ) ; |
public class Tuple15 { /** * Split this tuple into two tuples of degree 12 and 3. */
public final Tuple2 < Tuple12 < T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , T10 , T11 , T12 > , Tuple3 < T13 , T14 , T15 > > split12 ( ) { } } | return new Tuple2 < > ( limit12 ( ) , skip12 ( ) ) ; |
public class CmsDisplayResource { /** * Prepends the site - root to the given URL . < p >
* @ param url the URL
* @ return the absolute URL */
private String prependSiteRoot ( String url ) { } } | String site = getCms ( ) . getRequestContext ( ) . getSiteRoot ( ) ; if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( site ) || OpenCms . getSiteManager ( ) . isSharedFolder ( site ) ) { site = OpenCms . getSiteManager ( ) . getDefaultUri ( ) ; if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( site ) || ( OpenCms . getSiteM... |
public class MediaTypeUtils { /** * Checks if the media type is supported by the service .
* @ param mediaType Internet media type for the file
* @ return true if it is supported , false if not . */
public static boolean isValidMediaType ( final String mediaType ) { } } | return ( mediaType != null ) && MEDIA_TYPES . values ( ) . contains ( mediaType . toLowerCase ( ) ) ; |
public class FactoryOrientationAlgs { /** * Estimates the orientation of a region by using a sliding window across the different potential
* angles .
* @ see OrientationSlidingWindow
* @ param config Configuration for algorithm . If null defaults will be used .
* @ param integralType Type of integral image bein... | if ( config == null ) config = new ConfigSlidingIntegral ( ) ; config . checkValidity ( ) ; return ( OrientationIntegral < II > ) new ImplOrientationSlidingWindowIntegral ( config . objectRadiusToScale , config . samplePeriod , config . windowSize , config . radius , config . weightSigma , config . sampleWidth , integr... |
public class LibUtils { /** * Calculates the current OSType
* @ return The current OSType */
public static OSType calculateOS ( ) { } } | String vendor = System . getProperty ( "java.vendor" ) ; if ( "The Android Project" . equals ( vendor ) ) { return OSType . ANDROID ; } String osName = System . getProperty ( "os.name" ) ; osName = osName . toLowerCase ( Locale . ENGLISH ) ; if ( osName . startsWith ( "mac os" ) ) { return OSType . APPLE ; } if ( osNam... |
public class DataLoader { /** * Normally { @ link # dispatch ( ) } is an asynchronous operation but this version will ' join ' on the
* results if dispatch and wait for them to complete . If the { @ link CompletableFuture } callbacks make more
* calls to this data loader then the { @ link # dispatchDepth ( ) } will... | List < V > results = new ArrayList < > ( ) ; List < V > joinedResults = dispatch ( ) . join ( ) ; results . addAll ( joinedResults ) ; while ( this . dispatchDepth ( ) > 0 ) { joinedResults = dispatch ( ) . join ( ) ; results . addAll ( joinedResults ) ; } return results ; |
public class IRFactory { /** * This reduces the cost of these properties to O ( nodes ) to O ( files ) . */
private Node createTemplateNode ( ) { } } | // The Node type choice is arbitrary .
Node templateNode = new Node ( Token . SCRIPT ) ; templateNode . setStaticSourceFile ( sourceFile ) ; return templateNode ; |
public class EMatrixUtils { /** * Returns a new matrix by subtracting elements column by column .
* @ param matrix The input matrix
* @ param vector The vector to be subtracted from columns
* @ return A new matrix of which the vector is subtracted column by column */
public static RealMatrix colSubtract ( RealMat... | // Declare and initialize the new matrix :
double [ ] [ ] retval = new double [ matrix . getRowDimension ( ) ] [ matrix . getColumnDimension ( ) ] ; // Iterate over rows :
for ( int col = 0 ; col < retval . length ; col ++ ) { // Iterate over columns :
for ( int row = 0 ; row < retval [ 0 ] . length ; row ++ ) { retval... |
public class Parameters { /** * Returns the specified namespace joined into a string , for example { @ code " foo . bar " } for { @ code
* [ " foo " , " bar " ] } . The namespace may consist of any number of elements , including none at all .
* No element in the namespace may begin or end with a period . */
public ... | for ( final String element : namespace ) { checkArgument ( ! element . startsWith ( DELIM ) , "Namespace element may not begin with a period: " + element ) ; checkArgument ( ! element . endsWith ( DELIM ) , "Namespace element may not end with a period: " + element ) ; } return JOINER . join ( namespace ) ; |
public class CmsHtmlParser { /** * Collapse HTML whitespace in the given String . < p >
* @ param string the string to collapse
* @ return the input String with all HTML whitespace collapsed */
protected String collapse ( String string ) { } } | int len = string . length ( ) ; StringBuffer result = new StringBuffer ( len ) ; int state = 0 ; for ( int i = 0 ; i < len ; i ++ ) { char c = string . charAt ( i ) ; switch ( c ) { // see HTML specification section 9.1 White space
// http : / / www . w3 . org / TR / html4 / struct / text . html # h - 9.1
case '\u0020'... |
public class Properties { /** * Sets the " raw " comment for the specified key . Each line of the
* comment must be either empty , whitespace - only , or preceded by a
* comment marker ( " # " or " ! " ) . This is not enforced by this class .
* < br >
* Note : if you set a comment , you must set a corresponding... | if ( rawComment == null ) throw new NullPointerException ( ) ; Entry entry = props . get ( key ) ; if ( entry == null ) { entry = new Entry ( rawComment , null ) ; props . put ( key , entry ) ; } else { entry . setRawComment ( rawComment ) ; } |
public class AttributeValue { /** * An attribute of type Binary Set . For example :
* < code > " BS " : [ " U3Vubnk = " , " UmFpbnk = " , " U25vd3k = " ] < / code >
* @ param bS
* An attribute of type Binary Set . For example : < / p >
* < code > " BS " : [ " U3Vubnk = " , " UmFpbnk = " , " U25vd3k = " ] < / co... | if ( bS == null ) { this . bS = null ; return ; } this . bS = new java . util . ArrayList < java . nio . ByteBuffer > ( bS ) ; |
public class Monitors { /** * Creates a monitor config based on an annotation . */
private static MonitorConfig newConfig ( Class < ? > c , String defaultName , String id , com . netflix . servo . annotations . Monitor anno , TagList tags ) { } } | String name = anno . name ( ) ; if ( name . isEmpty ( ) ) { name = defaultName ; } MonitorConfig . Builder builder = MonitorConfig . builder ( name ) ; builder . withTag ( "class" , className ( c ) ) ; builder . withTag ( anno . type ( ) ) ; builder . withTag ( anno . level ( ) ) ; if ( tags != null ) { builder . withT... |
public class PGXADataSourceFactory { /** * All the other PostgreSQL DataSource use PGObjectFactory directly , but we can ' t do that with
* PGXADataSource because referencing PGXADataSource from PGObjectFactory would break
* " JDBC2 Enterprise " edition build which doesn ' t include PGXADataSource . */
public Objec... | Reference ref = ( Reference ) obj ; String className = ref . getClassName ( ) ; if ( className . equals ( "org.postgresql.xa.PGXADataSource" ) ) { return loadXADataSource ( ref ) ; } else { return null ; } |
public class Lexicon { /** * Returns a { @ link Function } that delegates to { @ code function } and falls back to
* { @ code defaultFunction } for null return values . */
static < F , T > Function < F , T > fallback ( Function < F , T > function , Function < ? super F , ? extends T > defaultFunction ) { } } | return from -> { T result = function . apply ( from ) ; return result == null ? defaultFunction . apply ( from ) : result ; } ; |
public class InternalXbaseParser { /** * InternalXbase . g : 367:1 : ruleXOtherOperatorExpression : ( ( rule _ _ XOtherOperatorExpression _ _ Group _ _ 0 ) ) ; */
public final void ruleXOtherOperatorExpression ( ) throws RecognitionException { } } | int stackSize = keepStackSize ( ) ; try { // InternalXbase . g : 371:2 : ( ( ( rule _ _ XOtherOperatorExpression _ _ Group _ _ 0 ) ) )
// InternalXbase . g : 372:2 : ( ( rule _ _ XOtherOperatorExpression _ _ Group _ _ 0 ) )
{ // InternalXbase . g : 372:2 : ( ( rule _ _ XOtherOperatorExpression _ _ Group _ _ 0 ) )
// In... |
public class SignatureConverter { /** * Convenience method for generating a method signature in human readable
* form .
* @ param className
* name of the class containing the method
* @ param methodName
* the name of the method
* @ param methodSig
* the signature of the method */
public static String conv... | return convertMethodSignature ( className , methodName , methodSig , "" ) ; |
public class AbstractKubernetesResourceProvider { /** * Get the value ( ) from the specified annotation using reflection .
* @ param annotation
* The annotation . */
private String getAnnotationValue ( Annotation annotation ) { } } | Class < ? extends Annotation > type = annotation . annotationType ( ) ; try { Method method = type . getDeclaredMethod ( VALUE ) ; return String . valueOf ( method . invoke ( annotation , NO_ARGS ) ) ; } catch ( NoSuchMethodException e ) { return null ; } catch ( InvocationTargetException e ) { return null ; } catch ( ... |
public class MariaDbStatement { /** * Retrieves the current result as an update count ; if the result is a ResultSet object or there
* are no more results , - 1 is returned . This method should be called only once per result .
* @ return the current result as an update count ; - 1 if the current result is a ResultS... | if ( results != null && results . getCmdInformation ( ) != null && ! results . isBatch ( ) ) { return results . getCmdInformation ( ) . getUpdateCount ( ) ; } return - 1 ; |
public class BusNetwork { /** * Add a bus line inside the bus network .
* @ param busLine is the bus line to insert .
* @ return < code > true < / code > if the bus line was added , otherwise < code > false < / code > */
public boolean addBusLine ( BusLine busLine ) { } } | if ( busLine == null ) { return false ; } if ( this . busLines . indexOf ( busLine ) != - 1 ) { return false ; } if ( ! this . busLines . add ( busLine ) ) { return false ; } final boolean isValidLine = busLine . isValidPrimitive ( ) ; busLine . setEventFirable ( isEventFirable ( ) ) ; busLine . setContainer ( this ) ;... |
public class FileObjectReaderImpl { /** * { @ inheritDoc } */
public long read ( OutputStream stream , long length ) throws IOException { } } | if ( stream instanceof FileOutputStream ) { // use NIO
return channel . transferTo ( 0 , length , ( ( FileOutputStream ) stream ) . getChannel ( ) ) ; } else { // bytes copy
ByteBuffer buff = ByteBuffer . allocate ( SerializationConstants . INTERNAL_BUFFER_SIZE ) ; int r ; int readed = 0 ; while ( ( r = channel . read ... |
public class RuntimeUtil { /** * Executes an external command and provides results of execution .
* Will accumulate limited output from the external process .
* @ param command array containing the command to call and its arguments .
* @ param maxBuffer max size of buffers < code > out , err < / code > . An exter... | if ( command . length == 0 ) { throw new IllegalArgumentException ( "Command must be provided." ) ; } String [ ] commandAndArgs = command . length == 1 && command [ 0 ] . contains ( " " ) ? Util . split ( command [ 0 ] , " " ) : command ; try { Process process = Runtime . getRuntime ( ) . exec ( commandAndArgs ) ; Outp... |
public class WriterBasedGenerator { /** * Method called to append escape sequence for given character , at the
* end of standard output buffer ; or if not possible , write out directly . */
private final void _appendCharacterEscape ( char ch , int escCode ) throws IOException , JsonGenerationException { } } | if ( escCode >= 0 ) { // \ \ N ( 2 char )
if ( ( _outputTail + 2 ) > _outputEnd ) { _flushBuffer ( ) ; } _outputBuffer [ _outputTail ++ ] = '\\' ; _outputBuffer [ _outputTail ++ ] = ( char ) escCode ; return ; } if ( escCode != CharacterEscapes . ESCAPE_CUSTOM ) { // std , \ \ uXXXX
if ( ( _outputTail + 2 ) > _outputEn... |
public class Main { /** * Calculate the nth centered hexagonal number .
* Examples :
* > > > nth _ centered _ hexagonal _ num ( 10)
* 271
* > > > nth _ centered _ hexagonal _ num ( 2)
* > > > nth _ centered _ hexagonal _ num ( 9)
* 217
* @ param index : The nth position of the centered hexagonal number se... | return 3 * index * ( index - 1 ) + 1 ; |
public class Combinations { /** * Extracts the entire bucket . Will add elements to the provided list or create a new one
* @ param storage Optional storage . If null a list is created . clear ( ) is automatically called .
* @ return List containing the bucket */
public List < T > getBucket ( List < T > storage ) {... | if ( storage == null ) storage = new ArrayList < T > ( ) ; else storage . clear ( ) ; for ( int i = 0 ; i < bins . length ; i ++ ) { storage . add ( a . get ( bins [ i ] ) ) ; } return storage ; |
public class AttributeDataset { /** * Returns a column . */
public AttributeVector column ( String col ) { } } | int i = - 1 ; for ( int j = 0 ; j < attributes . length ; j ++ ) { if ( attributes [ j ] . getName ( ) . equals ( col ) ) { i = j ; break ; } } if ( i == - 1 ) { throw new IllegalArgumentException ( "Invalid column name: " + col ) ; } return column ( i ) ; |
public class XForLoopExpressionImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public boolean eIsSet ( int featureID ) { } } | switch ( featureID ) { case XbasePackage . XFOR_LOOP_EXPRESSION__FOR_EXPRESSION : return forExpression != null ; case XbasePackage . XFOR_LOOP_EXPRESSION__EACH_EXPRESSION : return eachExpression != null ; case XbasePackage . XFOR_LOOP_EXPRESSION__DECLARED_PARAM : return declaredParam != null ; } return super . eIsSet (... |
public class DefaultDOManager { /** * Gets a list of the requested next available PIDs . the number of PIDs .
* @ param numPIDs
* The number of PIDs to generate . Defaults to 1 if the number is
* not a positive integer .
* @ param namespace
* The namespace to be used when generating the PIDs . If null ,
* t... | if ( numPIDs < 1 ) { numPIDs = 1 ; } String [ ] pidList = new String [ numPIDs ] ; if ( namespace == null || namespace . isEmpty ( ) ) { namespace = m_pidNamespace ; } try { for ( int i = 0 ; i < numPIDs ; i ++ ) { pidList [ i ] = m_pidGenerator . generatePID ( namespace ) . toString ( ) ; } return pidList ; } catch ( ... |
public class RelationExtractor { /** * read predictions */
private List readPredictionFile ( File pred ) throws IOException { } } | List list = new ArrayList ( ) ; LineNumberReader lr = new LineNumberReader ( new FileReader ( pred ) ) ; String line = null ; while ( ( line = lr . readLine ( ) ) != null ) { // logger . debug ( line ) ;
list . add ( new Double ( line . trim ( ) ) ) ; } // end while
lr . close ( ) ; return list ; |
public class ClockSkewDetector { /** * Attach the current client time to the { { @ link # mDev } identifier .
* if clientTime is null , the current time is used .
* @ param clientTime the supplied client time , use null for current time
* @ throws IfmapErrorResult
* @ throws IfmapException */
private void publi... | PublishElement pu ; PublishRequest pr ; String date = DateHelpers . getUtcTimeAsIso8601 ( clientTime ) ; Document timeMd = mMetadataFac . createClientTime ( date ) ; pu = Requests . createPublishUpdate ( mDev , timeMd , MetadataLifetime . session ) ; pr = Requests . createPublishReq ( pu ) ; mSsrc . publish ( pr ) ; |
public class SeaGlassStyle { /** * Getter for a region specific style property .
* < p > Overridden to cause this style to populate itself with data from
* UIDefaults , if necessary . < / p >
* < p > Properties in UIDefaults may be specified in a chained manner . For
* example : < / p >
* < pre >
* backgrou... | Values v = getValues ( ctx ) ; // strip off the prefix , if there is one .
String fullKey = key . toString ( ) ; String partialKey = fullKey . substring ( fullKey . indexOf ( "." ) + 1 ) ; Object obj = null ; int xstate = getExtendedState ( ctx , v ) ; // check the cache
tmpKey . init ( partialKey , xstate ) ; obj = v ... |
public class CommonUtils { /** * Returns XSD declaration of given property . */
public static XSDeclaration getXsdDeclaration ( CPropertyInfo propertyInfo ) { } } | XSComponent schemaComponent = propertyInfo . getSchemaComponent ( ) ; if ( ! ( schemaComponent instanceof XSParticle ) ) { // XSComplexType for example :
return null ; } XSTerm term = ( ( XSParticle ) schemaComponent ) . getTerm ( ) ; if ( ! ( term instanceof XSDeclaration ) ) { // XSModelGroup for example :
return nul... |
public class MappeableBitmapContainer { /** * Find the index of the previous set bit less than or equal to i , returns - 1 if none found .
* @ param i starting index
* @ return index of the previous set bit */
public int prevSetBit ( final int i ) { } } | int x = i >> 6 ; // signed i / 64
long w = bitmap . get ( x ) ; w <<= 64 - i - 1 ; if ( w != 0 ) { return i - Long . numberOfLeadingZeros ( w ) ; } for ( -- x ; x >= 0 ; -- x ) { long X = bitmap . get ( x ) ; if ( X != 0 ) { return x * 64 + 63 - Long . numberOfLeadingZeros ( X ) ; } } return - 1 ; |
public class ControlFilter { /** * ( non - Javadoc )
* @ see
* org . fcrepo . server . security . xacml . pep . rest . filters . RESTFilter # handleRequest ( javax . servlet
* . http . HttpServletRequest , javax . servlet . http . HttpServletResponse ) */
@ Override public RequestCtx handleRequest ( HttpServletRe... | RequestCtx req = null ; String action = request . getParameter ( "action" ) ; if ( action == null ) { throw new ServletException ( "Invalid request, action parameter must be specified." ) ; } Map < URI , AttributeValue > actions = new HashMap < URI , AttributeValue > ( ) ; Map < URI , AttributeValue > resAttr ; try { r... |
public class WildPath { /** * convertFileWildCardToRegx .
* @ param wildcard a { @ link java . lang . String } object .
* @ return a { @ link java . util . regex . Pattern } object . */
public static Pattern convertFileWildCardToRegx ( final String wildcard ) { } } | String regex = wildcard ; regex = regex . replaceAll ( "[.]" , "\\\\." ) ; regex = regex . replaceAll ( "[?]" , "." ) ; regex = regex . replaceAll ( "[*]" , ".*" ) ; return Pattern . compile ( "^" + regex + "$" , Pattern . CASE_INSENSITIVE ) ; |
public class DigestAuthHeaderFunction { /** * Generates digest hexadecimal string representation of a key with given
* algorithm .
* @ param algorithm
* @ param key
* @ return */
private String getDigestHex ( String algorithm , String key ) { } } | if ( algorithm . equals ( "md5" ) ) { return DigestUtils . md5Hex ( key ) ; } else if ( algorithm . equals ( "sha" ) ) { return DigestUtils . shaHex ( key ) ; } throw new CitrusRuntimeException ( "Unsupported digest algorithm: " + algorithm ) ; |
public class QuotedStringTokenizer { @ Override public String nextToken ( ) throws NoSuchElementException { } } | if ( ! hasMoreTokens ( ) || _token == null ) throw new NoSuchElementException ( ) ; String t = _token . toString ( ) ; _token . setLength ( 0 ) ; _hasToken = false ; return t ; |
public class ClassNodeUtils { /** * Return true if we have a static accessor */
public static boolean hasPossibleStaticProperty ( ClassNode cNode , String methodName ) { } } | // assume explicit static method call checked first so we can assume a simple check here
if ( ! methodName . startsWith ( "get" ) && ! methodName . startsWith ( "is" ) ) { return false ; } String propName = getPropNameForAccessor ( methodName ) ; PropertyNode pNode = getStaticProperty ( cNode , propName ) ; return pNod... |
public class BatchedTimeoutManager { /** * The group alarm call . The context on this call will be null . */
public void alarm ( Object context ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "alarm" , context ) ; btmLockManager . lock ( ) ; boolean btmLocked = true ; timeoutLockManager . lockExclusive ( ) ; boolean timeoutLocked = true ; try { // we won ' t be called unless there are alarms which have tim... |
public class JavaDate2SqlTimestampFieldConversion { /** * @ see FieldConversion # sqlToJava ( Object ) */
public Object sqlToJava ( Object source ) { } } | if ( source instanceof java . sql . Timestamp ) { return new java . util . Date ( ( ( java . sql . Timestamp ) source ) . getTime ( ) ) ; } else { return source ; } |
public class BatchListObjectParentPathsResponseMarshaller { /** * Marshall the given parameter object . */
public void marshall ( BatchListObjectParentPathsResponse batchListObjectParentPathsResponse , ProtocolMarshaller protocolMarshaller ) { } } | if ( batchListObjectParentPathsResponse == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( batchListObjectParentPathsResponse . getPathToObjectIdentifiersList ( ) , PATHTOOBJECTIDENTIFIERSLIST_BINDING ) ; protocolMarshaller . marshall ( batc... |
public class ControlBeanContextServicesSupport { /** * Try to find the registered service for a service object instance .
* May return null if the object instance is not from a service registered
* with this service provider .
* @ return Service class for service instance .
* @ throws IllegalArgumentException i... | for ( Class sc : _serviceProviders . keySet ( ) ) { if ( sc . isInstance ( service ) ) { return sc ; } } throw new IllegalArgumentException ( "Cannot find service provider for: " + service . getClass ( ) . getCanonicalName ( ) ) ; |
public class NetworkMessageEntity { /** * Read the first byte to retrieve the total number of key and call { @ link # decode ( DataInputStream , int ) for each
* key } .
* @ param buffer The current buffer to read .
* @ throws IOException Exception in case of error . */
@ Override protected void decode ( DataInpu... | entityId = buffer . readShort ( ) ; final int number = buffer . readByte ( ) ; for ( int i = 0 ; i < number ; i ++ ) { decode ( buffer , i ) ; } |
public class _Private_IonTextAppender { /** * LOBs */
public void printBlob ( _Private_IonTextWriterBuilder _options , byte [ ] value , int start , int len ) throws IOException { } } | if ( value == null ) { appendAscii ( "null.blob" ) ; return ; } @ SuppressWarnings ( "resource" ) TextStream ts = new TextStream ( new ByteArrayInputStream ( value , start , len ) ) ; // base64 encoding is 6 bits per char so
// it evens out at 3 bytes in 4 characters
char [ ] buf = new char [ _options . isPrettyPrintOn... |
public class DefaultGroovyMethods { /** * Drops the given number of key / value pairs from the head of this map if they are available .
* < pre class = " groovyTestCase " >
* def strings = [ ' a ' : 10 , ' b ' : 20 , ' c ' : 30 ]
* assert strings . drop ( 0 ) = = [ ' a ' : 10 , ' b ' : 20 , ' c ' : 30 ]
* asser... | if ( self . size ( ) <= num ) { return createSimilarMap ( self ) ; } if ( num == 0 ) { return cloneSimilarMap ( self ) ; } Map < K , V > ret = createSimilarMap ( self ) ; for ( Map . Entry < K , V > entry : self . entrySet ( ) ) { K key = entry . getKey ( ) ; V value = entry . getValue ( ) ; if ( num -- <= 0 ) { ret . ... |
public class AwsUtils { /** * Returns the AccountId of the user who is running the instance .
* @ return String representing the AccountId or the owner - id
* @ throws java . io . IOException if failed to retrieve the AccountId using the
* Cloud infrastructure */
public static String getAccountId ( ) throws IOExc... | // Get the MAC address of the machine .
String macUrl = getMetadataUrl ( ) + "/network/interfaces/macs/" ; String mac = invokeUrl ( macUrl ) . trim ( ) ; // Use the MAC address to obtain the owner - id or the
// AWS AccountId .
String idUrl = macUrl + mac + "owner-id" ; String acctId = invokeUrl ( idUrl ) . trim ( ) ; ... |
public class CachedRemoteTable { /** * Build a new remote session and initialize it .
* @ param parentSessionObject The parent session for this new session ( if null , parent = me ) .
* @ param strSessionClassName The class name of the remote session to build . */
public org . jbundle . thin . base . remote . Remot... | return m_tableRemote . makeRemoteSession ( strSessionClassName ) ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcPlanarForceMeasure ( ) { } } | if ( ifcPlanarForceMeasureEClass == null ) { ifcPlanarForceMeasureEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 850 ) ; } return ifcPlanarForceMeasureEClass ; |
public class route6 { /** * Use this API to fetch all the route6 resources that are configured on netscaler . */
public static route6 [ ] get ( nitro_service service ) throws Exception { } } | route6 obj = new route6 ( ) ; route6 [ ] response = ( route6 [ ] ) obj . get_resources ( service ) ; return response ; |
public class HttpUtils { /** * Delete
* @ param host
* @ param path
* @ param headers
* @ param queries
* @ return
* @ throws Exception */
public static String doDelete ( String host , String path , Map < String , String > headers , Map < String , String > queries , Map < String , String > body ) throws Exc... | return EntityUtils . toString ( doDeleteResponse ( host , path , headers , queries , JsonUtils . toJSON ( body ) ) . getEntity ( ) , "utf-8" ) ; |
public class AmazonGlacierClient { /** * This operation downloads the output of the job you initiated using < a > InitiateJob < / a > . Depending on the job type
* you specified when you initiated the job , the output will be either the content of an archive or a vault
* inventory .
* You can download all the job... | request = beforeClientExecution ( request ) ; return executeGetJobOutput ( request ) ; |
public class FactoryStereoDisparity { /** * Returns an algorithm for computing a dense disparity images with sub - pixel disparity accuracy .
* NOTE : For RECT _ FIVE the size of the sub - regions it uses is what is specified .
* @ param minDisparity Minimum disparity that it will check . Must be & ge ; 0 and & lt ... | double maxError = ( regionRadiusX * 2 + 1 ) * ( regionRadiusY * 2 + 1 ) * maxPerPixelError ; // 3 regions are used not just one in this case
if ( whichAlg == DisparityAlgorithms . RECT_FIVE ) maxError *= 3 ; DisparitySelect select ; if ( imageType == GrayU8 . class || imageType == GrayS16 . class ) { select = selectDis... |
public class StringUtils { /** * Constructs a new < code > String < / code > by decoding the specified array of bytes using the given charset .
* @ param bytes
* The bytes to be decoded into characters
* @ param charset
* The { @ link Charset } to encode the { @ code String }
* @ return A new < code > String ... | return bytes == null ? null : new String ( bytes , charset ) ; |
public class BaseFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EObject create ( EClass eClass ) { } } | switch ( eClass . getClassifierID ( ) ) { case BasePackage . AFP : return createAFP ( ) ; case BasePackage . UNKNSF : return createUNKNSF ( ) ; case BasePackage . SF_GROUPER : return createSFGrouper ( ) ; default : throw new IllegalArgumentException ( "The class '" + eClass . getName ( ) + "' is not a valid classifier"... |
public class OrcFile { /** * Creates an { @ link Corc } instance and stores it in the context to be reused for all rows . */
@ Override public void sourcePrepare ( FlowProcess < ? extends Configuration > flowProcess , SourceCall < Corc , RecordReader > sourceCall ) throws IOException { } } | sourceCall . setContext ( ( Corc ) sourceCall . getInput ( ) . createValue ( ) ) ; |
public class StopWatch { /** * Return a string with a table describing all tasks performed .
* For custom reporting , call getTaskInfo ( ) and use the task info directly . */
public String prettyPrint ( ) { } } | StringBuilder sb = new StringBuilder ( shortSummary ( ) ) ; sb . append ( '\n' ) ; sb . append ( "-----------------------------------------\n" ) ; sb . append ( "ms % Task name\n" ) ; sb . append ( "-----------------------------------------\n" ) ; NumberFormat nf = NumberFormat . getNumberInstance ( ) ; nf . se... |
public class NativeJavaMethod { /** * Find the index of the correct function to call given the set of methods
* or constructors and the arguments .
* If no function can be found to call , return - 1. */
static int findFunction ( Context cx , MemberBox [ ] methodsOrCtors , Object [ ] args ) { } } | if ( methodsOrCtors . length == 0 ) { return - 1 ; } else if ( methodsOrCtors . length == 1 ) { MemberBox member = methodsOrCtors [ 0 ] ; Class < ? > [ ] argTypes = member . getParameterTypes ( ) ; int alength = argTypes . length ; if ( member . isVarArgs ( ) ) { alength -- ; if ( alength > args . length ) { return - 1... |
public class StackdriverQuickstart { /** * Main launcher for the Stackdriver example . */
public static void main ( String [ ] args ) throws IOException , InterruptedException { } } | // Register the view . It is imperative that this step exists ,
// otherwise recorded metrics will be dropped and never exported .
View view = View . create ( Name . create ( "task_latency_distribution" ) , "The distribution of the task latencies." , LATENCY_MS , Aggregation . Distribution . create ( LATENCY_BOUNDARIES... |
public class ServletUtil { /** * Sends a redirect with relative paths determined from the request servlet path .
* @ see # getRedirectLocation ( javax . servlet . http . HttpServletRequest , javax . servlet . http . HttpServletResponse , java . lang . String , java . lang . String ) for transformations applied to the... | sendRedirect ( response , getRedirectLocation ( request , response , request . getServletPath ( ) , href ) , status ) ; |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link BigInteger } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link BigInteger } { @ code > } */
@ XmlEle... | return new JAXBElement < BigInteger > ( _Count_QNAME , BigInteger . class , null , value ) ; |
public class Preconditions { /** * See { @ link # checkArgument ( boolean , String , Object . . . ) } */
public static void checkArgument ( boolean b , String msg , Object arg1 ) { } } | if ( ! b ) { throwEx ( msg , arg1 ) ; } |
public class AbstractInstrumentation { /** * Instrument the classes and jar files . */
public void executeInstrumentation ( ) throws IOException { } } | errors . clear ( ) ; // Iterate over all entries in the classes list
for ( File f : this . classFiles ) { try { if ( ! f . canRead ( ) || ! f . canWrite ( ) ) { throw new IOException ( f + " can not be replaced" ) ; } instrumentClassFile ( f ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; errors . add ( e ) ; }... |
public class RaidShell { /** * Scan file and verify the checksums match the checksum store if have
* args [ ] contains the root where we need to check */
private void verifyFile ( String [ ] args , int startIndex ) { } } | Path root = null ; if ( args . length <= startIndex ) { throw new IllegalArgumentException ( "too few arguments" ) ; } String arg = args [ startIndex ] ; root = new Path ( arg ) ; try { FileSystem fs = root . getFileSystem ( conf ) ; // Make sure default uri is the same as root
conf . set ( FileSystem . FS_DEFAULT_NAME... |
public class RestServiceMethod { /** * Enclosed curly braces cannot be matched with a regex . Thus we remove them before applying the replaceAll method */
private String removeEnclosedCurlyBraces ( String str ) { } } | final char curlyReplacement = 6 ; char [ ] chars = str . toCharArray ( ) ; int open = 0 ; for ( int i = 0 ; i < chars . length ; i ++ ) { if ( chars [ i ] == '{' ) { if ( open != 0 ) chars [ i ] = curlyReplacement ; open ++ ; } else if ( chars [ i ] == '}' ) { open -- ; if ( open != 0 ) { chars [ i ] = curlyReplacement... |
public class ImageSegmentationOps { /** * Indicates border pixels between two regions . If two adjacent pixels ( 4 - connect ) are not from the same region
* then both pixels are marked as true ( value of 1 ) in output image , all other pixels are false ( 0 ) .
* @ param labeled Input segmented image .
* @ param ... | InputSanityCheck . checkSameShape ( labeled , output ) ; ImageMiscOps . fill ( output , 0 ) ; for ( int y = 0 ; y < output . height - 1 ; y ++ ) { int indexLabeled = labeled . startIndex + y * labeled . stride ; int indexOutput = output . startIndex + y * output . stride ; for ( int x = 0 ; x < output . width - 1 ; x +... |
public class JavaInlineExpressionCompiler { /** * Append the inline code for the given XNullLiteral .
* @ param expression the expression of the operation .
* @ param parentExpression is the expression that contains this one , or { @ code null } if the current expression is
* the root expression .
* @ param fea... | if ( parentExpression == null && feature instanceof XtendFunction ) { final XtendFunction function = ( XtendFunction ) feature ; output . append ( "(" ) ; // $ NON - NLS - 1 $
final JvmTypeReference reference = getFunctionTypeReference ( function ) ; if ( reference != null ) { final JvmType type = reference . getType (... |
public class ClasspathUrlFinder { /** * Uses the java . class . path system property to obtain a list of URLs that represent the CLASSPATH
* paths is used as a filter to only include paths that have the specific relative file within it
* @ param paths comma list of files that should exist in a particular path
* @... | ArrayList < URL > list = new ArrayList < URL > ( ) ; String classpath = System . getProperty ( "java.class.path" ) ; StringTokenizer tokenizer = new StringTokenizer ( classpath , File . pathSeparator ) ; for ( int i = 0 ; i < paths . length ; i ++ ) { paths [ i ] = paths [ i ] . trim ( ) ; } while ( tokenizer . hasMore... |
public class ProxyFactory { /** * Sets the invocation handler for a proxy . This method is less efficient than
* { @ link # setInvocationHandler ( Object , InvocationHandler ) } , however it will work on any proxy , not just proxies from a
* specific factory .
* @ param proxy the proxy to modify
* @ param handl... | try { final Field field = proxy . getClass ( ) . getDeclaredField ( INVOCATION_HANDLER_FIELD ) ; AccessController . doPrivileged ( new SetAccessiblePrivilege ( field ) ) ; field . set ( proxy , handler ) ; } catch ( NoSuchFieldException e ) { throw new RuntimeException ( "Could not find invocation handler on generated ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.