| Summary: | PDE doesn't handle project case change | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] PDE | Reporter: | John Arthorne <john.arthorne> | ||||
| Component: | UI | Assignee: | Wassim Melhem <wassim.melhem> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P2 | ||||||
| Version: | 2.0 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 2000 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
John Arthorne
Created attachment 139 [details]
Log file showing two internal errors that occur
Can reproduce it. The problem is here is more than just case change:
If the manifest or feature editor is open (i.e. any editor that inherits from
PDEMultiPageEditor), and you try to rename the project (e.g. any new name,
including just a case change as John described above), you will get the errors
described above.
There are two reasons for that:
1. The PDEMultiPageEditor instance does not update its 'editorInput' member
variable after the name of the project has been changed. This is why you can
open two editors on the same file.
Here is a brief explanation of what was happening:
i. Create a plug-in project: 'com.example.xyz'.
ii. Open its plugin.xml using the manifest editor. The editor is now open on
the file com.example.xyz/plugin.xml
iii. Rename the project to com.example.abc. Since the editorInput member
variable of PDEMultiPageEditor was not being updated after the project has been
renamed, the manifest editor is still technically open on the non-existent
com.example.xyz/plugin.xml. That is why when you can open another editor when
you double-click on plugin.xml. The second editor opens
com.example.abc/plugin.xml, which has a different path name than the previous
one.
2. The other problem which causes the error message 'Resource
com.example.xyz/plugin does not exist' to pop up has to do with the Alert
Section on the Overview page of the editor.
The Alert Section is supposed to update only when the resource has changed.
However, it was updating all the time because two of its 'if' conditions always
evaluated to true. Here is the code in question:
if (resource.getProject().equals(ourProject)) {
if ((delta.getKind() | IResourceDelta.CHANGED) !
= 0) {
if ((delta.getFlags() |
IResourceDelta.MARKERS) != 0) {
markersChanged = true;
return false;
}
}
}
Because IResourceDelta.CHANGED is equal to 0x4 and IResourceDelta.MARKERS is
equal to 0x20000, the 'if' conditions always evaluated to true, and falsely
assigned 'true' to 'markersChanged' in many cases.
The '|' operator in those 'if' conditions should obviously be replaced with '&'.
I'll pass on the fix to Dejan who will then integrate it.
|