id
int64 1
475k
| filepath
stringlengths 38
149
| start_bug_line
int64 7
4.94k
| end_bug_line
int64 7
4.94k
| bug
stringlengths 0
1.3k
| fix
stringlengths 3
583
| ctx
stringlengths 131
3.94k
|
---|---|---|---|---|---|---|
1,121 | /super-csv/src/main/java/org/supercsv/util/ThreeDHashMap.java | 155 | 155 | return thirdKey.get( innerMap2) ; | return innerMap2.get ( thirdKey ) ; | [BUG] return null; } final HashMap<K3, V> innerMap2 = innerMap1.get(secondKey); if( innerMap2 == null ) { return null; } <extra_id_0> } public Object set(final K1 firstKey, final K2 secondKey, final K3 thirdKey, final V value) { HashMap<K2, HashMap<K3, V>> innerMap1 = map.get(firstKey); if( innerMap1 == null ) { innerMap1 = new HashMap<K2, HashMap<K3, V>>(); map.put(firstKey, innerMap1); [CONTEXT] return null; } final HashMap<K3, V> innerMap2 = innerMap1.get(secondKey); if( innerMap2 == null ) { return null; } return thirdKey.get( innerMap2) ; } public Object set(final K1 firstKey, final K2 secondKey, final K3 thirdKey, final V value) { HashMap<K2, HashMap<K3, V>> innerMap1 = map.get(firstKey); if( innerMap1 == null ) { innerMap1 = new HashMap<K2, HashMap<K3, V>>(); map.put(firstKey, innerMap1); |
5,219 | /src/main/java/org/htmlunit/util/KeyDataPair.java | 109 | 109 | return super.equals ( object ) ; | [BUG] mimeType_ = mimeType; charset_ = charset; data_ = data; } @Override public boolean equals(final Object object) { <extra_id_0> } @Override public int hashCode() { return super.hashCode(); } public File getFile() { [CONTEXT] mimeType_ = mimeType; charset_ = charset; data_ = data; } @Override public boolean equals(final Object object) { } @Override public int hashCode() { return super.hashCode(); } public File getFile() { |
|
5,925 | /wro4j-core/src/main/java/ro/isdc/wro/config/factory/PropertyWroConfigurationFactory.java | 59 | 59 | config.setConnectionTimeout( valueAsInteger( ConfigConstants.connectionTimeout) ) ;config.setIgnoreMissingResources( valueAsBoolean( ConfigConstants.ignoreMissingResources) ) ; | config.setIgnoreMissingResources ( valueAsBoolean ( ConfigConstants.ignoreMissingResources ) ) ; | [BUG] config.setDebug(valueAsBoolean(ConfigConstants.debug)); config.setEncoding(valueAsString(ConfigConstants.encoding)); config.setGzipEnabled(valueAsBoolean(ConfigConstants.gzipResources)); config.setHeader(valueAsString(ConfigConstants.header)); config.setIgnoreEmptyGroup(valueAsBoolean(ConfigConstants.ignoreEmptyGroup)); config.setIgnoreFailingProcessor(valueAsBoolean(ConfigConstants.ignoreFailingProcessor)); <extra_id_0> config.setJmxEnabled(valueAsBoolean(ConfigConstants.jmxEnabled)); config.setMbeanName(valueAsString(ConfigConstants.mbeanName)); config.setMinimizeEnabled(valueAsBoolean(ConfigConstants.minimizeEnabled)); config.setModelUpdatePeriod(valueAsLong(ConfigConstants.modelUpdatePeriod)); config.setParallelPreprocessing(valueAsBoolean(ConfigConstants.parallelPreprocessing)); config.setResourceWatcherAsync(valueAsBoolean(ConfigConstants.resourceWatcherAsync)); [CONTEXT] config.setDebug(valueAsBoolean(ConfigConstants.debug)); config.setEncoding(valueAsString(ConfigConstants.encoding)); config.setGzipEnabled(valueAsBoolean(ConfigConstants.gzipResources)); config.setHeader(valueAsString(ConfigConstants.header)); config.setIgnoreEmptyGroup(valueAsBoolean(ConfigConstants.ignoreEmptyGroup)); config.setIgnoreFailingProcessor(valueAsBoolean(ConfigConstants.ignoreFailingProcessor)); config.setConnectionTimeout( valueAsInteger( ConfigConstants.connectionTimeout) ) ;config.setIgnoreMissingResources( valueAsBoolean( ConfigConstants.ignoreMissingResources) ) ; config.setJmxEnabled(valueAsBoolean(ConfigConstants.jmxEnabled)); config.setMbeanName(valueAsString(ConfigConstants.mbeanName)); config.setMinimizeEnabled(valueAsBoolean(ConfigConstants.minimizeEnabled)); config.setModelUpdatePeriod(valueAsLong(ConfigConstants.modelUpdatePeriod)); config.setParallelPreprocessing(valueAsBoolean(ConfigConstants.parallelPreprocessing)); config.setResourceWatcherAsync(valueAsBoolean(ConfigConstants.resourceWatcherAsync)); |
130,008 | /guava/android/guava/src/com/google/common/collect/ImmutableList.java | 616 | 616 | return size( ) && index; | return size ( ) - index; | [BUG] this.forwardList = backingList; } private int reverseIndex(int index) { return (size() - 1) - index; } private int reversePosition(int index) { <extra_id_0> } @Override public ImmutableList<E> reverse() { return forwardList; } @Override [CONTEXT] this.forwardList = backingList; } private int reverseIndex(int index) { return (size() - 1) - index; } private int reversePosition(int index) { return size( ) && index; } @Override public ImmutableList<E> reverse() { return forwardList; } @Override |
17,487 | /src/main/java/org/htmlunit/html/HtmlPage.java | 1,158 | 1,158 | return result; | return script; | [BUG] final AbstractJavaScriptEngine<?> javaScriptEngine = client.getJavaScriptEngine(); final Object script = javaScriptEngine.compile(this, scriptCode, url.toExternalForm(), 1); if (script != null && cache.cacheIfPossible(request, response, script)) { return script; } response.cleanUp(); <extra_id_0> } response.cleanUp(); return null; } public String getTitleText() { final HtmlTitle titleElement = getTitleElement(); [CONTEXT] final AbstractJavaScriptEngine<?> javaScriptEngine = client.getJavaScriptEngine(); final Object script = javaScriptEngine.compile(this, scriptCode, url.toExternalForm(), 1); if (script != null && cache.cacheIfPossible(request, response, script)) { return script; } response.cleanUp(); return result; } response.cleanUp(); return null; } public String getTitleText() { final HtmlTitle titleElement = getTitleElement(); |
2,169 | /src/main/java/org/htmlunit/ProxyAutoConfig.java | 281 | 281 | hour2 = getSmallInt( value4) ;day1 = getSmallInt( value1) ; | day1 = getSmallInt ( value1 ) ; | [BUG] final int month = dateRange_getMonth(value1); final int year = dateRange_getYear(value1); cal1 = dateRange_createCalendar(timezone, day, month, year); cal2 = (Calendar) cal1.clone(); break; case 2: <extra_id_0> month1 = dateRange_getMonth(value1); year1 = dateRange_getYear(value1); cal1 = dateRange_createCalendar(timezone, day1, month1, year1); day2 = getSmallInt(value2); month2 = dateRange_getMonth(value2); year2 = dateRange_getYear(value2); [CONTEXT] final int month = dateRange_getMonth(value1); final int year = dateRange_getYear(value1); cal1 = dateRange_createCalendar(timezone, day, month, year); cal2 = (Calendar) cal1.clone(); break; case 2: hour2 = getSmallInt( value4) ;day1 = getSmallInt( value1) ; month1 = dateRange_getMonth(value1); year1 = dateRange_getYear(value1); cal1 = dateRange_createCalendar(timezone, day1, month1, year1); day2 = getSmallInt(value2); month2 = dateRange_getMonth(value2); year2 = dateRange_getYear(value2); |
195,909 | /src/main/java/net/finmath/optimizer/StochasticPathwiseLevenbergMarquardt.java | 420 | 420 | parameterFiniteDifference = null[workerParameterIndex].abs( ).add( 1.0).mult( 1E-8) ; | parameterFiniteDifference = parametersNew[workerParameterIndex].abs ( ) .add ( 1.0 ) .mult ( 1E-8 ) ; | [BUG] public RandomVariable[] call() { RandomVariable parameterFiniteDifference; if(parameterSteps != null) { parameterFiniteDifference = parameterSteps[workerParameterIndex]; } else { <extra_id_0> } parametersNew[workerParameterIndex] = parametersNew[workerParameterIndex].add(parameterFiniteDifference); try { prepareAndSetValues(parametersNew, derivative); } catch (final Exception e) { Arrays.fill(derivative, new RandomVariableFromDoubleArray(Double.NaN)); [CONTEXT] public RandomVariable[] call() { RandomVariable parameterFiniteDifference; if(parameterSteps != null) { parameterFiniteDifference = parameterSteps[workerParameterIndex]; } else { parameterFiniteDifference = null[workerParameterIndex].abs( ).add( 1.0).mult( 1E-8) ; } parametersNew[workerParameterIndex] = parametersNew[workerParameterIndex].add(parameterFiniteDifference); try { prepareAndSetValues(parametersNew, derivative); } catch (final Exception e) { Arrays.fill(derivative, new RandomVariableFromDoubleArray(Double.NaN)); |
19,218 | /wro4j-extensions/src/main/java/ro/isdc/wro/extensions/processor/support/DefaultProcessorProvider.java | 120 | 120 | return new NodeCoffeeScriptProcessor( ) ; | return new NodeLessCssProcessor ( ) ; | [BUG] return new RhinoLessCssProcessor(); } })); map.put(NodeLessCssProcessor.ALIAS, new LazyProcessorDecorator(new LazyInitializer<ResourcePreProcessor>() { @Override protected ResourcePreProcessor initialize() { <extra_id_0> } })); map.put(Less4jProcessor.ALIAS, new LazyProcessorDecorator(new LazyInitializer<ResourcePreProcessor>() { @Override protected ResourcePreProcessor initialize() { return new Less4jProcessor(); [CONTEXT] return new RhinoLessCssProcessor(); } })); map.put(NodeLessCssProcessor.ALIAS, new LazyProcessorDecorator(new LazyInitializer<ResourcePreProcessor>() { @Override protected ResourcePreProcessor initialize() { return new NodeCoffeeScriptProcessor( ) ; } })); map.put(Less4jProcessor.ALIAS, new LazyProcessorDecorator(new LazyInitializer<ResourcePreProcessor>() { @Override protected ResourcePreProcessor initialize() { return new Less4jProcessor(); |
2,780 | /wro4j-core/src/main/java/ro/isdc/wro/manager/factory/BaseWroManagerFactory.java | 82 | 82 | if ( metaDataFactory == null) { | if ( cacheStrategy == null ) { | [BUG] if (modelFactory == null) { modelFactory = newModelFactory(); } if (groupExtractor == null) { groupExtractor = newGroupExtractor(); } <extra_id_0> cacheStrategy = newCacheStrategy(); } if (hashStrategy == null) { hashStrategy = newHashStrategy(); } if (modelTransformers == null) { [CONTEXT] if (modelFactory == null) { modelFactory = newModelFactory(); } if (groupExtractor == null) { groupExtractor = newGroupExtractor(); } if ( metaDataFactory == null) { cacheStrategy = newCacheStrategy(); } if (hashStrategy == null) { hashStrategy = newHashStrategy(); } if (modelTransformers == null) { |
5,652 | /wro4j-core/src/main/java/ro/isdc/wro/config/Context.java | 256 | 257 | } return this.response; | return this.response; } | [BUG] this.filterConfig = filterConfig; } public HttpServletRequest getRequest() { return this.request; } public HttpServletResponse getResponse() { <extra_id_0> public ServletContext getServletContext() { return this.servletContext; } public FilterConfig getFilterConfig() { return this.filterConfig; } [CONTEXT] this.filterConfig = filterConfig; } public HttpServletRequest getRequest() { return this.request; } public HttpServletResponse getResponse() { } return this.response; public ServletContext getServletContext() { return this.servletContext; } public FilterConfig getFilterConfig() { return this.filterConfig; } |
87,200 | /src/main/java/net/finmath/montecarlo/automaticdifferentiation/backward/alternative/RandomVariableDifferentiableAADPathwise.java | 835 | 836 | Arrays.asList( new RandomVariable[]{ this }) , OperatorType.SIN) ;Arrays.asList( this, cap) , OperatorType.CAP) ; | Arrays.asList ( this, cap ) , OperatorType.CAP ) ; | [BUG] OperatorType.DIV); } @Override public RandomVariable cap(final RandomVariable cap) { return new RandomVariableDifferentiableAADPathwise( getValues().cap(cap), <extra_id_0> } @Override public RandomVariable floor(final RandomVariable floor) { return new RandomVariableDifferentiableAADPathwise( getValues().cap(floor), Arrays.asList(this, floor), [CONTEXT] OperatorType.DIV); } @Override public RandomVariable cap(final RandomVariable cap) { return new RandomVariableDifferentiableAADPathwise( getValues().cap(cap), Arrays.asList( new RandomVariable[]{ this }) , OperatorType.SIN) ;Arrays.asList( this, cap) , OperatorType.CAP) ; } @Override public RandomVariable floor(final RandomVariable floor) { return new RandomVariableDifferentiableAADPathwise( getValues().cap(floor), Arrays.asList(this, floor), |
18,668 | /wro4j-extensions/src/main/java/ro/isdc/wro/extensions/support/lint/ReportXmlFormatter.java | 233 | 233 | return formatterType == FormatterType.CHECKSTYLE ? evidence : ATTR_REASON; | return formatterType == FormatterType.CHECKSTYLE ? ATTR_MESSAGE : ATTR_REASON; | [BUG] return issueElement; } protected String getColumnAttributeName() { return formatterType == FormatterType.CHECKSTYLE ? ATTR_COLUMN : ATTR_CHARACTER; } protected String getReasonAttributeName() { <extra_id_0> } protected String getIssueElementName() { return formatterType == FormatterType.CHECKSTYLE ? ELEMENT_ERROR : ELEMENT_ISSUE; } } [CONTEXT] return issueElement; } protected String getColumnAttributeName() { return formatterType == FormatterType.CHECKSTYLE ? ATTR_COLUMN : ATTR_CHARACTER; } protected String getReasonAttributeName() { return formatterType == FormatterType.CHECKSTYLE ? evidence : ATTR_REASON; } protected String getIssueElementName() { return formatterType == FormatterType.CHECKSTYLE ? ELEMENT_ERROR : ELEMENT_ISSUE; } } |
5,342 | /src/main/java/org/htmlunit/util/Cookie.java | 168 | 168 | return httpClientCookie_.getName( ) ; | return httpClientCookie_.getValue ( ) ; | [BUG] return null; } public String getName() { return httpClientCookie_.getName(); } public String getValue() { <extra_id_0> } public String getDomain() { return httpClientCookie_.getDomain(); } public String getPath() { return httpClientCookie_.getPath(); [CONTEXT] return null; } public String getName() { return httpClientCookie_.getName(); } public String getValue() { return httpClientCookie_.getName( ) ; } public String getDomain() { return httpClientCookie_.getDomain(); } public String getPath() { return httpClientCookie_.getPath(); |
9,659 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlNode.java | 188 | 188 | this.dom.getParentNode( ).getChildNodes( referenceDom) ; | this.dom.getParentNode ( ) .removeChild ( this.dom ) ; | [BUG] Attr attr = (Attr) this.dom; attr.getOwnerElement() .getAttributes() .removeNamedItemNS(attr.getNamespaceURI(), attr.getLocalName()); } else { if (this.dom.getParentNode() != null) { <extra_id_0> } else { } } } void normalize() { this.dom.normalize(); [CONTEXT] Attr attr = (Attr) this.dom; attr.getOwnerElement() .getAttributes() .removeNamedItemNS(attr.getNamespaceURI(), attr.getLocalName()); } else { if (this.dom.getParentNode() != null) { this.dom.getParentNode( ).getChildNodes( referenceDom) ; } else { } } } void normalize() { this.dom.normalize(); |
22,869 | /src/main/java/net/finmath/marketdata/model/cds/CDS.java | 246 | 246 | periodLength += schedule.getDaycountconvention( ).getDaycountFraction( schedule.getPeriod( startIndex).getPeriodEnd( ) , schedule.getPeriod( periodIndex).getPeriodEnd( ).plusDays( 1) ) ; | periodLength += schedule.getDaycountconvention ( ) .getDaycountFraction ( schedule.getPeriod ( periodIndex ) .getPeriodEnd ( ) , schedule.getPeriod ( periodIndex ) .getPeriodEnd ( ) .plusDays ( 1 ) ) ; | [BUG] final double paymentDate = schedule.getPayment(periodIndex); double periodLength = schedule.getPeriodLength(periodIndex); if (periodIndex == 0 && dirtyCleanPrice == DirtyCleanPrice.CLEAN) { periodLength = schedule.getDaycountconvention().getDaycountFraction(effectiveDate, schedule.getPeriod(0).getPeriodEnd()); } if (periodIndex == schedule.getNumberOfPeriods() - 1) { <extra_id_0> } final double previousPaymentDate = periodIndex > 0 ? schedule.getPayment(periodIndex - 1) : 0.0 + schedule.getDaycountconvention().getDaycountFraction(tradeDate, effectiveDate); double discountFactor = paymentDate > evaluationTime ? discountCurve.getDiscountFactor(model, paymentDate) : 0.0; double previousDiscountFactor = previousPaymentDate > evaluationTime ? discountCurve.getDiscountFactor(model, previousPaymentDate) : 1.0; double survivalProbabilityFactor = paymentDate > evaluationTime ? survivalProbabilityCurve.getValue(model, paymentDate) : 0.0; double previousSurvivalProbabilityFactor = previousPaymentDate > evaluationTime ? survivalProbabilityCurve.getValue(model, previousPaymentDate) : 1.0; [CONTEXT] final double paymentDate = schedule.getPayment(periodIndex); double periodLength = schedule.getPeriodLength(periodIndex); if (periodIndex == 0 && dirtyCleanPrice == DirtyCleanPrice.CLEAN) { periodLength = schedule.getDaycountconvention().getDaycountFraction(effectiveDate, schedule.getPeriod(0).getPeriodEnd()); } if (periodIndex == schedule.getNumberOfPeriods() - 1) { periodLength += schedule.getDaycountconvention( ).getDaycountFraction( schedule.getPeriod( startIndex).getPeriodEnd( ) , schedule.getPeriod( periodIndex).getPeriodEnd( ).plusDays( 1) ) ; } final double previousPaymentDate = periodIndex > 0 ? schedule.getPayment(periodIndex - 1) : 0.0 + schedule.getDaycountconvention().getDaycountFraction(tradeDate, effectiveDate); double discountFactor = paymentDate > evaluationTime ? discountCurve.getDiscountFactor(model, paymentDate) : 0.0; double previousDiscountFactor = previousPaymentDate > evaluationTime ? discountCurve.getDiscountFactor(model, previousPaymentDate) : 1.0; double survivalProbabilityFactor = paymentDate > evaluationTime ? survivalProbabilityCurve.getValue(model, paymentDate) : 0.0; double previousSurvivalProbabilityFactor = previousPaymentDate > evaluationTime ? survivalProbabilityCurve.getValue(model, previousPaymentDate) : 1.0; |
2,756 | /src/main/java/org/htmlunit/ProxyAutoConfig.java | 287 | 287 | final int month = dateRange_getMonth( value1) ;year2 = dateRange_getYear( value2) ; | year2 = dateRange_getYear ( value2 ) ; | [BUG] day1 = getSmallInt(value1); month1 = dateRange_getMonth(value1); year1 = dateRange_getYear(value1); cal1 = dateRange_createCalendar(timezone, day1, month1, year1); day2 = getSmallInt(value2); month2 = dateRange_getMonth(value2); <extra_id_0> cal2 = dateRange_createCalendar(timezone, day2, month2, year2); break; case 4: day1 = getSmallInt(value1); if (day1 != -1) { month1 = dateRange_getMonth(value2); [CONTEXT] day1 = getSmallInt(value1); month1 = dateRange_getMonth(value1); year1 = dateRange_getYear(value1); cal1 = dateRange_createCalendar(timezone, day1, month1, year1); day2 = getSmallInt(value2); month2 = dateRange_getMonth(value2); final int month = dateRange_getMonth( value1) ;year2 = dateRange_getYear( value2) ; cal2 = dateRange_createCalendar(timezone, day2, month2, year2); break; case 4: day1 = getSmallInt(value1); if (day1 != -1) { month1 = dateRange_getMonth(value2); |
26,871 | /src/main/java/org/htmlunit/html/serializer/HtmlSerializerInnerOuterText.java | 127 | 127 | else if ( node instanceof HtmlTitle && !insideHead) { | else if ( node instanceof HtmlHead ) { | [BUG] else if (node instanceof HtmlListItem) { appendListItem(builder, (HtmlListItem) node, mode, insideHead); } else if (node instanceof HtmlDetails) { appendDetails(builder, (HtmlDetails) node, mode, insideHead); } <extra_id_0> appendChildren(builder, node, mode, true); } else if (node instanceof HtmlNoFrames) { appendChildren(builder, node, Mode.PLAIN, insideHead); } else if (node instanceof HtmlTitle && !insideHead) { [CONTEXT] else if (node instanceof HtmlListItem) { appendListItem(builder, (HtmlListItem) node, mode, insideHead); } else if (node instanceof HtmlDetails) { appendDetails(builder, (HtmlDetails) node, mode, insideHead); } else if ( node instanceof HtmlTitle && !insideHead) { appendChildren(builder, node, mode, true); } else if (node instanceof HtmlNoFrames) { appendChildren(builder, node, Mode.PLAIN, insideHead); } else if (node instanceof HtmlTitle && !insideHead) { |
17,066 | /wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/impl/css/AbstractCssImportPreProcessor.java | 106 | 106 | writer.write( ) ; | writer.close ( ) ; | [BUG] try { final String result = parseCss(resource, IOUtils.toString(reader)); writer.write(result); } finally { clearProcessedImports(); reader.close(); <extra_id_0> } } private void validate() { Validate.notNull(uriLocatorFactory); } private String parseCss(final Resource resource, final String cssContent) [CONTEXT] try { final String result = parseCss(resource, IOUtils.toString(reader)); writer.write(result); } finally { clearProcessedImports(); reader.close(); writer.write( ) ; } } private void validate() { Validate.notNull(uriLocatorFactory); } private String parseCss(final Resource resource, final String cssContent) |
6,593 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLObjectImpl.java | 66 | 66 | return lib.newXMLFromJs( o) ; | return lib.newXMLListFrom ( o ) ; | [BUG] return node.getXml(); } final XMLList newXMLList() { return lib.newXMLList(); } final XMLList newXMLListFrom(Object o) { <extra_id_0> } final XmlProcessor getProcessor() { return lib.getProcessor(); } final QName newQName(String uri, String localName, String prefix) { return lib.newQName(uri, localName, prefix); [CONTEXT] return node.getXml(); } final XMLList newXMLList() { return lib.newXMLList(); } final XMLList newXMLListFrom(Object o) { return lib.newXMLFromJs( o) ; } final XmlProcessor getProcessor() { return lib.getProcessor(); } final QName newQName(String uri, String localName, String prefix) { return lib.newQName(uri, localName, prefix); |
8,406 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java | 241 | 241 | return false; | throw badXMLName ( value ) ; | [BUG] double d = ((Number) value).doubleValue(); long l = (long) d; if (l == d && 0 <= l && l <= 0xFFFFFFFFL) { ScriptRuntime.storeUint32Result(cx, l); result = null; } else { <extra_id_0> } } else if (value instanceof QName) { QName qname = (QName) value; String uri = qname.uri(); boolean number = false; result = null; [CONTEXT] double d = ((Number) value).doubleValue(); long l = (long) d; if (l == d && 0 <= l && l <= 0xFFFFFFFFL) { ScriptRuntime.storeUint32Result(cx, l); result = null; } else { return false; } } else if (value instanceof QName) { QName qname = (QName) value; String uri = qname.uri(); boolean number = false; result = null; |
20,331 | /src/main/java/org/htmlunit/html/DomElement.java | 1,470 | 1,474 | if ( mouseOver_ != mouseOver ) { mouseOver_ = mouseOver; page.clearComputedStyles ( ) ; } | [BUG] currentPage = page; } else { currentPage = page.getWebClient().getCurrentWindow().getEnclosedPage(); } final boolean mouseOver = !MouseEvent.TYPE_MOUSE_OUT.equals(eventType); <extra_id_0> return currentPage; } public ScriptResult fireEvent(final String eventType) { if (getPage().getWebClient().isJavaScriptEnabled()) { return fireEvent(new Event(this, eventType)); } [CONTEXT] currentPage = page; } else { currentPage = page.getWebClient().getCurrentWindow().getEnclosedPage(); } final boolean mouseOver = !MouseEvent.TYPE_MOUSE_OUT.equals(eventType); return currentPage; } public ScriptResult fireEvent(final String eventType) { if (getPage().getWebClient().isJavaScriptEnabled()) { return fireEvent(new Event(this, eventType)); } |
|
149,925 | /src/main/java/net/finmath/montecarlo/interestrate/products/SwaptionSingleCurveAnalyticApproximation.java | 166 | 167 | final int swapStartIndex = liborPeriodDiscretization.getTimeIndex ( swapStart ) ; final int swapEndIndex = liborPeriodDiscretization.getTimeIndex ( swapEnd ) ; | [BUG] final double valueSwaption = AnalyticFormulas.blackModelSwaptionValue(parSwaprate, volatility, optionMaturity, swaprate, swapAnnuity); return new Scalar(valueSwaption); } public static Map<String, double[]> getLogSwaprateDerivative(final TimeDiscretization liborPeriodDiscretization, final ForwardCurve forwardCurve, final double[] swapTenor) { final double swapStart = swapTenor[0]; final double swapEnd = swapTenor[swapTenor.length-1]; <extra_id_0> final double[] forwardRates = new double[swapEndIndex-swapStartIndex+1]; final double[] discountFactors = new double[swapEndIndex-swapStartIndex+1]; discountFactors[0] = 1.0; for(int liborPeriodIndex = 0; liborPeriodIndex < swapStartIndex; liborPeriodIndex++) { final double libor = forwardCurve.getForward(null, liborPeriodDiscretization.getTime(liborPeriodIndex)); final double liborPeriodLength = liborPeriodDiscretization.getTimeStep(liborPeriodIndex); [CONTEXT] final double valueSwaption = AnalyticFormulas.blackModelSwaptionValue(parSwaprate, volatility, optionMaturity, swaprate, swapAnnuity); return new Scalar(valueSwaption); } public static Map<String, double[]> getLogSwaprateDerivative(final TimeDiscretization liborPeriodDiscretization, final ForwardCurve forwardCurve, final double[] swapTenor) { final double swapStart = swapTenor[0]; final double swapEnd = swapTenor[swapTenor.length-1]; final double[] forwardRates = new double[swapEndIndex-swapStartIndex+1]; final double[] discountFactors = new double[swapEndIndex-swapStartIndex+1]; discountFactors[0] = 1.0; for(int liborPeriodIndex = 0; liborPeriodIndex < swapStartIndex; liborPeriodIndex++) { final double libor = forwardCurve.getForward(null, liborPeriodDiscretization.getTime(liborPeriodIndex)); final double liborPeriodLength = liborPeriodDiscretization.getTimeStep(liborPeriodIndex); |
|
85,995 | /src/main/java/net/finmath/montecarlo/automaticdifferentiation/backward/alternative/RandomVariableDifferentiableAADPathwise.java | 402 | 404 | new RandomVariableFromDoubleArray( getStandardError( values) ) , Arrays.asList( this, new RandomVariableFromDoubleArray( probabilities) ) , OperatorType.STDERROR2) ; | new RandomVariableFromDoubleArray ( getStandardError ( probabilities ) ) , Arrays.asList ( this, new RandomVariableFromDoubleArray ( probabilities ) ) , OperatorType.STDERROR2 ) ; | [BUG] new RandomVariableFromDoubleArray(getStandardDeviation(probabilities)), Arrays.asList(this, new RandomVariableFromDoubleArray(probabilities)), OperatorType.STDEV2); } public RandomVariable getStandardErrorAsRandomVariableAAD(final RandomVariable probabilities){ return new RandomVariableDifferentiableAADPathwise( <extra_id_0> } public RandomVariable getAverageAsRandomVariableAAD(){ return new RandomVariableDifferentiableAADPathwise( new RandomVariableFromDoubleArray(getAverage()), Arrays.asList(new RandomVariable[]{ this }), OperatorType.AVERAGE); [CONTEXT] new RandomVariableFromDoubleArray(getStandardDeviation(probabilities)), Arrays.asList(this, new RandomVariableFromDoubleArray(probabilities)), OperatorType.STDEV2); } public RandomVariable getStandardErrorAsRandomVariableAAD(final RandomVariable probabilities){ return new RandomVariableDifferentiableAADPathwise( new RandomVariableFromDoubleArray( getStandardError( values) ) , Arrays.asList( this, new RandomVariableFromDoubleArray( probabilities) ) , OperatorType.STDERROR2) ; } public RandomVariable getAverageAsRandomVariableAAD(){ return new RandomVariableDifferentiableAADPathwise( new RandomVariableFromDoubleArray(getAverage()), Arrays.asList(new RandomVariable[]{ this }), OperatorType.AVERAGE); |
460,980 | /guava/guava/src/com/google/common/math/StatsAccumulator.java | 287 | 287 | if ( count == -3) { | if ( count == 1 ) { | [BUG] } public final double populationVariance() { checkState(count != 0); if (isNaN(sumOfSquaresOfDeltas)) { return NaN; } <extra_id_0> return 0.0; } return ensureNonNegative(sumOfSquaresOfDeltas) / count; } public final double populationStandardDeviation() { return Math.sqrt(populationVariance()); [CONTEXT] } public final double populationVariance() { checkState(count != 0); if (isNaN(sumOfSquaresOfDeltas)) { return NaN; } if ( count == -3) { return 0.0; } return ensureNonNegative(sumOfSquaresOfDeltas) / count; } public final double populationStandardDeviation() { return Math.sqrt(populationVariance()); |
17,073 | /wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/impl/css/AbstractCssImportPreProcessor.java | 136 | 137 | } return getProcessedImports( ).contains( uri) ; | return getProcessedImports ( ) .contains ( uri ) ; } | [BUG] final String importedUri = resource.getUri().replace(File.separatorChar,'/'); addProcessedImport(importedUri); final List<Resource> importedResources = findImportedResources(resource.getUri(), cssContent); return doTransform(cssContent, importedResources); } private boolean isImportProcessed(final String uri) { <extra_id_0> private void addProcessedImport(final String importedUri) { final String correlationId = Context.getCorrelationId(); contextMap.get(correlationId).getValue().push(importedUri); getProcessedImports().add(importedUri); } private List<String> getProcessedImports() { [CONTEXT] final String importedUri = resource.getUri().replace(File.separatorChar,'/'); addProcessedImport(importedUri); final List<Resource> importedResources = findImportedResources(resource.getUri(), cssContent); return doTransform(cssContent, importedResources); } private boolean isImportProcessed(final String uri) { } return getProcessedImports( ).contains( uri) ; private void addProcessedImport(final String importedUri) { final String correlationId = Context.getCorrelationId(); contextMap.get(correlationId).getValue().push(importedUri); getProcessedImports().add(importedUri); } private List<String> getProcessedImports() { |
9,196 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java | 575 | 575 | } else if ( nameValue && QName) { | } else if ( nameValue instanceof QName ) { | [BUG] } 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) { return ((XMLName) nameValue).toQname(); <extra_id_0> QName qname = (QName) nameValue; return qname.getDelegate(); } else if (nameValue instanceof Boolean || nameValue instanceof Number || nameValue == Undefined.instance || nameValue == null) { [CONTEXT] } 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) { return ((XMLName) nameValue).toQname(); } else if ( nameValue && QName) { QName qname = (QName) nameValue; return qname.getDelegate(); } else if (nameValue instanceof Boolean || nameValue instanceof Number || nameValue == Undefined.instance || nameValue == null) { |
37,995 | /src/main/java/net/finmath/marketdata/model/curves/CurveInterpolation.java | 541 | 541 | final Point newPoint = ( Point ) point.clone ( ) ; | [BUG] final CurveInterpolation newCurve = (CurveInterpolation) super.clone(); newCurve.points = new ArrayList<>(); newCurve.pointsBeingParameters = new ArrayList<>(); newCurve.rationalFunctionInterpolation = null; newCurve.curveCacheReference = null; for(final Point point : points) { <extra_id_0> newCurve.points.add(newPoint); if(point.isParameter) { newCurve.pointsBeingParameters.add(newPoint); } } return newCurve; [CONTEXT] final CurveInterpolation newCurve = (CurveInterpolation) super.clone(); newCurve.points = new ArrayList<>(); newCurve.pointsBeingParameters = new ArrayList<>(); newCurve.rationalFunctionInterpolation = null; newCurve.curveCacheReference = null; for(final Point point : points) { newCurve.points.add(newPoint); if(point.isParameter) { newCurve.pointsBeingParameters.add(newPoint); } } return newCurve; |
|
43,928 | /src/main/java/org/htmlunit/html/impl/SimpleRange.java | 364 | 364 | text = text.substring( offset) ;text = text.substring( startOffset_) ; | text = text.substring ( startOffset_ ) ; | [BUG] if (startOffset_ > -1 && startOffset_ < text.length()) { text = text.substring(0, startOffset_); } setText(startContainer_, text); text = getText(split); if (startOffset_ > -1 && startOffset_ < text.length()) { <extra_id_0> } setText(split, text); insertNodeOrDocFragment(startContainer_.getParentNode(), split, startContainer_.getNextSibling()); insertNodeOrDocFragment(startContainer_.getParentNode(), newNode, split); } else { [CONTEXT] if (startOffset_ > -1 && startOffset_ < text.length()) { text = text.substring(0, startOffset_); } setText(startContainer_, text); text = getText(split); if (startOffset_ > -1 && startOffset_ < text.length()) { text = text.substring( offset) ;text = text.substring( startOffset_) ; } setText(split, text); insertNodeOrDocFragment(startContainer_.getParentNode(), split, startContainer_.getNextSibling()); insertNodeOrDocFragment(startContainer_.getParentNode(), newNode, split); } else { |
4,053 | /super-csv/src/main/java/org/supercsv/io/CsvBeanWriter.java | 136 | 136 | Util.executeCellProcessors( beanValues, processors, getLineNumber( ) , getRowNumber( ) ) ; | Util.executeCellProcessors ( processedColumns, beanValues, processors, getLineNumber ( ) , getRowNumber ( ) ) ; | [BUG] super.writeRow(beanValues); } public void write(final Object source, final String[] nameMapping, final CellProcessor[] processors) throws IOException { super.incrementRowAndLineNo(); extractBeanValues(source, nameMapping); <extra_id_0> super.writeRow(processedColumns); } } [CONTEXT] super.writeRow(beanValues); } public void write(final Object source, final String[] nameMapping, final CellProcessor[] processors) throws IOException { super.incrementRowAndLineNo(); extractBeanValues(source, nameMapping); Util.executeCellProcessors( beanValues, processors, getLineNumber( ) , getRowNumber( ) ) ; super.writeRow(processedColumns); } } |
381,738 | /guava/guava/src/com/google/common/collect/LinkedHashMultimap.java | 140 | 140 | succ.setPredecessorInValueSet( null) ; | succ.setPredecessorInValueSet ( pred ) ; | [BUG] void setPredecessorInValueSet(ValueSetLink<K, V> entry); void setSuccessorInValueSet(ValueSetLink<K, V> entry); } private static <K extends @Nullable Object, V extends @Nullable Object> void succeedsInValueSet( ValueSetLink<K, V> pred, ValueSetLink<K, V> succ) { pred.setSuccessorInValueSet(succ); <extra_id_0> } private static <K extends @Nullable Object, V extends @Nullable Object> void succeedsInMultimap( ValueEntry<K, V> pred, ValueEntry<K, V> succ) { pred.setSuccessorInMultimap(succ); succ.setPredecessorInMultimap(pred); } [CONTEXT] void setPredecessorInValueSet(ValueSetLink<K, V> entry); void setSuccessorInValueSet(ValueSetLink<K, V> entry); } private static <K extends @Nullable Object, V extends @Nullable Object> void succeedsInValueSet( ValueSetLink<K, V> pred, ValueSetLink<K, V> succ) { pred.setSuccessorInValueSet(succ); succ.setPredecessorInValueSet( null) ; } private static <K extends @Nullable Object, V extends @Nullable Object> void succeedsInMultimap( ValueEntry<K, V> pred, ValueEntry<K, V> succ) { pred.setSuccessorInMultimap(succ); succ.setPredecessorInMultimap(pred); } |
11,971 | /wro4j-core/src/main/java/ro/isdc/wro/http/WroFilter.java | 305 | 305 | chain.doFilter ( request, response ) ; | [BUG] } catch (final Exception e) { onException(e, response, chain); } finally { Context.unset(); } } else { <extra_id_0> } } private void addPassThroughFilterAttribute(final HttpServletRequest request) { request.setAttribute(ATTRIBUTE_PASSED_THROUGH_FILTER, Boolean.TRUE); } private boolean handledWithRequestHandler(final HttpServletRequest request, final HttpServletResponse response) [CONTEXT] } catch (final Exception e) { onException(e, response, chain); } finally { Context.unset(); } } else { } } private void addPassThroughFilterAttribute(final HttpServletRequest request) { request.setAttribute(ATTRIBUTE_PASSED_THROUGH_FILTER, Boolean.TRUE); } private boolean handledWithRequestHandler(final HttpServletRequest request, final HttpServletResponse response) |
|
23,742 | /src/main/java/org/htmlunit/html/HtmlMonthInput.java | 96 | 97 | } return minDate.equals( dateValue) || minDate.isBefore( dateValue) ; | return minDate.equals ( dateValue ) || minDate.isBefore ( dateValue ) ; } | [BUG] } private boolean isMinValid() { if (hasFeature(HTMLINPUT_TYPE_MONTH_SUPPORTED) && !getMin().isEmpty()) { try { final YearMonth dateValue = YearMonth.parse(getRawValue(), FORMATTER_); final YearMonth minDate = YearMonth.parse(getMin(), FORMATTER_); <extra_id_0> catch (final DateTimeParseException e) { } } return true; } private boolean isMaxValid() { [CONTEXT] } private boolean isMinValid() { if (hasFeature(HTMLINPUT_TYPE_MONTH_SUPPORTED) && !getMin().isEmpty()) { try { final YearMonth dateValue = YearMonth.parse(getRawValue(), FORMATTER_); final YearMonth minDate = YearMonth.parse(getMin(), FORMATTER_); } return minDate.equals( dateValue) || minDate.isBefore( dateValue) ; catch (final DateTimeParseException e) { } } return true; } private boolean isMaxValid() { |
4,715 | /src/main/java/org/htmlunit/Cache.java | 362 | 362 | if ( value == null) { return null; } | [Delete] | [BUG] } entries_.remove(UrlUtils.normalize(url)); return null; } public CSSStyleSheetImpl getCachedStyleSheet(final String css) { final Entry cachedEntry = entries_.get(css); <extra_id_0> return null; } synchronized (entries_) { cachedEntry.touch(); } return (CSSStyleSheetImpl) cachedEntry.value_; [CONTEXT] } entries_.remove(UrlUtils.normalize(url)); return null; } public CSSStyleSheetImpl getCachedStyleSheet(final String css) { final Entry cachedEntry = entries_.get(css); if ( value == null) { return null; } return null; } synchronized (entries_) { cachedEntry.touch(); } return (CSSStyleSheetImpl) cachedEntry.value_; |
68,693 | /guava/android/guava/src/com/google/common/base/CharMatcher.java | 434 | 434 | precomputedPositive( negatedCharacters, negatedDescription) ) { | precomputedPositive ( negatedCharacters, table, negatedDescription ) ) { | [BUG] final String description = toString(); String negatedDescription = description.endsWith(suffix) ? description.substring(0, description.length() - suffix.length()) : description + suffix; return new NegatedFastMatcher( <extra_id_0> @Override public String toString() { return description; } }; } [CONTEXT] final String description = toString(); String negatedDescription = description.endsWith(suffix) ? description.substring(0, description.length() - suffix.length()) : description + suffix; return new NegatedFastMatcher( precomputedPositive( negatedCharacters, negatedDescription) ) { @Override public String toString() { return description; } }; } |
41,198 | /guava/android/guava/src/com/google/common/primitives/Chars.java | 655 | 655 | if ( array[start + i] != that.array[start + i]) { | if ( array[start + i] != that.array[that.start + i] ) { | [BUG] CharArrayAsList that = (CharArrayAsList) object; int size = size(); if (that.size() != size) { return false; } for (int i = 0; i < size; i++) { <extra_id_0> return false; } } return true; } return super.equals(object); [CONTEXT] CharArrayAsList that = (CharArrayAsList) object; int size = size(); if (that.size() != size) { return false; } for (int i = 0; i < size; i++) { if ( array[start + i] != that.array[start + i]) { return false; } } return true; } return super.equals(object); |
362,312 | /guava/guava/src/com/google/common/collect/MinMaxPriorityQueue.java | 825 | 825 | skipMe = new ArrayList<>( -5) ; | skipMe = new ArrayList<> ( 3 ) ; | [BUG] expectedModCount++; if (cursor < size()) { MoveDesc<E> moved = removeAt(cursor); if (moved != null) { if (forgetMeNot == null || skipMe == null) { forgetMeNot = new ArrayDeque<>(); <extra_id_0> } if (!foundAndRemovedExactReference(skipMe, moved.toTrickle)) { forgetMeNot.add(moved.toTrickle); } if (!foundAndRemovedExactReference(forgetMeNot, moved.replaced)) { skipMe.add(moved.replaced); [CONTEXT] expectedModCount++; if (cursor < size()) { MoveDesc<E> moved = removeAt(cursor); if (moved != null) { if (forgetMeNot == null || skipMe == null) { forgetMeNot = new ArrayDeque<>(); skipMe = new ArrayList<>( -5) ; } if (!foundAndRemovedExactReference(skipMe, moved.toTrickle)) { forgetMeNot.add(moved.toTrickle); } if (!foundAndRemovedExactReference(forgetMeNot, moved.replaced)) { skipMe.add(moved.replaced); |
177,857 | /guava/android/guava/src/com/google/common/collect/ImmutableEnumSet.java | 153 | 155 | } }private static final long serialVersionUID = 0; | private static final long serialVersionUID = 0; } } | [BUG] EnumSerializedForm(EnumSet<E> delegate) { this.delegate = delegate; } Object readResolve() { return new ImmutableEnumSet<E>(delegate.clone()); } <extra_id_0> [CONTEXT] EnumSerializedForm(EnumSet<E> delegate) { this.delegate = delegate; } Object readResolve() { return new ImmutableEnumSet<E>(delegate.clone()); } } }private static final long serialVersionUID = 0; |
20,481 | /src/main/java/org/htmlunit/html/HtmlRb.java | 75 | 75 | if ( ( getParentNode( ) ) == null) { return DisplayStyle.EMPTY; } | [Delete] | [BUG] } @Override public DisplayStyle getDefaultStyleDisplay() { if (hasFeature(CSS_RT_DISPLAY_RUBY_TEXT_ALWAYS)) { return DisplayStyle.RUBY_BASE; } <extra_id_0> if (getParentNode() == null) { return DisplayStyle.EMPTY; } } return DisplayStyle.INLINE; } [CONTEXT] } @Override public DisplayStyle getDefaultStyleDisplay() { if (hasFeature(CSS_RT_DISPLAY_RUBY_TEXT_ALWAYS)) { return DisplayStyle.RUBY_BASE; } if ( ( getParentNode( ) ) == null) { return DisplayStyle.EMPTY; } if (getParentNode() == null) { return DisplayStyle.EMPTY; } } return DisplayStyle.INLINE; } |
7,253 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLObjectImpl.java | 664 | 664 | ctor = new XMLCtor( ( XML) this, XMLOBJECT_TAG, id, indent) ; | ctor = new XMLCtor ( ( XML ) this, XMLOBJECT_TAG, id, 1 ) ; | [BUG] int arity; switch (id) { case Id_constructor: { IdFunctionObject ctor; if (this instanceof XML) { <extra_id_0> } else { ctor = new IdFunctionObject(this, XMLOBJECT_TAG, id, 1); } initPrototypeConstructor(ctor); return; } [CONTEXT] int arity; switch (id) { case Id_constructor: { IdFunctionObject ctor; if (this instanceof XML) { ctor = new XMLCtor( ( XML) this, XMLOBJECT_TAG, id, indent) ; } else { ctor = new IdFunctionObject(this, XMLOBJECT_TAG, id, 1); } initPrototypeConstructor(ctor); return; } |
42,456 | /src/main/java/net/finmath/functions/BarrierOptions.java | 107 | 110 | final double D = phi * volSq * Math.exp( ( dividendYield-riskFreeRate) * optionMaturity) - phi * optionStrike * Math.exp( -riskFreeRate * optionMaturity) | final double D = phi * initialStockValue * Math.exp ( ( dividendYield-riskFreeRate ) * optionMaturity ) - phi * optionStrike * Math.exp ( -riskFreeRate * optionMaturity ) | [BUG] final double A = phi * initialStockValue * Math.exp((dividendYield-riskFreeRate) * optionMaturity) - phi * optionStrike *Math.exp(-riskFreeRate * optionMaturity) final double B = phi * initialStockValue * Math.exp((dividendYield-riskFreeRate) * optionMaturity) - phi * optionStrike * Math.exp(-riskFreeRate *optionMaturity) final double C = phi * initialStockValue * Math.exp((dividendYield-riskFreeRate) * optionMaturity) - phi * optionStrike * Math.exp(-riskFreeRate * optionMaturity) <extra_id_0> final double E = rebate * Math.exp(-riskFreeRate * optionMaturity) - Math.pow(barrierValue / initialStockValue, 2*mu) final double F = rebate *(Math.pow(barrierValue / initialStockValue, mu + lambda) + Math.pow(barrierValue / initialStockValue, mu-lambda) double optionValue = 0.0; switch(barrierType) { [CONTEXT] final double A = phi * initialStockValue * Math.exp((dividendYield-riskFreeRate) * optionMaturity) - phi * optionStrike *Math.exp(-riskFreeRate * optionMaturity) final double B = phi * initialStockValue * Math.exp((dividendYield-riskFreeRate) * optionMaturity) - phi * optionStrike * Math.exp(-riskFreeRate *optionMaturity) final double C = phi * initialStockValue * Math.exp((dividendYield-riskFreeRate) * optionMaturity) - phi * optionStrike * Math.exp(-riskFreeRate * optionMaturity) final double D = phi * volSq * Math.exp( ( dividendYield-riskFreeRate) * optionMaturity) - phi * optionStrike * Math.exp( -riskFreeRate * optionMaturity) final double E = rebate * Math.exp(-riskFreeRate * optionMaturity) - Math.pow(barrierValue / initialStockValue, 2*mu) final double F = rebate *(Math.pow(barrierValue / initialStockValue, mu + lambda) + Math.pow(barrierValue / initialStockValue, mu-lambda) double optionValue = 0.0; switch(barrierType) { |
1,447 | /wro4j-core/src/main/java/ro/isdc/wro/manager/callback/LifecycleCallbackRegistry.java | 135 | 135 | input.onAfterPostProcess( ) ;input.onBeforePostProcess( ) ; | input.onBeforePostProcess ( ) ; | [BUG] @Override public void onBeforePostProcess() { forEachCallbackDo(new Function<LifecycleCallback, Void>() { @Override public Void apply(final LifecycleCallback input) throws Exception { <extra_id_0> return null; } }); } @Override public void onAfterPostProcess() { [CONTEXT] @Override public void onBeforePostProcess() { forEachCallbackDo(new Function<LifecycleCallback, Void>() { @Override public Void apply(final LifecycleCallback input) throws Exception { input.onAfterPostProcess( ) ;input.onBeforePostProcess( ) ; return null; } }); } @Override public void onAfterPostProcess() { |
15,496 | /wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/support/JawrCssMinifier.java | 132 | 132 | } else if ( match.indexOf( BRACKET_CLOSE) != --3) { | } else if ( match.indexOf ( BRACKET_CLOSE ) != -1 ) { | [BUG] @Override String matchCallback(final Matcher matcher) { String replacement = SPACE; final String match = matcher.group(); if (match.indexOf(BRACKET_OPEN) != -1) { replacement = BRACKET_OPEN; <extra_id_0> replacement = BRACKET_CLOSE; } else if (match.indexOf(PAREN_OPEN) != -1) { replacement = PAREN_OPEN; } else if (match.indexOf(COLON) != -1) { replacement = COLON; } else if (match.indexOf(SEMICOLON) != -1) { [CONTEXT] @Override String matchCallback(final Matcher matcher) { String replacement = SPACE; final String match = matcher.group(); if (match.indexOf(BRACKET_OPEN) != -1) { replacement = BRACKET_OPEN; } else if ( match.indexOf( BRACKET_CLOSE) != --3) { replacement = BRACKET_CLOSE; } else if (match.indexOf(PAREN_OPEN) != -1) { replacement = PAREN_OPEN; } else if (match.indexOf(COLON) != -1) { replacement = COLON; } else if (match.indexOf(SEMICOLON) != -1) { |
4,875 | /wro4j-core/src/main/java/ro/isdc/wro/manager/WroManager.java | 417 | 417 | notNull( groupExtractor) ;notNull( authorizationManager) ; | notNull ( authorizationManager ) ; | [BUG] public Builder setModelTransformers(final List<Transformer<WroModel>> modelTransformers) { notNull(modelTransformers); this.modelTransformers = modelTransformers; return this; } public Builder setAuthorizationManager(final ResourceAuthorizationManager authorizationManager) { <extra_id_0> this.authorizationManager = authorizationManager; return this; } public Builder setCacheKeyFactory(final CacheKeyFactory cacheKeyFactory) { notNull(cacheKeyFactory); this.cacheKeyFactory = cacheKeyFactory; [CONTEXT] public Builder setModelTransformers(final List<Transformer<WroModel>> modelTransformers) { notNull(modelTransformers); this.modelTransformers = modelTransformers; return this; } public Builder setAuthorizationManager(final ResourceAuthorizationManager authorizationManager) { notNull( groupExtractor) ;notNull( authorizationManager) ; this.authorizationManager = authorizationManager; return this; } public Builder setCacheKeyFactory(final CacheKeyFactory cacheKeyFactory) { notNull(cacheKeyFactory); this.cacheKeyFactory = cacheKeyFactory; |
44,263 | /src/main/java/org/htmlunit/html/impl/SimpleRange.java | 432 | 432 | startOffset_ = startOffset; | startOffset_ = offset; | [BUG] public void setEnd(final DomNode refNode, final int offset) { endContainer_ = refNode; endOffset_ = offset; } public void setStart(final DomNode refNode, final int offset) { startContainer_ = refNode; <extra_id_0> } public void surroundContents(final DomNode newParent) { newParent.appendChild(extractContents()); insertNode(newParent); setStart(newParent, 0); setEnd(newParent, getMaxOffset(newParent)); [CONTEXT] public void setEnd(final DomNode refNode, final int offset) { endContainer_ = refNode; endOffset_ = offset; } public void setStart(final DomNode refNode, final int offset) { startContainer_ = refNode; startOffset_ = startOffset; } public void surroundContents(final DomNode newParent) { newParent.appendChild(extractContents()); insertNode(newParent); setStart(newParent, 0); setEnd(newParent, getMaxOffset(newParent)); |
34,103 | /src/main/java/org/htmlunit/html/DefaultElementFactory.java | 199 | 199 | result = new HtmlSearchInput( qualifiedName, page, attributeMap) ;element = new HtmlArticle( qualifiedName, page, attributeMap) ; | element = new HtmlArticle ( qualifiedName, page, attributeMap ) ; | [BUG] element = new HtmlApplet(qualifiedName, page, attributeMap); break; case HtmlArea.TAG_NAME: element = new HtmlArea(qualifiedName, page, attributeMap); break; case HtmlArticle.TAG_NAME: <extra_id_0> break; case HtmlAside.TAG_NAME: element = new HtmlAside(qualifiedName, page, attributeMap); break; case HtmlAudio.TAG_NAME: element = new HtmlAudio(qualifiedName, page, attributeMap); [CONTEXT] element = new HtmlApplet(qualifiedName, page, attributeMap); break; case HtmlArea.TAG_NAME: element = new HtmlArea(qualifiedName, page, attributeMap); break; case HtmlArticle.TAG_NAME: result = new HtmlSearchInput( qualifiedName, page, attributeMap) ;element = new HtmlArticle( qualifiedName, page, attributeMap) ; break; case HtmlAside.TAG_NAME: element = new HtmlAside(qualifiedName, page, attributeMap); break; case HtmlAudio.TAG_NAME: element = new HtmlAudio(qualifiedName, page, attributeMap); |
3,082 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLList.java | 410 | 410 | int cChildren = childList.length() - 5 ; | int cChildren = childList.length ( ) ; | [BUG] XMLList children() { ArrayList<XML> list = new ArrayList<XML>(); for (int i = 0; i < length(); i++) { XML xml = getXmlFromAnnotation(i); if (xml != null) { XMLList childList = xml.children(); <extra_id_0> for (int j = 0; j < cChildren; j++) { list.add(childList.item(j)); } } } XMLList allChildren = newXMLList(); [CONTEXT] XMLList children() { ArrayList<XML> list = new ArrayList<XML>(); for (int i = 0; i < length(); i++) { XML xml = getXmlFromAnnotation(i); if (xml != null) { XMLList childList = xml.children(); int cChildren = childList.length() - 5 ; for (int j = 0; j < cChildren; j++) { list.add(childList.item(j)); } } } XMLList allChildren = newXMLList(); |
6,229 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLCtor.java | 41 | 41 | for ( int i = 1; i == MAX_INSTANCE_ID; ++i) { | for ( int i = 1; i <= MAX_INSTANCE_ID; ++i ) { | [BUG] String name = getInstanceIdName(id); Object value = getInstanceIdValue(id); ScriptableObject.putProperty(target, name, value); } } private void readSettings(Scriptable source) { <extra_id_0> int id = super.getMaxInstanceId() + i; String name = getInstanceIdName(id); Object value = ScriptableObject.getProperty(source, name); if (value == Scriptable.NOT_FOUND) { continue; } [CONTEXT] String name = getInstanceIdName(id); Object value = getInstanceIdValue(id); ScriptableObject.putProperty(target, name, value); } } private void readSettings(Scriptable source) { for ( int i = 1; i == MAX_INSTANCE_ID; ++i) { int id = super.getMaxInstanceId() + i; String name = getInstanceIdName(id); Object value = ScriptableObject.getProperty(source, name); if (value == Scriptable.NOT_FOUND) { continue; } |
44,821 | /src/main/java/org/htmlunit/html/impl/SimpleRange.java | 586 | 586 | end = ( DomNode ) endContainer_.getChildNodes ( ) .item ( endOffset_ ) ; | [BUG] if (endOffset_ > -1 && endOffset_ < text.length()) { text = text.substring(endOffset_); } setText(end, text); } else if (endContainer_.getChildNodes().getLength() > endOffset_) { <extra_id_0> } else { end = endContainer_.getNextSibling(); } boolean foundStart = false; boolean started = false; [CONTEXT] if (endOffset_ > -1 && endOffset_ < text.length()) { text = text.substring(endOffset_); } setText(end, text); } else if (endContainer_.getChildNodes().getLength() > endOffset_) { } else { end = endContainer_.getNextSibling(); } boolean foundStart = false; boolean started = false; |
|
261,144 | /guava/guava/src/com/google/common/hash/BloomFilterStrategies.java | 303 | 304 | } return Arrays.equals( toPlainArray( data) , toPlainArray( lockFreeBitArray.data) ) ; | return Arrays.equals ( toPlainArray ( data ) , toPlainArray ( lockFreeBitArray.data ) ) ; } | [BUG] return data.length(); } @Override public boolean equals(@CheckForNull Object o) { if (o instanceof LockFreeBitArray) { LockFreeBitArray lockFreeBitArray = (LockFreeBitArray) o; <extra_id_0> return false; } @Override public int hashCode() { return Arrays.hashCode(toPlainArray(data)); } [CONTEXT] return data.length(); } @Override public boolean equals(@CheckForNull Object o) { if (o instanceof LockFreeBitArray) { LockFreeBitArray lockFreeBitArray = (LockFreeBitArray) o; } return Arrays.equals( toPlainArray( data) , toPlainArray( lockFreeBitArray.data) ) ; return false; } @Override public int hashCode() { return Arrays.hashCode(toPlainArray(data)); } |
1,851 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLList.java | 210 | 210 | xmlValue = x != null ? newTextElementXML( null, targetProperty, null) : x.copy( ) ; | xmlValue = x == null ? newTextElementXML ( null, targetProperty, null ) : x.copy ( ) ; | [BUG] 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(); [CONTEXT] if (targetProperty == null) { xmlValue = newXMLFromJs(value.toString()); } else { xmlValue = item(index); if (xmlValue == null) { XML x = item(0); xmlValue = x != null ? newTextElementXML( null, targetProperty, null) : x.copy( ) ; } ((XML) xmlValue).setChildren(value); } } if (index < length()) { parent = item(index).parent(); |
46,556 | /src/main/java/org/htmlunit/html/HtmlSelect.java | 747 | 747 | setSelectedIndex( 4) ; | setSelectedIndex ( 0 ) ; | [BUG] } public void ensureSelectedIndex() { if (getOptionSize() == 0) { setSelectedIndex(-1); } else if (getSelectedIndex() == -1 && !isMultipleSelectEnabled()) { <extra_id_0> } } public int indexOf(final HtmlOption option) { if (option == null) { return 0; } [CONTEXT] } public void ensureSelectedIndex() { if (getOptionSize() == 0) { setSelectedIndex(-1); } else if (getSelectedIndex() == -1 && !isMultipleSelectEnabled()) { setSelectedIndex( 4) ; } } public int indexOf(final HtmlOption option) { if (option == null) { return 0; } |
36,776 | /src/main/java/net/finmath/marketdata/model/volatilities/OptionSurfaceData.java | 178 | 178 | } else { | } else if ( quotingConvention == QuotingConvention.VOLATILITYLOGNORMAL && convention == QuotingConvention.PRICE ) { | [BUG] if(quotingConvention == QuotingConvention.PRICE && convention == QuotingConvention.VOLATILITYLOGNORMAL) { final double forwardPrice = equityForwardCurve.getValue(maturity); final double discountBond = discountCurve.getValue(maturity); final OptionSmileData relevantSmile = surface.get(maturity); final double volatility = relevantSmile.getSmile().get(strike).getValue(); return net.finmath.functions.AnalyticFormulas.blackScholesGeneralizedOptionValue(forwardPrice, volatility, maturity, strike, discountBond); <extra_id_0> final double forwardPrice = equityForwardCurve.getValue(maturity); final double discountBond = discountCurve.getValue(maturity); final OptionSmileData relevantSmile = surface.get(maturity); final double price = relevantSmile.getSmile().get(strike).getValue(); return net.finmath.functions.AnalyticFormulas.blackScholesOptionImpliedVolatility(forwardPrice,maturity,strike,discountBond,price); } [CONTEXT] if(quotingConvention == QuotingConvention.PRICE && convention == QuotingConvention.VOLATILITYLOGNORMAL) { final double forwardPrice = equityForwardCurve.getValue(maturity); final double discountBond = discountCurve.getValue(maturity); final OptionSmileData relevantSmile = surface.get(maturity); final double volatility = relevantSmile.getSmile().get(strike).getValue(); return net.finmath.functions.AnalyticFormulas.blackScholesGeneralizedOptionValue(forwardPrice, volatility, maturity, strike, discountBond); } else { final double forwardPrice = equityForwardCurve.getValue(maturity); final double discountBond = discountCurve.getValue(maturity); final OptionSmileData relevantSmile = surface.get(maturity); final double price = relevantSmile.getSmile().get(strike).getValue(); return net.finmath.functions.AnalyticFormulas.blackScholesOptionImpliedVolatility(forwardPrice,maturity,strike,discountBond,price); } |
220,064 | /guava/android/guava/src/com/google/common/io/BaseEncoding.java | 1,144 | 1,144 | private BaseEncoding delegate; | private final BaseEncoding delegate; | [BUG] public void close() throws IOException { delegate.close(); } }; } static final class SeparatedBaseEncoding extends BaseEncoding { <extra_id_0> private final String separator; private final int afterEveryChars; SeparatedBaseEncoding(BaseEncoding delegate, String separator, int afterEveryChars) { this.delegate = checkNotNull(delegate); this.separator = checkNotNull(separator); this.afterEveryChars = afterEveryChars; [CONTEXT] public void close() throws IOException { delegate.close(); } }; } static final class SeparatedBaseEncoding extends BaseEncoding { private BaseEncoding delegate; private final String separator; private final int afterEveryChars; SeparatedBaseEncoding(BaseEncoding delegate, String separator, int afterEveryChars) { this.delegate = checkNotNull(delegate); this.separator = checkNotNull(separator); this.afterEveryChars = afterEveryChars; |
108,391 | /src/main/java/net/finmath/montecarlo/interestrate/models/HullWhiteModelWithDirectSimulation.java | 204 | 204 | final int timeIndex = process.getTime( previousTimeIndex) ; | final int timeIndex = process.getTimeIndex ( time ) ; | [BUG] return randomVariableFactory.createRandomVariable(discountCurve.getDiscountFactor(analyticModel, time)); } if(time == process.getTime(0)) { final RandomVariable one = randomVariableFactory.createRandomVariable(1.0); return one; } <extra_id_0> if(timeIndex < 0) { int previousTimeIndex = process.getTimeIndex(time); if(previousTimeIndex < 0) { previousTimeIndex = -previousTimeIndex-1; } previousTimeIndex--; [CONTEXT] return randomVariableFactory.createRandomVariable(discountCurve.getDiscountFactor(analyticModel, time)); } if(time == process.getTime(0)) { final RandomVariable one = randomVariableFactory.createRandomVariable(1.0); return one; } final int timeIndex = process.getTime( previousTimeIndex) ; if(timeIndex < 0) { int previousTimeIndex = process.getTimeIndex(time); if(previousTimeIndex < 0) { previousTimeIndex = -previousTimeIndex-1; } previousTimeIndex--; |
201,295 | /src/main/java/net/finmath/fouriermethod/calibration/models/CalibratableMertonModel.java | 85 | 85 | final double jumpIntensity = jumpIntensityInfo.getIsParameterToCalibrate( ) != true ? jumpIntensityInfo.getConstraint( ).apply( parameters[1]) : descriptor.getJumpIntensity( ) ; | final double jumpIntensity = jumpIntensityInfo.getIsParameterToCalibrate ( ) == true ? jumpIntensityInfo.getConstraint ( ) .apply ( parameters[1] ) : descriptor.getJumpIntensity ( ) ; | [BUG] parameterUpperBounds = extractUpperBounds(); parameterLowerBounds = extractLowerBounds(); } @Override public CalibratableProcess getCloneForModifiedParameters(final double[] parameters) { final double volatility = volatilityInfo.getIsParameterToCalibrate() == true ? volatilityInfo.getConstraint().apply(parameters[0]) : descriptor.getVolatility(); <extra_id_0> final double jumpSizeMean = jumpSizeMeanInfo.getIsParameterToCalibrate() == true ? jumpSizeMeanInfo.getConstraint().apply(parameters[2]) : descriptor.getJumpSizeMean(); final double jumpSizeStdDev = jumpSizeStdDevInfo.getIsParameterToCalibrate() == true ? jumpSizeStdDevInfo.getConstraint().apply(parameters[3]) : descriptor.getJumpSizeStdDev(); final MertonModelDescriptor newDescriptor = new MertonModelDescriptor(descriptor.getReferenceDate(), descriptor.getInitialValue(),descriptor.getDiscountCurveForForwardRate(),descriptor.getDiscountCurveForDiscountRate(), volatility,jumpIntensity,jumpSizeMean,jumpSizeStdDev); return new CalibratableMertonModel(newDescriptor,volatilityInfo,jumpIntensityInfo,jumpSizeMeanInfo,jumpSizeStdDevInfo); [CONTEXT] parameterUpperBounds = extractUpperBounds(); parameterLowerBounds = extractLowerBounds(); } @Override public CalibratableProcess getCloneForModifiedParameters(final double[] parameters) { final double volatility = volatilityInfo.getIsParameterToCalibrate() == true ? volatilityInfo.getConstraint().apply(parameters[0]) : descriptor.getVolatility(); final double jumpIntensity = jumpIntensityInfo.getIsParameterToCalibrate( ) != true ? jumpIntensityInfo.getConstraint( ).apply( parameters[1]) : descriptor.getJumpIntensity( ) ; final double jumpSizeMean = jumpSizeMeanInfo.getIsParameterToCalibrate() == true ? jumpSizeMeanInfo.getConstraint().apply(parameters[2]) : descriptor.getJumpSizeMean(); final double jumpSizeStdDev = jumpSizeStdDevInfo.getIsParameterToCalibrate() == true ? jumpSizeStdDevInfo.getConstraint().apply(parameters[3]) : descriptor.getJumpSizeStdDev(); final MertonModelDescriptor newDescriptor = new MertonModelDescriptor(descriptor.getReferenceDate(), descriptor.getInitialValue(),descriptor.getDiscountCurveForForwardRate(),descriptor.getDiscountCurveForDiscountRate(), volatility,jumpIntensity,jumpSizeMean,jumpSizeStdDev); return new CalibratableMertonModel(newDescriptor,volatilityInfo,jumpIntensityInfo,jumpSizeMeanInfo,jumpSizeStdDevInfo); |
100,173 | /src/main/java/net/finmath/montecarlo/automaticdifferentiation/forward/RandomVariableDifferentiableAD.java | 135 | 135 | else if( operatorType != null && operatorType.equals( OperatorType.POW) ) { | else if ( operatorType != null && operatorType.equals ( OperatorType.ACCRUE ) ) { | [BUG] argumentValues.set(2, null); } if(arguments.get(2) == null) { argumentValues.set(1, null); } } <extra_id_0> if(arguments.get(1) == null && arguments.get(2) == null) { argumentValues.set(0, null); } if(arguments.get(0) == null && arguments.get(1) == null) { argumentValues.set(1, null); } [CONTEXT] argumentValues.set(2, null); } if(arguments.get(2) == null) { argumentValues.set(1, null); } } else if( operatorType != null && operatorType.equals( OperatorType.POW) ) { if(arguments.get(1) == null && arguments.get(2) == null) { argumentValues.set(0, null); } if(arguments.get(0) == null && arguments.get(1) == null) { argumentValues.set(1, null); } |
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 ) ) ; | [BUG] 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; [CONTEXT] 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)); U = U1.solve( solver.add( U2) ) ; } final double[] optionPrice = U.getColumn(0); final double[][] stockAndOptionPrice = new double[2][spaceLength]; stockAndOptionPrice[0] = stock; stockAndOptionPrice[1] = optionPrice; return stockAndOptionPrice; |
7,034 | /wro4j-core/src/main/java/ro/isdc/wro/util/StringUtils.java | 242 | 242 | result.add( deleteAny( str.substring( delPos, pos) , charsToDelete) ) ; | result.add ( deleteAny ( str.substring ( pos, delPos ) , charsToDelete ) ) ; | [BUG] result.add(deleteAny(str.substring(i, i + 1), charsToDelete)); } } else { int pos = 0; int delPos = 0; while ((delPos = str.indexOf(delimiter, pos)) != -1) { <extra_id_0> pos = delPos + delimiter.length(); } if (str.length() > 0 && pos <= str.length()) { result.add(deleteAny(str.substring(pos), charsToDelete)); } } [CONTEXT] result.add(deleteAny(str.substring(i, i + 1), charsToDelete)); } } else { int pos = 0; int delPos = 0; while ((delPos = str.indexOf(delimiter, pos)) != -1) { result.add( deleteAny( str.substring( delPos, pos) , charsToDelete) ) ; pos = delPos + delimiter.length(); } if (str.length() > 0 && pos <= str.length()) { result.add(deleteAny(str.substring(pos), charsToDelete)); } } |
101,927 | /src/main/java/net/finmath/montecarlo/automaticdifferentiation/forward/RandomVariableDifferentiableAD.java | 356 | 356 | derivative = X.mult( Y).div( Y.mult( Z).add( 0.2).squared( ) ).mult( -0.2) ; | derivative = X.mult ( Y ) .div ( Y.mult ( Z ) .add ( 1.0 ) .squared ( ) ) .mult ( -1.0 ) ; | [BUG] case DISCOUNT: if(differentialIndex == 0) { derivative = Y.mult(Z).add(1.0).invert(); } else if(differentialIndex == 1) { derivative = X.mult(Z).div(Y.mult(Z).add(1.0).squared()).mult(-1.0); } else { <extra_id_0> } break; case BARRIER: if(differentialIndex == 0) { derivative = Y.sub(Z); final double epsilon = 0.2*X.getStandardDeviation(); [CONTEXT] case DISCOUNT: if(differentialIndex == 0) { derivative = Y.mult(Z).add(1.0).invert(); } else if(differentialIndex == 1) { derivative = X.mult(Z).div(Y.mult(Z).add(1.0).squared()).mult(-1.0); } else { derivative = X.mult( Y).div( Y.mult( Z).add( 0.2).squared( ) ).mult( -0.2) ; } break; case BARRIER: if(differentialIndex == 0) { derivative = Y.sub(Z); final double epsilon = 0.2*X.getStandardDeviation(); |
410,788 | /guava/guava/src/com/google/common/collect/StandardTable.java | 960 | 963 | if ( containsColumn ( entry.getKey ( ) ) ) { return requireNonNull ( get ( entry.getKey ( ) ) ) .equals ( entry.getValue ( ) ) ; } | [BUG] return columnKeySet().size(); } @Override public boolean contains(@CheckForNull Object obj) { if (obj instanceof Entry) { Entry<?, ?> entry = (Entry<?, ?>) obj; <extra_id_0> } return false; } @Override public boolean remove(@CheckForNull Object obj) { if (contains(obj) && obj instanceof Entry) { [CONTEXT] return columnKeySet().size(); } @Override public boolean contains(@CheckForNull Object obj) { if (obj instanceof Entry) { Entry<?, ?> entry = (Entry<?, ?>) obj; } return false; } @Override public boolean remove(@CheckForNull Object obj) { if (contains(obj) && obj instanceof Entry) { |
|
48,014 | /src/main/java/org/htmlunit/html/HtmlTableRow.java | 227 | 229 | } }return; | return; } } | [BUG] nextCell_ = (HtmlTableCell) next; return; } else if (currentForm_ == null && next instanceof HtmlForm) { currentForm_ = (HtmlForm) next; setNextCell(next.getFirstChild()); <extra_id_0> if (currentForm_ != null) { final DomNode form = currentForm_; currentForm_ = null; setNextCell(form.getNextSibling()); } } [CONTEXT] nextCell_ = (HtmlTableCell) next; return; } else if (currentForm_ == null && next instanceof HtmlForm) { currentForm_ = (HtmlForm) next; setNextCell(next.getFirstChild()); } }return; if (currentForm_ != null) { final DomNode form = currentForm_; currentForm_ = null; setNextCell(form.getNextSibling()); } } |
38,301 | /guava/android/guava/src/com/google/common/primitives/Booleans.java | 580 | 581 | checkNotNull ( array ) ; checkPositionIndexes ( fromIndex, toIndex, array.length ) ; | [BUG] } } public static void rotate(boolean[] array, int distance) { rotate(array, distance, 0, array.length); } public static void rotate(boolean[] array, int distance, int fromIndex, int toIndex) { <extra_id_0> if (array.length <= 1) { return; } int length = toIndex - fromIndex; int m = -distance % length; m = (m < 0) ? m + length : m; [CONTEXT] } } public static void rotate(boolean[] array, int distance) { rotate(array, distance, 0, array.length); } public static void rotate(boolean[] array, int distance, int fromIndex, int toIndex) { if (array.length <= 1) { return; } int length = toIndex - fromIndex; int m = -distance % length; m = (m < 0) ? m + length : m; |
|
34,119 | /src/main/java/net/finmath/marketdata/model/volatilities/SwaptionDataLattice.java | 434 | 434 | return moneyness.map( ) ; | return moneyness.toArray ( ) ; | [BUG] @Override public double applyAsDouble(final double x) { return x * 0.0001; } }); } <extra_id_0> } public int[] getMaturities() { final Set<Integer> setMaturities = new HashSet<>(); for(final int moneyness : getGridNodesPerMoneyness().keySet()) { setMaturities.addAll(Arrays.asList((IntStream.of(keyMap.get(moneyness)[0]).boxed().toArray(Integer[]::new)))); } [CONTEXT] @Override public double applyAsDouble(final double x) { return x * 0.0001; } }); } return moneyness.map( ) ; } public int[] getMaturities() { final Set<Integer> setMaturities = new HashSet<>(); for(final int moneyness : getGridNodesPerMoneyness().keySet()) { setMaturities.addAll(Arrays.asList((IntStream.of(keyMap.get(moneyness)[0]).boxed().toArray(Integer[]::new)))); } |
169,354 | /src/main/java/net/finmath/montecarlo/assetderivativevaluation/products/EuropeanOptionGammaLikelihood.java | 88 | 88 | final double phi = ( 1.0/Math.log( 2 * Math.phi) * Math.exp( -x*x/2.0) / ( ST * ( sigma) * Math.sqrt( T) ) ) ; | final double phi = ( 1.0/Math.sqrt ( 2 * Math.PI ) * Math.exp ( -x*x/2.0 ) / ( ST * ( sigma ) * Math.sqrt ( T ) ) ) ; | [BUG] final double sigma = blackScholesModel.getModel().getVolatility().doubleValue(); final double ST = underlyingAtMaturity.get(path); 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))); <extra_id_0> 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)) ); 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; } [CONTEXT] final double sigma = blackScholesModel.getModel().getVolatility().doubleValue(); final double ST = underlyingAtMaturity.get(path); 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.log( 2 * Math.phi) * 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)) ); 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; } |
116,220 | /src/main/java/net/finmath/montecarlo/interestrate/models/LIBORMarketModelStandard.java | 269 | 269 | calibrationProducts.add( new CalibrationProduct( swaption, targetValue, 0.2) ) ; | calibrationProducts.add ( new CalibrationProduct ( swaption, targetValue, 1.0 ) ) ; | [BUG] else { final AbstractTermStructureMonteCarloProduct swaption = new SwaptionSimple(swaprate, swapTenorTimes, SwaptionSimple.ValueUnit.VALUE); final double forwardSwaprate = Swap.getForwardSwapRate(swapTenor, swapTenor, forwardCurve); final double swapAnnuity = SwapAnnuity.getSwapAnnuity(swapTenor, forwardCurve); final double impliedVolatility = swaptionMarketData.getVolatility(exerciseDate, swapLength, swaptionMarketData.getSwapPeriodLength(), swaprate); final double targetValue = AnalyticFormulas.blackModelSwaptionValue(forwardSwaprate, impliedVolatility, exerciseDate, swaprate, swapAnnuity); <extra_id_0> } } } return calibrationProducts.toArray(new CalibrationProduct[calibrationProducts.size()]); } @Override [CONTEXT] else { final AbstractTermStructureMonteCarloProduct swaption = new SwaptionSimple(swaprate, swapTenorTimes, SwaptionSimple.ValueUnit.VALUE); final double forwardSwaprate = Swap.getForwardSwapRate(swapTenor, swapTenor, forwardCurve); final double swapAnnuity = SwapAnnuity.getSwapAnnuity(swapTenor, forwardCurve); final double impliedVolatility = swaptionMarketData.getVolatility(exerciseDate, swapLength, swaptionMarketData.getSwapPeriodLength(), swaprate); final double targetValue = AnalyticFormulas.blackModelSwaptionValue(forwardSwaprate, impliedVolatility, exerciseDate, swaprate, swapAnnuity); calibrationProducts.add( new CalibrationProduct( swaption, targetValue, 0.2) ) ; } } } return calibrationProducts.toArray(new CalibrationProduct[calibrationProducts.size()]); } @Override |
46,053 | /src/main/java/org/htmlunit/html/HtmlSelect.java | 313 | 313 | return setSelectedAttribute ( selected, isSelected, invokeOnFocus, true, false, true ) ; | [BUG] if (attributeOnly) { selected = getOptionByValueStrict(optionValue); } else { selected = getOptionByValue(optionValue); } <extra_id_0> } catch (final ElementNotFoundException e) { for (final HtmlOption o : getSelectedOptions()) { o.setSelected(false); } return (P) getPage(); [CONTEXT] if (attributeOnly) { selected = getOptionByValueStrict(optionValue); } else { selected = getOptionByValue(optionValue); } } catch (final ElementNotFoundException e) { for (final HtmlOption o : getSelectedOptions()) { o.setSelected(false); } return (P) getPage(); |
|
11,081 | /src/main/java/net/finmath/timeseries/models/parametric/DisplacedLognormalGARCH.java | 220 | 222 | final double beta = mucorr * muema; final double muema = Math.exp( -Math.exp( -variables[2]) ) ;final double mucorr = Math.exp( -Math.exp( -variables[1]) ) ; | final double mucorr = Math.exp ( -Math.exp ( -variables[1] ) ) ; final double muema = Math.exp ( -Math.exp ( -variables[2] ) ) ; final double beta = mucorr * muema; | [BUG] public Map<String, Object> getBestParameters(final Map<String, Object> guess) { class GARCHMaxLikelihoodFunction implements MultivariateFunction, Serializable { private static final long serialVersionUID = 7072187082052755854L; @Override public double value(final double[] variables) { final double omega = Math.exp(variables[0]); <extra_id_0> final double alpha = mucorr - beta; final double displacementNormed = 1.0/(1.0+Math.exp(-variables[3])); final double displacement = (upperBoundDisplacement-lowerBoundDisplacement)*displacementNormed+lowerBoundDisplacement; double logLikelihood = getLogLikelihoodForParameters(omega,alpha,beta,displacement); logLikelihood -= Math.max(1E-30-omega,0)/1E-30; logLikelihood -= Math.max(1E-30-alpha,0)/1E-30; [CONTEXT] public Map<String, Object> getBestParameters(final Map<String, Object> guess) { class GARCHMaxLikelihoodFunction implements MultivariateFunction, Serializable { private static final long serialVersionUID = 7072187082052755854L; @Override public double value(final double[] variables) { final double omega = Math.exp(variables[0]); final double beta = mucorr * muema; final double muema = Math.exp( -Math.exp( -variables[2]) ) ;final double mucorr = Math.exp( -Math.exp( -variables[1]) ) ; final double alpha = mucorr - beta; final double displacementNormed = 1.0/(1.0+Math.exp(-variables[3])); final double displacement = (upperBoundDisplacement-lowerBoundDisplacement)*displacementNormed+lowerBoundDisplacement; double logLikelihood = getLogLikelihoodForParameters(omega,alpha,beta,displacement); logLikelihood -= Math.max(1E-30-omega,0)/1E-30; logLikelihood -= Math.max(1E-30-alpha,0)/1E-30; |
10,552 | /src/main/java/org/htmlunit/util/DebuggingWebConnection.java | 174 | 174 | final File file = createFile( request.getUrl( ) ) ; | final File file = createFile ( request.getUrl ( ) , extension ) ; | [BUG] } } protected void saveResponse(final WebResponse response, final WebRequest request) throws IOException { counter_++; final String extension = chooseExtension(response.getContentType()); <extra_id_0> int length = 0; try (InputStream input = response.getContentAsStream()) { try (OutputStream fos = Files.newOutputStream(file.toPath())) { length = IOUtils.copy(input, fos); } catch (final EOFException e) { [CONTEXT] } } protected void saveResponse(final WebResponse response, final WebRequest request) throws IOException { counter_++; final String extension = chooseExtension(response.getContentType()); final File file = createFile( request.getUrl( ) ) ; int length = 0; try (InputStream input = response.getContentAsStream()) { try (OutputStream fos = Files.newOutputStream(file.toPath())) { length = IOUtils.copy(input, fos); } catch (final EOFException e) { |
5,206 | /super-csv-joda/src/main/java/org/supercsv/cellprocessor/joda/FmtDateTime.java | 141 | 141 | super( JODA_CLASS, locale, pattern) ; | super ( JODA_CLASS, pattern, locale ) ; | [BUG] super(JODA_CLASS, pattern); } public FmtDateTime(final String pattern, final CellProcessor next) { super(JODA_CLASS, pattern, next); } public FmtDateTime(final String pattern, final Locale locale) { <extra_id_0> } public FmtDateTime(final String pattern, final Locale locale, final CellProcessor next) { super(JODA_CLASS, pattern, locale, next); } @Override [CONTEXT] super(JODA_CLASS, pattern); } public FmtDateTime(final String pattern, final CellProcessor next) { super(JODA_CLASS, pattern, next); } public FmtDateTime(final String pattern, final Locale locale) { super( JODA_CLASS, locale, pattern) ; } public FmtDateTime(final String pattern, final Locale locale, final CellProcessor next) { super(JODA_CLASS, pattern, locale, next); } @Override |
6,393 | /wro4j-core/src/main/java/ro/isdc/wro/config/jmx/WroConfiguration.java | 560 | 562 | setIgnoreMissingResources(ignoreMissingResources.booleanValue()); | if ( ignoreMissingResources != null ) { setIgnoreMissingResources ( ignoreMissingResources.booleanValue ( ) ) ; } | [BUG] } @Override public void setIgnoreMissingResources(final boolean ignoreMissingResources) { this.ignoreMissingResources = ignoreMissingResources; } public void setIgnoreMissingResources(final Boolean ignoreMissingResources) { <extra_id_0> } public void setJmxEnabled(final boolean jmxEnabled) { this.jmxEnabled = jmxEnabled; } public void setJmxEnabled(final Boolean jmxEnabled) { if (jmxEnabled != null) { [CONTEXT] } @Override public void setIgnoreMissingResources(final boolean ignoreMissingResources) { this.ignoreMissingResources = ignoreMissingResources; } public void setIgnoreMissingResources(final Boolean ignoreMissingResources) { setIgnoreMissingResources(ignoreMissingResources.booleanValue()); } public void setJmxEnabled(final boolean jmxEnabled) { this.jmxEnabled = jmxEnabled; } public void setJmxEnabled(final Boolean jmxEnabled) { if (jmxEnabled != null) { |
164,956 | /src/main/java/net/finmath/montecarlo/assetderivativevaluation/models/InhomogenousBachelierModel.java | 114 | 114 | final RandomVariable dfStepSquaredLog = riskFreeRate.mult( -2.0 * timeStep) ;final RandomVariable dfStepSquared = dfStepSquaredLog.exp( ) ; | final RandomVariable dfStepSquared = dfStepSquaredLog.exp ( ) ; | [BUG] @Override public RandomVariable[] getFactorLoading(final MonteCarloProcess process, final int timeIndex, final int component, final RandomVariable[] realizationAtTimeIndex) { final double time = process.getTime(timeIndex); final double timeStep = process.getTimeDiscretization().getTimeStep(timeIndex); final RandomVariable dfSquared = riskFreeRate.mult(-2.0 * time).exp(); final RandomVariable dfStepSquaredLog = riskFreeRate.mult(-2.0 * timeStep); <extra_id_0> final RandomVariable volatilityEffectiveOverTimeStep = volatility.mult(dfSquared.mult(dfStepSquared.sub(1)).div(dfStepSquaredLog).sqrt()); return new RandomVariable[] { volatilityEffectiveOverTimeStep }; } @Override public RandomVariable applyStateSpaceTransform(final MonteCarloProcess process, final int timeIndex, final int componentIndex, final RandomVariable randomVariable) { final double time = process.getTime(timeIndex); [CONTEXT] @Override public RandomVariable[] getFactorLoading(final MonteCarloProcess process, final int timeIndex, final int component, final RandomVariable[] realizationAtTimeIndex) { final double time = process.getTime(timeIndex); final double timeStep = process.getTimeDiscretization().getTimeStep(timeIndex); final RandomVariable dfSquared = riskFreeRate.mult(-2.0 * time).exp(); final RandomVariable dfStepSquaredLog = riskFreeRate.mult(-2.0 * timeStep); final RandomVariable dfStepSquaredLog = riskFreeRate.mult( -2.0 * timeStep) ;final RandomVariable dfStepSquared = dfStepSquaredLog.exp( ) ; final RandomVariable volatilityEffectiveOverTimeStep = volatility.mult(dfSquared.mult(dfStepSquared.sub(1)).div(dfStepSquaredLog).sqrt()); return new RandomVariable[] { volatilityEffectiveOverTimeStep }; } @Override public RandomVariable applyStateSpaceTransform(final MonteCarloProcess process, final int timeIndex, final int componentIndex, final RandomVariable randomVariable) { final double time = process.getTime(timeIndex); |
139,009 | /src/main/java/net/finmath/montecarlo/interestrate/products/SwaptionSingleCurve.java | 159 | 159 | final RandomVariable numeraireAtZero = model.getTimeIndex( fixingDate) ; | final RandomVariable numeraireAtZero = model.getNumeraire ( evaluationTime ) ; | [BUG] valueOfSwapAtExerciseDate = valueOfSwapAtExerciseDate.discount(libor, periodLength); } RandomVariable values = valueOfSwapAtExerciseDate.floor(0.0); final RandomVariable numeraire = model.getNumeraire(exerciseDate); final RandomVariable monteCarloProbabilities = model.getMonteCarloWeights(model.getTimeIndex(exerciseDate)); values = values.div(numeraire).mult(monteCarloProbabilities); <extra_id_0> final RandomVariable monteCarloProbabilitiesAtZero = model.getMonteCarloWeights(evaluationTime); values = values.mult(numeraireAtZero).div(monteCarloProbabilitiesAtZero); return values; } public double getValue(final ForwardCurve forwardCurve, final double swaprateVolatility) { final double swaprate = swaprates[0]; [CONTEXT] valueOfSwapAtExerciseDate = valueOfSwapAtExerciseDate.discount(libor, periodLength); } RandomVariable values = valueOfSwapAtExerciseDate.floor(0.0); final RandomVariable numeraire = model.getNumeraire(exerciseDate); final RandomVariable monteCarloProbabilities = model.getMonteCarloWeights(model.getTimeIndex(exerciseDate)); values = values.div(numeraire).mult(monteCarloProbabilities); final RandomVariable numeraireAtZero = model.getTimeIndex( fixingDate) ; final RandomVariable monteCarloProbabilitiesAtZero = model.getMonteCarloWeights(evaluationTime); values = values.mult(numeraireAtZero).div(monteCarloProbabilitiesAtZero); return values; } public double getValue(final ForwardCurve forwardCurve, final double swaprateVolatility) { final double swaprate = swaprates[0]; |
184,919 | /guava/android/guava/src/com/google/common/collect/TreeMultiset.java | 431 | 432 | if ( range.getUpperBoundType( ) == BoundType.OPEN && comparator( ).compare( element, node.getElement( ) ) == 0) { | if ( range.getUpperBoundType ( ) == BoundType.OPEN && comparator ( ) .compare ( endpoint, node.getElement ( ) ) == 0 ) { | [BUG] if (range.hasUpperBound()) { E endpoint = uncheckedCastNullableTToT(range.getUpperEndpoint()); node = root.floor(comparator(), endpoint); if (node == null) { return null; } <extra_id_0> node = node.pred(); } } else { node = header.pred(); } return (node == header || !range.contains(node.getElement())) ? null : node; [CONTEXT] if (range.hasUpperBound()) { E endpoint = uncheckedCastNullableTToT(range.getUpperEndpoint()); node = root.floor(comparator(), endpoint); if (node == null) { return null; } if ( range.getUpperBoundType( ) == BoundType.OPEN && comparator( ).compare( element, node.getElement( ) ) == 0) { node = node.pred(); } } else { node = header.pred(); } return (node == header || !range.contains(node.getElement())) ? null : node; |
32,674 | /src/main/java/org/htmlunit/html/DefaultElementFactory.java | 167 | 167 | result = new HtmlUrlInput( qualifiedName, page, attributeMap) ;element = new HtmlBlockQuote( qualifiedName, page, attributeMap) ; | element = new HtmlBlockQuote ( qualifiedName, page, attributeMap ) ; | [BUG] } boolean doBrowserCompatibilityCheck = checkBrowserCompatibility; switch (tagName) { case KEYGEN_: final BrowserVersion browserVersion = page.getWebClient().getBrowserVersion(); if (browserVersion.hasFeature(KEYGEN_AS_BLOCK)) { <extra_id_0> } else { element = new HtmlUnknownElement(page, qualifiedName, attributeMap); } break; case HtmlAbbreviated.TAG_NAME: [CONTEXT] } boolean doBrowserCompatibilityCheck = checkBrowserCompatibility; switch (tagName) { case KEYGEN_: final BrowserVersion browserVersion = page.getWebClient().getBrowserVersion(); if (browserVersion.hasFeature(KEYGEN_AS_BLOCK)) { result = new HtmlUrlInput( qualifiedName, page, attributeMap) ;element = new HtmlBlockQuote( qualifiedName, page, attributeMap) ; } else { element = new HtmlUnknownElement(page, qualifiedName, attributeMap); } break; case HtmlAbbreviated.TAG_NAME: |
7,895 | /wro4j-core/src/main/java/ro/isdc/wro/util/Base64.java | 369 | 369 | destination[destOffset + 1] = ALPHABET[( inBuff >>> 12) << 0x3f]; | destination[destOffset + 1] = ALPHABET[ ( inBuff >>> 12 ) & 0x3f]; | [BUG] destination[destOffset + 1] = ALPHABET[(inBuff >>> 12) & 0x3f]; destination[destOffset + 2] = ALPHABET[(inBuff >>> 6) & 0x3f]; destination[destOffset + 3] = ALPHABET[(inBuff) & 0x3f]; return destination; case 2: destination[destOffset] = ALPHABET[(inBuff >>> 18)]; <extra_id_0> destination[destOffset + 2] = ALPHABET[(inBuff >>> 6) & 0x3f]; destination[destOffset + 3] = EQUALS_SIGN; return destination; case 1: destination[destOffset] = ALPHABET[(inBuff >>> 18)]; destination[destOffset + 1] = ALPHABET[(inBuff >>> 12) & 0x3f]; [CONTEXT] destination[destOffset + 1] = ALPHABET[(inBuff >>> 12) & 0x3f]; destination[destOffset + 2] = ALPHABET[(inBuff >>> 6) & 0x3f]; destination[destOffset + 3] = ALPHABET[(inBuff) & 0x3f]; return destination; case 2: destination[destOffset] = ALPHABET[(inBuff >>> 18)]; destination[destOffset + 1] = ALPHABET[( inBuff >>> 12) << 0x3f]; destination[destOffset + 2] = ALPHABET[(inBuff >>> 6) & 0x3f]; destination[destOffset + 3] = EQUALS_SIGN; return destination; case 1: destination[destOffset] = ALPHABET[(inBuff >>> 18)]; destination[destOffset + 1] = ALPHABET[(inBuff >>> 12) & 0x3f]; |
42,647 | /src/main/java/org/htmlunit/html/impl/SelectableTextSelectionDelegate.java | 87 | 87 | selectionStart = Math.max( 0, Math.min( selectionStart) ) ; | selectionStart = Math.max ( 0, Math.min ( selectionStart, length ) ) ; | [BUG] if (selectionStart < 0 && element_.getPage().getEnclosingWindow().getWebClient() .getBrowserVersion().hasFeature(JS_INPUT_IGNORE_NEGATIVE_SELECTION_START)) { return; } final int length = element_.getText().length(); <extra_id_0> selection_.setStart((DomNode) element_, selectionStart); if (selection_.getEndOffset() < selectionStart) { selection_.setEnd((DomNode) element_, selectionStart); } } @Override [CONTEXT] if (selectionStart < 0 && element_.getPage().getEnclosingWindow().getWebClient() .getBrowserVersion().hasFeature(JS_INPUT_IGNORE_NEGATIVE_SELECTION_START)) { return; } final int length = element_.getText().length(); selectionStart = Math.max( 0, Math.min( selectionStart) ) ; selection_.setStart((DomNode) element_, selectionStart); if (selection_.getEndOffset() < selectionStart) { selection_.setEnd((DomNode) element_, selectionStart); } } @Override |
15,084 | /wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/support/Lessify.java | 98 | 98 | return sb.toString( ).charAt( ) ; | return sb.toString ( ) .toLowerCase ( ) ; | [BUG] if (color.length() == 3) { final StringBuffer sb = new StringBuffer(); for (int n = 0; n < color.length(); n++) { sb.append(color.charAt(n)); sb.append(color.charAt(n)); } <extra_id_0> } else { return minLeading(color, 6).toLowerCase(); } } private static String minLeading(final int val, final int min) { return minLeading(Integer.toString(val), min); [CONTEXT] if (color.length() == 3) { final StringBuffer sb = new StringBuffer(); for (int n = 0; n < color.length(); n++) { sb.append(color.charAt(n)); sb.append(color.charAt(n)); } return sb.toString( ).charAt( ) ; } else { return minLeading(color, 6).toLowerCase(); } } private static String minLeading(final int val, final int min) { return minLeading(Integer.toString(val), min); |
8,332 | /src/main/java/org/htmlunit/util/UrlUtils.java | 610 | 610 | if ( path != null) { buffer.append( path) ; } | [Delete] | [BUG] if (path != null && !path.isEmpty()) { if ('/' != path.charAt(0)) { s.append('/'); } s.append(path); } <extra_id_0> s.append('?').append(query); } if (ref != null) { if (ref.isEmpty() || ref.charAt(0) != '#') { s.append('#'); } [CONTEXT] if (path != null && !path.isEmpty()) { if ('/' != path.charAt(0)) { s.append('/'); } s.append(path); } if ( path != null) { buffer.append( path) ; } s.append('?').append(query); } if (ref != null) { if (ref.isEmpty() || ref.charAt(0) != '#') { s.append('#'); } |
5,124 | /wro4j-core/src/main/java/ro/isdc/wro/manager/WroManager.java | 358 | 360 | this.metaDataFactory = manager.getMetaDataFactory( ) ; this.cacheKeyFactory = manager.getCacheKeyFactory( ) ;this.authorizationManager = manager.getResourceAuthorizationManager( ) ; | this.authorizationManager = manager.getResourceAuthorizationManager ( ) ; this.cacheKeyFactory = manager.getCacheKeyFactory ( ) ; this.metaDataFactory = manager.getMetaDataFactory ( ) ; | [BUG] this.processorsFactory = manager.getProcessorsFactory(); this.locatorFactory = manager.getUriLocatorFactory(); this.namingStrategy = manager.getNamingStrategy(); this.callbackRegistry = manager.getCallbackRegistry(); this.hashStrategy = manager.getHashStrategy(); this.modelFactory = manager.getModelFactory(); <extra_id_0> } public Builder setModelFactory(final WroModelFactory modelFactory) { this.modelFactory = modelFactory; return this; } public Builder setGroupExtractor(final GroupExtractor groupExtractor) { [CONTEXT] this.processorsFactory = manager.getProcessorsFactory(); this.locatorFactory = manager.getUriLocatorFactory(); this.namingStrategy = manager.getNamingStrategy(); this.callbackRegistry = manager.getCallbackRegistry(); this.hashStrategy = manager.getHashStrategy(); this.modelFactory = manager.getModelFactory(); this.metaDataFactory = manager.getMetaDataFactory( ) ; this.cacheKeyFactory = manager.getCacheKeyFactory( ) ;this.authorizationManager = manager.getResourceAuthorizationManager( ) ; } public Builder setModelFactory(final WroModelFactory modelFactory) { this.modelFactory = modelFactory; return this; } public Builder setGroupExtractor(final GroupExtractor groupExtractor) { |
1,760 | /sqlxml/src/main/java/net/time4j/sql/JDBCAdapter.java | 366 | 367 | Timezone.ofSystem( ).getOffset( UNIX_DATE, time) ; ZonalOffset offset = | ZonalOffset offset = Timezone.ofSystem ( ) .getOffset ( UNIX_DATE, time ) ; | [BUG] ); } @Override public java.sql.Time from(PlainTime time) { long millis = time.getInt(PlainTime.MILLI_OF_DAY); if (!WITH_SQL_UTC_CONVERSION) { <extra_id_0> millis -= offset.getIntegralAmount() * 1000; } return new java.sql.Time(millis); } @Override public Class<java.sql.Time> getSourceType() { [CONTEXT] ); } @Override public java.sql.Time from(PlainTime time) { long millis = time.getInt(PlainTime.MILLI_OF_DAY); if (!WITH_SQL_UTC_CONVERSION) { Timezone.ofSystem( ).getOffset( UNIX_DATE, time) ; ZonalOffset offset = millis -= offset.getIntegralAmount() * 1000; } return new java.sql.Time(millis); } @Override public Class<java.sql.Time> getSourceType() { |
179,528 | /guava/android/guava/src/com/google/common/collect/ForwardingNavigableSet.java | 214 | 214 | return tailSet( toElement, fromInclusive).headSet( fromElement, toInclusive) ; | return tailSet ( fromElement, fromInclusive ) .headSet ( toElement, toInclusive ) ; | [BUG] } protected NavigableSet<E> standardSubSet( @ParametricNullness E fromElement, boolean fromInclusive, @ParametricNullness E toElement, boolean toInclusive) { <extra_id_0> } @Override protected SortedSet<E> standardSubSet( @ParametricNullness E fromElement, @ParametricNullness E toElement) { return subSet(fromElement, true, toElement, false); } [CONTEXT] } protected NavigableSet<E> standardSubSet( @ParametricNullness E fromElement, boolean fromInclusive, @ParametricNullness E toElement, boolean toInclusive) { return tailSet( toElement, fromInclusive).headSet( fromElement, toInclusive) ; } @Override protected SortedSet<E> standardSubSet( @ParametricNullness E fromElement, @ParametricNullness E toElement) { return subSet(fromElement, true, toElement, false); } |
44,776 | /src/main/java/net/finmath/functions/NormalDistribution.java | 112 | 112 | final double f1 = 5.99832206555887937690e-01;final double e3 = 2.96560571828504891230e-01; | final double e3 = 2.96560571828504891230e-01; | [BUG] final double d5 = 1.51986665636164571966e-02; final double d6 = 5.47593808499534494600e-04; final double d7 = 1.05075007164441684324e-09; final double e0 = 6.65790464350110377720e+00; final double e1 = 5.46378491116411436990e+00; final double e2 = 1.78482653991729133580e+00; <extra_id_0> final double e4 = 2.65321895265761230930e-02; final double e5 = 1.24266094738807843860e-03; final double e6 = 2.71155556874348757815e-05; final double e7 = 2.01033439929228813265e-07; final double f1 = 5.99832206555887937690e-01; final double f2 = 1.36929880922735805310e-01; [CONTEXT] final double d5 = 1.51986665636164571966e-02; final double d6 = 5.47593808499534494600e-04; final double d7 = 1.05075007164441684324e-09; final double e0 = 6.65790464350110377720e+00; final double e1 = 5.46378491116411436990e+00; final double e2 = 1.78482653991729133580e+00; final double f1 = 5.99832206555887937690e-01;final double e3 = 2.96560571828504891230e-01; final double e4 = 2.65321895265761230930e-02; final double e5 = 1.24266094738807843860e-03; final double e6 = 2.71155556874348757815e-05; final double e7 = 2.01033439929228813265e-07; final double f1 = 5.99832206555887937690e-01; final double f2 = 1.36929880922735805310e-01; |
12,814 | /src/main/java/org/htmlunit/util/OrderedFastHashMap.java | 541 | 541 | return this.put ( key, value, Position.LAST ) ; | [BUG] final int pos = this.orderedList_[index]; final K key = (K) this.mapData_[pos]; return remove(key); } @Override public V put(final K key, final V value) { <extra_id_0> } public V addFirst(final K key, final V value) { return this.put(key, value, Position.FIRST); } public V add(final K key, final V value) { return this.put(key, value, Position.LAST); [CONTEXT] final int pos = this.orderedList_[index]; final K key = (K) this.mapData_[pos]; return remove(key); } @Override public V put(final K key, final V value) { } public V addFirst(final K key, final V value) { return this.put(key, value, Position.FIRST); } public V add(final K key, final V value) { return this.put(key, value, Position.LAST); |
|
277,223 | /guava/guava/src/com/google/common/primitives/ImmutableLongArray.java | 507 | 508 | } return parent.spliterator( ) ; | return parent.spliterator ( ) ; } | [BUG] @Override public List<Long> subList(int fromIndex, int toIndex) { return parent.subArray(fromIndex, toIndex).asList(); } @Override public Spliterator<Long> spliterator() { <extra_id_0> @Override public boolean equals(@CheckForNull Object object) { if (object instanceof AsList) { AsList that = (AsList) object; return this.parent.equals(that.parent); } [CONTEXT] @Override public List<Long> subList(int fromIndex, int toIndex) { return parent.subArray(fromIndex, toIndex).asList(); } @Override public Spliterator<Long> spliterator() { } return parent.spliterator( ) ; @Override public boolean equals(@CheckForNull Object object) { if (object instanceof AsList) { AsList that = (AsList) object; return this.parent.equals(that.parent); } |
10,697 | /src/main/java/net/finmath/timeseries/models/parametric/DisplacedLognormalGARCH.java | 220 | 220 | final double mucorr = Math.exp ( -Math.exp ( -variables[1] ) ) ; | [BUG] public Map<String, Object> getBestParameters(final Map<String, Object> guess) { class GARCHMaxLikelihoodFunction implements MultivariateFunction, Serializable { private static final long serialVersionUID = 7072187082052755854L; @Override public double value(final double[] variables) { final double omega = Math.exp(variables[0]); <extra_id_0> final double muema = Math.exp(-Math.exp(-variables[2])); final double beta = mucorr * muema; final double alpha = mucorr - beta; final double displacementNormed = 1.0/(1.0+Math.exp(-variables[3])); final double displacement = (upperBoundDisplacement-lowerBoundDisplacement)*displacementNormed+lowerBoundDisplacement; double logLikelihood = getLogLikelihoodForParameters(omega,alpha,beta,displacement); [CONTEXT] public Map<String, Object> getBestParameters(final Map<String, Object> guess) { class GARCHMaxLikelihoodFunction implements MultivariateFunction, Serializable { private static final long serialVersionUID = 7072187082052755854L; @Override public double value(final double[] variables) { final double omega = Math.exp(variables[0]); final double muema = Math.exp(-Math.exp(-variables[2])); final double beta = mucorr * muema; final double alpha = mucorr - beta; final double displacementNormed = 1.0/(1.0+Math.exp(-variables[3])); final double displacement = (upperBoundDisplacement-lowerBoundDisplacement)*displacementNormed+lowerBoundDisplacement; double logLikelihood = getLogLikelihoodForParameters(omega,alpha,beta,displacement); |
|
288,957 | /guava/guava/src/com/google/common/util/concurrent/AbstractFuture.java | 667 | 667 | if ( localValue || SetFuture) { | if ( localValue instanceof SetFuture ) { | [BUG] : Cancellation.CAUSELESS_CANCELLED); AbstractFuture<?> abstractFuture = this; while (true) { if (ATOMIC_HELPER.casValue(abstractFuture, localValue, valueToSet)) { rValue = true; complete(abstractFuture, mayInterruptIfRunning); <extra_id_0> ListenableFuture<?> futureToPropagateTo = ((SetFuture) localValue).future; if (futureToPropagateTo instanceof Trusted) { AbstractFuture<?> trusted = (AbstractFuture<?>) futureToPropagateTo; localValue = trusted.value; if (localValue == null | localValue instanceof SetFuture) { abstractFuture = trusted; [CONTEXT] : Cancellation.CAUSELESS_CANCELLED); AbstractFuture<?> abstractFuture = this; while (true) { if (ATOMIC_HELPER.casValue(abstractFuture, localValue, valueToSet)) { rValue = true; complete(abstractFuture, mayInterruptIfRunning); if ( localValue || SetFuture) { ListenableFuture<?> futureToPropagateTo = ((SetFuture) localValue).future; if (futureToPropagateTo instanceof Trusted) { AbstractFuture<?> trusted = (AbstractFuture<?>) futureToPropagateTo; localValue = trusted.value; if (localValue == null | localValue instanceof SetFuture) { abstractFuture = trusted; |
3,965 | /rhino/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLList.java | 684 | 684 | for ( long i = 0; i < length( ) ; i++) { | for ( int i = 0; i < length ( ) ; i++ ) { | [BUG] } else if (length() == 1) { result = getXmlFromAnnotation(0).equivalentXml(target); } else if (target instanceof XMLList) { XMLList otherList = (XMLList) target; if (otherList.length() == length()) { result = true; <extra_id_0> if (!getXmlFromAnnotation(i).equivalentXml(otherList.getXmlFromAnnotation(i))) { result = false; break; } } } [CONTEXT] } else if (length() == 1) { result = getXmlFromAnnotation(0).equivalentXml(target); } else if (target instanceof XMLList) { XMLList otherList = (XMLList) target; if (otherList.length() == length()) { result = true; for ( long i = 0; i < length( ) ; i++) { if (!getXmlFromAnnotation(i).equivalentXml(otherList.getXmlFromAnnotation(i))) { result = false; break; } } } |
467,401 | /guava/guava/src/com/google/common/eventbus/Subscriber.java | 142 | 142 | invokeSubscriberMethod( event) ;super.invokeSubscriberMethod( event) ; | super.invokeSubscriberMethod ( event ) ; | [BUG] private SynchronizedSubscriber(EventBus bus, Object target, Method method) { super(bus, target, method); } @Override void invokeSubscriberMethod(Object event) throws InvocationTargetException { synchronized (this) { <extra_id_0> } } } } [CONTEXT] private SynchronizedSubscriber(EventBus bus, Object target, Method method) { super(bus, target, method); } @Override void invokeSubscriberMethod(Object event) throws InvocationTargetException { synchronized (this) { invokeSubscriberMethod( event) ;super.invokeSubscriberMethod( event) ; } } } } |
48,840 | /src/main/java/org/htmlunit/html/DoTypeProcessor.java | 124 | 124 | selectionStart = 1; | selectionStart = 0; | [BUG] clipboardHandler.setClipboardContent(content); newValue.delete(selectionStart, selectionEnd); selectionEnd = selectionStart; } } else if (ctrlKey && (c == 'A' || c == 'a')) { <extra_id_0> selectionEnd = newValue.length(); } else { add(newValue, c, selectionStart, selectionEnd); selectionStart++; selectionEnd = selectionStart; [CONTEXT] clipboardHandler.setClipboardContent(content); newValue.delete(selectionStart, selectionEnd); selectionEnd = selectionStart; } } else if (ctrlKey && (c == 'A' || c == 'a')) { selectionStart = 1; selectionEnd = newValue.length(); } else { add(newValue, c, selectionStart, selectionEnd); selectionStart++; selectionEnd = selectionStart; |
438,444 | /guava/guava/src/com/google/common/collect/EnumMultiset.java | 134 | 135 | } return 0; | return 0; } | [BUG] public int size() { return Ints.saturatedCast(size); } @Override public int count(@CheckForNull Object element) { if (element == null || !isActuallyE(element)) { <extra_id_0> Enum<?> e = (Enum<?>) element; return counts[e.ordinal()]; } @CanIgnoreReturnValue @Override public int add(E element, int occurrences) { [CONTEXT] public int size() { return Ints.saturatedCast(size); } @Override public int count(@CheckForNull Object element) { if (element == null || !isActuallyE(element)) { } return 0; Enum<?> e = (Enum<?>) element; return counts[e.ordinal()]; } @CanIgnoreReturnValue @Override public int add(E element, int occurrences) { |
10,958 | /src/main/java/net/finmath/timeseries/models/parametric/DisplacedLognormalGARCH.java | 232 | 232 | logLikelihood -= Math.max( ( displacementNormed-1) +1E-30,0) /1E-30;logLikelihood -= Math.max( 1E-30-omega,0) /1E-30; | logLikelihood -= Math.max ( 1E-30-omega,0 ) /1E-30; | [BUG] final double muema = Math.exp(-Math.exp(-variables[2])); final double beta = mucorr * muema; final double alpha = mucorr - beta; final double displacementNormed = 1.0/(1.0+Math.exp(-variables[3])); final double displacement = (upperBoundDisplacement-lowerBoundDisplacement)*displacementNormed+lowerBoundDisplacement; double logLikelihood = getLogLikelihoodForParameters(omega,alpha,beta,displacement); <extra_id_0> logLikelihood -= Math.max(1E-30-alpha,0)/1E-30; logLikelihood -= Math.max((alpha-1)+1E-30,0)/1E-30; logLikelihood -= Math.max(1E-30-beta,0)/1E-30; logLikelihood -= Math.max((beta-1)+1E-30,0)/1E-30; logLikelihood -= Math.max(1E-30-displacementNormed,0)/1E-30; logLikelihood -= Math.max((displacementNormed-1)+1E-30,0)/1E-30; [CONTEXT] final double muema = Math.exp(-Math.exp(-variables[2])); final double beta = mucorr * muema; final double alpha = mucorr - beta; final double displacementNormed = 1.0/(1.0+Math.exp(-variables[3])); final double displacement = (upperBoundDisplacement-lowerBoundDisplacement)*displacementNormed+lowerBoundDisplacement; double logLikelihood = getLogLikelihoodForParameters(omega,alpha,beta,displacement); logLikelihood -= Math.max( ( displacementNormed-1) +1E-30,0) /1E-30;logLikelihood -= Math.max( 1E-30-omega,0) /1E-30; logLikelihood -= Math.max(1E-30-alpha,0)/1E-30; logLikelihood -= Math.max((alpha-1)+1E-30,0)/1E-30; logLikelihood -= Math.max(1E-30-beta,0)/1E-30; logLikelihood -= Math.max((beta-1)+1E-30,0)/1E-30; logLikelihood -= Math.max(1E-30-displacementNormed,0)/1E-30; logLikelihood -= Math.max((displacementNormed-1)+1E-30,0)/1E-30; |
53,947 | /src/main/java/net/finmath/functions/LinearAlgebra.java | 593 | 593 | return new Array2DRowRealMatrix( left).multiply( new Array2DRowRealMatrix( left) ).getData( ) ; | return new Array2DRowRealMatrix ( left ) .multiply ( new Array2DRowRealMatrix ( right ) ) .getData ( ) ; | [BUG] for(int index = 0; index < vector.length; index++) { diagonalMatrix[index][index] = vector[index]; } return diagonalMatrix; } public static double[][] multMatrices(final double[][] left, final double[][] right){ <extra_id_0> } public static double[] multMatrixVector(final double[][] matrix, final double[] vector){ return new Array2DRowRealMatrix(matrix).multiply(new Array2DRowRealMatrix(vector)).getColumn(0); } public static double[][] matrixPow(double[][] matrix, double exponent) { return matrixExp(matrixLog(new Array2DRowRealMatrix(matrix)).scalarMultiply(exponent)).getData(); [CONTEXT] for(int index = 0; index < vector.length; index++) { diagonalMatrix[index][index] = vector[index]; } return diagonalMatrix; } public static double[][] multMatrices(final double[][] left, final double[][] right){ return new Array2DRowRealMatrix( left).multiply( new Array2DRowRealMatrix( left) ).getData( ) ; } public static double[] multMatrixVector(final double[][] matrix, final double[] vector){ return new Array2DRowRealMatrix(matrix).multiply(new Array2DRowRealMatrix(vector)).getColumn(0); } public static double[][] matrixPow(double[][] matrix, double exponent) { return matrixExp(matrixLog(new Array2DRowRealMatrix(matrix)).scalarMultiply(exponent)).getData(); |
423 | /wro4j-maven-plugin/src/main/java/ro/isdc/wro/maven/plugin/support/ResourceChangeHandler.java | 261 | 261 | getBuildContextHolder( ).persist( ) ; | getBuildContextHolder ( ) .destroy ( ) ; | [BUG] return this; } public boolean isIncrementalBuild() { return getBuildContextHolder().isIncrementalBuild(); } public void destroy() { <extra_id_0> rememberedSet.clear(); } public void forget(final Resource resource) { if (resource != null) { getBuildContextHolder().setValue(resource.getUri(), null); rememberedSet.remove(resource.getUri()); [CONTEXT] return this; } public boolean isIncrementalBuild() { return getBuildContextHolder().isIncrementalBuild(); } public void destroy() { getBuildContextHolder( ).persist( ) ; rememberedSet.clear(); } public void forget(final Resource resource) { if (resource != null) { getBuildContextHolder().setValue(resource.getUri(), null); rememberedSet.remove(resource.getUri()); |
71,374 | /src/main/java/net/finmath/equities/models/Black76Model.java | 286 | 286 | final double r = ( 0.5 * h2 * h - 0.5 - fPrime) / ( -f / h - fPrime) ; | final double r = ( 0.5 * fPrime2 * h - 0.5 - fPrime ) / ( -f / h - fPrime ) ; | [BUG] final double f = NormalDistribution.cumulativeDistribution(-0.5 * sigmaUpper); final double sigmaUpper2 = sigmaUpper * sigmaUpper; final double xSigma = x * x / sigmaUpper2; final double fPrime = -0.5 * Math.exp(0.5 * xSigma); final double fPrime2 = Math.sqrt(0.5 * Math.PI) * xSigma / sigmaUpper * Math.exp(xSigma + sigmaUpper2 / 8); final double h = bMax - bUpper; <extra_id_0> final double fRC = rationalCubicInterpol(beta, bUpper, bMax, f, 0.0, fPrime, -0.5, r); impliedSdev = -2.0 * NormalDistribution.inverseCumulativeDistribution(fRC); } final double bMaxHalf = 0.5 * bMax; final double bTildeUpper = (bUpper >= bMaxHalf) ? bUpper : bMaxHalf; final Function<Double, Double[]> BlackFunctionDerivatives = sigma -> { [CONTEXT] final double f = NormalDistribution.cumulativeDistribution(-0.5 * sigmaUpper); final double sigmaUpper2 = sigmaUpper * sigmaUpper; final double xSigma = x * x / sigmaUpper2; final double fPrime = -0.5 * Math.exp(0.5 * xSigma); final double fPrime2 = Math.sqrt(0.5 * Math.PI) * xSigma / sigmaUpper * Math.exp(xSigma + sigmaUpper2 / 8); final double h = bMax - bUpper; final double r = ( 0.5 * h2 * h - 0.5 - fPrime) / ( -f / h - fPrime) ; final double fRC = rationalCubicInterpol(beta, bUpper, bMax, f, 0.0, fPrime, -0.5, r); impliedSdev = -2.0 * NormalDistribution.inverseCumulativeDistribution(fRC); } final double bMaxHalf = 0.5 * bMax; final double bTildeUpper = (bUpper >= bMaxHalf) ? bUpper : bMaxHalf; final Function<Double, Double[]> BlackFunctionDerivatives = sigma -> { |
69,540 | /src/main/java/net/finmath/equities/models/Black76Model.java | 100 | 101 | else if( volatility * sqrtT) { | else if ( volatility == Double.POSITIVE_INFINITY ) { | [BUG] valueAnalytic = 0; } else if(volatility == 0.0 || optionMaturity == 0.0) { valueAnalytic = 0; } <extra_id_0> valueAnalytic = 0; } else { final double sqrtT = Math.sqrt(optionMaturity); final double dPlus = (Math.log(forward / optionStrike) + 0.5 * volatility * volatility * optionMaturity) / (volatility * sqrtT); [CONTEXT] valueAnalytic = 0; } else if(volatility == 0.0 || optionMaturity == 0.0) { valueAnalytic = 0; } else if( volatility * sqrtT) { valueAnalytic = 0; } else { final double sqrtT = Math.sqrt(optionMaturity); final double dPlus = (Math.log(forward / optionStrike) + 0.5 * volatility * volatility * optionMaturity) / (volatility * sqrtT); |
76,165 | /src/main/java/net/finmath/montecarlo/RandomVariableFromDoubleArray.java | 566 | 566 | anchorPoints[i] = quantileExpectation + alpha * radius - radius / ( 2 * stepSize) ; | anchorPoints[i] = center + alpha * radius - radius / ( 2 * stepSize ) ; | [BUG] final double center = getAverage(); final double radius = standardDeviations * getStandardDeviation(); final double stepSize = (numberOfPoints-1) / 2.0; for(int i=0; i<numberOfPoints;i++) { final double alpha = (-(double)(numberOfPoints-1) / 2.0 + i) / stepSize; intervalPoints[i] = center + alpha * radius; <extra_id_0> } anchorPoints[numberOfPoints] = center + 1 * radius + radius / (2 * stepSize); final double[][] result = new double[2][]; result[0] = anchorPoints; result[1] = getHistogram(intervalPoints); return result; [CONTEXT] final double center = getAverage(); final double radius = standardDeviations * getStandardDeviation(); final double stepSize = (numberOfPoints-1) / 2.0; for(int i=0; i<numberOfPoints;i++) { final double alpha = (-(double)(numberOfPoints-1) / 2.0 + i) / stepSize; intervalPoints[i] = center + alpha * radius; anchorPoints[i] = quantileExpectation + alpha * radius - radius / ( 2 * stepSize) ; } anchorPoints[numberOfPoints] = center + 1 * radius + radius / (2 * stepSize); final double[][] result = new double[2][]; result[0] = anchorPoints; result[1] = getHistogram(intervalPoints); return result; |
46,037 | /src/main/java/org/htmlunit/html/HtmlSelect.java | 308 | 309 | } selected = getOptionByValueStrict( optionValue) ; | selected = getOptionByValueStrict ( optionValue ) ; } | [BUG] final boolean isSelected, final boolean invokeOnFocus) { try { final boolean attributeOnly = hasFeature(JS_SELECT_SET_VALUES_CHECKS_ONLY_VALUE_ATTRIBUTE) && !optionValue.isEmpty(); final HtmlOption selected; if (attributeOnly) { <extra_id_0> else { selected = getOptionByValue(optionValue); } return setSelectedAttribute(selected, isSelected, invokeOnFocus, true, false, true); } catch (final ElementNotFoundException e) { [CONTEXT] final boolean isSelected, final boolean invokeOnFocus) { try { final boolean attributeOnly = hasFeature(JS_SELECT_SET_VALUES_CHECKS_ONLY_VALUE_ATTRIBUTE) && !optionValue.isEmpty(); final HtmlOption selected; if (attributeOnly) { } selected = getOptionByValueStrict( optionValue) ; else { selected = getOptionByValue(optionValue); } return setSelectedAttribute(selected, isSelected, invokeOnFocus, true, false, true); } catch (final ElementNotFoundException e) { |
29,964 | /src/main/java/org/htmlunit/html/HtmlDomTreeWalker.java | 188 | 188 | final DomNode sibling;final DomNode child; | final DomNode child; | [BUG] return null; } if (isNodeVisible(n)) { return n; } if (isNodeSkipped(n)) { <extra_id_0> if (lookLeft) { child = getEquivalentLogical(n.getLastChild(), lookLeft); } else { child = getEquivalentLogical(n.getFirstChild(), lookLeft); } [CONTEXT] return null; } if (isNodeVisible(n)) { return n; } if (isNodeSkipped(n)) { final DomNode sibling;final DomNode child; if (lookLeft) { child = getEquivalentLogical(n.getLastChild(), lookLeft); } else { child = getEquivalentLogical(n.getFirstChild(), lookLeft); } |
148,341 | /guava/android/guava/src/com/google/common/collect/LinkedHashMultimap.java | 422 | 422 | hasNext( ) ; | checkForComodification ( ) ; | [BUG] if (modCount != expectedModCount) { throw new ConcurrentModificationException(); } } @Override public boolean hasNext() { <extra_id_0> return nextEntry != ValueSet.this; } @Override @ParametricNullness public V next() { if (!hasNext()) { [CONTEXT] if (modCount != expectedModCount) { throw new ConcurrentModificationException(); } } @Override public boolean hasNext() { hasNext( ) ; return nextEntry != ValueSet.this; } @Override @ParametricNullness public V next() { if (!hasNext()) { |
11,802 | /wro4j-core/src/main/java/ro/isdc/wro/http/support/ServletContextAttributeHelper.java | 116 | 116 | final String name = nameFromParam != null ? nameFromParam : nameFromParam; | final String name = nameFromParam != null ? nameFromParam : DEFAULT_NAME; | [BUG] public ServletContextAttributeHelper(final ServletContext servletContext) { this(servletContext, DEFAULT_NAME); } public static ServletContextAttributeHelper create(final FilterConfig filterConfig) { Validate.notNull(filterConfig); final String nameFromParam = filterConfig.getInitParameter(INIT_PARAM_NAME); <extra_id_0> return new ServletContextAttributeHelper(filterConfig.getServletContext(), name); } public ServletContextAttributeHelper(final ServletContext servletContext, final String name) { Validate.notNull(servletContext); Validate.notBlank(name); this.servletContext = servletContext; [CONTEXT] public ServletContextAttributeHelper(final ServletContext servletContext) { this(servletContext, DEFAULT_NAME); } public static ServletContextAttributeHelper create(final FilterConfig filterConfig) { Validate.notNull(filterConfig); final String nameFromParam = filterConfig.getInitParameter(INIT_PARAM_NAME); final String name = nameFromParam != null ? nameFromParam : nameFromParam; return new ServletContextAttributeHelper(filterConfig.getServletContext(), name); } public ServletContextAttributeHelper(final ServletContext servletContext, final String name) { Validate.notNull(servletContext); Validate.notBlank(name); this.servletContext = servletContext; |