Bug 2855 - [ltk][rename] Referenced project wrong when renamed (1GJYKPZ)
Summary: [ltk][rename] Referenced project wrong when renamed (1GJYKPZ)
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 enhancement with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 199589 317400 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-10-10 22:44 EDT by Simon Arsenault CLA
Modified: 2011-09-28 15:53 EDT (History)
10 users (show)

See Also:


Attachments
Update referenced projects as part of the rename refactoring (19.11 KB, patch)
2010-06-28 14:49 EDT, Yuri Strot CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Arsenault CLA 2001-10-10 22:44:46 EDT
- Create two project P1 and P2
	- Open the properties dialog on P1 and make P2 a referenced project
	- Rename the P2 project to be P3
	- Open the properties dialog on P1 and look at the referenced projects

	Notice that it shows P3 and P2 with P2 being selected.

NOTES:
	
JW (10/2/01 4:21:42 PM) I believe we need to attach more semantics to project
references.  Although we have implemented what we have specified, we have
not always solved the problems before us.
Comment 1 DJ Houghton CLA 2001-10-29 19:21:41 EST
PRODUCT VERSION:
	0.135 Win 98 SE

Comment 2 Kevin Haaland CLA 2002-04-30 14:25:17 EDT
Defer
Comment 3 Randy Giffen CLA 2002-08-08 16:03:49 EDT
Reopen for investigation
Comment 4 Tod Creasey CLA 2002-08-09 15:28:38 EDT
This is more of a Workbench issue. Renaming and assigning appropriately.
Comment 5 Eduardo Pereira CLA 2002-09-05 14:50:57 EDT
Moving to Core for comments. I can't do much without some support from Core.
Comment 6 DJ Houghton CLA 2002-09-05 15:14:32 EDT
What are you requesting? New API? Modification of current behaviour? etc.

The notification that the project has been renamed is already included in the 
resource delta. 
Comment 7 DJ Houghton CLA 2002-09-10 13:08:54 EDT
Received no further information.

Moving to Platform/UI for comment/closure.
Comment 8 Eduardo Pereira CLA 2002-09-10 13:33:59 EDT
  Not sure but I think that the reference mappings between project are kept in 
Core. The UI only shows the references and allows the user to change these 
references.
  It seems that renaming the project should not affect the reference. I.E. 
project A references B and this should be independent of the names of A and B. 
Even though B was renamed it is the same project and the reference should be 
updated.
  If you think the user will have to update manually then this is not a bug and 
should be closed but if you think the reference should be updated automatically 
for the user then it should be done at Core level (I think).

Moving back to Core for comments.
Comment 9 DJ Houghton CLA 2002-09-10 13:56:00 EDT
Yes, I believe that the user entered the originaly bug report because they 
wanted the project references to be updated automatically.

Doing what you are asking at the Core level not only would break current API 
and require new API to be added, but it would change the basis for what for 
what project references were intended for in the first place.

Adding KH for comment.
Comment 10 Kevin Haaland CLA 2002-09-12 09:32:53 EDT
KH (09/12/02 9:49:34 AM) I believe we need to attach more semantics to project
references.  Although we have implemented what we have specified, we have
not always solved the problems before us.

This is a cross team issue that should be added to the "Top <x> List" but I do 
not anticipate having time to address this in 2.1. DJ I suggest that either you 
keep this in Core or move it to the UI team. Either way it should be a P3 
enhancement. 
Comment 11 DJ Houghton CLA 2002-09-12 09:59:20 EDT
Marking as enhancement.
Comment 12 John Arthorne CLA 2004-11-04 11:47:31 EST
Closing. This is an old request that has not turned out to be an important issue.
Comment 13 John Arthorne CLA 2007-08-15 16:29:38 EDT
*** Bug 199589 has been marked as a duplicate of this bug. ***
Comment 14 Andrey Loskutov CLA 2009-08-25 09:25:11 EDT
A small question: comment 12 says that we are closing the bug because there is no need for it.
Comment 13 / bug 199589 says, there is a need, but it's closed as duplicate of this bug and this but is not reopened since then.

Now our use case: we have a CDT based IDE where we rely on project references to run make. If project is renamed, make doesn't work anymore => customer is angry :-(

What I'm also wondering after following the discussion here: is it really so complicated to update .project file during the "rename" operation?

Is it a technical question or a question of module responsibility?

Regards,
Andrei

Comment 15 Szymon Brandys CLA 2009-08-25 10:51:58 EDT
Hi Andrei,

