| Summary: | [build path] editing user library properties drops classpath entry attributes | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Karen Butzke <karenfbutzke> | ||||
| Component: | UI | Assignee: | Markus Keller <markus.kell.r> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P2 | CC: | daniel_megert, konstantin | ||||
| Version: | 3.6 | Flags: | markus.kell.r:
review+
|
||||
| Target Milestone: | 3.7 M4 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Karen Butzke
I'm not sure how this could be a Dali bug, so I'm going to set it to the library provider framework. Any ideas? Reproduced the scenario and confirmed this as framework bug. Taking another looks at this. This looks to be a bug in JDT UI. Editing User Library properties via entry on the project properties wipes classpath entry attributes.
Repro for JDT UI:
1. Create a java project.
2. Create a user library called "mylib".
3. Add the following entry to .classpath file:
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/mylib">
<attributes>
<attribute name="owner.project.facets" value="jpt.jpa"/>
</attributes>
</classpathentry>
4. Find library entry in package explorer. Right click -> mylib -> properties.
5. User Libraries...
6. Edit library content by adding another jar.
7. Close all dialogs.
8. Notice that classpath entry has been stripped of attributes:
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/mylib"/>
Attributes are a critical facility for layered projects to extend JDT behavior.
Replace steps 5-8, with this: 5. Hit ok to close classpath container properties dialog without making any changes. Created attachment 181441 [details]
Patch v1
This patches UserLibraryWizardPage to preserve all of the information in the input classpath entry if the entry path doesn't change (user didn't select a different user library). There was already logic to preserve the setting of the export flag. I consolidated that logic with my changes.
Testing the described scenario as well as other editing and creation scenarios.
Can this patch be considered for inclusion into 3.7?
Markus, please take a look during M4. That makes perfectly sense. Thanks a lot for the patch. Released to HEAD. |