Bug 66319 - Compiler compliance for 1.3 violated in RC1
Summary: Compiler compliance for 1.3 violated in RC1
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 major (vote)
Target Milestone: 3.0 RC2   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-09 11:15 EDT by Peter Koves CLA
Modified: 2004-06-09 19:32 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Koves CLA 2004-06-09 11:15:36 EDT
RC1 compiles the following without an error with compiler compliance level set 
to 1.3:

import java.util.Hashtable;
public class EclipseCompilerBug {
  static { hash = new Hashtable(); }
  private static final Hashtable hash;
}

1.3.1 javac gives:
EclipseCompilerBug.java:25: illegal forward reference
                hash = new Hashtable();
                ^

The same code compiles without error with 1.4.2 and 1.5.0-B2 so this is indeed 
a compliance problem.
Comment 1 Olivier Thomann CLA 2004-06-09 11:32:19 EDT
I consider this more a bug in javac1.3.1 than a compliance issue. See
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4459133 for further details.
It has been fixed in 1.4.1.

Compliance doesn't mean that we must have the same bugs :-).
Comment 2 Philipe Mulet CLA 2004-06-09 11:56:27 EDT
Indeed we do implement the language spec.
Comment 3 Peter Koves CLA 2004-06-09 18:42:36 EDT
I beg to disagree... 
The question is does eclipse want to be useful or pedantic? At this point it is 
more or less true that if I am not compiling with my ide I am compiling using 
javac. So I think that indeed eclipse should be implementing javac-s bugs as 
part of compliance.

For consider... 
If I can't rely on eclipse to produce the same compilation results as that 
produced by an external build using javac then I have to ask every developer to 
compile all code with javac as well before submission. This is a huge loss in 
productivity. And it does not matter that it is fixed in 1.4.x (which I 
realize). It is very difficult to get a large shop like ours to upgrade (for 
our code a full regression --- which is required if a JDK upgrade is done --- 
is over 6 months).

So to reiterate, I think you need to comply with the de-facto standard (which 
is javac and not the LRS) even if it _is_ buggy.

P.S.: I promise not to reopen this again, but please consider my remarks as 
seriously as they were meant.
Comment 4 Philipe Mulet CLA 2004-06-09 19:32:47 EDT
Again I disagree. We are not reproducing javac bugs. Your point is well taken, 
but the only true solution for you then is to simply use an external Ant tool 
to run javac instead. Then you'll have whatever behavior (even if wrong) you 
want. 

Moreover, javac and Eclipse differ in generated classfiles, and you may 
observe more subtle issues near serialization if using both compilers at same 
time. To be on the safe side, you should stick to one particular version of a 
compiler (since across same compiler versions, bugs are being fixed, and 
behavior is thus altered).

Our compliance level denotes a Java Compliance Kit level not a javac level.