(In reply to comment #14)
> A small question: comment 12 says that we are closing the bug because there is
> no need for it.

Among others WONTFIX is used for very old bugs which will never be addressed. We don't plan to fix it, however I understand that one can find it useful.

> Now our use case: we have a CDT based IDE where we rely on project references to
> run make. If project is renamed, make doesn't work anymore => customer is angry
> :-(

We don't plan to work on it, however this is something you could look at and perhaps provide a patch.

> What I'm also wondering after following the discussion here: is it really so
> complicated to update .project file during the "rename" operation?

There might be people who relies on the current behavior. IProjectDescription#setReferencedProjects states that "The projects need not exist in the workspace.". So leaving a reference to moved or deleted projects seems to be fine.

However I can imagine IDE asking whether we want to update static project references or not.
Comment 16 Szymon Brandys CLA 2010-06-21 07:03:02 EDT
*** Bug 317400 has been marked as a duplicate of this bug. ***
Comment 17 Yuri Strot CLA 2010-06-21 09:08:12 EDT
I believe this issue should be fixed at the LTK level. For example java project rename correctly updates build paths. PDE project rename correctly updates plugin dependencies. And I'm sure general project rename should update project references as well.

From the user perspective I'd like to see "Update references" checkbox in the rename dialog (selected by default) like it was done with java projects.

Also this solution doesn't affect API and other plugins. So if you think such improvement makes sense I can create a patch for it.
Comment 18 Andrey Loskutov CLA 2010-06-21 09:20:09 EDT
(In reply to comment #17)
> I believe this issue should be fixed at the LTK level. For example java project
> rename correctly updates build paths. PDE project rename correctly updates
> plugin dependencies. And I'm sure general project rename should update project
> references as well.

Makes sense for me too
 
> From the user perspective I'd like to see "Update references" checkbox in the
> rename dialog (selected by default) like it was done with java projects.

Good idea.

> Also this solution doesn't affect API and other plugins. So if you think such
> improvement makes sense I can create a patch for it.

Personally I would support your patch, but unfortunately I have neither rights to reopen the bug or to accept the patch :-)

BTW, it would be nice to have the patch attached here so that anyone can try to apply it in the custom Eclipse product, even it the patch itself will be not accepted...
Comment 19 Szymon Brandys CLA 2010-06-21 10:07:08 EDT
(In reply to comment #18)
> BTW, it would be nice to have the patch attached here so that anyone can try to
> apply it in the custom Eclipse product, even it the patch itself will be not
> accepted...

Makes sense. Adding Markus as the owner for LTK.
Comment 20 Markus Keller CLA 2010-06-22 10:21:19 EDT
(In reply to comment #17)
> I believe this issue should be fixed at the LTK level.
[..]
> From the user perspective I'd like to see "Update references" checkbox in the
> rename dialog (selected by default) like it was done with java projects.

+1 from me. We have no plans to work on this, but I can review a patch.
Comment 21 Yuri Strot CLA 2010-06-28 14:49:10 EDT
Created attachment 172939 [details]
Update referenced projects as part of the rename refactoring

Hi Markus,

Thanks for your suggestion. I've created this patch for HEAD version.
Comment 22 Heiko Böttger CLA 2010-09-17 02:59:24 EDT
I found the duplicate #317400, when I wanted to report this as a bug.

For me this is something I expect to work, since it is automatically done in JDT/PDE. I also wonder why this bug is not moved to Platform/Resources or another better matching place. It has nothing to do with JDT, it should work for all projects.

If you still thing there is no need for this look at the 
following comments:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=2855#c13
https://bugs.eclipse.org/bugs/show_bug.cgi?id=2855#c16

And now with comment 

https://bugs.eclipse.org/bugs/show_bug.cgi?id=2855#c21

there is even a patch for this. I realy like to see this in one of the next release.
Comment 23 Markus Keller CLA 2011-05-03 11:25:22 EDT
Sorry, this bug got lost between the Resources and the JDT inbox.

The patch only affects non-Java projects. We should also update RenameJavaProjectChange and pde.ui's RenameProjectChange, so that we get the new functionality there as well.
Comment 24 Marc CLA 2011-09-28 15:53:25 EDT
(In reply to comment #23)
> Sorry, this bug got lost between the Resources and the JDT inbox.
> 
> The patch only affects non-Java projects. We should also update
> RenameJavaProjectChange and pde.ui's RenameProjectChange, so that we get the
> new functionality there as well.

The "project reference" properties is independent of the project nature.
Yuri on comment #21 provided a patch. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=2855#c21

Can this be included in the next release?