grails - How to convert Java code to Groovy code automatically -
grails - How to convert Java code to Groovy code automatically -
i have written code in java , need convert code groovy, take advantage groovy offers. there way convert java code groovy automatically or existing plugins can me started in direction?
fun fact - groovy has tool already, called java2groovy
- can see in bin
directory of groovy installation. it's wrapper script calls class in distro - org.codehaus.groovy.antlr.java.java2groovymain
.
pay no attending warnings added header of converted code:
!! not fit purpose !!
and
'java2groovy' cannot used convert 1 working programme
on more serious note - i'm pretty sure code hasn't been updated in long time, , wasn't feature-rich @ peak.
my suggestion similar others have said - leave if it's working , tested. if need in groovy, there few problematic differences between groovy , java, due groovy using { } chars closure; java constructs utilize (e.g. arrays) need converted. also, strangely - there's no do
/while
loop in groovy. , there cases runtime behavior different compile time, java uses compiled. dynamic dispatch typically results improve choices because groovy looks @ types are, not appeared looked @ compile time. improve problem if you're expecting same.
see http://groovy.codehaus.org/differences+from+java description of problems , workarounds.
java grails plugins groovy
Comments
Post a Comment