Bug 72946 - Refactoring context menu does not show inline action on local variables [refactoring] [inline temp]
Summary: Refactoring context menu does not show inline action on local variables [refa...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.1 M2   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-31 06:07 EDT by Tobias Widmer CLA
Modified: 2004-09-23 06:55 EDT (History)
1 user (show)

See Also:


Attachments
Method Body (1.45 KB, text/plain)
2004-08-31 06:56 EDT, Tobias Widmer CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Widmer CLA 2004-08-31 06:07:41 EDT
Build I20040824: Javaeditor context menu does not contain inline action when a 
local variable is selected. The refactoring is enabled however.

Steps to reproduce:
- Write a similar statement as below:

		ListRewrite list= rewrite.getListRewrite(targetClass, 
TypeDeclaration.BODY_DECLARATIONS_PROPERTY);
		list.insertAt(newMethod, ASTNodes.getInsertionIndex(newMethod, 
targetClass.bodyDeclarations()), null);
- Place caret on "list"
- Invoke context menu
Comment 1 Dirk Baeumer CLA 2004-08-31 06:37:38 EDT
Please investigate.
Comment 2 Tobias Widmer CLA 2004-08-31 06:56:26 EDT
Created attachment 14281 [details]
Method Body
Comment 3 Markus Keller CLA 2004-08-31 08:10:18 EDT
Moving to JDT/Core.

ICompilationUnit#codeSelect(int,int) returns an ILocalVariable with an invalid
parent iff the enclosing method has an array-type parameter:
...
	void test(int[] arg) {
		List list= new ArrayList();
	}
...
The parent of the ILocalVariable for "list" is "test(int[][]) (not open)". Note
the wrong array dimension count.

We only show the action if the resolved element exists, and an ILocalVariable
only exists iff its parent exists.
Comment 4 Tobias Widmer CLA 2004-08-31 09:07:40 EDT
The wrong array dimension can also be observed on the java text hover.
Comment 5 David Audel CLA 2004-09-02 09:21:09 EDT
Fixed and test added
   ResolveTest#testArrayParameterInsideParent1()

The bug was inside Util.typeSignature().
type.getParameterizedTypeName() return type name with brackets and 
Util.typeSignature() add also the brackets.
Comment 6 David Audel CLA 2004-09-23 06:55:14 EDT
Verified in I200409240100.