Bug 142135 - [model][classpath] Classpath containers and variable entries
Summary: [model][classpath] Classpath containers and variable entries
Status: VERIFIED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Target Milestone: 3.3 M5   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2006-05-16 23:01 EDT by Dimitry E Voytenko CLA
Modified: 2007-03-29 04:57 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry E Voytenko CLA 2006-05-16 23:01:06 EDT
Per IClasspathContainer JavaDoc:
  "... a classpath container can neither reference further classpath containers or classpath variables."

What's the reasoning behind this? It's not clear what are the limitations in case of variables. B/c variables are not allowed it's hard to reuse classpath container's entries in the sharable fasion.
Comment 1 Philipe Mulet CLA 2006-05-17 04:51:25 EDT
This was a design decision from the time we introduced classpath containers; to make them simple, and avoid complex nesting situations (eg. cycles...).
Nowadays, we are seeing more and more opportunities where we could improve by removing this limitation.

This is why we are considering removing the limitation in next release (3.3).
Comment 2 Dimitry E Voytenko CLA 2006-05-17 12:38:03 EDT
I see. This makes sense. Thanks for the prompt response.
Comment 3 Eugene Kuleshov CLA 2006-09-14 00:28:41 EDT
How about allowing these containers to have source folder entries? Bug 100508
Comment 4 Jerome Lanneluc CLA 2007-01-10 10:08:59 EST
Martin, if we added the support for nesting containers inside container, would the Package Explorer be affected ? I.e. would you want to show the nested containers as children of the parent container ?
Comment 5 Martin Aeschlimann CLA 2007-01-10 10:31:26 EST
Yes, at least the build path dialog and in the package explorer would be affected. Presenting the containers in their nested relationship definitly makes sense.
Comment 6 Eugene Kuleshov CLA 2007-01-10 12:56:43 EST
Is there are any chance to support source entries inside container? Can anyone please comment on this?
Comment 7 Jerome Lanneluc CLA 2007-01-10 12:59:58 EST
Actually, thinking more about it this would be a breaking change. From the existing API, clients can rightly assume that the only entry kinds returned by IClasspathContainer#getClasspathEntries() are CPE_LIBRARY and CPE_PROJECT. If we add other kinds, the code of this clients will surely break. We are not allowed to break existing clients, so we will not change the existing API and implementation.
Comment 8 Eugene Kuleshov CLA 2007-01-10 13:04:06 EST
Jerome, please reconsider. 

To keep API compatibility you can add another method to container that would allow to return entries other then CPE_LIBRARY and CPE_PROJECT. So, new clients would use that method instead of the old one.
Comment 9 Jerome Lanneluc CLA 2007-01-10 13:08:48 EST
Since existing clients implement IClasspathContainer, it is not possible to add a new method to this interface as this would break the binary compatibility.
Comment 10 Eugene Kuleshov CLA 2007-01-10 14:41:30 EST
(In reply to comment #9)
> Since existing clients implement IClasspathContainer, it is not possible to add
> a new method to this interface as this would break the binary compatibility.

Jerome, Eclipse already have strategy for dealing with that. One of the popular options is to put new method into new IClasspathContainer2 interface.
Comment 11 Olivier Thomann CLA 2007-02-05 11:19:15 EST
Verified for 3.3M5 using I20070205-0009.
Comment 12 Eugene Kuleshov CLA 2007-02-05 11:38:15 EST
What is verified? Have you actually implemented it? Nobody commented on suggestion to use additional interface...
Comment 13 Olivier Thomann CLA 2007-02-05 11:43:33 EST
Since it was fixed as WONTFIX, I verified that status is reflected in this build.
Jérôme, could you please comment on the comment 10?
Comment 14 Jerome Lanneluc CLA 2007-02-05 12:06:01 EST
Eugene, feel free to reopen this bug and provide a patch if this is important for you.