signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class EntityCachingAbstractSequencePrior { /** * extracts the entity starting at the given position
* and adds it to the entity list . returns the index
* of the last element in the entity ( < B > not < / b > index + 1) */
public Entity extractEntity ( int [ ] sequence , int position ) { } } | Entity entity = new Entity ( ) ; entity . type = sequence [ position ] ; entity . startPosition = position ; entity . words = new ArrayList < String > ( ) ; for ( ; position < sequence . length ; position ++ ) { if ( sequence [ position ] == entity . type ) { String word = doc . get ( position ) . get ( CoreAnnotations... |
public class DefaultHistoryManager { /** * / * ( non - Javadoc )
* @ see org . activiti . engine . impl . history . HistoryManagerInterface # recordTaskProcessDefinitionChange ( java . lang . String , java . lang . String ) */
@ Override public void recordTaskProcessDefinitionChange ( String taskId , String processDe... | if ( isHistoryLevelAtLeast ( HistoryLevel . ACTIVITY ) ) { HistoricTaskInstanceEntity historicTaskInstance = getHistoricTaskInstanceEntityManager ( ) . findById ( taskId ) ; if ( historicTaskInstance != null ) { historicTaskInstance . setProcessDefinitionId ( processDefinitionId ) ; } } |
public class WrapperManager { /** * Return wrapper instance corresponding to the given object key . < p >
* This method is called whenever the ORB is attempting to invoke a
* method on an object identitied by an IOR . The byte array received
* by this method must be a serialized instance of a
* < code > BeanId ... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "keyToObject" ) ; EJSWrapperCommon wc = null ; EJSRemoteWrapper wrapper = null ; // The key into the wrapper cache is the serialized beanId , and the
// serialized beanId either is the wrapper key , or at least part of
// the w... |
public class InterceptedSubclassFactory { /** * Creates the given method on the proxy class where the implementation
* forwards the call directly to the method handler .
* the generated bytecode is equivalent to :
* return ( RetType ) methodHandler . invoke ( this , param1 , param2 ) ;
* @ param methodInfo any ... | invokeMethodHandler ( method , methodInfo , true , DEFAULT_METHOD_RESOLVER , delegateToSuper , staticConstructor ) ; |
public class Application { /** * < p > Get a value by evaluating an expression . < / p >
* < p > Call { @ link # getExpressionFactory } then call { @ link
* ExpressionFactory # createValueExpression } passing the argument
* < code > expression < / code > and < code > expectedType < / code > . Call
* { @ link Fa... | if ( defaultApplication != null ) { return defaultApplication . evaluateExpressionGet ( context , expression , expectedType ) ; } throw new UnsupportedOperationException ( ) ; |
public class Tools { /** * Clamp values .
* @ param x Value .
* @ param range Range .
* @ return Value . */
public static double Clamp ( double x , DoubleRange range ) { } } | return Clamp ( x , range . getMin ( ) , range . getMax ( ) ) ; |
public class Properties { /** * Returns the value to which the specified property key is mapped , or
* < code > null < / code > if this properties contains no mapping for the property key .
* @ param property
* the property key whose associated value is to be returned
* @ return the value to which the specified... | return ( T ) properties . get ( property . getName ( ) ) ; |
public class VFSRepository { /** * For testing purpose of new VFS providers ( eg . Confluence , . . . )
* @ param urlScheme a { @ link java . lang . String } object .
* @ param provider a { @ link org . apache . commons . vfs . provider . FileProvider } object .
* @ throws org . apache . commons . vfs . FileSyste... | ( ( DefaultFileSystemManager ) fileSystemManager ) . addProvider ( urlScheme , provider ) ; |
public class InternalTimerServiceImpl { /** * Starts the local { @ link InternalTimerServiceImpl } by :
* < ol >
* < li > Setting the { @ code keySerialized } and { @ code namespaceSerializer } for the timers it will contain . < / li >
* < li > Setting the { @ code triggerTarget } which contains the action to be ... | if ( ! isInitialized ) { if ( keySerializer == null || namespaceSerializer == null ) { throw new IllegalArgumentException ( "The TimersService serializers cannot be null." ) ; } if ( this . keySerializer != null || this . namespaceSerializer != null || this . triggerTarget != null ) { throw new IllegalStateException ( ... |
public class SerializationUtils { /** * Read a JSON string and parse to { @ link JsonNode } instance , with a custom class loader .
* @ param source
* @ param classLoader
* @ return
* @ since 0.6.2 */
public static JsonNode readJson ( Reader source , ClassLoader classLoader ) { } } | ClassLoader oldClassLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; if ( classLoader != null ) { Thread . currentThread ( ) . setContextClassLoader ( classLoader ) ; } try { if ( source == null ) { return NullNode . instance ; } ObjectMapper mapper = poolMapper . borrowObject ( ) ; if ( mapper != null... |
public class AmazonConnectClient { /** * Updates the security profiles assigned to the user .
* @ param updateUserSecurityProfilesRequest
* @ return Result of the UpdateUserSecurityProfiles operation returned by the service .
* @ throws InvalidRequestException
* The request is not valid .
* @ throws InvalidPa... | request = beforeClientExecution ( request ) ; return executeUpdateUserSecurityProfiles ( request ) ; |
public class RSAUtils { /** * 获取公钥
* @ param keyMap 密钥对
* @ return
* @ throws Exception */
public static String getPublicKey ( Map < String , Object > keyMap ) throws Exception { } } | Key key = ( Key ) keyMap . get ( PUBLIC_KEY ) ; return String . valueOf ( Base64Utils . encode ( key . getEncoded ( ) ) ) ; |
public class RequestHttpBase { /** * Returns the value of an already set output header .
* @ param name name of the header to get . */
public String headerOut ( String name ) { } } | ArrayList < String > keys = _headerKeysOut ; int headerSize = keys . size ( ) ; for ( int i = 0 ; i < headerSize ; i ++ ) { String oldKey = keys . get ( i ) ; if ( oldKey . equalsIgnoreCase ( name ) ) { return ( String ) _headerValuesOut . get ( i ) ; } } /* if ( name . equalsIgnoreCase ( " content - type " ) ) {
thr... |
public class FTPClient { /** * Throws ServerException if GFD . 47 GETPUT is not supported or
* cannot be used . */
protected void checkGETPUTSupport ( ) throws ServerException , IOException { } } | if ( ! isFeatureSupported ( FeatureList . GETPUT ) ) { throw new ServerException ( ServerException . UNSUPPORTED_FEATURE ) ; } if ( controlChannel . isIPv6 ( ) ) { throw new ServerException ( ServerException . UNSUPPORTED_FEATURE , "Cannot use GridFTP2 with IP 6" ) ; } |
public class HttpClientResourceAdaptor { /** * ( non - Javadoc )
* @ see
* javax . slee . resource . ResourceAdaptor # setResourceAdaptorContext ( javax . slee
* . resource . ResourceAdaptorContext ) */
public void setResourceAdaptorContext ( ResourceAdaptorContext arg0 ) { } } | resourceAdaptorContext = arg0 ; tracer = resourceAdaptorContext . getTracer ( HttpClientResourceAdaptor . class . getSimpleName ( ) ) ; try { fireableEventType = resourceAdaptorContext . getEventLookupFacility ( ) . getFireableEventType ( new EventTypeID ( "net.java.client.slee.resource.http.event.ResponseEvent" , "net... |
public class AbstractDirectoryInfo { /** * Try to locate a directory in the file system .
* @ param directory the directory to locate
* @ return true if the directory was found , false otherwise */
protected final boolean tryFS ( String directory ) { } } | String path = directory ; File file = new File ( path ) ; if ( this . testDirectory ( file ) == true ) { // found in file system
try { this . url = file . toURI ( ) . toURL ( ) ; this . file = file ; this . fullDirectoryName = FilenameUtils . getPath ( file . getAbsolutePath ( ) ) ; this . setRootPath = directory ; ret... |
public class Primitives { /** * Write value to byte array
* @ param value
* @ param array
* @ param offset
* @ see java . nio . ByteBuffer # putFloat ( float ) */
public static final void writeFloat ( float value , byte [ ] array , int offset ) { } } | writeInt ( Float . floatToRawIntBits ( value ) , array , offset ) ; |
public class FTPFileSystem { /** * Convenience method , so that we don ' t open a new connection when using this
* method from within another method . Otherwise every API invocation incurs
* the overhead of opening / closing a TCP connection . */
private FileStatus getFileStatus ( FTPClient client , Path file ) thr... | FileStatus fileStat = null ; Path workDir = new Path ( client . printWorkingDirectory ( ) ) ; Path absolute = makeAbsolute ( workDir , file ) ; Path parentPath = absolute . getParent ( ) ; if ( parentPath == null ) { // root dir
long length = - 1 ; // Length of root dir on server not known
boolean isDir = true ; int bl... |
public class CryptoUtils { /** * Calculates the SHA1 hash of the string .
* @ param text
* @ return sha1 hash of the string */
public static String getHashSHA1 ( String text ) { } } | byte [ ] bytes = text . getBytes ( StandardCharsets . ISO_8859_1 ) ; return getHashSHA1 ( bytes ) ; |
public class SM2Engine { /** * 下一个K值
* @ return K值 */
private BigInteger nextK ( ) { } } | final int qBitLength = this . ecParams . getN ( ) . bitLength ( ) ; BigInteger k ; do { k = new BigInteger ( qBitLength , this . random ) ; } while ( k . equals ( ECConstants . ZERO ) || k . compareTo ( this . ecParams . getN ( ) ) >= 0 ) ; return k ; |
public class Utils { /** * http : / / stackoverflow . com / questions / 8981029 / simple - way - to - do - dynamic - but - square - layout */
public static int getSquaredMeasureSpec ( final ViewGroup viewGroup , int widthMeasureSpec , int heightMeasureSpec ) { } } | int widthMode = View . MeasureSpec . getMode ( widthMeasureSpec ) ; int widthSize = View . MeasureSpec . getSize ( widthMeasureSpec ) ; int heightMode = View . MeasureSpec . getMode ( heightMeasureSpec ) ; int heightSize = View . MeasureSpec . getSize ( heightMeasureSpec ) ; int size ; if ( widthMode == View . MeasureS... |
public class JarVerifier { /** * called to let us know we have processed all the
* META - INF entries , and if we re - read one of them , don ' t
* re - process it . Also gets rid of any data structures
* we needed when parsing META - INF entries . */
void doneWithMeta ( ) { } } | parsingMeta = false ; anyToVerify = ! sigFileSigners . isEmpty ( ) ; baos = null ; sigFileData = null ; pendingBlocks = null ; signerCache = null ; manDig = null ; // MANIFEST . MF is always treated as signed and verified ,
// move its signers from sigFileSigners to verifiedSigners .
if ( sigFileSigners . containsKey (... |
public class Converter { /** * Transforms different objects ( BigDecimal , Integer ) to Double .
* @ param value
* The object to transform
* @ return
* The double value */
public static Double asDouble ( Object value ) { } } | double doubleValue ; switch ( value . getClass ( ) . getCanonicalName ( ) ) { case "java.math.BigDecimal" : doubleValue = ( ( BigDecimal ) value ) . doubleValue ( ) ; break ; case "java.lang.Integer" : doubleValue = ( ( Integer ) value ) . doubleValue ( ) ; break ; default : doubleValue = ( Double ) value ; break ; } r... |
public class BlockMapOutputBuffer { /** * return the value of ProcResourceValues for later use */
protected ProcResourceValues sortReduceParts ( ) { } } | long sortStartMilli = System . currentTimeMillis ( ) ; ProcResourceValues sortStartProcVals = task . getCurrentProcResourceValues ( ) ; long sortStart = task . jmxThreadInfoTracker . getTaskCPUTime ( "MAIN_TASK" ) ; // sort
for ( int i = 0 ; i < reducePartitions . length ; i ++ ) { reducePartitions [ i ] . groupOrSort ... |
public class SearchExpression { /** * A list of filter objects .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setFilters ( java . util . Collection ) } or { @ link # withFilters ( java . util . Collection ) } if you want to override
* the existing values... | if ( this . filters == null ) { setFilters ( new java . util . ArrayList < Filter > ( filters . length ) ) ; } for ( Filter ele : filters ) { this . filters . add ( ele ) ; } return this ; |
public class BasicChecker { /** * Initializes the internal state of the checker from parameters
* specified in the constructor . */
@ Override public void init ( boolean forward ) throws CertPathValidatorException { } } | if ( ! forward ) { prevPubKey = trustedPubKey ; if ( PKIX . isDSAPublicKeyWithoutParams ( prevPubKey ) ) { // If TrustAnchor is a DSA public key and it has no params , it
// cannot be used to verify the signature of the first cert ,
// so throw exception
throw new CertPathValidatorException ( "Key parameters missing" )... |
public class SpecStringParser { /** * TODO Unit Test this */
public static String fixLeadingBracketSugar ( String dotNotaton ) { } } | if ( dotNotaton == null || dotNotaton . length ( ) == 0 ) { return "" ; } char prev = dotNotaton . charAt ( 0 ) ; StringBuilder sb = new StringBuilder ( ) ; sb . append ( prev ) ; for ( int index = 1 ; index < dotNotaton . length ( ) ; index ++ ) { char curr = dotNotaton . charAt ( index ) ; if ( curr == '[' && prev !=... |
public class Configuration { /** * Write a UID file
* @ param uidFile The UID file to write
* @ param uid The UID to write to the file */
private void writeUid ( File uidFile , String uid ) { } } | BufferedWriter bw = null ; try { bw = new BufferedWriter ( new FileWriter ( uidFile ) ) ; bw . write ( uid ) ; } catch ( IOException ioe ) { } finally { if ( bw != null ) { try { bw . close ( ) ; } catch ( IOException ioe ) { } } } |
public class MethodInterceptor { /** * { @ inheritDoc } */
public Object processInvocation ( final InterceptorContext context ) throws Exception { } } | try { Method method = this . method ; if ( withContext ) { if ( changeMethod ) { final Method oldMethod = context . getMethod ( ) ; context . setMethod ( method ) ; try { return method . invoke ( interceptorInstance , context . getInvocationContext ( ) ) ; } finally { context . setMethod ( oldMethod ) ; } } else { retu... |
public class ExecutionManager { /** * Cancel request and workers . */
@ SuppressWarnings ( "deprecation" ) private void cancelRequestAndWorkers ( ) { } } | for ( ActorRef worker : workers . values ( ) ) { if ( worker != null && ! worker . isTerminated ( ) ) { worker . tell ( OperationWorkerMsgType . CANCEL , getSelf ( ) ) ; } } logger . info ( "ExecutionManager sending cancelPendingRequest at time: " + PcDateUtils . getNowDateTimeStr ( ) ) ; |
public class Version { /** * Factory method to construct an instance of { @ link Version } initialized with major , minor
* and maintenance version numbers along with the version qualifier ( e . g . RELEASE ) .
* @ param major major version number .
* @ param minor minor version number .
* @ param maintenance m... | return from ( major , minor , maintenance , qualifier , 0 ) ; |
public class ApiOvhTelephony { /** * Alter this object properties
* REST : PUT / telephony / { billingAccount } / ovhPabx / { serviceName } / menu / { menuId } / entry / { entryId }
* @ param body [ required ] New object properties
* @ param billingAccount [ required ] The name of your billingAccount
* @ param ... | String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/menu/{menuId}/entry/{entryId}" ; StringBuilder sb = path ( qPath , billingAccount , serviceName , menuId , entryId ) ; exec ( qPath , "PUT" , sb . toString ( ) , body ) ; |
public class BeanUtils { /** * 获得输入对象列表的镜象实例列表 , 要求参数类必需包含一个无参的public构造函数
* @ param sourceList
* @ return
* @ author ying
* @ since 1.0.0 */
@ SuppressWarnings ( { } } | "rawtypes" , "unchecked" } ) public static List getCloneList ( List sourceList ) { if ( null == sourceList ) { return null ; } List targetList = new ArrayList ( ) ; for ( int i = 0 ; i < sourceList . size ( ) ; i ++ ) { Object target = null ; Object source = sourceList . get ( i ) ; try { Constructor con = source . get... |
public class EvaluatorStatusManager { /** * Transition to the new state of the evaluator , if possible .
* @ param toState New state of the evaluator .
* @ throws IllegalStateException if state transition is not valid . */
private void setState ( final EvaluatorState toState ) { } } | while ( true ) { final EvaluatorState fromState = this . state . get ( ) ; if ( fromState == toState ) { break ; } if ( ! fromState . isLegalTransition ( toState ) ) { LOG . log ( Level . WARNING , "Illegal state transition: {0} -> {1}" , new Object [ ] { fromState , toState } ) ; throw new IllegalStateException ( "Ill... |
public class XmlWriter { /** * Write an attribute with a value , if value is null nothing is written .
* @ throws IllegalStateException if the is no element is open */
public void writeAttribute ( String name , Object value ) { } } | if ( ! _isElementOpen ) throw new IllegalStateException ( "no open element" ) ; if ( value == null ) return ; _isElementOpen = false ; try { _strategy . writeAttribute ( this , name , value ) ; } finally { _isElementOpen = true ; } |
public class ZipEntryUtil { /** * Create new Zip entry and fill it with associated with file meta - info
* @ param name Zip entry name
* @ param file source File
* @ return newly created Zip entry */
static ZipEntry fromFile ( String name , File file ) { } } | ZipEntry zipEntry = new ZipEntry ( name ) ; if ( ! file . isDirectory ( ) ) { zipEntry . setSize ( file . length ( ) ) ; } zipEntry . setTime ( file . lastModified ( ) ) ; ZTFilePermissions permissions = ZTFilePermissionsUtil . getDefaultStategy ( ) . getPermissions ( file ) ; if ( permissions != null ) { ZipEntryUtil ... |
public class Timeout { /** * Creates a new Timeout instance . */
public static Timeout create ( final TimeoutId id , final String sagaId , final String name , final Date expiredAt , final Object data ) { } } | Timeout timeout = new Timeout ( ) ; timeout . id = id ; timeout . sagaId = sagaId ; timeout . expiredAt = expiredAt ; timeout . name = name ; timeout . data = data ; return timeout ; |
public class SessionAffinityManager { /** * setTheSipApplicationSessionCookie */
public void setSIPCookie ( ServletRequest request , ServletResponse response , String sipCookieString ) { } } | // LIBERTY Cannot reach IExtendedResponse from here .
// overridden in SessionAffinityManagerImpl
if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_CORE . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_CORE . logp ( Level . FINE , methodClassName , metho... |
public class Xsd2CobolTypesModelBuilder { /** * For java . lang types , strips the package which is not needed in generated
* java classes .
* @ param javaType the proposed java class
* @ return the java type name shortened if needed */
private static String getShortTypeName ( Class < ? > javaType ) { } } | String javaTypeName = javaType . getName ( ) ; if ( javaTypeName . startsWith ( "java.lang." ) ) { return javaTypeName . substring ( "java.lang." . length ( ) ) ; } else { return javaTypeName ; } |
public class CodepointHelper { /** * Removes leading and trailing bidi controls from the string
* @ param sStr
* Source string
* @ return the modified string */
@ Nullable public static String stripBidi ( @ Nullable final String sStr ) { } } | if ( sStr == null || sStr . length ( ) <= 1 ) return sStr ; String ret = sStr ; if ( isBidi ( ret . charAt ( 0 ) ) ) ret = ret . substring ( 1 ) ; if ( isBidi ( ret . charAt ( ret . length ( ) - 1 ) ) ) ret = ret . substring ( 0 , ret . length ( ) - 1 ) ; return ret ; |
public class DefaultFontMapper { /** * Looks for a BaseFont parameter associated with a name .
* @ param name the name
* @ return the BaseFont parameter or < CODE > null < / CODE > if not found . */
public BaseFontParameters getBaseFontParameters ( String name ) { } } | String alias = ( String ) aliases . get ( name ) ; if ( alias == null ) return ( BaseFontParameters ) mapper . get ( name ) ; BaseFontParameters p = ( BaseFontParameters ) mapper . get ( alias ) ; if ( p == null ) return ( BaseFontParameters ) mapper . get ( name ) ; else return p ; |
public class Terminal { /** * Like print , but prints out a whole slew of objects on the same line .
* @ param messages objects you want to print on the same line . */
public static void puts ( Object ... messages ) { } } | for ( Object message : messages ) { IO . print ( message ) ; if ( ! ( message instanceof Terminal . Escape ) ) IO . print ( ' ' ) ; } IO . println ( ) ; |
public class Plot { /** * Generates the Gnuplot script and data files .
* @ param basepath The base path to use . A number of new files will be
* created and their names will all start with this string .
* @ return The number of data points sent to Gnuplot . This can be less
* than the number of data points inv... | int npoints = 0 ; final int nseries = datapoints . size ( ) ; final String datafiles [ ] = nseries > 0 ? new String [ nseries ] : null ; FileSystem . checkDirectory ( new File ( basepath ) . getParent ( ) , Const . MUST_BE_WRITEABLE , Const . CREATE_IF_NEEDED ) ; for ( int i = 0 ; i < nseries ; i ++ ) { datafiles [ i ]... |
public class WebsocketFinalizer { /** * UriConfiguration methods */
@ Override public WebsocketSender uri ( String uri ) { } } | return new WebsocketFinalizer ( cachedConfiguration . bootstrap ( b -> HttpClientConfiguration . uri ( b , uri ) ) ) ; |
public class StaticTypeCheckingSupport { /** * Filter methods according to visibility
* @ param methodNodeList method nodes to filter
* @ param enclosingClassNode the enclosing class
* @ return filtered method nodes
* @ since 3.0.0 */
public static List < MethodNode > filterMethodsByVisibility ( List < MethodNo... | if ( ! asBoolean ( methodNodeList ) ) { return StaticTypeCheckingVisitor . EMPTY_METHODNODE_LIST ; } List < MethodNode > result = new LinkedList < > ( ) ; boolean isEnclosingInnerClass = enclosingClassNode instanceof InnerClassNode ; List < ClassNode > outerClasses = enclosingClassNode . getOuterClasses ( ) ; outer : f... |
public class PKAbstractSigningUtil { /** * ( non - Javadoc )
* @ see de . brendamour . jpasskit . signing . IPKSigningUtil # signManifestFile ( byte [ ] , de . brendamour . jpasskit . signing . PKSigningInformation ) */
@ Override public byte [ ] signManifestFile ( byte [ ] manifestJSON , PKSigningInformation signing... | Assert . notNull ( manifestJSON , "Manifest JSON is mandatory" ) ; CMSProcessableByteArray content = new CMSProcessableByteArray ( manifestJSON ) ; return signManifestUsingContent ( signingInformation , content ) ; |
public class InputLogEventMarshaller { /** * Marshall the given parameter object . */
public void marshall ( InputLogEvent inputLogEvent , ProtocolMarshaller protocolMarshaller ) { } } | if ( inputLogEvent == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( inputLogEvent . getTimestamp ( ) , TIMESTAMP_BINDING ) ; protocolMarshaller . marshall ( inputLogEvent . getMessage ( ) , MESSAGE_BINDING ) ; } catch ( Exception e ) { thr... |
public class OVSImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setOVERCHAR ( Integer newOVERCHAR ) { } } | Integer oldOVERCHAR = overchar ; overchar = newOVERCHAR ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . OVS__OVERCHAR , oldOVERCHAR , overchar ) ) ; |
public class JmsJcaSessionImpl { /** * Gets the managed connection , this will reassociate itself with a managed
* connection if we don ' t have one and the connection manager is a
* < code > LazyAssociatableConnectionManager < / code > .
* @ return the managed connection
* @ throws IllegalStateException
* if... | if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , "getManagedConnection" ) ; } if ( _managedConnection == null ) { final ConnectionManager connectionManager = _connection . getConnectionManager ( ) ; if ( connectionManager == null ) { throw new IllegalStateEx... |
public class DataSet { /** * This method changes the back - end store used to hold and represent data
* points . Changing this may be beneficial for expert users who know how
* their data will be accessed , or need to make modifications for more
* efficient storage . < br >
* If the currently data store is not ... | if ( store . size ( ) > 0 ) throw new RuntimeException ( "A non-empty data store was provided to an already existing dataset object." ) ; store . setCategoricalDataInfo ( this . datapoints . getCategoricalDataInfo ( ) ) ; store . setNumNumeric ( numNumerVals ) ; if ( this . datapoints . size ( ) > 0 ) { for ( int i = 0... |
public class AwsIamAccessKeyDetailsMarshaller { /** * Marshall the given parameter object . */
public void marshall ( AwsIamAccessKeyDetails awsIamAccessKeyDetails , ProtocolMarshaller protocolMarshaller ) { } } | if ( awsIamAccessKeyDetails == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( awsIamAccessKeyDetails . getUserName ( ) , USERNAME_BINDING ) ; protocolMarshaller . marshall ( awsIamAccessKeyDetails . getStatus ( ) , STATUS_BINDING ) ; protoc... |
public class SystemPropertiesUtil { /** * 合并系统变量 ( - D ) , 环境变量 和默认值 , 以系统变量优先 */
public static Double getDouble ( String propertyName , String envName , Double defaultValue ) { } } | checkEnvName ( envName ) ; Double propertyValue = NumberUtil . toDoubleObject ( System . getProperty ( propertyName ) , null ) ; if ( propertyValue != null ) { return propertyValue ; } else { propertyValue = NumberUtil . toDoubleObject ( System . getenv ( envName ) , null ) ; return propertyValue != null ? propertyValu... |
public class DockerClient { /** * Remove an image , deleting any tags it might have . */
public void removeImage ( String imageId ) throws DockerException { } } | Preconditions . checkState ( ! StringUtils . isEmpty ( imageId ) , "Image ID can't be empty" ) ; try { WebResource webResource = client . resource ( restEndpointUrl + "/images/" + imageId ) . queryParam ( "force" , "true" ) ; LOGGER . trace ( "DELETE: {}" , webResource ) ; webResource . delete ( ) ; } catch ( UniformIn... |
public class ASTHelpers { /** * Find the root assignable expression of a chain of field accesses . If there is no root ( i . e , a
* bare method call or a static method call ) , return null .
* < p > Examples :
* < pre > { @ code
* a . trim ( ) . intern ( ) = = > a
* a . b . trim ( ) . intern ( ) = = > a . b ... | if ( ! ( methodInvocationTree instanceof JCMethodInvocation ) ) { throw new IllegalArgumentException ( "Expected type to be JCMethodInvocation, but was " + methodInvocationTree . getClass ( ) ) ; } // Check for bare method call , e . g . intern ( ) .
if ( ( ( JCMethodInvocation ) methodInvocationTree ) . getMethodSelec... |
public class UpdatePatchBaselineRequest { /** * Information about the patches to use to update the instances , including target operating systems and source
* repositories . Applies to Linux instances only .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # s... | if ( this . sources == null ) { setSources ( new com . amazonaws . internal . SdkInternalList < PatchSource > ( sources . length ) ) ; } for ( PatchSource ele : sources ) { this . sources . add ( ele ) ; } return this ; |
public class ByteBufUtil { /** * Encode a { @ link CharSequence } in < a href = " http : / / en . wikipedia . org / wiki / UTF - 8 " > UTF - 8 < / a > and write
* it to a { @ link ByteBuf } .
* It behaves like { @ link # reserveAndWriteUtf8 ( ByteBuf , CharSequence , int ) } with { @ code reserveBytes }
* compute... | return reserveAndWriteUtf8 ( buf , seq , utf8MaxBytes ( seq ) ) ; |
public class RowMapperWide { /** * Returns the Lucene { @ link Query } to get the { @ link Document } s satisfying the specified partition key and { @ link
* RangeTombstone } .
* @ param partitionKey A partition key .
* @ param rangeTombstone A { @ link RangeTombstone } .
* @ return The Lucene { @ link Query } ... | BooleanQuery query = new BooleanQuery ( ) ; query . add ( partitionKeyMapper . query ( partitionKey ) , MUST ) ; query . add ( clusteringKeyMapper . query ( rangeTombstone . min , rangeTombstone . max ) , MUST ) ; return query ; |
public class IsBetweenLowerBoundInclusive { /** * Creates a matcher for { @ code T } s that matches when the < code > compareTo ( ) < / code > method returns a value between
* < code > from < / code > and < code > to < / code > , both included .
* < p > For example :
* < pre > assertThat ( 10 , betweenLowerBoundI... | return new IsBetweenLowerBoundInclusive ( from , to ) ; |
public class CommandLine { /** * Sets whether the parser should ignore case when converting arguments to { @ code enum } values . The default is { @ code false } .
* When set to true , for example , for an option of type < a href = " https : / / docs . oracle . com / javase / 8 / docs / api / java / time / DayOfWeek ... | getCommandSpec ( ) . parser ( ) . caseInsensitiveEnumValuesAllowed ( newValue ) ; for ( CommandLine command : getCommandSpec ( ) . subcommands ( ) . values ( ) ) { command . setCaseInsensitiveEnumValuesAllowed ( newValue ) ; } return this ; |
public class HistoricalSecrets { /** * / * package */
static Secret decrypt ( String data , CryptoConfidentialKey key ) throws IOException , GeneralSecurityException { } } | byte [ ] in ; try { in = Base64 . getDecoder ( ) . decode ( data . getBytes ( StandardCharsets . UTF_8 ) ) ; } catch ( IllegalArgumentException ex ) { throw new IOException ( "Could not decode secret" , ex ) ; } Secret s = tryDecrypt ( key . decrypt ( ) , in ) ; if ( s != null ) return s ; // try our historical key for... |
public class Regex { /** * Finds next match and returns the matched string
* @ param in
* @ param size
* @ return Matched string
* @ throws IOException
* @ throws SyntaxErrorException */
public String find ( PushbackReader in , int size ) throws IOException , SyntaxErrorException { } } | if ( acceptEmpty ) { throw new IllegalArgumentException ( "using find for '" + expression + "' that accepts empty string" ) ; } InputReader reader = Input . getInstance ( in , size ) ; int rc = find ( reader ) ; reader . release ( ) ; if ( rc == 1 ) { return reader . getString ( ) ; } else { throw new SyntaxErrorExce... |
public class ClustersInner { /** * Lists all the HDInsight clusters under the subscription .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList & lt ; Clus... | return listNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < ClusterInner > > , Page < ClusterInner > > ( ) { @ Override public Page < ClusterInner > call ( ServiceResponse < Page < ClusterInner > > response ) { return response . body ( ) ; } } ) ; |
public class UserEntryScreen { /** * Add all the screen listeners . */
public void addListeners ( ) { } } | String strMessage = "Create new user account" ; String strTerms = this . getProperty ( "terms" ) ; // Terms resource EY
if ( strTerms == null ) strTerms = "terms" ; if ( this . getTask ( ) != null ) if ( this . getTask ( ) . getApplication ( ) != null ) { BaseApplication application = ( BaseApplication ) this . getTask... |
public class PathParamSerializers { /** * Create a PathParamSerializer for List parameters . */
public static < Param > PathParamSerializer < List < Param > > list ( String name , Function < PSequence < String > , Param > deserialize , Function < Param , PSequence < String > > serialize ) { } } | return new NamedPathParamSerializer < List < Param > > ( "List(" + name + ")" ) { @ Override public PSequence < String > serialize ( List < Param > parameter ) { List < String > serializedParams = serializeCollection ( parameter , serialize ) . collect ( Collectors . toList ( ) ) ; return TreePVector . from ( serialize... |
public class ShowImages { /** * Shows a set of images in a grid pattern .
* @ param numColumns How many columns are in the grid
* @ param title Number of the window
* @ param images List of images to show
* @ return Display panel */
public static ImageGridPanel showGrid ( int numColumns , String title , Buffere... | JFrame frame = new JFrame ( title ) ; int numRows = images . length / numColumns + images . length % numColumns ; ImageGridPanel panel = new ImageGridPanel ( numRows , numColumns , images ) ; frame . add ( panel , BorderLayout . CENTER ) ; frame . pack ( ) ; frame . setVisible ( true ) ; return panel ; |
public class ParserBase { /** * Returns < code > true < / code > if the supplied < code > file < / code > is a valid zip and contains at least one entry of each of the supplied < code > fileTypes < / code > .
* @ param file The zip file to check
* @ param fileTypes The types of files to look for
* @ return < code... | // It must be a zip file with an XML file at it ' s root and a properties file in it
if ( ! file . getName ( ) . endsWith ( ".zip" ) ) { return false ; } ZipFile zip = null ; try { zip = new ZipFile ( file ) ; boolean [ ] foundFileTypes = new boolean [ fileTypes . length ] ; boolean foundAll = false ; Enumeration < ? e... |
public class FlashImpl { /** * Convert the Object to a Boolean .
* @ param value
* @ return */
private Boolean _convertToBoolean ( Object value ) { } } | Boolean booleanValue ; if ( value instanceof Boolean ) { booleanValue = ( Boolean ) value ; } else { booleanValue = Boolean . parseBoolean ( value . toString ( ) ) ; } return booleanValue ; |
public class AbstractMethod { /** * Utility method for obtaining an appropriate { @ link AuthMethod } for this call .
* @ param acceptableAuthMethods an array of classes , representing authentication methods that are acceptable for
* this endpoint
* @ return An AuthMethod created from one of the provided acceptab... | if ( acceptable == null ) { this . acceptable = new HashSet < > ( ) ; Collections . addAll ( acceptable , acceptableAuthMethods ) ; } return this . httpWrapper . getAuthCollection ( ) . getAcceptableAuthMethod ( acceptable ) ; |
public class Record { /** * Get the table for this record .
* This is the same as getFieldTable , but casts the class up .
* @ return The table for this record . */
public BaseTable getTable ( ) { } } | BaseTable table = ( BaseTable ) super . getTable ( ) ; if ( table == null ) // It ' s possible that m _ table was set in an overriding init method .
{ DatabaseOwner databaseOwner = null ; if ( this . getRecordOwner ( ) != null ) databaseOwner = this . getRecordOwner ( ) . getDatabaseOwner ( ) ; if ( databaseOwner != nu... |
public class AddOn { /** * Calculates the requirements to run this add - on , in the current ZAP and Java versions and with the given
* { @ code availableAddOns } .
* If the add - on depends on other add - ons , those add - ons are also checked if are also runnable .
* < strong > Note : < / strong > All the given... | AddOnRunRequirements requirements = new AddOnRunRequirements ( this ) ; calculateRunRequirementsImpl ( availableAddOns , requirements , null , this ) ; if ( requirements . isRunnable ( ) ) { checkExtensionsWithDeps ( availableAddOns , requirements , this ) ; } return requirements ; |
public class ObfuscatUtil { /** * Compute the the hash value for the String .
* @ param passwd
* the password String
* @ return
* the Hash digest byte .
* @ throws NoSuchAlgorithmException
* the NoSuchAlgorithmException . */
public static byte [ ] computeHash ( String passwd ) throws NoSuchAlgorithmExceptio... | java . security . MessageDigest md = java . security . MessageDigest . getInstance ( "SHA-1" ) ; md . reset ( ) ; md . update ( passwd . getBytes ( ) ) ; return md . digest ( ) ; |
public class JobEndNotifier { /** * simple synchronous way */
public static void localRunnerNotification ( JobConf conf , JobStatus status ) { } } | JobEndStatusInfo notification = createNotification ( conf , status ) ; if ( notification != null ) { while ( notification . configureForRetry ( ) ) { try { int code = httpNotification ( notification . getUri ( ) ) ; if ( code != 200 ) { throw new IOException ( "Invalid response status code: " + code ) ; } else { break ... |
public class ScheduleExpressionParser { /** * Parses a single value at the current position in the parse string .
* Whitespace before the value is not skipped . A " single value " is defined
* per the spec and includes :
* < ul >
* < li > Non - negative integers within the attribute ' s range . The return
* v... | if ( ivPos < ivString . length ( ) && ivString . charAt ( ivPos ) == '*' ) { ivPos ++ ; return ENCODED_WILD_CARD ; } int begin = scanToken ( ) ; String [ ] namedValues = ivAttr . getNamedValues ( ) ; int result = namedValues == null ? - 1 : findNamedValue ( begin , namedValues , ivAttr . getMin ( ) ) ; if ( result == -... |
public class PdfOutline { /** * Returns the PDF representation of this < CODE > PdfOutline < / CODE > .
* @ param writer the encryption information
* @ param os
* @ throws IOException */
public void toPdf ( PdfWriter writer , OutputStream os ) throws IOException { } } | if ( color != null && ! color . equals ( Color . black ) ) { put ( PdfName . C , new PdfArray ( new float [ ] { color . getRed ( ) / 255f , color . getGreen ( ) / 255f , color . getBlue ( ) / 255f } ) ) ; } int flag = 0 ; if ( ( style & Font . BOLD ) != 0 ) flag |= 2 ; if ( ( style & Font . ITALIC ) != 0 ) flag |= 1 ; ... |
public class MicroMetaDao { /** * 锟斤拷荼锟斤拷锟斤拷询锟斤拷录锟斤拷 */
public int queryObjCountByCondition ( String tableName , String condition ) { } } | /* JdbcTemplate jdbcTemplate = ( JdbcTemplate ) MicroDbHolder
. getDbSource ( dbName ) ; */
// String tableName = changeTableNameCase ( otableName ) ;
JdbcTemplate jdbcTemplate = getMicroJdbcTemplate ( ) ; String sql = "" ; sql = "select count(1) from " + tableName + " where " + condition ; logger . debug ( sql ) ; I... |
public class BaseMultifactorAuthenticationProviderBypass { /** * Evaluate attribute rules for bypass .
* @ param attrName the attr name
* @ param attrValue the attr value
* @ param attributes the attributes
* @ param matchIfNoValueProvided the force match on value
* @ return true a matching attribute name / v... | LOGGER . debug ( "Locating matching attribute [{}] with value [{}] amongst the attribute collection [{}]" , attrName , attrValue , attributes ) ; if ( StringUtils . isBlank ( attrName ) ) { LOGGER . debug ( "Failed to match since attribute name is undefined" ) ; return false ; } val names = attributes . entrySet ( ) . ... |
public class ObjectMetadata { /** * Gets the Content - Length HTTP header indicating the size of the
* associated object in bytes .
* This field is required when uploading objects to S3 , but the AWS S3 Java
* client will automatically set it when working directly with files . When
* uploading directly from a s... | Long contentLength = ( Long ) metadata . get ( Headers . CONTENT_LENGTH ) ; if ( contentLength == null ) return 0 ; return contentLength . longValue ( ) ; |
public class PhiAccrualFailureDetector { /** * Compute phi for the specified node id .
* @ return phi value */
public double phi ( ) { } } | long latestHeartbeat = history . latestHeartbeatTime ( ) ; DescriptiveStatistics samples = history . samples ( ) ; if ( samples . getN ( ) < minSamples ) { return 0.0 ; } return computePhi ( samples , latestHeartbeat , System . currentTimeMillis ( ) ) ; |
public class Quicksort { /** * Sort the list in ascending order using this algorithm .
* @ param < E > the type of elements in this list .
* @ param list the list that we want to sort */
public static < E extends Comparable < E > > void sort ( List < E > list ) { } } | Quicksort . sort ( list , 0 , list . size ( ) - 1 , false ) ; |
public class SiteTracker { /** * An array per up host , there will be no entry for this host */
public long [ ] [ ] getRemoteSites ( ) { } } | int localhost = VoltDB . instance ( ) . getHostMessenger ( ) . getHostId ( ) ; long [ ] [ ] retval = new long [ m_allHostsImmutable . size ( ) - 1 ] [ ] ; int i = 0 ; for ( int host : m_allHostsImmutable ) { if ( host != localhost ) { retval [ i ++ ] = longListToArray ( m_hostsToSitesImmutable . get ( host ) ) ; } } re... |
public class JDBCUtilities { /** * Return true if table tableName contains field fieldName .
* @ param connection Connection
* @ param tableName Table name
* @ param fieldName Field name
* @ return True if the table contains the field
* @ throws SQLException */
public static boolean hasField ( Connection conn... | final Statement statement = connection . createStatement ( ) ; try { final ResultSet resultSet = statement . executeQuery ( "SELECT * FROM " + TableLocation . parse ( tableName ) + " LIMIT 0;" ) ; try { return hasField ( resultSet . getMetaData ( ) , fieldName ) ; } finally { resultSet . close ( ) ; } } catch ( SQLExce... |
public class OptimizationPlan { /** * Adds rules for converting { @ code source } to { @ code dest } .
* A rule for every combination of flipped / unflipped commutative operations added .
* @ param source source pattern
* @ param dest destination pattern */
@ SuppressWarnings ( "ObjectAllocationInLoop" ) public v... | // amount of commutative nodes
int n = 0 ; for ( NodeBase node : source . getDescendants ( ) ) { if ( node instanceof CommutativeOperator ) { n ++ ; } } for ( int i = 0 ; i < 1 << n ; i ++ ) { Root root = new Root ( source . getClone ( ) ) ; int j = 0 ; for ( NodeBase node : root . getDescendants ( ) ) { if ( node inst... |
public class CpnlElFunctions { /** * Replaces all ' href ' attribute values found in the text value by the resolver mapped value .
* @ param request the text ( rich text ) value
* @ param value the text ( rich text ) value
* @ return the transformed text value */
public static String map ( SlingHttpServletRequest... | StringBuilder result = new StringBuilder ( ) ; Matcher matcher = HREF_PATTERN . matcher ( value ) ; int len = value . length ( ) ; int pos = 0 ; while ( matcher . find ( pos ) ) { String unmapped = matcher . group ( 3 ) ; String mapped = url ( request , unmapped ) ; result . append ( value , pos , matcher . start ( ) )... |
public class CmsJspTagDisplay { /** * Sets the items . < p >
* @ param displayFormatters the items to set */
public void setDisplayFormatters ( Object displayFormatters ) { } } | if ( displayFormatters instanceof List ) { for ( Object formatterItem : ( ( List < ? > ) displayFormatters ) ) { if ( formatterItem instanceof CmsJspContentAccessValueWrapper ) { addFormatter ( ( CmsJspContentAccessValueWrapper ) formatterItem ) ; } } } else if ( displayFormatters instanceof CmsJspContentAccessValueWra... |
public class ServerDnsAliasesInner { /** * Gets a server DNS alias .
* @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal .
* @ param serverName The name of the server that the alias is pointing to .
* @... | return getWithServiceResponseAsync ( resourceGroupName , serverName , dnsAliasName ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class RenderUtils { /** * Render a generic object , returning the corresponding HTML string . Works for null objects ,
* RDF { @ code Value } s , { @ code Record } s , { @ code BindingSet } s and { @ code Iterable } s of the
* former .
* @ param object
* the object to render .
* @ return the rendered H... | try { final StringBuilder builder = new StringBuilder ( ) ; render ( object , builder ) ; return builder . toString ( ) ; } catch ( final IOException ex ) { throw new Error ( ex ) ; // should not happen
} |
public class CmsVfsBundleManager { /** * Adds a resource bundle based on a properties file in the VFS . < p >
* @ param bundleResource the properties file */
private void addPropertyBundle ( CmsResource bundleResource ) { } } | NameAndLocale nameAndLocale = getNameAndLocale ( bundleResource ) ; Locale locale = nameAndLocale . getLocale ( ) ; String baseName = nameAndLocale . getName ( ) ; m_bundleBaseNames . add ( baseName ) ; LOG . info ( String . format ( "Adding property VFS bundle (path=%s, name=%s, locale=%s)" , bundleResource . getRootP... |
public class CmsResourceTreeContainer { /** * Fills the properties of a tree item . < p >
* @ param cms the CMS context
* @ param resourceItem the empty item
* @ param resource the resource for which the tree item is being created
* @ param parentId the parent id */
protected void fillProperties ( CmsObject cms... | resourceItem . getItemProperty ( PROPERTY_RESOURCE ) . setValue ( resource ) ; // use the root path as name in case of the root item
String name = getName ( cms , resource , parentId ) ; if ( resource . isFolder ( ) && ! name . endsWith ( "/" ) ) { name += "/" ; } CmsResourceUtil resUtil = new CmsResourceUtil ( cms , r... |
public class ArrayMath { /** * Computes 2 - norm of vector
* @ param a A vector of double
* @ return Euclidean norm of a */
public static double norm ( double [ ] a ) { } } | double squaredSum = 0 ; for ( double anA : a ) { squaredSum += anA * anA ; } return Math . sqrt ( squaredSum ) ; |
public class Exceptions { /** * Throws the given exception and sneaks it through any compiler checks . This
* allows to throw checked exceptions without the need to declare it .
* Clients should use the following idiom to trick static analysis and dead code checks :
* < pre >
* throw sneakyThrow ( new CheckedEx... | if ( t == null ) throw new NullPointerException ( "t" ) ; Exceptions . < RuntimeException > sneakyThrow0 ( t ) ; return null ; |
public class BasicBondGenerator { /** * Determine the ring set for this atom container .
* @ param atomContainer the atom container to find rings in .
* @ return the rings of the molecule */
protected IRingSet getRingSet ( IAtomContainer atomContainer ) { } } | IRingSet ringSet = atomContainer . getBuilder ( ) . newInstance ( IRingSet . class ) ; try { IAtomContainerSet molecules = ConnectivityChecker . partitionIntoMolecules ( atomContainer ) ; for ( IAtomContainer mol : molecules . atomContainers ( ) ) { ringSet . add ( Cycles . sssr ( mol ) . toRingSet ( ) ) ; } return rin... |
public class ParameterizedTypeReference { /** * / * @ Nullable */
private LightweightTypeReference getSuperTypeByName ( String typeName , boolean interfaceType ) { } } | JvmTypeReference superType = getSuperTypeByName ( typeName , interfaceType , type , new RecursionGuard < JvmType > ( ) ) ; if ( superType != null ) { JvmType rawType = superType . getType ( ) ; if ( isRawType ( ) ) { return createRawTypeReference ( rawType ) ; } if ( superType . eClass ( ) == TypesPackage . Literals . ... |
public class XmlErrorHandler { /** * Adds a validation error based on a < code > SAXParseException < / code > .
* @ param severity
* the severity of the error
* @ param spex
* the < code > SAXParseException < / code > raised while validating the
* XML source */
private void addError ( short severity , SAXPars... | if ( spex . getLineNumber ( ) > 0 ) { buf . append ( "Line " + spex . getLineNumber ( ) + " - " ) ; } buf . append ( spex . getMessage ( ) + "\n" ) ; ValidationError error = new ValidationError ( severity , buf . toString ( ) ) ; errors . add ( error ) ; buf . setLength ( 0 ) ; |
public class ELTools { /** * Returns a list of String denoting every primitively typed property of a certain bean .
* @ param p _ expression
* The EL expression describing the bean . The EL expression is passed without the leading " # { " and the
* trailing brace " } " .
* @ param p _ recursive
* if true , th... | synchronized ( propertyLists ) { if ( propertyLists . containsKey ( p_expression ) ) { return propertyLists . get ( p_expression ) ; } } Object container = evalAsObject ( "#{" + p_expression + "}" ) ; Class < ? extends Object > c = container == null ? null : container . getClass ( ) ; List < String > propertyNames = ne... |
public class Pointer { /** * Creates a new Pointer to the given buffer . < br / >
* < br / >
* Note that this method takes into account the array offset and position
* of the given buffer , in contrast to the { @ link # to ( Buffer ) } method .
* @ param buffer The buffer
* @ return The new pointer
* @ thro... | if ( buffer == null || ( ! buffer . isDirect ( ) && ! buffer . hasArray ( ) ) ) { throw new IllegalArgumentException ( "Buffer may not be null and must have an array or be direct" ) ; } if ( buffer instanceof ByteBuffer ) { return computePointer ( ( ByteBuffer ) buffer ) ; } if ( buffer instanceof ShortBuffer ) { retur... |
public class BigDecimalUtil { /** * Returns a value rounded - up to p digits after decimal .
* If p is negative , then the number is rounded to
* places to the left of the decimal point . eg .
* 10.23 rounded to - 1 will give : 20 . If p is zero ,
* the returned value is rounded to the nearest integral
* valu... | if ( n == null ) { return null ; } final int scale = n . scale ( ) ; return BigDecimalUtil . setScale ( BigDecimal . valueOf ( roundUp ( n . doubleValue ( ) , p ) ) , scale ) ; |
public class NamedEventManager { /** * Retrieves the short name for an event class , according to spec rules .
* @ param cls the class to find the short name for .
* @ return a String containing the short name for the given class . */
private String getFixedName ( Class < ? extends ComponentSystemEvent > cls ) { } ... | StringBuilder result = new StringBuilder ( ) ; String className ; // Get the unqualified class name .
className = cls . getSimpleName ( ) ; // Strip the trailing " event " off the class name if present .
if ( className . toLowerCase ( ) . endsWith ( "event" ) ) { className = className . substring ( 0 , result . length ... |
public class BranchUniversalObject { /** * Method to report user actions happened on this BUO . Use this method to report the user actions for analytics purpose .
* @ param action A { @ link String } with value of user action name . See { @ link BranchEvent } for Branch defined user events .
* @ param metadata A Ha... | JSONObject actionCompletedPayload = new JSONObject ( ) ; try { JSONArray canonicalIDList = new JSONArray ( ) ; canonicalIDList . put ( canonicalIdentifier_ ) ; actionCompletedPayload . put ( canonicalIdentifier_ , convertToJson ( ) ) ; if ( metadata != null ) { for ( String key : metadata . keySet ( ) ) { actionComplet... |
public class UriBuilder { /** * Returns whether the href is a JAX - RS template .
* @ param href the href to check
* @ return true if the href is templated , false otherwise */
static boolean jaxTemplate ( String href ) { } } | Matcher m = JAX_RS_TEMPLATE . matcher ( href ) ; return m . matches ( ) ; |
public class DatabaseInformationMain { /** * One time initialisation of instance attributes
* at construction time . < p > */
protected final void init ( ) { } } | ns = new DINameSpace ( database ) ; pi = new DIProcedureInfo ( ns ) ; // flag the Session - dependent cached tables
Table t ; for ( int i = 0 ; i < sysTables . length ; i ++ ) { t = sysTables [ i ] = generateTable ( i ) ; if ( t != null ) { t . setDataReadOnly ( true ) ; } } GranteeManager gm = database . getGranteeMan... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.