Bug 29213 - Should check the visibility of the array type before calling a method
Summary: Should check the visibility of the array type before calling a method
Status: VERIFIED FIXED
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: 2.1 M5   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-09 10:46 EST by Olivier Thomann CLA
Modified: 2003-02-10 06:47 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.