Bug 84001 - [select] Renaming of class with internal classes fails.
Summary: [select] Renaming of class with internal classes fails.
Status: CLOSED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.1 RC2   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-29 21:59 EST by Andrew Taylor CLA
Modified: 2005-06-10 12:07 EDT (History)
0 users

See Also:


Attachments
Demo (864.79 KB, application/x-shockwave-flash)
2005-01-29 22:02 EST, Andrew Taylor CLA
no flags Details
Proposed patch (1.53 KB, text/plain)
2005-06-03 07:19 EDT, David Audel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Taylor CLA 2005-01-29 21:59:24 EST
Trying to rename a class with internal classes (or perhaps more precisely a
class that is a referenced parent of an internal class) fails to pick up
positionality.  That is, rename within 'new >ExternalClass.InternalClass<(...'
causes InternalClass to be renamed, not ExternalClass, even if cursor is within
the text of 'ExternalClass'.

I'll attach an swf demo.
Comment 1 Andrew Taylor CLA 2005-01-29 22:02:31 EST
Created attachment 17574 [details]
Demo
Comment 2 Olivier Thomann CLA 2005-01-31 10:08:34 EST
What build are you using?
Comment 3 Andrew Taylor CLA 2005-01-31 13:49:36 EST
Using latest build, eclipse-SDK-I20050126-0800-linux-gtk.
Comment 4 Frederic Fusier CLA 2005-02-15 10:58:11 EST
A simpler test case is:
public class Test {
	public static class Sub {}
}
class X {
	void foo() {
		new Test.Sub();
	}
}

Select Test in "new Test.Sub();" and try to refactor it... Dialog is opened with
Sub instead of Test.

Problem comes from Selection Engine...
Comment 5 Philipe Mulet CLA 2005-06-03 07:02:26 EDT
+1 for RC2
Comment 6 David Audel CLA 2005-06-03 07:19:36 EDT
Created attachment 22308 [details]
Proposed patch
Comment 7 David Audel CLA 2005-06-03 07:20:12 EDT
Fixed and tests added
  SelectionTest#test54() -> test55()
  ResolveTests#testTypeInsideConstructor()
Comment 8 Olivier Thomann CLA 2005-06-06 15:05:25 EDT
Verified using N20050606-0010 + JDT/Core HEAD
Comment 9 Olivier Thomann CLA 2005-06-10 12:07:43 EDT
Verified in I20050610-0010.