Bug 29213

Summary: Should check the visibility of the array type before calling a method
Product: [Eclipse Project] JDT Reporter: Olivier Thomann <Olivier_Thomann>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.1   
Target Milestone: 2.1 M5   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Olivier Thomann CLA 2003-01-09 10:46:30 EST
Using 0107, we don't check the visibility of the array type before a message send.

Test case:
[package pkg;
public class A1 {
    public static A[] array;
    static class A {}
}]
[class A {
    String s = pkg.A1.array.toString();
}]
1) Compile these sources.
2) No error reported.

Jikes 1.18 and javac 1.4.1 report a visibility problem on pkg.A1.array.
A.java:2: toString() in java.lang.Object is not defined in a public class or
interface; cannot be accessed from outside package
    String s = pkg.A1.array.toString();
                           ^
1 error

Found 1 semantic error compiling "D:/temp/A.java":

     2.     String s = pkg.A1.array.toString();
                       ^----------^
*** Semantic Error: The type "pkg.A1$A[]" has default access and is not
accessible here.
Comment 1 Philipe Mulet CLA 2003-01-10 05:54:07 EST
Fixed in latest, also added support for reporting visibility issue against 
receiver type.
Comment 2 David Audel CLA 2003-02-10 06:47:19 EST
Verified.