Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 369654 - [rename] Method rename fails and garbles code
Summary: [rename] Method rename fails and garbles code
Status: CLOSED DUPLICATE of bug 287539
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.8   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-25 08:18 EST by Sharon Ben Asher CLA
Modified: 2012-01-25 12:54 EST (History)
2 users (show)

See Also:


Attachments
Java source file before the rename operation. passes compilation (8.53 KB, application/octet-stream)
2012-01-25 08:23 EST, Sharon Ben Asher CLA
no flags Details
Java source file after the rename operation. (8.55 KB, application/octet-stream)
2012-01-25 08:23 EST, Sharon Ben Asher CLA
no flags Details
trial project (16.77 KB, application/octet-stream)
2012-01-25 09:02 EST, Ayushman Jain CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sharon Ben Asher CLA 2012-01-25 08:18:14 EST
Build Identifier: Version: Indigo Service Release 1 Build id: 20110916-0149

The class passes compilation before the operation.
I do Method rename of an inner class.  the method is reference in the parent class. the results are garbled code
before and after source files are attached

Reproducible: Always
Comment 1 Sharon Ben Asher CLA 2012-01-25 08:23:27 EST
Created attachment 210047 [details]
Java source file before the rename operation. passes compilation
Comment 2 Sharon Ben Asher CLA 2012-01-25 08:23:54 EST
Created attachment 210048 [details]
Java source file after the rename operation.
Comment 3 Sharon Ben Asher CLA 2012-01-25 08:27:28 EST
reproduction details: 
1) on the "before" file, go to line 223, where method getHashKeyAttributeValue is defined
2) try to rename (using alt+shift+R) to createHashKeyAttributeValue (problem was just reproduced using copy+paste of new name)
Comment 4 Ayushman Jain CLA 2012-01-25 09:02:24 EST
Created attachment 210051 [details]
trial project

Your example has too many unresolved references for us to reproduce in our workspace without getting the other dependencies. 
I tried to get rid of all the errors by creating dummy classes and methods (see attached project), and then tried the refactoring. It works perfectly for me. Can you please attach your project or consturct a stand-alone test case which I can copy into my workbench and reproduce? Thanks!
Comment 5 Sharon Ben Asher CLA 2012-01-25 10:57:36 EST
i tried to create a test case project and failed to reproduce
meantime in the original project i did extensive refactoring and i seperated the parent and the inner classes and now the problem is not reproduced anymore 
the bug can be closed until it is reproduced once again
Comment 6 Srikanth Sankaran CLA 2012-01-25 11:04:27 EST
(In reply to comment #5)
> i tried to create a test case project and failed to reproduce
> meantime in the original project i did extensive refactoring and i seperated
> the parent and the inner classes and now the problem is not reproduced anymore 
> the bug can be closed until it is reproduced once again

I found a bunch of old issues in many instances closed as
not eclipse issues: 

https://bugs.eclipse.org/bugs/show_bug.cgi?id=144798
https://bugs.eclipse.org/bugs/show_bug.cgi?id=145866
https://bugs.eclipse.org/bugs/show_bug.cgi?id=287539

In any case, before closing this as not reproducible,
we'll let the UI folks to have a look to see if something
rings a bell (admittedly there is not a whole lot here)
Comment 7 Sharon Ben Asher CLA 2012-01-25 11:09:43 EST
hmm... I am using svn (sliksvn client) so perhaps this is related...
Comment 8 Dani Megert CLA 2012-01-25 12:54:55 EST

*** This bug has been marked as a duplicate of bug 287539 ***