signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Director { /** * Creates array of productIds and calls method below
* @ param featureNames Collection of features names to uninstall
* @ param allowUninstallAll If false , will fail if no user features are installed
* @ param force If uninstallation should be forced
* @ throws InstallException */
p... | getUninstallDirector ( ) . uninstallFeaturesPrereqChecking ( featureNames , allowUninstallAll , force ) ; |
public class PicketBoxSecurityIntegration { /** * { @ inheritDoc } */
public org . ironjacamar . core . spi . security . SecurityContext getSecurityContext ( ) { } } | org . jboss . security . SecurityContext sc = SecurityContextAssociation . getSecurityContext ( ) ; if ( sc == null ) return null ; return new PicketBoxSecurityContext ( sc ) ; |
public class RestoreAgent { /** * Creates a ZooKeeper directory if it doesn ' t exist . Crashes VoltDB if the
* creation fails for any reason other then the path already existing .
* @ param path */
void createZKDirectory ( String path ) { } } | try { try { m_zk . create ( path , new byte [ 0 ] , Ids . OPEN_ACL_UNSAFE , CreateMode . PERSISTENT ) ; } catch ( KeeperException e ) { if ( e . code ( ) != Code . NODEEXISTS ) { throw e ; } } } catch ( Exception e ) { VoltDB . crashGlobalVoltDB ( "Failed to create Zookeeper node: " + e . getMessage ( ) , false , e ) ;... |
public class RecyclerFactory { /** * Creates a new { @ link Recycler } .
* @ param newObjectCreator the { @ link Function } to create a new object
* @ param < T > the type being recycled .
* @ return the { @ link Recycler }
* @ throws NullPointerException if { @ code newObjectCreator } is { @ code null } */
pub... | Objects . requireNonNull ( newObjectCreator , "newObjectCreator must not be null" ) ; return new Recycler < T > ( ) { @ Override protected T newObject ( Handle < T > handle ) { return newObjectCreator . apply ( handle ) ; } } ; |
public class DefaultConsumerBootstrap { /** * 取消订阅服务列表 */
public void unSubscribe ( ) { } } | if ( StringUtils . isEmpty ( consumerConfig . getDirectUrl ( ) ) && consumerConfig . isSubscribe ( ) ) { List < RegistryConfig > registryConfigs = consumerConfig . getRegistry ( ) ; if ( registryConfigs != null ) { for ( RegistryConfig registryConfig : registryConfigs ) { Registry registry = RegistryFactory . getRegist... |
public class rewritepolicy_binding { /** * Use this API to fetch rewritepolicy _ binding resource of given name . */
public static rewritepolicy_binding get ( nitro_service service , String name ) throws Exception { } } | rewritepolicy_binding obj = new rewritepolicy_binding ( ) ; obj . set_name ( name ) ; rewritepolicy_binding response = ( rewritepolicy_binding ) obj . get_resource ( service ) ; return response ; |
public class DAOValidatorHelper { /** * Methode permettant de verifier si un chemin contient des variables d ' environnement
* @ param expressionChaine a controler
* @ returnResultat de la verification */
public static boolean isExpressionContainsENV ( String expression ) { } } | // Si la chaine est vide : false
if ( expression == null || expression . trim ( ) . length ( ) == 0 ) { // On retourne false
return false ; } // On split
return isExpressionContainPattern ( expression , ENV_CHAIN_PATTERN ) ; |
public class DatastreamResource { /** * < p > Invoke API - A . getDatastreamDissemination ( context , pid , dsID , asOfDateTime )
* < / p > < p >
* GET / objects / { pid } / datastreams / { dsID } / content ? asOfDateTime < / p > */
@ Path ( "/{dsID}/content" ) @ GET public Response getDatastream ( @ PathParam ( Re... | Context context = getContext ( ) ; try { Date asOfDateTime = DateUtility . parseDateOrNull ( dateTime ) ; MIMETypedStream stream = m_access . getDatastreamDissemination ( context , pid , dsID , asOfDateTime ) ; if ( m_datastreamFilenameHelper != null ) { m_datastreamFilenameHelper . addContentDispositionHeader ( contex... |
public class MiniTemplatorParser { /** * If shortFormEnabled is true , the short form commands in the format " < $ . . . > " are also recognized . */
private void parseTemplateCommands ( ) throws MiniTemplator . TemplateSyntaxException { } } | int p = 0 ; // p is the current position within templateText
while ( true ) { int p0 = templateText . indexOf ( cmdStartStr , p ) ; // p0 is the start of the current command
boolean shortForm = false ; if ( shortFormEnabled && p0 != p ) { if ( p0 == - 1 ) { p0 = templateText . indexOf ( cmdStartStrShort , p ) ; shortFo... |
public class AWSBackupClient { /** * Backup plans are documents that contain information that AWS Backup uses to schedule tasks that create recovery
* points of resources .
* If you call < code > CreateBackupPlan < / code > with a plan that already exists , the existing < code > backupPlanId < / code >
* is retur... | request = beforeClientExecution ( request ) ; return executeCreateBackupPlan ( request ) ; |
public class AvroUtils { /** * A helper method to extract avro serialization configurations from the topology configuration and register
* specific kryo serializers as necessary . A default serializer will be provided if none is specified in the
* configuration . " avro . serializer " should specify the complete cl... | final Class serializerClass ; if ( conf . containsKey ( "avro.serializer" ) ) { serializerClass = Class . forName ( ( String ) conf . get ( "avro.serializer" ) ) ; } else { serializerClass = GenericAvroSerializer . class ; } conf . registerSerialization ( GenericData . Record . class , serializerClass ) ; conf . setSki... |
public class DescribeRaidArraysResult { /** * A < code > RaidArrays < / code > object that describes the specified RAID arrays .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setRaidArrays ( java . util . Collection ) } or { @ link # withRaidArrays ( java .... | if ( this . raidArrays == null ) { setRaidArrays ( new com . amazonaws . internal . SdkInternalList < RaidArray > ( raidArrays . length ) ) ; } for ( RaidArray ele : raidArrays ) { this . raidArrays . add ( ele ) ; } return this ; |
public class MultiUserChatLightManager { /** * Returns a collection with the XMPP addresses of the MUC Light services .
* @ return a collection with the XMPP addresses of the MUC Light services .
* @ throws XMPPErrorException
* @ throws NoResponseException
* @ throws NotConnectedException
* @ throws Interrupt... | ServiceDiscoveryManager sdm = ServiceDiscoveryManager . getInstanceFor ( connection ( ) ) ; return sdm . findServices ( MultiUserChatLight . NAMESPACE , false , false ) ; |
public class EsaResourceImpl { /** * { @ inheritDoc } */
@ Override public Map < String , Collection < String > > getRequireFeatureWithTolerates ( ) { } } | // The feature may be an older feature which never had the tolerates information
// stored , in which case , look in the older requireFeature field and massage
// that info into the required format .
// Or there may just not be any required features at all .
Collection < RequireFeatureWithTolerates > rfwt = _asset . ge... |
public class JcrTools { /** * Execute the supplied operation on each node in the workspace accessible by the supplied session .
* @ param session the session
* @ param includeSystemNodes true if all nodes under " / jcr : system " should be included , or false if the system nodes should be
* excluded
* @ param o... | Node node = session . getRootNode ( ) ; operation . run ( node ) ; NodeIterator iter = node . getNodes ( ) ; while ( iter . hasNext ( ) ) { Node child = iter . nextNode ( ) ; if ( ! includeSystemNodes && child . getName ( ) . equals ( "jcr:system" ) ) continue ; operation . run ( child ) ; onEachNodeBelow ( child , ope... |
public class GeometryEngine { /** * See OperatorDisjoint . */
public static boolean disjoint ( Geometry geometry1 , Geometry geometry2 , SpatialReference spatialReference ) { } } | OperatorDisjoint op = ( OperatorDisjoint ) factory . getOperator ( Operator . Type . Disjoint ) ; boolean result = op . execute ( geometry1 , geometry2 , spatialReference , null ) ; return result ; |
public class NodeTypes { /** * Validates that the given property definition is valid under the ModeShape and JCR type rules within the given context .
* ModeShape considers a property definition valid if it meets these criteria :
* < ol >
* < li > Residual properties cannot be mandatory < / li >
* < li > If the... | assert propertyDefinition != null ; assert supertypes != null ; assert pendingTypes != null ; boolean residual = JcrNodeType . RESIDUAL_ITEM_NAME . equals ( propertyDefinition . getName ( ) ) ; if ( propertyDefinition . isMandatory ( ) && ! propertyDefinition . isProtected ( ) && residual ) { throw new InvalidNodeTypeD... |
public class JsonPathUtils { /** * Evaluate JsonPath expression on given payload string and return result as string .
* @ param payload
* @ param jsonPathExpression
* @ return */
public static String evaluateAsString ( String payload , String jsonPathExpression ) { } } | try { JSONParser parser = new JSONParser ( JSONParser . MODE_JSON_SIMPLE ) ; Object receivedJson = parser . parse ( payload ) ; ReadContext readerContext = JsonPath . parse ( receivedJson ) ; return evaluateAsString ( readerContext , jsonPathExpression ) ; } catch ( ParseException e ) { throw new CitrusRuntimeException... |
public class StandaloneConfiguration { /** * copy another configuration ' s values into this one if they are set . */
public void merge ( StandaloneConfiguration other ) { } } | if ( other == null ) { return ; } if ( isMergeAble ( Integer . class , other . browserTimeout , browserTimeout ) ) { browserTimeout = other . browserTimeout ; } if ( isMergeAble ( Integer . class , other . jettyMaxThreads , jettyMaxThreads ) ) { jettyMaxThreads = other . jettyMaxThreads ; } if ( isMergeAble ( Integer .... |
public class RendererBuilder { /** * Configure prototypes used as Renderer instances .
* @ param prototypes to use by the builder in order to create Renderer instances . */
public final void setPrototypes ( Collection < ? extends Renderer < ? extends T > > prototypes ) { } } | if ( prototypes == null ) { throw new NeedsPrototypesException ( "RendererBuilder has to be created with a non null collection of" + "Collection<Renderer<T> to provide new or recycled Renderer instances" ) ; } this . prototypes = new LinkedList < > ( prototypes ) ; |
public class RaftSessionRegistry { /** * Removes all sessions registered for the given service .
* @ param primitiveId the service identifier */
public void removeSessions ( PrimitiveId primitiveId ) { } } | sessions . entrySet ( ) . removeIf ( e -> e . getValue ( ) . getService ( ) . serviceId ( ) . equals ( primitiveId ) ) ; |
public class FunctionKeyReader { /** * Creates new extractor capable of extracting a saga instance key from a message . */
public static < MESSAGE > FunctionKeyReader < MESSAGE , String > create ( final Class < MESSAGE > messageClazz , final KeyReadFunction < MESSAGE > readFunction ) { } } | return new FunctionKeyReader < > ( messageClazz , ExtractFunctionReader . encapsulate ( readFunction ) ) ; |
public class SshX509RsaPublicKey { /** * Encode the public key into a blob of binary data , the encoded result will
* be passed into init to recreate the key .
* @ return an encoded byte array
* @ throws SshException
* @ todo Implement this com . sshtools . ssh . SshPublicKey method */
public byte [ ] getEncode... | try { return cert . getEncoded ( ) ; } catch ( Throwable ex ) { throw new SshException ( "Failed to encoded key data" , SshException . INTERNAL_ERROR , ex ) ; } |
public class Polygon { /** * Merge equals points .
* Creates constraints and populates the context with points . */
public void prepareTriangulation ( TriangulationContext < ? > tcx ) { } } | int hint = _points . size ( ) ; if ( _steinerPoints != null ) { hint += _steinerPoints . size ( ) ; } if ( _holes != null ) { for ( Polygon p : _holes ) { hint += p . pointCount ( ) ; } } HashMap < TriangulationPoint , TriangulationPoint > uniquePts = new HashMap < TriangulationPoint , TriangulationPoint > ( hint ) ; T... |
public class XSplitter { /** * Perform an minimum overlap split . The { @ link # chooseMinimumOverlapSplit }
* calculates the partition for the split dimension determined by
* { @ link # chooseSplitAxis }
* < code > ( common split history , minFanout , maxEntries - minFanout + 1 ) < / code >
* with the minimum ... | if ( node . getEntry ( 0 ) instanceof LeafEntry ) { throw new IllegalArgumentException ( "The minimum overlap split will only be performed on directory nodes" ) ; } if ( node . getNumEntries ( ) < 2 ) { throw new IllegalArgumentException ( "Splitting less than two entries is pointless." ) ; } int maxEntries = tree . ge... |
public class ClassFeatureSet { /** * Determine if given method overrides a superclass or superinterface
* method .
* @ param javaClass
* class defining the method
* @ param method
* the method
* @ return true if the method overrides a superclass / superinterface method ,
* false if not */
private boolean ... | if ( method . isStatic ( ) ) { return false ; } try { JavaClass [ ] superclassList = javaClass . getSuperClasses ( ) ; if ( superclassList != null ) { JavaClassAndMethod match = Hierarchy . findMethod ( superclassList , method . getName ( ) , method . getSignature ( ) , Hierarchy . INSTANCE_METHOD ) ; if ( match != nul... |
public class DHistogram { /** * The initial histogram bins are setup from the Vec rollups . */
static public DHistogram [ ] initialHist ( Frame fr , int ncols , int nbins , DHistogram hs [ ] , int min_rows , boolean doGrpSplit , boolean isBinom ) { } } | Vec vecs [ ] = fr . vecs ( ) ; for ( int c = 0 ; c < ncols ; c ++ ) { Vec v = vecs [ c ] ; final float minIn = ( float ) Math . max ( v . min ( ) , - Float . MAX_VALUE ) ; // inclusive vector min
final float maxIn = ( float ) Math . min ( v . max ( ) , Float . MAX_VALUE ) ; // inclusive vector max
final float maxEx = f... |
public class AnnualTimeZoneRule { /** * { @ inheritDoc } */
@ Override public boolean isEquivalentTo ( TimeZoneRule other ) { } } | if ( ! ( other instanceof AnnualTimeZoneRule ) ) { return false ; } AnnualTimeZoneRule otherRule = ( AnnualTimeZoneRule ) other ; if ( startYear == otherRule . startYear && endYear == otherRule . endYear && dateTimeRule . equals ( otherRule . dateTimeRule ) ) { return super . isEquivalentTo ( other ) ; } return false ; |
public class CustomBuiltXML { /** * overrides the visitor to find String concatenations including xml strings
* @ param seen
* the opcode that is being visited */
@ Override public void sawOpcode ( int seen ) { } } | String strCon = null ; try { stack . precomputation ( this ) ; if ( seen == Const . INVOKESPECIAL ) { String clsName = getClassConstantOperand ( ) ; if ( SignatureUtils . isPlainStringConvertableClass ( clsName ) ) { String methodName = getNameConstantOperand ( ) ; String methodSig = getSigConstantOperand ( ) ; if ( Va... |
public class SingleFilterAdapter { /** * Adapt the untyped hbaseFilter instance into a RowFilter .
* @ param context a { @ link com . google . cloud . bigtable . hbase . adapters . filters . FilterAdapterContext } object .
* @ param hbaseFilter a { @ link org . apache . hadoop . hbase . filter . Filter } object .
... | T typedFilter = getTypedFilter ( hbaseFilter ) ; return adapter . adapt ( context , typedFilter ) ; |
public class Transformation2D { /** * Set this transformation to be a shift .
* @ param x
* The X coordinate to shift to .
* @ param y
* The Y coordinate to shift to . */
public void setShift ( double x , double y ) { } } | xx = 1 ; xy = 0 ; xd = x ; yx = 0 ; yy = 1 ; yd = y ; |
public class JsonViewSupportFactoryBean { /** * Registering custom serializer allows to the JSonView to deal with custom serializations for certains field types . < br >
* This way you could register for instance a JODA serialization as a DateTimeSerializer . < br >
* Thus , when JSonView find a field of that type ... | this . converter . registerCustomSerializer ( cls , forType ) ; |
public class ForwardingTransformerHandlerBase { /** * LexicalHandler */
public void startDTD ( String name , String publicId , String systemId ) throws SAXException { } } | getLexicalTarget ( ) . startDTD ( name , publicId , systemId ) ; |
public class AWSCognitoIdentityProviderClient { /** * Gets the header information for the . csv file to be used as input for the user import job .
* @ param getCSVHeaderRequest
* Represents the request to get the header information for the . csv file for the user import job .
* @ return Result of the GetCSVHeader... | request = beforeClientExecution ( request ) ; return executeGetCSVHeader ( request ) ; |
public class PropertyChangeSupport { /** * Reports a bound property update to listeners
* that have been registered to track updates of
* all properties or a property with the specified name .
* No event is fired if old and new values are equal and non - null .
* This is merely a convenience wrapper around the ... | if ( oldValue == null || newValue == null || ! oldValue . equals ( newValue ) ) { firePropertyChange ( new PropertyChangeEvent ( this . source , propertyName , oldValue , newValue ) ) ; } |
public class XMLConfigAdmin { /** * run update from cfml engine
* @ throws PageException */
public void runUpdate ( Password password ) throws PageException { } } | checkWriteAccess ( ) ; ConfigServerImpl cs = ( ConfigServerImpl ) ConfigImpl . getConfigServer ( config , password ) ; CFMLEngineFactory factory = cs . getCFMLEngine ( ) . getCFMLEngineFactory ( ) ; synchronized ( factory ) { try { cleanUp ( factory ) ; factory . update ( cs . getPassword ( ) , cs . getIdentification (... |
public class Task { /** * Update the job status record that shows this job has started . */
private void setTaskStart ( ) { } } | m_taskRecord . setProperty ( TaskRecord . PROP_EXECUTOR , m_hostID ) ; m_taskRecord . setProperty ( TaskRecord . PROP_START_TIME , Long . toString ( System . currentTimeMillis ( ) ) ) ; m_taskRecord . setProperty ( TaskRecord . PROP_FINISH_TIME , null ) ; m_taskRecord . setProperty ( TaskRecord . PROP_PROGRESS , null )... |
public class GlobalMercator { /** * Returns bounds of the given tile in EPSG : 900913 coordinates
* @ param tx
* @ param ty
* @ param zoom
* @ return the array of [ w , s , e , n ] */
public double [ ] TileBounds ( int tx , int ty , int zoom ) { } } | double [ ] min = PixelsToMeters ( tx * tileSize , ty * tileSize , zoom ) ; double minx = min [ 0 ] , miny = min [ 1 ] ; double [ ] max = PixelsToMeters ( ( tx + 1 ) * tileSize , ( ty + 1 ) * tileSize , zoom ) ; double maxx = max [ 0 ] , maxy = max [ 1 ] ; return new double [ ] { minx , miny , maxx , maxy } ; |
public class Scanner { /** * Sets this scanner ' s locale to the specified locale .
* < p > A scanner ' s locale affects many elements of its default
* primitive matching regular expressions ; see
* < a href = " # localized - numbers " > localized numbers < / a > above .
* < p > Invoking the { @ link # reset } ... | if ( locale . equals ( this . locale ) ) return this ; this . locale = locale ; DecimalFormat df = ( DecimalFormat ) NumberFormat . getNumberInstance ( locale ) ; DecimalFormatSymbols dfs = DecimalFormatSymbols . getInstance ( locale ) ; // These must be literalized to avoid collision with regex
// metacharacters such ... |
public class BsnUtil { /** * Generates random number that could be a BSN .
* Based on : http : / / www . testnummers . nl / bsn . js
* @ return random BSN . */
public String generateBsn ( ) { } } | String Result1 = "" ; int Nr9 = randomUtil . random ( 3 ) ; int Nr8 = randomUtil . random ( 10 ) ; int Nr7 = randomUtil . random ( 10 ) ; int Nr6 = randomUtil . random ( 10 ) ; int Nr5 = randomUtil . random ( 10 ) ; int Nr4 = randomUtil . random ( 10 ) ; int Nr3 = randomUtil . random ( 10 ) ; int Nr2 = randomUtil . ran... |
public class ShareActionProvider { /** * Sets an intent with information about the share action . Here is a
* sample for constructing a share intent :
* < pre >
* < code >
* Intent shareIntent = new Intent ( Intent . ACTION _ SEND ) ;
* shareIntent . setType ( " image / * " ) ;
* Uri uri = Uri . fromFile ( ... | ActivityChooserModel dataModel = ActivityChooserModel . get ( mContext , mShareHistoryFileName ) ; dataModel . setIntent ( shareIntent ) ; |
public class MPIO { /** * Send a control message to a list of MEs
* @ param jsMsg The message to be sent
* @ param priority The priority at which to send it
* @ param fromTo The MEs to send it to */
public void sendDownTree ( SIBUuid8 [ ] targets , int priority , AbstractMessage cMsg ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "sendDownTree" , new Object [ ] { this , cMsg , Integer . valueOf ( priority ) , targets } ) ; // Select a set of connections , then annotate the message .
int length = targets . length ; // the unique list of connections
MP... |
public class PluginManager { /** * Performs the installation of the plugins .
* @ param plugins The collection of plugins to install .
* @ param dynamicLoad If true , the plugin will be dynamically loaded into this Jenkins . If false ,
* the plugin will only take effect after the reboot .
* See { @ link UpdateC... | return install ( plugins , dynamicLoad , null ) ; |
public class IabHelper { /** * Performs Iab setup with the mService object which must
* be properly connected before calling this method . */
private void startSetupIabAsync ( final String packageName , final OnIabSetupFinishedListener listener ) { } } | new Thread ( new Runnable ( ) { @ Override public void run ( ) { try { Logger . d ( "Checking for in-app billing 3 support." ) ; // check for in - app billing v3 support
int response = mService . isBillingSupported ( 3 , packageName , ITEM_TYPE_INAPP ) ; if ( response != BILLING_RESPONSE_RESULT_OK ) { if ( listener != ... |
public class ObjectSpace { /** * Causes this ObjectSpace to stop listening to the connections for method invocation messages . */
public void close ( ) { } } | Connection [ ] connections = this . connections ; for ( int i = 0 ; i < connections . length ; i ++ ) connections [ i ] . removeListener ( invokeListener ) ; synchronized ( instancesLock ) { ArrayList < ObjectSpace > temp = new ArrayList ( Arrays . asList ( instances ) ) ; temp . remove ( this ) ; instances = temp . to... |
public class LocLogger { /** * Log a localized message at the INFO level .
* @ param key
* the key used for localization
* @ param args
* optional arguments */
public void info ( Enum < ? > key , Object ... args ) { } } | if ( ! logger . isInfoEnabled ( ) ) { return ; } String translatedMsg = imc . getMessage ( key , args ) ; MessageParameterObj mpo = new MessageParameterObj ( key , args ) ; if ( instanceofLAL ) { ( ( LocationAwareLogger ) logger ) . log ( LOCALIZED , FQCN , LocationAwareLogger . INFO_INT , translatedMsg , args , null )... |
public class DockerAndScriptUtils { /** * Builds a map with the variables defined by this class .
* @ param instance a non - null instance
* @ return a non - null map where all the properties here are mapped to their values for this instance */
public static Map < String , String > buildReferenceMap ( Instance inst... | Map < String , String > result = new HashMap < > ( ) ; String instancePath = InstanceHelpers . computeInstancePath ( instance ) ; result . put ( ROBOCONF_INSTANCE_NAME , instance . getName ( ) ) ; result . put ( ROBOCONF_INSTANCE_PATH , instancePath ) ; result . put ( ROBOCONF_COMPONENT_NAME , instance . getComponent (... |
public class IsotopePatternManipulator { /** * Return the isotope pattern sorted by mass
* to the highest abundance .
* @ param isotopeP The IsotopePattern object to sort
* @ return The IsotopePattern sorted */
public static IsotopePattern sortByMass ( IsotopePattern isotopeP ) { } } | try { IsotopePattern isoSort = ( IsotopePattern ) isotopeP . clone ( ) ; // Do nothing for empty isotope pattern
if ( isoSort . getNumberOfIsotopes ( ) == 0 ) return isoSort ; // Sort the isotopes
List < IsotopeContainer > listISO = isoSort . getIsotopes ( ) ; Collections . sort ( listISO , new Comparator < IsotopeCont... |
public class Threshold { /** * Configures the activation method with the comparison operator and the
* threshold .
* @ param parameters is the comparison operator and threshold */
@ Override public void configure ( String parameters ) { } } | if ( parameters . isEmpty ( ) ) { return ; } List < String > values = Op . split ( parameters , " " , true ) ; final int required = 2 ; if ( values . size ( ) < required ) { throw new RuntimeException ( MessageFormat . format ( "[configuration error] activation {0} requires {1} parameters" , this . getClass ( ) . getSi... |
public class AbstractExtendedSet { /** * { @ inheritDoc } */
@ Override public int powerSetSize ( int min , int max ) { } } | if ( min < 1 || max < min ) throw new IllegalArgumentException ( ) ; final int size = size ( ) ; // special cases
if ( size < min ) return 0 ; if ( size == min ) return 1 ; /* * Compute the sum of binomial coefficients ranging from ( size choose
* max ) to ( size choose min ) using dynamic programming */
// trivial c... |
public class TrConfigurator { /** * Initialize Tr ( and underlying Tr service ) . */
public static synchronized void init ( LogProviderConfig config ) { } } | if ( config == null ) throw new NullPointerException ( "LogProviderConfig must not be null" ) ; if ( loggingConfig . get ( ) . compareAndSet ( null , config ) ) { // Only initialize Tr once - - all subsequent changes go through update
// The synchronization of this method is gratuitous ( just makes us feel better ) ,
/... |
public class ProtoUtils { /** * Proto3 enums fields can accept and return unknown values via the get < Field > Value ( ) methods , we
* use those methods instead of the methods that deal with the enum constants in order to support
* unknown enum values . If we didn ' t , any field with an unknown enum value would t... | return descriptor . getType ( ) == Descriptors . FieldDescriptor . Type . ENUM && descriptor . getFile ( ) . getSyntax ( ) == Syntax . PROTO3 ; |
public class ViewStateReader { /** * Entry point for processing saved view state .
* @ param file project file
* @ param varData view state var data
* @ param fixedData view state fixed data
* @ throws IOException */
public void process ( ProjectFile file , Var2Data varData , byte [ ] fixedData ) throws IOExcep... | Props props = getProps ( varData ) ; // System . out . println ( props ) ;
if ( props != null ) { String viewName = MPPUtility . removeAmpersands ( props . getUnicodeString ( VIEW_NAME ) ) ; byte [ ] listData = props . getByteArray ( VIEW_CONTENTS ) ; List < Integer > uniqueIdList = new LinkedList < Integer > ( ) ; if ... |
public class AbstractGenericHandler { /** * Publishes a response with the attached observable .
* @ param response the response to publish .
* @ param observable pushing into the event sink . */
protected void publishResponse ( final CouchbaseResponse response , final Subject < CouchbaseResponse , CouchbaseResponse... | if ( response . status ( ) != ResponseStatus . RETRY && observable != null ) { if ( moveResponseOut ) { Scheduler scheduler = env ( ) . scheduler ( ) ; if ( scheduler instanceof CoreScheduler ) { scheduleDirect ( ( CoreScheduler ) scheduler , response , observable ) ; } else { scheduleWorker ( scheduler , response , ob... |
public class ModeledUserGroup { /** * Stores all restricted ( privileged ) attributes within the given Map ,
* pulling the values of those attributes from the underlying user group
* model . If no value is yet defined for an attribute , that attribute will
* be set to null .
* @ param attributes
* The Map to ... | // Set disabled attribute
attributes . put ( DISABLED_ATTRIBUTE_NAME , getModel ( ) . isDisabled ( ) ? "true" : null ) ; |
public class JobStateToJsonConverter { /** * Write a list of { @ link JobState } s to json document .
* @ param jsonWriter { @ link com . google . gson . stream . JsonWriter }
* @ param jobStates list of { @ link JobState } s to write to json document
* @ throws IOException */
private void writeJobStates ( JsonWr... | jsonWriter . beginArray ( ) ; for ( JobState jobState : jobStates ) { writeJobState ( jsonWriter , jobState ) ; } jsonWriter . endArray ( ) ; |
public class CPDefinitionVirtualSettingLocalServiceUtil { /** * Deletes the cp definition virtual setting with the primary key from the database . Also notifies the appropriate model listeners .
* @ param CPDefinitionVirtualSettingId the primary key of the cp definition virtual setting
* @ return the cp definition ... | return getService ( ) . deleteCPDefinitionVirtualSetting ( CPDefinitionVirtualSettingId ) ; |
public class ConfidenceInterval { /** * Adapted from https : / / gist . github . com / gcardone / 5536578.
* @ param alpha probability of incorrectly rejecting the null hypothesis ( 1
* - confidence _ level )
* @ param df degrees of freedom
* @ param n number of observations
* @ param std standard deviation
... | // Create T Distribution with df degrees of freedom
TDistribution tDist = new TDistribution ( df ) ; // Calculate critical value
double critVal = tDist . inverseCumulativeProbability ( 1.0 - alpha ) ; // Calculate confidence interval
double ci = critVal * std / Math . sqrt ( n ) ; double lower = mean - ci ; double uppe... |
public class HBCIUtils { /** * Gibt zu einer gegebenen Bankleitzahl zurück , welche HBCI - Version für DDV
* bzw . RDH zu verwenden ist . Siehe auch { @ link # getPinTanVersionForBLZ ( String ) } .
* @ param blz
* @ return HBCI - Version
* @ deprecated Bitte { @ link HBCIUtils # getBankInfo ( String ) } verwe... | BankInfo info = getBankInfo ( blz ) ; if ( info == null ) return "" ; return info . getRdhVersion ( ) != null ? info . getRdhVersion ( ) . getId ( ) : "" ; |
public class User { /** * Deletes this user from Hudson . */
@ RequirePOST public void doDoDelete ( StaplerRequest req , StaplerResponse rsp ) throws IOException { } } | checkPermission ( Jenkins . ADMINISTER ) ; if ( idStrategy ( ) . equals ( id , Jenkins . getAuthentication ( ) . getName ( ) ) ) { rsp . sendError ( HttpServletResponse . SC_BAD_REQUEST , "Cannot delete self" ) ; return ; } delete ( ) ; rsp . sendRedirect2 ( "../.." ) ; |
public class CreateSSLCertificateTask { /** * { @ inheritDoc } */
@ Override public String getTaskHelp ( ) { } } | return getTaskHelp ( "sslCert.desc" , "sslCert.usage.options" , "sslCert.required-key." , "sslCert.required-desc." , "sslCert.option-key." , "sslCert.option-desc." , "sslCert.option.addon" , null , scriptName , DefaultSSLCertificateCreator . MINIMUM_PASSWORD_LENGTH , DefaultSSLCertificateCreator . DEFAULT_VALIDITY , De... |
public class BitmapUtils { /** * Compress the bitmap to the byte array as the specified format and quality .
* @ param bitmap to compress .
* @ param format the format .
* @ param quality the quality of the compressed bitmap .
* @ return the compressed bitmap byte array . */
public static byte [ ] toByteArray (... | ByteArrayOutputStream out = null ; try { out = new ByteArrayOutputStream ( ) ; bitmap . compress ( format , quality , out ) ; return out . toByteArray ( ) ; } finally { CloseableUtils . close ( out ) ; } |
public class MjdbcLogger { /** * Checks if SLF4j is available ( loaded ) in JVM
* @ return true - if SLF4j is available for use */
public static boolean isSLF4jAvailable ( ) { } } | if ( SLF4jAvailable == null ) { try { Class . forName ( "org.slf4j.Logger" ) ; setSLF4jAvailable ( true ) ; } catch ( ClassNotFoundException e ) { setSLF4jAvailable ( false ) ; } } return SLF4jAvailable ; |
public class ExpiryPolicyBuilder { /** * Set TTL since last update .
* Note : Calling this method on a builder with an existing TTL since last access will override the previous value or function .
* @ param update TTL since last update
* @ return a new builder with the TTL since last update */
public ExpiryPolicy... | if ( update != null && update . isNegative ( ) ) { throw new IllegalArgumentException ( "Update duration must be positive" ) ; } return update ( ( a , b , c ) -> update ) ; |
public class ListMath { /** * Performs a linear transformation on inverse value of each number in a list .
* @ param data The list of numbers to divide the numerator by
* @ param numerator The numerator for each division
* @ param offset The additive constant
* @ return result [ x ] = numerator / data [ x ] + o... | return new ListDouble ( ) { @ Override public double getDouble ( int index ) { return numerator / data . getDouble ( index ) + offset ; } @ Override public int size ( ) { return data . size ( ) ; } } ; |
public class PrettySharedPreferences { /** * Call to commit changes .
* @ see android . content . SharedPreferences . Editor # commit ( ) */
public boolean commit ( ) { } } | if ( editing == null ) { return false ; } final boolean result = editing . commit ( ) ; editing = null ; return result ; |
public class MuxInputStream { /** * Gets the raw input stream . Clients will normally not call
* this . */
protected InputStream getInputStream ( ) throws IOException { } } | if ( is == null && server != null ) is = server . readChannel ( channel ) ; return is ; |
public class RtpChannel { /** * Sets the connection mode of the channel . < br >
* Possible modes : send _ only , recv _ only , inactive , send _ recv , conference , network _ loopback .
* @ param connectionMode the new connection mode adopted by the channel */
public void updateMode ( ConnectionMode connectionMode... | switch ( connectionMode ) { case SEND_ONLY : this . rtpHandler . setReceivable ( false ) ; this . rtpHandler . setLoopable ( false ) ; audioComponent . updateMode ( false , true ) ; oobComponent . updateMode ( false , true ) ; this . rtpHandler . deactivate ( ) ; this . transmitter . activate ( ) ; break ; case RECV_ON... |
public class FlatFileUtils { /** * Removes the characters from the string . */
public static String remove ( String string , char c ) { } } | return string . replaceAll ( String . valueOf ( c ) , "" ) ; |
public class SpeechToTextWebSocketListener { /** * Send input stream .
* @ param inputStream the input stream */
private void sendInputStream ( InputStream inputStream ) { } } | byte [ ] buffer = new byte [ ONE_KB ] ; int read ; try { // This method uses a blocking while loop to receive all contents of the underlying input stream .
// AudioInputStreams , typically used for streaming microphone inputs return 0 only when the stream has been
// closed . Elsewise AudioInputStream . read ( ) blocks... |
public class BaseXmlImporter { /** * Return new node index .
* @ param parentData
* @ param name
* @ param skipIdentifier
* @ return
* @ throws PathNotFoundException
* @ throws IllegalPathException
* @ throws RepositoryException */
public int getNodeIndex ( NodeData parentData , InternalQName name , Strin... | if ( name instanceof QPathEntry ) { name = new InternalQName ( name . getNamespace ( ) , name . getName ( ) ) ; } int newIndex = 1 ; NodeDefinitionData nodedef = nodeTypeDataManager . getChildNodeDefinition ( name , parentData . getPrimaryTypeName ( ) , parentData . getMixinTypeNames ( ) ) ; List < ItemState > transien... |
public class XMxmlSerializer { /** * ( non - Javadoc )
* @ see
* org . deckfour . xes . out . XesSerializer # serialize ( org . deckfour . xes . model . XLog ,
* java . io . OutputStream ) */
public void serialize ( XLog log , OutputStream out ) throws IOException { } } | XLogging . log ( "start serializing log to MXML" , XLogging . Importance . DEBUG ) ; long start = System . currentTimeMillis ( ) ; SXDocument doc = new SXDocument ( out ) ; doc . addComment ( "This file has been generated with the OpenXES library. It conforms" ) ; doc . addComment ( "to the legacy MXML standard for log... |
public class AbstractAddStepHandler { /** * < strong > Deprecated < / strong > . Subclasses wishing for custom rollback behavior should instead override
* { @ link # rollbackRuntime ( OperationContext , org . jboss . dmr . ModelNode , org . jboss . as . controller . registry . Resource ) } .
* This default implemen... | // no - op |
public class AWSACMPCAWaiters { /** * Builds a CertificateAuthorityCSRCreated waiter by using custom parameters waiterParameters and other parameters
* defined in the waiters specification , and then polls until it determines whether the resource entered the desired
* state or not , where polling criteria is bound ... | return new WaiterBuilder < GetCertificateAuthorityCsrRequest , GetCertificateAuthorityCsrResult > ( ) . withSdkFunction ( new GetCertificateAuthorityCsrFunction ( client ) ) . withAcceptors ( new HttpSuccessStatusAcceptor ( WaiterState . SUCCESS ) , new CertificateAuthorityCSRCreated . IsRequestInProgressExceptionMatch... |
public class IntHashMap { /** * Returns a set view of the keys contained in this map . The set is
* backed by the map , so changes to the map are reflected in the set , and
* vice - versa . The set supports element removal , which removes the
* corresponding mapping from this map , via the < tt > Iterator . remov... | if ( keySet == null ) { keySet = new AbstractSet ( ) { public Iterator iterator ( ) { return new IntHashIterator ( KEYS ) ; } public int size ( ) { return count ; } public boolean contains ( Object o ) { return containsKey ( o ) ; } public boolean remove ( Object o ) { return IntHashMap . this . remove ( o ) != null ; ... |
public class GrailsDomainBinder { /** * Creates and binds the discriminator property used in table - per - hierarchy inheritance to
* discriminate between sub class instances
* @ param table The table to bind onto
* @ param entity The root class entity
* @ param mappings The mappings instance */
protected void ... | Mapping m = getMapping ( entity . getMappedClass ( ) ) ; SimpleValue d = new SimpleValue ( metadataBuildingContext , table ) ; entity . setDiscriminator ( d ) ; DiscriminatorConfig discriminatorConfig = m != null ? m . getDiscriminator ( ) : null ; boolean hasDiscriminatorConfig = discriminatorConfig != null ; entity .... |
public class SqlExecutor { /** * 执行非查询 SQL语句
* @ param sql 需要执行的非查询SQL语句对象 ( insert / update / delete )
* @ return 是否执行成功
* @ throws SQLException SQL执行异常 */
public boolean execute ( Sql sql ) throws SQLException { } } | long start = System . currentTimeMillis ( ) ; if ( sql . validate ( ) == false ) { return false ; } boolean result = false ; PreparedStatement stmt = null ; try { stmt = this . createStatment ( conn , sql ) ; stmt . execute ( ) ; result = true ; } catch ( SQLException e ) { throw e ; } finally { try { if ( stmt != null... |
public class ControllableBaseInterceptor { /** * for Generic headache .
* @ param annotations The array of annotation . ( NotNull , EmptyAllowed )
* @ return The list of annotation type . ( NotNull , EmptyAllowed ) */
protected List < Class < ? extends Annotation > > createAnnotationTypeList ( Class < ? > ... annot... | final List < Class < ? extends Annotation > > annotationList = new ArrayList < Class < ? extends Annotation > > ( ) ; for ( Class < ? > annoType : annotations ) { @ SuppressWarnings ( "unchecked" ) final Class < ? extends Annotation > castType = ( Class < ? extends Annotation > ) annoType ; annotationList . add ( castT... |
public class Sign { /** * 用私钥对信息生成数字签名
* @ param data 加密数据
* @ return 签名 */
public byte [ ] sign ( byte [ ] data ) { } } | lock . lock ( ) ; try { signature . initSign ( this . privateKey ) ; signature . update ( data ) ; return signature . sign ( ) ; } catch ( Exception e ) { throw new CryptoException ( e ) ; } finally { lock . unlock ( ) ; } |
public class Driver { /** * Creates a connection to specified | url | with given configuration | info | .
* @ param url the JDBC URL
* @ param info the properties for the new connection
* @ return the configured connection
* @ throws SQLException if fails to connect
* @ see # connect ( java . lang . String , ... | return connect ( url , props ( info ) ) ; |
public class LoggerWrapper { /** * Log a DOM node list at the FINER level
* @ param msg The message to show with the list , or null if no message
* needed
* @ param nodeList
* @ see NodeList */
public void logDomNodeList ( String msg , NodeList nodeList ) { } } | StackTraceElement caller = StackTraceUtils . getCallerStackTraceElement ( ) ; String toLog = ( msg != null ? msg + "\n" : "DOM nodelist:\n" ) ; for ( int i = 0 ; i < nodeList . getLength ( ) ; i ++ ) { toLog += domNodeDescription ( nodeList . item ( i ) , 0 ) + "\n" ; } if ( caller != null ) { logger . logp ( Level . F... |
public class ApnsPayloadBuilder { /** * < p > Sets a subtitle for the notification . Clears any previously - set localized subtitle key and arguments . < / p >
* < p > By default , no subtitle is included . Requires iOS 10 or newer . < / p >
* @ param alertSubtitle the subtitle for this push notification
* @ retu... | this . alertSubtitle = alertSubtitle ; this . localizedAlertSubtitleKey = null ; this . localizedAlertSubtitleArguments = null ; return this ; |
public class Peer { /** * Called each time the state of a call changes to determine the Peers
* overall state . */
private void evaluateState ( ) { } } | synchronized ( this . callList ) { // Get the highest prioirty state from the set of calls .
PeerState newState = PeerState . NOTSET ; for ( CallTracker call : this . callList ) { if ( call . getState ( ) . getPriority ( ) > newState . getPriority ( ) ) newState = call . getState ( ) ; } this . _state = newState ; } |
public class BugPrioritySorter { /** * Sorts bug groups on severity first , then on bug pattern name . */
static int compareGroups ( BugGroup m1 , BugGroup m2 ) { } } | int result = m1 . compareTo ( m2 ) ; if ( result == 0 ) { return m1 . getShortDescription ( ) . compareToIgnoreCase ( m2 . getShortDescription ( ) ) ; } return result ; |
public class PromptOptions { /** * Creates a new { @ link PromptOptions } .
* @ param message
* @ return */
public static final PromptOptions newOptions ( final String message ) { } } | PromptOptions options = JavaScriptObject . createObject ( ) . cast ( ) ; options . setMessage ( message ) ; options . setCallback ( PromptCallback . DEFAULT_PROMPT_CALLBACK ) ; return options ; |
public class JMLambda { /** * Bi function if true optional .
* @ param < T > the type parameter
* @ param < U > the type parameter
* @ param < R > the type parameter
* @ param bool the bool
* @ param target1 the target 1
* @ param target2 the target 2
* @ param biFunction the bi function
* @ return the ... | return supplierIfTrue ( bool , ( ) -> biFunction . apply ( target1 , target2 ) ) ; |
public class AmazonRoute53Client { /** * Creates a new version of an existing traffic policy . When you create a new version of a traffic policy , you
* specify the ID of the traffic policy that you want to update and a JSON - formatted document that describes the new
* version . You use traffic policies to create ... | request = beforeClientExecution ( request ) ; return executeCreateTrafficPolicyVersion ( request ) ; |
public class SchemaUpdater { /** * Executes the given statement . */
private void execute ( String sql ) throws SQLException { } } | Statement statement = connection . createStatement ( ) ; try { statement . executeUpdate ( substitute ( sql ) ) ; } finally { DbUtils . closeQuietly ( statement ) ; } |
public class NodeImpl { /** * { @ inheritDoc } */
public void checkPermission ( String actions ) throws AccessControlException , RepositoryException { } } | checkValid ( ) ; if ( ! session . getAccessManager ( ) . hasPermission ( getACL ( ) , actions , session . getUserState ( ) . getIdentity ( ) ) ) { throw new AccessControlException ( "Permission denied " + getPath ( ) + " : " + actions ) ; } |
public class NodeEntryImpl { /** * Set the value for a specific attribute
* @ param name attribute name
* @ param value attribute value
* @ return value */
public String setAttribute ( final String name , final String value ) { } } | if ( null != value ) { return getAttributes ( ) . put ( name , value ) ; } else { getAttributes ( ) . remove ( name ) ; return value ; } |
public class AbstractCli { /** * Adds common options to { @ code parser } .
* @ param parser */
private void initializeCommonOptions ( OptionParser parser ) { } } | helpOpt = parser . acceptsAll ( Arrays . asList ( "help" , "h" ) , "Print this help message." ) ; randomSeed = parser . accepts ( "randomSeed" , "Seed to use for generating random numbers. " + "Program execution may still be nondeterministic, if multithreading is used." ) . withRequiredArg ( ) . ofType ( Long . class )... |
public class BplusTreeFile { /** * Read metadata from file
* @ return true if file is clean or not
* @ throws InvalidDataException if metadata is invalid */
private boolean readMetaData ( ) throws InvalidDataException { } } | final ByteBuffer buf = storage . get ( 0 ) ; int magic1 , magic2 , t_b_order_leaf , t_b_order_internal , t_blockSize ; // sanity
boolean isClean = false ; magic1 = buf . getInt ( ) ; if ( magic1 != MAGIC_1 ) { throw new InvalidDataException ( "Invalid metadata (MAGIC1)" ) ; } t_blockSize = buf . getInt ( ) ; if ( t_blo... |
public class MutableBigInteger { /** * Sets this MutableBigInteger ' s value array to a copy of the specified
* array . The intLen is set to the length of the specified array . */
void copyValue ( int [ ] val ) { } } | int len = val . length ; if ( value . length < len ) value = new int [ len ] ; System . arraycopy ( val , 0 , value , 0 , len ) ; intLen = len ; offset = 0 ; |
public class HashtableOnDisk { /** * This invokes the action ' s " execute " method once for every
* object passing only the key to the method , to avoid the
* overhead of reading the object if it is not necessary .
* The iteration is synchronized with concurrent get and put operations
* to avoid locking the HT... | return walkHash ( action , RETRIEVE_KEY , index , length ) ; |
public class ApplicationContextProvider { /** * Gets cas properties .
* @ return the cas properties */
public static Optional < CasConfigurationProperties > getCasConfigurationProperties ( ) { } } | if ( CONTEXT != null ) { return Optional . of ( CONTEXT . getBean ( CasConfigurationProperties . class ) ) ; } return Optional . empty ( ) ; |
public class CharInfo { /** * Map a character to a String . For example given
* the character ' > ' this method would return the fully decorated
* entity name " & lt ; " .
* Strings for entity references are loaded from a properties file ,
* but additional mappings defined through calls to defineChar2String ( )... | // CharKey m _ charKey = new CharKey ( ) ; / / Alternative to synchronized
m_charKey . setChar ( value ) ; return ( String ) m_charToString . get ( m_charKey ) ; |
public class DeploymentMetadataParse { /** * Transform a < code > & lt ; plugin . . . / & gt ; < / code > structure . */
protected void parseProcessEnginePlugin ( Element element , List < ProcessEnginePluginXml > plugins ) { } } | ProcessEnginePluginXmlImpl plugin = new ProcessEnginePluginXmlImpl ( ) ; Map < String , String > properties = new HashMap < String , String > ( ) ; for ( Element childElement : element . elements ( ) ) { if ( PLUGIN_CLASS . equals ( childElement . getTagName ( ) ) ) { plugin . setPluginClass ( childElement . getText ( ... |
public class DescribeTrailsResult { /** * The list of trail objects .
* @ param trailList
* The list of trail objects . */
public void setTrailList ( java . util . Collection < Trail > trailList ) { } } | if ( trailList == null ) { this . trailList = null ; return ; } this . trailList = new com . amazonaws . internal . SdkInternalList < Trail > ( trailList ) ; |
public class SocketController { /** * creates application lifecycle and network connectivity callbacks .
* @ return Application lifecycle and network connectivity callbacks . */
public LifecycleListener createLifecycleListener ( ) { } } | return new LifecycleListener ( ) { @ Override public void onForegrounded ( Context context ) { synchronized ( lock ) { if ( ! isForegrounded ) { isForegrounded = true ; connectSocket ( ) ; if ( receiver == null ) { receiver = new InternetConnectionReceiver ( socketConnection ) ; } context . registerReceiver ( receiver ... |
public class ExceptionHandling { /** * Find a location ( class and line number ) where an exception occurred
* - ignore Assert and ChorusAssert if these are at the top of the exception stack ,
* we ' re trying to provide the user class which used the assertions */
public static String getExceptionLocation ( Throwab... | StackTraceElement element = findStackTraceElement ( t ) ; return element != null ? "(" + getSimpleClassName ( element ) + ":" + element . getLineNumber ( ) + ")-" : "" ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.