signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Update { /** * The update is done without calling triggers and check of access rights .
* @ throws EFapsException if update not possible ( unique key , object does
* not exists , etc . . . ) */
public void executeWithoutTrigger ( ) throws EFapsException { } } | if ( Update . STATUSOK . getStati ( ) . isEmpty ( ) ) { final Context context = Context . getThreadContext ( ) ; ConnectionResource con = null ; try { con = context . getConnectionResource ( ) ; for ( final Entry < SQLTable , List < Value > > entry : this . table2values . entrySet ( ) ) { final SQLUpdate update = Conte... |
public class KNXnetIPDevMgmt { /** * / * ( non - Javadoc )
* @ see tuwien . auto . calimero . knxnetip . ConnectionImpl # handleService
* ( tuwien . auto . calimero . knxnetip . servicetype . KNXnetIPHeader , byte [ ] , int ) */
void handleService ( KNXnetIPHeader h , byte [ ] data , int offset ) throws KNXFormatEx... | final int svc = h . getServiceType ( ) ; if ( svc == KNXnetIPHeader . DEVICE_CONFIGURATION_REQ ) { ServiceRequest req ; try { req = PacketHelper . getServiceRequest ( h , data , offset ) ; } catch ( final KNXFormatException e ) { // try to get at least the connection header of the service request
req = PacketHelper . g... |
public class MemberMethod { /** * { @ inheritDoc } */
@ Override public Type getGenericType ( ) { } } | Type resultType ; if ( CheckUtil . checkBounds ( this . param , this . method . getGenericParameterTypes ( ) ) ) { resultType = this . method . getGenericParameterTypes ( ) [ this . param ] ; } else { resultType = this . method . getGenericReturnType ( ) ; } return resultType ; |
public class OqlBuilder { /** * from .
* @ param from a { @ link java . lang . String } object .
* @ param < E > a E object .
* @ return a { @ link org . beangle . commons . dao . query . builder . OqlBuilder } object . */
public static < E > OqlBuilder < E > from ( final String from ) { } } | OqlBuilder < E > query = new OqlBuilder < E > ( ) ; query . newFrom ( from ) ; return query ; |
public class Widget { /** * Add another { @ link Widget } as a child of this one .
* A { @ link GVRSceneObject } other than the one directly managed by the child
* { @ code Widget } can be specified as the child ' s root . This is useful in
* cases where the parent object needs to insert additional scene objects ... | final boolean added = addChildInner ( child , childRootSceneObject , index ) ; Log . d ( Log . SUBSYSTEM . WIDGET , TAG , "addChild [%s] %b" , child , added ) ; if ( added ) { onTransformChanged ( ) ; if ( ! preventLayout ) { invalidateAllLayouts ( ) ; requestLayout ( ) ; } } return added ; |
public class JsonUtil { /** * Returns a field in a Json object as a boolean .
* Throws IllegalArgumentException if the field value is null .
* @ param object the Json Object
* @ param field the field in the Json object to return
* @ return the Json field value as a boolean */
public static boolean getBoolean ( ... | final JsonValue value = object . get ( field ) ; throwExceptionIfNull ( value , field ) ; return value . asBoolean ( ) ; |
public class CloudInstanceController { /** * Cloud Instance Endpoints */
@ RequestMapping ( value = "/cloud/instance/refresh" , method = POST , consumes = APPLICATION_JSON_VALUE , produces = APPLICATION_JSON_VALUE ) public ResponseEntity < Collection < String > > refreshInstances ( @ Valid @ RequestBody ( required = fa... | return ResponseEntity . ok ( ) . body ( cloudInstanceService . refreshInstances ( request ) ) ; |
public class CompressUtil { /** * compress a source file / directory to a tar / bzip2 file
* @ param sources
* @ param target
* @ param mode
* @ throws IOException */
private static void compressTBZ2 ( Resource [ ] sources , Resource target , int mode ) throws IOException { } } | // File tmpTarget = File . createTempFile ( " _ temp " , " tmp " ) ;
ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; compressTar ( sources , baos , mode ) ; _compressBZip2 ( new ByteArrayInputStream ( baos . toByteArray ( ) ) , target . getOutputStream ( ) ) ; // tmpTarget . delete ( ) ; |
public class RequestXmlFactory { /** * Converts the specified list of PartETags to an XML fragment that can be
* sent to the CompleteMultipartUpload operation of Amazon S3.
* @ param partETags
* The list of part ETags containing the data to include in the
* new XML fragment .
* @ return A byte array containin... | XmlWriter xml = new XmlWriter ( ) ; xml . start ( "CompleteMultipartUpload" ) ; if ( partETags != null ) { List < PartETag > sortedPartETags = new ArrayList < PartETag > ( partETags ) ; Collections . sort ( sortedPartETags , new Comparator < PartETag > ( ) { public int compare ( PartETag tag1 , PartETag tag2 ) { if ( t... |
public class SessionNode { /** * Get the segment for this node .
* @ param cache the cache
* @ param parent the parent node
* @ return the segment
* @ throws NodeNotFoundInParentException if the node doesn ' t exist in the referenced parent */
protected final Segment getSegment ( NodeCache cache , CachedNode pa... | if ( parent != null ) { ChildReference ref = parent . getChildReferences ( cache ) . getChild ( key ) ; if ( ref == null ) { // This node doesn ' t exist in the parent
throw new NodeNotFoundInParentException ( key , parent . getKey ( ) ) ; } return ref . getSegment ( ) ; } // This is the root node . . .
return workspac... |
public class CmsWorkplace { /** * Generates a variable button bar separator line . < p >
* @ param leftPixel the amount of pixel left to the line
* @ param rightPixel the amount of pixel right to the line
* @ param className the css class name for the formatting
* @ return a variable button bar separator line *... | StringBuffer result = new StringBuffer ( 512 ) ; if ( leftPixel > 0 ) { result . append ( buttonBarLineSpacer ( leftPixel ) ) ; } result . append ( "<td><span class=\"" ) ; result . append ( className ) ; result . append ( "\"></span></td>\n" ) ; if ( rightPixel > 0 ) { result . append ( buttonBarLineSpacer ( rightPixe... |
public class RedBlackTreeInteger { /** * Remove the given key . The key MUST exists , else the tree won ' t be valid anymore . */
public void removeKey ( int key ) { } } | if ( key == first . value ) { removeMin ( ) ; return ; } if ( key == last . value ) { removeMax ( ) ; return ; } // if both children of root are black , set root to red
if ( ( root . left == null || ! root . left . red ) && ( root . right == null || ! root . right . red ) ) root . red = true ; root = removeKey ( root ,... |
public class AntPathMatcher { /** * Tests whether or not a string matches against a pattern . The pattern may contain two special characters : < br > ' * '
* means zero or more characters < br > ' ? ' means one and only one character
* @ param pattern pattern to match against . Must not be < code > null < / code > ... | AntPathStringMatcher matcher = new AntPathStringMatcher ( pattern , str , uriTemplateVariables ) ; return matcher . matchStrings ( ) ; |
public class ConfigClient { /** * Deletes an exclusion .
* < p > Sample code :
* < pre > < code >
* try ( ConfigClient configClient = ConfigClient . create ( ) ) {
* ExclusionName name = ProjectExclusionName . of ( " [ PROJECT ] " , " [ EXCLUSION ] " ) ;
* configClient . deleteExclusion ( name ) ;
* < / cod... | DeleteExclusionRequest request = DeleteExclusionRequest . newBuilder ( ) . setName ( name == null ? null : name . toString ( ) ) . build ( ) ; deleteExclusion ( request ) ; |
public class CxxAstScanner { /** * Helper method for scanning a single file
* @ param file is the file to be checked
* @ param cxxConfig the plugin configuration
* @ param visitors AST checks and visitors to use
* @ param language for sensor
* @ return file checked with measures and issues */
public static So... | if ( ! file . isFile ( ) ) { throw new IllegalArgumentException ( "File '" + file + "' not found." ) ; } AstScanner < Grammar > scanner = create ( language , cxxConfig , visitors ) ; scanner . scanFile ( file . file ( ) ) ; Collection < SourceCode > sources = scanner . getIndex ( ) . search ( new QueryByType ( SourceFi... |
public class AbstractAggregatorImpl { /** * Returns the content type string for the specified filename based on the filename ' s extension .
* Uses use both MimetypeFileTypeMap and FileNameMap ( from URLConnection ) because
* MimetypeFileTypeMap provides a convenient way for the application to add new mappings , bu... | String contentType = DEFAULT_CONTENT_TYPE ; if ( fileTypeMap != null ) { contentType = fileTypeMap . getContentType ( filename ) ; } if ( DEFAULT_CONTENT_TYPE . equals ( contentType ) && fileNameMap != null ) { String test = fileNameMap . getContentTypeFor ( filename ) ; if ( test != null ) { contentType = test ; } } r... |
public class AbstractRuleImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } } | switch ( featureID ) { case XtextPackage . ABSTRACT_RULE__NAME : setName ( NAME_EDEFAULT ) ; return ; case XtextPackage . ABSTRACT_RULE__TYPE : setType ( ( TypeRef ) null ) ; return ; case XtextPackage . ABSTRACT_RULE__ALTERNATIVES : setAlternatives ( ( AbstractElement ) null ) ; return ; case XtextPackage . ABSTRACT_R... |
public class SessionEntityTypesClient { /** * Creates a session entity type .
* < p > If the specified session entity type already exists , overrides the session entity type .
* < p > Sample code :
* < pre > < code >
* try ( SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient . create (... | CreateSessionEntityTypeRequest request = CreateSessionEntityTypeRequest . newBuilder ( ) . setParent ( parent == null ? null : parent . toString ( ) ) . setSessionEntityType ( sessionEntityType ) . build ( ) ; return createSessionEntityType ( request ) ; |
public class HessianProxyFactory { /** * JNDI object factory so the proxy can be used as a resource . */
public Object getObjectInstance ( Object obj , Name name , Context nameCtx , Hashtable < ? , ? > environment ) throws Exception { } } | Reference ref = ( Reference ) obj ; String api = null ; String url = null ; for ( int i = 0 ; i < ref . size ( ) ; i ++ ) { RefAddr addr = ref . get ( i ) ; String type = addr . getType ( ) ; String value = ( String ) addr . getContent ( ) ; if ( type . equals ( "type" ) ) api = value ; else if ( type . equals ( "url" ... |
public class ASTHelper { /** * Creates a { @ link FieldDeclaration } .
* @ param modifiers
* modifiers
* @ param type
* type
* @ param variable
* variable declarator
* @ return instance of { @ link FieldDeclaration } */
public static FieldDeclaration createFieldDeclaration ( int modifiers , Type type , Va... | List < VariableDeclarator > variables = new ArrayList < VariableDeclarator > ( ) ; variables . add ( variable ) ; FieldDeclaration ret = new FieldDeclaration ( modifiers , type , variables ) ; return ret ; |
public class DevicesInner { /** * Uploads registration certificate for the device .
* @ param deviceName The device name .
* @ param resourceGroupName The resource group name .
* @ param parameters The upload certificate request .
* @ param serviceCallback the async ServiceCallback to handle successful and fail... | return ServiceFuture . fromResponse ( uploadCertificateWithServiceResponseAsync ( deviceName , resourceGroupName , parameters ) , serviceCallback ) ; |
public class UACRegisterSipServlet { /** * ( non - Javadoc )
* @ see javax . servlet . sip . SipServletListener # servletInitialized ( javax . servlet . sip . SipServletContextEvent ) */
public void servletInitialized ( SipServletContextEvent ce ) { } } | ServletContext servletContext = ce . getServletContext ( ) ; SipFactory sipFactory = ( SipFactory ) servletContext . getAttribute ( SIP_FACTORY ) ; String userName = servletContext . getInitParameter ( "user.name" ) ; String domainName = servletContext . getInitParameter ( "domain.name" ) ; SipApplicationSession sipApp... |
public class MonitorMethodInterceptorDefinitionDecorator { /** * Register a new PerformanceMonitor with Spring if it does not already exist .
* @ param beanName The name of the bean that this performance monitor is wrapped around
* @ param registry The registry where all the spring beans are registered */
private v... | String perfMonitorName = beanName + "PerformanceMonitor" ; if ( ! registry . containsBeanDefinition ( perfMonitorName ) ) { BeanDefinitionBuilder initializer = BeanDefinitionBuilder . rootBeanDefinition ( PerformanceMonitorBean . class ) ; registry . registerBeanDefinition ( perfMonitorName , initializer . getBeanDefin... |
public class BaseGridTableScreen { /** * Create a data entry screen with this main record .
* ( null means use this screen ' s grid record )
* @ param record The main record for the new form .
* @ param iDocMode The document type of the new form .
* @ param bReadCurrentRecord Sync the new screen with my current... | if ( record == null ) record = this . getMainRecord ( ) ; if ( record == this . getMainRecord ( ) ) { try { int iSelection = this . getScreenFieldView ( ) . getSelectedRow ( ) ; if ( iSelection != - 1 ) { Record recAtTarget = null ; this . finalizeThisScreen ( ) ; // Validate current control , update record , get ready... |
public class BootstrapProgressBar { /** * Starts an infinite animation cycle which provides the visual effect of stripes moving
* backwards . The current system time is used to offset tiled bitmaps of the progress background ,
* producing the effect that the stripes are moving backwards . */
private void startStrip... | if ( ! striped || ! animated ) { return ; } clearAnimation ( ) ; progressAnimator = ValueAnimator . ofFloat ( 0 , 0 ) ; progressAnimator . setDuration ( UPDATE_ANIM_MS ) ; progressAnimator . setRepeatCount ( ValueAnimator . INFINITE ) ; progressAnimator . setRepeatMode ( ValueAnimator . RESTART ) ; progressAnimator . s... |
public class DeleteFilesJob { /** * Deletes the files in the provided GoogleCloudStorageFileSet */
@ Override public Value < Void > run ( List < GcsFilename > files ) throws Exception { } } | for ( GcsFilename file : files ) { try { gcs . delete ( file ) ; } catch ( RetriesExhaustedException | IOException e ) { log . log ( Level . WARNING , "Failed to cleanup file: " + file , e ) ; } } return null ; |
public class ModelMapper { /** * Transform an organization from database model to client / server model
* @ param dbOrganization DbOrganization
* @ return Organization */
public Organization getOrganization ( final DbOrganization dbOrganization ) { } } | final Organization organization = DataModelFactory . createOrganization ( dbOrganization . getName ( ) ) ; organization . getCorporateGroupIdPrefixes ( ) . addAll ( dbOrganization . getCorporateGroupIdPrefixes ( ) ) ; return organization ; |
public class DaoTemplate { /** * 根据某个字段 ( 最好是唯一字段 ) 查询单个记录 < br >
* 当有多条返回时 , 只显示查询到的第一条
* @ param < T > 字段值类型
* @ param field 字段名
* @ param value 字段值
* @ return 记录
* @ throws SQLException SQL执行异常 */
public < T > Entity get ( String field , T value ) throws SQLException { } } | return this . get ( Entity . create ( tableName ) . set ( field , value ) ) ; |
public class JspConfigTypeImpl { /** * Returns all < code > jsp - property - group < / code > elements
* @ return list of < code > jsp - property - group < / code > */
public List < JspPropertyGroupType < JspConfigType < T > > > getAllJspPropertyGroup ( ) { } } | List < JspPropertyGroupType < JspConfigType < T > > > list = new ArrayList < JspPropertyGroupType < JspConfigType < T > > > ( ) ; List < Node > nodeList = childNode . get ( "jsp-property-group" ) ; for ( Node node : nodeList ) { JspPropertyGroupType < JspConfigType < T > > type = new JspPropertyGroupTypeImpl < JspConfi... |
public class EmbedBuilder { /** * Updates all fields of the embed that satisfy the given predicate using the given updater .
* @ param predicate The predicate that fields have to satisfy to get updated .
* @ param updater The updater for the fields ; the { @ code EditableEmbedField } is only valid during the run of... | delegate . updateFields ( predicate , updater ) ; return this ; |
public class OjbTagsHandler { /** * Processes the template for all reference definitions of the current class definition .
* @ param template The template
* @ param attributes The attributes of the tag
* @ exception XDocletException if an error occurs
* @ doc . tag type = " block " */
public void forAllReferenc... | for ( Iterator it = _curClassDef . getReferences ( ) ; it . hasNext ( ) ; ) { _curReferenceDef = ( ReferenceDescriptorDef ) it . next ( ) ; // first we check whether it is an inherited anonymous reference
if ( _curReferenceDef . isAnonymous ( ) && ( _curReferenceDef . getOwner ( ) != _curClassDef ) ) { continue ; } if ... |
public class DistanceFormatter { /** * Method that can be used to check if an instance of { @ link DistanceFormatter }
* needs to be updated based on the passed language / unitType .
* @ param language to check against the current formatter language
* @ param unitType to check against the current formatter unitTy... | return ! this . language . equals ( language ) || ! this . unitType . equals ( unitType ) || ! ( this . roundingIncrement == roundingIncrement ) ; |
public class CleverTapAPI { /** * Lifecycle */
private void activityResumed ( Activity activity ) { } } | getConfigLogger ( ) . verbose ( getAccountId ( ) , "App in foreground" ) ; checkTimeoutSession ( ) ; if ( ! isAppLaunchPushed ( ) ) { pushAppLaunchedEvent ( ) ; onTokenRefresh ( ) ; } if ( ! inCurrentSession ( ) ) { // onTokenRefresh ( ) ;
pushInitialEventsAsync ( ) ; } checkPendingInAppNotifications ( activity ) ; |
public class NameNameHtmlRenderer { /** * { @ inheritDoc } */
@ Override public final String getNameHtml ( ) { } } | final Name name = nameRenderer . getGedObject ( ) ; final StringBuilder builder = new StringBuilder ( 40 ) ; final String prefix = GedRenderer . escapeString ( name . getPrefix ( ) ) ; final String surname = GedRenderer . escapeString ( name . getSurname ( ) ) ; final String suffix = GedRenderer . escapeString ( name .... |
public class OSXAdapter { /** * See setFileHandler above for an example */
public boolean callTarget ( Object appleEvent ) throws InvocationTargetException , IllegalAccessException { } } | Object result = targetMethod . invoke ( targetObject , ( Object [ ] ) null ) ; if ( result == null ) { return true ; } return Boolean . valueOf ( result . toString ( ) ) . booleanValue ( ) ; |
public class DateUtils { /** * Sets the minute field to a date returning a new object .
* The original { @ code Date } is unchanged .
* @ param date the date , not null
* @ param amount the amount to set
* @ return a new { @ code Date } set with the specified value
* @ throws IllegalArgumentException if the d... | return set ( date , Calendar . MINUTE , amount ) ; |
public class TypeMappingsFactory { /** * Get the type id ( defined by this class ) for the given class .
* @ param classType Class to get type of .
* @ return Type id of class . */
public int getTypeId ( Class classType ) { } } | final Class origType = classType ; while ( null != classType ) { Integer typeObj = ( Integer ) _typeMap . get ( classType ) ; if ( null != typeObj ) { return typeObj . intValue ( ) ; } classType = classType . getSuperclass ( ) ; } // special check for blobs / clobs they are interfaces not derived from
if ( Blob . class... |
public class GrpcUtil { /** * Closes an InputStream , ignoring IOExceptions .
* This method exists because Guava ' s { @ code Closeables . closeQuietly ( ) } is beta . */
public static void closeQuietly ( @ Nullable InputStream message ) { } } | if ( message == null ) { return ; } try { message . close ( ) ; } catch ( IOException ioException ) { // do nothing except log
log . log ( Level . WARNING , "exception caught in closeQuietly" , ioException ) ; } |
public class SRE { /** * Replies all the installed SRE into the class path .
* @ param onlyInstalledInJRE indicates if the services will be considered only into the libraries that are
* installed into the JRE . If { @ code true } , only the libraries into the JRE will be considered and
* the application libraries... | synchronized ( SRE . class ) { ServiceLoader < SREBootstrap > sl = loader == null ? null : loader . get ( ) ; if ( sl == null ) { if ( onlyInstalledInJRE ) { sl = ServiceLoader . loadInstalled ( SREBootstrap . class ) ; } else { sl = ServiceLoader . load ( SREBootstrap . class ) ; } loader = new SoftReference < > ( sl ... |
public class GitHubClientCacheOps { /** * Removes directories with caches
* @ param caches paths to directories to be removed */
private static void deleteEveryIn ( DirectoryStream < Path > caches ) { } } | for ( Path notActualCache : caches ) { LOGGER . debug ( "Deleting redundant cache dir {}" , notActualCache ) ; try { FileUtils . deleteDirectory ( notActualCache . toFile ( ) ) ; } catch ( IOException e ) { LOGGER . error ( "Can't delete cache dir <{}>" , notActualCache , e ) ; } } |
public class BraveTracerFactory { /** * The Open Tracing { @ link Tracer } bean .
* @ param tracing The { @ link Tracing } bean
* @ return The Open Tracing { @ link Tracer } bean */
@ Singleton @ Requires ( classes = { } } | BraveTracer . class , Tracer . class } ) @ Primary Tracer braveTracer ( Tracing tracing ) { BraveTracer braveTracer = BraveTracer . create ( tracing ) ; if ( ! GlobalTracer . isRegistered ( ) ) { GlobalTracer . register ( braveTracer ) ; } return braveTracer ; |
public class UserSeedChangeListener { /** * Will notify all the registered listeners about the event
* @ param user The target user */
public static void fireUserSeedRenewed ( @ Nonnull User user ) { } } | for ( UserSeedChangeListener l : all ( ) ) { try { l . onUserSeedRenewed ( user ) ; } catch ( Exception e ) { LOGGER . log ( Level . WARNING , "Exception caught during onUserSeedRenewed event" , e ) ; } } |
public class HttpClient { /** * Performs multipart post
* @ param url
* @ param map
* @ throws Exception */
public void postMultipart ( String url , Map < String , String > map ) throws Exception { } } | String boundaryStr = "-----boundary0" ; StringBuilder sb = new StringBuilder ( ) ; map . forEach ( ( k , v ) -> { sb . append ( boundaryStr + "\r" ) ; sb . append ( "Content-Disposition: form-data; name=\"" + k + "\"\r" ) ; sb . append ( "\r" ) ; sb . append ( v ) ; sb . append ( "\r" ) ; } ) ; String request = "POST "... |
public class DebugPseudoAtom { /** * { @ inheritDoc } */
@ Override public void setPoint2d ( Point2d point2d ) { } } | logger . debug ( "Setting point2d: x=" + point2d . x + ", y=" + point2d . y ) ; super . setPoint2d ( point2d ) ; |
public class IndyGuardsFiltersAndSignatures { /** * This method is called by he handle to realize the bean constructor
* with property map . */
public static Object setBeanProperties ( MetaClass mc , Object bean , Map properties ) { } } | for ( Iterator iter = properties . entrySet ( ) . iterator ( ) ; iter . hasNext ( ) ; ) { Map . Entry entry = ( Map . Entry ) iter . next ( ) ; String key = entry . getKey ( ) . toString ( ) ; Object value = entry . getValue ( ) ; mc . setProperty ( bean , key , value ) ; } return bean ; |
public class CpCommand { /** * Preserves attributes from the source file to the target file .
* @ param srcPath the source path
* @ param dstPath the destination path in the Alluxio filesystem */
private void preserveAttributes ( AlluxioURI srcPath , AlluxioURI dstPath ) throws IOException , AlluxioException { } } | if ( mPreservePermissions ) { URIStatus srcStatus = mFileSystem . getStatus ( srcPath ) ; mFileSystem . setAttribute ( dstPath , SetAttributePOptions . newBuilder ( ) . setOwner ( srcStatus . getOwner ( ) ) . setGroup ( srcStatus . getGroup ( ) ) . setMode ( new Mode ( ( short ) srcStatus . getMode ( ) ) . toProto ( ) ... |
public class ExtractorUtils { /** * Naive implementation of the difference in days between two dates */
private static long daysBetween ( Date date1 , Date date2 ) { } } | long diff ; if ( date2 . after ( date1 ) ) { diff = date2 . getTime ( ) - date1 . getTime ( ) ; } else { diff = date1 . getTime ( ) - date2 . getTime ( ) ; } return diff / ( 24 * 60 * 60 * 1000 ) ; |
public class UpdatePreferencesServlet { /** * Update the user ' s preferred skin .
* @ param request HTTP Request
* @ param skinName name of the Skin
* @ throws IOException
* @ throws PortalException */
@ RequestMapping ( method = RequestMethod . POST , params = "action=chooseSkin" ) public ModelAndView chooseS... | this . stylesheetUserPreferencesService . setStylesheetParameter ( request , PreferencesScope . THEME , "skin" , skinName ) ; return new ModelAndView ( "jsonView" , Collections . emptyMap ( ) ) ; |
public class JCRStoreResource { /** * The method is called from the transaction manager if the complete
* transaction is completed . < br / >
* @ param _ xid global transaction identifier ( not used , because each
* file with the file id gets a new VFS store resource
* instance )
* @ param _ onePhase < i > tr... | try { if ( getSession ( ) . hasPendingChanges ( ) ) { getSession ( ) . save ( ) ; } getSession ( ) . logout ( ) ; } catch ( final AccessDeniedException e ) { throw new XAException ( "AccessDeniedException" ) ; } catch ( final ItemExistsException e ) { throw new XAException ( "ItemExistsException" ) ; } catch ( final Re... |
public class RestTemplate { /** * OPTIONS */
public Set < HttpMethod > optionsForAllow ( String url , Object ... urlVariables ) throws RestClientException { } } | HttpHeaders headers = execute ( url , HttpMethod . OPTIONS , null , this . headersExtractor , urlVariables ) ; return headers . getAllow ( ) ; |
public class UserClient { /** * Set user ' s group message blocking
* @ param payload GroupShieldPayload
* @ param username Necessary
* @ return No content
* @ throws APIConnectionException connect exception
* @ throws APIRequestException request exception */
public ResponseWrapper setGroupShield ( GroupShiel... | Preconditions . checkArgument ( null != payload , "GroupShieldPayload should not be null" ) ; StringUtils . checkUsername ( username ) ; return _httpClient . sendPost ( _baseUrl + userPath + "/" + username + "/groupsShield" , payload . toString ( ) ) ; |
public class GaliosFieldOps { /** * < p > Multiply the two polynomials together . The technique used here isn ' t the fastest but is easy
* to understand . < / p >
* < p > NOTE : No modulus operation is performed so the result might not be a member of the same field . < / p >
* @ param a polynomial
* @ param b ... | int z = 0 ; for ( int i = 0 ; ( b >> i ) > 0 ; i ++ ) { if ( ( b & ( 1 << i ) ) != 0 ) { z ^= a << i ; } } return z ; |
public class RestClientUtil { /** * 更新索引定义 : my _ index / _ mapping
* https : / / www . elastic . co / guide / en / elasticsearch / reference / 7.0 / indices - put - mapping . html
* @ param indexMapping
* @ return
* @ throws ElasticSearchException */
public String updateIndiceMapping ( String action , String i... | try { return this . client . executeHttp ( action , indexMapping , ClientUtil . HTTP_POST ) ; } catch ( ElasticSearchException e ) { return ResultUtil . hand404HttpRuntimeException ( e , String . class , ResultUtil . OPERTYPE_updateIndiceMapping ) ; } |
public class DateTimeUtils { /** * Converts a { @ code java . sql . Date } to a { @ code LocalDate } .
* @ param sqlDate the SQL date , not null
* @ return the local date , not null */
@ SuppressWarnings ( "deprecation" ) public static LocalDate toLocalDate ( java . sql . Date sqlDate ) { } } | return LocalDate . of ( sqlDate . getYear ( ) + 1900 , sqlDate . getMonth ( ) + 1 , sqlDate . getDate ( ) ) ; |
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public String convertCDDXocBaseToString ( EDataType eDataType , Object instanceValue ) { } } | return instanceValue == null ? null : instanceValue . toString ( ) ; |
public class Transformers { static < T > T transform ( Object value , Class < T > toClazz , Registry registry ) { } } | try { if ( toClazz . isInstance ( value ) ) { return ( T ) value ; } else if ( value instanceof BindObject ) { T bean = newInstance ( toClazz ) ; for ( Map . Entry < String , Object > entry : ( BindObject ) value ) { Class < ? > requiredType = PropertyUtils . getPropertyType ( toClazz , entry . getKey ( ) ) ; Object pr... |
public class StaticCATXATransaction { /** * Calls setTransactionTimeout ( ) on the SIXAResource .
* Fields :
* BIT16 XAResourceId
* BIT32 Timeout
* @ param request
* @ param conversation
* @ param requestNumber
* @ param allocatedFromBufferPool
* @ param partOfExchange */
public static void rcvXA_setTxT... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "rcvXA_setTxTimeout" , new Object [ ] { request , conversation , "" + requestNumber , "" + allocatedFromBufferPool , "" + partOfExchange } ) ; try { int clientTransactionId = request . getInt ( ) ; int timeout = request . ge... |
public class LogQueryTool { /** * Get query , truncated if to big .
* @ param buffer current query buffer
* @ return possibly truncated query if too big */
private String subQuery ( ByteBuffer buffer ) { } } | String queryString ; if ( options . maxQuerySizeToLog == 0 ) { queryString = new String ( buffer . array ( ) , 5 , buffer . limit ( ) ) ; } else { queryString = new String ( buffer . array ( ) , 5 , Math . min ( buffer . limit ( ) - 5 , ( options . maxQuerySizeToLog * 3 ) ) ) ; if ( queryString . length ( ) > options .... |
public class ArbitrateFactory { /** * 销毁和释放对应pipelineId的仲裁资源
* @ param pipelineId */
public static < T extends ArbitrateLifeCycle > void destory ( Long pipelineId , Class < T > instanceClass ) { } } | Map < Class , Object > resources = cache . get ( pipelineId ) ; if ( resources != null ) { Object obj = resources . remove ( instanceClass ) ; if ( obj instanceof ArbitrateLifeCycle ) { ArbitrateLifeCycle lifeCycle = ( ArbitrateLifeCycle ) obj ; lifeCycle . destory ( ) ; // 调用销毁方法
} } |
public class ClustersInner { /** * Executes script actions on the specified HDInsight cluster .
* @ param resourceGroupName The name of the resource group .
* @ param clusterName The name of the cluster .
* @ param parameters The parameters for executing script actions .
* @ throws IllegalArgumentException thro... | return beginExecuteScriptActionsWithServiceResponseAsync ( resourceGroupName , clusterName , parameters ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ; |
public class SimpleDocTreeVisitor { /** * { @ inheritDoc } This implementation calls { @ code defaultAction } .
* @ param node { @ inheritDoc }
* @ param p { @ inheritDoc }
* @ return the result of { @ code defaultAction } */
@ Override public R visitValue ( ValueTree node , P p ) { } } | return defaultAction ( node , p ) ; |
public class MapEntry { /** * / * ( non - Javadoc )
* @ see com . google . protobuf . MessageOrBuilder # getField ( com . google . protobuf . Descriptors . FieldDescriptor ) */
@ Override public Object getField ( FieldDescriptor field ) { } } | checkFieldDescriptor ( field ) ; Object result = field . getNumber ( ) == 1 ? getKey ( ) : getValue ( ) ; // Convert enums to EnumValueDescriptor .
if ( field . getType ( ) == FieldDescriptor . Type . ENUM ) { result = field . getEnumType ( ) . findValueByNumberCreatingIfUnknown ( ( java . lang . Integer ) result ) ; }... |
public class PkiOperationResponseHandler { /** * { @ inheritDoc } */
@ Override public CMSSignedData getResponse ( final byte [ ] content , final String mimeType ) throws ContentException { } } | if ( mimeType . startsWith ( PKI_MESSAGE ) ) { try { return new CMSSignedData ( content ) ; } catch ( CMSException e ) { throw new InvalidContentException ( e ) ; } } else { throw new InvalidContentTypeException ( mimeType , PKI_MESSAGE ) ; } |
public class AWSIoTAnalyticsClient { /** * Creates the content of a data set by applying a " queryAction " ( a SQL query ) or a " containerAction " ( executing a
* containerized application ) .
* @ param createDatasetContentRequest
* @ return Result of the CreateDatasetContent operation returned by the service . ... | request = beforeClientExecution ( request ) ; return executeCreateDatasetContent ( request ) ; |
public class CmsUploadPropertyPanel { /** * Sets up the property editor . < p > */
protected void initializePropertyEditor ( ) { } } | Map < String , CmsXmlContentProperty > propertyConfig = m_values . getPropertyDefinitions ( ) ; m_propertyEditorHandler = new CmsUploadPropertyEditorHandler ( m_dialog , m_values ) ; CmsSimplePropertyEditor propertyEditor = new CmsUploadPropertyEditor ( propertyConfig , m_propertyEditorHandler ) ; propertyEditor . getF... |
public class CmsDynamicFunctionParser { /** * Parses a dynamic function bean from an in - memory XML content object . < p >
* @ param cms the current CMS context
* @ param content the XML content from which to read the dynamic function bean
* @ return the dynamic function bean read from the XML content
* @ thro... | Locale locale = getLocaleToUse ( cms , content ) ; String oldSiteRoot = cms . getRequestContext ( ) . getSiteRoot ( ) ; try { cms . getRequestContext ( ) . setSiteRoot ( "" ) ; CmsResource functionFormatter = getFunctionFormatter ( cms ) ; CmsXmlContentRootLocation root = new CmsXmlContentRootLocation ( content , local... |
public class SipStandardManager { /** * Set the maximum number of actives Sip Sessions allowed , or - 1 for no
* limit .
* @ param max
* The new maximum number of sip sessions */
public void setMaxActiveSipSessions ( int max ) { } } | int oldMaxActiveSipSessions = this . sipManagerDelegate . getMaxActiveSipSessions ( ) ; this . sipManagerDelegate . setMaxActiveSipSessions ( max ) ; support . firePropertyChange ( "maxActiveSipSessions" , Integer . valueOf ( oldMaxActiveSipSessions ) , Integer . valueOf ( this . sipManagerDelegate . getMaxActiveSipSes... |
public class MatchTarget { /** * Creates a clone of this MatchTarget . Override only if the system clone support does
* not produce a correct result . */
public MatchTarget duplicate ( ) { } } | try { return ( MatchTarget ) clone ( ) ; } catch ( CloneNotSupportedException e ) { // No FFDC Code Needed .
// FFDC driven by wrapper class .
FFDC . processException ( cclass , "com.ibm.ws.sib.matchspace.MatchTarget.duplicate" , e , "1:112:1.15" ) ; // should not happen
throw new IllegalStateException ( ) ; } |
public class QueryUtils { /** * Returns type of query from given query string .
* @ param query a query string
* @ return type of query
* @ since 1.4 */
public static QueryType getQueryType ( String query ) { } } | final String trimmedQuery = removeCommentAndWhiteSpace ( query ) ; if ( trimmedQuery == null || trimmedQuery . length ( ) < 1 ) { return QueryType . OTHER ; } final char firstChar = trimmedQuery . charAt ( 0 ) ; final QueryType type ; switch ( firstChar ) { case 'S' : case 's' : type = QueryType . SELECT ; break ; case... |
public class Configuration { /** * Return value matching this enumerated type .
* @ param name Property name
* @ throws NullPointerException if the configuration property does not exist
* @ throws IllegalArgumentException If mapping is illegal for the type
* provided */
public < T extends Enum < T > > T getEnum... | final String val = get ( name ) ; Preconditions . checkNotNull ( val ) ; return Enum . valueOf ( declaringClass , val ) ; |
public class AsyncMutateInBuilder { /** * Perform several { @ link Mutation mutation } operations inside a single existing { @ link JsonDocument JSON document }
* and watch for durability requirements .
* The list of mutations and paths to mutate in the JSON is added through builder methods like
* { @ link # arra... | return execute ( persistTo , ReplicateTo . NONE , timeout , timeUnit ) ; |
public class Interceptors { /** * Creates a ternary interceptor chain .
* @ param < R > the function result type
* @ param < T1 > the function first parameter type
* @ param < T2 > the function second parameter type
* @ param < T3 > the function third parameter type
* @ param < I > the ternary interceptor typ... | return new TernaryInterceptorChain < T1 , T2 , T3 , R > ( innermost , interceptors ) ; |
public class XmlInOut { /** * Export this table .
* @ record The record to export .
* @ strFileName The destination filename ( deleted the old copy if this file exists ) . */
public boolean exportXML ( BaseTable table , String strFileName ) { } } | Record record = table . getRecord ( ) ; boolean bSuccess = true ; File file = new File ( strFileName ) ; if ( file . exists ( ) ) file . delete ( ) ; // Delete if it exists
else { String strPath = file . getParent ( ) ; File fileDir = new File ( strPath ) ; fileDir . mkdirs ( ) ; } XmlInOut . enableAllBehaviors ( recor... |
public class AbstractTypeConvertingMap { /** * Helper method for obtaining long value from parameter
* @ param name The name of the parameter
* @ return The long value or null if there isn ' t one */
public Long getLong ( String name ) { } } | Object o = get ( name ) ; if ( o instanceof Number ) { return ( ( Number ) o ) . longValue ( ) ; } if ( o != null ) { try { return Long . parseLong ( o . toString ( ) ) ; } catch ( NumberFormatException e ) { } } return null ; |
public class JsonXOutput { /** * Resets this output for re - use . */
public JsonXOutput clear ( boolean clearBuffer ) { } } | if ( clearBuffer ) tail = head . clear ( ) ; lastRepeated = false ; lastNumber = 0 ; return this ; |
public class DeviceAttribute_3DAODefaultImpl { public void insert_ul ( final int [ ] argin ) { } } | attrval . r_dim . dim_x = argin . length ; attrval . r_dim . dim_y = 0 ; DevVarULongArrayHelper . insert ( attrval . value , argin ) ; |
public class Studio { /** * Listens to key to close a | window | . */
private static final KeyAdapter closeKeyStrokes ( final java . awt . Window window ) { } } | return new KeyAdapter ( ) { public void keyReleased ( KeyEvent e ) { final int kc = e . getKeyCode ( ) ; if ( kc == KeyEvent . VK_ESCAPE || kc == KeyEvent . VK_ENTER ) { window . dispose ( ) ; } } } ; |
public class TasksImpl { /** * Updates the properties of the specified task .
* @ param jobId The ID of the job containing the task .
* @ param taskId The ID of the task to update .
* @ param constraints Constraints that apply to this task . If omitted , the task is given the default constraints . For multi - ins... | return ServiceFuture . fromHeaderResponse ( updateWithServiceResponseAsync ( jobId , taskId , constraints , taskUpdateOptions ) , serviceCallback ) ; |
public class HttpRequestSubscriber { /** * Invoked on each write of an { @ link HttpObject } . */
@ Override public void operationComplete ( ChannelFuture future ) throws Exception { } } | // If a message has been sent out , cancel the timeout for starting a request .
cancelTimeout ( ) ; if ( future . isSuccess ( ) ) { // The first write is always the first headers , so log that we finished our first transfer over the
// wire .
if ( ! loggedRequestFirstBytesTransferred ) { logBuilder . requestFirstBytesT... |
public class QuestionnaireBuilder { /** * Special Types - - - - - */
private void addReferenceQuestions ( QuestionnaireItemComponent group , ElementDefinition element , String path , List < CanonicalType > profileURL , List < QuestionnaireResponse . QuestionnaireResponseItemComponent > answerGroups ) throws FHIRExcepti... | // var
// rn : String ;
// i : integer ;
// q : TFhirQuestionnaireGroupQuestion ;
ToolingExtensions . addFhirType ( group , "Reference" ) ; QuestionnaireItemComponent q = addQuestion ( group , QuestionnaireItemType . REFERENCE , path , "value" , group . getText ( ) , answerGroups ) ; group . setText ( null ) ; CommaSep... |
public class CurvedArrow { /** * Draws a highlight of the curve .
* @ param g
* the graphics to draw the highlight of the curve upon */
public void drawHighlight ( Graphics2D g ) { } } | if ( needsRefresh ) refreshCurve ( ) ; Graphics2D g2 = ( Graphics2D ) g . create ( ) ; g2 . setStroke ( new java . awt . BasicStroke ( 6.0f ) ) ; g2 . setColor ( HIGHLIGHT_COLOR ) ; g2 . draw ( curve ) ; g2 . transform ( affineToText ) ; g2 . fill ( bounds ) ; g2 . dispose ( ) ; |
public class Selector { /** * Find the first element that matches the query .
* @ param cssQuery CSS selector
* @ param root root element to descend into
* @ return the matching element , or < b > null < / b > if none . */
public static Element selectFirst ( String cssQuery , Element root ) { } } | Validate . notEmpty ( cssQuery ) ; return Collector . findFirst ( QueryParser . parse ( cssQuery ) , root ) ; |
public class KafkaUtils { /** * SUPPRESS CHECKSTYLE : OFF JavadocMethodRegex */
public static byte [ ] serializeLong ( Long data ) { } } | if ( data == null ) { return null ; } return new byte [ ] { ( byte ) ( data >>> 56 ) , ( byte ) ( data >>> 48 ) , ( byte ) ( data >>> 40 ) , ( byte ) ( data >>> 32 ) , ( byte ) ( data >>> 24 ) , ( byte ) ( data >>> 16 ) , ( byte ) ( data >>> 8 ) , data . byteValue ( ) } ; |
public class AlbumUtils { /** * Generate a random jpg file path .
* @ param context context .
* @ return file path . */
@ NonNull public static String randomJPGPath ( Context context ) { } } | if ( ! Environment . MEDIA_MOUNTED . equals ( Environment . getExternalStorageState ( ) ) ) { return randomJPGPath ( context . getCacheDir ( ) ) ; } return randomJPGPath ( ) ; |
public class UUCoder { /** * encodes a byte array to a String
* @ param barr
* @ return encoded String */
public static String encode ( byte barr [ ] ) { } } | StringBuilder rtn = new StringBuilder ( ) ; int len = barr . length ; int read = 0 ; boolean stop = false ; byte b = 0 ; int offset = 0 ; do { int left = len - read ; if ( left == 0 ) stop = true ; if ( left <= 45 ) b = ( byte ) left ; else b = 45 ; rtn . append ( _enc ( b ) ) ; for ( int i = 0 ; i < b ; i += 3 ) { if ... |
public class StepExecution { /** * Fully - resolved values passed into the step before execution .
* @ param inputs
* Fully - resolved values passed into the step before execution .
* @ return Returns a reference to this object so that method calls can be chained together . */
public StepExecution withInputs ( ja... | setInputs ( inputs ) ; return this ; |
public class Computer { /** * Returns the { @ link Node } description for this computer */
@ Restricted ( DoNotUse . class ) @ Exported public @ Nonnull String getDescription ( ) { } } | Node node = getNode ( ) ; return ( node != null ) ? node . getNodeDescription ( ) : null ; |
public class VTimeZone { /** * Parse VTIMEZONE data and create a RuleBasedTimeZone */
private boolean parse ( ) { } } | // / CLOVER : OFF
if ( vtzlines == null || vtzlines . size ( ) == 0 ) { return false ; } // / CLOVER : ON
// timezone ID
String tzid = null ; int state = INI ; boolean dst = false ; // current zone type
String from = null ; // current zone from offset
String to = null ; // current zone offset
String tzname = null ; // ... |
public class Sendinblue { /** * Get all campaigns detail .
* @ param { Object } data contains json objects as a key value pair from HashMap .
* @ options data { String } type : Type of campaign . Possible values – classic , trigger , sms , template ( case sensitive ) [ Optional ]
* @ options data { String } statu... | String type = data . get ( "type" ) . toString ( ) ; String status = data . get ( "status" ) . toString ( ) ; String page = data . get ( "page" ) . toString ( ) ; String page_limit = data . get ( "page_limit" ) . toString ( ) ; String url ; if ( EMPTY_STRING . equals ( type ) && EMPTY_STRING . equals ( status ) && EMPT... |
public class TempByteHolder { /** * Reads all available data from input stream .
* @ param is
* @ throws IOException */
public void readFrom ( java . io . InputStream is ) throws IOException { } } | int howmuch = 0 ; do { _write_pos += howmuch ; moveWindow ( _write_pos ) ; howmuch = is . read ( _memory_buffer ) ; } while ( howmuch != - 1 ) ; |
public class CDIServiceUtils { /** * Returns a unique identifying string for an annotated type . This method should be used when calling BeforeBeanIdentifer . addAnnotatedType ( )
* @ param annotatedType the new annotated type you are createing . Null is an accepted value but should only be used if you know exactly w... | // We use the symbolic name as a compromise between makeing the ID unique enough to allow multiple annotated types based on the same type
// to quote the javadoc : " This method allows multiple annotated types , based on the same underlying type , to be defined . "
// and allowing failover to work . Failover will fail ... |
public class JsxResourceConverter { /** * / * ( non - Javadoc )
* @ see com . ibm . jaggr . core . cache . ICacheManager . ICacheManagerListener # initialized ( com . ibm . jaggr . core . IAggregator ) */
@ Override public void initialized ( ICacheManager cacheManager ) { } } | final String sourceMethod = "initialized" ; // $ NON - NLS - 1 $
final boolean isTraceLogging = log . isLoggable ( Level . FINER ) ; if ( isTraceLogging ) { log . entering ( sourceClass , sourceMethod ) ; } // Cache manager is initialized . De - register the listener and add our named cache
cacheMgrListenerReg . unregi... |
public class HistogramStatistics { /** * Computes the variance of pixel intensity values for a GrayU8 image represented by the given histogram .
* @ param histogram Histogram with N bins
* @ param mean Mean of the image .
* @ param N number of bins in the histogram .
* @ return variance */
public static double ... | return variance ( histogram , mean , count ( histogram , N ) , N ) ; |
public class HistoryFilterPlusDialog { /** * This method initializes jPanel
* @ return javax . swing . JPanel */
private JPanel getJPanel ( ) { } } | if ( jPanel == null ) { GridBagConstraints gridBagConstraints12 = new GridBagConstraints ( ) ; java . awt . GridBagConstraints gridBagConstraints11 = new GridBagConstraints ( ) ; java . awt . GridBagConstraints gridBagConstraints6 = new GridBagConstraints ( ) ; ZapLabel descLabel = new ZapLabel ( ) ; descLabel . setLin... |
public class ZealotConfigManager { /** * 初始化加载Zealot的配置信息到缓存中 .
* @ param zealotConfig 配置类实例
* @ param xmlLocations zealot的XML文件所在的位置 , 多个用逗号隔开
* @ param handlerLocations zealot的自定义handler处理器所在的位置 , 多个用逗号隔开 */
public void initLoad ( AbstractZealotConfig zealotConfig , String xmlLocations , String handlerLocations... | this . xmlLocations = xmlLocations ; this . handlerLocations = handlerLocations ; this . initLoad ( zealotConfig ) ; |
public class RobustLoaderWriterResilienceStrategy { /** * Get all entries for the provided keys . Entries not found by the loader - writer are expected to be an entry
* with the key and a null value .
* @ param keys the keys being retrieved
* @ param e the triggered failure
* @ return a map of key - value pairs... | try { return loaderWriter . loadAll ( ( Iterable ) keys ) ; // FIXME : bad typing that we should fix
} catch ( BulkCacheLoadingException e1 ) { throw e1 ; } catch ( Exception e1 ) { throw ExceptionFactory . newCacheLoadingException ( e1 , e ) ; } finally { cleanup ( keys , e ) ; } |
public class ThreadPoolTaskScheduler { /** * { @ inheritDoc }
* @ see org . audit4j . core . schedule . AsyncTaskExecutor # submit ( java . lang . Runnable ) */
@ Override public Future < ? > submit ( Runnable task ) { } } | ExecutorService executor = getScheduledExecutor ( ) ; try { return executor . submit ( errorHandlingTask ( task , false ) ) ; } catch ( RejectedExecutionException ex ) { throw new TaskRejectedException ( "Executor [" + executor + "] did not accept task: " + task , ex ) ; } |
public class VortexWorker { /** * Starts the scheduler and executor and waits until termination . */
@ Override public byte [ ] call ( final byte [ ] memento ) throws Exception { } } | final ExecutorService schedulerThread = Executors . newSingleThreadExecutor ( ) ; final ExecutorService commandExecutor = Executors . newFixedThreadPool ( numOfThreads ) ; final ConcurrentMap < Integer , Future > futures = new ConcurrentHashMap < > ( ) ; // Scheduling thread starts
schedulerThread . execute ( new Runna... |
public class DSClientFactory { /** * Gets the host filter predicate .
* @ param hostFilterPolicy
* the host filter policy
* @ return the host filter predicate */
private Predicate < com . datastax . driver . core . Host > getHostFilterPredicate ( String hostFilterPolicy ) { } } | Predicate < com . datastax . driver . core . Host > predicate = null ; Method getter = null ; Class < ? > hostFilterClazz = null ; try { hostFilterClazz = Class . forName ( hostFilterPolicy ) ; getter = hostFilterClazz . getDeclaredMethod ( GET_INSTANCE ) ; predicate = ( Predicate < com . datastax . driver . core . Hos... |
public class ByteIntervalProperty { /** * Utility method to include the SI unit name .
* @ param value The value of a Long in String form .
* @ return Rounded value with appended SI units . For example , 45.3MB , 62B , 27.2GB , etc . */
public String addUnits ( String value ) { } } | StringBuffer buff = new StringBuffer ( 100 ) ; long bytes = Long . parseLong ( value ) ; if ( bytes < 1000000 ) { buff . append ( value ) ; buff . append ( "B" ) ; } else { int unit = 1000 ; int exp = ( int ) ( Math . log ( bytes ) / Math . log ( unit ) ) ; String pre = "kMGTPE" . charAt ( exp - 1 ) + "" ; String ov = ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.