Bug 36012 - Multiple package private classes in one java file generates error
Summary: Multiple package private classes in one java file generates error
Status: VERIFIED DUPLICATE of bug 32505
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: 3.2 M4   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-03 06:23 EST by Frank Cornelissen CLA
Modified: 2007-04-02 07:25 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 Frank Cornelissen CLA 2003-04-03 06:23:09 EST
Create a project with a seperate bin and source folder (the errors are weirder
when they are the same).

Create package x
Create java file named A with contents

  package x;

  class A {
  }

  class B {
  }

create java file C with contents

  package x;

  class C {
    B b;
  }

The last file will generate error "B cannot be resolved (or is not a valid type)  
for the field C.b"

I think this should be allowed...
Comment 1 Philipe Mulet CLA 2003-04-03 07:08:19 EST
Secondary types are legite, but discouraged. Incrementally they may not be 
found by compiling tools, which only expect to look types inside files with 
matching names. 

e.g. use javac and only mention x/A.java on the classpath (not as part of the 
compiled file on the command line), and you'll see that B won't be resolved.

We may want to improve this down the road, but we don't want to become slow 
just for this case.
Comment 2 Philipe Mulet CLA 2003-04-03 07:09:56 EST

*** This bug has been marked as a duplicate of 32505 ***
Comment 3 Frederic Fusier CLA 2007-04-02 07:25:49 EDT
Verified for 3.2 using M20060629-1905.