Bug 38088 - package protected classes not recognized properly
Summary: package protected classes not recognized properly
Status: RESOLVED DUPLICATE of bug 36032
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-25 07:18 EDT by Germano Leichsenring CLA
Modified: 2003-05-27 05:00 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 Germano Leichsenring CLA 2003-05-25 07:18:00 EDT
Inner classes which are package protected are not properly recognized; an error
inside eclipse is shown, but the compilation has no problems or warnings.
Example: The following code is not properly recognized but compiles and works
properly.
--- Outer.java
public class Outer {
}
class PackageProtected{
	void print(){
		System.out.println("print()");
	}
}


--- SamePackage.java
public class SamePackage {
	PackageProtected pp;
	public static void main(String[] args) {
		SamePackage sp = new SamePackage();
		sp.pp = new PackageProtected();
		sp.pp.print();
	}
}
Comment 1 Germano Leichsenring CLA 2003-05-25 07:25:47 EDT
Actually, not inner classes, but package protected classes which are inside
another class' file. Big difference.
Comment 2 Rafael Chaves CLA 2003-05-26 10:02:59 EDT
Moving to JDT-UI.
Comment 3 Dirk Baeumer CLA 2003-05-26 14:21:57 EDT
Philippe, any comments.
Comment 4 Philipe Mulet CLA 2003-05-27 04:59:15 EDT
This is a known issue with secondary types which aren't properly detected in 
the Java model resolution. The compiler usually will find them better since all 
types are fed to the compiler at once, but it can occur that compilation would 
fail as well, though the case is not so common.

Workaround is to extract secondary type in separate file with proper name. We 
want to support this scenario in the future though.
Comment 5 Philipe Mulet CLA 2003-05-27 05:00:04 EDT

*** This bug has been marked as a duplicate of 36032 ***