Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 387535

Summary: The classpath container's states are persisted, are used on workspace open, but not on project open
Product: [Eclipse Project] JDT Reporter: Nicolas Lalevée <nicolas.lalevee>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 4.2   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard: stalebug

Description Nicolas Lalevée CLA 2012-08-18 08:49:20 EDT
I have seen this behaviour with the IvyDE classpath container http://ant.apache.org/ivy/ivyde/.
* have a java project with an IvyDE container, properly resolved, with classpath entries.
* restart Eclipse.
* IvyDE get the persisted data and is able to rebuild the classpath without launching any Ivy resolve.
* close the project and reopen.
* persisted data are not read and IvyDE doesn't get thoses: it has to launch a resolve.

I have looked at the JDT classes and debug them. AFAI, here is what is going on workspace open:
* persisted data of the containers get into the "previousSessionContainers" map of the JavaModelManager
* a call of JavaCore.getClasspathContainer (from a ClasspathContainerInitializer for instance) get the persisted state of the container
* the ClasspathContainerInitializer implementation call JavaCore.setClasspathContainer to properly setup the container, which get it removed from previousSessionContainers

So far so good. On project close/reopen now:
* JavaModelManager implements ISaveParticipant and persist the state of the containers
* On reopen, the ClasspathContainerInitializer is called, but JavaCore.getClasspathContainer doesn't get any container, since previousSessionContainers has been cleaned out

So maybe a simple solution would be to listen on project close events and add to "previousSessionContainers" the containers of the closing project ?
Comment 1 Tomasz Zarna CLA 2012-08-20 09:39:16 EDT
(In reply to comment #0)
> So maybe a simple solution would be to listen on project close events and add to
> "previousSessionContainers" the containers of the closing project ?

Nicolas, have you tried hacking that to see if it would actually help?
Comment 2 Nicolas Lalevée CLA 2012-08-22 07:18:31 EDT
Ni I didn't.
Does it means it is not a phony idea ? So if I make a patch it could be integrated ?
Comment 3 Tomasz Zarna CLA 2012-08-23 08:23:27 EDT
The team is extremely busy now with Java8 related work, so it's unlikely that someone will investigate this. Unless there is a working patch. Patches are always welcome. That's the best way of having your bug fixed: provide a patch, work on it with a committer and I'm sure sooner or later the bug will be fixed.
Comment 4 Eclipse Genie CLA 2019-01-24 15:29:45 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.