Bug 21864

Summary: Associate package hierarchy with top-level source directory
Product: [Eclipse Project] JDT Reporter: Scott Leschke <scott.leschke>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3    
Version: 2.0   
Target Milestone: 2.1 M3   
Hardware: All   
OS: All   
Whiteboard:

Description Scott Leschke CLA 2002-07-24 13:55:38 EDT
When you create a Java project and identify your top level source directories, 
it would be nice to be able to associate an implied package hierarchy (ex. 
com.mycompany.myproject) with the folder. JDT seems to demand that the source 
structure mirrors the build structure. While this certainly isn't fatal, having 
2 or 3 levels of empty directories just to satisfy the compiler is a pain.

Please correct me if there is some way to acheive this effect that I'm unaware 
of.
Comment 1 Kent Johnson CLA 2002-07-24 14:20:36 EDT
Sorry I'm not sure I'm following you... do you want to say the source 
folder 'src' is equal to 'a.b.c'? A subfolder 'd' should be interpreted as a 
package 'a.b.c.d'?
Comment 2 Scott Leschke CLA 2002-07-24 14:32:28 EDT
Yes, that's exactly what I mean.
Comment 3 Philipe Mulet CLA 2002-07-25 05:10:09 EDT
I am not fan of the proposal. I think you simply need a better UI to 
hide/collapse these uninteresting packages.

If you use the package explorer, it does hide them though. Why are these 
folders bothering you ?

Note that other compilers have the same behavior (e.g. try to compile X.java 
against a bunch of sources on your classpath. The bunch of sources has to be 
organized properly as well).

Comment 4 Scott Leschke CLA 2002-07-25 13:13:38 EDT
I agree it's a minor issue and that yes, the Package Explorer does show them 
collapsed, which is what makes this tolerable, but it just seems silly to have 
to have 3 levels of nothing just to satify the IDE. Sun's compiler doesn't 
really care as long as your compiling into a different destination from the 
source, which we're doing.

No big deal though. Just a minor annoyance. I will admit to that. We've already 
broken down and added the layers of nothing. I just thought I'd throw it out 
there as a possible enhancement.
Comment 5 Philipe Mulet CLA 2002-11-13 04:05:24 EST
Your request makes sense, but in the light of an incremental compiler, we need 
things to be located at guessable locations to perform correctly.

Javac or other compiler tools will not care about file locations if you pass 
them all onto the command line, but as soon as these sources are to be found 
through the classpath, they'd better be nested in package directory structures.

We are no different in enforcing this rule everywhere.
As per your last comment, I will close this defect, since it works as designed.