Bug 29864 - Unable to restore working set item - cannot instantiate item: org.eclipse.jdt.ui.PersistableJavaElementFactory
Summary: Unable to restore working set item - cannot instantiate item: org.eclipse.jdt...
Status: VERIFIED FIXED
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: 2.1 M5   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-21 03:55 EST by Dani Megert CLA
Modified: 2006-04-05 04:35 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2003-01-21 03:55:53 EST
Build I20030115

IPackageFragmentRoot.getHandleIdentifier() returns something like:
  "=C/C:/Java/J9_06282002/ive/lib/jclMax/classes.zip"

Restoring this handle identifier does not always work (depending on which parent
the JAR returns, I guess).

JavaCore.create(String) should be smart and return the correct external JAR for
project C.
Comment 1 Jerome Lanneluc CLA 2003-01-22 09:09:11 EST
Dani, would it fail (i.e. return null) when the JAR doesn't exist on disk?
Comment 2 Dani Megert CLA 2003-01-22 09:30:50 EST
I don't think so. The result should simply be a handle.
Having said this I see that we need to add an exist() check in the
PersistableJavaElementFactory.
Comment 3 Jerome Lanneluc CLA 2003-01-23 09:56:26 EST
Sorry, I misexplained myself. I meant to ask if the case where you see it 
failing was when the JAR doesn't exist on disk.
Comment 4 Dani Megert CLA 2003-01-23 10:09:36 EST
It exists on disk. It is quite a common case: it happens because external JARs
are shared. When I asked for the handle it was apparently rooted with project C.

On recreation it's probably rooted with another project.

I know (and can life with) the fact that I can't trust the JARs parent but I
need at least a way to restore such an element via handle.

A scenario where it sometimes happens is when you have working sets that contain
elements from an external JAR.
Comment 5 Jerome Lanneluc CLA 2003-01-23 11:00:40 EST
Reworked the way mementos work for package fragment roots. It should now ensure 
that the project stored in the memento is used as the parent of the package 
fragment root when restoring it.

Added regression tests MementoTests.testPackageFragmentRoot*
Comment 6 Dani Megert CLA 2003-01-23 11:23:43 EST
what if it is not the root but some binary element below, e.g. java.lang.Object?
Comment 7 Jerome Lanneluc CLA 2003-01-23 11:57:33 EST
It should work as well: the same code is used to create the package fragment 
root in all cases.
Comment 8 David Audel CLA 2003-02-13 05:07:37 EST
Verified.
Comment 9 Missing name CLA 2006-04-04 17:50:56 EDT
I moved to 3.2M6 using my old 3.2M5 workspace.

I got an "Unable to restore working set item - no factory ID." with no exception stack trace. 

What happened ? Did I lose something in a workset I am not working on at the moment (Eclipse seems to be working ok otherwise with the exsiting working sets).

Can this bug be more specific as to what happened ?
-------------------------------------------------------
Cheers and goodwill
-----------------------------------------------------------------------
Configuration
----------------------------------------------------------------------
Intel Pentium III 448Mhz, 320 MB of RAM
----------------------------------------------------------------------
Windows XP Version 5.1 (Build 2600.xpsp_sp2_gdr.050301-1519: Service Pack 2)
----------------------------------------------------------------------
rh8 kernel 2.4.18-14
-----------------------------------------------------------------------
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
---------------------------------------------------------------------
eclipse-platform-3.2M6-win32
eclipse-PDE-3.2M6
eclipse-JDT-3.2M6
xsd-runtime-2.2.0M4
emf-sdo-runtime-2.2.0M4
GEF-runtime-3.2M4
JEM-runtime-1.2M1
wtp-1.5M4
subclipse-0.9.108
-----------------------------------------------------------


Comment 10 Jerome Lanneluc CLA 2006-04-05 04:35:06 EDT
(In reply to comment #9)
Please open a separate bug report against Platform UI