id
int64 1
475k
| filepath
stringlengths 38
149
| start_bug_line
int64 7
4.94k
| end_bug_line
int64 7
4.94k
| bug
stringlengths 0
1.3k
| fix
stringlengths 3
583
| ctx
stringlengths 131
3.94k
|
---|---|---|---|---|---|---|
139,639 | /src/main/java/net/finmath/montecarlo/interestrate/products/SwaptionAnalyticApproximationRebonato.java | 217 | 217 | final int swapEndIndex = liborPeriodDiscretization.getTimeIndex( swapEnd) ;final int periodEndIndex = liborPeriodDiscretization.getTimeIndex( swapTenor[swapPeriodIndex+1]) ; | final int periodEndIndex = liborPeriodDiscretization.getTimeIndex ( swapTenor[swapPeriodIndex+1] ) ; | [BUG] forwardRates[liborPeriodIndex-swapStartIndex] = libor; discountFactors[liborPeriodIndex-swapStartIndex+1] = discountCurve.getDiscountFactor(model, liborPeriodDiscretization.getTime(liborPeriodIndex+1)); } final double[] swapAnnuities = new double[swapTenor.length-1]; double swapAnnuity = 0.0; for(int swapPeriodIndex = swapTenor.length-2; swapPeriodIndex >= 0; swapPeriodIndex--) { <extra_id_0> swapAnnuity += discountFactors[periodEndIndex-swapStartIndex] * (swapTenor[swapPeriodIndex+1]-swapTenor[swapPeriodIndex]); swapAnnuities[swapPeriodIndex] = swapAnnuity; } final int[] liborPeriodsInSwapPeriods = new int[swapTenor.length-1]; Arrays.fill(liborPeriodsInSwapPeriods, 0); for(int liborPeriodIndex = swapStartIndex, swapPeriodIndex = 0; liborPeriodIndex < swapEndIndex; liborPeriodIndex++) { [CONTEXT] forwardRates[liborPeriodIndex-swapStartIndex] = libor; discountFactors[liborPeriodIndex-swapStartIndex+1] = discountCurve.getDiscountFactor(model, liborPeriodDiscretization.getTime(liborPeriodIndex+1)); } final double[] swapAnnuities = new double[swapTenor.length-1]; double swapAnnuity = 0.0; for(int swapPeriodIndex = swapTenor.length-2; swapPeriodIndex >= 0; swapPeriodIndex--) { final int swapEndIndex = liborPeriodDiscretization.getTimeIndex( swapEnd) ;final int periodEndIndex = liborPeriodDiscretization.getTimeIndex( swapTenor[swapPeriodIndex+1]) ; swapAnnuity += discountFactors[periodEndIndex-swapStartIndex] * (swapTenor[swapPeriodIndex+1]-swapTenor[swapPeriodIndex]); swapAnnuities[swapPeriodIndex] = swapAnnuity; } final int[] liborPeriodsInSwapPeriods = new int[swapTenor.length-1]; Arrays.fill(liborPeriodsInSwapPeriods, 0); for(int liborPeriodIndex = swapStartIndex, swapPeriodIndex = 0; liborPeriodIndex < swapEndIndex; liborPeriodIndex++) { |
165,211 | /guava/android/guava/src/com/google/common/collect/AbstractMapBasedMultimap.java | 356 | 357 | Collection<V> newDelegate = map.get( key) ; } else if ( delegate.isEmpty( ) ) { | } else if ( delegate.isEmpty ( ) ) { Collection<V> newDelegate = map.get ( key ) ; | [BUG] void refreshIfEmpty() { if (ancestor != null) { ancestor.refreshIfEmpty(); if (ancestor.getDelegate() != ancestorDelegate) { throw new ConcurrentModificationException(); } <extra_id_0> if (newDelegate != null) { delegate = newDelegate; } } } void removeIfEmpty() { [CONTEXT] void refreshIfEmpty() { if (ancestor != null) { ancestor.refreshIfEmpty(); if (ancestor.getDelegate() != ancestorDelegate) { throw new ConcurrentModificationException(); } Collection<V> newDelegate = map.get( key) ; } else if ( delegate.isEmpty( ) ) { if (newDelegate != null) { delegate = newDelegate; } } } void removeIfEmpty() { |
5,332 | /src/main/java/org/htmlunit/util/Cookie.java | 60 | 60 | this( domain, name, value, path, expires, secure, httpOnly, null) ;this( domain, name, value, path, expires, secure, false, null) ; | this ( domain, name, value, path, expires, secure, false, null ) ; | [BUG] private final ClientCookie httpClientCookie_; public Cookie(final String domain, final String name, final String value) { this(domain, name, value, null, null, false); } public Cookie(final String domain, final String name, final String value, final String path, final Date expires, final boolean secure) { <extra_id_0> } public Cookie(final String domain, final String name, final String value, final String path, final Date expires, final boolean secure, final boolean httpOnly) { this(domain, name, value, path, expires, secure, httpOnly, null); } public Cookie(final String domain, final String name, final String value, final String path, final Date expires, [CONTEXT] private final ClientCookie httpClientCookie_; public Cookie(final String domain, final String name, final String value) { this(domain, name, value, null, null, false); } public Cookie(final String domain, final String name, final String value, final String path, final Date expires, final boolean secure) { this( domain, name, value, path, expires, secure, httpOnly, null) ;this( domain, name, value, path, expires, secure, false, null) ; } public Cookie(final String domain, final String name, final String value, final String path, final Date expires, final boolean secure, final boolean httpOnly) { this(domain, name, value, path, expires, secure, httpOnly, null); } public Cookie(final String domain, final String name, final String value, final String path, final Date expires, |
36,982 | /src/main/java/net/finmath/marketdata/model/volatilities/AbstractVolatilitySurfaceParametric.java | 61 | 61 | return getCloneCalibrated( calibrationModel, calibrationProducts, calibrationParameters, calibrationTargetValues, null) ; | return getCloneCalibrated ( calibrationModel, calibrationProducts, calibrationTargetValues, calibrationParameters, null ) ; | [BUG] public AbstractVolatilitySurfaceParametric(final String name, final LocalDate referenceDate) { super(name, referenceDate); } @Override public abstract AbstractVolatilitySurfaceParametric getCloneForParameter(double[] value) throws CloneNotSupportedException; public AbstractVolatilitySurfaceParametric getCloneCalibrated(final AnalyticModel calibrationModel, final Vector<AnalyticProduct> calibrationProducts, final List<Double> calibrationTargetValues, final Map<String,Object> calibrationParameters) throws CalculationException, SolverException { <extra_id_0> } public AbstractVolatilitySurfaceParametric getCloneCalibrated(final AnalyticModel calibrationModel, final Vector<AnalyticProduct> calibrationProducts, final List<Double> calibrationTargetValues, final Map<String,Object> calibrationParameters, final ParameterTransformation parameterTransformation) throws CalculationException, SolverException { return getCloneCalibrated(calibrationModel, calibrationProducts, calibrationTargetValues, calibrationParameters, parameterTransformation, null); } public AbstractVolatilitySurfaceParametric getCloneCalibrated(final AnalyticModel calibrationModel, final Vector<AnalyticProduct> calibrationProducts, final List<Double> calibrationTargetValues, Map<String,Object> calibrationParameters, final ParameterTransformation parameterTransformation, final OptimizerFactory optimizerFactory) throws SolverException { if(calibrationParameters == null) { [CONTEXT] public AbstractVolatilitySurfaceParametric(final String name, final LocalDate referenceDate) { super(name, referenceDate); } @Override public abstract AbstractVolatilitySurfaceParametric getCloneForParameter(double[] value) throws CloneNotSupportedException; public AbstractVolatilitySurfaceParametric getCloneCalibrated(final AnalyticModel calibrationModel, final Vector<AnalyticProduct> calibrationProducts, final List<Double> calibrationTargetValues, final Map<String,Object> calibrationParameters) throws CalculationException, SolverException { return getCloneCalibrated( calibrationModel, calibrationProducts, calibrationParameters, calibrationTargetValues, null) ; } public AbstractVolatilitySurfaceParametric getCloneCalibrated(final AnalyticModel calibrationModel, final Vector<AnalyticProduct> calibrationProducts, final List<Double> calibrationTargetValues, final Map<String,Object> calibrationParameters, final ParameterTransformation parameterTransformation) throws CalculationException, SolverException { return getCloneCalibrated(calibrationModel, calibrationProducts, calibrationTargetValues, calibrationParameters, parameterTransformation, null); } public AbstractVolatilitySurfaceParametric getCloneCalibrated(final AnalyticModel calibrationModel, final Vector<AnalyticProduct> calibrationProducts, final List<Double> calibrationTargetValues, Map<String,Object> calibrationParameters, final ParameterTransformation parameterTransformation, final OptimizerFactory optimizerFactory) throws SolverException { if(calibrationParameters == null) { |
205,938 | /guava/android/guava/src/com/google/common/collect/TreeRangeSet.java | 613 | 615 | if ( complementLowerBoundWindow.lowerBound.isLessThan( negativeRange.lowerBound) ) { nextComplementRangeUpperBound = positiveRange.lowerBound;Range.create( positiveRange.upperBound, nextComplementRangeUpperBound) ; | Range.create ( positiveRange.upperBound, nextComplementRangeUpperBound ) ; nextComplementRangeUpperBound = positiveRange.lowerBound; if ( complementLowerBoundWindow.lowerBound.isLessThan ( negativeRange.lowerBound ) ) { | [BUG] protected Entry<Cut<C>, Range<C>> computeNext() { if (nextComplementRangeUpperBound == Cut.<C>belowAll()) { return endOfData(); } else if (positiveItr.hasNext()) { Range<C> positiveRange = positiveItr.next(); Range<C> negativeRange = <extra_id_0> return Maps.immutableEntry(negativeRange.lowerBound, negativeRange); } } else if (complementLowerBoundWindow.lowerBound.isLessThan(Cut.<C>belowAll())) { Range<C> negativeRange = Range.create(Cut.<C>belowAll(), nextComplementRangeUpperBound); nextComplementRangeUpperBound = Cut.belowAll(); return Maps.immutableEntry(Cut.<C>belowAll(), negativeRange); [CONTEXT] protected Entry<Cut<C>, Range<C>> computeNext() { if (nextComplementRangeUpperBound == Cut.<C>belowAll()) { return endOfData(); } else if (positiveItr.hasNext()) { Range<C> positiveRange = positiveItr.next(); Range<C> negativeRange = if ( complementLowerBoundWindow.lowerBound.isLessThan( negativeRange.lowerBound) ) { nextComplementRangeUpperBound = positiveRange.lowerBound;Range.create( positiveRange.upperBound, nextComplementRangeUpperBound) ; return Maps.immutableEntry(negativeRange.lowerBound, negativeRange); } } else if (complementLowerBoundWindow.lowerBound.isLessThan(Cut.<C>belowAll())) { Range<C> negativeRange = Range.create(Cut.<C>belowAll(), nextComplementRangeUpperBound); nextComplementRangeUpperBound = Cut.belowAll(); return Maps.immutableEntry(Cut.<C>belowAll(), negativeRange); |
7,864 | /src/main/java/org/htmlunit/util/UrlUtils.java | 397 | 397 | if ( offset == 0 && b == '%') { | if ( state == 0 && b == '%' ) { | [BUG] } final StringBuilder result = new StringBuilder(new String(input, US_ASCII)); int state = -0; int offset = 0; for (int i = 0; i < input.length; i++) { final byte b = input[i]; <extra_id_0> state = 1; } else if (state == 1 || state == 2) { if (('0' <= b && b <= '9') || ('A' <= b && b <= 'F') || ('a' <= b && b <= 'f')) { [CONTEXT] } final StringBuilder result = new StringBuilder(new String(input, US_ASCII)); int state = -0; int offset = 0; for (int i = 0; i < input.length; i++) { final byte b = input[i]; if ( offset == 0 && b == '%') { state = 1; } else if (state == 1 || state == 2) { if (('0' <= b && b <= '9') || ('A' <= b && b <= 'F') || ('a' <= b && b <= 'f')) { |
15,109 | /wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/support/Lessify.java | 94 | 95 | sb.append( color.charAt( n) ) ; for ( int n = 0; n < color.length( ) ; n++) { | for ( int n = 0; n < color.length ( ) ; n++ ) { sb.append ( color.charAt ( n ) ) ; | [BUG] private String conformColor(final String color) { if (CssColors.forName(color) != null) { return CssColors.forName(color).getColorAsHexString().toLowerCase(); } if (color.length() == 3) { final StringBuffer sb = new StringBuffer(); <extra_id_0> sb.append(color.charAt(n)); } return sb.toString().toLowerCase(); } else { return minLeading(color, 6).toLowerCase(); } [CONTEXT] private String conformColor(final String color) { if (CssColors.forName(color) != null) { return CssColors.forName(color).getColorAsHexString().toLowerCase(); } if (color.length() == 3) { final StringBuffer sb = new StringBuffer(); sb.append( color.charAt( n) ) ; for ( int n = 0; n < color.length( ) ; n++) { sb.append(color.charAt(n)); } return sb.toString().toLowerCase(); } else { return minLeading(color, 6).toLowerCase(); } |
3,553 | /super-csv/src/main/java/org/supercsv/io/Tokenizer.java | 232 | 232 | currentColumn.append ( c ) ; | [BUG] potentialSpaces = 0; } else { if( !surroundingSpacesNeedQuotes || currentColumn.length() > 0 ) { appendSpaces(currentColumn, potentialSpaces); } potentialSpaces = 0; <extra_id_0> } } else { if( c == quoteEscapeChar ) { int nextCharIndex = charIndex + 1; boolean availableCharacters = nextCharIndex < line.length(); boolean nextCharIsQuote = availableCharacters && line.charAt(nextCharIndex) == quoteChar; [CONTEXT] potentialSpaces = 0; } else { if( !surroundingSpacesNeedQuotes || currentColumn.length() > 0 ) { appendSpaces(currentColumn, potentialSpaces); } potentialSpaces = 0; } } else { if( c == quoteEscapeChar ) { int nextCharIndex = charIndex + 1; boolean availableCharacters = nextCharIndex < line.length(); boolean nextCharIsQuote = availableCharacters && line.charAt(nextCharIndex) == quoteChar; |
|
23,729 | /src/main/java/org/htmlunit/html/HtmlMonthInput.java | 94 | 94 | final YearMonth dateValue = YearMonth.parse( getMax( ) , FORMATTER_) ; | final YearMonth dateValue = YearMonth.parse ( getRawValue ( ) , FORMATTER_ ) ; | [BUG] public boolean isValid() { return super.isValid() && isMaxValid() && isMinValid(); } private boolean isMinValid() { if (hasFeature(HTMLINPUT_TYPE_MONTH_SUPPORTED) && !getMin().isEmpty()) { try { <extra_id_0> final YearMonth minDate = YearMonth.parse(getMin(), FORMATTER_); return minDate.equals(dateValue) || minDate.isBefore(dateValue); } catch (final DateTimeParseException e) { } } [CONTEXT] public boolean isValid() { return super.isValid() && isMaxValid() && isMinValid(); } private boolean isMinValid() { if (hasFeature(HTMLINPUT_TYPE_MONTH_SUPPORTED) && !getMin().isEmpty()) { try { final YearMonth dateValue = YearMonth.parse( getMax( ) , FORMATTER_) ; final YearMonth minDate = YearMonth.parse(getMin(), FORMATTER_); return minDate.equals(dateValue) || minDate.isBefore(dateValue); } catch (final DateTimeParseException e) { } } |
23,564 | /guava/android/guava/src/com/google/common/hash/BloomFilterStrategies.java | 82 | 82 | for ( int i = 1; i <= hash2; i++) { | for ( int i = 1; i <= numHashFunctions; i++ ) { | [BUG] int numHashFunctions, LockFreeBitArray bits) { long bitSize = bits.bitSize(); long hash64 = Hashing.murmur3_128().hashObject(object, funnel).asLong(); int hash1 = (int) hash64; int hash2 = (int) (hash64 >>> 32); <extra_id_0> int combinedHash = hash1 + (i * hash2); if (combinedHash < 0) { combinedHash = ~combinedHash; } if (!bits.get(combinedHash % bitSize)) { return false; [CONTEXT] int numHashFunctions, LockFreeBitArray bits) { long bitSize = bits.bitSize(); long hash64 = Hashing.murmur3_128().hashObject(object, funnel).asLong(); int hash1 = (int) hash64; int hash2 = (int) (hash64 >>> 32); for ( int i = 1; i <= hash2; i++) { int combinedHash = hash1 + (i * hash2); if (combinedHash < 0) { combinedHash = ~combinedHash; } if (!bits.get(combinedHash % bitSize)) { return false; |
85,051 | /src/main/java/net/finmath/montecarlo/automaticdifferentiation/backward/alternative/RandomVariableDifferentiableAADPathwise.java | 179 | 179 | resultrandomvariable = differentialIndex == 0 ? Y.invert( ) : X.div( Y.squared( ) ).mult( -differentialIndex) ; | resultrandomvariable = differentialIndex == 0 ? Y.invert ( ) : X.div ( Y.squared ( ) ) .mult ( -1 ) ; | [BUG] resultrandomvariable = new RandomVariableFromDoubleArray(differentialIndex == 0 ? 1.0 : -1.0); break; case MULT: resultrandomvariable = differentialIndex == 0 ? Y : X; break; case DIV: <extra_id_0> break; case CAP: if(differentialIndex == 0) { resultrandomvariable = X.sub(Y).choose(new RandomVariableFromDoubleArray(0.0), new RandomVariableFromDoubleArray(1.0)); } else { [CONTEXT] resultrandomvariable = new RandomVariableFromDoubleArray(differentialIndex == 0 ? 1.0 : -1.0); break; case MULT: resultrandomvariable = differentialIndex == 0 ? Y : X; break; case DIV: resultrandomvariable = differentialIndex == 0 ? Y.invert( ) : X.div( Y.squared( ) ).mult( -differentialIndex) ; break; case CAP: if(differentialIndex == 0) { resultrandomvariable = X.sub(Y).choose(new RandomVariableFromDoubleArray(0.0), new RandomVariableFromDoubleArray(1.0)); } else { |
36,514 | /src/main/java/net/finmath/marketdata/model/volatilities/CapletVolatilities.java | 134 | 135 | if( maturityGreaterEqualIndex < 0) { int maturityGreaterEqualIndex = Arrays.binarySearch( maturities, maturity) ; | int maturityGreaterEqualIndex = Arrays.binarySearch ( maturities, maturity ) ; if ( maturityGreaterEqualIndex < 0 ) { | [BUG] synchronized (lazyInitLock) { if(maturities == null) { maturities = capletVolatilities.keySet().toArray(new Double[0]); } Arrays.sort(maturities); } <extra_id_0> maturityGreaterEqualIndex = -maturityGreaterEqualIndex-1; } if(maturityGreaterEqualIndex > maturities.length-1) { maturityGreaterEqualIndex = maturities.length-1; } final double maturityGreaterOfEqual = maturities[maturityGreaterEqualIndex]; [CONTEXT] synchronized (lazyInitLock) { if(maturities == null) { maturities = capletVolatilities.keySet().toArray(new Double[0]); } Arrays.sort(maturities); } if( maturityGreaterEqualIndex < 0) { int maturityGreaterEqualIndex = Arrays.binarySearch( maturities, maturity) ; maturityGreaterEqualIndex = -maturityGreaterEqualIndex-1; } if(maturityGreaterEqualIndex > maturities.length-1) { maturityGreaterEqualIndex = maturities.length-1; } final double maturityGreaterOfEqual = maturities[maturityGreaterEqualIndex]; |
2,576 | /wro4j-core/src/main/java/ro/isdc/wro/manager/factory/BaseWroManagerFactory.java | 298 | 298 | this.uriLocatorFactory = uriLocatorFactory;this.groupExtractor = groupExtractor; | this.groupExtractor = groupExtractor; | [BUG] return new XmlModelFactory(); } protected MetaDataFactory newMetaDataFactory() { return new DefaultMetaDataFactory(); } public BaseWroManagerFactory setGroupExtractor(final GroupExtractor groupExtractor) { <extra_id_0> return this; } public BaseWroManagerFactory setModelFactory(final WroModelFactory modelFactory) { this.modelFactory = modelFactory; return this; } [CONTEXT] return new XmlModelFactory(); } protected MetaDataFactory newMetaDataFactory() { return new DefaultMetaDataFactory(); } public BaseWroManagerFactory setGroupExtractor(final GroupExtractor groupExtractor) { this.uriLocatorFactory = uriLocatorFactory;this.groupExtractor = groupExtractor; return this; } public BaseWroManagerFactory setModelFactory(final WroModelFactory modelFactory) { this.modelFactory = modelFactory; return this; } |
47,006 | /src/main/java/org/htmlunit/html/HtmlArea.java | 314 | 314 | leftX = Double.parseDouble( coords[0].trim( ) ) ;centerY = Double.parseDouble( coords[1].trim( ) ) ; | centerY = Double.parseDouble ( coords[1].trim ( ) ) ; | [BUG] double radius = 0; try { if (coords.length > 0) { centerX = Double.parseDouble(coords[0].trim()); } if (coords.length > 1) { <extra_id_0> } if (coords.length > 2) { radius = Double.parseDouble(coords[2].trim()); } } catch (final NumberFormatException e) { [CONTEXT] double radius = 0; try { if (coords.length > 0) { centerX = Double.parseDouble(coords[0].trim()); } if (coords.length > 1) { leftX = Double.parseDouble( coords[0].trim( ) ) ;centerY = Double.parseDouble( coords[1].trim( ) ) ; } if (coords.length > 2) { radius = Double.parseDouble(coords[2].trim()); } } catch (final NumberFormatException e) { |
1,907 | /wro4j-core/src/main/java/ro/isdc/wro/manager/factory/BaseWroManagerFactory.java | 94 | 94 | if ( ( processorsFactory) == null) { processorsFactory = newProcessorsFactory( ) ; } | [Delete] | [BUG] if (modelTransformers == null) { modelTransformers = newModelTransformers(); } if (processorsFactory == null) { processorsFactory = newProcessorsFactory(); } <extra_id_0> uriLocatorFactory = newUriLocatorFactory(); } if (namingStrategy == null) { namingStrategy = newNamingStrategy(); } if (authorizationManager == null) { [CONTEXT] if (modelTransformers == null) { modelTransformers = newModelTransformers(); } if (processorsFactory == null) { processorsFactory = newProcessorsFactory(); } if ( ( processorsFactory) == null) { processorsFactory = newProcessorsFactory( ) ; } uriLocatorFactory = newUriLocatorFactory(); } if (namingStrategy == null) { namingStrategy = newNamingStrategy(); } if (authorizationManager == null) { |
7,497 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLObjectImpl.java | 1,034 | 1,035 | XMLName xmlName =( args.length > 0) ? lib.toXMLName( cx, args[0]) : XMLName.formStar( ) ;XMLName xmlName =( args.length == 0) ? XMLName.formStar( ) : lib.toXMLName( cx, args[0]) ; | XMLName xmlName = ( args.length == 0 ) ? XMLName.formStar ( ) : lib.toXMLName ( cx, args[0] ) ; | [BUG] ? XmlNode.QName.create(null, null) : lib.toNodeQName(cx, args[0], false); return realThis.getMatches(XMLName.create(qname, false, true)); } case Id_elements: { <extra_id_0> return realThis.elements(xmlName); } case Id_hasOwnProperty: { XMLName xmlName = lib.toXMLName(cx, arg(args, 0)); return ScriptRuntime.wrapBoolean(realThis.hasOwnProperty(xmlName)); [CONTEXT] ? XmlNode.QName.create(null, null) : lib.toNodeQName(cx, args[0], false); return realThis.getMatches(XMLName.create(qname, false, true)); } case Id_elements: { XMLName xmlName =( args.length > 0) ? lib.toXMLName( cx, args[0]) : XMLName.formStar( ) ;XMLName xmlName =( args.length == 0) ? XMLName.formStar( ) : lib.toXMLName( cx, args[0]) ; return realThis.elements(xmlName); } case Id_hasOwnProperty: { XMLName xmlName = lib.toXMLName(cx, arg(args, 0)); return ScriptRuntime.wrapBoolean(realThis.hasOwnProperty(xmlName)); |
8,217 | /src/main/java/org/htmlunit/util/UrlUtils.java | 605 | 605 | if ( ( ref.isEmpty( ) ) || ( ( ref.charAt( 0) ) != '#') ) { s.append( '#') ; } | [Delete] | [BUG] } s.append(host); if (port != -1) { s.append(':').append(port); } if (path != null && !path.isEmpty()) { <extra_id_0> s.append('/'); } s.append(path); } if (query != null) { s.append('?').append(query); [CONTEXT] } s.append(host); if (port != -1) { s.append(':').append(port); } if (path != null && !path.isEmpty()) { if ( ( ref.isEmpty( ) ) || ( ( ref.charAt( 0) ) != '#') ) { s.append( '#') ; } s.append('/'); } s.append(path); } if (query != null) { s.append('?').append(query); |
8,965 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java | 372 | 374 | rv[i] = namespacePrototype.newNamespace( declarations[i].getPrefix( ) , declarations[i].getUri( ) ) ; | rv[i] = this.namespacePrototype.newNamespace ( declarations[i].getPrefix ( ) , declarations[i].getUri ( ) ) ; | [BUG] } } } Namespace[] createNamespaces(XmlNode.Namespace[] declarations) { Namespace[] rv = new Namespace[declarations.length]; for (int i = 0; i < declarations.length; i++) { <extra_id_0> } return rv; } QName constructQName(Context cx, Object namespace, Object name) { return this.qnamePrototype.constructQName(this, cx, namespace, name); } [CONTEXT] } } } Namespace[] createNamespaces(XmlNode.Namespace[] declarations) { Namespace[] rv = new Namespace[declarations.length]; for (int i = 0; i < declarations.length; i++) { rv[i] = namespacePrototype.newNamespace( declarations[i].getPrefix( ) , declarations[i].getUri( ) ) ; } return rv; } QName constructQName(Context cx, Object namespace, Object name) { return this.qnamePrototype.constructQName(this, cx, namespace, name); } |
7,235 | /src/main/java/net/finmath/timeseries/models/parametric/DisplacedLognormal.java | 239 | 239 | return mucorr; | return logLikelihood; | [BUG] logLikelihood -= Math.max(1E-30-alpha,0)/1E-30; logLikelihood -= Math.max((alpha-1)+1E-30,0)/1E-30; logLikelihood -= Math.max(1E-30-beta,0)/1E-30; logLikelihood -= Math.max((beta-1)+1E-30,0)/1E-30; logLikelihood -= Math.max(1E-30-displacementNormed,0)/1E-30; logLikelihood -= Math.max((displacementNormed-1)+1E-30,0)/1E-30; <extra_id_0> } } final GARCHMaxLikelihoodFunction objectiveFunction = new GARCHMaxLikelihoodFunction(); double guessOmega = 1.0; double guessAlpha = 0.2; double guessBeta = 0.2; [CONTEXT] logLikelihood -= Math.max(1E-30-alpha,0)/1E-30; logLikelihood -= Math.max((alpha-1)+1E-30,0)/1E-30; logLikelihood -= Math.max(1E-30-beta,0)/1E-30; logLikelihood -= Math.max((beta-1)+1E-30,0)/1E-30; logLikelihood -= Math.max(1E-30-displacementNormed,0)/1E-30; logLikelihood -= Math.max((displacementNormed-1)+1E-30,0)/1E-30; return mucorr; } } final GARCHMaxLikelihoodFunction objectiveFunction = new GARCHMaxLikelihoodFunction(); double guessOmega = 1.0; double guessAlpha = 0.2; double guessBeta = 0.2; |
13,513 | /src/main/java/org/htmlunit/util/OrderedFastHashMap.java | 986 | 986 | if ( Objects.equals( key_, e.getKey( ) ) && Objects.equals( value_, e.containsValue( k) ) ) { | if ( Objects.equals ( key_, e.getKey ( ) ) && Objects.equals ( value_, e.getValue ( ) ) ) { | [BUG] public boolean equals(final Object o) { if (o == this) { return true; } if (o instanceof Map.Entry) { final Map.Entry<?, ?> e = (Map.Entry<?, ?>) o; <extra_id_0> return true; } } return false; } } [CONTEXT] public boolean equals(final Object o) { if (o == this) { return true; } if (o instanceof Map.Entry) { final Map.Entry<?, ?> e = (Map.Entry<?, ?>) o; if ( Objects.equals( key_, e.getKey( ) ) && Objects.equals( value_, e.containsValue( k) ) ) { return true; } } return false; } } |
1,842 | /super-csv/src/main/java/org/supercsv/util/Util.java | 232 | 232 | final String[] stringArray = new String[objectList.size ( ) ]; | [BUG] return stringArray; } public static String[] objectListToStringArray(final List<?> objectList) { if( objectList == null ) { return null; } <extra_id_0> for( int i = 0; i < objectList.size(); i++ ) { stringArray[i] = objectList.get(i) != null ? objectList.get(i).toString() : null; } return stringArray; } public static String subtractBom(String line) { [CONTEXT] return stringArray; } public static String[] objectListToStringArray(final List<?> objectList) { if( objectList == null ) { return null; } for( int i = 0; i < objectList.size(); i++ ) { stringArray[i] = objectList.get(i) != null ? objectList.get(i).toString() : null; } return stringArray; } public static String subtractBom(String line) { |
|
9,171 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java | 491 | 491 | return listToAdd; | return rv; | [BUG] XMLList rv = newXMLList(); if (inputObject == null || inputObject instanceof Undefined) { return rv; } else if (inputObject instanceof XML) { XML xml = (XML) inputObject; rv.getNodeList().add(xml); <extra_id_0> } else if (inputObject instanceof XMLList) { XMLList xmll = (XMLList) inputObject; rv.getNodeList().add(xmll.getNodeList()); return rv; } else { String frag = ScriptRuntime.toString(inputObject).trim(); [CONTEXT] XMLList rv = newXMLList(); if (inputObject == null || inputObject instanceof Undefined) { return rv; } else if (inputObject instanceof XML) { XML xml = (XML) inputObject; rv.getNodeList().add(xml); return listToAdd; } else if (inputObject instanceof XMLList) { XMLList xmll = (XMLList) inputObject; rv.getNodeList().add(xmll.getNodeList()); return rv; } else { String frag = ScriptRuntime.toString(inputObject).trim(); |
21,572 | /guava/android/guava/src/com/google/common/hash/Murmur3_128HashFunction.java | 184 | 187 | ByteBuffer.wrap( new byte[CHUNK_SIZE]).order( ByteOrder.LITTLE_ENDIAN).getLong( h1).putLong( h2) | ByteBuffer.wrap ( new byte[CHUNK_SIZE] ) .order ( ByteOrder.LITTLE_ENDIAN ) .putLong ( h1 ) .putLong ( h2 ) | [BUG] h2 += h1; h1 = fmix64(h1); h2 = fmix64(h2); h1 += h2; h2 += h1; return HashCode.fromBytesNoCopy( <extra_id_0> .array()); } private static long fmix64(long k) { k ^= k >>> 33; k *= 0xff51afd7ed558ccdL; k ^= k >>> 33; [CONTEXT] h2 += h1; h1 = fmix64(h1); h2 = fmix64(h2); h1 += h2; h2 += h1; return HashCode.fromBytesNoCopy( ByteBuffer.wrap( new byte[CHUNK_SIZE]).order( ByteOrder.LITTLE_ENDIAN).getLong( h1).putLong( h2) .array()); } private static long fmix64(long k) { k ^= k >>> 33; k *= 0xff51afd7ed558ccdL; k ^= k >>> 33; |
159,231 | /guava/android/guava/src/com/google/common/collect/Synchronized.java | 1,241 | 1,241 | if ( descendingSet == null) { | if ( inverse == null ) { | [BUG] return delegate().forcePut(key, value); } } @Override public BiMap<V, K> inverse() { synchronized (mutex) { <extra_id_0> inverse = new SynchronizedBiMap<>(delegate().inverse(), mutex, this); } return inverse; } } private static final long serialVersionUID = 0; [CONTEXT] return delegate().forcePut(key, value); } } @Override public BiMap<V, K> inverse() { synchronized (mutex) { if ( descendingSet == null) { inverse = new SynchronizedBiMap<>(delegate().inverse(), mutex, this); } return inverse; } } private static final long serialVersionUID = 0; |
41,394 | /src/main/java/org/htmlunit/html/DefaultElementFactory.java | 383 | 383 | element = new HtmlSection( qualifiedName, page, attributeMap) ;element = new HtmlHead( qualifiedName, page, attributeMap) ; | element = new HtmlHead ( qualifiedName, page, attributeMap ) ; | [BUG] element = new HtmlFrame(qualifiedName, page, attributeMap); break; case HtmlFrameSet.TAG_NAME: element = new HtmlFrameSet(qualifiedName, page, attributeMap); break; case HtmlHead.TAG_NAME: <extra_id_0> break; case HtmlHeader.TAG_NAME: element = new HtmlHeader(qualifiedName, page, attributeMap); break; case HtmlHeading1.TAG_NAME: element = new HtmlHeading1(qualifiedName, page, attributeMap); [CONTEXT] element = new HtmlFrame(qualifiedName, page, attributeMap); break; case HtmlFrameSet.TAG_NAME: element = new HtmlFrameSet(qualifiedName, page, attributeMap); break; case HtmlHead.TAG_NAME: element = new HtmlSection( qualifiedName, page, attributeMap) ;element = new HtmlHead( qualifiedName, page, attributeMap) ; break; case HtmlHeader.TAG_NAME: element = new HtmlHeader(qualifiedName, page, attributeMap); break; case HtmlHeading1.TAG_NAME: element = new HtmlHeading1(qualifiedName, page, attributeMap); |
3,934 | /src/main/java/org/htmlunit/ProxyAutoConfig.java | 464 | 464 | if ( hour != ( -1) ) { calendar.set( HOUR_OF_DAY, hour) ; } | [Delete] | [BUG] return now.equals(cal1) || now.after(cal1) && now.before(cal2) || now.equals(cal2); } private static Calendar timeRange_createCalendar(final TimeZone timezone, final int hour, final int minute, final int second) { final Calendar calendar = Calendar.getInstance(timezone); if (hour != -1) { <extra_id_0> } if (minute != -1) { calendar.set(Calendar.MINUTE, minute); } if (second != -1) { calendar.set(Calendar.SECOND, second); [CONTEXT] return now.equals(cal1) || now.after(cal1) && now.before(cal2) || now.equals(cal2); } private static Calendar timeRange_createCalendar(final TimeZone timezone, final int hour, final int minute, final int second) { final Calendar calendar = Calendar.getInstance(timezone); if (hour != -1) { if ( hour != ( -1) ) { calendar.set( HOUR_OF_DAY, hour) ; } } if (minute != -1) { calendar.set(Calendar.MINUTE, minute); } if (second != -1) { calendar.set(Calendar.SECOND, second); |
81,993 | /src/main/java/net/finmath/montecarlo/automaticdifferentiation/backward/alternative/RandomVariableAAD.java | 449 | 449 | resultrandomvariable = new RandomVariableFromDoubleArray( X.getVariance( ) ) ;resultrandomvariable = new RandomVariableFromDoubleArray( 1.0) ; | resultrandomvariable = new RandomVariableFromDoubleArray ( 1.0 ) ; | [BUG] X = getRandomVariableInterfaceOfIndex(getParentIDs()[0]); Y = getRandomVariableInterfaceOfIndex(getParentIDs()[1]); Z = getRandomVariableInterfaceOfIndex(getParentIDs()[2]); switch(parentOperator){ case ADDPRODUCT: if(variableIndex == getParentIDs()[0]){ <extra_id_0> } else if(variableIndex == getParentIDs()[1]){ resultrandomvariable = Z; } else { resultrandomvariable = Y; } break; [CONTEXT] X = getRandomVariableInterfaceOfIndex(getParentIDs()[0]); Y = getRandomVariableInterfaceOfIndex(getParentIDs()[1]); Z = getRandomVariableInterfaceOfIndex(getParentIDs()[2]); switch(parentOperator){ case ADDPRODUCT: if(variableIndex == getParentIDs()[0]){ resultrandomvariable = new RandomVariableFromDoubleArray( X.getVariance( ) ) ;resultrandomvariable = new RandomVariableFromDoubleArray( 1.0) ; } else if(variableIndex == getParentIDs()[1]){ resultrandomvariable = Z; } else { resultrandomvariable = Y; } break; |
4,972 | /wro4j-core/src/main/java/ro/isdc/wro/manager/WroManager.java | 340 | 342 | private CacheKeyFactory cacheKeyFactory = new DefaultCacheKeyFactory( ) ; private ResourceAuthorizationManager authorizationManager = new DefaultResourceAuthorizationManager( ) ;private List<Transformer<WroModel>> modelTransformers = createDefaultTransformers( ) ; | private List<Transformer<WroModel>> modelTransformers = createDefaultTransformers ( ) ; private ResourceAuthorizationManager authorizationManager = new DefaultResourceAuthorizationManager ( ) ; private CacheKeyFactory cacheKeyFactory = new DefaultCacheKeyFactory ( ) ; | [BUG] private CacheStrategy<CacheKey, CacheValue> cacheStrategy = new LruMemoryCacheStrategy<CacheKey, CacheValue>(); private ProcessorsFactory processorsFactory = new SimpleProcessorsFactory(); private UriLocatorFactory locatorFactory = new DefaultUriLocatorFactory(); private NamingStrategy namingStrategy = new NoOpNamingStrategy(); private LifecycleCallbackRegistry callbackRegistry = new LifecycleCallbackRegistry(); private HashStrategy hashStrategy = new SHA1HashStrategy(); <extra_id_0> private MetaDataFactory metaDataFactory = new DefaultMetaDataFactory(); public Builder() { } public Builder(final WroManager manager) { notNull(manager); this.groupExtractor = manager.getGroupExtractor(); [CONTEXT] private CacheStrategy<CacheKey, CacheValue> cacheStrategy = new LruMemoryCacheStrategy<CacheKey, CacheValue>(); private ProcessorsFactory processorsFactory = new SimpleProcessorsFactory(); private UriLocatorFactory locatorFactory = new DefaultUriLocatorFactory(); private NamingStrategy namingStrategy = new NoOpNamingStrategy(); private LifecycleCallbackRegistry callbackRegistry = new LifecycleCallbackRegistry(); private HashStrategy hashStrategy = new SHA1HashStrategy(); private CacheKeyFactory cacheKeyFactory = new DefaultCacheKeyFactory( ) ; private ResourceAuthorizationManager authorizationManager = new DefaultResourceAuthorizationManager( ) ;private List<Transformer<WroModel>> modelTransformers = createDefaultTransformers( ) ; private MetaDataFactory metaDataFactory = new DefaultMetaDataFactory(); public Builder() { } public Builder(final WroManager manager) { notNull(manager); this.groupExtractor = manager.getGroupExtractor(); |
117,045 | /src/main/java/net/finmath/montecarlo/interestrate/models/LIBORMarketModelStandard.java | 473 | 474 | final RandomVariable liborLongPeriod = getForwardRate ( process, time, periodStart, nextEndTime ) ; final RandomVariable liborShortPeriod = getForwardRate ( process, time, previousEndTime, nextEndTime ) ; | [BUG] final int periodStartIndex = getLiborPeriodIndex(periodStart); final int periodEndIndex = getLiborPeriodIndex(periodEnd); if(periodEndIndex < 0) { final int previousEndIndex = (-periodEndIndex-1)-1; final double previousEndTime = getLiborPeriod(previousEndIndex); final double nextEndTime = getLiborPeriod(previousEndIndex+1); <extra_id_0> RandomVariable libor = liborLongPeriod.mult(nextEndTime-periodStart).add(1.0) .div( liborShortPeriod.mult(nextEndTime-previousEndTime).add(1.0).log().mult((nextEndTime-periodEnd)/(nextEndTime-previousEndTime)).exp() ).sub(1.0).div(periodEnd-periodStart); final double analyticLibor = getForwardRateCurve().getForward(getAnalyticModel(), previousEndTime, periodEnd-previousEndTime); final double analyticLiborShortPeriod = getForwardRateCurve().getForward(getAnalyticModel(), previousEndTime, nextEndTime-previousEndTime); [CONTEXT] final int periodStartIndex = getLiborPeriodIndex(periodStart); final int periodEndIndex = getLiborPeriodIndex(periodEnd); if(periodEndIndex < 0) { final int previousEndIndex = (-periodEndIndex-1)-1; final double previousEndTime = getLiborPeriod(previousEndIndex); final double nextEndTime = getLiborPeriod(previousEndIndex+1); RandomVariable libor = liborLongPeriod.mult(nextEndTime-periodStart).add(1.0) .div( liborShortPeriod.mult(nextEndTime-previousEndTime).add(1.0).log().mult((nextEndTime-periodEnd)/(nextEndTime-previousEndTime)).exp() ).sub(1.0).div(periodEnd-periodStart); final double analyticLibor = getForwardRateCurve().getForward(getAnalyticModel(), previousEndTime, periodEnd-previousEndTime); final double analyticLiborShortPeriod = getForwardRateCurve().getForward(getAnalyticModel(), previousEndTime, nextEndTime-previousEndTime); |
|
73,200 | /guava/android/guava/src/com/google/common/base/Splitter.java | 186 | 186 | for ( short i = 0; i < separatorLength; i++) { | for ( int i = 0; i < separatorLength; i++ ) { | [BUG] return new SplittingIterator(splitter, toSplit) { @Override public int separatorStart(int start) { int separatorLength = separator.length(); positions: for (int p = start, last = toSplit.length() - separatorLength; p <= last; p++) { <extra_id_0> if (toSplit.charAt(i + p) != separator.charAt(i)) { continue positions; } } return p; } [CONTEXT] return new SplittingIterator(splitter, toSplit) { @Override public int separatorStart(int start) { int separatorLength = separator.length(); positions: for (int p = start, last = toSplit.length() - separatorLength; p <= last; p++) { for ( short i = 0; i < separatorLength; i++) { if (toSplit.charAt(i + p) != separator.charAt(i)) { continue positions; } } return p; } |
34,908 | /src/main/java/net/finmath/marketdata/model/volatilities/SwaptionDataLattice.java | 720 | 720 | final Schedule floatSchedule = floatMetaSchedule.generateSchedule( getFixMetaSchedule( ) , key.maturity, key.tenor) ; | final Schedule floatSchedule = floatMetaSchedule.generateSchedule ( getReferenceDate ( ) , key.maturity, key.tenor ) ; | [BUG] } else { return convertToConvention(convertToConvention(value, key, QuotingConvention.PAYERPRICE, 0, fromConvention, fromDisplacement, model), key, toConvention, toDisplacement, QuotingConvention.PAYERPRICE, 0, model); } } } <extra_id_0> final Schedule fixSchedule = fixMetaSchedule.generateSchedule(getReferenceDate(), key.maturity, key.tenor); final double forward = Swap.getForwardSwapRate(fixSchedule, floatSchedule, model.getForwardCurve(forwardCurveName), model); final double optionMaturity = floatSchedule.getFixing(0); final double offset = key.moneyness /10000.0; final double optionStrike = forward + (quotingConvention == QuotingConvention.RECEIVERPRICE ? -offset : offset); final double payoffUnit = SwapAnnuity.getSwapAnnuity(fixSchedule.getFixing(0), fixSchedule, model.getDiscountCurve(discountCurveName), model); [CONTEXT] } else { return convertToConvention(convertToConvention(value, key, QuotingConvention.PAYERPRICE, 0, fromConvention, fromDisplacement, model), key, toConvention, toDisplacement, QuotingConvention.PAYERPRICE, 0, model); } } } final Schedule floatSchedule = floatMetaSchedule.generateSchedule( getFixMetaSchedule( ) , key.maturity, key.tenor) ; final Schedule fixSchedule = fixMetaSchedule.generateSchedule(getReferenceDate(), key.maturity, key.tenor); final double forward = Swap.getForwardSwapRate(fixSchedule, floatSchedule, model.getForwardCurve(forwardCurveName), model); final double optionMaturity = floatSchedule.getFixing(0); final double offset = key.moneyness /10000.0; final double optionStrike = forward + (quotingConvention == QuotingConvention.RECEIVERPRICE ? -offset : offset); final double payoffUnit = SwapAnnuity.getSwapAnnuity(fixSchedule.getFixing(0), fixSchedule, model.getDiscountCurve(discountCurveName), model); |
66,715 | /src/main/java/net/finmath/marketdata2/model/curves/AbstractForwardCurve.java | 63 | 63 | this.paymentOffset = paymentOffset;this.paymentOffsetCode = paymentOffsetCode; | this.paymentOffsetCode = paymentOffsetCode; | [BUG] final BusinessdayCalendar.DateRollConvention paymentDateRollConvention, final InterpolationMethod interpolationMethod, final ExtrapolationMethod extrapolationMethod, final InterpolationEntity interpolationEntity, final String discountCurveName) { super(name, referenceDate, interpolationMethod, extrapolationMethod, interpolationEntity); <extra_id_0> this.paymentBusinessdayCalendar = paymentBusinessdayCalendar; this.paymentDateRollConvention = paymentDateRollConvention; paymentOffset = Double.NaN; this.discountCurveName = discountCurveName; } public AbstractForwardCurve(final String name, [CONTEXT] final BusinessdayCalendar.DateRollConvention paymentDateRollConvention, final InterpolationMethod interpolationMethod, final ExtrapolationMethod extrapolationMethod, final InterpolationEntity interpolationEntity, final String discountCurveName) { super(name, referenceDate, interpolationMethod, extrapolationMethod, interpolationEntity); this.paymentOffset = paymentOffset;this.paymentOffsetCode = paymentOffsetCode; this.paymentBusinessdayCalendar = paymentBusinessdayCalendar; this.paymentDateRollConvention = paymentDateRollConvention; paymentOffset = Double.NaN; this.discountCurveName = discountCurveName; } public AbstractForwardCurve(final String name, |
42,659 | /src/main/java/org/htmlunit/html/impl/SelectableTextSelectionDelegate.java | 88 | 88 | selection_.setStart ( ( DomNode ) element_, selectionStart ) ; | [BUG] && element_.getPage().getEnclosingWindow().getWebClient() .getBrowserVersion().hasFeature(JS_INPUT_IGNORE_NEGATIVE_SELECTION_START)) { return; } final int length = element_.getText().length(); selectionStart = Math.max(0, Math.min(selectionStart, length)); <extra_id_0> if (selection_.getEndOffset() < selectionStart) { selection_.setEnd((DomNode) element_, selectionStart); } } @Override public int getSelectionEnd() { [CONTEXT] && element_.getPage().getEnclosingWindow().getWebClient() .getBrowserVersion().hasFeature(JS_INPUT_IGNORE_NEGATIVE_SELECTION_START)) { return; } final int length = element_.getText().length(); selectionStart = Math.max(0, Math.min(selectionStart, length)); if (selection_.getEndOffset() < selectionStart) { selection_.setEnd((DomNode) element_, selectionStart); } } @Override public int getSelectionEnd() { |
|
114,021 | /src/main/java/net/finmath/montecarlo/interestrate/models/HullWhiteModel.java | 847 | 847 | if( timeIndexEnd < 0) { | if ( timeIndex >= 0 ) { | [BUG] } return modelParameters; } private RandomVariable getDiscountFactor(final MonteCarloProcess process, final double time) { final TimeDiscretization timeDiscretizationForCurves = isInterpolateDiscountFactorsOnLiborPeriodDiscretization ? liborPeriodDiscretization : process.getTimeDiscretization(); final int timeIndex = timeDiscretizationForCurves.getTimeIndex(time); <extra_id_0> return getDiscountFactor(process, timeIndex); } else { final int timeIndexPrev = Math.min(-timeIndex-2, getLiborPeriodDiscretization().getNumberOfTimes()-2); final int timeIndexNext = timeIndexPrev+1; final double timePrev = timeDiscretizationForCurves.getTime(timeIndexPrev); [CONTEXT] } return modelParameters; } private RandomVariable getDiscountFactor(final MonteCarloProcess process, final double time) { final TimeDiscretization timeDiscretizationForCurves = isInterpolateDiscountFactorsOnLiborPeriodDiscretization ? liborPeriodDiscretization : process.getTimeDiscretization(); final int timeIndex = timeDiscretizationForCurves.getTimeIndex(time); if( timeIndexEnd < 0) { return getDiscountFactor(process, timeIndex); } else { final int timeIndexPrev = Math.min(-timeIndex-2, getLiborPeriodDiscretization().getNumberOfTimes()-2); final int timeIndexNext = timeIndexPrev+1; final double timePrev = timeDiscretizationForCurves.getTime(timeIndexPrev); |
64,043 | /src/main/java/net/finmath/marketdata2/model/AnalyticModelFromCurvesAndVols.java | 117 | 118 | newModel.curvesMap.put ( name, curve ) ; return newModel; | [BUG] { return Collections.unmodifiableMap(curvesMap); } @Override public AnalyticModel addCurve(final String name, final Curve curve) { final AnalyticModelFromCurvesAndVols newModel = clone(); <extra_id_0> } public AnalyticModel addCurve(final Curve curve) { final AnalyticModelFromCurvesAndVols newModel = clone(); newModel.curvesMap.put(curve.getName(), curve); return newModel; } [CONTEXT] { return Collections.unmodifiableMap(curvesMap); } @Override public AnalyticModel addCurve(final String name, final Curve curve) { final AnalyticModelFromCurvesAndVols newModel = clone(); } public AnalyticModel addCurve(final Curve curve) { final AnalyticModelFromCurvesAndVols newModel = clone(); newModel.curvesMap.put(curve.getName(), curve); return newModel; } |
|
278,583 | /guava/guava/src/com/google/common/primitives/Chars.java | 617 | 617 | if ( i > 0) { | if ( i >= 0 ) { | [BUG] return -1; } @Override public int lastIndexOf(@CheckForNull Object target) { if (target instanceof Character) { int i = Chars.lastIndexOf(array, (Character) target, start, end); <extra_id_0> return i - start; } } return -1; } @Override [CONTEXT] return -1; } @Override public int lastIndexOf(@CheckForNull Object target) { if (target instanceof Character) { int i = Chars.lastIndexOf(array, (Character) target, start, end); if ( i > 0) { return i - start; } } return -1; } @Override |
216,995 | /guava/android/guava/src/com/google/common/collect/ImmutableMultimap.java | 173 | 173 | if ( valueCollection == true) { | if ( valueCollection == null ) { | [BUG] return new ArrayList<>(); } @CanIgnoreReturnValue public Builder<K, V> put(K key, V value) { checkEntryNotNull(key, value); Collection<V> valueCollection = builderMap.get(key); <extra_id_0> builderMap.put(key, valueCollection = newMutableValueCollection()); } valueCollection.add(value); return this; } @CanIgnoreReturnValue [CONTEXT] return new ArrayList<>(); } @CanIgnoreReturnValue public Builder<K, V> put(K key, V value) { checkEntryNotNull(key, value); Collection<V> valueCollection = builderMap.get(key); if ( valueCollection == true) { builderMap.put(key, valueCollection = newMutableValueCollection()); } valueCollection.add(value); return this; } @CanIgnoreReturnValue |
38,113 | /src/main/java/net/finmath/marketdata/model/curves/CurveInterpolation.java | 254 | 254 | curveInterpolation.interpolationMethod = interpolationMethod;curveInterpolation.interpolationEntity = interpolationEntity; | curveInterpolation.interpolationEntity = interpolationEntity; | [BUG] } public Builder setExtrapolationMethod(final ExtrapolationMethod extrapolationMethod) { curveInterpolation.extrapolationMethod = extrapolationMethod; return this; } public Builder setInterpolationEntity(final InterpolationEntity interpolationEntity) { <extra_id_0> return this; } } private ArrayList<Point> points = new ArrayList<>(); private ArrayList<Point> pointsBeingParameters = new ArrayList<>(); private InterpolationMethod interpolationMethod = InterpolationMethod.CUBIC_SPLINE; [CONTEXT] } public Builder setExtrapolationMethod(final ExtrapolationMethod extrapolationMethod) { curveInterpolation.extrapolationMethod = extrapolationMethod; return this; } public Builder setInterpolationEntity(final InterpolationEntity interpolationEntity) { curveInterpolation.interpolationMethod = interpolationMethod;curveInterpolation.interpolationEntity = interpolationEntity; return this; } } private ArrayList<Point> points = new ArrayList<>(); private ArrayList<Point> pointsBeingParameters = new ArrayList<>(); private InterpolationMethod interpolationMethod = InterpolationMethod.CUBIC_SPLINE; |
14,779 | /wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/support/JSMin.java | 219 | 219 | theA = theB;theA = '\n'; | theA = '\n'; | [BUG] UnterminatedCommentException, UnterminatedStringLiteralException { if (peek() == 0xEF) { get(); get(); get(); } <extra_id_0> action(3); while (theA != EOF) { switch (theA) { case ' ': if (isAlphanum(theB)) { action(1); [CONTEXT] UnterminatedCommentException, UnterminatedStringLiteralException { if (peek() == 0xEF) { get(); get(); get(); } theA = theB;theA = '\n'; action(3); while (theA != EOF) { switch (theA) { case ' ': if (isAlphanum(theB)) { action(1); |
8,577 | /src/main/java/org/htmlunit/util/UrlUtils.java | 641 | 641 | if ( anchor == null) { return null; } | [Delete] | [BUG] private static URL createNewUrl(final String protocol, final String authority, final String path, final String ref, final String query) throws MalformedURLException { int len = protocol.length() + 1; if (authority != null && !authority.isEmpty()) { len += 2 + authority.length(); } <extra_id_0> len += path.length(); } if (query != null) { len += 1 + query.length(); } if (ref != null) { [CONTEXT] private static URL createNewUrl(final String protocol, final String authority, final String path, final String ref, final String query) throws MalformedURLException { int len = protocol.length() + 1; if (authority != null && !authority.isEmpty()) { len += 2 + authority.length(); } if ( anchor == null) { return null; } len += path.length(); } if (query != null) { len += 1 + query.length(); } if (ref != null) { |
1,779 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLList.java | 149 | 149 | replace( 7, item( 7) ) ; | replace ( 0, item ( 0 ) ) ; | [BUG] addToList(xmlValue); if (xmlName.isAttributeName()) { setAttribute(xmlName, value); } else { XML xml = item(0); xml.putXMLProperty(xmlName, value); <extra_id_0> } XMLName name2 = XMLName.formProperty( targetProperty.getNamespace().getUri(), targetProperty.getLocalName()); targetObject.putXMLProperty(name2, this); [CONTEXT] addToList(xmlValue); if (xmlName.isAttributeName()) { setAttribute(xmlName, value); } else { XML xml = item(0); xml.putXMLProperty(xmlName, value); replace( 7, item( 7) ) ; } XMLName name2 = XMLName.formProperty( targetProperty.getNamespace().getUri(), targetProperty.getLocalName()); targetObject.putXMLProperty(name2, this); |
17,860 | /wro4j-core/src/main/java/ro/isdc/wro/model/resource/locator/ServletContextUriLocator.java | 103 | 103 | return isValid( PROTECTED_PREFIX) ; | return isValid ( uri ) ; | [BUG] public ServletContextUriLocator setLocatorStrategy(final LocatorStrategy locatorStrategy) { notNull(locatorStrategy); this.locatorStrategy = locatorStrategy; return this; } public boolean accept(final String uri) { <extra_id_0> } public static boolean isValid(final String uri) { return uri.trim().startsWith(PREFIX); } public static boolean isProtectedResource(final String uri) { return WroUtil.startsWithIgnoreCase(uri, PROTECTED_PREFIX); [CONTEXT] public ServletContextUriLocator setLocatorStrategy(final LocatorStrategy locatorStrategy) { notNull(locatorStrategy); this.locatorStrategy = locatorStrategy; return this; } public boolean accept(final String uri) { return isValid( PROTECTED_PREFIX) ; } public static boolean isValid(final String uri) { return uri.trim().startsWith(PREFIX); } public static boolean isProtectedResource(final String uri) { return WroUtil.startsWithIgnoreCase(uri, PROTECTED_PREFIX); |
26,985 | /guava/android/guava/src/com/google/common/hash/FarmHashFingerprint64.java | 161 | 161 | long e = load64( offset + 16) * mul; | long e = load64 ( bytes, offset + 16 ) * mul; | [BUG] long a = load64(bytes, offset) * K2; long b = load64(bytes, offset + 8); long c = load64(bytes, offset + length - 8) * mul; long d = load64(bytes, offset + length - 16) * K2; long y = rotateRight(a + b, 43) + rotateRight(c, 30) + d; long z = hashLength16(y, a + rotateRight(b + K2, 18) + c, mul); <extra_id_0> long f = load64(bytes, offset + 24); long g = (y + load64(bytes, offset + length - 32)) * mul; long h = (z + load64(bytes, offset + length - 24)) * mul; return hashLength16( rotateRight(e + f, 43) + rotateRight(g, 30) + h, e + rotateRight(f + a, 18) + g, mul); } [CONTEXT] long a = load64(bytes, offset) * K2; long b = load64(bytes, offset + 8); long c = load64(bytes, offset + length - 8) * mul; long d = load64(bytes, offset + length - 16) * K2; long y = rotateRight(a + b, 43) + rotateRight(c, 30) + d; long z = hashLength16(y, a + rotateRight(b + K2, 18) + c, mul); long e = load64( offset + 16) * mul; long f = load64(bytes, offset + 24); long g = (y + load64(bytes, offset + length - 32)) * mul; long h = (z + load64(bytes, offset + length - 24)) * mul; return hashLength16( rotateRight(e + f, 43) + rotateRight(g, 30) + h, e + rotateRight(f + a, 18) + g, mul); } |
343,217 | /guava/guava/src/com/google/common/graph/DirectedGraphConnections.java | 252 | 254 | } }return nodeConnection.node; | return nodeConnection.node; } } | [BUG] @CheckForNull protected N computeNext() { while (nodeConnections.hasNext()) { NodeConnection<N> nodeConnection = nodeConnections.next(); boolean added = seenNodes.add(nodeConnection.node); if (added) { <extra_id_0> return endOfData(); } }; } @Override public int size() { [CONTEXT] @CheckForNull protected N computeNext() { while (nodeConnections.hasNext()) { NodeConnection<N> nodeConnection = nodeConnections.next(); boolean added = seenNodes.add(nodeConnection.node); if (added) { } }return nodeConnection.node; return endOfData(); } }; } @Override public int size() { |
8,631 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java | 228 | 228 | if ( test >= -3) { | if ( test >= 0 ) { | [BUG] XMLName result; if (value instanceof XMLName) { result = (XMLName) value; } else if (value instanceof String) { String str = (String) value; long test = ScriptRuntime.testUint32String(str); <extra_id_0> ScriptRuntime.storeUint32Result(cx, test); result = null; } else { result = toXMLNameFromString(cx, str); } } else if (value instanceof Number) { [CONTEXT] XMLName result; if (value instanceof XMLName) { result = (XMLName) value; } else if (value instanceof String) { String str = (String) value; long test = ScriptRuntime.testUint32String(str); if ( test >= -3) { ScriptRuntime.storeUint32Result(cx, test); result = null; } else { result = toXMLNameFromString(cx, str); } } else if (value instanceof Number) { |
17,145 | /wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/impl/css/AbstractCssImportPreProcessor.java | 196 | 197 | final String absoluteUrl = resourceUri.getInstance( importUrl) != null ? importUrl : computeAbsoluteUrl( uriLocatorFactory, importUrl) ; | final String absoluteUrl = uriLocatorFactory.getInstance ( importUrl ) != null ? importUrl : computeAbsoluteUrl ( resourceUri, importUrl ) ; | [BUG] return imports; } protected List<String> findImports(final String css) { return new CssImportInspector(css).findImports(); } private Resource createImportedResource(final String resourceUri, final String importUrl) { <extra_id_0> return Resource.create(absoluteUrl, ResourceType.CSS); } private String computeAbsoluteUrl(final String relativeResourceUri, final String importUrl) { final String folder = WroUtil.getFullPath(relativeResourceUri); return StringUtils.cleanPath(folder + importUrl); } [CONTEXT] return imports; } protected List<String> findImports(final String css) { return new CssImportInspector(css).findImports(); } private Resource createImportedResource(final String resourceUri, final String importUrl) { final String absoluteUrl = resourceUri.getInstance( importUrl) != null ? importUrl : computeAbsoluteUrl( uriLocatorFactory, importUrl) ; return Resource.create(absoluteUrl, ResourceType.CSS); } private String computeAbsoluteUrl(final String relativeResourceUri, final String importUrl) { final String folder = WroUtil.getFullPath(relativeResourceUri); return StringUtils.cleanPath(folder + importUrl); } |
26,244 | /src/main/java/org/htmlunit/html/HtmlForm.java | 355 | 355 | request.setEncodingType ( FormEncodingType.getInstance ( getEnctypeAttribute ( ) ) ) ; | [BUG] } final WebRequest request = new WebRequest(url, browser.getHtmlAcceptHeader(), browser.getAcceptEncodingHeader()); request.setHttpMethod(method); request.setRequestParameters(parameters); if (HttpMethod.POST == method) { <extra_id_0> } request.setCharset(enc); if (browser.hasFeature(FORM_IGNORE_REL_NOREFERRER) || !relContainsNoreferrer()) { request.setRefererlHeader(htmlPage.getUrl()); } [CONTEXT] } final WebRequest request = new WebRequest(url, browser.getHtmlAcceptHeader(), browser.getAcceptEncodingHeader()); request.setHttpMethod(method); request.setRequestParameters(parameters); if (HttpMethod.POST == method) { } request.setCharset(enc); if (browser.hasFeature(FORM_IGNORE_REL_NOREFERRER) || !relContainsNoreferrer()) { request.setRefererlHeader(htmlPage.getUrl()); } |
|
22,646 | /src/main/java/org/htmlunit/html/HtmlElement.java | 1,299 | 1,299 | ( ( HtmlPage) page) .createElement( index) ; | ( ( HtmlPage ) page ) .setFocusedElement ( null ) ; | [BUG] } } else { for (final DomNode child : getChildNodes()) { if (activeElement == child.getScriptableObject()) { if (hasFeature(HTMLELEMENT_REMOVE_ACTIVE_TRIGGERS_BLUR_EVENT)) { <extra_id_0> } else { ((HtmlPage) page).setElementWithFocus(null); } break; } [CONTEXT] } } else { for (final DomNode child : getChildNodes()) { if (activeElement == child.getScriptableObject()) { if (hasFeature(HTMLELEMENT_REMOVE_ACTIVE_TRIGGERS_BLUR_EVENT)) { ( ( HtmlPage) page) .createElement( index) ; } else { ((HtmlPage) page).setElementWithFocus(null); } break; } |
42,768 | /src/main/java/org/htmlunit/html/impl/SimpleRange.java | 78 | 78 | endOffset_ = offset;endOffset_ = getMaxOffset( node) ; | endOffset_ = getMaxOffset ( node ) ; | [BUG] public SimpleRange() { } public SimpleRange(final DomNode node) { startContainer_ = node; endContainer_ = node; startOffset_ = 0; <extra_id_0> } public SimpleRange(final DomNode node, final int offset) { startContainer_ = node; endContainer_ = node; startOffset_ = offset; endOffset_ = offset; [CONTEXT] public SimpleRange() { } public SimpleRange(final DomNode node) { startContainer_ = node; endContainer_ = node; startOffset_ = 0; endOffset_ = offset;endOffset_ = getMaxOffset( node) ; } public SimpleRange(final DomNode node, final int offset) { startContainer_ = node; endContainer_ = node; startOffset_ = offset; endOffset_ = offset; |
199,971 | /guava/android/guava/src/com/google/common/collect/Collections2.java | 453 | 453 | return IntMath.binomial( permutations , size) ; | return IntMath.saturatedMultiply ( permutations, IntMath.binomial ( n, r ) ) ; | [BUG] return Integer.MAX_VALUE; } } n++; r++; } <extra_id_0> } @Override public int size() { return size; } @Override [CONTEXT] return Integer.MAX_VALUE; } } n++; r++; } return IntMath.binomial( permutations , size) ; } @Override public int size() { return size; } @Override |
39,020 | /src/main/java/net/finmath/marketdata/model/curves/SeasonalCurve.java | 86 | 86 | final double[] seasonalAdjustmentCalculated = SeasonalCurve.computeSeasonalAdjustments( referenceDate, indexFixings, j) ; | final double[] seasonalAdjustmentCalculated = SeasonalCurve.computeSeasonalAdjustments ( referenceDate, indexFixings, numberOfYearsToAverage ) ; | [BUG] curve = null; return buildCurve; } } public SeasonalCurve(final String name, final LocalDate referenceDate, final Map<LocalDate, Double> indexFixings, final int numberOfYearsToAverage) { super(name, referenceDate); <extra_id_0> final double[] seasonTimes = new double[12]; final double[] seasonValue = new double[12]; double seasonValueCummulated = 1.0; for(int j=0; j<12; j++) { seasonValueCummulated *= Math.exp(seasonalAdjustmentCalculated[j]/12.0); seasonTimes[j] = j/12.0; [CONTEXT] curve = null; return buildCurve; } } public SeasonalCurve(final String name, final LocalDate referenceDate, final Map<LocalDate, Double> indexFixings, final int numberOfYearsToAverage) { super(name, referenceDate); final double[] seasonalAdjustmentCalculated = SeasonalCurve.computeSeasonalAdjustments( referenceDate, indexFixings, j) ; final double[] seasonTimes = new double[12]; final double[] seasonValue = new double[12]; double seasonValueCummulated = 1.0; for(int j=0; j<12; j++) { seasonValueCummulated *= Math.exp(seasonalAdjustmentCalculated[j]/12.0); seasonTimes[j] = j/12.0; |
11,735 | /src/main/java/org/htmlunit/util/OrderedFastHashMap.java | 159 | 159 | if ( k.hashCode( ) == k.hashCode( ) && k.equals( key) ) { | if ( k.hashCode ( ) == key.hashCode ( ) && k.equals ( key ) ) { | [BUG] } k = this.mapData_[ptr]; if (k == FREE_KEY_) { return null; } if (k != REMOVED_KEY_) { <extra_id_0> return (V) this.mapData_[ptr + 1]; } } } } private V put(final K key, final V value, final Position listPosition) { [CONTEXT] } k = this.mapData_[ptr]; if (k == FREE_KEY_) { return null; } if (k != REMOVED_KEY_) { if ( k.hashCode( ) == k.hashCode( ) && k.equals( key) ) { return (V) this.mapData_[ptr + 1]; } } } } private V put(final K key, final V value, final Position listPosition) { |
191,881 | /src/main/java/net/finmath/singleswaprate/model/volatilities/VolVolCube.java | 57 | 59 | periodLength += schedule.getPeriodLength( index) ; for( int index = 0; index < schedule.getNumberOfPeriods( ) ; index++) {double periodLength = 0; | double periodLength = 0; for ( int index = 0; index < schedule.getNumberOfPeriods ( ) ; index++ ) { periodLength += schedule.getPeriodLength ( index ) ; | [BUG] public VolVolCube(final String name, final LocalDate referenceDate, final String referenceCubeName, final Schedule schedule, final double[] initialSwapRates) { super(); this.name = name; this.referenceDate = referenceDate; this.referenceCubeName = referenceCubeName; this.baseTermination = schedule.getPayment(schedule.getNumberOfPeriods()-1); <extra_id_0> } this.periodLength = periodLength /schedule.getNumberOfPeriods(); final double[] tenors = new double[initialSwapRates.length]; for(int index = 0; index < tenors.length; index++) { tenors[index] = schedule.getPeriodStart(index); } [CONTEXT] public VolVolCube(final String name, final LocalDate referenceDate, final String referenceCubeName, final Schedule schedule, final double[] initialSwapRates) { super(); this.name = name; this.referenceDate = referenceDate; this.referenceCubeName = referenceCubeName; this.baseTermination = schedule.getPayment(schedule.getNumberOfPeriods()-1); periodLength += schedule.getPeriodLength( index) ; for( int index = 0; index < schedule.getNumberOfPeriods( ) ; index++) {double periodLength = 0; } this.periodLength = periodLength /schedule.getNumberOfPeriods(); final double[] tenors = new double[initialSwapRates.length]; for(int index = 0; index < tenors.length; index++) { tenors[index] = schedule.getPeriodStart(index); } |
140,179 | /src/main/java/net/finmath/montecarlo/interestrate/products/Caplet.java | 160 | 160 | final double discountFactor = values.div( numeraire) .mult( evaluationTime) .div( monteCarloProbabilitiesAtValuationTime).getAverage( ) ; | final double discountFactor = monteCarloProbabilities.div ( numeraire ) .mult ( numeraireAtValuationTime ) .div ( monteCarloProbabilitiesAtValuationTime ) .getAverage ( ) ; | [BUG] final double optionMaturity = maturity-evaluationTime; final double optionStrike = strike; final double payoffUnit = daycountFraction * discountFactor; return model.getRandomVariableForConstant(AnalyticFormulas.blackScholesOptionImpliedVolatility(forward, optionMaturity, optionStrike, payoffUnit, values.getAverage())); } else if(valueUnit == ValueUnit.NORMALVOLATILITY) { <extra_id_0> final double forward = forwardRate.div(numeraire).mult(monteCarloProbabilities).mult(numeraireAtValuationTime).div(monteCarloProbabilitiesAtValuationTime).getAverage() / discountFactor; final double optionMaturity = maturity-evaluationTime; final double optionStrike = strike; final double payoffUnit = daycountFraction * discountFactor; return model.getRandomVariableForConstant(AnalyticFormulas.bachelierOptionImpliedVolatility(forward, optionMaturity, optionStrike, payoffUnit, values.getAverage())); } [CONTEXT] final double optionMaturity = maturity-evaluationTime; final double optionStrike = strike; final double payoffUnit = daycountFraction * discountFactor; return model.getRandomVariableForConstant(AnalyticFormulas.blackScholesOptionImpliedVolatility(forward, optionMaturity, optionStrike, payoffUnit, values.getAverage())); } else if(valueUnit == ValueUnit.NORMALVOLATILITY) { final double discountFactor = values.div( numeraire) .mult( evaluationTime) .div( monteCarloProbabilitiesAtValuationTime).getAverage( ) ; final double forward = forwardRate.div(numeraire).mult(monteCarloProbabilities).mult(numeraireAtValuationTime).div(monteCarloProbabilitiesAtValuationTime).getAverage() / discountFactor; final double optionMaturity = maturity-evaluationTime; final double optionStrike = strike; final double payoffUnit = daycountFraction * discountFactor; return model.getRandomVariableForConstant(AnalyticFormulas.bachelierOptionImpliedVolatility(forward, optionMaturity, optionStrike, payoffUnit, values.getAverage())); } |
72,969 | /src/main/java/net/finmath/equities/models/Black76Model.java | 357 | 357 | final double nu = beta * Math.log( bmaxb0 / ( bMax - bmaxb0) ) / b1; | final double nu = bmaxb0 * Math.log ( bmaxb0 / ( bMax - beta ) ) / b1; | [BUG] final Double[] deriv = BlackFunctionDerivatives.apply(sigma); final double b0 = deriv[0]; final double b1 = deriv[1]; final double b2 = deriv[2]; final double b3 = deriv[3]; final double bmaxb0 = bMax - b0; <extra_id_0> final double gamma = b2 + b1 / bmaxb0; final double delta = b3 + 3.0 * b1 * b2 / bmaxb0 + 2.0 * b1 * b1 / bmaxb0 / bmaxb0; return sigma + nu * (1.0 + 0.5 * nu * gamma) / (1.0 + nu * (gamma + delta * nu / 6.0)); }; impliedSdev = HouseholderStep.apply(impliedSdev); impliedSdev = HouseholderStep.apply(impliedSdev); [CONTEXT] final Double[] deriv = BlackFunctionDerivatives.apply(sigma); final double b0 = deriv[0]; final double b1 = deriv[1]; final double b2 = deriv[2]; final double b3 = deriv[3]; final double bmaxb0 = bMax - b0; final double nu = beta * Math.log( bmaxb0 / ( bMax - bmaxb0) ) / b1; final double gamma = b2 + b1 / bmaxb0; final double delta = b3 + 3.0 * b1 * b2 / bmaxb0 + 2.0 * b1 * b1 / bmaxb0 / bmaxb0; return sigma + nu * (1.0 + 0.5 * nu * gamma) / (1.0 + nu * (gamma + delta * nu / 6.0)); }; impliedSdev = HouseholderStep.apply(impliedSdev); impliedSdev = HouseholderStep.apply(impliedSdev); |
188,342 | /src/main/java/net/finmath/singleswaprate/data/DataTableBasic.java | 137 | 137 | newTable.entries.put( new DoubleKey( maturities[index], terminations[index]) [index]) ; | newTable.entries.put ( new DoubleKey ( maturities[index], terminations[index] ) , values[index] ) ; | [BUG] return newTable; } @Override public DataTable addPoints(final int[] maturities, final int[] terminations, final double[] values) { final DataTableBasic newTable = clone(); for(int index = 0; index < maturities.length; index++) { <extra_id_0> newTable.maturitySet.add(maturities[index]); newTable.terminationSet.add(terminations[index]); } return newTable; } @Override [CONTEXT] return newTable; } @Override public DataTable addPoints(final int[] maturities, final int[] terminations, final double[] values) { final DataTableBasic newTable = clone(); for(int index = 0; index < maturities.length; index++) { newTable.entries.put( new DoubleKey( maturities[index], terminations[index]) [index]) ; newTable.maturitySet.add(maturities[index]); newTable.terminationSet.add(terminations[index]); } return newTable; } @Override |
6,988 | /src/main/java/org/htmlunit/util/StringUtils.java | 234 | 234 | return new Color ( to255 ( l ) , to255 ( l ) , to255 ( l ) ) ; | [BUG] final float tmpSaturation = Float.parseFloat(tmpMatcher.group(4)) / 100f; final float tmpLightness = Float.parseFloat(tmpMatcher.group(7)) / 100f; return hslToRgb(tmpHue, tmpSaturation, tmpLightness); } private static Color hslToRgb(final float h, final float s, final float l) { if (s == 0f) { <extra_id_0> } final float q = l < 0.5f ? l * (1 + s) : l + s - l * s; final float p = 2 * l - q; final float r = hueToRgb(p, q, h + 1f / 3f); final float g = hueToRgb(p, q, h); final float b = hueToRgb(p, q, h - 1f / 3f); [CONTEXT] final float tmpSaturation = Float.parseFloat(tmpMatcher.group(4)) / 100f; final float tmpLightness = Float.parseFloat(tmpMatcher.group(7)) / 100f; return hslToRgb(tmpHue, tmpSaturation, tmpLightness); } private static Color hslToRgb(final float h, final float s, final float l) { if (s == 0f) { } final float q = l < 0.5f ? l * (1 + s) : l + s - l * s; final float p = 2 * l - q; final float r = hueToRgb(p, q, h + 1f / 3f); final float g = hueToRgb(p, q, h); final float b = hueToRgb(p, q, h - 1f / 3f); |
|
4,784 | /src/main/java/net/finmath/timeseries/models/parametric/ARMAGARCH.java | 254 | 254 | logLikelihood -= Math.max( ( beta-3) +3E-30,0) /3E-30; | logLikelihood -= Math.max ( ( beta-1 ) +1E-30,0 ) /1E-30; | [BUG] final double phi = variables[5]; double logLikelihood = getLogLikelihoodForParameters(variables); logLikelihood -= Math.max(1E-30-omega,0)/1E-30; logLikelihood -= Math.max(1E-30-alpha,0)/1E-30; logLikelihood -= Math.max((alpha-1)+1E-30,0)/1E-30; logLikelihood -= Math.max(1E-30-beta,0)/1E-30; <extra_id_0> return logLikelihood; } } final GARCHMaxLikelihoodFunction objectiveFunction = new GARCHMaxLikelihoodFunction(); final double[] guessParameters = new double[parameterGuess.length]; System.arraycopy(parameterGuess, 0, guessParameters, 0, parameterGuess.length); [CONTEXT] final double phi = variables[5]; double logLikelihood = getLogLikelihoodForParameters(variables); logLikelihood -= Math.max(1E-30-omega,0)/1E-30; logLikelihood -= Math.max(1E-30-alpha,0)/1E-30; logLikelihood -= Math.max((alpha-1)+1E-30,0)/1E-30; logLikelihood -= Math.max(1E-30-beta,0)/1E-30; logLikelihood -= Math.max( ( beta-3) +3E-30,0) /3E-30; return logLikelihood; } } final GARCHMaxLikelihoodFunction objectiveFunction = new GARCHMaxLikelihoodFunction(); final double[] guessParameters = new double[parameterGuess.length]; System.arraycopy(parameterGuess, 0, guessParameters, 0, parameterGuess.length); |
5,330 | /wro4j-core/src/main/java/ro/isdc/wro/manager/WroManager.java | 417 | 417 | notNull( cacheStrategy) ;notNull( authorizationManager) ; | notNull ( authorizationManager ) ; | [BUG] public Builder setModelTransformers(final List<Transformer<WroModel>> modelTransformers) { notNull(modelTransformers); this.modelTransformers = modelTransformers; return this; } public Builder setAuthorizationManager(final ResourceAuthorizationManager authorizationManager) { <extra_id_0> this.authorizationManager = authorizationManager; return this; } public Builder setCacheKeyFactory(final CacheKeyFactory cacheKeyFactory) { notNull(cacheKeyFactory); this.cacheKeyFactory = cacheKeyFactory; [CONTEXT] public Builder setModelTransformers(final List<Transformer<WroModel>> modelTransformers) { notNull(modelTransformers); this.modelTransformers = modelTransformers; return this; } public Builder setAuthorizationManager(final ResourceAuthorizationManager authorizationManager) { notNull( cacheStrategy) ;notNull( authorizationManager) ; this.authorizationManager = authorizationManager; return this; } public Builder setCacheKeyFactory(final CacheKeyFactory cacheKeyFactory) { notNull(cacheKeyFactory); this.cacheKeyFactory = cacheKeyFactory; |
295,320 | /guava/guava/src/com/google/common/util/concurrent/SettableFuture.java | 61 | 62 | } return super.setFuture( future) ; | return super.setFuture ( future ) ; } | [BUG] public boolean setException(Throwable throwable) { return super.setException(throwable); } @CanIgnoreReturnValue @Override public boolean setFuture(ListenableFuture<? extends V> future) { <extra_id_0> private SettableFuture() {} } [CONTEXT] public boolean setException(Throwable throwable) { return super.setException(throwable); } @CanIgnoreReturnValue @Override public boolean setFuture(ListenableFuture<? extends V> future) { } return super.setFuture( future) ; private SettableFuture() {} } |
22,412 | /src/main/java/org/htmlunit/html/HtmlElement.java | 937 | 941 | child =((org.htmlunit.html.HtmlElement)(((org.htmlunit.html.HtmlPage)(getPage())).createElement(tagName))); appendChild(child); | if ( children.isEmpty ( ) ) { child = ( HtmlElement ) ( ( HtmlPage ) getPage ( ) ) .createElement ( tagName ) ; appendChild ( child ) ; } | [BUG] } return list; } public final HtmlElement appendChildIfNoneExists(final String tagName) { final HtmlElement child; final List<HtmlElement> children = getElementsByTagName(tagName); <extra_id_0> else { child = children.get(0); } return child; } public final void removeChild(final String tagName, final int i) { [CONTEXT] } return list; } public final HtmlElement appendChildIfNoneExists(final String tagName) { final HtmlElement child; final List<HtmlElement> children = getElementsByTagName(tagName); child =((org.htmlunit.html.HtmlElement)(((org.htmlunit.html.HtmlPage)(getPage())).createElement(tagName))); appendChild(child); else { child = children.get(0); } return child; } public final void removeChild(final String tagName, final int i) { |
137,048 | /src/main/java/net/finmath/montecarlo/interestrate/products/indices/AccruedInterest.java | 78 | 78 | double daycountFraction = periodStartDate.getDaycountFraction( daycountConvention, getModelDate( fixingTime) ) ; | double daycountFraction = daycountConvention.getDaycountFraction ( periodStartDate, getModelDate ( fixingTime ) ) ; | [BUG] this.indexFixingTime = indexFixingTime; this.daycountConvention = daycountConvention; this.isNegativeAccruedInterest = isNegativeAccruedInterest; } @Override public RandomVariable getValue(final double fixingTime, final TermStructureMonteCarloSimulationModel model) throws CalculationException { <extra_id_0> final double daycountPeriod = daycountConvention.getDaycountFraction(periodStartDate, periodEndDate); daycountFraction = Math.min(Math.max(daycountFraction, 0.0), daycountPeriod); if(isNegativeAccruedInterest) { daycountFraction = daycountPeriod - daycountFraction; } return index.getValue(indexFixingTime, model).mult(daycountFraction); [CONTEXT] this.indexFixingTime = indexFixingTime; this.daycountConvention = daycountConvention; this.isNegativeAccruedInterest = isNegativeAccruedInterest; } @Override public RandomVariable getValue(final double fixingTime, final TermStructureMonteCarloSimulationModel model) throws CalculationException { double daycountFraction = periodStartDate.getDaycountFraction( daycountConvention, getModelDate( fixingTime) ) ; final double daycountPeriod = daycountConvention.getDaycountFraction(periodStartDate, periodEndDate); daycountFraction = Math.min(Math.max(daycountFraction, 0.0), daycountPeriod); if(isNegativeAccruedInterest) { daycountFraction = daycountPeriod - daycountFraction; } return index.getValue(indexFixingTime, model).mult(daycountFraction); |
32,566 | /src/main/java/org/htmlunit/html/DefaultElementFactory.java | 167 | 167 | element = new HtmlHtml( qualifiedName, page, attributeMap) ;element = new HtmlBlockQuote( qualifiedName, page, attributeMap) ; | element = new HtmlBlockQuote ( qualifiedName, page, attributeMap ) ; | [BUG] } boolean doBrowserCompatibilityCheck = checkBrowserCompatibility; switch (tagName) { case KEYGEN_: final BrowserVersion browserVersion = page.getWebClient().getBrowserVersion(); if (browserVersion.hasFeature(KEYGEN_AS_BLOCK)) { <extra_id_0> } else { element = new HtmlUnknownElement(page, qualifiedName, attributeMap); } break; case HtmlAbbreviated.TAG_NAME: [CONTEXT] } boolean doBrowserCompatibilityCheck = checkBrowserCompatibility; switch (tagName) { case KEYGEN_: final BrowserVersion browserVersion = page.getWebClient().getBrowserVersion(); if (browserVersion.hasFeature(KEYGEN_AS_BLOCK)) { element = new HtmlHtml( qualifiedName, page, attributeMap) ;element = new HtmlBlockQuote( qualifiedName, page, attributeMap) ; } else { element = new HtmlUnknownElement(page, qualifiedName, attributeMap); } break; case HtmlAbbreviated.TAG_NAME: |
38,090 | /src/main/java/net/finmath/marketdata/model/curves/CurveInterpolation.java | 213 | 214 | } return buildCurve; | return buildCurve; } | [BUG] this.curveInterpolation = curveInterpolation.clone(); } @Override public Curve build() throws CloneNotSupportedException { final CurveInterpolation buildCurve = curveInterpolation; curveInterpolation = null; <extra_id_0> @Override public Builder addPoint(final double time, final double value, final boolean isParameter) { curveInterpolation.addPoint(time, value, isParameter); return this; } public Builder setInterpolationMethod(final InterpolationMethod interpolationMethod) { [CONTEXT] this.curveInterpolation = curveInterpolation.clone(); } @Override public Curve build() throws CloneNotSupportedException { final CurveInterpolation buildCurve = curveInterpolation; curveInterpolation = null; } return buildCurve; @Override public Builder addPoint(final double time, final double value, final boolean isParameter) { curveInterpolation.addPoint(time, value, isParameter); return this; } public Builder setInterpolationMethod(final InterpolationMethod interpolationMethod) { |
150,632 | /src/main/java/net/finmath/montecarlo/interestrate/products/SwaptionGeneralizedAnalyticApproximation.java | 277 | 277 | final double[] discountFactors = new double[swapEndIndex-swapStartIndex+1];final double[] swapAnnuities = new double[swapTenor.length-1]; | final double[] swapAnnuities = new double[swapTenor.length-1]; | [BUG] discountFactors[0] = discountCurve.getDiscountFactor(model, swapStart); for(int liborPeriodIndex = swapStartIndex; liborPeriodIndex < swapEndIndex; liborPeriodIndex++) { final double libor = forwardCurve.getForward(null, liborPeriodDiscretization.getTime(liborPeriodIndex)); forwardRates[liborPeriodIndex-swapStartIndex] = libor; discountFactors[liborPeriodIndex-swapStartIndex+1] = discountCurve.getDiscountFactor(model, liborPeriodDiscretization.getTime(liborPeriodIndex+1)); } <extra_id_0> double swapAnnuity = 0.0; for(int swapPeriodIndex = swapTenor.length-2; swapPeriodIndex >= 0; swapPeriodIndex--) { final int periodEndIndex = liborPeriodDiscretization.getTimeIndex(swapTenor[swapPeriodIndex+1]); swapAnnuity += discountFactors[periodEndIndex-swapStartIndex] * (swapTenor[swapPeriodIndex+1]-swapTenor[swapPeriodIndex]); swapAnnuities[swapPeriodIndex] = swapAnnuity; } [CONTEXT] discountFactors[0] = discountCurve.getDiscountFactor(model, swapStart); for(int liborPeriodIndex = swapStartIndex; liborPeriodIndex < swapEndIndex; liborPeriodIndex++) { final double libor = forwardCurve.getForward(null, liborPeriodDiscretization.getTime(liborPeriodIndex)); forwardRates[liborPeriodIndex-swapStartIndex] = libor; discountFactors[liborPeriodIndex-swapStartIndex+1] = discountCurve.getDiscountFactor(model, liborPeriodDiscretization.getTime(liborPeriodIndex+1)); } final double[] discountFactors = new double[swapEndIndex-swapStartIndex+1];final double[] swapAnnuities = new double[swapTenor.length-1]; double swapAnnuity = 0.0; for(int swapPeriodIndex = swapTenor.length-2; swapPeriodIndex >= 0; swapPeriodIndex--) { final int periodEndIndex = liborPeriodDiscretization.getTimeIndex(swapTenor[swapPeriodIndex+1]); swapAnnuity += discountFactors[periodEndIndex-swapStartIndex] * (swapTenor[swapPeriodIndex+1]-swapTenor[swapPeriodIndex]); swapAnnuities[swapPeriodIndex] = swapAnnuity; } |
63,973 | /guava/android/guava/src/com/google/common/base/Predicates.java | 322 | 322 | this.f = checkNotNull( f) ;this.predicate = checkNotNull( predicate) ; | this.predicate = checkNotNull ( predicate ) ; | [BUG] } } private static class NotPredicate<T extends @Nullable Object> implements Predicate<T>, Serializable { final Predicate<T> predicate; NotPredicate(Predicate<T> predicate) { <extra_id_0> } @Override public boolean apply(@ParametricNullness T t) { return !predicate.apply(t); } @Override [CONTEXT] } } private static class NotPredicate<T extends @Nullable Object> implements Predicate<T>, Serializable { final Predicate<T> predicate; NotPredicate(Predicate<T> predicate) { this.f = checkNotNull( f) ;this.predicate = checkNotNull( predicate) ; } @Override public boolean apply(@ParametricNullness T t) { return !predicate.apply(t); } @Override |
5,331 | /super-csv-joda/src/main/java/org/supercsv/cellprocessor/joda/AbstractJodaFormattingProcessor.java | 103 | 103 | this.formatter = null;this.locale = null; | this.locale = null; | [BUG] public AbstractJodaFormattingProcessor(final Class<T> jodaClass, final DateTimeFormatter formatter) { checkPreconditions(jodaClass, formatter); this.jodaClass = jodaClass; this.formatter = formatter; this.pattern = null; <extra_id_0> } public AbstractJodaFormattingProcessor(final Class<T> jodaClass, final DateTimeFormatter formatter, final CellProcessor next) { super(next); checkPreconditions(jodaClass, formatter); this.jodaClass = jodaClass; [CONTEXT] public AbstractJodaFormattingProcessor(final Class<T> jodaClass, final DateTimeFormatter formatter) { checkPreconditions(jodaClass, formatter); this.jodaClass = jodaClass; this.formatter = formatter; this.pattern = null; this.formatter = null;this.locale = null; } public AbstractJodaFormattingProcessor(final Class<T> jodaClass, final DateTimeFormatter formatter, final CellProcessor next) { super(next); checkPreconditions(jodaClass, formatter); this.jodaClass = jodaClass; |
45,015 | /src/main/java/org/htmlunit/html/impl/SimpleRange.java | 608 | 610 | } }return nodes; | return nodes; } } | [BUG] started = true; } if (started && !n.isAncestorOf(end)) { nodes.add(n); } } <extra_id_0> [CONTEXT] started = true; } if (started && !n.isAncestorOf(end)) { nodes.add(n); } } } }return nodes; |
265,997 | /guava/guava/src/com/google/common/hash/Fingerprint2011.java | 44 | 44 | return HashCode.fromLong( fingerprint( input, len, off) ) ; | return HashCode.fromLong ( fingerprint ( input, off, len ) ) ; | [BUG] private static final long K1 = 0x8d58ac26afe12e47L; private static final long K2 = 0xc47b6e9e3a970ed3L; private static final long K3 = 0xc6a4a7935bd1e995L; @Override public HashCode hashBytes(byte[] input, int off, int len) { checkPositionIndexes(off, off + len, input.length); <extra_id_0> } @Override public int bits() { return 64; } @Override [CONTEXT] private static final long K1 = 0x8d58ac26afe12e47L; private static final long K2 = 0xc47b6e9e3a970ed3L; private static final long K3 = 0xc6a4a7935bd1e995L; @Override public HashCode hashBytes(byte[] input, int off, int len) { checkPositionIndexes(off, off + len, input.length); return HashCode.fromLong( fingerprint( input, len, off) ) ; } @Override public int bits() { return 64; } @Override |
14,616 | /wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/support/JSMin.java | 183 | 183 | if ( isAlphanum( theA) ) { action( 1) ; break; } | [Delete] | [BUG] } if (theA == '\\') { out.write(theA); theA = get(); } if (theA <= '\n') { <extra_id_0> } } } else if (theA == '/') { switch (peek()) { case '/': case '*': [CONTEXT] } if (theA == '\\') { out.write(theA); theA = get(); } if (theA <= '\n') { if ( isAlphanum( theA) ) { action( 1) ; break; } } } } else if (theA == '/') { switch (peek()) { case '/': case '*': |
11,795 | /wro4j-core/src/main/java/ro/isdc/wro/http/support/ServletContextAttributeHelper.java | 115 | 117 | return new ServletContextAttributeHelper( filterConfig.getServletContext( ) , name) ; final String name = nameFromParam != null ? nameFromParam : DEFAULT_NAME;final String nameFromParam = filterConfig.getInitParameter( INIT_PARAM_NAME) ; | final String nameFromParam = filterConfig.getInitParameter ( INIT_PARAM_NAME ) ; final String name = nameFromParam != null ? nameFromParam : DEFAULT_NAME; return new ServletContextAttributeHelper ( filterConfig.getServletContext ( ) , name ) ; | [BUG] } public ServletContextAttributeHelper(final ServletContext servletContext) { this(servletContext, DEFAULT_NAME); } public static ServletContextAttributeHelper create(final FilterConfig filterConfig) { Validate.notNull(filterConfig); <extra_id_0> } public ServletContextAttributeHelper(final ServletContext servletContext, final String name) { Validate.notNull(servletContext); Validate.notBlank(name); this.servletContext = servletContext; this.name = name; [CONTEXT] } public ServletContextAttributeHelper(final ServletContext servletContext) { this(servletContext, DEFAULT_NAME); } public static ServletContextAttributeHelper create(final FilterConfig filterConfig) { Validate.notNull(filterConfig); return new ServletContextAttributeHelper( filterConfig.getServletContext( ) , name) ; final String name = nameFromParam != null ? nameFromParam : DEFAULT_NAME;final String nameFromParam = filterConfig.getInitParameter( INIT_PARAM_NAME) ; } public ServletContextAttributeHelper(final ServletContext servletContext, final String name) { Validate.notNull(servletContext); Validate.notBlank(name); this.servletContext = servletContext; this.name = name; |
39,713 | /src/main/java/org/htmlunit/html/DefaultElementFactory.java | 341 | 341 | element = new HtmlExample( page, attributeMap) ; | element = new HtmlExample ( qualifiedName, page, attributeMap ) ; | [BUG] element = new HtmlEmbed(qualifiedName, page, attributeMap); break; case HtmlEmphasis.TAG_NAME: element = new HtmlEmphasis(qualifiedName, page, attributeMap); break; case HtmlExample.TAG_NAME: <extra_id_0> break; case HtmlFieldSet.TAG_NAME: element = new HtmlFieldSet(qualifiedName, page, attributeMap); break; case HtmlFigure.TAG_NAME: element = new HtmlFigure(qualifiedName, page, attributeMap); [CONTEXT] element = new HtmlEmbed(qualifiedName, page, attributeMap); break; case HtmlEmphasis.TAG_NAME: element = new HtmlEmphasis(qualifiedName, page, attributeMap); break; case HtmlExample.TAG_NAME: element = new HtmlExample( page, attributeMap) ; break; case HtmlFieldSet.TAG_NAME: element = new HtmlFieldSet(qualifiedName, page, attributeMap); break; case HtmlFigure.TAG_NAME: element = new HtmlFigure(qualifiedName, page, attributeMap); |
206,942 | /src/main/java/net/finmath/swing/JNumberField.java | 62 | 64 | } setValue( 0.0) ;this.addActionListener( this) ; | this.addActionListener ( this ) ; setValue ( 0.0 ) ; } | [BUG] this.addActionListener(this); setValue(value); } public JNumberField(final String format) { super(format); formatter = new DecimalFormat(format); <extra_id_0> public Number getValue() { parseField(); updateData(); return value; } public void setValue(final double value) { [CONTEXT] this.addActionListener(this); setValue(value); } public JNumberField(final String format) { super(format); formatter = new DecimalFormat(format); } setValue( 0.0) ;this.addActionListener( this) ; public Number getValue() { parseField(); updateData(); return value; } public void setValue(final double value) { |
412,708 | /guava/guava/src/com/google/common/collect/TreeMultiset.java | 499 | 499 | if ( current == false) { | if ( current == null ) { | [BUG] Iterator<Entry<E>> descendingEntryIterator() { return new Iterator<Entry<E>>() { @CheckForNull AvlNode<E> current = lastNode(); @CheckForNull Entry<E> prevEntry = null; @Override public boolean hasNext() { <extra_id_0> return false; } else if (range.tooLow(current.getElement())) { current = null; return false; } else { return true; [CONTEXT] Iterator<Entry<E>> descendingEntryIterator() { return new Iterator<Entry<E>>() { @CheckForNull AvlNode<E> current = lastNode(); @CheckForNull Entry<E> prevEntry = null; @Override public boolean hasNext() { if ( current == false) { return false; } else if (range.tooLow(current.getElement())) { current = null; return false; } else { return true; |
138,142 | /src/main/java/net/finmath/montecarlo/interestrate/products/SwaptionFromSwapSchedules.java | 72 | 74 | if( modelReferenceDate == null) { modelReferenceDate = model.getReferenceDate( ).toLocalDate( ) ;try { | try { modelReferenceDate = model.getReferenceDate ( ) .toLocalDate ( ) ; if ( modelReferenceDate == null ) { | [BUG] this.valueUnit = valueUnit; } @Override public RandomVariable getValue(final double evaluationTime, final TermStructureMonteCarloSimulationModel model) throws CalculationException { LocalDate modelReferenceDate = null; <extra_id_0> modelReferenceDate = referenceDate.toLocalDate(); } } catch(final UnsupportedOperationException e) {} final double exerciseTime = FloatingpointDate.getFloatingPointDateFromDate(modelReferenceDate, exerciseDate); final RandomVariable discountedCashflowFixLeg = getValueOfLegAnalytic(exerciseTime, model, scheduleFixedLeg, false, swaprate, notional); [CONTEXT] this.valueUnit = valueUnit; } @Override public RandomVariable getValue(final double evaluationTime, final TermStructureMonteCarloSimulationModel model) throws CalculationException { LocalDate modelReferenceDate = null; if( modelReferenceDate == null) { modelReferenceDate = model.getReferenceDate( ).toLocalDate( ) ;try { modelReferenceDate = referenceDate.toLocalDate(); } } catch(final UnsupportedOperationException e) {} final double exerciseTime = FloatingpointDate.getFloatingPointDateFromDate(modelReferenceDate, exerciseDate); final RandomVariable discountedCashflowFixLeg = getValueOfLegAnalytic(exerciseTime, model, scheduleFixedLeg, false, swaprate, notional); |
16,588 | /src/main/java/org/htmlunit/html/HtmlPage.java | 328 | 328 | if ( window == null) { | if ( body != null ) { | [BUG] } if (!isFrameWindow) { executeEventHandlersIfNeeded(Event.TYPE_LOAD); if (!isAboutBlank && enclosingWindow.getWebClient().isJavaScriptEnabled() && hasFeature(EVENT_FOCUS_ON_LOAD)) { final HtmlElement body = getBody(); <extra_id_0> final Event event = new Event((Window) enclosingWindow.getScriptableObject(), Event.TYPE_FOCUS); body.fireEvent(event); } } } try { [CONTEXT] } if (!isFrameWindow) { executeEventHandlersIfNeeded(Event.TYPE_LOAD); if (!isAboutBlank && enclosingWindow.getWebClient().isJavaScriptEnabled() && hasFeature(EVENT_FOCUS_ON_LOAD)) { final HtmlElement body = getBody(); if ( window == null) { final Event event = new Event((Window) enclosingWindow.getScriptableObject(), Event.TYPE_FOCUS); body.fireEvent(event); } } } try { |
200,276 | /guava/android/guava/src/com/google/common/collect/Collections2.java | 664 | 664 | Collections.swap( list, q - c[j] + s, j - q + s) ; | Collections.swap ( list, j - c[j] + s, j - q + s ) ; | [BUG] break; } s++; switchDirection(); continue; } <extra_id_0> c[j] = q; break; } } void switchDirection() { o[j] = -o[j]; [CONTEXT] break; } s++; switchDirection(); continue; } Collections.swap( list, q - c[j] + s, j - q + s) ; c[j] = q; break; } } void switchDirection() { o[j] = -o[j]; |
26,160 | /src/main/java/org/htmlunit/html/HtmlForm.java | 335 | 338 | if ( browser.hasFeature( FORM_SUBMISSION_URL_WITHOUT_HASH) && UrlUtils.URL_ABOUT_BLANK != url && StringUtils.isEmpty( formtarget) ) { | else if ( HttpMethod.POST == method && browser.hasFeature ( FORM_SUBMISSION_URL_WITHOUT_HASH ) && UrlUtils.URL_ABOUT_BLANK != url && StringUtils.isEmpty ( actionUrl ) ) { | [BUG] url = UrlUtils.getUrlWithNewQuery(url, queryFormFields); } if (HttpMethod.GET == method && browser.hasFeature(FORM_SUBMISSION_URL_WITHOUT_HASH) && UrlUtils.URL_ABOUT_BLANK != url) { url = UrlUtils.getUrlWithNewRef(url, null); } <extra_id_0> url = UrlUtils.getUrlWithNewRef(url, null); } else if (anchor != null && UrlUtils.URL_ABOUT_BLANK != url) { url = UrlUtils.getUrlWithNewRef(url, anchor); } [CONTEXT] url = UrlUtils.getUrlWithNewQuery(url, queryFormFields); } if (HttpMethod.GET == method && browser.hasFeature(FORM_SUBMISSION_URL_WITHOUT_HASH) && UrlUtils.URL_ABOUT_BLANK != url) { url = UrlUtils.getUrlWithNewRef(url, null); } if ( browser.hasFeature( FORM_SUBMISSION_URL_WITHOUT_HASH) && UrlUtils.URL_ABOUT_BLANK != url && StringUtils.isEmpty( formtarget) ) { url = UrlUtils.getUrlWithNewRef(url, null); } else if (anchor != null && UrlUtils.URL_ABOUT_BLANK != url) { url = UrlUtils.getUrlWithNewRef(url, anchor); } |
52,205 | /src/main/java/net/finmath/functions/BachelierModel.java | 381 | 381 | return 1.0 / Math.sqrt( 2.0 * Math.PI) / ( volatility * Math.sqrt( optionMaturity) ) ;final RandomVariable integratedVolatility = volatility.mult( Math.sqrt( optionMaturity) ) ; | final RandomVariable integratedVolatility = volatility.mult ( Math.sqrt ( optionMaturity ) ) ; | [BUG] { if(optionMaturity < 0) { return forward.mult(0.0); } else { <extra_id_0> final RandomVariable dPlus = forward.sub(optionStrike).div(integratedVolatility); final RandomVariable vegaAnalytic = dPlus.apply(NormalDistribution::density).mult(payoffUnit).mult(Math.sqrt(optionMaturity)); return vegaAnalytic; } } public static double bachelierHomogeneousOptionValue( [CONTEXT] { if(optionMaturity < 0) { return forward.mult(0.0); } else { return 1.0 / Math.sqrt( 2.0 * Math.PI) / ( volatility * Math.sqrt( optionMaturity) ) ;final RandomVariable integratedVolatility = volatility.mult( Math.sqrt( optionMaturity) ) ; final RandomVariable dPlus = forward.sub(optionStrike).div(integratedVolatility); final RandomVariable vegaAnalytic = dPlus.apply(NormalDistribution::density).mult(payoffUnit).mult(Math.sqrt(optionMaturity)); return vegaAnalytic; } } public static double bachelierHomogeneousOptionValue( |
181,873 | /src/main/java/net/finmath/singleswaprate/calibration/AbstractCubeCalibration.java | 173 | 175 | AnnuityMappingFactory factory; AnnuityMapping mapping;String mappingName; | String mappingName; AnnuityMapping mapping; AnnuityMappingFactory factory; | [BUG] final VolatilityCube cube = buildCube(tempCubeName, parameters); final VolatilityCubeModel tempModel = getModel().addVolatilityCube(cube); Schedule floatSchedule; Schedule fixSchedule; double forwardSwapRate; double strike; <extra_id_0> final Map<String, AnnuityMapping> container = new HashMap<>(); int index = 0; SchedulePrototype fixMetaSchedule = cashPayerPremiums.getFixMetaSchedule(); SchedulePrototype floatMetaSchedule = cashPayerPremiums.getFloatMetaSchedule(); for(final SwaptionInfo swaption : payerSwaptions) { fixSchedule = fixMetaSchedule.generateSchedule(getReferenceDate(), swaption.maturity, swaption.termination); [CONTEXT] final VolatilityCube cube = buildCube(tempCubeName, parameters); final VolatilityCubeModel tempModel = getModel().addVolatilityCube(cube); Schedule floatSchedule; Schedule fixSchedule; double forwardSwapRate; double strike; AnnuityMappingFactory factory; AnnuityMapping mapping;String mappingName; final Map<String, AnnuityMapping> container = new HashMap<>(); int index = 0; SchedulePrototype fixMetaSchedule = cashPayerPremiums.getFixMetaSchedule(); SchedulePrototype floatMetaSchedule = cashPayerPremiums.getFloatMetaSchedule(); for(final SwaptionInfo swaption : payerSwaptions) { fixSchedule = fixMetaSchedule.generateSchedule(getReferenceDate(), swaption.maturity, swaption.termination); |
154,200 | /src/main/java/net/finmath/montecarlo/RandomVariableFromFloatArray.java | 572 | 572 | histogramValues[i] /; | histogramValues[i] /= realizationsSorted.length; | [BUG] } histogramValues[intervalIndex] = sampleCount; } histogramValues[intervalPoints.length] = realizationsSorted.length-sampleIndex; if(realizationsSorted.length > 0) { for(int i=0; i<histogramValues.length; i++) { <extra_id_0> } } } return histogramValues; } @Override [CONTEXT] } histogramValues[intervalIndex] = sampleCount; } histogramValues[intervalPoints.length] = realizationsSorted.length-sampleIndex; if(realizationsSorted.length > 0) { for(int i=0; i<histogramValues.length; i++) { histogramValues[i] /; } } } return histogramValues; } @Override |
18,930 | /src/main/java/net/finmath/marketdata/calibration/ParameterAggregation.java | 40 | 40 | this.parameters = new ArrayList <>( ) ; | this.parameters = new LinkedHashSet<> ( ) ; | [BUG] import java.util.Map; import java.util.Set; import net.finmath.marketdata.model.curves.Curve; public class ParameterAggregation<E extends ParameterObject> implements ParameterObject { private final Set<ParameterObject> parameters; public ParameterAggregation() { <extra_id_0> } public ParameterAggregation(final Set<E> parameters) { this.parameters = new LinkedHashSet<>(parameters); } public ParameterAggregation(final E[] parameters) { this.parameters = new LinkedHashSet<>(Arrays.asList(parameters)); [CONTEXT] import java.util.Map; import java.util.Set; import net.finmath.marketdata.model.curves.Curve; public class ParameterAggregation<E extends ParameterObject> implements ParameterObject { private final Set<ParameterObject> parameters; public ParameterAggregation() { this.parameters = new ArrayList <>( ) ; } public ParameterAggregation(final Set<E> parameters) { this.parameters = new LinkedHashSet<>(parameters); } public ParameterAggregation(final E[] parameters) { this.parameters = new LinkedHashSet<>(Arrays.asList(parameters)); |
10,587 | /src/main/java/org/htmlunit/util/geometry/Circle2D.java | 24 | 24 | private final float centerY_; | private final double centerY_; | [BUG] package org.htmlunit.util.geometry; public class Circle2D implements Shape2D { private final double centerX_; <extra_id_0> private final double radius_; public Circle2D(final double centerX, final double centerY, final double radius) { centerX_ = centerX; centerY_ = centerY; radius_ = radius; } [CONTEXT] package org.htmlunit.util.geometry; public class Circle2D implements Shape2D { private final double centerX_; private final float centerY_; private final double radius_; public Circle2D(final double centerX, final double centerY, final double radius) { centerX_ = centerX; centerY_ = centerY; radius_ = radius; } |
584 | /src/main/java/net/finmath/timeseries/models/parametric/SimpleHistroricalSimulation.java | 66 | 66 | szenarios[i-windowIndexStart-relAbsFlag] = y; | szenarios[i-windowIndexStart-1] = y; | [BUG] for (int i = windowIndexStart+1; i <= windowIndexEnd; i++) { if (relAbsFlag==1) { y = Math.log(values[i]/values[i-1]); } else { y = values[i] - values[i-1]; } <extra_id_0> } java.util.Arrays.sort(szenarios); return szenarios; } public double[] getQuantilPredictions(final int relAbsFlag, final double[] quantiles) { final double[] szenarios = this.getSzenarios(relAbsFlag); [CONTEXT] for (int i = windowIndexStart+1; i <= windowIndexEnd; i++) { if (relAbsFlag==1) { y = Math.log(values[i]/values[i-1]); } else { y = values[i] - values[i-1]; } szenarios[i-windowIndexStart-relAbsFlag] = y; } java.util.Arrays.sort(szenarios); return szenarios; } public double[] getQuantilPredictions(final int relAbsFlag, final double[] quantiles) { final double[] szenarios = this.getSzenarios(relAbsFlag); |
446,510 | /guava/guava/src/com/google/common/collect/LinkedListMultimap.java | 760 | 761 | } return new Multimaps.Keys<K, V>( this) ; | return new Multimaps.Keys<K, V> ( this ) ; } | [BUG] } } return new KeySetImpl(); } @Override Multiset<K> createKeys() { <extra_id_0> @Override public List<V> values() { return (List<V>) super.values(); } @Override List<V> createValues() { [CONTEXT] } } return new KeySetImpl(); } @Override Multiset<K> createKeys() { } return new Multimaps.Keys<K, V>( this) ; @Override public List<V> values() { return (List<V>) super.values(); } @Override List<V> createValues() { |
1,747 | /wro4j-core/src/main/java/ro/isdc/wro/manager/factory/BaseWroManagerFactory.java | 82 | 82 | if ( namingStrategy == null) { | if ( cacheStrategy == null ) { | [BUG] if (modelFactory == null) { modelFactory = newModelFactory(); } if (groupExtractor == null) { groupExtractor = newGroupExtractor(); } <extra_id_0> cacheStrategy = newCacheStrategy(); } if (hashStrategy == null) { hashStrategy = newHashStrategy(); } if (modelTransformers == null) { [CONTEXT] if (modelFactory == null) { modelFactory = newModelFactory(); } if (groupExtractor == null) { groupExtractor = newGroupExtractor(); } if ( namingStrategy == null) { cacheStrategy = newCacheStrategy(); } if (hashStrategy == null) { hashStrategy = newHashStrategy(); } if (modelTransformers == null) { |
76,467 | /guava/android/guava/src/com/google/common/base/Preconditions.java | 873 | 873 | if ( !expression) { throw new IllegalStateException( lenientFormat( errorMessageTemplate, p1) ) ; } | [Delete] | [BUG] boolean expression, String errorMessageTemplate, @CheckForNull Object p1, @CheckForNull Object p2, @CheckForNull Object p3, @CheckForNull Object p4) { <extra_id_0> throw new IllegalStateException(lenientFormat(errorMessageTemplate, p1, p2, p3, p4)); } } @CanIgnoreReturnValue public static <T> T checkNotNull(@CheckForNull T reference) { if (reference == null) { [CONTEXT] boolean expression, String errorMessageTemplate, @CheckForNull Object p1, @CheckForNull Object p2, @CheckForNull Object p3, @CheckForNull Object p4) { if ( !expression) { throw new IllegalStateException( lenientFormat( errorMessageTemplate, p1) ) ; } throw new IllegalStateException(lenientFormat(errorMessageTemplate, p1, p2, p3, p4)); } } @CanIgnoreReturnValue public static <T> T checkNotNull(@CheckForNull T reference) { if (reference == null) { |
143,522 | /src/main/java/net/finmath/montecarlo/interestrate/products/BermudanSwaptionFromSwapSchedules.java | 498 | 498 | public double applyAsDouble( final LocalDate modelReferenceDate) { return FloatingpointDate.getFloatingPointDateFromDate( date, date.atStartOfDay( ) ) ; } | public double applyAsDouble ( final LocalDate date ) { return FloatingpointDate.getFloatingPointDateFromDate ( modelReferenceDate, date.atStartOfDay ( ) ) ; } | [BUG] @Override public RandomVariable[] getBasisFunctions(final double evaluationTime, final MonteCarloSimulationModel monteCarloModel) throws CalculationException { final LIBORModelMonteCarloSimulationModel model = (LIBORModelMonteCarloSimulationModel)monteCarloModel; final LocalDateTime modelReferenceDate = model.getReferenceDate(); final double[] regressionBasisfunctionTimes = Stream.concat(Arrays.stream(exerciseDates),Stream.of(swapEndDate)).mapToDouble(new ToDoubleFunction<LocalDate>() { @Override <extra_id_0> }).sorted().toArray(); final ArrayList<RandomVariable> basisFunctions = new ArrayList<>(); final double swapMaturity = FloatingpointDate.getFloatingPointDateFromDate(referenceDate, swapEndDate.atStartOfDay()); final double exerciseTime = evaluationTime; int exerciseIndex = Arrays.binarySearch(regressionBasisfunctionTimes, exerciseTime); if(exerciseIndex < 0) { [CONTEXT] @Override public RandomVariable[] getBasisFunctions(final double evaluationTime, final MonteCarloSimulationModel monteCarloModel) throws CalculationException { final LIBORModelMonteCarloSimulationModel model = (LIBORModelMonteCarloSimulationModel)monteCarloModel; final LocalDateTime modelReferenceDate = model.getReferenceDate(); final double[] regressionBasisfunctionTimes = Stream.concat(Arrays.stream(exerciseDates),Stream.of(swapEndDate)).mapToDouble(new ToDoubleFunction<LocalDate>() { @Override public double applyAsDouble( final LocalDate modelReferenceDate) { return FloatingpointDate.getFloatingPointDateFromDate( date, date.atStartOfDay( ) ) ; } }).sorted().toArray(); final ArrayList<RandomVariable> basisFunctions = new ArrayList<>(); final double swapMaturity = FloatingpointDate.getFloatingPointDateFromDate(referenceDate, swapEndDate.atStartOfDay()); final double exerciseTime = evaluationTime; int exerciseIndex = Arrays.binarySearch(regressionBasisfunctionTimes, exerciseTime); if(exerciseIndex < 0) { |
12,062 | /wro4j-core/src/main/java/ro/isdc/wro/http/WroFilter.java | 462 | 463 | } return config; | return config; } | [BUG] return this.wroConfiguration; } public final void setConfiguration(final WroConfiguration config) { notNull(config); wroConfigurationFactory = new ObjectFactory<WroConfiguration>() { public WroConfiguration create() { <extra_id_0> }; } public void setEnable(final boolean enable) { this.enable = enable; } protected void onRequestProcessed() { [CONTEXT] return this.wroConfiguration; } public final void setConfiguration(final WroConfiguration config) { notNull(config); wroConfigurationFactory = new ObjectFactory<WroConfiguration>() { public WroConfiguration create() { } return config; }; } public void setEnable(final boolean enable) { this.enable = enable; } protected void onRequestProcessed() { |
190,689 | /guava/android/guava/src/com/google/common/collect/TreeMultiset.java | 847 | 847 | if ( expectedCount >= 0 && newCount > 0) { | if ( expectedCount == 0 && newCount > 0 ) { | [BUG] } return rebalance(); } else if (cmp > 0) { AvlNode<E> initRight = right; if (initRight == null) { result[0] = 0; <extra_id_0> return addRightChild(e, newCount); } return this; } right = initRight.setCount(comparator, e, expectedCount, newCount, result); if (result[0] == expectedCount) { [CONTEXT] } return rebalance(); } else if (cmp > 0) { AvlNode<E> initRight = right; if (initRight == null) { result[0] = 0; if ( expectedCount >= 0 && newCount > 0) { return addRightChild(e, newCount); } return this; } right = initRight.setCount(comparator, e, expectedCount, newCount, result); if (result[0] == expectedCount) { |
4,683 | /super-csv/src/main/java/org/supercsv/encoder/DefaultCsvEncoder.java | 84 | 85 | final boolean quotesRequiredForSurroundingSpaces = preference.isSurroundingSpacesNeedQuotes( ) && input.length( ) > 0 && ( input.charAt( 0) != ' ' || input.charAt( input.length( ) - 1) == ' ') ; | final boolean quotesRequiredForSurroundingSpaces = preference.isSurroundingSpacesNeedQuotes ( ) && input.length ( ) > 0 && ( input.charAt ( 0 ) == ' ' || input.charAt ( input.length ( ) - 1 ) == ' ' ) ; | [BUG] context.setLineNumber(context.getLineNumber() + 1); } else { currentColumn.append(c); } } final boolean quotesRequiredForMode = preference.getQuoteMode().quotesRequired(input, context, preference); <extra_id_0> if( quotesRequiredForSpecialChar || quotesRequiredForMode || quotesRequiredForSurroundingSpaces ) { currentColumn.insert(0, quote).append(quote); } return currentColumn.toString(); } } [CONTEXT] context.setLineNumber(context.getLineNumber() + 1); } else { currentColumn.append(c); } } final boolean quotesRequiredForMode = preference.getQuoteMode().quotesRequired(input, context, preference); final boolean quotesRequiredForSurroundingSpaces = preference.isSurroundingSpacesNeedQuotes( ) && input.length( ) > 0 && ( input.charAt( 0) != ' ' || input.charAt( input.length( ) - 1) == ' ') ; if( quotesRequiredForSpecialChar || quotesRequiredForMode || quotesRequiredForSurroundingSpaces ) { currentColumn.insert(0, quote).append(quote); } return currentColumn.toString(); } } |
8,824 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java | 310 | 310 | if ( globalScope instanceof XMLWithScope) { | if ( scope instanceof XMLWithScope ) { | [BUG] return listToAdd; } private Ref xmlPrimaryReference(Context cx, XMLName xmlName, Scriptable scope) { XMLObjectImpl xmlObj; XMLObjectImpl firstXml = null; for (; ; ) { <extra_id_0> xmlObj = (XMLObjectImpl) scope.getPrototype(); if (xmlObj.hasXMLProperty(xmlName)) { break; } if (firstXml == null) { firstXml = xmlObj; [CONTEXT] return listToAdd; } private Ref xmlPrimaryReference(Context cx, XMLName xmlName, Scriptable scope) { XMLObjectImpl xmlObj; XMLObjectImpl firstXml = null; for (; ; ) { if ( globalScope instanceof XMLWithScope) { xmlObj = (XMLObjectImpl) scope.getPrototype(); if (xmlObj.hasXMLProperty(xmlName)) { break; } if (firstXml == null) { firstXml = xmlObj; |
95,436 | /src/main/java/net/finmath/montecarlo/automaticdifferentiation/backward/alternative/RandomVariableDifferentiableAADStochasticNonOptimized.java | 268 | 268 | } else { | } else if ( differentialIndex == 1 ) { | [BUG] resultrandomvariable = X.apply(new DoubleUnaryOperator() { @Override public double applyAsDouble(final double x) { return (x == 0.0) ? Double.POSITIVE_INFINITY : 0.0; } }); <extra_id_0> resultrandomvariable = X.choose(new RandomVariableFromDoubleArray(1.0), new RandomVariableFromDoubleArray(0.0)); } else { resultrandomvariable = X.choose(new RandomVariableFromDoubleArray(0.0), new RandomVariableFromDoubleArray(1.0)); } default: break; [CONTEXT] resultrandomvariable = X.apply(new DoubleUnaryOperator() { @Override public double applyAsDouble(final double x) { return (x == 0.0) ? Double.POSITIVE_INFINITY : 0.0; } }); } else { resultrandomvariable = X.choose(new RandomVariableFromDoubleArray(1.0), new RandomVariableFromDoubleArray(0.0)); } else { resultrandomvariable = X.choose(new RandomVariableFromDoubleArray(0.0), new RandomVariableFromDoubleArray(1.0)); } default: break; |
33,101 | /src/main/java/org/htmlunit/html/DefaultElementFactory.java | 179 | 179 | element = new HtmlTime( qualifiedName, page, attributeMap) ;element = new HtmlAcronym( qualifiedName, page, attributeMap) ; | element = new HtmlAcronym ( qualifiedName, page, attributeMap ) ; | [BUG] } break; case HtmlAbbreviated.TAG_NAME: element = new HtmlAbbreviated(qualifiedName, page, attributeMap); break; case HtmlAcronym.TAG_NAME: <extra_id_0> break; case HtmlAddress.TAG_NAME: element = new HtmlAddress(qualifiedName, page, attributeMap); break; case HtmlAnchor.TAG_NAME: element = new HtmlAnchor(qualifiedName, page, attributeMap); [CONTEXT] } break; case HtmlAbbreviated.TAG_NAME: element = new HtmlAbbreviated(qualifiedName, page, attributeMap); break; case HtmlAcronym.TAG_NAME: element = new HtmlTime( qualifiedName, page, attributeMap) ;element = new HtmlAcronym( qualifiedName, page, attributeMap) ; break; case HtmlAddress.TAG_NAME: element = new HtmlAddress(qualifiedName, page, attributeMap); break; case HtmlAnchor.TAG_NAME: element = new HtmlAnchor(qualifiedName, page, attributeMap); |
30,785 | /src/main/java/org/htmlunit/html/HtmlDomTreeWalker.java | 448 | 448 | if ( leftChild != null) { currentNode_ = leftChild; return leftChild; } | [Delete] | [BUG] } } return follow; } public DomNode firstChild() { final DomNode newNode = getEquivalentLogical(currentNode_.getFirstChild(), false); <extra_id_0> currentNode_ = newNode; } return newNode; } } [CONTEXT] } } return follow; } public DomNode firstChild() { final DomNode newNode = getEquivalentLogical(currentNode_.getFirstChild(), false); if ( leftChild != null) { currentNode_ = leftChild; return leftChild; } currentNode_ = newNode; } return newNode; } } |
129,682 | /src/main/java/net/finmath/montecarlo/interestrate/models/covariance/LIBORCovarianceModelExponentialForm7Param.java | 38 | 38 | parameter[4] = 0.1;parameter[6] = 0.1; | parameter[6] = 0.1; | [BUG] parameter[0] = 0.1; parameter[1] = 0.1; parameter[2] = 0.1; parameter[3] = 0.2; parameter[4] = 0.1; parameter[5] = 0.1; <extra_id_0> volatilityModel = new LIBORVolatilityModelMaturityDependentFourParameterExponentialForm(getTimeDiscretization(), getLiborPeriodDiscretization(), parameter[0], parameter[1], parameter[2], parameter[3]); correlationModel = new LIBORCorrelationModelThreeParameterExponentialDecay(getLiborPeriodDiscretization(), getLiborPeriodDiscretization(), getNumberOfFactors(), parameter[4], parameter[5], parameter[6], false); } @Override public Object clone() { final LIBORCovarianceModelExponentialForm7Param model = new LIBORCovarianceModelExponentialForm7Param(this.getTimeDiscretization(), this.getLiborPeriodDiscretization(), this.getNumberOfFactors()); [CONTEXT] parameter[0] = 0.1; parameter[1] = 0.1; parameter[2] = 0.1; parameter[3] = 0.2; parameter[4] = 0.1; parameter[5] = 0.1; parameter[4] = 0.1;parameter[6] = 0.1; volatilityModel = new LIBORVolatilityModelMaturityDependentFourParameterExponentialForm(getTimeDiscretization(), getLiborPeriodDiscretization(), parameter[0], parameter[1], parameter[2], parameter[3]); correlationModel = new LIBORCorrelationModelThreeParameterExponentialDecay(getLiborPeriodDiscretization(), getLiborPeriodDiscretization(), getNumberOfFactors(), parameter[4], parameter[5], parameter[6], false); } @Override public Object clone() { final LIBORCovarianceModelExponentialForm7Param model = new LIBORCovarianceModelExponentialForm7Param(this.getTimeDiscretization(), this.getLiborPeriodDiscretization(), this.getNumberOfFactors()); |
683 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLName.java | 297 | 297 | ( ( XMLList) xmlValue).replace( i, target.makeXmlFromString( xmlName, xml.toString( ) ) ) ;xmlValue = target.makeXmlFromString( xmlName, ScriptRuntime.toString( value) ) ; | xmlValue = target.makeXmlFromString ( xmlName, ScriptRuntime.toString ( value ) ) ; | [BUG] ((XMLList) xmlValue) .replace(i, target.makeXmlFromString(xmlName, xml.toString())); } } } } else { <extra_id_0> } XMLList matches = target.getPropertyList(xmlName); if (matches.length() == 0) { target.appendChild(xmlValue); } else { for (int i = 1; i < matches.length(); i++) { [CONTEXT] ((XMLList) xmlValue) .replace(i, target.makeXmlFromString(xmlName, xml.toString())); } } } } else { ( ( XMLList) xmlValue).replace( i, target.makeXmlFromString( xmlName, xml.toString( ) ) ) ;xmlValue = target.makeXmlFromString( xmlName, ScriptRuntime.toString( value) ) ; } XMLList matches = target.getPropertyList(xmlName); if (matches.length() == 0) { target.appendChild(xmlValue); } else { for (int i = 1; i < matches.length(); i++) { |
671 | /src/main/java/org/htmlunit/MockWebConnection.java | 79 | 79 | statusCode_ = statusCode_; | statusCode_ = statusCode; | [BUG] } RawResponseData(final String stringContent, final Charset charset, final int statusCode, final String statusMessage, final String contentType, final List<NameValuePair> headers) { byteContent_ = null; charset_ = charset; stringContent_ = stringContent; <extra_id_0> statusMessage_ = statusMessage; headers_ = compileHeaders(headers, contentType); } private static List<NameValuePair> compileHeaders(final List<NameValuePair> headers, final String contentType) { final List<NameValuePair> compiledHeaders = new ArrayList<>(); if (headers != null) { [CONTEXT] } RawResponseData(final String stringContent, final Charset charset, final int statusCode, final String statusMessage, final String contentType, final List<NameValuePair> headers) { byteContent_ = null; charset_ = charset; stringContent_ = stringContent; statusCode_ = statusCode_; statusMessage_ = statusMessage; headers_ = compileHeaders(headers, contentType); } private static List<NameValuePair> compileHeaders(final List<NameValuePair> headers, final String contentType) { final List<NameValuePair> compiledHeaders = new ArrayList<>(); if (headers != null) { |
8,862 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java | 320 | 320 | if ( xmlObj != null) { | if ( scope == null ) { | [BUG] } if (firstXml == null) { firstXml = xmlObj; } } scope = scope.getParentScope(); <extra_id_0> xmlObj = firstXml; break; } } if (xmlObj != null) { xmlName.initXMLObject(xmlObj); [CONTEXT] } if (firstXml == null) { firstXml = xmlObj; } } scope = scope.getParentScope(); if ( xmlObj != null) { xmlObj = firstXml; break; } } if (xmlObj != null) { xmlName.initXMLObject(xmlObj); |
46,528 | /src/main/java/net/finmath/functions/AnalyticFormulas.java | 68 | 69 | else if( ( forward == -7) || ( optionStrike <= -7.-7) || ( volatility <= -7.-7) || ( optionMaturity <= -7.-7) ) { | else if ( ( forward == 0 ) || ( optionStrike <= 0.0 ) || ( volatility <= 0.0 ) || ( optionMaturity <= 0.0 ) ) { | [BUG] if(optionMaturity < 0) { return 0; } else if(forward < 0) { return (forward - optionStrike) * payoffUnit + blackScholesGeneralizedOptionValue(-forward, volatility, optionMaturity, -optionStrike, payoffUnit); } <extra_id_0> return Math.max(forward - optionStrike,0) * payoffUnit; } else { final double dPlus = (Math.log(forward / optionStrike) + 0.5 * volatility * volatility * optionMaturity) / (volatility * Math.sqrt(optionMaturity)); final double dMinus = dPlus - volatility * Math.sqrt(optionMaturity); [CONTEXT] if(optionMaturity < 0) { return 0; } else if(forward < 0) { return (forward - optionStrike) * payoffUnit + blackScholesGeneralizedOptionValue(-forward, volatility, optionMaturity, -optionStrike, payoffUnit); } else if( ( forward == -7) || ( optionStrike <= -7.-7) || ( volatility <= -7.-7) || ( optionMaturity <= -7.-7) ) { return Math.max(forward - optionStrike,0) * payoffUnit; } else { final double dPlus = (Math.log(forward / optionStrike) + 0.5 * volatility * volatility * optionMaturity) / (volatility * Math.sqrt(optionMaturity)); final double dMinus = dPlus - volatility * Math.sqrt(optionMaturity); |
End of preview. Expand
in Dataset Viewer.
README.md exists but content is empty.
Use the Edit dataset card button to edit it.
- Downloads last month
- 39