Bug 232174 - [compiler][1.5] Non-existing error is reported for derived classes in different package
Summary: [compiler][1.5] Non-existing error is reported for derived classes in differe...
Status: RESOLVED DUPLICATE of bug 216692
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M5   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-14 15:50 EDT by Branko CLA
Modified: 2008-05-15 06:41 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Branko CLA 2008-05-14 15:50:40 EDT
Build ID: M20080221-1800

Steps To Reproduce:
1. Create the following files in an eclipse project:
//---------- com.b.p1.A.java -------------------------
package com.b.p1;
public class A<K> {
    protected final class Inner {}
}
//---------- com.b.p1.ADerivedSamePkg.java ------------
package com.b.p1;
import java.util.Map;
public class ADerivedSamePkg extends A<Object> {
    protected void someMethod() {
        Map.Entry<String, Inner> some = null;
        Inner x = some.getValue();
    }
}
//---------- com.b.p2.ADerivedDifferentPkg.java ----------
package com.b.p2;
import java.util.Map;
import com.b.p1.A;
public class ADerivedDifferentPkg extends A<Object> {
    protected void someMethod()     {
        Map.Entry<String, Inner> some = null;
        Inner x = some.getValue(); // <-- error in this line
    }
}

2. The line: Inner x = some.getValue();
in class ADerivedDifferentPkg will be flagged as in error:
The type A<K>.Inner is not visible

It shouldn't be, because class ADerivedDifferentPkg derives from A, and class A.Inner is protected, available to all derived classes, not just those in the same package!


More information:
In the Europa fall release this works as expected, i.e. it is not marked as error.
Comment 1 Philipe Mulet CLA 2008-05-15 05:56:42 EDT
Dup of bug 216692.

*** This bug has been marked as a duplicate of bug 216692 ***
Comment 2 Philipe Mulet CLA 2008-05-15 05:58:50 EDT
Fix is available in 3.4 and in 3.3 maintenance branch post 3.3.2.
A patch is posted at: http://www.eclipse.org/jdt/core/r3.3/index.php#UPDATES
(use the 3.3.3 preview)
Comment 3 Philipe Mulet CLA 2008-05-15 06:41:50 EDT
Added GenericTypeTest#testr1329