You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by ot...@apache.org on 2003/04/16 06:22:40 UTC
cvs commit: jakarta-lucene/src/java/org/apache/lucene/search WildcardTermEnum.java
otis 2003/04/15 21:22:39
Modified: src/java/org/apache/lucene/search WildcardTermEnum.java
Log:
- Cosmetics and Javadocs.
Revision Changes Path
1.5 +11 -3 jakarta-lucene/src/java/org/apache/lucene/search/WildcardTermEnum.java
Index: WildcardTermEnum.java
===================================================================
RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/search/WildcardTermEnum.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- WildcardTermEnum.java 29 Jan 2003 17:18:55 -0000 1.4
+++ WildcardTermEnum.java 16 Apr 2003 04:22:38 -0000 1.5
@@ -75,7 +75,11 @@
boolean fieldMatch = false;
boolean endEnum = false;
- /** Creates new WildcardTermEnum */
+ /**
+ * Creates a new <code>WildcardTermEnum</code>. Passing in a
+ * {@link org.apache.lucene.index.Term} that does not contain a
+ * <code>WILDCARD_CHAR</code> will cause an exception to be thrown.
+ */
public WildcardTermEnum(IndexReader reader, Term term) throws IOException {
super(reader, term);
searchTerm = term;
@@ -85,8 +89,12 @@
int sidx = text.indexOf(WILDCARD_STRING);
int cidx = text.indexOf(WILDCARD_CHAR);
int idx = sidx;
- if (idx == -1) idx = cidx;
- else if (cidx >= 0) idx = Math.min(idx, cidx);
+ if (idx == -1) {
+ idx = cidx;
+ }
+ else if (cidx >= 0) {
+ idx = Math.min(idx, cidx);
+ }
pre = searchTerm.text().substring(0,idx);
preLen = pre.length();
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org