signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class FlightRecorderInputStream { /** * To record the bytes we ' ve skipped , convert the call to read . */
@ Override public long skip ( long n ) throws IOException { } } | byte [ ] buf = new byte [ ( int ) Math . min ( n , 64 * 1024 ) ] ; return read ( buf , 0 , buf . length ) ; |
public class FilterInstanceWrapper { /** * Inovkes the wrapped filter ' s doFilter method
* @ param request the servlet request object
* @ param response the servlet response object
* @ param chain the filter chain object */
public void doFilter ( ServletRequest request , ServletResponse response , FilterChain ch... | try { // invoke the wrapped filter
if ( _filterState == FILTER_STATE_AVAILABLE ) { nServicing . incrementAndGet ( ) ; try { if ( request . isAsyncSupported ( ) ) { // 141092
boolean isAsyncSupported = this . _filterConfig . isAsyncSupported ( ) ; if ( ! isAsyncSupported ) { WebContainerRequestState reqState = WebContai... |
public class ScheduleService { /** * IMPORTANT : this method is only meant for TOP level usage ( never use this within a transaction ) . It gobbles exception . */
public Stage rerunJobs ( final Stage stage , final List < String > jobNames , final HttpOperationResult result ) { } } | final StageIdentifier identifier = stage . getIdentifier ( ) ; HealthStateType healthStateForStage = HealthStateType . general ( HealthStateScope . forStage ( identifier . getPipelineName ( ) , identifier . getStageName ( ) ) ) ; if ( jobNames == null || jobNames . isEmpty ( ) ) { String message = "No job was selected ... |
public class EventManager { /** * Initialize ZMQ event system if not already done ,
* subscribe to the interface change event end
* returns the connection parameters .
* @ param deviceName The specified event device name
* @ return the connection parameters . */
public DevVarLongStringArray subscribe ( final St... | xlogger . entry ( ) ; // If first time start the ZMQ management
if ( ! isInitialized ) { initialize ( ) ; } // check if event is already subscribed
final String fullName = EventUtilities . buildDeviceEventName ( deviceName , EventType . INTERFACE_CHANGE_EVENT ) ; EventImpl eventImpl = eventImplMap . get ( fullName ) ; ... |
public class FileExtensions { /** * Gets the absolut path without the filename .
* @ param file
* the file .
* @ return ' s the absolut path without filename . */
public static String getAbsolutPathWithoutFilename ( final File file ) { } } | final String absolutePath = file . getAbsolutePath ( ) ; int lastSlash_index = absolutePath . lastIndexOf ( "/" ) ; if ( lastSlash_index < 0 ) { lastSlash_index = absolutePath . lastIndexOf ( "\\" ) ; } return absolutePath . substring ( 0 , lastSlash_index + 1 ) ; |
public class ObjectType { /** * Gets the node corresponding to the definition of the specified property .
* This could be the node corresponding to declaration of the property or the
* node corresponding to the first reference to this property , e . g . ,
* " this . propertyName " in a constructor . Note this is ... | Property p = getSlot ( propertyName ) ; return p == null ? null : p . getNode ( ) ; |
public class Router { /** * Specify a middleware that will be called for a matching HTTP CONNECT
* @ param regex A regular expression
* @ param handlers The middleware to call */
public Router connect ( @ NotNull final Pattern regex , @ NotNull final IMiddleware ... handlers ) { } } | addRegEx ( "CONNECT" , regex , handlers , connectBindings ) ; return this ; |
public class FileInfo { /** * < code > optional string ufsPath = 4 ; < / code > */
public java . lang . String getUfsPath ( ) { } } | java . lang . Object ref = ufsPath_ ; if ( ref instanceof java . lang . String ) { return ( java . lang . String ) ref ; } else { com . google . protobuf . ByteString bs = ( com . google . protobuf . ByteString ) ref ; java . lang . String s = bs . toStringUtf8 ( ) ; if ( bs . isValidUtf8 ( ) ) { ufsPath_ = s ; } retur... |
public class BccClient { /** * Deleting the specified image .
* Only the customized image can be deleted ,
* otherwise , it ' s will get < code > 403 < / code > errorCode .
* @ param request The request containing all options for deleting the specified image . */
public void deleteImage ( DeleteImageRequest reque... | checkNotNull ( request , "request should not be null." ) ; checkStringNotEmpty ( request . getImageId ( ) , "request imageId should not be empty." ) ; InternalRequest internalRequest = this . createRequest ( request , HttpMethodName . DELETE , IMAGE_PREFIX , request . getImageId ( ) ) ; invokeHttpClient ( internalReque... |
public class HybridBinarizer { /** * Calculates the final BitMatrix once for all requests . This could be called once from the
* constructor instead , but there are some advantages to doing it lazily , such as making
* profiling easier , and not doing heavy lifting when callers don ' t expect it . */
@ Override pub... | if ( matrix != null ) { return matrix ; } LuminanceSource source = getLuminanceSource ( ) ; int width = source . getWidth ( ) ; int height = source . getHeight ( ) ; if ( width >= MINIMUM_DIMENSION && height >= MINIMUM_DIMENSION ) { byte [ ] luminances = source . getMatrix ( ) ; int subWidth = width >> BLOCK_SIZE_POWER... |
public class ResourceResolver { /** * Searches resource loaders for one that supports the given prefix .
* @ param prefix The prefix the loader should support . ( classpath : , file : , etc )
* @ return An optional resource loader */
public @ Nonnull Optional < ResourceLoader > getSupportingLoader ( @ Nonnull Strin... | ArgumentUtils . requireNonNull ( "prefix" , prefix ) ; return resourceLoaders . stream ( ) . filter ( rl -> rl . supportsPrefix ( prefix ) ) . findFirst ( ) ; |
public class CommonsPool2ConfigConverter { /** * Converts { @ link GenericObjectPoolConfig } properties to an immutable { @ link BoundedPoolConfig } . Applies max total , min / max
* idle and test on borrow / create / release configuration .
* @ param config must not be { @ literal null } .
* @ return the convert... | LettuceAssert . notNull ( config , "GenericObjectPoolConfig must not be null" ) ; return BoundedPoolConfig . builder ( ) . maxTotal ( config . getMaxTotal ( ) ) . maxIdle ( config . getMaxIdle ( ) ) . minIdle ( config . getMinIdle ( ) ) . testOnAcquire ( config . getTestOnBorrow ( ) ) . testOnCreate ( config . getTestO... |
public class CmsManyToOneMap { /** * Removes the entry with the given key . < p >
* @ param key the key */
public void remove ( K key ) { } } | V removedValue = m_forwardMap . remove ( key ) ; if ( removedValue != null ) { m_reverseMap . remove ( removedValue , key ) ; } |
public class DefaultShardManagerBuilder { /** * Sets the { @ link org . slf4j . MDC MDC } mappings provider to use in JDA .
* < br > If sharding is enabled JDA will automatically add a { @ code jda . shard } context with the format { @ code [ SHARD _ ID / TOTAL ] }
* where { @ code SHARD _ ID } and { @ code TOTAL }... | this . contextProvider = provider ; if ( provider != null ) this . enableContext = true ; return this ; |
public class DualYearOfEraElement { /** * ~ Methoden - - - - - */
@ Override public void print ( ChronoDisplay context , Appendable buffer , AttributeQuery attributes ) throws IOException , ChronoException { } } | NumberSystem numsys = getNumberSystem ( attributes ) ; TextWidth width = attributes . get ( Attributes . TEXT_WIDTH , TextWidth . NARROW ) ; int minDigits ; switch ( width ) { case NARROW : minDigits = 1 ; break ; case SHORT : minDigits = 2 ; break ; case ABBREVIATED : minDigits = 3 ; break ; default : minDigits = 4 ; ... |
public class IPv4 { /** * Parses the provided CIDR string and produces a closed { @ link Range } encapsulating all IPv4 addresses between
* the network and broadcast addresses in the subnet represented by the CIDR . */
public static Range < IPv4 > cidrRange ( String cidr ) { } } | try { CidrInfo cidrInfo = parseCIDR ( cidr ) ; if ( cidrInfo . getNetwork ( ) instanceof Inet4Address && cidrInfo . getBroadcast ( ) instanceof Inet4Address ) { return closed ( new IPv4 ( ( Inet4Address ) cidrInfo . getNetwork ( ) ) , new IPv4 ( ( Inet4Address ) cidrInfo . getBroadcast ( ) ) ) ; } } catch ( Exception i... |
public class FixedShardsDistribution { /** * Associates segments to each shard .
* @ param shardsNumPerServer numbers of shards allocated for each server
* @ param segmentsPerServer the primary owned segments of each server
* @ param nodes the members of the cluster */
private void populateSegments ( int [ ] shar... | int shardId = 0 ; int n = 0 ; Set < Integer > remainingSegments = new HashSet < > ( ) ; for ( Address node : nodes ) { Collection < Integer > primarySegments = segmentsPerServer . get ( n ) ; int shardQuantity = shardsNumPerServer [ n ] ; if ( shardQuantity == 0 ) { remainingSegments . addAll ( segmentsPerServer . get ... |
public class GeoPackageGeometryData { /** * Get the Well - Known Binary Geometry bytes
* @ return bytes */
public byte [ ] getWkbBytes ( ) { } } | int wkbByteCount = bytes . length - wkbGeometryIndex ; byte [ ] wkbBytes = new byte [ wkbByteCount ] ; System . arraycopy ( bytes , wkbGeometryIndex , wkbBytes , 0 , wkbByteCount ) ; return wkbBytes ; |
public class Example03_PatientResourceProvider { /** * Simple " search " implementation * */
@ Search public List < Patient > search ( ) { } } | List < Patient > retVal = new ArrayList < Patient > ( ) ; retVal . addAll ( myPatients . values ( ) ) ; return retVal ; |
public class MPDUtility { /** * Writes a large byte array to a file .
* @ param fileName output file name
* @ param data target data */
public static final void fileDump ( String fileName , byte [ ] data ) { } } | try { FileOutputStream os = new FileOutputStream ( fileName ) ; os . write ( data ) ; os . close ( ) ; } catch ( IOException ex ) { ex . printStackTrace ( ) ; } |
public class HashIndex { /** * This is the analogue of < code > loadFromFilename < / code > , and is intended to be included in a routine
* that unpacks a text - serialized form of an object that incorporates an Index .
* NOTE : presumes that the next readLine ( ) will read in the first line of the
* portion of t... | HashIndex < String > index = new HashIndex < String > ( ) ; String line = br . readLine ( ) ; // terminate if EOF reached , or if a blank line is encountered .
while ( ( line != null ) && ( line . length ( ) > 0 ) ) { int start = line . indexOf ( '=' ) ; if ( start == - 1 || start == line . length ( ) - 1 ) { continue ... |
public class AuthRundeckStorageTree { /** * Map containing path and name given a path
* @ param path path
* @ return map */
private Map < String , String > authResForPath ( Path path ) { } } | HashMap < String , String > authResource = new HashMap < String , String > ( ) ; authResource . put ( PATH_RES_KEY , path . getPath ( ) ) ; authResource . put ( NAME_RES_KEY , path . getName ( ) ) ; return authResource ; |
public class CmsXmlContainerPageFactory { /** * Returns the cached container page . < p >
* @ param cms the cms context
* @ param resource the container page resource
* @ param keepEncoding if to keep the encoding while unmarshalling
* @ return the cached container page , or < code > null < / code > if not foun... | if ( resource instanceof I_CmsHistoryResource ) { return null ; } return getCache ( ) . getCacheContainerPage ( getCache ( ) . getCacheKey ( resource . getStructureId ( ) , keepEncoding ) , cms . getRequestContext ( ) . getCurrentProject ( ) . isOnlineProject ( ) ) ; |
public class DefaultGroovyMethods { /** * Converts the given collection to another type . A default concrete
* type is used for List , Set , or SortedSet . If the given type has
* a constructor taking a collection , that is used . Otherwise , the
* call is deferred to { @ link # asType ( Object , Class ) } . If t... | if ( col . getClass ( ) == clazz ) { return ( T ) col ; } if ( clazz == List . class ) { return ( T ) asList ( ( Iterable ) col ) ; } if ( clazz == Set . class ) { if ( col instanceof Set ) return ( T ) col ; return ( T ) new LinkedHashSet ( col ) ; } if ( clazz == SortedSet . class ) { if ( col instanceof SortedSet ) ... |
public class AstNodeFactory { /** * Utility method to determine if an { @ link AstNode } contains a specific mixin type .
* @ param node the AstNode
* @ param mixinType the target mixin type { @ link String } ; may not be null ;
* @ return true if the mixinType exists for this node */
public boolean hasMixinType ... | CheckArg . isNotNull ( node , "node" ) ; CheckArg . isNotNull ( mixinType , "mixinType" ) ; return node . getMixins ( ) . contains ( mixinType ) ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EEnum getIfcSwitchingDeviceTypeEnum ( ) { } } | if ( ifcSwitchingDeviceTypeEnumEEnum == null ) { ifcSwitchingDeviceTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 1080 ) ; } return ifcSwitchingDeviceTypeEnumEEnum ; |
public class LoadedClassCache { /** * Returns a class object . If the class is new , a new Class object is
* created , otherwise the cached object is returned .
* @ param cl
* the classloader
* @ param className
* the class name
* @ return the class object associated to the given class name * @ throws Class... | if ( LOADED_PLUGINS . get ( cl ) == null ) { LOADED_PLUGINS . put ( cl , new ClassesData ( ) ) ; } ClassesData cd = LOADED_PLUGINS . get ( cl ) ; Class clazz = cd . getClass ( className ) ; if ( clazz == null ) { clazz = cl . loadClass ( className ) ; saveClass ( cl , clazz ) ; } return clazz ; |
public class PathElement { /** * A valid key contains alphanumerics and underscores , cannot start with a
* number , and cannot start or end with { @ code - } . */
private static boolean isValidKey ( final String s ) { } } | // Equivalent to this regex \ * | [ _ a - zA - Z ] ( ? : [ - _ a - zA - Z0-9 ] * [ _ a - zA - Z0-9 ] ) but faster
if ( s == null ) { return false ; } if ( s . equals ( WILDCARD_VALUE ) ) { return true ; } int lastIndex = s . length ( ) - 1 ; if ( lastIndex == - 1 ) { return false ; } if ( ! isValidKeyStartCharacter ( s... |
public class OnLineStatistics { /** * Effectively removes a sample with the given value and weight from the total .
* Removing values that have not been added may yield results that have no meaning
* < br > < br >
* NOTE : { @ link # getSkewness ( ) } and { @ link # getKurtosis ( ) } are not currently updated cor... | if ( weight < 0 ) throw new ArithmeticException ( "Can not remove a negative weight" ) ; else if ( weight == 0 ) return ; double n1 = n ; n -= weight ; double delta = x - mean ; double delta_n = delta * weight / n ; double delta_n2 = delta_n * delta_n ; double term1 = delta * delta_n * n1 ; mean -= delta_n ; m2 -= weig... |
public class TableRef { /** * Creates a table with a custom throughput . The provision type is Custom and the provision load is ignored .
* < pre >
* StorageRef storage = new StorageRef ( " your _ app _ key " , " your _ token " ) ;
* TableRef tableRef = storage . table ( " your _ table " ) ;
* / / Create table ... | PostBodyBuilder pbb = new PostBodyBuilder ( context ) ; pbb . addObject ( "table" , this . name ) ; pbb . addObject ( "provisionType" , StorageProvisionType . CUSTOM . getValue ( ) ) ; pbb . addObject ( "key" , key . map ( ) ) ; pbb . addObject ( "throughput" , throughput . map ( ) ) ; Rest r = new Rest ( context , Res... |
public class AptControlImplementation { /** * Does this control impl on one of it superclasses implement java . io . Serializable ?
* @ return true if this control impl or one of its superclasses implements java . io . Serializable . */
protected boolean isSerializable ( ) { } } | for ( InterfaceType superIntf : _implDecl . getSuperinterfaces ( ) ) { if ( superIntf . toString ( ) . equals ( "java.io.Serializable" ) ) { return true ; } } // check to see if the superclass is serializable
return _superClass != null && _superClass . isSerializable ( ) ; |
public class AttributeListHelper { /** * Add to the attributes of the parent for saving .
* @ param attributes some attributes to add to the list */
private void addToAttributes ( final List < ApiAttribute > attributes ) { } } | for ( final ApiObject object : attributes ) { final ApiModelToGedObjectVisitor visitor = createVisitor ( ) ; object . accept ( visitor ) ; } |
public class GoogleRecognitionServiceImpl { /** * Manage recognizer cancellation runnable .
* @ param action ( int ) ( 0 - stop , 1 - restart ) */
private void updateStopRunnable ( final int action ) { } } | if ( stopRunnable != null ) { if ( action == 0 ) { handler . removeCallbacks ( stopRunnable ) ; } else if ( action == 1 ) { handler . removeCallbacks ( stopRunnable ) ; handler . postDelayed ( stopRunnable , STOP_DELAY ) ; } } |
public class BuiltinSlotTypeMetadataMarshaller { /** * Marshall the given parameter object . */
public void marshall ( BuiltinSlotTypeMetadata builtinSlotTypeMetadata , ProtocolMarshaller protocolMarshaller ) { } } | if ( builtinSlotTypeMetadata == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( builtinSlotTypeMetadata . getSignature ( ) , SIGNATURE_BINDING ) ; protocolMarshaller . marshall ( builtinSlotTypeMetadata . getSupportedLocales ( ) , SUPPORTEDL... |
public class AbstractProfileProfileAligner { /** * Sets the query { @ link Profile } .
* @ param query the first { @ link Profile } of the pair to align */
public void setQuery ( Profile < S , C > query ) { } } | this . query = query ; queryFuture = null ; reset ( ) ; |
public class AvroRowDeserializationSchema { private Row convertAvroRecordToRow ( Schema schema , RowTypeInfo typeInfo , IndexedRecord record ) { } } | final List < Schema . Field > fields = schema . getFields ( ) ; final TypeInformation < ? > [ ] fieldInfo = typeInfo . getFieldTypes ( ) ; final int length = fields . size ( ) ; final Row row = new Row ( length ) ; for ( int i = 0 ; i < length ; i ++ ) { final Schema . Field field = fields . get ( i ) ; row . setField ... |
public class QueuePlugin { /** * Add a delay in the named queue . */
@ SuppressWarnings ( "unchecked" ) public T delay ( int milliseconds , String name , Function ... funcs ) { } } | for ( Element e : elements ( ) ) { queue ( e , name , new DelayFunction ( e , name , milliseconds , funcs ) ) ; } return ( T ) this ; |
public class NioGroovyMethods { /** * Write the text to the Path , using the specified encoding . If the given
* charset is " UTF - 16BE " or " UTF - 16LE " ( or an equivalent alias ) and
* < code > writeBom < / code > is < code > true < / code > , the requisite byte order
* mark is written to the file before the... | Writer writer = null ; try { OutputStream out = Files . newOutputStream ( self ) ; if ( writeBom ) { IOGroovyMethods . writeUTF16BomIfRequired ( out , charset ) ; } writer = new OutputStreamWriter ( out , Charset . forName ( charset ) ) ; writer . write ( text ) ; writer . flush ( ) ; Writer temp = writer ; writer = nu... |
public class NotificationBoard { /** * Set the margin of the header .
* @ param l
* @ param t
* @ param r
* @ param b */
public void setHeaderMargin ( int l , int t , int r , int b ) { } } | mHeader . setMargin ( l , t , r , b ) ; |
public class PropertyEditorBase { /** * Initializes the property editor .
* @ param target The target object .
* @ param propInfo The PropertyInfo instance reflecting the property being edited on the target .
* @ param propGrid The property grid owning this property editor . */
protected void init ( Object target... | this . target = target ; this . propInfo = propInfo ; this . propGrid = propGrid ; this . index = propGrid . getEditorCount ( ) ; wireController ( ) ; |
public class AmazonEC2Client { /** * Resets a network interface attribute . You can specify only one attribute at a time .
* @ param resetNetworkInterfaceAttributeRequest
* Contains the parameters for ResetNetworkInterfaceAttribute .
* @ return Result of the ResetNetworkInterfaceAttribute operation returned by th... | request = beforeClientExecution ( request ) ; return executeResetNetworkInterfaceAttribute ( request ) ; |
public class DataSourceService { /** * Indicates whether or not thread identity , sync - to - thread , and RRS transactions are supported .
* The result is a 3 element array , of which ,
* < ul >
* < li > The first element indicates support for thread identity . 2 = REQUIRED , 1 = ALLOWED , 0 = NOT ALLOWED . < / ... | WSManagedConnectionFactoryImpl mcf1 ; if ( jdbcDriverSvc . loadFromApp ( ) ) { final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; // data source class is loaded from thread context class loader
if ( identifier == null ) { ClassLoader tccl = priv . getContextClassLoader ( ) ; identifier = connectorSvc . ge... |
public class KeenQueryClient { /** * Sends a request to the server in this client ' s project , using the given URL and request
* data via the given HTTP method and authenticated with the given key .
* The request data will be serialized into JSON using the client ' s
* { @ link io . keen . client . java . KeenJs... | boolean useOutputSource = true ; if ( HttpMethods . GET . equals ( method ) || HttpMethods . DELETE . equals ( method ) ) { if ( null != requestData && ! requestData . isEmpty ( ) ) { throw new IllegalStateException ( "Trying to send a GET request with a request " + "body, which would result in sending a POST." ) ; } u... |
public class PELoader { /** * For testing purposes only .
* @ param args
* @ throws IOException */
public static void main ( String [ ] args ) throws IOException , AWTException { } } | logger . entry ( ) ; File file = new File ( "/home/karsten/samples/65535sects.exe" ) ; ReportCreator reporter = ReportCreator . apply ( file ) ; reporter . printReport ( ) ; // File file2 = new File ( " / home / katja / samples / tesla2 " ) ;
// List < File > list = new ArrayList < > ( ) ;
// list . add ( file ) ;
// l... |
public class CircularSeekBar { /** * Set the max of the CircularSeekBar .
* If the new max is less than the current progress , then the progress will be set to zero .
* If the progress is changed as a result , then any listener will receive a onProgressChanged event .
* @ param max The new max for the CircularSee... | if ( ! ( max <= 0 ) ) { // Check to make sure it ' s greater than zero
if ( max <= mProgress ) { mProgress = 0 ; // If the new max is less than current progress , set progress to zero
if ( mOnCircularSeekBarChangeListener != null ) { mOnCircularSeekBarChangeListener . onProgressChanged ( this , mProgress , false ) ; } ... |
public class Routable { /** * Maps a filter to be executed after any matching routes even if the route throws any exception
* @ param filter The filter */
public void afterAfter ( Filter filter ) { } } | addFilter ( HttpMethod . afterafter , FilterImpl . create ( SparkUtils . ALL_PATHS , filter ) ) ; |
public class CharSet { /** * < p > Does the { @ code CharSet } contain the specified
* character { @ code ch } . < / p >
* @ param ch the character to check for
* @ return { @ code true } if the set contains the characters */
public boolean contains ( final char ch ) { } } | for ( final CharRange range : set ) { if ( range . contains ( ch ) ) { return true ; } } return false ; |
public class CmsModelPageHelper { /** * Creates a new model group page . < p >
* @ param name the page name
* @ param description the page description
* @ param copyId structure id of the resource to use as a model for the model page , if any ( may be null )
* @ return the new resource
* @ throws CmsException... | CmsResource newPage = null ; CmsResourceTypeConfig config = m_adeConfig . getResourceType ( CmsResourceTypeXmlContainerPage . MODEL_GROUP_TYPE_NAME ) ; if ( ( config != null ) && ! config . isDisabled ( ) ) { if ( copyId == null ) { newPage = config . createNewElement ( m_cms , m_rootResource . getRootPath ( ) ) ; } el... |
public class CmsJspLoader { /** * Generates the taglib directives for a collection of taglib identifiers . < p >
* @ param taglibs the taglib identifiers
* @ return a string containing taglib directives */
protected String generateTaglibInclusions ( Collection < String > taglibs ) { } } | StringBuffer buffer = new StringBuffer ( ) ; for ( String taglib : taglibs ) { String uri = m_taglibs . get ( taglib ) ; if ( uri != null ) { buffer . append ( "<%@ taglib prefix=\"" + taglib + "\" uri=\"" + uri + "\" %>" ) ; } } return buffer . toString ( ) ; |
public class QueryServiceImpl { /** * Splits a list of qualified ( meta - ) annotation names into a proper java
* list .
* @ param rawCorpusNames The qualified names separated by " , " .
* @ return */
private List < MatrixQueryData . QName > splitMatrixKeysFromRaw ( String raw ) { } } | LinkedList < MatrixQueryData . QName > result = new LinkedList < > ( ) ; String [ ] split = raw . split ( "," ) ; for ( String s : split ) { String [ ] nameSplit = s . trim ( ) . split ( ":" , 2 ) ; MatrixQueryData . QName qname = new MatrixQueryData . QName ( ) ; if ( nameSplit . length == 2 ) { qname . namespace = na... |
public class Gtin8Validator { /** * { @ inheritDoc } check if given string is a valid gtin .
* @ see javax . validation . ConstraintValidator # isValid ( java . lang . Object ,
* javax . validation . ConstraintValidatorContext ) */
@ Override public final boolean isValid ( final Object pvalue , final ConstraintVali... | final String valueAsString = Objects . toString ( pvalue , null ) ; if ( StringUtils . isEmpty ( valueAsString ) ) { return true ; } if ( ! StringUtils . isNumeric ( valueAsString ) ) { // EAN8 must be numeric , but that ' s handled by digits annotation
return true ; } if ( valueAsString . length ( ) != GTIN8_LENGTH ) ... |
public class BootstrapContextImpl { /** * Returns the component name of the JCAContextProvider for the specified work context class .
* @ param workContextClass a WorkContext implementation class or ExecutionContext .
* @ return the component name of the JCAContextProvider . */
String getJCAContextProviderName ( Cl... | ServiceReference < JCAContextProvider > ref = null ; for ( Class < ? > cl = workContextClass ; ref == null && cl != null ; cl = cl . getSuperclass ( ) ) ref = contextProviders . getReference ( cl . getName ( ) ) ; String name = ref == null ? null : ( String ) ref . getProperty ( JCAContextProvider . CONTEXT_NAME ) ; if... |
public class AbstractQueryDecorator { /** * ( non - Javadoc )
* @ see org . springframework . data . solr . core . query . Query # setStatsOptions ( org . springframework . data . solr . core . query . StatsOptions ) */
@ Override public < T extends Query > T setStatsOptions ( StatsOptions statsOptions ) { } } | return query . setStatsOptions ( statsOptions ) ; |
public class ISO8859_1Reader { /** * Reads the next character . */
public int read ( char [ ] buf , int offset , int length ) throws IOException { } } | for ( int i = 0 ; i < length ; i ++ ) { int ch = is . read ( ) ; if ( ch < 0 ) return i > 0 ? i : - 1 ; else { buf [ offset + i ] = ( char ) ch ; } } return length ; |
public class SparseArrayContracts { /** * The { @ code Object . hashCode ( ) } contract for a { @ link SparseArray } .
* < pre >
* int hash = 0;
* for ( SparseArrayEntry < ? > entry : sparseArrayEntries ) {
* hash + = entry . hashCode ( ) ;
* return hash ;
* < / pre >
* @ param sparseArrayEntries
* @ re... | int hash = 0 ; for ( SparseArrayEntry < ? > entry : sparseArrayEntries ) { hash += entry . hashCode ( ) ; } return hash ; |
public class SchemaVersionOne { /** * / * ( non - Javadoc )
* @ see net . agkn . hll . serialization . ISchemaVersion # getSerializer ( HLLType , int , int ) */
@ Override public IWordSerializer getSerializer ( HLLType type , int wordLength , int wordCount ) { } } | return new BigEndianAscendingWordSerializer ( wordLength , wordCount , paddingBytes ( type ) ) ; |
public class Campaign { /** * Gets the advertisingChannelSubType value for this Campaign .
* @ return advertisingChannelSubType * Optional refinement of advertisingChannelType . Must be a valid
* sub - type of the parent channel
* type . May only be set for new campaigns and cannot
* be changed once set .
* <... | return advertisingChannelSubType ; |
public class DNSLookup { /** * Checks if a host name has a valid record .
* @ param hostName
* The hostname
* @ param dnsType
* The kind of record ( A , AAAA , MX , . . . )
* @ return Whether the record is available or not
* @ throws DNSLookupException
* Appears on a fatal error like dnsType invalid or in... | return DNSLookup . doLookup ( hostName , dnsType ) > 0 ; |
public class ParsedQuery { /** * Gets a value by the key specified . Unlike ' get ' , checks that the parameter is not null */
public String getString ( String key ) { } } | String value = get ( key ) ; Utils . require ( value != null , key + " parameter is not set" ) ; return value ; |
public class SesameGraphBuilder { /** * / * ( non - Javadoc )
* @ see org . openprovenance . prov . rdf . GraphBuilder # qualifiedNameToURI ( org . openprovenance . prov . model . QualifiedName ) */
@ Override public URIImpl qualifiedNameToURI ( QualifiedName name ) { } } | String unescapedLocalName = qnU . unescapeProvLocalName ( name . getLocalPart ( ) ) ; return new URIImpl ( name . getNamespaceURI ( ) + unescapedLocalName ) ; |
public class CmsADEConfigData { /** * Internal method for getting the function references . < p >
* @ return the function references */
protected List < CmsFunctionReference > internalGetFunctionReferences ( ) { } } | CmsADEConfigData parentData = parent ( ) ; if ( ( parentData == null ) ) { if ( m_data . isModuleConfig ( ) ) { return Collections . unmodifiableList ( m_data . getFunctionReferences ( ) ) ; } else { return Lists . newArrayList ( ) ; } } else { return parentData . internalGetFunctionReferences ( ) ; } |
public class VMMetricsView { /** * Converts the long uptime to an human readable format , examples :
* 2 d , 0 hour , 34 min , 2s
* 12 hours , 12 min , 22s */
private String humanReadable ( long uptime ) { } } | uptime = uptime / 1000 ; int sec = ( int ) uptime % 60 ; uptime /= 60 ; int min = ( int ) uptime % 60 ; uptime /= 60 ; int hour = ( int ) uptime % 24 ; uptime /= 24 ; int day = ( int ) uptime ; String str = "" ; if ( day > 0 ) if ( day > 1 ) str += day + " days, " ; else str += day + " day, " ; // prints 0 hour in case... |
public class FactoryDerivativeSparse { /** * Creates a sparse Laplacian filter .
* @ see DerivativeLaplacian
* @ param imageType The type of image which is to be processed .
* @ param border How the border should be handled . If null { @ link BorderType # EXTENDED } will be used .
* @ return Filter for performi... | if ( border == null ) { border = FactoryImageBorder . single ( imageType , BorderType . EXTENDED ) ; } if ( GeneralizedImageOps . isFloatingPoint ( imageType ) ) { ImageConvolveSparse < GrayF32 , Kernel2D_F32 > r = FactoryConvolveSparse . convolve2D ( GrayF32 . class , DerivativeLaplacian . kernel_F32 ) ; r . setImageB... |
public class CastorMarshaller { /** * Convert the given { @ code XMLException } to an appropriate exception from the
* { @ code org . springframework . oxm } hierarchy .
* < p > A boolean flag is used to indicate whether this exception occurs during marshalling or
* unmarshalling , since Castor itself does not ma... | if ( ex instanceof ValidationException ) { return new ValidationFailureException ( "Castor validation exception" , ex ) ; } else if ( ex instanceof MarshalException ) { if ( marshalling ) { return new MarshallingFailureException ( "Castor marshalling exception" , ex ) ; } else { return new UnmarshallingFailureException... |
public class EventDistributor { /** * with this method you can register EventPublisher add a Source of Events to the System .
* This method represents a higher level of abstraction ! Use the EventManager to fire Events !
* This method is intended for use cases where you have an entire new source of events ( e . g .... | if ( registered . containsKey ( identification ) ) return Optional . empty ( ) ; EventPublisher eventPublisher = new EventPublisher ( events ) ; registered . put ( identification , eventPublisher ) ; return Optional . of ( eventPublisher ) ; |
public class DiffBuilder { /** * Test if two { @ code Objects } s are equal .
* @ param fieldName
* the field name
* @ param lhs
* the left hand { @ code Object }
* @ param rhs
* the right hand { @ code Object }
* @ return this
* @ throws IllegalArgumentException
* if field name is { @ code null } */
... | validateFieldNameNotNull ( fieldName ) ; if ( objectsTriviallyEqual ) { return this ; } if ( lhs == rhs ) { return this ; } Object objectToTest ; if ( lhs != null ) { objectToTest = lhs ; } else { // rhs cannot be null , as lhs ! = rhs
objectToTest = rhs ; } if ( objectToTest . getClass ( ) . isArray ( ) ) { if ( objec... |
public class BugResolution { /** * If getApplicabilityVisitor ( ) is overwritten , this checks
* to see if this resolution applies to the code at the given marker .
* @ param marker
* @ return true if this resolution should be visible to the user at the given marker */
public boolean isApplicable ( IMarker marker... | ASTVisitor prescanVisitor = getApplicabilityVisitor ( ) ; if ( prescanVisitor instanceof ApplicabilityVisitor ) { // this has an implicit null check
return findApplicability ( prescanVisitor , marker ) ; } return true ; |
public class UserAttrs { /** * Returns user - defined - attribute
* @ param path
* @ param attribute user : attribute name . user : can be omitted .
* @ param options
* @ return
* @ throws IOException */
public static final String getStringAttribute ( Path path , String attribute , LinkOption ... options ) th... | attribute = attribute . startsWith ( "user:" ) ? attribute : "user:" + attribute ; byte [ ] attr = ( byte [ ] ) Files . getAttribute ( path , attribute , options ) ; if ( attr == null ) { return null ; } return new String ( attr , UTF_8 ) ; |
public class BackupLongTermRetentionPoliciesInner { /** * Creates or updates a database backup long term retention policy .
* @ 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 n... | return createOrUpdateWithServiceResponseAsync ( resourceGroupName , serverName , databaseName , parameters ) . map ( new Func1 < ServiceResponse < BackupLongTermRetentionPolicyInner > , BackupLongTermRetentionPolicyInner > ( ) { @ Override public BackupLongTermRetentionPolicyInner call ( ServiceResponse < BackupLongTer... |
public class ItemImpl { /** * Checking if this item has valid item state , i . e . wasn ' t removed ( and
* saved ) .
* @ return true or throws an InvalidItemStateException exception otherwise
* @ throws InvalidItemStateException */
protected boolean checkValid ( ) throws InvalidItemStateException { } } | try { session . checkLive ( ) ; } catch ( RepositoryException e ) { throw new InvalidItemStateException ( "This kind of operation is forbidden after a session.logout()." , e ) ; } if ( data == null ) { throw new InvalidItemStateException ( "Invalid item state. Item was removed or discarded." ) ; } session . updateLastA... |
public class InboundTransferTask { /** * Cancels a set of segments and marks them as finished .
* If all segments are cancelled then the whole task is cancelled , as if { @ linkplain # cancel ( ) } was called .
* @ param cancelledSegments the segments to be cancelled */
public void cancelSegments ( IntSet cancelled... | if ( isCancelled ) { throw new IllegalArgumentException ( "The task is already cancelled." ) ; } if ( trace ) { log . tracef ( "Partially cancelling inbound state transfer from node %s, segments %s" , source , cancelledSegments ) ; } synchronized ( segments ) { // healthy paranoia
if ( ! segments . containsAll ( cancel... |
public class ContextManager { /** * Set the context pool configuration . < p / >
* The context pool parameters are not required when < code > enableContextPool = = false < / code > . If < code > enableContextPool = = true < / code > and any of the context pool parameters
* are null , that parameter will be set to t... | final String METHODNAME = "setContextPool" ; this . iContextPoolEnabled = enableContextPool ; if ( iContextPoolEnabled ) { this . iInitPoolSize = initPoolSize == null ? DEFAULT_INIT_POOL_SIZE : initPoolSize ; this . iMaxPoolSize = maxPoolSize == null ? DEFAULT_MAX_POOL_SIZE : maxPoolSize ; this . iPrefPoolSize = prefPo... |
public class ConcurrentLinkedList { /** * Removes and returns the item at the head of the queue . Concurrent calls to
* this method and offerAndGetNode ( ) do not mutually block , however , concurrent
* calls to this method are serialized . */
public E poll ( ) { } } | if ( mSize . get ( ) == 0 ) return null ; mPollLock . lock ( ) ; try { return removeHead ( ) ; } finally { mPollLock . unlock ( ) ; } |
public class VertxCompletableFuture { /** * Returns a new CompletableFuture that is completed when all of the given CompletableFutures complete . If any of
* the given CompletableFutures complete exceptionally , then the returned CompletableFuture also does so , with a
* CompletionException holding this exception a... | CompletableFuture < Void > all = CompletableFuture . allOf ( futures ) ; return VertxCompletableFuture . from ( vertx , all ) ; |
public class SystemPropertiesUtil { /** * 合并系统变量 ( - D ) , 环境变量 和默认值 , 以系统变量优先 */
public static Boolean getBoolean ( String propertyName , String envName , Boolean defaultValue ) { } } | checkEnvName ( envName ) ; Boolean propertyValue = BooleanUtil . toBooleanObject ( System . getProperty ( propertyName ) , null ) ; if ( propertyValue != null ) { return propertyValue ; } else { propertyValue = BooleanUtil . toBooleanObject ( System . getenv ( envName ) , null ) ; return propertyValue != null ? propert... |
public class InMemoryCookieStore { /** * Get all URIs , which are associated with at least one cookie
* of this cookie store . */
public List < URI > getURIs ( ) { } } | List < URI > uris = new ArrayList < URI > ( ) ; lock . lock ( ) ; try { List < URI > result = new ArrayList < URI > ( uriIndex . keySet ( ) ) ; result . remove ( null ) ; return Collections . unmodifiableList ( result ) ; } finally { uris . addAll ( uriIndex . keySet ( ) ) ; lock . unlock ( ) ; } |
public class Saml10ObjectBuilder { /** * New attribute statement .
* @ param subject the subject
* @ param attributes the attributes
* @ param attributeNamespace the attribute namespace
* @ return the attribute statement */
public AttributeStatement newAttributeStatement ( final Subject subject , final Map < St... | val attrStatement = newSamlObject ( AttributeStatement . class ) ; attrStatement . setSubject ( subject ) ; for ( val e : attributes . entrySet ( ) ) { if ( e . getValue ( ) instanceof Collection < ? > && ( ( Collection < ? > ) e . getValue ( ) ) . isEmpty ( ) ) { LOGGER . info ( "Skipping attribute [{}] because it doe... |
public class LocalSession { /** * / * ( non - Javadoc )
* @ see net . timewalker . ffmq4 . common . session . AbstractSession # onSessionClose ( ) */
@ Override protected void onSessionClose ( ) { } } | // Rollback updates
try { if ( hasPendingUpdates ( ) ) rollbackUpdates ( true , true , null ) ; } catch ( JMSException e ) { ErrorTools . log ( e , log ) ; } super . onSessionClose ( ) ; |
public class Monetary { /** * Returns all factory instances that match the query .
* @ param query the factory query , not null .
* @ return the instances found , never null . */
public static Collection < MonetaryAmountFactory < ? > > getAmountFactories ( MonetaryAmountFactoryQuery query ) { } } | return Optional . ofNullable ( monetaryAmountsSingletonQuerySpi ( ) ) . orElseThrow ( ( ) -> new MonetaryException ( "No MonetaryAmountsSingletonQuerySpi loaded, query functionality is not available." ) ) . getAmountFactories ( query ) ; |
public class A_CmsListDialog { /** * Returns the current selected item . < p >
* @ return the current selected item */
public CmsListItem getSelectedItem ( ) { } } | try { return getList ( ) . getItem ( CmsStringUtil . splitAsArray ( getParamSelItems ( ) , CmsHtmlList . ITEM_SEPARATOR ) [ 0 ] . trim ( ) ) ; } catch ( Exception e ) { try { return getList ( ) . getItem ( "" ) ; } catch ( Exception e1 ) { return null ; } } |
public class SSLChannelProvider { /** * Required service : this is not dynamic , and so is called after deactivate
* @ param ref reference to the service */
protected void unsetSslSupport ( SSLSupport service ) { } } | sslSupport = null ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "unsetSslSupport" , service ) ; } |
public class ObjectFactory { /** * Create an instance of { @ link Project . Calendars . Calendar . WeekDays . WeekDay . WorkingTimes . WorkingTime } */
public Project . Calendars . Calendar . WeekDays . WeekDay . WorkingTimes . WorkingTime createProjectCalendarsCalendarWeekDaysWeekDayWorkingTimesWorkingTime ( ) { } } | return new Project . Calendars . Calendar . WeekDays . WeekDay . WorkingTimes . WorkingTime ( ) ; |
public class CollidableUpdater { /** * Check if the collidable entered in collision with another one .
* @ param origin The origin used .
* @ param provider The provider owner .
* @ param transformable The transformable owner .
* @ param other The collidable reference .
* @ param accepted The accepted groups ... | final List < Collision > collisions = new ArrayList < > ( ) ; if ( enabled && other . isEnabled ( ) && accepted . contains ( other . getGroup ( ) ) ) { final int size = cacheColls . size ( ) ; for ( int i = 0 ; i < size ; i ++ ) { final Collision collision = collide ( origin , provider , transformable , other , cacheCo... |
public class DeleteCommand { /** * Webdav Delete method implementation .
* @ param session current session
* @ param path file path
* @ param lockTokenHeader lock tokens
* @ return the instance of javax . ws . rs . core . Response */
public Response delete ( Session session , String path , String lockTokenHeade... | try { if ( lockTokenHeader == null ) { lockTokenHeader = "" ; } Item item = session . getItem ( path ) ; if ( item . isNode ( ) ) { Node node = ( Node ) item ; if ( node . isLocked ( ) ) { String nodeLockToken = node . getLock ( ) . getLockToken ( ) ; if ( ( nodeLockToken == null ) || ( ! nodeLockToken . equals ( lockT... |
public class ImageSizeImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . IMAGE_SIZE__UNITBASE : setUNITBASE ( UNITBASE_EDEFAULT ) ; return ; case AfplibPackage . IMAGE_SIZE__HRESOL : setHRESOL ( HRESOL_EDEFAULT ) ; return ; case AfplibPackage . IMAGE_SIZE__VRESOL : setVRESOL ( VRESOL_EDEFAULT ) ; return ; case AfplibPackage . IMAGE_SIZE__HSIZE : s... |
public class BytesMessageImpl { /** * ( non - Javadoc )
* @ see javax . jms . BytesMessage # readBoolean ( ) */
@ Override public boolean readBoolean ( ) throws JMSException { } } | backupState ( ) ; try { return getInput ( ) . readBoolean ( ) ; } catch ( EOFException e ) { restoreState ( ) ; throw new MessageEOFException ( "End of body reached" ) ; } catch ( IOException e ) { restoreState ( ) ; throw new FFMQException ( "Cannot read message body" , "IO_ERROR" , e ) ; } catch ( RuntimeException e ... |
public class HijriCalendar { /** * / * [ deutsch ]
* < p > Erzeugt ein neues Hijri - Kalenderdatum in der angegebenen Variante . < / p >
* @ param variantSource source of calendar variant
* @ param hyear islamic year
* @ param hmonth islamic month
* @ param hdom islamic day of month
* @ return new instance ... | return HijriCalendar . of ( variantSource . getVariant ( ) , hyear , hmonth . getValue ( ) , hdom ) ; |
public class Joiner { /** * Adds the contents of the given { @ code StringJoiner } without prefix and
* suffix as the next element if it is non - empty . If the given { @ code
* StringJoiner } is empty , the call has no effect .
* < p > A { @ code StringJoiner } is empty if { @ link # addAll ( CharSequence ) add ... | N . checkArgNotNull ( other ) ; if ( other . buffer != null ) { final int length = other . buffer . length ( ) ; // lock the length so that we can seize the data to be appended
// before initiate copying to avoid interference , especially when
// merge ' this '
StringBuilder builder = prepareBuilder ( ) ; builder . app... |
public class AbstractCompressionCodec { /** * TODO : make protected on a minor release */
byte [ ] writeAndClose ( byte [ ] payload , StreamWrapper wrapper ) throws IOException { } } | ByteArrayOutputStream outputStream = new ByteArrayOutputStream ( 512 ) ; OutputStream compressionStream = wrapper . wrap ( outputStream ) ; try { compressionStream . write ( payload ) ; compressionStream . flush ( ) ; } finally { Objects . nullSafeClose ( compressionStream ) ; } return outputStream . toByteArray ( ) ; |
public class LocPathIterator { /** * Return the first node out of the nodeset , if this expression is
* a nodeset expression . This is the default implementation for
* nodesets . Derived classes should try and override this and return a
* value without having to do a clone operation .
* @ param xctxt The XPath ... | DTMIterator iter = ( DTMIterator ) m_clones . getInstance ( ) ; int current = xctxt . getCurrentNode ( ) ; iter . setRoot ( current , xctxt ) ; int next = iter . nextNode ( ) ; // m _ clones . freeInstance ( iter ) ;
iter . detach ( ) ; return next ; |
public class ParticleEditor { /** * Import an emitter XML file */
public void importEmitter ( ) { } } | chooser . setDialogTitle ( "Open" ) ; int resp = chooser . showOpenDialog ( this ) ; if ( resp == JFileChooser . APPROVE_OPTION ) { File file = chooser . getSelectedFile ( ) ; File path = file . getParentFile ( ) ; try { final ConfigurableEmitter emitter = ParticleIO . loadEmitter ( file ) ; if ( emitter . getImageName... |
public class PollingMultiFileWatcher { /** * Stops polling the files for changes . Should be called during server shutdown or when this watcher is no
* longer needed to make sure the background thread is stopped . */
@ Override public void shutdown ( ) { } } | if ( isStarted ( ) ) { future . cancel ( true ) ; executorService . shutdown ( ) ; future = null ; executorService = null ; watchedFiles = ImmutableSet . of ( ) ; callback = null ; metadataCacheRef . set ( ImmutableMap . of ( ) ) ; stats . clear ( ) ; } |
public class PolicyAssignmentsInner { /** * Deletes a policy assignment by ID .
* When providing a scope for the assigment , use ' / subscriptions / { subscription - id } / ' for subscriptions , ' / subscriptions / { subscription - id } / resourceGroups / { resource - group - name } ' for resource groups , and ' / su... | return deleteByIdWithServiceResponseAsync ( policyAssignmentId ) . map ( new Func1 < ServiceResponse < PolicyAssignmentInner > , PolicyAssignmentInner > ( ) { @ Override public PolicyAssignmentInner call ( ServiceResponse < PolicyAssignmentInner > response ) { return response . body ( ) ; } } ) ; |
public class Serializables { /** * Utility for returning a Serializable object from a byte array . */
public static < T extends Serializable > T deserialize ( byte [ ] bytes ) throws IOException , ClassNotFoundException { } } | return deserialize ( bytes , false ) ; |
public class SurveyorUncaughtExceptionHandler { /** * Given a stack trace , turn it into a HTML formatted string - to improve its display
* @ param stackTrace - stack trace to convert to string
* @ return String with stack trace formatted with HTML line breaks */
private String printStackTrace ( Object [ ] stackTra... | StringBuilder output = new StringBuilder ( ) ; for ( Object line : stackTrace ) { output . append ( line ) ; output . append ( newline ) ; } return output . toString ( ) ; |
public class LogGammaDistribution { /** * LogGamma distribution PDF ( with 0.0 for x & lt ; 0)
* @ param x query value
* @ param k Alpha
* @ param theta Theta = 1 / Beta
* @ return probability density */
public static double pdf ( double x , double k , double theta , double shift ) { } } | x = ( x - shift ) ; return x <= 0. ? 0. : FastMath . pow ( theta , k ) / GammaDistribution . gamma ( k ) * FastMath . pow ( 1 + x , - ( theta + 1. ) ) * FastMath . pow ( FastMath . log1p ( x ) , k - 1. ) ; |
public class ModelsImpl { /** * Deletes a hierarchical entity extractor child from the application .
* @ param appId The application ID .
* @ param versionId The version ID .
* @ param hEntityId The hierarchical entity extractor ID .
* @ param hChildId The hierarchical entity extractor child ID .
* @ throws I... | return deleteHierarchicalEntityChildWithServiceResponseAsync ( appId , versionId , hEntityId , hChildId ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class DefaultActionBuilder { /** * 根据class对应的profile获得ctl / action类中除去后缀后的名字 。 < br >
* 如果对应profile中是uriStyle , 那么类中只保留简单类名 , 去掉后缀 , 并且小写第一个字母 。 < br >
* 否则加上包名 , 其中的 . 编成URI路径分割符 。 包名不做其他处理 。 < br >
* 复杂URL , 以 / 开始
* @ param className */
public Action build ( Class < ? > clazz ) { } } | Action action = new Action ( ) ; String className = clazz . getName ( ) ; Profile profile = profileService . getProfile ( className ) ; org . beangle . struts2 . annotation . Action an = clazz . getAnnotation ( org . beangle . struts2 . annotation . Action . class ) ; StringBuilder sb = new StringBuilder ( ) ; // names... |
public class IpCamDevice { /** * This method will send HTTP HEAD request to the camera URL to check whether it ' s online or
* offline . It ' s online when this request succeed and it ' s offline if any exception occurs or
* response code is 404 Not Found .
* @ return True if camera is online , false otherwise */... | LOG . debug ( "Checking online status for {} at {}" , getName ( ) , getURL ( ) ) ; try { return client . execute ( new HttpHead ( toURI ( getURL ( ) ) ) ) . getStatusLine ( ) . getStatusCode ( ) != 404 ; } catch ( Exception e ) { return false ; } |
public class Snappy { /** * Uncompress the input [ offset , offset + length ) as a String of the given
* encoding
* @ param input
* @ param offset
* @ param length
* @ param encoding
* @ return the uncompressed data
* @ throws IOException */
public static String uncompressString ( byte [ ] input , int off... | byte [ ] uncompressed = new byte [ uncompressedLength ( input , offset , length ) ] ; uncompress ( input , offset , length , uncompressed , 0 ) ; return new String ( uncompressed , encoding ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.