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

Bug 361231

Summary: Bad Memento serialization with external Zip projet fragment
Product: [Technology] DLTK Reporter: Simon Bernard <sbernard>
Component: CommonAssignee: dltk.common-inbox <dltk.common-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: andrei.sobolev, contact
Version: 3.0Keywords: contributed
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
a patch for this bug none

Description Simon Bernard CLA 2011-10-18 05:38:08 EDT
It seems that the serialization/deserialization of memento for an external zip project fragment does not work.

To reproduce the problem you need to have a dltk IDE which support Zip projet fragment.
(your languageToolkit need to return true for this method : @see org.eclipse.dltk.core.AbstractLanguageToolkit#languageSupportZIPBuildpath())
It seems this is not the case for Ruby and TCL (but for test reason you could change the languageToolkit of those IDEs by overriding this method)
Now :
- add a external zip archive to your project.
- open a source file in this archive.
- close eclipse. (the memento is serialize)
- reopen eclipse. (the memento is deserialize)
- but the editor could not open the sourcefile (IO Exception), because the zipPath of ArchiveProjectFragment is not right.

I suppose the error is at the serialization.
External ArchiveProjectFragment is manage as "classic" ArchiveProjectFragment, this seems to be an error.
Comment 1 Simon Bernard CLA 2011-10-18 05:44:38 EDT
Created attachment 205400 [details]
a patch for this bug

I propose a patch, ArchiveProjectFragment  as ExternalProjectFragment, when the archive is external.

It seems this works for me, but I change the behavior of getElementName() and 
I don't really know the consequences :p !
Comment 2 Benjamin Cabé CLA 2011-12-01 11:13:09 EST
Ping :)
Any chance you guys could review and include the attached patch?
Comment 3 Andrei Sobolev CLA 2011-12-01 11:35:23 EST
Patch commited in HEAD.
Thanks.