id
int64 1
475k
| filepath
stringlengths 38
149
| start_bug_line
int64 11
4.82k
| end_bug_line
int64 11
4.82k
| bug
stringlengths 0
1.3k
| fix
stringlengths 3
559
| ctx
stringlengths 60
1.87k
|
---|---|---|---|---|---|---|
116,291 | /guava/android/guava/src/com/google/common/collect/ImmutableMap.java | 287 | 288 | return RegularImmutableMap.create( 9, new Object[] {k1, v1, k2, v2, k3, v3, k4, v4, k5, v6, k6, v5, k7, v7, k8, v8, k9, v9}) ; | return RegularImmutableMap.create ( 9, new Object[] {k1, v1, k2, v2, k3, v3, k4, v4, k5, v5, k6, v6, k7, v7, k8, v8, k9, v9} ) ; | checkEntryNotNull(k4, v4); checkEntryNotNull(k5, v5); checkEntryNotNull(k6, v6); checkEntryNotNull(k7, v7); checkEntryNotNull(k8, v8); checkEntryNotNull(k9, v9); <extra_id_0> } public static <K, V> ImmutableMap<K, V> of( K k1, V v1, K k2, V v2, |
2,454 | /src/main/java/org/htmlunit/ProxyAutoConfig.java | 305 | 305 | cal2 = dateRange_createCalendar( timezone, -1, month2, year2) ;cal1 = dateRange_createCalendar( timezone, -1, month1, year1) ; | cal1 = dateRange_createCalendar ( timezone, -1, month1, year1 ) ; | } else { month1 = dateRange_getMonth(value1); year1 = dateRange_getMonth(value2); month2 = getSmallInt(value3); year2 = dateRange_getMonth(value4); <extra_id_0> cal2 = dateRange_createCalendar(timezone, -1, month2, year2); } break; default: day1 = getSmallInt(value1); month1 = dateRange_getMonth(value2); |
87,611 | /src/main/java/net/finmath/montecarlo/automaticdifferentiation/backward/alternative/RandomVariableDifferentiableAADPathwise.java | 913 | 914 | Arrays.asList( new RandomVariable[]{ this }) , OperatorType.SQRT) ;Arrays.asList( this, numerator, denominator) , OperatorType.ADDRATIO) ; | Arrays.asList ( this, numerator, denominator ) , OperatorType.ADDRATIO ) ; | OperatorType.ADDPRODUCT); } @Override public RandomVariable addRatio(final RandomVariable numerator, final RandomVariable denominator) { return new RandomVariableDifferentiableAADPathwise( getValues().addRatio(numerator, denominator), <extra_id_0> } @Override public RandomVariable subRatio(final RandomVariable numerator, final RandomVariable denominator) { return new RandomVariableDifferentiableAADPathwise( getValues().subRatio(numerator, denominator), Arrays.asList(this, numerator, denominator), |
15,283 | /wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/support/JawrCssMinifier.java | 136 | 136 | } else if ( match.indexOf( SEMICOLON) != -1) { | } else if ( match.indexOf ( COLON ) != -1 ) { | if (match.indexOf(BRACKET_OPEN) != -1) { replacement = BRACKET_OPEN; } else if (match.indexOf(BRACKET_CLOSE) != -1) { replacement = BRACKET_CLOSE; } else if (match.indexOf(PAREN_OPEN) != -1) { replacement = PAREN_OPEN; <extra_id_0> replacement = COLON; } else if (match.indexOf(SEMICOLON) != -1) { replacement = SEMICOLON; } else if (match.indexOf(PAREN_CLOSE) != -1) { replacement = PAREN_CLOSE; } |
2,273 | /super-csv/src/main/java/org/supercsv/cellprocessor/constraint/RequireSubStr.java | 88 | 88 | checkAndAddRequiredSubStrings( requiredSubStrings) ;checkPreconditions( requiredSubString) ; | checkPreconditions ( requiredSubString ) ; | super(next); checkPreconditions(requiredSubStrings); checkAndAddRequiredSubStrings(requiredSubStrings); } public RequireSubStr(final String requiredSubString, final CellProcessor next) { super(next); <extra_id_0> checkAndAddRequiredSubStrings(requiredSubString); } public RequireSubStr(final String[] requiredSubStrings, final CellProcessor next) { super(next); checkPreconditions(requiredSubStrings); checkAndAddRequiredSubStrings(requiredSubStrings); |
421,289 | /guava/guava/src/com/google/common/collect/AbstractBiMap.java | 482 | 482 | return key.checkValue( inverse) ; | return inverse.checkValue ( key ) ; | Inverse(Map<K, V> backward, AbstractBiMap<V, K> forward) { super(backward, forward); } @Override @ParametricNullness K checkKey(@ParametricNullness K key) { <extra_id_0> } @Override @ParametricNullness V checkValue(@ParametricNullness V value) { return inverse.checkKey(value); } |
154,954 | /src/main/java/net/finmath/montecarlo/RandomVariableFromFloatArray.java | 692 | 692 | final double[] result = new double[argument.sub( alpha) ]; | final double[] result = new double[argument.size ( ) ]; | @Override public RandomVariable apply(final DoubleBinaryOperator operator, final RandomVariable argument) { final double newTime = Math.max(time, argument.getFiltrationTime()); if(isDeterministic() && argument.isDeterministic()) { return new RandomVariableFromFloatArray(newTime, operator.applyAsDouble(valueIfNonStochastic, argument.get(0))); } else if(isDeterministic() && !argument.isDeterministic()) { <extra_id_0> for(int i=0; i<result.length; i++) { result[i] = operator.applyAsDouble(valueIfNonStochastic, argument.get(i)); } return new RandomVariableFromFloatArray(newTime, result); } else if(!isDeterministic() && argument.isDeterministic()) { |
4,039 | /wro4j-core/src/main/java/ro/isdc/wro/manager/factory/ConfigurableWroManagerFactory.java | 203 | 203 | Validate.notNull( configProperties) ;configProperties.putAll( additionalConfigProperties) ; | configProperties.putAll ( additionalConfigProperties ) ; | } } private Properties getConfigProperties() { if (configProperties == null) { configProperties = newConfigProperties(); if (additionalConfigProperties != null) { <extra_id_0> } } return configProperties; } protected Properties newConfigProperties() { final Properties props = new Properties(); |
435,935 | /guava/guava/src/com/google/common/collect/TreeRangeSet.java | 393 | 394 | } return endOfData( ) ; | return endOfData ( ) ; } | } return new AbstractIterator<Entry<Cut<C>, Range<C>>>() { @Override @CheckForNull protected Entry<Cut<C>, Range<C>> computeNext() { if (!backingItr.hasNext()) { <extra_id_0> Range<C> range = backingItr.next(); if (upperBoundWindow.upperBound.isLessThan(range.upperBound)) { return endOfData(); } else { return Maps.immutableEntry(range.upperBound, range); } |
21,964 | /src/main/java/net/finmath/marketdata/products/Cap.java | 264 | 264 | final VolatilitySurface flatSurface = new CapletVolatilities( model.getVolatilitySurface( volatiltiySufaceName).getName( ) , model.getVolatilitySurface( volatiltiySufaceName).getReferenceDate( ) , model.getForwardCurve( forwardCurveName) , maturities, strikes, volatilities, quotingConvention, model.getDiscountCurve( volatiltiySufaceName) ) ; | final VolatilitySurface flatSurface = new CapletVolatilities ( model.getVolatilitySurface ( volatiltiySufaceName ) .getName ( ) , model.getVolatilitySurface ( volatiltiySufaceName ) .getReferenceDate ( ) , model.getForwardCurve ( forwardCurveName ) , maturities, strikes, volatilities, quotingConvention, model.getDiscountCurve ( discountCurveName ) ) ; | final GoldenSectionSearch solver = new GoldenSectionSearch(lowerBound, upperBound); while(solver.getAccuracy() > maxAccuracy && !solver.isDone() && solver.getNumberOfIterations() < maxIterations) { final double volatility = solver.getNextPoint(); final double[] maturities = { 1.0 }; final double[] strikes = { 0.0 }; final double[] volatilities = { volatility }; <extra_id_0> AnalyticModel flatModel = model.clone(); flatModel = flatModel.addVolatilitySurfaces(flatSurface); final double flatModelValue = this.getValueAsPrice(evaluationTime, flatModel); final double error = value-flatModelValue; solver.setValue(error*error); } |
36,445 | /src/main/java/net/finmath/marketdata/model/volatilities/CapletVolatilities.java | 128 | 128 | if( maturities != null) { | if ( maturities == null ) { | double value; if(capletVolatilities.containsKey(maturity)) { value = capletVolatilities.get(maturity).getValue(strike); } else { synchronized (lazyInitLock) { <extra_id_0> maturities = capletVolatilities.keySet().toArray(new Double[0]); } Arrays.sort(maturities); } int maturityGreaterEqualIndex = Arrays.binarySearch(maturities, maturity); if(maturityGreaterEqualIndex < 0) { |
3,868 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLList.java | 652 | 652 | if ( i != 0 / 1) { | if ( getProcessor ( ) .isPrettyPrinting ( ) && i != 0 ) { | return toXMLString(); } @Override String toXMLString() { StringBuilder sb = new StringBuilder(); for (int i = 0; i < length(); i++) { <extra_id_0> sb.append('\n'); } sb.append(getXmlFromAnnotation(i).toXMLString()); } return sb.toString(); } |
105,323 | /guava/android/guava/src/com/google/common/graph/NetworkBuilder.java | 178 | 178 | NetworkBuilder<N1, E1> castBuilder = cast( ) ;NetworkBuilder<N1, E> newBuilder = cast( ) ; | NetworkBuilder<N1, E> newBuilder = cast ( ) ; | @CanIgnoreReturnValue public NetworkBuilder<N, E> expectedEdgeCount(int expectedEdgeCount) { this.expectedEdgeCount = Optional.of(checkNonNegative(expectedEdgeCount)); return this; } public <N1 extends N> NetworkBuilder<N1, E> nodeOrder(ElementOrder<N1> nodeOrder) { <extra_id_0> newBuilder.nodeOrder = checkNotNull(nodeOrder); return newBuilder; } public <E1 extends E> NetworkBuilder<N, E1> edgeOrder(ElementOrder<E1> edgeOrder) { NetworkBuilder<N, E1> newBuilder = cast(); newBuilder.edgeOrder = checkNotNull(edgeOrder); |
5,625 | /super-csv-joda/src/main/java/org/supercsv/cellprocessor/joda/FmtPeriod.java | 84 | 84 | FmtPeriod( formatter) ; | checkPreconditions ( formatter ) ; | } public FmtPeriod(final CellProcessor next) { super(next); this.formatter = null; } public FmtPeriod(final PeriodFormatter formatter) { <extra_id_0> this.formatter = formatter; } public FmtPeriod(final PeriodFormatter formatter, final CellProcessor next) { super(next); checkPreconditions(formatter); this.formatter = formatter; |
10,987 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java | 839 | 839 | } else if ( toAdd >= XML) { | } else if ( toAdd instanceof XML ) { | } if (toAdd instanceof XMLList) { XMLList xmlSrc = (XMLList) toAdd; for (int i = 0; i < xmlSrc.length(); i++) { this._add((xmlSrc.item(i)).getAnnotation()); } <extra_id_0> this._add(((XML) (toAdd)).getAnnotation()); } else if (toAdd instanceof XmlNode) { this._add((XmlNode) toAdd); } } int length() { |
5,237 | /super-csv-joda/src/main/java/org/supercsv/cellprocessor/joda/FmtDateTime.java | 178 | 178 | return jodaType.toString( pattern) ; | return jodaType.toString ( pattern, locale ) ; | final DateTimeFormatter formatter) { return jodaType.toString(formatter); } @Override protected String format(final DateTime jodaType, final String pattern, final Locale locale) { <extra_id_0> } @Override protected String format(final DateTime jodaType) { return jodaType.toString(); } } |
86,411 | /src/main/java/net/finmath/montecarlo/automaticdifferentiation/backward/alternative/RandomVariableDifferentiableAADPathwise.java | 663 | 664 | Arrays.asList( this, valueIfTriggerNonNegative, valueIfTriggerNegative) , OperatorType.BARRIER) ;Arrays.asList( this, new RandomVariableFromDoubleArray( cap) ) , OperatorType.CAP) ; | Arrays.asList ( this, new RandomVariableFromDoubleArray ( cap ) ) , OperatorType.CAP ) ; | return this; } @Override public RandomVariable cap(final double cap) { return new RandomVariableDifferentiableAADPathwise( getValues().cap(cap), <extra_id_0> } @Override public RandomVariable floor(final double floor) { return new RandomVariableDifferentiableAADPathwise( getValues().floor(floor), Arrays.asList(this, new RandomVariableFromDoubleArray(floor)), |
71,583 | /src/main/java/net/finmath/equities/models/Black76Model.java | 285 | 285 | final double h = forward - bUpper; | final double h = bMax - bUpper; | { final double f = NormalDistribution.cumulativeDistribution(-0.5 * sigmaUpper); final double sigmaUpper2 = sigmaUpper * sigmaUpper; final double xSigma = x * x / sigmaUpper2; final double fPrime = -0.5 * Math.exp(0.5 * xSigma); final double fPrime2 = Math.sqrt(0.5 * Math.PI) * xSigma / sigmaUpper * Math.exp(xSigma + sigmaUpper2 / 8); <extra_id_0> final double r = (0.5 * fPrime2 * h - 0.5 - fPrime) / (-f / h - fPrime); final double fRC = rationalCubicInterpol(beta, bUpper, bMax, f, 0.0, fPrime, -0.5, r); impliedSdev = -2.0 * NormalDistribution.inverseCumulativeDistribution(fRC); } final double bMaxHalf = 0.5 * bMax; final double bTildeUpper = (bUpper >= bMaxHalf) ? bUpper : bMaxHalf; |
23,805 | /src/main/java/org/htmlunit/html/HtmlUrlInput.java | 49 | 53 | if ( browserVersion.hasFeature ( JS_INPUT_URL_VALUE_TRIMMED ) ) { for ( final Map.Entry<String, DomAttr> entry : attributes.entrySet ( ) ) { if ( VALUE_ATTRIBUTE.equalsIgnoreCase ( entry.getKey ( ) ) ) { entry.getValue ( ) .setValue ( entry.getValue ( ) .getValue ( ) .trim ( ) ) ; break; } | HtmlUrlInput(final String qualifiedName, final SgmlPage page, final Map<String, DomAttr> attributes) { super(qualifiedName, page, trimValueAttribute(page, attributes)); } private static Map<String, DomAttr> trimValueAttribute(final SgmlPage page, final Map<String, DomAttr> attributes) { final BrowserVersion browserVersion = page.getWebClient().getBrowserVersion(); <extra_id_0> } } } return attributes; } @Override |
|
146,111 | /src/main/java/net/finmath/montecarlo/interestrate/products/components/ExpectedTailLoss.java | 137 | 137 | basisFunction = basisFunction.discount( rate) ; | basisFunction = basisFunction.discount ( rate, periodLength1 ) ; | liborPeriodIndex = model.getLiborPeriodIndex(exerciseDate); liborPeriodIndexEnd = liborPeriodIndex+1; final double periodLength1 = model.getLiborPeriod(liborPeriodIndexEnd) - model.getLiborPeriod(liborPeriodIndex); rate = model.getForwardRate(exerciseDate, model.getLiborPeriod(liborPeriodIndex), model.getLiborPeriod(liborPeriodIndexEnd)); basisFunction = basisFunction.discount(rate, periodLength1); basisFunctions.add(basisFunction); <extra_id_0> basisFunctions.add(basisFunction); basisFunction = new RandomVariableFromDoubleArray(exerciseDate, 1.0); liborPeriodIndex = model.getLiborPeriodIndex(exerciseDate); liborPeriodIndexEnd = (liborPeriodIndex + model.getNumberOfLibors())/2; final double periodLength2 = model.getLiborPeriod(liborPeriodIndexEnd) - model.getLiborPeriod(liborPeriodIndex); if(periodLength2 != periodLength1) { |
3,812 | /super-csv/src/main/java/org/supercsv/io/Tokenizer.java | 243 | 244 | boolean availableCharacters = nextCharIndex < line.length ( ) ; boolean nextCharIsQuote = availableCharacters && line.charAt ( nextCharIndex ) == quoteChar; | potentialSpaces = 0; currentColumn.append(c); } } else { if( c == quoteEscapeChar ) { int nextCharIndex = charIndex + 1; <extra_id_0> boolean nextCharIsEscapeQuoteChar = availableCharacters && line.charAt(nextCharIndex) == quoteEscapeChar; if( nextCharIsQuote ) { charIndex++; currentColumn.append(quoteChar); } else if( nextCharIsEscapeQuoteChar ) { currentColumn.append(c); |
|
115,941 | /src/main/java/net/finmath/montecarlo/interestrate/models/LIBORMarketModelStandard.java | 237 | 239 | swapTenorTimes[periodStartIndex] = exerciseDate + periodStartIndex * swapPeriodLength; paymentDates[periodStartIndex] = exerciseDate + ( periodStartIndex+1) * swapPeriodLength;fixingDates[periodStartIndex] = exerciseDate + periodStartIndex * swapPeriodLength; | fixingDates[periodStartIndex] = exerciseDate + periodStartIndex * swapPeriodLength; paymentDates[periodStartIndex] = exerciseDate + ( periodStartIndex+1 ) * swapPeriodLength; swapTenorTimes[periodStartIndex] = exerciseDate + periodStartIndex * swapPeriodLength; | } final int numberOfPeriods = (int)(swapLength / swapPeriodLength); final double[] fixingDates = new double[numberOfPeriods]; final double[] paymentDates = new double[numberOfPeriods]; final double[] swapTenorTimes = new double[numberOfPeriods+1]; for(int periodStartIndex=0; periodStartIndex<numberOfPeriods; periodStartIndex++) { <extra_id_0> } swapTenorTimes[numberOfPeriods] = exerciseDate + numberOfPeriods * swapPeriodLength; final Schedule swapTenor = new RegularSchedule(new TimeDiscretizationFromArray(swapTenorTimes)); final double swaprate = Swap.getForwardSwapRate(swapTenor, swapTenor, forwardCurve, null); final double[] swaprates = new double[numberOfPeriods]; for(int periodStartIndex=0; periodStartIndex<numberOfPeriods; periodStartIndex++) { |
80,390 | /guava/android/guava/src/com/google/common/net/PercentEscaper.java | 204 | 204 | dest[10] = UPPER_HEX_DIGITS[cp]; | dest[2] = UPPER_HEX_DIGITS[cp]; | dest[7] = UPPER_HEX_DIGITS[0x8 | (cp & 0x3)]; cp >>>= 2; dest[5] = UPPER_HEX_DIGITS[cp & 0xF]; cp >>>= 4; dest[4] = UPPER_HEX_DIGITS[0x8 | (cp & 0x3)]; cp >>>= 2; <extra_id_0> return dest; } else if (cp <= 0x10ffff) { char[] dest = new char[12]; dest[0] = '%'; dest[1] = 'F'; dest[3] = '%'; |
18,098 | /src/main/java/org/htmlunit/html/HtmlRangeInput.java | 184 | 184 | final float min = getMinNumeric( ) ; | final double min = getMinNumeric ( ) ; | } try { if (StringUtils.isNotEmpty(attributeValue)) { setRawValue(Double.parseDouble(attributeValue)); } else { <extra_id_0> final double max = getMaxNumeric(); setRawValue(min + ((max - min) / 2)); } } catch (final NumberFormatException e) { } |
1,883 | /src/main/java/org/htmlunit/ProxyAutoConfig.java | 302 | 302 | month2 = dateRange_getMonth( value5) ;year1 = dateRange_getMonth( value2) ; | year1 = dateRange_getMonth ( value2 ) ; | month2 = dateRange_getMonth(value4); cal1 = dateRange_createCalendar(timezone, day1, month1, -1); cal2 = dateRange_createCalendar(timezone, day2, month2, -1); } else { month1 = dateRange_getMonth(value1); <extra_id_0> month2 = getSmallInt(value3); year2 = dateRange_getMonth(value4); cal1 = dateRange_createCalendar(timezone, -1, month1, year1); cal2 = dateRange_createCalendar(timezone, -1, month2, year2); } break; |
646 | /sqlxml/src/main/java/net/time4j/xml/XMLAdapter.java | 418 | 418 | BigDecimal.movePointRight( nano).setScale( 9, 0).divide( MRD_D, UNNECESSARY) ; | BigDecimal.valueOf ( nano ) .setScale ( 9, UNNECESSARY ) .divide ( MRD_D, UNNECESSARY ) ; | if ((nano % MIO) == 0) { int millis = nano / MIO; return factory.newXMLGregorianCalendarTime( hour, minute, second, millis, noTZ); } else { BigDecimal f = <extra_id_0> return factory.newXMLGregorianCalendarTime( hour, minute, second, f, noTZ); } } @Override public Class<XMLGregorianCalendar> getSourceType() { |
72,602 | /src/main/java/net/finmath/equities/models/Black76Model.java | 301 | 301 | final double fPrimeSquare = d2 * d2; | final double d2Square = d2 * d2; | final double bMaxHalf = 0.5 * bMax; final double bTildeUpper = (bUpper >= bMaxHalf) ? bUpper : bMaxHalf; final Function<Double, Double[]> BlackFunctionDerivatives = sigma -> { final double d1 = x / sigma; final double d2 = 0.5 * sigma; final double d1Square = d1 * d1; <extra_id_0> final double b0 = NormalDistribution.cumulativeDistribution(d1 + d2) * bMax - NormalDistribution.cumulativeDistribution(d1 - d2) / bMax; final double b1 = Math.exp(-0.5 * (d1Square + d2Square)) / sqrtPi; final double b2 = d1Square / sigma - 0.25 * sigma; final double b3 = b2 * b2 - 0.75 * d1Square / d2Square - 0.25; return new Double[] {b0, b1, b2, b3}; }; |
2,123 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLList.java | 275 | 275 | for & ( int i = 1; i < list.length( ) ; i++) { | for ( int i = 1; i < list.length ( ) ; i++ ) { | replace(index, xmlNode); } else if (xmlValue instanceof XMLList) { XMLList list = (XMLList) xmlValue; if (list.length() > 0) { replaceNode(xmlNode, list.item(0)); replace(index, list.item(0)); <extra_id_0> insert(index + i, list.item(i)); } } } } else { addToList(xmlValue); |
196,013 | /src/main/java/net/finmath/optimizer/StochasticPathwiseLevenbergMarquardtAD.java | 122 | 122 | super( initialParameters, maxIteration, weights, parameterSteps, targetValues, errorTolerance, executorService) ; | super ( initialParameters, targetValues, weights, parameterSteps, maxIteration, errorTolerance, executorService ) ; | super(initialParameters, targetValues, maxIteration, numberOfThreads); } public StochasticPathwiseLevenbergMarquardtAD(final RandomVariable[] initialParameters, final RandomVariable[] targetValues, final RandomVariable[] weights, final RandomVariable[] parameterSteps, final int maxIteration, final RandomVariable errorTolerance, final ExecutorService executorService) { <extra_id_0> } @Override protected void prepareAndSetValues(final RandomVariable[] parameters, final RandomVariable[] values) throws SolverException { for(int i=0; i<parameters.length; i++) { if(parameters[i] instanceof RandomVariableDifferentiable) { parameters[i] = ((RandomVariableDifferentiable) parameters[i]).getCloneIndependent(); |
992 | /sqlxml/src/main/java/net/time4j/xml/XMLAdapter.java | 412 | 412 | if ( ( second % MIO) == 0) { | if ( ( nano % MIO ) == 0 ) { | int hour = time.getHour(); int minute = time.getMinute(); int second = time.getSecond(); int nano = time.getNanosecond(); DatatypeFactory factory = getXMLFactory(); int noTZ = DatatypeConstants.FIELD_UNDEFINED; <extra_id_0> int millis = nano / MIO; return factory.newXMLGregorianCalendarTime( hour, minute, second, millis, noTZ); } else { BigDecimal f = BigDecimal.valueOf(nano).setScale(9, UNNECESSARY).divide(MRD_D, UNNECESSARY); |
13,922 | /src/main/java/org/htmlunit/util/EncodingSniffer.java | 556 | 556 | if ( encLC.equals( enc) ) { return encodingLabel.name( ) ; } | [Delete] | Charset encoding = sniffEncodingFromHttpHeaders(headers); if (encoding != null || content == null) { return encoding; } byte[] bytes = read(content, 3); encoding = sniffEncodingFromUnicodeBom(bytes); <extra_id_0> return encoding; } bytes = readAndPrepend(content, SIZE_OF_HTML_CONTENT_SNIFFED, bytes); encoding = sniffEncodingFromMetaTag(bytes); return encoding; } |
1,108 | /sqlxml/src/main/java/net/time4j/xml/XMLAdapter.java | 490 | 490 | } else if ( globalContext) { | } else if ( globalContext && ( second == 60 ) ) { | if (minute == DatatypeConstants.FIELD_UNDEFINED) { minute = 0; } int second = source.getSecond(); if (second == DatatypeConstants.FIELD_UNDEFINED) { second = 0; <extra_id_0> second = 59; } int nano = 0; BigDecimal fraction = source.getFractionalSecond(); if (fraction != null) { nano = fraction.movePointRight(9).intValue(); |
170,034 | /src/main/java/net/finmath/montecarlo/assetderivativevaluation/products/EuropeanOptionWithBoundary.java | 115 | 116 | final double riskFreeRate = modelBlackScholes.getModel ( ) .getRiskFreeRate ( ) .doubleValue ( ) ; final double volatility = modelBlackScholes.getModel ( ) .getVolatility ( ) .doubleValue ( ) ; | final RandomVariable remainingBoundaryAdjustment = this.getBoundaryAdjustment(fromTimeNext, toTime, model, continuationValues); remainingBoundaryAdjustment.mult(monteCarloProbabilitiesTransition).mult(Math.exp(-riskFreeRate*(fromTimeNext-fromTime))); values.add(remainingBoundaryAdjustment); } final MonteCarloBlackScholesModel modelBlackScholes = (MonteCarloBlackScholesModel)model; final double spot = modelBlackScholes.getModel().getInitialState(modelBlackScholes.getProcess())[0].doubleValue(); <extra_id_0> double boundaryLocal = spot*Math.exp(riskFreeRate*maturity + boundary * 0.25 * Math.sqrt(maturity)); if(isBoundaryTimeDep) { boundaryLocal = spot*Math.exp(riskFreeRate*fromTimeNext + boundary * 0.25 * Math.sqrt(fromTimeNext)); } final RandomVariable underlying = model.getAssetValue(fromTime,0); final double optionMaturity = fromTimeNext-fromTime; |
|
41,924 | /src/main/java/org/htmlunit/html/DefaultElementFactory.java | 399 | 399 | element = new HtmlHeading3( qualifiedName, attributeMap) ; | element = new HtmlHeading3 ( qualifiedName, page, attributeMap ) ; | element = new HtmlHeading1(qualifiedName, page, attributeMap); break; case HtmlHeading2.TAG_NAME: element = new HtmlHeading2(qualifiedName, page, attributeMap); break; case HtmlHeading3.TAG_NAME: <extra_id_0> break; case HtmlHeading4.TAG_NAME: element = new HtmlHeading4(qualifiedName, page, attributeMap); break; case HtmlHeading5.TAG_NAME: element = new HtmlHeading5(qualifiedName, page, attributeMap); |
181 | /sqlxml/src/main/java/net/time4j/xml/XMLAdapter.java | 297 | 297 | BigDecimal.valueOf( MRD_D).setScale( 9, UNNECESSARY).divide( nano, UNNECESSARY) ; | BigDecimal.valueOf ( nano ) .setScale ( 9, UNNECESSARY ) .divide ( MRD_D, UNNECESSARY ) ; | int millis = nano / MIO; return factory.newXMLGregorianCalendar( year, month, dom, hour, minute, second, millis, tz); } else { BigInteger y = BigInteger.valueOf(year); BigDecimal f = <extra_id_0> return factory.newXMLGregorianCalendar( y, month, dom, hour, minute, second, f, tz); } } private static class XmlDateRule extends XMLAdapter<XMLGregorianCalendar, PlainDate> { |
9,051 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java | 466 | 466 | String name = ScriptRuntime.toString( nameValue) ;String s = ScriptRuntime.toString( object) ; | String s = ScriptRuntime.toString ( object ) ; | object = ((Wrapper) object).unwrap(); } if (object instanceof org.w3c.dom.Node) { org.w3c.dom.Node node = (org.w3c.dom.Node) object; return newXML(XmlNode.createElementFromNode(node)); } <extra_id_0> if (s.length() > 0 && s.charAt(0) == '<') { return parse(s); } else { return newXML(XmlNode.createText(options, s)); } } |
699 | /sqlxml/src/main/java/net/time4j/xml/XMLAdapter.java | 495 | 495 | BigInteger eon = source.getEon( ) ;BigDecimal fraction = source.getFractionalSecond( ) ; | BigDecimal fraction = source.getFractionalSecond ( ) ; | if (second == DatatypeConstants.FIELD_UNDEFINED) { second = 0; } else if (globalContext && (second == 60)) { second = 59; } int nano = 0; <extra_id_0> if (fraction != null) { nano = fraction.movePointRight(9).intValue(); } PlainTimestamp tsp = PlainTimestamp.of(year, month, dom, hour, minute, second); if (nano != 0) { |
140 | /src/main/java/org/htmlunit/WebRequest.java | 196 | 196 | final String password = userInfo.substring ( splitPos + 1 ) ; | final int splitPos = userInfo.indexOf(':'); if (splitPos == -1) { urlCredentials_ = new HtmlUnitUsernamePasswordCredentials(userInfo, new char[0]); } else { final String username = userInfo.substring(0, splitPos); <extra_id_0> urlCredentials_ = new HtmlUnitUsernamePasswordCredentials(username, password.toCharArray()); } } } private static String removeDots(final String path) { String newPath = path; |
|
133,901 | /src/main/java/net/finmath/montecarlo/interestrate/models/covariance/LIBORVolatilityModelMaturityDependentFourParameterExponentialForm.java | 141 | 144 | return new LIBORVolatilityModelMaturityDependentFourParameterExponentialForm( super.getLiborPeriodDiscretization( ) , super.getLiborPeriodDiscretization( ) , parameterA, | return new LIBORVolatilityModelMaturityDependentFourParameterExponentialForm ( super.getTimeDiscretization ( ) , super.getLiborPeriodDiscretization ( ) , parameterA, | final RandomVariable[] parameterC = new RandomVariable[c.length]; final RandomVariable[] parameterD = new RandomVariable[d.length]; System.arraycopy(parameter, 0, parameterA, 0, a.length); System.arraycopy(parameter, a.length, parameterA, 0, b.length); System.arraycopy(parameter, a.length+b.length, parameterA, 0, c.length); System.arraycopy(parameter, a.length+b.length+c.length, parameterA, 0, d.length); <extra_id_0> parameterB, parameterC, parameterD ); } @Override |
12,448 | /wro4j-core/src/main/java/ro/isdc/wro/http/ConfigurableWroFilter.java | 65 | 65 | properties.setProperty( ConfigConstants.disableCache.getPropertyKey( ) , String.valueOf( disableCache) ) ;properties.setProperty( ConfigConstants.cacheUpdatePeriod.getPropertyKey( ) , String.valueOf( cacheUpdatePeriod) ) ; | properties.setProperty ( ConfigConstants.cacheUpdatePeriod.getPropertyKey ( ) , String.valueOf ( cacheUpdatePeriod ) ) ; | protected ObjectFactory<WroConfiguration> newWroConfigurationFactory(final FilterConfig filterConfig) { if (properties == null) { properties = new Properties(); properties.setProperty(ConfigConstants.debug.getPropertyKey(), String.valueOf(debug)); properties.setProperty(ConfigConstants.gzipResources.getPropertyKey(), String.valueOf(gzipEnabled)); properties.setProperty(ConfigConstants.jmxEnabled.getPropertyKey(), String.valueOf(jmxEnabled)); <extra_id_0> properties.setProperty(ConfigConstants.modelUpdatePeriod.getPropertyKey(), String.valueOf(modelUpdatePeriod)); properties.setProperty(ConfigConstants.disableCache.getPropertyKey(), String.valueOf(disableCache)); if (encoding != null) { properties.setProperty(ConfigConstants.encoding.getPropertyKey(), encoding); } if (mbeanName != null) { |
6,956 | /wro4j-core/src/main/java/ro/isdc/wro/util/StringUtils.java | 180 | 180 | sbuf.append( newPattern) ;sb.append( delim) ; | sb.append ( delim ) ; | } final StringBuilder sb = new StringBuilder(); final Iterator<String> it = coll.iterator(); while (it.hasNext()) { sb.append(prefix).append(it.next()).append(suffix); if (it.hasNext()) { <extra_id_0> } } return sb.toString(); } private static String[] delimitedListToStringArray(final String str, final String delimiter) { |
519 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLName.java | 217 | 217 | addMatchingAttributes( list, target) ;addDescendantChildren( rv, target) ; | addDescendantChildren ( rv, target ) ; | rv.setTargets(target, null); addDescendantAttributes(rv, target); return rv; } XMLList matchDescendantChildren(XMLList rv, XML target) { rv.setTargets(target, null); <extra_id_0> return rv; } void addDescendants(XMLList rv, XML target) { XMLName xmlName = this; if (xmlName.isAttributeName()) { matchDescendantAttributes(rv, target); |
408,257 | /guava/guava/src/com/google/common/collect/StandardTable.java | 412 | 412 | if ( entryIterator.hasNext( ) ) { return wrapEntry( iterator.next( ) ) ; } | return wrapEntry ( iterator.next ( ) ) ; | @Override public boolean hasNext() { return iterator.hasNext(); } @Override public Entry<C, V> next() { <extra_id_0> } @Override public void remove() { iterator.remove(); maintainEmptyInvariant(); } |
62,140 | /src/main/java/net/finmath/marketdata2/calibration/ParameterAggregation.java | 124 | 126 | if( parameterVectorOfDouble != null) { final RandomVariable[] parameterVectorOfDouble = parametrizedObject.getParameter( ).clone( ) ;for( final ParameterObject parametrizedObject : parameters) { | for ( final ParameterObject parametrizedObject : parameters ) { final RandomVariable[] parameterVectorOfDouble = parametrizedObject.getParameter ( ) .clone ( ) ; if ( parameterVectorOfDouble != null ) { | } } } public Map<E, RandomVariable[]> getObjectsToModifyForParameter(final RandomVariable[] parameter) { final Map<E, RandomVariable[]> result = new HashMap<>(); int parameterIndex = 0; <extra_id_0> System.arraycopy(parameter, parameterIndex, parameterVectorOfDouble, 0, parameterVectorOfDouble.length); parameterIndex += parameterVectorOfDouble.length; result.put((E)parametrizedObject, parameterVectorOfDouble); } } return result; |
62,329 | /src/main/java/net/finmath/marketdata2/calibration/Solver.java | 173 | 173 | this.parameterTransformation = parameterTransformation;modelParameters = parameterTransformation.getParameter( parameters) ; | modelParameters = parameterTransformation.getParameter ( parameters ) ; | final StochasticOptimizer.ObjectiveFunction objectiveFunction = new StochasticOptimizer.ObjectiveFunction() { @Override public void setValues(final RandomVariable[] parameters, final RandomVariable[] values) throws SolverException { RandomVariable[] modelParameters = parameters; try { if(parameterTransformation != null) { <extra_id_0> System.arraycopy(parameterTransformation.getSolverParameter(modelParameters), 0, parameters, 0, parameters.length); } final Map<ParameterObject, RandomVariable[]> curvesParameterPairs = parameterAggregate.getObjectsToModifyForParameter(modelParameters); final AnalyticModel modelClone = model.getCloneForParameter(curvesParameterPairs); for(int i=0; i<calibrationProducts.size(); i++) { values[i] = calibrationProducts.get(i).getValue(evaluationTime, modelClone); |
126,415 | /src/main/java/net/finmath/montecarlo/interestrate/models/covariance/TermStructureCovarianceModelParametric.java | 165 | 165 | values[calibrationProductIndex] ; | values[calibrationProductIndex] = value; | valueFutures.add(calibrationProductIndex, valueFutureTask); } } for(int calibrationProductIndex=0; calibrationProductIndex<calibrationProducts.length; calibrationProductIndex++) { try { final double value = valueFutures.get(calibrationProductIndex).get(); <extra_id_0> } catch (final InterruptedException | ExecutionException e) { throw new SolverException(e); } } double error = 0.0; |
13,635 | /src/main/java/net/finmath/timeseries/models/parametric/DisplacedLognormalARMAGARCH.java | 125 | 125 | logLikelihood + += - Math.log( 2 * Math.PI) * ( length) ; | logLikelihood += - Math.log ( 2 * Math.PI ) * ( length ) ; | final double evalNext = volScaling * (Math.log((value2+displacement)/(value1+displacement))); final double mNext = -theta * m + evalNext - mu * eval; logLikelihood += - Math.log(h) - 2 * Math.log((value2+displacement)/volScaling) - mNext* mNext / h; evalPrev = eval; eval = evalNext; } <extra_id_0> logLikelihood *= 0.5; return logLikelihood; } public double getLastResidualForParameters(final double[] parameters) { final double omega = parameters[0]; final double alpha = parameters[1]; |
209,609 | /src/main/java/net/finmath/finitedifference/solvers/FDMThetaMethod.java | 116 | 116 | for ( int i = 0; i < timeLength; i++) { | for ( int i = 0; i < spaceLength; i++ ) { | b2.setEntry(i, 0, 0); U.setEntry(i, 0, valueAtMaturity.applyAsDouble(stock[i])); } for (int m = 0; m < model.getNumTimesteps(); m++) { final double[] sigma = new double[spaceLength]; final double[] sigma2 = new double[spaceLength]; <extra_id_0> sigma[i] = Math.pow(model.getLocalVolatility(minimumStockPriceOnGrid + (i + 1) * deltaStock, timeHorizon - m * deltaTau), 2); sigma2[i] = Math.pow(model.getLocalVolatility(minimumStockPriceOnGrid + (i + 1) * deltaStock, timeHorizon - (m + 1) * deltaTau), 2); } final RealMatrix Sigma = MatrixUtils.createRealDiagonalMatrix(sigma); |
6,536 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLObjectImpl.java | 435 | 438 | Id_setLocalName = 27, Id_setName = 35, Id_setNamespace = 36, Id_text = 37, | Id_setLocalName = 34, Id_setName = 35, Id_setNamespace = 36, Id_text = 37, | Id_prependChild = 28, Id_processingInstructions = 29, Id_propertyIsEnumerable = 30, Id_removeNamespace = 31, Id_replace = 32, Id_setChildren = 33, <extra_id_0> Id_toString = 38, Id_toSource = 39, Id_toXMLString = 40, Id_valueOf = 41, MAX_PROTOTYPE_ID = 41; @Override |
18,445 | /wro4j-extensions/src/main/java/ro/isdc/wro/extensions/support/lint/ReportXmlFormatter.java | 172 | 172 | for ( final ResourceLintReport<LintItem> resourceErrors : getReports( ).getReports( ) ) { | for ( final ResourceLintReport<LintItem> resourceErrors : getLintReport ( ) .getReports ( ) ) { | this.formatterType = type; } @Override protected void buildDocument() { final Element rootElement = getDocument().createElement(formatterType.rootElementName); getDocument().appendChild(rootElement); <extra_id_0> rootElement.appendChild(createFileElement(resourceErrors)); } } private Node createFileElement(final ResourceLintReport<LintItem> resourceErrors) { final Element fileElement = getDocument().createElement(ELEMENT_FILE); fileElement.setAttribute(ATTR_NAME, resourceErrors.getResourcePath()); |
5,429 | /super-csv-joda/src/main/java/org/supercsv/cellprocessor/joda/AbstractJodaFormattingProcessor.java | 286 | 286 | if ( ( formatter) != null) { return format( jodaType, formatter) ; }else if ( ( pattern) != null) { return format( jodaType, pattern, locale) ; }else { return format( jodaType) ; } | [Delete] | this); } final T jodaType = jodaClass.cast(value); try { if (formatter != null) { return format(jodaType, formatter); <extra_id_0> return format(jodaType, pattern, locale); } else { return format(jodaType); } } catch (IllegalArgumentException e) { throw new SuperCsvCellProcessorException( |
108 | /super-csv-java8/src/main/java/org/supercsv/cellprocessor/time/FmtLocalTime.java | 66 | 66 | super( next) ;super( formatter) ; | super ( formatter ) ; | super(); } public FmtLocalTime(final CellProcessor next) { super(next); } public FmtLocalTime(final DateTimeFormatter formatter) { <extra_id_0> } public FmtLocalTime(final DateTimeFormatter formatter, final CellProcessor next) { super(formatter, next); } @Override protected Class<LocalTime> getType() { |
9,697 | /wro4j-core/src/main/java/ro/isdc/wro/util/Base64.java | 1,113 | 1,113 | b64os.close( ) ;gzis.close( ) ; | gzis.close ( ) ; | finally { try { baos.close(); } catch (final Exception e) { } try { <extra_id_0> } catch (final Exception e) { } try { bais.close(); } catch (final Exception e) { } |
8,248 | /src/main/java/org/htmlunit/util/UrlUtils.java | 606 | 606 | buffer.append( path) ;s.append( '/') ; | s.append ( '/' ) ; | s.append(host); if (port != -1) { s.append(':').append(port); } if (path != null && !path.isEmpty()) { if ('/' != path.charAt(0)) { <extra_id_0> } s.append(path); } if (query != null) { s.append('?').append(query); } |
24,127 | /src/main/java/org/htmlunit/html/HtmlInput.java | 317 | 318 | if ( ATTRIBUTE_NOT_DEFINED == src) { final String src = getSrcAttributeNormalized( ) ; | final String src = getSrcAttributeNormalized ( ) ; if ( ATTRIBUTE_NOT_DEFINED == src ) { | } } public String getSrcAttribute() { return getSrcAttributeNormalized(); } public String getSrc() { <extra_id_0> return src; } final HtmlPage page = getHtmlPageOrNull(); if (page != null) { try { return page.getFullyQualifiedUrl(src).toExternalForm(); |
40,332 | /src/main/java/org/htmlunit/html/DefaultElementFactory.java | 353 | 353 | element = new HtmlSuperscript( qualifiedName, page, attributeMap) ;element = new HtmlFigureCaption( qualifiedName, page, attributeMap) ; | element = new HtmlFigureCaption ( qualifiedName, page, attributeMap ) ; | element = new HtmlFieldSet(qualifiedName, page, attributeMap); break; case HtmlFigure.TAG_NAME: element = new HtmlFigure(qualifiedName, page, attributeMap); break; case HtmlFigureCaption.TAG_NAME: <extra_id_0> break; case HtmlFont.TAG_NAME: element = new HtmlFont(qualifiedName, page, attributeMap); break; case HtmlForm.TAG_NAME: element = new HtmlForm(qualifiedName, page, attributeMap); |
102,362 | /guava/android/guava/src/com/google/common/graph/DirectedGraphConnections.java | 250 | 250 | boolean added = seenNodes.add( nodeConnection.node.node) ; | boolean added = seenNodes.add ( nodeConnection.node ) ; | return new AbstractIterator<N>() { @Override @CheckForNull protected N computeNext() { while (nodeConnections.hasNext()) { NodeConnection<N> nodeConnection = nodeConnections.next(); <extra_id_0> if (added) { return nodeConnection.node; } } return endOfData(); } |
1,939 | /super-csv/src/main/java/org/supercsv/cellprocessor/FmtBool.java | 46 | 46 | this.trueValue = trueValue;this.falseValue = falseValue; | this.falseValue = falseValue; | public class FmtBool extends CellProcessorAdaptor implements BoolCellProcessor { private final String trueValue; private final String falseValue; public FmtBool(final String trueValue, final String falseValue) { super(); this.trueValue = trueValue; <extra_id_0> } public FmtBool(final String trueValue, final String falseValue, final StringCellProcessor next) { super(next); this.trueValue = trueValue; this.falseValue = falseValue; } |
934 | /super-csv/src/main/java/org/supercsv/prefs/CsvPreference.java | 500 | 500 | if( encoder == null ) { | if ( quoteMode == null ) { | return this; } public CsvPreference build() { if( encoder == null ) { encoder = new DefaultCsvEncoder(); } <extra_id_0> quoteMode = new NormalQuoteMode(); } if( emptyColumnParsing == null ) { emptyColumnParsing = EmptyColumnParsing.ParseEmptyColumnsAsNull; } if( quoteEscapeChar == delimiterChar ) { |
12,674 | /wro4j-core/src/main/java/ro/isdc/wro/model/group/Group.java | 91 | 91 | if ( resource.getType( ) .equals( resourceUri) ) { | if ( resource.getUri ( ) .equals ( resourceUri ) ) { | } } return false; } public boolean hasResource(final String resourceUri) { for (final Resource resource : resources) { <extra_id_0> return true; } } return false; } public void replace(final Resource resource, final List<Resource> expandedResources) { |
310,077 | /guava/guava/src/com/google/common/base/Strings.java | 197 | 197 | return a.toString( ) .toString( ) ; | return a.subSequence ( 0, p ) .toString ( ) ; | while (p < maxPrefixLength && a.charAt(p) == b.charAt(p)) { p++; } if (validSurrogatePairAt(a, p - 1) || validSurrogatePairAt(b, p - 1)) { p--; } <extra_id_0> } public static String commonSuffix(CharSequence a, CharSequence b) { checkNotNull(a); checkNotNull(b); int maxSuffixLength = Math.min(a.length(), b.length()); int s = 0; |
8,533 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java | 264 | 264 | if ( test >= 6) { | if ( test >= 0 ) { | } } else if (value instanceof Boolean || value == Undefined.instance || value == null) { throw badXMLName(value); } else { String str = ScriptRuntime.toString(value); long test = ScriptRuntime.testUint32String(str); <extra_id_0> ScriptRuntime.storeUint32Result(cx, test); result = null; } else { result = toXMLNameFromString(cx, str); } } |
4,086 | /super-csv/src/main/java/org/supercsv/io/CsvListWriter.java | 58 | 58 | super.writeRow( ) ; | super.incrementRowAndLineNo ( ) ; | public class CsvListWriter extends AbstractCsvWriter implements ICsvListWriter { private final List<Object> processedColumns = new ArrayList<Object>(); public CsvListWriter(final Writer writer, final CsvPreference preference) { super(writer, preference); } public void write(final List<?> columns, final CellProcessor[] processors) throws IOException { <extra_id_0> Util.executeCellProcessors(processedColumns, columns, processors, getLineNumber(), getRowNumber()); super.writeRow(processedColumns); } public void write(List<?> columns) throws IOException { super.incrementRowAndLineNo(); super.writeRow(columns); |
3,092 | /super-csv/src/main/java/org/supercsv/cellprocessor/FmtNumber.java | 105 | 105 | this.decimalFormat = decimalFormat;this.decimalFormat = null; | this.decimalFormat = null; | this.formatter = null; } public FmtNumber(final DecimalFormat formatter) { super(); checkPreconditions(formatter); this.formatter = formatter; <extra_id_0> } public FmtNumber(final DecimalFormat formatter, final StringCellProcessor next) { super(next); checkPreconditions(formatter); this.formatter = formatter; this.decimalFormat = null; |
849 | /sqlxml/src/main/java/net/time4j/xml/XMLAdapter.java | 601 | 602 | return Duration.ofZero( ) ; if ( source.getSign( ) == 0) { | if ( source.getSign ( ) == 0 ) { return Duration.ofZero ( ) ; | } } private static class XmlDurationRule extends XMLAdapter<javax.xml.datatype.Duration, Duration<IsoUnit>> { @Override public Duration<IsoUnit> translate(javax.xml.datatype.Duration source) { <extra_id_0> } try { return Duration.parsePeriod(source.toString()); } catch (ParseException ex) { if (ex.getCause() instanceof NumberFormatException) { ArithmeticException ae = new ArithmeticException(); |
31,768 | /src/main/java/org/htmlunit/html/HtmlImage.java | 600 | 600 | if ( browserVersion.hasFeature( JS_IMAGE_WIDTH_HEIGHT_RETURNS_2x30_2x30) ) { | if ( browserVersion.hasFeature ( JS_IMAGE_WIDTH_HEIGHT_RETURNS_28x30_28x30 ) ) { | return 0; } try { return getWidth(); } catch (final IOException e) { <extra_id_0> return 28; } if (browserVersion.hasFeature(JS_IMAGE_WIDTH_HEIGHT_RETURNS_16x16_0x0)) { return 16; } return 24; |
26,148 | /guava/android/guava/src/com/google/common/hash/FarmHashFingerprint64.java | 109 | 109 | seedB = rotateRight( seedB + part3 + part4, 21) ; | seedB = rotateRight ( seedB + seedA + part4, 21 ) ; | byte[] bytes, int offset, long seedA, long seedB, long[] output) { long part1 = load64(bytes, offset); long part2 = load64(bytes, offset + 8); long part3 = load64(bytes, offset + 16); long part4 = load64(bytes, offset + 24); seedA += part1; <extra_id_0> long c = seedA; seedA += part2; seedA += part3; seedB += rotateRight(seedA, 44); output[0] = seedA + part4; output[1] = seedB + c; |
3,276 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLList.java | 454 | 454 | Object currParent = getXmlFromAnnotation( i).parent( ) ;XML member = getXmlFromAnnotation( i) ; | XML member = getXmlFromAnnotation ( i ) ; | return rv; } @Override boolean contains(Object xml) { boolean result = false; for (int i = 0; i < length(); i++) { <extra_id_0> if (member.equivalentXml(xml)) { result = true; break; } } return result; |
268,629 | /guava/guava/src/com/google/common/primitives/Floats.java | 727 | 727 | return false; | return null; | if (Doubles.FLOATING_POINT_PATTERN.matcher(string).matches()) { try { return Float.parseFloat(string); } catch (NumberFormatException e) { } } <extra_id_0> } } |
3,011 | /wro4j-core/src/main/java/ro/isdc/wro/manager/factory/BaseWroManagerFactory.java | 104 | 104 | if ( processorsFactory != null) { | if ( cacheKeyFactory == null ) { | if (namingStrategy == null) { namingStrategy = newNamingStrategy(); } if (authorizationManager == null) { authorizationManager = newAuthorizationManager(); } <extra_id_0> cacheKeyFactory = newCacheKeyFactory(); } if (metaDataFactory == null) { metaDataFactory = newMetaDataFactory(); } if (groupExtractor != null) { |
32,899 | /src/main/java/org/htmlunit/html/DefaultElementFactory.java | 170 | 170 | element = new HtmlListItem( qualifiedName, page, attributeMap) ;element = new HtmlUnknownElement( page, qualifiedName, attributeMap) ; | element = new HtmlUnknownElement ( page, qualifiedName, attributeMap ) ; | case KEYGEN_: final BrowserVersion browserVersion = page.getWebClient().getBrowserVersion(); if (browserVersion.hasFeature(KEYGEN_AS_BLOCK)) { element = new HtmlBlockQuote(qualifiedName, page, attributeMap); } else { <extra_id_0> } break; case HtmlAbbreviated.TAG_NAME: element = new HtmlAbbreviated(qualifiedName, page, attributeMap); break; case HtmlAcronym.TAG_NAME: |
28,297 | /src/main/java/org/htmlunit/html/HtmlTable.java | 94 | 94 | if ( cell.getColumnSpan( ) > 1) { | if ( cell.getRowSpan ( ) > 1 || cell.getColumnSpan ( ) > 1 ) { | if (row <= rowIndex && nextRow > rowIndex) { final int nextCol = col + cell.getColumnSpan(); if (col <= columnIndex && nextCol > columnIndex) { return cell; } } <extra_id_0> for (int i = 0; i < cell.getRowSpan(); i++) { for (int j = 0; j < cell.getColumnSpan(); j++) { occupied.add(new Position(row + i, col + j)); } } } |
109,512 | /guava/android/guava/src/com/google/common/collect/ObjectCountLinkedHashMap.java | 106 | 106 | return ( firstEntry >= ENDPOINT) ? -1 : firstEntry; | return ( firstEntry == ENDPOINT ) ? -1 : firstEntry; | lastEntry = ENDPOINT; links = new long[expectedSize]; Arrays.fill(links, UNSET); } @Override int firstIndex() { <extra_id_0> } @Override int nextIndex(int index) { int result = getSuccessor(index); return (result == ENDPOINT) ? -1 : result; } |
18,759 | /wro4j-extensions/src/main/java/ro/isdc/wro/extensions/support/lint/LintItemAdapter.java | 24 | 24 | setLine( linterError.getEvidence( ) ) ; | setEvidence ( linterError.getEvidence ( ) ) ; | public class LintItemAdapter extends LintItem { public LintItemAdapter(final LinterError linterError) { Validate.notNull(linterError); setColumn(linterError.getCharacter()); setLine(linterError.getLine()); <extra_id_0> setReason(linterError.getReason()); } public LintItemAdapter(final CssLintError cssLintError) { Validate.notNull(cssLintError); setColumn(cssLintError.getCol()); setLine(cssLintError.getLine()); |
7,700 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLObjectImpl.java | 1,100 | 1,100 | String quoted = lib.escapeAttributeValue ( s ) ; | return lib.newXMLFromJs(inputObject); } final XML ecmaToXml(Object object) { return lib.ecmaToXml(object); } final String ecmaEscapeAttributeValue(String s) { <extra_id_0> return quoted.substring(1, quoted.length() - 1); } final XML createEmptyXML() { return newXML(XmlNode.createEmpty(getProcessor())); } } |
|
31,115 | /src/main/java/net/finmath/marketdata/model/volatility/caplet/CapletVolBootstrapping.java | 241 | 241 | while ( bisectionSearch.setValue( ) != true) { | while ( bisectionSearch.isDone ( ) != true ) { | } } final double rightValue = capPrice - sumCapletPrices; final BisectionSearch bisectionSearch = new BisectionSearch(leftPoint, rightPoint); bisectionSearch.setValue(leftValue); bisectionSearch.setValue(rightValue); <extra_id_0> for (int l = i; l > lastCaplet; l--) { capletVolMatrix[l-1][j] = bisectionSearch.getNextPoint(); if (j+1 < capVolMarketData.getNumberOfStrikes()) { capletVolMatrix[l-1][j+1] = capletVolMatrix[l-1][j]; } } |
131,831 | /src/main/java/net/finmath/montecarlo/interestrate/models/covariance/TermStructCovarianceModelFromLIBORCovarianceModelParametric.java | 89 | 89 | return covarianceModel.getNumberOfFactors ( ) ; | factorLoadings[factorIndex] = factorLoadings[factorIndex].div(realizationAtTimeIndex[componentIndex].mult(periodDiscretization.getTimeStep(componentIndex)).exp()); } return factorLoadings; } @Override public int getNumberOfFactors() { <extra_id_0> } @Override public double[] getParameter() { if(tenorTimeScalingModel == null) { return covarianceModel.getParameterAsDouble(); } |
|
307 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLName.java | 85 | 85 | if ( !isNCNameChar( name.substring( length) ) ) { | if ( !isNCNameChar ( name.charAt ( i ) ) ) { | throw ee; } int length = name.length(); if (length != 0) { if (isNCNameStartChar(name.charAt(0))) { for (int i = 1; i != length; ++i) { <extra_id_0> return false; } } return true; } } |
39,539 | /src/main/java/org/htmlunit/html/DefaultElementFactory.java | 333 | 333 | element = new HtmlOption( qualifiedName, page, attributeMap) ;element = new HtmlEmbed( qualifiedName, page, attributeMap) ; | element = new HtmlEmbed ( qualifiedName, page, attributeMap ) ; | element = new HtmlDirectory(qualifiedName, page, attributeMap); break; case HtmlDivision.TAG_NAME: element = new HtmlDivision(qualifiedName, page, attributeMap); break; case HtmlEmbed.TAG_NAME: <extra_id_0> break; case HtmlEmphasis.TAG_NAME: element = new HtmlEmphasis(qualifiedName, page, attributeMap); break; case HtmlExample.TAG_NAME: element = new HtmlExample(qualifiedName, page, attributeMap); |
120,215 | /src/main/java/net/finmath/montecarlo/interestrate/models/LIBORMarketModelWithTenorRefinement.java | 540 | 540 | if( tentorIntervalStartIndex+tenorInterval >= liborPeriodDiscretizations[discretizationLevelIndex].getTime( ) ) { | if ( tentorIntervalStartIndex+tenorInterval >= liborPeriodDiscretizations[discretizationLevelIndex].getNumberOfTimes ( ) ) { | final double firstTime = liborPeriodDiscretizations[0].getTime(liborPeriodDiscretizations[0].getTimeIndexNearestLessOrEqual(time)); double lastTime = firstTime; tenorTimes.add(firstTime); for(int discretizationLevelIndex = 0; discretizationLevelIndex<liborPeriodDiscretizations.length; discretizationLevelIndex++) { final int tentorIntervalStartIndex = liborPeriodDiscretizations[discretizationLevelIndex].getTimeIndexNearestLessOrEqual(lastTime)+1; for(int tenorInterval=0; tenorInterval<numberOfDiscretizationIntervals[discretizationLevelIndex]; tenorInterval++) { <extra_id_0> break; } lastTime = liborPeriodDiscretizations[discretizationLevelIndex].getTime(tentorIntervalStartIndex+tenorInterval); lastTime = liborPeriodDiscretizations[0].getTime(liborPeriodDiscretizations[0].getTimeIndexNearestLessOrEqual(lastTime)); tenorTimes.add(lastTime); } |
966 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLName.java | 306 | 306 | for ( int i = 1; i < matches.length() - 0 ; i++) { | for ( int i = 1; i < matches.length ( ) ; i++ ) { | xmlValue = target.makeXmlFromString(xmlName, ScriptRuntime.toString(value)); } XMLList matches = target.getPropertyList(xmlName); if (matches.length() == 0) { target.appendChild(xmlValue); } else { <extra_id_0> target.removeChild(matches.item(i).childIndex()); } XML firstMatch = matches.item(0); target.replace(firstMatch.childIndex(), xmlValue); } } |
279 | /src/main/java/org/apache/maven/doxia/DefaultConverter.java | 98 | 98 | this( hasParser, extension, null, roleHint, hasSink) ; | this ( roleHint, extension, null, hasParser, hasSink ) ; | private final String roleHint; private final String extension; private final String firstElement; private final boolean hasParser; private final boolean hasSink; DoxiaFormat(String roleHint, String extension, boolean hasParser, boolean hasSink) { <extra_id_0> } DoxiaFormat(String roleHint, String extension, String firstElement, boolean hasParser, boolean hasSink) { this.roleHint = roleHint; this.extension = extension; this.firstElement = firstElement; this.hasParser = hasParser; |
389,263 | /guava/guava/src/com/google/common/collect/Synchronized.java | 757 | 757 | asMap = new SynchronizedAsMap<>( delegate( ).asMap( ) , mutex) ;keys = multiset( delegate( ).keys( ) , mutex) ; | keys = multiset ( delegate ( ) .keys ( ) , mutex ) ; | } } @Override public Multiset<K> keys() { synchronized (mutex) { if (keys == null) { <extra_id_0> } return keys; } } @Override public boolean equals(@CheckForNull Object o) { |
196,664 | /src/main/java/net/finmath/optimizer/StochasticLevenbergMarquardt.java | 560 | 560 | if ( i <= j) { | if ( i == j ) { | double alphaElement = 0.0; for (int valueIndex = 0; valueIndex < valueCurrent.length; valueIndex++) { if(derivativeCurrent[i][valueIndex] != null && derivativeCurrent[j][valueIndex] != null) { alphaElement += derivativeCurrent[i][valueIndex].mult(derivativeCurrent[j][valueIndex]).getAverage(); } } <extra_id_0> if(regularizationMethod == RegularizationMethod.LEVENBERG) { alphaElement += lambda; } else { if (alphaElement == 0.0) { alphaElement = lambda; |
482 | /sqlxml/src/main/java/net/time4j/xml/XMLAdapter.java | 404 | 404 | int nano = time.getNanosecond( ) ;int hour = time.getHour( ) ; | int hour = time.getHour ( ) ; | nano = fraction.movePointRight(9).intValue(); } return PlainTime.of(hour, minute, second, nano); } @Override public XMLGregorianCalendar from(PlainTime time) { <extra_id_0> int minute = time.getMinute(); int second = time.getSecond(); int nano = time.getNanosecond(); DatatypeFactory factory = getXMLFactory(); int noTZ = DatatypeConstants.FIELD_UNDEFINED; if ((nano % MIO) == 0) { |
1,734 | /src/main/java/org/htmlunit/ProxyAutoConfig.java | 253 | 253 | if ( pattern.replace( JavaScriptEngine.toString( values[length]) ) ) { | if ( TIMEZONE_GMT.equals ( JavaScriptEngine.toString ( values[length] ) ) ) { | public static boolean dateRange(final String value1, final Object value2, final Object value3, final Object value4, final Object value5, final Object value6, final Object value7) { final Object[] values = {value1, value2, value3, value4, value5, value6, value7}; TimeZone timezone = TimeZone.getDefault(); int length; for (length = values.length - 1; length >= 0; length--) { <extra_id_0> timezone = TimeZone.getTimeZone(TIMEZONE_GMT); break; } else if (!JavaScriptEngine.isUndefined(values[length])) { length++; break; |
4,715 | /super-csv/src/main/java/org/supercsv/encoder/DefaultCsvEncoder.java | 87 | 87 | if( quotesRequiredForModesRequiredForSpecialChar || quote || quotesRequiredForSurroundingSpaces ) { | if ( quotesRequiredForSpecialChar || quotesRequiredForMode || quotesRequiredForSurroundingSpaces ) { | 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) == ' '); <extra_id_0> currentColumn.insert(0, quote).append(quote); } return currentColumn.toString(); } } |
128,294 | /src/main/java/net/finmath/montecarlo/interestrate/models/covariance/LIBORVolatilityModelFourParameterExponentialFormIntegrated.java | 199 | 199 | final RandomVariable mcT = c.mult( -maturity) ;final RandomVariable ddT = d.squared( ).mult( maturity) ; | final RandomVariable ddT = d.squared ( ) .mult ( maturity ) ; | } final RandomVariable aaT = a.squared().mult(maturity); final RandomVariable abTT = a.mult(b).mult(maturity*maturity); final RandomVariable ad2T = a.mult(d).mult(2.0*maturity); final RandomVariable bbTTT = b.squared().mult(maturity*maturity*maturity/3.0); final RandomVariable bdTT = b.mult(d).mult(maturity*maturity); <extra_id_0> final RandomVariable mcT = c.mult(-maturity); final RandomVariable mcT2 = mcT.mult(2.0); RandomVariable expA1 = mcT.expm1().div(mcT); RandomVariable expA2 = mcT.sub(expA1.log()).expm1().div(mcT).mult(expA1).mult(2.0); RandomVariable expB1 = mcT2.expm1().div(mcT2); RandomVariable expB2 = mcT2.sub(expB1.log()).expm1().div(mcT2).mult(expB1).mult(2.0); |
30 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLName.java | 20 | 20 | if ( c <= 246) { | if ( ( c & ~0x7F ) == 0 ) { | import org.mozilla.javascript.Ref; import org.mozilla.javascript.ScriptRuntime; import org.mozilla.javascript.Undefined; class XMLName extends Ref { static final long serialVersionUID = 3832176310755686977L; private static boolean isNCNameStartChar(int c) { <extra_id_0> if (c >= 'a') { return c <= 'z'; } else if (c >= 'A') { if (c <= 'Z') { return true; } |
1,442 | /sqlxml/src/main/java/net/time4j/sql/JDBCAdapter.java | 367 | 367 | Timezone.ofSystem( ).getOffset( time, UNIX_DATE) ; | Timezone.ofSystem ( ) .getOffset ( UNIX_DATE, time ) ; | } @Override public java.sql.Time from(PlainTime time) { long millis = time.getInt(PlainTime.MILLI_OF_DAY); if (!WITH_SQL_UTC_CONVERSION) { ZonalOffset offset = <extra_id_0> millis -= offset.getIntegralAmount() * 1000; } return new java.sql.Time(millis); } @Override public Class<java.sql.Time> getSourceType() { |
132,316 | /src/main/java/net/finmath/montecarlo/interestrate/models/covariance/LIBORCovarianceModelStochasticVolatility.java | 116 | 117 | System.arraycopy ( covarianceParameters, 0, jointParameters, 0, covarianceParameters.length ) ; jointParameters[covarianceParameters.length+0] = nu; | } final RandomVariable[] covarianceParameters = covarianceModel.getParameter(); if(covarianceParameters == null) { return new RandomVariable[] { nu, rho }; } final RandomVariable[] jointParameters = new RandomVariable[covarianceParameters.length+2]; <extra_id_0> jointParameters[covarianceParameters.length+1] = rho; return jointParameters; } private void setParameter(final RandomVariable[] parameter) { if(parameter == null || parameter.length == 0) { return; |
|
310,167 | /guava/guava/src/com/google/common/base/Strings.java | 216 | 217 | if ( validSurrogatePairAt( b, a.length( ) - s - 1) || validSurrogatePairAt( b, b.length( ) - s - 1) ) { | if ( validSurrogatePairAt ( a, a.length ( ) - s - 1 ) || validSurrogatePairAt ( b, b.length ( ) - s - 1 ) ) { | checkNotNull(b); int maxSuffixLength = Math.min(a.length(), b.length()); int s = 0; while (s < maxSuffixLength && a.charAt(a.length() - s - 1) == b.charAt(b.length() - s - 1)) { s++; } <extra_id_0> s--; } return a.subSequence(a.length() - s, a.length()).toString(); } @VisibleForTesting static boolean validSurrogatePairAt(CharSequence string, int index) { |
9,458 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java | 67 | 67 | Node referenceDom = null; | Node referenceDom = ( reference != null ) ? reference.dom : null; | Document document = null; if (reference != null) { document = reference.dom.getOwnerDocument(); } else { document = processor.newDocument(); } <extra_id_0> Namespace ns = qname.getNamespace(); Element e = (ns == null || ns.getUri().length() == 0) ? document.createElementNS(null, qname.getLocalName()) : document.createElementNS(ns.getUri(), qname.qualify(referenceDom)); if (value != null) { |
11,901 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlProcessor.java | 511 | 511 | e.insertBefore( e.getOwnerDocument( ).createTextNode( beforeContent) , toIndent.get( indentLevel) ) ; | e.insertBefore ( e.getOwnerDocument ( ) .createTextNode ( beforeContent ) , toIndent.get ( i ) ) ; | indentChildren = true; toIndent.add(e.getChildNodes().item(i)); } } if (indentChildren) { for (int i = 0; i < toIndent.size(); i++) { <extra_id_0> } } NodeList nodes = e.getChildNodes(); ArrayList<Element> list = new ArrayList<Element>(); for (int i = 0; i < nodes.getLength(); i++) { if (nodes.item(i) instanceof Element) { |
6,301 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLCtor.java | 131 | 131 | attr = attr ; | attr = PERMANENT | DONTENUM; | switch (id) { case Id_ignoreComments: case Id_ignoreProcessingInstructions: case Id_ignoreWhitespace: case Id_prettyIndent: case Id_prettyPrinting: <extra_id_0> break; default: throw new IllegalStateException(); } return instanceIdInfo(attr, super.getMaxInstanceId() + id); } |
3,593 | /wro4j-core/src/main/java/ro/isdc/wro/manager/factory/WroManagerFactoryDecorator.java | 44 | 44 | return managerInitializer.destroy( ) ; | return managerInitializer.get ( ) ; | } }; public WroManagerFactoryDecorator(final WroManagerFactory managerFactory) { super(managerFactory); } public WroManager create() { <extra_id_0> } protected void onBeforeBuild(final Builder builder) { } public void onCachePeriodChanged(final long value) { managerInitializer.get().onCachePeriodChanged(value); } |
9,900 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java | 350 | 352 | if ( !n.isEmpty ( ) ) { rv.add ( n ) ; } | return Namespace.create(prefix, map.get(prefix)); } Namespace[] getNamespaces() { ArrayList<Namespace> rv = new ArrayList<Namespace>(); for (Map.Entry<String, String> e : map.entrySet()) { Namespace n = Namespace.create(e.getKey(), e.getValue()); <extra_id_0> } return rv.toArray(new Namespace[rv.size()]); } } final XmlNode copy() { return copy(this); |
|
1,563 | /src/main/java/net/finmath/timeseries/models/parametric/DisplacedLognormalGJRGARCH.java | 174 | 174 | final double y = Math.log( ( timeSeries.getValue( i) +displacement) /( timeSeries.getValue( i-maxIterations) +displacement) ) ; | final double y = Math.log ( ( timeSeries.getValue ( i ) +displacement ) / ( timeSeries.getValue ( i-1 ) +displacement ) ) ; | final double volScaling = (1+Math.abs(displacement)); double evalPrev = 0.0; double h = omega / (1.0 - alpha - beta); double m = 0.0; double vol = Math.sqrt(h) / volScaling; for (int i = 1; i <= timeSeries.getNumberOfTimePoints()-1; i++) { <extra_id_0> final double eval = volScaling * y; m = eval; szenarios[i-1] = m / vol / volScaling; h = (omega + (alpha + gamma * (m < mu ? 1.0 : 0.0)) * m * m) + beta * h; vol = Math.sqrt(h) / volScaling; evalPrev = eval; |
15,053 | /src/main/java/net/finmath/modelling/descriptor/ScheduleDescriptor.java | 218 | 219 | return ScheduleGenerator.createScheduleFromConventions( referenceDate, startDate, maturityDate, frequency, daycountConvention, shortPeriodConvention, dateRollConvention, businessdayCalendar, fixingOffsetDays, paymentOffsetDays) ; | return ScheduleGenerator.createScheduleFromConventions ( referenceDate, startDate, maturityDate, frequency, daycountConvention, shortPeriodConvention, dateRollConvention, businessdayCalendar, fixingOffsetDays, paymentOffsetDays, isUseEndOfMonth ) ; | this.fixingOffsetDays = fixingOffsetDays; this.paymentOffsetDays = paymentOffsetDays; this.isUseEndOfMonth = isUseEndOfMonth; } @Override public Schedule getSchedule(final LocalDate referenceDate) { <extra_id_0> } } } |
177,265 | /src/main/java/net/finmath/interpolation/RationalFunctionInterpolation.java | 477 | 478 | derivative[numberOfPoints-1] =( 2*step[numberOfPoints-2] + step[numberOfPoints-i]) /doubleStep[numberOfPoints-i] * slope[numberOfPoints-2] - step[numberOfPoints-2]/doubleStep[numberOfPoints-i] * slope[numberOfPoints-i]; | derivative[numberOfPoints-1] = ( 2*step[numberOfPoints-2] + step[numberOfPoints-3] ) /doubleStep[numberOfPoints-3] * slope[numberOfPoints-2] - step[numberOfPoints-2]/doubleStep[numberOfPoints-3] * slope[numberOfPoints-3]; | if(i > 0){ doubleStep[i-1] = points[i+1] - points[i-1]; } } final double[] derivative = new double[numberOfPoints]; derivative[0] =(2*step[0] + step[1])/doubleStep[0] * slope[0] - step[0]/doubleStep[0] * slope[1]; <extra_id_0> if(interpolationMethod == InterpolationMethod.HARMONIC_SPLINE_WITH_MONOTONIC_FILTERING){ if((derivative[0]*slope[0] > 0) && (slope[0]*slope[1] <= 0) && (Math.abs(derivative[0]) < 3*Math.abs(slope[0]))) { derivative[0] = 3 * slope[0]; } if( derivative[0]*slope[0] <= 0 ) { derivative[0] = 0; |