Summary: | Classpath persistence should be resilient with unknown attributes | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Philipe Mulet <philippe_mulet> | ||||||||||||
Component: | Core | Assignee: | Jerome Lanneluc <jerome_lanneluc> | ||||||||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||||||||
Severity: | normal | ||||||||||||||
Priority: | P3 | ||||||||||||||
Version: | 3.1 | ||||||||||||||
Target Milestone: | 3.1.1 | ||||||||||||||
Hardware: | PC | ||||||||||||||
OS: | Windows XP | ||||||||||||||
Whiteboard: | |||||||||||||||
Attachments: |
|
Description
Philipe Mulet
2005-06-23 07:24:36 EDT
Created attachment 26628 [details]
Patch against R3_1_maintenance branch
Created attachment 26629 [details]
Regression test
For this fix to work, bug 108346 must also be fixed. Created attachment 26698 [details]
Patch against R3_1_maintenance branch
Better patch that reads the unknown attributes and elements just before writing
the .classpath file. With this patch, there is no need for the UI to reuse the
IClasspathEntries comming from getRawClasspath() any longer.
Removing dependency on bug 108346 as the new patch reads the unknown attributes of the .classpath file just, and preserve them before writing the new entries. Created attachment 26828 [details]
Patch against R3_1_maintenance branch
Improved fix that encode the unknown elements using a XmlWriter (instead of
using the toString() of the node).
Created attachment 26829 [details]
Regression tests
Added 2 regression tests
+1 for 3.1.1 (so it can be forward compatible with 3.2 installs). Released fix and regression tests in both HEAD and R3_1_maintenance branch. Verified in I20050920-0010 for 3.2M2 Why do we get this in the .log? org.eclipse.jdt.internal.core.Assert$AssertionFailedException: Unknown kind: '' at org.eclipse.jdt.internal.core.ClasspathEntry.elementDecode(ClasspathEntry.java:746) at org.eclipse.jdt.internal.core.JavaProject.decodeClasspath(JavaProject.java:835) at org.eclipse.jdt.internal.core.JavaProject.readClasspathFile(JavaProject.java:2562) at org.eclipse.jdt.internal.core.JavaProject.readClasspathFile(JavaProject.java:2547) at org.eclipse.jdt.internal.core.JavaProject.getRawClasspath(JavaProject.java:1852) at org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspath(JavaProject.java:1955) at org.eclipse.jdt.internal.core.DeltaProcessor.createExternalArchiveDelta(DeltaProcessor.java:711) at org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged(DeltaProcessor.java:1791) at org.eclipse.jdt.internal.core.DeltaProcessingState.resourceChanged(DeltaProcessingState.java:432) at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:276) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044) at org.eclipse.core.runtime.Platform.run(Platform.java:783) at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:270) at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:144) at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:180) at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:914) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:45) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76) An error in the problem view is good enough. I don't see a need to log the error. kind is a known attribute: it has known values and ' ' is not one of them Verified for 3.1.1 using M20050923-1430. |