signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ConfigClient { /** * Lists all the exclusions in a parent resource . * < p > Sample code : * < pre > < code > * try ( ConfigClient configClient = ConfigClient . create ( ) ) { * ParentName parent = ProjectName . of ( " [ PROJECT ] " ) ; * for ( LogExclusion element : configClient . listExclusions ( parent ) . iterateAll ( ) ) { * / / doThingsWith ( element ) ; * < / code > < / pre > * @ param parent Required . The parent resource whose exclusions are to be listed . * < p > " projects / [ PROJECT _ ID ] " " organizations / [ ORGANIZATION _ ID ] " * " billingAccounts / [ BILLING _ ACCOUNT _ ID ] " " folders / [ FOLDER _ ID ] " * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ public final ListExclusionsPagedResponse listExclusions ( ParentName parent ) { } }
ListExclusionsRequest request = ListExclusionsRequest . newBuilder ( ) . setParent ( parent == null ? null : parent . toString ( ) ) . build ( ) ; return listExclusions ( request ) ;
public class InstallerModule { /** * Instantiate all found installers using default constructor . * @ param installerClasses found installer classes * @ return list of installer instances */ private List < FeatureInstaller > prepareInstallers ( final List < Class < ? extends FeatureInstaller > > installerClasses ) { } }
final List < FeatureInstaller > installers = Lists . newArrayList ( ) ; // different instance then used in guice context , but it ' s just an accessor object final Options options = new Options ( context . options ( ) ) ; for ( Class < ? extends FeatureInstaller > installerClass : installerClasses ) { try { final FeatureInstaller installer = installerClass . newInstance ( ) ; installers . add ( installer ) ; if ( WithOptions . class . isAssignableFrom ( installerClass ) ) { ( ( WithOptions ) installer ) . setOptions ( options ) ; } } catch ( Exception e ) { throw new IllegalStateException ( "Failed to register installer " + installerClass . getName ( ) , e ) ; } } return installers ;
public class IPAddressSection { /** * overridden in ipv6 to handle zone */ protected String toHexString ( boolean with0xPrefix , CharSequence zone ) { } }
if ( isDualString ( ) ) { return toNormalizedStringRange ( toIPParams ( with0xPrefix ? IPStringCache . hexPrefixedParams : IPStringCache . hexParams ) , getLower ( ) , getUpper ( ) , zone ) ; } return toIPParams ( with0xPrefix ? IPStringCache . hexPrefixedParams : IPStringCache . hexParams ) . toString ( this , zone ) ;
public class AbstractConfigurableTemplateResolver { /** * Sets all the new template aliases to be used . * Template aliases allow the use of several ( and probably shorter ) * names for templates . * Aliases are applied to template names < b > before < / b > prefix / suffix . * @ param templateAliases the new template aliases . */ public final void setTemplateAliases ( final Map < String , String > templateAliases ) { } }
if ( templateAliases != null ) { this . templateAliases . putAll ( templateAliases ) ; }
public class CommsByteBuffer { /** * This method performs the < strong > exact < / strong > same function as the < code > putMessage < / code > * method except that any odd exceptions that occur during message encoding are wrapped in an * SIResourceException so that they can be thrown directly to the client Core SPI app . * @ param message * @ param commsConnection * @ param conversation * @ return Returns the message length . * @ throws SIConnectionDroppedException if the connection is dropped . * @ throws SIResourceException if the message fails to be encoded . */ public synchronized int putClientMessage ( SIBusMessage message , CommsConnection commsConnection , Conversation conversation ) throws SIConnectionDroppedException , SIResourceException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "putClientMessage" , new Object [ ] { message , commsConnection , conversation } ) ; int msgLength = 0 ; try { msgLength = putMessage ( ( JsMessage ) message , commsConnection , conversation ) ; } catch ( UnsupportedEncodingException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".putClientMessage" , CommsConstants . COMMSBYTEBUFFER_PUTCLIENTMSG_01 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Caught unsupported encoding exception" , e ) ; throw new SIResourceException ( e ) ; } catch ( MessageCopyFailedException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".putClientMessage" , CommsConstants . COMMSBYTEBUFFER_PUTCLIENTMSG_02 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Caught message copy failed exception" , e ) ; throw new SIResourceException ( e ) ; } catch ( IncorrectMessageTypeException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".putClientMessage" , CommsConstants . COMMSBYTEBUFFER_PUTCLIENTMSG_03 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Caught incorrect message type exception" , e ) ; throw new SIResourceException ( e ) ; } catch ( MessageEncodeFailedException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".putClientMessage" , CommsConstants . COMMSBYTEBUFFER_PUTCLIENTMSG_04 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Caught message encoding failed exception" , e ) ; throw new SIResourceException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "putClientMessage" , msgLength ) ; return msgLength ;
public class TagRenderingBase { /** * This method will render all of the general attributes . */ protected void renderGeneral ( HashMap map , AbstractRenderAppender sb , boolean doubleQuote ) { } }
if ( map == null ) return ; Iterator iterator = map . keySet ( ) . iterator ( ) ; for ( ; iterator . hasNext ( ) ; ) { String key = ( String ) iterator . next ( ) ; if ( key == null ) continue ; String value = ( String ) map . get ( key ) ; if ( doubleQuote ) renderAttribute ( sb , key , value ) ; else renderAttributeSingleQuotes ( sb , key , value ) ; }
public class AmazonSimpleEmailServiceClient { /** * Adds a domain to the list of identities for your Amazon SES account in the current AWS Region and attempts to * verify it . For more information about verifying domains , see < a * href = " http : / / docs . aws . amazon . com / ses / latest / DeveloperGuide / verify - addresses - and - domains . html " > Verifying Email * Addresses and Domains < / a > in the < i > Amazon SES Developer Guide . < / i > * You can execute this operation no more than once per second . * @ param verifyDomainIdentityRequest * Represents a request to begin Amazon SES domain verification and to generate the TXT records that you must * publish to the DNS server of your domain to complete the verification . For information about domain * verification , see the < a * href = " http : / / docs . aws . amazon . com / ses / latest / DeveloperGuide / verify - domains . html " > Amazon SES Developer * Guide < / a > . * @ return Result of the VerifyDomainIdentity operation returned by the service . * @ sample AmazonSimpleEmailService . VerifyDomainIdentity * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / email - 2010-12-01 / VerifyDomainIdentity " target = " _ top " > AWS API * Documentation < / a > */ @ Override public VerifyDomainIdentityResult verifyDomainIdentity ( VerifyDomainIdentityRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeVerifyDomainIdentity ( request ) ;
public class NNDescent { /** * Add cand to cur ' s heap neighbors with distance * @ param cur Current object * @ param cand Neighbor candidate * @ param distance Distance * @ return { @ code true } if it was a new neighbor . */ private boolean add ( DBIDRef cur , DBIDRef cand , double distance ) { } }
KNNHeap neighbors = store . get ( cur ) ; if ( neighbors . contains ( cand ) ) { return false ; } double newKDistance = neighbors . insert ( distance , cand ) ; return ( distance <= newKDistance ) ;
public class AppServiceEnvironmentsInner { /** * Create or update a worker pool . * Create or update a worker pool . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param name Name of the App Service Environment . * @ param workerPoolName Name of the worker pool . * @ param workerPoolEnvelope Properties of the worker pool . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable for the request */ public Observable < WorkerPoolResourceInner > createOrUpdateWorkerPoolAsync ( String resourceGroupName , String name , String workerPoolName , WorkerPoolResourceInner workerPoolEnvelope ) { } }
return createOrUpdateWorkerPoolWithServiceResponseAsync ( resourceGroupName , name , workerPoolName , workerPoolEnvelope ) . map ( new Func1 < ServiceResponse < WorkerPoolResourceInner > , WorkerPoolResourceInner > ( ) { @ Override public WorkerPoolResourceInner call ( ServiceResponse < WorkerPoolResourceInner > response ) { return response . body ( ) ; } } ) ;
public class AbstractGitFlowMojo { /** * Executes git commands to check for uncommitted changes . * @ return < code > true < / code > when there are uncommitted changes , * < code > false < / code > otherwise . * @ throws CommandLineException * @ throws MojoFailureException */ private boolean executeGitHasUncommitted ( ) throws MojoFailureException , CommandLineException { } }
boolean uncommited = false ; // 1 if there were differences and 0 means no differences // git diff - - no - ext - diff - - ignore - submodules - - quiet - - exit - code final CommandResult diffCommandResult = executeGitCommandExitCode ( "diff" , "--no-ext-diff" , "--ignore-submodules" , "--quiet" , "--exit-code" ) ; String error = null ; if ( diffCommandResult . getExitCode ( ) == SUCCESS_EXIT_CODE ) { // git diff - index - - cached - - quiet - - ignore - submodules HEAD - - final CommandResult diffIndexCommandResult = executeGitCommandExitCode ( "diff-index" , "--cached" , "--quiet" , "--ignore-submodules" , "HEAD" , "--" ) ; if ( diffIndexCommandResult . getExitCode ( ) != SUCCESS_EXIT_CODE ) { error = diffIndexCommandResult . getError ( ) ; uncommited = true ; } } else { error = diffCommandResult . getError ( ) ; uncommited = true ; } if ( StringUtils . isNotBlank ( error ) ) { throw new MojoFailureException ( error ) ; } return uncommited ;
public class EsMarshalling { /** * Marshals the given bean into the given map . * @ param bean the bean * @ return the content builder * @ throws StorageException when a storage problem occurs while storing a bean */ public static XContentBuilder marshall ( PoliciesBean bean ) throws StorageException { } }
try ( XContentBuilder builder = XContentFactory . jsonBuilder ( ) ) { preMarshall ( bean ) ; builder . startObject ( ) . field ( "organizationId" , bean . getOrganizationId ( ) ) . field ( "entityId" , bean . getEntityId ( ) ) . field ( "entityVersion" , bean . getEntityVersion ( ) ) . field ( "type" , bean . getType ( ) ) ; List < PolicyBean > policies = bean . getPolicies ( ) ; if ( policies != null && ! policies . isEmpty ( ) ) { builder . startArray ( "policies" ) ; for ( PolicyBean policy : policies ) { builder . startObject ( ) . field ( "id" , policy . getId ( ) ) . field ( "name" , policy . getName ( ) ) . field ( "configuration" , policy . getConfiguration ( ) ) . field ( "createdBy" , policy . getCreatedBy ( ) ) . field ( "createdOn" , policy . getCreatedOn ( ) . getTime ( ) ) . field ( "modifiedBy" , policy . getModifiedBy ( ) ) . field ( "modifiedOn" , policy . getModifiedOn ( ) . getTime ( ) ) . field ( "definitionId" , policy . getDefinition ( ) . getId ( ) ) . field ( "orderIndex" , policy . getOrderIndex ( ) ) . endObject ( ) ; } builder . endArray ( ) ; } builder . endObject ( ) ; postMarshall ( bean ) ; return builder ; } catch ( IOException e ) { throw new StorageException ( e ) ; }
public class AbstractBigtableAdmin { /** * < p > deleteRowRangeByPrefix . < / p > * @ param tableName a { @ link org . apache . hadoop . hbase . TableName } object . * @ param prefix an array of byte . * @ throws java . io . IOException if any . */ public void deleteRowRangeByPrefix ( TableName tableName , byte [ ] prefix ) throws IOException { } }
try { tableAdminClientWrapper . dropRowRange ( tableName . getNameAsString ( ) , Bytes . toString ( prefix ) ) ; } catch ( Throwable throwable ) { throw new IOException ( String . format ( "Failed to truncate table '%s'" , tableName . getNameAsString ( ) ) , throwable ) ; }
public class CodecCollector { /** * Grouped key name . * @ param key * the key * @ param baseRangeSize * the base range size * @ param baseRangeBase * the base range base * @ return the string */ private static String groupedKeyName ( String key , Double baseRangeSize , Double baseRangeBase ) { } }
final double precision = 0.000001 ; if ( baseRangeSize == null || baseRangeSize <= 0 ) { return key ; } else { Double doubleKey ; Double doubleBase ; Double doubleNumber ; Double doubleStart ; Double doubleEnd ; try { doubleKey = Double . parseDouble ( key ) ; doubleBase = baseRangeBase != null ? baseRangeBase : 0 ; doubleNumber = Math . floor ( ( doubleKey - doubleBase ) / baseRangeSize ) ; doubleStart = doubleBase + doubleNumber * baseRangeSize ; doubleEnd = doubleStart + baseRangeSize ; } catch ( NumberFormatException e ) { return key ; } // integer if ( Math . abs ( baseRangeSize - Math . floor ( baseRangeSize ) ) < precision && Math . abs ( doubleBase - Math . floor ( doubleBase ) ) < precision ) { try { if ( baseRangeSize > 1 ) { return String . format ( "%.0f" , doubleStart ) + "-" + String . format ( "%.0f" , doubleEnd - 1 ) ; } else { return String . format ( "%.0f" , doubleStart ) ; } } catch ( NumberFormatException e ) { return key ; } } else { return "[" + doubleStart + "," + doubleEnd + ")" ; } }
public class DayPeriod { /** * / * [ deutsch ] * < p > Ermittelt das Ende des Tagesabschnitts , der die angegebene Uhrzeit enth & auml ; lt . < / p > * @ param context the clock time a day period is searched for * @ return end of day period around given clock time , exclusive * @ see # getStart ( PlainTime ) * @ since 3.13/4.10 */ public PlainTime getEnd ( PlainTime context ) { } }
PlainTime compare = ( ( context . getHour ( ) == 24 ) ? PlainTime . midnightAtStartOfDay ( ) : context ) ; for ( PlainTime key : this . codeMap . keySet ( ) ) { if ( compare . isBefore ( key ) ) { return key ; } } return this . codeMap . firstKey ( ) ;
public class Configuration { /** * Initialize the taglet manager . The strings to initialize the simple custom tags should * be in the following format : " [ tag name ] : [ location str ] : [ heading ] " . * @ param customTagStrs the set two dimensional arrays of strings . These arrays contain * either - tag or - taglet arguments . */ private void initTagletManager ( Set < String [ ] > customTagStrs ) { } }
tagletManager = ( tagletManager == null ) ? new TagletManager ( nosince , showversion , showauthor , javafx , exportInternalAPI , message ) : tagletManager ; for ( String [ ] args : customTagStrs ) { if ( args [ 0 ] . equals ( "-taglet" ) ) { tagletManager . addCustomTag ( args [ 1 ] , getFileManager ( ) , tagletpath ) ; continue ; } String [ ] tokens = tokenize ( args [ 1 ] , TagletManager . SIMPLE_TAGLET_OPT_SEPARATOR , 3 ) ; if ( tokens . length == 1 ) { String tagName = args [ 1 ] ; if ( tagletManager . isKnownCustomTag ( tagName ) ) { // reorder a standard tag tagletManager . addNewSimpleCustomTag ( tagName , null , "" ) ; } else { // Create a simple tag with the heading that has the same name as the tag . StringBuilder heading = new StringBuilder ( tagName + ":" ) ; heading . setCharAt ( 0 , Character . toUpperCase ( tagName . charAt ( 0 ) ) ) ; tagletManager . addNewSimpleCustomTag ( tagName , heading . toString ( ) , "a" ) ; } } else if ( tokens . length == 2 ) { // Add simple taglet without heading , probably to excluding it in the output . tagletManager . addNewSimpleCustomTag ( tokens [ 0 ] , tokens [ 1 ] , "" ) ; } else if ( tokens . length >= 3 ) { tagletManager . addNewSimpleCustomTag ( tokens [ 0 ] , tokens [ 2 ] , tokens [ 1 ] ) ; } else { message . error ( "doclet.Error_invalid_custom_tag_argument" , args [ 1 ] ) ; } }
public class OperationFuture { /** * Get the CAS for this operation . * The interrupted status of the current thread is cleared by this method . * Inspect the returned OperationStatus to check whether an interruption has taken place . * @ throws UnsupportedOperationException If this is for an ASCII protocol * configured client . * @ return the CAS for this operation or null if unsuccessful . */ public Long getCas ( ) { } }
if ( cas == null ) { try { get ( ) ; } catch ( InterruptedException e ) { status = new OperationStatus ( false , "Interrupted" , StatusCode . INTERRUPTED ) ; } catch ( ExecutionException e ) { getLogger ( ) . warn ( "Error getting cas of operation" , e ) ; } } if ( cas == null && status . isSuccess ( ) ) { throw new UnsupportedOperationException ( "This operation doesn't return" + "a cas value." ) ; } return cas ;
public class BlackDuckService { public void put ( BlackDuckView blackDuckView ) throws IntegrationException { } }
if ( blackDuckView . getHref ( ) . isPresent ( ) ) { String uri = blackDuckView . getHref ( ) . get ( ) ; // add the ' missing ' pieces back from view that could have been lost String json = blackDuckJsonTransformer . producePatchedJson ( blackDuckView ) ; Request request = RequestFactory . createCommonPutRequestBuilder ( json ) . uri ( uri ) . build ( ) ; try ( Response response = execute ( request ) ) { } catch ( IOException e ) { throw new IntegrationException ( e . getMessage ( ) , e ) ; } }
public class GeldKarteParser { /** * Method used to get the transaction type * @ param logstate the log state * @ return the transaction type or null */ protected TransactionTypeEnum getType ( byte logstate ) { } }
switch ( ( logstate & 0x60 ) >> 5 ) { case 0 : return TransactionTypeEnum . LOADED ; case 1 : return TransactionTypeEnum . UNLOADED ; case 2 : return TransactionTypeEnum . PURCHASE ; case 3 : return TransactionTypeEnum . REFUND ; } return null ;
public class PdfContentByte { /** * Adds a template to this content . * @ param template the template * @ param a an element of the transformation matrix * @ param b an element of the transformation matrix * @ param c an element of the transformation matrix * @ param d an element of the transformation matrix * @ param e an element of the transformation matrix * @ param f an element of the transformation matrix */ public void addTemplate ( PdfTemplate template , float a , float b , float c , float d , float e , float f ) { } }
checkWriter ( ) ; checkNoPattern ( template ) ; PdfName name = writer . addDirectTemplateSimple ( template , null ) ; PageResources prs = getPageResources ( ) ; name = prs . addXObject ( name , template . getIndirectReference ( ) ) ; content . append ( "q " ) ; content . append ( a ) . append ( ' ' ) ; content . append ( b ) . append ( ' ' ) ; content . append ( c ) . append ( ' ' ) ; content . append ( d ) . append ( ' ' ) ; content . append ( e ) . append ( ' ' ) ; content . append ( f ) . append ( " cm " ) ; content . append ( name . getBytes ( ) ) . append ( " Do Q" ) . append_i ( separator ) ;
public class CollationController { /** * remove columns from @ param filter where we already have data in @ param container newer than @ param sstableTimestamp */ private void reduceNameFilter ( QueryFilter filter , ColumnFamily container , long sstableTimestamp ) { } }
if ( container == null ) return ; for ( Iterator < CellName > iterator = ( ( NamesQueryFilter ) filter . filter ) . columns . iterator ( ) ; iterator . hasNext ( ) ; ) { CellName filterColumn = iterator . next ( ) ; Cell cell = container . getColumn ( filterColumn ) ; if ( cell != null && cell . timestamp ( ) > sstableTimestamp ) iterator . remove ( ) ; }
public class WritingRepository { /** * Speichert ein Blob im Repository . * @ param blob * zu speicherndes Blob * @ return Id , unter der das Blob abgelegt wurde * @ throws IOException */ public String store ( Blob blob ) throws IOException { } }
File blobFile = File . createTempFile ( getClass ( ) . getName ( ) , null , strategy . tempDir ( ) ) ; BufferedOutputStream outputStream = new BufferedOutputStream ( new FileOutputStream ( blobFile ) ) ; blob . writeToStream ( outputStream ) ; if ( strategy instanceof FileRepositoryStrategy ) { ( ( FileRepositoryStrategy ) strategy ) . storeFileByRename ( blob . id ( ) , blobFile ) ; } else { strategy . store ( blob . id ( ) , new FileInputStream ( blobFile ) ) ; } return blob . id ( ) ;
public class UpdatableResultSet { /** * { inheritDoc } . */ public void updateInt ( int columnIndex , int value ) throws SQLException { } }
checkUpdatable ( columnIndex ) ; parameterHolders [ columnIndex - 1 ] = new IntParameter ( value ) ;
public class ElementIdMap { /** * Method called when size ( number of entries ) of symbol table grows * so big that load factor is exceeded . Since size has to remain * power of two , arrays will then always be doubled . Main work * is really redistributing old entries into new String / Bucket * entries . */ private void rehash ( ) { } }
int size = mTable . length ; /* Let ' s grow aggressively ; this should minimize number of * resizes , while adding to mem usage . But since these Maps * are never long - lived ( only during parsing and validation of * a single doc ) , that shouldn ' t greatly matter . */ int newSize = ( size << 2 ) ; ElementId [ ] oldSyms = mTable ; mTable = new ElementId [ newSize ] ; // Let ' s update index mask , threshold , now ( needed for rehashing ) mIndexMask = newSize - 1 ; mSizeThreshold <<= 2 ; int count = 0 ; // let ' s do sanity check for ( int i = 0 ; i < size ; ++ i ) { for ( ElementId id = oldSyms [ i ] ; id != null ; ) { ++ count ; int index = calcHash ( id . getId ( ) ) & mIndexMask ; ElementId nextIn = id . nextColliding ( ) ; id . setNextColliding ( mTable [ index ] ) ; mTable [ index ] = id ; id = nextIn ; } } if ( count != mSize ) { ExceptionUtil . throwInternal ( "on rehash(): had " + mSize + " entries; now have " + count + "." ) ; }
public class SibRaSynchronizedDispatcher { /** * The method reads a message from a handle . This is z / os specific method * @ param The handle associated with the message to read * @ return The message */ protected SIBusMessage readMessage ( SIMessageHandle handle ) throws ResourceException , SIMessageNotLockedException { } }
final String methodName = "beforeDelivery" ; if ( TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName , handle ) ; } /* * Delete the message under the transaction */ SIBusMessage message = readAndDeleteMessage ( handle , getTransactionForDelete ( ) ) ; if ( TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName , message ) ; } return message ;
public class ImageVectorizer { /** * Gets an image vectorization result from the pool , waiting if necessary . * @ return the vectorization result * @ throws Exception * for a failed vectorization task */ public ImageVectorizationResult getImageVectorizationResultWait ( ) throws Exception { } }
try { ImageVectorizationResult imvr = pool . take ( ) . get ( ) ; return imvr ; } catch ( Exception e ) { throw e ; } finally { // in any case ( Exception or not ) the numPendingTask should be reduced numPendingTasks -- ; }
public class LogChannel { /** * This method will only be called AFTER affirming that we should be logging */ void log ( SessionLogEntry entry , String formattedMessage ) { } }
int level = entry . getLevel ( ) ; Throwable loggedException = entry . getException ( ) ; String msgParm ; if ( ( formattedMessage == null || formattedMessage . equals ( "" ) ) && loggedException != null ) { msgParm = loggedException . toString ( ) ; } else { msgParm = "[" + this . channel + "] " + formattedMessage ; } switch ( level ) { case 8 : return ; case 7 : // SEVERE Tr . error ( _tc , "PROVIDER_ERROR_CWWJP9992E" , msgParm ) ; break ; case 6 : // WARN Tr . warning ( _tc , "PROVIDER_WARNING_CWWJP9991W" , msgParm ) ; break ; case 5 : // INFO Tr . info ( _tc , "PROVIDER_INFO_CWWJP9990I" , msgParm ) ; break ; case 4 : // CONFIG // I ' m not sure what to do with this level . . . just do ( log ) it . Tr . info ( _tc , "PROVIDER_INFO_CWWJP9990I" , msgParm ) ; break ; case 3 : // FINE case 2 : // FINER case 1 : // FINEST case 0 : // TRACE Tr . debug ( _tc , formattedMessage ) ; break ; } // end switch // if there is an exception - only log it to trace if ( _tc . isDebugEnabled ( ) && loggedException != null ) { Tr . debug ( _tc , "throwable" , loggedException ) ; }
public class GISCoordinates { /** * This function convert France Lambert 93 coordinate to geographic WSG84 Data . * @ param x is the coordinate in France Lambert 93 * @ param y is the coordinate in France Lambert 93 * @ return lambda and phi in geographic WSG84 in degrees . */ @ Pure public static GeodesicPosition L93_WSG84 ( double x , double y ) { } }
final Point2d ntfLambdaPhi = NTFLambert_NTFLambdaPhi ( x , y , LAMBERT_93_N , LAMBERT_93_C , LAMBERT_93_XS , LAMBERT_93_YS ) ; return NTFLambdaPhi_WSG84 ( ntfLambdaPhi . getX ( ) , ntfLambdaPhi . getY ( ) ) ;
public class SessionBeanImpl { /** * Initializes the bean and its metadata */ @ Override public void internalInitialize ( BeanDeployerEnvironment environment ) { } }
super . internalInitialize ( environment ) ; checkEJBTypeAllowed ( ) ; checkConflictingRoles ( ) ; checkObserverMethods ( ) ; checkScopeAllowed ( ) ;
public class ConnectionDAODefaultImpl { public String adm_name ( final Connection connection ) throws DevFailed { } }
checkIfTango ( connection , "adm_name" ) ; build_connection ( connection ) ; String name = null ; try { name = connection . device . adm_name ( ) ; } catch ( final Exception e ) { ApiUtilDAODefaultImpl . removePendingRepliesOfDevice ( connection ) ; throw_dev_failed ( connection , e , "adm_name" , false ) ; } if ( name != null && ! name . startsWith ( "tango://" ) && ! name . startsWith ( "//" ) ) name = "tango://" + connection . url . host + ":" + connection . url . port + "/" + name ; // If no database , add syntax to be used in DeviceProxy constructor . if ( ! connection . url . use_db ) { name += "#dbase=no" ; } return name ;
public class HtmlBaseTag { /** * Gets the onClick javascript event . * @ return the onClick event . */ public String getOnClick ( ) { } }
AbstractHtmlState tsh = getState ( ) ; return tsh . getAttribute ( AbstractHtmlState . ATTR_JAVASCRIPT , ONCLICK ) ;
public class JavaEncrypt { /** * RSA加密 * @ param string { @ link String } * @ return { @ link String } * @ throws BadPaddingException 异常 * @ throws IllegalBlockSizeException 异常 * @ throws UnsupportedEncodingException 异常 * @ throws NoSuchPaddingException 异常 * @ throws NoSuchAlgorithmException 异常 * @ throws InvalidKeyException 异常 */ public static String rsa ( String string ) throws InvalidKeyException , NoSuchAlgorithmException , NoSuchPaddingException , UnsupportedEncodingException , IllegalBlockSizeException , BadPaddingException { } }
return cryptDES ( string , Cipher . ENCRYPT_MODE , "RSA" ) ;
public class MathUtil { /** * Returns true iff { @ code left } and { @ code right } are finite values within { @ code tolerance } of * each other . Note that both this method and { @ link # notEqualWithinTolerance } returns false if * either { @ code left } or { @ code right } is infinite or NaN . */ public static boolean equalWithinTolerance ( double left , double right , double tolerance ) { } }
return Math . abs ( left - right ) <= Math . abs ( tolerance ) ;
public class PhotosetsApi { /** * Remove multiple photos from a photoset . * < br > * This method requires authentication with ' write ' permission . * < br > * Note : This method requires an HTTP POST request . * @ param photosetId id of the photoset to remove a photo from . * @ param photoIds list of photo id ' s to remove from the photoset . * @ return an empty success response if it completes without error . * @ throws JinxException if any parameter is null or empty , or if there are other errors . * @ see < a href = " https : / / www . flickr . com / services / api / flickr . photosets . removePhotos . html " > flickr . photosets . removePhotos < / a > */ public Response removePhotos ( String photosetId , List < String > photoIds ) throws JinxException { } }
JinxUtils . validateParams ( photosetId , photoIds ) ; Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.photosets.removePhotos" ) ; params . put ( "photoset_id" , photosetId ) ; params . put ( "photo_ids" , JinxUtils . buildCommaDelimitedList ( photoIds ) ) ; return jinx . flickrPost ( params , Response . class ) ;
public class GitlabAPI { /** * Get project badges * @ param projectId The id of the project for which the badges should be retrieved * @ return The list of badges * @ throws IOException on GitLab API call error */ public List < GitlabBadge > getProjectBadges ( Serializable projectId ) throws IOException { } }
String tailUrl = GitlabProject . URL + "/" + sanitizeProjectId ( projectId ) + GitlabBadge . URL ; return Arrays . asList ( retrieve ( ) . to ( tailUrl , GitlabBadge [ ] . class ) ) ;
public class Utils { /** * Converts a Java object to a srec value . * @ param o The Java object * @ return The srec value */ public static Value convertFromJava ( Object o ) { } }
if ( o instanceof Long ) { return new NumberValue ( new BigDecimal ( ( Long ) o ) ) ; } else if ( o instanceof Integer ) { return new NumberValue ( new BigDecimal ( ( Integer ) o ) ) ; } else if ( o instanceof Double ) { return new NumberValue ( new BigDecimal ( ( Double ) o ) ) ; } else if ( o instanceof Float ) { return new NumberValue ( new BigDecimal ( ( Float ) o ) ) ; } else if ( o instanceof String ) { return new StringValue ( ( String ) o ) ; } else if ( o instanceof Date ) { return new DateValue ( ( Date ) o ) ; } else if ( o instanceof Boolean ) { return BooleanValue . getInstance ( ( Boolean ) o ) ; } else if ( o == null ) { return NilValue . getInstance ( ) ; } throw new CommandExecutionException ( "Could not convert Java object " + o + " to an equivalent srec value" ) ;
public class ApiOvhMe { /** * Get xdsl settings linked to the nichandle * REST : GET / me / xdsl / setting */ public OvhSetting xdsl_setting_GET ( ) throws IOException { } }
String qPath = "/me/xdsl/setting" ; StringBuilder sb = path ( qPath ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhSetting . class ) ;
public class VersionRegEx { /** * Returns the lower of the two given versions by comparing them using their natural * ordering . If both versions are equal , then the first argument is returned . * @ param v1 The first version . * @ param v2 The second version . * @ return The lower version . * @ throws IllegalArgumentException If either argument is < code > null < / code > . * @ since 0.4.0 */ public static VersionRegEx min ( VersionRegEx v1 , VersionRegEx v2 ) { } }
require ( v1 != null , "v1 is null" ) ; require ( v2 != null , "v2 is null" ) ; return compare ( v1 , v2 , false ) <= 0 ? v1 : v2 ;
public class SoyExpression { /** * Generates code to box the expression assuming that it is non - nullable and on the top of the * stack . */ private static void doBox ( CodeBuilder adapter , SoyRuntimeType type ) { } }
if ( type . isKnownSanitizedContent ( ) ) { FieldRef . enumReference ( ContentKind . valueOf ( ( ( SanitizedType ) type . soyType ( ) ) . getContentKind ( ) . name ( ) ) ) . accessStaticUnchecked ( adapter ) ; MethodRef . ORDAIN_AS_SAFE . invokeUnchecked ( adapter ) ; } else if ( type . isKnownString ( ) ) { MethodRef . STRING_DATA_FOR_VALUE . invokeUnchecked ( adapter ) ; } else if ( type . isKnownListOrUnionOfLists ( ) ) { MethodRef . LIST_IMPL_FOR_PROVIDER_LIST . invokeUnchecked ( adapter ) ; } else if ( type . isKnownLegacyObjectMapOrUnionOfMaps ( ) ) { FieldRef . enumReference ( RuntimeMapTypeTracker . Type . LEGACY_OBJECT_MAP_OR_RECORD ) . putUnchecked ( adapter ) ; MethodRef . DICT_IMPL_FOR_PROVIDER_MAP . invokeUnchecked ( adapter ) ; } else if ( type . isKnownMapOrUnionOfMaps ( ) ) { MethodRef . MAP_IMPL_FOR_PROVIDER_MAP . invokeUnchecked ( adapter ) ; } else if ( type . isKnownProtoOrUnionOfProtos ( ) ) { MethodRef . SOY_PROTO_VALUE_CREATE . invokeUnchecked ( adapter ) ; } else { throw new IllegalStateException ( "Can't box soy expression of type " + type ) ; }
public class QAttribute { /** * { @ inheritDoc } */ @ Override public AbstractQPart prepare ( final AbstractTypeQuery _query , final AbstractQPart _part ) throws EFapsException { } }
if ( _part instanceof AbstractQAttrCompare ) { this . ignoreCase = ( ( AbstractQAttrCompare ) _part ) . isIgnoreCase ( ) ; } if ( this . attribute == null ) { if ( _query . getBaseType ( ) . getAttributes ( ) . containsKey ( this . attributeName ) ) { this . attribute = _query . getBaseType ( ) . getAttribute ( this . attributeName ) ; } else { QAttribute . LOG . error ( "Could not get attribute with Name '{}' for type: '{}'" , this . attributeName , _query . getBaseType ( ) ) ; throw new EFapsException ( getClass ( ) , "prepare" , this . attributeName ) ; } } this . tableIndex = _query . getIndex4SqlTable ( this . attribute . getTable ( ) ) ; return this ;
public class XmlParser { /** * Parse an entity declaration . * < pre > * [ 70 ] EntityDecl : : = GEDecl | PEDecl * [ 71 ] GEDecl : : = ' & lt ; ! ENTITY ' S Name S EntityDef S ? ' & gt ; ' * [ 72 ] PEDecl : : = ' & lt ; ! ENTITY ' S ' % ' S Name S PEDef S ? ' & gt ; ' * [ 73 ] EntityDef : : = EntityValue | ( ExternalID NDataDecl ? ) * [ 74 ] PEDef : : = EntityValue | ExternalID * [ 75 ] ExternalID : : = ' SYSTEM ' S SystemLiteral * | ' PUBLIC ' S PubidLiteral S SystemLiteral * [ 76 ] NDataDecl : : = S ' NDATA ' S Name * < / pre > * NOTE : the ' & lt ; ! ENTITY ' has already been read . */ private void parseEntityDecl ( ) throws Exception { } }
boolean peFlag = false ; int flags = 0 ; // Check for a parameter entity . expandPE = false ; requireWhitespace ( ) ; if ( tryRead ( '%' ) ) { peFlag = true ; requireWhitespace ( ) ; } expandPE = true ; // Read the entity name , and prepend // ' % ' if necessary . String name = readNmtoken ( true ) ; // NE08 if ( name . indexOf ( ':' ) >= 0 ) { fatal ( "Illegal character(':') in entity name " , name , null ) ; } if ( peFlag ) { name = "%" + name ; } // Read the entity value . requireWhitespace ( ) ; char c = readCh ( ) ; unread ( c ) ; if ( ( c == '"' ) || ( c == '\'' ) ) { // Internal entity . . . replacement text has expanded refs // to characters and PEs , but not to general entities String value = readLiteral ( flags ) ; setInternalEntity ( name , value ) ; } else { // Read the external IDs ExternalIdentifiers ids = readExternalIds ( false , false ) ; // Check for NDATA declaration . boolean white = tryWhitespace ( ) ; if ( ! peFlag && tryRead ( "NDATA" ) ) { if ( ! white ) { fatal ( "whitespace required before NDATA" ) ; } requireWhitespace ( ) ; String notationName = readNmtoken ( true ) ; if ( ! skippedPE ) { setExternalEntity ( name , ENTITY_NDATA , ids , notationName ) ; handler . unparsedEntityDecl ( name , ids . publicId , ids . systemId , ids . baseUri , notationName ) ; } } else if ( ! skippedPE ) { setExternalEntity ( name , ENTITY_TEXT , ids , null ) ; handler . getDeclHandler ( ) . externalEntityDecl ( name , ids . publicId , handler . resolveURIs ( ) // FIXME : ASSUMES not skipped // " false " forces error on bad URI ? handler . absolutize ( ids . baseUri , ids . systemId , false ) : ids . systemId ) ; } } // Finish the declaration . skipWhitespace ( ) ; require ( '>' ) ;
public class ComparableItemListImpl { /** * define a comparator which will be used to sort the list " everytime " it is altered * NOTE this will only sort if you " set " a new list or " add " new items ( not if you provide a position for the add function ) * @ param comparator used to sort the list * @ return this */ public ComparableItemListImpl < Item > withComparator ( @ Nullable Comparator < Item > comparator ) { } }
return withComparator ( comparator , true ) ;
public class AbstractJavaMetadata { /** * Gets a field meta data from { @ link FieldDeclaration } . * @ param fieldDeclaration - the declaration . * @ return fieldMetadata - meta data . */ protected FieldMetadata getFieldMetadataFrom ( FieldDeclaration fieldDeclaration ) { } }
if ( fieldDeclaration != null && fieldDeclaration . getType ( ) != null && ( ! fieldDeclaration . fragments ( ) . isEmpty ( ) ) ) { // type Type type = fieldDeclaration . getType ( ) ; // Primitive type if ( type . isPrimitiveType ( ) ) { return processPrimitiveType ( fieldDeclaration ) ; } // ParameterizedType if ( type . isParameterizedType ( ) ) { return processParameterizedType ( fieldDeclaration ) ; } // SimpleType if ( type . isSimpleType ( ) ) { return processSimpleType ( fieldDeclaration ) ; } // ArrayType if ( type . isArrayType ( ) ) { return processArrayTypeFrom ( fieldDeclaration ) ; } // QualifiedType if ( type . isQualifiedType ( ) ) { // TODO } // WildcardType if ( type . isWildcardType ( ) ) { // TODO } } return null ;
public class ShakeAroundAPI { /** * 页面管理 - 新增页面 * @ param accessToken accessToken * @ param pageAdd pageAdd * @ return result */ public static PageAddResult pageAdd ( String accessToken , PageAdd pageAdd ) { } }
return pageAdd ( accessToken , JsonUtil . toJSONString ( pageAdd ) ) ;
public class WSDLFilePublisher { /** * Get the file publish location */ private File getPublishLocation ( String serviceName , String archiveName , String wsdlLocation ) throws IOException { } }
if ( wsdlLocation == null && serviceName == null ) { Loggers . DEPLOYMENT_LOGGER . cannotGetWsdlPublishLocation ( ) ; return null ; } // JBWS - 2829 : windows issue if ( archiveName . startsWith ( "http://" ) ) { archiveName = archiveName . replace ( "http://" , "http-" ) ; } File locationFile = new File ( serverConfig . getServerDataDir ( ) . getCanonicalPath ( ) + "/wsdl/" + archiveName ) ; if ( wsdlLocation != null && wsdlLocation . indexOf ( expLocation ) >= 0 ) { wsdlLocation = wsdlLocation . substring ( wsdlLocation . indexOf ( expLocation ) + expLocation . length ( ) ) ; return new File ( locationFile + "/" + wsdlLocation ) ; } else if ( wsdlLocation != null && ! wsdlLocation . startsWith ( "vfs:" ) ) { for ( String wsdlLocationPrefix : wsdlLocationPrefixes ) { if ( wsdlLocation . startsWith ( wsdlLocationPrefix ) ) { return new File ( locationFile , encodeLocation ( wsdlLocation . substring ( wsdlLocationPrefix . length ( ) , wsdlLocation . lastIndexOf ( "/" ) + 1 ) ) ) ; } } return new File ( locationFile , encodeLocation ( wsdlLocation ) ) ; } else { return new File ( locationFile + "/" + serviceName + ".wsdl" ) ; }
public class ComponentCommander { /** * Browses recursively the components in order to find components with the name . * @ param name the component ' s name . * @ param components components to browse . * @ return the first component with the name . */ protected Component lookForComponent ( String name , ObservableList < Node > components ) { } }
for ( int i = 0 ; i < components . size ( ) && ! mFindWithEqual ; i ++ ) { // String componentName = ComponentNamer . getInstance ( ) . getNameForComponent ( components [ c ] ) ; Node c = components . get ( i ) ; checkName ( name , c ) ; if ( ! mFindWithEqual ) { if ( c instanceof Parent ) { Component result = lookForComponent ( name , ( ( Parent ) c ) . getChildrenUnmodifiable ( ) ) ; if ( result != null ) { return result ; } } } } return null ;
public class WeekdaySet { /** * This method encodes the given { @ code set } to a bit - mask for { @ link # getValue ( ) } . * @ param set is the { @ link Set } of { @ link Weekday } s . * @ return the encoded { @ link # getValue ( ) value } . */ private static int encode ( Set < Weekday > set ) { } }
int bitmask = 0 ; for ( Weekday weekday : set ) { bitmask = bitmask | ( 1 << weekday . ordinal ( ) ) ; } return bitmask ;
public class NettyNetworkManager { /** * { @ inheritDoc } * @ throws IllegalStateException If manager is already closed . */ @ Override public void close ( ) throws IOException , IllegalStateException { } }
if ( this . open . compareAndSet ( true , false ) ) { try { this . eventGroup . shutdownGracefully ( 0L , 5L , TimeUnit . SECONDS ) . sync ( ) ; } catch ( Exception e ) { throw new IOException ( "Could not be gracefully closed." , e ) ; } } else { throw new IllegalStateException ( "Network Manager is already closed" ) ; }
public class AcceleratorMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Accelerator accelerator , ProtocolMarshaller protocolMarshaller ) { } }
if ( accelerator == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( accelerator . getAcceleratorArn ( ) , ACCELERATORARN_BINDING ) ; protocolMarshaller . marshall ( accelerator . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( accelerator . getIpAddressType ( ) , IPADDRESSTYPE_BINDING ) ; protocolMarshaller . marshall ( accelerator . getEnabled ( ) , ENABLED_BINDING ) ; protocolMarshaller . marshall ( accelerator . getIpSets ( ) , IPSETS_BINDING ) ; protocolMarshaller . marshall ( accelerator . getStatus ( ) , STATUS_BINDING ) ; protocolMarshaller . marshall ( accelerator . getCreatedTime ( ) , CREATEDTIME_BINDING ) ; protocolMarshaller . marshall ( accelerator . getLastModifiedTime ( ) , LASTMODIFIEDTIME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class Principals { /** * Gets one PrincipalProvider corresponding to a type of PrincipalProvider . < br > * < br > * For example , you can use this method to get the LDAPUser by calling : < br > * < code > getOnePrincipalsByType ( principals , LDAPUserPrincipalProvider . class ) < / code > . < br > * < br > * Then : < br > * < code > LDAPUser user = * ldapUserPrincipalProvider . getPrincipal ( ) < / code > . * @ param < T > type of the PrincipalProvider * @ param principalProviders the principals to find the type . * @ param principalClass the PrincipalProvider type , not null * @ return The user ' s PrincipalProvider of type principalProviderClass . Null if none . */ public static < T extends Serializable > PrincipalProvider < T > getOnePrincipalByType ( Collection < PrincipalProvider < ? > > principalProviders , Class < T > principalClass ) { } }
Collection < PrincipalProvider < T > > pps = getPrincipalsByType ( principalProviders , principalClass ) ; if ( ! pps . isEmpty ( ) ) { return pps . iterator ( ) . next ( ) ; } else { return null ; }
public class IntervalCollection { /** * / * [ deutsch ] * < p > Ermittelt , ob keine & Uuml ; berschneidung von Intervallen existiert . < / p > * @ return { @ code true } if there is no intersection else { @ code false } * @ since 3.24/4.20 */ public boolean isDisjunct ( ) { } }
for ( int i = 0 , n = this . intervals . size ( ) - 1 ; i < n ; i ++ ) { ChronoInterval < T > current = this . intervals . get ( i ) ; ChronoInterval < T > next = this . intervals . get ( i + 1 ) ; if ( current . getEnd ( ) . isInfinite ( ) || next . getStart ( ) . isInfinite ( ) ) { return false ; } else if ( current . getEnd ( ) . isOpen ( ) ) { if ( this . isAfter ( current . getEnd ( ) . getTemporal ( ) , next . getStart ( ) . getTemporal ( ) ) ) { return false ; } } else if ( ! this . isBefore ( current . getEnd ( ) . getTemporal ( ) , next . getStart ( ) . getTemporal ( ) ) ) { return false ; } } return true ;
public class CachingCodecRegistry { /** * Variant where the CQL type is unknown . Can be covariant if we come from a lookup by Java value . */ protected TypeCodec < ? > createCodec ( GenericType < ? > javaType , boolean isJavaCovariant ) { } }
TypeToken < ? > token = javaType . __getToken ( ) ; if ( List . class . isAssignableFrom ( token . getRawType ( ) ) && token . getType ( ) instanceof ParameterizedType ) { Type [ ] typeArguments = ( ( ParameterizedType ) token . getType ( ) ) . getActualTypeArguments ( ) ; GenericType < ? > elementType = GenericType . of ( typeArguments [ 0 ] ) ; TypeCodec < ? > elementCodec = codecFor ( elementType , isJavaCovariant ) ; return TypeCodecs . listOf ( elementCodec ) ; } else if ( Set . class . isAssignableFrom ( token . getRawType ( ) ) && token . getType ( ) instanceof ParameterizedType ) { Type [ ] typeArguments = ( ( ParameterizedType ) token . getType ( ) ) . getActualTypeArguments ( ) ; GenericType < ? > elementType = GenericType . of ( typeArguments [ 0 ] ) ; TypeCodec < ? > elementCodec = codecFor ( elementType , isJavaCovariant ) ; return TypeCodecs . setOf ( elementCodec ) ; } else if ( Map . class . isAssignableFrom ( token . getRawType ( ) ) && token . getType ( ) instanceof ParameterizedType ) { Type [ ] typeArguments = ( ( ParameterizedType ) token . getType ( ) ) . getActualTypeArguments ( ) ; GenericType < ? > keyType = GenericType . of ( typeArguments [ 0 ] ) ; GenericType < ? > valueType = GenericType . of ( typeArguments [ 1 ] ) ; TypeCodec < ? > keyCodec = codecFor ( keyType , isJavaCovariant ) ; TypeCodec < ? > valueCodec = codecFor ( valueType , isJavaCovariant ) ; return TypeCodecs . mapOf ( keyCodec , valueCodec ) ; } throw new CodecNotFoundException ( null , javaType ) ;
public class HttpMethodBase { /** * Return the length ( in bytes ) of the response body , as specified in a * < tt > Content - Length < / tt > header . * Return < tt > - 1 < / tt > when the content - length is unknown . * @ return content length , if < tt > Content - Length < / tt > header is available . * < tt > 0 < / tt > indicates that the request has no body . * If < tt > Content - Length < / tt > header is not present , the method * returns < tt > - 1 < / tt > . */ public long getResponseContentLength ( ) { } }
Header [ ] headers = getResponseHeaderGroup ( ) . getHeaders ( "Content-Length" ) ; if ( headers . length == 0 ) { return - 1 ; } if ( headers . length > 1 ) { LOG . warn ( "Multiple content-length headers detected" ) ; } for ( int i = headers . length - 1 ; i >= 0 ; i -- ) { Header header = headers [ i ] ; try { return Long . parseLong ( header . getValue ( ) ) ; } catch ( NumberFormatException e ) { if ( LOG . isWarnEnabled ( ) ) { LOG . warn ( "Invalid content-length value: " + e . getMessage ( ) ) ; } } // See if we can have better luck with another header , if present } return - 1 ;
public class LZ09 { /** * control the PS shape of 2 - d instances */ double psfunc2 ( double x , double t1 , int dim , int type , int css ) { } }
// type : the type of curve // css : the class of index double beta ; beta = 0.0 ; dim ++ ; if ( type == 21 ) { double xy = 2 * ( x - 0.5 ) ; beta = xy - Math . pow ( t1 , 0.5 * ( nvar + 3 * dim - 8 ) / ( nvar - 2 ) ) ; } if ( type == 22 ) { double theta = 6 * Math . PI * t1 + dim * Math . PI / nvar ; double xy = 2 * ( x - 0.5 ) ; beta = xy - Math . sin ( theta ) ; } if ( type == 23 ) { double theta = 6 * Math . PI * t1 + dim * Math . PI / nvar ; double ra = 0.8 * t1 ; double xy = 2 * ( x - 0.5 ) ; if ( css == 1 ) { beta = xy - ra * Math . cos ( theta ) ; } else { beta = xy - ra * Math . sin ( theta ) ; } } if ( type == 24 ) { double theta = 6 * Math . PI * t1 + dim * Math . PI / nvar ; double xy = 2 * ( x - 0.5 ) ; double ra = 0.8 * t1 ; if ( css == 1 ) { beta = xy - ra * Math . cos ( theta / 3 ) ; } else { beta = xy - ra * Math . sin ( theta ) ; } } if ( type == 25 ) { double rho = 0.8 ; double phi = Math . PI * t1 ; double theta = 6 * Math . PI * t1 + dim * Math . PI / nvar ; double xy = 2 * ( x - 0.5 ) ; if ( css == 1 ) { beta = xy - rho * Math . sin ( phi ) * Math . sin ( theta ) ; } else if ( css == 2 ) { beta = xy - rho * Math . sin ( phi ) * Math . cos ( theta ) ; } else { beta = xy - rho * Math . cos ( phi ) ; } } if ( type == 26 ) { double theta = 6 * Math . PI * t1 + dim * Math . PI / nvar ; double ra = 0.3 * t1 * ( t1 * Math . cos ( 4 * theta ) + 2 ) ; double xy = 2 * ( x - 0.5 ) ; if ( css == 1 ) { beta = xy - ra * Math . cos ( theta ) ; } else { beta = xy - ra * Math . sin ( theta ) ; } } return beta ;
public class IBMViewHandlerProxy { /** * Get conversation context . * @ return the conversation context */ private ConversationContext getConversationContext ( String id ) { } }
if ( conversationContext == null ) { synchronized ( this ) { if ( conversationContext == null ) { Container container = Container . instance ( id ) ; conversationContext = container . deploymentManager ( ) . instance ( ) . select ( HttpConversationContext . class ) . get ( ) ; } } } return conversationContext ;
public class ParseException { /** * This method has the standard behavior when this object has been created * using the standard constructors . Otherwise , it uses " currentToken " and * " expectedTokenSequences " to generate a parse error message and returns * it . If this object has been created due to a parse error , and you do not * catch it ( it gets thrown from the parser ) , then this method is called * during the printing of the final stack trace , and hence the correct error * message gets displayed . */ @ Override public String getMessage ( ) { } }
if ( ! specialConstructor ) { StringBuilder msg = new StringBuilder ( ) ; msg . append ( "parse error [" ) ; msg . append ( ( file != null ) ? file . toString ( ) : "?" ) ; msg . append ( ":" ) ; msg . append ( ( sourceRange != null ) ? sourceRange . toString ( ) : "?" ) ; msg . append ( "]\n" ) ; msg . append ( super . getMessage ( ) ) ; return msg . toString ( ) ; } StringBuilder expected = new StringBuilder ( ) ; int maxSize = 0 ; for ( int i = 0 ; i < expectedTokenSequences . length ; i ++ ) { if ( maxSize < expectedTokenSequences [ i ] . length ) { maxSize = expectedTokenSequences [ i ] . length ; } for ( int j = 0 ; j < expectedTokenSequences [ i ] . length ; j ++ ) { expected . append ( tokenImage [ expectedTokenSequences [ i ] [ j ] ] ) . append ( " " ) ; } if ( expectedTokenSequences [ i ] [ expectedTokenSequences [ i ] . length - 1 ] != 0 ) { expected . append ( "..." ) ; } expected . append ( eol ) . append ( " " ) ; } String retval = "parse error " ; retval += ( file != null ) ? "[" + file + ":" : "[?:" ; if ( sourceRange != null ) { retval += sourceRange . toString ( ) + "]\n" ; } else { retval += currentToken . next . beginLine + "." + currentToken . next . beginColumn + "-" + currentToken . next . endLine + "." + currentToken . next . endLine + "]\n" ; } retval += "\nEncountered: " ; Token tok = currentToken . next ; for ( int i = 0 ; i < maxSize ; i ++ ) { if ( i != 0 ) retval += " " ; if ( tok . kind == 0 ) { retval += tokenImage [ 0 ] ; break ; } retval += add_escapes ( tok . image ) ; tok = tok . next ; } if ( expectedTokenSequences . length == 1 ) { retval += "\nWas expecting:" + eol + " " ; } else { retval += "\nWas expecting one of:" + eol + " " ; } retval += expected . toString ( ) ; return retval ;
public class BoUtils { /** * De - serialize a BO from byte array . * @ param bytes * the byte array obtained from { @ link # toBytes ( BaseBo ) } * @ param clazz * @ return */ public static < T extends BaseBo > T fromBytes ( byte [ ] bytes , Class < T > clazz ) { } }
return fromBytes ( bytes , clazz , null ) ;
public class HamcrestMatchers { /** * Creates a matcher of { @ link Comparable } object that matches when the examined object is after or equal with * respect to object < code > value < / code > , as reported by the < code > compareTo < / code > method of the < b > examined < / b > * object . * < p > E . g . : < code > Date past ; Date now ; assertThat ( now , afterOrEqual ( now ) ) ; assertThat ( now , afterOrEqual ( past ) ) ; * < / code > * < p > The matcher renames the Hamcrest matcher obtained with * { @ linkplain org . hamcrest . Matchers # greaterThanOrEqualTo ( Comparable ) } . */ public static < T extends Comparable < T > > Matcher < T > afterOrEqual ( final T value ) { } }
return Matchers . greaterThanOrEqualTo ( value ) ;
public class Frame { /** * Clear the Java operand stack . Only local variable slots will remain in * the frame . */ public void clearStack ( ) { } }
if ( ! isValid ( ) ) { throw new IllegalStateException ( "accessing top or bottom frame" ) ; } assert slotList . size ( ) >= numLocals ; if ( slotList . size ( ) > numLocals ) { slotList . subList ( numLocals , slotList . size ( ) ) . clear ( ) ; }
public class ProcessorBuilder { /** * Create code from this definition * @ param defCode code definition * @ return code object */ private ProcCode createCode ( Code defCode ) { } }
if ( ! defCode . hasPatterns ( ) ) { throw new IllegalStateException ( "Field pattern can't be null." ) ; } if ( defCode . getTemplate ( ) == null ) { throw new IllegalStateException ( "Field template can't be null." ) ; } ProcCode code = codes . get ( defCode ) ; if ( code == null ) { List < Pattern > confPatterns = defCode . getPatterns ( ) ; List < ProcPattern > procPatterns = new ArrayList < ProcPattern > ( confPatterns . size ( ) ) ; for ( Pattern confPattern : confPatterns ) { procPatterns . add ( createPattern ( confPattern ) ) ; } code = new ProcCode ( procPatterns , createTemplate ( defCode . getTemplate ( ) ) , defCode . getName ( ) , defCode . getPriority ( ) , defCode . isTransparent ( ) ) ; codes . put ( defCode , code ) ; } return code ;
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getGCLINE ( ) { } }
if ( gclineEClass == null ) { gclineEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 455 ) ; } return gclineEClass ;
public class EraPeriod { /** * 指定した日時が含まれているかどうか 。 * @ param date チェック対象の日時 。 タイムゾーンは 、 { @ literal GMT - 00:00 } である必要がある 。 * @ return true : この時代に含まれている 。 * @ throws IllegalArgumentException { @ literal date = = null . } */ public boolean contains ( final Date date ) { } }
ArgUtils . notNull ( date , "date" ) ; if ( startDate == null ) { return endDate . compareTo ( date ) >= 0 ; } else if ( endDate == null ) { return startDate . compareTo ( date ) <= 0 ; } else { return ( endDate . compareTo ( date ) >= 0 ) && ( startDate . compareTo ( date ) <= 0 ) ; }
public class DescribePointBrief { /** * Computes the descriptor at the specified point . If the region go outside of the image then a description * will not be made . * @ param c _ x Center of region being described . * @ param c _ y Center of region being described . * @ param feature Where the descriptor is written to . */ public void process ( double c_x , double c_y , TupleDesc_B feature ) { } }
describe . process ( ( int ) c_x , ( int ) c_y , feature ) ;
public class AbstractJawrImageReference { /** * ( non - Javadoc ) * @ see org . apache . wicket . MarkupContainer # onRender ( ) */ protected void onRender ( ) { } }
MarkupStream markupStream = findMarkupStream ( ) ; try { final ComponentTag openTag = markupStream . getTag ( ) ; final ComponentTag tag = openTag . mutable ( ) ; final IValueMap attributes = tag . getAttributes ( ) ; String src = ( String ) attributes . get ( "src" ) ; boolean base64 = Boolean . valueOf ( ( String ) attributes . get ( "base64" ) ) . booleanValue ( ) ; // src is mandatory if ( null == src ) { throw new IllegalStateException ( "The src attribute is mandatory for this Jawr tag. " ) ; } // Retrieve the image resource handler ServletWebRequest servletWebRequest = ( ServletWebRequest ) getRequest ( ) ; HttpServletRequest request = servletWebRequest . getContainerRequest ( ) ; BinaryResourcesHandler binaryRsHandler = ( BinaryResourcesHandler ) WebApplication . get ( ) . getServletContext ( ) . getAttribute ( JawrConstant . BINARY_CONTEXT_ATTRIBUTE ) ; if ( null == binaryRsHandler ) throw new IllegalStateException ( "You are using a Jawr image tag while the Jawr Image servlet has not been initialized. Initialization of Jawr Image servlet either failed or never occurred." ) ; final Response response = getResponse ( ) ; src = ImageTagUtils . getImageUrl ( src , base64 , binaryRsHandler , request , getHttpServletResponseUrlEncoder ( response ) ) ; Writer writer = new RedirectWriter ( response ) ; this . renderer = RendererFactory . getImgRenderer ( binaryRsHandler . getConfig ( ) , isPlainImage ( ) ) ; this . renderer . renderImage ( src , attributes , writer ) ; } catch ( IOException ex ) { LOGGER . error ( "onRender() error : " , ex ) ; } finally { // Reset the Thread local for the Jawr context ThreadLocalJawrContext . reset ( ) ; } markupStream . skipComponent ( ) ;
public class AclXmlFactory { /** * Converts the specified AccessControlList object to an XML fragment that * can be sent to Amazon S3. * @ param acl * The AccessControlList to convert to XML . * @ return an XML representation of the Access Control List object , suitable * to send in a request to Amazon S3. */ public byte [ ] convertToXmlByteArray ( AccessControlList acl ) throws SdkClientException { } }
Owner owner = acl . getOwner ( ) ; if ( owner == null ) { throw new SdkClientException ( "Invalid AccessControlList: missing an S3Owner" ) ; } XmlWriter xml = new XmlWriter ( ) ; xml . start ( "AccessControlPolicy" , "xmlns" , Constants . XML_NAMESPACE ) ; xml . start ( "Owner" ) ; if ( owner . getId ( ) != null ) { xml . start ( "ID" ) . value ( owner . getId ( ) ) . end ( ) ; } if ( owner . getDisplayName ( ) != null ) { xml . start ( "DisplayName" ) . value ( owner . getDisplayName ( ) ) . end ( ) ; } xml . end ( ) ; xml . start ( "AccessControlList" ) ; for ( Grant grant : acl . getGrantsAsList ( ) ) { xml . start ( "Grant" ) ; convertToXml ( grant . getGrantee ( ) , xml ) ; xml . start ( "Permission" ) . value ( grant . getPermission ( ) . toString ( ) ) . end ( ) ; xml . end ( ) ; } xml . end ( ) ; xml . end ( ) ; return xml . getBytes ( ) ;
public class DatabaseAccountsInner { /** * Patches the properties of an existing Azure Cosmos DB database account . * @ param resourceGroupName Name of an Azure resource group . * @ param accountName Cosmos DB database account name . * @ param updateParameters The tags parameter to patch for the current database account . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < DatabaseAccountInner > patchAsync ( String resourceGroupName , String accountName , DatabaseAccountPatchParameters updateParameters , final ServiceCallback < DatabaseAccountInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( patchWithServiceResponseAsync ( resourceGroupName , accountName , updateParameters ) , serviceCallback ) ;
public class DefaultXMLWriter { /** * / * ( non - Javadoc ) * @ see tuwien . auto . calimero . xml . XMLWriter # writeDeclaration ( boolean , java . lang . String ) */ public void writeDeclaration ( boolean standalone , String encoding ) throws KNXMLException { } }
try { w . write ( "<?xml version=" + quote + "1.0" + quote ) ; w . write ( " standalone=" + quote + ( standalone ? "yes" : "no" ) + quote ) ; if ( encoding != null && encoding . length ( ) > 0 ) w . write ( " encoding=" + quote + encoding + quote ) ; w . write ( "?>" ) ; w . newLine ( ) ; } catch ( final IOException e ) { throw new KNXMLException ( e . getMessage ( ) ) ; }
public class AppendableExpression { /** * Invokes { @ link LoggingAdvisingAppendable # appendLoggingFunctionInvocation } on the appendable . */ AppendableExpression appendLoggingFunctionInvocation ( String functionName , String placeholderValue , List < SoyExpression > args , List < Expression > escapingDirectives ) { } }
return withNewDelegate ( delegate . invoke ( APPEND_LOGGING_FUNCTION_INVOCATION , LOGGING_FUNCTION_INVOCATION_CREATE . invoke ( constant ( functionName ) , constant ( placeholderValue ) , SoyExpression . asBoxedList ( args ) ) , BytecodeUtils . asImmutableList ( escapingDirectives ) ) , true ) ;
public class Bitso { /** * Public Functions */ public BookInfo [ ] getAvailableBooks ( ) throws BitsoAPIException , BitsoPayloadException , BitsoServerException { } }
String request = "/api/v3/available_books" ; String getResponse = sendGet ( request ) ; JSONArray payloadJSON = ( JSONArray ) getJSONPayload ( getResponse ) ; int totalElements = payloadJSON . length ( ) ; BookInfo [ ] books = new BookInfo [ totalElements ] ; for ( int i = 0 ; i < totalElements ; i ++ ) { books [ i ] = new BookInfo ( payloadJSON . getJSONObject ( i ) ) ; } return books ;
public class MoveOnEventHandler { /** * Called when a new blank record is required for the table / query . * @ param bDisplayOption If true , display any changes . */ public void doNewRecord ( boolean bDisplayOption ) { } }
super . doNewRecord ( bDisplayOption ) ; if ( m_bMoveOnNew ) { boolean bOldModified = false ; if ( m_fldDest != null ) bOldModified = m_fldDest . isModified ( ) ; int iMoveType = DBConstants . INIT_MOVE ; // Typically , Don ' t trigger a record change . if ( m_bMoveOnValid ) if ( m_fldDest != null ) if ( m_fldDest instanceof ReferenceField ) if ( ( ( ReferenceField ) m_fldDest ) . getReferenceRecord ( ) != null ) if ( ( ( ReferenceField ) m_fldDest ) . getReferenceRecord ( ) . getCounterField ( ) == m_fldSource ) if ( ( m_fldDest . getRecord ( ) . getEditMode ( ) == DBConstants . EDIT_IN_PROGRESS ) || ( m_fldDest . getRecord ( ) . getEditMode ( ) == DBConstants . EDIT_CURRENT ) ) iMoveType = DBConstants . SCREEN_MOVE ; // Special case - clearing a secondary field = YES - modified this . moveTheData ( bDisplayOption , iMoveType ) ; if ( iMoveType == DBConstants . INIT_MOVE ) if ( m_fldDest != null ) if ( bOldModified == false ) m_fldDest . setModified ( false ) ; }
public class WebAppSecurityCollaboratorImpl { /** * public java . security . Principal getUserPrincipal ( ) * Returns a java . security . Principal object containing the name of the current authenticated user . If the user has not been authenticated , the method returns null . * Returns : * a java . security . Principal containing the name of the user making this request ; null if the user has not been authenticated { @ inheritDoc } * Look at the Subject on the thread only . * We will extract , from the set of Principals , our WSPrincipal type . */ @ Override public Principal getUserPrincipal ( ) { } }
if ( System . getSecurityManager ( ) == null ) { return collabUtils . getCallerPrincipal ( false , null , true , isJaspiEnabled ) ; } else { return AccessController . doPrivileged ( new PrivilegedAction < Principal > ( ) { @ Override public Principal run ( ) { return collabUtils . getCallerPrincipal ( false , null , true , isJaspiEnabled ) ; } } ) ; }
public class MonitorInstancesResult { /** * The monitoring information . * @ return The monitoring information . */ public java . util . List < InstanceMonitoring > getInstanceMonitorings ( ) { } }
if ( instanceMonitorings == null ) { instanceMonitorings = new com . amazonaws . internal . SdkInternalList < InstanceMonitoring > ( ) ; } return instanceMonitorings ;
public class Interaction { /** * Create a InteractionFetcher to execute fetch . * @ param pathServiceSid The SID of the parent Service of the resource to fetch * @ param pathSessionSid he SID of the parent Session of the resource to fetch * @ param pathSid The unique string that identifies the resource * @ return InteractionFetcher capable of executing the fetch */ public static InteractionFetcher fetcher ( final String pathServiceSid , final String pathSessionSid , final String pathSid ) { } }
return new InteractionFetcher ( pathServiceSid , pathSessionSid , pathSid ) ;
public class IntStream { /** * Zip together the " a " , " b " and " c " arrays until one of them runs out of values . * Each triple of values is combined into a single value using the supplied zipFunction function . * @ param a * @ param b * @ return */ public static IntStream zip ( final int [ ] a , final int [ ] b , final int [ ] c , final IntTriFunction < Integer > zipFunction ) { } }
return Stream . zip ( a , b , c , zipFunction ) . mapToInt ( ToIntFunction . UNBOX ) ;
public class DeleteReplicaActionMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteReplicaAction deleteReplicaAction , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteReplicaAction == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteReplicaAction . getRegionName ( ) , REGIONNAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ParseUtils { /** * There must be a better way . */ public static Number toNumber ( String string ) { } }
BigDecimal value = new BigDecimal ( string ) ; try { long l = value . longValueExact ( ) ; int i = ( int ) l ; if ( ( long ) i == l ) { return i ; } else { return l ; } } catch ( ArithmeticException e ) { double d = value . doubleValue ( ) ; if ( BigDecimal . valueOf ( d ) . equals ( value ) ) { float f = ( float ) d ; if ( ( double ) f == d ) { return ( float ) d ; } else { return d ; } } else { return null ; } }
public class InternalTimerServiceImpl { /** * Restore the timers ( both processing and event time ones ) for a given { @ code keyGroupIdx } . * @ param restoredSnapshot the restored snapshot containing the key - group ' s timers , * and the serializers that were used to write them * @ param keyGroupIdx the id of the key - group to be put in the snapshot . */ @ SuppressWarnings ( "unchecked" ) public void restoreTimersForKeyGroup ( InternalTimersSnapshot < ? , ? > restoredSnapshot , int keyGroupIdx ) { } }
this . restoredTimersSnapshot = ( InternalTimersSnapshot < K , N > ) restoredSnapshot ; TypeSerializer < K > restoredKeySerializer = restoredTimersSnapshot . getKeySerializerSnapshot ( ) . restoreSerializer ( ) ; if ( this . keyDeserializer != null && ! this . keyDeserializer . equals ( restoredKeySerializer ) ) { throw new IllegalArgumentException ( "Tried to restore timers for the same service with different key serializers." ) ; } this . keyDeserializer = restoredKeySerializer ; TypeSerializer < N > restoredNamespaceSerializer = restoredTimersSnapshot . getNamespaceSerializerSnapshot ( ) . restoreSerializer ( ) ; if ( this . namespaceDeserializer != null && ! this . namespaceDeserializer . equals ( restoredNamespaceSerializer ) ) { throw new IllegalArgumentException ( "Tried to restore timers for the same service with different namespace serializers." ) ; } this . namespaceDeserializer = restoredNamespaceSerializer ; checkArgument ( localKeyGroupRange . contains ( keyGroupIdx ) , "Key Group " + keyGroupIdx + " does not belong to the local range." ) ; // restore the event time timers eventTimeTimersQueue . addAll ( restoredTimersSnapshot . getEventTimeTimers ( ) ) ; // restore the processing time timers processingTimeTimersQueue . addAll ( restoredTimersSnapshot . getProcessingTimeTimers ( ) ) ;
public class CPDefinitionOptionRelLocalServiceBaseImpl { /** * Deletes the cp definition option rel from the database . Also notifies the appropriate model listeners . * @ param cpDefinitionOptionRel the cp definition option rel * @ return the cp definition option rel that was removed * @ throws PortalException */ @ Indexable ( type = IndexableType . DELETE ) @ Override public CPDefinitionOptionRel deleteCPDefinitionOptionRel ( CPDefinitionOptionRel cpDefinitionOptionRel ) throws PortalException { } }
return cpDefinitionOptionRelPersistence . remove ( cpDefinitionOptionRel ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link String } { @ code > } } */ @ XmlElementDecl ( namespace = "http://belframework.org/schema/1.0/xbel" , name = "disclaimer" ) public JAXBElement < String > createDisclaimer ( String value ) { } }
return new JAXBElement < String > ( _Disclaimer_QNAME , String . class , null , value ) ;
public class Parser { /** * * * * * * CODE * * * * * */ public Rule Code ( ) { } }
return NodeSequence ( Test ( '`' ) , FirstOf ( Code ( Ticks ( 1 ) ) , Code ( Ticks ( 2 ) ) , Code ( Ticks ( 3 ) ) , Code ( Ticks ( 4 ) ) , Code ( Ticks ( 5 ) ) ) ) ;
public class ThreadUtils { /** * Creates new { @ link Handler } with the same { @ link Looper } as the original handler . * @ param original original handler , can not be null * @ param callback message handling callback , may be null * @ return new instance */ public static Handler newHandler ( Handler original , Handler . Callback callback ) { } }
return new Handler ( original . getLooper ( ) , callback ) ;
public class Filters { /** * The Channel to use as a filter for the metrics returned . Only VOICE is supported . * @ param channels * The Channel to use as a filter for the metrics returned . Only VOICE is supported . * @ see Channel */ public void setChannels ( java . util . Collection < String > channels ) { } }
if ( channels == null ) { this . channels = null ; return ; } this . channels = new java . util . ArrayList < String > ( channels ) ;
public class ConfigFactory { /** * Set a property in the ConfigFactory . Those properties will be used to expand variables specified in the ` @ Source ` * annotation , or by the ConfigFactory to configure its own behavior . * @ param key the key for the property . * @ param value the value for the property . * @ return the old value . * @ since 1.0.4 */ public static String setProperty ( String key , String value ) { } }
return INSTANCE . setProperty ( key , value ) ;
public class ItemListBox { /** * Inserts the supplied item into this list box at the specified position , using the specified * label if given . If no label is given , { @ link # toLabel ( Object ) } is used to calculate it . */ public void insertItem ( T item , int index , String label ) { } }
insertItem ( label == null ? toLabel ( item ) : label , index ) ; _items . add ( index , item ) ;
public class CommerceTierPriceEntryLocalServiceBaseImpl { /** * Returns the commerce tier price entry matching the UUID and group . * @ param uuid the commerce tier price entry ' s UUID * @ param groupId the primary key of the group * @ return the matching commerce tier price entry , or < code > null < / code > if a matching commerce tier price entry could not be found */ @ Override public CommerceTierPriceEntry fetchCommerceTierPriceEntryByUuidAndGroupId ( String uuid , long groupId ) { } }
return commerceTierPriceEntryPersistence . fetchByUUID_G ( uuid , groupId ) ;
public class BorderApplier { /** * { @ inheritDoc } */ public Map < String , String > parse ( Map < String , String > style ) { } }
Map < String , String > mapRtn = new HashMap < String , String > ( ) ; for ( String pos : new String [ ] { null , TOP , RIGHT , BOTTOM , LEFT } ) { // border [ - attr ] if ( pos == null ) { setBorderAttr ( mapRtn , pos , style . get ( BORDER ) ) ; setBorderAttr ( mapRtn , pos , style . get ( BORDER + "-" + COLOR ) ) ; setBorderAttr ( mapRtn , pos , style . get ( BORDER + "-" + WIDTH ) ) ; setBorderAttr ( mapRtn , pos , style . get ( BORDER + "-" + STYLE ) ) ; } // border - pos [ - attr ] else { setBorderAttr ( mapRtn , pos , style . get ( BORDER + "-" + pos ) ) ; for ( String attr : new String [ ] { COLOR , WIDTH , STYLE } ) { String attrName = BORDER + "-" + pos + "-" + attr ; String attrValue = style . get ( attrName ) ; if ( StringUtils . isNotBlank ( attrValue ) ) { mapRtn . put ( attrName , attrValue ) ; } } } } return mapRtn ;
public class MemcachedSessionService { /** * Initialize this manager . */ void startInternal ( ) throws LifecycleException { } }
_log . info ( getClass ( ) . getSimpleName ( ) + " starts initialization... (configured" + " nodes definition " + _memcachedNodes + ", failover nodes " + _failoverNodes + ")" ) ; _statistics = Statistics . create ( _enableStatistics ) ; _memcachedNodesManager = createMemcachedNodesManager ( _memcachedNodes , _failoverNodes ) ; if ( _storage == null ) { _storage = createStorageClient ( _memcachedNodesManager , _statistics ) ; } final String sessionCookieName = _manager . getSessionCookieName ( ) ; _currentRequest = new CurrentRequest ( ) ; _trackingHostValve = createRequestTrackingHostValve ( sessionCookieName , _currentRequest ) ; final Context context = _manager . getContext ( ) ; context . getParent ( ) . getPipeline ( ) . addValve ( _trackingHostValve ) ; _trackingContextValve = createRequestTrackingContextValve ( sessionCookieName ) ; context . getPipeline ( ) . addValve ( _trackingContextValve ) ; initNonStickyLockingMode ( _memcachedNodesManager ) ; _transcoderService = createTranscoderService ( _statistics ) ; _backupSessionService = new BackupSessionService ( _transcoderService , _sessionBackupAsync , _sessionBackupTimeout , _backupThreadCount , _storage , _memcachedNodesManager , _statistics ) ; _log . info ( "--------\n- " + getClass ( ) . getSimpleName ( ) + " finished initialization:" + "\n- sticky: " + _sticky + "\n- operation timeout: " + _operationTimeout + "\n- node ids: " + _memcachedNodesManager . getPrimaryNodeIds ( ) + "\n- failover node ids: " + _memcachedNodesManager . getFailoverNodeIds ( ) + "\n- storage key prefix: " + _memcachedNodesManager . getStorageKeyFormat ( ) . prefix + "\n- locking mode: " + _lockingMode + " (expiration: " + _lockExpiration + "s)" + "\n--------" ) ;
public class JaxWsHttpServletRequestAdapter { /** * ( non - Javadoc ) * @ see javax . servlet . ServletRequest # getServletContext ( ) */ @ Override public ServletContext getServletContext ( ) { } }
try { collaborator . preInvoke ( componentMetaData ) ; return request . getServletContext ( ) ; } finally { collaborator . postInvoke ( ) ; }
public class ThymeleafTemplateCollector { /** * A dialect has left . * @ param dialect the dialect that has left */ @ Unbind public synchronized void unbindDialect ( IDialect dialect ) { } }
LOGGER . debug ( "Binding a new dialect {}, processors: {}" , dialect . getPrefix ( ) , dialect . getProcessors ( ) ) ; if ( this . dialects . remove ( dialect ) ) { configure ( ) ; for ( Template template : getTemplates ( ) ) { ( ( ThymeLeafTemplateImplementation ) template ) . updateEngine ( engine ) ; } }
public class ActiveRepairService { /** * add it to the sessions ( avoid NPE in tests ) */ RepairFuture submitArtificialRepairSession ( RepairJobDesc desc ) { } }
Set < InetAddress > neighbours = new HashSet < > ( ) ; neighbours . addAll ( ActiveRepairService . getNeighbors ( desc . keyspace , desc . range , null , null ) ) ; RepairSession session = new RepairSession ( desc . parentSessionId , desc . sessionId , desc . range , desc . keyspace , RepairParallelism . PARALLEL , neighbours , new String [ ] { desc . columnFamily } ) ; sessions . put ( session . getId ( ) , session ) ; RepairFuture futureTask = new RepairFuture ( session ) ; executor . execute ( futureTask ) ; return futureTask ;
public class MutableBigInteger { /** * Makes this number an { @ code n } - int number all of whose bits are ones . * Used by Burnikel - Ziegler division . * @ param n number of ints in the { @ code value } array * @ return a number equal to { @ code ( ( 1 < < ( 32 * n ) ) ) - 1} */ private void ones ( int n ) { } }
if ( n > value . length ) value = new int [ n ] ; Arrays . fill ( value , - 1 ) ; offset = 0 ; intLen = n ;
public class Config { /** * Sets the map of cache event journal configurations , mapped by config name . * The config name may be a pattern with which the configuration will be * obtained in the future . * @ param eventJournalConfigs the cache event journal configuration map to set * @ return this config instance */ public Config setCacheEventJournalConfigs ( Map < String , EventJournalConfig > eventJournalConfigs ) { } }
this . cacheEventJournalConfigs . clear ( ) ; this . cacheEventJournalConfigs . putAll ( eventJournalConfigs ) ; for ( Entry < String , EventJournalConfig > entry : eventJournalConfigs . entrySet ( ) ) { entry . getValue ( ) . setCacheName ( entry . getKey ( ) ) ; } return this ;
public class Resource { private < T > T assertReqProp ( String key , T val ) { } }
if ( val == null ) { throw new RuntimeException ( "The property [" + key + "] is not present " ) ; } return val ;
public class CmsWebdavServlet { /** * Copy the contents of the specified input stream to the specified * output stream , and ensure that both streams are closed before returning * ( even in the face of an exception ) . < p > * @ param item the RepositoryItem * @ param writer the writer to write to * @ param ranges iterator of the ranges the client wants to retrieve * @ param contentType the content type of the resource * @ throws IOException if an input / output error occurs */ protected void copy ( I_CmsRepositoryItem item , PrintWriter writer , Iterator < CmsWebdavRange > ranges , String contentType ) throws IOException { } }
IOException exception = null ; while ( ( exception == null ) && ( ranges . hasNext ( ) ) ) { InputStream resourceInputStream = new ByteArrayInputStream ( item . getContent ( ) ) ; Reader reader = new InputStreamReader ( resourceInputStream ) ; CmsWebdavRange currentRange = ranges . next ( ) ; // Writing MIME header . writer . println ( ) ; writer . println ( "--" + MIME_SEPARATION ) ; if ( contentType != null ) { writer . println ( "Content-Type: " + contentType ) ; } writer . println ( "Content-Range: bytes " + currentRange . getStart ( ) + "-" + currentRange . getEnd ( ) + "/" + currentRange . getLength ( ) ) ; writer . println ( ) ; // Printing content exception = copyRange ( reader , writer , currentRange . getStart ( ) , currentRange . getEnd ( ) ) ; try { reader . close ( ) ; } catch ( Exception e ) { if ( LOG . isErrorEnabled ( ) ) { LOG . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . ERR_CLOSE_READER_0 ) , e ) ; } } } writer . println ( ) ; writer . print ( "--" + MIME_SEPARATION + "--" ) ; // Rethrow any exception that has occurred if ( exception != null ) { throw exception ; }
public class Zealot { /** * 根据标签拼接的SQL信息来生成最终的SQL . * @ param sqlInfo sql及参数信息 * @ param paramObj 参数对象信息 * @ return 返回SqlInfo对象 */ private static SqlInfo buildFinalSql ( SqlInfo sqlInfo , Object paramObj ) { } }
// 得到生成的SQL , 如果有MVEL的模板表达式 , 则执行计算出该表达式来生成最终的SQL String sql = sqlInfo . getJoin ( ) . toString ( ) ; sql = ParseHelper . parseTemplate ( sql , paramObj ) ; return sqlInfo . setSql ( StringHelper . replaceBlank ( sql ) ) ;
public class ComponentsInner { /** * Purges data in an Application Insights component by a set of user - defined filters . * @ param resourceGroupName The name of the resource group . * @ param resourceName The name of the Application Insights component resource . * @ param body Describes the body of a request to purge data in a single table of an Application Insights component * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the ComponentPurgeResponseInner object */ public Observable < ServiceResponse < ComponentPurgeResponseInner > > purgeWithServiceResponseAsync ( String resourceGroupName , String resourceName , ComponentPurgeBody body ) { } }
if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( resourceName == null ) { throw new IllegalArgumentException ( "Parameter resourceName is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiVersion() is required and cannot be null." ) ; } if ( body == null ) { throw new IllegalArgumentException ( "Parameter body is required and cannot be null." ) ; } Validator . validate ( body ) ; return service . purge ( resourceGroupName , this . client . subscriptionId ( ) , resourceName , this . client . apiVersion ( ) , body , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < ComponentPurgeResponseInner > > > ( ) { @ Override public Observable < ServiceResponse < ComponentPurgeResponseInner > > call ( Response < ResponseBody > response ) { try { ServiceResponse < ComponentPurgeResponseInner > clientResponse = purgeDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class KernelResolverRepository { /** * Return whether the given resource is applicable to the current product definitions . * @ param resource the repository resource * @ return { @ code true } if the resource is applicable , otherwise { @ code false } */ private boolean isApplicable ( RepositoryResource resource ) { } }
if ( resource instanceof ApplicableToProduct ) { if ( ( ( ApplicableToProduct ) resource ) . getAppliesTo ( ) == null ) { return true ; // No appliesTo - > applicable } } return ( ( RepositoryResourceImpl ) resource ) . doesResourceMatch ( productDefinitions , null ) ;
public class ContextFailedHandler { /** * This method is executed asynchronously since the original extender thread may try to obtain a lock to the OSGi * framework ' s registry state during the stop while holding the event handling lock , which may result in a transitive * deadlock . * @ param event can be < code > null < / code > , in which case it is ignored . */ @ Override @ Async public void onOsgiApplicationEvent ( OsgiBundleApplicationContextEvent event ) { } }
// We need to use the generic OsgiBundleApplicationContextEvent here and test // for instanceof since gemini - blueprint does not correctly determine // the event type we are listening for . if ( event instanceof OsgiBundleContextFailedEvent ) { final Bundle bundle = event . getBundle ( ) ; handleStop ( bundle ) ; stop ( bundle ) ; }
public class gslbsyncstatus { /** * Use this API to fetch all the gslbsyncstatus resources that are configured on netscaler . */ public static gslbsyncstatus get ( nitro_service service ) throws Exception { } }
gslbsyncstatus obj = new gslbsyncstatus ( ) ; gslbsyncstatus [ ] response = ( gslbsyncstatus [ ] ) obj . get_resources ( service ) ; return response [ 0 ] ;
public class EJSContainer { /** * d139352-2 */ public ContainerTx getCurrentTx ( SynchronizationRegistryUOWScope uowId , boolean isLocal ) throws CSITransactionRolledbackException { } }
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; // d532639.2 if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getCurrentTx (" + ContainerTx . uowIdToString ( uowId ) + ", " + ( isLocal ? "local" : "global" ) + ")" ) ; ContainerTx result = null ; SynchronizationRegistryUOWScope currTxKey = uowId ; // If there is no transaction , then this is probably BMT and either // an EJB 1.1 module or the BMT transaction has been rolled back . // In either case , just allow the method to continue without a // ContainerTx . If there is a transaction , then look for an existing // ContainerTx , or create one if not found . if ( currTxKey != null ) { result = ( ContainerTx ) currTxKey . getResource ( containerTxResourceKey ) ; if ( result == null ) { result = ivEJBRuntime . createContainerTx ( this , ! isLocal , currTxKey , uowCtrl ) ; try { uowCtrl . enlistWithTransaction ( currTxKey , result ) ; } catch ( CSIException ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".getCurrentTx" , "1305" , this ) ; uowCtrl . setRollbackOnly ( ) ; throw new CSITransactionRolledbackException ( "Enlistment with transaction failed" , ex ) ; } currTxKey . putResource ( containerTxResourceKey , result ) ; } } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getCurrentTx : " + result ) ; return result ;
public class CPInstancePersistenceImpl { /** * Returns the last cp instance in the ordered set where CPDefinitionId = & # 63 ; and status & ne ; & # 63 ; . * @ param CPDefinitionId the cp definition ID * @ param status the status * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the last matching cp instance * @ throws NoSuchCPInstanceException if a matching cp instance could not be found */ @ Override public CPInstance findByC_NotST_Last ( long CPDefinitionId , int status , OrderByComparator < CPInstance > orderByComparator ) throws NoSuchCPInstanceException { } }
CPInstance cpInstance = fetchByC_NotST_Last ( CPDefinitionId , status , orderByComparator ) ; if ( cpInstance != null ) { return cpInstance ; } StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "CPDefinitionId=" ) ; msg . append ( CPDefinitionId ) ; msg . append ( ", status=" ) ; msg . append ( status ) ; msg . append ( "}" ) ; throw new NoSuchCPInstanceException ( msg . toString ( ) ) ;