signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class ListSubscriptionsByTopicResult { /** * A list of subscriptions .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setSubscriptions ( java . util . Collection ) } or { @ link # withSubscriptions ( java . util . Collection ) } if you want
* to ove... | if ( this . subscriptions == null ) { setSubscriptions ( new com . amazonaws . internal . SdkInternalList < Subscription > ( subscriptions . length ) ) ; } for ( Subscription ele : subscriptions ) { this . subscriptions . add ( ele ) ; } return this ; |
public class DialogUtils { /** * Waits for a { @ link android . app . Dialog } to close .
* @ param timeout the amount of time in milliseconds to wait
* @ return { @ code true } if the { @ code Dialog } is closed before the timeout and { @ code false } if it is not closed */
public boolean waitForDialogToClose ( lo... | waitForDialogToOpen ( TIMEOUT_DIALOG_TO_CLOSE , false ) ; final long endTime = SystemClock . uptimeMillis ( ) + timeout ; while ( SystemClock . uptimeMillis ( ) < endTime ) { if ( ! isDialogOpen ( ) ) { return true ; } sleeper . sleep ( MINISLEEP ) ; } return false ; |
public class DecoratorProxyFactory { /** * m is more generic than a */
private static boolean isEqual ( Method m , Method a ) { } } | if ( m . getName ( ) . equals ( a . getName ( ) ) && m . getParameterTypes ( ) . length == a . getParameterTypes ( ) . length && m . getReturnType ( ) . isAssignableFrom ( a . getReturnType ( ) ) ) { for ( int i = 0 ; i < m . getParameterTypes ( ) . length ; i ++ ) { if ( ! ( m . getParameterTypes ( ) [ i ] . isAssigna... |
public class HttpOutboundServiceContextImpl { /** * Method to encapsulate the act of reading , parsing , and deciding whether
* to keep a response message ( asynchronously ) . This will return if a read
* is being performed asynchronously , or if a response was fully parsed and
* handed off to the application cha... | // if read data is available or sitting on socket , then start the parse
// now otherwise setup for a socket read
VirtualConnection vc = null ; if ( ! isReadDataAvailable ( ) && null == getNextReadBuffer ( ) ) { setupReadBuffers ( getHttpConfig ( ) . getIncomingHdrBufferSize ( ) , false ) ; vc = getTSC ( ) . getReadInt... |
public class DocLocale { /** * Find out if there is any HTML tag in the given string . If found
* return true else return false . */
private boolean htmlSentenceTerminatorFound ( String str , int index ) { } } | for ( int i = 0 ; i < sentenceTerminators . length ; i ++ ) { String terminator = sentenceTerminators [ i ] ; if ( str . regionMatches ( true , index , terminator , 0 , terminator . length ( ) ) ) { return true ; } } return false ; |
public class Call { /** * Abbreviation for { { @ link # methodForBoolean ( String , Object . . . ) } .
* @ since 1.1
* @ param methodName the name of the method
* @ param optionalParameters the ( optional ) parameters of the method .
* @ return the result of the method execution */
public static Function < Obje... | return methodForBoolean ( methodName , optionalParameters ) ; |
public class SessionDescriptor { /** * Excludes specified formats from descriptor .
* @ param formatName the name of the format . */
public void exclude ( String formatName ) { } } | for ( int i = 0 ; i < count ; i ++ ) { md [ i ] . exclude ( formatName ) ; } |
public class CircularBuffer { /** * Add an item to the queue .
* @ param item to be added */
public void enqueue ( T item ) { } } | queue [ head ] = item ; head ++ ; size ++ ; if ( head == queue . length ) head = 0 ; |
public class CmsSolrIndex { /** * Checks if the current user is allowed to access non - online indexes . < p >
* To access non - online indexes the current user must be a workplace user at least . < p >
* @ param cms the CMS object initialized with the current request context / user
* @ throws CmsSearchException ... | // If an offline index is being selected , check permissions
if ( ! CmsProject . ONLINE_PROJECT_NAME . equals ( getProject ( ) ) ) { // only if the user has the role Workplace user , he is allowed to access the Offline index
try { OpenCms . getRoleManager ( ) . checkRole ( cms , CmsRole . ELEMENT_AUTHOR ) ; } catch ( C... |
public class ByteUtils { /** * Converts a byte array to a binary String .
* @ param bytes
* a byte array
* @ param isMSB
* true if MSB , false if LSB
* @ return binary String */
public static String toBinaryString ( byte [ ] bytes , boolean isMSB ) { } } | StringBuilder sb = new StringBuilder ( ) ; for ( byte b : bytes ) { String binary = String . format ( "%8s" , Integer . toBinaryString ( b & 0xFF ) ) . replace ( ' ' , '0' ) ; if ( isMSB ) sb . append ( binary ) ; else sb . append ( new StringBuilder ( binary ) . reverse ( ) ) ; } return sb . toString ( ) ; |
public class TaskCreator { /** * Set up cross - check feature . We provide an ' xcheck ' task which depends on a number of Test tasks that run the
* unit tests compiled against every Checkstyle version against all the other Checkstyle libraries . In this way , we
* find out which versions are compatible . */
public... | final TaskContainer tasks = project . getTasks ( ) ; final Task xtest = tasks . create ( XTEST_TASK_NAME ) ; xtest . setGroup ( XTEST_GROUP_NAME ) ; xtest . setDescription ( "Run the unit tests against all supported Checkstyle runtimes" ) ; tasks . getByName ( JavaBasePlugin . BUILD_TASK_NAME ) . dependsOn ( xtest ) ; ... |
public class SubmissionUtils { /** * Re - creates a document given the document and the reserved keys .
* @ param doc Main document
* @ param reserved Document that contains reserved keys . A reserve key starts with an underscore . In this document ,
* the reserved keys do not have the starting underscore .
* @... | JSONObject result = JSONSupport . copyObject ( doc ) ; // Re - insert attributes that start with ' _ '
if ( null != reserved ) { Iterator < ? > it = reserved . keys ( ) ; while ( it . hasNext ( ) ) { Object keyObj = it . next ( ) ; if ( keyObj instanceof String ) { String key = ( String ) keyObj ; Object value = reserv... |
public class Metadata { /** * Adds a new element to the specific element class . If no element class is found , then a new element class . will be
* created .
* @ param className
* the class name
* @ param classElement
* the new element to be added . */
public void addClassElement ( final String className , f... | classElement . setType ( getNamespaceValue ( classElement . getType ( ) ) ) ; if ( classElement . getMaxOccurs ( ) != null && ! classElement . getMaxOccurs ( ) . equals ( "1" ) ) { classElement . setMaxOccurs ( "unbounded" ) ; } for ( MetadataItem item : classList ) { if ( item . getName ( ) . equals ( className ) && i... |
public class SipApplicationSessionImpl { /** * ( non - Javadoc )
* @ see javax . servlet . sip . SipApplicationSession # getTimers ( ) */
public Collection < ServletTimer > getTimers ( ) { } } | if ( ! isValid ( ) ) { throw new IllegalStateException ( "SipApplicationSession already invalidated !" ) ; } if ( servletTimers != null ) { return servletTimers . values ( ) ; } return new HashMap < String , ServletTimer > ( ) . values ( ) ; |
public class StructureDiagramGenerator { /** * Returns the other atom of the bond .
* Expects bond to have only two atoms .
* Returns null if the given atom is not part of the given bond .
* @ param atom the atom we already have
* @ param bond the bond
* @ return the other atom of the bond */
public IAtom get... | if ( ! bond . contains ( atom ) ) return null ; if ( bond . getBegin ( ) . equals ( atom ) ) return bond . getEnd ( ) ; else return bond . getBegin ( ) ; |
public class SnapshotContentItem { /** * / * ( non - Javadoc )
* @ see java . util . Comparator # compare ( java . lang . Object , java . lang . Object ) */
@ Override public int compare ( SnapshotContentItem o1 , SnapshotContentItem o2 ) { } } | return o1 . contentId . compareTo ( o2 . contentId ) ; |
public class RoleGraphEditingPlugin { /** * If startVertex is non - null , stretch an edge shape between
* startVertex and the mouse pointer to simulate edge creation */
@ SuppressWarnings ( "unchecked" ) public void mouseDragged ( MouseEvent e ) { } } | if ( checkModifiers ( e ) ) { if ( startVertex != null ) { transformEdgeShape ( down , e . getPoint ( ) ) ; transformArrowShape ( down , e . getPoint ( ) ) ; } VisualizationViewer < String , String > vv = ( VisualizationViewer < String , String > ) e . getSource ( ) ; vv . repaint ( ) ; } |
public class StringHelper { /** * Get the passed string element repeated for a certain number of times . Each
* string element is simply appended at the end of the string .
* @ param sElement
* The string to get repeated . May not be < code > null < / code > .
* @ param nRepeats
* The number of repetitions to... | ValueEnforcer . notNull ( sElement , "Element" ) ; ValueEnforcer . isGE0 ( nRepeats , "Repeats" ) ; final int nElementLength = sElement . length ( ) ; // Check if result length would exceed int range
if ( ( long ) nElementLength * nRepeats > Integer . MAX_VALUE ) throw new IllegalArgumentException ( "Resulting string e... |
public class GeopaparazziSpatialiteCreator { /** * VARS DOCS END */
@ Execute public void process ( ) throws Exception { } } | checkNull ( inGeopaparazzi , inShapefilesFolder ) ; if ( pEncoding == null || pEncoding . trim ( ) . length ( ) == 0 ) { pEncoding = "UTF-8" ; } if ( pSizeFactor < 1 ) { pSizeFactor = 3 ; } if ( pLinesWidthFactor < 1 ) { pLinesWidthFactor = 6 ; } File shpFolder = new File ( inShapefilesFolder ) ; File [ ] shpfiles = sh... |
public class DataSourceCompactionConfig { /** * This method is copied from { @ code CompactionTask # getValidTargetCompactionSizeBytes } . The only difference is this
* method doesn ' t check ' numShards ' which is not supported by { @ link UserCompactTuningConfig } .
* Currently , we can ' t use the same method he... | if ( targetCompactionSizeBytes != null ) { Preconditions . checkArgument ( ! hasPartitionConfig ( maxRowsPerSegment , tuningConfig ) , "targetCompactionSizeBytes[%s] cannot be used with maxRowsPerSegment[%s] and maxTotalRows[%s]" , targetCompactionSizeBytes , maxRowsPerSegment , tuningConfig == null ? null : tuningConf... |
public class LinkFactoryImpl { /** * Given a class , return the appropriate tool tip .
* @ param typeElement the class to get the tool tip for .
* @ return the tool tip for the appropriate class . */
private String getClassToolTip ( TypeElement typeElement , boolean isTypeLink ) { } } | Configuration configuration = m_writer . configuration ; Utils utils = configuration . utils ; if ( isTypeLink ) { return configuration . getText ( "doclet.Href_Type_Param_Title" , utils . getSimpleName ( typeElement ) ) ; } else if ( utils . isInterface ( typeElement ) ) { return configuration . getText ( "doclet.Href... |
public class FactorGraph { /** * Gets a new { @ code FactorGraph } identical to this one , except with
* every variable in { @ code varNumsToEliminate } marginalized out .
* The returned { @ code FactorGraph } is defined on the variables in
* { @ code this } , minus any of the passed - in variables . This
* pro... | FactorGraph currentFactorGraph = this ; for ( Integer eliminatedVariableIndex : varNumsToEliminate ) { // Each iteration marginalizes out a single variable from
// currentFactorGraph ,
// aggregating intermediate results in nextFactorGraph .
FactorGraph nextFactorGraph = new FactorGraph ( ) ; // Copy the variables in c... |
public class ModbusSerialMaster { /** * Disconnects this < tt > ModbusSerialMaster < / tt > from the slave . */
public void disconnect ( ) { } } | if ( connection != null && connection . isOpen ( ) ) { connection . close ( ) ; transaction = null ; setTransaction ( null ) ; } |
public class Versions { /** * Returns all minor versions for the given major version or null
* if major version does not exist .
* @ param major
* @ return */
public String [ ] getMinors ( String major ) { } } | prepareDetailedVersions ( ) ; if ( majors . containsKey ( major ) ) { return majors . get ( major ) . toArray ( new String [ ] { } ) ; } return null ; |
public class IntentMarshaller { /** * Marshall the given parameter object . */
public void marshall ( Intent intent , ProtocolMarshaller protocolMarshaller ) { } } | if ( intent == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( intent . getIntentName ( ) , INTENTNAME_BINDING ) ; protocolMarshaller . marshall ( intent . getIntentVersion ( ) , INTENTVERSION_BINDING ) ; } catch ( Exception e ) { throw new ... |
public class Worker { /** * We could response to a node change by attempting to modify the driver in the current worker
* however it is cleaner to bring this worker down gracefully , and let it restart elsewhere
* ( non - Javadoc )
* @ see org . apache . zookeeper . Watcher # process ( org . apache . zookeeper . ... | logger . debug ( "recived event " + event ) ; if ( event . getState ( ) == KeeperState . Expired || event . getState ( ) == KeeperState . Disconnected ) { driver . setGoOn ( false ) ; shutdown ( ) ; } if ( event . getType ( ) == EventType . NodeDataChanged || event . getType ( ) == EventType . NodeDeleted ) { driver . ... |
public class ResourceFinder { /** * Reads the contents of the found URLs as a Strings and returns them .
* Individual URLs that cannot be read are skipped and added to the
* list of ' resourcesNotLoaded '
* @ param uri
* @ return a list of the content of each resource URL found
* @ throws IOException if class... | resourcesNotLoaded . clear ( ) ; String fulluri = path + uri ; List < String > strings = new ArrayList < > ( ) ; Enumeration < URL > resources = getResources ( fulluri ) ; while ( resources . hasMoreElements ( ) ) { URL url = resources . nextElement ( ) ; try { String string = readContents ( url ) ; strings . add ( str... |
public class Table { /** * ignore the result or throw an ArrayIndexOutOfBound exception */
@ GuardedBy ( "lock" ) protected int computeRow ( long seqno ) { } } | int diff = ( int ) ( seqno - offset ) ; if ( diff < 0 ) return diff ; return diff / elements_per_row ; |
public class StateId { /** * Convenience method for creating a list of { @ code StateId } s suitable for paging through a stored state . Each
* { @ code StateId } will have the same state token as { @ code this } but with different index ranges . For example , with
* a page size of 200 and a total results of 420 , ... | Validate . isTrue ( pageSize > 0 , "Page size must be positive: was " + pageSize ) ; Validate . isTrue ( totalResults > 0 , "Total results must be positive: was " + totalResults ) ; final List < StateId > pages = new ArrayList < StateId > ( totalResults / pageSize + 1 ) ; Range range = Range . first ( pageSize ) ; for ... |
public class LinkHandler { /** * Initialize non - persistent fields . These fields are common to both MS
* reconstitution of DestinationHandlers and initial creation .
* @ param messageProcessor the message processor instance
* @ param durableSubscriptionsTable the topicspace durable subscriptions
* HashMap fro... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "initializeNonPersistent" , new Object [ ] { messageProcessor , durableSubscriptionsTable , transaction } ) ; super . initializeNonPersistent ( messageProcessor , durableSubscriptionsTable , transaction ) ; // Required to pi... |
public class Ra10XmlGen { /** * Output xml
* @ param def definition
* @ param out Writer
* @ throws IOException ioException */
@ Override public void writeXmlBody ( Definition def , Writer out ) throws IOException { } } | writeConnectorVersion ( out ) ; int indent = 1 ; writeIndent ( out , indent ) ; out . write ( "<display-name>Display Name</display-name>" ) ; writeEol ( out ) ; writeIndent ( out , indent ) ; out . write ( "<vendor-name>Red Hat Inc</vendor-name>" ) ; writeEol ( out ) ; writeIndent ( out , indent ) ; out . write ( "<spe... |
public class NetUtil { /** * Creates a HTTP connection to the given URL .
* @ param pURL the URL to get .
* @ param pProperties connection properties .
* @ param pFollowRedirects specifies whether we should follow redirects .
* @ param pTimeout the specified timeout , in milliseconds .
* @ return a HttpURLCon... | // Open the connection , and get the stream
HttpURLConnection conn ; if ( pTimeout > 0 ) { // Supports timeout
conn = new com . twelvemonkeys . net . HttpURLConnection ( pURL , pTimeout ) ; } else { // Faster , more compatible
conn = ( HttpURLConnection ) pURL . openConnection ( ) ; } // Set user agent
if ( ( pProperti... |
public class CachingFileAccess { /** * Reset the Cleanup size and interval
* The size and interval when started are 500 items ( memory size unknown ) checked every minute in a background thread .
* @ param size
* @ param interval */
public void cleanupParams ( int size , long interval ) { } } | timer . cancel ( ) ; timer . schedule ( new Cleanup ( content , size ) , interval , interval ) ; |
public class IndustryApi { /** * List character industry jobs List industry jobs placed by a character - - -
* This route is cached for up to 300 seconds SSO Scope :
* esi - industry . read _ character _ jobs . v1
* @ param characterId
* An EVE character ID ( required )
* @ param datasource
* The server nam... | ApiResponse < List < CharacterIndustryJobsResponse > > resp = getCharactersCharacterIdIndustryJobsWithHttpInfo ( characterId , datasource , ifNoneMatch , includeCompleted , token ) ; return resp . getData ( ) ; |
public class IonWriterSystemBinary { /** * { @ inheritDoc }
* The { @ link OutputStream } spec is mum regarding the behavior of flush on
* a closed stream , so we shouldn ' t assume that our stream can handle that . */
public final void flush ( ) throws IOException { } } | if ( ! _closed ) { if ( atDatagramLevel ( ) && ! hasAnnotations ( ) ) { SymbolTable symtab = getSymbolTable ( ) ; if ( symtab != null && symtab . isReadOnly ( ) && symtab . isLocalTable ( ) ) { // It ' s no longer possible to add more symbols to the local
// symtab , so we can safely write everything out .
writeAllBuff... |
public class DataSet { /** * Strips the data transform of all but the passed in labels
* @ param labels strips the data transform of all but the passed in labels
* @ return the dataset with only the specified labels */
@ Override public DataSet filterBy ( int [ ] labels ) { } } | List < DataSet > list = asList ( ) ; List < DataSet > newList = new ArrayList < > ( ) ; List < Integer > labelList = new ArrayList < > ( ) ; for ( int i : labels ) labelList . add ( i ) ; for ( DataSet d : list ) { int outcome = d . outcome ( ) ; if ( labelList . contains ( outcome ) ) { newList . add ( d ) ; } } retur... |
public class AbstractRunMojo { /** * Build a customized webapp in a directory ,
* applying a number of AMPs and / or JARs from alfresco maven plugin configuration .
* @ param warName the name of the custom war
* @ param modules the modules that should be applied to the custom war
* @ param originalWarGroupId th... | final String warOutputDir = getWarOutputDir ( warName ) ; final String ampsModuleDir = "modules/" + warName + "/amps" ; final String ampsOutputDir = "${project.build.directory}/" + ampsModuleDir ; List < Element > ampModules = new ArrayList < > ( ) ; List < Element > jarModules = new ArrayList < > ( ) ; if ( modules !=... |
public class ApiErrorExtractor { /** * Determine if a given GoogleJsonError is caused by , and only by ,
* account disabled error . */
public boolean accessDeniedNonRecoverable ( GoogleJsonError e ) { } } | ErrorInfo errorInfo = getErrorInfo ( e ) ; if ( errorInfo != null ) { String reason = errorInfo . getReason ( ) ; return ACCOUNT_DISABLED_REASON_CODE . equals ( reason ) || ACCESS_NOT_CONFIGURED_REASON_CODE . equals ( reason ) ; } return false ; |
public class SimpleSourceFactory { /** * ( non - Javadoc )
* @ see com . sematext . ag . source . SourceFactory # create ( ) */
@ Override public Source create ( ) throws InitializationFailedException { } } | Source source = null ; try { source = sourceClass . newInstance ( ) ; } catch ( InstantiationException e ) { LOG . fatal ( "Creating source failed, " + SOURCE_CLASS_CONFIG_KEY + ": " + sourceClass , e ) ; System . exit ( 0 ) ; } catch ( IllegalAccessException e ) { LOG . fatal ( "Creating source failed, " + SOURCE_CLAS... |
public class CredentialEncrypter { /** * Returns true if the provided bytes _ could _ be encrypted credentials , even if they can ' t be decrypted
* by a specific instance . */
public static boolean isPotentiallyEncryptedBytes ( byte [ ] bytes ) { } } | checkNotNull ( bytes , "bytes" ) ; // The number of bytes is a non - zero multiple of the block size .
try { return bytes . length != 0 && bytes . length % Cipher . getInstance ( CIPHER ) . getBlockSize ( ) == 0 ; } catch ( Throwable t ) { // This shouldn ' t happen since AES is supported by all JVMs .
throw Throwables... |
public class NrqlAlertConditionService { /** * Updates the given NRQL alert condition .
* @ param condition The alert condition to update
* @ return The alert condition that was updated */
public Optional < NrqlAlertCondition > update ( NrqlAlertCondition condition ) { } } | return HTTP . PUT ( String . format ( "/v2/alerts_nrql_conditions/%d.json" , condition . getId ( ) ) , condition , NRQL_ALERT_CONDITION ) ; |
public class PactDslWithProvider { /** * Description of the request that is expected to be received
* @ param description request description */
public PactDslRequestWithoutPath uponReceiving ( String description ) { } } | return new PactDslWithState ( consumerPactBuilder , consumerPactBuilder . getConsumerName ( ) , providerName , defaultRequestValues , defaultResponseValues ) . uponReceiving ( description ) ; |
public class ApiClientMgr { /** * 重新创建apiclient
* 2种情况需要重新创建 : 1 、 首次 2 、 client的状态已经紊乱
* @ return 新创建的client */
private HuaweiApiClient resetApiClient ( ) { } } | if ( context == null ) { HMSAgentLog . e ( "HMSAgent not init" ) ; return null ; } synchronized ( APICLIENT_LOCK ) { if ( apiClient != null ) { // 对于老的apiClient , 1分钟后才丢弃 , 防止外面正在使用过程中这边disConnect了
disConnectClientDelay ( apiClient , 60000 ) ; } HMSAgentLog . d ( "reset client" ) ; // 这种重置client , 极端情况可能会出现2个client都回调结... |
public class HttpJsonSerializer { /** * Parses a single Tree object
* < b > Note : < / b > Incoming data is a hash map of strings instead of directly
* deserializing to a tree . We do it this way because we don ' t want users
* messing with the timestamp fields .
* @ return A parsed Tree
* @ throws JSONExcept... | final String json = query . getContent ( ) ; if ( json == null || json . isEmpty ( ) ) { throw new BadRequestException ( HttpResponseStatus . BAD_REQUEST , "Missing message content" , "Supply valid JSON formatted data in the body of your request" ) ; } try { final HashMap < String , String > properties = JSON . parseTo... |
public class ArrayListBag { @ SuppressWarnings ( "unchecked" ) @ Override public void bag ( ArrayList < Object > unBaggedObject ) { } } | if ( unBaggedObject == null || unBaggedObject . isEmpty ( ) ) return ; arrayObj = new Object [ unBaggedObject . size ( ) ] ; Object obj = null ; for ( int i = 0 ; i < arrayObj . length ; i ++ ) { obj = unBaggedObject . get ( i ) ; if ( obj instanceof Date ) obj = new DateBag ( ( Date ) obj ) ; else if ( obj instanceof ... |
public class AmazonWorkspacesClient { /** * Deletes the specified image from your account . To delete an image , you must first delete any bundles that are
* associated with the image .
* @ param deleteWorkspaceImageRequest
* @ return Result of the DeleteWorkspaceImage operation returned by the service .
* @ th... | request = beforeClientExecution ( request ) ; return executeDeleteWorkspaceImage ( request ) ; |
public class CmsSite { /** * Gets all site matchers which should be used for matching the site . < p >
* @ return all site matchers to be used for matching the site */
public List < CmsSiteMatcher > getAllMatchers ( ) { } } | List < CmsSiteMatcher > result = Lists . newArrayList ( ) ; switch ( getSSLMode ( ) ) { case LETS_ENCRYPT : case MANUAL_EP_TERMINATION : List < CmsSiteMatcher > baseMatchers = Lists . newArrayList ( ) ; baseMatchers . add ( m_siteMatcher ) ; for ( CmsSiteMatcher alias : m_aliases ) { baseMatchers . add ( alias ) ; } //... |
public class SimonVisitors { /** * Visit Simons recursively as a tree starting from the specified Simon .
* @ param simon Parent simon
* @ param visitor Visitor
* @ throws IOException */
public static void visitTree ( Simon simon , SimonVisitor visitor ) throws IOException { } } | visitor . visit ( simon ) ; for ( Simon childSimon : simon . getChildren ( ) ) { visitTree ( childSimon , visitor ) ; } |
public class HTTPFaxClientSpi { /** * This function will submit a new fax job . < br >
* The fax job ID may be populated by this method in the provided
* fax job object .
* @ param faxJob
* The fax job object containing the needed information */
@ Override protected void submitFaxJobImpl ( FaxJob faxJob ) { } } | // create HTTP request
HTTPRequest httpRequest = this . createSubmitFaxJobHTTPRequest ( faxJob ) ; // submit HTTP request
this . submitHTTPRequest ( faxJob , httpRequest , FaxActionType . SUBMIT_FAX_JOB ) ; |
public class PolicyViolationError { /** * Gets the violatingParts value for this PolicyViolationError .
* @ return violatingParts * Lists the parts that violate the policy . */
public com . google . api . ads . adwords . axis . v201809 . rm . PolicyViolationErrorPart [ ] getViolatingParts ( ) { } } | return violatingParts ; |
public class GetUploadRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetUploadRequest getUploadRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getUploadRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getUploadRequest . getArn ( ) , ARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e... |
public class GroovyMBean { /** * Description of the specified attribute name .
* @ param attr - the attribute
* @ return String the description */
protected String describeAttribute ( MBeanAttributeInfo attr ) { } } | StringBuilder buf = new StringBuilder ( ) ; buf . append ( "(" ) ; if ( attr . isReadable ( ) ) { buf . append ( "r" ) ; } if ( attr . isWritable ( ) ) { buf . append ( "w" ) ; } buf . append ( ") " ) . append ( attr . getType ( ) ) . append ( " " ) . append ( attr . getName ( ) ) ; return buf . toString ( ) ; |
public class Checks { /** * Checks that passed reference is not null ,
* throws { @ link NullPointerException } with passed message if reference is null
* @ param object to check
* @ param message exception message if object is null */
public static void checkNotNull ( @ Nullable Object object , @ NonNull String ... | if ( object == null ) { throw new NullPointerException ( message ) ; } |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EEnum getMediaEjectControlReserved ( ) { } } | if ( mediaEjectControlReservedEEnum == null ) { mediaEjectControlReservedEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 92 ) ; } return mediaEjectControlReservedEEnum ; |
public class InventoryNavigator { /** * Get the ManagedObjectReference for an item under the
* specified parent node that has the type and name specified .
* @ param type type of the managed object
* @ param name name to match
* @ return First ManagedEntity object of the type / name pair found
* @ throws Remo... | if ( name == null || name . length ( ) == 0 ) { return null ; } if ( type == null ) { type = "ManagedEntity" ; } String [ ] [ ] typeinfo = new String [ ] [ ] { new String [ ] { type , "name" , } , } ; ObjectContent [ ] ocs = retrieveObjectContents ( typeinfo , true ) ; if ( ocs == null || ocs . length == 0 ) { return n... |
public class ModelsImpl { /** * Deletes an intent classifier from the application .
* @ param appId The application ID .
* @ param versionId The version ID .
* @ param intentId The intent classifier ID .
* @ param deleteIntentOptionalParameter the object representing the optional parameters to be set before cal... | return ServiceFuture . fromResponse ( deleteIntentWithServiceResponseAsync ( appId , versionId , intentId , deleteIntentOptionalParameter ) , serviceCallback ) ; |
public class OntopOptimizationConfigurationImpl { /** * To be overloaded */
@ Override protected Stream < Module > buildGuiceModules ( ) { } } | return Stream . concat ( super . buildGuiceModules ( ) , Stream . of ( new OntopOptimizationModule ( this ) ) ) ; |
public class CmsShellCommands { /** * Changes the access control for a given resource and a given principal ( user / group ) .
* @ param resourceName name of the resource
* @ param principalType the type of the principal ( group or user )
* @ param principalName name of the principal
* @ param permissionString ... | m_cms . lockResource ( resourceName ) ; if ( I_CmsPrincipal . PRINCIPAL_GROUP . equalsIgnoreCase ( principalType . trim ( ) ) ) { principalName = OpenCms . getImportExportManager ( ) . translateGroup ( principalName ) ; } else { principalName = OpenCms . getImportExportManager ( ) . translateUser ( principalName ) ; } ... |
public class Flowable { /** * Converts a { @ link Future } into a Publisher .
* < img width = " 640 " height = " 315 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / from . Future . png " alt = " " >
* You can convert any object that supports the { @ link Future } int... | ObjectHelper . requireNonNull ( future , "future is null" ) ; return RxJavaPlugins . onAssembly ( new FlowableFromFuture < T > ( future , 0L , null ) ) ; |
public class OMMapBufferEntry { /** * Flushes the memory mapped buffer to disk only if it ' s dirty .
* @ return true if the buffer has been successfully flushed , otherwise false . */
boolean flush ( ) { } } | if ( ! dirty ) return true ; acquireExclusiveLock ( ) ; try { final long timer = OProfiler . getInstance ( ) . startChrono ( ) ; // FORCE THE WRITE OF THE BUFFER
for ( int i = 0 ; i < FORCE_RETRY ; ++ i ) { try { buffer . force ( ) ; dirty = false ; break ; } catch ( Exception e ) { OLogManager . instance ( ) . debug (... |
public class KeyRangeIterable { /** * Convenience function to add the correct { @ link StackedIterator } to the key
* range Iterator stack .
* This method is used to add a < em > single < / em > < em > projected < / em > constraint
* to the stack . */
private static Iterator < MarkerRange . Builder > addProjected... | if ( projected instanceof In ) { return new SetIterator ( ( In ) projected , name , inner ) ; } else if ( projected instanceof Range ) { return new RangeIterator ( name , ( Range ) projected , inner ) ; } else { return inner ; } |
public class TokenUtils { /** * Read a PEM encoded public key from the classpath
* @ param pemResName - key file resource name
* @ return PublicKey
* @ throws Exception on decode failure */
public static PublicKey readPublicKey ( String pemResName ) throws Exception { } } | InputStream contentIS = TokenUtils . class . getResourceAsStream ( pemResName ) ; byte [ ] tmp = new byte [ 4096 ] ; int length = contentIS . read ( tmp ) ; PublicKey publicKey = decodePublicKey ( new String ( tmp , 0 , length ) ) ; return publicKey ; |
public class SubscriptionService { /** * Changes the amount of a subscription . < br >
* < br >
* The new amount is valid one - time only after which the original subscription amount will be charged again . If you
* want to permanently change the amount use { @ link SubscriptionService # changeAmount ( String , I... | return changeAmount ( subscription , amount , 0 , null , null ) ; |
public class ParosTableContext { /** * / * ( non - Javadoc )
* @ see org . parosproxy . paros . db . paros . TableContext # getDataForContext ( int ) */
@ Override public synchronized List < RecordContext > getDataForContext ( int contextId ) throws DatabaseException { } } | try { List < RecordContext > result = new ArrayList < > ( ) ; psGetAllDataForContext . setInt ( 1 , contextId ) ; try ( ResultSet rs = psGetAllDataForContext . executeQuery ( ) ) { while ( rs . next ( ) ) { result . add ( new RecordContext ( rs . getLong ( DATAID ) , rs . getInt ( CONTEXTID ) , rs . getInt ( TYPE ) , r... |
public class UserManager { /** * Get the user with the specified email address
* @ param sEmailAddress
* The email address to be checked . May be < code > null < / code > .
* @ return < code > null < / code > if no such user exists
* @ see # getUserOfEmailAddressIgnoreCase ( String ) */
@ Nullable public IUser ... | if ( StringHelper . hasNoText ( sEmailAddress ) ) return null ; return findFirst ( x -> sEmailAddress . equals ( x . getEmailAddress ( ) ) ) ; |
public class GetInventoryResult { /** * Collection of inventory entities such as a collection of instance inventory .
* @ return Collection of inventory entities such as a collection of instance inventory . */
public java . util . List < InventoryResultEntity > getEntities ( ) { } } | if ( entities == null ) { entities = new com . amazonaws . internal . SdkInternalList < InventoryResultEntity > ( ) ; } return entities ; |
public class Heritrix3Wrapper { /** * Returns the job state object given a jobname .
* @ param jobname job name
* @ return job state */
public JobResult job ( String jobname ) { } } | HttpGet getRequest = new HttpGet ( baseUrl + "job/" + jobname ) ; getRequest . addHeader ( "Accept" , "application/xml" ) ; return jobResult ( getRequest ) ; |
public class CommerceTaxFixedRatePersistenceImpl { /** * Removes all the commerce tax fixed rates where commerceTaxMethodId = & # 63 ; from the database .
* @ param commerceTaxMethodId the commerce tax method ID */
@ Override public void removeByCommerceTaxMethodId ( long commerceTaxMethodId ) { } } | for ( CommerceTaxFixedRate commerceTaxFixedRate : findByCommerceTaxMethodId ( commerceTaxMethodId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( commerceTaxFixedRate ) ; } |
public class ThriftDataHandler { /** * Populate entity from slice .
* @ param m the m
* @ param relationNames the relation names
* @ param isWrapReq the is wrap req
* @ param e the e
* @ param columnOrSuperColumnsFromRow the column or super columns from row
* @ return the object
* @ throws CharacterCoding... | ThriftDataResultHelper dataGenerator = new ThriftDataResultHelper ( ) ; for ( ByteBuffer key : columnOrSuperColumnsFromRow . keySet ( ) ) { Object id = PropertyAccessorHelper . getObject ( m . getIdAttribute ( ) . getJavaType ( ) , key . array ( ) ) ; ThriftRow tr = new ThriftRow ( ) ; tr . setColumnFamilyName ( m . ge... |
public class AbstractWebSink { /** * a convenience method for creating a metrics cache */
< K , V > Cache < K , V > createCache ( ) { } } | return CacheBuilder . newBuilder ( ) . maximumSize ( cacheMaxSize ) . expireAfterWrite ( cacheTtlSeconds , TimeUnit . SECONDS ) . ticker ( cacheTicker ) . build ( ) ; |
public class LoadPermissionModifications { /** * The load permissions to add .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setAdd ( java . util . Collection ) } or { @ link # withAdd ( java . util . Collection ) } if you want to override the
* existing ... | if ( this . add == null ) { setAdd ( new com . amazonaws . internal . SdkInternalList < LoadPermissionRequest > ( add . length ) ) ; } for ( LoadPermissionRequest ele : add ) { this . add . add ( ele ) ; } return this ; |
public class DescribeResourceRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeResourceRequest describeResourceRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( describeResourceRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeResourceRequest . getOrganizationId ( ) , ORGANIZATIONID_BINDING ) ; protocolMarshaller . marshall ( describeResourceRequest . getResourceId ( ) , RESOUR... |
public class FailureInfoMarshaller { /** * Marshall the given parameter object . */
public void marshall ( FailureInfo failureInfo , ProtocolMarshaller protocolMarshaller ) { } } | if ( failureInfo == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( failureInfo . getStatusCode ( ) , STATUSCODE_BINDING ) ; protocolMarshaller . marshall ( failureInfo . getErrorCode ( ) , ERRORCODE_BINDING ) ; protocolMarshaller . marshall... |
public class Queue { /** * Release reserved message after specified time . If there is no message with such id on the queue , an
* EmptyQueueException is thrown .
* @ param message The message to release .
* @ param delay The time after which the message will be released .
* @ throws io . iron . ironmq . HTTPEx... | releaseMessage ( message . getId ( ) , message . getReservationId ( ) , new Long ( delay ) ) ; |
public class Boxing { /** * Transforms an array of { @ code Boolean } , { @ code Character } , or { @ code Number }
* into a primitive array .
* @ param src source array
* @ param srcPos start position
* @ param len length
* @ return primitive array */
public static Object unboxAll ( Object [ ] src , int srcP... | if ( srcPos >= src . length ) { throw new IndexOutOfBoundsException ( String . valueOf ( srcPos ) ) ; } Class < ? > type = src [ srcPos ] . getClass ( ) ; return unboxAll ( type , src , srcPos , len ) ; |
public class DataCubeAPI { /** * 拉取会员卡数据 < br >
* 1 . 查询时间区间需 & lt ; = 62天 , 否则报错 ; < br >
* 2 . 传入时间格式需严格参照示例填写如 ” 2015-06-15 ” , 否则报错 ; < br >
* 3 . 该接口只能拉取非当天的数据 , 不能拉取当天的卡券数据 , 否则报错 。 < br >
* @ param access _ token access _ token
* @ param memberCardCube memberCardCube
* @ return result */
public stati... | return getCardMemberCardInfo ( access_token , JsonUtil . toJSONString ( memberCardCube ) ) ; |
public class JavaClasspathParser { /** * Reads entry of a . classpath file .
* @ param projectName
* - the name of project containing the . classpath file
* @ param projectRootAbsoluteFullPath
* - the path to project containing the . classpath file
* @ param unknownElements
* - map of unknow elements
* @ ... | final URL rscFile = new URL ( projectRootAbsoluteFullPath . toExternalForm ( ) . concat ( JavaProject . CLASSPATH_FILENAME ) ) ; byte [ ] bytes ; // when a project is imported , we get a first delta for the addition of the . project , but the . classpath is not accessible
// so default to using java . io . File
// see ... |
public class IO { /** * Provide a skip fully method . Either skips the requested number of bytes
* or throws an IOException ;
* @ param in
* The input stream on which to perform the skip
* @ param bytes
* Number of bytes to skip
* @ throws EOFException
* if we reach EOF and still need to skip more bytes
... | if ( bytes < 0 ) { throw new IllegalArgumentException ( "Can't skip " + bytes + " bytes" ) ; } long remaining = bytes ; while ( remaining > 0 ) { long skipped = in . skip ( remaining ) ; if ( skipped <= 0 ) { throw new EOFException ( "Reached EOF while trying to skip a total of " + bytes ) ; } remaining -= skipped ; } |
public class CommerceCurrencyPersistenceImpl { /** * Caches the commerce currencies in the entity cache if it is enabled .
* @ param commerceCurrencies the commerce currencies */
@ Override public void cacheResult ( List < CommerceCurrency > commerceCurrencies ) { } } | for ( CommerceCurrency commerceCurrency : commerceCurrencies ) { if ( entityCache . getResult ( CommerceCurrencyModelImpl . ENTITY_CACHE_ENABLED , CommerceCurrencyImpl . class , commerceCurrency . getPrimaryKey ( ) ) == null ) { cacheResult ( commerceCurrency ) ; } else { commerceCurrency . resetOriginalValues ( ) ; } ... |
public class TransformStatistics { /** * Extracts the row , column , and matrix summations based on entries in
* the given { @ link Matrix } . If { @ code countRowOccurrances } is true , the
* number of non zeros in each row will be counted for the row summation .
* If { @ code countColumnOccurrances } is true , ... | // Initialize the statistics .
int numColumns = 0 ; int numRows = 0 ; double matrixSum = 0 ; Map < Integer , Double > rowCountMap = new IntegerMap < Double > ( ) ; Map < Integer , Double > colCountMap = new IntegerMap < Double > ( ) ; // Get an iterator for the matrix file .
Iterator < MatrixEntry > iter ; try { iter =... |
public class MessageListenerFilterList { /** * Free . */
public void free ( ) { } } | Iterator < BaseMessageFilter > iterator = this . iterator ( ) ; while ( iterator . hasNext ( ) ) { BaseMessageFilter messageFilter = iterator . next ( ) ; boolean bFilterOwner = false ; if ( messageFilter . getMessageListener ( 0 ) == this ) bFilterOwner = true ; messageFilter . removeFilterMessageListener ( m_messageL... |
public class StrSubstitutor { /** * Replaces all the occurrences of variables within the given source buffer
* with their matching values from the resolver .
* The buffer is updated with the result .
* Only the specified portion of the buffer will be processed .
* The rest of the buffer is not processed , but i... | if ( source == null ) { return false ; } final StrBuilder buf = new StrBuilder ( length ) . append ( source , offset , length ) ; if ( substitute ( buf , 0 , length ) == false ) { return false ; } source . replace ( offset , offset + length , buf . toString ( ) ) ; return true ; |
public class AbstractMetamodelDeclarationImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } } | switch ( featureID ) { case XtextPackage . ABSTRACT_METAMODEL_DECLARATION__EPACKAGE : setEPackage ( ( EPackage ) null ) ; return ; case XtextPackage . ABSTRACT_METAMODEL_DECLARATION__ALIAS : setAlias ( ALIAS_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ; |
public class GdxUtilities { /** * Attempts to close the application on each platform . Calls { @ link Application # exit ( ) } on regular platforms and
* manually calls { @ link ApplicationListener # dispose ( ) } on GWT , as it doesn ' t implement exit method properly .
* Null - safe , this method will have an eff... | final Application application = Gdx . app ; if ( application == null ) { return ; } else if ( isRunningOnGwt ( ) ) { // GWT Application # exit ( ) implementation is empty . Disposing manually .
if ( application . getApplicationListener ( ) != null ) { application . getApplicationListener ( ) . dispose ( ) ; // Applicat... |
public class CuckooFilter { /** * Creates a new { @ code CuckooFilter } that ' s a copy of this instance . The
* new instance is equal to this instance but shares no mutable state . Note
* that further { @ code # put ( Object ) } } operations < i > may < / i > cause a copy to
* diverge even if the same operations... | victimLock . readLock ( ) ; bucketLocker . lockAllBucketsRead ( ) ; try { return new CuckooFilter < > ( hasher . copy ( ) , table . copy ( ) , count , hasVictim , victim . copy ( ) , expectedConcurrency ) ; } finally { bucketLocker . unlockAllBucketsRead ( ) ; victimLock . tryUnlockRead ( ) ; } |
public class WorkUnitContext { /** * All the { @ link Executor } s that jointly execute a { @ link Task } call this method to synchronize on the start . */
public void synchronizeStart ( ) throws InterruptedException { } } | startLatch . synchronize ( ) ; // the main thread will send a notification
Executor e = Executor . currentExecutor ( ) ; WorkUnit wu = e . getCurrentWorkUnit ( ) ; if ( wu . isMainWork ( ) ) { future . start . set ( e . getCurrentExecutable ( ) ) ; } |
public class RepairingNsStreamWriter { /** * Element copier method implementation suitable for use with
* namespace - aware writers in repairing mode .
* The trickiest thing is having to properly
* order calls to < code > setPrefix < / code > , < code > writeNamespace < / code >
* and < code > writeStartElement... | /* In case of repairing stream writer , we can actually just
* go ahead and first output the element : stream writer should
* be able to resolve namespace mapping for the element
* automatically , as necessary . */
String prefix = elemStack . getPrefix ( ) ; String uri = elemStack . getNsURI ( ) ; writeStartEleme... |
public class ProteinBuilderTool { /** * Creates a BioPolymer from a sequence of amino acid as identified by a
* the sequence of their one letter codes . It uses the given { @ link IChemObjectBuilder }
* to create a data model .
* < p > For example :
* < pre >
* BioPolymer protein = ProteinBuilderTool . create... | Map < String , IAminoAcid > templates = AminoAcids . getHashMapBySingleCharCode ( ) ; IBioPolymer protein = builder . newInstance ( IBioPolymer . class ) ; IStrand strand = builder . newInstance ( IStrand . class ) ; IAminoAcid previousAA = null ; for ( int i = 0 ; i < sequence . length ( ) ; i ++ ) { String aminoAcidC... |
public class VectorUtil { /** * Compute the absolute cosine of the angle between two dense vectors .
* To convert it to radians , use < code > Math . acos ( angle ) < / code > !
* @ param v1 first vector
* @ param v2 second vector
* @ return Angle */
public static double angleDense ( NumberVector v1 , NumberVec... | final int dim1 = v1 . getDimensionality ( ) , dim2 = v2 . getDimensionality ( ) ; final int mindim = ( dim1 <= dim2 ) ? dim1 : dim2 ; // Essentially , we want to compute this :
// v1 . transposeTimes ( v2 ) / ( v1 . euclideanLength ( ) * v2 . euclideanLength ( ) ) ;
// We can just compute all three in parallel .
double... |
public class FaultManager { /** * Check if a resource on a node is blacklisted .
* @ param nodeName The node name .
* @ param type The type of resource to check for blacklisting .
* @ return A boolean value that is true if blacklisted , false if not . */
public boolean isBlacklisted ( String nodeName , ResourceTy... | List < ResourceType > blacklistedResourceTypes = blacklistedNodes . get ( nodeName ) ; if ( blacklistedResourceTypes != null ) { synchronized ( blacklistedResourceTypes ) { return blacklistedResourceTypes . contains ( type ) ; } } else { return false ; } |
public class Distribution { /** * Computes the inverse Cumulative Density Function ( CDF < sup > - 1 < / sup > ) at
* the given point . It takes in a value in the range of [ 0 , 1 ] and returns
* the value x , such that CDF ( x ) = < tt > p < / tt >
* @ param p the probability value
* @ return the value such th... | if ( p < 0 || p > 1 ) throw new ArithmeticException ( "Value of p must be in the range [0,1], not " + p ) ; double a = Double . isInfinite ( min ( ) ) ? Double . MIN_VALUE : min ( ) ; double b = Double . isInfinite ( max ( ) ) ? Double . MAX_VALUE : max ( ) ; // default case , lets just do a root finding on the CDF for... |
public class CommitVisitor { /** * Determines whether the specified visitable object is commit - able . The object is commit - able if the object
* is Auditable and this Visitor is not targeting a specific object in the application domain object graph
* hierarchy .
* @ param visitable the visited object being eva... | return ( visitable instanceof Auditable && ( target == null || identity ( visitable ) == identity ( target ) ) ) ; |
public class Gauge { /** * Defines if only the first and the last ticklabel
* will be drawn . Sometimes this could be useful if a gauge
* should for example only should show 0 and 1000.
* @ param VISIBLE */
public void setOnlyFirstAndLastTickLabelVisible ( final boolean VISIBLE ) { } } | if ( null == onlyFirstAndLastTickLabelVisible ) { _onlyFirstAndLastTickLabelVisible = VISIBLE ; fireUpdateEvent ( REDRAW_EVENT ) ; } else { onlyFirstAndLastTickLabelVisible . set ( VISIBLE ) ; } |
public class CleverTapAPI { /** * Push */
private void pushFCMDeviceToken ( String token , final boolean register , final boolean forceUpdate ) { } } | synchronized ( tokenLock ) { if ( havePushedDeviceToken && ! forceUpdate ) { getConfigLogger ( ) . verbose ( getAccountId ( ) , "FcmManager: skipping device token push - already sent." ) ; return ; } try { token = ( token != null ) ? token : getCachedFCMToken ( ) ; if ( token == null ) return ; pushDeviceToken ( contex... |
public class OfflineDownloadOptions { /** * Used to build a new instance of this class .
* @ return this classes builder class
* @ since 0.1.0 */
public static Builder builder ( ) { } } | return new AutoValue_OfflineDownloadOptions . Builder ( ) . uuid ( UUID . randomUUID ( ) . getMostSignificantBits ( ) ) . metadata ( new byte [ ] { } ) . progress ( 0 ) ; // TODO user must provide a notificationOptions object |
public class ProgressiveJpegParser { /** * Parses more data from inputStream .
* @ param inputStream instance of buffered pooled byte buffer input stream */
private boolean doParseMoreData ( final InputStream inputStream ) { } } | final int oldBestScanNumber = mBestScanNumber ; try { int nextByte ; while ( mParserState != NOT_A_JPEG && ( nextByte = inputStream . read ( ) ) != - 1 ) { mBytesParsed ++ ; if ( mEndMarkerRead ) { // There should be no more data after the EOI marker , just in case there is lets
// bail out instead of trying to parse t... |
public class AWSStorageGatewayClient { /** * Deletes the specified virtual tape . This operation is only supported in the tape gateway type .
* @ param deleteTapeRequest
* DeleteTapeInput
* @ return Result of the DeleteTape operation returned by the service .
* @ throws InvalidGatewayRequestException
* An exc... | request = beforeClientExecution ( request ) ; return executeDeleteTape ( request ) ; |
public class ReflectionUtil { /** * Rerturns the { @ link Class # getDeclaredFields ( ) declared field } with the given name .
* @ param type must not be < code > null < / code > .
* @ param name must not be < code > null < / code > .
* @ return the field , or < code > null < / code > */
public static Field findF... | if ( type == null ) { throw new IllegalArgumentException ( "Method argument type must not be null" ) ; } if ( name == null ) { throw new IllegalArgumentException ( "Method argument name must not be null" ) ; } Class < ? > c = type ; do { for ( Field f : c . getDeclaredFields ( ) ) { if ( name . equals ( f . getName ( )... |
public class PorterStemmer { /** * cons ( i ) is true < = > b [ i ] is a consonant . */
private final boolean cons ( int i ) { } } | switch ( sb . charAt ( i ) ) { case 'a' : case 'e' : case 'i' : case 'o' : case 'u' : return false ; case 'y' : return ( i == 0 ) ? true : ! cons ( i - 1 ) ; default : return true ; } |
public class InputChannel { /** * Increases the current backoff and returns whether the operation was successful .
* @ return < code > true < / code > , iff the operation was successful . Otherwise , < code > false < / code > . */
protected boolean increaseBackoff ( ) { } } | // Backoff is disabled
if ( currentBackoff < 0 ) { return false ; } // This is the first time backing off
if ( currentBackoff == 0 ) { currentBackoff = initialBackoff ; return true ; } // Continue backing off
else if ( currentBackoff < maxBackoff ) { currentBackoff = Math . min ( currentBackoff * 2 , maxBackoff ) ; ret... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.