Bug 26617 - A class from an unnamed package is visible to classes in named packages
Summary: A class from an unnamed package is visible to classes in named packages
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: unknown
: P3 normal
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
URL:
Keywords: accepts-invalid
Depends on: 28067
Blocks: 13607
  Show dependency treegraph
 
Reported: 2006-03-09 10:14 UTC by Ranjit Mathew
Modified: 2007-01-09 20:48 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-03-15 16:51:13


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ranjit Mathew 2006-03-09 10:14:44 UTC
GCJ allows classes in named packages to see classes in unnamed packages.

For example:

---- ./Snafu.java ----
public class Snafu { }
----------------------

---- ./foo/Bar.java ----
package foo;
// import Snafu;
public class Bar
{
  Snafu junk;
}
------------------------

Note that GCJ accepts the code in "foo/Bar.java" with
or without the line commenting out the import declaration.

Both Jikes 1.22 and Sun's JDK 1.5.0_05 reject this
code.
Comment 1 Andrew Pinski 2006-03-15 16:51:13 UTC
Confirmed.
Comment 2 Tom Tromey 2007-01-09 20:48:22 UTC
All gcj front end bugs have been fixed by the gcj-eclipse branch merge.
I'm mass-closing the affected PRs.
If you believe one of these was closed in error, please reopen it
with a note explaining why.
Thanks.