Bug 89347 - [compiler] public constructor of protected inner class invisible in subclass
Summary: [compiler] public constructor of protected inner class invisible in subclass
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 major with 1 vote (vote)
Target Milestone: 3.2 RC1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-29 09:29 EST by Frank Cornelissen CLA
Modified: 2006-04-13 13:10 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 Frank Cornelissen CLA 2005-03-29 09:29:12 EST
The following two java files will generate the error on the file user.BugUser that InternalInfo$ is not a 
type. However, it is defined inside the file definer.BugContainer as a protected inner class. These 
classes will compile and run with sun jdk java (tested on macosx 1.4.2_05 and linux 1.4.2_06). This 
happens both with 3.0.0 and 3.0.2

-------------------
package definer;
public abstract class BugContainer {
	protected static class InternalInfo$ {
		public InternalInfo$() {}
	}
	abstract protected InternalInfo$ getInfo();
}
---------------------
package user;

import definer.BugContainer;

public class BugUser extends BugContainer{
	protected InternalInfo$ getInfo() {
		return new InternalInfo$();
	}
}
Comment 1 Tim Rob CLA 2005-04-13 09:52:49 EDT
The issue is also reproducable on Eclipse 3.1.0M6. 
It happens only when BugUser is compiled after BugContainer. It seems to be an
issue in the compiler.
If the "$" is removed from the "InternalInfo$" the problem is gone.
Comment 2 Frank Cornelissen CLA 2005-04-15 06:16:47 EDT
changed verfsion field to reflect Tims obserrvation above
Comment 3 Frederic Fusier CLA 2005-06-08 11:29:14 EDT
Still happens using build N20050608-0010.
Set version filed back to 3.0 as this problem was discovered on 3.0 version...
Comment 4 Philipe Mulet CLA 2006-03-30 08:46:30 EST
Issue occurs only when compiling BugUser against binary form of BugContainer.
Added InnerEmulationTest#test127-128.
Comment 5 Philipe Mulet CLA 2006-03-30 10:26:22 EST
Problem comes from poor decoding of source name in this scenario. IBinaryType doesn't surface the inner name of member, and heuristic doesn't work.

Adding IBinaryType#getSourceName() to hide the magic, and allow classfile reader to simply surface the inner source name.
Comment 6 Philipe Mulet CLA 2006-03-31 06:52:21 EST
Added IBinaryType#getSourceName() to surface the real info from classfile.
Fixed
Comment 7 Maxime Daniel CLA 2006-04-13 13:10:27 EDT
Verified for 3.2 RC1 using Build id: I20060413-0010.