From 14d70e9be71f94f52e4edcb2de3e41a8436d6831 Mon Sep 17 00:00:00 2001
From: Yonik Seeley <yonik@apache.org>
Date: Wed, 21 Mar 2007 13:58:47 +0000
Subject: [PATCH] interned comparison comments

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@520891 13f79535-47bb-0310-9956-ffa450edef68
---
 src/java/org/apache/lucene/search/PrefixFilter.java | 2 +-
 src/java/org/apache/lucene/search/PrefixQuery.java  | 3 ++-
 src/java/org/apache/lucene/search/RangeQuery.java   | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/java/org/apache/lucene/search/PrefixFilter.java b/src/java/org/apache/lucene/search/PrefixFilter.java
index 9771791954b..9358dc76024 100755
--- a/src/java/org/apache/lucene/search/PrefixFilter.java
+++ b/src/java/org/apache/lucene/search/PrefixFilter.java
@@ -70,7 +70,7 @@ abstract class PrefixGenerator implements IdGenerator {
         Term term = enumerator.term();
         if (term != null &&
             term.text().startsWith(prefixText) &&
-            term.field() == prefixField)
+            term.field() == prefixField) // interned comparison
         {
           termDocs.seek(term);
           while (termDocs.next()) {
diff --git a/src/java/org/apache/lucene/search/PrefixQuery.java b/src/java/org/apache/lucene/search/PrefixQuery.java
index 0e3ccdaa28a..bfc6e058414 100644
--- a/src/java/org/apache/lucene/search/PrefixQuery.java
+++ b/src/java/org/apache/lucene/search/PrefixQuery.java
@@ -47,7 +47,8 @@ public class PrefixQuery extends Query {
         Term term = enumerator.term();
         if (term != null &&
             term.text().startsWith(prefixText) &&
-            term.field() == prefixField) {
+            term.field() == prefixField) // interned comparison 
+        {
           TermQuery tq = new TermQuery(term);	  // found a match
           tq.setBoost(getBoost());                // set the boost
           query.add(tq, BooleanClause.Occur.SHOULD);		  // add to query
diff --git a/src/java/org/apache/lucene/search/RangeQuery.java b/src/java/org/apache/lucene/search/RangeQuery.java
index 3e116203553..30e4c405154 100644
--- a/src/java/org/apache/lucene/search/RangeQuery.java
+++ b/src/java/org/apache/lucene/search/RangeQuery.java
@@ -91,7 +91,7 @@ public class RangeQuery extends Query
 
             do {
                 Term term = enumerator.term();
-                if (term != null && term.field() == testField) {
+                if (term != null && term.field() == testField) { // interned comparison
                     if (!checkLower || term.text().compareTo(lowerTerm.text()) > 0) {
                         checkLower = false;
                         if (upperTerm != null) {