lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <>
Subject RE: Strange error with IBM Java 5
Date Sun, 26 Sep 2010 04:09:13 GMT
This error also happened with an older Sun javac. This crashed our Hudson
build, too, until we upgraded to latest 1.5 version. But in my opinion, we
should remove any annotation from the extended for-loop. And you are right
the Suppress is no longer needed J



Uwe Schindler

H.-H.-Meier-Allee 63, D-28213 Bremen




From: Shai Erera [] 
Sent: Saturday, September 25, 2010 1:58 PM
Subject: Strange error with IBM Java 5



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 (
 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$AnnotationBuilder.visitArray(TreeMaker.ja
    [javac]     at$Array.accept(
    [javac]     at$AnnotationBuilder.translate(TreeMaker.jav


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; 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/
--- lucene/src/test/org/apache/lucene/search/
(revision 1001313)
+++ lucene/src/test/org/apache/lucene/search/
(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) {
-        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 :).


View raw message