Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 2.6.1.Release
-
Fix Version/s: 2.7.0.Release
-
Component/s: Refactoring
-
Labels:None
-
Number of attachments :
Description
When I try to use the Extract Method refactoring action on a block of code where one or more arguments to the new method are arrays, the type of that argument in the refactoring dialog box is incorrect. For example, for this trivial code block:
String[] strings = null;
String str = null;
str = strings[0];
If I try to extract the final line into a new method called test, the dialog shows the argument type for the strings variable to be "String;" in the arguments list, but in the method signature preview, the method signature is "private test(String str, [Ljava.lang.String; strings)", and that's what you get in the code if you perform the refactoring.
Interestingly, passing in an array of ints instead of Strings gives a slightly different type (though it also fails). This code block:
int[] ints = null;
int i;
i = ints[0];
Yields an argument type of "[I" for the ints variable in both the argument list and the method preview.
Thanks for reporting this. The text you are seeing is the underlying Groovy/JVM type name for an array type. Should be relatively easy to fix.