Community
Participate
Working Groups
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
Please investigate.
Created attachment 14281 [details] Method Body
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.
The wrong array dimension can also be observed on the java text hover.
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.
Verified in I200409240100.