Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Hammer2020-12-06 16:29:24 +0000
committerMickael Istria2022-03-17 17:50:16 +0000
commitbfbc401841d36d3505d2b1e3aa63bc3c8449b409 (patch)
tree34687474ea7c4a939a9000a1b222dd21465daa1c
parent01ef7d3bf1afee97848cbc0db42a1fc01cfea140 (diff)
downloadeclipse.platform.ua-master.tar.gz
eclipse.platform.ua-master.tar.xz
eclipse.platform.ua-master.zip
Bug: calls equals(Object) on StringBuilder and StringHEADI20220318-0220I20220317-1800master
Call to StringBuilder.equals(String) in org.apache.lucene.demo.html.HTMLParser.addText(String) This method calls equals(Object) on two references of different class types and analysis suggests they will be to objects of different classes at runtime. Further, examination of the equals methods that would be invoked suggest that either this call will always return false, or else the equals method is not be symmetric (which is a property required by the contract for equals in class Object). Rank: Scariest (1), confidence: High Pattern: EC_UNRELATED_TYPES Type: EC, Category: CORRECTNESS (Correctness) Change-Id: Iba0ddd0564ceee8cf1c176aba580c279689d1068 Signed-off-by: Carsten Hammer <carsten.hammer@t-online.de> Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.ua/+/173460 Tested-by: Platform Bot <platform-bot@eclipse.org> Reviewed-by: Mickael Istria <mistria@redhat.com>
-rw-r--r--org.eclipse.help.base/src_demo/org/apache/lucene/demo/html/HTMLParser.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/org.eclipse.help.base/src_demo/org/apache/lucene/demo/html/HTMLParser.java b/org.eclipse.help.base/src_demo/org/apache/lucene/demo/html/HTMLParser.java
index f6ad4b73a..1b62e11dd 100644
--- a/org.eclipse.help.base/src_demo/org/apache/lucene/demo/html/HTMLParser.java
+++ b/org.eclipse.help.base/src_demo/org/apache/lucene/demo/html/HTMLParser.java
@@ -126,7 +126,7 @@ InterruptedException {
if (!inHeading || summary.length() > 0) {
addToSummary(text);
}
- if (!titleComplete && !title.equals("")) { // finished title //$NON-NLS-1$
+ if (!titleComplete && !title.toString().isEmpty()) { // finished title
synchronized(this) {
titleComplete = true; // tell waiting threads
notifyAll();

Back to the top