Bug 10701

Summary: Undefined method when compiling using JDK 1.4
Product: [Eclipse Project] JDT Reporter: Philipe Mulet <philippe_mulet>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P1 CC: philipborlin, preuss
Version: 2.0   
Target Milestone: 2.0 M4   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Philipe Mulet CLA 2002-03-04 13:24:52 EST
Build 20020226

The following test case should compile, but Eclipse compiler rejects it:

import javax.swing.AbstractAction;

public class Main {

public static void main(String[] args) {
  AbstractAction myAction = null;
  myAction.actionPerformed(null); // SHOULDN'T BE ANY COMPILE ERROR
}
}
Comment 1 Olivier Thomann CLA 2002-03-04 15:20:36 EST
This is due to the removal of default abstract methods in rt.jar provided with the JDK1.4.
Comment 2 Philipe Mulet CLA 2002-03-05 05:03:58 EST
Indeed, 1.4 class libraries are compiled for target 1.2 or better (as opposed 
to 1.3 classlibs which were compiled for 1.1 targets).
This means that no default abstract method is generated any longer, and this 
can disturb some compiler lookup semantics since
the reference is now different.

Eclipse is in 1.3 mode by default, and soon a compiler setting will allow you 
to turn it into a 1.4 compiler (which it is already, simply missing the UI for 
setting the option).

If using Javac, you will notice that it refuses alltogether to compile against 
a 1.4 library:

d:\>javac -bootclasspath d:\jdk1.4\jre\lib\rt.jar Main.java
Main.java:5: cannot access java.lang.Object
bad class file: d:\jdk1.4\jre\lib\rt.jar(java/lang/Object.class)
class file has wrong version 48.0, should be 47.0
Please remove or make sure it appears in the correct subdirectory of the 
classpath.
public static void main(String[] args) {
                        ^
1 error
Comment 3 Philipe Mulet CLA 2002-03-05 05:50:35 EST
Closing, this is a legite failure until 1.4 setting is available (there is a 
JDT/UI request for this, see http://bugs.eclipse.org/bugs/show_bug.cgi?id=9510).
Comment 4 Olivier Thomann CLA 2002-03-14 16:15:38 EST
*** Bug 11406 has been marked as a duplicate of this bug. ***
Comment 5 Philipe Mulet CLA 2002-03-15 04:24:23 EST
*** Bug 11435 has been marked as a duplicate of this bug. ***
Comment 6 Philipe Mulet CLA 2002-04-30 06:59:26 EDT
As per bug 11435, we did fix our compiler behavior to be able to deal with 1.4 
libraries in 1.3 mode.