java2xtend
java2xtend copied to clipboard
Java to Xtend conversion
`Lists.newArrayList();` can get converted to just `newArrayList`, for example.
This snippet ``` java List x = Lists.newArrayList(); ``` is converted to ``` xtend var x = Lists.newArrayList ``` and the type of x is lost.
The field switches type: public class Foo { double x = 0 } becomes class Foo { var x=0 } which is an integer. Also public class Foo { double...
public class Foo { public String foo() { if(1>2) return "foo"; else return "bar"; } } Will be converted to class Foo { def foo(){ if (1 > 2) return...
``` java public class Test { public void m(int arg) { arg = 5; System.out.println(arg); } } ``` generates ``` java class Test { def m( int arg){ arg=5 println(arg)...
``` java public class Test { public void m() { int x = 5; x+=1; } } ``` gets converted to ``` java class Test { def m(){ var x=5...
``` java public class Test { public String m() { return "\n"; } } ``` gets converted to ``` java class Test { def m(){ ' ' } } ```...
Currently for nested classes a double colon is used, but it Xtend 2.4.1 (And earlier) a dollar sign is the correct syntax. The double colon has to be used for...