lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Terry Steichen" <te...@net-frame.com>
Subject Re: cvs commit: jakarta-lucene/src/java/org/apache/lucene/search FieldSortedHitQueue.java
Date Wed, 17 Mar 2004 20:09:30 GMT
Tim,

I think your patch program inadvertently inserted some placeholder code in
this module.  I just tried the latest CVS build and got a whole new set of
errors.  When I cleaned it up manually, what it did was implement the patch
you had supplied earlier.

However, bug 27638 is different: it was what happened *after* your patch was
applied.  I believe (as does Doug, I think) that the sorting code has other
Java 1.4 dependencies (which may be a lot more difficult to work around).

Regards,

Terry

PS: Doug's comment was:  "It looks to me like the new hit sorting code also
relies on this same compiler
feature (initializer code in anonymous classes can throw exceptions).  So my
guess is that, e.g., IntegerSortedHitQueue and StringSortedHitQueue also
won't
compile in 1.3 or earlier.  Is that correct? "



----- Original Message -----
From: <tjones@apache.org>
To: <lucene-dev@jakarta.apache.org>
Sent: Wednesday, March 17, 2004 1:21 PM
Subject: cvs commit: jakarta-lucene/src/java/org/apache/lucene/search
FieldSortedHitQueue.java


> oops - the commit email bounced because I wasn't signed up.  but here it
is:
>
> Date: 17 Mar 2004 18:11:02 -0000
> Message-ID: <20040317181102.93750.qmail@minotaur.apache.org>
> From: tjones@apache.org
> To: jakarta-lucene-cvs@apache.org
> Subject: cvs commit: jakarta-lucene/src/java/org/apache/lucene/search
FieldSortedHitQueue.java
> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
>
> tjones      2004/03/17 10:11:02
>
>   Modified:    src/java/org/apache/lucene/search FieldSortedHitQueue.java
>   Log:
>   remove java 1.4 dependent code in order to maintain java 1.3 level
compatibility
>
>   Revision  Changes    Path
>   1.5       +25 -4
jakarta-lucene/src/java/org/apache/lucene/search/FieldSortedHitQueue.java
>
>   Index: FieldSortedHitQueue.java
>   ===================================================================
>   RCS file:
/home/cvs/jakarta-lucene/src/java/org/apache/lucene/search/FieldSortedHitQue
ue.java,v
>   retrieving revision 1.4
>   retrieving revision 1.5
>   diff -u -r1.4 -r1.5
>   --- FieldSortedHitQueue.java 27 Feb 2004 12:29:31 -0000 1.4
>   +++ FieldSortedHitQueue.java 17 Mar 2004 18:11:02 -0000 1.5
>   @@ -23,7 +23,6 @@
>
>    import java.io.IOException;
>    import java.util.Hashtable;
>   -import java.util.regex.Pattern;
>
>    /**
>     * Expert: Base class for collecting results from a search and sorting
>   @@ -84,10 +83,14 @@
>        protected static final Hashtable fieldCache = new Hashtable();
>
>    /** The pattern used to detect integer values in a field */
>   - protected static final Pattern pIntegers = Pattern.compile
("[0-9\\-]+");
>   + /** removed for java 1.3 compatibility
>   + protected static final Pattern pIntegers = Pattern.compile
("[0-9\\-]+");
>   + **/
>
>    /** The pattern used to detect float values in a field */
>   - protected static final Pattern pFloats = Pattern.compile
("[0-9+\\-\\.eEfFdD]+");
>   + /** removed for java 1.3 compatibility
>   + protected static final Object pFloats = Pattern.compile
("[0-9+\\-\\.eEfFdD]+");
>   + **/
>
>
>    /**
>   @@ -187,12 +190,30 @@
>    if (term.field() == field) {
>    String termtext = term.text().trim();
>
>   + /**
>   + * Java 1.4 level code:
>   +
>    if (pIntegers.matcher(termtext).matches())
>    return IntegerSortedHitQueue.comparator (reader, enumerator, field);
>
>    else if (pFloats.matcher(termtext).matches())
>    return FloatSortedHitQueue.comparator (reader, enumerator, field);
>   + */
>
>   + // Java 1.3 level code:
>   + try {
>   + Integer.parseInt (termtext);
>   + return IntegerSortedHitQueue.comparator (reader, enumerator, field);
>   + } catch (NumberFormatException nfe) {
>   + // nothing
>   + }
>   + try {
>   + Float.parseFloat (termtext);
>   + return FloatSortedHitQueue.comparator (reader, enumerator, field);
>   + } catch (NumberFormatException nfe) {
>   + // nothing
>   + }
>   +
>    return StringSortedHitQueue.comparator (reader, enumerator, field);
>
>    } else {
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-dev-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message