signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class PowerOfTwoFileAllocator { /** * Split primitive for AA - trees .
* @ param t
* the node that roots the tree .
* @ return the new root after the rotation . */
private static Region split ( Region t ) { } } | if ( t . right . right . level == t . level ) { t = rotateWithRightChild ( t ) ; t . level ++ ; } return t ; |
public class Tenant { /** * Create a Tenant object from the given application definition . If the application
* does not define a tenant , the Tenant for the default database is returned .
* @ param appDef { @ link ApplicationDefinition }
* @ return { @ link Tenant } in which application resides . */
public static Tenant getTenant ( ApplicationDefinition appDef ) { } } | String tenantName = appDef . getTenantName ( ) ; if ( Utils . isEmpty ( tenantName ) ) { return TenantService . instance ( ) . getDefaultTenant ( ) ; } TenantDefinition tenantDef = TenantService . instance ( ) . getTenantDefinition ( tenantName ) ; Utils . require ( tenantDef != null , "Tenant definition does not exist: %s" , tenantName ) ; return new Tenant ( tenantDef ) ; |
public class Vector3d { /** * / * ( non - Javadoc )
* @ see org . joml . Vector3dc # div ( org . joml . Vector3fc , org . joml . Vector3d ) */
public Vector3d div ( Vector3fc v , Vector3d dest ) { } } | dest . x = x / v . x ( ) ; dest . y = y / v . y ( ) ; dest . z = z / v . z ( ) ; return dest ; |
public class ResourceConverter { /** * Accepts a JsonNode which encapsulates a link . The link may be represented as a simple string or as
* < a href = " http : / / jsonapi . org / format / # document - links " > link < / a > object . This method introspects on the
* { @ code linkNode } , returning the value of the { @ code href } member , if it exists , or returns the string form
* of the { @ code linkNode } if it doesn ' t .
* < em > Package - private for unit testing . < / em >
* @ param linkNode a JsonNode representing a link , may return { @ code null }
* @ return the link URL */
String getLink ( JsonNode linkNode ) { } } | // Handle both representations of a link : as a string or as an object
// http : / / jsonapi . org / format / # document - links ( v1.0)
if ( linkNode . has ( HREF ) ) { // object form
return linkNode . get ( HREF ) . asText ( ) ; } return linkNode . asText ( null ) ; |
public class NetworkConverter { /** * Convert a collection of links to an array of JSON links objects .
* @ param c the collection of Links
* @ return a JSON formatted array of Links */
public JSONArray linksToJSON ( Collection < Link > c ) { } } | JSONArray a = new JSONArray ( ) ; for ( Link l : c ) { a . add ( linkToJSON ( l ) ) ; } return a ; |
public class SinglePointCrossover { /** * Package private for testing purpose . */
static < T > void crossover ( final MSeq < T > that , final MSeq < T > other , final int index ) { } } | assert index >= 0 : format ( "Crossover index must be within [0, %d) but was %d" , that . length ( ) , index ) ; that . swap ( index , min ( that . length ( ) , other . length ( ) ) , other , index ) ; |
public class aaaparameter { /** * Use this API to fetch all the aaaparameter resources that are configured on netscaler . */
public static aaaparameter get ( nitro_service service ) throws Exception { } } | aaaparameter obj = new aaaparameter ( ) ; aaaparameter [ ] response = ( aaaparameter [ ] ) obj . get_resources ( service ) ; return response [ 0 ] ; |
public class B64Code { /** * Fast Base 64 decode as described in RFC 1421.
* Does not attempt to cope with extra whitespace as described in RFC 1521.
* Avoids creating extra copies of the input / output .
* Note this code has been flattened for performance .
* @ param input
* byte array to decode .
* @ param inOffset
* the offset .
* @ param inLen
* the length .
* @ return byte array containing the decoded form of the input .
* @ throws IllegalArgumentException
* if the input is not a valid B64 encoding . */
public static byte [ ] decode ( final byte [ ] input , int inOffset , final int inLen ) { } } | if ( inLen == 0 ) return ByteString . EMPTY_BYTE_ARRAY ; if ( inLen % 4 != 0 ) throw new IllegalArgumentException ( "Input block size is not 4" ) ; int withoutPaddingLen = inLen , limit = inOffset + inLen ; while ( input [ -- limit ] == pad ) withoutPaddingLen -- ; // Create result array of exact required size .
final int outLen = ( ( withoutPaddingLen ) * 3 ) / 4 ; final byte [ ] output = new byte [ outLen ] ; decode ( input , inOffset , inLen , output , 0 , outLen ) ; return output ; |
public class AbstractParameterization { /** * Log any error that has accumulated . */
public synchronized void logAndClearReportedErrors ( ) { } } | for ( ParameterException e : getErrors ( ) ) { if ( LOG . isDebugging ( ) ) { LOG . warning ( e . getMessage ( ) , e ) ; } else { LOG . warning ( e . getMessage ( ) ) ; } } clearErrors ( ) ; |
public class ConjugatedPiSystemsDetector { /** * Check an Atom whether it may be conjugated or not .
* @ param ac The AtomContainer containing currentAtom
* @ param currentAtom The Atom to check
* @ return - 1 if isolated , 0 if conjugated , 1 if cumulative db */
private static int checkAtom ( IAtomContainer ac , IAtom currentAtom ) { } } | int check = - 1 ; List < IAtom > atoms = ac . getConnectedAtomsList ( currentAtom ) ; List < IBond > bonds = ac . getConnectedBondsList ( currentAtom ) ; if ( currentAtom . getFlag ( CDKConstants . ISAROMATIC ) ) { check = 0 ; } else if ( currentAtom . getFormalCharge ( ) == 1 /* * currentAtom . getSymbol
* ( ) . equals ( " C " ) */
) { check = 0 ; } else if ( currentAtom . getFormalCharge ( ) == - 1 ) { // / / NEGATIVE CHARGES WITH A NEIGHBOOR PI BOND / / / / /
int counterOfPi = 0 ; for ( IAtom atom : atoms ) { if ( ac . getMaximumBondOrder ( atom ) != IBond . Order . SINGLE ) { counterOfPi ++ ; } } if ( counterOfPi > 0 ) check = 0 ; } else { int se = ac . getConnectedSingleElectronsCount ( currentAtom ) ; if ( se == 1 ) { check = 0 ; // / / DETECTION of radicals
} else if ( ac . getConnectedLonePairsCount ( currentAtom ) > 0 /* & & ( currentAtom . getSymbol ( ) . equals ( " N " ) */
) { check = 0 ; // / / DETECTION of lone pair
} else { int highOrderBondCount = 0 ; for ( int j = 0 ; j < atoms . size ( ) ; j ++ ) { IBond bond = bonds . get ( j ) ; if ( bond == null || bond . getOrder ( ) != IBond . Order . SINGLE ) { highOrderBondCount ++ ; } else { } } if ( highOrderBondCount == 1 ) { check = 0 ; } else if ( highOrderBondCount > 1 ) { check = 1 ; } } } return check ; |
public class SolrIndexer { /** * Retrieve and parse the config file stored under the provided object ID .
* If caching is configured the instantiated config object will be cached to
* speed up subsequent access .
* @ param oid
* : The config OID to retrieve from storage or cache
* @ return JsonSimple : The parsed or cached JSON object */
private JsonSimpleConfig getConfigFile ( String oid ) { } } | if ( oid == null ) { return null ; } // Try the cache first
JsonSimpleConfig configFile = deCacheConfig ( oid ) ; if ( configFile != null ) { return configFile ; } // Or evaluate afresh
try { DigitalObject object = storage . getObject ( oid ) ; Payload payload = object . getPayload ( object . getSourceId ( ) ) ; log . debug ( "First time parsing config file: '{}'" , oid ) ; configFile = new JsonSimpleConfig ( payload . open ( ) ) ; payload . close ( ) ; cacheConfig ( oid , configFile ) ; return configFile ; } catch ( IOException ex ) { log . error ( "Rules file could not be parsed! '{}'" , oid , ex ) ; return null ; } catch ( StorageException ex ) { log . error ( "Rules file could not be retrieved! '{}'" , oid , ex ) ; return null ; } |
public class StreamSchemaCodec { /** * Generate { @ link co . cask . tigon . sql . flowlet . StreamSchema } from serialized Schema String . */
public static StreamSchema deserialize ( String schemaString ) { } } | Iterable < String > fieldArray = Splitter . on ( ';' ) . trimResults ( ) . omitEmptyStrings ( ) . split ( schemaString ) ; StreamSchema . Builder builder = new StreamSchema . Builder ( ) ; for ( String field : fieldArray ) { Iterable < String > defnArray = Splitter . onPattern ( "\\s+" ) . trimResults ( ) . omitEmptyStrings ( ) . split ( field ) ; List < String > defnList = Lists . newArrayList ( defnArray ) ; // We expect FieldType , FieldName ( optional : FieldAttribute )
Preconditions . checkArgument ( defnList . size ( ) >= 2 ) ; GDATFieldType type = GDATFieldType . getGDATFieldType ( defnList . get ( 0 ) . toUpperCase ( ) ) ; String fieldName = defnList . get ( 1 ) ; builder . addField ( fieldName , type ) ; } return builder . build ( ) ; |
public class AbstractExtendedSet { /** * { @ inheritDoc } */
@ Override public int symmetricDifferenceSize ( Collection < ? extends T > other ) { } } | return other == null ? size ( ) : size ( ) + other . size ( ) - 2 * intersectionSize ( other ) ; |
public class QueuePoller { /** * Called at the beginning of the main loop to check if the poller config is up to date ( nbThread , pause . . . ) */
private void refreshDeploymentParameter ( DbConn cnx ) { } } | List < DeploymentParameter > prms = DeploymentParameter . select ( cnx , "dp_select_by_id" , this . dpId ) ; if ( prms . size ( ) != 1 ) { this . stop ( ) ; return ; } DeploymentParameter p = prms . get ( 0 ) ; if ( p . getPollingInterval ( ) != this . pollingInterval || ( p . getEnabled ( ) && this . maxNbThread != p . getNbThread ( ) ) || ( this . maxNbThread > 0 && ! p . getEnabled ( ) ) || ( this . maxNbThread == 0 && p . getEnabled ( ) ) ) { applyDeploymentParameter ( p ) ; } this . strictPollingPeriod = Boolean . parseBoolean ( GlobalParameter . getParameter ( cnx , "strictPollingPeriod" , "false" ) ) ; |
public class Conversions { /** * Unwraps { @ code object } to extract the original array if and only if { @ code object } was previously created by
* { @ link # doWrapArray ( Object ) } .
* @ param value
* the object to be unwrapped . May be < code > null < / code > .
* @ param componentType
* the expected component type of the array . May not be < code > null < / code > .
* @ return the previously wrapped array if the given value represents such . Otherwise returns the value unmodified .
* May return < code > null < / code > if the value was < code > null < / code > .
* @ throws ArrayStoreException
* if the expected runtime { @ code componentType } does not match the actual runtime component type . */
@ Pure public static Object unwrapArray ( Object value , Class < ? > componentType ) { } } | // This is the generic object array check .
if ( value instanceof WrappedArray < ? > ) { Object result = ( ( WrappedArray < ? > ) value ) . internalToArray ( ) ; return checkComponentType ( result , componentType ) ; } // And now for the primitive arrays .
if ( value instanceof WrappedIntegerArray ) { Object result = ( ( WrappedIntegerArray ) value ) . internalToArray ( ) ; return checkComponentType ( result , componentType ) ; } if ( value instanceof WrappedLongArray ) { Object result = ( ( WrappedLongArray ) value ) . internalToArray ( ) ; return checkComponentType ( result , componentType ) ; } if ( value instanceof WrappedFloatArray ) { Object result = ( ( WrappedFloatArray ) value ) . internalToArray ( ) ; return checkComponentType ( result , componentType ) ; } if ( value instanceof WrappedDoubleArray ) { Object result = ( ( WrappedDoubleArray ) value ) . internalToArray ( ) ; return checkComponentType ( result , componentType ) ; } if ( value instanceof WrappedByteArray ) { Object result = ( ( WrappedByteArray ) value ) . internalToArray ( ) ; return checkComponentType ( result , componentType ) ; } if ( value instanceof WrappedShortArray ) { Object result = ( ( WrappedShortArray ) value ) . internalToArray ( ) ; return checkComponentType ( result , componentType ) ; } if ( value instanceof WrappedBooleanArray ) { Object result = ( ( WrappedBooleanArray ) value ) . internalToArray ( ) ; return checkComponentType ( result , componentType ) ; } if ( value instanceof WrappedCharacterArray ) { Object result = ( ( WrappedCharacterArray ) value ) . internalToArray ( ) ; return checkComponentType ( result , componentType ) ; } if ( ! ( value instanceof Iterable < ? > ) ) { // Nothing to unwrap .
return value ; } if ( ! componentType . isPrimitive ( ) ) { @ SuppressWarnings ( { "unchecked" , "rawtypes" } ) Object result = Iterables . toArray ( ( Iterable ) value , componentType ) ; return result ; } try { List < ? > list = IterableExtensions . toList ( ( Iterable < ? > ) value ) ; Object result = Array . newInstance ( componentType , list . size ( ) ) ; for ( int i = 0 ; i < list . size ( ) ; i ++ ) { Object element = list . get ( i ) ; if ( element == null ) { throw new ArrayStoreException ( "Cannot store <null> in primitive arrays." ) ; } Array . set ( result , i , element ) ; } return result ; } catch ( IllegalArgumentException iae ) { throw new ArrayStoreException ( "Primitive conversion failed: " + iae . getMessage ( ) ) ; } |
public class AbstractAlpineQueryManager { /** * Persists the specified PersistenceCapable objects .
* @ param pcs an array of PersistenceCapable objects
* @ param < T > the type to return
* @ return the persisted objects */
@ SuppressWarnings ( "unchecked" ) public < T > T [ ] persist ( T ... pcs ) { } } | pm . currentTransaction ( ) . begin ( ) ; pm . makePersistentAll ( pcs ) ; pm . currentTransaction ( ) . commit ( ) ; pm . getFetchPlan ( ) . setDetachmentOptions ( FetchPlan . DETACH_LOAD_FIELDS ) ; pm . refreshAll ( pcs ) ; return pcs ; |
public class SystemPropertiesUtil { /** * 合并系统变量 ( - D ) , 环境变量 和默认值 , 以系统变量优先 */
public static Integer getInteger ( String propertyName , String envName , Integer defaultValue ) { } } | checkEnvName ( envName ) ; Integer propertyValue = NumberUtil . toIntObject ( System . getProperty ( propertyName ) , null ) ; if ( propertyValue != null ) { return propertyValue ; } else { propertyValue = NumberUtil . toIntObject ( System . getenv ( envName ) , null ) ; return propertyValue != null ? propertyValue : defaultValue ; } |
public class GraphicalModel { /** * Add a binary factor , with known dimensions for the variables
* @ param a The index of the first variable .
* @ param cardA The cardinality ( i . e , dimension ) of the first factor
* @ param b The index of the second variable
* @ param cardB The cardinality ( i . e , dimension ) of the second factor
* @ param featurizer The featurizer . This takes as input two assignments for the two variables , and returns the features on
* those variables .
* @ return a reference to the created factor . This can be safely ignored , as the factor is already saved in the model */
public Factor addBinaryFactor ( int a , int cardA , int b , int cardB , BiFunction < Integer , Integer , ConcatVector > featurizer ) { } } | return addFactor ( new int [ ] { a , b } , new int [ ] { cardA , cardB } , assignment -> featurizer . apply ( assignment [ 0 ] , assignment [ 1 ] ) ) ; |
public class APIClient { /** * Generate a secured and public API Key from a list of tagFilters and an
* optional user token identifying the current user
* @ param privateApiKey your private API Key
* @ param tagFilters the list of tags applied to the query ( used as security )
* @ param userToken an optional token identifying the current user
* @ deprecated Use ` generateSecuredApiKey ( String privateApiKey , Query query , String userToken ) ` version */
@ Deprecated public String generateSecuredApiKey ( String privateApiKey , String tagFilters , String userToken ) throws NoSuchAlgorithmException , InvalidKeyException , AlgoliaException { } } | if ( ! tagFilters . contains ( "=" ) ) return generateSecuredApiKey ( privateApiKey , new Query ( ) . setTagFilters ( tagFilters ) , userToken ) ; else { if ( userToken != null && userToken . length ( ) > 0 ) { try { tagFilters = String . format ( "%s%s%s" , tagFilters , "&userToken=" , URLEncoder . encode ( userToken , "UTF-8" ) ) ; } catch ( UnsupportedEncodingException e ) { throw new AlgoliaException ( e . getMessage ( ) ) ; } } return Base64 . encodeBase64String ( String . format ( "%s%s" , hmac ( privateApiKey , tagFilters ) , tagFilters ) . getBytes ( Charset . forName ( "UTF8" ) ) ) ; } |
public class Bounds { /** * Maps d \ in [ l , u ] to transformed ( d ) , such that
* transformed ( d ) \ in [ A [ i ] , B [ i ] ] . The transform is
* just a linear one . It does * NOT * check for + / - infinity . */
public double transformRangeLinearly ( double l , double u , int i , double d ) { } } | return ( B [ i ] - A [ i ] ) / ( u - l ) * ( d - u ) + B [ i ] ; |
public class AppLinkNavigation { /** * Navigates to an { @ link AppLink } .
* @ param context the Context from which the navigation should be performed .
* @ param appLink the AppLink being navigated to .
* @ return the { @ link NavigationResult } performed by navigating . */
public static NavigationResult navigate ( Context context , AppLink appLink ) { } } | return new AppLinkNavigation ( appLink , null , null ) . navigate ( context ) ; |
public class InProcessVoltDBServer { /** * Run DDL from a given string ( integrally uses in - process sqlcommand ) .
* Must be called after { @ link # start ( ) } .
* @ param ddl String containing DDL to run .
* @ return InProcessVoltDBServer instance for chaining . */
public InProcessVoltDBServer runDDLFromString ( String ddl ) { } } | try { File tempDDLFile = File . createTempFile ( "volt_ddl_" , ".sql" ) ; BufferedWriter writer = new BufferedWriter ( new FileWriter ( tempDDLFile ) ) ; writer . write ( ddl + "\n" ) ; writer . close ( ) ; runDDLFromPath ( tempDDLFile . getAbsolutePath ( ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; System . exit ( - 1 ) ; } return this ; |
public class JDateChooser { /** * Sets the locale .
* @ param l
* The new locale value */
public void setLocale ( Locale l ) { } } | super . setLocale ( l ) ; dateEditor . setLocale ( l ) ; jcalendar . setLocale ( l ) ; |
public class JSONWriter { /** * Push an array or object scope .
* @ throws JSONException
* If nesting is too deep . */
private void push ( JSONObject jo ) throws JSONException { } } | if ( this . top >= maxdepth ) { throw new JSONException ( "Nesting too deep." ) ; } this . stack [ this . top ] = jo ; this . mode = jo == null ? 'a' : 'k' ; this . top += 1 ; |
public class GetResourceSharesResult { /** * Information about the resource shares .
* @ param resourceShares
* Information about the resource shares . */
public void setResourceShares ( java . util . Collection < ResourceShare > resourceShares ) { } } | if ( resourceShares == null ) { this . resourceShares = null ; return ; } this . resourceShares = new java . util . ArrayList < ResourceShare > ( resourceShares ) ; |
public class EngineVersionCheck { /** * Downloads the current released version number and compares it to the
* running engine ' s version number . If the released version number is newer
* a warning is printed recommending an upgrade .
* @ return returns false as no updates are made to the database that would
* require compaction
* @ throws UpdateException thrown if the local database properties could not
* be updated */
@ Override public boolean update ( Engine engine ) throws UpdateException { } } | this . settings = engine . getSettings ( ) ; try { final CveDB db = engine . getDatabase ( ) ; final boolean autoupdate = settings . getBoolean ( Settings . KEYS . AUTO_UPDATE , true ) ; final boolean enabled = settings . getBoolean ( Settings . KEYS . UPDATE_VERSION_CHECK_ENABLED , true ) ; final String original = settings . getString ( Settings . KEYS . CVE_ORIGINAL_JSON ) ; final String current = settings . getString ( Settings . KEYS . CVE_MODIFIED_JSON ) ; /* * Only update if auto - update is enabled , the engine check is
* enabled , and the NVD CVE URLs have not been modified ( i . e . the
* user has not configured them to point to an internal source ) . */
if ( enabled && autoupdate && original != null && original . equals ( current ) ) { LOGGER . debug ( "Begin Engine Version Check" ) ; final DatabaseProperties properties = db . getDatabaseProperties ( ) ; final long lastChecked = Long . parseLong ( properties . getProperty ( ENGINE_VERSION_CHECKED_ON , "0" ) ) ; final long now = System . currentTimeMillis ( ) ; updateToVersion = properties . getProperty ( CURRENT_ENGINE_RELEASE , "" ) ; final String currentVersion = settings . getString ( Settings . KEYS . APPLICATION_VERSION , "0.0.0" ) ; LOGGER . debug ( "Last checked: {}" , lastChecked ) ; LOGGER . debug ( "Now: {}" , now ) ; LOGGER . debug ( "Current version: {}" , currentVersion ) ; final boolean updateNeeded = shouldUpdate ( lastChecked , now , properties , currentVersion ) ; if ( updateNeeded ) { LOGGER . warn ( "A new version of dependency-check is available. Consider updating to version {}." , updateToVersion ) ; } } } catch ( DatabaseException ex ) { LOGGER . debug ( "Database Exception opening databases to retrieve properties" , ex ) ; throw new UpdateException ( "Error occurred updating database properties." ) ; } catch ( InvalidSettingException ex ) { LOGGER . debug ( "Unable to determine if autoupdate is enabled" , ex ) ; } return false ; |
public class TwoDimensionalCounter { /** * replace the counter for K1 - index o by new counter c */
public ClassicCounter < K2 > setCounter ( K1 o , Counter < K2 > c ) { } } | ClassicCounter < K2 > old = getCounter ( o ) ; total -= old . totalCount ( ) ; if ( c instanceof ClassicCounter ) { map . put ( o , ( ClassicCounter < K2 > ) c ) ; } else { map . put ( o , new ClassicCounter < K2 > ( c ) ) ; } total += c . totalCount ( ) ; return old ; |
public class DomainsInner { /** * Creates an ownership identifier for a domain or updates identifier details for an existing identifer .
* Creates an ownership identifier for a domain or updates identifier details for an existing identifer .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param domainName Name of domain .
* @ param name Name of identifier .
* @ param domainOwnershipIdentifier A JSON representation of the domain ownership properties .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the DomainOwnershipIdentifierInner object */
public Observable < ServiceResponse < DomainOwnershipIdentifierInner > > updateOwnershipIdentifierWithServiceResponseAsync ( String resourceGroupName , String domainName , String name , DomainOwnershipIdentifierInner domainOwnershipIdentifier ) { } } | if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( domainName == null ) { throw new IllegalArgumentException ( "Parameter domainName is required and cannot be null." ) ; } if ( name == null ) { throw new IllegalArgumentException ( "Parameter name is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( domainOwnershipIdentifier == null ) { throw new IllegalArgumentException ( "Parameter domainOwnershipIdentifier is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiVersion() is required and cannot be null." ) ; } Validator . validate ( domainOwnershipIdentifier ) ; return service . updateOwnershipIdentifier ( resourceGroupName , domainName , name , this . client . subscriptionId ( ) , domainOwnershipIdentifier , this . client . apiVersion ( ) , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < DomainOwnershipIdentifierInner > > > ( ) { @ Override public Observable < ServiceResponse < DomainOwnershipIdentifierInner > > call ( Response < ResponseBody > response ) { try { ServiceResponse < DomainOwnershipIdentifierInner > clientResponse = updateOwnershipIdentifierDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ; |
public class GetSegmentImportJobsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetSegmentImportJobsRequest getSegmentImportJobsRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getSegmentImportJobsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getSegmentImportJobsRequest . getApplicationId ( ) , APPLICATIONID_BINDING ) ; protocolMarshaller . marshall ( getSegmentImportJobsRequest . getPageSize ( ) , PAGESIZE_BINDING ) ; protocolMarshaller . marshall ( getSegmentImportJobsRequest . getSegmentId ( ) , SEGMENTID_BINDING ) ; protocolMarshaller . marshall ( getSegmentImportJobsRequest . getToken ( ) , TOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class MetaDataExporter { /** * Set the column comparator class
* @ param columnComparatorClass */
public void setColumnComparatorClass ( Class < ? extends Comparator < Property > > columnComparatorClass ) { } } | module . bind ( SQLCodegenModule . COLUMN_COMPARATOR , columnComparatorClass ) ; |
public class ArrayTypeConverter { private Object [ ] createTargetArray ( OpenType pElementType , int pLength ) { } } | if ( pElementType instanceof SimpleType ) { try { SimpleType simpleType = ( SimpleType ) pElementType ; Class elementClass = Class . forName ( simpleType . getClassName ( ) ) ; return ( Object [ ] ) Array . newInstance ( elementClass , pLength ) ; } catch ( ClassNotFoundException e ) { throw new IllegalArgumentException ( "Can't find class " + pElementType . getClassName ( ) + " for instantiating array: " + e . getMessage ( ) , e ) ; } } else if ( pElementType instanceof CompositeType ) { return new CompositeData [ pLength ] ; } else { throw new UnsupportedOperationException ( "Unsupported array element type: " + pElementType ) ; } |
public class MtasXMLParser { /** * Gets the q name .
* @ param key the key
* @ return the q name */
private QName getQName ( String key ) { } } | QName qname ; if ( ( qname = qNames . get ( key ) ) == null ) { qname = new QName ( namespaceURI , key ) ; qNames . put ( key , qname ) ; } return qname ; |
public class ComputationGraph { /** * Return the input size ( number of inputs ) for the specified layer . < br >
* Note that the meaning of the " input size " can depend on the type of layer . For example : < br >
* - DenseLayer , OutputLayer , etc : the feature vector size ( nIn configuration option ) < br >
* - Recurrent layers : the feature vector size < i > per time step < / i > ( nIn configuration option ) < br >
* - ConvolutionLayer : the channels ( number of channels ) < br >
* - Subsampling layers , global pooling layers , etc : size of 0 is always returned < br >
* @ param layer Index of the layer to get the size of . Must be in range 0 to nLayers - 1 inclusive
* @ return Size of the layer */
public int layerInputSize ( int layer ) { } } | if ( layer < 0 || layer > layers . length ) { throw new IllegalArgumentException ( "Invalid layer index: " + layer + ". Layer index must be between 0 and " + ( layers . length - 1 ) + " inclusive" ) ; } return layerInputSize ( layers [ layer ] . conf ( ) . getLayer ( ) . getLayerName ( ) ) ; |
public class JavascriptEngine { /** * ( non - Javadoc )
* @ see javax . script . Invocable # getInterface ( java . lang . Object ,
* java . lang . Class ) */
@ Override public < T > T getInterface ( Object thiz , Class < T > clasz ) { } } | return ( ( Invocable ) scriptEngine ) . getInterface ( thiz , clasz ) ; |
public class MethodExpressionActionListener { /** * < p class = " changed _ modified _ 2_0 " > Both { @ link MethodExpression }
* instances described in the constructor must be saved . < / p > */
public Object saveState ( FacesContext context ) { } } | if ( context == null ) { throw new NullPointerException ( ) ; } return new Object [ ] { methodExpressionOneArg , methodExpressionZeroArg } ; |
public class XmlUtil { /** * Parse an XML document ( with appropriate flags for our purposes ) from the given stream .
* @ param is input stream containing the document
* @ param resolver resolver to be used for parsing
* @ throws PluginException for all errors */
public static Document parse ( InputStream is , EntityResolver resolver ) { } } | try { DocumentBuilder parser = createParser ( resolver ) ; return parser . parse ( is ) ; } catch ( Exception e ) { throw new PluginException ( "Error parsing XML document from input stream: " + e , e ) ; } |
public class AbstractHeaderDialogBuilder { /** * Obtains the icon of the dialog ' s header from a specific theme .
* @ param themeResourceId
* The resource id of the theme , the icon should be obtained from , as an { @ link Integer }
* value */
private void obtainHeaderIcon ( @ StyleRes final int themeResourceId ) { } } | TypedArray typedArray = getContext ( ) . getTheme ( ) . obtainStyledAttributes ( themeResourceId , new int [ ] { R . attr . materialDialogHeaderIcon } ) ; int resourceId = typedArray . getResourceId ( 0 , 0 ) ; if ( resourceId != 0 ) { setHeaderIcon ( resourceId ) ; } |
public class BinaryInputFormat { @ PublicEvolving @ Override public Tuple2 < Long , Long > getCurrentState ( ) throws IOException { } } | if ( this . blockBasedInput == null ) { throw new RuntimeException ( "You must have forgotten to call open() on your input format." ) ; } return new Tuple2 < > ( this . blockBasedInput . getCurrBlockPos ( ) , // the last read index in the block
this . readRecords // the number of records read
) ; |
public class ControlRequestAckImpl { /** * / * ( non - Javadoc )
* @ see com . ibm . ws . sib . mfp . control . ControlRequestAck # getTick ( ) */
public final long [ ] getTick ( ) { } } | List list = ( List ) jmo . getField ( ControlAccess . BODY_REQUESTACK_TICK ) ; long lists [ ] = new long [ list . size ( ) ] ; for ( int i = 0 ; i < lists . length ; i ++ ) lists [ i ] = ( ( Long ) list . get ( i ) ) . longValue ( ) ; return lists ; } /* * Get summary trace line for this message
* Javadoc description supplied by ControlMessage interface . */
public void getTraceSummaryLine ( StringBuilder buff ) { // Get the common fields for control messages
super . getTraceSummaryLine ( buff ) ; buff . append ( "dmeVersion=" ) ; buff . append ( getDMEVersion ( ) ) ; appendArray ( buff , "tick" , getTick ( ) ) ; } /* Set Methods */
/* ( non - Javadoc )
* @ see com . ibm . ws . sib . mfp . control . ControlRequestAck # setDMEVersion ( long ) */
public final void setDMEVersion ( long value ) { jmo . setLongField ( ControlAccess . BODY_REQUESTACK_DMEVERSION , value ) ; } /* ( non - Javadoc )
* @ see com . ibm . ws . sib . mfp . control . ControlRequestAck # setTick ( long [ ] ) */
public final void setTick ( long [ ] values ) { jmo . setField ( ControlAccess . BODY_REQUESTACK_TICK , values ) ; } |
public class RedisCacheSource { /** * - - - - - exists - - - - - */
@ Override public CompletableFuture < Boolean > existsAsync ( String key ) { } } | return ( CompletableFuture ) send ( "EXISTS" , null , ( Type ) null , key , key . getBytes ( UTF8 ) ) ; |
public class RetryUtils { /** * Returns true if the specified exception is a request entity too large error .
* @ param exception The exception to test .
* @ return True if the exception resulted from a request entity too large error message from a service , otherwise false . */
public static boolean isRequestEntityTooLargeException ( SdkBaseException exception ) { } } | return isAse ( exception ) && toAse ( exception ) . getStatusCode ( ) == HttpStatus . SC_REQUEST_TOO_LONG ; |
public class WorkerWebUIBlockInfo { /** * Sets file blocks on tier .
* @ param FileBlocksOnTier the file blocks on tier
* @ return the file blocks on tier */
public WorkerWebUIBlockInfo setFileBlocksOnTier ( List < ImmutablePair < String , List < UIFileBlockInfo > > > FileBlocksOnTier ) { } } | mFileBlocksOnTier = FileBlocksOnTier ; return this ; |
public class DescribeSSLPoliciesResult { /** * Information about the policies .
* @ param sslPolicies
* Information about the policies . */
public void setSslPolicies ( java . util . Collection < SslPolicy > sslPolicies ) { } } | if ( sslPolicies == null ) { this . sslPolicies = null ; return ; } this . sslPolicies = new java . util . ArrayList < SslPolicy > ( sslPolicies ) ; |
public class InternalUtils { /** * Set the given Struts module in the request , and expose its set of MessageResources as request attributes .
* @ param prefix the prefix of the desired module .
* @ param request the current HttpServletRequest .
* @ param servletContext the current ServletContext .
* @ return the selected ModuleConfig , or < code > null < / code > if there is none for the given module prefix . */
public static ModuleConfig selectModule ( String prefix , HttpServletRequest request , ServletContext servletContext ) { } } | ModuleConfig moduleConfig = getModuleConfig ( prefix , servletContext ) ; if ( moduleConfig == null ) { request . removeAttribute ( Globals . MODULE_KEY ) ; return null ; } // If this module came from an abstract page flow controller class , don ' t select it .
ControllerConfig cc = moduleConfig . getControllerConfig ( ) ; if ( cc instanceof PageFlowControllerConfig && ( ( PageFlowControllerConfig ) cc ) . isAbstract ( ) ) { return moduleConfig ; } // Just return it if it ' s already registered .
if ( request . getAttribute ( Globals . MODULE_KEY ) == moduleConfig ) return moduleConfig ; request . setAttribute ( Globals . MODULE_KEY , moduleConfig ) ; MessageResourcesConfig [ ] mrConfig = moduleConfig . findMessageResourcesConfigs ( ) ; Object formBean = unwrapFormBean ( getCurrentActionForm ( request ) ) ; for ( int i = 0 ; i < mrConfig . length ; i ++ ) { String key = mrConfig [ i ] . getKey ( ) ; MessageResources resources = ( MessageResources ) servletContext . getAttribute ( key + prefix ) ; if ( resources != null ) { if ( ! ( resources instanceof ExpressionAwareMessageResources ) ) { resources = new ExpressionAwareMessageResources ( resources , formBean , request , servletContext ) ; } request . setAttribute ( key , resources ) ; } else { request . removeAttribute ( key ) ; } } return moduleConfig ; |
public class CliDirectory { /** * Auto complete the given prefix with child command possibilities .
* @ param prefix Prefix to offer auto complete for .
* @ return Auto complete for the child { @ link CliCommand } s that starts with the given prefix . Case insensitive . */
public AutoComplete autoCompleteCommand ( String prefix ) { } } | final Trie < CliValueType > possibilities = childCommands . subTrie ( prefix ) . mapValues ( CliValueType . COMMAND . < CliCommand > getMapper ( ) ) ; return new AutoComplete ( prefix , possibilities ) ; |
public class DiffCalculator { /** * Initializes the processing of a RevisionTask using a new DiffTask .
* @ param task
* Reference to the DiffTask */
private void init ( final Task < Revision > task ) { } } | this . partCounter ++ ; this . result = new Task < Diff > ( task . getHeader ( ) , partCounter ) ; |
public class GeometryEngine { /** * Exports geometry to the ESRI shape file format .
* See OperatorExportToESRIShape .
* @ param geometry
* The geometry to export . ( null value is not allowed )
* @ return Array containing the exported ESRI shape file . */
public static byte [ ] geometryToEsriShape ( Geometry geometry ) { } } | if ( geometry == null ) throw new IllegalArgumentException ( ) ; OperatorExportToESRIShape op = ( OperatorExportToESRIShape ) factory . getOperator ( Operator . Type . ExportToESRIShape ) ; return op . execute ( 0 , geometry ) . array ( ) ; |
public class AmazonApiGatewayV2Client { /** * Gets a Deployment .
* @ param getDeploymentRequest
* @ return Result of the GetDeployment operation returned by the service .
* @ throws NotFoundException
* The resource specified in the request was not found .
* @ throws TooManyRequestsException
* The client is sending more than the allowed number of requests per unit of time .
* @ sample AmazonApiGatewayV2 . GetDeployment */
@ Override public GetDeploymentResult getDeployment ( GetDeploymentRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeGetDeployment ( request ) ; |
public class ConnectionHandle { /** * Renews this connection , i . e . Sets this connection to be logically open
* ( although it was never really physically closed ) */
protected void renewConnection ( ) { } } | this . logicallyClosed . set ( false ) ; this . threadUsingConnection = Thread . currentThread ( ) ; if ( this . doubleCloseCheck ) { this . doubleCloseException = null ; } |
public class FieldUtil { /** * 获取字段中的Field
* @ param clazz 类
* @ param fieldName 字段名
* @ return 返回字段对象 */
public static Field getField ( Class clazz , String fieldName ) { } } | if ( Map . class . isAssignableFrom ( clazz ) ) { return new Field ( new MapField ( fieldName ) ) ; } java . lang . reflect . Field field = null ; while ( field == null && clazz != null ) { try { field = clazz . getDeclaredField ( fieldName ) ; field . setAccessible ( true ) ; } catch ( Exception e ) { clazz = clazz . getSuperclass ( ) ; } } return new Field ( field ) ; |
public class TypefaceProvider { /** * Returns a reference to the requested typeface , creating a new instance if none already exists
* @ param context the current context
* @ param iconSet the icon typeface
* @ return a reference to the typeface instance */
public static Typeface getTypeface ( Context context , IconSet iconSet ) { } } | String path = iconSet . fontPath ( ) . toString ( ) ; if ( TYPEFACE_MAP . get ( path ) == null ) { final Typeface font = Typeface . createFromAsset ( context . getAssets ( ) , path ) ; TYPEFACE_MAP . put ( path , font ) ; } return TYPEFACE_MAP . get ( path ) ; |
public class ProtoMapper { /** * Convert a ProtoBuf { @ link Value } message into its native Java object
* equivalent .
* See { @ link ProtoMapper # toProto ( Object ) } for the reverse mapping and the
* possible values that can be returned from this method .
* @ param any an instance of a ProtoBuf { @ link Value } message
* @ return a native Java object representing the value */
@ Override public Object fromProto ( Value any ) { } } | switch ( any . getKindCase ( ) ) { case NULL_VALUE : return null ; case BOOL_VALUE : return any . getBoolValue ( ) ; case NUMBER_VALUE : return any . getNumberValue ( ) ; case STRING_VALUE : return any . getStringValue ( ) ; case STRUCT_VALUE : Struct struct = any . getStructValue ( ) ; Map < String , Object > map = new HashMap < > ( ) ; for ( Map . Entry < String , Value > pair : struct . getFieldsMap ( ) . entrySet ( ) ) { map . put ( pair . getKey ( ) , fromProto ( pair . getValue ( ) ) ) ; } return map ; case LIST_VALUE : List < Object > list = new ArrayList < > ( ) ; for ( Value val : any . getListValue ( ) . getValuesList ( ) ) { list . add ( fromProto ( val ) ) ; } return list ; default : throw new ClassCastException ( "unset Value element: " + any ) ; } |
public class HttpRequestMessageImpl { /** * Parse the query parameters out of this message . This will check just the
* URL query data of the request . */
private synchronized void parseParameters ( ) { } } | if ( null != this . queryParams ) { // already parsed
return ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "parseParameters for " + this ) ; } String encoding = getCharset ( ) . name ( ) ; // PQ99481 . . . non - English environments are too complex at the moment due to
// the fact that current clients are not enforcing the proper Content - Type
// header usage therefore figuring out what encoding to use involves system
// properties , WAS config files , etc . So query parameters will only be
// pulled
// from the URI and not POST formdata
// now merge in any possible URL params
String queryString = getQueryString ( ) ; if ( null != queryString ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Parsing URL query data" ) ; } this . queryParams = HttpChannelUtils . parseQueryString ( queryString , encoding ) ; } else { // if we didn ' t have any data then just create an empty table
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { // PQ99481 Tr . debug ( tc , " No parameter data found in body or URL " ) ;
Tr . debug ( tc , "No query data found in URL" ) ; } this . queryParams = new Hashtable < String , String [ ] > ( ) ; } |
public class JaxWsMetaDataManager { /** * This method will be called to retrieve client metadata from the module
* metadata slot for a given WAR module . */
public static JaxWsClientMetaData getJaxWsClientMetaData ( ) { } } | ModuleMetaData mmd = getModuleMetaData ( ) ; // 146981
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "mmd: " + mmd ) ; return getJaxWsClientMetaData ( mmd ) ; |
public class ArgumentTokenBIOAnnotator { /** * Returns a label for the annotated token
* @ param argumentComponent covering argument component
* @ param token token
* @ return BIO label */
protected String getLabel ( ArgumentComponent argumentComponent , Token token ) { } } | StringBuilder sb = new StringBuilder ( argumentComponent . getClass ( ) . getSimpleName ( ) ) ; if ( "BIO" . equals ( this . codingGranularity ) ) { // Does the component begin here ?
if ( argumentComponent . getBegin ( ) == token . getBegin ( ) ) { sb . append ( B_SUFFIX ) ; } else { sb . append ( I_SUFFIX ) ; } } else { sb . append ( I_SUFFIX ) ; } return sb . toString ( ) ; |
public class CmsPathIncludeExcludeSet { /** * Adds an excluded path . < p >
* @ param exclude the path to add */
public void addExclude ( String exclude ) { } } | exclude = normalizePath ( exclude ) ; m_excludes . add ( exclude ) ; m_allPaths . add ( exclude ) ; |
public class DesiredPlayerSessionMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DesiredPlayerSession desiredPlayerSession , ProtocolMarshaller protocolMarshaller ) { } } | if ( desiredPlayerSession == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( desiredPlayerSession . getPlayerId ( ) , PLAYERID_BINDING ) ; protocolMarshaller . marshall ( desiredPlayerSession . getPlayerData ( ) , PLAYERDATA_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class IRequestResponseFactory40Impl { /** * ( non - Javadoc )
* @ see com . ibm . ws . webcontainer . osgi . request . IRequestFactory # createRequest ( com . ibm . wsspi . http . HttpInboundConnection ) */
@ Override public IResponse createResponse ( IRequest ireq , HttpInboundConnection inboundConnection ) { } } | return new IResponse40Impl ( ireq , inboundConnection ) ; |
public class CmsCommentImages { /** * Returns the image resources of the gallery folder which are edited in the dialog form . < p >
* @ return the images of the gallery folder which are edited in the dialog form */
protected List < CmsResource > getImages ( ) { } } | // get all image resources of the folder
int imageId ; try { imageId = OpenCms . getResourceManager ( ) . getResourceType ( CmsResourceTypeImage . getStaticTypeName ( ) ) . getTypeId ( ) ; } catch ( CmsLoaderException e1 ) { // should really never happen
LOG . warn ( e1 . getLocalizedMessage ( ) , e1 ) ; imageId = CmsResourceTypeImage . getStaticTypeId ( ) ; } CmsResourceFilter filter = CmsResourceFilter . IGNORE_EXPIRATION . addRequireType ( imageId ) ; try { return getCms ( ) . readResources ( getParamResource ( ) , filter , false ) ; } catch ( CmsException e ) { // log , should never happen
if ( LOG . isErrorEnabled ( ) ) { LOG . error ( e . getLocalizedMessage ( getLocale ( ) ) ) ; } return Collections . emptyList ( ) ; } |
public class NumberFormat { /** * Returns the pattern for the provided locale and choice .
* @ param forLocale the locale of the data .
* @ param choice the pattern format .
* @ return the pattern */
protected static String getPattern ( ULocale forLocale , int choice ) { } } | /* for ISOCURRENCYSTYLE and PLURALCURRENCYSTYLE ,
* the pattern is the same as the pattern of CURRENCYSTYLE
* but by replacing the single currency sign with
* double currency sign or triple currency sign . */
String patternKey = null ; switch ( choice ) { case NUMBERSTYLE : case INTEGERSTYLE : patternKey = "decimalFormat" ; break ; case CURRENCYSTYLE : String cfKeyValue = forLocale . getKeywordValue ( "cf" ) ; patternKey = ( cfKeyValue != null && cfKeyValue . equals ( "account" ) ) ? "accountingFormat" : "currencyFormat" ; break ; case CASHCURRENCYSTYLE : case ISOCURRENCYSTYLE : case PLURALCURRENCYSTYLE : case STANDARDCURRENCYSTYLE : patternKey = "currencyFormat" ; break ; case PERCENTSTYLE : patternKey = "percentFormat" ; break ; case SCIENTIFICSTYLE : patternKey = "scientificFormat" ; break ; case ACCOUNTINGCURRENCYSTYLE : patternKey = "accountingFormat" ; break ; default : assert false ; patternKey = "decimalFormat" ; break ; } ICUResourceBundle rb = ( ICUResourceBundle ) UResourceBundle . getBundleInstance ( ICUData . ICU_BASE_NAME , forLocale ) ; NumberingSystem ns = NumberingSystem . getInstance ( forLocale ) ; String result = rb . findStringWithFallback ( "NumberElements/" + ns . getName ( ) + "/patterns/" + patternKey ) ; if ( result == null ) { result = rb . getStringWithFallback ( "NumberElements/latn/patterns/" + patternKey ) ; } return result ; |
public class TypeEncoder { /** * Returns the formal type parameters of the given type . If we have { @ code @ AutoValue abstract
* class Foo < T extends SomeClass > } then this method will return an encoding of { @ code < T extends
* SomeClass > } for { @ code Foo } . Likewise it will return an encoding of the angle - bracket part of :
* < br >
* { @ code Foo < SomeClass > } < br >
* { @ code Foo < T extends Number > } < br >
* { @ code Foo < E extends Enum < E > > } < br >
* { @ code Foo < K , V extends Comparable < ? extends K > > } .
* < p > The encoding is simply that classes in the " extends " part are marked , so the examples will
* actually look something like this : < br >
* { @ code < ` bar . baz . SomeClass ` > } < br >
* { @ code < T extends ` java . lang . Number ` > } < br >
* { @ code < E extends ` java . lang . Enum ` < E > > } < br >
* { @ code < K , V extends ` java . lang . Comparable ` < ? extends K > > } . */
static String formalTypeParametersString ( TypeElement type ) { } } | List < ? extends TypeParameterElement > typeParameters = type . getTypeParameters ( ) ; if ( typeParameters . isEmpty ( ) ) { return "" ; } else { StringBuilder sb = new StringBuilder ( "<" ) ; String sep = "" ; for ( TypeParameterElement typeParameter : typeParameters ) { sb . append ( sep ) ; sep = ", " ; appendTypeParameterWithBounds ( typeParameter , sb ) ; } return sb . append ( ">" ) . toString ( ) ; } |
public class Matrix { /** * A = A + B
* @ param B another matrix
* @ return A + B */
public Matrix plusEquals ( Matrix B ) { } } | checkMatrixDimensions ( B ) ; for ( int i = 0 ; i < m ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { A [ i ] [ j ] = A [ i ] [ j ] + B . A [ i ] [ j ] ; } } return this ; |
public class ParserDML { /** * This is a Volt extension to allow
* DELETE FROM tab ORDER BY c LIMIT 1
* Adds a SortAndSlice object to the statement if the next tokens
* are ORDER BY , LIMIT or OFFSET .
* @ param deleteStmt */
private SortAndSlice voltGetSortAndSliceForDelete ( RangeVariable [ ] rangeVariables ) { } } | SortAndSlice sas = XreadOrderByExpression ( ) ; if ( sas == null || sas == SortAndSlice . noSort ) return SortAndSlice . noSort ; // Resolve columns in the ORDER BY clause . This code modified
// from how compileDelete resolves columns in its WHERE clause
for ( int i = 0 ; i < sas . exprList . size ( ) ; ++ i ) { Expression e = ( Expression ) sas . exprList . get ( i ) ; HsqlList unresolved = e . resolveColumnReferences ( RangeVariable . emptyArray , null ) ; unresolved = Expression . resolveColumnSet ( rangeVariables , unresolved , null ) ; ExpressionColumn . checkColumnsResolved ( unresolved ) ; e . resolveTypes ( session , null ) ; } return sas ; |
public class ModelHelper { /** * Converts StreamConfiguration into StreamConfig .
* @ param scope the stream ' s scope
* @ param streamName The Stream Name
* @ param configModel The stream configuration .
* @ return StreamConfig instance . */
public static final StreamConfig decode ( String scope , String streamName , final StreamConfiguration configModel ) { } } | Preconditions . checkNotNull ( configModel , "configModel" ) ; final StreamConfig . Builder builder = StreamConfig . newBuilder ( ) . setStreamInfo ( createStreamInfo ( scope , streamName ) ) . setScalingPolicy ( decode ( configModel . getScalingPolicy ( ) ) ) ; if ( configModel . getRetentionPolicy ( ) != null ) { builder . setRetentionPolicy ( decode ( configModel . getRetentionPolicy ( ) ) ) ; } return builder . build ( ) ; |
public class CmsGalleryService { /** * Reads the users folder filters from the additional info . < p >
* @ return the folder filters */
private JSONObject readUserFolderFilters ( ) { } } | CmsUser user = getCmsObject ( ) . getRequestContext ( ) . getCurrentUser ( ) ; String addInfo = ( String ) user . getAdditionalInfo ( FOLDER_FILTER_ADD_INFO_KEY ) ; JSONObject result = null ; if ( CmsStringUtil . isNotEmptyOrWhitespaceOnly ( addInfo ) ) { try { result = new JSONObject ( addInfo ) ; } catch ( JSONException e ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } } if ( result == null ) { result = new JSONObject ( ) ; } return result ; |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIfcSurfaceStyle ( ) { } } | if ( ifcSurfaceStyleEClass == null ) { ifcSurfaceStyleEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 578 ) ; } return ifcSurfaceStyleEClass ; |
public class TQAssocBean { /** * Eagerly fetch this association with the properties specified . */
public R fetch ( String properties ) { } } | ( ( TQRootBean ) _root ) . query ( ) . fetch ( _name , properties ) ; return _root ; |
public class ST_Isovist { /** * This function compute the visibility polygon
* @ param viewPoint Point instance , isovist location
* @ param lineSegments Occlusion segments . Geometry collection or polygon or linestring
* @ param maxDistance Maximum distance of view from viewPoint ( spatial ref units )
* @ return The visibility polygon
* @ throws SQLException In case of wrong parameters */
public static Geometry isovist ( Geometry viewPoint , Geometry lineSegments , double maxDistance ) throws SQLException { } } | if ( ! ( viewPoint instanceof Point ) || viewPoint . isEmpty ( ) ) { throw new SQLException ( "First parameter of ST_Isovist must be a Point" ) ; } if ( maxDistance <= 0 ) { throw new SQLException ( "Third parameter of ST_Isovist must be a valid distance superior than 0" ) ; } VisibilityAlgorithm visibilityAlgorithm = new VisibilityAlgorithm ( maxDistance ) ; visibilityAlgorithm . addGeometry ( lineSegments ) ; return visibilityAlgorithm . getIsoVist ( viewPoint . getCoordinate ( ) , true ) ; |
public class TransformingIteratorWrapper { /** * / * ( non - Javadoc )
* @ see org . archive . util . iterator . LookaheadIterator # lookahead ( ) */
protected boolean lookahead ( ) { } } | assert next == null : "looking ahead when next is already loaded" ; while ( inner . hasNext ( ) ) { next = transform ( inner . next ( ) ) ; if ( next != null ) { return true ; } } noteExhausted ( ) ; return false ; |
public class Branch { /** * < p > Initialises a session with the Branch API . < / p >
* @ param callback A { @ link BranchReferralInitListener } instance that will be called
* following successful ( or unsuccessful ) initialisation of the session
* with the Branch API .
* @ param isReferrable A { @ link Boolean } value indicating whether this initialisation
* session should be considered as potentially referrable or not .
* By default , a user is only referrable if initSession results in a
* fresh install . Overriding this gives you control of who is referrable .
* @ param activity The calling { @ link Activity } for context .
* @ return A { @ link Boolean } value that returns < i > false < / i > if unsuccessful . */
public boolean initSession ( BranchReferralInitListener callback , boolean isReferrable , Activity activity ) { } } | initUserSessionInternal ( callback , activity , isReferrable ) ; return true ; |
public class BasicRandomRoutingTable { /** * Determine the next hop for a message .
* @ param message the message to determine the next hop for
* @ return the next TrustGraphNodeId to send the message to or null if
* the next hop cannot be determined .
* @ see RandomRoutingTable . getNextHop ( TrustGraphAdvertisement ) */
@ Override public TrustGraphNodeId getNextHop ( final TrustGraphAdvertisement message ) { } } | final TrustGraphNodeId prev = message . getSender ( ) ; return getNextHop ( prev ) ; |
public class DefaultEurekaClientConfig { /** * ( non - Javadoc )
* @ see com . netflix . discovery . EurekaClientConfig # getDSServerURLContext ( ) */
@ Override public String getEurekaServerURLContext ( ) { } } | return configInstance . getStringProperty ( namespace + EUREKA_SERVER_URL_CONTEXT_KEY , configInstance . getStringProperty ( namespace + EUREKA_SERVER_FALLBACK_URL_CONTEXT_KEY , null ) . get ( ) ) . get ( ) ; |
public class AdjacencyMap { /** * This method removes all keys that match the given value */
private boolean removeMatchingKeys ( NavigableMap < Endpoint , Integer > map , Endpoint endpoint , Map < UUID , TreeMap < Endpoint , Integer > > otherMap , Direction dir ) { } } | if ( map == null ) { return false ; } // Mark this endpoint as a marker , because it is used to do a tailMap traversal to remove matching edges
endpoint . setMarker ( ) ; // Find the first key
Endpoint floorKey = map . floorKey ( endpoint ) ; Map < Endpoint , Integer > view ; if ( floorKey == null ) { // This means that the element being searched is the minimum
view = map ; } else { view = map . tailMap ( floorKey ) ; } Iterator < Map . Entry < Endpoint , Integer > > entryIter = view . entrySet ( ) . iterator ( ) ; boolean isFirst = true ; while ( entryIter . hasNext ( ) ) { Map . Entry < Endpoint , Integer > entry = entryIter . next ( ) ; Endpoint key = entry . getKey ( ) ; if ( endpoint . isMatch ( key ) ) { // Remove it from this index
entryIter . remove ( ) ; // and from the underlying edge map if necessary
if ( dir != null ) { // Direction is null if this is a recursive all
// Remove the edge if the map is provided for this purpose
UUID edgeId = key . getEdgeId ( ) ; IEdge edge = edgeRemover . removeEdge ( edgeId ) ; assert ( edge != null ) ; // Remove the other endpoint of this edge . NOTE : Self loops are not allowed .
Endpoint otherEndpoint ; UUID otherVertexId ; if ( dir == Direction . OUT ) { otherVertexId = edge . getInVertexId ( ) ; otherEndpoint = new Endpoint ( key . getEdgeLabel ( ) , key . getEdgeId ( ) ) ; } else { otherVertexId = edge . getOutVertexId ( ) ; otherEndpoint = new Endpoint ( key . getEdgeLabel ( ) , key . getEdgeId ( ) ) ; } if ( removeMatchingKeys ( otherMap . get ( otherVertexId ) , otherEndpoint , null , null ) ) { otherMap . remove ( otherVertexId ) ; } } } else { // Done with removes - - the tree map is sorted
if ( isFirst ) { // continue
} else { break ; } } isFirst = false ; } return ( map . size ( ) == 0 ) ; |
public class EtcdClient { /** * { @ inheritDoc }
* @ see InitializingBean # afterPropertiesSet ( ) */
@ Override public void afterPropertiesSet ( ) throws Exception { } } | if ( this . requestFactory == null ) { SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory ( ) ; requestFactory . setConnectTimeout ( 1000 ) ; requestFactory . setReadTimeout ( 3000 ) ; this . requestFactory = requestFactory ; } template = new RestTemplate ( this . requestFactory ) ; template . setMessageConverters ( Arrays . asList ( requestConverter , responseConverter ) ) ; if ( locationUpdaterEnabled ) { Runnable worker = new Runnable ( ) { @ Override public void run ( ) { updateMembers ( ) ; } } ; locationUpdater . scheduleAtFixedRate ( worker , 5000 , 5000 , TimeUnit . MILLISECONDS ) ; } |
public class ExecutorServiceImpl { /** * ( non - Javadoc )
* @ see com . ibm . ws . threading . ThreadQuiesce # quiesceThreads ( ) */
@ Override @ FFDCIgnore ( TimeoutException . class ) public boolean quiesceThreads ( ) { } } | this . serverStopping = true ; try { // Wait 30 seconds for all pre - quiesce work to complete
phaser . arriveAndDeregister ( ) ; phaser . awaitAdvanceInterruptibly ( 0 , 30 , TimeUnit . SECONDS ) ; } catch ( InterruptedException e ) { // FFDC and fail quiesce notification
return false ; } catch ( TimeoutException e ) { // If we time out , quiesce has failed . This is normal , so no FFDC .
return false ; } return true ; |
public class BackendManager { /** * Log at debug level
* @ param msg message to log */
public void debug ( String msg ) { } } | logHandler . debug ( msg ) ; if ( debugStore != null ) { debugStore . log ( msg ) ; } |
public class ApiOvhHostingweb { /** * Configuration used on your hosting
* REST : GET / hosting / web / { serviceName } / ovhConfig
* @ param path [ required ] Filter the value of path property ( like )
* @ param historical [ required ] Filter the value of historical property ( = )
* @ param serviceName [ required ] The internal name of your hosting */
public ArrayList < Long > serviceName_ovhConfig_GET ( String serviceName , Boolean historical , String path ) throws IOException { } } | String qPath = "/hosting/web/{serviceName}/ovhConfig" ; StringBuilder sb = path ( qPath , serviceName ) ; query ( sb , "historical" , historical ) ; query ( sb , "path" , path ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t3 ) ; |
public class ZipUtil { /** * Extracts the directory entry to the location specified by { @ code dir }
* @ param entry
* the { @ link ZipEntry } object for the directory being extracted
* @ param dir
* the { @ link File } object for the target directory
* @ throws IOException */
private static void extractDirectory ( ZipEntry entry , File dir ) throws IOException { } } | final String sourceMethod = "extractFile" ; // $ NON - NLS - 1 $
final boolean isTraceLogging = log . isLoggable ( Level . FINER ) ; if ( isTraceLogging ) { log . entering ( sourceClass , sourceMethod , new Object [ ] { entry , dir } ) ; } dir . mkdir ( ) ; // May fail if the directory has already been created
if ( ! dir . setLastModified ( entry . getTime ( ) ) ) { throw new IOException ( "Failed to set last modified time for " + dir . getAbsolutePath ( ) ) ; // $ NON - NLS - 1 $
} if ( isTraceLogging ) { log . exiting ( sourceClass , sourceMethod ) ; } |
public class XmlIOUtil { /** * Serializes the { @ code messages } into the { @ link OutputStream } using the given schema . */
public static < T > void writeListTo ( OutputStream out , List < T > messages , Schema < T > schema ) throws IOException { } } | writeListTo ( out , messages , schema , DEFAULT_OUTPUT_FACTORY ) ; |
public class MathRandom { /** * Returns a random integer number in the range of [ min , max ] .
* @ param min
* minimum value for generated number
* @ param max
* maximum value for generated number */
public long getLong ( final long min , final long max ) { } } | return min ( min , max ) + getLong ( abs ( max - min ) ) ; |
public class WSEJBProxy { /** * Adds a standard EJB Proxy Method . < p >
* The method added just calls the EJB instance method directly . < p >
* @ param cw ASM Class writer to add the method to .
* @ param className name of the proxy class being generated .
* @ param implClassName name of the EJB implementation class .
* @ param method reflection method from the interface defining
* method to be added to the proxy . */
private static void addEJBMethod ( ClassWriter cw , String className , String implClassName , Method method ) { } } | GeneratorAdapter mg ; String methodName = method . getName ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , INDENT + "adding method : " + methodName + " " + MethodAttribUtils . jdiMethodSignature ( method ) + " : isBridge = " + method . isBridge ( ) + " : aroundInvoke = false" ) ; // Convert the return value , arguments , and exception classes to
// ASM Type objects , and create the ASM Method object which will
// be used to actually add the method and method code .
Type returnType = Type . getType ( method . getReturnType ( ) ) ; Type [ ] argTypes = getTypes ( method . getParameterTypes ( ) ) ; Type [ ] exceptionTypes = getTypes ( method . getExceptionTypes ( ) ) ; org . objectweb . asm . commons . Method m = new org . objectweb . asm . commons . Method ( methodName , returnType , argTypes ) ; // Create an ASM GeneratorAdapter object for the ASM Method , which
// makes generating dynamic code much easier . . . as it keeps track
// of the position of the arguements and local variables , etc .
mg = new GeneratorAdapter ( ACC_PUBLIC , m , null , exceptionTypes , cw ) ; // Begin Method Code . . .
mg . visitCode ( ) ; // Now invoke the business method ;
// - Directly , by calling the method on the bean instance .
// ( ( bean impl ) ivEjbInstance ) . < method > ( < args . . . > ) ;
// or
// return ( ( bean impl ) ivEjbInstance ) . < method > ( < args . . . > ) ;
Type implType = Type . getType ( "L" + implClassName + ";" ) ; mg . loadThis ( ) ; mg . visitFieldInsn ( GETFIELD , className , "ivEjbInstance" , "Ljava/lang/Object;" ) ; mg . checkCast ( implType ) ; mg . loadArgs ( 0 , argTypes . length ) ; // do not pass " this "
mg . visitMethodInsn ( INVOKEVIRTUAL , implClassName , methodName , m . getDescriptor ( ) ) ; // return
mg . returnValue ( ) ; // End Method Code . . .
mg . endMethod ( ) ; // GeneratorAdapter accounts for visitMaxs ( x , y )
mg . visitEnd ( ) ; |
public class ObjectOffsetImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eSet ( int featureID , Object newValue ) { } } | switch ( featureID ) { case AfplibPackage . OBJECT_OFFSET__OBJ_TPE : setObjTpe ( ( Integer ) newValue ) ; return ; case AfplibPackage . OBJECT_OFFSET__OBJ_OSET : setObjOset ( ( Integer ) newValue ) ; return ; case AfplibPackage . OBJECT_OFFSET__OBJ_OST_HI : setObjOstHi ( ( Integer ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ; |
public class RandomGenerator { /** * Generates random string that contains chars ( a - z , A - Z ) and some symbols ( _ , - , # , = ) .
* @ param lenght the length of the generated string
* @ return random string */
public static String generateCharsSymbolsString ( int lenght ) { } } | StringBuffer buf = new StringBuffer ( lenght ) ; SecureRandom rand = new SecureRandom ( ) ; for ( int i = 0 ; i < lenght ; i ++ ) { buf . append ( charsSymbols [ rand . nextInt ( charsSymbols . length ) ] ) ; } return buf . toString ( ) ; |
public class EndpointToken { /** * Creates an EndpointToken for the domain / endpoint
* @ param client the bandwidth client .
* @ param domainId the domain id .
* @ param endpointId the endpoint id .
* @ return the created token .
* @ throws AppPlatformException API Exception
* @ throws ParseException Error parsing data
* @ throws IOException error */
public static EndpointToken create ( final BandwidthClient client , final String domainId , final String endpointId ) throws AppPlatformException , ParseException , IOException { } } | assert ( client != null && domainId != null && endpointId != null ) ; return createToken ( client , domainId , endpointId , null ) ; |
public class SpnegoAuthScheme { /** * Implementation method that returns the text to send via the Authenticate header on the next request . */
private String authenticate ( Credentials credentials , URI requestURI ) throws AuthenticationException { } } | if ( ! ( credentials instanceof SpnegoCredentials ) ) { throw new AuthenticationException ( "Invalid credentials type provided to " + this . getClass ( ) . getName ( ) + "." + "Expected " + SpnegoCredentials . class . getName ( ) + " but got " + credentials . getClass ( ) . getName ( ) ) ; } final SpnegoCredentials spnegoCredentials = ( SpnegoCredentials ) credentials ; try { initializeNegotiator ( requestURI , spnegoCredentials ) ; return getNegotiateToken ( ) ; } catch ( GSSException e ) { throw new AuthenticationException ( "Could not authenticate" , e ) ; } catch ( UnknownHostException e ) { throw new AuthenticationException ( "Could not authenticate" , e ) ; } |
public class DbcHelper { /** * Get the { @ link DataSource } that hosts the specified { @ link Connection } .
* @ param conn
* @ return
* @ since 0.8.2 */
public static DataSource getDataSource ( Connection conn ) { } } | if ( conn == null ) { return null ; } String dsName = openConnDsName . get ( ) . get ( conn ) ; return getJdbcDataSource ( dsName ) ; |
public class FYShuffle { /** * Randomly shuffle an long array
* @ param longArray array of long to shuffle . */
public static void shuffle ( long [ ] longArray ) { } } | int swapPlace = - 1 ; for ( int i = 0 ; i < longArray . length ; i ++ ) { swapPlace = ( int ) ( Math . random ( ) * ( longArray . length - 1 ) ) ; XORSwap . swap ( longArray , i , swapPlace ) ; } |
public class ModbusSlave { /** * Closes the listener of this slave */
@ SuppressWarnings ( "deprecation" ) void closeListener ( ) { } } | if ( listener != null && listener . isListening ( ) ) { listener . stop ( ) ; // Wait until the listener says it has stopped , but don ' t wait forever
int count = 0 ; while ( listenerThread != null && listenerThread . isAlive ( ) && count < 50 ) { ModbusUtil . sleep ( 100 ) ; count ++ ; } // If the listener is still not stopped , kill the thread
if ( listenerThread != null && listenerThread . isAlive ( ) ) { listenerThread . stop ( ) ; } listenerThread = null ; } isRunning = false ; |
public class BackgroundImagePanel { /** * set the current Background image
* @ param imageUrl the url of the image that need to be set */
public final void setBackgroundImage ( URL imageUrl ) { } } | if ( imageUrl != null ) { try { img = ImageIO . read ( imageUrl ) ; } catch ( IOException ioe ) { // do nothing
} } |
public class Monitor { /** * Waits for the guard to be satisfied . Waits at most the given time , and may be interrupted . May
* be called only by a thread currently occupying this monitor .
* @ return whether the guard is now satisfied
* @ throws InterruptedException if interrupted while waiting */
public boolean waitFor ( Guard guard , long time , TimeUnit unit ) throws InterruptedException { } } | final long timeoutNanos = toSafeNanos ( time , unit ) ; if ( ! ( ( guard . monitor == this ) & lock . isHeldByCurrentThread ( ) ) ) { throw new IllegalMonitorStateException ( ) ; } if ( guard . isSatisfied ( ) ) { return true ; } if ( Thread . interrupted ( ) ) { throw new InterruptedException ( ) ; } return awaitNanos ( guard , timeoutNanos , true ) ; |
public class DisplaySingle { /** * Sets the visibility of the sections .
* The sections could be defined by a start value , a stop value
* and a color . One has to create a Section object from the
* class Section .
* The sections are stored in a ArrayList so there could be
* multiple . This might be a useful feature if you need to have
* exactly defined areas that you could not visualize with the
* track feature .
* @ param SECTIONS _ VISIBLE */
public void setSectionsVisible ( final boolean SECTIONS_VISIBLE ) { } } | sectionsVisible = SECTIONS_VISIBLE ; init ( getInnerBounds ( ) . width , getInnerBounds ( ) . height ) ; repaint ( getInnerBounds ( ) ) ; |
public class AcceleratorAttributesMarshaller { /** * Marshall the given parameter object . */
public void marshall ( AcceleratorAttributes acceleratorAttributes , ProtocolMarshaller protocolMarshaller ) { } } | if ( acceleratorAttributes == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( acceleratorAttributes . getFlowLogsEnabled ( ) , FLOWLOGSENABLED_BINDING ) ; protocolMarshaller . marshall ( acceleratorAttributes . getFlowLogsS3Bucket ( ) , FLOWLOGSS3BUCKET_BINDING ) ; protocolMarshaller . marshall ( acceleratorAttributes . getFlowLogsS3Prefix ( ) , FLOWLOGSS3PREFIX_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class Util { /** * Creates an { @ link IOException } with < code > t < / code > as its cause .
* @ param t the cause . */
public static IOException createIOException ( Throwable t ) { } } | IOException ex = new IOException ( t . getMessage ( ) ) ; ex . initCause ( t ) ; return ex ; |
public class NoraUiInjectorSource { /** * { @ inheritDoc } */
@ Override public Injector getInjector ( ) { } } | Injector injector = Guice . createInjector ( Stage . PRODUCTION , CucumberModules . SCENARIO , new SpeedRegulatorModule ( ) , new TimeModule ( ) , new NoraUiModule ( ) ) ; try { NoraUiInjector . createInjector ( injector ) ; } catch ( TechnicalException e ) { logger . error ( "error NoraUiInjectorSource.getInjector()" , e ) ; } return injector ; |
public class SharedTreeModel { /** * Performs deep clone of given model . */
protected M deepClone ( Key < M > result ) { } } | M newModel = IcedUtils . deepCopy ( self ( ) ) ; newModel . _key = result ; // Do not clone model metrics
newModel . _output . clearModelMetrics ( ) ; newModel . _output . _training_metrics = null ; newModel . _output . _validation_metrics = null ; // Clone trees
Key [ ] [ ] treeKeys = newModel . _output . _treeKeys ; for ( int i = 0 ; i < treeKeys . length ; i ++ ) { for ( int j = 0 ; j < treeKeys [ i ] . length ; j ++ ) { if ( treeKeys [ i ] [ j ] == null ) continue ; CompressedTree ct = DKV . get ( treeKeys [ i ] [ j ] ) . get ( ) ; CompressedTree newCt = IcedUtils . deepCopy ( ct ) ; newCt . _key = CompressedTree . makeTreeKey ( i , j ) ; DKV . put ( treeKeys [ i ] [ j ] = newCt . _key , newCt ) ; } } // Clone Aux info
Key [ ] [ ] treeKeysAux = newModel . _output . _treeKeysAux ; if ( treeKeysAux != null ) { for ( int i = 0 ; i < treeKeysAux . length ; i ++ ) { for ( int j = 0 ; j < treeKeysAux [ i ] . length ; j ++ ) { if ( treeKeysAux [ i ] [ j ] == null ) continue ; CompressedTree ct = DKV . get ( treeKeysAux [ i ] [ j ] ) . get ( ) ; CompressedTree newCt = IcedUtils . deepCopy ( ct ) ; newCt . _key = Key . make ( createAuxKey ( treeKeys [ i ] [ j ] . toString ( ) ) ) ; DKV . put ( treeKeysAux [ i ] [ j ] = newCt . _key , newCt ) ; } } } return newModel ; |
public class HttpRequestHandler { /** * Check whether the given host and / or address is allowed to access this agent .
* @ param pHost host to check
* @ param pAddress address to check
* @ param pOrigin ( optional ) origin header to check also . */
public void checkAccess ( String pHost , String pAddress , String pOrigin ) { } } | if ( ! backendManager . isRemoteAccessAllowed ( pHost , pAddress ) ) { throw new SecurityException ( "No access from client " + pAddress + " allowed" ) ; } if ( ! backendManager . isOriginAllowed ( pOrigin , true ) ) { throw new SecurityException ( "Origin " + pOrigin + " is not allowed to call this agent" ) ; } |
public class HttpJsonSerializer { /** * Parses one or more data points for storage
* @ return an array of data points to process for storage
* @ throws JSONException if parsing failed
* @ throws BadRequestException if the content was missing or parsing failed */
@ Override public List < IncomingDataPoint > parsePutV1 ( ) { } } | if ( ! query . hasContent ( ) ) { throw new BadRequestException ( "Missing request content" ) ; } // convert to a string so we can handle character encoding properly
final String content = query . getContent ( ) . trim ( ) ; final int firstbyte = content . charAt ( 0 ) ; try { if ( firstbyte == '{' ) { final IncomingDataPoint dp = JSON . parseToObject ( content , IncomingDataPoint . class ) ; final ArrayList < IncomingDataPoint > dps = new ArrayList < IncomingDataPoint > ( 1 ) ; dps . add ( dp ) ; return dps ; } else { return JSON . parseToObject ( content , TR_INCOMING ) ; } } catch ( IllegalArgumentException iae ) { throw new BadRequestException ( "Unable to parse the given JSON" , iae ) ; } |
public class ConfiguredEqualsVerifier { /** * Factory method . For general use .
* @ param < T > The type .
* @ param type The class for which the { @ code equals } method should be
* tested .
* @ return A fluent API for EqualsVerifier . */
public < T > EqualsVerifierApi < T > forClass ( Class < T > type ) { } } | return new EqualsVerifierApi < > ( type , EnumSet . copyOf ( warningsToSuppress ) , factoryCache , usingGetClass ) ; |
public class Expressions { /** * Parses an expression into a tree
* @ param expression The expression to parse ( as a string )
* @ param metric _ queries A list to store the parsed metrics in
* @ param data _ query The time series query
* @ return The parsed tree ready for evaluation
* @ throws IllegalArgumentException if the expression was null , empty or
* invalid .
* @ throws UnsupportedOperationException if the requested function couldn ' t
* be found . */
public static ExpressionTree parse ( final String expression , final List < String > metric_queries , final TSQuery data_query ) { } } | if ( expression == null || expression . isEmpty ( ) ) { throw new IllegalArgumentException ( "Expression may not be null or empty" ) ; } if ( expression . indexOf ( '(' ) == - 1 || expression . indexOf ( ')' ) == - 1 ) { throw new IllegalArgumentException ( "Invalid Expression: " + expression ) ; } final ExpressionReader reader = new ExpressionReader ( expression . toCharArray ( ) ) ; // consume any whitespace ahead of the expression
reader . skipWhitespaces ( ) ; final String function_name = reader . readFuncName ( ) ; final Expression root_expression = ExpressionFactory . getByName ( function_name ) ; final ExpressionTree root = new ExpressionTree ( root_expression , data_query ) ; reader . skipWhitespaces ( ) ; if ( reader . peek ( ) == '(' ) { reader . next ( ) ; parse ( reader , metric_queries , root , data_query ) ; } return root ; |
public class MemoryHeap { /** * Takes some bytes from heap
* @ param bytes
* @ throws ScriptLimitException */
public synchronized void take ( long bytes ) throws ScriptLimitException { } } | if ( limit > 0 ) { memory -= bytes ; if ( memory < 0 ) throw new ScriptLimitException ( ScriptLimitException . Limits . MEMORY , limit ) ; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.