diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2010-11-10 22:20:08 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2010-11-10 22:20:08 +0100 |
commit | 40b76b50462ac2a3d25b29eb4a8d28298a474efa (patch) | |
tree | 5e9090e40a8d020d48c27dea84f093af5a9ed7bc /test/transform | |
parent | c8774389e7cb73e494267af3a87f70c7497b220a (diff) | |
parent | 632027249b813bfabd457c07ebc89c4456e8175d (diff) | |
download | lombok-40b76b50462ac2a3d25b29eb4a8d28298a474efa.tar.gz lombok-40b76b50462ac2a3d25b29eb4a8d28298a474efa.tar.bz2 lombok-40b76b50462ac2a3d25b29eb4a8d28298a474efa.zip |
Merge branch 'fixDelombok'
Diffstat (limited to 'test/transform')
13 files changed, 44 insertions, 15 deletions
diff --git a/test/transform/resource/after-delombok/ValErrors.java b/test/transform/resource/after-delombok/ValErrors.java index 5ac785ab..770a7e95 100644 --- a/test/transform/resource/after-delombok/ValErrors.java +++ b/test/transform/resource/after-delombok/ValErrors.java @@ -1,8 +1,8 @@ public class ValErrors { - public void nullType() { - final val a = null; - } public void unresolvableExpression() { - final val c = d; + final java.lang.Object c = d; + } + public void arrayInitializer() { + val e = {"foo", "bar"}; } }
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/ValWeirdTypes.java b/test/transform/resource/after-delombok/ValWeirdTypes.java index 66212906..34beb80b 100644 --- a/test/transform/resource/after-delombok/ValWeirdTypes.java +++ b/test/transform/resource/after-delombok/ValWeirdTypes.java @@ -44,4 +44,14 @@ public class ValWeirdTypes<Z> { final java.util.AbstractList<java.lang.String> d = c ? a : b; java.util.RandomAccess confirm = c ? a : b; } + public void nullType() { + final java.lang.Object nully = null; + } + public void testArrays() { + final int[] intArray = new int[]{1, 2, 3}; + final java.lang.Object[][] multiDimArray = new Object[][]{{}}; + final int[] copy = intArray; + final java.lang.Object[] single = multiDimArray[0]; + final int singleInt = copy[0]; + } }
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/ValComplex.java b/test/transform/resource/after-ecj/ValComplex.java new file mode 100644 index 00000000..cb06d3c1 --- /dev/null +++ b/test/transform/resource/after-ecj/ValComplex.java @@ -0,0 +1 @@ +//ignore
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/ValErrors.java b/test/transform/resource/after-ecj/ValErrors.java new file mode 100644 index 00000000..cb06d3c1 --- /dev/null +++ b/test/transform/resource/after-ecj/ValErrors.java @@ -0,0 +1 @@ +//ignore
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/ValInFor.java b/test/transform/resource/after-ecj/ValInFor.java new file mode 100644 index 00000000..cb06d3c1 --- /dev/null +++ b/test/transform/resource/after-ecj/ValInFor.java @@ -0,0 +1 @@ +//ignore
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/ValLessSimple.java b/test/transform/resource/after-ecj/ValLessSimple.java new file mode 100644 index 00000000..cb06d3c1 --- /dev/null +++ b/test/transform/resource/after-ecj/ValLessSimple.java @@ -0,0 +1 @@ +//ignore
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/ValSimple.java b/test/transform/resource/after-ecj/ValSimple.java new file mode 100644 index 00000000..cb06d3c1 --- /dev/null +++ b/test/transform/resource/after-ecj/ValSimple.java @@ -0,0 +1 @@ +//ignore
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/ValWeirdTypes.java b/test/transform/resource/after-ecj/ValWeirdTypes.java new file mode 100644 index 00000000..cb06d3c1 --- /dev/null +++ b/test/transform/resource/after-ecj/ValWeirdTypes.java @@ -0,0 +1 @@ +//ignore
\ No newline at end of file diff --git a/test/transform/resource/before/ValErrors.java b/test/transform/resource/before/ValErrors.java index 742bca6d..7c5c0a8b 100644 --- a/test/transform/resource/before/ValErrors.java +++ b/test/transform/resource/before/ValErrors.java @@ -1,9 +1,9 @@ public class ValErrors { - public void nullType() { - val a = null; - } - public void unresolvableExpression() { val c = d; } + + public void arrayInitializer() { + val e = { "foo", "bar"}; + } }
\ No newline at end of file diff --git a/test/transform/resource/before/ValWeirdTypes.java b/test/transform/resource/before/ValWeirdTypes.java index 6f6eb9db..855fb91f 100644 --- a/test/transform/resource/before/ValWeirdTypes.java +++ b/test/transform/resource/before/ValWeirdTypes.java @@ -51,4 +51,16 @@ public class ValWeirdTypes<Z> { val d = c ? a : b; java.util.RandomAccess confirm = c ? a : b; } + + public void nullType() { + val nully = null; + } + + public void testArrays() { + val intArray = new int[] {1, 2, 3}; + val multiDimArray = new Object[][] {{}}; + val copy = intArray; + val single = multiDimArray[0]; + val singleInt = copy[0]; + } }
\ No newline at end of file diff --git a/test/transform/resource/messages-delombok/ValErrors.java.messages b/test/transform/resource/messages-delombok/ValErrors.java.messages index feba6912..ca7baeab 100644 --- a/test/transform/resource/messages-delombok/ValErrors.java.messages +++ b/test/transform/resource/messages-delombok/ValErrors.java.messages @@ -1,2 +1,2 @@ -3:21 ERROR Cannot use 'val' here because initializer expression does not have a representable type: <nulltype> -7:21 ERROR Cannot use 'val' here because initializer expression does not have a representable type: Type cannot be resolved +3:21 ERROR Cannot use 'val' here because initializer expression does not have a representable type: Type cannot be resolved +7:21 ERROR 'val' is not compatible with array initializer expressions. Use the full form (new int[] { ... } instead of just { ... }) diff --git a/test/transform/resource/messages-idempotent/ValErrors.java.messages b/test/transform/resource/messages-idempotent/ValErrors.java.messages new file mode 100644 index 00000000..ebeee317 --- /dev/null +++ b/test/transform/resource/messages-idempotent/ValErrors.java.messages @@ -0,0 +1 @@ +6:21 ERROR 'val' is not compatible with array initializer expressions. Use the full form (new int[] { ... } instead of just { ... }) diff --git a/test/transform/src/lombok/transform/TestLombokFilesIdempotent.java b/test/transform/src/lombok/transform/TestLombokFilesIdempotent.java index 63d34820..6a874bfc 100644 --- a/test/transform/src/lombok/transform/TestLombokFilesIdempotent.java +++ b/test/transform/src/lombok/transform/TestLombokFilesIdempotent.java @@ -40,6 +40,11 @@ public class TestLombokFilesIdempotent implements DirectoryRunner.TestParams { } @Override + public File getMessagesDirectory() { + return new File("test/transform/resource/messages-idempotent"); + } + + @Override public DirectoryRunner.Compiler getCompiler() { return DirectoryRunner.Compiler.DELOMBOK; } @@ -48,9 +53,4 @@ public class TestLombokFilesIdempotent implements DirectoryRunner.TestParams { public boolean printErrors() { return true; } - - @Override - public File getMessagesDirectory() { - return null; - } } |