Bug 361869 - Undo broken after Move refactoring
Summary: Undo broken after Move refactoring
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.8   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-24 16:37 EDT by Ayushman Jain CLA
Modified: 2020-03-21 19:25 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ayushman Jain CLA 2011-10-24 16:37:50 EDT
HEAD

package org.test.foobar;
/**
*{@link org.missing.Foo}
*/
class Foo
{
}

Copy this into a project. Move this class into a default package in the project. A dialog appears with problems found: Found potential matches. Please preview changes on preview page.

However clicking Continue does not show a preview page. The resulting CU I get is

/**
*{@link missing.Foo}
*/
class Foo
{
}

I don't know why the @link line gets changed here.
So , two problems here:
1) The spurious dialog
2) The changed @link line

Fix for bug 241834 seems to have fixed exception but still doesn't look 100% cured to me.
Comment 1 Ayushman Jain CLA 2011-10-24 16:40:13 EDT
Also doing a CTRL-Z after above steps results in broken comment
i.e. linorgk.missing.Foo
Comment 2 Satyam Kandula CLA 2011-11-02 05:21:54 EDT
I think the problem should be with refactoring.
Comment 3 Deepak Azad CLA 2011-11-08 10:55:40 EST
(In reply to comment #0)
> I don't know why the @link line gets changed here.
> So , two problems here:
> 1) The spurious dialog
The dialog is fine, the reference for 'Foo' is the link. (Try searching for reference to Foo in the workspace)

> 2) The changed @link line
This is also ok.

Try with the following snippet where the link is valid to being with and see how it is updated. 
------------------------------
package org.test.foobar;
/**
*{@link org.test.Foo}
*/
class Foo
{
}
------------------------------

"org.missing.Foo" is a garbage link and the result is also garbage which fits the garbge in and garbage out principle :-)
Comment 4 Deepak Azad CLA 2011-11-08 10:58:42 EST
(In reply to comment #1)
> Also doing a CTRL-Z after above steps results in broken comment
> i.e. linorgk.missing.Foo

Undo seems to be broken. For me Undo does not do anything. Keeping this bug for the undo problem.
Comment 5 Ayushman Jain CLA 2011-11-08 11:02:17 EST
(In reply to comment #3)
> "org.missing.Foo" is a garbage link and the result is also garbage which fits
> the garbge in and garbage out principle :-)

Does not look like a very reasonable argument. Why can't the garbage be just left alone? How does "org.missing.Foo" get messed up into some other string?
Comment 6 Deepak Azad CLA 2011-11-08 11:11:04 EST
(In reply to comment #5)
> Does not look like a very reasonable argument. Why can't the garbage be just
> left alone? How does "org.missing.Foo" get messed up into some other string?
It is not messed up. If you start with link as "org.test.Foo", it is updated to "Foo". But if you start with "org.missing.Foo" the refactoring tries to update it but does not get very far as the link is not valid and it cannot understand 'missing' and hence leaves it as is.
Comment 7 Markus Keller CLA 2011-11-08 11:40:01 EST
The handling of potential matches is not great, see bug 198921.
Comment 8 Eclipse Genie CLA 2020-03-21 19:25:24 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.