Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

LUCENE-1892: Demo HTMLParser compares StringBuffer to an empty String with .equals

Mark Robert Millerf10221e4683c
diff --git a/src/demo/org/apache/lucene/demo/html/HTMLParser.java b/src/demo/org/apache/lucene/demo/html/HTMLParser.java
index db215b0d9a5..06deb5f7a66 100644
--- a/src/demo/org/apache/lucene/demo/html/HTMLParser.java
+++ b/src/demo/org/apache/lucene/demo/html/HTMLParser.java
@@ -128,7 +128,7 @@ InterruptedException {
title.append(text);
else {
addToSummary(text);
- if (!titleComplete && !title.equals("")) { // finished title
+ if (!titleComplete && !(title.length() == 0)) { // finished title
synchronized(this) {
titleComplete = true; // tell waiting threads
notifyAll();
diff --git a/src/demo/org/apache/lucene/demo/html/HTMLParser.jj b/src/demo/org/apache/lucene/demo/html/HTMLParser.jj
index 3e59dffeefb..6cb126ec021 100644
--- a/src/demo/org/apache/lucene/demo/html/HTMLParser.jj
+++ b/src/demo/org/apache/lucene/demo/html/HTMLParser.jj
@@ -155,7 +155,7 @@ InterruptedException {
title.append(text);
else {
addToSummary(text);
- if (!titleComplete && !title.equals("")) { // finished title
+ if (!titleComplete && !(title.length() == 0)) { // finished title
synchronized(this) {
titleComplete = true; // tell waiting threads
notifyAll();