Bug 5021 - Refactoring damages code
Summary: Refactoring damages code
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: 2.0 M1   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-16 12:41 EDT by Tim Ellison CLA
Modified: 2002-01-11 09:08 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Ellison CLA 2001-10-16 12:41:05 EDT
Build 202a.

After a failed attempt at renaming an interface from 'Context' to 'IContext', 
various compilation units' source code was trashed.

For example: within JavaDoc
	 * @return the result of the bind as an HTTP response
	 * @see delete() */
became
	 * @return the result of the bind as an HTTP response
	 * @see delIContext */

And there are many more examples of a text replacement being done in very 
bizzare places.  
Comment 1 Tim Ellison CLA 2001-10-16 12:42:42 EDT
The failed refactoring mentioned in this bug report was Bug#5015
Comment 2 Adam Kiezun CLA 2001-10-17 11:34:59 EDT
need a reproducible testcase
Comment 3 Tim Ellison CLA 2001-10-18 05:39:11 EDT
- Use Eclipse build 202a with the attached workspace
  Let me know if you require the complete install.
- From the outline view of org.eclipse.webdav.IContext
  choose to Rename... the interface.
- Enter a new name, say, 'IContextDebug', click Next.
- There should be two problems noted.
- Optionally, click Next to see the walkback reported in Bug#5015
  (This trashing bug also appears if you don't cause the walkback)
- Click Finish, the rename progresses to completion.
- Take a look at org.eclipse.webdav.server.PreconditionCheck.java
  The rename has changed line 51 from
    throw new InternalServerError("Tokenizing problem ...
  to
    throw new IIContextDebugerverError("Tokenizing problem ...

There are, in general, other random places where a bad rename has occurred.
Comment 4 Adam Kiezun CLA 2001-10-18 06:06:03 EDT
1. i see no attached workspace
2. sounds like the indexer is corrupted - what is reported by search?
 (search for references to org.eclipse.webdav.IContext)
 my guess is that matches are incorrectly reported
Comment 5 Tim Ellison CLA 2001-10-18 08:48:23 EDT
1. I'm having problems with the Bugzila attachments from here, please see the 
file in
  ftp://walleye.oti.com/upload/Bug#5021-workspace.zip
until I get it attached.

2. Indeed, the search you requested gives many false hits.
Comment 6 Adam Kiezun CLA 2001-10-18 08:50:29 EDT
in that case - the bug gets moved to jcore for investigation
Comment 7 Philipe Mulet CLA 2001-10-22 04:46:30 EDT
Please investigate match positions.
Comment 8 Jerome Lanneluc CLA 2001-10-22 05:00:13 EDT
Walleye seems to be down for now.
Tim, if you have another ftp server that I can access, please let me know.
Comment 9 Jerome Lanneluc CLA 2001-10-22 06:05:05 EDT
Walleye is up, but I cannot see the 'upload' directory. What user/password 
should I use?
Comment 10 Jerome Lanneluc CLA 2001-10-22 10:51:53 EDT
Was able to reproduce. The problem was that the same match set was used by a 
compilation unit and all the compilation units that were requested during type 
resolution. Matches were reported agains the wrong compilation unit.

Fixed in SNZ's HEAD stream.