signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class TopologyBuilder { /** * Define a new bolt in this topology . This defines a basic bolt , which is a
* simpler to use but more restricted kind of bolt . Basic bolts are intended
* for non - aggregation processing and automate the anchoring / acking process to
* achieve proper reliability in the topolo... | return setBolt ( id , bolt , null ) ; |
public class StructureTools { /** * List of groups from the structure not included in ca ( e . g . ligands ) .
* Unaligned groups are searched from all chains referenced in ca , as well
* as any chains in the first model of the structure from ca [ 0 ] , if any .
* @ param ca an array of atoms
* @ return */
publ... | Set < Chain > chains = new HashSet < Chain > ( ) ; Set < Group > caGroups = new HashSet < Group > ( ) ; // Create list of all chains in this structure
Structure s = null ; if ( ca . length > 0 ) { Group g = ca [ 0 ] . getGroup ( ) ; if ( g != null ) { Chain c = g . getChain ( ) ; if ( c != null ) { s = c . getStructure... |
public class ShardingEncryptorStrategy { /** * Is has sharding query assisted encryptor or not .
* @ param logicTableName logic table name
* @ return has sharding query assisted encryptor or not */
public boolean isHasShardingQueryAssistedEncryptor ( final String logicTableName ) { } } | return shardingEncryptor instanceof ShardingQueryAssistedEncryptor && ! Collections2 . filter ( assistedQueryColumns , new Predicate < ColumnNode > ( ) { @ Override public boolean apply ( final ColumnNode input ) { return input . getTableName ( ) . equals ( logicTableName ) ; } } ) . isEmpty ( ) ; |
public class JCufft { /** * Convenience method for { @ link JCufft # cufftExecZ2D ( cufftHandle , Pointer , Pointer ) } .
* Accepts arrays for input and output data and automatically performs the host - device
* and device - host copies .
* @ see jcuda . jcufft . JCufft # cufftExecZ2D ( cufftHandle , Pointer , Po... | int cudaResult = 0 ; boolean inPlace = ( cIdata == rOdata ) ; // Allocate space for the input data on the device
Pointer hostCIdata = Pointer . to ( cIdata ) ; Pointer deviceCIdata = new Pointer ( ) ; cudaResult = JCuda . cudaMalloc ( deviceCIdata , cIdata . length * Sizeof . DOUBLE ) ; if ( cudaResult != cudaError . c... |
public class DocumentReferenceTranslator { /** * Default implementation ignores providers . Override to try registry lookup . */
public Document toDomDocument ( Object obj , boolean tryProviders ) throws TranslationException { } } | if ( this instanceof XmlDocumentTranslator ) return ( ( XmlDocumentTranslator ) this ) . toDomDocument ( obj ) ; else throw new UnsupportedOperationException ( "Translator: " + this . getClass ( ) . getName ( ) + " does not implement" + XmlDocumentTranslator . class . getName ( ) ) ; |
public class StAXUtils { /** * Go to the end of the current element . This include skipping any children element .
* @ param xmlReader the XML stream reader
* @ return the type of the new current event
* @ throws XMLStreamException if there is an error processing the underlying XML source
* @ since 5.3M1 */
pub... | if ( ! xmlReader . isStartElement ( ) ) { throw new XMLStreamException ( "Current node is not start element" ) ; } if ( ! xmlReader . isEndElement ( ) ) { for ( xmlReader . next ( ) ; ! xmlReader . isEndElement ( ) ; xmlReader . next ( ) ) { if ( xmlReader . isStartElement ( ) ) { skipElement ( xmlReader ) ; } } } retu... |
public class Type { /** * Check if a type is convertable including support for varargs . If varargs
* is true , then this will add 40 to the total cost such that non - varargs
* will always take precedence .
* @ see # convertableFrom ( Type ) */
public int convertableFrom ( Type other , boolean vararg ) { } } | int cost = convertableFrom ( other ) ; if ( cost < 0 ) { return cost ; } return ( vararg ? cost + 40 : cost ) ; |
public class FctBnCnvBnFromRs { /** * < p > Get bean in lazy mode ( if bean is null then initialize it ) . < / p >
* @ param pAddParam additional param
* @ param pBeanName - bean name
* @ return requested bean
* @ throws Exception - an exception */
@ Override public final IConverterByName < IRecordSet < RS > , ... | IConverterByName < IRecordSet < RS > , ? > convrt = this . convertersMap . get ( pBeanName ) ; if ( convrt == null ) { // locking :
synchronized ( this . convertersMap ) { // make sure again whether it ' s null after locking :
convrt = this . convertersMap . get ( pBeanName ) ; if ( convrt == null ) { if ( pBeanName . ... |
public class JettyStarter { /** * Set the common resource base ( directory ) from which all web application
* resources will be loaded ( servlet context root ) .
* @ param aResourceBase
* The resource . May neither be < code > null < / code > nor empty .
* @ return this for chaining */
@ Nonnull public final Je... | ValueEnforcer . notNull ( aResourceBase , "ResourceBase" ) ; m_aResourceBase = aResourceBase ; return this ; |
public class Repository { /** * http : / / en . wikipedia . org / wiki / Byte _ Order _ Mark */
private static String stripBom ( String str ) { } } | if ( ! str . isEmpty ( ) && str . charAt ( 0 ) == 65279 ) { return str . substring ( 1 ) ; } else { return str ; } |
public class ScanStream { /** * Sequentially iterate over entries in a hash identified by { @ code key } . This method uses { @ code HSCAN } to perform an
* iterative scan .
* @ param commands the commands interface , must not be { @ literal null } .
* @ param key the hash to scan .
* @ param scanArgs the scan ... | LettuceAssert . notNull ( scanArgs , "ScanArgs must not be null" ) ; return hscan ( commands , key , Optional . of ( scanArgs ) ) ; |
public class StringBlock { /** * Returns raw string ( without any styling information ) at specified index .
* Returns null if index is invalid or object was not initialized . */
public String getRaw ( int index ) { } } | if ( m_strings == null || index < 0 || index > m_strings . length - 1 ) { return null ; } return m_strings [ index ] ; |
public class EnvironmentLogger { /** * Returns the finest assigned level for any classloader environment . */
private Level getFinestLevel ( ) { } } | Level level ; if ( _parent == null ) level = Level . INFO ; else if ( _parent . isLocalLevel ( ) ) level = selectFinestLevel ( _systemLevel , _parent . getFinestLevel ( ) ) ; else if ( _systemLevel != null ) level = _systemLevel ; else level = _parent . getFinestLevel ( ) ; if ( _localLevel == null ) return level ; for... |
public class MultiPathImpl { /** * Reviewed vs . Native Jan 11 , 2011 */
public void startPath ( Point point ) { } } | if ( point . isEmpty ( ) ) throw new IllegalArgumentException ( ) ; // throw new
// IllegalArgumentException ( ) ;
mergeVertexDescription ( point . getDescription ( ) ) ; _initPathStartPoint ( ) ; point . copyTo ( m_moveToPoint ) ; // TODO check MultiPathImpl . cpp comment
// " / / the description will be merged later ... |
public class UnicodeSetStringSpan { /** * Spans a string .
* @ param s The string to be spanned
* @ param start The start index that the span begins
* @ param spanCondition The span condition
* @ return the limit ( exclusive end ) of the span */
public int span ( CharSequence s , int start , SpanCondition spanC... | if ( spanCondition == SpanCondition . NOT_CONTAINED ) { return spanNot ( s , start , null ) ; } int spanLimit = spanSet . span ( s , start , SpanCondition . CONTAINED ) ; if ( spanLimit == s . length ( ) ) { return spanLimit ; } return spanWithStrings ( s , start , spanLimit , spanCondition ) ; |
public class EclipseProductLocationProvider { /** * Returns a list of paths of Eclipse installations .
* The search process works by scanning for each ' source dir ' for either an eclipse installation or a folder containing the text returned
* by getDirName ( ) . If such a folder is found , this process is applied ... | List < String > driveLetters = asList ( "C" ) ; try { driveLetters = OsUtils . getDrivesOnWindows ( ) ; } catch ( Throwable ignore ) { ignore . printStackTrace ( ) ; } List < String > sourceDirs = new ArrayList < String > ( ) ; for ( String letter : driveLetters ) { for ( String possibleSource : descriptor . getSourceD... |
public class KeyVaultClientBaseImpl { /** * List secrets in a specified key vault .
* The Get Secrets operation is applicable to the entire vault . However , only the base secret identifier and its attributes are provided in the response . Individual secret versions are not listed in the response . This operation req... | return getSecretsSinglePageAsync ( vaultBaseUrl , maxresults ) . concatMap ( new Func1 < ServiceResponse < Page < SecretItem > > , Observable < ServiceResponse < Page < SecretItem > > > > ( ) { @ Override public Observable < ServiceResponse < Page < SecretItem > > > call ( ServiceResponse < Page < SecretItem > > page )... |
public class ThrowsTaglet { /** * { @ inheritDoc } */
public void inherit ( DocFinder . Input input , DocFinder . Output output ) { } } | ClassDoc exception ; if ( input . tagId == null ) { ThrowsTag throwsTag = ( ThrowsTag ) input . tag ; exception = throwsTag . exception ( ) ; input . tagId = exception == null ? throwsTag . exceptionName ( ) : throwsTag . exception ( ) . qualifiedName ( ) ; } else { exception = input . element . containingClass ( ) . f... |
public class TransactionOLTP { /** * Executes a method which has the potential to throw a TemporaryLockingException or a PermanentLockingException .
* If the exception is thrown it is wrapped in a GraknServerException so that the transaction can be retried .
* @ param method The locking method to execute */
private... | try { return method . get ( ) ; } catch ( JanusGraphException e ) { if ( e . isCausedBy ( TemporaryLockingException . class ) || e . isCausedBy ( PermanentLockingException . class ) ) { throw TemporaryWriteException . temporaryLock ( e ) ; } else { throw GraknServerException . unknown ( e ) ; } } |
public class Page { /** * Write the entire page by calling : < br >
* writeHtmlHead ( out ) < br >
* writeBodyTag ( out ) < br >
* writeElements ( out ) < br >
* writeHtmlEnd ( out ) */
public void write ( Writer out ) throws IOException { } } | writeHtmlHead ( out ) ; writeBodyTag ( out ) ; writeElements ( out ) ; writeHtmlEnd ( out ) ; |
public class FastTrackReader { /** * Extract the outline level from a task ' s WBS attribute .
* @ param task Task instance
* @ return outline level */
private Integer getOutlineLevel ( Task task ) { } } | String value = task . getWBS ( ) ; Integer result = Integer . valueOf ( 1 ) ; if ( value != null && value . length ( ) > 0 ) { String [ ] path = WBS_SPLIT_REGEX . split ( value ) ; result = Integer . valueOf ( path . length ) ; } return result ; |
public class OutboundConnectionTracker { /** * Closes a conversation for the specified connection . It is unnecessary to
* require a reference to the conversation being closed as by the time this method
* is invoked , the conversation has been marked " closed " and all that remains is the
* book keeping . This me... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "closeConversation" , connectionHostingConversation ) ; // To avoid deadlock - keep a list of pending closes and only allow one thread
// to process this list .
boolean closeOnThisThread = false ; synchronized ( close... |
public class IFixUtils { /** * This method will find which iFixes have been installed and return a list with all of the IDs of APARs that have been fixed by the iFixes .
* @ param wlpInstallationDirectory The installation directory of the current install
* @ param console The console for printing messages to
* @ ... | Set < LibertyProfileMetadataFile > lpmfInfos = new HashSet < LibertyProfileMetadataFile > ( ) ; // First create a parser for reading the Liberty Profile Metadata XML
try { docBuilder = DocumentBuilderFactory . newInstance ( ) . newDocumentBuilder ( ) ; } catch ( Exception e ) { // If we can ' t create an unmarshaller t... |
public class ReflectionUtils { /** * Make the given constructor accessible , explicitly setting it accessible
* if necessary . The { @ code setAccessible ( true ) } method is only called
* when actually necessary , to avoid unnecessary conflicts with a JVM
* SecurityManager ( if active ) .
* @ param ctor the co... | if ( ( ! Modifier . isPublic ( ctor . getModifiers ( ) ) || ! Modifier . isPublic ( ctor . getDeclaringClass ( ) . getModifiers ( ) ) ) && ! ctor . isAccessible ( ) ) { ctor . setAccessible ( true ) ; } |
public class FrameworkUtils { public static ExtensionMeta mkExtensionMeta ( String name , Object ... params ) { } } | List < ? > paramList = Arrays . asList ( params ) ; String paramStr = paramList . isEmpty ( ) ? "" : paramList . stream ( ) . map ( t -> t == null ? "" : t . toString ( ) ) . reduce ( ( l , r ) -> l + ", " + r ) . get ( ) ; String desc = name + "(" + paramStr + ")" ; return new ExtensionMeta ( name , desc , paramList )... |
public class AbstractProcessorChain { /** * < p > Directs processing along the chain by executing the root { @ link ProcessorChainLink } and delegating
* all successors to { @ link # onTraverse ( Object , ProcessorChainLink , Object . . . ) } and the terminal link to
* { @ link # onTerminate ( Object , Object . . .... | try { ProcessorChainLink < LINK_RESULT , LINK_FAILURE > current = root ; LINK_RESULT result = onInitiate ( current , args ) ; while ( ! current . isTerminalLink ( ) ) { current = current . getSuccessor ( ) ; result = onTraverse ( result , current , args ) ; } onTerminate ( result , args ) ; return result ; } catch ( Ex... |
public class FileUtils { /** * This method is able to determine whether a file is GZipped and return an { @ link InputStream } in any case .
* @ param path the path to the file to open
* @ param options options specifying how the file is opened
* @ return a new input stream
* @ throws IOException if an I / O er... | FileUtils . checkFile ( path ) ; InputStream inputStream = Files . newInputStream ( path , options ) ; if ( path . toFile ( ) . getName ( ) . endsWith ( ".gz" ) ) { inputStream = new GZIPInputStream ( inputStream ) ; } return inputStream ; |
public class RepositoryResourceImpl { /** * Checks if the two resources are equivalent by checking if the assets
* are equivalent .
* @ param obj
* @ return */
public boolean equivalent ( Object obj ) { } } | if ( this == obj ) return true ; if ( obj == null ) return false ; if ( getClass ( ) != obj . getClass ( ) ) return false ; RepositoryResourceImpl other = ( RepositoryResourceImpl ) obj ; if ( _asset == null ) { if ( other . _asset != null ) return false ; } else if ( ! _asset . equivalent ( other . _asset ) ) return f... |
public class JvmTypeConstraintImplCustom { /** * Constraint bounds are definitely invalid if they are < code > not null < / code > and point to a primitive type .
* { @ link JvmSpecializedTypeReference } will not be resolved by this check thus they may lead to finally
* invalid constraint bounds .
* @ param const... | if ( constraintBound == null ) return true ; if ( constraintBound instanceof JvmSpecializedTypeReference ) { JvmTypeReference equivalent = ( JvmTypeReference ) constraintBound . eGet ( TypesPackage . Literals . JVM_SPECIALIZED_TYPE_REFERENCE__EQUIVALENT , false ) ; if ( equivalent != null ) { return isLikelyAValidConst... |
public class OAuth20Utils { /** * Is authorized grant type for service ?
* @ param grantType the grant type
* @ param registeredService the registered service
* @ return true / false */
public static boolean isAuthorizedGrantTypeForService ( final String grantType , final OAuthRegisteredService registeredService ... | if ( registeredService . getSupportedGrantTypes ( ) != null && ! registeredService . getSupportedGrantTypes ( ) . isEmpty ( ) ) { LOGGER . debug ( "Checking grant type [{}] against supported grant types [{}]" , grantType , registeredService . getSupportedGrantTypes ( ) ) ; return registeredService . getSupportedGrantTy... |
public class SaneOption { /** * Set the value of the current option to the supplied value . Option value must be of integer type
* TODO : consider caching the returned value for " fast read " later
* @ param newValue for the option
* @ return the value actually set
* @ throws IOException */
public int setIntege... | Preconditions . checkState ( getValueCount ( ) == 1 , "option is an array" ) ; // check that this option is readable
Preconditions . checkState ( isWriteable ( ) ) ; // Send RPC corresponding to :
// SANE _ Status sane _ control _ option ( SANE _ Handle h , SANE _ Int n ,
// SANE _ Action a , void * v ,
// SANE _ Int *... |
public class LTCCallbacks { /** * Register a < code > UOWCallback < / code > for LTC notifications .
* @ param callback The UOWCallback object to register with the LocalTransaction service */
public void registerCallback ( UOWCallback callback ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "registerCallback" , callback ) ; if ( ! _callbacks . contains ( callback ) ) { _callbacks . add ( callback ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Number of registered ... |
public class HttpExtKit { /** * Send Hex String request */
public static String postHexString ( String url , Map < String , String > queryParas , byte [ ] data , Map < String , String > headers ) { } } | return HttpKit . post ( url , queryParas , HexKit . byteToHexString ( data ) , headers ) ; |
public class CPDefinitionLinkPersistenceImpl { /** * Returns the first cp definition link in the ordered set where CPDefinitionId = & # 63 ; and type = & # 63 ; .
* @ param CPDefinitionId the cp definition ID
* @ param type the type
* @ param orderByComparator the comparator to order the set by ( optionally < cod... | List < CPDefinitionLink > list = findByCPD_T ( CPDefinitionId , type , 0 , 1 , orderByComparator ) ; if ( ! list . isEmpty ( ) ) { return list . get ( 0 ) ; } return null ; |
public class TangoEventsAdapter { public void addTangoPeriodicListener ( ITangoPeriodicListener listener , String attrName , String [ ] filters , boolean stateless ) throws DevFailed { } } | TangoPeriodic tangoPeriodic ; String key = deviceName + "/" + attrName ; if ( ( tangoPeriodic = tango_periodic_source . get ( key ) ) == null ) { tangoPeriodic = new TangoPeriodic ( deviceProxy , attrName , filters ) ; tango_periodic_source . put ( key , tangoPeriodic ) ; } synchronized ( moni ) { tangoPeriodic . addTa... |
public class TarInputStream { /** * Skip bytes in the input buffer . This skips bytes in the current entry ' s data , not the entire archive , and will
* stop at the end of the current entry ' s data if the number to skip extends beyond that point .
* @ param numToSkip
* The number of bytes to skip .
* @ return... | // REVIEW
// This is horribly inefficient , but it ensures that we
// properly skip over bytes via the TarBuffer . . .
byte [ ] skipBuf = new byte [ 8 * 1024 ] ; long num = numToSkip ; for ( ; num > 0 ; ) { int numRead = this . read ( skipBuf , 0 , ( num > skipBuf . length ? skipBuf . length : ( int ) num ) ) ; if ( nu... |
public class ConfigClassAnalyzer { /** * Strips all decorations from the decorated object .
* @ param decorated the decorated object
* @ return the stripped object */
public static Object stripDeep ( Object decorated ) { } } | Object stripped = stripShallow ( decorated ) ; if ( stripped == decorated ) { return stripped ; } else { return stripDeep ( stripped ) ; } |
public class AWSStorageGatewayClient { /** * Returns an array of Challenge - Handshake Authentication Protocol ( CHAP ) credentials information for a specified
* iSCSI target , one for each target - initiator pair .
* @ param describeChapCredentialsRequest
* A JSON object containing the Amazon Resource Name ( ARN... | request = beforeClientExecution ( request ) ; return executeDescribeChapCredentials ( request ) ; |
public class AccountACL { /** * Set if a player can withdraw money in the account
* @ param name The Player name
* @ param withdraw Can withdraw or not */
public void setWithdraw ( String name , boolean withdraw ) { } } | String newName = name . toLowerCase ( ) ; if ( aclList . containsKey ( name ) ) { AccountACLValue value = aclList . get ( newName ) ; set ( newName , value . canDeposit ( ) , withdraw , value . canAcl ( ) , value . canBalance ( ) , value . isOwner ( ) ) ; } else { set ( newName , false , withdraw , false , false , fals... |
public class DirectoryLookupService { /** * Remove the NotificationHandler from the Service .
* @ param serviceName
* the service name .
* @ param handler
* the NotificationHandler for the service . */
public void removeNotificationHandler ( String serviceName , NotificationHandler handler ) { } } | if ( handler == null || serviceName == null || serviceName . isEmpty ( ) ) { throw new IllegalArgumentException ( ) ; } synchronized ( notificationHandlers ) { if ( notificationHandlers . containsKey ( serviceName ) ) { List < NotificationHandler > list = notificationHandlers . get ( serviceName ) ; if ( list . contain... |
public class DataSet { /** * Writes a DataSet as text file ( s ) to the specified location .
* < p > For each element of the DataSet the result of { @ link Object # toString ( ) } is written . < br / >
* < br / >
* < span class = " strong " > Output files and directories < / span > < br / >
* What output how wr... | return output ( new TextOutputFormat < T > ( new Path ( filePath ) ) ) ; |
public class Widgets { /** * Creates a label that triggers an action using the supplied text and handler . The label will
* be styled as specified with an additional style that configures the mouse pointer and adds
* underline to the text . */
public static Label newActionLabel ( String text , String style , ClickH... | return makeActionLabel ( newLabel ( text , style ) , onClick ) ; |
public class ScriptUtils { /** * Recursively sets all files and directories executable , starting from a file or base directory .
* @ param f a file to set executable or a base directory */
public static void setScriptsExecutable ( File fileOrDir ) { } } | List < File > files = new ArrayList < > ( ) ; if ( fileOrDir . isDirectory ( ) ) files . addAll ( Utils . listAllFiles ( fileOrDir , true ) ) ; else files . add ( fileOrDir ) ; for ( File f : files ) f . setExecutable ( true ) ; |
public class FlowIdProtocolHeaderCodec { /** * Write flow id .
* @ param message the message
* @ param flowId the flow id */
public static void writeFlowId ( Message message , String flowId ) { } } | Map < String , List < String > > headers = getOrCreateProtocolHeader ( message ) ; headers . put ( FLOWID_HTTP_HEADER_NAME , Collections . singletonList ( flowId ) ) ; if ( LOG . isLoggable ( Level . FINE ) ) { LOG . fine ( "HTTP header '" + FLOWID_HTTP_HEADER_NAME + "' set to: " + flowId ) ; } |
public class DefaultCouchbaseDataHandler { /** * Iterate and populate json object .
* @ param entity
* the entity
* @ param iterator
* the iterator
* @ return the json object */
private JsonObject iterateAndPopulateJsonObject ( Object entity , Iterator < Attribute > iterator , String tableName ) { } } | JsonObject obj = JsonObject . create ( ) ; while ( iterator . hasNext ( ) ) { Attribute attribute = iterator . next ( ) ; Field field = ( Field ) attribute . getJavaMember ( ) ; Object value = PropertyAccessorHelper . getObject ( entity , field ) ; obj . put ( ( ( AbstractAttribute ) attribute ) . getJPAColumnName ( ) ... |
public class SearchForm { /** * advance */
@ Override public int getStartPosition ( ) { } } | final FessConfig fessConfig = ComponentUtil . getFessConfig ( ) ; if ( start == null ) { start = fessConfig . getPagingSearchPageStartAsInteger ( ) ; } return start ; |
public class UserProfileHandlerImpl { /** * Create new profile node . */
private Node getProfileNode ( Node userNode ) throws RepositoryException { } } | try { return userNode . getNode ( JCROrganizationServiceImpl . JOS_PROFILE ) ; } catch ( PathNotFoundException e ) { return userNode . addNode ( JCROrganizationServiceImpl . JOS_PROFILE ) ; } |
public class AbstractBackendHelper { /** * Call this in { @ link org . microg . nlp . api . LocationBackendService # onClose ( ) } . */
public synchronized void onClose ( ) { } } | if ( state == State . DISABLED || state == State . DISABLING ) throw new IllegalStateException ( "Do not call onClose if not opened before" ) ; if ( state == State . WAITING ) { state = State . DISABLED ; } else { state = State . DISABLING ; } |
public class Media { /** * Downloads existing media file from server .
* @ param mediaName name of media
* @ param file file for putting content . Will be overridden .
* @ throws IOException unexpected error . */
public void download ( final String mediaName , final File file ) throws IOException { } } | final String uri = client . getUserResourceInstanceUri ( BandwidthConstants . MEDIA_URI_PATH , mediaName ) ; client . download ( uri , file ) ; |
public class ErrorPageFilter { /** * Called to render the error page , if possible .
* @ param sc the status code of the error .
* @ param message the message for the error .
* @ param request the request that caused the error .
* @ param response the response that the error will be written to .
* @ throws IO... | if ( 400 <= sc && sc < 600 && ! response . isCommitted ( ) ) { String [ ] fileNames = new String [ ] { "/" + Integer . toString ( sc ) + ".html" , "/" + Integer . toString ( sc ) . subSequence ( 0 , 2 ) + "x.html" , "/" + Integer . toString ( sc ) . subSequence ( 0 , 1 ) + "xx.html" } ; InputStream errorPageIn = null ;... |
public class MethodUtils { /** * < p > Retrieves a method whether or not it ' s accessible . If no such method
* can be found , return { @ code null } . < / p >
* @ param cls The class that will be subjected to the method search
* @ param methodName The method that we wish to call
* @ param parameterTypes Argum... | Validate . notNull ( cls , "Null class not allowed." ) ; Validate . notEmpty ( methodName , "Null or blank methodName not allowed." ) ; // Address methods in superclasses
Method [ ] methodArray = cls . getDeclaredMethods ( ) ; final List < Class < ? > > superclassList = ClassUtils . getAllSuperclasses ( cls ) ; for ( f... |
public class BigtableDataGrpcClient { /** * { @ inheritDoc } */
@ Override public ListenableFuture < List < FlatRow > > readFlatRowsAsync ( ReadRowsRequest request ) { } } | if ( shouldOverrideAppProfile ( request . getAppProfileId ( ) ) ) { request = request . toBuilder ( ) . setAppProfileId ( clientDefaultAppProfileId ) . build ( ) ; } return Futures . transform ( createStreamingListener ( request , readRowsAsync , request . getTableName ( ) ) . getAsyncResult ( ) , FLAT_ROW_LIST_TRANSFO... |
public class Tile { /** * Defines if the switch in the SwitchTileSkin is active
* @ param SELECTED */
public void setActive ( final boolean SELECTED ) { } } | if ( null == active ) { _active = SELECTED ; fireTileEvent ( REDRAW_EVENT ) ; } else { active . set ( SELECTED ) ; } |
public class SnapshotUtil { /** * Generates a Filename to the snapshot file for the given table .
* @ param table
* @ param fileNonce
* @ param hostId */
public static final String constructFilenameForTable ( Table table , String fileNonce , SnapshotFormat format , int hostId ) { } } | String extension = ".vpt" ; if ( format == SnapshotFormat . CSV ) { extension = ".csv" ; } StringBuilder filename_builder = new StringBuilder ( fileNonce ) ; filename_builder . append ( "-" ) ; filename_builder . append ( table . getTypeName ( ) ) ; if ( ! table . getIsreplicated ( ) ) { filename_builder . append ( "-h... |
public class NettyHelper { /** * 得到服务端Boss线程池
* @ param config 服务端配置
* @ return 服务端Boss线程池 */
public static EventLoopGroup getServerBossEventLoopGroup ( ServerTransportConfig config ) { } } | String type = config . getProtocolType ( ) ; EventLoopGroup bossGroup = serverBossGroups . get ( type ) ; if ( bossGroup == null ) { synchronized ( NettyHelper . class ) { bossGroup = serverBossGroups . get ( config . getProtocolType ( ) ) ; if ( bossGroup == null ) { int bossThreads = config . getBossThreads ( ) ; bos... |
public class CamelRouteActionBuilder { /** * Remove these Camel routes . */
public void remove ( String ... routes ) { } } | RemoveCamelRouteAction camelRouteAction = new RemoveCamelRouteAction ( ) ; camelRouteAction . setRouteIds ( Arrays . asList ( routes ) ) ; camelRouteAction . setCamelContext ( getCamelContext ( ) ) ; action . setDelegate ( camelRouteAction ) ; |
public class Matchers { /** * Matches an AST node that is enclosed by some node that matches the given matcher .
* < p > TODO ( eaftan ) : This could be used instead of enclosingBlock and enclosingClass . */
public static < T extends Tree > Matcher < Tree > enclosingNode ( final Matcher < T > matcher ) { } } | return new Matcher < Tree > ( ) { @ SuppressWarnings ( "unchecked" ) // TODO ( cushon ) : this should take a Class < T >
@ Override public boolean matches ( Tree t , VisitorState state ) { TreePath path = state . getPath ( ) . getParentPath ( ) ; while ( path != null ) { Tree node = path . getLeaf ( ) ; state = state .... |
public class AbstractSchemaScannerPlugin { /** * Create the table descriptors .
* @ param catalog The catalog .
* @ param schema The schema .
* @ param schemaDescriptor The schema descriptor .
* @ param columnTypes The cached data types .
* @ param allColumns The map to collect all columns .
* @ param allFo... | for ( Table table : catalog . getTables ( schema ) ) { TableDescriptor tableDescriptor = getTableDescriptor ( table , schemaDescriptor , store ) ; Map < String , ColumnDescriptor > localColumns = new HashMap < > ( ) ; for ( Column column : table . getColumns ( ) ) { ColumnDescriptor columnDescriptor = createColumnDescr... |
public class Synthetic { /** * Returns a sequence of events where some items are more popular than others , according to a
* zipfian distribution . Unlike { @ link # zipfian } , the generated sequence scatters the " popular "
* items across the item space . Use if you don ' t want the head of the distribution ( the... | return generate ( new ScrambledZipfianGenerator ( 0 , items - 1 , constant ) , events ) ; |
public class PartitionReplicaSyncRequest { /** * Send responses for first number of { @ code permits } namespaces and remove them from the list . */
private void sendOperationsForNamespaces ( int permits ) { } } | InternalPartitionServiceImpl partitionService = getService ( ) ; try { PartitionReplicationEvent event = new PartitionReplicationEvent ( getPartitionId ( ) , getReplicaIndex ( ) ) ; Iterator < ServiceNamespace > iterator = namespaces . iterator ( ) ; for ( int i = 0 ; i < permits ; i ++ ) { ServiceNamespace namespace =... |
public class PublishedCustomer { /** * region > removeOrder ( action , not published ) */
@ Action ( semantics = SemanticsOf . IDEMPOTENT ) public PublishedCustomer removeOrder ( final Order order ) { } } | getOrders ( ) . remove ( order ) ; repositoryService . remove ( order ) ; return this ; |
public class MoreCollectors { /** * Returns a { @ code Collector } which finds all the elements which are equal
* to each other and smaller than any other element according to the natural
* order . The found elements are reduced using the specified downstream
* { @ code Collector } .
* @ param < T > the type of... | return maxAll ( Comparator . < T > reverseOrder ( ) , downstream ) ; |
public class DevicesApi { /** * Delete Device
* Deletes a device
* @ param deviceId deviceId ( required )
* @ return ApiResponse & lt ; DeviceEnvelope & gt ;
* @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */
public ApiResponse < DeviceEnvelope > de... | com . squareup . okhttp . Call call = deleteDeviceValidateBeforeCall ( deviceId , null , null ) ; Type localVarReturnType = new TypeToken < DeviceEnvelope > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ; |
public class RowMapperWide { /** * Returns the Lucene { @ link Sort } to get { @ link Document } s in the same order that is used in Cassandra .
* @ return The Lucene { @ link Sort } to get { @ link Document } s in the same order that is used in Cassandra . */
public Sort sort ( ) { } } | SortField [ ] partitionKeySort = tokenMapper . sortFields ( ) ; SortField [ ] clusteringKeySort = clusteringKeyMapper . sortFields ( ) ; return new Sort ( ArrayUtils . addAll ( partitionKeySort , clusteringKeySort ) ) ; |
public class SegmentWithState { /** * Change the segment state to { @ link SegmentState # PUSHED _ AND _ DROPPED } . The current state should be
* { @ link SegmentState # APPENDING } . This method should be called after the segment of { @ link # segmentIdentifier } is
* completely pushed and dropped .
* @ param d... | checkStateTransition ( this . state , SegmentState . APPENDING , SegmentState . PUSHED_AND_DROPPED ) ; this . state = SegmentState . PUSHED_AND_DROPPED ; this . dataSegment = dataSegment ; |
public class BPSImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setPsegName ( String newPsegName ) { } } | String oldPsegName = psegName ; psegName = newPsegName ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . BPS__PSEG_NAME , oldPsegName , psegName ) ) ; |
public class Messenger { /** * Share Group History
* @ param gid group ' s id
* @ return Promise of void */
@ NotNull @ ObjectiveCName ( "shareHistoryWithGid:" ) public Promise < Void > shareHistory ( int gid ) { } } | return modules . getGroupsModule ( ) . shareHistory ( gid ) ; |
public class Links { /** * Creates a { @ link Links } instance from the given RFC5988 - compatible link format .
* @ param source a comma separated list of { @ link Link } representations .
* @ return the { @ link Links } represented by the given { @ link String } . */
public static Links parse ( @ Nullable String ... | if ( ! StringUtils . hasText ( source ) ) { return NONE ; } Matcher matcher = LINK_HEADER_PATTERN . matcher ( source ) ; List < Link > links = new ArrayList < > ( ) ; while ( matcher . find ( ) ) { Link link = Link . valueOf ( matcher . group ( ) ) ; if ( link != null ) { links . add ( link ) ; } } return new Links ( l... |
public class UnderFileSystemBlockStore { /** * Closes the block reader or writer and checks whether it is necessary to commit the block
* to Local block store .
* During UFS block read , this is triggered when the block is unlocked .
* During UFS block write , this is triggered when the UFS block is committed .
... | BlockInfo blockInfo ; try ( LockResource lr = new LockResource ( mLock ) ) { blockInfo = mBlocks . get ( new Key ( sessionId , blockId ) ) ; if ( blockInfo == null ) { LOG . warn ( "Key (block ID: {}, session ID {}) is not found when cleaning up the UFS block." , blockId , sessionId ) ; return ; } } blockInfo . closeRe... |
public class NonBlockingHashMap { /** * Returns a { @ link Set } view of the keys contained in this map . The set
* is backed by the map , so changes to the map are reflected in the set ,
* and vice - versa . The set supports element removal , which removes the
* corresponding mapping from this map , via the < tt... | return new AbstractSet < TypeK > ( ) { @ Override public void clear ( ) { NonBlockingHashMap . this . clear ( ) ; } @ Override public int size ( ) { return NonBlockingHashMap . this . size ( ) ; } @ Override public boolean contains ( Object k ) { return NonBlockingHashMap . this . containsKey ( k ) ; } @ Override publi... |
public class ServiceFactory { /** * Example USage :
* < code >
* StructureFinder [ ] finders = new StructureFinder [ sources . length ] ;
* ServiceFactory . getInstance ( ) . createForNames ( sources , finders ) ;
* < / code >
* @ param names the object / service names
* @ param objectOutput array to place ... | if ( objectOutput == null || objectOutput . length == 0 ) throw new IllegalArgumentException ( "Non empty objectOutput" ) ; if ( names == null || names . length == 0 ) { return ; } String name = null ; Object obj = null ; try { for ( int i = 0 ; i < names . length ; i ++ ) { name = names [ i ] ; obj = this . create ( n... |
public class WebAppFilterManager { /** * Compares the request uri to the passed in filter uri to see if the filter
* associated with the filter uri should filter the request uri
* @ param requestURI
* the request uri
* @ param filterURI
* the uri associated with the filter
* @ return boolean indicating whet... | boolean theyMatch = false ; // determine what type of filter uri we have
switch ( fmInfo . getMappingType ( ) ) { case FMI_MAPPING_SINGLE_SLASH : // default servlet mapping . . . if requestURI is " / " , they match
if ( requestURI . equals ( "/" ) ) // 144908
theyMatch = true ; break ; case FMI_MAPPING_PATH_MATCH : // ... |
public class SystemInterpreter { /** * ExqlInterpreter */
public static void main0 ( String [ ] args ) throws Exception { } } | // 转换语句中的表达式
String sql = "insert ignore into table_name " + "(`id`,`uid`,`favable_id`,`addtime`,`ranking`) " + "values (:1,:2,now(),0)" ; ExqlPattern pattern = ExqlPatternImpl . compile ( sql ) ; ExqlContextImpl context = new ExqlContextImpl ( ) ; Map < String , Object > parametersAsMap = new HashMap < String , Object... |
public class MultiUserChat { /** * Get a new MUC enter configuration builder .
* @ param nickname the nickname used when entering the MUC room .
* @ return a new MUC enter configuration builder .
* @ since 4.2 */
public MucEnterConfiguration . Builder getEnterConfigurationBuilder ( Resourcepart nickname ) { } } | return new MucEnterConfiguration . Builder ( nickname , connection . getReplyTimeout ( ) ) ; |
public class ConnectionDAODefaultImpl { public void init ( final Connection connection ) throws DevFailed { } } | // Check Tango Host Properties ( host name , port number )
connection . url = new TangoUrl ( ) ; connection . setDevice_is_dbase ( true ) ; connection . transparent_reconnection = true ; // Always true for Database
// connection . url . trace ( ) ;
ApiUtil . get_orb ( ) ; connect_to_dbase ( connection ) ; connection . ... |
public class AbstractSphere3F { /** * Replies if the specified box intersects the specified sphere .
* @ param sphereCenterx x coordinate of the sphere center .
* @ param sphereCentery y coordinate of the sphere center .
* @ param sphereCenterz z coordinate of the sphere center .
* @ param sphereRadius is the r... | // Find points on OBB closest and farest to sphere center
Point3f closest = new Point3f ( ) ; Point3f farest = new Point3f ( ) ; AbstractOrientedBox3F . computeClosestFarestOBBPoints ( sphereCenterx , sphereCentery , sphereCenterz , boxCenterx , boxCentery , boxCenterz , boxAxis1x , boxAxis1y , boxAxis1z , boxAxis2x , ... |
public class Agg { /** * Get a { @ link Collector } that calculates the < code > BIT _ OR ( ) < / code > for any
* type of { @ link Number } . */
public static < T , U > Collector < T , ? , Integer > bitOrInt ( ToIntFunction < ? super T > function ) { } } | return Collector . of ( ( ) -> new int [ 1 ] , ( s , v ) -> { s [ 0 ] = s [ 0 ] | function . applyAsInt ( v ) ; } , ( s1 , s2 ) -> { s1 [ 0 ] = s1 [ 0 ] | s2 [ 0 ] ; return s1 ; } , s -> s [ 0 ] ) ; |
public class CrsUtilities { /** * Reads a { @ link CoordinateReferenceSystem } from a prj file .
* @ param filePath the path to the prj file or the connected datafile it sidecar file for .
* @ param extension the extension of the data file . If < code > null < / code > it is assumed to be prj .
* @ return the rea... | CoordinateReferenceSystem crs = null ; String prjPath = null ; String filePathLower = filePath . trim ( ) . toLowerCase ( ) ; if ( filePathLower . endsWith ( ".prj" ) ) { // it is the prj file
prjPath = filePath ; } else if ( extension != null && filePathLower . endsWith ( "." + extension ) ) { // datafile was supplied... |
public class GetGroupsResult { /** * The collection of all active groups .
* @ param groups
* The collection of all active groups . */
public void setGroups ( java . util . Collection < GroupSummary > groups ) { } } | if ( groups == null ) { this . groups = null ; return ; } this . groups = new java . util . ArrayList < GroupSummary > ( groups ) ; |
public class CmsContentEditor { /** * Opens the copy locale dialog . < p > */
void openCopyLocaleDialog ( ) { } } | CmsCopyLocaleDialog dialog = new CmsCopyLocaleDialog ( m_availableLocales , m_contentLocales , m_locale , m_definitions . get ( m_locale ) . hasSynchronizedElements ( ) , this ) ; dialog . center ( ) ; |
public class SftpUtil { /** * Deletes a directory with all its files and sub - directories . The reason it
* do a " chmod 700 " before the delete is that some tests changes the
* permission , and thus we have to restore the right to delete it . . .
* @ param muleClient
* @ param endpointName
* @ param relativ... | EndpointURI endpointURI = getImmutableEndpoint ( muleContext , endpointName ) . getEndpointURI ( ) ; String path = endpointURI . getPath ( ) + relativePath ; try { // Ensure that we can delete the current directory and the below
// directories ( if write is not permitted then delete is either )
sftpClient . chmod ( pat... |
public class SourceCode { /** * returns if the current character ( internal pointer ) and the following are the same as the given
* input */
public boolean isCurrent ( String str ) { } } | if ( pos + str . length ( ) > lcText . length ) return false ; for ( int i = str . length ( ) - 1 ; i >= 0 ; i -- ) { if ( str . charAt ( i ) != lcText [ pos + i ] ) return false ; } return true ; |
public class EigenvalueSmall_F64 { /** * See page 385 of Fundamentals of Matrix Computations 2nd */
public void symm2x2_fast ( double a11 , double a12 , double a22 ) { } } | // double p = ( a11 - a22 ) * 0.5;
// double r = Math . sqrt ( p * p + a12 * a12 ) ;
// value0 . real = a22 + a12 * a12 / ( r - p ) ;
// value1 . real = a22 - a12 * a12 / ( r + p ) ;
// public void symm2x2 _ std ( double a11 , double a12 , double a22 )
double left = ( a11 + a22 ) * 0.5 ; double b = ( a11 - a22 ) * 0.5 ... |
public class RevocationVerificationManager { /** * This method first tries to verify the given certificate chain using OCSP since OCSP verification is
* faster . If that fails it tries to do the verification using CRL .
* @ param peerCertificates javax . security . cert . X509Certificate [ ] array of peer certifica... | X509Certificate [ ] convertedCertificates = convert ( peerCertificates ) ; long start = System . currentTimeMillis ( ) ; // If not set by the user , default cache size will be 50 and default cache delay will be 15 mins .
OCSPCache ocspCache = OCSPCache . getCache ( ) ; ocspCache . init ( cacheSize , cacheDelayMins ) ; ... |
public class SignatureFinder { /** * Stop finding signatures for all active players . */
public synchronized void stop ( ) { } } | if ( isRunning ( ) ) { MetadataFinder . getInstance ( ) . removeTrackMetadataListener ( metadataListener ) ; WaveformFinder . getInstance ( ) . removeWaveformListener ( waveformListener ) ; BeatGridFinder . getInstance ( ) . removeBeatGridListener ( beatGridListener ) ; running . set ( false ) ; pendingUpdates . clear ... |
public class DateUtils { /** * Parse format { @ link # DATETIME _ FORMAT } . This method never throws exception .
* @ param s any string
* @ return the datetime , { @ code null } if parsing error or if parameter is { @ code null } */
@ CheckForNull public static Date parseDateTimeQuietly ( @ Nullable String s ) { }... | Date datetime = null ; if ( s != null ) { try { datetime = parseDateTime ( s ) ; } catch ( RuntimeException e ) { // ignore
} } return datetime ; |
public class CsvDozerBeanWriter { /** * { @ inheritDoc } */
public void write ( final Object source , final CellProcessor [ ] processors ) throws IOException { } } | if ( source == null ) { throw new NullPointerException ( "object to write should not be null" ) ; } else if ( processors == null ) { throw new NullPointerException ( "processors should not be null" ) ; } // update the current row / line numbers
super . incrementRowAndLineNo ( ) ; // extract the bean values into the Lis... |
public class StockholmFileParser { /** * Handles a line that corresponds to a sequence . < br >
* e . g . : COATB _ BPIKE / 30-81 AEPNAATNYATEAMDSLKTQAIDLISQTWPVVTTVVVAGLVIRLFKKFSSKA < br >
* N . B . : This function can ' t tolerate sequences with intrinsic white space .
* @ param line
* the line to be parsed
... | String [ ] lineContent = line . split ( "\\s+" ) ; if ( lineContent . length != 2 ) { throw new ParserException ( "Could not split sequence line into sequence name and sequence:\n" + line ) ; } stockholmStructure . appendToSequence ( lineContent [ 0 ] , lineContent [ 1 ] ) ; |
public class IOUtils { /** * Read text .
* @ param inputStream the input stream
* @ return the string */
public static String readText ( InputStream inputStream ) { } } | BufferedReader bufferedReader = new BufferedReader ( new InputStreamReader ( inputStream ) ) ; String line ; StringBuilder stringBuilder = new StringBuilder ( ) ; try { while ( ( line = bufferedReader . readLine ( ) ) != null ) { stringBuilder . append ( line ) ; stringBuilder . append ( '\n' ) ; } } catch ( IOExceptio... |
public class OntologyTermRepository { /** * Retrieves an { @ link OntologyTerm } for one or more IRIs
* @ param iris Array of { @ link OntologyTerm } IRIs
* @ return combined { @ link OntologyTerm } for the iris . */
public OntologyTerm getOntologyTerm ( String [ ] iris ) { } } | List < OntologyTerm > ontologyTerms = Lists . newArrayList ( ) ; for ( String iri : iris ) { org . molgenis . ontology . core . meta . OntologyTerm ontologyTermEntity = dataService . query ( ONTOLOGY_TERM , org . molgenis . ontology . core . meta . OntologyTerm . class ) . eq ( ONTOLOGY_TERM_IRI , iri ) . findOne ( ) ;... |
public class DefaultWardenService { /** * ~ Methods * * * * * */
private static String _constructWardenMetricExpression ( String relativeStart , PrincipalUser user , PolicyCounter counter ) { } } | assert ( user != null ) : "User cannot be null." ; assert ( counter != null ) : "Counter cannot be null." ; assert ( relativeStart != null ) : "Relative start cannot be null." ; String metricName = counter . getMetricName ( ) ; String userName = user . getUserName ( ) ; if ( "sum" . equals ( counter . getAggregator ( )... |
public class AbstractJaxRsResourceProvider { /** * Update an existing resource based on the given condition
* @ param resource the body contents for the put method
* @ return the response
* @ see < a href = " https : / / www . hl7 . org / fhir / http . html # update " > https : / / www . hl7 . org / fhir / http .... | return execute ( getResourceRequest ( RequestTypeEnum . PUT , RestOperationTypeEnum . UPDATE ) . resource ( resource ) ) ; |
public class HttpResponseHeader { /** * Parses the response headers and build a lis of all the http cookies set . For the cookies whose domain
* could not be determined , the { @ code defaultDomain } is set .
* @ param defaultDomain the default domain
* @ return the http cookies */
public List < HttpCookie > getH... | List < HttpCookie > cookies = new LinkedList < > ( ) ; Vector < String > cookiesS = getHeaders ( HttpHeader . SET_COOKIE ) ; if ( cookiesS != null ) { for ( String c : cookiesS ) { cookies . addAll ( parseCookieString ( c , defaultDomain ) ) ; } } cookiesS = getHeaders ( HttpHeader . SET_COOKIE2 ) ; if ( cookiesS != nu... |
public class ElementIterator { /** * Copied from { @ link org . apache . accumulo . core . iterators . user . RowEncodingIterator } */
@ Override public void seek ( Range range , Collection < ByteSequence > columnFamilies , boolean inclusive ) throws IOException { } } | topKey = null ; topValue = null ; Key sk = range . getStartKey ( ) ; if ( sk != null && sk . getColumnFamilyData ( ) . length ( ) == 0 && sk . getColumnQualifierData ( ) . length ( ) == 0 && sk . getColumnVisibilityData ( ) . length ( ) == 0 && sk . getTimestamp ( ) == Long . MAX_VALUE && ! range . isStartKeyInclusive ... |
public class GsonOrdainer { /** * Generate sanitized js content with provided Gson serializer .
* @ param gson A Gson serializer .
* @ param obj The object to render as gson .
* @ return SanitizedContent containing the object rendered as a json string . */
public static SanitizedContent serializeObject ( Gson gso... | return ordainJson ( gson . toJson ( obj ) ) ; |
public class CmsModuleUpdater { /** * Handles the file deletions .
* @ param cms the CMS context to use
* @ param toDelete the resources to delete
* @ throws CmsException if something goes wrong */
protected void processDeletions ( CmsObject cms , List < CmsResource > toDelete ) throws CmsException { } } | Collections . sort ( toDelete , ( a , b ) -> b . getRootPath ( ) . compareTo ( a . getRootPath ( ) ) ) ; for ( CmsResource deleteRes : toDelete ) { m_report . print ( org . opencms . importexport . Messages . get ( ) . container ( org . opencms . importexport . Messages . RPT_DELFOLDER_0 ) , I_CmsReport . FORMAT_NOTE )... |
public class Device { /** * Request the update progress as a percentage value from 0 to 100
* @ return The current progress .
* @ throws CommandExecutionException When there has been a error during the communication or the response was invalid . */
public int updateProgress ( ) throws CommandExecutionException { } ... | int resp = sendToArray ( "miIO.get_ota_progress" ) . optInt ( 0 , - 1 ) ; if ( ( resp < 0 ) || ( resp > 100 ) ) throw new CommandExecutionException ( CommandExecutionException . Error . INVALID_RESPONSE ) ; return resp ; |
public class FacesImpl { /** * Detect human faces in an image and returns face locations , and optionally with faceIds , landmarks , and attributes .
* @ param image An image stream .
* @ param detectWithStreamOptionalParameter the object representing the optional parameters to be set before calling this API
* @ ... | return ServiceFuture . fromResponse ( detectWithStreamWithServiceResponseAsync ( image , detectWithStreamOptionalParameter ) , serviceCallback ) ; |
public class ComputerVisionImpl { /** * Optical Character Recognition ( OCR ) detects printed text in an image and extracts the recognized characters into a machine - usable character stream . Upon success , the OCR results will be returned . Upon failure , the error code together with an error message will be returned... | return ServiceFuture . fromResponse ( recognizePrintedTextWithServiceResponseAsync ( detectOrientation , url , recognizePrintedTextOptionalParameter ) , serviceCallback ) ; |
public class PropertyResolver { /** * Parse a String and replace vars a la ant ( $ { key } from System Properties
* Support complex Strings like :
* " $ { myhost } " " $ { myhost : w2 } " " $ { mybean : defbean } . $ { mybean2 : defbean2 } "
* @ param s
* @ return resolved String */
public String resolveProps (... | if ( s == null ) { return null ; } int ipos = 0 ; int pos = s . indexOf ( "${" , ipos ) ; if ( pos == - 1 ) return s ; StringBuilder sb = new StringBuilder ( ) ; while ( ipos < s . length ( ) ) { pos = s . indexOf ( "${" , ipos ) ; if ( pos < 0 ) { sb . append ( s . substring ( ipos ) ) ; break ; } if ( pos != ipos ) s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.