signature
stringlengths 43
39.1k
| implementation
stringlengths 0
450k
|
|---|---|
public class ToStringOption { /** * Return a < code > ToStringOption < / code > instance with { @ link # appendTransient } option set .
* if the current instance is not { @ link # DEFAULT _ OPTION default instance } then set
* on the current instance and return the current instance . Otherwise , clone the default
* instance and set on the clone and return the clone
* @ param appendTransient
* @ return this option instance or clone if this is the { @ link # DEFAULT _ OPTION } */
public ToStringOption setAppendTransient ( boolean appendTransient ) { } }
|
ToStringOption op = this ; if ( this == DEFAULT_OPTION ) { op = new ToStringOption ( this . appendStatic , this . appendTransient ) ; } op . appendTransient = appendTransient ; return op ;
|
public class NamePreservingRunnable { /** * Wraps { @ link Thread # setName ( String ) } to catch a possible { @ link Exception } s such as
* { @ link SecurityException } in sandbox environments , such as applets */
private void setName ( Thread thread , String name ) { } }
|
try { thread . setName ( name ) ; } catch ( SecurityException se ) { if ( LOGGER . isWarnEnabled ( ) ) { LOGGER . warn ( "Failed to set the thread name." , se ) ; } }
|
public class DirectBufferProxy { /** * Lexicographically compare two buffers .
* @ param o1 left operand ( required )
* @ param o2 right operand ( required )
* @ return as specified by { @ link Comparable } interface */
@ SuppressWarnings ( "checkstyle:ReturnCount" ) public static int compareBuff ( final DirectBuffer o1 , final DirectBuffer o2 ) { } }
|
requireNonNull ( o1 ) ; requireNonNull ( o2 ) ; if ( o1 . equals ( o2 ) ) { return 0 ; } final int minLength = Math . min ( o1 . capacity ( ) , o2 . capacity ( ) ) ; final int minWords = minLength / Long . BYTES ; for ( int i = 0 ; i < minWords * Long . BYTES ; i += Long . BYTES ) { final long lw = o1 . getLong ( i , BIG_ENDIAN ) ; final long rw = o2 . getLong ( i , BIG_ENDIAN ) ; final int diff = Long . compareUnsigned ( lw , rw ) ; if ( diff != 0 ) { return diff ; } } for ( int i = minWords * Long . BYTES ; i < minLength ; i ++ ) { final int lw = Byte . toUnsignedInt ( o1 . getByte ( i ) ) ; final int rw = Byte . toUnsignedInt ( o2 . getByte ( i ) ) ; final int result = Integer . compareUnsigned ( lw , rw ) ; if ( result != 0 ) { return result ; } } return o1 . capacity ( ) - o2 . capacity ( ) ;
|
public class ParallelOracleBuilders { /** * Creates a { @ link DynamicParallelOracleBuilder } using the provided supplier . Uses the further specified
* { @ link DynamicParallelOracleBuilder # withPoolPolicy ( PoolPolicy ) } and
* { @ link DynamicParallelOracleBuilder # withPoolSize ( int ) } ( or its defaults ) to determine the thread pool .
* @ param oracleSupplier
* the supplier for spawning new thread - specific membership oracle instances
* @ param < I >
* input symbol type
* @ param < D >
* output domain type
* @ return a preconfigured oracle builder */
@ Nonnull public static < I , D > DynamicParallelOracleBuilder < I , D > newDynamicParallelOracle ( Supplier < ? extends MembershipOracle < I , D > > oracleSupplier ) { } }
|
return new DynamicParallelOracleBuilder < > ( oracleSupplier ) ;
|
public class CameraConfigurationManager { /** * Reads , one time , values from the camera that are needed by the app . */
void initFromCameraParameters ( Camera camera ) { } }
|
Camera . Parameters parameters = camera . getParameters ( ) ; WindowManager manager = ( WindowManager ) context . getSystemService ( Context . WINDOW_SERVICE ) ; Display display = manager . getDefaultDisplay ( ) ; Point theScreenResolution = new Point ( ) ; getDisplaySize ( display , theScreenResolution ) ; screenResolution = theScreenResolution ; Log . i ( TAG , "Screen resolution: " + screenResolution ) ; cameraResolution = findBestPreviewSizeValue ( parameters , screenResolution ) ; Log . i ( TAG , "Camera resolution: " + cameraResolution ) ;
|
public class SCoveragePreCompileMojo { /** * Configures project for compilation with SCoverage instrumentation .
* @ throws MojoExecutionException if unexpected problem occurs */
@ Override public void execute ( ) throws MojoExecutionException { } }
|
if ( "pom" . equals ( project . getPackaging ( ) ) ) { getLog ( ) . info ( "Skipping SCoverage execution for project with packaging type 'pom'" ) ; // for aggragetor mojo - list of submodules : List < MavenProject > modules = project . getCollectedProjects ( ) ;
return ; } if ( skip ) { getLog ( ) . info ( "Skipping Scoverage execution" ) ; Properties projectProperties = project . getProperties ( ) ; // for maven - resources - plugin ( testResources ) , maven - compiler - plugin ( testCompile ) ,
// sbt - compiler - maven - plugin ( testCompile ) , scala - maven - plugin ( testCompile ) ,
// maven - surefire - plugin and scalatest - maven - plugin
setProperty ( projectProperties , "maven.test.skip" , "true" ) ; // for scalatest - maven - plugin and specs2 - maven - plugin
setProperty ( projectProperties , "skipTests" , "true" ) ; return ; } long ts = System . currentTimeMillis ( ) ; String scalaBinaryVersion = null ; String resolvedScalaVersion = resolveScalaVersion ( ) ; if ( resolvedScalaVersion != null ) { if ( "2.10" . equals ( resolvedScalaVersion ) || resolvedScalaVersion . startsWith ( "2.10." ) ) { scalaBinaryVersion = "2.10" ; } else if ( "2.11" . equals ( resolvedScalaVersion ) || resolvedScalaVersion . startsWith ( "2.11." ) ) { scalaBinaryVersion = "2.11" ; } else if ( "2.12" . equals ( resolvedScalaVersion ) || resolvedScalaVersion . startsWith ( "2.12." ) ) { scalaBinaryVersion = "2.12" ; } else if ( "2.13.0-RC1" . equals ( resolvedScalaVersion ) ) { scalaBinaryVersion = "2.13.0-RC1" ; } else { getLog ( ) . warn ( String . format ( "Skipping SCoverage execution - unsupported Scala version \"%s\"" , resolvedScalaVersion ) ) ; return ; } } else { getLog ( ) . warn ( "Skipping SCoverage execution - Scala version not set" ) ; return ; } Map < String , String > additionalProjectPropertiesMap = null ; if ( additionalForkedProjectProperties != null && ! additionalForkedProjectProperties . isEmpty ( ) ) { String [ ] props = additionalForkedProjectProperties . split ( ";" ) ; additionalProjectPropertiesMap = new HashMap < String , String > ( props . length ) ; for ( String propVal : props ) { String [ ] tmp = propVal . split ( "=" , 2 ) ; if ( tmp . length == 2 ) { String propName = tmp [ 0 ] . trim ( ) ; String propValue = tmp [ 1 ] . trim ( ) ; additionalProjectPropertiesMap . put ( propName , propValue ) ; } else { getLog ( ) . warn ( String . format ( "Skipping invalid additional forked project property \"%s\", must be in \"key=value\" format" , propVal ) ) ; } } } SCoverageForkedLifecycleConfigurator . afterForkedLifecycleEnter ( project , reactorProjects , additionalProjectPropertiesMap ) ; try { Artifact pluginArtifact = getScalaScoveragePluginArtifact ( scalaBinaryVersion ) ; Artifact runtimeArtifact = getScalaScoverageRuntimeArtifact ( scalaBinaryVersion ) ; if ( pluginArtifact == null ) { return ; // scoverage plugin will not be configured
} addScoverageDependenciesToClasspath ( runtimeArtifact ) ; String arg = DATA_DIR_OPTION + dataDirectory . getAbsolutePath ( ) ; String _scalacOptions = quoteArgument ( arg ) ; String addScalacArgs = arg ; if ( ! StringUtils . isEmpty ( excludedPackages ) ) { arg = EXCLUDED_PACKAGES_OPTION + excludedPackages . replace ( "(empty)" , "<empty>" ) ; _scalacOptions = _scalacOptions + SPACE + quoteArgument ( arg ) ; addScalacArgs = addScalacArgs + PIPE + arg ; } if ( ! StringUtils . isEmpty ( excludedFiles ) ) { arg = EXCLUDED_FILES_OPTION + excludedFiles ; _scalacOptions = _scalacOptions + SPACE + quoteArgument ( arg ) ; addScalacArgs = addScalacArgs + PIPE + arg ; } if ( highlighting ) { _scalacOptions = _scalacOptions + SPACE + "-Yrangepos" ; addScalacArgs = addScalacArgs + PIPE + "-Yrangepos" ; } String _scalacPlugins = String . format ( "%s:%s:%s" , pluginArtifact . getGroupId ( ) , pluginArtifact . getArtifactId ( ) , pluginArtifact . getVersion ( ) ) ; arg = PLUGIN_OPTION + pluginArtifact . getFile ( ) . getAbsolutePath ( ) ; addScalacArgs = addScalacArgs + PIPE + arg ; Properties projectProperties = project . getProperties ( ) ; // for sbt - compiler - maven - plugin ( version 1.0.0 - beta5 + )
setProperty ( projectProperties , "sbt._scalacOptions" , _scalacOptions ) ; // for sbt - compiler - maven - plugin ( version 1.0.0 - beta5 + )
setProperty ( projectProperties , "sbt._scalacPlugins" , _scalacPlugins ) ; // for scala - maven - plugin ( version 3.0.0 + )
setProperty ( projectProperties , "addScalacArgs" , addScalacArgs ) ; // for scala - maven - plugin ( version 3.1.0 + )
setProperty ( projectProperties , "analysisCacheFile" , "${project.build.directory}/scoverage-analysis/compile" ) ; // for maven - surefire - plugin and scalatest - maven - plugin
setProperty ( projectProperties , "maven.test.failure.ignore" , "true" ) ; // for maven - jar - plugin
// VERY IMPORTANT ! Prevents from overwriting regular project artifact file
// with instrumented one during " integration - check " or " integration - report " execution .
project . getBuild ( ) . setFinalName ( "scoverage-" + project . getBuild ( ) . getFinalName ( ) ) ; saveSourceRootsToFile ( ) ; } catch ( ArtifactNotFoundException e ) { throw new MojoExecutionException ( "SCoverage preparation failed" , e ) ; } catch ( ArtifactResolutionException e ) { throw new MojoExecutionException ( "SCoverage preparation failed" , e ) ; } catch ( IOException e ) { throw new MojoExecutionException ( "SCoverage preparation failed" , e ) ; } long te = System . currentTimeMillis ( ) ; getLog ( ) . debug ( String . format ( "Mojo execution time: %d ms" , te - ts ) ) ;
|
public class BouncyCastleCertProcessingFactory { /** * Creates a new proxy credential from the specified certificate chain and a private key . A set of X . 509
* extensions can be optionally included in the new proxy certificate . This function automatically creates
* a " RSA " - based key pair .
* @ see # createProxyCertificate ( X509Certificate , PrivateKey , PublicKey , int , int , X509ExtensionSet ,
* String ) createProxyCertificate
* @ param certs
* the certificate chain for the new proxy credential . The top - most certificate
* < code > cert [ 0 ] < / code > will be designated as the issuing certificate .
* @ param privateKey
* the private key of the issuing certificate . The new proxy certificate will be signed with
* that private key .
* @ param bits
* the strength of the key pair for the new proxy certificate .
* @ param lifetime
* lifetime of the new certificate in seconds . If 0 ( or less then ) the new certificate will
* have the same lifetime as the issuing certificate .
* @ param certType
* the type of proxy credential to create
* @ param extSet
* a set of X . 509 extensions to be included in the new proxy certificate . Can be null . If
* delegation mode is { @ link org . globus . gsi . GSIConstants . CertificateType # GSI _ 3 _ RESTRICTED _ PROXY
* GSIConstants . CertificateType . GSI _ 3 _ RESTRICTED _ PROXY } or { @ link org . globus . gsi . GSIConstants . CertificateType # GSI _ 4 _ RESTRICTED _ PROXY
* GSIConstants . CertificateType . GSI _ 4 _ RESTRICTED _ PROXY } then
* { @ link org . globus . gsi . proxy . ext . ProxyCertInfoExtension ProxyCertInfoExtension } must be
* present in the extension set .
* @ param cnValue
* the value of the CN component of the subject of the new proxy credential . If null , the
* defaults will be used depending on the proxy certificate type created .
* @ return < code > GlobusCredential < / code > the new proxy credential .
* @ exception GeneralSecurityException
* if a security error occurs . */
public X509Credential createCredential ( X509Certificate [ ] certs , PrivateKey privateKey , int bits , int lifetime , GSIConstants . CertificateType certType , X509ExtensionSet extSet , String cnValue ) throws GeneralSecurityException { } }
|
X509Certificate [ ] bcCerts = getX509CertificateObjectChain ( certs ) ; KeyPairGenerator keyGen = null ; keyGen = KeyPairGenerator . getInstance ( "RSA" , "BC" ) ; keyGen . initialize ( bits ) ; KeyPair keyPair = keyGen . genKeyPair ( ) ; X509Certificate newCert = createProxyCertificate ( bcCerts [ 0 ] , privateKey , keyPair . getPublic ( ) , lifetime , certType , extSet , cnValue ) ; X509Certificate [ ] newCerts = new X509Certificate [ bcCerts . length + 1 ] ; newCerts [ 0 ] = newCert ; System . arraycopy ( certs , 0 , newCerts , 1 , certs . length ) ; return new X509Credential ( keyPair . getPrivate ( ) , newCerts ) ;
|
public class StrictFormatStringValidation { /** * Helps { @ code validate ( ) } validate a format string that is a variable , but not a parameter . This
* method assumes that the format string variable has already been asserted to be final or
* effectively final . */
private static ValidationResult validateFormatStringVariable ( ExpressionTree formatStringTree , final Symbol formatStringSymbol , final List < ? extends ExpressionTree > args , final VisitorState state ) { } }
|
if ( formatStringSymbol . getKind ( ) != ElementKind . LOCAL_VARIABLE ) { return ValidationResult . create ( null , String . format ( "Variables used as format strings that are not local variables must be compile time" + " constants.\n%s is neither a local variable nor a compile time constant." , formatStringTree ) ) ; } // Find the Tree for the block in which the variable is defined . If it is not defined in this
// class ( though it may have been in a super class ) . We require compile time constant values in
// that case .
Symbol owner = formatStringSymbol . owner ; TreePath path = TreePath . getPath ( state . getPath ( ) , formatStringTree ) ; while ( path != null && ASTHelpers . getSymbol ( path . getLeaf ( ) ) != owner ) { path = path . getParentPath ( ) ; } // A local variable must be declared in a parent tree to be accessed . This case should be
// impossible .
if ( path == null ) { throw new IllegalStateException ( String . format ( "Could not find the Tree where local variable %s is declared. " + "This should be impossible." , formatStringTree ) ) ; } // Scan down from the scope where the variable was declared
ValidationResult result = path . getLeaf ( ) . accept ( new TreeScanner < ValidationResult , Void > ( ) { @ Override public ValidationResult visitVariable ( VariableTree node , Void unused ) { if ( ASTHelpers . getSymbol ( node ) == formatStringSymbol ) { if ( node . getInitializer ( ) == null ) { return ValidationResult . create ( null , String . format ( "Variables used as format strings must be initialized when they are" + " declared.\nInvalid declaration: %s" , node ) ) ; } return validateStringFromAssignment ( node , node . getInitializer ( ) , args , state ) ; } return super . visitVariable ( node , unused ) ; } @ Override public ValidationResult reduce ( ValidationResult r1 , ValidationResult r2 ) { if ( r1 == null && r2 == null ) { return null ; } return MoreObjects . firstNonNull ( r1 , r2 ) ; } } , null ) ; return result ;
|
public class ConnectionType { /** * Get the connection type from the virtual connection .
* @ param vc
* @ return ConnectionType */
public static ConnectionType getVCConnectionType ( VirtualConnection vc ) { } }
|
if ( vc == null ) { return null ; } return ( ConnectionType ) vc . getStateMap ( ) . get ( CONNECTION_TYPE_VC_KEY ) ;
|
public class TimSort { /** * Merges the two runs at stack indices i and i + 1 . Run i must be
* the penultimate or antepenultimate run on the stack . In other words ,
* i must be equal to stackSize - 2 or stackSize - 3.
* @ param i stack index of the first of the two runs to merge */
private void mergeAt ( int i ) { } }
|
assert stackSize >= 2 ; assert i >= 0 ; assert i == stackSize - 2 || i == stackSize - 3 ; int base1 = runBase [ i ] ; int len1 = runLen [ i ] ; int base2 = runBase [ i + 1 ] ; int len2 = runLen [ i + 1 ] ; assert len1 > 0 && len2 > 0 ; assert base1 + len1 == base2 ; /* * Record the length of the combined runs ; if i is the 3rd - last
* run now , also slide over the last run ( which isn ' t involved
* in this merge ) . The current run ( i + 1 ) goes away in any case . */
runLen [ i ] = len1 + len2 ; if ( i == stackSize - 3 ) { runBase [ i + 1 ] = runBase [ i + 2 ] ; runLen [ i + 1 ] = runLen [ i + 2 ] ; } stackSize -- ; /* * Find where the first element of run2 goes in run1 . Prior elements
* in run1 can be ignored ( because they ' re already in place ) . */
int k = gallopRight ( a [ base2 ] , a , base1 , len1 , 0 , c ) ; assert k >= 0 ; base1 += k ; len1 -= k ; if ( len1 == 0 ) return ; /* * Find where the last element of run1 goes in run2 . Subsequent elements
* in run2 can be ignored ( because they ' re already in place ) . */
len2 = gallopLeft ( a [ base1 + len1 - 1 ] , a , base2 , len2 , len2 - 1 , c ) ; assert len2 >= 0 ; if ( len2 == 0 ) return ; // Merge remaining runs , using tmp array with min ( len1 , len2 ) elements
if ( len1 <= len2 ) mergeLo ( base1 , len1 , base2 , len2 ) ; else mergeHi ( base1 , len1 , base2 , len2 ) ;
|
public class PropertyChangesStatistics { /** * Show an alert containing useful information for debugging . It also
* shows how many registrations happened since last call ; that ' s useful
* to detect registration leaks . */
String getStatistics ( ) { } }
|
String msg = "PropertyChanges stats :\r\n" + "# registered handlers : " + nbRegisteredHandlers + "\r\n" + "# notifications : " + nbNotifications + "\r\n" + "# dispatches : " + nbDispatches + "\r\n" ; StringBuilder details = new StringBuilder ( ) ; for ( Entry < String , Integer > e : counts . entrySet ( ) ) { details . append ( e . getKey ( ) + " => " + e . getValue ( ) ) ; Integer oldCount = oldCounts . get ( e . getKey ( ) ) ; if ( oldCount != null ) details . append ( " (diff: " + ( e . getValue ( ) - oldCount ) + ")" ) ; details . append ( "\n" ) ; } oldCounts = new HashMap < > ( counts ) ; return msg + details . toString ( ) ;
|
public class GetDomainNamesResult { /** * The elements from this collection .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setItems ( java . util . Collection ) } or { @ link # withItems ( java . util . Collection ) } if you want to override the
* existing values .
* @ param items
* The elements from this collection .
* @ return Returns a reference to this object so that method calls can be chained together . */
public GetDomainNamesResult withItems ( DomainName ... items ) { } }
|
if ( this . items == null ) { setItems ( new java . util . ArrayList < DomainName > ( items . length ) ) ; } for ( DomainName ele : items ) { this . items . add ( ele ) ; } return this ;
|
public class FileSystemConnector { /** * Utility method for obtaining the { @ link File } object that corresponds to the supplied identifier . Subclasses may override
* this method to change the format of the identifiers , but in that case should also override the { @ link # isRoot ( String ) } ,
* { @ link # isContentNode ( String ) } , and { @ link # idFor ( File ) } methods .
* @ param id the identifier ; may not be null
* @ return the File object for the given identifier
* @ see # isRoot ( String )
* @ see # isContentNode ( String )
* @ see # idFor ( File ) */
protected File fileFor ( String id ) { } }
|
assert id . startsWith ( DELIMITER ) ; if ( id . endsWith ( DELIMITER ) ) { id = id . substring ( 0 , id . length ( ) - DELIMITER . length ( ) ) ; } if ( isContentNode ( id ) ) { id = id . substring ( 0 , id . length ( ) - JCR_CONTENT_SUFFIX_LENGTH ) ; } return new File ( directory , id ) ;
|
public class TrellisUtils { /** * / * package - private because of JPMS */
static < T > Optional < T > findFirst ( final Class < T > service ) { } }
|
final ServiceLoader < T > loader = load ( service ) ; if ( loader == null ) return empty ( ) ; final Iterator < T > services = loader . iterator ( ) ; return services . hasNext ( ) ? of ( services . next ( ) ) : empty ( ) ;
|
public class BoardingPassBuilder { /** * Adds a secondary field for the current { @ link BoardingPass } object . This
* field is optional . There can be at most 5 secondary fields per boarding
* pass .
* @ param label
* the label for the additional field . It can ' t be empty .
* @ param value
* the value for the additional field . It can ' t be empty .
* @ return this builder . */
public BoardingPassBuilder addSecondaryField ( String label , String value ) { } }
|
Field field = new Field ( label , value ) ; this . boardingPass . addSecondaryField ( field ) ; return this ;
|
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcPipeFitting ( ) { } }
|
if ( ifcPipeFittingEClass == null ) { ifcPipeFittingEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 419 ) ; } return ifcPipeFittingEClass ;
|
public class TransferSQLText { /** * Method declaration
* @ param type
* @ param r
* @ param p
* @ throws SQLException */
private void transferRow ( TransferResultSet r ) throws Exception { } }
|
String sLast = "" ; int len = r . getColumnCount ( ) ; if ( WTextWrite == null ) { try { WTextWrite = new BufferedWriter ( new FileWriter ( sFileName ) ) ; } catch ( IOException e ) { throw new DataAccessPointException ( e . getMessage ( ) ) ; } } for ( int i = 0 ; i < len ; i ++ ) { int t = r . getColumnType ( i + 1 ) ; sLast = "column=" + r . getColumnName ( i + 1 ) + " datatype=" + ( String ) helper . getSupportedTypes ( ) . get ( new Integer ( t ) ) ; Object o = r . getObject ( i + 1 ) ; if ( o == null ) { sLast += " value=<null>" ; } else { o = helper . convertColumnValue ( o , i + 1 , t ) ; sLast += " value=\'" + o . toString ( ) + "\'" ; } WTextWrite . write ( "\t" + sLast + "\n" ) ; WTextWrite . flush ( ) ; } WTextWrite . write ( "\n" ) ; WTextWrite . flush ( ) ; sLast = "" ;
|
public class InterfaceService { /** * Allows to show a globally registered dialog .
* @ param dialogControllerClass class managing a single dialog . */
public void showDialog ( final Class < ? > dialogControllerClass ) { } }
|
if ( currentController != null ) { dialogControllers . get ( dialogControllerClass ) . show ( currentController . getStage ( ) ) ; }
|
public class MessageCacheImpl { /** * Removes a message from the cache .
* @ param message The message to remove . */
public void removeMessage ( Message message ) { } }
|
synchronized ( messages ) { messages . removeIf ( messageRef -> Objects . equals ( messageRef . get ( ) , message ) ) ; }
|
public class JsonUtil { /** * Returns a field in a Json object as a double .
* Throws IllegalArgumentException if the field value is null .
* @ param object the Json Object
* @ param field the field in the Json object to return
* @ return the Json field value as a double */
public static double getDouble ( JsonObject object , String field ) { } }
|
final JsonValue value = object . get ( field ) ; throwExceptionIfNull ( value , field ) ; return value . asDouble ( ) ;
|
public class DecimalFormat { /** * Check validity of using fast - path for this instance . If fast - path is valid
* for this instance , sets fast - path state as true and initializes fast - path
* utility fields as needed .
* This method is supposed to be called rarely , otherwise that will break the
* fast - path performance . That means avoiding frequent changes of the
* properties of the instance , since for most properties , each time a change
* happens , a call to this method is needed at the next format call .
* FAST - PATH RULES :
* Similar to the default DecimalFormat instantiation case .
* More precisely :
* - HALF _ EVEN rounding mode ,
* - isGroupingUsed ( ) is true ,
* - groupingSize of 3,
* - multiplier is 1,
* - Decimal separator not mandatory ,
* - No use of exponential notation ,
* - minimumIntegerDigits is exactly 1 and maximumIntegerDigits at least 10
* - For number of fractional digits , the exact values found in the default case :
* Currency : min = max = 2.
* Decimal : min = 0 . max = 3. */
private void checkAndSetFastPathStatus ( ) { } }
|
boolean fastPathWasOn = isFastPath ; if ( ( roundingMode == RoundingMode . HALF_EVEN ) && ( isGroupingUsed ( ) ) && ( groupingSize == 3 ) && ( secondaryGroupingSize == 0 ) && ( multiplier == 1 ) && ( ! decimalSeparatorAlwaysShown ) && ( ! useExponentialNotation ) ) { // The fast - path algorithm is semi - hardcoded against
// minimumIntegerDigits and maximumIntegerDigits .
isFastPath = ( ( minimumIntegerDigits == 1 ) && ( maximumIntegerDigits >= 10 ) ) ; // The fast - path algorithm is hardcoded against
// minimumFractionDigits and maximumFractionDigits .
if ( isFastPath ) { if ( isCurrencyFormat ) { if ( ( minimumFractionDigits != 2 ) || ( maximumFractionDigits != 2 ) ) isFastPath = false ; } else if ( ( minimumFractionDigits != 0 ) || ( maximumFractionDigits != 3 ) ) isFastPath = false ; } } else isFastPath = false ; // Since some instance properties may have changed while still falling
// in the fast - path case , we need to reinitialize fastPathData anyway .
if ( isFastPath ) { // We need to instantiate fastPathData if not already done .
if ( fastPathData == null ) fastPathData = new FastPathData ( ) ; // Sets up the locale specific constants used when formatting .
// '0 ' is our default representation of zero .
fastPathData . zeroDelta = symbols . getZeroDigit ( ) - '0' ; fastPathData . groupingChar = symbols . getGroupingSeparator ( ) ; // Sets up fractional constants related to currency / decimal pattern .
fastPathData . fractionalMaxIntBound = ( isCurrencyFormat ) ? 99 : 999 ; fastPathData . fractionalScaleFactor = ( isCurrencyFormat ) ? 100.0d : 1000.0d ; // Records the need for adding prefix or suffix
fastPathData . positiveAffixesRequired = ( positivePrefix . length ( ) != 0 ) || ( positiveSuffix . length ( ) != 0 ) ; fastPathData . negativeAffixesRequired = ( negativePrefix . length ( ) != 0 ) || ( negativeSuffix . length ( ) != 0 ) ; // Creates a cached char container for result , with max possible size .
int maxNbIntegralDigits = 10 ; int maxNbGroups = 3 ; int containerSize = Math . max ( positivePrefix . length ( ) , negativePrefix . length ( ) ) + maxNbIntegralDigits + maxNbGroups + 1 + maximumFractionDigits + Math . max ( positiveSuffix . length ( ) , negativeSuffix . length ( ) ) ; fastPathData . fastPathContainer = new char [ containerSize ] ; // Sets up prefix and suffix char arrays constants .
fastPathData . charsPositiveSuffix = positiveSuffix . toCharArray ( ) ; fastPathData . charsNegativeSuffix = negativeSuffix . toCharArray ( ) ; fastPathData . charsPositivePrefix = positivePrefix . toCharArray ( ) ; fastPathData . charsNegativePrefix = negativePrefix . toCharArray ( ) ; // Sets up fixed index positions for integral and fractional digits .
// Sets up decimal point in cached result container .
int longestPrefixLength = Math . max ( positivePrefix . length ( ) , negativePrefix . length ( ) ) ; int decimalPointIndex = maxNbIntegralDigits + maxNbGroups + longestPrefixLength ; fastPathData . integralLastIndex = decimalPointIndex - 1 ; fastPathData . fractionalFirstIndex = decimalPointIndex + 1 ; fastPathData . fastPathContainer [ decimalPointIndex ] = isCurrencyFormat ? symbols . getMonetaryDecimalSeparator ( ) : symbols . getDecimalSeparator ( ) ; } else if ( fastPathWasOn ) { // Previous state was fast - path and is no more .
// Resets cached array constants .
fastPathData . fastPathContainer = null ; fastPathData . charsPositiveSuffix = null ; fastPathData . charsNegativeSuffix = null ; fastPathData . charsPositivePrefix = null ; fastPathData . charsNegativePrefix = null ; } fastPathCheckNeeded = false ;
|
public class ClassHelper { /** * Check if the passed class is an interface or not . Please note that
* annotations are also interfaces !
* @ param aClass
* The class to check .
* @ return < code > true < / code > if the class is an interface ( or an annotation ) */
public static boolean isInterface ( @ Nullable final Class < ? > aClass ) { } }
|
return aClass != null && Modifier . isInterface ( aClass . getModifiers ( ) ) ;
|
public class InternalUtilities { /** * getConstraints , This returns a grid bag constraints object that can be used for placing a
* component appropriately into a grid bag layout . */
static public GridBagConstraints getConstraints ( int gridx , int gridy ) { } }
|
GridBagConstraints gc = new GridBagConstraints ( ) ; gc . fill = GridBagConstraints . BOTH ; gc . gridx = gridx ; gc . gridy = gridy ; return gc ;
|
public class HttpHeaders { /** * Returns the list value to use for the given parameter passed to the setter method . */
private < T > List < T > getAsList ( T passedValue ) { } }
|
if ( passedValue == null ) { return null ; } List < T > result = new ArrayList < T > ( ) ; result . add ( passedValue ) ; return result ;
|
public class X509CRL { /** * Verifies that this CRL was signed using the
* private key that corresponds to the given public key .
* This method uses the signature verification engine
* supplied by the given provider . Note that the specified Provider object
* does not have to be registered in the provider list .
* This method was added to version 1.8 of the Java Platform Standard
* Edition . In order to maintain backwards compatibility with existing
* service providers , this method is not { @ code abstract }
* and it provides a default implementation .
* @ param key the PublicKey used to carry out the verification .
* @ param sigProvider the signature provider .
* @ exception NoSuchAlgorithmException on unsupported signature
* algorithms .
* @ exception InvalidKeyException on incorrect key .
* @ exception SignatureException on signature errors .
* @ exception CRLException on encoding errors .
* @ since 1.8 */
public void verify ( PublicKey key , Provider sigProvider ) throws CRLException , NoSuchAlgorithmException , InvalidKeyException , SignatureException { } }
|
// BEGIN Android - changed
// TODO ( user ) : was X509CRLImpl . verify ( this , key , sigProvider ) ;
// As the javadoc says , this " default implementation " was introduced as to avoid breaking
// providers that generate concrete subclasses of this class .
// The method X509Impl in the original definition calls this method , thus entering an
// infinite loop . This strange behaviour was checked to be not specific to libcore by
// running a test with vogar - - mode = jvm .
throw new UnsupportedOperationException ( "X509CRL instance doesn't not support X509CRL#verify(PublicKey, Provider)" ) ; // END Android - changed
|
public class Domain { /** * Choose a value from this { @ link Domain } according to the given { @ link ValueChoiceFunction } identifier .
* @ param vcf A { @ link ValueChoiceFunction } function identifier .
* @ return A value chosen according to the given { @ link ValueChoiceFunction } .
* @ throws IllegalValueChoiceFunction */
public Object chooseValue ( String vcf ) throws IllegalValueChoiceFunction { } }
|
if ( ! valueChoiceFunctions . containsKey ( this . getClass ( ) ) ) throw new Error ( "No value choice function defined for domains fo type " + this . getClass ( ) . getSimpleName ( ) ) ; HashMap < String , ValueChoiceFunction > vcfs = valueChoiceFunctions . get ( this . getClass ( ) ) ; if ( vcfs == null ) throw new Error ( "No value choice function defined for domains of type " + this . getClass ( ) . getSimpleName ( ) ) ; ValueChoiceFunction vcfunc = vcfs . get ( vcf ) ; if ( vcfunc == null ) throw new IllegalValueChoiceFunction ( vcf , this . getClass ( ) . getSimpleName ( ) ) ; return vcfunc . getValue ( this ) ;
|
public class vpnglobal_authenticationnegotiatepolicy_binding { /** * Use this API to fetch filtered set of vpnglobal _ authenticationnegotiatepolicy _ binding resources .
* filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */
public static vpnglobal_authenticationnegotiatepolicy_binding [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } }
|
vpnglobal_authenticationnegotiatepolicy_binding obj = new vpnglobal_authenticationnegotiatepolicy_binding ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; vpnglobal_authenticationnegotiatepolicy_binding [ ] response = ( vpnglobal_authenticationnegotiatepolicy_binding [ ] ) obj . getfiltered ( service , option ) ; return response ;
|
public class ConstraintsConverter { /** * Register a converter for a specific constraint .
* @ param c the converter to register */
public void register ( ConstraintConverter < ? extends Constraint > c ) { } }
|
java2json . put ( c . getSupportedConstraint ( ) , c ) ; json2java . put ( c . getJSONId ( ) , c ) ;
|
public class IdClassMetadata { /** * Creates and returns the MethodHandle for the constructor .
* @ return the MethodHandle for the constructor . */
private MethodHandle findConstructor ( ) { } }
|
try { MethodHandle mh = MethodHandles . publicLookup ( ) . findConstructor ( clazz , MethodType . methodType ( void . class , getIdType ( ) ) ) ; return mh ; } catch ( NoSuchMethodException | IllegalAccessException exp ) { String pattern = "Class %s requires a public constructor with one parameter of type %s" ; String error = String . format ( pattern , clazz . getName ( ) , getIdType ( ) ) ; throw new EntityManagerException ( error , exp ) ; }
|
public class JPAExEntityManager { /** * d465813 / / switch to ' bindings ' d511673 */
static boolean hasAppManagedPC ( Collection < InjectionBinding < ? > > injectionBindings , String ejbName , Set < String > persistenceRefNames ) { } }
|
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "hasAppManagedPC : " + ( ( injectionBindings != null ) ? ( "<" + injectionBindings . size ( ) + "> :" + injectionBindings ) : "No Injection Bindings" ) ) ; boolean rtnValue = false ; if ( injectionBindings != null && injectionBindings . size ( ) > 0 ) { for ( InjectionBinding < ? > binding : injectionBindings ) { if ( binding instanceof JPAPUnitInjectionBinding ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "persistence-unit-ref name=" + binding . getJndiName ( ) + " contains component=" + ejbName ) ; JPAPUnitInjectionBinding puBinding = ( JPAPUnitInjectionBinding ) binding ; if ( puBinding . containsComponent ( ejbName ) ) // F743-30682
{ rtnValue = true ; if ( persistenceRefNames != null ) // F743-30682
{ persistenceRefNames . add ( puBinding . getJndiName ( ) ) ; } } } } } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "hasAppManagedPC : " + rtnValue ) ; return rtnValue ;
|
public class DoubleStreamEx { /** * Returns the maximum element of this stream according to the provided key
* extractor function .
* This is a terminal operation .
* @ param keyExtractor a non - interfering , stateless function
* @ return an { @ code OptionalDouble } describing the first element of this
* stream for which the highest value was returned by key extractor ,
* or an empty { @ code OptionalDouble } if the stream is empty
* @ since 0.1.2 */
public OptionalDouble maxByLong ( DoubleToLongFunction keyExtractor ) { } }
|
return collect ( PrimitiveBox :: new , ( box , d ) -> { long key = keyExtractor . applyAsLong ( d ) ; if ( ! box . b || box . l < key ) { box . b = true ; box . l = key ; box . d = d ; } } , PrimitiveBox . MAX_LONG ) . asDouble ( ) ;
|
public class MapServiceContextImpl { /** * TODO : interceptors should get a wrapped object which includes the serialized version */
@ Override public Object interceptGet ( String mapName , Object value ) { } }
|
MapContainer mapContainer = getMapContainer ( mapName ) ; InterceptorRegistry interceptorRegistry = mapContainer . getInterceptorRegistry ( ) ; List < MapInterceptor > interceptors = interceptorRegistry . getInterceptors ( ) ; Object result = null ; if ( ! interceptors . isEmpty ( ) ) { result = toObject ( value ) ; for ( MapInterceptor interceptor : interceptors ) { Object temp = interceptor . interceptGet ( result ) ; if ( temp != null ) { result = temp ; } } } return result == null ? value : result ;
|
public class Utils { /** * Check whether value matches the pattern build with prefix , middle part
* and post - fixer .
* @ param value a value to be checked
* @ param prefix a prefix pattern
* @ param middle a middle pattern
* @ param postfix a post - fixer pattern
* @ return true if value matches pattern otherwise false */
public static boolean matches ( String value , String prefix , String middle , String postfix ) { } }
|
String pattern = prefix + middle + postfix ; boolean result = value . matches ( pattern ) ; return result ;
|
public class TranscoderDB { /** * / * make _ transcoder _ entry */
static Entry makeEntry ( byte [ ] source , byte [ ] destination ) { } }
|
CaseInsensitiveBytesHash < Entry > sHash = transcoders . get ( source ) ; if ( sHash == null ) { sHash = new CaseInsensitiveBytesHash < Entry > ( ) ; transcoders . putDirect ( source , sHash ) ; } Entry entry = sHash . get ( destination ) ; if ( entry == null ) { entry = new Entry ( source , destination ) ; sHash . putDirect ( destination , entry ) ; } else { throw new TranscoderException ( ErrorMessages . ERR_TRANSCODER_ALREADY_REGISTERED , new String ( source + " to " + new String ( destination ) ) ) ; } return entry ;
|
public class TableColumnStyle { /** * Append the XML to the table representation
* @ param util an util
* @ param appendable the destination
* @ param count the number of columns concerned
* @ throws IOException if an I / O error occurs */
public void appendXMLToTable ( final XMLUtil util , final Appendable appendable , final int count ) throws IOException { } }
|
appendable . append ( "<table:table-column" ) ; util . appendEAttribute ( appendable , "table:style-name" , this . name ) ; if ( count > 1 ) util . appendAttribute ( appendable , "table:number-columns-repeated" , count ) ; if ( this . defaultCellStyle != null ) util . appendEAttribute ( appendable , "table:default-cell-style-name" , this . defaultCellStyle . getName ( ) ) ; appendable . append ( "/>" ) ;
|
public class StoreConfig { /** * Gets a boolean property via a string property name .
* @ param pName - the property name
* @ param defaultValue - the default property value
* @ return a boolean property */
public boolean getBoolean ( String pName , boolean defaultValue ) { } }
|
String pValue = _properties . getProperty ( pName ) ; return parseBoolean ( pName , pValue , defaultValue ) ;
|
public class Distance { /** * Gets the Symmetric Kullback - Leibler distance .
* This metric is valid only for real and positive P and Q .
* @ param p P vector .
* @ param q Q vector .
* @ return The Symmetric Kullback Leibler distance between p and q . */
public static double SymmetricKullbackLeibler ( double [ ] p , double [ ] q ) { } }
|
double dist = 0 ; for ( int i = 0 ; i < p . length ; i ++ ) { dist += ( p [ i ] - q [ i ] ) * ( Math . log ( p [ i ] ) - Math . log ( q [ i ] ) ) ; } return dist ;
|
public class WriterUtils { /** * Add a type parameter to the given executable member .
* @ param typeParameters the type parameters .
* @ param htmlTree the output .
* @ param configuration the configuration .
* @ param writer the background writer . */
public static void addTypeParameters ( Content typeParameters , Content htmlTree , ConfigurationImpl configuration , SubWriterHolderWriter writer ) { } }
|
if ( ! typeParameters . isEmpty ( ) ) { htmlTree . addContent ( " " ) ; // $ NON - NLS - 1 $
htmlTree . addContent ( Utils . keyword ( Utils . getKeywords ( ) . getWithKeyword ( ) ) ) ; htmlTree . addContent ( " " ) ; // $ NON - NLS - 1 $
htmlTree . addContent ( typeParameters ) ; htmlTree . addContent ( " " ) ; // $ NON - NLS - 1 $
}
|
public class DirectoryRegistrationService { /** * Update the metadata attribute of the ProvidedServiceInstance
* The ProvidedServiceInstance is uniquely identified by serviceName and providerAddress
* @ param serviceName
* the serviceName of the ProvidedServiceInstance .
* @ param providerAddress
* The IP address or FQDN that the instance is running on .
* @ param metadata
* the meta data . */
public void updateServiceMetadata ( String serviceName , String providerAddress , Map < String , String > metadata ) { } }
|
getServiceDirectoryClient ( ) . updateInstanceMetadata ( serviceName , providerAddress , metadata , disableOwnerError ) ;
|
public class ReversePurgeItemHashMap { /** * assume newSize is power of 2 */
@ SuppressWarnings ( "unchecked" ) void resize ( final int newSize ) { } }
|
final Object [ ] oldKeys = keys ; final long [ ] oldValues = values ; final short [ ] oldStates = states ; keys = new Object [ newSize ] ; values = new long [ newSize ] ; states = new short [ newSize ] ; loadThreshold = ( int ) ( newSize * LOAD_FACTOR ) ; lgLength = Integer . numberOfTrailingZeros ( newSize ) ; numActive = 0 ; for ( int i = 0 ; i < oldKeys . length ; i ++ ) { if ( oldStates [ i ] > 0 ) { adjustOrPutValue ( ( T ) oldKeys [ i ] , oldValues [ i ] ) ; } }
|
public class CmsMacroResolver { /** * Resolves the macros in the given input . < p >
* Calls < code > { @ link # resolveMacros ( String ) } < / code > until no more macros can
* be resolved in the input . This way " nested " macros in the input are resolved as well . < p >
* @ see org . opencms . util . I _ CmsMacroResolver # resolveMacros ( java . lang . String ) */
public String resolveMacros ( String input ) { } }
|
String result = input ; if ( input != null ) { String lastResult ; do { // save result for next comparison
lastResult = result ; // resolve the macros
result = CmsMacroResolver . resolveMacros ( result , this ) ; // if nothing changes then the final result is found
} while ( ! result . equals ( lastResult ) ) ; } // return the result
return result ;
|
public class Config { /** * Read config object stored in JSON format from < code > String < / code >
* @ param content of config
* @ return config
* @ throws IOException error */
public static Config fromJSON ( String content ) throws IOException { } }
|
ConfigSupport support = new ConfigSupport ( ) ; return support . fromJSON ( content , Config . class ) ;
|
public class PropertyChangeSupport { /** * Remove a PropertyChangeListener from the listener list .
* This removes a PropertyChangeListener that was registered
* for all properties .
* If < code > listener < / code > was added more than once to the same event
* source , it will be notified one less time after being removed .
* If < code > listener < / code > is null , or was never added , no exception is
* thrown and no action is taken .
* @ param listener The PropertyChangeListener to be removed */
public void removePropertyChangeListener ( PropertyChangeListener listener ) { } }
|
if ( listener == null ) { return ; } if ( listener instanceof PropertyChangeListenerProxy ) { PropertyChangeListenerProxy proxy = ( PropertyChangeListenerProxy ) listener ; // Call two argument remove method .
removePropertyChangeListener ( proxy . getPropertyName ( ) , proxy . getListener ( ) ) ; } else { this . map . remove ( null , listener ) ; }
|
public class HmacSignatureBuilder { /** * 判断期望摘要是否与已构建的摘要相等 .
* @ param expectedSignatureHex
* 传入的期望摘要16进制编码表示的字符串
* @ param builderMode
* 采用的构建模式
* @ return < code > true < / code > - 期望摘要与已构建的摘要相等 ; < code > false < / code > -
* 期望摘要与已构建的摘要不相等
* @ author zhd
* @ since 1.0.0 */
public boolean isHashEqualsWithHex ( String expectedSignatureHex , BuilderMode builderMode ) { } }
|
try { final byte [ ] signature = build ( builderMode ) ; return MessageDigest . isEqual ( signature , DatatypeConverter . parseHexBinary ( expectedSignatureHex ) ) ; } catch ( Throwable e ) { System . err . println ( e . getMessage ( ) ) ; return false ; }
|
public class PactDslRootValue { /** * Value that must be an integer */
public static PactDslRootValue integerType ( ) { } }
|
PactDslRootValue value = new PactDslRootValue ( ) ; value . generators . addGenerator ( Category . BODY , "" , new RandomIntGenerator ( 0 , Integer . MAX_VALUE ) ) ; value . setValue ( 100 ) ; value . setMatcher ( new NumberTypeMatcher ( NumberTypeMatcher . NumberType . INTEGER ) ) ; return value ;
|
public class MinimalJmxServer { /** * Try to register standard MBean type in the JMX server
* @ param beanClass the class name of the MBean */
public final boolean registerMBean ( final Class < ? > clazz ) { } }
|
if ( this . mbs != null && clazz != null ) { try { final String fqnName = clazz . getCanonicalName ( ) ; final String domain = fqnName . substring ( 0 , fqnName . lastIndexOf ( '.' ) ) ; final String type = fqnName . substring ( fqnName . lastIndexOf ( '.' ) + 1 ) ; final ObjectName objectName = new ObjectName ( String . format ( beanNameFormat , domain , type ) ) ; if ( ! mbs . isRegistered ( objectName ) ) { LaunchingMessageKind . IJMX0004 . format ( objectName ) ; mbs . registerMBean ( clazz . newInstance ( ) , objectName ) ; LaunchingMessageKind . IJMX0005 . format ( objectName ) ; } this . beanNames . add ( objectName ) ; } catch ( Exception e ) { LaunchingMessageKind . EJMX0004 . format ( clazz . getCanonicalName ( ) , e ) ; return false ; } } else { LaunchingMessageKind . EJMX0002 . format ( ) ; return false ; } return true ;
|
public class GosuStringUtil { /** * < p > Overlays part of a String with another String . < / p >
* < p > A < code > null < / code > string input returns < code > null < / code > .
* A negative index is treated as zero .
* An index greater than the string length is treated as the string length .
* The start index is always the smaller of the two indices . < / p >
* < pre >
* GosuStringUtil . overlay ( null , * , * , * ) = null
* GosuStringUtil . overlay ( " " , " abc " , 0 , 0 ) = " abc "
* GosuStringUtil . overlay ( " abcdef " , null , 2 , 4 ) = " abef "
* GosuStringUtil . overlay ( " abcdef " , " " , 2 , 4 ) = " abef "
* GosuStringUtil . overlay ( " abcdef " , " " , 4 , 2 ) = " abef "
* GosuStringUtil . overlay ( " abcdef " , " zzzz " , 2 , 4 ) = " abzzzzef "
* GosuStringUtil . overlay ( " abcdef " , " zzzz " , 4 , 2 ) = " abzzzzef "
* GosuStringUtil . overlay ( " abcdef " , " zzzz " , - 1 , 4 ) = " zzzzef "
* GosuStringUtil . overlay ( " abcdef " , " zzzz " , 2 , 8 ) = " abzzzz "
* GosuStringUtil . overlay ( " abcdef " , " zzzz " , - 2 , - 3 ) = " zzzzabcdef "
* GosuStringUtil . overlay ( " abcdef " , " zzzz " , 8 , 10 ) = " abcdefzzzz "
* < / pre >
* @ param str the String to do overlaying in , may be null
* @ param overlay the String to overlay , may be null
* @ param start the position to start overlaying at
* @ param end the position to stop overlaying before
* @ return overlayed String , < code > null < / code > if null String input
* @ since 2.0 */
public static String overlay ( String str , String overlay , int start , int end ) { } }
|
if ( str == null ) { return null ; } if ( overlay == null ) { overlay = EMPTY ; } int len = str . length ( ) ; if ( start < 0 ) { start = 0 ; } if ( start > len ) { start = len ; } if ( end < 0 ) { end = 0 ; } if ( end > len ) { end = len ; } if ( start > end ) { int temp = start ; start = end ; end = temp ; } return new StringBuffer ( len + start - end + overlay . length ( ) + 1 ) . append ( str . substring ( 0 , start ) ) . append ( overlay ) . append ( str . substring ( end ) ) . toString ( ) ;
|
public class JsonReader { /** * 跳过属性的值 */
@ Override public final void skipValue ( ) { } }
|
final char ch = nextGoodChar ( ) ; switch ( ch ) { case '"' : case '\'' : backChar ( ch ) ; readString ( ) ; break ; case '{' : while ( hasNext ( ) ) { this . readSmallString ( ) ; // 读掉field
this . readBlank ( ) ; this . skipValue ( ) ; } break ; case '[' : while ( hasNext ( ) ) { this . skipValue ( ) ; } break ; default : char c ; for ( ; ; ) { c = nextChar ( ) ; if ( c <= ' ' ) return ; if ( c == '}' || c == ']' || c == ',' || c == ':' ) { backChar ( c ) ; return ; } } }
|
public class GenericUtils { /** * Create a new object of type < code > T < / code > , which is cloned from < code > value < / code > .
* The equivalent class copy constructor is invoked .
* @ param value
* @ param < T >
* @ return
* @ throws MIDDException */
public static < T > T newInstance ( final T value ) throws MIDDException { } }
|
if ( value == null ) { return null ; } else { return newInstance ( value , value . getClass ( ) ) ; }
|
public class P3DatabaseReader { /** * Configure the mapping between a database column and a field .
* @ param container column to field map
* @ param name column name
* @ param type field type */
private static void defineField ( Map < String , FieldType > container , String name , FieldType type ) { } }
|
defineField ( container , name , type , null ) ;
|
public class JmxData { /** * Get data from JMX using object name query expression . */
static List < JmxData > query ( ObjectName query ) throws Exception { } }
|
return query ( ManagementFactory . getPlatformMBeanServer ( ) , query ) ;
|
public class CompileUtils { /** * Compiles Java code and returns compiled class back . */
public static Class compileClass ( String name , String code , List < Class > classPath ) throws Exception { } }
|
JavaCompiler compiler = ToolProvider . getSystemJavaCompiler ( ) ; DiagnosticCollector < JavaFileObject > diagnostics = new DiagnosticCollector < JavaFileObject > ( ) ; MemoryJavaFileManager fileManager = new MemoryJavaFileManager ( compiler . getStandardFileManager ( null , null , null ) ) ; List < JavaFileObject > javaFileObjects = new ArrayList < JavaFileObject > ( ) ; javaFileObjects . add ( new MemoryJavaFileObject ( name , code ) ) ; File tempDir = new File ( System . getProperty ( "java.io.tmpdir" ) , name ) ; List < String > options = new ArrayList < String > ( ) ; if ( classPath . size ( ) > 0 ) { options . add ( "-classpath" ) ; options . add ( tempDir . getAbsolutePath ( ) ) ; for ( Class c : classPath ) { String classRelativePath = c . getName ( ) . replace ( '.' , '/' ) + ".class" ; URL classInputLocation = c . getResource ( '/' + classRelativePath ) ; File outputFile = new File ( tempDir , classRelativePath ) ; outputFile . getParentFile ( ) . mkdirs ( ) ; InputStream input = classInputLocation . openStream ( ) ; FileOutputStream output = new FileOutputStream ( outputFile ) ; IOUtils . copy ( input , output ) ; input . close ( ) ; output . close ( ) ; } } Boolean success = compiler . getTask ( null , fileManager , diagnostics , options , null , javaFileObjects ) . call ( ) ; if ( success ) { return fileManager . getClassLoader ( null ) . loadClass ( name ) ; } else { StringBuilder stringBuilder = new StringBuilder ( ) ; for ( Diagnostic diagnostic : diagnostics . getDiagnostics ( ) ) { stringBuilder . append ( diagnostic . getMessage ( null ) ) . append ( "\n" ) ; } throw new Exception ( stringBuilder . toString ( ) ) ; }
|
public class MyActivity { /** * Callback once we are done with the authorization of this app
* @ param intent */
@ Override public void onNewIntent ( Intent intent ) { } }
|
super . onNewIntent ( intent ) ; // Verify OAuth callback
Uri uri = intent . getData ( ) ; if ( uri != null && uri . getScheme ( ) . equals ( OAUTH_CALLBACK_SCHEME ) ) { String verifier = uri . getQueryParameter ( OAuth . OAUTH_VERIFIER ) ; new UpworkRetrieveAccessTokenTask ( ) . execute ( verifier ) ; }
|
public class GaplessSoundOutputStreamImpl { /** * This method will only create a new line if
* a ) an AudioFormat is set
* and
* b ) no line is open
* c ) or the already open Line is not matching the audio format needed
* After creating or reusing the line , status " open " and " running " are ensured
* @ see de . quippy . javamod . io . SoundOutputStreamImpl # openSourceLine ( )
* @ since 27.02.2011 */
@ Override protected synchronized void openSourceLine ( ) { } }
|
try { if ( audioFormat != null && ( sourceLine == null || ( sourceLine != null && ! sourceLine . getFormat ( ) . matches ( audioFormat ) ) ) ) { super . openSourceLine ( ) ; } else if ( sourceLine != null ) { if ( ! sourceLine . isOpen ( ) ) sourceLine . open ( ) ; if ( ! sourceLine . isRunning ( ) ) sourceLine . start ( ) ; } } catch ( Exception ex ) { sourceLine = null ; Log . error ( "Error occured when opening audio device" , ex ) ; }
|
public class PropertyList { /** * Returns the first property of specified name .
* @ param aName name of property to return
* @ return a property or null if no matching property found */
public final < R > R getProperty ( final String aName ) { } }
|
for ( final T p : this ) { if ( p . getName ( ) . equalsIgnoreCase ( aName ) ) { return ( R ) p ; } } return null ;
|
public class Matrix4x3d { /** * Set the value of the matrix element at column 0 and row 2.
* @ param m02
* the new value
* @ return this */
public Matrix4x3d m02 ( double m02 ) { } }
|
this . m02 = m02 ; properties &= ~ PROPERTY_ORTHONORMAL ; if ( m02 != 0.0 ) properties &= ~ ( PROPERTY_IDENTITY | PROPERTY_TRANSLATION ) ; return this ;
|
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public IfcAnalysisModelTypeEnum createIfcAnalysisModelTypeEnumFromString ( EDataType eDataType , String initialValue ) { } }
|
IfcAnalysisModelTypeEnum result = IfcAnalysisModelTypeEnum . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
|
public class DurableInputHandler { /** * This method is a NOP for durable handlers .
* @ param msg ignored
* @ param transaction ignored
* @ param producerSession ignored
* @ param sourceCellule ignored
* @ param targetCellule ignored */
public void handleMessage ( MessageItem msg , TransactionCommon transaction , SIBUuid8 sourceMEUuid ) { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "handleMessage" , new Object [ ] { msg , transaction , sourceMEUuid } ) ; SIErrorException e = new SIErrorException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0001" , new Object [ ] { "com.ibm.ws.sib.processor.impl.DurableInputHandler" , "1:143:1.52.1.1" } , null ) ) ; // FFDC
FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.DurableInputHandler.handleMessage" , "1:150:1.52.1.1" , this ) ; SibTr . exception ( tc , e ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0001" , new Object [ ] { "com.ibm.ws.sib.processor.impl.DurableInputHandler" , "1:158:1.52.1.1" } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "handleMessage" , e ) ; throw e ;
|
public class MutateRowsAttemptCallable { /** * Create a synthetic { @ link ApiException } for an individual entry . When the entire RPC fails , it
* implies that all entries failed as well . This helper is used to make that behavior explicit .
* The generated exception will have the overall error as its cause . */
private static ApiException createSyntheticErrorForRpcFailure ( Throwable overallRequestError ) { } }
|
if ( overallRequestError instanceof ApiException ) { ApiException requestApiException = ( ApiException ) overallRequestError ; return ApiExceptionFactory . createException ( "Didn't receive a result for this mutation entry" , overallRequestError , requestApiException . getStatusCode ( ) , requestApiException . isRetryable ( ) ) ; } return ApiExceptionFactory . createException ( "Didn't receive a result for this mutation entry" , overallRequestError , LOCAL_UNKNOWN_STATUS , false ) ;
|
public class ShareableSupportedWorkspaceDataManager { /** * { @ inheritDoc } */
public List < PropertyData > getReferencesData ( String identifier , boolean skipVersionStorage ) throws RepositoryException { } }
|
return persistentManager . getReferencesData ( identifier , skipVersionStorage ) ;
|
public class ListStepsResult { /** * The filtered list of steps for the cluster .
* @ return The filtered list of steps for the cluster . */
public java . util . List < StepSummary > getSteps ( ) { } }
|
if ( steps == null ) { steps = new com . amazonaws . internal . SdkInternalList < StepSummary > ( ) ; } return steps ;
|
public class ResourceController { /** * Checks if an activity that requires the given resource list
* can run immediately .
* This method is really only useful as a hint , since
* another activity might acquire resources before the caller
* gets to call { @ link # execute ( Runnable , ResourceActivity ) } . */
public boolean canRun ( final ResourceList resources ) { } }
|
try { return _withLock ( new Callable < Boolean > ( ) { @ Override public Boolean call ( ) { return ! inUse . isCollidingWith ( resources ) ; } } ) ; } catch ( Exception e ) { throw new IllegalStateException ( "Inner callable does not throw exception" ) ; }
|
public class HeartbeatHandler { /** * called periodically to check that the heartbeat has been received
* @ return { @ code true } if we have received a heartbeat recently */
private boolean hasReceivedHeartbeat ( ) { } }
|
long currentTimeMillis = System . currentTimeMillis ( ) ; boolean result = lastTimeMessageReceived + heartbeatTimeoutMs >= currentTimeMillis ; if ( ! result ) Jvm . warn ( ) . on ( getClass ( ) , Integer . toHexString ( hashCode ( ) ) + " missed heartbeat, lastTimeMessageReceived=" + lastTimeMessageReceived + ", currentTimeMillis=" + currentTimeMillis ) ; return result ;
|
public class DefaultGrailsPluginManager { /** * This method will attempt to load that plug - ins not loaded in the first pass */
private void loadDelayedPlugins ( ) { } }
|
while ( ! delayedLoadPlugins . isEmpty ( ) ) { GrailsPlugin plugin = delayedLoadPlugins . remove ( 0 ) ; if ( areDependenciesResolved ( plugin ) ) { if ( ! hasValidPluginsToLoadBefore ( plugin ) ) { registerPlugin ( plugin ) ; } else { delayedLoadPlugins . add ( plugin ) ; } } else { // ok , it still hasn ' t resolved the dependency after the initial
// load of all plugins . All hope is not lost , however , so lets first
// look inside the remaining delayed loads before giving up
boolean foundInDelayed = false ; for ( GrailsPlugin remainingPlugin : delayedLoadPlugins ) { if ( isDependentOn ( plugin , remainingPlugin ) ) { foundInDelayed = true ; break ; } } if ( foundInDelayed ) { delayedLoadPlugins . add ( plugin ) ; } else { failedPlugins . put ( plugin . getName ( ) , plugin ) ; LOG . error ( "ERROR: Plugin [" + plugin . getName ( ) + "] cannot be loaded because its dependencies [" + DefaultGroovyMethods . inspect ( plugin . getDependencyNames ( ) ) + "] cannot be resolved" ) ; } } }
|
public class SystemUtil { /** * Retrieves a System property , or returns some default value if :
* < ul >
* < li > the property isn ' t found < / li >
* < li > the property name is null or empty < / li >
* < li > if a security manager exists and its checkPropertyAccess method doesn ' t allow access to the specified system property . < / li >
* < / ul >
* @ param name the name of the system property .
* @ param defaultValue a default value .
* @ return value of the system property or the default value */
public static String getSystemPropertySafe ( String name , String defaultValue ) { } }
|
try { return System . getProperty ( name , defaultValue ) ; } catch ( SecurityException | NullPointerException | IllegalArgumentException ignore ) { // suppress exception
} return defaultValue ;
|
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public IPOOvlyOrent createIPOOvlyOrentFromString ( EDataType eDataType , String initialValue ) { } }
|
IPOOvlyOrent result = IPOOvlyOrent . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
|
public class JsonReader { /** * Read the Json from the passed File .
* @ param aFile
* The file containing the Json to be parsed . May not be
* < code > null < / code > .
* @ param aFallbackCharset
* The charset to be used in case no BOM is present . May not be
* < code > null < / code > .
* @ param aCustomExceptionHandler
* An optional custom exception handler that can be used to collect the
* unrecoverable parsing errors . May be < code > null < / code > .
* @ return < code > null < / code > if reading failed , the Json declarations
* otherwise . */
@ Nullable public static IJson readFromFile ( @ Nonnull final File aFile , @ Nonnull final Charset aFallbackCharset , @ Nullable final IJsonParseExceptionCallback aCustomExceptionHandler ) { } }
|
return readFromStream ( new FileSystemResource ( aFile ) , aFallbackCharset , aCustomExceptionHandler ) ;
|
public class DefaultValues { /** * Returns the specified value if it is specified by a user . */
public static Optional < String > getSpecifiedValue ( @ Nullable String value ) { } }
|
return isSpecified ( value ) ? Optional . ofNullable ( value ) : Optional . empty ( ) ;
|
public class AwsCodeCommitCredentialProvider { /** * This provider can handle uris like
* https : / / git - codecommit . $ AWS _ REGION . amazonaws . com / v1 / repos / $ REPO .
* @ param uri uri to parse
* @ return { @ code true } if the URI can be handled */
public static boolean canHandle ( String uri ) { } }
|
if ( ! hasText ( uri ) ) { return false ; } try { URL url = new URL ( uri ) ; URI u = new URI ( url . getProtocol ( ) , url . getUserInfo ( ) , url . getHost ( ) , url . getPort ( ) , url . getPath ( ) , url . getQuery ( ) , url . getRef ( ) ) ; if ( u . getScheme ( ) . equals ( "https" ) ) { String host = u . getHost ( ) ; if ( host . endsWith ( ".amazonaws.com" ) && host . startsWith ( "git-codecommit." ) ) { return true ; } } } catch ( Throwable t ) { // ignore all , we can ' t handle it
} return false ;
|
public class DSUtil { /** * Construct a < code > Function < / code > based on a map . The
* resulting function will throw an exception if invoked on an
* element that is unassigned in < code > map < / code > . */
public static < K , V > Function < K , V > map2fun ( final Map < K , V > map ) { } }
|
return new Function < K , V > ( ) { public V f ( K key ) { V value = map . get ( key ) ; if ( value == null ) { throw new Error ( "No value for " + key ) ; } return value ; } } ;
|
public class Stream { /** * Returns a stream consisting of the results of replacing each element of
* this stream with the contents of a mapped stream produced by applying
* the provided mapping function to each element .
* < p > This is an intermediate operation .
* @ param mapper the mapper function used to apply to each element
* @ return the new { @ code DoubleStream }
* @ see # flatMap ( com . annimon . stream . function . Function ) */
@ NotNull public DoubleStream flatMapToDouble ( @ NotNull final Function < ? super T , ? extends DoubleStream > mapper ) { } }
|
return new DoubleStream ( params , new ObjFlatMapToDouble < T > ( iterator , mapper ) ) ;
|
public class LoadBalancerService { /** * { @ inheritDoc } */
@ Override public Stream < LoadBalancerMetadata > findLazy ( LoadBalancerFilter filter ) { } }
|
checkNotNull ( filter , "Filter must be not a null" ) ; Stream < DataCenterMetadata > dataCenters = dataCenterService . findLazy ( filter . getDataCenterFilter ( ) ) ; return dataCenters . flatMap ( datacenter -> loadBalancerClient . getLoadBalancers ( datacenter . getId ( ) ) . stream ( ) ) . filter ( filter . getPredicate ( ) ) . filter ( filter . getIds ( ) . size ( ) > 0 ? combine ( LoadBalancerMetadata :: getId , in ( filter . getIds ( ) ) ) : alwaysTrue ( ) ) ;
|
public class TokenList { /** * Inserts the LokenList immediately following the ' before ' token */
public void insertAfter ( Token before , TokenList list ) { } }
|
Token after = before . next ; before . next = list . first ; list . first . previous = before ; if ( after == null ) { last = list . last ; } else { after . previous = list . last ; list . last . next = after ; } size += list . size ;
|
public class QueryParameters { /** * getters */
public Map < String , List < ? extends Object > > getUnionParameters ( ) { } }
|
if ( unionParameters == null ) { unionParameters = new HashMap < String , List < ? extends Object > > ( ) ; } return unionParameters ;
|
public class TileTextKpiSkin { /** * * * * * * Initialization * * * * * */
private void initGraphics ( ) { } }
|
// Set initial size
if ( Double . compare ( gauge . getPrefWidth ( ) , 0.0 ) <= 0 || Double . compare ( gauge . getPrefHeight ( ) , 0.0 ) <= 0 || Double . compare ( gauge . getWidth ( ) , 0.0 ) <= 0 || Double . compare ( gauge . getHeight ( ) , 0.0 ) <= 0 ) { if ( gauge . getPrefWidth ( ) > 0 && gauge . getPrefHeight ( ) > 0 ) { gauge . setPrefSize ( gauge . getPrefWidth ( ) , gauge . getPrefHeight ( ) ) ; } else { gauge . setPrefSize ( PREFERRED_WIDTH , PREFERRED_HEIGHT ) ; } } barBackground = new Region ( ) ; barBackground . setBackground ( new Background ( new BackgroundFill ( gauge . getBarBackgroundColor ( ) , new CornerRadii ( 0.0 , 0.0 , 0.025 , 0.025 , true ) , Insets . EMPTY ) ) ) ; barClip = new Rectangle ( ) ; bar = new Rectangle ( ) ; bar . setFill ( gauge . getBarColor ( ) ) ; bar . setStroke ( null ) ; bar . setClip ( barClip ) ; titleText = new Text ( ) ; titleText . setFill ( gauge . getTitleColor ( ) ) ; Helper . enableNode ( titleText , ! gauge . getTitle ( ) . isEmpty ( ) ) ; valueText = new Text ( ) ; valueText . setFill ( gauge . getValueColor ( ) ) ; Helper . enableNode ( valueText , gauge . isValueVisible ( ) ) ; unitText = new Text ( gauge . getUnit ( ) ) ; unitText . setFill ( gauge . getUnitColor ( ) ) ; Helper . enableNode ( unitText , ! gauge . getUnit ( ) . isEmpty ( ) ) ; percentageText = new Text ( ) ; percentageText . setFill ( gauge . getBarColor ( ) ) ; percentageUnitText = new Text ( "%" ) ; percentageUnitText . setFill ( gauge . getBarColor ( ) ) ; maxValueRect = new Rectangle ( ) ; maxValueRect . setFill ( gauge . getThresholdColor ( ) ) ; maxValueText = new Text ( String . format ( locale , "%." + gauge . getTickLabelDecimals ( ) + "f" , gauge . getMaxValue ( ) ) ) ; maxValueText . setFill ( gauge . getBackgroundPaint ( ) ) ; maxValueUnitText = new Text ( gauge . getUnit ( ) ) ; maxValueUnitText . setFill ( gauge . getBackgroundPaint ( ) ) ; pane = new Pane ( barBackground , bar , titleText , valueText , unitText , percentageText , percentageUnitText , maxValueRect , maxValueText , maxValueUnitText ) ; pane . setBorder ( new Border ( new BorderStroke ( gauge . getBorderPaint ( ) , BorderStrokeStyle . SOLID , new CornerRadii ( PREFERRED_WIDTH * 0.025 ) , new BorderWidths ( gauge . getBorderWidth ( ) ) ) ) ) ; pane . setBackground ( new Background ( new BackgroundFill ( gauge . getBackgroundPaint ( ) , new CornerRadii ( PREFERRED_WIDTH * 0.025 ) , Insets . EMPTY ) ) ) ; getChildren ( ) . setAll ( pane ) ;
|
public class Dialog { /** * Set the background drawable of positive action button .
* @ param id The resourceId of drawable .
* @ return The Dialog for chaining methods . */
public Dialog positiveActionBackground ( int id ) { } }
|
return positiveActionBackground ( id == 0 ? null : getContext ( ) . getResources ( ) . getDrawable ( id ) ) ;
|
public class AbstractChecksumMojo { /** * { @ inheritDoc } */
@ Override public void execute ( ) throws MojoExecutionException , MojoFailureException { } }
|
// Prepare an execution .
Execution execution = ( failOnError ) ? new FailOnErrorExecution ( ) : new NeverFailExecution ( getLog ( ) ) ; execution . setAlgorithms ( algorithms ) ; execution . setFiles ( getFilesToProcess ( ) ) ; execution . setFailIfNoFiles ( isFailIfNoFiles ( ) ) ; execution . setFailIfNoAlgorithms ( failIfNoAlgorithms ) ; execution . setFailIfNoTargets ( failIfNoTargets ) ; if ( ! quiet ) { execution . addTarget ( new MavenLogTarget ( getLog ( ) ) ) ; } if ( includeRelativePath ) { execution . setSubPath ( relativeSubPath ) ; } else { execution . setSubPath ( null ) ; } if ( isIndividualFiles ( ) ) { File outputDirectory = null ; if ( StringUtils . isNotEmpty ( getIndividualFilesOutputDirectory ( ) ) ) { outputDirectory = FileUtils . resolveFile ( new File ( project . getBuild ( ) . getDirectory ( ) ) , getIndividualFilesOutputDirectory ( ) ) ; } execution . addTarget ( new OneHashPerFileTarget ( encoding , outputDirectory , createArtifactListeners ( ) , isAppendFilename ( ) ) ) ; } if ( isCsvSummary ( ) ) { execution . addTarget ( new CsvSummaryFileTarget ( FileUtils . resolveFile ( new File ( project . getBuild ( ) . getDirectory ( ) ) , getCsvSummaryFile ( ) ) , encoding , createArtifactListeners ( ) ) ) ; } if ( isXmlSummary ( ) ) { execution . addTarget ( new XmlSummaryFileTarget ( FileUtils . resolveFile ( new File ( project . getBuild ( ) . getDirectory ( ) ) , getXmlSummaryFile ( ) ) , encoding , createArtifactListeners ( ) ) ) ; } if ( isShasumSummary ( ) ) { execution . addTarget ( new ShasumSummaryFileTarget ( FileUtils . resolveFile ( new File ( project . getBuild ( ) . getDirectory ( ) ) , getShasumSummaryFile ( ) ) , createArtifactListeners ( ) ) ) ; } // Run the execution .
try { execution . run ( ) ; } catch ( ExecutionException e ) { getLog ( ) . error ( e . getMessage ( ) ) ; throw new MojoFailureException ( e . getMessage ( ) ) ; }
|
public class Publisher { /** * Schedules the publishing of a message . The publishing of the message may occur immediately or
* be delayed based on the publisher batching options .
* < p > Example of publishing a message .
* < pre > { @ code
* String message = " my _ message " ;
* ByteString data = ByteString . copyFromUtf8 ( message ) ;
* PubsubMessage pubsubMessage = PubsubMessage . newBuilder ( ) . setData ( data ) . build ( ) ;
* ApiFuture < String > messageIdFuture = publisher . publish ( pubsubMessage ) ;
* ApiFutures . addCallback ( messageIdFuture , new ApiFutureCallback < String > ( ) {
* public void onSuccess ( String messageId ) {
* System . out . println ( " published with message id : " + messageId ) ;
* public void onFailure ( Throwable t ) {
* System . out . println ( " failed to publish : " + t ) ;
* } < / pre >
* @ param message the message to publish .
* @ return the message ID wrapped in a future . */
public ApiFuture < String > publish ( PubsubMessage message ) { } }
|
if ( shutdown . get ( ) ) { throw new IllegalStateException ( "Cannot publish on a shut-down publisher." ) ; } final OutstandingPublish outstandingPublish = new OutstandingPublish ( messageTransform . apply ( message ) ) ; List < OutstandingBatch > batchesToSend ; messagesBatchLock . lock ( ) ; try { batchesToSend = messagesBatch . add ( outstandingPublish ) ; // Setup the next duration based delivery alarm if there are messages batched .
setupAlarm ( ) ; } finally { messagesBatchLock . unlock ( ) ; } messagesWaiter . incrementPendingMessages ( 1 ) ; if ( ! batchesToSend . isEmpty ( ) ) { for ( final OutstandingBatch batch : batchesToSend ) { logger . log ( Level . FINER , "Scheduling a batch for immediate sending." ) ; executor . execute ( new Runnable ( ) { @ Override public void run ( ) { publishOutstandingBatch ( batch ) ; } } ) ; } } return outstandingPublish . publishResult ;
|
public class RequestLoggingFilter { protected String handleClientError ( HttpServletRequest request , HttpServletResponse response , RequestClientErrorException cause ) throws IOException { } }
|
final boolean beforeHandlingCommitted = response . isCommitted ( ) ; // basically false
processClientErrorCallback ( request , response , cause ) ; final String title ; if ( response . isCommitted ( ) ) { title = response . getStatus ( ) + " (thrown as " + cause . getTitle ( ) + ")" ; if ( beforeHandlingCommitted ) { // basically no way but just in case
showCliEx ( cause , ( ) -> { final StringBuilder sb = new StringBuilder ( ) ; sb . append ( "*Cannot send error as '" ) . append ( title ) . append ( "' because of already committed:" ) ; sb . append ( " path=" ) . append ( request . getRequestURI ( ) ) ; return sb . toString ( ) ; } ) ; return title ; // cannot help it
} // committed in callback process
} else { title = cause . getTitle ( ) ; } showCliEx ( cause , ( ) -> { final StringBuilder sb = new StringBuilder ( ) ; sb . append ( LF ) . append ( "_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/" ) ; sb . append ( LF ) . append ( "...Sending error as '" ) . append ( title ) . append ( "' manually" ) ; sb . append ( " #" ) . append ( Integer . toHexString ( cause . hashCode ( ) ) ) ; sb . append ( LF ) . append ( " Request: " ) . append ( request . getRequestURI ( ) ) ; final String queryString = request . getQueryString ( ) ; if ( queryString != null && ! queryString . isEmpty ( ) ) { sb . append ( "?" ) . append ( queryString ) ; } sb . append ( LF ) ; buildRequestHeaders ( sb , request ) ; buildRequestAttributes ( sb , request , /* showErrorFlush */
true ) ; buildSessionAttributes ( sb , request , /* showErrorFlush */
true ) ; sb . append ( " Exception: " ) . append ( cause . getClass ( ) . getName ( ) ) ; sb . append ( LF ) . append ( " Message: " ) ; final String causeMsg = cause . getMessage ( ) ; if ( causeMsg != null && causeMsg . contains ( LF ) ) { sb . append ( LF ) . append ( "/- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" ) ; sb . append ( LF ) . append ( causeMsg ) ; sb . append ( LF ) . append ( "- - - - - - - - - -/" ) ; } else { sb . append ( causeMsg ) ; } sb . append ( LF ) . append ( " Stack Traces:" ) ; buildClientErrorStackTrace ( cause , sb , 0 ) ; sb . append ( LF ) ; sb . append ( "_/_/_/_/_/_/_/_/_/_/" ) ; return sb . toString ( ) ; } ) ; try { if ( ! response . isCommitted ( ) ) { // because may be committed in callback process
response . sendError ( cause . getErrorStatus ( ) ) ; } return title ; } catch ( IOException sendEx ) { final String msg = "Failed to send error as '" + title + "': " + sendEx . getMessage ( ) ; if ( errorLogging ) { logger . error ( msg ) ; } else { showCliEx ( cause , ( ) -> msg ) ; } return title ; // cannot help it
}
|
public class HtmlTree { /** * Generates a NOSCRIPT tag with some content .
* @ param body content of the noscript tag
* @ return an HtmlTree object for the NOSCRIPT tag */
public static HtmlTree NOSCRIPT ( Content body ) { } }
|
HtmlTree htmltree = new HtmlTree ( HtmlTag . NOSCRIPT , nullCheck ( body ) ) ; return htmltree ;
|
public class CmsResourceUtil { /** * Sets the cms context . < p >
* @ param cms the cms context to set */
public void setCms ( CmsObject cms ) { } }
|
m_cms = cms ; m_request = cms . getRequestContext ( ) ; m_referenceProject = null ; m_projectResources = null ; m_messages = null ;
|
public class EJBMDOrchestrator { /** * This method calculates the bean pool limits of this bean type . There is one
* bean pool for each of the application ' s bean types .
* This method supplies default min / max pool sizes if none
* are specified via system property values .
* The two system properties examined by this method are
* " noEJBPool " and " poolSizeSpecProp " . The first property
* " noEJBPool " allows customers to specify that we are to do no
* pooling . If this property is set , the second property is
* irrelevant . The second property " poolSizeSpecProp " allows
* customers to provide min / max pool sizes for one or more
* bean types by J2EEName . The format of this property is
* beantype = [ H ] min , [ H ] max [ : beantype = [ H ] min , [ H ] max . . . ]
* For example :
* SMApp # PerfModule # TunerBean = 54 , : SMApp # SMModule # TypeBean = 100,200
* Note that either the min or max value may be ommitted . If so ,
* a default value is applied .
* Also note that " H " may be prepended to either min or max value ( s ) .
* This " H " designates the value as a hard limit . A hard limit on
* min value causes the container to guarantee that at least that
* many bean instances are available at all times ( ie . this is the
* combination of bean instances currently in use plus those in the
* pool ) . A hard limint on max value causes the container to enforce
* that the total number of bean instances ( ie . total in use plus those
* in the pool ) does not exceed the max value . Without this hard
* limit set only the maximum instance count in the pool is enforced ,
* there may also be additional instances in use .
* @ param bmd is the configuration data to be updated with the
* calculated pool limits . The bmd variables set by this
* method include :
* bmd . minPoolSize
* bmd . maxPoolSize ,
* bmd . ivInitialPoolSize
* bmd . ivMaxCreation . */
private void processBeanPoolLimits ( BeanMetaData bmd ) throws EJBConfigurationException { } }
|
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "processBeanPoolLimits" ) ; } boolean checkAppConfigCustom = bmd . isCheckConfig ( ) ; // F743-33178
// The following default values are documented in the info center
// changing them may affect existing customer applicatioins .
// Arguments can be made about the following values . No great
// science was used in determining these numbers .
int defaultMinPoolSize = 50 ; int defaultMaxPoolSize = 500 ; long defaultMaxCreationTimeout = 300000 ; // 5 minutes
String minStr = null ; String maxStr = null ; String timeoutStr = null ; String poolSizeSpec = null ; boolean noEJBPool = false ; // d262413 PK20648
// Determine if the noEJBPool or poolSize java system properties have
// been specified . noEJBPool overrides everything , so the poolSize
// property is not needed when noEJBPool is enabled . d262413 PK20648
// Property access & default now handled by ContainerProperties . 391302
if ( NoEJBPool ) noEJBPool = true ; else poolSizeSpec = PoolSize ; // 121700
if ( poolSizeSpec != null ) { StringTokenizer st = new StringTokenizer ( poolSizeSpec , ":" ) ; while ( st . hasMoreTokens ( ) ) { String token = st . nextToken ( ) ; int assignmentPivot = token . indexOf ( '=' ) ; if ( assignmentPivot > 0 ) { String lh = token . substring ( 0 , assignmentPivot ) . trim ( ) ; // Now Z / OS does not allow " # " in java properties so we also
// must allow " % " . If those are used we will switch them to " # " before
// proceeding . / / d434795
lh = lh . replaceAll ( "%" , "#" ) ; if ( lh . equals ( bmd . j2eeName . toString ( ) ) ) { // d130438
String rh = token . substring ( assignmentPivot + 1 ) . trim ( ) ; StringTokenizer sizeTokens = new StringTokenizer ( rh , "," ) ; if ( sizeTokens . hasMoreTokens ( ) ) { // min parm was specified
minStr = sizeTokens . nextToken ( ) . trim ( ) ; } if ( sizeTokens . hasMoreTokens ( ) ) { // max parm was specified
maxStr = sizeTokens . nextToken ( ) . trim ( ) ; } if ( sizeTokens . hasMoreTokens ( ) ) { // timeout parm was specified
timeoutStr = sizeTokens . nextToken ( ) . trim ( ) ; } } else if ( lh . equals ( "*" ) && ( minStr == null || maxStr == null || timeoutStr == null ) ) { String rh = token . substring ( assignmentPivot + 1 ) . trim ( ) ; StringTokenizer sizeTokens = new StringTokenizer ( rh , "," ) ; if ( sizeTokens . hasMoreTokens ( ) ) { // min parm was specified
String defaultMinStr = sizeTokens . nextToken ( ) ; if ( minStr == null ) { minStr = defaultMinStr . trim ( ) ; } } if ( sizeTokens . hasMoreTokens ( ) ) { // max parm was specified
String defaultMaxStr = sizeTokens . nextToken ( ) ; if ( maxStr == null ) { maxStr = defaultMaxStr . trim ( ) ; } } if ( sizeTokens . hasMoreTokens ( ) ) { // timeout parm was specified
String defaultTimeoutStr = sizeTokens . nextToken ( ) ; if ( timeoutStr == null ) { timeoutStr = defaultTimeoutStr . trim ( ) ; } } } } else { // Syntax error - - token did not include an equals sign . . . .
Tr . warning ( tc , "POOLSIZE_MISSING_EQUALS_SIGN_CNTR0062W" , new Object [ ] { token } ) ; if ( isValidationFailable ( checkAppConfigCustom ) ) { EJBConfigurationException ecex = new EJBConfigurationException ( "An equals sign was not found in the pool size specification string " + token + "." ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "processBeanPoolLimits : " + ecex ) ; throw ecex ; } } } // while loop
} // poolSizeSpec not null
int tmpMinPoolSize , tmpMaxPoolSize ; long tmpMaxCreationTimeout ; boolean setInitialPoolSize = false ; // PK20648
boolean setMaxCreation = false ; // PK20648
if ( minStr != null ) { try { // An H prefix indicates a hard limit ( pre - load pool ) . PK20648
if ( minStr . startsWith ( "H" ) ) { setInitialPoolSize = true ; minStr = minStr . substring ( 1 ) ; } tmpMinPoolSize = Integer . parseInt ( minStr ) ; if ( tmpMinPoolSize < 1 ) { Tr . warning ( tc , "INVALID_MIN_POOLSIZE_CNTR0057W" , new Object [ ] { ( bmd . j2eeName ) . toString ( ) , Integer . toString ( tmpMinPoolSize ) } ) ; tmpMinPoolSize = defaultMinPoolSize ; if ( isValidationFailable ( checkAppConfigCustom ) ) { EJBConfigurationException ecex = new EJBConfigurationException ( "Minimum pool size specified for bean " + bmd . j2eeName + " not a valid positive integer: " + tmpMinPoolSize + "." ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "processBeanPoolLimits : " + ecex ) ; throw ecex ; } } } catch ( NumberFormatException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".processBeanPoolLimits" , "2594" , this ) ; Tr . warning ( tc , "INVALID_MIN_POOLSIZE_CNTR0057W" , new Object [ ] { ( bmd . j2eeName ) . toString ( ) , minStr } ) ; tmpMinPoolSize = defaultMinPoolSize ; if ( isValidationFailable ( checkAppConfigCustom ) ) { EJBConfigurationException ecex = new EJBConfigurationException ( "Minimum pool size specified for bean " + bmd . j2eeName + " not a valid integer: " + minStr + "." ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "processBeanPoolLimits : " + ecex ) ; throw ecex ; } } } else { tmpMinPoolSize = defaultMinPoolSize ; } if ( maxStr != null ) { try { // An H prefix indicates a hard limit ( Max Creation ) . PK20648
if ( maxStr . startsWith ( "H" ) ) { setMaxCreation = true ; maxStr = maxStr . substring ( 1 ) ; } tmpMaxPoolSize = Integer . parseInt ( maxStr ) ; if ( tmpMaxPoolSize < 1 ) { Tr . warning ( tc , "INVALID_MAX_POOLSIZE_CNTR0058W" , new Object [ ] { ( bmd . j2eeName ) . toString ( ) , Integer . toString ( tmpMaxPoolSize ) } ) ; tmpMaxPoolSize = defaultMaxPoolSize ; if ( isValidationFailable ( checkAppConfigCustom ) ) { EJBConfigurationException ecex = new EJBConfigurationException ( "Maximum pool size specified for bean " + bmd . j2eeName + " not a valid positive integer: " + tmpMaxPoolSize + "." ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "processBeanPoolLimits : " + ecex ) ; throw ecex ; } } } catch ( NumberFormatException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".processBeanPoolLimits" , "2616" , this ) ; Tr . warning ( tc , "INVALID_MAX_POOLSIZE_CNTR0058W" , new Object [ ] { ( bmd . j2eeName ) . toString ( ) , maxStr } ) ; tmpMaxPoolSize = defaultMaxPoolSize ; if ( isValidationFailable ( checkAppConfigCustom ) ) { EJBConfigurationException ecex = new EJBConfigurationException ( "Maximum pool size specified for bean " + bmd . j2eeName + " not a valid integer: " + maxStr + "." ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "processBeanPoolLimits : " + ecex ) ; throw ecex ; } } } else { tmpMaxPoolSize = defaultMaxPoolSize ; } if ( setMaxCreation && timeoutStr != null ) { try { tmpMaxCreationTimeout = Integer . parseInt ( timeoutStr ) * 1000 ; if ( tmpMaxCreationTimeout < 0 ) { Tr . warning ( tc , "INVALID_MAX_POOLTIMEOUT_CNTR0127W" , new Object [ ] { ( bmd . j2eeName ) . toString ( ) , timeoutStr , "300" } ) ; tmpMaxCreationTimeout = defaultMaxCreationTimeout ; if ( isValidationFailable ( checkAppConfigCustom ) ) { EJBConfigurationException ecex = new EJBConfigurationException ( "Maximum pool size timeout specified for bean " + bmd . j2eeName + " not a valid positive integer: " + timeoutStr + "." ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "processBeanPoolLimits : " + ecex ) ; throw ecex ; } } } catch ( NumberFormatException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".processBeanPoolLimits" , "2573" , this ) ; Tr . warning ( tc , "INVALID_MAX_POOLTIMEOUT_CNTR0127W" , new Object [ ] { ( bmd . j2eeName ) . toString ( ) , timeoutStr , "300" } ) ; tmpMaxCreationTimeout = defaultMaxCreationTimeout ; if ( isValidationFailable ( checkAppConfigCustom ) ) { EJBConfigurationException ecex = new EJBConfigurationException ( "Maximum pool size timeout specified for bean " + bmd . j2eeName + " not a valid integer: " + timeoutStr + "." ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "processBeanPoolLimits : " + ecex ) ; throw ecex ; } } } else { tmpMaxCreationTimeout = defaultMaxCreationTimeout ; } // If the noEJBPool system property has been set to " true " , then a
// no - capacity ejb pool will be created . ( This should only be used
// for development / debug purposes ) / / d262413 PK20648
if ( noEJBPool ) { bmd . minPoolSize = 0 ; bmd . maxPoolSize = 0 ; } // Otherwise , if an invalid min / max pair was specified , then the
// defaults will be used , and a warning issued .
else if ( tmpMaxPoolSize < tmpMinPoolSize ) { Tr . warning ( tc , "INVALID_POOLSIZE_COMBO_CNTR0059W" , new Object [ ] { ( bmd . j2eeName ) . toString ( ) , Integer . toString ( tmpMinPoolSize ) , Integer . toString ( tmpMaxPoolSize ) } ) ; bmd . minPoolSize = defaultMinPoolSize ; bmd . maxPoolSize = defaultMaxPoolSize ; if ( isValidationFailable ( checkAppConfigCustom ) ) { EJBConfigurationException ecex = new EJBConfigurationException ( "Minimum pool size specified for bean " + bmd . j2eeName + " is greater than maximum pool size specified: (" + tmpMinPoolSize + "," + tmpMaxPoolSize + ")" ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "processBeanPoolLimits : " + ecex ) ; throw ecex ; } } // And finally , everything looks good , so the configured sizes
// and pre - load / max creation limit values will be used .
else { bmd . minPoolSize = tmpMinPoolSize ; bmd . maxPoolSize = tmpMaxPoolSize ; // Set the pre - load and max creation values to the min / max pool
// size values if ' H ' ( hard ) specified , and the values were
// otherwise valid . PK20648
if ( setInitialPoolSize ) bmd . ivInitialPoolSize = bmd . minPoolSize ; if ( setMaxCreation ) { bmd . ivMaxCreation = bmd . maxPoolSize ; bmd . ivMaxCreationTimeout = tmpMaxCreationTimeout ; } } if ( poolSizeSpec != null || noEJBPool ) { // Log an Info message indicating pool min / max values , including
// whether or not they are ' hard ' limits . PK20648
String minPoolSizeStr = Integer . toString ( bmd . minPoolSize ) ; if ( bmd . ivInitialPoolSize > 0 ) minPoolSizeStr = "H " + minPoolSizeStr ; String maxPoolSizeStr = Integer . toString ( bmd . maxPoolSize ) ; if ( bmd . ivMaxCreation > 0 ) { maxPoolSizeStr = "H " + maxPoolSizeStr ; String maxPoolTimeoutStr = Long . toString ( bmd . ivMaxCreationTimeout / 1000 ) ; Tr . info ( tc , "POOLSIZE_VALUES_CNTR0128I" , new Object [ ] { minPoolSizeStr , maxPoolSizeStr , maxPoolTimeoutStr , bmd . enterpriseBeanClassName } ) ; } else { Tr . info ( tc , "POOLSIZE_VALUES_CNTR0060I" , new Object [ ] { minPoolSizeStr , maxPoolSizeStr , bmd . enterpriseBeanClassName } ) ; } } if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "processBeanPoolLimits" ) ; }
|
public class CmsContentEditor { /** * Previews the native event to enable keyboard short cuts . < p >
* @ param event the event */
void previewNativeEvent ( NativePreviewEvent event ) { } }
|
Event nativeEvent = Event . as ( event . getNativeEvent ( ) ) ; if ( event . getTypeInt ( ) == Event . ONKEYDOWN ) { int keyCode = nativeEvent . getKeyCode ( ) ; if ( nativeEvent . getCtrlKey ( ) || nativeEvent . getMetaKey ( ) ) { // look for short cuts
if ( nativeEvent . getShiftKey ( ) ) { if ( keyCode == KeyCodes . KEY_S ) { exitWithSaving ( ) ; nativeEvent . preventDefault ( ) ; nativeEvent . stopPropagation ( ) ; } else if ( keyCode == KeyCodes . KEY_X ) { confirmCancel ( ) ; nativeEvent . preventDefault ( ) ; nativeEvent . stopPropagation ( ) ; } } else if ( keyCode == KeyCodes . KEY_S ) { if ( checkValidation ( ) ) { save ( ) ; } nativeEvent . preventDefault ( ) ; nativeEvent . stopPropagation ( ) ; } } }
|
public class ToTextStream { /** * Report an XML comment anywhere in the document .
* This callback will be used for comments inside or outside the
* document element , including comments in the external DTD
* subset ( if read ) .
* @ param ch An array holding the characters in the comment .
* @ param start The starting position in the array .
* @ param length The number of characters to use from the array .
* @ throws org . xml . sax . SAXException The application may raise an exception . */
public void comment ( char ch [ ] , int start , int length ) throws org . xml . sax . SAXException { } }
|
flushPending ( ) ; if ( m_tracer != null ) super . fireCommentEvent ( ch , start , length ) ;
|
public class CircularQueue_I32 { /** * Adds a new element to the queue . If the queue isn ' t large enough to store this value then its internal data
* array will grow
* @ param value Value which is to be added */
public void add ( int value ) { } }
|
// see if it needs to grow the queue
if ( size >= data . length ) { int a [ ] = new int [ nextDataSize ( ) ] ; System . arraycopy ( data , start , a , 0 , data . length - start ) ; System . arraycopy ( data , 0 , a , data . length - start , start ) ; start = 0 ; data = a ; } data [ ( start + size ) % data . length ] = value ; size ++ ;
|
public class CloudDirectoryUtils { /** * Gets attribute key value by name .
* @ param attributesResult the attributes result
* @ param attributeName the attribute name
* @ return the attribute key value by name */
public static AttributeKeyAndValue getAttributeKeyValueByName ( final ListObjectAttributesResult attributesResult , final String attributeName ) { } }
|
return attributesResult . getAttributes ( ) . stream ( ) . filter ( a -> a . getKey ( ) . getName ( ) . equalsIgnoreCase ( attributeName ) ) . findFirst ( ) . orElse ( null ) ;
|
public class IntentUtils { /** * Open a browser window to the URL specified .
* @ param url Target url */
public static Intent openLink ( String url ) { } }
|
// if protocol isn ' t defined use http by default
if ( ! TextUtils . isEmpty ( url ) && ! url . contains ( "://" ) ) { url = "http://" + url ; } Intent intent = new Intent ( ) ; intent . setAction ( Intent . ACTION_VIEW ) ; intent . setData ( Uri . parse ( url ) ) ; return intent ;
|
public class BoxAPIResponse { /** * Returns the response error stream , handling the case when it contains gzipped data .
* @ return gzip decoded ( if needed ) error stream or null */
private InputStream getErrorStream ( ) { } }
|
InputStream errorStream = this . connection . getErrorStream ( ) ; if ( errorStream != null ) { final String contentEncoding = this . connection . getContentEncoding ( ) ; if ( contentEncoding != null && contentEncoding . equalsIgnoreCase ( "gzip" ) ) { try { errorStream = new GZIPInputStream ( errorStream ) ; } catch ( IOException e ) { // just return the error stream as is
} } } return errorStream ;
|
public class ChangedFile { /** * Return the name of the file relative to the source folder .
* @ return the relative name */
public String getRelativeName ( ) { } }
|
File folder = this . sourceFolder . getAbsoluteFile ( ) ; File file = this . file . getAbsoluteFile ( ) ; String folderName = StringUtils . cleanPath ( folder . getPath ( ) ) ; String fileName = StringUtils . cleanPath ( file . getPath ( ) ) ; Assert . state ( fileName . startsWith ( folderName ) , ( ) -> "The file " + fileName + " is not contained in the source folder " + folderName ) ; return fileName . substring ( folderName . length ( ) + 1 ) ;
|
public class RestClientUtil { /** * 创建或者更新索引文档
* @ param indexName
* @ param indexType
* @ param params
* @ return
* @ throws ElasticSearchException */
public String addMapDocument ( String indexName , String indexType , Map params , ClientOptions clientOptions ) throws ElasticSearchException { } }
|
Object docId = null ; Object parentId = null ; Object routing = null ; String refreshOption = null ; if ( clientOptions != null ) { refreshOption = clientOptions . getRefreshOption ( ) ; docId = clientOptions . getIdField ( ) != null ? params . get ( clientOptions . getIdField ( ) ) : null ; parentId = clientOptions . getParentIdField ( ) != null ? params . get ( clientOptions . getParentIdField ( ) ) : null ; routing = clientOptions . getRountField ( ) != null ? params . get ( clientOptions . getRountField ( ) ) : null ; } return addDocument ( indexName , indexType , params , docId , parentId , routing , refreshOption ) ;
|
public class CommerceAvailabilityEstimateLocalServiceBaseImpl { /** * Returns the commerce availability estimate matching the UUID and group .
* @ param uuid the commerce availability estimate ' s UUID
* @ param groupId the primary key of the group
* @ return the matching commerce availability estimate , or < code > null < / code > if a matching commerce availability estimate could not be found */
@ Override public CommerceAvailabilityEstimate fetchCommerceAvailabilityEstimateByUuidAndGroupId ( String uuid , long groupId ) { } }
|
return commerceAvailabilityEstimatePersistence . fetchByUUID_G ( uuid , groupId ) ;
|
public class PanelUserDAO { /** * Creates new panel user
* @ param panel panel
* @ param user user
* @ param role user ' s role in panel
* @ param joinType join type
* @ param stamp panel stamp
* @ param creator creator user
* @ return new panelist */
public PanelUser create ( Panel panel , User user , PanelUserRole role , PanelUserJoinType joinType , PanelStamp stamp , User creator ) { } }
|
Date now = new Date ( ) ; PanelUser panelUser = new PanelUser ( ) ; panelUser . setPanel ( panel ) ; panelUser . setUser ( user ) ; panelUser . setRole ( role ) ; panelUser . setJoinType ( joinType ) ; panelUser . setStamp ( stamp ) ; panelUser . setCreated ( now ) ; panelUser . setCreator ( creator ) ; panelUser . setLastModified ( now ) ; panelUser . setLastModifier ( creator ) ; panelUser . setArchived ( Boolean . FALSE ) ; return persist ( panelUser ) ;
|
public class ProbeManagerImpl { /** * Add the specified listener to the collection of listeners associated
* with the specified probe .
* @ param probe the probe that fires for the listener
* @ param listener the listener that ' s driven by the probe */
void addListenerByProbe ( ProbeImpl probe , ProbeListener listener ) { } }
|
Set < ProbeListener > listeners = listenersByProbe . get ( probe ) ; if ( listeners == null ) { listeners = new CopyOnWriteArraySet < ProbeListener > ( ) ; listenersByProbe . putIfAbsent ( probe , listeners ) ; listeners = listenersByProbe . get ( probe ) ; } listeners . add ( listener ) ;
|
public class Authorization { /** * Approves a pending Issuing < code > Authorization < / code > object . */
public Authorization approve ( Map < String , Object > params ) throws StripeException { } }
|
return approve ( params , ( RequestOptions ) null ) ;
|
public class Hex { /** * Create a String from a char array with zero - copy ( if available ) , using reflection to access a package - protected constructor of String . */
public static String wrapCharArray ( char [ ] c ) { } }
|
if ( c == null ) return null ; String s = null ; if ( stringConstructor != null ) { try { s = stringConstructor . newInstance ( 0 , c . length , c ) ; } catch ( Exception e ) { // Swallowing as we ' ll just use a copying constructor
} } return s == null ? new String ( c ) : s ;
|
public class ListConfigurationSetsResult { /** * An object that contains a list of configuration sets for your account in the current region .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setConfigurationSets ( java . util . Collection ) } or { @ link # withConfigurationSets ( java . util . Collection ) } if
* you want to override the existing values .
* @ param configurationSets
* An object that contains a list of configuration sets for your account in the current region .
* @ return Returns a reference to this object so that method calls can be chained together . */
public ListConfigurationSetsResult withConfigurationSets ( String ... configurationSets ) { } }
|
if ( this . configurationSets == null ) { setConfigurationSets ( new java . util . ArrayList < String > ( configurationSets . length ) ) ; } for ( String ele : configurationSets ) { this . configurationSets . add ( ele ) ; } return this ;
|
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public FullyQualifiedNameFQNType createFullyQualifiedNameFQNTypeFromString ( EDataType eDataType , String initialValue ) { } }
|
FullyQualifiedNameFQNType result = FullyQualifiedNameFQNType . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
|
public class BundledComponentRepository { /** * documentation inherited */
public CharacterComponent getComponent ( int componentId ) throws NoSuchComponentException { } }
|
CharacterComponent component = _components . get ( componentId ) ; if ( component == null ) { throw new NoSuchComponentException ( componentId ) ; } return component ;
|
public class BlockReconstructor { /** * Returns a DistributedFileSystem hosting the path supplied . */
protected DistributedFileSystem getDFS ( Path p ) throws IOException { } }
|
FileSystem fs = p . getFileSystem ( getConf ( ) ) ; DistributedFileSystem dfs = null ; if ( fs instanceof DistributedFileSystem ) { dfs = ( DistributedFileSystem ) fs ; } else if ( fs instanceof FilterFileSystem ) { FilterFileSystem ffs = ( FilterFileSystem ) fs ; if ( ffs . getRawFileSystem ( ) instanceof DistributedFileSystem ) { dfs = ( DistributedFileSystem ) ffs . getRawFileSystem ( ) ; } } return dfs ;
|
public class XAttributeMapConverter { /** * ( non - Javadoc )
* @ see
* com . thoughtworks . xstream . converters . Converter # unmarshal ( com . thoughtworks
* . xstream . io . HierarchicalStreamReader ,
* com . thoughtworks . xstream . converters . UnmarshallingContext ) */
public Object unmarshal ( HierarchicalStreamReader reader , UnmarshallingContext context ) { } }
|
XAttributeMap map = null ; // restore correct type of attribute map , i . e . , check for buffered
// implementation , and correctly restore lazy implementation if
// this had been used for serialization .
boolean lazy = reader . getAttribute ( "lazy" ) . equals ( "true" ) ; boolean buffered = reader . getAttribute ( "buffered" ) . equals ( "true" ) ; if ( lazy ) { if ( buffered ) { map = new XAttributeMapLazyImpl < XAttributeMapBufferedImpl > ( XAttributeMapBufferedImpl . class ) ; } else { map = new XAttributeMapLazyImpl < XAttributeMapImpl > ( XAttributeMapImpl . class ) ; } } else if ( buffered ) { map = new XAttributeMapBufferedImpl ( ) ; } else { map = new XAttributeMapImpl ( ) ; } while ( reader . hasMoreChildren ( ) ) { reader . moveDown ( ) ; XAttribute attribute = ( XAttribute ) context . convertAnother ( map , XAttribute . class , XesXStreamPersistency . attributeConverter ) ; map . put ( attribute . getKey ( ) , attribute ) ; reader . moveUp ( ) ; } return map ;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.