lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shai Erera <ser...@gmail.com>
Subject Strange error with IBM Java 5
Date Sat, 25 Sep 2010 20:57:32 GMT
Hi

I svn upped today (actually saw this few days ago too), and ran 'ant clean'.
Then from lucene/contrib/benchmark I ran 'ant compile' and hit this:

    [javac] An exception has occurred in the compiler (1.5.0). Please file a
bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport)
after
 checking the Bug Parade for duplicates. Include your program and the
following diagnostic in your report.  Thank you.
    [javac] java.lang.AssertionError: {unused}
    [javac]     at
com.sun.tools.javac.tree.TreeMaker$AnnotationBuilder.visitArray(TreeMaker.java:655)
    [javac]     at
com.sun.tools.javac.code.Attribute$Array.accept(Attribute.java:151)
    [javac]     at
com.sun.tools.javac.tree.TreeMaker$AnnotationBuilder.translate(TreeMaker.java:658)

BUILD FAILED

This only happened w/ IBM Java 5, and didn't happen w/ Sun's 5 or IBM/Sun's
6. I've found this related;
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6297416. Searched the
code for "unused" suppresses and found TestPositionIncrement had this
pattern. So I've committed this to trunk (doesn't happen on 3x 'cause the
Suppress isn't there):

Index: lucene/src/test/org/apache/lucene/search/TestPositionIncrement.java
===================================================================
--- lucene/src/test/org/apache/lucene/search/TestPositionIncrement.java
(revision 1001313)
+++ lucene/src/test/org/apache/lucene/search/TestPositionIncrement.java
(working copy)
@@ -287,12 +287,10 @@
       }
       Collection<byte[]> payloads = pspans.getPayload();
       sawZero |= pspans.start() == 0;
-      for (@SuppressWarnings("unused") byte[] bytes : payloads) {
+      for (byte[] bytes : payloads) {
         count++;
-        if (!VERBOSE) {
-          // do nothing
-        } else {
-          System.out.println("  payload: " + new String((byte[]) bytes));
+        if (VERBOSE) {
+          System.out.println("  payload: " + new String(bytes));
         }
       }
     }

BTW, the Suppress was not necessary because the byte[] is used in the print.

FYI in case you run into it one day :).

Shai

Mime
View raw message