Bug: calls equals(Object) on StringBuilder and String 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>
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 f6ad4b7..1b62e11 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 @@ 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();