Bug 134839 - [compiler] Incorrect compile errors reported in 1.3 compliance level
Summary: [compiler] Incorrect compile errors reported in 1.3 compliance level
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 RC1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 134476 135523 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-04-04 14:57 EDT by Fares Abdullah CLA
Modified: 2006-04-27 04:15 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fares Abdullah CLA 2006-04-04 14:57:47 EDT
Eclipse 3.2M6 on Windows XP SP2 (eclipse-SDK-3.2M6-win32.zip)
Running on Sun JDK 1.5.0

Add the following two files to a Java project and set its compliance level to 1.3:

public interface MyInterface {
	public void writeToStream();
	public void readFromStream();
}

public abstract class MyClass implements MyInterface {
	public void b() {
	}
	public void a() {
		writeTypeToStream();
	}
	private void writeTypeToStream() {
	}
}


The compiler says that the call to writeTypeToStream() from MyClass.a() is an error because the method doesn't exist. This compiler error goes away if I do things like, but not limited to:
- Delete method b()
- Change the method name, "writeTypeToStream" to something like "c"
- Delete either method from MyInterface
Comment 1 Olivier Thomann CLA 2006-04-04 17:12:59 EDT
I'll investigate.
Comment 2 Philipe Mulet CLA 2006-04-05 07:54:34 EDT
Reproduced. Likely a consequence of sorting methods and -target 1.1.
Comment 3 Philipe Mulet CLA 2006-04-05 08:07:45 EDT
Problem comes from late addition of default abstract methods, which broke the ordering. Fix under testing.
Comment 4 Philipe Mulet CLA 2006-04-05 09:51:29 EDT
This is a regression over 3.2M5, and only affects -target 1.1 case.
Comment 5 Philipe Mulet CLA 2006-04-05 09:52:31 EDT
Added LookupTest#test061.
Fixed by re-sorting if necessary when default abstract methods are inserted.
Comment 6 Philipe Mulet CLA 2006-04-05 09:52:44 EDT
Fixed
Comment 7 Philipe Mulet CLA 2006-04-05 09:54:52 EDT
Will post a patch on JDT/Core web page. 
Olivier - pls indicate in this bug, where to find it.
Comment 8 Philipe Mulet CLA 2006-04-05 09:57:59 EDT
*** Bug 134476 has been marked as a duplicate of this bug. ***
Comment 9 Olivier Thomann CLA 2006-04-05 11:37:25 EDT
A patch is available:
See http://www.eclipse.org/jdt/core/r3.2/index.php#UPDATES

Replace the existing jar for jdt/core with this one in the plugins directory of your Eclipse installation directory.
Comment 10 Fares Abdullah CLA 2006-04-06 04:25:26 EDT
The patch works for me. I no longer see the errors.
Comment 11 Olivier Thomann CLA 2006-04-07 09:44:16 EDT
*** Bug 135523 has been marked as a duplicate of this bug. ***
Comment 12 Maxime Daniel CLA 2006-04-13 15:44:03 EDT
Verified for 3.2 RC1 using Build id: I20060413-0010.
Comment 13 Aaron Digulla CLA 2006-04-27 04:15:11 EDT
Verified for bug 134476