signature
stringlengths 43
39.1k
| implementation
stringlengths 0
450k
|
|---|---|
public class AESUtils { /** * AES key should be 16 bytes in length .
* @ param key
* @ return */
public static byte [ ] normalizeKey ( byte [ ] keyData ) { } }
|
if ( keyData == null ) { return RSG . generate ( 16 ) . getBytes ( StandardCharsets . UTF_8 ) ; } else { return normalizeKey ( new String ( keyData , StandardCharsets . UTF_8 ) ) . getBytes ( StandardCharsets . UTF_8 ) ; }
|
public class NagiosWriter { /** * The meat of the output . Nagios format . . */
@ Override public void internalWrite ( Server server , Query query , ImmutableList < Result > results ) throws Exception { } }
|
checkFile ( query ) ; List < String > typeNames = getTypeNames ( ) ; for ( Result result : results ) { String [ ] keyString = KeyUtils . getKeyString ( server , query , result , typeNames , null ) . split ( "\\." ) ; if ( isNumeric ( result . getValue ( ) ) && filters . contains ( keyString [ 2 ] ) ) { int thresholdPos = filters . indexOf ( keyString [ 2 ] ) ; StringBuilder sb = new StringBuilder ( ) ; sb . append ( "[" ) ; sb . append ( result . getEpoch ( ) ) ; sb . append ( "] PROCESS_SERVICE_CHECK_RESULT;" ) ; sb . append ( nagiosHost ) ; sb . append ( ";" ) ; if ( prefix != null ) { sb . append ( prefix ) ; } sb . append ( keyString [ 2 ] ) ; if ( suffix != null ) { sb . append ( suffix ) ; } sb . append ( ";" ) ; sb . append ( nagiosCheckValue ( result . getValue ( ) . toString ( ) , thresholds . get ( thresholdPos ) ) ) ; sb . append ( ";" ) ; // Missing the performance information
logger . info ( sb . toString ( ) ) ; } }
|
public class CreateCreativesFromTemplates { /** * Runs the example .
* @ param adManagerServices the services factory .
* @ param session the session .
* @ param advertiserId the ID of the advertiser ( company ) that all creatives will be assigned to .
* @ throws ApiException if the API request failed with one or more service errors .
* @ throws RemoteException if the API request failed due to other errors .
* @ throws IOException if unable to get media data from the URL . */
public static void runExample ( AdManagerServices adManagerServices , AdManagerSession session , long advertiserId ) throws IOException { } }
|
// Get the CreativeService .
CreativeServiceInterface creativeService = adManagerServices . get ( session , CreativeServiceInterface . class ) ; // Create creative size .
Size size = new Size ( ) ; size . setWidth ( 600 ) ; size . setHeight ( 315 ) ; size . setIsAspectRatio ( false ) ; // Use the image banner with optional third party tracking template .
// To determine what other creative templates exist ,
// run GetAllCreativeTemplates . java .
long creativeTemplateId = 10000680L ; // Create a template creative .
TemplateCreative templateCreative = new TemplateCreative ( ) ; templateCreative . setName ( "Template creative #" + new Random ( ) . nextInt ( Integer . MAX_VALUE ) ) ; templateCreative . setAdvertiserId ( advertiserId ) ; templateCreative . setCreativeTemplateId ( creativeTemplateId ) ; templateCreative . setSize ( size ) ; // Create the asset variable value .
AssetCreativeTemplateVariableValue assetVariableValue = new AssetCreativeTemplateVariableValue ( ) ; assetVariableValue . setUniqueName ( "Imagefile" ) ; CreativeAsset asset = new CreativeAsset ( ) ; asset . setAssetByteArray ( Media . getMediaDataFromUrl ( "https://goo.gl/3b9Wfh" ) ) ; // Filenames must be unique .
asset . setFileName ( String . format ( "image%s.jpg" , new Random ( ) . nextInt ( Integer . MAX_VALUE ) ) ) ; assetVariableValue . setAsset ( asset ) ; // Create the image width variable value .
LongCreativeTemplateVariableValue imageWidthVariableValue = new LongCreativeTemplateVariableValue ( ) ; imageWidthVariableValue . setUniqueName ( "Imagewidth" ) ; imageWidthVariableValue . setValue ( 300L ) ; // Create the image height variable value .
LongCreativeTemplateVariableValue imageHeightVariableValue = new LongCreativeTemplateVariableValue ( ) ; imageHeightVariableValue . setUniqueName ( "Imageheight" ) ; imageHeightVariableValue . setValue ( 250L ) ; // Create the URL variable value .
UrlCreativeTemplateVariableValue urlVariableValue = new UrlCreativeTemplateVariableValue ( ) ; urlVariableValue . setUniqueName ( "ClickthroughURL" ) ; urlVariableValue . setValue ( "www.google.com" ) ; // Create the target window variable value .
StringCreativeTemplateVariableValue targetWindowVariableValue = new StringCreativeTemplateVariableValue ( ) ; targetWindowVariableValue . setUniqueName ( "Targetwindow" ) ; targetWindowVariableValue . setValue ( "__blank" ) ; // Set the creative template variables .
templateCreative . setCreativeTemplateVariableValues ( new BaseCreativeTemplateVariableValue [ ] { assetVariableValue , imageWidthVariableValue , imageHeightVariableValue , urlVariableValue , targetWindowVariableValue } ) ; // Create the creative on the server .
Creative [ ] creatives = creativeService . createCreatives ( new Creative [ ] { templateCreative } ) ; for ( Creative createdCreative : creatives ) { System . out . printf ( "A creative with ID %d, name '%s', and type '%s'" + " was created and can be previewed at: %s%n" , createdCreative . getId ( ) , createdCreative . getName ( ) , createdCreative . getClass ( ) . getSimpleName ( ) , createdCreative . getPreviewUrl ( ) ) ; }
|
public class Logger { /** * adding a new anonymous Logger object is handled by doSetParent ( ) . */
@ CallerSensitive public static Logger getAnonymousLogger ( String resourceBundleName ) { } }
|
LogManager manager = LogManager . getLogManager ( ) ; // cleanup some Loggers that have been GC ' ed
manager . drainLoggerRefQueueBounded ( ) ; // Android - changed : Use VMStack . getStackClass1.
/* J2ObjC modified .
Logger result = new Logger ( null , resourceBundleName ,
VMStack . getStackClass1 ( ) ) ; */
Logger result = new Logger ( null , resourceBundleName , null ) ; result . anonymous = true ; Logger root = manager . getLogger ( "" ) ; result . doSetParent ( root ) ; return result ;
|
public class WSCredentialProvider { /** * Checks if the subject is valid . Currently , a subject is REQUIRED to have
* a WSCredential , and it is only valid if the WSCredential is not expired .
* @ param subject The subject to validate , { @ code null } is not supported .
* @ return < code > true < / code > if the subject is valid . */
@ Override @ FFDCIgnore ( { } }
|
CredentialDestroyedException . class , CredentialExpiredException . class } ) public boolean isSubjectValid ( Subject subject ) { boolean valid = false ; try { WSCredential wsCredential = getWSCredential ( subject ) ; if ( wsCredential != null ) { long credentialExpirationInMillis = wsCredential . getExpiration ( ) ; Date currentTime = new Date ( ) ; Date expirationTime = new Date ( credentialExpirationInMillis ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Current time = " + currentTime + ", expiration time = " + expirationTime ) ; } if ( credentialExpirationInMillis == 0 || credentialExpirationInMillis == - 1 || currentTime . before ( expirationTime ) ) { valid = true ; } } } catch ( CredentialDestroyedException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "CredentialDestroyedException while determining the validity of the subject." , e ) ; } } catch ( CredentialExpiredException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "CredentialExpiredException while determining the validity of the subject." , e ) ; } } return valid ;
|
public class JTablePanel { /** * Set the model used by the left table .
* @ param model table model */
public void setLeftTableModel ( TableModel model ) { } }
|
TableModel old = m_leftTable . getModel ( ) ; m_leftTable . setModel ( model ) ; firePropertyChange ( "leftTableModel" , old , model ) ;
|
public class CalendarModifiedPrecedingHandler { /** * If the current date of the give calculator is a non - working day , it will
* be moved according to the algorithm implemented .
* @ param calculator
* the calculator
* @ return the date which may have moved . */
@ Override public Calendar moveCurrentDate ( final BaseCalculator < Calendar > calculator ) { } }
|
return adjustDate ( calculator . getCurrentBusinessDate ( ) , - 1 , calculator ) ;
|
public class FLACDecoder { /** * Read the next data frame .
* @ return The next frame
* @ throws IOException on read error */
public Frame readNextFrame ( ) throws IOException { } }
|
// boolean got _ a _ frame ;
try { while ( true ) { // switch ( state ) {
// case STREAM _ DECODER _ SEARCH _ FOR _ METADATA :
// findMetadata ( ) ;
// break ;
// case STREAM _ DECODER _ READ _ METADATA :
// readMetadata ( ) ; / * above function sets the status for us * /
// break ;
// case DECODER _ SEARCH _ FOR _ FRAME _ SYNC :
findFrameSync ( ) ; /* above function sets the status for us */
// System . exit ( 0 ) ;
// break ;
// case DECODER _ READ _ FRAME :
try { readFrame ( ) ; return frame ; } catch ( FrameDecodeException e ) { badFrames ++ ; } // break ;
// case DECODER _ END _ OF _ STREAM :
// case DECODER _ ABORTED :
// return null ;
// default :
// return null ;
} } catch ( EOFException e ) { eof = true ; } return null ;
|
public class CommonOps_DDF3 { /** * Sets every element in the vector to the specified value . < br >
* < br >
* a < sub > i < / sub > = value
* @ param a A vector whose elements are about to be set . Modified .
* @ param v The value each element will have . */
public static void fill ( DMatrix3 a , double v ) { } }
|
a . a1 = v ; a . a2 = v ; a . a3 = v ;
|
public class DialogPreference { /** * Obtains the title color of the dialog , which is shown by the preference , from a specific
* typed array .
* @ param typedArray
* The typed array , the title color should be obtained from , as an instance of the class
* { @ link TypedArray } . The typed array may not be null */
private void obtainDialogTitleColor ( @ NonNull final TypedArray typedArray ) { } }
|
setDialogTitleColor ( typedArray . getColor ( R . styleable . DialogPreference_dialogTitleColor , - 1 ) ) ;
|
public class WebFragmentDescriptorImpl { /** * If not already created , a new < code > security - role < / code > element will be created and returned .
* Otherwise , the first existing < code > security - role < / code > element will be returned .
* @ return the instance defined for the element < code > security - role < / code > */
public SecurityRoleType < WebFragmentDescriptor > getOrCreateSecurityRole ( ) { } }
|
List < Node > nodeList = model . get ( "security-role" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new SecurityRoleTypeImpl < WebFragmentDescriptor > ( this , "security-role" , model , nodeList . get ( 0 ) ) ; } return createSecurityRole ( ) ;
|
public class AssociateCertificateRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( AssociateCertificateRequest associateCertificateRequest , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( associateCertificateRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( associateCertificateRequest . getArn ( ) , ARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class UrlValidator { /** * Returns true if the query is null or it ' s a properly formatted query string .
* @ param query Query value to validate .
* @ return true if query is valid . */
protected boolean isValidQuery ( String query ) { } }
|
if ( query == null ) { return true ; } return QUERY_PATTERN . matcher ( query ) . matches ( ) ;
|
public class RepositoryCreationServiceImpl { /** * { @ inheritDoc } */
public String reserveRepositoryName ( String repositoryName ) throws RepositoryCreationException { } }
|
if ( rpcService != null ) { // reserve RepositoryName at coordinator - node
try { Object result = rpcService . executeCommandOnCoordinator ( reserveRepositoryName , true , repositoryName ) ; if ( result instanceof String ) { return ( String ) result ; } else if ( result instanceof Throwable ) { throw new RepositoryCreationException ( "Can't reserve repository " + repositoryName , ( Throwable ) result ) ; } else { throw new RepositoryCreationException ( "ReserveRepositoryName command returns unknown type result." ) ; } } catch ( RPCException e ) { Throwable cause = ( e ) . getCause ( ) ; if ( cause instanceof RepositoryCreationException ) { throw ( RepositoryCreationException ) cause ; } else { throw new RepositoryCreationException ( "Can not reserve repository name " + repositoryName + " since: " + e . getMessage ( ) , e ) ; } } } else { return reserveRepositoryNameLocally ( repositoryName ) ; }
|
public class DocPath { /** * Return the inverse path for a package .
* For example , if the package is java . lang ,
* the inverse path is . . / . . . */
public static DocPath forRoot ( PackageElement pkgElement ) { } }
|
String name = ( pkgElement == null || pkgElement . isUnnamed ( ) ) ? "" : pkgElement . getQualifiedName ( ) . toString ( ) ; return new DocPath ( name . replace ( '.' , '/' ) . replaceAll ( "[^/]+" , ".." ) ) ;
|
public class VarBindingBuilder { /** * Adds a binding annotation . */
public VarBindingBuilder has ( String name , Object value ) { } }
|
varBinding_ . setAnnotation ( name , Objects . toString ( value , null ) ) ; return this ;
|
public class BigQueryOutputConfiguration { /** * Gets the write disposition of the output table . This specifies the action that occurs if the
* destination table already exists . By default , if the table already exists , BigQuery appends
* data to the output table .
* @ param conf the configuration to reference the keys from .
* @ return the write disposition of the output table . */
public static String getWriteDisposition ( Configuration conf ) { } }
|
return conf . get ( BigQueryConfiguration . OUTPUT_TABLE_WRITE_DISPOSITION_KEY , BigQueryConfiguration . OUTPUT_TABLE_WRITE_DISPOSITION_DEFAULT ) ;
|
public class FLUSH { /** * Starts the flush protocol
* @ param members List of participants in the flush protocol . Guaranteed to be non - null */
private void onSuspend ( final List < Address > members ) { } }
|
Message msg = null ; Collection < Address > participantsInFlush = null ; synchronized ( sharedLock ) { flushCoordinator = localAddress ; // start FLUSH only on group members that we need to flush
participantsInFlush = members ; participantsInFlush . retainAll ( currentView . getMembers ( ) ) ; flushMembers . clear ( ) ; flushMembers . addAll ( participantsInFlush ) ; flushMembers . removeAll ( suspected ) ; msg = new Message ( null ) . src ( localAddress ) . setBuffer ( marshal ( participantsInFlush , null ) ) . putHeader ( this . id , new FlushHeader ( FlushHeader . START_FLUSH , currentViewId ( ) ) ) ; } if ( participantsInFlush . isEmpty ( ) ) { flush_promise . setResult ( SUCCESS_START_FLUSH ) ; } else { down_prot . down ( msg ) ; if ( log . isDebugEnabled ( ) ) log . debug ( localAddress + ": flush coordinator " + " is starting FLUSH with participants " + participantsInFlush ) ; }
|
public class DefaultZoomableController { /** * Sets the image bounds , in view - absolute coordinates . */
@ Override public void setImageBounds ( RectF imageBounds ) { } }
|
if ( ! imageBounds . equals ( mImageBounds ) ) { mImageBounds . set ( imageBounds ) ; onTransformChanged ( ) ; if ( mImageBoundsListener != null ) { mImageBoundsListener . onImageBoundsSet ( mImageBounds ) ; } }
|
public class CmsEntity { /** * Removes the attribute without triggering any change events . < p >
* @ param attributeName the attribute name */
public void removeAttributeSilent ( String attributeName ) { } }
|
CmsEntityAttribute attr = getAttribute ( attributeName ) ; if ( attr != null ) { if ( attr . isSimpleValue ( ) ) { m_simpleAttributes . remove ( attributeName ) ; } else { for ( CmsEntity child : attr . getComplexValues ( ) ) { removeChildChangeHandler ( child ) ; } m_entityAttributes . remove ( attributeName ) ; } }
|
public class ArgumentParser { /** * Get argument name */
private String getArgumentName ( final String arg ) { } }
|
int pos = arg . indexOf ( "=" ) ; if ( pos == - 1 ) { pos = arg . indexOf ( ":" ) ; } return arg . substring ( 0 , pos != - 1 ? pos : arg . length ( ) ) ;
|
public class CmsContainerpageService { /** * Converts container page element data to a bean which can be saved in a container page . < p >
* @ param cms the current CMS context
* @ param containerpageRootPath the container page root path
* @ param container the container containing the element
* @ param elementData the data for the single element
* @ return the container element bean
* @ throws CmsException if something goes wrong */
private CmsContainerElementBean getContainerElementBeanToSave ( CmsObject cms , String containerpageRootPath , CmsContainer container , CmsContainerElement elementData ) throws CmsException { } }
|
String elementClientId = elementData . getClientId ( ) ; boolean hasUuidPrefix = ( elementClientId != null ) && elementClientId . matches ( CmsUUID . UUID_REGEX + ".*$" ) ; boolean isCreateNew = elementData . isCreateNew ( ) ; if ( elementData . isNew ( ) && ! hasUuidPrefix ) { // Due to the changed save system without the save button , we need to make sure that new elements
// are only created once . This must happen when the user first edits a new element . But we still
// want to save changes to non - new elements on the page , so we skip new elements while saving .
return null ; } CmsContainerElementBean element = getCachedElement ( elementData . getClientId ( ) , containerpageRootPath ) ; CmsResource resource ; if ( element . getResource ( ) == null ) { element . initResource ( cms ) ; resource = element . getResource ( ) ; } else { // make sure resource is readable , this is necessary for new content elements
if ( element . getId ( ) . isNullUUID ( ) ) { // in memory only element , can not be read nor saved
return null ; } resource = cms . readResource ( element . getId ( ) , CmsResourceFilter . IGNORE_EXPIRATION ) ; } // check if there is a valid formatter
int containerWidth = container . getWidth ( ) ; CmsADEConfigData config = getConfigData ( containerpageRootPath ) ; CmsFormatterConfiguration formatters = config . getFormatters ( cms , resource ) ; String containerType = null ; containerType = container . getType ( ) ; I_CmsFormatterBean formatter = null ; String formatterConfigId = null ; if ( ( element . getIndividualSettings ( ) != null ) && ( element . getIndividualSettings ( ) . get ( CmsFormatterConfig . getSettingsKeyForContainer ( container . getName ( ) ) ) != null ) ) { formatterConfigId = element . getIndividualSettings ( ) . get ( CmsFormatterConfig . getSettingsKeyForContainer ( container . getName ( ) ) ) ; if ( CmsUUID . isValidUUID ( formatterConfigId ) ) { formatter = OpenCms . getADEManager ( ) . getCachedFormatters ( false ) . getFormatters ( ) . get ( new CmsUUID ( formatterConfigId ) ) ; } else if ( formatterConfigId . startsWith ( CmsFormatterConfig . SCHEMA_FORMATTER_ID ) && CmsUUID . isValidUUID ( formatterConfigId . substring ( CmsFormatterConfig . SCHEMA_FORMATTER_ID . length ( ) ) ) ) { formatter = formatters . getFormatterSelection ( containerType , containerWidth ) . get ( formatterConfigId ) ; } } if ( formatter == null ) { formatter = CmsElementUtil . getFormatterForContainer ( cms , element , container , config , getSessionCache ( ) ) ; if ( formatter != null ) { formatterConfigId = formatter . isFromFormatterConfigFile ( ) ? formatter . getId ( ) : CmsFormatterConfig . SCHEMA_FORMATTER_ID + formatter . getJspStructureId ( ) . toString ( ) ; } } CmsContainerElementBean newElementBean = null ; if ( formatter != null ) { Map < String , String > settings = new HashMap < String , String > ( element . getIndividualSettings ( ) ) ; String formatterKey = CmsFormatterConfig . getSettingsKeyForContainer ( container . getName ( ) ) ; settings . put ( formatterKey , formatterConfigId ) ; // remove not used formatter settings
Iterator < Entry < String , String > > entries = settings . entrySet ( ) . iterator ( ) ; while ( entries . hasNext ( ) ) { Entry < String , String > entry = entries . next ( ) ; if ( entry . getKey ( ) . startsWith ( CmsFormatterConfig . FORMATTER_SETTINGS_KEY ) && ! entry . getKey ( ) . equals ( formatterKey ) ) { entries . remove ( ) ; } } newElementBean = new CmsContainerElementBean ( element . getId ( ) , formatter . getJspStructureId ( ) , settings , isCreateNew ) ; } return newElementBean ;
|
public class LoadBalancerAttributes { /** * This parameter is reserved .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setAdditionalAttributes ( java . util . Collection ) } or { @ link # withAdditionalAttributes ( java . util . Collection ) }
* if you want to override the existing values .
* @ param additionalAttributes
* This parameter is reserved .
* @ return Returns a reference to this object so that method calls can be chained together . */
public LoadBalancerAttributes withAdditionalAttributes ( AdditionalAttribute ... additionalAttributes ) { } }
|
if ( this . additionalAttributes == null ) { setAdditionalAttributes ( new com . amazonaws . internal . SdkInternalList < AdditionalAttribute > ( additionalAttributes . length ) ) ; } for ( AdditionalAttribute ele : additionalAttributes ) { this . additionalAttributes . add ( ele ) ; } return this ;
|
public class Constituent { /** * getter for parent - gets The parent in a constituency tree , C
* @ generated
* @ return value of the feature */
public Constituent getParent ( ) { } }
|
if ( Constituent_Type . featOkTst && ( ( Constituent_Type ) jcasType ) . casFeat_parent == null ) jcasType . jcas . throwFeatMissing ( "parent" , "de.julielab.jules.types.Constituent" ) ; return ( Constituent ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( Constituent_Type ) jcasType ) . casFeatCode_parent ) ) ) ;
|
public class AbstractParsedStmt { /** * Perform various optimizations for IN / EXISTS subqueries if possible
* @ param expr to optimize
* @ return optimized expression */
private AbstractExpression optimizeInExpressions ( AbstractExpression expr ) { } }
|
ExpressionType exprType = expr . getExpressionType ( ) ; if ( ExpressionType . CONJUNCTION_AND == exprType || ExpressionType . CONJUNCTION_OR == exprType ) { AbstractExpression optimizedLeft = optimizeInExpressions ( expr . getLeft ( ) ) ; expr . setLeft ( optimizedLeft ) ; AbstractExpression optimizedRight = optimizeInExpressions ( expr . getRight ( ) ) ; expr . setRight ( optimizedRight ) ; return expr ; } if ( ExpressionType . COMPARE_EQUAL != exprType ) { return expr ; } assert ( expr instanceof ComparisonExpression ) ; if ( ( ( ComparisonExpression ) expr ) . getQuantifier ( ) != QuantifierType . ANY ) { return expr ; } /* * Verify that an IN expression can be safely converted to an EXISTS one
* IN ( SELECT " forms e . g . " ( A , B ) IN ( SELECT X , Y , FROM . . . ) = >
* EXISTS ( SELECT 42 FROM . . . AND | WHERE | HAVING A = X AND | WHERE | HAVING B = Y ) */
AbstractExpression inColumns = expr . getLeft ( ) ; if ( inColumns instanceof SelectSubqueryExpression ) { // If the left child is a ( SELECT . . . ) expression itself we can ' t convert it
// to the EXISTS expression because the mandatory run time scalar check -
// ( expression must return a single row at most )
return expr ; } // The right hand operand of the equality operation must be a SELECT statement
AbstractExpression rightExpr = expr . getRight ( ) ; if ( ! ( rightExpr instanceof SelectSubqueryExpression ) ) { return expr ; } SelectSubqueryExpression subqueryExpr = ( SelectSubqueryExpression ) rightExpr ; AbstractParsedStmt subquery = subqueryExpr . getSubqueryStmt ( ) ; if ( ! ( subquery instanceof ParsedSelectStmt ) ) { return expr ; } ParsedSelectStmt selectStmt = ( ParsedSelectStmt ) subquery ; // Must not have OFFSET or LIMIT set
// EXISTS ( select * from T where T . X = parent . X order by T . Y offset 10 limit 5)
// seems to require 11 matches
// parent . X IN ( select T . X from T order by T . Y offset 10 limit 5)
// seems to require 1 match that has exactly 10-14 rows ( matching or not ) with lesser or equal values of Y .
if ( selectStmt . hasLimitOrOffset ( ) ) { return expr ; } ParsedSelectStmt . rewriteInSubqueryAsExists ( selectStmt , inColumns ) ; subqueryExpr . resolveCorrelations ( ) ; AbstractExpression existsExpr = new OperatorExpression ( ) ; existsExpr . setExpressionType ( ExpressionType . OPERATOR_EXISTS ) ; existsExpr . setLeft ( subqueryExpr ) ; return optimizeExistsExpression ( existsExpr ) ;
|
public class AbstractSailthruClient { /** * HTTP POST Request with Interface implementation of ApiParams and ApiFileParams
* @ param data
* @ param fileParams
* @ throws IOException */
public JsonResponse apiPost ( ApiParams data , ApiFileParams fileParams ) throws IOException { } }
|
return httpRequestJson ( HttpRequestMethod . POST , data , fileParams ) ;
|
public class OrientationHelperEx { /** * Creates a vertical OrientationHelper for the given LayoutManager .
* @ param layoutManager The LayoutManager to attach to .
* @ return A new OrientationHelper */
public static OrientationHelperEx createVerticalHelper ( ExposeLinearLayoutManagerEx layoutManager ) { } }
|
return new OrientationHelperEx ( layoutManager ) { @ Override public int getEndAfterPadding ( ) { return mLayoutManager . getHeight ( ) - mLayoutManager . getPaddingBottom ( ) ; } @ Override public int getEnd ( ) { return mLayoutManager . getHeight ( ) ; } @ Override public void offsetChildren ( int amount ) { mLayoutManager . offsetChildrenVertical ( amount ) ; } @ Override public int getStartAfterPadding ( ) { return mLayoutManager . getPaddingTop ( ) ; } @ Override public int getDecoratedMeasurement ( View view ) { final RecyclerView . LayoutParams params = ( RecyclerView . LayoutParams ) view . getLayoutParams ( ) ; return ! mLayoutManager . isEnableMarginOverLap ( ) ? mLayoutManager . getDecoratedMeasuredHeight ( view ) + params . topMargin + params . bottomMargin : mLayoutManager . getDecoratedMeasuredHeight ( view ) ; } @ Override public int getDecoratedMeasurementInOther ( View view ) { final RecyclerView . LayoutParams params = ( RecyclerView . LayoutParams ) view . getLayoutParams ( ) ; return mLayoutManager . getDecoratedMeasuredWidth ( view ) + params . leftMargin + params . rightMargin ; } @ Override public int getDecoratedEnd ( View view ) { final RecyclerView . LayoutParams params = ( RecyclerView . LayoutParams ) view . getLayoutParams ( ) ; return ! mLayoutManager . isEnableMarginOverLap ( ) ? mLayoutManager . getDecoratedBottom ( view ) + params . bottomMargin : mLayoutManager . getDecoratedBottom ( view ) ; } @ Override public int getDecoratedStart ( View view ) { final RecyclerView . LayoutParams params = ( RecyclerView . LayoutParams ) view . getLayoutParams ( ) ; return ! mLayoutManager . isEnableMarginOverLap ( ) ? mLayoutManager . getDecoratedTop ( view ) - params . topMargin : mLayoutManager . getDecoratedTop ( view ) ; } @ Override public int getTotalSpace ( ) { return mLayoutManager . getHeight ( ) - mLayoutManager . getPaddingTop ( ) - mLayoutManager . getPaddingBottom ( ) ; } @ Override public void offsetChild ( View view , int offset ) { view . offsetTopAndBottom ( offset ) ; } @ Override public int getEndPadding ( ) { return mLayoutManager . getPaddingBottom ( ) ; } } ;
|
public class ServletHttpResponse { public void setBufferSize ( int size ) { } }
|
HttpOutputStream out = ( HttpOutputStream ) _httpResponse . getOutputStream ( ) ; if ( out . isWritten ( ) || _writer != null && _writer . isWritten ( ) ) throw new IllegalStateException ( "Output written" ) ; out . setBufferSize ( size ) ;
|
public class CmsXmlContentDefinition { /** * Returns a content handler instance for the given resource . < p >
* @ param cms the cms - object
* @ param resource the resource
* @ return the content handler
* @ throws CmsException if something goes wrong */
public static I_CmsXmlContentHandler getContentHandlerForResource ( CmsObject cms , CmsResource resource ) throws CmsException { } }
|
return getContentDefinitionForResource ( cms , resource ) . getContentHandler ( ) ;
|
public class AbstractReferencedValueMap { /** * Create a storage object that permits to put the specified
* elements inside this map .
* @ param key is the key associated to the value
* @ param value is the value
* @ return the new storage object */
protected final ReferencableValue < K , V > makeValue ( K key , V value ) { } }
|
return makeValue ( key , value , this . queue ) ;
|
public class TimeCounter { /** * Stops or suspends the time count .
* @ return This { @ link TimeCounter } . */
public TimeCounter stop ( ) { } }
|
switch ( state ) { case UNSTARTED : throw new IllegalStateException ( "Not started. " ) ; case STOPPED : throw new IllegalStateException ( "Already stopped. " ) ; case RUNNING : watch . suspend ( ) ; } state = State . STOPPED ; return this ;
|
public class UResourceBundle { /** * Returns a resource in a given resource that has a given index , or null if the
* resource is not found .
* @ param index the index of the resource
* @ return the resource , or null
* @ see # get ( int )
* @ deprecated This API is ICU internal only .
* @ hide draft / provisional / internal are hidden on Android */
@ Deprecated protected UResourceBundle findTopLevel ( int index ) { } }
|
// NOTE : this _ barely _ works for top - level resources . For resources at lower
// levels , it fails when you fall back to the parent , since you ' re now
// looking at root resources , not at the corresponding nested resource .
// Not only that , but unless the indices correspond 1 - to - 1 , the index will
// lose meaning . Essentially this only works if the child resource arrays
// are prefixes of their parent arrays .
for ( UResourceBundle res = this ; res != null ; res = res . getParent ( ) ) { UResourceBundle obj = res . handleGet ( index , null , this ) ; if ( obj != null ) { return obj ; } } return null ;
|
public class GetVpcLinksResult { /** * The current page of elements from this collection .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setItems ( java . util . Collection ) } or { @ link # withItems ( java . util . Collection ) } if you want to override the
* existing values .
* @ param items
* The current page of elements from this collection .
* @ return Returns a reference to this object so that method calls can be chained together . */
public GetVpcLinksResult withItems ( VpcLink ... items ) { } }
|
if ( this . items == null ) { setItems ( new java . util . ArrayList < VpcLink > ( items . length ) ) ; } for ( VpcLink ele : items ) { this . items . add ( ele ) ; } return this ;
|
public class JCuda { /** * [ C + + API ] Binds an array to a surface
* < pre >
* template < class T , int dim > cudaError _ t cudaBindSurfaceToArray (
* const surface < T ,
* dim > & surf ,
* cudaArray _ const _ t array ,
* const cudaChannelFormatDesc & desc ) [ inline ]
* < / pre >
* < div >
* < p > [ C + + API ] Binds an array to a surface
* Binds the CUDA array < tt > array < / tt > to the surface reference < tt > surf < / tt > . < tt > desc < / tt > describes how the memory is interpreted when
* dealing with the surface . Any CUDA array previously bound to < tt > surf < / tt > is unbound .
* < div >
* < span > Note : < / span >
* < p > Note that this
* function may also return error codes from previous , asynchronous
* launches .
* < / div >
* < / div >
* @ param surfref Surface to bind
* @ param array Memory array on device
* @ param desc Channel format
* @ param surf Surface to bind
* @ param array Memory array on device
* @ param surf Surface to bind
* @ param array Memory array on device
* @ param desc Channel format
* @ return cudaSuccess , cudaErrorInvalidValue , cudaErrorInvalidSurface
* @ see JCuda # cudaBindSurfaceToArray
* @ see JCuda # cudaBindSurfaceToArray */
public static int cudaBindSurfaceToArray ( surfaceReference surfref , cudaArray array , cudaChannelFormatDesc desc ) { } }
|
return checkResult ( cudaBindSurfaceToArrayNative ( surfref , array , desc ) ) ;
|
public class ClassificationServiceCache { /** * Indicates whether or not the given { @ link FileModel } is already attached to the { @ link ClassificationModel } .
* Note that this assumes all { @ link ClassificationModel } attachments are handled via the { @ link ClassificationService } .
* Outside of tests , this should be a safe assumption to make . */
static boolean isClassificationLinkedToFileModel ( GraphRewrite event , ClassificationModel classificationModel , FileModel fileModel ) { } }
|
String key = getClassificationFileModelCacheKey ( classificationModel , fileModel ) ; Boolean linked = getCache ( event ) . get ( key ) ; if ( linked == null ) { GraphTraversal < Vertex , Vertex > existenceCheck = new GraphTraversalSource ( event . getGraphContext ( ) . getGraph ( ) ) . V ( classificationModel . getElement ( ) ) ; existenceCheck . out ( ClassificationModel . FILE_MODEL ) ; existenceCheck . filter ( vertexTraverser -> vertexTraverser . get ( ) . equals ( fileModel . getElement ( ) ) ) ; linked = existenceCheck . hasNext ( ) ; cacheClassificationFileModel ( event , classificationModel , fileModel , linked ) ; } return linked ;
|
public class DirectLogFetcher { /** * Put 32 - bit integer in the buffer .
* @ param i32 the integer to put in the buffer */
protected final void putInt32 ( long i32 ) { } }
|
ensureCapacity ( position + 4 ) ; byte [ ] buf = buffer ; buf [ position ++ ] = ( byte ) ( i32 & 0xff ) ; buf [ position ++ ] = ( byte ) ( i32 >>> 8 ) ; buf [ position ++ ] = ( byte ) ( i32 >>> 16 ) ; buf [ position ++ ] = ( byte ) ( i32 >>> 24 ) ;
|
public class Reflect { /** * Create a proxy for the wrapped object allowing to typesafely invoke
* methods on it using a custom interface
* @ param proxyType The interface type that is implemented by the proxy
* @ return A proxy for the wrapped object */
@ SuppressWarnings ( "unchecked" ) public < P > P as ( final Class < P > proxyType ) { } }
|
final boolean isMap = ( object instanceof Map ) ; final InvocationHandler handler = new InvocationHandler ( ) { @ Override @ SuppressWarnings ( "null" ) public Object invoke ( Object proxy , Method method , Object [ ] args ) throws Throwable { String name = method . getName ( ) ; // Actual method name matches always come first
try { return on ( type , object ) . call ( name , args ) . get ( ) ; } // [ # 14 ] Emulate POJO behaviour on wrapped map objects
catch ( ReflectException e ) { if ( isMap ) { Map < String , Object > map = ( Map < String , Object > ) object ; int length = ( args == null ? 0 : args . length ) ; if ( length == 0 && name . startsWith ( "get" ) ) { return map . get ( property ( name . substring ( 3 ) ) ) ; } else if ( length == 0 && name . startsWith ( "is" ) ) { return map . get ( property ( name . substring ( 2 ) ) ) ; } else if ( length == 1 && name . startsWith ( "set" ) ) { map . put ( property ( name . substring ( 3 ) ) , args [ 0 ] ) ; return null ; } } throw e ; } } } ; return ( P ) Proxy . newProxyInstance ( proxyType . getClassLoader ( ) , new Class [ ] { proxyType } , handler ) ;
|
public class SipCall { /** * This method sends a basic response to a previously received MESSAGE request . The response is
* constructed based on the parameters passed in . Call this method after waitForMessage ( ) returns
* true . Call this method multiple times to send multiple responses to the received MESSAGE . The
* MESSAGE being responded to must be the last received request on this SipCall .
* @ param statusCode The status code of the response to send ( may use SipResponse constants ) .
* @ param reasonPhrase If not null , the reason phrase to send .
* @ param expires If not - 1 , an expiration time is added to the response . This parameter indicates
* the duration the message is valid , in seconds .
* @ return true if the response was successfully sent , false otherwise . */
public boolean sendMessageResponse ( int statusCode , String reasonPhrase , int expires ) { } }
|
return sendMessageResponse ( statusCode , reasonPhrase , expires , null , null , null ) ;
|
public class CollectionUtil { /** * < p > toPrimitiveDoubleArray . < / p >
* @ param values a { @ link java . util . List } object .
* @ return a { @ link java . lang . Object } object . */
public static Object toPrimitiveDoubleArray ( List < ? > values ) { } }
|
double [ ] array = new double [ values . size ( ) ] ; int cursor = 0 ; for ( Object o : values ) { array [ cursor ] = ( Double ) o ; cursor ++ ; } return array ;
|
public class CmsToolBar { /** * Creates a properly styled toolbar button . < p >
* @ param icon the button icon
* @ param title the button title , will be used for the tooltip
* @ return the button */
public static Button createButton ( Resource icon , String title ) { } }
|
return createButton ( icon , title , false ) ;
|
public class CmsCreateSiteThread { /** * Creates online version of given CmsObject . < p >
* @ param cms given CmsObject
* @ return online CmsObject */
private CmsObject getOnlineCmsObject ( CmsObject cms ) { } }
|
CmsObject res = null ; try { res = OpenCms . initCmsObject ( cms ) ; res . getRequestContext ( ) . setCurrentProject ( cms . readProject ( CmsProject . ONLINE_PROJECT_ID ) ) ; } catch ( CmsException e ) { LOG . error ( "Cannot create CmsObject" , e ) ; } return res ;
|
public class KeyWrapper { /** * Encodes the given { @ link PublicKey } < em > without wrapping < / em > . Since a
* public key is public , this is a convenience method provided to convert it
* to a String for unprotected storage .
* This method internally calls { @ link ByteArray # toBase64 ( byte [ ] ) } ,
* passing the value of { @ link PublicKey # getEncoded ( ) } .
* @ param key The { @ link PublicKey } to be encoded .
* @ return A String representation ( base64 - encoded ) of the raw
* { @ link PublicKey } , for ease of storage . */
public static String encodePublicKey ( PublicKey key ) { } }
|
byte [ ] bytes = key . getEncoded ( ) ; return BEGIN + "\n" + new String ( Base64 . encodeBase64Chunked ( bytes ) , StandardCharsets . UTF_8 ) . trim ( ) + "\n" + END ;
|
public class SdkUtils { /** * Helper method that wraps given arrays inside of a single outputstream .
* @ param outputStreams an array of multiple outputstreams .
* @ return a single outputstream that will write to provided outputstreams . */
public static OutputStream createArrayOutputStream ( final OutputStream [ ] outputStreams ) { } }
|
return new OutputStream ( ) { @ Override public void close ( ) throws IOException { for ( OutputStream o : outputStreams ) { o . close ( ) ; } super . close ( ) ; } @ Override public void flush ( ) throws IOException { for ( OutputStream o : outputStreams ) { o . flush ( ) ; } super . flush ( ) ; } @ Override public void write ( int oneByte ) throws IOException { for ( OutputStream o : outputStreams ) { o . write ( oneByte ) ; } } @ Override public void write ( byte [ ] buffer ) throws IOException { for ( OutputStream o : outputStreams ) { o . write ( buffer ) ; } } @ Override public void write ( byte [ ] buffer , int offset , int count ) throws IOException { for ( OutputStream o : outputStreams ) { o . write ( buffer , offset , count ) ; } } } ;
|
public class AnnotationId { /** * Construct an instance . It initially contains no elements .
* @ param declaringType the type declaring the program element .
* @ param type the annotation type .
* @ param annotatedElement the program element type to be annotated .
* @ return an annotation { @ code AnnotationId < D , V > } instance . */
public static < D , V > AnnotationId < D , V > get ( TypeId < D > declaringType , TypeId < V > type , ElementType annotatedElement ) { } }
|
if ( annotatedElement != ElementType . TYPE && annotatedElement != ElementType . METHOD && annotatedElement != ElementType . FIELD && annotatedElement != ElementType . PARAMETER ) { throw new IllegalArgumentException ( "element type is not supported to annotate yet." ) ; } return new AnnotationId < > ( declaringType , type , annotatedElement ) ;
|
public class AmazonIdentityManagementClient { /** * Deletes a virtual MFA device .
* < note >
* You must deactivate a user ' s virtual MFA device before you can delete it . For information about deactivating MFA
* devices , see < a > DeactivateMFADevice < / a > .
* < / note >
* @ param deleteVirtualMFADeviceRequest
* @ return Result of the DeleteVirtualMFADevice operation returned by the service .
* @ throws NoSuchEntityException
* The request was rejected because it referenced a resource entity that does not exist . The error message
* describes the resource .
* @ throws DeleteConflictException
* The request was rejected because it attempted to delete a resource that has attached subordinate
* entities . The error message describes these entities .
* @ throws LimitExceededException
* The request was rejected because it attempted to create resources beyond the current AWS account limits .
* The error message describes the limit exceeded .
* @ throws ServiceFailureException
* The request processing has failed because of an unknown error , exception or failure .
* @ sample AmazonIdentityManagement . DeleteVirtualMFADevice
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / iam - 2010-05-08 / DeleteVirtualMFADevice " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public DeleteVirtualMFADeviceResult deleteVirtualMFADevice ( DeleteVirtualMFADeviceRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeDeleteVirtualMFADevice ( request ) ;
|
public class OneKey { /** * Compares the key ' s assigned algorithm with the provided value , indicating if the values are the
* same .
* @ param algorithmId
* the algorithm to compare or { @ code null } to check for no assignment .
* @ return { @ code true } if the current key has the provided algorithm assigned , or { @ code false }
* otherwise */
public boolean HasAlgorithmID ( AlgorithmID algorithmId ) { } }
|
CBORObject thisObj = get ( KeyKeys . Algorithm ) ; CBORObject thatObj = ( algorithmId == null ? null : algorithmId . AsCBOR ( ) ) ; boolean result ; if ( thatObj == null ) { result = ( thisObj == null ) ; } else { result = thatObj . equals ( thisObj ) ; } return result ;
|
public class TypeUtil { /** * Gets the parameterization of the given base type .
* For example , given the following
* < pre > { @ code
* interface Foo < T > extends List < List < T > > { }
* interface Bar extends Foo < String > { }
* } < / pre >
* This method works like this :
* < pre > { @ code
* getBaseClass ( Bar , List ) = List < List < String >
* getBaseClass ( Bar , Foo ) = Foo < String >
* getBaseClass ( Foo < ? extends Number > , Collection ) = Collection < List < ? extends Number > >
* getBaseClass ( ArrayList < ? extends BigInteger > , List ) = List < ? extends BigInteger >
* } < / pre >
* @ param type
* The type that derives from { @ code baseType }
* @ param baseType
* The class whose parameterization we are interested in .
* @ return
* The use of { @ code baseType } in { @ code type } .
* or null if the type is not assignable to the base type . */
public static Type getBaseClass ( Type type , Class baseType ) { } }
|
return baseClassFinder . visit ( type , baseType ) ;
|
public class EventsHelper { /** * Bind a function to the focus event of each matched element .
* @ param jsScope
* Scope to use
* @ return the jQuery code */
public static ChainableStatement focus ( JsScope jsScope ) { } }
|
return new DefaultChainableStatement ( StateEvent . FOCUS . getEventLabel ( ) , jsScope . render ( ) ) ;
|
public class ShellUtils { /** * Copy a URL package to a target folder
* @ param uri the URI to download core release package
* @ param destination the target filename to download the release package to
* @ param isVerbose display verbose output or not
* @ return true if successful */
public static boolean curlPackage ( String uri , String destination , boolean isVerbose , boolean isInheritIO ) { } }
|
// get the directory containing the target file
File parentDirectory = Paths . get ( destination ) . getParent ( ) . toFile ( ) ; // using curl copy the url to the target file
String cmd = String . format ( "curl %s -o %s" , uri , destination ) ; int ret = runSyncProcess ( isVerbose , isInheritIO , splitTokens ( cmd ) , new StringBuilder ( ) , parentDirectory ) ; return ret == 0 ;
|
public class DfuServiceInitiator { /** * Sets custom UUIDs for the Buttonless DFU Service from SDK 14 ( or later ) .
* Use this method if your DFU implementation uses different UUID for at least one of the given
* UUIDs . Parameter set to < code > null < / code > will reset the UUID to the default value .
* @ param buttonlessDfuServiceUuid custom Buttonless DFU service UUID or null , if default
* is to be used
* @ param buttonlessDfuControlPointUuid custom Buttonless DFU characteristic UUID or null ,
* if default is to be used
* @ return the builder */
public DfuServiceInitiator setCustomUuidsForButtonlessDfuWithBondSharing ( @ Nullable final UUID buttonlessDfuServiceUuid , @ Nullable final UUID buttonlessDfuControlPointUuid ) { } }
|
final ParcelUuid [ ] uuids = new ParcelUuid [ 2 ] ; uuids [ 0 ] = buttonlessDfuServiceUuid != null ? new ParcelUuid ( buttonlessDfuServiceUuid ) : null ; uuids [ 1 ] = buttonlessDfuControlPointUuid != null ? new ParcelUuid ( buttonlessDfuControlPointUuid ) : null ; buttonlessDfuWithBondSharingUuids = uuids ; return this ;
|
public class MapPolygon { /** * Replies if this element has an intersection
* with the specified rectangle .
* @ return < code > true < / code > if this MapElement is intersecting the specified area ,
* otherwise < code > false < / code > */
@ Override @ Pure public boolean intersects ( Shape2D < ? , ? , ? , ? , ? , ? extends Rectangle2afp < ? , ? , ? , ? , ? , ? > > rectangle ) { } }
|
if ( boundsIntersects ( rectangle ) ) { final Path2d p = toPath2D ( ) ; return p . intersects ( rectangle ) ; } return false ;
|
public class Base64Utils { /** * Base64 - decode the given byte array from an UTF - 8 String .
* @ param src the encoded UTF - 8 String ( may be { @ code null } )
* @ return the original byte array ( or { @ code null } if the input was { @ code null } )
* @ throws IllegalStateException if Base64 encoding is not supported ,
* i . e . neither Java 8 nor Apache Commons Codec is present at runtime */
public static byte [ ] decodeFromString ( String src ) { } }
|
assertSupported ( ) ; if ( src == null ) { return null ; } if ( src . length ( ) == 0 ) { return new byte [ 0 ] ; } return delegate . decode ( src . getBytes ( DEFAULT_CHARSET ) ) ;
|
public class BidiLine { /** * Gets the width of a range of characters .
* @ param startIdx the first index to calculate
* @ param lastIdx the last inclusive index to calculate
* @ return the sum of all widths */
public float getWidth ( int startIdx , int lastIdx ) { } }
|
char c = 0 ; PdfChunk ck = null ; float width = 0 ; for ( ; startIdx <= lastIdx ; ++ startIdx ) { boolean surrogate = Utilities . isSurrogatePair ( text , startIdx ) ; if ( surrogate ) { width += detailChunks [ startIdx ] . getCharWidth ( Utilities . convertToUtf32 ( text , startIdx ) ) ; ++ startIdx ; } else { c = text [ startIdx ] ; ck = detailChunks [ startIdx ] ; if ( PdfChunk . noPrint ( ck . getUnicodeEquivalent ( c ) ) ) continue ; width += detailChunks [ startIdx ] . getCharWidth ( c ) ; } } return width ;
|
public class PiwikRequest { /** * Get the value at the specified index from the json array at the specified
* parameter .
* @ param key the key of the json array to access
* @ param index the index of the value in the json array
* @ return the value at the index in the json array */
private JsonValue getFromJsonArray ( String key , int index ) { } }
|
PiwikJsonArray a = ( PiwikJsonArray ) parameters . get ( key ) ; if ( a == null ) { return null ; } return a . get ( index ) ;
|
public class BluetoothLeScannerCompat { /** * Start Bluetooth LE scan . The scan results will be delivered through { @ code callback } .
* Requires { @ link Manifest . permission # BLUETOOTH _ ADMIN } permission .
* An app must hold
* { @ link Manifest . permission # ACCESS _ COARSE _ LOCATION ACCESS _ FINE _ LOCATION } permission
* in order to get results .
* @ param filters { @ link ScanFilter } s for finding exact BLE devices .
* @ param settings Optional settings for the scan .
* @ param callback Callback used to deliver scan results .
* @ throws IllegalArgumentException If { @ code settings } or { @ code callback } is null . */
@ SuppressWarnings ( "unused" ) @ RequiresPermission ( allOf = { } }
|
Manifest . permission . BLUETOOTH_ADMIN , Manifest . permission . BLUETOOTH } ) public final void startScan ( @ Nullable final List < ScanFilter > filters , @ Nullable final ScanSettings settings , @ NonNull final ScanCallback callback ) { // noinspection ConstantConditions
if ( callback == null ) { throw new IllegalArgumentException ( "callback is null" ) ; } final Handler handler = new Handler ( Looper . getMainLooper ( ) ) ; startScanInternal ( filters != null ? filters : Collections . < ScanFilter > emptyList ( ) , settings != null ? settings : new ScanSettings . Builder ( ) . build ( ) , callback , handler ) ;
|
public class SagaExecutionTask { /** * Similar to { @ link # handle ( ) } but intended for execution on any thread . < p / >
* May throw a runtime exception in case something went wrong invoking the target saga message handler . */
@ Override public void run ( ) { } }
|
try { handle ( ) ; } catch ( Exception e ) { Throwables . throwIfUnchecked ( e ) ; throw new RuntimeException ( e ) ; }
|
public class Reflection { /** * recursive method . */
private static List < Field > getAllFieldsRec ( Class clazz , List < Field > fieldList ) { } }
|
Class superClazz = clazz . getSuperclass ( ) ; if ( superClazz != null ) { getAllFieldsRec ( superClazz , fieldList ) ; } fieldList . addAll ( ArrayUtil . toList ( clazz . getDeclaredFields ( ) , Field . class ) ) ; return fieldList ;
|
public class SettingsMode { /** * CLI Utility Methods */
public static SettingsMode get ( Map < String , String [ ] > clArgs ) { } }
|
String [ ] params = clArgs . remove ( "-mode" ) ; if ( params == null ) { Cql3NativeOptions opts = new Cql3NativeOptions ( ) ; opts . accept ( "cql3" ) ; opts . accept ( "native" ) ; opts . accept ( "prepared" ) ; return new SettingsMode ( opts ) ; } GroupedOptions options = GroupedOptions . select ( params , new ThriftOptions ( ) , new Cql3NativeOptions ( ) , new Cql3ThriftOptions ( ) , new Cql3SimpleNativeOptions ( ) , new Cql2ThriftOptions ( ) ) ; if ( options == null ) { printHelp ( ) ; System . out . println ( "Invalid -mode options provided, see output for valid options" ) ; System . exit ( 1 ) ; } return new SettingsMode ( options ) ;
|
public class DailyCalendar { /** * Determines the next time included by the < CODE > DailyCalendar < / CODE > after
* the specified time .
* @ param timeInMillis
* the initial date / time after which to find an included time
* @ return the time in milliseconds representing the next time included after
* the specified time . */
@ Override public long getNextIncludedTime ( final long timeInMillis ) { } }
|
long nextIncludedTime = timeInMillis + oneMillis ; while ( ! isTimeIncluded ( nextIncludedTime ) ) { if ( ! m_bInvertTimeRange ) { // If the time is in a range excluded by this calendar , we can
// move to the end of the excluded time range and continue
// testing from there . Otherwise , if nextIncludedTime is
// excluded by the baseCalendar , ask it the next time it
// includes and begin testing from there . Failing this , add one
// millisecond and continue testing .
if ( ( nextIncludedTime >= getTimeRangeStartingTimeInMillis ( nextIncludedTime ) ) && ( nextIncludedTime <= getTimeRangeEndingTimeInMillis ( nextIncludedTime ) ) ) { nextIncludedTime = getTimeRangeEndingTimeInMillis ( nextIncludedTime ) + oneMillis ; } else if ( ( getBaseCalendar ( ) != null ) && ( ! getBaseCalendar ( ) . isTimeIncluded ( nextIncludedTime ) ) ) { nextIncludedTime = getBaseCalendar ( ) . getNextIncludedTime ( nextIncludedTime ) ; } else { nextIncludedTime ++ ; } } else { // If the time is in a range excluded by this calendar , we can
// move to the end of the excluded time range and continue
// testing from there . Otherwise , if nextIncludedTime is
// excluded by the baseCalendar , ask it the next time it
// includes and begin testing from there . Failing this , add one
// millisecond and continue testing .
if ( nextIncludedTime < getTimeRangeStartingTimeInMillis ( nextIncludedTime ) ) { nextIncludedTime = getTimeRangeStartingTimeInMillis ( nextIncludedTime ) ; } else if ( nextIncludedTime > getTimeRangeEndingTimeInMillis ( nextIncludedTime ) ) { // ( move to start of next day )
nextIncludedTime = getEndOfDayJavaCalendar ( nextIncludedTime ) . getTime ( ) . getTime ( ) ; nextIncludedTime += 1l ; } else if ( ( getBaseCalendar ( ) != null ) && ( ! getBaseCalendar ( ) . isTimeIncluded ( nextIncludedTime ) ) ) { nextIncludedTime = getBaseCalendar ( ) . getNextIncludedTime ( nextIncludedTime ) ; } else { nextIncludedTime ++ ; } } } return nextIncludedTime ;
|
public class ExpandableButtonMenu { /** * Initialized animation properties */
private void calculateAnimationProportions ( ) { } }
|
TRANSLATION_Y = sHeight * buttonDistanceY ; TRANSLATION_X = sWidth * buttonDistanceX ; anticipation = new AnticipateInterpolator ( INTERPOLATOR_WEIGHT ) ; overshoot = new OvershootInterpolator ( INTERPOLATOR_WEIGHT ) ;
|
public class JKDateTimeUtil { /** * Checks if is date eqaualed .
* @ param date1 the date 1
* @ param date2 the date 2
* @ return true , if is date eqaualed */
public static boolean isDateEqaualed ( final java . util . Date date1 , final java . util . Date date2 ) { } }
|
final String d1 = JKFormatUtil . formatDate ( date1 , JKFormatUtil . MYSQL_DATE_DB_PATTERN ) ; final String d2 = JKFormatUtil . formatDate ( date2 , JKFormatUtil . MYSQL_DATE_DB_PATTERN ) ; return d1 . equalsIgnoreCase ( d2 ) ;
|
public class RTTextLogger { /** * ( non - Javadoc )
* @ see org . overture . interpreter . messages . rtlog . IRTLogger # enable ( boolean ) */
@ Override public synchronized void enable ( boolean on ) { } }
|
if ( ! on ) { dump ( true ) ; cached = null ; } enabled = on ;
|
public class StormpathShiroIniEnvironment { /** * Wraps the original FilterChainResolver in a priority based instance , which will detect Stormpath API based logins
* ( form , auth headers , etc ) .
* @ return */
@ Override protected FilterChainResolver createFilterChainResolver ( ) { } }
|
FilterChainResolver originalFilterChainResolver = super . createFilterChainResolver ( ) ; if ( originalFilterChainResolver == null ) { return null ; } return getFilterChainResolverFactory ( originalFilterChainResolver ) . getInstance ( ) ;
|
public class JournalQueue { /** * Migrate all operations to the given target queue
* @ param otherQueue target journal queue */
public void migrateTo ( JournalQueue otherQueue ) { } }
|
if ( head == null ) return ; // Empty
if ( otherQueue . head == null ) { // Other queue was empty , copy everything
otherQueue . head = head ; otherQueue . tail = tail ; otherQueue . size = size ; } else { // Other queue is not empty , append operations
otherQueue . tail . setNext ( head ) ; otherQueue . tail = tail ; otherQueue . size += size ; } // Clear this queue
head = tail = null ; size = 0 ;
|
public class InternalUtils { /** * TODO : make this pluggable */
public static Object unwrapFormBean ( ActionForm form ) { } }
|
if ( form == null ) return null ; if ( form instanceof AnyBeanActionForm ) { return ( ( AnyBeanActionForm ) form ) . getBean ( ) ; } return form ;
|
public class ByteArrayDiskQueue { /** * Creates a new disk - based queue of byte arrays .
* @ param file the file that will be used to dump the queue on disk .
* @ param bufferSize the number of items in the circular buffer ( will be possibly decreased so to be a power of two ) .
* @ param direct whether the { @ link ByteBuffer } used by this queue should be { @ linkplain ByteBuffer # allocateDirect ( int ) allocated directly } .
* @ see ByteDiskQueue # createNew ( File , int , boolean ) */
public static ByteArrayDiskQueue createNew ( final File file , final int bufferSize , final boolean direct ) throws IOException { } }
|
return new ByteArrayDiskQueue ( ByteDiskQueue . createNew ( file , bufferSize , direct ) ) ;
|
public class AmazonGameLiftClient { /** * Updates capacity settings for a fleet . Use this action to specify the number of EC2 instances ( hosts ) that you
* want this fleet to contain . Before calling this action , you may want to call < a > DescribeEC2InstanceLimits < / a > to
* get the maximum capacity based on the fleet ' s EC2 instance type .
* Specify minimum and maximum number of instances . Amazon GameLift will not change fleet capacity to values fall
* outside of this range . This is particularly important when using auto - scaling ( see < a > PutScalingPolicy < / a > ) to
* allow capacity to adjust based on player demand while imposing limits on automatic adjustments .
* To update fleet capacity , specify the fleet ID and the number of instances you want the fleet to host . If
* successful , Amazon GameLift starts or terminates instances so that the fleet ' s active instance count matches the
* desired instance count . You can view a fleet ' s current capacity information by calling
* < a > DescribeFleetCapacity < / a > . If the desired instance count is higher than the instance type ' s limit , the
* " Limit Exceeded " exception occurs .
* < b > Learn more < / b >
* < a href = " https : / / docs . aws . amazon . com / gamelift / latest / developerguide / fleets - intro . html " > Working with Fleets < / a > .
* < b > Related operations < / b >
* < ul >
* < li >
* < a > CreateFleet < / a >
* < / li >
* < li >
* < a > ListFleets < / a >
* < / li >
* < li >
* < a > DeleteFleet < / a >
* < / li >
* < li >
* Describe fleets :
* < ul >
* < li >
* < a > DescribeFleetAttributes < / a >
* < / li >
* < li >
* < a > DescribeFleetCapacity < / a >
* < / li >
* < li >
* < a > DescribeFleetPortSettings < / a >
* < / li >
* < li >
* < a > DescribeFleetUtilization < / a >
* < / li >
* < li >
* < a > DescribeRuntimeConfiguration < / a >
* < / li >
* < li >
* < a > DescribeEC2InstanceLimits < / a >
* < / li >
* < li >
* < a > DescribeFleetEvents < / a >
* < / li >
* < / ul >
* < / li >
* < li >
* Update fleets :
* < ul >
* < li >
* < a > UpdateFleetAttributes < / a >
* < / li >
* < li >
* < a > UpdateFleetCapacity < / a >
* < / li >
* < li >
* < a > UpdateFleetPortSettings < / a >
* < / li >
* < li >
* < a > UpdateRuntimeConfiguration < / a >
* < / li >
* < / ul >
* < / li >
* < li >
* Manage fleet actions :
* < ul >
* < li >
* < a > StartFleetActions < / a >
* < / li >
* < li >
* < a > StopFleetActions < / a >
* < / li >
* < / ul >
* < / li >
* < / ul >
* @ param updateFleetCapacityRequest
* Represents the input for a request action .
* @ return Result of the UpdateFleetCapacity operation returned by the service .
* @ throws NotFoundException
* A service resource associated with the request could not be found . Clients should not retry such
* requests .
* @ throws ConflictException
* The requested operation would cause a conflict with the current state of a service resource associated
* with the request . Resolve the conflict before retrying this request .
* @ throws LimitExceededException
* The requested operation would cause the resource to exceed the allowed service limit . Resolve the issue
* before retrying .
* @ throws InvalidFleetStatusException
* The requested operation would cause a conflict with the current state of a resource associated with the
* request and / or the fleet . Resolve the conflict before retrying .
* @ throws InternalServiceException
* The service encountered an unrecoverable internal failure while processing the request . Clients can retry
* such requests immediately or after a waiting period .
* @ throws InvalidRequestException
* One or more parameter values in the request are invalid . Correct the invalid parameter values before
* retrying .
* @ throws UnauthorizedException
* The client failed authentication . Clients should not retry such requests .
* @ sample AmazonGameLift . UpdateFleetCapacity
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / gamelift - 2015-10-01 / UpdateFleetCapacity " target = " _ top " > AWS
* API Documentation < / a > */
@ Override public UpdateFleetCapacityResult updateFleetCapacity ( UpdateFleetCapacityRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeUpdateFleetCapacity ( request ) ;
|
public class DocumentBlock { /** * setter for hasBold - sets
* @ generated
* @ param v value to set into the feature */
public void setHasBold ( boolean v ) { } }
|
if ( DocumentBlock_Type . featOkTst && ( ( DocumentBlock_Type ) jcasType ) . casFeat_hasBold == null ) jcasType . jcas . throwFeatMissing ( "hasBold" , "ch.epfl.bbp.uima.types.DocumentBlock" ) ; jcasType . ll_cas . ll_setBooleanValue ( addr , ( ( DocumentBlock_Type ) jcasType ) . casFeatCode_hasBold , v ) ;
|
public class ServerInventoryService { /** * { @ inheritDoc } */
@ Override public synchronized void start ( StartContext context ) throws StartException { } }
|
ROOT_LOGGER . debug ( "Starting Host Controller Server Inventory" ) ; try { final ProcessControllerConnectionService processControllerConnectionService = client . getValue ( ) ; URI managementURI = new URI ( protocol , null , NetworkUtils . formatAddress ( getNonWildCardManagementAddress ( ) ) , port , null , null , null ) ; serverInventory = new ServerInventoryImpl ( domainController , environment , managementURI , processControllerConnectionService . getClient ( ) , extensionRegistry ) ; processControllerConnectionService . setServerInventory ( serverInventory ) ; serverCallback . getValue ( ) . setCallbackHandler ( serverInventory . getServerCallbackHandler ( ) ) ; if ( domainServerCallback != null && domainServerCallback . getValue ( ) != null ) { domainServerCallback . getValue ( ) . getServerCallbackHandlerInjector ( ) . inject ( serverInventory . getServerCallbackHandler ( ) ) ; } futureInventory . setInventory ( serverInventory ) ; } catch ( Exception e ) { futureInventory . setFailure ( e ) ; throw new StartException ( e ) ; }
|
public class DefaultGroovyMethods { /** * Convert an iterator to a Set . The iterator will become
* exhausted of elements after making this conversion .
* @ param self an iterator
* @ return a Set
* @ since 1.8.0 */
public static < T > Set < T > toSet ( Iterator < T > self ) { } }
|
Set < T > answer = new HashSet < T > ( ) ; while ( self . hasNext ( ) ) { answer . add ( self . next ( ) ) ; } return answer ;
|
public class RefUpdate { /** * Returns the ref ( refspec ) representing this RefUpdate .
* @ return the ref */
public String getRef ( ) { } }
|
if ( refName != null ) { if ( ! refName . startsWith ( "refs/" ) ) { return REFS_HEADS + refName ; } return refName ; } return null ;
|
public class RebalanceUtils { /** * Given the current cluster and final cluster , generates an interim cluster
* with empty new nodes ( and zones ) .
* @ param currentCluster Current cluster metadata
* @ param finalCluster Final cluster metadata
* @ return Returns a new interim cluster which contains nodes and zones of
* final cluster , but with empty partition lists if they were not
* present in current cluster . */
public static Cluster getInterimCluster ( Cluster currentCluster , Cluster finalCluster ) { } }
|
List < Node > newNodeList = new ArrayList < Node > ( currentCluster . getNodes ( ) ) ; for ( Node node : finalCluster . getNodes ( ) ) { if ( ! currentCluster . hasNodeWithId ( node . getId ( ) ) ) { newNodeList . add ( UpdateClusterUtils . updateNode ( node , new ArrayList < Integer > ( ) ) ) ; } } Collections . sort ( newNodeList ) ; return new Cluster ( currentCluster . getName ( ) , newNodeList , Lists . newArrayList ( finalCluster . getZones ( ) ) ) ;
|
public class ProjectCalendar { /** * Sets the ProjectCalendar instance from which this calendar is derived .
* @ param calendar base calendar instance */
public void setParent ( ProjectCalendar calendar ) { } }
|
// I ' ve seen a malformed MSPDI file which sets the parent calendar to itself .
// Silently ignore this here .
if ( calendar != this ) { if ( getParent ( ) != null ) { getParent ( ) . removeDerivedCalendar ( this ) ; } super . setParent ( calendar ) ; if ( calendar != null ) { calendar . addDerivedCalendar ( this ) ; } clearWorkingDateCache ( ) ; }
|
public class PolishWordTokenizer { /** * Tokenizes text .
* The Polish tokenizer differs from the standard one
* in the following respects :
* < ol >
* < li > it does not treat the hyphen as part of the
* word if the hyphen is at the end of the word ; < / li >
* < li > it includes n - dash and m - dash as tokenizing characters ,
* as these are not included in the spelling dictionary ;
* < li > it splits two kinds of compound words containing a hyphen ,
* such as < em > dziecko - geniusz < / em > ( two nouns ) ,
* < em > polsko - indonezyjski < / em > ( an ad - adjectival adjective and adjective ) ,
* < em > polsko - francusko - niemiecki < / em > ( two ad - adjectival adjectives and adjective ) ,
* or < em > osiemnaście - dwadzieścia < / em > ( two numerals )
* but not words in which the hyphen occurs before a morphological ending
* ( such as < em > SMS - y < / em > ) .
* < / ol >
* @ param text String of words to tokenize . */
@ Override public List < String > tokenize ( final String text ) { } }
|
final List < String > l = new ArrayList < > ( ) ; final StringTokenizer st = new StringTokenizer ( text , plTokenizing , true ) ; while ( st . hasMoreElements ( ) ) { final String token = st . nextToken ( ) ; if ( token . length ( ) > 1 ) { if ( token . endsWith ( "-" ) ) { l . add ( token . substring ( 0 , token . length ( ) - 1 ) ) ; l . add ( "-" ) ; } else if ( token . charAt ( 0 ) == '-' ) { l . add ( "-" ) ; l . addAll ( tokenize ( token . substring ( 1 , token . length ( ) ) ) ) ; } else if ( token . contains ( "-" ) ) { String [ ] tokenParts = token . split ( "-" ) ; if ( prefixes . contains ( tokenParts [ 0 ] ) || tagger == null ) { l . add ( token ) ; } else if ( Character . isDigit ( tokenParts [ tokenParts . length - 1 ] . charAt ( 0 ) ) ) { // split numbers at dash or minus sign , 1-10
for ( int i = 0 ; i < tokenParts . length ; i ++ ) { l . add ( tokenParts [ i ] ) ; if ( i != tokenParts . length - 1 ) { l . add ( "-" ) ; } } } else { List < String > testedTokens = new ArrayList < > ( tokenParts . length + 1 ) ; Collections . addAll ( testedTokens , tokenParts ) ; testedTokens . add ( token ) ; try { List < AnalyzedTokenReadings > taggedToks = tagger . tag ( testedTokens ) ; if ( taggedToks . size ( ) == tokenParts . length + 1 && ! taggedToks . get ( tokenParts . length ) . isTagged ( ) ) { boolean isCompound = false ; switch ( tokenParts . length ) { case 2 : if ( ( taggedToks . get ( 0 ) . hasPosTag ( "adja" ) // " niemiecko - indonezyjski "
&& taggedToks . get ( 1 ) . hasPartialPosTag ( "adj:" ) ) || ( taggedToks . get ( 0 ) . hasPartialPosTag ( "subst:" ) // " kobieta - wojownik "
&& taggedToks . get ( 1 ) . hasPartialPosTag ( "subst:" ) ) || ( taggedToks . get ( 0 ) . hasPartialPosTag ( "num:" ) // osiemnaście - dwadzieścia
&& taggedToks . get ( 1 ) . hasPartialPosTag ( "num:" ) ) ) { isCompound = true ; } break ; case 3 : if ( taggedToks . get ( 0 ) . hasPosTag ( "adja" ) && taggedToks . get ( 1 ) . hasPosTag ( "adja" ) && taggedToks . get ( 2 ) . hasPartialPosTag ( "adj:" ) ) { isCompound = true ; } break ; } if ( isCompound ) { for ( int i = 0 ; i < tokenParts . length ; i ++ ) { l . add ( tokenParts [ i ] ) ; if ( i != tokenParts . length - 1 ) { l . add ( "-" ) ; } } } else { l . add ( token ) ; } } else { l . add ( token ) ; } } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } } else { l . add ( token ) ; } } else { l . add ( token ) ; } } return joinEMailsAndUrls ( l ) ;
|
public class ToolTips { /** * Adds a data with label with coordinates ( xOffset , yOffset ) . This point will be highlighted with
* a circle centering ( xOffset , yOffset ) */
public void addData ( double xOffset , double yOffset , String label ) { } }
|
DataPoint dp = new DataPoint ( xOffset , yOffset , label ) ; dataPointList . add ( dp ) ;
|
public class Messenger { /** * Adding reaction to a message
* @ param peer destination peer
* @ param rid random id of message
* @ param code reaction code
* @ return Command for execution */
@ ObjectiveCName ( "addReactionWithPeer:withRid:withCode:" ) public Command < Void > addReaction ( Peer peer , long rid , String code ) { } }
|
return callback -> modules . getMessagesModule ( ) . addReaction ( peer , rid , code ) . then ( v -> callback . onResult ( v ) ) . failure ( e -> callback . onError ( e ) ) ;
|
public class SipSessionImpl { /** * Does it need to be synchronized ? */
protected Map < String , Object > getAttributeMap ( ) { } }
|
if ( this . sipSessionAttributeMap == null ) { this . sipSessionAttributeMap = new ConcurrentHashMap < String , Object > ( ) ; } return this . sipSessionAttributeMap ;
|
public class LocationHelper { /** * Register the listener with the Location Manager to receive location updates */
@ RequiresPermission ( anyOf = { } }
|
Manifest . permission . ACCESS_COARSE_LOCATION , Manifest . permission . ACCESS_FINE_LOCATION } ) public synchronized void startLocalization ( ) { if ( ! started && hasSignificantlyOlderLocation ( ) ) { started = true ; // get all enabled providers
List < String > enabledProviders = locationManager . getProviders ( true ) ; boolean gpsProviderEnabled = enabledProviders != null && enabledProviders . contains ( LocationManager . GPS_PROVIDER ) ; boolean networkProviderEnabled = enabledProviders != null && enabledProviders . contains ( LocationManager . NETWORK_PROVIDER ) ; if ( gpsProviderEnabled || networkProviderEnabled ) { if ( gpsProviderEnabled ) { locationManager . requestLocationUpdates ( LocationManager . GPS_PROVIDER , LOCATION_MIN_TIME , 0 , this ) ; } if ( networkProviderEnabled ) { locationManager . requestLocationUpdates ( LocationManager . NETWORK_PROVIDER , LOCATION_MIN_TIME , 0 , this ) ; } AlarmUtils . scheduleElapsedRealtimeAlarm ( SystemClock . elapsedRealtime ( ) + LOCATION_MAX_TIME , getCancelPendingIntent ( ) ) ; LOGGER . info ( "Localization started" ) ; } else { started = false ; LOGGER . info ( "All providers disabled" ) ; } }
|
public class IntervalCollection { /** * / * [ deutsch ]
* < p > Ermittelt die gemeinsame Schnittmenge . < / p >
* @ param other another interval collection
* @ return new interval collection with disjunct blocks containing all time points in both interval collections
* @ since 3.8/4.5 */
public IntervalCollection < T > intersect ( IntervalCollection < T > other ) { } }
|
if ( this . isEmpty ( ) || other . isEmpty ( ) ) { List < ChronoInterval < T > > zero = Collections . emptyList ( ) ; return this . create ( zero ) ; } List < ChronoInterval < T > > list = new ArrayList < > ( ) ; for ( ChronoInterval < T > a : this . intervals ) { for ( ChronoInterval < T > b : other . intervals ) { List < ChronoInterval < T > > candidates = new ArrayList < > ( 2 ) ; candidates . add ( a ) ; candidates . add ( b ) ; candidates . sort ( this . getComparator ( ) ) ; candidates = this . intersect ( candidates ) ; if ( ! candidates . isEmpty ( ) ) { list . addAll ( candidates ) ; } } } list . sort ( this . getComparator ( ) ) ; return this . create ( list ) . withBlocks ( ) ;
|
public class ImmutabilityTools { /** * This method takes a immutable boolean term and convert it into an old mutable boolean function . */
public Expression convertToMutableBooleanExpression ( ImmutableExpression booleanExpression ) { } }
|
OperationPredicate pred = booleanExpression . getFunctionSymbol ( ) ; return termFactory . getExpression ( pred , convertToMutableTerms ( booleanExpression . getTerms ( ) ) ) ;
|
public class JdbcQueue { /** * Setter for { @ link # jdbcHelper } .
* @ param jdbcHelper
* @ param setMyOwnJdbcHelper
* @ return
* @ since 0.7.1 */
protected JdbcQueue < ID , DATA > setJdbcHelper ( IJdbcHelper jdbcHelper , boolean setMyOwnJdbcHelper ) { } }
|
if ( this . jdbcHelper != null && myOwnJdbcHelper && this . jdbcHelper instanceof AbstractJdbcHelper ) { ( ( AbstractJdbcHelper ) this . jdbcHelper ) . destroy ( ) ; } this . jdbcHelper = jdbcHelper ; myOwnJdbcHelper = setMyOwnJdbcHelper ; return this ;
|
public class TypedQuery { /** * Execute the typed query and return an iterator of entities
* @ return Iterator & lt ; ENTITY & gt ; */
@ Override public Iterator < ENTITY > iterator ( ) { } }
|
StatementWrapper statementWrapper = new BoundStatementWrapper ( getOperationType ( boundStatement ) , meta , boundStatement , encodedBoundValues ) ; if ( LOGGER . isTraceEnabled ( ) ) { LOGGER . trace ( String . format ( "Generate iterator for typed query : %s" , statementWrapper . getBoundStatement ( ) . preparedStatement ( ) . getQueryString ( ) ) ) ; } CompletableFuture < ResultSet > futureRS = rte . execute ( statementWrapper ) ; return new EntityIteratorWrapper < > ( futureRS , meta , statementWrapper , options ) ;
|
public class KryoSerializer { /** * Utility method that takes lists of registered types and their serializers , and resolve
* them into a single list such that the result will resemble the final registration
* result in Kryo . */
private static LinkedHashMap < String , KryoRegistration > buildKryoRegistrations ( Class < ? > serializedType , LinkedHashSet < Class < ? > > registeredTypes , LinkedHashMap < Class < ? > , Class < ? extends Serializer < ? > > > registeredTypesWithSerializerClasses , LinkedHashMap < Class < ? > , ExecutionConfig . SerializableSerializer < ? > > registeredTypesWithSerializers ) { } }
|
final LinkedHashMap < String , KryoRegistration > kryoRegistrations = new LinkedHashMap < > ( ) ; kryoRegistrations . put ( serializedType . getName ( ) , new KryoRegistration ( serializedType ) ) ; for ( Class < ? > registeredType : checkNotNull ( registeredTypes ) ) { kryoRegistrations . put ( registeredType . getName ( ) , new KryoRegistration ( registeredType ) ) ; } for ( Map . Entry < Class < ? > , Class < ? extends Serializer < ? > > > registeredTypeWithSerializerClassEntry : checkNotNull ( registeredTypesWithSerializerClasses ) . entrySet ( ) ) { kryoRegistrations . put ( registeredTypeWithSerializerClassEntry . getKey ( ) . getName ( ) , new KryoRegistration ( registeredTypeWithSerializerClassEntry . getKey ( ) , registeredTypeWithSerializerClassEntry . getValue ( ) ) ) ; } for ( Map . Entry < Class < ? > , ExecutionConfig . SerializableSerializer < ? > > registeredTypeWithSerializerEntry : checkNotNull ( registeredTypesWithSerializers ) . entrySet ( ) ) { kryoRegistrations . put ( registeredTypeWithSerializerEntry . getKey ( ) . getName ( ) , new KryoRegistration ( registeredTypeWithSerializerEntry . getKey ( ) , registeredTypeWithSerializerEntry . getValue ( ) ) ) ; } // add Avro support if flink - avro is available ; a dummy otherwise
AvroUtils . getAvroUtils ( ) . addAvroGenericDataArrayRegistration ( kryoRegistrations ) ; return kryoRegistrations ;
|
public class UnixPath { /** * Returns { @ code true } if { @ code path } starts with { @ code other } .
* @ see java . nio . file . Path # startsWith ( java . nio . file . Path ) */
public boolean startsWith ( UnixPath other ) { } }
|
UnixPath me = removeTrailingSeparator ( ) ; other = other . removeTrailingSeparator ( ) ; if ( other . path . length ( ) > me . path . length ( ) ) { return false ; } else if ( me . isAbsolute ( ) != other . isAbsolute ( ) ) { return false ; } else if ( ! me . path . isEmpty ( ) && other . path . isEmpty ( ) ) { return false ; } return startsWith ( split ( ) , other . split ( ) ) ;
|
public class PercentileTimer { /** * Returns a PercentileTimer limited to the specified range . */
private PercentileTimer withRange ( long min , long max ) { } }
|
return ( this . min == min && this . max == max ) ? this : new PercentileTimer ( registry , id , min , max , counters ) ;
|
public class Permission { /** * The permission that you want to give to the AWS user that is listed in Grantee . Valid values include :
* < ul >
* < li >
* < code > READ < / code > : The grantee can read the thumbnails and metadata for thumbnails that Elastic Transcoder adds
* to the Amazon S3 bucket .
* < / li >
* < li >
* < code > READ _ ACP < / code > : The grantee can read the object ACL for thumbnails that Elastic Transcoder adds to the
* Amazon S3 bucket .
* < / li >
* < li >
* < code > WRITE _ ACP < / code > : The grantee can write the ACL for the thumbnails that Elastic Transcoder adds to the
* Amazon S3 bucket .
* < / li >
* < li >
* < code > FULL _ CONTROL < / code > : The grantee has READ , READ _ ACP , and WRITE _ ACP permissions for the thumbnails that
* Elastic Transcoder adds to the Amazon S3 bucket .
* < / li >
* < / ul >
* @ param access
* The permission that you want to give to the AWS user that is listed in Grantee . Valid values include : < / p >
* < ul >
* < li >
* < code > READ < / code > : The grantee can read the thumbnails and metadata for thumbnails that Elastic Transcoder
* adds to the Amazon S3 bucket .
* < / li >
* < li >
* < code > READ _ ACP < / code > : The grantee can read the object ACL for thumbnails that Elastic Transcoder adds to
* the Amazon S3 bucket .
* < / li >
* < li >
* < code > WRITE _ ACP < / code > : The grantee can write the ACL for the thumbnails that Elastic Transcoder adds to
* the Amazon S3 bucket .
* < / li >
* < li >
* < code > FULL _ CONTROL < / code > : The grantee has READ , READ _ ACP , and WRITE _ ACP permissions for the thumbnails
* that Elastic Transcoder adds to the Amazon S3 bucket .
* < / li > */
public void setAccess ( java . util . Collection < String > access ) { } }
|
if ( access == null ) { this . access = null ; return ; } this . access = new com . amazonaws . internal . SdkInternalList < String > ( access ) ;
|
public class StoreFactory { /** * Creates a fixed - capacity { @ link krati . store . DataStore DataStore } with the default parameters below .
* < pre >
* batchSize : 10000
* numSyncBatches : 10
* segmentCompactFactor : 0.5
* < / pre >
* @ param homeDir - the store home directory
* @ param capacity - the store capacity which cannot be changed after the store is created
* @ param segmentFileSizeMB - the segment size in MB
* @ param segmentFactory - the segment factory
* @ return A fixed - capacity DataStore .
* @ throws Exception if the store cannot be created . */
public static StaticDataStore createStaticDataStore ( File homeDir , int capacity , int segmentFileSizeMB , SegmentFactory segmentFactory ) throws Exception { } }
|
int batchSize = StoreParams . BATCH_SIZE_DEFAULT ; int numSyncBatches = StoreParams . NUM_SYNC_BATCHES_DEFAULT ; double segmentCompactFactor = StoreParams . SEGMENT_COMPACT_FACTOR_DEFAULT ; return createStaticDataStore ( homeDir , capacity , batchSize , numSyncBatches , segmentFileSizeMB , segmentFactory , segmentCompactFactor ) ;
|
public class XBProjector { /** * Ensures that the given object is a projection created by a projector .
* @ param projection
* @ return */
private DOMAccess checkProjectionInstance ( final Object projection ) { } }
|
if ( java . lang . reflect . Proxy . isProxyClass ( projection . getClass ( ) ) ) { InvocationHandler invocationHandler = java . lang . reflect . Proxy . getInvocationHandler ( projection ) ; if ( invocationHandler instanceof ProjectionInvocationHandler ) { if ( projection instanceof DOMAccess ) { return ( DOMAccess ) projection ; } } } throw new IllegalArgumentException ( "Given object " + projection + " is not a projection." ) ;
|
public class JspViewDeclarationLanguageBase { /** * { @ inheritDoc } */
@ Override public void renderView ( FacesContext context , UIViewRoot view ) throws IOException { } }
|
// Try not to use native objects in this class . Both MyFaces and the bridge
// provide implementations of buildView but they do not override this class .
checkNull ( context , "context" ) ; checkNull ( view , "view" ) ; // do not render the view if the rendered attribute for the view is false
if ( ! view . isRendered ( ) ) { if ( log . isLoggable ( Level . FINEST ) ) { log . finest ( "View is not rendered" ) ; } return ; } // Check if the current view has already been built via VDL . buildView ( )
// and if not , build it from here . This is necessary because legacy ViewHandler
// implementations return null on getViewDeclarationLanguage ( ) and thus
// VDL . buildView ( ) is never called . Furthermore , before JSF 2.0 introduced
// the VDLs , the code that built the view was in ViewHandler . renderView ( ) .
if ( ! isViewBuilt ( context , view ) ) { buildView ( context , view ) ; } ExternalContext externalContext = context . getExternalContext ( ) ; String viewId = context . getViewRoot ( ) . getViewId ( ) ; if ( log . isLoggable ( Level . FINEST ) ) { log . finest ( "Rendering JSP view: " + viewId ) ; } // handle character encoding as of section 2.5.2.2 of JSF 1.1
if ( null != externalContext . getSession ( false ) ) { externalContext . getSessionMap ( ) . put ( ViewHandler . CHARACTER_ENCODING_KEY , externalContext . getResponseCharacterEncoding ( ) ) ; } // render the view in this method ( since JSF 1.2)
RenderKitFactory renderFactory = ( RenderKitFactory ) FactoryFinder . getFactory ( FactoryFinder . RENDER_KIT_FACTORY ) ; RenderKit renderKit = renderFactory . getRenderKit ( context , view . getRenderKitId ( ) ) ; ResponseWriter responseWriter = context . getResponseWriter ( ) ; if ( responseWriter == null ) { responseWriter = renderKit . createResponseWriter ( externalContext . getResponseOutputWriter ( ) , null , externalContext . getRequestCharacterEncoding ( ) ) ; context . setResponseWriter ( responseWriter ) ; } // try to enable the ResponseSwitch again ( disabled in buildView ( ) )
Object response = context . getExternalContext ( ) . getResponse ( ) ; ResponseSwitch responseSwitch = getResponseSwitch ( response ) ; if ( responseSwitch != null ) { responseSwitch . setEnabled ( true ) ; } ResponseWriter oldResponseWriter = responseWriter ; StringWriter stateAwareWriter = null ; StateManager stateManager = context . getApplication ( ) . getStateManager ( ) ; boolean viewStateAlreadyEncoded = isViewStateAlreadyEncoded ( context ) ; if ( ! viewStateAlreadyEncoded ) { // we will need to parse the reponse and replace the view _ state token with the actual state
stateAwareWriter = new StringWriter ( ) ; // Create a new response - writer using as an underlying writer the stateAwareWriter
// Effectively , all output will be buffered in the stateAwareWriter so that later
// this writer can replace the state - markers with the actual state .
responseWriter = oldResponseWriter . cloneWithWriter ( stateAwareWriter ) ; context . setResponseWriter ( responseWriter ) ; } try { if ( ! actuallyRenderView ( context , view ) ) { return ; } } finally { if ( oldResponseWriter != null ) { context . setResponseWriter ( oldResponseWriter ) ; } } if ( ! viewStateAlreadyEncoded ) { // parse the response and replace the token wit the state
flushBufferToWriter ( stateAwareWriter . getBuffer ( ) , externalContext . getResponseOutputWriter ( ) ) ; } else { stateManager . saveView ( context ) ; } // now disable the ResponseSwitch again
if ( responseSwitch != null ) { responseSwitch . setEnabled ( false ) ; } // Final step - we output any content in the wrappedResponse response from above to the response ,
// removing the wrappedResponse response from the request , we don ' t need it anymore
ViewResponseWrapper afterViewTagResponse = ( ViewResponseWrapper ) externalContext . getRequestMap ( ) . get ( AFTER_VIEW_TAG_CONTENT_PARAM ) ; externalContext . getRequestMap ( ) . remove ( AFTER_VIEW_TAG_CONTENT_PARAM ) ; // afterViewTagResponse is null if the current request is a partial request
if ( afterViewTagResponse != null ) { afterViewTagResponse . flushToWriter ( externalContext . getResponseOutputWriter ( ) , externalContext . getResponseCharacterEncoding ( ) ) ; } // TODO sobryan : Is this right ?
context . getResponseWriter ( ) . flush ( ) ;
|
public class RDF4JHelper { /** * TODO : could we have a RDF sub - class of ValueConstant ? */
public static Literal getLiteral ( ValueConstant literal ) { } }
|
Objects . requireNonNull ( literal ) ; TermType type = literal . getType ( ) ; if ( ! ( type instanceof RDFDatatype ) ) // TODO : throw a proper exception
throw new IllegalStateException ( "A ValueConstant given to OWLAPI must have a RDF datatype" ) ; RDFDatatype datatype = ( RDFDatatype ) type ; return datatype . getLanguageTag ( ) . map ( lang -> fact . createLiteral ( literal . getValue ( ) , lang . getFullString ( ) ) ) . orElseGet ( ( ) -> fact . createLiteral ( literal . getValue ( ) , fact . createIRI ( datatype . getIRI ( ) . getIRIString ( ) ) ) ) ;
|
public class CResponse { /** * Open a raw stream on the response body .
* @ return The stream */
public InputStream openStream ( ) { } }
|
if ( entity == null ) { return null ; } try { return entity . getContent ( ) ; } catch ( IOException ex ) { throw new CStorageException ( "Can't open stream" , ex ) ; }
|
public class MetadataUtils { /** * Gets the embedded collection instance .
* @ param embeddedCollectionField
* the embedded collection field
* @ return the embedded collection instance */
public static Collection getEmbeddedCollectionInstance ( Field embeddedCollectionField ) { } }
|
Collection embeddedCollection = null ; Class embeddedCollectionFieldClass = embeddedCollectionField . getType ( ) ; if ( embeddedCollection == null || embeddedCollection . isEmpty ( ) ) { if ( embeddedCollectionFieldClass . equals ( List . class ) ) { embeddedCollection = new ArrayList < Object > ( ) ; } else if ( embeddedCollectionFieldClass . equals ( Set . class ) ) { embeddedCollection = new HashSet < Object > ( ) ; } else { throw new InvalidEntityDefinitionException ( "Field " + embeddedCollectionField . getName ( ) + " must be either instance of List or Set" ) ; } } return embeddedCollection ;
|
public class JavacParser { /** * Return the lesser of two positions , making allowance for either one
* being unset . */
static int earlier ( int pos1 , int pos2 ) { } }
|
if ( pos1 == Position . NOPOS ) return pos2 ; if ( pos2 == Position . NOPOS ) return pos1 ; return ( pos1 < pos2 ? pos1 : pos2 ) ;
|
public class Access { /** * Gets the .
* @ param _ accessType the access type
* @ param _ instances the instances
* @ return the access */
public static Access get ( final AccessType _accessType , final Collection < Instance > _instances ) { } }
|
return new Access ( _accessType , _instances ) ;
|
public class AWSLicenseManagerClient { /** * Modifies the attributes of an existing license configuration object . A license configuration is an abstraction of
* a customer license agreement that can be consumed and enforced by License Manager . Components include
* specifications for the license type ( Instances , cores , sockets , VCPUs ) , tenancy ( shared or Dedicated Host ) , host
* affinity ( how long a VM is associated with a host ) , the number of licenses purchased and used .
* @ param updateLicenseConfigurationRequest
* @ return Result of the UpdateLicenseConfiguration operation returned by the service .
* @ throws InvalidParameterValueException
* One or more parameter values are not valid .
* @ throws ServerInternalException
* The server experienced an internal error . Try again .
* @ throws AuthorizationException
* The AWS user account does not have permission to perform the action . Check the IAM policy associated with
* this account .
* @ throws AccessDeniedException
* Access to resource denied .
* @ throws RateLimitExceededException
* Too many requests have been submitted . Try again after a brief wait .
* @ sample AWSLicenseManager . UpdateLicenseConfiguration
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / license - manager - 2018-08-01 / UpdateLicenseConfiguration "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public UpdateLicenseConfigurationResult updateLicenseConfiguration ( UpdateLicenseConfigurationRequest request ) { } }
|
request = beforeClientExecution ( request ) ; return executeUpdateLicenseConfiguration ( request ) ;
|
public class ProductPartition { /** * Sets the caseValue value for this ProductPartition .
* @ param caseValue * Dimension value with which this product partition is refining
* its parent . Undefined for the
* root partition . */
public void setCaseValue ( com . google . api . ads . adwords . axis . v201809 . cm . ProductDimension caseValue ) { } }
|
this . caseValue = caseValue ;
|
public class OgnlOps { /** * Returns the constant from the NumericTypes interface that best expresses the type
* of an operation , which can be either numeric or not , on the two given types .
* @ param localt1 type of one argument to an operator
* @ param localt2 type of the other argument
* @ param canBeNonNumeric whether the operator can be interpreted as non - numeric
* @ return the appropriate constant from the NumericTypes interface */
public static int getNumericType ( int t1 , int t2 , boolean canBeNonNumeric ) { } }
|
int localt1 = t1 ; int localt2 = t2 ; if ( localt1 == localt2 ) return localt1 ; if ( canBeNonNumeric && ( localt1 == NONNUMERIC || localt2 == NONNUMERIC || localt1 == CHAR || localt2 == CHAR ) ) return NONNUMERIC ; // Try to interpret strings as doubles . . .
if ( localt1 == NONNUMERIC ) { localt1 = DOUBLE ; } // Try to interpret strings as doubles . . .
if ( localt2 == NONNUMERIC ) { localt2 = DOUBLE ; } if ( localt1 >= MIN_REAL_TYPE ) { if ( localt2 >= MIN_REAL_TYPE ) return Math . max ( localt1 , localt2 ) ; if ( localt2 < INT ) return localt1 ; if ( localt2 == BIGINT ) return BIGDEC ; return Math . max ( DOUBLE , localt1 ) ; } else if ( localt2 >= MIN_REAL_TYPE ) { if ( localt1 < INT ) return localt2 ; if ( localt1 == BIGINT ) return BIGDEC ; return Math . max ( DOUBLE , localt2 ) ; } else return Math . max ( localt1 , localt2 ) ;
|
public class JDBCBackendDataSource { /** * Get connections .
* @ param connectionMode connection mode
* @ param dataSourceName data source name
* @ param connectionSize size of connections to get
* @ return connections
* @ throws SQLException SQL exception */
public List < Connection > getConnections ( final ConnectionMode connectionMode , final String dataSourceName , final int connectionSize ) throws SQLException { } }
|
return getConnections ( connectionMode , dataSourceName , connectionSize , TransactionType . LOCAL ) ;
|
public class StringUtils { /** * https : / / developer . apple . com / reference / foundation / nsstring / 1411141 - stringbydeletinglastpathcomponen */
public static String stringByDeletingLastPathComponent ( final String str ) { } }
|
String path = str ; int start = str . length ( ) - 1 ; while ( path . charAt ( start ) == '/' ) { start -- ; } final int index = path . lastIndexOf ( '/' , start ) ; path = ( index < 0 ) ? "" : path . substring ( 0 , index ) ; if ( path . length ( ) == 0 && str . charAt ( 0 ) == '/' ) { return "/" ; } return path ;
|
public class ListStepsResult { /** * The filtered list of steps for the cluster .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setSteps ( java . util . Collection ) } or { @ link # withSteps ( java . util . Collection ) } if you want to override the
* existing values .
* @ param steps
* The filtered list of steps for the cluster .
* @ return Returns a reference to this object so that method calls can be chained together . */
public ListStepsResult withSteps ( StepSummary ... steps ) { } }
|
if ( this . steps == null ) { setSteps ( new com . amazonaws . internal . SdkInternalList < StepSummary > ( steps . length ) ) ; } for ( StepSummary ele : steps ) { this . steps . add ( ele ) ; } return this ;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.