signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class CreateIdentityPoolResult { /** * An array of Amazon Resource Names ( ARNs ) of the SAML provider for your identity pool .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setSamlProviderARNs ( java . util . Collection ) } or { @ link # withSamlPro... | if ( this . samlProviderARNs == null ) { setSamlProviderARNs ( new java . util . ArrayList < String > ( samlProviderARNs . length ) ) ; } for ( String ele : samlProviderARNs ) { this . samlProviderARNs . add ( ele ) ; } return this ; |
public class BuildsInner { /** * Patch the build properties .
* @ param resourceGroupName The name of the resource group to which the container registry belongs .
* @ param registryName The name of the container registry .
* @ param buildId The build ID .
* @ throws IllegalArgumentException thrown if parameters... | return updateWithServiceResponseAsync ( resourceGroupName , registryName , buildId ) . map ( new Func1 < ServiceResponse < BuildInner > , BuildInner > ( ) { @ Override public BuildInner call ( ServiceResponse < BuildInner > response ) { return response . body ( ) ; } } ) ; |
public class MaterialStepper { /** * Called when a step title is clicked . */
@ Override public void onSelection ( SelectionEvent < MaterialStep > event ) { } } | if ( stepSkippingAllowed ) { if ( event . getSelectedItem ( ) . getState ( ) == State . SUCCESS ) { goToStep ( event . getSelectedItem ( ) ) ; } } |
public class BigComplexMath { /** * Calculates the { @ link BigDecimal } n ' th root of { @ link BigComplex } x ( < sup > n < / sup > √ x ) .
* < p > See < a href = " http : / / en . wikipedia . org / wiki / Square _ root " > Wikipedia : Square root < / a > < / p >
* @ param x the { @ link BigComplex } value to cal... | MathContext mc = new MathContext ( mathContext . getPrecision ( ) + 4 , mathContext . getRoundingMode ( ) ) ; return pow ( x , BigDecimal . ONE . divide ( n , mc ) , mc ) . round ( mathContext ) ; |
public class Resolver { /** * Resolves the value of the current Promise with the given date .
* @ param value
* the value of the Promise */
public final void resolve ( Date value ) { } } | future . complete ( new Tree ( ( Tree ) null , null , value ) ) ; |
public class BehaviorUnitComparator { /** * Compare two Xtext expressions .
* @ param e1 the first expression to compare .
* @ param e2 the second expression to compare .
* @ return A negative value if < code > e1 < / code > is
* lower than < code > e2 < / code > , a positive value if
* < code > e1 < / code >... | if ( e1 == e2 ) { return 0 ; } if ( e1 == null ) { return Integer . MIN_VALUE ; } if ( e2 == null ) { return Integer . MAX_VALUE ; } return e1 . toString ( ) . compareTo ( e2 . toString ( ) ) ; |
public class DocBookBuilder { /** * Builds the revision history for the book . The revision history used will be determined in the following order : < br / >
* < br / >
* 1 . Revision History Override < br / >
* 2 . Content Spec Revision History Topic < br / >
* 3 . Revision History Template
* @ param buildDa... | final ContentSpec contentSpec = buildData . getContentSpec ( ) ; // Replace the basic injection data inside the revision history
final String revisionHistoryXml = stringConstantProvider . getStringConstant ( buildData . getServerEntities ( ) . getRevisionHistoryStringConstantId ( ) ) . getValue ( ) ; // DocBook 5 shoul... |
public class SphinxLinks { /** * Takes a string and replaces occurrences of rst / sphinx with kurento domain markup with javadoc
* and jsdoc equivalents .
* @ param arguments
* A list of arguments as Strings from the call . The first one is the rst / sphinx text ,
* and the second optional one defines the curre... | // Classes
String typeName = arguments . get ( 0 ) . toString ( ) ; String res = translate ( typeName , toReplace ) ; // Instance properties
String classNamePath = arguments . size ( ) > 1 ? "module:" + arguments . get ( 1 ) . toString ( ) : "" ; String instanceProperty = "{@link " + classNamePath + "#$1}" ; String ins... |
public class UploadObjectObserver { /** * Used to initialized this observer . This method is an SPI ( service
* provider interface ) that is called from
* < code > AmazonS3EncryptionClient < / code > .
* Implementation of this method should never block .
* @ param req
* the upload object request
* @ param s... | this . req = req ; this . s3direct = s3direct ; this . s3 = s3 ; this . es = es ; return this ; |
public class SimpleInterval { /** * / * [ deutsch ]
* < p > Formatiert dieses Intervall in einem benutzerdefinierten Format . < / p >
* @ param printer format object for printing start and end components
* @ param intervalPattern interval pattern containing placeholders { 0 } and { 1 } ( for start and end )
* @... | AttributeQuery attrs = printer . getAttributes ( ) ; StringBuilder sb = new StringBuilder ( 32 ) ; int i = 0 ; int n = intervalPattern . length ( ) ; while ( i < n ) { char c = intervalPattern . charAt ( i ) ; if ( ( c == '{' ) && ( i + 2 < n ) && ( intervalPattern . charAt ( i + 2 ) == '}' ) ) { char next = intervalPa... |
public class Logger { /** * Issue a log message with parameters and a throwable with a level of FATAL .
* @ param loggerFqcn the logger class name
* @ param message the message
* @ param params the message parameters
* @ param t the throwable */
public void fatal ( String loggerFqcn , Object message , Object [ ... | doLog ( Level . FATAL , loggerFqcn , message , params , t ) ; |
public class lbroute6 { /** * Use this API to fetch lbroute6 resources of given names . */
public static lbroute6 [ ] get ( nitro_service service , String network [ ] ) throws Exception { } } | if ( network != null && network . length > 0 ) { lbroute6 response [ ] = new lbroute6 [ network . length ] ; lbroute6 obj [ ] = new lbroute6 [ network . length ] ; for ( int i = 0 ; i < network . length ; i ++ ) { obj [ i ] = new lbroute6 ( ) ; obj [ i ] . set_network ( network [ i ] ) ; response [ i ] = ( lbroute6 ) o... |
public class AssociationPersister { /** * Returns an { @ link AssociationContext } to be passed to { @ link GridDialect } operations targeting the association
* managed by this persister . */
public AssociationContext getAssociationContext ( ) { } } | if ( associationContext == null ) { associationContext = new AssociationContextImpl ( associationTypeContext , hostingEntity != null ? OgmEntityEntryState . getStateFor ( session , hostingEntity ) . getTuplePointer ( ) : new TuplePointer ( ) , transactionContext ( session ) ) ; } return associationContext ; |
public class LinkedList { /** * Replaces the element at the specified position in this list with the
* specified element .
* @ param index index of the element to replace
* @ param element element to be stored at the specified position
* @ return the element previously at the specified position
* @ throws Ind... | checkElementIndex ( index ) ; Node < E > x = node ( index ) ; E oldVal = x . item ; x . item = element ; return oldVal ; |
public class ClientFactory { /** * Asynchronously creates a new message receiver to the entity on the messagingFactory .
* @ param messagingFactory messaging factory ( which represents a connection ) on which receiver needs to be created .
* @ param entityPath path of entity
* @ return a CompletableFuture represe... | return createMessageReceiverFromEntityPathAsync ( messagingFactory , entityPath , DEFAULTRECEIVEMODE ) ; |
public class Iterators { /** * Wraps the given Iterator into an Iterable .
* @ param it The Iterator to wrap .
* @ return An { @ link Iterable } which returns the given Iterator . */
public static < T > Iterable < T > iterableOf ( Iterator < T > it ) { } } | final Iterator < T > theIt = Require . nonNull ( it , "it" ) ; return new Iterable < T > ( ) { @ Override public Iterator < T > iterator ( ) { return theIt ; } } ; |
public class DefaultGroovyMethods { /** * A convenience method for creating an immutable list
* @ param self a List
* @ return an immutable List
* @ see java . util . Collections # unmodifiableList ( java . util . List )
* @ since 1.0 */
public static < T > List < T > asImmutable ( List < ? extends T > self ) {... | return Collections . unmodifiableList ( self ) ; |
public class LifecycleQueryInstalledChaincodeProposalResponse { /** * The lable used by this chaincode . This is defined by the installed chaincode . See label parameter in { @ link LifecycleChaincodePackage # fromSource ( String , Path , TransactionRequest . Type , String , Path ) }
* @ return the label
* @ throws... | Lifecycle . QueryInstalledChaincodeResult queryInstalledChaincodeResult = parsePayload ( ) ; if ( queryInstalledChaincodeResult == null ) { return null ; } return queryInstalledChaincodeResult . getLabel ( ) ; |
public class JawrBinaryResourceRequestHandler { /** * ( non - Javadoc )
* @ see
* net . jawr . web . servlet . JawrRequestHandler # writeContent ( java . lang . String ,
* javax . servlet . http . HttpServletRequest ,
* javax . servlet . http . HttpServletResponse ) */
@ Override protected void writeContent ( S... | String resourceName = requestedPath ; if ( ! jawrConfig . getGeneratorRegistry ( ) . isGeneratedBinaryResource ( resourceName ) && ! resourceName . startsWith ( URL_SEPARATOR ) ) { resourceName = URL_SEPARATOR + resourceName ; } try ( InputStream is = rsReaderHandler . getResourceAsStream ( resourceName ) ; OutputStrea... |
public class StorageBuilder { /** * Builds a provider - specific storage implementation , by passing this builder in constructor . Each implementation
* gets its required information from builder .
* @ return The storage builder */
public IStorageProvider build ( ) { } } | if ( appInfoRepo == null ) { throw new IllegalStateException ( "Undefined application information repository" ) ; } if ( userCredentialsRepo == null ) { throw new IllegalStateException ( "Undefined user credentials repository" ) ; } try { Constructor providerConstructor = providerClass . getConstructor ( StorageBuilder... |
public class BundleDelegatingComponentInstanciationListener { /** * { @ inheritDoc } */
public void inject ( Object toInject , Class < ? > toHandle ) { } } | synchronized ( listeners ) { Collection < BundleAnalysingComponentInstantiationListener > values = listeners . values ( ) ; for ( BundleAnalysingComponentInstantiationListener analyser : values ) { if ( analyser . injectionPossible ( toHandle ) ) { analyser . inject ( toInject , toHandle ) ; return ; } } } throw new Il... |
public class BeanMapper { /** * 简单的复制出新类型对象 . */
public static < S , D > D map ( S source , Class < D > destinationClass ) { } } | return mapper . map ( source , destinationClass ) ; |
public class StringBuffer { /** * readObject is called to restore the state of the StringBuffer from
* a stream . */
private void readObject ( java . io . ObjectInputStream s ) throws java . io . IOException , ClassNotFoundException { } } | java . io . ObjectInputStream . GetField fields = s . readFields ( ) ; char [ ] value = ( char [ ] ) fields . get ( "value" , null ) ; int count = fields . get ( "count" , 0 ) ; append ( value , 0 , count ) ; |
public class PatchSchedulesInner { /** * Gets all patch schedules in the specified redis cache ( there is only one ) .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to... | return listByRedisResourceNextSinglePageAsync ( nextPageLink ) . concatMap ( new Func1 < ServiceResponse < Page < RedisPatchScheduleInner > > , Observable < ServiceResponse < Page < RedisPatchScheduleInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < RedisPatchScheduleInner > > > call ( Service... |
public class AbstractMultiDataSetNormalizer { /** * Fit an iterator
* @ param iterator for the data to iterate over */
public void fit ( @ NonNull MultiDataSetIterator iterator ) { } } | List < S . Builder > featureNormBuilders = new ArrayList < > ( ) ; List < S . Builder > labelNormBuilders = new ArrayList < > ( ) ; iterator . reset ( ) ; while ( iterator . hasNext ( ) ) { MultiDataSet next = iterator . next ( ) ; fitPartial ( next , featureNormBuilders , labelNormBuilders ) ; } featureStats = buildLi... |
public class ViewPortHandler { /** * Load the windows resize handler with initial view port detection . */
protected ViewPort load ( ) { } } | resize = Window . addResizeHandler ( event -> { execute ( event . getWidth ( ) , event . getHeight ( ) ) ; } ) ; execute ( window ( ) . width ( ) , ( int ) window ( ) . height ( ) ) ; return viewPort ; |
public class TimeZoneFormat { /** * Private method returning the instance of TimeZoneGenericNames
* used by this object . The instance of TimeZoneGenericNames might
* not be available until the first use ( lazy instantiation ) because
* it is only required for handling generic names ( that are not used
* by Dat... | if ( _gnames == null ) { // _ gnames is volatile
synchronized ( this ) { if ( _gnames == null ) { _gnames = TimeZoneGenericNames . getInstance ( _locale ) ; } } } return _gnames ; |
public class Fishbowl { /** * Executes the given statement and encloses any checked exception
* thrown with an unchecked { @ link WrappedException } , that
* is thrown instead . Returns the statement ' s return value if no
* exception is thrown .
* < pre >
* public void doSomething ( ) {
* URL url = wrapChe... | try { return statement . evaluate ( ) ; } catch ( RuntimeException e ) { throw e ; } catch ( Error e ) { throw e ; } catch ( Throwable e ) { throw new WrappedException ( e ) ; } |
public class CPDefinitionLinkPersistenceImpl { /** * Returns the cp definition links before and after the current cp definition link in the ordered set where CProductId = & # 63 ; and type = & # 63 ; .
* @ param CPDefinitionLinkId the primary key of the current cp definition link
* @ param CProductId the c product ... | CPDefinitionLink cpDefinitionLink = findByPrimaryKey ( CPDefinitionLinkId ) ; Session session = null ; try { session = openSession ( ) ; CPDefinitionLink [ ] array = new CPDefinitionLinkImpl [ 3 ] ; array [ 0 ] = getByCP_T_PrevAndNext ( session , cpDefinitionLink , CProductId , type , orderByComparator , true ) ; array... |
public class AeroGearFCMPushRegistrar { /** * Send a confirmation the message was opened
* @ param metricsMessage The id of the message received
* @ param callback a callback . */
@ Override public void sendMetrics ( final UnifiedPushMetricsMessage metricsMessage , final Callback < UnifiedPushMetricsMessage > callb... | new AsyncTask < Void , Void , Exception > ( ) { @ Override protected Exception doInBackground ( Void ... params ) { try { if ( ( metricsMessage . getMessageId ( ) == null ) || ( metricsMessage . getMessageId ( ) . trim ( ) . equals ( "" ) ) ) { throw new IllegalStateException ( "Message ID cannot be null or blank" ) ; ... |
public class EvalVisitor { /** * Implementations for functions . */
@ Override protected SoyValue visitFunctionNode ( FunctionNode node ) { } } | Object soyFunction = node . getSoyFunction ( ) ; // Handle nonplugin functions .
if ( soyFunction instanceof BuiltinFunction ) { BuiltinFunction nonpluginFn = ( BuiltinFunction ) soyFunction ; switch ( nonpluginFn ) { case IS_FIRST : return visitIsFirstFunction ( node ) ; case IS_LAST : return visitIsLastFunction ( nod... |
public class AWSStorageGatewayClient { /** * Returns information about the cache of a gateway . This operation is only supported in the cached volume , tape and
* file gateway types .
* The response includes disk IDs that are configured as cache , and it includes the amount of cache allocated and
* used .
* @ p... | request = beforeClientExecution ( request ) ; return executeDescribeCache ( request ) ; |
public class ConfigClientWatch { /** * / * for testing */
boolean stateChanged ( String oldState , String newState ) { } } | return ( ! hasText ( oldState ) && hasText ( newState ) ) || ( hasText ( oldState ) && ! oldState . equals ( newState ) ) ; |
public class PropertiesUtil { /** * Generate java code by the specified xml .
* @ param is
* @ param srcPath
* @ param packageName
* @ param className
* @ param isPublicField */
public static void xml2Java ( InputStream is , String srcPath , String packageName , String className , boolean isPublicField ) { } ... | DocumentBuilder docBuilder = XMLUtil . createDOMParser ( true , true ) ; Writer writer = null ; try { Document doc = docBuilder . parse ( is ) ; Node root = doc . getFirstChild ( ) ; // TODO it ' s difficult to support duplicated property and may be misused .
if ( hasDuplicatedPropName ( root ) ) { throw new AbacusExce... |
public class EDBUtils { /** * Converts a list of EDBObjects into a list of JPAObjects */
public static List < JPAObject > convertEDBObjectsToJPAObjects ( List < EDBObject > objects ) { } } | List < JPAObject > result = new ArrayList < JPAObject > ( ) ; for ( EDBObject object : objects ) { result . add ( convertEDBObjectToJPAObject ( object ) ) ; } return result ; |
public class ChainLight { /** * Attaches light to specified body with relative direction offset
* @ param body
* that will be automatically followed , note that the body
* rotation angle is taken into account for the light offset
* and direction calculations
* @ param degrees
* directional relative offset i... | this . body = body ; this . bodyPosition . set ( body . getPosition ( ) ) ; bodyAngleOffset = MathUtils . degreesToRadians * degrees ; bodyAngle = body . getAngle ( ) ; applyAttachment ( ) ; if ( staticLight ) dirty = true ; |
public class WsHandshakeValidator { /** * Facade method to validate an HttpMessageRequest .
* @ param request the request to validate
* @ return true iff the appropriate handshake for websocket protocol is contained
* within the provided request . */
public boolean validate ( HttpRequestMessage request , boolean ... | WebSocketWireProtocol wireProtocolVersion = guessWireProtocolVersion ( request ) ; if ( wireProtocolVersion == null ) { return false ; } final WsHandshakeValidator validator = handshakeValidatorsByWireProtocolVersion . get ( wireProtocolVersion ) ; return validator != null && validator . doValidate ( request , isPostMe... |
public class GVRAndroidResource { /** * Returns the full path of the resource file with extension .
* @ return path of the GVRAndroidResource . May return null if the
* resource is not associated with any file */
public String getResourcePath ( ) { } } | switch ( resourceType ) { case ANDROID_ASSETS : return assetPath ; case ANDROID_RESOURCE : return resourceFilePath ; case LINUX_FILESYSTEM : return filePath ; case NETWORK : return url . getPath ( ) ; case INPUT_STREAM : return inputStreamName ; default : return null ; } |
public class LTPAToken2Factory { /** * { @ inheritDoc } */
@ Override public Token createToken ( Map tokenData ) throws TokenCreationFailedException { } } | String userUniqueId = getUniqueId ( tokenData ) ; return new LTPAToken2 ( userUniqueId , expirationInMinutes , sharedKey , privateKey , publicKey ) ; |
public class QueryParserBase { /** * Get the mapped field name using meta information derived from the given domain type .
* @ param fieldName
* @ param domainType
* @ return
* @ since 4.0 */
protected String getMappedFieldName ( String fieldName , @ Nullable Class < ? > domainType ) { } } | if ( domainType == null || mappingContext == null ) { return fieldName ; } SolrPersistentEntity entity = mappingContext . getPersistentEntity ( domainType ) ; if ( entity == null ) { return fieldName ; } SolrPersistentProperty property = entity . getPersistentProperty ( fieldName ) ; return property != null ? property ... |
public class PropertyAccessorHelper { /** * Gets the declared fields .
* @ param relationalField
* the relational field
* @ return the declared fields */
public static Field [ ] getDeclaredFields ( Field relationalField ) { } } | Field [ ] fields ; if ( isCollection ( relationalField . getType ( ) ) ) { fields = PropertyAccessorHelper . getGenericClass ( relationalField ) . getDeclaredFields ( ) ; } else { fields = relationalField . getType ( ) . getDeclaredFields ( ) ; } return fields ; |
public class AmazonSimpleWorkflowClient { /** * Returns information about the specified domain , including description and status .
* < b > Access Control < / b >
* You can use IAM policies to control this action ' s access to Amazon SWF resources as follows :
* < ul >
* < li >
* Use a < code > Resource < / c... | request = beforeClientExecution ( request ) ; return executeDescribeDomain ( request ) ; |
public class DefaultClusterEventService { /** * Handles a collection of subscription updates received via the gossip protocol .
* @ param subscriptions a collection of subscriptions provided by the sender */
private void update ( Collection < InternalSubscriptionInfo > subscriptions ) { } } | for ( InternalSubscriptionInfo subscription : subscriptions ) { InternalTopic topic = topics . computeIfAbsent ( subscription . topic , InternalTopic :: new ) ; InternalSubscriptionInfo matchingSubscription = topic . remoteSubscriptions ( ) . stream ( ) . filter ( s -> s . memberId ( ) . equals ( subscription . memberI... |
public class Constraints { /** * / / / / / pre - defined extra constraints / / / / / */
public static < T extends Comparable < T > > ExtraConstraint < T > min ( T minVal ) { } } | return min ( minVal , true ) ; |
public class NvdCveParser { /** * Parses the NVD JSON file and inserts / updates data into the database .
* @ param file the NVD JSON file to parse
* @ throws UpdateException thrown if the file could not be read */
public void parse ( File file ) throws UpdateException { } } | LOGGER . debug ( "Parsing " + file . getName ( ) ) ; try ( InputStream fin = new FileInputStream ( file ) ; InputStream in = new GZIPInputStream ( fin ) ; InputStreamReader isr = new InputStreamReader ( in , UTF_8 ) ; JsonReader reader = new JsonReader ( isr ) ) { final Gson gson = new GsonBuilder ( ) . create ( ) ; re... |
public class ElasticSearchPropertiesFilePlugin { /** * 直接从map中装载初始化话es所需要的属性 , 用于从zookeeper / consul / etcd / Eureka动态加载es配置
* @ param configProperties */
public static void init ( Map configProperties ) { } } | if ( configProperties != null && configProperties . size ( ) > 0 ) { ElasticSearchPropertiesFilePlugin . configProperties = configProperties ; initType = 1 ; } |
public class CompareUtil { /** * Checks if any of the passed in objects is null .
* @ param _ objects array of objects , may be null
* @ return true if null found , false otherwise */
public static boolean isAnyNull ( Object ... _objects ) { } } | if ( _objects == null ) { return true ; } for ( Object obj : _objects ) { if ( obj == null ) { return true ; } } return false ; |
public class SqlDateTimeUtils { /** * Converts the internal representation of a SQL DATE ( int ) to the Java
* type used for UDF parameters ( { @ link java . sql . Date } ) with the given TimeZone .
* < p > The internal int represents the days since January 1 , 1970 . When we convert it
* to { @ link java . sql .... | // note that , in this case , can ' t handle Daylight Saving Time
final long t = v * MILLIS_PER_DAY ; return new java . sql . Date ( t - tz . getOffset ( t ) ) ; |
public class CustomTopicXMLValidator { /** * Checks to make sure that a topics xml content is valid for the specific topic . This involves checking the following :
* < ul >
* < li > Table row entries match the cols attribute . < / li >
* < li > The root XML Element matches the topic type . < / li >
* < li > The... | final List < String > xmlErrors = new ArrayList < String > ( ) ; // Check to ensure that if the topic has a table , that the table isn ' t missing any entries
if ( ! DocBookUtilities . validateTables ( topicDoc ) ) { xmlErrors . add ( "Table column declaration doesn't match the number of entry elements." ) ; } // Check... |
public class RabinKarpHash { /** * Find the shortest of all patterns .
* @ param patterns
* @ return */
private static int minLen ( String ... patterns ) { } } | int minLen = patterns [ 0 ] . length ( ) ; for ( String str : patterns ) { if ( str . length ( ) < minLen ) { minLen = str . length ( ) ; } } return minLen ; |
public class BaseListener { /** * Remove a specific listener from the chain .
* @ param listener The listener to remove .
* @ param bDeleteFlag If true , free the listener . */
public void removeListener ( BaseListener listener , boolean bFreeFlag ) { } } | if ( m_nextListener != null ) { if ( m_nextListener == listener ) { m_nextListener = listener . getNextListener ( ) ; listener . unlink ( bFreeFlag ) ; // remove theBehavior from the linked list
} else m_nextListener . removeListener ( listener , bFreeFlag ) ; } // Remember to free the listener after removing it ! |
public class ApiInvoker { /** * Serialize an Object .
* @ param obj the Object to serialize
* @ throws APIException if an exception occurs during serialization */
public static String serialize ( Object obj ) throws ApiException { } } | try { if ( obj != null ) if ( obj instanceof String ) { // This assumes that we receive json as a string
return ( String ) obj ; } else { return JsonUtil . getJsonMapper ( ) . writeValueAsString ( obj ) ; } else return null ; } catch ( Exception e ) { throw new ApiException ( 500 , e . getMessage ( ) ) ; } |
public class WriteOnChangeHandler { /** * Set this cloned listener to the same state at this listener .
* @ param field The field this new listener will be added to .
* @ param The new listener to sync to this .
* @ param Has the init method been called ?
* @ return True if I called init . */
public boolean syn... | if ( ! bInitCalled ) ( ( WriteOnChangeHandler ) listener ) . init ( null , m_bRefreshAfterWrite ) ; return super . syncClonedListener ( field , listener , true ) ; |
public class SeleniumSelectField { /** * this private method try to search the value of the select for n seconds
* specified by TIMEOUT static variable . The coerence if the data passed is
* or isn ' t the correct value is responsability of the test developer .
* @ param type
* values defined by the Type privat... | assert value != null ; reloadElement ( ) ; this . selectByType ( type , value ) ; |
public class JivePropertiesExtensionProvider { /** * Parse a properties sub - packet . If any errors occur while de - serializing Java object
* properties , an exception will be printed and not thrown since a thrown exception will shut
* down the entire connection . ClassCastExceptions will occur when both the send... | Map < String , Object > properties = new HashMap < > ( ) ; while ( true ) { int eventType = parser . next ( ) ; if ( eventType == XmlPullParser . START_TAG && parser . getName ( ) . equals ( "property" ) ) { // Parse a property
boolean done = false ; String name = null ; String type = null ; String valueText = null ; O... |
public class GeometryPath { /** * Add a new sub - path to the path . A path can have multiple sub - paths . Sub - paths may be disconnected lines or rings
* but , thanks to even - odd rule , holes can be added as well .
* @ param coordinates
* @ param closed */
public void addSubPath ( Coordinate [ ] coordinates ... | subPaths . add ( new SubPath ( coordinates , closed ) ) ; updateCoordinates ( ) ; |
public class LocalLauncher { /** * Launch the topology */
@ Override public boolean launch ( PackingPlan packing ) { } } | LOG . log ( Level . FINE , "Launching topology for local cluster {0}" , LocalContext . cluster ( config ) ) ; // setup the working directory
// mainly it downloads and extracts the heron - core - release and topology package
if ( ! setupWorkingDirectoryAndExtractPackages ( ) ) { LOG . severe ( "Failed to setup working ... |
public class EventCountCircuitBreaker { /** * Creates the map with strategy objects . It allows access for a strategy for a given
* state .
* @ return the strategy map */
private static Map < State , StateStrategy > createStrategyMap ( ) { } } | final Map < State , StateStrategy > map = new EnumMap < > ( State . class ) ; map . put ( State . CLOSED , new StateStrategyClosed ( ) ) ; map . put ( State . OPEN , new StateStrategyOpen ( ) ) ; return map ; |
public class AWSOpsWorksClient { /** * Describes load - based auto scaling configurations for specified layers .
* < note >
* You must specify at least one of the parameters .
* < / note >
* < b > Required Permissions < / b > : To use this action , an IAM user must have a Show , Deploy , or Manage permissions
... | request = beforeClientExecution ( request ) ; return executeDescribeLoadBasedAutoScaling ( request ) ; |
public class OgmLoader { /** * The entity instance is not in the session cache
* Copied from Loader # instanceNotYetLoaded */
private Object instanceNotYetLoaded ( final Tuple resultset , final int i , final Loadable persister , final String rowIdAlias , final org . hibernate . engine . spi . EntityKey key , final Lo... | final String instanceClass = getInstanceClass ( resultset , i , persister , key . getIdentifier ( ) , session ) ; final Object object ; if ( optionalObjectKey != null && key . equals ( optionalObjectKey ) ) { // its the given optional object
object = optionalObject ; } else { // instantiate a new instance
object = sess... |
public class Provider { /** * Notify the instance with the given type is < b > FULLY < / b > injected which means all of its
* nested injectable fields are injected and ready < b > RECURSIVELY < / b > .
* < p > This method should get called every time the instance is injected , no matter if it ' s a
* newly creat... | notifyInstanceCreationWhenNeeded ( ) ; if ( referencedListeners != null ) { int len = referencedListeners . size ( ) ; for ( int i = 0 ; i < len ; i ++ ) { referencedListeners . get ( i ) . onReferenced ( provider , instance ) ; } } |
public class RequestMessage { /** * In certain cases , the URL will contain query string information and the
* POST body will as well . This method merges the two maps together .
* @ param urlParams */
private void mergeQueryParams ( Map < String , String [ ] > urlParams ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "mergeQueryParams: " + urlParams ) ; } for ( Entry < String , String [ ] > entry : urlParams . entrySet ( ) ) { String key = entry . getKey ( ) ; // prepend to postdata values if necessary
String [ ] post = this . queryParame... |
public class ProgressiveJpegParser { /** * Not every marker is followed by associated segment */
private static boolean doesMarkerStartSegment ( int markerSecondByte ) { } } | if ( markerSecondByte == JfifUtil . MARKER_TEM ) { return false ; } if ( markerSecondByte >= JfifUtil . MARKER_RST0 && markerSecondByte <= JfifUtil . MARKER_RST7 ) { return false ; } return markerSecondByte != JfifUtil . MARKER_EOI && markerSecondByte != JfifUtil . MARKER_SOI ; |
public class ModeShapeEngine { /** * Start this engine to make it available for use . This method does nothing if the engine is already running .
* @ see # shutdown ( ) */
public void start ( ) { } } | if ( state == State . RUNNING ) return ; final Lock lock = this . lock . writeLock ( ) ; try { lock . lock ( ) ; this . state = State . STARTING ; // Create an executor service that we ' ll use to start the repositories . . .
ThreadFactory threadFactory = new NamedThreadFactory ( "modeshape-start-repo" ) ; repositorySt... |
public class MutablePropertySources { /** * Replace the property source with the given name with the given property
* source object .
* @ param name the name of the property source to find and replace
* @ param propertySource the replacement property source
* @ throws IllegalArgumentException if no property sou... | if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Replacing PropertySource '" + name + "' with '" + propertySource . getName ( ) + "'" ) ; } int index = assertPresentAndGetIndex ( name ) ; this . propertySourceList . set ( index , propertySource ) ; |
public class AWSCloudHSMClient { /** * This is documentation for < b > AWS CloudHSM Classic < / b > . For more information , see < a
* href = " http : / / aws . amazon . com / cloudhsm / faqs - classic / " > AWS CloudHSM Classic FAQs < / a > , the < a
* href = " http : / / docs . aws . amazon . com / cloudhsm / cla... | request = beforeClientExecution ( request ) ; return executeDeleteLunaClient ( request ) ; |
public class EventManager { /** * Fire a new event and run all the listeners .
* @ param eventDefinition
* @ param eventDetails */
public void fire ( EventDefinition eventDefinition , Event eventDetails ) { } } | if ( eventDefinition . getType ( ) == EventDefinition . TYPE_POST ) { fire ( listenersPost , eventDefinition , eventDetails ) ; } else { fire ( listeners , eventDefinition , eventDetails ) ; } |
public class SDKUtils { /** * used asn1 and get hash
* @ param blockNumber
* @ param previousHash
* @ param dataHash
* @ return byte [ ]
* @ throws IOException
* @ throws InvalidArgumentException */
public static byte [ ] calculateBlockHash ( HFClient client , long blockNumber , byte [ ] previousHash , byte... | if ( previousHash == null ) { throw new InvalidArgumentException ( "previousHash parameter is null." ) ; } if ( dataHash == null ) { throw new InvalidArgumentException ( "dataHash parameter is null." ) ; } if ( null == client ) { throw new InvalidArgumentException ( "client parameter is null." ) ; } CryptoSuite cryptoS... |
public class TrieNode { /** * Visit first trie node .
* @ param visitor the visitor
* @ return the trie node */
public TrieNode visitFirst ( Consumer < ? super TrieNode > visitor ) { } } | visitor . accept ( this ) ; TrieNode refresh = refresh ( ) ; refresh . getChildren ( ) . forEach ( n -> n . visitFirst ( visitor ) ) ; return refresh ; |
public class Clustering { /** * Check if clustering is active for this cache manager */
public static boolean isAvailable ( ServiceProvider < Service > serviceProvider ) { } } | return ENTITY_SERVICE_CLASS != null && serviceProvider . getService ( ENTITY_SERVICE_CLASS ) != null ; |
public class GvmClusters { /** * assumes pairs are contiguous */
private void addPairs ( ) { } } | GvmCluster < S , K > cj = clusters [ count ] ; int c = count - 1 ; // index at which new pairs registered for existing clusters
for ( int i = 0 ; i < count ; i ++ ) { GvmCluster < S , K > ci = clusters [ i ] ; GvmClusterPair < S , K > pair = new GvmClusterPair < S , K > ( ci , cj ) ; ci . pairs [ c ] = pair ; cj . pair... |
public class sslvserver_sslcipher_binding { /** * Use this API to fetch sslvserver _ sslcipher _ binding resources of given name . */
public static sslvserver_sslcipher_binding [ ] get ( nitro_service service , String vservername ) throws Exception { } } | sslvserver_sslcipher_binding obj = new sslvserver_sslcipher_binding ( ) ; obj . set_vservername ( vservername ) ; sslvserver_sslcipher_binding response [ ] = ( sslvserver_sslcipher_binding [ ] ) obj . get_resources ( service ) ; return response ; |
public class VarOptItemsSketch { /** * Returns a byte array representation of this sketch . May fail for polymorphic item types .
* @ param serDe An instance of ArrayOfItemsSerDe
* @ return a byte array representation of this sketch */
public byte [ ] toByteArray ( final ArrayOfItemsSerDe < ? super T > serDe ) { } ... | if ( ( r_ == 0 ) && ( h_ == 0 ) ) { // null class is ok since empty - - no need to call serDe
return toByteArray ( serDe , null ) ; } else { final int validIndex = ( h_ == 0 ? 1 : 0 ) ; final Class < ? > clazz = data_ . get ( validIndex ) . getClass ( ) ; return toByteArray ( serDe , clazz ) ; } |
public class XPathQueryBuilder { /** * Creates a < code > LocationStepQueryNode < / code > at the current position
* in parent .
* @ param node the current node in the xpath syntax tree .
* @ param parent the parent < code > PathQueryNode < / code > .
* @ return the created < code > LocationStepQueryNode < / co... | LocationStepQueryNode queryNode = null ; boolean descendant = false ; Node p = node . jjtGetParent ( ) ; for ( int i = 0 ; i < p . jjtGetNumChildren ( ) ; i ++ ) { SimpleNode c = ( SimpleNode ) p . jjtGetChild ( i ) ; if ( c == node ) { // NOSONAR
queryNode = factory . createLocationStepQueryNode ( parent ) ; queryNode... |
public class Checks { /** * - - - Input validating methods . - - - */
public static void checkFileToBeRead ( File archive , String fileDesc ) throws IllegalArgumentException { } } | if ( archive == null ) throw new IllegalArgumentException ( fileDesc + " must not be null." ) ; if ( ! archive . exists ( ) ) throw new IllegalArgumentException ( fileDesc + " does not exist: " + archive . getAbsolutePath ( ) ) ; if ( archive . isDirectory ( ) ) throw new IllegalArgumentException ( fileDesc + " is a di... |
public class ExtensionLoader { /** * Initialize a specific Extension
* @ param ext the Extension that need to be initialized
* @ throws DatabaseUnsupportedException
* @ throws DatabaseException */
public void startLifeCycle ( Extension ext ) throws DatabaseException , DatabaseUnsupportedException { } } | ext . init ( ) ; ext . databaseOpen ( model . getDb ( ) ) ; ext . initModel ( model ) ; ext . initXML ( model . getSession ( ) , model . getOptionsParam ( ) ) ; ext . initView ( view ) ; ExtensionHook extHook = new ExtensionHook ( model , view ) ; extensionHooks . put ( ext , extHook ) ; try { ext . hook ( extHook ) ; ... |
public class Communications { /** * Returns minute UTC as per 1371-4 . pdf .
* @ param extractor
* @ param slotTimeout
* @ param startIndex
* @ return */
private static Integer getMinuteUtc ( AisExtractor extractor , int slotTimeout , int startIndex ) { } } | if ( slotTimeout == 1 ) { // skip the msb bit
int minutes = extractor . getValue ( startIndex + 10 , startIndex + 17 ) ; return minutes ; } else return null ; |
public class OrderQueryBond { /** * ( non - Javadoc )
* @ see
* org . openscience . cdk . isomorphism . matchers . smarts . SMARTSBond # matches ( org
* . openscience . cdk . interfaces . IBond ) */
@ Override public boolean matches ( IBond bond ) { } } | if ( bond . isAromatic ( ) ^ isAromatic ( ) ) return false ; // we check for both bonds being aromatic - but the query will
// never come in as aromatic ( since there is a separate aromatic
// query bond ) . But no harm in checking
return bond . isAromatic ( ) || bond . getOrder ( ) == getOrder ( ) ; |
public class Bot { /** * Invoke the appropriate method in a conversation .
* @ param event received from facebook */
private void invokeChainedMethod ( Event event ) { } } | Queue < MethodWrapper > queue = conversationQueueMap . get ( event . getSender ( ) . getId ( ) ) ; if ( queue != null && ! queue . isEmpty ( ) ) { MethodWrapper methodWrapper = queue . peek ( ) ; try { EventType [ ] eventTypes = methodWrapper . getMethod ( ) . getAnnotation ( Controller . class ) . events ( ) ; for ( E... |
public class PasswordMaker { /** * This performs the actual hashing . It obtains an instance of the hashing algorithm
* and feeds in the necessary data .
* @ param masterPassword The master password to use as a key .
* @ param data The data to be hashed .
* @ param account The account with the hash settings to ... | SecureUTF8String output = null ; SecureCharArray digestChars = null ; SecureByteArray masterPasswordBytes = null ; SecureByteArray dataBytes = null ; try { masterPasswordBytes = new SecureByteArray ( masterPassword ) ; dataBytes = new SecureByteArray ( data ) ; if ( ! account . isHmac ( ) ) { dataBytes . prepend ( mast... |
public class ClassUtils { /** * Given an input class object , return a string which consists of the
* class ' s package name as a pathname , i . e . , all dots ( ' . ' ) are replaced by
* slashes ( ' / ' ) . Neither a leading nor trailing slash is added . The result
* could be concatenated with a slash and the na... | if ( clazz == null ) { return "" ; } String className = clazz . getName ( ) ; int packageEndIndex = className . lastIndexOf ( PACKAGE_SEPARATOR ) ; if ( packageEndIndex == - 1 ) { return "" ; } String packageName = className . substring ( 0 , packageEndIndex ) ; return packageName . replace ( PACKAGE_SEPARATOR , PATH_S... |
public class XMLChecker { /** * Determines if the specified string matches the < em > SystemLiteral < / em > production .
* See : < a href = " http : / / www . w3 . org / TR / REC - xml # NT - SystemLiteral " > Definition of SystemLiteral < / a > .
* @ param s the character string to check , cannot be < code > null... | try { checkSystemLiteral ( s ) ; return true ; } catch ( InvalidXMLException exception ) { return false ; } |
public class SFSession { /** * Performs a sanity check on properties . Sanity checking includes :
* - verifying that a server url is present
* - verifying various combinations of properties given the authenticator
* @ throws SFException */
private void performSanityCheckOnProperties ( ) throws SFException { } } | for ( SFSessionProperty property : SFSessionProperty . values ( ) ) { if ( property . isRequired ( ) && ! connectionPropertiesMap . containsKey ( property ) ) { switch ( property ) { case SERVER_URL : throw new SFException ( ErrorCode . MISSING_SERVER_URL ) ; default : throw new SFException ( ErrorCode . MISSING_CONNEC... |
public class PartitionedLeaderService { /** * Returns the underlying leader services for each partition . The services are guaranteed to be returned
* ordered by partition number . */
public List < LeaderService > getPartitionLeaderServices ( ) { } } | return _partitionLeaders . stream ( ) . map ( PartitionLeader :: getLeaderService ) . collect ( Collectors . toList ( ) ) ; |
public class DateIteratorFactory { /** * given a block of RRULE , EXRULE , RDATE , and EXDATE content lines , parse
* them into a single date iterable .
* @ param rdata RRULE , EXRULE , RDATE , and EXDATE lines .
* @ param start the first occurrence of the series .
* @ param tzid the local timezone - - used to ... | return new RecurrenceIterableWrapper ( RecurrenceIteratorFactory . createRecurrenceIterable ( rdata , dateToDateValue ( start , true ) , tzid , strict ) ) ; |
public class GithubRenderer { /** * Create the HTML markup for the DOM . */
private void encodeMarkup ( final FacesContext context , final Github github ) throws IOException { } } | final ResponseWriter writer = context . getResponseWriter ( ) ; final String clientId = github . getClientId ( context ) ; final String widgetVar = github . resolveWidgetVar ( ) ; writer . startElement ( "div" , github ) ; writer . writeAttribute ( "id" , clientId , "id" ) ; writer . writeAttribute ( HTML . WIDGET_VAR ... |
public class MwsJsonWriter { /** * Output escaped value .
* @ param value */
private void escape ( String value ) { } } | int n = value . length ( ) ; int i = 0 ; for ( int j = 0 ; j < n ; ++ j ) { char c = value . charAt ( j ) ; int k = ESCAPED_CHARS . indexOf ( c ) ; if ( k >= 0 || c < ' ' ) { if ( i < j ) { append ( value , i , j ) ; } if ( k >= 0 ) { append ( ESCAPE_SEQ [ k ] ) ; } else { append ( "\\u" ) ; append ( String . format ( ... |
public class HtmlElementTables { /** * Elements in order which are implicitly opened when a descendant tag is
* lexically nested within an ancestor . */
int [ ] impliedElements ( int anc , int desc ) { } } | // < style > and < script > are allowed anywhere .
if ( desc == SCRIPT_TAG || desc == STYLE_TAG ) { return ZERO_INTS ; } // It ' s dangerous to allow free < li > tags because of the way an < li >
// implies a < / li > if there is an < li > on the parse stack without a
// LIST _ SCOPE element in the middle .
// Since we... |
public class SceneStructureCommon { /** * Specifies the location of a point in 3D space
* @ param which Which point is being specified
* @ param x coordinate along x - axis
* @ param y coordinate along y - axis
* @ param z coordinate along z - axis */
public void setPoint ( int which , double x , double y , dou... | points [ which ] . set ( x , y , z ) ; |
public class CPMeasurementUnitLocalServiceBaseImpl { /** * Returns the cp measurement unit matching the UUID and group .
* @ param uuid the cp measurement unit ' s UUID
* @ param groupId the primary key of the group
* @ return the matching cp measurement unit
* @ throws PortalException if a matching cp measurem... | return cpMeasurementUnitPersistence . findByUUID_G ( uuid , groupId ) ; |
public class Debouncer { /** * This must be called on eventExecutor too . */
public void receive ( IncomingT element ) { } } | assert adminExecutor . inEventLoop ( ) ; if ( stopped ) { return ; } if ( window . isZero ( ) || maxEvents == 1 ) { LOG . debug ( "Received {}, flushing immediately (window = {}, maxEvents = {})" , element , window , maxEvents ) ; onFlush . accept ( coalescer . apply ( ImmutableList . of ( element ) ) ) ; } else { curr... |
public class CmisConnector { /** * Converts CMIS object ' s properties to JCR node properties .
* @ param object CMIS object
* @ param writer JCR node representation . */
private void cmisProperties ( CmisObject object , DocumentWriter writer ) { } } | // convert properties
List < Property < ? > > list = object . getProperties ( ) ; for ( Property < ? > property : list ) { String pname = properties . findJcrName ( property . getId ( ) ) ; if ( pname != null ) { writer . addProperty ( pname , properties . jcrValues ( property ) ) ; } } |
public class Normalizer2Impl { /** * Decomposes s [ src , limit [ and writes the result to dest .
* limit can be NULL if src is NUL - terminated .
* destLengthEstimate is the initial dest buffer capacity and can be - 1. */
public void decompose ( CharSequence s , int src , int limit , StringBuilder dest , int destL... | if ( destLengthEstimate < 0 ) { destLengthEstimate = limit - src ; } dest . setLength ( 0 ) ; ReorderingBuffer buffer = new ReorderingBuffer ( this , dest , destLengthEstimate ) ; decompose ( s , src , limit , buffer ) ; |
public class AmazonCloudDirectoryClient { /** * Deletes a < a > TypedLinkFacet < / a > . For more information , see < a href =
* " https : / / docs . aws . amazon . com / clouddirectory / latest / developerguide / directory _ objects _ links . html # directory _ objects _ links _ typedlink "
* > Typed Links < / a >... | request = beforeClientExecution ( request ) ; return executeDeleteTypedLinkFacet ( request ) ; |
public class BiDirectionalAssociationHelper { /** * Checks whether table name and key column names of the given joinable and inverse collection persister match . */
private static boolean isCollectionMatching ( Joinable mainSideJoinable , OgmCollectionPersister inverseSidePersister ) { } } | boolean isSameTable = mainSideJoinable . getTableName ( ) . equals ( inverseSidePersister . getTableName ( ) ) ; if ( ! isSameTable ) { return false ; } return Arrays . equals ( mainSideJoinable . getKeyColumnNames ( ) , inverseSidePersister . getElementColumnNames ( ) ) ; |
public class PngOptimizerTask { private String makeDirs ( String path ) { } } | try { File out = new File ( path ) ; if ( ! out . exists ( ) ) { if ( ! out . mkdirs ( ) ) { throw new IOException ( "Couldn't create path: " + path ) ; } } path = out . getCanonicalPath ( ) ; } catch ( IOException e ) { throw new BuildException ( "Bad path: " + path ) ; } return path ; |
public class Matrix4x3f { /** * Store the values of the given matrix < code > m < / code > into < code > this < / code > matrix .
* @ see # Matrix4x3f ( Matrix4x3fc )
* @ see # get ( Matrix4x3f )
* @ param m
* the matrix to copy the values from
* @ return this */
public Matrix4x3f set ( Matrix4x3fc m ) { } } | if ( m instanceof Matrix4x3f ) { MemUtil . INSTANCE . copy ( ( Matrix4x3f ) m , this ) ; } else { setMatrix4x3fc ( m ) ; } properties = m . properties ( ) ; return this ; |
public class TransactionLocalMap { /** * Set the value associated with key .
* @ param key the thread local object
* @ param value the value to be set */
public void put ( TransactionLocal key , Object value ) { } } | // We don ' t use a fast path as with get ( ) because it is at
// least as common to use set ( ) to create new entries as
// it is to replace existing ones , in which case , a fast
// path would fail more often than not .
Entry [ ] tab = table ; int len = tab . length ; int i = key . hashCode & ( len - 1 ) ; for ( Entr... |
public class ShortBuffer { /** * Creates a short buffer based on a newly allocated short array .
* @ param capacity the capacity of the new buffer .
* @ return the created short buffer .
* @ throws IllegalArgumentException if { @ code capacity } is less than zero . */
public static ShortBuffer allocate ( int capa... | if ( capacity < 0 ) { throw new IllegalArgumentException ( ) ; } ByteBuffer bb = ByteBuffer . allocateDirect ( capacity * 2 ) ; bb . order ( ByteOrder . nativeOrder ( ) ) ; return bb . asShortBuffer ( ) ; |
public class HerokuAPI { /** * Lists the formation info for an app
* @ param appName See { @ link # listApps } for a list of apps that can be used . */
public List < Formation > listFormation ( String appName ) { } } | return connection . execute ( new FormationList ( appName ) , apiKey ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.