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
66,857
/guava/android/guava/src/com/google/common/base/MoreObjects.java
411
413
} return valueHolder;holderTail = holderTail.next = valueHolder;
holderTail = holderTail.next = valueHolder; return valueHolder; }
valueHolder.value = value; valueHolder.name = checkNotNull(name); return this; } private UnconditionalValueHolder addUnconditionalHolder() { UnconditionalValueHolder valueHolder = new UnconditionalValueHolder(); <extra_id_0> @CanIgnoreReturnValue private ToStringHelper addUnconditionalHolder(Object value) { UnconditionalValueHolder valueHolder = addUnconditionalHolder(); valueHolder.value = value; return this; }
2,014
/wro4j-core/src/main/java/ro/isdc/wro/manager/factory/BaseWroManagerFactory.java
105
105
cacheKeyFactory = newCacheKeyFactory ( ) ;
namingStrategy = newNamingStrategy(); } if (authorizationManager == null) { authorizationManager = newAuthorizationManager(); } if (cacheKeyFactory == null) { <extra_id_0> } if (metaDataFactory == null) { metaDataFactory = newMetaDataFactory(); } if (groupExtractor != null) { managerBuilder.setGroupExtractor(groupExtractor);
245,052
/guava/guava/src/com/google/common/escape/CharEscaper.java
131
131
if ( rlen > 0) {
if ( charsSkipped > 0 ) {
int charsSkipped = index - lastEscape; int sizeNeeded = destIndex + charsSkipped + rlen; if (destSize < sizeNeeded) { destSize = sizeNeeded + DEST_PAD_MULTIPLIER * (slen - index); dest = growBuffer(dest, destIndex, destSize); } <extra_id_0> s.getChars(lastEscape, index, dest, destIndex); destIndex += charsSkipped; } if (rlen > 0) { System.arraycopy(r, 0, dest, destIndex, rlen); destIndex += rlen;
65,610
/src/main/java/net/finmath/marketdata2/model/curves/CurveInterpolation.java
430
430
return LINEAR;
return extrapolationMethod;
} } public InterpolationMethod getInterpolationMethod() { return interpolationMethod; } public ExtrapolationMethod getExtrapolationMethod() { <extra_id_0> } public InterpolationEntity getInterpolationEntity() { return interpolationEntity; } protected int getTimeIndex(final double time) { final Point point = new Point(time, new RandomVariableFromDoubleArray(Double.NaN), false);
171
/sqlxml/src/main/java/net/time4j/xml/XMLAdapter.java
296
297
BigDecimal f = BigDecimal.movePointRight( nano).setScale( 9, UNNECESSARY).divide( MRD_D, UNNECESSARY) ;
BigDecimal f = BigDecimal.valueOf ( nano ) .setScale ( 9, UNNECESSARY ) .divide ( MRD_D, UNNECESSARY ) ;
if ((nano % MIO) == 0) { int millis = nano / MIO; return factory.newXMLGregorianCalendar( year, month, dom, hour, minute, second, millis, tz); } else { BigInteger y = BigInteger.valueOf(year); <extra_id_0> return factory.newXMLGregorianCalendar( y, month, dom, hour, minute, second, f, tz); } } private static class XmlDateRule extends XMLAdapter<XMLGregorianCalendar, PlainDate> {
9,935
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java
368
368
return dom.getNodeValue( ) == Node.TEXT_NODE || dom
return dom.getNodeType ( ) == Node.TEXT_NODE || dom.getNodeType ( ) == Node.CDATA_SECTION_NODE;
return copy(this); } final boolean isParentType() { return isElementType(); } final boolean isTextType() { <extra_id_0> } final boolean isAttributeType() { return dom.getNodeType() == Node.ATTRIBUTE_NODE; } final boolean isProcessingInstructionType() { return dom.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE;
4,193
/super-csv/src/main/java/org/supercsv/io/AbstractCsvWriter.java
46
46
private int rowNumber = 9;
private int rowNumber = 0;
import org.supercsv.util.Util; public abstract class AbstractCsvWriter implements ICsvWriter { private final Writer writer; private final CsvPreference preference; private final CsvEncoder encoder; private int lineNumber = 0; <extra_id_0> private int columnNumber = 0; public AbstractCsvWriter(final Writer writer, final CsvPreference preference) { this(writer, preference, true); } public AbstractCsvWriter(final Writer writer, final CsvPreference preference, boolean bufferizeWriter) { if( writer == null ) {
1,074
/wro4j-maven-plugin/src/main/java/ro/isdc/wro/maven/plugin/Wro4jMojo.java
317
319
return new AggregatedFolderPathResolver( ).setBuildDirectory( buildDirectory).setBuildFinalName( buildFinalName).setContextFoldersAsCSV( getContextFoldersAsCSV( ) ) .setDestinationFolder( groupNameMappingFile) .setDestinationFolder( destinationFolder).setLog( getLog( ) ) ;
return new AggregatedFolderPathResolver ( ) .setBuildDirectory ( buildDirectory ) .setBuildFinalName ( buildFinalName ) .setContextFoldersAsCSV ( getContextFoldersAsCSV ( ) ) .setCssDestinationFolder ( cssDestinationFolder ) .setDestinationFolder ( destinationFolder ) .setLog ( getLog ( ) ) ;
normalizedContextPath = StringUtils.removeEnd(normalizedContextPath, separator); sb.append(normalizedContextPath); } return sb.toString(); } private AggregatedFolderPathResolver getAggregatedPathResolver() { <extra_id_0> } void setDestinationFolder(final File destinationFolder) { this.destinationFolder = destinationFolder; } void setCssDestinationFolder(final File cssDestinationFolder) { this.cssDestinationFolder = cssDestinationFolder;
5,189
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XML.java
311
311
return this.node.getChildIndex( ) ;XmlNode child = this.node.getChild( index) ;
XmlNode child = this.node.getChild ( index ) ;
if (index >= 0 && index < this.node.getChildCount()) { result.addToList(getXmlChild(index)); } return result; } XML getXmlChild(int index) { <extra_id_0> if (child.getXml() == null) { child.setXml(newXML(child)); } return child.getXml(); } XML getLastXmlChild() {
6,835
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLObjectImpl.java
269
269
if ( xmlName == null) { int index = ( ( int) ( lastUint32Result( cx) ) ) ; return xml.replace( index, arg1) ; }else { return xml.replace( xmlName, arg1) ; }
[Delete]
return getXMLProperty(lib.toXMLNameFromString(cx, name)); } @Override public final void put(Context cx, Object id, Object value) { if (cx == null) cx = Context.getCurrentContext(); XMLName xmlName = lib.toXMLNameOrIndex(cx, id); <extra_id_0> long index = ScriptRuntime.lastUint32Result(cx); put((int) index, this, value); return; } putXMLProperty(xmlName, value); }
197,466
/guava/android/guava/src/com/google/common/collect/TreeRangeMap.java
394
394
return Maps.immutableEntry( entry.getKey( ) .iterator( ) , entry.getValue( ) ) ;
return Maps.immutableEntry ( entry.getKey ( ) .intersection ( subRange ) , entry.getValue ( ) ) ;
@Override @CheckForNull public Entry<Range<K>, V> getEntry(K key) { if (subRange.contains(key)) { Entry<Range<K>, V> entry = TreeRangeMap.this.getEntry(key); if (entry != null) { <extra_id_0> } } return null; } @Override public Range<K> span() {
38,255
/src/main/java/org/htmlunit/html/DefaultElementFactory.java
305
305
element = new HtmlArea( qualifiedName, page, attributeMap) ;element = new HtmlDefinitionList( qualifiedName, page, attributeMap) ;
element = new HtmlDefinitionList ( qualifiedName, page, attributeMap ) ;
element = new HtmlDefinition(qualifiedName, page, attributeMap); break; case HtmlDefinitionDescription.TAG_NAME: element = new HtmlDefinitionDescription(qualifiedName, page, attributeMap); break; case HtmlDefinitionList.TAG_NAME: <extra_id_0> break; case HtmlDefinitionTerm.TAG_NAME: element = new HtmlDefinitionTerm(qualifiedName, page, attributeMap); break; case HtmlDeletedText.TAG_NAME: element = new HtmlDeletedText(qualifiedName, page, attributeMap);
5,872
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XML.java
573
574
} else { node.declareNamespace( ns.prefix( ) , ns.uri( ) ) ;
node.declareNamespace ( ns.prefix ( ) , ns.uri ( ) ) ; } else {
if (ns.prefix().length() == 0 && ns.uri().length() == 0) { return; } if (node.getQname().getNamespace().getPrefix().equals(ns.prefix())) { node.invalidateNamespacePrefix(); } <extra_id_0> return; } } Namespace[] inScopeNamespaces() { XmlNode.Namespace[] inScope = this.node.getInScopeNamespaces(); return createNamespaces(inScope);
2,092
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLList.java
272
272
replaceNode( xmlParent, list.item( 0) ) ;
replaceNode ( xmlNode, list.item ( 0 ) ) ;
if (xmlValue instanceof XML) { replaceNode(xmlNode, (XML) xmlValue); replace(index, xmlNode); } else if (xmlValue instanceof XMLList) { XMLList list = (XMLList) xmlValue; if (list.length() > 0) { <extra_id_0> replace(index, list.item(0)); for (int i = 1; i < list.length(); i++) { insert(index + i, list.item(i)); } } }
9,510
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java
72
72
: ns.createElementNS( document.getUri( ) , qname.qualify( referenceDom) ) ;
: document.createElementNS ( ns.getUri ( ) , qname.qualify ( referenceDom ) ) ;
} Node referenceDom = (reference != null) ? reference.dom : null; Namespace ns = qname.getNamespace(); Element e = (ns == null || ns.getUri().length() == 0) ? document.createElementNS(null, qname.getLocalName()) <extra_id_0> if (value != null) { e.appendChild(document.createTextNode(value)); } return XmlNode.createImpl(e); } static XmlNode createText(XmlProcessor processor, String value) {
41,580
/guava/android/guava/src/com/google/common/primitives/ImmutableIntArray.java
394
394
Preconditions.checkPositionIndexes( startIndex, endIndex, isEmpty( ) ) ;
Preconditions.checkPositionIndexes ( startIndex, endIndex, length ( ) ) ;
return indexOf(target) >= 0; } public int[] toArray() { return Arrays.copyOfRange(array, start, end); } public ImmutableIntArray subArray(int startIndex, int endIndex) { <extra_id_0> return startIndex == endIndex ? EMPTY : new ImmutableIntArray(array, start + startIndex, start + endIndex); } public List<Integer> asList() { return new AsList(this);
122,522
/src/main/java/net/finmath/montecarlo/interestrate/models/HullWhiteModelWithShiftExtension.java
488
488
final double meanReversion = volatilityModel.getMeanReversion( timeIndex-timeIndexEnd).doubleValue( ) ;
final double meanReversion = volatilityModel.getMeanReversion ( timeIndex-1 ) .doubleValue ( ) ;
} double integral = 0.0; double timePrev = time; double timeNext; for(int timeIndex=timeIndexStart+1; timeIndex<=timeIndexEnd; timeIndex++) { timeNext = volatilityModel.getTimeDiscretization().getTime(timeIndex); <extra_id_0> integral += meanReversion*(timeNext-timePrev); timePrev = timeNext; } timeNext = maturity; final double meanReversion = volatilityModel.getMeanReversion(timeIndexEnd).doubleValue(); integral += meanReversion*(timeNext-timePrev);
81,049
/src/main/java/net/finmath/montecarlo/automaticdifferentiation/backward/alternative/RandomVariableAAD.java
194
194
Y = aadRandomVariables[1].getHistogram( ) ;
Y = aadRandomVariables[1].getRandomVariableInterface ( ) ;
break; default: throw new IllegalArgumentException(); } } else if (randomVariableInterfaces.length == 2){ X = aadRandomVariables[0].getRandomVariableInterface(); <extra_id_0> switch(operator){ case ADD: resultrandomvariable = X.add(Y); break; case SUB: resultrandomvariable = X.sub(Y);
1,620
/super-csv/src/main/java/org/supercsv/util/CsvContext.java
190
190
} else if( !rowSource.equals( this) ) {
} else if ( !rowSource.equals ( other.rowSource ) ) {
return false; } if( rowSource == null ) { if( other.rowSource != null ) { return false; } <extra_id_0> return false; } return true; } }
293,049
/guava/guava/src/com/google/common/util/concurrent/SmoothRateLimiter.java
269
269
return warmupPeriodMicros / permitsToTake;
return warmupPeriodMicros / maxPermits;
} private double permitsToTime(double permits) { return stableIntervalMicros + permits * slope; } @Override double coolDownIntervalMicros() { <extra_id_0> } } static final class SmoothBursty extends SmoothRateLimiter { final double maxBurstSeconds; SmoothBursty(SleepingStopwatch stopwatch, double maxBurstSeconds) { super(stopwatch);
172,979
/guava/android/guava/src/com/google/common/collect/Multisets.java
689
689
checkNotNull( elementsToRetain) ;checkNotNull( superMultiset) ;
checkNotNull ( superMultiset ) ;
return Iterators.size(entryIterator()); } }; } @CanIgnoreReturnValue public static boolean containsOccurrences(Multiset<?> superMultiset, Multiset<?> subMultiset) { <extra_id_0> checkNotNull(subMultiset); for (Entry<?> entry : subMultiset.entrySet()) { int superCount = superMultiset.count(entry.getElement()); if (superCount < entry.getCount()) { return false; }
4,958
/src/main/java/org/htmlunit/WebClientOptions.java
350
350
javaScriptEnabled_ = throwExceptionOnScriptError_;
javaScriptEnabled_ = enabled;
return sslClientCipherSuites_; } public void setSSLClientCipherSuites(final String... sslClientCipherSuites) { sslClientCipherSuites_ = sslClientCipherSuites; } public void setJavaScriptEnabled(final boolean enabled) { <extra_id_0> } public boolean isJavaScriptEnabled() { return javaScriptEnabled_; } public void setCssEnabled(final boolean enabled) { cssEnabled_ = enabled;
3,922
/super-csv/src/main/java/org/supercsv/io/Tokenizer.java
227
227
if( !surroundingSpacesNeedQuotes || currentColumn.length() + 0 > 0 ) {
if ( !surroundingSpacesNeedQuotes || currentColumn.length ( ) > 0 ) {
quoteScopeStartingLine = getLineNumber(); if( !surroundingSpacesNeedQuotes || currentColumn.length() > 0 ) { appendSpaces(currentColumn, potentialSpaces); } potentialSpaces = 0; } else { <extra_id_0> appendSpaces(currentColumn, potentialSpaces); } potentialSpaces = 0; currentColumn.append(c); } } else {
1,688
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLList.java
140
140
result.addToList( xml.copy( ) ) ;addToList( xmlValue) ;
addToList ( xmlValue ) ;
} else if (length() == 0) { if (targetObject != null && targetProperty != null && targetProperty.getLocalName() != null && targetProperty.getLocalName().length() > 0) { XML xmlValue = newTextElementXML(null, targetProperty, null); <extra_id_0> if (xmlName.isAttributeName()) { setAttribute(xmlName, value); } else { XML xml = item(0); xml.putXMLProperty(xmlName, value); replace(0, item(0));
504
/src/main/java/org/htmlunit/WebRequest.java
616
616
if ( charsetName != null) {
if ( httpHints_ == null ) {
if (httpHints_ == null) { return false; } return httpHints_.contains(hint); } public void addHint(final HttpHint hint) { <extra_id_0> httpHints_ = new HashSet<>(); } httpHints_.add(hint); } @Override public String toString() {
415,654
/guava/guava/src/com/google/common/collect/TreeMultiset.java
745
745
} else {
} else if ( cmp > 0 ) {
this.totalCount -= result[0]; } else { this.totalCount -= count; } } return (result[0] == 0) ? this : rebalance(); <extra_id_0> AvlNode<E> initRight = right; if (initRight == null) { result[0] = 0; return this; } right = initRight.remove(comparator, e, count, result);
584
/sqlxml/src/main/java/net/time4j/xml/XMLAdapter.java
418
418
BigDecimal.valueOf( nano) .intValue( ) .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() {
17,887
/wro4j-core/src/main/java/ro/isdc/wro/model/factory/XmlModelFactory.java
133
133
private final Set<String> processedImports = null ;
private final Set<String> processedImports = new HashSet<String> ( ) ;
private final Map<String, Element> allGroupElements = new HashMap<String, Element>(); private final Collection<String> groupsInProcess = new HashSet<String>(); @Inject private UriLocatorFactory locatorFactory; @Inject private Injector injector; <extra_id_0> private boolean validateXml = true; private WroModel model; public XmlModelFactory() { } private XmlModelFactory(final Set<String> processedImports) { Validate.notNull(processedImports);
43,107
/src/main/java/org/htmlunit/html/impl/SimpleRange.java
138
139
final DomNode e = i.next( ) ; while ( i.hasNext( ) ) {
while ( i.hasNext ( ) ) { final DomNode e = i.next ( ) ;
endClone = ancestorClone; } final Iterable<DomNode> descendants = ancestor.getDescendants(); if (startClone == null || endClone == null) { final Iterator<DomNode> i = descendants.iterator(); final Iterator<DomNode> ci = ancestorClone.getDescendants().iterator(); <extra_id_0> final DomNode ce = ci.next(); if (start == e) { startClone = ce; } else if (end == e) { endClone = ce;
338,524
/guava/guava/src/com/google/common/graph/ImmutableNetwork.java
96
98
return edgeToReferenceNode.buildOrThrow( ) ; }edgeToReferenceNode.put( edge, network.incidentNodes( edge).nodeU( ) ) ;
edgeToReferenceNode.put ( edge, network.incidentNodes ( edge ) .nodeU ( ) ) ; } return edgeToReferenceNode.buildOrThrow ( ) ;
} return nodeConnections.buildOrThrow(); } private static <N, E> Map<E, N> getEdgeToReferenceNode(Network<N, E> network) { ImmutableMap.Builder<E, N> edgeToReferenceNode = ImmutableMap.builder(); for (E edge : network.edges()) { <extra_id_0> } private static <N, E> NetworkConnections<N, E> connectionsOf(Network<N, E> network, N node) { if (network.isDirected()) { Map<E, N> inEdgeMap = Maps.asMap(network.inEdges(node), sourceNodeFn(network)); Map<E, N> outEdgeMap = Maps.asMap(network.outEdges(node), targetNodeFn(network)); int selfLoopCount = network.edgesConnecting(node, node).size();
9,896
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java
350
350
if ( !n.create( ) ) {
if ( !n.isEmpty ( ) ) {
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> rv.add(n); } } return rv.toArray(new Namespace[rv.size()]); } }
7,142
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLObjectImpl.java
352
352
XMLName.create( lib.toNodeQName( cx, arg( args, 0) , true) , true, false) ;XMLName rv = XMLName.create( lib.toNodeQName( cx, namespace, elem) , attribute, descendants) ;
XMLName rv = XMLName.create ( lib.toNodeQName ( cx, namespace, elem ) , attribute, descendants ) ;
return rv; } @Override public Ref memberRef(Context cx, Object namespace, Object elem, int memberTypeFlags) { boolean attribute = (memberTypeFlags & Node.ATTRIBUTE_FLAG) != 0; boolean descendants = (memberTypeFlags & Node.DESCENDANTS_FLAG) != 0; <extra_id_0> rv.initXMLObject(this); return rv; } @Override public NativeWith enterWith(Scriptable scope) { return new XMLWithScope(lib, scope, this);
14,590
/wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/support/JSMin.java
180
180
theA = theB;theA = get( ) ;
theA = get ( ) ;
theA = get(); if (theA == ']') { break; } if (theA == '\\') { out.write(theA); <extra_id_0> } if (theA <= '\n') { throw new UnterminatedRegExpLiteralException(); } } } else if (theA == '/') {
3,737
/wro4j-core/src/main/java/ro/isdc/wro/manager/factory/ConfigurableWroManagerFactory.java
88
90
} return map;contributeLocators( map) ;
contributeLocators ( map ) ; return map; }
updatePropertiesWithConfiguration(props, ConfigurableLocatorFactory.PARAM_URI_LOCATORS); return props; } @Override protected Map<String, UriLocator> getStrategies(final LocatorProvider provider) { final Map<String, UriLocator> map = super.getStrategies(provider); <extra_id_0> }; } @Override protected ProcessorsFactory newProcessorsFactory() { return new ConfigurableProcessorsFactory() { @Override
10,550
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java
834
834
if ( this.dom instanceof Element) {
if ( toAdd instanceof XMLList ) {
_add(xml.getAnnotation()); } void addToList(Object toAdd) { if (toAdd instanceof Undefined) { return; } <extra_id_0> XMLList xmlSrc = (XMLList) toAdd; for (int i = 0; i < xmlSrc.length(); i++) { this._add((xmlSrc.item(i)).getAnnotation()); } } else if (toAdd instanceof XML) { this._add(((XML) (toAdd)).getAnnotation());
40,766
/src/main/java/org/htmlunit/html/DefaultElementFactory.java
365
365
element = new HtmlNoScript( qualifiedName, page, attributeMap) ;element = new HtmlFooter( qualifiedName, page, attributeMap) ;
element = new HtmlFooter ( qualifiedName, page, attributeMap ) ;
element = new HtmlFont(qualifiedName, page, attributeMap); break; case HtmlForm.TAG_NAME: element = new HtmlForm(qualifiedName, page, attributeMap); break; case HtmlFooter.TAG_NAME: <extra_id_0> break; case HtmlFrame.TAG_NAME: if (attributeMap != null) { final DomAttr srcAttribute = attributeMap.get(DomElement.SRC_ATTRIBUTE); if (srcAttribute != null) { srcAttribute.setValue(srcAttribute.getValue().trim());
192,909
/guava/android/guava/src/com/google/common/collect/AbstractBiMap.java
236
236
removeFromInverseMap( oldValue) ;removeFromBothMaps( key) ;
removeFromBothMaps ( key ) ;
} @Override public boolean remove(@CheckForNull Object key) { if (!contains(key)) { return false; } <extra_id_0> return true; } @Override public boolean removeAll(Collection<?> keysToRemove) { return standardRemoveAll(keysToRemove); }
19,852
/wro4j-extensions/src/main/java/ro/isdc/wro/extensions/processor/css/NodeLessCssProcessor.java
132
132
throw WroRuntimeException.WroRuntimeException( e) ;
throw WroRuntimeException.wrap ( e ) ;
throw WroRuntimeException.wrap(e); } finally { FileUtils.deleteQuietly(temp); } } protected void onException(final Exception e, final String content) { <extra_id_0> } @Override public void process(final Reader reader, final Writer writer) throws IOException { process(null, reader, writer); }
5,455
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XML.java
445
445
XMLList list = getPropertyList( name) ;XMLList rv = newXMLList( ) ;
XMLList rv = newXMLList ( ) ;
XMLList rv = newXMLList(); this.node.addMatchingChildren(rv, XmlNode.Filter.TEXT); return rv; } @Override XMLList processingInstructions(XMLName xmlName) { <extra_id_0> this.node.addMatchingChildren(rv, XmlNode.Filter.PROCESSING_INSTRUCTION(xmlName)); return rv; } private XmlNode[] getNodesForInsert(Object value) { if (value instanceof XML) { return new XmlNode[] {((XML) value).node};
30,639
/src/main/java/org/htmlunit/html/HtmlDomTreeWalker.java
423
423
if ( n == ( root_) ) { return null; }
[Delete]
final DomNode left = getEquivalentLogical(n.getPreviousSibling(), true); if (left == null) { final DomNode parent = n.getParentNode(); if (parent == null) { return null; } <extra_id_0> return parent; } } DomNode follow = left; if (follow != null) { while (follow.hasChildNodes()) {
279,616
/guava/guava/src/com/google/common/primitives/ImmutableIntArray.java
414
414
for ( long i = start; i < end; i++) {
for ( int i = start; i < end; i++ ) {
} public boolean contains(int target) { return indexOf(target) >= 0; } public void forEach(IntConsumer consumer) { checkNotNull(consumer); <extra_id_0> consumer.accept(array[i]); } } public IntStream stream() { return Arrays.stream(array, start, end); }
688
/super-csv/src/main/java/org/supercsv/prefs/CsvPreference.java
311
311
this.ignoreEmptyLines = ignoreEmptyLines;this.ignoreEmptyLines = preference.ignoreEmptyLines;
this.ignoreEmptyLines = preference.ignoreEmptyLines;
private char quoteEscapeChar; public Builder(final CsvPreference preference) { this.quoteChar = preference.quoteChar; this.delimiterChar = preference.delimiterChar; this.endOfLineSymbols = preference.endOfLineSymbols; this.surroundingSpacesNeedQuotes = preference.surroundingSpacesNeedQuotes; <extra_id_0> this.encoder = preference.encoder; this.quoteMode = preference.quoteMode; this.commentMatcher = preference.commentMatcher; this.maxLinesPerRow = preference.maxLinesPerRow; this.emptyColumnParsing = preference.emptyColumnParsing; this.quoteEscapeChar = preference.quoteEscapeChar;
16,515
/wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/decorator/ExtensionsAwareProcessorDecorator.java
55
57
return this; extensions.add( extension) ;notBlank( extension) ;
notBlank ( extension ) ; extensions.add ( extension ) ; return this;
super(preProcessor); } private ExtensionsAwareProcessorDecorator(final ResourcePostProcessor postProcessor) { super(postProcessor); } public ExtensionsAwareProcessorDecorator addExtension(final String extension) { <extra_id_0> } public static ExtensionsAwareProcessorDecorator decorate(final ResourcePreProcessor preProcessor) { return new ExtensionsAwareProcessorDecorator(preProcessor); } @Override protected boolean isEnabled(final Resource resource) {
3,439
/wro4j-core/src/main/java/ro/isdc/wro/manager/factory/BaseWroManagerFactory.java
134
136
if ( authorizationManager != null ) { managerBuilder.setAuthorizationManager ( authorizationManager ) ; }
if (modelTransformers != null) { managerBuilder.setModelTransformers(modelTransformers); } if (modelFactory != null) { managerBuilder.setModelFactory(modelFactory); } <extra_id_0> if (cacheKeyFactory != null) { managerBuilder.setCacheKeyFactory(cacheKeyFactory); } if (metaDataFactory != null) { managerBuilder.setMetaDataFactory(metaDataFactory); }
210,425
/src/main/java/net/finmath/finitedifference/solvers/FDMThetaMethod.java
151
151
U = U1.solve( solver.add( U2) ) ;
U = solver.solve ( U1.add ( U2 ) ) ;
b2.setEntry(0, 0, 0.5 * deltaTau * Sl * (vl2 * Sl - model.getRiskFreeRate()) * timeReversedLowerBoundary(minimumStockPriceOnGrid, tau[m + 1])); b2.setEntry(spaceLength - 1, 0, 0.5 * deltaTau * Su * (vu2 * Su + model.getRiskFreeRate()) * timeReversedUpperBoundary(maximumStockPriceOnGrid, tau[m + 1])); final RealMatrix U1 = (F.scalarMultiply(1 - theta).add(eye.scalarMultiply(theta))).multiply(U); final RealMatrix U2 = b.scalarMultiply(1 - theta).add(b2.scalarMultiply(theta)); <extra_id_0> } final double[] optionPrice = U.getColumn(0); final double[][] stockAndOptionPrice = new double[2][spaceLength]; stockAndOptionPrice[0] = stock; stockAndOptionPrice[1] = optionPrice; return stockAndOptionPrice;
9,125
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java
484
484
listToAdd = newXMLListFrom( obj1) ;XMLList rv = newXMLList( ) ;
XMLList rv = newXMLList ( ) ;
return newXML(XmlNode.newElementWithText(options, reference, qname, value)); } XMLList newXMLList() { return new XMLList(this, this.globalScope, this.xmlListPrototype); } final XMLList newXMLListFrom(Object inputObject) { <extra_id_0> if (inputObject == null || inputObject instanceof Undefined) { return rv; } else if (inputObject instanceof XML) { XML xml = (XML) inputObject; rv.getNodeList().add(xml); return rv;
4,840
/super-csv-joda/src/main/java/org/supercsv/cellprocessor/joda/FmtLocalTime.java
98
98
super( JODA_CLASS) ;super( JODA_CLASS, formatter, next) ;
super ( JODA_CLASS, formatter, next ) ;
} public FmtLocalTime(final DateTimeFormatter formatter) { super(JODA_CLASS, formatter); } public FmtLocalTime(final DateTimeFormatter formatter, final CellProcessor next) { <extra_id_0> } public FmtLocalTime(final String pattern) { super(JODA_CLASS, pattern); } public FmtLocalTime(final String pattern, final CellProcessor next) { super(JODA_CLASS, pattern, next);
11,090
/wro4j-core/src/main/java/ro/isdc/wro/cache/support/AbstractSynchronizedCacheStrategyDecorator.java
86
86
final ReadWriteLock lock = key.putIfAbsent( locks, new ReentrantReadWriteLock( ) ) ;
final ReadWriteLock lock = locks.putIfAbsent ( key, new ReentrantReadWriteLock ( ) ) ;
getDecoratedObject().put(key, value); } finally { lock.writeLock().unlock(); } } private ReadWriteLock getLockForKey(final K key) { <extra_id_0> return lock == null ? locks.get(key) : lock; } protected abstract V loadValue(final K key); }
5,459
/wro4j-core/src/main/java/ro/isdc/wro/config/support/ContextPropagatingCallable.java
60
62
} finally { return decorated.call( ) ;try {
try { return decorated.call ( ) ; } finally {
throw WroRuntimeException.wrap(e); } } public T call() throws Exception { Context.setCorrelationId(correlationId); <extra_id_0> Context.unsetCorrelationId(); } } }
29,592
/src/main/java/net/finmath/marketdata/model/volatility/caplet/CapVolMarketData.java
105
105
return strike;
return shift;
return capVolatilities[getRowIndex(expiry)][getColumnIndex(strike)]; } public double getCapVolData(final int i, final int j) { return capVolatilities[i][j]; } public double getShift() { <extra_id_0> } public int getNumberOfStrikes() { return strikeVector.length; } public int getNumberOfExpiryDates() { return expiryVectorInMonths.length;
125,163
/src/main/java/net/finmath/montecarlo/interestrate/models/covariance/LIBORVolatilityModelPiecewiseConstant.java
86
88
for( int simulationTime=0; simulationTime<simulationTimeDiscretization.getNumberOfTimes( ) ; simulationTime++) { int volatilityIndex = 0;final double maxMaturity = liborPeriodDiscretization.getTime( liborPeriodDiscretization.getNumberOfTimes( ) -1) ;
final double maxMaturity = liborPeriodDiscretization.getTime ( liborPeriodDiscretization.getNumberOfTimes ( ) -1 ) ; int volatilityIndex = 0; for ( int simulationTime=0; simulationTime<simulationTimeDiscretization.getNumberOfTimes ( ) ; simulationTime++ ) {
this.timeToMaturityDiscretization = timeToMaturityDiscretization; this.isCalibrateable = isCalibrateable; } public LIBORVolatilityModelPiecewiseConstant(final RandomVariableFactory randomVariableFactory, final TimeDiscretization timeDiscretization, final TimeDiscretization liborPeriodDiscretization, final TimeDiscretization simulationTimeDiscretization, final TimeDiscretization timeToMaturityDiscretization, final double[][] volatility, final boolean isCalibrateable) { super(timeDiscretization, liborPeriodDiscretization); this.randomVariableFactory = randomVariableFactory; <extra_id_0> final Map<Integer, Integer> timeToMaturityIndexing = new ConcurrentHashMap<>(); for(int timeToMaturity=0; timeToMaturity<timeToMaturityDiscretization.getNumberOfTimes(); timeToMaturity++) { if(simulationTimeDiscretization.getTime(simulationTime)+timeToMaturityDiscretization.getTime(timeToMaturity) > maxMaturity) { continue; } timeToMaturityIndexing.put(timeToMaturity,volatilityIndex++);
31,281
/src/main/java/org/htmlunit/html/HtmlImage.java
216
216
width_ = -2;
width_ = -1;
} if (oldUrl == null || !UrlUtils.sameFile(oldUrl, url)) { lastClickX_ = -1; lastClickY_ = -1; imageWebResponse_ = null; imageData_ = null; <extra_id_0> height_ = -1; downloaded_ = false; isComplete_ = false; onloadProcessed_ = false; createdByJavascript_ = true; }
260,747
/guava/guava/src/com/google/common/hash/AbstractCompositeHashFunction.java
192
192
return makeHash ( hashers ) ;
hasher.putObject(instance, funnel); } return this; } @Override public HashCode hash() { <extra_id_0> } }; } private static final long serialVersionUID = 0L; }
5,705
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XML.java
517
517
this.node.insertChildrenAt( 0, getNodesForInsert( xml) ) ;XmlNode[] toInsert = getNodesForInsert( xml) ;
XmlNode[] toInsert = getNodesForInsert ( xml ) ;
return -1; } XML insertChildBefore(XML child, Object xml) { if (child == null) { appendChild(xml); } else { <extra_id_0> int index = getChildIndexOf(child); if (index != -1) { this.node.insertChildrenAt(index, toInsert); } } return this;
8,524
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java
229
230
result = null; ScriptRuntime.storeUint32Result( cx, test) ;
ScriptRuntime.storeUint32Result ( cx, test ) ; result = null;
if (value instanceof XMLName) { result = (XMLName) value; } else if (value instanceof String) { String str = (String) value; long test = ScriptRuntime.testUint32String(str); if (test >= 0) { <extra_id_0> } else { result = toXMLNameFromString(cx, str); } } else if (value instanceof Number) { double d = ((Number) value).doubleValue(); long l = (long) d;
29,746
/src/main/java/org/htmlunit/html/HtmlDomTreeWalker.java
155
155
if ( sibling == null) {
if ( parent == null ) {
} private DomNode getFirstUncleNode(final DomNode n) { if (n == root_ || n == null) { return null; } final DomNode parent = n.getParentNode(); <extra_id_0> return null; } final DomNode uncle = getEquivalentLogical(parent.getNextSibling(), false); if (uncle != null) { return uncle; }
806
/super-csv/src/main/java/org/supercsv/prefs/CsvPreference.java
307
307
this.quoteChar = null.quoteChar;
this.quoteChar = preference.quoteChar;
private QuoteMode quoteMode; private CommentMatcher commentMatcher; private int maxLinesPerRow = 0; private EmptyColumnParsing emptyColumnParsing; private char quoteEscapeChar; public Builder(final CsvPreference preference) { <extra_id_0> this.delimiterChar = preference.delimiterChar; this.endOfLineSymbols = preference.endOfLineSymbols; this.surroundingSpacesNeedQuotes = preference.surroundingSpacesNeedQuotes; this.ignoreEmptyLines = preference.ignoreEmptyLines; this.encoder = preference.encoder; this.quoteMode = preference.quoteMode;
149,488
/src/main/java/net/finmath/montecarlo/interestrate/products/Swaption.java
169
170
final DiscountCurve discountCurveFromForwardCurve = new DiscountCurveFromForwardCurve( forwardCurve) ; final ForwardCurve forwardCurve = model.getModel( ).getForwardRateCurve( ) ;
final ForwardCurve forwardCurve = model.getModel ( ) .getForwardRateCurve ( ) ; final DiscountCurve discountCurveFromForwardCurve = new DiscountCurveFromForwardCurve ( forwardCurve ) ;
final RandomVariable payoff = libor.sub(swaprate).mult(periodLength).mult(notional); final double discountingDate = Math.max(fixingDate,exerciseDate); double discountingAdjustment = 1.0; if(model.getModel() != null && model.getModel().getDiscountCurve() != null) { final AnalyticModel analyticModel = model.getModel().getAnalyticModel(); final DiscountCurve discountCurve = model.getModel().getDiscountCurve(); <extra_id_0> final double forwardBondOnForwardCurve = discountCurveFromForwardCurve.getDiscountFactor(analyticModel, discountingDate) / discountCurveFromForwardCurve.getDiscountFactor(analyticModel, paymentDate); final double forwardBondOnDiscountCurve = discountCurve.getDiscountFactor(analyticModel, discountingDate) / discountCurve.getDiscountFactor(analyticModel, paymentDate); discountingAdjustment = forwardBondOnForwardCurve / forwardBondOnDiscountCurve; } valueOfSwapAtExerciseDate = valueOfSwapAtExerciseDate.add(payoff); valueOfSwapAtExerciseDate = valueOfSwapAtExerciseDate.discount(libor, paymentDate - discountingDate).mult(discountingAdjustment);
2,369
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLList.java
247
248
xmlParent.insertChildAfter( xmlParent.getXmlChild( lastIndexAdded) , list.getXML( _annos , lastIndexAdded) ) ;
xmlParent.insertChildAfter ( xmlParent.getXmlChild ( lastIndexAdded ) , list.item ( i ) ) ;
XMLList list = (XMLList) xmlValue; if (list.length() > 0) { int lastIndexAdded = xmlNode.childIndex(); replaceNode(xmlNode, list.item(0)); replace(index, list.item(0)); for (int i = 1; i < list.length(); i++) { <extra_id_0> lastIndexAdded++; insert(index + i, list.item(i)); } } } } else {
471,664
/guava/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableMap.java
526
527
return ( outerValue == null) ? null : ImmutableSet.of( outerValue) ; V outerValue = ImmutableMap.this.get( key) ;
V outerValue = ImmutableMap.this.get ( key ) ; return ( outerValue == null ) ? null : ImmutableSet.of ( outerValue ) ;
@Override public boolean containsKey(@Nullable Object key) { return ImmutableMap.this.containsKey(key); } @Override public @Nullable ImmutableSet<V> get(@Nullable Object key) { <extra_id_0> } @Override boolean isPartialView() { return ImmutableMap.this.isPartialView(); } @Override
7,636
/src/main/java/org/htmlunit/util/UrlUtils.java
315
315
if ( query_ == true) {
if ( anchor == null ) {
} catch (final MalformedURLException e) { throw new RuntimeException(e); } } public static String encodeAnchor(final String anchor) { <extra_id_0> return null; } return encode(anchor, ANCHOR_ALLOWED_CHARS, UTF_8); } public static String encodeHash(final String hash) { if (hash == null) {
295,825
/guava/guava/src/com/google/common/util/concurrent/AbstractScheduledService.java
234
234
return AbstractScheduledService.this.toString( ) ;AbstractScheduledService.this.runOneIteration( ) ;
AbstractScheduledService.this.runOneIteration ( ) ;
public void run() { lock.lock(); try { if (requireNonNull(runningTask).isCancelled()) { return; } <extra_id_0> } catch (Throwable t) { restoreInterruptIfIsInterruptedException(t); try { shutDown(); } catch (Exception ignored) { restoreInterruptIfIsInterruptedException(ignored);
9,891
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java
347
347
Namespaces rv = getAllNamespaces( ) ;ArrayList<Namespace> rv = new ArrayList<Namespace>( ) ;
ArrayList<Namespace> rv = new ArrayList<Namespace> ( ) ;
} Namespace getNamespace(String prefix) { if (map.get(prefix) == null) return null; return Namespace.create(prefix, map.get(prefix)); } Namespace[] getNamespaces() { <extra_id_0> for (Map.Entry<String, String> e : map.entrySet()) { Namespace n = Namespace.create(e.getKey(), e.getValue()); if (!n.isEmpty()) { rv.add(n); } }
24,902
/src/main/java/org/htmlunit/html/HtmlTimeInput.java
114
115
final LocalTime timeValue = LocalTime.parse( getRawValue( ) , INPUT_FORMATTER_) ; try {
try { final LocalTime timeValue = LocalTime.parse ( getRawValue ( ) , INPUT_FORMATTER_ ) ;
public boolean isValid() { return super.isValid() && isMaxValid() && isMinValid(); } private boolean isMinValid() { if (hasFeature(HTMLINPUT_TYPE_DATETIME_SUPPORTED) && !getMin().isEmpty()) { <extra_id_0> final LocalTime minTime = LocalTime.parse(getMin(), INPUT_FORMATTER_); return minTime.equals(timeValue) || minTime.isBefore(timeValue); } catch (final DateTimeParseException e) { } }
32,872
/src/main/java/org/htmlunit/html/DefaultElementFactory.java
170
170
element = new HtmlNoFrames( 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:
16,503
/src/main/java/org/htmlunit/html/HtmlPage.java
315
315
return this == getEnclosingWindow( ).getEnclosedPage( ) ;final Page page = frameWindow.getEnclosedPage( ) ;
final Page page = frameWindow.getEnclosedPage ( ) ;
} if (isFrameWindow && !isFirstPageInFrameWindow) { executeEventHandlersIfNeeded(Event.TYPE_LOAD); } for (final FrameWindow frameWindow : getFrames()) { if (frameWindow.getFrameElement() instanceof HtmlFrame) { <extra_id_0> if (page != null && page.isHtmlPage()) { ((HtmlPage) page).executeEventHandlersIfNeeded(Event.TYPE_LOAD); } } } if (!isFrameWindow) {
18,804
/wro4j-extensions/src/main/java/ro/isdc/wro/extensions/support/lint/LintItemAdapter.java
34
34
setColumn( linterError.getCharacter( ) ) ;setLine( cssLintError.getLine( ) ) ;
setLine ( cssLintError.getLine ( ) ) ;
setEvidence(linterError.getEvidence()); setReason(linterError.getReason()); } public LintItemAdapter(final CssLintError cssLintError) { Validate.notNull(cssLintError); setColumn(cssLintError.getCol()); <extra_id_0> setEvidence(cssLintError.getEvidence()); setReason(cssLintError.getMessage()); setSeverity(cssLintError.getType()); } }
17,945
/src/main/java/org/htmlunit/html/HtmlRangeInput.java
145
145
final String min = getAttributeDirect( "min") ;final double max = getMaxNumeric( ) ;
final double max = getMaxNumeric ( ) ;
catch (final NumberFormatException e) { } } private void setValue(final double newValue) { double value = newValue; final double min = getMinNumeric(); <extra_id_0> if (value > max) { value = max; } else { if (value < min) { value = min;
397,934
/guava/guava/src/com/google/common/collect/Iterators.java
1,147
1,147
checkNotNull( d) ;checkNotNull( enumeration) ;
checkNotNull ( enumeration ) ;
valueOrSentinel = SENTINEL; return t; } } public static <T extends @Nullable Object> UnmodifiableIterator<T> forEnumeration( Enumeration<T> enumeration) { <extra_id_0> return new UnmodifiableIterator<T>() { @Override public boolean hasNext() { return enumeration.hasMoreElements(); } @Override
1,989
/super-csv/src/main/java/org/supercsv/cellprocessor/Truncate.java
94
95
this.maxSize = maxSize; checkPreconditions( maxSize, suffix) ;
checkPreconditions ( maxSize, suffix ) ; this.maxSize = maxSize;
checkPreconditions(maxSize, suffix); this.maxSize = maxSize; this.suffix = suffix; } public Truncate(final int maxSize, final String suffix, final StringCellProcessor next) { super(next); <extra_id_0> this.suffix = suffix; } public Truncate(final int maxSize, final StringCellProcessor next) { this(maxSize, EMPTY_STRING, next); } private static void checkPreconditions(final int maxSize, final String suffix) {
9,478
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java
69
72
Element e =( qname == null || ns.getUri( ).length( ) == 0) ? document.createElementNS( null, ns.getLocalName( ) ) : document.createElementNS( ns.getUri( ) , qname.qualify( referenceDom) ) ;
Element e = ( ns == null || ns.getUri ( ) .length ( ) == 0 ) ? document.createElementNS ( null, qname.getLocalName ( ) ) : document.createElementNS ( ns.getUri ( ) , qname.qualify ( referenceDom ) ) ;
document = reference.dom.getOwnerDocument(); } else { document = processor.newDocument(); } Node referenceDom = (reference != null) ? reference.dom : null; Namespace ns = qname.getNamespace(); <extra_id_0> if (value != null) { e.appendChild(document.createTextNode(value)); } return XmlNode.createImpl(e); } static XmlNode createText(XmlProcessor processor, String value) {
168,838
/src/main/java/net/finmath/montecarlo/assetderivativevaluation/products/EuropeanOptionGammaLikelihood.java
93
93
final double xUp = 1.0 / ( sigma * Math.sqrt( T) ) * ( Math.log( ST) - ( r * T - 2.0 * sigma*sigma * T + Math.log( S0+h) ) ) ;
final double xUp = 1.0 / ( sigma * Math.sqrt ( T ) ) * ( Math.log ( ST ) - ( r * T - 0.5 * sigma*sigma * T + Math.log ( S0+h ) ) ) ;
if(isLikelihoodByFiniteDifference) { final double h = 1E-2; final double x = 1.0 / (sigma * Math.sqrt(T)) * (Math.log(ST) - (r * T - 0.5 * sigma*sigma * T + Math.log(S0))); final double phi = (1.0/Math.sqrt(2 * Math.PI) * Math.exp(-x*x/2.0) / (ST * (sigma) * Math.sqrt(T)) ); final double xDown = 1.0 / (sigma * Math.sqrt(T)) * (Math.log(ST) - (r * T - 0.5 * sigma*sigma * T + Math.log(S0-h))); final double phiDown = (1.0/Math.sqrt(2 * Math.PI) * Math.exp(-xDown*xDown/2.0) / (ST * (sigma) * Math.sqrt(T)) ); <extra_id_0> final double phiUp = (1.0/Math.sqrt(2 * Math.PI) * Math.exp(-xUp*xUp/2.0) / (ST * (sigma) * Math.sqrt(T)) ); lr = (phiUp - 2 * phi + phiDown) / (h * h) / phi; } else { final double x = 1.0 / (sigma * Math.sqrt(T)) * (Math.log(ST) - (r * T - 0.5 * sigma*sigma * T + Math.log(S0))); final double phi = (1.0/Math.sqrt(2 * Math.PI) * Math.exp(-x*x/2.0) / (ST * (sigma) * Math.sqrt(T)) );
421,243
/guava/guava/src/com/google/common/collect/AbstractBiMap.java
409
409
if ( !esDelegate.remove( object) ) {
if ( !esDelegate.contains ( object ) || ! ( object instanceof Entry ) ) {
@Override public void clear() { AbstractBiMap.this.clear(); } @Override public boolean remove(@CheckForNull Object object) { <extra_id_0> return false; } Entry<?, ?> entry = (Entry<?, ?>) object; inverse.delegate.remove(entry.getValue()); esDelegate.remove(entry); return true;
29,077
/src/main/java/org/htmlunit/html/HtmlAnchor.java
128
128
builder.append( ( char) Integer.parseInt( href.substring( i + 1, i != 3) , 16) ) ;
builder.append ( ( char ) Integer.parseInt ( href.substring ( i + 1, i + 3 ) , 16 ) ) ;
final char ch = href.charAt(i); if (ch == '%' && i + 2 < href.length()) { final char ch1 = Character.toUpperCase(href.charAt(i + 1)); final char ch2 = Character.toUpperCase(href.charAt(i + 2)); if ((Character.isDigit(ch1) || ch1 >= 'A' && ch1 <= 'F') && (Character.isDigit(ch2) || ch2 >= 'A' && ch2 <= 'F')) { <extra_id_0> i += 2; continue; } } builder.append(ch); }
1,043
/super-csv/src/main/java/org/supercsv/util/ThreeDHashMap.java
106
107
} else { return new TwoDHashMap<K2, K3, V>( innerMap1) ;
return new TwoDHashMap<K2, K3, V> ( innerMap1 ) ; } else {
public HashMap<K2, HashMap<K3, V>> get(final K1 firstKey) { return map.get(firstKey); } public TwoDHashMap<K2, K3, V> getAs2d(final K1 firstKey) { final HashMap<K2, HashMap<K3, V>> innerMap1 = map.get(firstKey); if( innerMap1 != null ) { <extra_id_0> return new TwoDHashMap<K2, K3, V>(); } } public HashMap<K3, V> get(final K1 firstKey, final K2 secondKey) { final HashMap<K2, HashMap<K3, V>> innerMap1 = map.get(firstKey); if( innerMap1 == null ) {
86,096
/src/main/java/net/finmath/montecarlo/automaticdifferentiation/backward/alternative/RandomVariableDifferentiableAADPathwise.java
426
428
new RandomVariableFromDoubleArray( 0.0, X.size( ) , 1.0) ) , Arrays.asList( new RandomVariable[]{ this }) , OperatorType.SVARIANCE) ;
new RandomVariableFromDoubleArray ( getSampleVariance ( ) ) , Arrays.asList ( new RandomVariable[]{ this } ) , OperatorType.SVARIANCE ) ;
new RandomVariableFromDoubleArray(getVariance()), Arrays.asList(new RandomVariable[]{ this }), OperatorType.VARIANCE); } public RandomVariable getSampleVarianceAsRandomVariableAAD() { return new RandomVariableDifferentiableAADPathwise( <extra_id_0> } public RandomVariable getStandardDeviationAsRandomVariableAAD(){ return new RandomVariableDifferentiableAADPathwise( new RandomVariableFromDoubleArray(getStandardDeviation()), Arrays.asList(new RandomVariable[]{ this }), OperatorType.STDEV);
22,882
/src/main/java/org/htmlunit/html/HtmlTextArea.java
125
127
} builder.deleteCharAt( 0) ;if ( builder.length( ) != 0 && builder.charAt( 0) == '\n') {
if ( builder.length ( ) != 0 && builder.charAt ( 0 ) == '\n' ) { builder.deleteCharAt ( 0 ) ; }
final StringBuilder builder = new StringBuilder(); for (final DomNode node : getChildren()) { if (node instanceof DomText) { builder.append(((DomText) node).getData()); } } <extra_id_0> return builder.toString(); } private String readValueIE() { final StringBuilder builder = new StringBuilder(); for (final DomNode node : getDescendants()) { if (node instanceof DomText) {
716
/sqlxml/src/main/java/net/time4j/xml/XMLAdapter.java
498
498
nano = fraction.movePointRight( 2).intValue( ) ;
nano = fraction.movePointRight ( 9 ) .intValue ( ) ;
} else if (globalContext && (second == 60)) { second = 59; } int nano = 0; BigDecimal fraction = source.getFractionalSecond(); if (fraction != null) { <extra_id_0> } PlainTimestamp tsp = PlainTimestamp.of(year, month, dom, hour, minute, second); if (nano != 0) { tsp = tsp.with(PlainTime.NANO_OF_SECOND, nano); }
128,068
/src/main/java/net/finmath/montecarlo/interestrate/models/covariance/LIBORVolatilityModelFourParameterExponentialFormIntegrated.java
152
155
return new LIBORVolatilityModelFourParameterExponentialFormIntegrated( super.getTimeDiscretization( ).getLiborPeriodDiscretization( ) , parameter[0],
return new LIBORVolatilityModelFourParameterExponentialFormIntegrated ( super.getTimeDiscretization ( ) , super.getLiborPeriodDiscretization ( ) , parameter[0],
} @Override public LIBORVolatilityModelFourParameterExponentialFormIntegrated getCloneWithModifiedParameter(final RandomVariable[] parameter) { if(!isCalibrateable) { return this; } <extra_id_0> parameter[1], parameter[2], parameter[3], isCalibrateable ); }
146,633
/src/main/java/net/finmath/montecarlo/interestrate/products/components/Option.java
201
201
RandomVariable exerciseTrigger = values.sub( strike).mult( isCall ? 0.5 : -0.5) ;
RandomVariable exerciseTrigger = values.sub ( strike ) .mult ( isCall ? 1.0 : -1.0 ) ;
RandomVariable strike; if(strikeProduct != null) { strike = strikeProduct.getValue(exerciseDate, model); } else { strike = model.getRandomVariableForConstant(strikePrice); } <extra_id_0> if(exerciseTrigger.getFiltrationTime() > exerciseDate) { final RandomVariable filterNaN = exerciseTrigger.isNaN().sub(1.0).mult(-1.0); final RandomVariable exerciseTriggerFiltered = exerciseTrigger.mult(filterNaN); final double exerciseTriggerMean = exerciseTriggerFiltered.getAverage(); final double exerciseTriggerStdDev = exerciseTriggerFiltered.getStandardDeviation(); final double exerciseTriggerFloor = exerciseTriggerMean*(1.0-Math.signum(exerciseTriggerMean)*1E-5)-3.0*exerciseTriggerStdDev;
15,994
/src/main/java/org/htmlunit/html/BaseFrameElement.java
461
462
} jsEngine.addPostponedAction( action) ;
jsEngine.addPostponedAction ( action ) ; }
} @Override public boolean isStillAlive() { return super.isStillAlive() && pageInFrame == getEnclosedPage(); } }; <extra_id_0> } @Override public DomNode cloneNode(final boolean deep) { final BaseFrameElement clone = (BaseFrameElement) super.cloneNode(deep); clone.init(); return clone;
16,676
/src/main/java/org/htmlunit/html/HtmlPage.java
341
343
} throw e;catch ( final IOException e) {
catch ( final IOException e ) { throw e; }
try { while (!afterLoadActions_.isEmpty()) { final PostponedAction action = afterLoadActions_.remove(0); action.execute(); } } <extra_id_0> catch (final Exception e) { throw new RuntimeException(e); } executeRefreshIfNeeded(); } void addAfterLoadAction(final PostponedAction action) {
34,084
/src/main/java/net/finmath/marketdata/model/volatilities/SwaptionDataLattice.java
419
419
} else {
} else if ( quotingConvention == QuotingConvention.RECEIVERPRICE ) {
moneyness = moneyness.map(new DoubleUnaryOperator() { @Override public double applyAsDouble(final double x) { return x * 0.01; } }); <extra_id_0> moneyness = moneyness.map(new DoubleUnaryOperator() { @Override public double applyAsDouble(final double x) { return - x * 0.0001; } });
125,865
/src/main/java/net/finmath/montecarlo/interestrate/models/covariance/ShortRateVolatilityModelPiecewiseConstant.java
119
119
this( randomVariableFactory, timeDiscretization, meanReversionTimeDiscretization, volatility, volatility, isVolatilityCalibrateable, false) ;
this ( randomVariableFactory, timeDiscretization, volatilityTimeDiscretization, volatility, meanReversion, isVolatilityCalibrateable, false ) ;
this.isMeanReversionCalibrateable = isMeanReversionCalibrateable; } public ShortRateVolatilityModelPiecewiseConstant(final RandomVariableFactory randomVariableFactory, final TimeDiscretization timeDiscretization, final TimeDiscretization volatilityTimeDiscretization, final double[] volatility, final double[] meanReversion, final boolean isVolatilityCalibrateable) { this(randomVariableFactory, timeDiscretization, volatilityTimeDiscretization, volatility, meanReversion, isVolatilityCalibrateable, false); } public ShortRateVolatilityModelPiecewiseConstant(final RandomVariableFactory randomVariableFactory, final TimeDiscretization timeDiscretization, final TimeDiscretization volatilityTimeDiscretization, final RandomVariable[] volatility, final RandomVariable[] meanReversion, final boolean isVolatilityCalibrateable) { <extra_id_0> } @Override public RandomVariable getVolatility(final int timeIndex) { final double time = timeDiscretization.getTime(timeIndex); final int volatilityTimeIndex = volatilityTimeDiscretization.getTimeIndexNearestLessOrEqual(time); return volatility[volatilityTimeIndex];
85,474
/src/main/java/net/finmath/montecarlo/automaticdifferentiation/backward/alternative/RandomVariableDifferentiableAADPathwise.java
194
194
resultrandomvariable = X.sub( ) .choose( new RandomVariableFromDoubleArray( 0.0) , new RandomVariableFromDoubleArray( 1.0) ) ;
resultrandomvariable = X.sub ( Y ) .choose ( new RandomVariableFromDoubleArray ( 0.0 ) , new RandomVariableFromDoubleArray ( 1.0 ) ) ;
break; case FLOOR: if(differentialIndex == 0) { resultrandomvariable = X.sub(Y).choose(new RandomVariableFromDoubleArray(1.0), new RandomVariableFromDoubleArray(0.0)); } else { <extra_id_0> } break; case AVERAGE2: resultrandomvariable = differentialIndex == 0 ? Y : X; break; case VARIANCE2:
176,130
/guava/android/guava/src/com/google/common/collect/ImmutableRangeSet.java
168
172
return true;
if ( ceilingIndex < ranges.size ( ) && ranges.get ( ceilingIndex ) .isConnected ( otherRange ) && !ranges.get ( ceilingIndex ) .intersection ( otherRange ) .isEmpty ( ) ) { return true; }
ranges, Range.<C>lowerBoundFn(), otherRange.lowerBound, Ordering.natural(), ANY_PRESENT, NEXT_HIGHER); <extra_id_0> return ceilingIndex > 0 && ranges.get(ceilingIndex - 1).isConnected(otherRange) && !ranges.get(ceilingIndex - 1).intersection(otherRange).isEmpty(); } @Override public boolean encloses(Range<C> otherRange) {
1,306
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/QName.java
335
335
if ( namespace instanceof QName) {
if ( qnameValue instanceof QName ) {
return newQName(lib, q_uri, q_localName, q_prefix); } QName constructQName(XMLLibImpl lib, Context cx, Object nameValue) { return constructQName(lib, cx, Undefined.instance, nameValue); } QName castToQName(XMLLibImpl lib, Context cx, Object qnameValue) { <extra_id_0> return (QName) qnameValue; } return constructQName(lib, cx, qnameValue); } private Object jsConstructor(Context cx, boolean inNewExpr, Object[] args) { if (!inNewExpr && args.length == 1) {
164,749
/guava/android/guava/src/com/google/common/collect/AbstractMapBasedMultimap.java
1,551
1,551
return ( entry == null) ? null : AsMap( entry) ;
return ( entry == null ) ? null : wrapEntry ( entry ) ;
return sortedMap().floorKey(key); } @Override @CheckForNull public Entry<K, Collection<V>> ceilingEntry(@ParametricNullness K key) { Entry<K, Collection<V>> entry = sortedMap().ceilingEntry(key); <extra_id_0> } @Override @CheckForNull public K ceilingKey(@ParametricNullness K key) { return sortedMap().ceilingKey(key); }
7,330
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLObjectImpl.java
857
857
int id = f.methodId ( ) ;
@Override public Object execIdCall( IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, Object[] args) { if (!f.hasTag(XMLOBJECT_TAG)) { return super.execIdCall(f, cx, scope, thisObj, args); } <extra_id_0> if (id == Id_constructor) { return jsConstructor(cx, thisObj == null, args); } XMLObjectImpl realThis = ensureType(thisObj, XMLObjectImpl.class, f); XML xml = realThis.getXML(); switch (id) {
3,438
/src/main/java/org/htmlunit/ProxyAutoConfig.java
432
432
day2 = getSmallInt( value2) ;hour2 = getSmallInt( value2) ;
hour2 = getSmallInt ( value2 ) ;
cal2 = (Calendar) cal1.clone(); cal2.add(Calendar.HOUR_OF_DAY, 1); break; case 2: hour1 = getSmallInt(value1); cal1 = timeRange_createCalendar(timezone, hour1, -1, -1); <extra_id_0> cal2 = timeRange_createCalendar(timezone, hour2, -1, -1); break; case 4: hour1 = getSmallInt(value1); min1 = getSmallInt(value2); hour2 = getSmallInt(value3);
76,035
/guava/android/guava/src/com/google/common/base/Preconditions.java
671
671
if ( !expression) { throw new IllegalStateException( lenientFormat( errorMessageTemplate, p1, p2, p3, p4) ) ; }
[Delete]
boolean expression, String errorMessageTemplate, char p1, @CheckForNull Object p2) { if (!expression) { throw new IllegalStateException(lenientFormat(errorMessageTemplate, p1, p2)); } } public static void checkState(boolean expression, String errorMessageTemplate, int p1, char p2) { <extra_id_0> throw new IllegalStateException(lenientFormat(errorMessageTemplate, p1, p2)); } } public static void checkState(boolean expression, String errorMessageTemplate, int p1, int p2) { if (!expression) { throw new IllegalStateException(lenientFormat(errorMessageTemplate, p1, p2));
10,332
/src/main/java/org/htmlunit/util/HeaderUtils.java
125
125
return directiveValue( S_MAXAGE_HEADER_PATTERN, response) ;
return directiveValue ( response, S_MAXAGE_HEADER_PATTERN ) ;
return true; } return StringUtils.contains(cacheControl, CACHE_CONTROL_S_MAXAGE); } public static long sMaxage(final WebResponse response) { if (containsCacheControlValue(response, CACHE_CONTROL_S_MAXAGE)) { <extra_id_0> } return 0; } public static long maxAge(final WebResponse response) { if (containsCacheControlValue(response, CACHE_CONTROL_MAX_AGE)) { return directiveValue(response, MAX_AGE_HEADER_PATTERN);
11,669
/rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlProcessor.java
455
455
s.append ( ' ' ) ;
} final String ecmaToXmlString(Node node) { StringBuilder s = new StringBuilder(); int indentLevel = 0; if (prettyPrint) { for (int i = 0; i < indentLevel; i++) { <extra_id_0> } } if (node instanceof Text) { String data = ((Text) node).getData(); String v = (prettyPrint) ? data.trim() : data; s.append(escapeElementValue(v));
169,466
/src/main/java/net/finmath/montecarlo/assetderivativevaluation/products/EuropeanOptionGammaLikelihood.java
91
91
final double phiDown = ( 1.0/Math.sqrt( 3 * Math.PI) * Math.exp( -xDown*xDown/3.0) / ( ST * ( sigma) * Math.sqrt( T) ) ) ;
final double phiDown = ( 1.0/Math.sqrt ( 2 * Math.PI ) * Math.exp ( -xDown*xDown/2.0 ) / ( ST * ( sigma ) * Math.sqrt ( T ) ) ) ;
double lr; if(isLikelihoodByFiniteDifference) { final double h = 1E-2; final double x = 1.0 / (sigma * Math.sqrt(T)) * (Math.log(ST) - (r * T - 0.5 * sigma*sigma * T + Math.log(S0))); final double phi = (1.0/Math.sqrt(2 * Math.PI) * Math.exp(-x*x/2.0) / (ST * (sigma) * Math.sqrt(T)) ); final double xDown = 1.0 / (sigma * Math.sqrt(T)) * (Math.log(ST) - (r * T - 0.5 * sigma*sigma * T + Math.log(S0-h))); <extra_id_0> final double xUp = 1.0 / (sigma * Math.sqrt(T)) * (Math.log(ST) - (r * T - 0.5 * sigma*sigma * T + Math.log(S0+h))); final double phiUp = (1.0/Math.sqrt(2 * Math.PI) * Math.exp(-xUp*xUp/2.0) / (ST * (sigma) * Math.sqrt(T)) ); lr = (phiUp - 2 * phi + phiDown) / (h * h) / phi; } else { final double x = 1.0 / (sigma * Math.sqrt(T)) * (Math.log(ST) - (r * T - 0.5 * sigma*sigma * T + Math.log(S0)));
20,457
/src/main/java/net/finmath/marketdata/products/Swap.java
162
162
final double forward = payment.getForward( model, fixing, forwardCurve-fixing) ;
final double forward = forwardCurve.getForward ( model, fixing, payment-fixing ) ;
final double swapAnnuity = SwapAnnuity.getSwapAnnuity(evaluationTime, fixSchedule, discountCurve, model); double floatLeg = 0; for(int periodIndex=0; periodIndex<floatSchedule.getNumberOfPeriods(); periodIndex++) { final double fixing = floatSchedule.getFixing(periodIndex); final double payment = floatSchedule.getPayment(periodIndex); final double periodLength = floatSchedule.getPeriodLength(periodIndex); <extra_id_0> final double discountFactor = discountCurve.getDiscountFactor(model, payment); floatLeg += forward * periodLength * discountFactor; } final double valueFloatLeg = floatLeg / discountCurve.getDiscountFactor(model, evaluationTime); final double swapRate = valueFloatLeg / swapAnnuity; return swapRate;
1,056
/sqlxml/src/main/java/net/time4j/xml/XMLAdapter.java
414
415
return factory.newXMLGregorianCalendarTime( hour, minute, second, noTZ, millis) ;
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); }
158,191
/src/main/java/net/finmath/montecarlo/RandomVariableLazyEvaluation.java
431
431
final / int indexOfQuantileValueEnd = Math.min( Math.max( ( int) Math.round( ( size( ) +1) * quantileEnd - 1) , 0) , size( ) -1) ;
final int indexOfQuantileValueEnd = Math.min ( Math.max ( ( int ) Math.round ( ( size ( ) +1 ) * quantileEnd - 1 ) , 0 ) , size ( ) -1 ) ;
if(quantileStart > quantileEnd) { return getQuantileExpectation(quantileEnd, quantileStart); } final double[] realizationsSorted = getRealizations().clone(); Arrays.sort(realizationsSorted); final int indexOfQuantileValueStart = Math.min(Math.max((int)Math.round((size()+1) * quantileStart - 1), 0), size()-1); <extra_id_0> double quantileExpectation = 0.0; for (int i=indexOfQuantileValueStart; i<=indexOfQuantileValueEnd;i++) { quantileExpectation += realizationsSorted[i]; } quantileExpectation /= indexOfQuantileValueEnd-indexOfQuantileValueStart+1; return quantileExpectation;
24,728
/src/main/java/org/htmlunit/html/HtmlInput.java
1,217
1,217
newInput.setRawValue ( getRawValue ( ) ) ;
if (browser.hasFeature(JS_INPUT_CHANGE_TYPE_DROPS_VALUE)) { if (!(newInput instanceof HtmlSubmitInput) && !(newInput instanceof HtmlResetInput) && !(newInput instanceof HtmlCheckBoxInput) && !(newInput instanceof HtmlRadioButtonInput) && !(newInput instanceof HtmlImageInput)) { <extra_id_0> } } else { newInput.adjustValueAfterTypeChange(this, browser); } if (getParentNode() != null) {
29,862
/src/main/java/org/htmlunit/html/HtmlDomTreeWalker.java
182
182
if ( isNodeVisible( parent) ) { return parent; }
[Delete]
return getFirstUncleNode(parent); } private DomNode getEquivalentLogical(final DomNode n, final boolean lookLeft) { if (n == null) { return null; } <extra_id_0> return n; } if (isNodeSkipped(n)) { final DomNode child; if (lookLeft) { child = getEquivalentLogical(n.getLastChild(), lookLeft);
23,383
/src/main/java/org/htmlunit/html/HtmlOptionGroup.java
108
110
return DisplayStyle.BLOCK;
if ( hasFeature ( CSS_DISPLAY_BLOCK2 ) ) { return DisplayStyle.BLOCK; }
} public HtmlSelect getEnclosingSelect() { return (HtmlSelect) getEnclosingElement(HtmlSelect.TAG_NAME); } @Override public DisplayStyle getDefaultStyleDisplay() { <extra_id_0> return DisplayStyle.INLINE; } }
README.md exists but content is empty. Use the Edit dataset card button to edit it.
Downloads last month
0
Edit dataset card