signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class RTMPHandshake { /** * Prepare the ciphers .
* @ param sharedSecret shared secret byte sequence */
protected void initRC4Encryption ( byte [ ] sharedSecret ) { } } | log . debug ( "Shared secret: {}" , Hex . encodeHexString ( sharedSecret ) ) ; // create output cipher
log . debug ( "Outgoing public key [{}]: {}" , outgoingPublicKey . length , Hex . encodeHexString ( outgoingPublicKey ) ) ; byte [ ] rc4keyOut = new byte [ 32 ] ; // digest is 32 bytes , but our key is 16
calculateHMA... |
public class CXDChunk { /** * extract fp value from an ( byte ) offset */
protected final double getFValue ( int off ) { } } | if ( _valsz == 8 ) return UDP . get8d ( _mem , off + _ridsz ) ; throw H2O . unimpl ( ) ; |
public class DefaultLoginWebflowConfigurer { /** * Create gateway request check decision state .
* @ param flow the flow */
protected void createGatewayRequestCheckDecisionState ( final Flow flow ) { } } | createDecisionState ( flow , CasWebflowConstants . STATE_ID_GATEWAY_REQUEST_CHECK , "requestParameters.gateway != '' and requestParameters.gateway != null and flowScope.service != null" , CasWebflowConstants . STATE_ID_GATEWAY_SERVICES_MGMT_CHECK , CasWebflowConstants . STATE_ID_SERVICE_AUTHZ_CHECK ) ; |
public class Context { /** * Remove an object from the list of objects registered to receive
* notification of changes to a bounded property
* @ see java . beans . PropertyChangeEvent
* @ see # addPropertyChangeListener ( java . beans . PropertyChangeListener )
* @ param l the listener */
public final void remo... | if ( sealed ) onSealedMutation ( ) ; propertyListeners = Kit . removeListener ( propertyListeners , l ) ; |
public class DescribeElasticGpusRequest { /** * The Elastic Graphics accelerator IDs .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setElasticGpuIds ( java . util . Collection ) } or { @ link # withElasticGpuIds ( java . util . Collection ) } if you want
... | if ( this . elasticGpuIds == null ) { setElasticGpuIds ( new com . amazonaws . internal . SdkInternalList < String > ( elasticGpuIds . length ) ) ; } for ( String ele : elasticGpuIds ) { this . elasticGpuIds . add ( ele ) ; } return this ; |
public class Ifc4FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public IfcMedicalDeviceTypeEnum createIfcMedicalDeviceTypeEnumFromString ( EDataType eDataType , String initialValue ) { } } | IfcMedicalDeviceTypeEnum result = IfcMedicalDeviceTypeEnum . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class LegacyBehavior { /** * When executing an async job for an activity wrapped in an miBody , set the execution to the
* miBody except the wrapped activity is marked as async .
* Background : in < = 7.2 async jobs were created for the inner activity , although the
* semantics are that they are executed b... | ActivityImpl activity = execution . getActivity ( ) ; if ( ! isAsync ( activity ) && isActivityWrappedInMultiInstanceBody ( activity ) ) { execution . setActivity ( ( ActivityImpl ) activity . getFlowScope ( ) ) ; } |
public class V1InstanceCreator { /** * Create a new note with a name , asset , content , and ' personal ' flag .
* @ param name The initial name of the note .
* @ param asset The asset this note belongs to .
* @ param content The content of the note .
* @ param personal True if this note is only visible to .
... | Note note = new Note ( instance ) ; note . setAsset ( asset ) ; note . setName ( name ) ; note . setContent ( content ) ; note . setPersonal ( personal ) ; addAttributes ( note , attributes ) ; note . save ( ) ; return note ; |
public class TregexParser { /** * pertains to this node gets passed all the way down to the Description node */
final public TregexPattern Node ( Relation r ) throws ParseException { } } | TregexPattern node ; switch ( ( jj_ntk == - 1 ) ? jj_ntk ( ) : jj_ntk ) { case 12 : jj_consume_token ( 12 ) ; node = SubNode ( r ) ; jj_consume_token ( 13 ) ; break ; case IDENTIFIER : case BLANK : case REGEX : case 14 : case 15 : case 18 : case 19 : node = ModDescription ( r ) ; break ; default : jj_la1 [ 0 ] = jj_gen... |
public class COSAPIClient { /** * Copy a single object in the bucket via a COPY operation .
* @ param srcKey source object path
* @ param dstKey destination object path
* @ param size object size
* @ throws AmazonClientException on failures inside the AWS SDK
* @ throws InterruptedIOException the operation wa... | LOG . debug ( "copyFile {} -> {} " , srcKey , dstKey ) ; CopyObjectRequest copyObjectRequest = new CopyObjectRequest ( mBucket , srcKey , mBucket , dstKey ) ; try { ObjectMetadata srcmd = getObjectMetadata ( srcKey ) ; if ( srcmd != null ) { copyObjectRequest . setNewObjectMetadata ( srcmd ) ; } ProgressListener progre... |
public class DefaultWebElementsFactory { /** * ( non - Javadoc )
* @ see
* minium . web . internal . InternalWebElementsFactory # createMixin ( minium . webElements */
@ Override public T createMixin ( final Elements elems ) { } } | AbstractMixinInitializer initializer = new AbstractMixinInitializer ( ) { @ Override protected void initialize ( ) { implement ( Object . class ) . with ( elems ) ; implement ( InternalWebElements . class ) . with ( elems ) ; implement ( FreezableElements . class ) . with ( elems ) ; implement ( ExpressionWebElements .... |
public class InitialValueFinder { /** * Gets all possible values the given variable may have after initialisation
* of its class . { @ link # run ( ) } has to be invoked beforehand !
* @ return all possible values the given variable may have after
* initialisation of its class . This is never { @ code null } .
... | if ( ! arePossibleInitialValuesAlreadyFound ) { findPossibleInitialValues ( ) ; arePossibleInitialValuesAlreadyFound = true ; } return Collections . unmodifiableSet ( possibleInitialValues ) ; |
public class tunneltrafficpolicy { /** * Use this API to fetch all the tunneltrafficpolicy resources that are configured on netscaler . */
public static tunneltrafficpolicy [ ] get ( nitro_service service , options option ) throws Exception { } } | tunneltrafficpolicy obj = new tunneltrafficpolicy ( ) ; tunneltrafficpolicy [ ] response = ( tunneltrafficpolicy [ ] ) obj . get_resources ( service , option ) ; return response ; |
public class DemoShowLargeAssembly { /** * Load a specific biological assembly for a PDB entry
* @ param pdbId . . the PDB ID
* @ param bioAssemblyId . . the first assembly has the bioAssemblyId 1
* @ return a Structure object or null if something went wrong . */
public static Structure readStructure ( String pdb... | // pre - computed files use lower case PDB IDs
pdbId = pdbId . toLowerCase ( ) ; // we just need this to track where to store PDB files
// this checks the PDB _ DIR property ( and uses a tmp location if not set )
AtomCache cache = new AtomCache ( ) ; cache . setUseMmCif ( true ) ; FileParsingParameters p = cache . getF... |
public class NodeBuilder { /** * copies children from copyf to the builder , up to the provided index in copyf ( exclusive ) */
private void copyChildren ( int upToChildPosition ) { } } | // ( ensureRoom isn ' t called here , as we should always be at / behind key additions )
if ( copyFromChildPosition >= upToChildPosition ) return ; int len = upToChildPosition - copyFromChildPosition ; if ( len > 0 ) { System . arraycopy ( copyFrom , getKeyEnd ( copyFrom ) + copyFromChildPosition , buildChildren , buil... |
public class LeaderBoard { /** * Create a map of information that describes how to write pipeline output to BigQuery . This map
* is used to write user score sums . */
protected static Map < String , WriteToBigQuery . FieldInfo < KV < String , Integer > > > configureGlobalWindowBigQueryWrite ( ) { } } | Map < String , WriteToBigQuery . FieldInfo < KV < String , Integer > > > tableConfigure = configureBigQueryWrite ( ) ; tableConfigure . put ( "processing_time" , new WriteToBigQuery . FieldInfo < > ( "STRING" , ( c , w ) -> GameConstants . DATE_TIME_FORMATTER . print ( Instant . now ( ) ) ) ) ; return tableConfigure ; |
public class RecommendationsInner { /** * Disable all recommendations for an app .
* Disable all recommendations for an app .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param siteName Name of the app .
* @ throws IllegalArgumentException thrown if parameters fail ... | return disableAllForWebAppWithServiceResponseAsync ( resourceGroupName , siteName ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ; |
public class GeomUtil { /** * Computes and returns the dot product of the two vectors . See { @ link
* # dot ( Point , Point , Point , Point ) } for an explanation of the arguments */
public static int dot ( int v1sx , int v1sy , int v1ex , int v1ey , int v2sx , int v2sy , int v2ex , int v2ey ) { } } | return ( ( v1ex - v1sx ) * ( v2ex - v2sx ) + ( v1ey - v1sy ) * ( v2ey - v2sy ) ) ; |
public class PartitionRequestQueue { /** * Adds unannounced credits from the consumer and enqueues the corresponding reader for this
* consumer ( if not enqueued yet ) .
* @ param receiverId The input channel id to identify the consumer .
* @ param credit The unannounced credits of the consumer . */
void addCredi... | if ( fatalError ) { return ; } NetworkSequenceViewReader reader = allReaders . get ( receiverId ) ; if ( reader != null ) { reader . addCredit ( credit ) ; enqueueAvailableReader ( reader ) ; } else { throw new IllegalStateException ( "No reader for receiverId = " + receiverId + " exists." ) ; } |
public class RegisterTaskWithMaintenanceWindowRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( RegisterTaskWithMaintenanceWindowRequest registerTaskWithMaintenanceWindowRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( registerTaskWithMaintenanceWindowRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( registerTaskWithMaintenanceWindowRequest . getWindowId ( ) , WINDOWID_BINDING ) ; protocolMarshaller . marshall ( registerTaskWithMaintenanceWin... |
public class CProductPersistenceImpl { /** * Clears the cache for all c products .
* The { @ link EntityCache } and { @ link FinderCache } are both cleared by this method . */
@ Override public void clearCache ( ) { } } | entityCache . clearCache ( CProductImpl . class ) ; finderCache . clearCache ( FINDER_CLASS_NAME_ENTITY ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITH_PAGINATION ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION ) ; |
public class BRSImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . BRS__RS_NAME : setRSName ( RS_NAME_EDEFAULT ) ; return ; case AfplibPackage . BRS__TRIPLETS : getTriplets ( ) . clear ( ) ; return ; } super . eUnset ( featureID ) ; |
public class CrawljaxRunner { /** * Reads input data from a JSON file in the output directory . */
private void readFormDataFromFile ( ) { } } | List < FormInput > formInputList = FormInputValueHelper . deserializeFormInputs ( config . getSiteDir ( ) ) ; if ( formInputList != null ) { InputSpecification inputSpecs = config . getCrawlRules ( ) . getInputSpecification ( ) ; for ( FormInput input : formInputList ) { inputSpecs . inputField ( input ) ; } } |
public class TouchAction { /** * Tap on an element .
* @ param tapOptions see { @ link TapOptions } .
* @ return this TouchAction , for chaining . */
public T tap ( TapOptions tapOptions ) { } } | ActionParameter action = new ActionParameter ( "tap" , tapOptions ) ; parameterBuilder . add ( action ) ; return ( T ) this ; |
public class DB { /** * Selects the term ids for all with the specified name .
* @ param name The term name .
* @ return The list of ids .
* @ throws SQLException on database error . */
public Set < Long > selectTermIds ( final String name ) throws SQLException { } } | Connection conn = null ; PreparedStatement stmt = null ; ResultSet rs = null ; Set < Long > ids = Sets . newHashSetWithExpectedSize ( 4 ) ; try { conn = connectionSupplier . getConnection ( ) ; stmt = conn . prepareStatement ( selectTermIdsSQL ) ; stmt . setString ( 1 , name ) ; rs = stmt . executeQuery ( ) ; while ( r... |
public class CompositeELResolver { /** * For a given base and property , attempts to determine whether a call to
* { @ link # setValue ( ELContext , Object , Object , Object ) } will always fail . The result is obtained
* by querying all component resolvers . If this resolver handles the given ( base , property )
... | context . setPropertyResolved ( false ) ; for ( int i = 0 , l = resolvers . size ( ) ; i < l ; i ++ ) { boolean readOnly = resolvers . get ( i ) . isReadOnly ( context , base , property ) ; if ( context . isPropertyResolved ( ) ) { return readOnly ; } } return false ; |
public class FastCloner { /** * deep clones " o " .
* @ param < T >
* the type of " o "
* @ param o
* the object to be deep - cloned
* @ return a deep - clone of " o " . */
public < T > T deepClone ( final T o ) { } } | if ( o == null ) { return null ; } if ( ! this . cloningEnabled ) { return o ; } if ( this . dumpClonedClasses ) { System . out . println ( "start>" + o . getClass ( ) ) ; } final Map < Object , Object > clones = new IdentityHashMap < Object , Object > ( 16 ) ; try { return cloneInternal ( o , clones ) ; } catch ( fina... |
public class Eval { /** * Evaluates a snippet of source .
* @ param userSource the source of the snippet
* @ return the list of primary and update events
* @ throws IllegalStateException */
List < SnippetEvent > eval ( String userSource ) throws IllegalStateException { } } | List < SnippetEvent > allEvents = new ArrayList < > ( ) ; for ( Snippet snip : sourceToSnippets ( userSource ) ) { if ( snip . kind ( ) == Kind . ERRONEOUS ) { state . maps . installSnippet ( snip ) ; allEvents . add ( new SnippetEvent ( snip , Status . NONEXISTENT , Status . REJECTED , false , null , null , null ) ) ;... |
public class IntObjectHashMap { /** * Check if the tables contain an element associated with specified key
* at specified index .
* @ param key key to check
* @ param index index to check
* @ return true if an element is associated with key at index */
private boolean containsKey ( final int key , final int ind... | return ( key != 0 || states [ index ] == FULL ) && keys [ index ] == key ; |
public class RingBuffer { /** * Create a new single producer RingBuffer using the default wait strategy { @ link BlockingWaitStrategy } .
* @ param < E > Class of the event stored in the ring buffer .
* @ param factory used to create the events within the ring buffer .
* @ param bufferSize number of elements to c... | return createSingleProducer ( factory , bufferSize , new BlockingWaitStrategy ( ) ) ; |
public class VirtualHostKeySelector { /** * Read the CN out of the cert */
private String getCertCN ( X509Certificate x509 ) throws CertificateParsingException { } } | X500Principal principal = x509 . getSubjectX500Principal ( ) ; String subjectName = principal . getName ( ) ; String [ ] fields = subjectName . split ( "," ) ; for ( String field : fields ) { if ( field . startsWith ( "CN=" ) ) { String serverName = field . substring ( 3 ) ; return serverName . toLowerCase ( ) ; } } th... |
public class ModCluster { /** * Start advertising a mcmp handler .
* @ param config the mcmp handler config
* @ throws IOException */
public synchronized void advertise ( MCMPConfig config ) throws IOException { } } | final MCMPConfig . AdvertiseConfig advertiseConfig = config . getAdvertiseConfig ( ) ; if ( advertiseConfig == null ) { throw new IllegalArgumentException ( "advertise not enabled" ) ; } MCMPAdvertiseTask . advertise ( container , advertiseConfig , xnioWorker ) ; |
public class SwingApplication { /** * Mouse pressed mouse adapter .
* @ param consumer the consumer
* @ return the mouse adapter */
public static MouseAdapter mousePressed ( @ NonNull Consumer < MouseEvent > consumer ) { } } | return new MouseAdapter ( ) { @ Override public void mousePressed ( MouseEvent e ) { consumer . accept ( e ) ; super . mousePressed ( e ) ; } } ; |
public class CommPortIdentifier { /** * Gets communication port identifier
* @ param p - port for which identifier object is returned
* @ return - port identifier object
* @ throws NoSuchPortException - in case the non existing serial port found */
static public CommPortIdentifier getPortIdentifier ( CommPort p )... | LOGGER . fine ( "CommPortIdentifier:getPortIdentifier(CommPort)" ) ; CommPortIdentifier c ; synchronized ( Sync ) { c = CommPortIndex ; while ( c != null && c . commPort != p ) { c = c . next ; } } if ( c != null ) { return ( c ) ; } LOGGER . fine ( "not found!" + p . getName ( ) ) ; throw new NoSuchPortException ( ) ; |
public class TypeConverter { /** * Convert the passed source value to int
* @ param aSrcValue
* The source value . May be < code > null < / code > .
* @ param nDefault
* The default value to be returned if an error occurs during type
* conversion .
* @ return The converted value .
* @ throws RuntimeExcept... | final Integer aValue = convert ( aSrcValue , Integer . class , null ) ; return aValue == null ? nDefault : aValue . intValue ( ) ; |
public class Source { /** * Delves through the parboiled node tree to find comments . */
private boolean gatherComments ( org . parboiled . Node < Node > parsed ) { } } | boolean foundComments = false ; for ( org . parboiled . Node < Node > child : parsed . getChildren ( ) ) { foundComments |= gatherComments ( child ) ; } List < Comment > cmts = registeredComments . get ( parsed ) ; if ( cmts != null ) for ( Comment c : cmts ) { comments . add ( c ) ; return true ; } return foundComment... |
public class SchemaManager { /** * After addition or removal of columns and indexes all views that
* reference the table should be recompiled . */
void recompileDependentObjects ( Table table ) { } } | OrderedHashSet set = getReferencingObjects ( table . getName ( ) ) ; Session session = database . sessionManager . getSysSession ( ) ; for ( int i = 0 ; i < set . size ( ) ; i ++ ) { HsqlName name = ( HsqlName ) set . get ( i ) ; switch ( name . type ) { case SchemaObject . VIEW : case SchemaObject . CONSTRAINT : case ... |
public class VectorPackingHeapDecorator { /** * check each rule 1.1 ( lower or upper bound ) against the bin with the maximum loadSlack
* possibly filter the bound of the binLoad variable , update the heap
* and continue until the rule does not apply
* @ param d the dimension
* @ param delta the global slack to... | assert maxSlackBinHeap != null ; int nChanges = 0 ; if ( loadSlack ( d , maxSlackBinHeap . get ( d ) . peek ( ) ) > delta ) { do { int b = maxSlackBinHeap . get ( d ) . poll ( ) ; if ( isSup ) { p . filterLoadSup ( d , b , delta + p . loads [ d ] [ b ] . getLB ( ) ) ; } else { p . filterLoadInf ( d , b , p . loads [ d ... |
public class Dag { /** * Concatenate two dags together . Join the " other " dag to " this " dag and return " this " dag .
* The concatenate method ensures that all the jobs of " this " dag ( which may have multiple end nodes )
* are completed before starting any job of the " other " dag . This is done by adding eac... | if ( other == null || other . isEmpty ( ) ) { return this ; } if ( this . isEmpty ( ) ) { return other ; } for ( DagNode node : getDependencyNodes ( forkNodes ) ) { if ( ! this . parentChildMap . containsKey ( node ) ) { this . parentChildMap . put ( node , Lists . newArrayList ( ) ) ; } for ( DagNode otherNode : other... |
public class UserEventMessenger { /** * Send an EventMessage directly to the client specified with the user parameter . If
* there is no entry in the { @ link SimpUserRegistry } for this user nothing happens .
* In contrast to { @ link # sendToUser ( String , Object , String ) } this method does not
* check if th... | sendToUsersDirect ( topicURI , event , Collections . singleton ( user ) ) ; |
public class MtasSolrComponentCollection { /** * ( non - Javadoc )
* @ see
* mtas . solr . handler . component . util . MtasSolrComponent # distributedProcess ( org .
* apache . solr . handler . component . ResponseBuilder ,
* mtas . codec . util . CodecComponent . ComponentFields ) */
@ SuppressWarnings ( "unc... | // System . out . println ( " collection : " + System . nanoTime ( ) + " - "
// + Thread . currentThread ( ) . getId ( ) + " - "
// + rb . req . getParams ( ) . getBool ( " isShard " , false ) + " DISTRIBUTEDPROCESS "
// + rb . stage + " " + rb . req . getParamString ( ) ) ;
NamedList < Object > mtasResponse = null ; t... |
public class JCRStoreResource { /** * Gets the folder node .
* @ return the folder node
* @ throws EFapsException on error
* @ throws RepositoryException the repository exception */
protected Node getFolderNode ( ) throws EFapsException , RepositoryException { } } | Node ret = getSession ( ) . getRootNode ( ) ; if ( getProperties ( ) . containsKey ( JCRStoreResource . PROPERTY_BASEFOLDER ) ) { if ( ret . hasNode ( getProperties ( ) . get ( JCRStoreResource . PROPERTY_BASEFOLDER ) ) ) { ret = ret . getNode ( getProperties ( ) . get ( JCRStoreResource . PROPERTY_BASEFOLDER ) ) ; } e... |
public class SoftHashSet { /** * Adds the specified element to this set if it is not already
* present .
* @ param obj element to be added to this set .
* @ return < tt > true < / tt > if the set did not already contain the specified
* element . */
public boolean add ( Object obj ) { } } | if ( obj == null ) { obj = NULL ; } Entry tab [ ] = mTable ; int hash = hashCode ( obj ) ; int index = ( hash & 0x7FFFFFFF ) % tab . length ; for ( Entry e = tab [ index ] , prev = null ; e != null ; e = e . mNext ) { Object iobj = e . get ( ) ; if ( iobj == null ) { // Clean up after a cleared Reference .
if ( prev !=... |
public class fis { /** * Use this API to fetch all the fis resources that are configured on netscaler . */
public static fis [ ] get ( nitro_service service ) throws Exception { } } | fis obj = new fis ( ) ; fis [ ] response = ( fis [ ] ) obj . get_resources ( service ) ; return response ; |
public class VirtualNetworkLinksInner { /** * Updates a virtual network link to the specified Private DNS zone .
* @ param resourceGroupName The name of the resource group .
* @ param privateZoneName The name of the Private DNS zone ( without a terminating dot ) .
* @ param virtualNetworkLinkName The name of the ... | return updateWithServiceResponseAsync ( resourceGroupName , privateZoneName , virtualNetworkLinkName , parameters , ifMatch ) . map ( new Func1 < ServiceResponse < VirtualNetworkLinkInner > , VirtualNetworkLinkInner > ( ) { @ Override public VirtualNetworkLinkInner call ( ServiceResponse < VirtualNetworkLinkInner > res... |
public class SubscriptionDefinitionImpl { /** * Returns the selector .
* @ return String */
public String getSelector ( ) { } } | if ( tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getSelector" ) ; SibTr . exit ( tc , "getSelector" , selector ) ; } return selector ; |
public class AWSCognitoIdentityProviderClient { /** * Set the user pool MFA configuration .
* @ param setUserPoolMfaConfigRequest
* @ return Result of the SetUserPoolMfaConfig operation returned by the service .
* @ throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service enco... | request = beforeClientExecution ( request ) ; return executeSetUserPoolMfaConfig ( request ) ; |
public class Util { /** * Read all bytes from an InputStream into a byte array . Can be replaced with < code > Files . readAllBytes ( ) < / code > once
* the code is migrated to Java 7.
* @ param pInputStream the input stream
* @ return the complete contents read from the input stream
* @ throws IOException I /... | ByteArrayOutputStream baos = null ; BufferedInputStream bis = null ; try { baos = new ByteArrayOutputStream ( IO_BUFFER_SIZE_BYTES ) ; bis = new BufferedInputStream ( pInputStream , IO_BUFFER_SIZE_BYTES ) ; byte [ ] buffer = new byte [ IO_BUFFER_SIZE_BYTES ] ; for ( int bytesRead = bis . read ( buffer ) ; bytesRead > 0... |
public class br_configurebandwidth5x { /** * < pre >
* Use this operation to configure Repeater bandwidth of devices of version 5 . x or earlier .
* < / pre > */
public static br_configurebandwidth5x configurebandwidth5x ( nitro_service client , br_configurebandwidth5x resource ) throws Exception { } } | return ( ( br_configurebandwidth5x [ ] ) resource . perform_operation ( client , "configurebandwidth5x" ) ) [ 0 ] ; |
public class AbstractAuditEventMessageImpl { /** * Create and set an Event Identification block for this audit event message
* @ param outcome The Event Outcome Indicator
* @ param action The Event Action Code
* @ param id The Event ID
* @ param type The Event Type Code
* @ return The Event Identification blo... | EventIdentificationType eventBlock = new EventIdentificationType ( ) ; eventBlock . setEventID ( id ) ; eventBlock . setEventDateTime ( TimestampUtils . getRFC3881Timestamp ( eventDateTime ) ) ; if ( ! EventUtils . isEmptyOrNull ( action ) ) { eventBlock . setEventActionCode ( action . getCode ( ) ) ; } if ( ! EventUti... |
public class AbstractCloseableConnectorResponse { /** * Implements the default close behavior */
public void close ( ) { } } | Closeable closable = getClosable ( ) ; try { LOG . closingResponse ( this ) ; closable . close ( ) ; LOG . successfullyClosedResponse ( this ) ; } catch ( IOException e ) { throw LOG . exceptionWhileClosingResponse ( e ) ; } |
public class LayerManagerPanel { /** * Loops through this layer panel ' s layer / checkbox list and updates the checkbox font to indicate whether the
* corresponding layer was just rendered . This method is called by a rendering listener - - see comment below .
* @ param wwd the world window . */
protected void upd... | for ( GeneralLayerPanel layerPanel : this . layerPanels ) { // The frame timestamp from the layer indicates the last frame in which it rendered something . If that
// timestamp matches the current timestamp of the scene controller , then the layer rendered something
// during the most recent frame . Note that this fram... |
public class TIFFImageWriter { /** * Metadata */
@ Override public TIFFImageMetadata getDefaultImageMetadata ( final ImageTypeSpecifier imageType , final ImageWriteParam param ) { } } | return initMeta ( null , imageType , param ) ; |
public class DataAdapter { /** * Transforms given binned index ( short ) from class column into a value from interval [ 0 . . N - 1]
* corresponding to a particular predictor class */
public int unmapClass ( int clazz ) { } } | Col c = _c [ _c . length - 1 ] ; if ( c . _isByte ) return clazz ; else { // OK , this is not fully correct bad handle corner - cases like for example dataset uses classes only
// with 0 and 3 . Our API reports that there are 4 classes but in fact there are only 2 classes .
if ( clazz >= c . _binned2raw . length ) claz... |
public class SolarEventCalculator { /** * Computes the sunset time for the given zenith at the given date .
* @ param solarZenith
* < code > Zenith < / code > enum corresponding to the type of sunset to compute .
* @ param date
* < code > Calendar < / code > object representing the date to compute the sunset fo... | return getLocalTimeAsCalendar ( computeSolarEventTime ( solarZenith , date , false ) , date ) ; |
public class KModuleDeploymentService { /** * This method is used to filter classes that are added to the { @ link DeployedUnit } .
* When this method is used , only classes that are meant to be used with serialization are
* added to the deployment . This feature can be used to , for example , make sure that non - ... | if ( classToAdd . isInterface ( ) || classToAdd . isAnnotation ( ) || classToAdd . isLocalClass ( ) || classToAdd . isMemberClass ( ) ) { return ; } boolean jaxbClass = false ; boolean remoteableClass = false ; // @ XmlRootElement and @ XmlType may be used with inheritance
for ( Annotation anno : classToAdd . getAnnota... |
public class RowMarshaller { /** * Marshall the given parameter object . */
public void marshall ( Row row , ProtocolMarshaller protocolMarshaller ) { } } | if ( row == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( row . getData ( ) , DATA_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class SnorocketOWLReasoner { /** * Determines if a specific set of inferences have been precomputed .
* @ param inferenceType The type of inference to check for .
* @ return < code > true < / code > if the specified type of inferences have been
* precomputed , otherwise < code > false < / code > . */
@ Ove... | if ( inferenceType . equals ( InferenceType . CLASS_HIERARCHY ) ) { return reasoner . isClassified ( ) ; } else { return false ; } |
public class MQMessageUtils { /** * 将Message转换为FlatMessage
* @ param message 原生message
* @ return FlatMessage列表 */
public static List < FlatMessage > messageConverter ( Message message ) { } } | try { if ( message == null ) { return null ; } List < FlatMessage > flatMessages = new ArrayList < > ( ) ; List < CanalEntry . Entry > entrys = null ; if ( message . isRaw ( ) ) { List < ByteString > rawEntries = message . getRawEntries ( ) ; entrys = new ArrayList < CanalEntry . Entry > ( rawEntries . size ( ) ) ; for... |
public class UnPack200Task { /** * { @ inheritDoc } */
public void check ( JnlpDependencyConfig config ) { } } | if ( config == null ) { throw new NullPointerException ( "config can't be null" ) ; } if ( config . getArtifact ( ) == null ) { throw new NullPointerException ( "config.artifact can't be null" ) ; } if ( config . getArtifact ( ) . getFile ( ) == null ) { throw new NullPointerException ( "config.artifact.file can't be n... |
public class Function { /** * Use the given arguments as the first N arguments ,
* then figure out the rest of the arguments by looking at parameter annotations ,
* then finally call { @ link # invoke } . */
Object bindAndInvoke ( Object o , StaplerRequest req , StaplerResponse rsp , Object ... headArgs ) throws Il... | Class [ ] types = getParameterTypes ( ) ; Annotation [ ] [ ] annotations = getParameterAnnotations ( ) ; String [ ] parameterNames = getParameterNames ( ) ; Object [ ] arguments = new Object [ types . length ] ; // fill in the first N arguments
System . arraycopy ( headArgs , 0 , arguments , 0 , headArgs . length ) ; t... |
public class MultiMEProxyHandler { /** * Returns the neighbour for the given UUID
* @ param neighbourUUID The uuid to find
* @ param includeRecovered Also look for the neighbour in the recovered list
* @ return The neighbour object */
public final Neighbour getNeighbour ( SIBUuid8 neighbourUUID , boolean includeR... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getNeighbour" , new Object [ ] { neighbourUUID , Boolean . valueOf ( includeRecovered ) } ) ; Neighbour neighbour = _neighbours . getNeighbour ( neighbourUUID ) ; if ( ( neighbour == null ) && includeRecovered ) neighbour =... |
public class CmsMacroResolver { /** * Returns a function which applies the macro substitution of this resolver to its argument . < p >
* @ return a function performing string substitution with this resolver */
public Function < String , String > toFunction ( ) { } } | return new Function < String , String > ( ) { public String apply ( String input ) { return resolveMacros ( input ) ; } } ; |
public class DBSecurityGroup { /** * Contains a list of < a > IPRange < / a > elements .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setIPRanges ( java . util . Collection ) } or { @ link # withIPRanges ( java . util . Collection ) } if you want to overri... | if ( this . iPRanges == null ) { setIPRanges ( new com . amazonaws . internal . SdkInternalList < IPRange > ( iPRanges . length ) ) ; } for ( IPRange ele : iPRanges ) { this . iPRanges . add ( ele ) ; } return this ; |
public class StringUtils { /** * Convert a string into the set of its characters .
* @ param src Source string
* @ return Set of characters within the source string */
public static HashSet < Character > toCharacterSet ( String src ) { } } | int n = src . length ( ) ; HashSet < Character > res = new HashSet < > ( n ) ; for ( int i = 0 ; i < n ; i ++ ) res . add ( src . charAt ( i ) ) ; return res ; } public static Character [ ] toCharacterArray ( String src ) { return ArrayUtils . box ( src . toCharArray ( ) ) ; } public static int unhex ( String str ) { i... |
public class AreaSizesBD { /** * Construct an area at the origin that has the same size as { @ code size } .
* @ param size The area size
* @ return An area at the origin */
public static AreaBD area ( final AreaSizeBD size ) { } } | Objects . requireNonNull ( size , "Size" ) ; return AreaBD . of ( BigDecimal . ZERO , size . sizeX ( ) , BigDecimal . ZERO , size . sizeY ( ) ) ; |
public class ConfigFileReader { /** * Loads name value pairs directly from given file . . . adding them as settings
* @ param file to get settings from
* @ return list of settings */
public Settings load ( String file , CommandBuilder builder ) throws CommandLineException { } } | Scanner scanner = null ; try { File config = new File ( file ) ; Assert . isTrue ( config . exists ( ) , "File '" + file + "' does not exist" ) ; Assert . isFalse ( config . isDirectory ( ) , "File '" + file + "' is a directory" ) ; Assert . isTrue ( config . canRead ( ) , "File '" + file + "' cannot be read" ) ; scann... |
public class ProgressWheel { /** * Parse the attributes passed to the view from the XML
* @ param a the attributes to parse */
private void parseAttributes ( TypedArray a ) { } } | // We transform the default values from DIP to pixels
DisplayMetrics metrics = getContext ( ) . getResources ( ) . getDisplayMetrics ( ) ; barWidth = ( int ) TypedValue . applyDimension ( TypedValue . COMPLEX_UNIT_DIP , barWidth , metrics ) ; rimWidth = ( int ) TypedValue . applyDimension ( TypedValue . COMPLEX_UNIT_DI... |
public class HtmlTableRendererBase { /** * Renders the footer facet for the given < code > UIColumn < / code > .
* @ param facesContext the < code > FacesContext < / code > .
* @ param writer the < code > ResponseWriter < / code > .
* @ param uiComponent the < code > UIComponent < / code > to render the facet for... | writer . startElement ( HTML . TD_ELEM , null ) ; // uiComponent ) ;
if ( colspan > 1 ) { writer . writeAttribute ( HTML . COLSPAN_ATTR , Integer . valueOf ( colspan ) , null ) ; } if ( footerStyleClass != null ) { writer . writeAttribute ( HTML . CLASS_ATTR , footerStyleClass , null ) ; } if ( facet != null ) { // Ren... |
public class Math { /** * The Kendall Tau Rank Correlation Coefficient is used to measure the
* degree of correspondence between sets of rankings where the measures
* are not equidistant . It is used with non - parametric data . */
public static double kendall ( int [ ] x , int [ ] y ) { } } | if ( x . length != y . length ) { throw new IllegalArgumentException ( "Input vector sizes are different." ) ; } int is = 0 , n2 = 0 , n1 = 0 , n = x . length ; double aa , a2 , a1 ; for ( int j = 0 ; j < n - 1 ; j ++ ) { for ( int k = j + 1 ; k < n ; k ++ ) { a1 = x [ j ] - x [ k ] ; a2 = y [ j ] - y [ k ] ; aa = a1 *... |
public class BoundedInputStreamBuffer { /** * { @ inheritDoc } */
@ Override public byte peekByte ( ) throws IndexOutOfBoundsException , IOException { } } | final int read = internalReadBytes ( 1 ) ; if ( read == - 1 ) { // not sure this is really the right thing to do
throw new IndexOutOfBoundsException ( ) ; } return getByte ( this . readerIndex ) ; |
public class Assert { /** * Assert a boolean expression , throwing an { @ code IllegalArgumentException } if the expression
* evaluates to { @ code false } .
* < pre class = " code " >
* Assert . isTrue ( i & gt ; 0 , ( ) - & gt ; " The value ' " + i + " ' must be greater than zero " ) ;
* < / pre >
* @ param... | if ( ! expression ) { throw new IllegalArgumentException ( Assert . nullSafeGet ( messageSupplier ) ) ; } |
public class Album { /** * Preview Album . */
public static BasicGalleryWrapper < GalleryAlbumWrapper , AlbumFile , String , AlbumFile > galleryAlbum ( android . support . v4 . app . Fragment fragment ) { } } | return new GalleryAlbumWrapper ( fragment . getContext ( ) ) ; |
public class ScheduledDailyScanUpload { /** * Gets the first execution time for the given scan and upload which is at or after " now " . */
public Instant getNextExecutionTimeAfter ( Instant now ) { } } | OffsetTime timeOfDay = OffsetTime . from ( TIME_OF_DAY_FORMAT . parse ( getTimeOfDay ( ) ) ) ; // The time of the next run is based on the time past midnight UTC relative to the current time
Instant nextExecTime = now . atOffset ( ZoneOffset . UTC ) . with ( timeOfDay ) . toInstant ( ) ; // If the first execution would... |
public class GosuStringUtil { /** * < p > Joins the elements of the provided < code > Collection < / code > into
* a single String containing the provided elements . < / p >
* < p > No delimiter is added before or after the list .
* A < code > null < / code > separator is the same as an empty String ( " " ) . < /... | if ( collection == null ) { return null ; } return join ( collection . iterator ( ) , separator ) ; |
public class Verb { /** * getter for isModal - gets whether this verb has the POS MD ( modal ) , e . g . should , . . .
* @ generated
* @ return value of the feature */
public boolean getIsModal ( ) { } } | if ( Verb_Type . featOkTst && ( ( Verb_Type ) jcasType ) . casFeat_isModal == null ) jcasType . jcas . throwFeatMissing ( "isModal" , "ch.epfl.bbp.uima.types.Verb" ) ; return jcasType . ll_cas . ll_getBooleanValue ( addr , ( ( Verb_Type ) jcasType ) . casFeatCode_isModal ) ; |
public class EMail { /** * Attempts to send the message ( asynchronously ) .
* @ return
* @ throws Throwable */
public Object execute ( ) throws Throwable { } } | try { URL u = new URL ( "mailto:" + mailto ) ; URLConnection c = u . openConnection ( ) ; c . setDoInput ( false ) ; c . setDoOutput ( true ) ; c . connect ( ) ; outMail = new PrintWriter ( c . getOutputStream ( ) , true ) ; outMail . println ( "From: " + mailfrom ) ; outMail . println ( "To: " + mailto ) ; outMail . p... |
public class Fn { /** * Creates a < i > function expression < / i > for building a function operating on
* a target object of type Set & lt ; T & gt ; , being < tt > Type & lt ; T & gt ; < / tt > a type specified
* as a parameter .
* This is equivalent to < tt > Fn . on ( Types . setOf ( type ) ) < / tt >
* @ p... | return new Level0SetOperator < Set < T > , T > ( ExecutionTarget . forFn ( Normalisation . SET ) ) ; |
public class ExplicitDenyMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ExplicitDeny explicitDeny , ProtocolMarshaller protocolMarshaller ) { } } | if ( explicitDeny == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( explicitDeny . getPolicies ( ) , POLICIES_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) ,... |
public class Singleton { /** * Retrieves the singleton object , creating it by calling a provider if it is not created yet . This method uses
* double - checked locking to ensure that only one instance will ever be created , while keeping retrieval cost at
* minimum .
* @ see < a href = " http : / / en . wikipedi... | T result = _value ; if ( isMissing ( result ) ) synchronized ( this ) { result = _value ; if ( isMissing ( result ) ) { _value = result = functor . invoke ( argument ) ; } } return result ; |
public class CmsGalleryController { /** * Removes a selected gallery from the search object . < p >
* @ param key the gallery key */
public void removeGalleryParam ( String key ) { } } | if ( m_searchObject . getGalleries ( ) . contains ( key ) ) { m_galleriesChanged = true ; m_handler . onClearGalleries ( Collections . singletonList ( key ) ) ; m_searchObject . removeGallery ( key ) ; updateResultsTab ( false ) ; ValueChangeEvent . fire ( this , m_searchObject ) ; } |
public class DecodeWorker { /** * Writes out a single PNG which is three times the width of the input image , containing from left
* to right : the original image , the row sampling monochrome version , and the 2D sampling
* monochrome version . */
private static void dumpBlackPoint ( URI uri , BufferedImage image ... | int width = bitmap . getWidth ( ) ; int height = bitmap . getHeight ( ) ; int stride = width * 3 ; int [ ] pixels = new int [ stride * height ] ; // The original image
int [ ] argb = new int [ width ] ; for ( int y = 0 ; y < height ; y ++ ) { image . getRGB ( 0 , y , width , 1 , argb , 0 , width ) ; System . arraycopy ... |
public class AnnotationSagaAnalyzer { /** * { @ inheritDoc } */
@ Override public Map < Class < ? extends Saga > , SagaHandlersMap > scanHandledMessageTypes ( ) { } } | if ( scanResult == null ) { populateSagaHandlers ( ) ; } return scanResult ; |
public class WriteMethodUtil { /** * Validates the target type .
* @ param entity an entity
* @ throws com . sdl . odata . api . processor . ODataProcessorException
* @ throws com . sdl . odata . api . processor . datasource . ODataTargetTypeException */
public static void validateTargetType ( Object entity , ODa... | if ( ! entityDataModel . getType ( entity . getClass ( ) ) . getFullyQualifiedName ( ) . equals ( getTargetType ( request , entityDataModel , oDataUri ) . typeName ( ) ) ) { throw new ODataProcessorException ( PROCESSOR_ERROR , "Entity to persist does not match specified Resource name" ) ; } |
public class CmsAdminMenuGroup { /** * Returns the necessary html code . < p >
* @ param wp the jsp page to write the code to
* @ return html code */
public String groupHtml ( CmsWorkplace wp ) { } } | StringBuffer html = new StringBuffer ( 512 ) ; html . append ( htmlStart ( wp ) ) ; Iterator < CmsAdminMenuItem > itItem = m_container . elementList ( ) . iterator ( ) ; while ( itItem . hasNext ( ) ) { CmsAdminMenuItem item = itItem . next ( ) ; html . append ( item . itemHtml ( wp ) ) ; html . append ( "\n" ) ; } htm... |
public class Vector4f { /** * Read this vector from the supplied { @ link FloatBuffer } starting at the specified
* absolute buffer position / index .
* This method will not increment the position of the given FloatBuffer .
* @ param index
* the absolute position into the FloatBuffer
* @ param buffer
* valu... | MemUtil . INSTANCE . get ( this , index , buffer ) ; return this ; |
public class AbstractMemberWriter { /** * Add the modifier and type for the member in the member summary .
* @ param member the member to add the type for
* @ param type the type to add
* @ param tdSummaryType the content tree to which the modified and type will be added */
protected void addModifierAndType ( Ele... | HtmlTree code = new HtmlTree ( HtmlTag . CODE ) ; addModifier ( member , code ) ; if ( type == null ) { code . addContent ( utils . isClass ( member ) ? "class" : "interface" ) ; code . addContent ( Contents . SPACE ) ; } else { List < ? extends TypeParameterElement > list = utils . isExecutableElement ( member ) ? ( (... |
public class ConfigurableImpl { /** * internal helper function to recursively collect Interfaces .
* This is needed since { @ link Class # getInterfaces ( ) } does only return directly implemented Interfaces ,
* But not the ones derived from those classes . */
private static void collectInterfaces ( Set < Class < ?... | interfaces . add ( anInterface ) ; for ( Class < ? > superInterface : anInterface . getInterfaces ( ) ) { collectInterfaces ( interfaces , superInterface ) ; } |
public class ListUtil { /** * Replies an iterator that goes from end to start of the given list .
* < p > The replied iterator dos not support removals .
* @ param < T > the type of the list elements .
* @ param list the list .
* @ return the reverse iterator .
* @ since 14.0 */
public static < T > Iterator <... | return new Iterator < T > ( ) { private int next = list . size ( ) - 1 ; @ Override @ Pure public boolean hasNext ( ) { return this . next >= 0 ; } @ Override public T next ( ) { final int n = this . next ; -- this . next ; try { return list . get ( n ) ; } catch ( IndexOutOfBoundsException exception ) { throw new NoSu... |
public class CmsContentService { /** * Creates a new resource to edit , delegating to an edit handler if edit handler data is passed in . < p >
* @ param cms The CmsObject of the current request context .
* @ param newLink A string , specifying where which new content should be created .
* @ param locale The loca... | String newFileName ; if ( newLink . startsWith ( CmsJspTagEdit . NEW_LINK_IDENTIFIER ) ) { newFileName = CmsJspTagEdit . createResource ( cms , newLink , locale , referenceSitePath , modelFileSitePath , mode , postCreateHandler ) ; } else { newFileName = A_CmsResourceCollector . createResourceForCollector ( cms , newLi... |
public class TypeAnnotationPosition { /** * Create a { @ code TypeAnnotationPosition } for a constructor reference
* type argument .
* @ param location The type path .
* @ param type _ index The index of the type argument . */
public static TypeAnnotationPosition constructorRefTypeArg ( final List < TypePathEntry... | return constructorRefTypeArg ( location , null , type_index , - 1 ) ; |
public class FastMathCalc { /** * Compute the reciprocal of in . Use the following algorithm .
* in = c + d .
* want to find x + y such that x + y = 1 / ( c + d ) and x is much
* larger than y and x has several zero bits on the right .
* Set b = 1 / ( 2 ^ 22 ) , a = 1 - b . Thus ( a + b ) = 1.
* Use following... | final double b = 1.0 / 4194304.0 ; final double a = 1.0 - b ; if ( in [ 0 ] == 0.0 ) { in [ 0 ] = in [ 1 ] ; in [ 1 ] = 0.0 ; } result [ 0 ] = a / in [ 0 ] ; result [ 1 ] = ( b * in [ 0 ] - a * in [ 1 ] ) / ( in [ 0 ] * in [ 0 ] + in [ 0 ] * in [ 1 ] ) ; if ( result [ 1 ] != result [ 1 ] ) { // can happen if result [ 1... |
public class MessageSetImpl { /** * Gets messages in the given channel before a given message in any channel until one that meets the given
* condition is found .
* If no message matches the condition , an empty set is returned .
* @ param channel The channel of the messages .
* @ param condition The abort cond... | return getMessagesUntil ( channel , condition , before , - 1 ) ; |
public class StringUtils { /** * Trims a string of unicode whitespace and invisible characters
* @ param input Input string
* @ return Trimmed string or null if input was null */
public static String trim ( CharSequence input ) { } } | if ( input == null ) { return null ; } return StringFunctions . TRIM . apply ( input . toString ( ) ) ; |
public class LdifRecord { /** * - - - - - private methods - - - - - */
private void throwmsg ( String m ) throws NamingException { } } | String msg = m + " at line " + in . pos + " record=" + crec ; in . skip ( ) ; throw new NamingException ( msg ) ; |
public class TracerFactory { /** * Tries to open all enqueued QueueTracer .
* @ return true if all configured tracers has been opened , false otherwise */
public boolean openQueueTracer ( ) { } } | final int TRIALS = 5 ; int tracerCounter = 0 , trialCounter = 0 ; boolean success = false ; do { this . queueWriteLock . lock ( ) ; try { if ( this . queueConfig . enabled ) { for ( QueueTracer < ? > queueTracer : this . queueConfig . blockingTracerDeque ) { if ( ! queueTracer . isOpened ( ) ) { queueTracer . open ( ) ... |
public class MenuScreen { /** * Code to display a Menu . */
public void postSetupGrid ( ) { } } | Record menu = this . getMainRecord ( ) ; BaseListener behMenu = menu . getListener ( StringSubFileFilter . class . getName ( ) ) ; menu . removeListener ( behMenu , true ) ; |
public class StreamSegmentReadIndex { /** * Reads a range of bytes from the StreamSegment .
* @ param startOffset The offset in the StreamSegment where to start reading .
* @ param maxLength The maximum number of bytes to read .
* @ param timeout Timeout for the operation .
* @ return A ReadResult containing me... | Exceptions . checkNotClosed ( this . closed , this ) ; Preconditions . checkState ( ! this . recoveryMode , "StreamSegmentReadIndex is in Recovery Mode." ) ; Exceptions . checkArgument ( startOffset >= 0 , "startOffset" , "startOffset must be a non-negative number." ) ; Exceptions . checkArgument ( maxLength >= 0 , "ma... |
public class KafkaMsgConsumer { /** * Destroying method . */
@ SuppressWarnings ( "unused" ) public void destroy ( ) { } } | // stop all workers
for ( KafkaMsgConsumerWorker worker : topicWorkers . values ( ) ) { try { worker . stopWorker ( ) ; } catch ( Exception e ) { LOGGER . warn ( e . getMessage ( ) , e ) ; } } topicWorkers . clear ( ) ; // clear all message listeners
synchronized ( topicMsgListeners ) { topicMsgListeners . clear ( ) ; ... |
import java . util . * ; import java . util . regex . Matcher ; import java . util . regex . Pattern ; public class FrequentWords { /** * This function finds out the top - n most frequent words in the provided text .
* Examples :
* > > > findFrequentWords ( " python is a programming language " , 1)
* [ ( " python... | Pattern pattern = Pattern . compile ( "\\w+" ) ; HashMap < String , Integer > wordCount = new HashMap < > ( ) ; Matcher matcher = pattern . matcher ( textString ) ; while ( matcher . find ( ) ) { String word = matcher . group ( ) ; wordCount . put ( word , wordCount . getOrDefault ( word , 0 ) + 1 ) ; } List < Map . En... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.