Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 361231 - Bad Memento serialization with external Zip projet fragment
Summary: Bad Memento serialization with external Zip projet fragment
Status: RESOLVED FIXED
Alias: None
Product: DLTK
Classification: Technology
Component: Common (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: dltk.common-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2011-10-18 05:38 EDT by Simon Bernard CLA
Modified: 2011-12-01 11:35 EST (History)
2 users (show)

See Also:


Attachments
a patch for this bug (1.53 KB, patch)
2011-10-18 05:44 EDT, Simon Bernard CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.