Community
Participate
Working Groups
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.
Dani, would it fail (i.e. return null) when the JAR doesn't exist on disk?
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.
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.
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.
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*
what if it is not the root but some binary element below, e.g. java.lang.Object?
It should work as well: the same code is used to create the package fragment root in all cases.
Verified.
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 -----------------------------------------------------------
(In reply to comment #9) Please open a separate bug report against Platform UI