-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception on Java class refactoring #1043
Comments
When JDT searches for the method's references, any occurrences in Groovy sources are not represented in the Java AST and so the covering node is used (block statement in this case). public static ASTNode perform(ASTNode root, int start, int length) {
NodeFinder finder = new NodeFinder(root, start, length);
ASTNode result= finder.getCoveredNode();
if (result == null || result.getStartPosition() != start || result.getLength() != length) {
return finder.getCoveringNode();
} Groovy would need to provide AST for the method statements for this to work. At the moment only a minimal amount of AST is provided in method bodies to support declaration of local variables. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Consider this Java class:
and this Groovy class:
Now go to
test59.Test59Java.foo(String, Integer)
and hit Alt+Shift+C to invoke Change Method Signature refactoring. Add a new parameter, typeString
, nameanother
, default valuenull
.Hit OK.
I get the following exception:
If you hit Continue, the Groovy class is not updated and a compilation error on it arises, of course.
The text was updated successfully, but these errors were encountered: