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

Bug 6270

Summary: PDE doesn't handle project case change
Product: [Eclipse Project] PDE Reporter: John Arthorne <john.arthorne>
Component: UIAssignee: 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 Flags
Log file showing two internal errors that occur none

Description John Arthorne CLA 2001-11-23 14:05:35 EST
Build 2001-11-20

1) Create a fragment project called "Frag".
2) Open the fragment.xml file
3) Select the project in the navigator, select rename
4) Rename the project to "FRAG" (first error appears in attached log)
5) Now click on the + box next to the project name to expand it
   (second error occurs, see attached log).

6) Double click on fragment.xml

It opens a second fragment editor beside the first one.  There are now two 
editors open on the same file!
Comment 1 John Arthorne CLA 2001-11-23 14:06:44 EST
Created attachment 139 [details]
Log file showing two internal errors that occur
Comment 2 Dejan Glozic CLA 2002-01-22 12:51:14 EST
Can reproduce it.
Comment 3 Wassim Melhem CLA 2002-07-03 08:47:05 EDT
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.