diff options
Diffstat (limited to 'test/transform/resource/after-ecj')
23 files changed, 478 insertions, 37 deletions
diff --git a/test/transform/resource/after-ecj/Constructors.java b/test/transform/resource/after-ecj/Constructors.java index e47ec8b5..3b3a14da 100644 --- a/test/transform/resource/after-ecj/Constructors.java +++ b/test/transform/resource/after-ecj/Constructors.java @@ -35,7 +35,7 @@ } } @lombok.NoArgsConstructor class NoArgsConstructor1 { - final int x; + int x; String name; public @java.lang.SuppressWarnings("all") NoArgsConstructor1() { super(); diff --git a/test/transform/resource/after-ecj/DataPlain.java b/test/transform/resource/after-ecj/DataPlain.java index 0c4a6ab0..6322d347 100644 --- a/test/transform/resource/after-ecj/DataPlain.java +++ b/test/transform/resource/after-ecj/DataPlain.java @@ -127,10 +127,13 @@ final @Data class Data3 { } } final @Data @lombok.EqualsAndHashCode(callSuper = true) class Data4 extends java.util.Timer { - final int x; + int x; public @java.lang.SuppressWarnings("all") int getX() { return this.x; } + public @java.lang.SuppressWarnings("all") void setX(final int x) { + this.x = x; + } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (("Data4(x=" + this.getX()) + ")"); } diff --git a/test/transform/resource/after-ecj/DelegateOnGetter.java b/test/transform/resource/after-ecj/DelegateOnGetter.java index cb06d3c1..4b10bf7f 100644 --- a/test/transform/resource/after-ecj/DelegateOnGetter.java +++ b/test/transform/resource/after-ecj/DelegateOnGetter.java @@ -1 +1,44 @@ -//ignore
\ No newline at end of file +import lombok.Delegate; +import lombok.Getter; +class DelegateOnGetter { + private interface Bar { + void setList(java.util.ArrayList<java.lang.String> list); + int getInt(); + } + private final @Delegate @Getter(lazy = true) java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<Bar>> bar = new java.util.concurrent.atomic.AtomicReference<java.util.concurrent.atomic.AtomicReference<Bar>>(); + public @Delegate @java.lang.SuppressWarnings("all") Bar getBar() { + java.util.concurrent.atomic.AtomicReference<Bar> value = this.bar.get(); + if ((value == null)) + { + synchronized (this.bar) + { + value = this.bar.get(); + if ((value == null)) + { + final Bar actualValue = new Bar() { + x() { + super(); + } + public void setList(java.util.ArrayList<String> list) { + } + public int getInt() { + return 42; + } + }; + value = new java.util.concurrent.atomic.AtomicReference<Bar>(actualValue); + this.bar.set(value); + } + } + } + return value.get(); + } + public @java.lang.SuppressWarnings("all") int getInt() { + return this.getBar().getInt(); + } + public @java.lang.SuppressWarnings("all") void setList(final java.util.ArrayList<java.lang.String> list) { + this.getBar().setList(list); + } + DelegateOnGetter() { + super(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/DelegateOnGetterNone.java b/test/transform/resource/after-ecj/DelegateOnGetterNone.java index cb06d3c1..0e303936 100644 --- a/test/transform/resource/after-ecj/DelegateOnGetterNone.java +++ b/test/transform/resource/after-ecj/DelegateOnGetterNone.java @@ -1 +1,19 @@ -//ignore
\ No newline at end of file +import lombok.AccessLevel; +import lombok.Delegate; +import lombok.Getter; +@Getter class DelegateOnGetterNone { + private interface Bar { + void setList(java.util.ArrayList<java.lang.String> list); + int getInt(); + } + private final @Delegate @Getter(AccessLevel.NONE) Bar bar = null; + public @java.lang.SuppressWarnings("all") int getInt() { + return this.bar.getInt(); + } + public @java.lang.SuppressWarnings("all") void setList(final java.util.ArrayList<java.lang.String> list) { + this.bar.setList(list); + } + DelegateOnGetterNone() { + super(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/DelegateOnMethods.java b/test/transform/resource/after-ecj/DelegateOnMethods.java index cb06d3c1..37922e2a 100644 --- a/test/transform/resource/after-ecj/DelegateOnMethods.java +++ b/test/transform/resource/after-ecj/DelegateOnMethods.java @@ -1 +1,13 @@ -//ignore
\ No newline at end of file +import lombok.Delegate; +abstract class DelegateOnMethods { + public static interface Bar { + void bar(java.util.ArrayList<java.lang.String> list); + } + public @java.lang.SuppressWarnings("all") void bar(final java.util.ArrayList<java.lang.String> list) { + this.getBar().bar(list); + } + DelegateOnMethods() { + super(); + } + public abstract @Delegate Bar getBar(); +}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/DelegateTypesAndExcludes.java b/test/transform/resource/after-ecj/DelegateTypesAndExcludes.java index cb06d3c1..821c0851 100644 --- a/test/transform/resource/after-ecj/DelegateTypesAndExcludes.java +++ b/test/transform/resource/after-ecj/DelegateTypesAndExcludes.java @@ -1 +1,36 @@ -//ignore
\ No newline at end of file +import lombok.Delegate; +class DelegatePlain { + private static class FooImpl implements Foo { + private FooImpl() { + super(); + } + public void foo() { + } + public void bar(java.util.ArrayList<java.lang.String> list) { + } + } + private static class BarImpl implements Bar { + private BarImpl() { + super(); + } + public void bar(java.util.ArrayList<java.lang.String> list) { + } + } + private static interface Foo extends Bar { + void foo(); + } + private static interface Bar { + void bar(java.util.ArrayList<java.lang.String> list); + } + private final @Delegate(types = Bar.class) BarImpl bar = new BarImpl(); + private final @Delegate(types = Foo.class,excludes = Bar.class) FooImpl foo = new FooImpl(); + public @java.lang.SuppressWarnings("all") void bar(final java.util.ArrayList<java.lang.String> list) { + this.bar.bar(list); + } + public @java.lang.SuppressWarnings("all") void foo() { + this.foo.foo(); + } + DelegatePlain() { + super(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/GetterAlreadyExists.java b/test/transform/resource/after-ecj/GetterAlreadyExists.java index 257457bb..d5bb7e60 100644 --- a/test/transform/resource/after-ecj/GetterAlreadyExists.java +++ b/test/transform/resource/after-ecj/GetterAlreadyExists.java @@ -166,7 +166,7 @@ class Getter16 { super(); } static String hasFoo() { - return false; + return ""; } } class Getter17 { @@ -178,7 +178,7 @@ class Getter17 { super(); } static String isFoo() { - return false; + return ""; } } class Getter18 { @@ -187,6 +187,6 @@ class Getter18 { super(); } static String getFoo() { - return false; + return ""; } } diff --git a/test/transform/resource/after-ecj/GetterLazy.java b/test/transform/resource/after-ecj/GetterLazy.java index 669a9a81..89aaa40f 100644 --- a/test/transform/resource/after-ecj/GetterLazy.java +++ b/test/transform/resource/after-ecj/GetterLazy.java @@ -14,7 +14,8 @@ class GetterLazy { value = this.fieldName.get(); if ((value == null)) { - value = new java.util.concurrent.atomic.AtomicReference<ValueType>(new ValueType()); + final ValueType actualValue = new ValueType(); + value = new java.util.concurrent.atomic.AtomicReference<ValueType>(actualValue); this.fieldName.set(value); } } diff --git a/test/transform/resource/after-ecj/GetterLazyEahcToString.java b/test/transform/resource/after-ecj/GetterLazyEahcToString.java index 4876bd67..15c774a2 100644 --- a/test/transform/resource/after-ecj/GetterLazyEahcToString.java +++ b/test/transform/resource/after-ecj/GetterLazyEahcToString.java @@ -10,7 +10,8 @@ value = this.value.get(); if ((value == null)) { - value = new java.util.concurrent.atomic.AtomicReference<String>(""); + final String actualValue = ""; + value = new java.util.concurrent.atomic.AtomicReference<String>(actualValue); this.value.set(value); } } diff --git a/test/transform/resource/after-ecj/GetterLazyNative.java b/test/transform/resource/after-ecj/GetterLazyNative.java index 6c90a101..da1357a0 100644 --- a/test/transform/resource/after-ecj/GetterLazyNative.java +++ b/test/transform/resource/after-ecj/GetterLazyNative.java @@ -17,7 +17,8 @@ class GetterLazyNative { value = this.booleanField.get(); if ((value == null)) { - value = new java.util.concurrent.atomic.AtomicReference<java.lang.Boolean>(true); + final boolean actualValue = true; + value = new java.util.concurrent.atomic.AtomicReference<java.lang.Boolean>(actualValue); this.booleanField.set(value); } } @@ -33,7 +34,8 @@ class GetterLazyNative { value = this.byteField.get(); if ((value == null)) { - value = new java.util.concurrent.atomic.AtomicReference<java.lang.Byte>(1); + final byte actualValue = 1; + value = new java.util.concurrent.atomic.AtomicReference<java.lang.Byte>(actualValue); this.byteField.set(value); } } @@ -49,7 +51,8 @@ class GetterLazyNative { value = this.shortField.get(); if ((value == null)) { - value = new java.util.concurrent.atomic.AtomicReference<java.lang.Short>(1); + final short actualValue = 1; + value = new java.util.concurrent.atomic.AtomicReference<java.lang.Short>(actualValue); this.shortField.set(value); } } @@ -65,7 +68,8 @@ class GetterLazyNative { value = this.intField.get(); if ((value == null)) { - value = new java.util.concurrent.atomic.AtomicReference<java.lang.Integer>(1); + final int actualValue = 1; + value = new java.util.concurrent.atomic.AtomicReference<java.lang.Integer>(actualValue); this.intField.set(value); } } @@ -81,7 +85,8 @@ class GetterLazyNative { value = this.longField.get(); if ((value == null)) { - value = new java.util.concurrent.atomic.AtomicReference<java.lang.Long>(1); + final long actualValue = 1; + value = new java.util.concurrent.atomic.AtomicReference<java.lang.Long>(actualValue); this.longField.set(value); } } @@ -97,7 +102,8 @@ class GetterLazyNative { value = this.floatField.get(); if ((value == null)) { - value = new java.util.concurrent.atomic.AtomicReference<java.lang.Float>(1.0f); + final float actualValue = 1.0f; + value = new java.util.concurrent.atomic.AtomicReference<java.lang.Float>(actualValue); this.floatField.set(value); } } @@ -113,7 +119,8 @@ class GetterLazyNative { value = this.doubleField.get(); if ((value == null)) { - value = new java.util.concurrent.atomic.AtomicReference<java.lang.Double>(1.0); + final double actualValue = 1.0; + value = new java.util.concurrent.atomic.AtomicReference<java.lang.Double>(actualValue); this.doubleField.set(value); } } @@ -129,7 +136,8 @@ class GetterLazyNative { value = this.charField.get(); if ((value == null)) { - value = new java.util.concurrent.atomic.AtomicReference<java.lang.Character>('1'); + final char actualValue = '1'; + value = new java.util.concurrent.atomic.AtomicReference<java.lang.Character>(actualValue); this.charField.set(value); } } @@ -145,7 +153,8 @@ class GetterLazyNative { value = this.intArrayField.get(); if ((value == null)) { - value = new java.util.concurrent.atomic.AtomicReference<int[]>(new int[]{1}); + final int[] actualValue = new int[]{1}; + value = new java.util.concurrent.atomic.AtomicReference<int[]>(actualValue); this.intArrayField.set(value); } } diff --git a/test/transform/resource/after-ecj/SimpleTypeResolution.java b/test/transform/resource/after-ecj/SimpleTypeResolution.java index a0997c67..b049c62e 100644 --- a/test/transform/resource/after-ecj/SimpleTypeResolution.java +++ b/test/transform/resource/after-ecj/SimpleTypeResolution.java @@ -1,7 +1,6 @@ class SimpleTypeResolutionFail { private @Getter int x; SimpleTypeResolutionFail() { - super(); } } class SimpleTypeResolutionSuccess { @@ -10,6 +9,5 @@ class SimpleTypeResolutionSuccess { return this.x; } SimpleTypeResolutionSuccess() { - super(); } } diff --git a/test/transform/resource/after-ecj/ToStringInner.java b/test/transform/resource/after-ecj/ToStringInner.java index 963299db..dc8696c5 100644 --- a/test/transform/resource/after-ecj/ToStringInner.java +++ b/test/transform/resource/after-ecj/ToStringInner.java @@ -1,7 +1,7 @@ import lombok.ToString; @ToString class ToStringOuter { @ToString class ToStringInner { - final int y; + int y; public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (("ToStringOuter.ToStringInner(y=" + this.y) + ")"); } @@ -10,7 +10,7 @@ import lombok.ToString; } } static @ToString class ToStringStaticInner { - final int y; + int y; public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (("ToStringOuter.ToStringStaticInner(y=" + this.y) + ")"); } @@ -20,7 +20,7 @@ import lombok.ToString; } class ToStringMiddle { @ToString class ToStringMoreInner { - final String name; + String name; public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (("ToStringOuter.ToStringMiddle.ToStringMoreInner(name=" + this.name) + ")"); } @@ -32,7 +32,7 @@ import lombok.ToString; super(); } } - final int x; + int x; String name; public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((("ToStringOuter(x=" + this.x) + ", name=") + this.name) + ")"); diff --git a/test/transform/resource/after-ecj/ToStringPlain.java b/test/transform/resource/after-ecj/ToStringPlain.java index 458f78d0..2361b32a 100644 --- a/test/transform/resource/after-ecj/ToStringPlain.java +++ b/test/transform/resource/after-ecj/ToStringPlain.java @@ -1,6 +1,6 @@ import lombok.ToString; @lombok.ToString class ToString1 { - final int x; + int x; String name; public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((("ToString1(x=" + this.x) + ", name=") + this.name) + ")"); @@ -10,7 +10,7 @@ import lombok.ToString; } } @ToString class ToString2 { - final int x; + int x; String name; public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { return (((("ToString2(x=" + this.x) + ", name=") + this.name) + ")"); diff --git a/test/transform/resource/after-ecj/TrickyTypeResolution.java b/test/transform/resource/after-ecj/TrickyTypeResolution.java index cb06d3c1..fb807709 100644 --- a/test/transform/resource/after-ecj/TrickyTypeResolution.java +++ b/test/transform/resource/after-ecj/TrickyTypeResolution.java @@ -1 +1,87 @@ -//ignore
\ No newline at end of file +import lombok.*; +class TrickyDoNothing { + @interface Getter { + } + @Getter int x; + TrickyDoNothing() { + super(); + } +} +class TrickyDoNothing2 { + @interface Getter { + } + @Getter int x; + TrickyDoNothing2() { + super(); + } +} +class TrickySuccess { + @Getter int x; + public @java.lang.SuppressWarnings("all") int getX() { + return this.x; + } + TrickySuccess() { + super(); + } +} +class TrickyDoNothing3 { + TrickyDoNothing3() { + super(); + } + void test() { + class val { + val() { + super(); + } + } + val x = null; + } +} +class TrickyDoSomething { + TrickyDoSomething() { + super(); + } + void test() { + final @val java.lang.Object x = null; + class val { + val() { + super(); + } + } + } +} +class DoubleTrickyDoNothing { + DoubleTrickyDoNothing() { + super(); + } + void test() { + class val { + val() { + super(); + } + } + for (int i = 10;; (i < 20); i ++) + { + val y = null; + } + } +} +class DoubleTrickyDoSomething { + DoubleTrickyDoSomething() { + super(); + } + void test() { + for (int j = 10;; (j < 20); j ++) + { + class val { + val() { + super(); + } + } + } + for (int i = 10;; (i < 20); i ++) + { + final @val java.lang.Object y = null; + } + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/TrickyTypeResolution2.java b/test/transform/resource/after-ecj/TrickyTypeResolution2.java index cb06d3c1..d9c5f9b0 100644 --- a/test/transform/resource/after-ecj/TrickyTypeResolution2.java +++ b/test/transform/resource/after-ecj/TrickyTypeResolution2.java @@ -1 +1,14 @@ -//ignore
\ No newline at end of file +import lombok.*; +class DoNothingDueToTopLevel { + DoNothingDueToTopLevel() { + super(); + } + void test() { + val x = null; + } +} +class val { + val() { + super(); + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/ValComplex.java b/test/transform/resource/after-ecj/ValComplex.java index cb06d3c1..6e435e56 100644 --- a/test/transform/resource/after-ecj/ValComplex.java +++ b/test/transform/resource/after-ecj/ValComplex.java @@ -1 +1,26 @@ -//ignore
\ No newline at end of file +import lombok.val; +public class ValComplex { + private String field = ""; + private static final int CONSTANT = 20; + <clinit>() { + } + public ValComplex() { + super(); + } + public void testComplex() { + final @val char[] shouldBeCharArray = field.toCharArray(); + final @val int shouldBeInt = CONSTANT; + final @val java.lang.Object lock = new Object(); + synchronized (lock) + { + final @val int field = 20; + final @val int inner = 10; + switch (field) { + case 5 : ; + final @val char[] shouldBeCharArray2 = shouldBeCharArray; + final @val int innerInner = inner; + } + } + final @val java.lang.String shouldBeString = field; + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/ValErrors.java b/test/transform/resource/after-ecj/ValErrors.java index cb06d3c1..1bd61f87 100644 --- a/test/transform/resource/after-ecj/ValErrors.java +++ b/test/transform/resource/after-ecj/ValErrors.java @@ -1 +1,12 @@ -//ignore
\ No newline at end of file +import lombok.val; +public class ValErrors { + public ValErrors() { + super(); + } + 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/after-ecj/ValInFor.java b/test/transform/resource/after-ecj/ValInFor.java index cb06d3c1..1b6c13d0 100644 --- a/test/transform/resource/after-ecj/ValInFor.java +++ b/test/transform/resource/after-ecj/ValInFor.java @@ -1 +1,14 @@ -//ignore
\ No newline at end of file +import lombok.val; +public class ValInFor { + public ValInFor() { + super(); + } + public void enhancedFor() { + java.util.List<String> list = java.util.Arrays.asList("Hello, World!"); + for (final @val java.lang.String shouldBeString : list) + { + System.out.println(shouldBeString.toLowerCase()); + final @val java.lang.String shouldBeString2 = shouldBeString; + } + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/ValLessSimple.java b/test/transform/resource/after-ecj/ValLessSimple.java index cb06d3c1..c7587f91 100644 --- a/test/transform/resource/after-ecj/ValLessSimple.java +++ b/test/transform/resource/after-ecj/ValLessSimple.java @@ -1 +1,39 @@ -//ignore
\ No newline at end of file +import lombok.val; +public class ValLessSimple { + private short field2 = 5; + { + System.out.println("Hello"); + final @val int z = 20; + final @val int x = 10; + final @val int a = z; + final @val short y = field2; + } + private String field = "field"; + public ValLessSimple() { + super(); + } + private String method() { + return "method"; + } + private double method2() { + return 2.0; + } + private void testVal(String param) { + final @val java.lang.String fieldV = field; + final @val int a = 10; + final @val int b = 20; + { + final @val java.lang.String methodV = method(); + final @val java.lang.String foo = (fieldV + methodV); + } + } + private void testValInCatchBlock() { + try + { + final @val int x = (1 / 0); + } + catch (ArithmeticException e) { + final @val int y = 0; + } + } +} diff --git a/test/transform/resource/after-ecj/ValOutersWithGenerics.java b/test/transform/resource/after-ecj/ValOutersWithGenerics.java new file mode 100644 index 00000000..b4225ede --- /dev/null +++ b/test/transform/resource/after-ecj/ValOutersWithGenerics.java @@ -0,0 +1,34 @@ +import java.util.*; +import lombok.val; +public class ValOutersWithGenerics<Z> { + class Inner { + Inner() { + super(); + } + } + static class SubClass extends ValOutersWithGenerics<String> { + SubClass() { + super(); + } + public void testSubClassOfOutersWithGenerics() { + List<Inner> list = new ArrayList<Inner>(); + final @val ValOutersWithGenerics<java.lang.String>.Inner elem = list.get(0); + } + } + public ValOutersWithGenerics() { + super(); + } + public void testOutersWithGenerics() { + final @val java.lang.String foo = ""; + List<Inner> list = new ArrayList<Inner>(); + final @val ValOutersWithGenerics<Z>.Inner elem = list.get(0); + } + public void testLocalClasses() { + class Local<A> { + Local() { + super(); + } + } + final @val Local<java.lang.String> q = new Local<String>(); + } +} diff --git a/test/transform/resource/after-ecj/ValSimple.java b/test/transform/resource/after-ecj/ValSimple.java index cb06d3c1..3a8fb188 100644 --- a/test/transform/resource/after-ecj/ValSimple.java +++ b/test/transform/resource/after-ecj/ValSimple.java @@ -1 +1,25 @@ -//ignore
\ No newline at end of file +import lombok.val; +public class ValSimple { + private String field = "field"; + private short field2 = 5; + public ValSimple() { + super(); + } + private String method() { + return "method"; + } + private double method2() { + return 2.0; + } + private void testVal(String param) { + final @val java.lang.String fieldV = field; + final @val java.lang.String methodV = method(); + final @val java.lang.String paramV = param; + final @val java.lang.String valOfVal = fieldV; + final @val java.lang.String operatorV = (fieldV + valOfVal); + final @val short fieldW = field2; + final @val double methodW = method2(); + byte localVar = 3; + final @val int operatorW = (fieldW + localVar); + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/ValWeirdTypes.java b/test/transform/resource/after-ecj/ValWeirdTypes.java index cb06d3c1..516a3932 100644 --- a/test/transform/resource/after-ecj/ValWeirdTypes.java +++ b/test/transform/resource/after-ecj/ValWeirdTypes.java @@ -1 +1,64 @@ -//ignore
\ No newline at end of file +import java.util.*; +import lombok.val; +public class ValWeirdTypes<Z> { + private List<Z> fieldList; + public ValWeirdTypes() { + super(); + } + public void testGenerics() { + List<String> list = new ArrayList<String>(); + list.add("Hello, World!"); + final @val java.lang.String shouldBeString = list.get(0); + final @val java.util.List<java.lang.String> shouldBeListOfString = list; + final @val java.util.List<java.lang.String> shouldBeListOfStringToo = Arrays.asList("hello", "world"); + final @val java.lang.String shouldBeString2 = shouldBeListOfString.get(0); + } + public void testGenericsInference() { + final @val java.util.List<java.lang.Object> huh = Collections.emptyList(); + final @val java.util.List<java.lang.Number> huh2 = Collections.<Number>emptyList(); + } + public void testPrimitives() { + final @val int x = 10; + final @val long y = (5 + 3L); + } + public void testAnonymousInnerClass() { + final @val java.lang.Runnable y = new Runnable() { + x() { + super(); + } + public void run() { + } + }; + } + public <T extends Number>void testTypeParams(List<T> param) { + final @val T t = param.get(0); + final @val Z z = fieldList.get(0); + final @val java.util.List<T> k = param; + final @val java.util.List<Z> y = fieldList; + } + public void testBounds(List<? extends Number> lower, List<? super Number> upper) { + final @val java.lang.Number a = lower.get(0); + final @val java.lang.Object b = upper.get(0); + final @val java.util.List<? extends java.lang.Number> c = lower; + final @val java.util.List<? super java.lang.Number> d = upper; + List<?> unbound = lower; + final @val java.util.List<?> e = unbound; + } + public void testCompound() { + final @val java.util.ArrayList<java.lang.String> a = new ArrayList<String>(); + final @val java.util.Vector<java.lang.String> b = new Vector<String>(); + final @val boolean c = (1 < System.currentTimeMillis()); + final @val java.util.AbstractList<java.lang.String> d = (c ? a : b); + java.util.RandomAccess confirm = (c ? a : b); + } + public void nullType() { + final @val java.lang.Object nully = null; + } + public void testArrays() { + final @val int[] intArray = new int[]{1, 2, 3}; + final @val java.lang.Object[][] multiDimArray = new Object[][]{{}}; + final @val int[] copy = intArray; + final @val java.lang.Object[] single = multiDimArray[0]; + final @val int singleInt = copy[0]; + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/ValWithLabel.java b/test/transform/resource/after-ecj/ValWithLabel.java index cb06d3c1..0ce2be35 100644 --- a/test/transform/resource/after-ecj/ValWithLabel.java +++ b/test/transform/resource/after-ecj/ValWithLabel.java @@ -1 +1,15 @@ -//ignore
\ No newline at end of file +import lombok.val; +public class ValWithLabel { + { + LABEL: for (final @val java.lang.String x : new String[0]) + { + if ((x.toLowerCase() == null)) + { + continue LABEL; + } + } + } + public ValWithLabel() { + super(); + } +}
\ No newline at end of file |