mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
test for field generation
This commit is contained in:
+1
@@ -66,4 +66,5 @@ class FileGenerationTest extends LightGroovyTestCase {
|
||||
void testMethodParamsInClosures() {doTest()}
|
||||
void testClosureParamInInnerClosure() {doTest()}
|
||||
void testMethodParamInClosureImplicitReturn() {doTest()}
|
||||
void testField() {doTest()}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@ public class X extends groovy.lang.GroovyObjectSupport implements groovy.lang.Gr
|
||||
public groovy.lang.Closure<java.lang.Integer> getFoo() {
|
||||
return foo;
|
||||
}
|
||||
public void setFoo(java.lang.Object foo) {
|
||||
public void setFoo(groovy.lang.Closure<java.lang.Integer> foo) {
|
||||
this.foo = foo;
|
||||
}
|
||||
private groovy.lang.Closure<java.lang.Integer> foo = new groovy.lang.Closure<java.lang.Integer>(this, this) {
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
class X {
|
||||
def field = [1:2, 3:4]
|
||||
def second = [1, 2, 3]
|
||||
def a=5, b=3
|
||||
|
||||
def c=[1:2], d=5
|
||||
int x
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
public class X extends groovy.lang.GroovyObjectSupport implements groovy.lang.GroovyObject {
|
||||
public java.util.Map<java.lang.String, java.lang.Integer> getField() {
|
||||
return field;
|
||||
}
|
||||
public void setField(java.util.Map<java.lang.String, java.lang.Integer> field) {
|
||||
this.field = field;
|
||||
}
|
||||
public java.util.ArrayList<java.lang.Integer> getSecond() {
|
||||
return second;
|
||||
}
|
||||
public void setSecond(java.util.ArrayList<java.lang.Integer> second) {
|
||||
this.second = second;
|
||||
}
|
||||
public java.lang.Integer getA() {
|
||||
return a;
|
||||
}
|
||||
public void setA(java.lang.Integer a) {
|
||||
this.a = a;
|
||||
}
|
||||
public java.lang.Integer getB() {
|
||||
return b;
|
||||
}
|
||||
public void setB(java.lang.Integer b) {
|
||||
this.b = b;
|
||||
}
|
||||
public java.util.Map<java.lang.String, java.lang.Integer> getC() {
|
||||
return c;
|
||||
}
|
||||
public void setC(java.util.Map<java.lang.String, java.lang.Integer> c) {
|
||||
this.c = c;
|
||||
}
|
||||
public java.lang.Integer getD() {
|
||||
return d;
|
||||
}
|
||||
public void setD(java.lang.Integer d) {
|
||||
this.d = d;
|
||||
}
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
public void setX(int x) {
|
||||
this.x = x;
|
||||
}
|
||||
{
|
||||
java.util.Map<java.lang.String, java.lang.Integer> map = new java.util.Map<java.lang.String, java.lang.Integer>(2);
|
||||
map.put("1", 2);
|
||||
map.put("3", 4);
|
||||
field = map;}
|
||||
private java.util.Map<java.lang.String, java.lang.Integer> field;
|
||||
private java.util.ArrayList<java.lang.Integer> second = new java.util.ArrayList<java.lang.Integer>(java.util.Arrays.asList(1, 2, 3));
|
||||
private java.lang.Integer a = 5;
|
||||
private java.lang.Integer b = 3;
|
||||
{
|
||||
java.util.Map<java.lang.String, java.lang.Integer> map = new java.util.Map<java.lang.String, java.lang.Integer>(1);
|
||||
map.put("1", 2);
|
||||
c = map;}
|
||||
private java.util.Map<java.lang.String, java.lang.Integer> c;
|
||||
private java.lang.Integer d = 5;
|
||||
private int x;
|
||||
}
|
||||
+1
-1
@@ -6,7 +6,7 @@ org.codehaus.groovy.runtime.DefaultGroovyMethods.print(Foo.this, CONST);
|
||||
public static java.lang.Integer getCONST() {
|
||||
return CONST;
|
||||
}
|
||||
public static void setCONST(java.lang.Object CONST) {
|
||||
public static void setCONST(java.lang.Integer CONST) {
|
||||
Foo.CONST = CONST;
|
||||
}
|
||||
private static java.lang.Integer CONST = 5;
|
||||
|
||||
Reference in New Issue
Block a user