I have inherited significant amounts of Groovy code, and I have found it difficult to maintain for several reasons:
Although I appreciate the compactness of the language, maintenance has been difficult and cumbersome.
I have tried to manually convert some pieces to Java, it's been a pain. Are you aware of any tools or plugins that help with this conversion?
IntelliJ IDEA has a quite decent support for refactoring of groovy code. It also has a source code level converter from Groovy -> Java. Most of the time it generates code that does not compile, but it may help to get you started with the process of converting the code. Groovy code:
class HelloWorld {
def name
def greet() { "Hello ${name}" }
int add(int a, int b) {
return a+b;
}
}
Converted Java code:
public class HelloWorld {
public GString greet() {
return "Hello " + String.valueOf(name);
}
public int add(int a, int b) {
return a + b;
}
public Object getName() {
return name;
}
public void setName(Object name) {
this.name = name;
}
private Object name;
}