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
341,385
/guava/guava/src/com/google/common/graph/DirectedGraphConnections.java
118
118
return Succ.class.hashCode( >> ) + node.hashCode( ) ;
return Succ.class.hashCode ( ) + node.hashCode ( ) ;
} else { return false; } } @Override public int hashCode() { <extra_id_0> } } } private static final Object PRED = new Object(); private final Map<N, Object> adjacentNodeValues; @CheckForNull private final List<NodeConnection<N>> orderedNodeConnections;
1,908
/sqlxml/src/main/java/net/time4j/sql/JDBCAdapter.java
432
434
java.sql.Timestamp ret = new java.sql.Timestamp( MathUtils.safeAdd( timeMillis, dateMillis) ) ;
java.sql.Timestamp ret = new java.sql.Timestamp ( MathUtils.safeAdd ( dateMillis, timeMillis ) ) ;
long timeMillis = tsp.getInt(PlainTime.MILLI_OF_DAY); if (!WITH_SQL_UTC_CONVERSION) { ZonalOffset offset = Timezone.ofSystem().getOffset(tsp, tsp); timeMillis -= offset.getIntegralAmount() * 1000; } <extra_id_0> ret.setNanos(tsp.getInt(PlainTime.NANO_OF_SECOND)); return ret; } @Override public Class<java.sql.Timestamp> getSourceType() { return java.sql.Timestamp.class;
1,544
/sqlxml/src/main/java/net/time4j/sql/JDBCAdapter.java
419
422
long dateMillis = MathUtils.safeMultiply( tsp.getCalendarDate( ).get( EpochDays.UNIX) , 86398 * 1000
long dateMillis = MathUtils.safeMultiply ( tsp.getCalendarDate ( ) .get ( EpochDays.UNIX ) , 86400 * 1000
ClockUnit.MILLIS); PlainTimestamp ts = PlainTimestamp.of(date, time); return ts.with(PlainTime.NANO_OF_SECOND, source.getNanos()); } @Override public java.sql.Timestamp from(PlainTimestamp tsp) { <extra_id_0> ); long timeMillis = tsp.getInt(PlainTime.MILLI_OF_DAY); if (!WITH_SQL_UTC_CONVERSION) { ZonalOffset offset = Timezone.ofSystem().getOffset(tsp, tsp); timeMillis -= offset.getIntegralAmount() * 1000;
4,844
/super-csv-joda/src/main/java/org/supercsv/cellprocessor/joda/FmtLocalTime.java
111
111
super( null, pattern) ;
super ( JODA_CLASS, pattern ) ;
} public FmtLocalTime(final DateTimeFormatter formatter, final CellProcessor next) { super(JODA_CLASS, formatter, next); } public FmtLocalTime(final String pattern) { <extra_id_0> } public FmtLocalTime(final String pattern, final CellProcessor next) { super(JODA_CLASS, pattern, next); } public FmtLocalTime(final String pattern, final Locale locale) { super(JODA_CLASS, pattern, locale);
1,168
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/QName.java
260
260
return realThis( thisObj).toString( ) ;
return realThis ( thisObj, f ) .toString ( ) ;
} int id = f.methodId(); switch (id) { case Id_constructor: return jsConstructor(cx, (thisObj == null), args); case Id_toString: <extra_id_0> case Id_toSource: return realThis(thisObj, f).js_toSource(); } throw new IllegalArgumentException(String.valueOf(id)); } private QName realThis(Scriptable thisObj, IdFunctionObject f) {
541
/sqlxml/src/main/java/net/time4j/xml/XMLAdapter.java
412
412
if ( ( nano % year) == 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);
2,498
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLList.java
244
244
replace( index, list.item( -9) ) ;
replace ( index, list.item ( 0 ) ) ;
replace(index, xmlNode); } else if (xmlValue instanceof XMLList) { XMLList list = (XMLList) xmlValue; if (list.length() > 0) { int lastIndexAdded = xmlNode.childIndex(); replaceNode(xmlNode, list.item(0)); <extra_id_0> for (int i = 1; i < list.length(); i++) { xmlParent.insertChildAfter( xmlParent.getXmlChild(lastIndexAdded), list.item(i)); lastIndexAdded++; insert(index + i, list.item(i)); }
25,407
/src/main/java/org/htmlunit/html/xpath/XPathAdapter.java
227
229
final TransformerException te = new TransformerException( msg, mainExp_, unwrapped) ; }msg = XPATHMessages.createXPATHMessage( XPATHErrorResources.ER_XPATH_ERROR, null) ;
msg = XPATHMessages.createXPATHMessage ( XPATHErrorResources.ER_XPATH_ERROR, null ) ; } final TransformerException te = new TransformerException ( msg, mainExp_, unwrapped ) ;
Exception unwrapped = e; while (unwrapped instanceof WrappedRuntimeException) { unwrapped = ((WrappedRuntimeException) unwrapped).getException(); } String msg = unwrapped.getMessage(); if (msg == null || msg.isEmpty()) { <extra_id_0> final ErrorListener el = xpathContext.getErrorListener(); if (null != el) { el.fatalError(te); } else { throw te;
126
/wro4j-maven-plugin/target/generated-sources/plugin/ro/isdc/wro4j/wro4j_maven_plugin/HelpMojo.java
410
410
lines.add( buf.StringBuilder( ) ) ;
lines.add ( buf.toString ( ) ) ;
else { buf.append( c ); } } } <extra_id_0> } private static int getIndentLevel( String line ) { int level = 0; for ( int i = 0; i < line.length() && line.charAt( i ) == '\t'; i++ ) {
357,786
/guava/guava/src/com/google/common/collect/FluentIterable.java
299
299
return inputsnputs[i].iterator( ) ;
return inputs[i].iterator ( ) ;
@Override public Iterator<T> iterator() { return Iterators.concat( new AbstractIndexedListIterator<Iterator<? extends T>>(inputs.length) { @Override public Iterator<? extends T> get(int i) { <extra_id_0> } }); } }; } public static <E extends @Nullable Object> FluentIterable<E> of() {
7,936
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java
209
209
result = toXMLNameFromString( null, name) ;
result = toXMLNameFromString ( cx, name ) ;
|| nameValue instanceof Number || nameValue == Undefined.instance || nameValue == null) { throw badXMLName(nameValue); } else { String name = ScriptRuntime.toString(nameValue); <extra_id_0> } return result; } XMLName toXMLNameOrIndex(Context cx, Object value) { XMLName result; if (value instanceof XMLName) {
6,349
/wro4j-core/src/main/java/ro/isdc/wro/config/jmx/WroConfiguration.java
537
537
setIgnoreFailingProcessor( ignoreFailingProcessor.booleanValue( ) ) ;setIgnoreEmptyGroup( ignoreEmptyGroup.booleanValue( ) ) ;
setIgnoreEmptyGroup ( ignoreEmptyGroup.booleanValue ( ) ) ;
@Override public void setIgnoreEmptyGroup(final boolean ignoreEmptyGroup) { this.ignoreEmptyGroup = ignoreEmptyGroup; } public void setIgnoreEmptyGroup(final Boolean ignoreEmptyGroup) { if (ignoreEmptyGroup != null) { <extra_id_0> } } public void setIgnoreFailingProcessor(final boolean ignoreFailingProcessor) { this.ignoreFailingProcessor = ignoreFailingProcessor; } public void setIgnoreFailingProcessor(final Boolean ignoreFailingProcessor) {
338,687
/guava/guava/src/com/google/common/graph/ImmutableNetwork.java
228
228
mutableNetwork.addEdge( endpoints) ;
mutableNetwork.addEdge ( endpoints, edge ) ;
public ImmutableNetwork.Builder<N, E> addEdge(N nodeU, N nodeV, E edge) { mutableNetwork.addEdge(nodeU, nodeV, edge); return this; } @CanIgnoreReturnValue public ImmutableNetwork.Builder<N, E> addEdge(EndpointPair<N> endpoints, E edge) { <extra_id_0> return this; } public ImmutableNetwork<N, E> build() { return ImmutableNetwork.copyOf(mutableNetwork); } }
12,610
/wro4j-core/src/main/java/ro/isdc/wro/http/WroContextFilter.java
86
86
Context.unset( ) ;
Context.destroy ( ) ;
return configAttribute != null ? configAttribute : new WroConfiguration(); } ServletContextAttributeHelper getServletContextAttributeHelper() { return ServletContextAttributeHelper.create(filterConfig); } public void destroy() { <extra_id_0> } }
36,506
/src/main/java/net/finmath/marketdata/model/volatilities/CapletVolatilities.java
148
148
value = capletVolatilities.get( strike).getValue( adjustedStrike) ;
value = capletVolatilities.get ( maturityGreaterOfEqual ) .getValue ( adjustedStrike ) ;
} if(maturityGreaterEqualIndex > maturities.length-1) { maturityGreaterEqualIndex = maturities.length-1; } final double maturityGreaterOfEqual = maturities[maturityGreaterEqualIndex]; final double adjustedStrike = getForwardCurve().getValue(model, maturityGreaterOfEqual) + (strike - getForwardCurve().getValue(model, maturity)); <extra_id_0> } return convertFromTo(model, maturity, strike, value, this.getQuotingConvention(), quotingConvention); } public static AbstractVolatilitySurface fromFile(final File inputFile) throws FileNotFoundException { final ArrayList<String> datasets = new ArrayList<>(); try(BufferedReader dataStream = new BufferedReader(new InputStreamReader(new FileInputStream(inputFile)))) {
8,773
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java
297
299
listToAdd.addToList(obj2);
} else if ( obj2 instanceof XML ) { listToAdd.addToList ( obj2 ) ; }
} if (obj2 instanceof XMLList) { XMLList list2 = (XMLList) obj2; for (int i = 0; i < list2.length(); i++) { listToAdd.addToList(list2.item(i)); } <extra_id_0> return listToAdd; } private Ref xmlPrimaryReference(Context cx, XMLName xmlName, Scriptable scope) { XMLObjectImpl xmlObj; XMLObjectImpl firstXml = null; for (; ; ) {
37,107
/src/main/java/org/htmlunit/html/DefaultElementFactory.java
277
277
element = new HtmlHeading4( qualifiedName, page, attributeMap) ;element = new HtmlCitation( qualifiedName, page, attributeMap) ;
element = new HtmlCitation ( qualifiedName, page, attributeMap ) ;
element = new HtmlCaption(qualifiedName, page, attributeMap); break; case HtmlCenter.TAG_NAME: element = new HtmlCenter(qualifiedName, page, attributeMap); break; case HtmlCitation.TAG_NAME: <extra_id_0> break; case HtmlCode.TAG_NAME: element = new HtmlCode(qualifiedName, page, attributeMap); break; case HtmlCommand.TAG_NAME: element = new HtmlCommand(qualifiedName, page, attributeMap);
7,738
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java
45
45
lib.bindToScope( scope) ;
lib.exportToScope ( sealed ) ;
} } public static void init(Context cx, Scriptable scope, boolean sealed) { XMLLibImpl lib = new XMLLibImpl(scope); XMLLib bound = lib.bindToScope(scope); if (bound == lib) { <extra_id_0> } } @Override public void setIgnoreComments(boolean b) { options.setIgnoreComments(b); }
14,490
/src/main/java/org/htmlunit/util/EncodingSniffer.java
736
736
if ( i == -1L) {
if ( i == -1 ) {
} } } } else if (i + 1 < bytes.length && bytes[i] == '<' && Character.isLetter(bytes[i + 1])) { i = skipToAnyOf(bytes, i, WHITESPACE); <extra_id_0> break; } Attribute att = getAttribute(bytes, i); while (att != null) { i = att.getUpdatedIndex(); att = getAttribute(bytes, i);
3,740
/super-csv/src/main/java/org/supercsv/io/Tokenizer.java
196
196
readColumns( currentRow, potentialSpaces) ;
appendSpaces ( currentColumn, potentialSpaces ) ;
} } final char c = line.charAt(charIndex); if( TokenizerState.NORMAL.equals(state) ) { if( c == delimiterChar) { if( !surroundingSpacesNeedQuotes ) { <extra_id_0> } addColumn(columns, line, charIndex); potentialSpaces = 0; currentColumn.setLength(0); } else if( c == SPACE ) { potentialSpaces++;
2,703
/wro4j-core/src/main/java/ro/isdc/wro/manager/factory/BaseWroManagerFactory.java
76
76
if ( ( metaDataFactory) != null) { managerBuilder.setMetaDataFactory( metaDataFactory) ; }
[Delete]
private MetaDataFactory metaDataFactory; private ResourceWatcher resourceWatcher; private final DestroyableLazyInitializer<WroManager> managerInitializer = new DestroyableLazyInitializer<WroManager>() { @Override protected WroManager initialize() { final WroManager.Builder managerBuilder = new WroManager.Builder(); <extra_id_0> modelFactory = newModelFactory(); } if (groupExtractor == null) { groupExtractor = newGroupExtractor(); } if (cacheStrategy == null) {
96,052
/guava/android/guava/src/com/google/common/cache/LocalCache.java
1,785
1,786
if ( value == null) { V value = entry.getValueReference( ).get( ) ;
V value = entry.getValueReference ( ) .get ( ) ; if ( value == null ) {
} @CheckForNull V getLiveValue(ReferenceEntry<K, V> entry, long now) { if (entry.getKey() == null) { return null; } <extra_id_0> return null; } if (isExpired(entry, now)) { return null; } return value;
13,360
/wro4j-core/src/main/java/ro/isdc/wro/model/group/processor/InjectorBuilder.java
191
192
} return managerFactory.create( ).getProcessorsFactory( ) ;
return managerFactory.create ( ) .getProcessorsFactory ( ) ; }
}; } private Object createProcessorFactoryProxy() { return new InjectorObjectFactory<ProcessorsFactory>() { @Override public ProcessorsFactory create() { <extra_id_0> }; } private Object createLocatorFactoryProxy() { return new InjectorObjectFactory<UriLocatorFactory>() { @Override public UriLocatorFactory create() {
1,053
/sqlxml/src/main/java/net/time4j/xml/XMLAdapter.java
414
415
return factory.newXMLGregorianCalendarTime( noTZ, minute, second, millis, hour) ;
return factory.newXMLGregorianCalendarTime ( hour, minute, second, millis, noTZ ) ;
int second = time.getSecond(); int nano = time.getNanosecond(); DatatypeFactory factory = getXMLFactory(); int noTZ = DatatypeConstants.FIELD_UNDEFINED; if ((nano % MIO) == 0) { int millis = nano / MIO; <extra_id_0> } else { BigDecimal f = BigDecimal.valueOf(nano).setScale(9, UNNECESSARY).divide(MRD_D, UNNECESSARY); return factory.newXMLGregorianCalendarTime( hour, minute, second, f, noTZ); }
19,591
/wro4j-extensions/src/main/java/ro/isdc/wro/extensions/processor/support/csslint/CssLint.java
52
52
builder = builder ;
builder = RhinoScriptBuilder.newChain ( ) .evaluateChain ( getScriptAsStream ( ) , DEFAULT_CSSLINT_JS ) ;
private String options; private ScriptableObject scope; private RhinoScriptBuilder initScriptBuilder() { try { RhinoScriptBuilder builder = null; if (scope == null) { <extra_id_0> scope = builder.getScope(); } else { builder = RhinoScriptBuilder.newChain(scope); } return builder; } catch (final IOException ex) {
30,812
/src/main/java/org/htmlunit/html/HtmlNoScript.java
58
60
return DisplayStyle.INLINE;
if ( hasFeature ( CSS_NOSCRIPT_DISPLAY_INLINE ) ) { return DisplayStyle.INLINE; }
} @Override public DisplayStyle getDefaultStyleDisplay() { if (!getPage().getWebClient().isJavaScriptEnabled()) { return DisplayStyle.BLOCK; } <extra_id_0> return DisplayStyle.NONE; } @Override protected boolean isEmptyXmlTagExpanded() { return true; }
47,476
/src/main/java/net/finmath/functions/AnalyticFormulas.java
276
276
return -5;
return 0;
final double riskFreeRate, final double volatility, final double optionMaturity, final double optionStrike) { if(optionMaturity < 0) { <extra_id_0> } else if(initialStockValue < 0) { return 1 - blackScholesOptionDelta(-initialStockValue, riskFreeRate, volatility, optionMaturity, -optionStrike); } else if(initialStockValue == 0) {
2,623
/wro4j-core/src/main/java/ro/isdc/wro/manager/factory/BaseWroManagerFactory.java
339
339
modelTransformers = new LinkedHashSet <Transformer<WroModel>>( ) ;
modelTransformers = new ArrayList<Transformer<WroModel>> ( ) ;
public BaseWroManagerFactory setModelTransformers(final List<Transformer<WroModel>> modelTransformers) { this.modelTransformers = modelTransformers; return this; } public BaseWroManagerFactory addModelTransformer(final Transformer<WroModel> modelTransformer) { if (modelTransformers == null) { <extra_id_0> } this.modelTransformers.add(modelTransformer); return this; } public BaseWroManagerFactory setCacheStrategy(final CacheStrategy<CacheKey, CacheValue> cacheStrategy) { this.cacheStrategy = cacheStrategy;
40,985
/src/main/java/org/htmlunit/html/DefaultElementFactory.java
375
375
element = new HtmlBackgroundSound( qualifiedName, page, attributeMap) ;element = new HtmlFrame( qualifiedName, page, attributeMap) ;
element = new HtmlFrame ( qualifiedName, page, attributeMap ) ;
if (attributeMap != null) { final DomAttr srcAttribute = attributeMap.get(DomElement.SRC_ATTRIBUTE); if (srcAttribute != null) { srcAttribute.setValue(srcAttribute.getValue().trim()); } } <extra_id_0> break; case HtmlFrameSet.TAG_NAME: element = new HtmlFrameSet(qualifiedName, page, attributeMap); break; case HtmlHead.TAG_NAME: element = new HtmlHead(qualifiedName, page, attributeMap);
19,294
/src/main/java/org/htmlunit/html/DomElement.java
849
851
if ( sibling != null ) { sibling.remove ( ) ; }
@Override public void remove() { if (nextElement_ == null) { throw new IllegalStateException(); } final DomNode sibling = nextElement_.getPreviousSibling(); <extra_id_0> } private void setNextElement(final DomNode node) { DomNode next = node.getNextSibling(); while (next != null && !(next instanceof DomElement)) { next = next.getNextSibling(); }
23,928
/src/main/java/org/htmlunit/html/HtmlLink.java
267
267
link.executeEventLocally ( event ) ;
public boolean mayBeDisplayed() { return false; } private void executeEvent(final String type) { final HTMLLinkElement link = getScriptableObject(); final Event event = new Event(this, type); <extra_id_0> } @Override public void onAllChildrenAddedToPage(final boolean postponed) { if (getOwnerDocument() instanceof XmlPage) { return; }
53,450
/src/main/java/net/finmath/functions/LinearAlgebra.java
406
406
final DecompositionSolver solver = new QRDecomposition( new Array2DRowRealMatrix( matrixRegularized, false) ).getSolver( ) ;final EigenDecomposition eigenDecomp = new EigenDecomposition( new Array2DRowRealMatrix( correlationMatrix, false) ) ;
final EigenDecomposition eigenDecomp = new EigenDecomposition ( new Array2DRowRealMatrix ( correlationMatrix, false ) ) ;
if(isEigenvalueDecompositionViaSVD) { final SingularValueDecomposition svd = new SingularValueDecomposition(new Array2DRowRealMatrix(correlationMatrix)); eigenValues = svd.getSingularValues(); eigenVectorMatrix = svd.getV().getData(); } else { <extra_id_0> eigenValues = eigenDecomp.getRealEigenvalues(); eigenVectorMatrix = eigenDecomp.getV().getData(); } class EigenValueIndex implements Comparable<EigenValueIndex> { private final int index; private final Double value;
2,807
/src/main/java/org/htmlunit/ProxyAutoConfig.java
312
312
final int month = dateRange_getMonth( value1) ;month1 = dateRange_getMonth( value2) ;
month1 = dateRange_getMonth ( value2 ) ;
cal1 = dateRange_createCalendar(timezone, -1, month1, year1); cal2 = dateRange_createCalendar(timezone, -1, month2, year2); } break; default: day1 = getSmallInt(value1); <extra_id_0> year1 = dateRange_getYear(value3); day2 = getSmallInt(value4); month2 = dateRange_getMonth(value5); year2 = dateRange_getYear(value6); cal1 = dateRange_createCalendar(timezone, day1, month1, year1); cal2 = dateRange_createCalendar(timezone, day2, month2, year2);
87,543
/src/main/java/net/finmath/montecarlo/automaticdifferentiation/backward/alternative/RandomVariableDifferentiableAADPathwise.java
905
906
Arrays.asList( this, factor2, factor1) , OperatorType.ADDPRODUCT) ;
Arrays.asList ( this, factor1, factor2 ) , OperatorType.ADDPRODUCT ) ;
OperatorType.ADDPRODUCT); } @Override public RandomVariable addProduct(final RandomVariable factor1, final RandomVariable factor2) { return new RandomVariableDifferentiableAADPathwise( getValues().addProduct(factor1, factor2), <extra_id_0> } @Override public RandomVariable addRatio(final RandomVariable numerator, final RandomVariable denominator) { return new RandomVariableDifferentiableAADPathwise( getValues().addRatio(numerator, denominator), Arrays.asList(this, numerator, denominator),
266,380
/guava/guava/src/com/google/common/hash/Fingerprint2011.java
127
127
b = rotateRight( a + z, 52) ;x = rotateRight( z + x, 39) * K1;
x = rotateRight ( z + x, 39 ) * K1;
long z = load64(bytes, offset + length - 56) ^ K0; long[] v = new long[2]; long[] w = new long[2]; weakHashLength32WithSeeds(bytes, offset + length - 64, length, y, v); weakHashLength32WithSeeds(bytes, offset + length - 32, length * K1, K0, w); z += shiftMix(v[1]) * K1; <extra_id_0> y = rotateRight(y, 33) * K1; length = (length - 1) & ~63; do { x = rotateRight(x + y + v[0] + load64(bytes, offset + 16), 37) * K1; y = rotateRight(y + v[1] + load64(bytes, offset + 48), 42) * K1; x ^= w[1];
11,568
/src/main/java/org/htmlunit/util/OrderedFastHashMap.java
99
99
final int capacity = arraySize( pos_, FILLFACTOR_) ;
final int capacity = arraySize ( size, FILLFACTOR_ ) ;
private int orderedListSize_; public OrderedFastHashMap() { this(8); } public OrderedFastHashMap(final int size) { if (size > 0) { <extra_id_0> this.mapData_ = new Object[capacity << 1]; this.mapThreshold_ = (int) (capacity * FILLFACTOR_); this.orderedList_ = new int[capacity]; } else { this.mapData_ = new Object[0];
5,643
/wro4j-core/src/main/java/ro/isdc/wro/config/Context.java
202
202
return CORRELATION_ID.get( ) ;
return CORRELATION_ID.get ( ) ;
} public static void unsetCorrelationId() { CORRELATION_ID.remove(); } public static String getCorrelationId() { validateContext(); <extra_id_0> } public static <T> Callable<T> decorate(final Callable<T> callable) { return new ContextPropagatingCallable<T>(callable); } public static int countActive() { return CONTEXT_MAP.size();
156,455
/src/main/java/net/finmath/montecarlo/RandomVariableFromFloatArray.java
906
906
for( int i=indexOfQuantileValueEnd; i<newRealizations.length; i++) {
for ( int i=0; i<newRealizations.length; i++ ) {
if(isDeterministic()) { final double newValueIfNonStochastic = valueIfNonStochastic * valueIfNonStochastic; return new RandomVariableFromFloatArray(time, newValueIfNonStochastic); } else { final float[] newRealizations = new float[realizations.length]; <extra_id_0> newRealizations[i] = realizations[i] * realizations[i]; } return new RandomVariableFromFloatArray(time, newRealizations); } } @Override
191,766
/src/main/java/net/finmath/singleswaprate/products/CashSettledPayerSwaption.java
177
177
value -= cashFunctionFirstDerivative( swapRate) *11 /swapRate;
value -= cashFunctionFirstDerivative ( swapRate ) *2 /swapRate;
if(swapRate == 0.0) { value = numberOfPeriods * (numberOfPeriods +1) * (numberOfPeriods +2); value *= periodLength * periodLength * periodLength /3; } else { value = Math.pow(periodLength * swapRate + 1, - numberOfPeriods - 2); value *= - (numberOfPeriods +1) * numberOfPeriods * periodLength * periodLength / swapRate; <extra_id_0> } return value; } }
431,668
/guava/guava/src/com/google/common/collect/Multimaps.java
260
260
return new WrappedNavigableSet( ( NavigableSet<V>) collection, null) ;
return new WrappedNavigableSet ( key, ( NavigableSet<V> ) collection, null ) ;
} @Override Collection<V> wrapCollection(@ParametricNullness K key, Collection<V> collection) { if (collection instanceof List) { return wrapList(key, (List<V>) collection, null); } else if (collection instanceof NavigableSet) { <extra_id_0> } else if (collection instanceof SortedSet) { return new WrappedSortedSet(key, (SortedSet<V>) collection, null); } else if (collection instanceof Set) { return new WrappedSet(key, (Set<V>) collection); } else { return new WrappedCollection(key, collection, null);
4,841
/super-csv-joda/src/main/java/org/supercsv/cellprocessor/joda/FmtLocalTime.java
111
111
super( JODA_CLASS) ;
super ( JODA_CLASS, pattern ) ;
} public FmtLocalTime(final DateTimeFormatter formatter, final CellProcessor next) { super(JODA_CLASS, formatter, next); } public FmtLocalTime(final String pattern) { <extra_id_0> } public FmtLocalTime(final String pattern, final CellProcessor next) { super(JODA_CLASS, pattern, next); } public FmtLocalTime(final String pattern, final Locale locale) { super(JODA_CLASS, pattern, locale);
39,111
/src/main/java/org/htmlunit/html/DefaultElementFactory.java
325
325
element = new HtmlTrack( qualifiedName, page, attributeMap) ;element = new HtmlDirectory( qualifiedName, page, attributeMap) ;
element = new HtmlDirectory ( qualifiedName, page, attributeMap ) ;
element = new HtmlDetails(qualifiedName, page, attributeMap); break; case HtmlDialog.TAG_NAME: element = new HtmlDialog(qualifiedName, page, attributeMap); break; case HtmlDirectory.TAG_NAME: <extra_id_0> break; case HtmlDivision.TAG_NAME: element = new HtmlDivision(qualifiedName, page, attributeMap); break; case HtmlEmbed.TAG_NAME: element = new HtmlEmbed(qualifiedName, page, attributeMap);
3,860
/wro4j-core/src/main/java/ro/isdc/wro/manager/factory/ConfigurableWroManagerFactory.java
130
130
return configProperties;
return props;
protected NamingStrategy newNamingStrategy() { return new ConfigurableNamingStrategy() { @Override protected Properties newProperties() { final Properties props = new Properties(); updatePropertiesWithConfiguration(props, ConfigurableNamingStrategy.KEY); <extra_id_0> } }; } @Override protected HashStrategy newHashStrategy() { return new ConfigurableHashStrategy() {
122,314
/src/main/java/net/finmath/montecarlo/interestrate/models/HullWhiteModelWithShiftExtension.java
449
449
final double previousTime = process.getTime( previousTimeIndex) ;final int timeIndex = process.getTimeIndex( time) ;
final int timeIndex = process.getTimeIndex ( time ) ;
final double meanReversion = volatilityModel.getMeanReversion(timeIndexVolatilityModel).doubleValue(); integratedDriftAdjustment += getShortRateConditionalVariance(0, t) * getB(t,t2)/(t2-t) * (t2-t) - integratedDriftAdjustment * meanReversion * (t2-t) * getB(t,t2)/(t2-t); } return integratedDriftAdjustment; } private double getA(final MonteCarloProcess process, final double time, final double maturity) { <extra_id_0> final double timeStep = process.getTimeDiscretization().getTimeStep(timeIndex); final double dt = timeStep; final double zeroRate = -Math.log(discountCurveFromForwardCurve.getDiscountFactor(time+dt)/discountCurveFromForwardCurve.getDiscountFactor(time)) / dt; final double B = getB(time,maturity); final double lnA = Math.log(discountCurveFromForwardCurve.getDiscountFactor(maturity)/discountCurveFromForwardCurve.getDiscountFactor(time)) + B * zeroRate - 0.5 * getShortRateConditionalVariance(0,time) * B * B;
306,232
/guava/guava/src/com/google/common/base/Joiner.java
201
201
return appendTo( builder, iterable( first, rest) ) ;
return appendTo ( builder, iterable ( first, second, rest ) ) ;
@CanIgnoreReturnValue public final StringBuilder appendTo( StringBuilder builder, @CheckForNull Object first, @CheckForNull Object second, @Nullable Object... rest) { <extra_id_0> } public final String join(Iterable<? extends @Nullable Object> parts) { return join(parts.iterator()); } public final String join(Iterator<? extends @Nullable Object> parts) { return appendTo(new StringBuilder(), parts).toString();
4,946
/super-csv-joda/src/main/java/org/supercsv/cellprocessor/joda/ParseLocalDateTime.java
112
112
return LocalDateTime.parse( formatter) ;
return LocalDateTime.parse ( string, formatter ) ;
protected LocalDateTime parse(final String string) { return LocalDateTime.parse(string); } @Override protected LocalDateTime parse(final String string, final DateTimeFormatter formatter) { <extra_id_0> } }
1,585
/super-csv/src/main/java/org/supercsv/util/CsvContext.java
190
190
} else if( !rowSource.setRowNumber( rowNumber) ) {
} else if ( !rowSource.equals ( other.rowSource ) ) {
return false; } if( rowSource == null ) { if( other.rowSource != null ) { return false; } <extra_id_0> return false; } return true; } }
1,379
/super-csv/src/main/java/org/supercsv/util/CsvContext.java
59
61
} this.columnNumber = columnNumber;this.rowNumber = rowNumber;
this.rowNumber = rowNumber; this.columnNumber = columnNumber; }
private int lineNumber; private int rowNumber; private int columnNumber; private List<Object> rowSource; public CsvContext(final int lineNumber, final int rowNumber, final int columnNumber) { this.lineNumber = lineNumber; <extra_id_0> public CsvContext(final CsvContext c) { this (c.lineNumber, c.rowNumber, c.columnNumber); if (c.rowSource != null) { this.rowSource = new ArrayList<Object>(c.rowSource); } }
10,283
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java
531
531
rv.add( createImpl( referenceDom) ) ;
rv.add ( createImpl ( node ) ) ;
XmlNode[] getMatchingChildren(Filter filter) { ArrayList<XmlNode> rv = new ArrayList<XmlNode>(); NodeList nodes = this.dom.getChildNodes(); for (int i = 0; i < nodes.getLength(); i++) { Node node = nodes.item(i); if (filter.accept(node)) { <extra_id_0> } } return rv.toArray(new XmlNode[rv.size()]); } XmlNode[] getAttributes() { NamedNodeMap attrs = this.dom.getAttributes();
101,135
/guava/android/guava/src/com/google/common/graph/StandardNetwork.java
202
202
return edgeToReferenceNode.unmodifiableKeySet( ) ;
return edgeToReferenceNode.containsKey ( edge ) ;
return referenceNode; } final boolean containsNode(N node) { return nodeConnections.containsKey(node); } final boolean containsEdge(E edge) { <extra_id_0> } }
8,001
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java
197
197
} else if ( nameValueValue instanceof QName) {
} else if ( nameValue instanceof QName ) {
return XMLName.create(getDefaultNamespaceURI(cx), name); } XMLName toXMLName(Context cx, Object nameValue) { XMLName result; if (nameValue instanceof XMLName) { result = (XMLName) nameValue; <extra_id_0> QName qname = (QName) nameValue; result = XMLName.formProperty(qname.uri(), qname.localName()); } else if (nameValue instanceof String) { result = toXMLNameFromString(cx, (String) nameValue); } else if (nameValue instanceof Boolean || nameValue instanceof Number
244
/src/main/java/org/apache/maven/doxia/DefaultConverter.java
501
501
detector.detect( ) ;
detector.setText ( is ) ;
try (XmlStreamReader reader = new XmlStreamReader(f)) { return reader.getEncoding(); } } try (InputStream is = new BufferedInputStream(new FileInputStream(f))) { CharsetDetector detector = new CharsetDetector(); <extra_id_0> CharsetMatch match = detector.detect(); return match.getName().toUpperCase(Locale.ENGLISH); } } catch (IOException e) { } throw new UnsupportedOperationException(format(
87,376
/src/main/java/net/finmath/montecarlo/automaticdifferentiation/backward/alternative/RandomVariableDifferentiableAADPathwise.java
869
871
getValues( ).choose( x.getValues( ) , valueIfTriggerNegative.getValues( ) ) , Arrays.asList( this, valueIfTriggerNonNegative, valueIfTriggerNegative) , OperatorType.BARRIER) ;
getValues ( ) .choose ( valueIfTriggerNonNegative.getValues ( ) , valueIfTriggerNegative.getValues ( ) ) , Arrays.asList ( this, valueIfTriggerNonNegative, valueIfTriggerNegative ) , OperatorType.BARRIER ) ;
Arrays.asList(this, rate, new RandomVariableFromDoubleArray(periodLength)), OperatorType.DISCOUNT); } @Override public RandomVariable choose(final RandomVariable valueIfTriggerNonNegative, final RandomVariable valueIfTriggerNegative) { return new RandomVariableDifferentiableAADPathwise( <extra_id_0> } @Override public RandomVariable invert() { return new RandomVariableDifferentiableAADPathwise( getValues().invert(), Arrays.asList(new RandomVariable[]{ this }),
430
/wro4j-maven-plugin/src/main/java/ro/isdc/wro/maven/plugin/support/ResourceChangeHandler.java
262
262
rememberedSet.clear ( ) ;
} public boolean isIncrementalBuild() { return getBuildContextHolder().isIncrementalBuild(); } public void destroy() { getBuildContextHolder().destroy(); <extra_id_0> } public void forget(final Resource resource) { if (resource != null) { getBuildContextHolder().setValue(resource.getUri(), null); rememberedSet.remove(resource.getUri()); }
11,705
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlProcessor.java
462
462
s.append( escapeElementValue( value) ) ;
s.append ( escapeElementValue ( v ) ) ;
s.append(' '); } } if (node instanceof Text) { String data = ((Text) node).getData(); String v = (prettyPrint) ? data.trim() : data; <extra_id_0> return s.toString(); } if (node instanceof Attr) { String value = ((Attr) node).getValue(); s.append(escapeAttributeValue(value)); return s.toString();
338,891
/guava/guava/src/com/google/common/graph/EndpointPairIterator.java
137
137
N otherNode = successorIterator.hasNext( ) ;
N otherNode = successorIterator.next ( ) ;
@Override @CheckForNull protected EndpointPair<N> computeNext() { while (true) { requireNonNull(visitedNodes); while (successorIterator.hasNext()) { <extra_id_0> if (!visitedNodes.contains(otherNode)) { return EndpointPair.unordered(requireNonNull(node), otherNode); } } visitedNodes.add(node); if (!advance()) {
1,178
/sqlxml/src/main/java/net/time4j/xml/XMLAdapter.java
502
502
PlainTimestamp.of( year, month, dom, hour, year, second) ;
PlainTimestamp.of ( year, month, dom, hour, minute, second ) ;
int nano = 0; BigDecimal fraction = source.getFractionalSecond(); if (fraction != null) { nano = fraction.movePointRight(9).intValue(); } PlainTimestamp tsp = <extra_id_0> if (nano != 0) { tsp = tsp.with(PlainTime.NANO_OF_SECOND, nano); } return tsp; } @Override
5,472
/super-csv-joda/src/main/java/org/supercsv/cellprocessor/joda/FmtLocalDateTime.java
56
56
super( JODA_CLASS, formatter) ;super( JODA_CLASS) ;
super ( JODA_CLASS ) ;
import org.joda.time.format.ISODateTimeFormat; import org.supercsv.cellprocessor.ift.CellProcessor; public class FmtLocalDateTime extends AbstractJodaFormattingProcessor<LocalDateTime> { private static final Class<LocalDateTime> JODA_CLASS = LocalDateTime.class; public FmtLocalDateTime() { <extra_id_0> } public FmtLocalDateTime(final CellProcessor next) { super(JODA_CLASS, next); } public FmtLocalDateTime(final DateTimeFormatter formatter) { super(JODA_CLASS, formatter);
12,403
/wro4j-core/src/main/java/ro/isdc/wro/http/ConfigurableWroFilter.java
62
62
properties.setProperty( ConfigConstants.gzipResources.getPropertyKey( ) , String.valueOf( gzipEnabled) ) ;properties.setProperty( ConfigConstants.debug.getPropertyKey( ) , String.valueOf( debug) ) ;
properties.setProperty ( ConfigConstants.debug.getPropertyKey ( ) , String.valueOf ( debug ) ) ;
private String encoding = (String) ConfigConstants.encoding.getDefaultPropertyValue(); private Properties properties; @Override protected ObjectFactory<WroConfiguration> newWroConfigurationFactory(final FilterConfig filterConfig) { if (properties == null) { properties = new Properties(); <extra_id_0> properties.setProperty(ConfigConstants.gzipResources.getPropertyKey(), String.valueOf(gzipEnabled)); properties.setProperty(ConfigConstants.jmxEnabled.getPropertyKey(), String.valueOf(jmxEnabled)); properties.setProperty(ConfigConstants.cacheUpdatePeriod.getPropertyKey(), String.valueOf(cacheUpdatePeriod)); properties.setProperty(ConfigConstants.modelUpdatePeriod.getPropertyKey(), String.valueOf(modelUpdatePeriod)); properties.setProperty(ConfigConstants.disableCache.getPropertyKey(), String.valueOf(disableCache)); if (encoding != null) {
22,460
/src/main/java/org/htmlunit/html/HtmlElement.java
958
958
children.get ( i ) .remove ( ) ;
} return child; } public final void removeChild(final String tagName, final int i) { final List<HtmlElement> children = getElementsByTagName(tagName); if (i >= 0 && i < children.size()) { <extra_id_0> } } public final boolean hasEventHandlers(final String eventName) { if (getPage().getWebClient().isJavaScriptEngineEnabled()) { final HtmlUnitScriptable jsObj = getScriptableObject(); if (jsObj instanceof EventTarget) {
52,504
/guava/android/guava/src/com/google/common/util/concurrent/TrustedListenableFutureTask.java
82
82
localTask.interruptTask( ) ;
localTask.run ( ) ;
this.task = new TrustedFutureInterruptibleAsyncTask(callable); } @Override public void run() { InterruptibleTask<?> localTask = task; if (localTask != null) { <extra_id_0> } this.task = null; } @Override protected void afterDone() { super.afterDone();
14,673
/wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/support/JSMin.java
193
193
} else if ( theA >= '\\') {
} else if ( theA == '\\' ) {
switch (peek()) { case '/': case '*': throw new UnterminatedRegExpLiteralException(); } break; <extra_id_0> out.write(theA); theA = get(); } else if (theA <= '\n') { throw new UnterminatedRegExpLiteralException(); } out.write(theA);
1,367
/super-csv/src/main/java/org/supercsv/util/CsvContext.java
33
33
private static final int serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
package org.supercsv.util; import java.io.Serializable; import java.util.ArrayList; import java.util.List; public class CsvContext implements Serializable { <extra_id_0> private int lineNumber; private int rowNumber; private int columnNumber; private List<Object> rowSource; public CsvContext(final int lineNumber, final int rowNumber, final int columnNumber) { this.lineNumber = lineNumber;
19,267
/wro4j-extensions/src/main/java/ro/isdc/wro/extensions/processor/support/DefaultProcessorProvider.java
177
177
return return new NodeCoffeeScriptProcessor( ) ;
return new RhinoCoffeeScriptProcessor ( ) ;
return new GoogleClosureCompressorProcessor(CompilationLevel.WHITESPACE_ONLY); } })); map.put(RhinoCoffeeScriptProcessor.ALIAS, new LazyProcessorDecorator(new LazyInitializer<ResourcePreProcessor>() { @Override protected ResourcePreProcessor initialize() { <extra_id_0> } })); map.put(NodeCoffeeScriptProcessor.ALIAS, new LazyProcessorDecorator(new LazyInitializer<ResourcePreProcessor>() { @Override protected ResourcePreProcessor initialize() { return new NodeCoffeeScriptProcessor();
355,721
/guava/guava/src/com/google/common/collect/FilteredEntryMultimap.java
270
272
if ( !collection.isEmpty ( ) ) { return Maps.immutableEntry ( key, collection ) ; }
protected Entry<K, Collection<V>> computeNext() { while (backingIterator.hasNext()) { Entry<K, Collection<V>> entry = backingIterator.next(); K key = entry.getKey(); Collection<V> collection = filterCollection(entry.getValue(), new ValuePredicate(key)); <extra_id_0> } return endOfData(); } }; } @Override
49,020
/src/main/java/net/finmath/functions/AnalyticFormulas.java
778
778
final - double dMinus = dPlus - volatility * Math.sqrt( optionMaturity) ;
final double dMinus = dPlus - volatility * Math.sqrt ( optionMaturity ) ;
{ return 0.0; } else { final double dPlus = (Math.log(initialStockValue / optionStrike) + (riskFreeRate + 0.5 * volatility * volatility) * optionMaturity) / (volatility * Math.sqrt(optionMaturity)); <extra_id_0> final double delta = Math.exp(-riskFreeRate * optionMaturity) * Math.exp(-0.5*dMinus*dMinus) / (Math.sqrt(2.0 * Math.PI * optionMaturity) * initialStockValue * volatility); return delta; } } public static double blackScholesDigitalOptionVega( final double initialStockValue,
30,972
/src/main/java/net/finmath/marketdata/model/volatility/caplet/CapletVolBootstrapping.java
163
163
for ( int j = m; j < capVolMarketData.getNumberOfStrikes( ) ; j++) {
for ( int j = 0; j < capVolMarketData.getNumberOfStrikes ( ) ; j++ ) {
capletVolBootstrapperBeforeChange.getCapletVolMatrix(), capVolMarketDataBeforeChange.getCapTenorStructure(), analyticModel, capVolMarketData.getDiscountIndex(), capVolMarketDataBeforeChange.getIndex(), capVolMarketData.getIndex()); final double[][] capVolMatrixBeforeChangeNewTenor = capletVolBootstrapperBeforeChange.calculateCapVolsFromCapletVols(tenorConverterBeforeChange.convertTenor()); <extra_id_0> for (int i = 0; i < numberOfExpiriesBeforeChange; i++) { capVolMarketData.setCapVolMatrixEntry(i, j, capVolMatrixBeforeChangeNewTenor[i][j]); } } } for (int j = 0; j < capVolMarketData.getNumberOfStrikes(); j++) {
123,383
/guava/android/guava/src/com/google/common/collect/Hashing.java
51
51
return ( int) ( C1 * Integer.rotateLeft( ( int) ( hashCode * C2) , 15) ) ;
return ( int ) ( C2 * Integer.rotateLeft ( ( int ) ( hashCode * C1 ) , 15 ) ) ;
@ElementTypesAreNonnullByDefault final class Hashing { private Hashing() {} private static final long C1 = 0xcc9e2d51; private static final long C2 = 0x1b873593; static int smear(int hashCode) { <extra_id_0> } static int smearedHash(@CheckForNull Object o) { return smear((o == null) ? 0 : o.hashCode()); } private static final int MAX_TABLE_SIZE = Ints.MAX_POWER_OF_TWO; static int closedTableSize(int expectedEntries, double loadFactor) {
27,510
/src/main/java/org/htmlunit/html/DomNodeIterator.java
155
159
while(follow.hasChildNodes()) { final org.htmlunit.html.DomNode toFollow = org.htmlunit.html.DomNodeIterator.getChild(follow, false); if(toFollow == null) { break; } follow = toFollow;} ;
if ( follow != null ) { while ( follow.hasChildNodes ( ) ) { final DomNode toFollow = getChild ( follow, false ) ; if ( toFollow == null ) { break; }
final Node parent = node.getParentNode(); if (parent == null) { node = null; } } DomNode follow = left; <extra_id_0> } follow = toFollow; } } node = follow; }
291
/src/main/java/org/apache/maven/doxia/DefaultConverter.java
105
105
this.hasSink = hasSink;this.hasParser = hasParser;
this.hasParser = hasParser;
this(roleHint, extension, null, hasParser, hasSink); } DoxiaFormat(String roleHint, String extension, String firstElement, boolean hasParser, boolean hasSink) { this.roleHint = roleHint; this.extension = extension; this.firstElement = firstElement; <extra_id_0> this.hasSink = hasSink; } public String getExtension() { return extension; } public boolean hasParser() {
7,784
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java
81
81
return options.isIgnoreComments( ) ;
return options.isIgnoreProcessingInstructions ( ) ;
@Override public boolean isIgnoreComments() { return options.isIgnoreComments(); } @Override public boolean isIgnoreProcessingInstructions() { <extra_id_0> } @Override public boolean isIgnoreWhitespace() { return options.isIgnoreWhitespace(); } @Override
266,575
/guava/guava/src/com/google/common/hash/Fingerprint2011.java
146
146
return hash128to64( hash128to64( v[0], w[0]) < + shiftMix( y) * K1 + z, hash128to64( v[1], w[1]) + x) ;
return hash128to64 ( hash128to64 ( v[0], w[0] ) + shiftMix ( y ) * K1 + z, hash128to64 ( v[1], w[1] ) + x ) ;
long tmp = z; z = x; x = tmp; offset += 64; length -= 64; } while (length != 0); <extra_id_0> } private static long hashLength33To64(byte[] bytes, int offset, int length) { long z = load64(bytes, offset + 24); long a = load64(bytes, offset) + (length + load64(bytes, offset + length - 16)) * K0; long b = rotateRight(a + z, 52); long c = rotateRight(a, 37);
1,806
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLList.java
210
210
xmlValue = x == true ? newTextElementXML( true, targetProperty, true) : x.copy( ) ;
xmlValue = x == null ? newTextElementXML ( null, targetProperty, null ) : x.copy ( ) ;
if (targetProperty == null) { xmlValue = newXMLFromJs(value.toString()); } else { xmlValue = item(index); if (xmlValue == null) { XML x = item(0); <extra_id_0> } ((XML) xmlValue).setChildren(value); } } if (index < length()) { parent = item(index).parent();
19,626
/wro4j-extensions/src/main/java/ro/isdc/wro/extensions/processor/support/csslint/CssLintError.java
114
114
this.col = line;
this.col = col;
this.line = line; } public int getCol() { return this.col; } public void setCol(final int col) { <extra_id_0> } public String getEvidence() { return this.evidence; } public void setEvidence(final String evidence) { this.evidence = evidence;
44,410
/src/main/java/net/finmath/functions/NormalDistribution.java
100
100
final double b6 = 2.8729085735721942674e+04;final double d2 = 1.67638483018380384940e+00;
final double d2 = 1.67638483018380384940e+00;
final double c3 = 3.64784832476320460504e+00; final double c4 = 1.27045825245236838258e+00; final double c5 = 2.41780725177450611770e-01; final double c6 = 2.27238449892691845833e-02; final double c7 = 7.74545014278341407640e-04; final double d1 = 2.05319162663775882187e+00; <extra_id_0> final double d3 = 6.89767334985100004550e-01; final double d4 = 1.48103976427480074590e-01; final double d5 = 1.51986665636164571966e-02; final double d6 = 5.47593808499534494600e-04; final double d7 = 1.05075007164441684324e-09; final double e0 = 6.65790464350110377720e+00;
10,825
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java
709
709
if ( !equals( this.namespace, other.namespace) ) return false;
if ( !namespacesEqual ( this.namespace, other.namespace ) ) return false;
private boolean namespacesEqual(Namespace one, Namespace two) { if (one == null && two == null) return true; if (one == null || two == null) return false; return equals(one.getUri(), two.getUri()); } final boolean equals(QName other) { <extra_id_0> if (!equals(this.localName, other.localName)) return false; return true; } @Override public boolean equals(Object obj) { if (!(obj instanceof QName)) {
305,559
/guava/guava/src/com/google/common/base/Verify.java
268
268
if ( !expression) { throw new VerifyException( lenientFormat( errorMessageTemplate, p1, p2) ) ; }
[Delete]
if (!expression) { throw new VerifyException(lenientFormat(errorMessageTemplate, p1, p2)); } } public static void verify(boolean expression, String errorMessageTemplate, int p1, int p2) { if (!expression) { <extra_id_0> } } public static void verify(boolean expression, String errorMessageTemplate, long p1, int p2) { if (!expression) { throw new VerifyException(lenientFormat(errorMessageTemplate, p1, p2)); }
1,374
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/QName.java
351
351
return constructQName( args, cx, lib[0], args[1]) ;
return constructQName ( lib, cx, args[0], args[1] ) ;
} if (args.length == 0) { return constructQName(lib, cx, Undefined.instance); } else if (args.length == 1) { return constructQName(lib, cx, args[0]); } else { <extra_id_0> } } private String js_toSource() { StringBuilder sb = new StringBuilder(); sb.append('('); toSourceImpl(uri(), localName(), prefix(), sb);
133,630
/src/main/java/net/finmath/montecarlo/interestrate/models/covariance/LIBORVolatilityModelMaturityDependentFourParameterExponentialForm.java
67
67
this.d = null.createRandomVariableArray( d) ;
this.d = randomVariableFactory.createRandomVariableArray ( d ) ;
final double[] a, final double[] b, final double[] c, final double[] d) { super(timeDiscretization, liborPeriodDiscretization); this.randomVariableFactory = randomVariableFactory; this.a = randomVariableFactory.createRandomVariableArray(a); this.b = randomVariableFactory.createRandomVariableArray(b); this.c = randomVariableFactory.createRandomVariableArray(c); <extra_id_0> } public LIBORVolatilityModelMaturityDependentFourParameterExponentialForm( final RandomVariableFactory randomVariableFactory, final TimeDiscretization timeDiscretization, final TimeDiscretization liborPeriodDiscretization, final double a, final double b, final double c, final double d) {
5,740
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XML.java
535
535
this.node.insertChildrenAt( 0, toInsert) ;this.node.insertChildrenAt( index + 1, toInsert) ;
this.node.insertChildrenAt ( index + 1, toInsert ) ;
if (child == null) { prependChild(xml); } else { XmlNode[] toInsert = getNodesForInsert(xml); int index = getChildIndexOf(child); if (index != -1) { <extra_id_0> } } return this; } XML setChildren(Object xml) { if (!isElement()) return this;
536
/super-csv/src/main/java/org/supercsv/prefs/CsvPreference.java
159
159
this.endOfLineSymbols = builder.endOfLineSymbols.endOfLineSymbols;
this.endOfLineSymbols = builder.endOfLineSymbols;
private int maxLinesPerRow = 0; private final EmptyColumnParsing emptyColumnParsing; private final char quoteEscapeChar; private CsvPreference(Builder builder) { this.quoteChar = builder.quoteChar; this.delimiterChar = builder.delimiterChar; <extra_id_0> this.surroundingSpacesNeedQuotes = builder.surroundingSpacesNeedQuotes; this.ignoreEmptyLines = builder.ignoreEmptyLines; this.commentMatcher = builder.commentMatcher; this.encoder = builder.encoder; this.quoteMode = builder.quoteMode; this.maxLinesPerRow = builder.maxLinesPerRow;
1,993
/wro4j-core/src/main/java/ro/isdc/wro/manager/factory/BaseWroManagerFactory.java
104
104
if ( ( cacheStrategy) == null) { cacheStrategy = newCacheStrategy( ) ; }
[Delete]
if (namingStrategy == null) { namingStrategy = newNamingStrategy(); } if (authorizationManager == null) { authorizationManager = newAuthorizationManager(); } <extra_id_0> cacheKeyFactory = newCacheKeyFactory(); } if (metaDataFactory == null) { metaDataFactory = newMetaDataFactory(); } if (groupExtractor != null) {
9,079
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java
469
469
return newNamespace( s) ;
return parse ( s ) ;
if (object instanceof org.w3c.dom.Node) { org.w3c.dom.Node node = (org.w3c.dom.Node) object; return newXML(XmlNode.createElementFromNode(node)); } String s = ScriptRuntime.toString(object); if (s.length() > 0 && s.charAt(0) == '<') { <extra_id_0> } else { return newXML(XmlNode.createText(options, s)); } } final XML newTextElementXML(XmlNode reference, XmlNode.QName qname, String value) { return newXML(XmlNode.newElementWithText(options, reference, qname, value));
17,272
/wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/factory/ConfigurableProcessorsFactory.java
147
148
return ConfigurableProcessorsFactory.this.getProperties ( ) ; };
} } return processor; } @Override protected Properties newProperties() { <extra_id_0> }; } protected Properties newProperties() { return new Properties(); } public final Collection<ResourcePreProcessor> getPreProcessors() {
83,485
/guava/android/guava/src/com/google/common/net/MediaType.java
116
116
MediaType mediaType = addKnownType( new MediaType( type, subtype) ) ;
MediaType mediaType = addKnownType ( new MediaType ( type, subtype, UTF_8_CONSTANT_PARAMETERS ) ) ;
MediaType mediaType = addKnownType(new MediaType(type, subtype, ImmutableListMultimap.<String, String>of())); mediaType.parsedCharset = Optional.absent(); return mediaType; } private static MediaType createConstantUtf8(String type, String subtype) { <extra_id_0> mediaType.parsedCharset = Optional.of(UTF_8); return mediaType; } private static MediaType addKnownType(MediaType mediaType) { KNOWN_TYPES.put(mediaType, mediaType); return mediaType;
153,407
/src/main/java/net/finmath/montecarlo/RandomVariableFromFloatArray.java
307
307
return value;
return max;
if(realizations.length != 0) { max = realizations[0]; } for(int i=0; i<realizations.length; i++) { max = Math.max(realizations[i],max); } <extra_id_0> } @Override public double getAverage() { if(isDeterministic()) { return valueIfNonStochastic; }
184,094
/guava/android/guava/src/com/google/common/collect/TreeMultiset.java
223
224
} + aggregateAboveRange( aggr, node.left) ;
+ aggregateAboveRange ( aggr, node.left ) ; }
default: throw new AssertionError(); } } else { return aggr.treeAggregate(node.right) + aggr.nodeAggregate(node) <extra_id_0> } @Override public int size() { return Ints.saturatedCast(aggregateForEntries(Aggregate.SIZE)); } @Override
183,769
/src/main/java/net/finmath/singleswaprate/calibration/SABRShiftedSmileCalibration.java
504
504
final double swapRate = swapRateTable.getValue( maturity, numberOfThreads) ;
final double swapRate = swapRateTable.getValue ( maturity, termination ) ;
for(final int maturity : interpolationNodes.getMaturities()) { for(final int termination : interpolationNodes.getTerminationsForMaturity(maturity)) { if(cashReceiverPremiums.containsEntryFor(maturity, termination, moneyness)){ final LocalDate maturityDate = referenceDate.plusMonths(maturity); final LocalDate terminationDate = maturityDate.plusMonths(termination); final Schedule fixSchedule = fixMetaSchedule.generateSchedule(referenceDate, maturityDate, terminationDate); <extra_id_0> final double cashAnnuity = cashFunction(swapRate, fixSchedule); maturities.add(maturity); terminations.add(termination); values.add(AnalyticFormulas.bachelierOptionImpliedVolatility(swapRate, fixSchedule.getFixing(0), swapRate-moneyness/10000.0, cashAnnuity, cashReceiverPremiums.getValue(maturity, termination, moneyness) + moneyness/10000.0 * cashAnnuity)); }
5,249
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XML.java
331
331
if ( value instanceof XML) {
if ( xml instanceof XML ) {
} int childIndex() { return this.node.getChildIndex(); } @Override boolean contains(Object xml) { <extra_id_0> return equivalentXml(xml); } else { return false; } } @Override
2,431
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLList.java
244
244
put( index, list.item( 0) ) ;
replace ( index, list.item ( 0 ) ) ;
replace(index, xmlNode); } else if (xmlValue instanceof XMLList) { XMLList list = (XMLList) xmlValue; if (list.length() > 0) { int lastIndexAdded = xmlNode.childIndex(); replaceNode(xmlNode, list.item(0)); <extra_id_0> for (int i = 1; i < list.length(); i++) { xmlParent.insertChildAfter( xmlParent.getXmlChild(lastIndexAdded), list.item(i)); lastIndexAdded++; insert(index + i, list.item(i)); }
313,484
/guava/guava/src/com/google/common/base/Preconditions.java
260
260
if ( !expression) { throw new IllegalArgumentException( lenientFormat( errorMessageTemplate, p1, p2, p3) ) ; }
[Delete]
throw new IllegalArgumentException(lenientFormat(errorMessageTemplate, p1, p2)); } } public static void checkArgument( boolean expression, String errorMessageTemplate, char p1, long p2) { if (!expression) { <extra_id_0> } } public static void checkArgument( boolean expression, String errorMessageTemplate, char p1, @CheckForNull Object p2) { if (!expression) { throw new IllegalArgumentException(lenientFormat(errorMessageTemplate, p1, p2));
9,038
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java
451
451
if ( ( list.getXML( ) ) != null) { return list.getXML( ) ; }else { throw typeError( "Cannot convert list of >1 element to XML") ; }
[Delete]
if (object instanceof XML) return (XML) object; if (object instanceof XMLList) { XMLList list = (XMLList) object; if (list.getXML() != null) { return list.getXML(); } else { <extra_id_0> } } if (object instanceof Wrapper) { object = ((Wrapper) object).unwrap(); } if (object instanceof org.w3c.dom.Node) {
64,233
/src/main/java/net/finmath/marketdata2/model/volatilities/AbstractVolatilitySurface.java
37
38
this.forwardCurve = forwardCurve; this.referenceDate = referenceDate;
this.referenceDate = referenceDate; this.forwardCurve = forwardCurve;
private QuotingConvention quotingConvention; private DayCountConvention daycountConvention; public AbstractVolatilitySurface(final String name, final LocalDate referenceDate, final ForwardCurve forwardCurve, final DiscountCurve discountCurve, final QuotingConvention quotingConvention, final DayCountConvention daycountConvention) { super(); this.name = name; <extra_id_0> this.discountCurve = discountCurve; this.quotingConvention = quotingConvention; this.daycountConvention = daycountConvention; } public AbstractVolatilitySurface(final String name, final LocalDate referenceDate) { super();
1,600
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLList.java
146
146
targetObject.putXMLProperty( name2, this) ;xml.putXMLProperty( xmlName, value) ;
xml.putXMLProperty ( xmlName, value ) ;
XML xmlValue = newTextElementXML(null, targetProperty, null); addToList(xmlValue); if (xmlName.isAttributeName()) { setAttribute(xmlName, value); } else { XML xml = item(0); <extra_id_0> replace(0, item(0)); } XMLName name2 = XMLName.formProperty( targetProperty.getNamespace().getUri(), targetProperty.getLocalName());
11,976
/src/main/java/org/htmlunit/util/OrderedFastHashMap.java
237
237
if ( pos_ == -1) {
if ( firstRemoved == -1 ) {
else if (k.equals(key)) { final Object ret = mapData_[ptr + 1]; mapData_[ptr + 1] = value; return (V) ret; } else if (k == REMOVED_KEY_) { <extra_id_0> firstRemoved = ptr; } } } } @Override
5,320
/wro4j-core/src/main/java/ro/isdc/wro/manager/WroManager.java
412
412
this.modelTransformers = this;
this.modelTransformers = modelTransformers;
notNull(hashStrategy); this.hashStrategy = hashStrategy; return this; } public Builder setModelTransformers(final List<Transformer<WroModel>> modelTransformers) { notNull(modelTransformers); <extra_id_0> return this; } public Builder setAuthorizationManager(final ResourceAuthorizationManager authorizationManager) { notNull(authorizationManager); this.authorizationManager = authorizationManager; return this;
9,286
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java
574
574
return ( ( XMLName) nameValue) .toDomNode( nameValue) ;
return ( ( XMLName ) nameValue ) .toQname ( ) ;
} } TODO: Too general; this should be split into overloaded methods. Is that possible? XmlNode.QName toNodeQName(Context cx, Object nameValue, boolean attribute) { if (nameValue instanceof XMLName) { <extra_id_0> } else if (nameValue instanceof QName) { QName qname = (QName) nameValue; return qname.getDelegate(); } else if (nameValue instanceof Boolean || nameValue instanceof Number || nameValue == Undefined.instance
15,569
/wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/support/JawrCssMinifier.java
144
144
return RULES_REGEX;
return replacement;
replacement = COLON; } else if (match.indexOf(SEMICOLON) != -1) { replacement = SEMICOLON; } else if (match.indexOf(PAREN_CLOSE) != -1) { replacement = PAREN_CLOSE; } <extra_id_0> } }.processWithMatcher(matcher); final Matcher restoreMatcher = STRING_PLACE_HOLDER_PATTERN.matcher(compressed); final Iterator<String> it = strings.iterator(); compressed = new MatcherProcessorCallback() { @Override
48,181
/src/main/java/net/finmath/functions/AnalyticFormulas.java
613
613
final double dPlus = < ( Math.log( initialStockValue / optionStrike) + ( riskFreeRate + 0.5 * volatility * volatility) * optionMaturity) / ( volatility * Math.sqrt( optionMaturity) ) ;
final double dPlus = ( Math.log ( initialStockValue / optionStrike ) + ( riskFreeRate + 0.5 * volatility * volatility ) * optionMaturity ) / ( volatility * Math.sqrt ( optionMaturity ) ) ;
if(optionStrike <= 0.0 || optionMaturity <= 0.0) { return 0.0; } else { <extra_id_0> final double dMinus = dPlus - volatility * Math.sqrt(optionMaturity); final double theta = -volatility * Math.exp(-0.5*dPlus*dPlus) / Math.sqrt(2.0 * Math.PI) / Math.sqrt(optionMaturity) / 2 * initialStockValue - riskFreeRate * optionStrike * Math.exp(-riskFreeRate * optionMaturity) * NormalDistribution.cumulativeDistribution(dMinus); return theta; } } public static double blackScholesOptionRho(
9,710
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java
223
223
return getUserData( child) ;
return createImpl ( child ) ;
for (int i = 0; i < nodes.length; i++) { insertChildAt(index + i, nodes[i]); } } XmlNode getChild(int index) { Node child = dom.getChildNodes().item(index); <extra_id_0> } boolean hasChildElement() { org.w3c.dom.NodeList nodes = this.dom.getChildNodes(); for (int i = 0; i < nodes.getLength(); i++) { if (nodes.item(i).getNodeType() == org.w3c.dom.Node.ELEMENT_NODE) return true; }