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

Bug 237830

Summary: class renaming changes active selection
Product: [Eclipse Project] Platform Reporter: markus <markus.galileo>
Component: UIAssignee: Dani Megert <daniel_megert>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: daniel_megert, Jonathan.Neufeld, paul.tillotson, scohen, thomas.oesterle
Version: 3.3   
Target Milestone: 3.5 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description markus CLA 2008-06-19 13:41:31 EDT
Build ID: I20080530-1730

Steps To Reproduce:
1. open eclipse, with a new clean workspace
2. create a new java project, create a single class
3. in the project explorer panel, activate the link between the open editor and the content in the navigator is enabled
(button with 2 arrows, 1 pointing to the right, the other to the left)
4. open the created class in the editor and set the cursor in the middle of the class name
5. press alt+shift+r to trigger in editor renaming
6. type a few characters
7. pause for a second without pressing enter or esc
8. the selection is modified, the whole class name (or the first part of it if you typed a space or such) is selected. 9. Typing again erases the previous name/changes

More information:
tested on vanilla eclipse 3.4RC3
seems like it was not happening in eclipse 3.3.x
Comment 1 Dani Megert CLA 2008-06-20 03:42:20 EDT
Can reproduce using 3.4 RC4 and also with Navigator and Package Explorer. Will investigate.
Comment 2 Dani Megert CLA 2008-06-20 04:26:50 EDT
>Can reproduce using 3.4 RC4 and also with Navigator and Package Explorer.
Ugly! This is caused by the Project Explorer. Because the Project Explorer sets the editor selection even if it is not active you can also observe it with other views (like Package Explorer). Also, refactoring isn't needed: simply typing inside the class name causes the selection to be scrambled by the Project Explorer.

Same bug in 3.3.x.
Comment 3 Dani Megert CLA 2008-06-20 09:13:59 EDT
Fixed in HEAD.
Comment 4 Dani Megert CLA 2008-06-20 09:17:54 EDT
.
Comment 5 Dani Megert CLA 2008-06-20 09:26:43 EDT
*** Bug 229245 has been marked as a duplicate of this bug. ***
Comment 6 Dani Megert CLA 2008-09-02 02:17:21 EDT
*** Bug 244340 has been marked as a duplicate of this bug. ***
Comment 7 Dani Megert CLA 2008-11-13 03:00:54 EST
*** Bug 255060 has been marked as a duplicate of this bug. ***
Comment 8 Dani Megert CLA 2009-05-08 02:56:21 EDT
*** Bug 275317 has been marked as a duplicate of this bug. ***
Comment 9 paul tillotson CLA 2009-05-08 10:25:52 EDT
I'm very glad to see this fixed, Dani!

For people who are experiencing this but can't upgrade immediately, I'd like to point out a work-around: 

Uncheck the "Link open editors with content in the navigator" option (button with two little yellow arrows)
Comment 10 Dani Megert CLA 2009-05-14 13:50:23 EDT
*** Bug 275317 has been marked as a duplicate of this bug. ***
Comment 11 Steve Cohen CLA 2009-05-15 09:03:56 EDT
I'm assured by the developers that <a href="show_bug.cgi?id=275317" title="RESOLVED DUPLICATE - Eclipse gets into a state where it automatically selects text I just entered">Bug 275317</a> is a duplicate of this one, and I believe them, but I would like to point out that you don't even have to type inside the class name to see the bug.  You can also see it simply by typing a new method between two existing methods of an existing class.  As soon as you get to the method name, these symptoms will also occur.  
Comment 12 Steve Cohen CLA 2009-05-15 09:05:23 EDT
Sorry about the botched links.  Looks like I don't know how to make a good link in this system.