From 483e23d3853aa37a19390019fcf0db97ac8bc1d4 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Thu, 22 Jul 2010 01:33:24 +0200 Subject: Added tests for ecj, fixed a few minor bugs that came out of that. --- test/transform/resource/after-delombok/GetterWithDollar.java | 6 +++++- test/transform/resource/after-delombok/NonNullPlain.java | 8 ++++---- test/transform/resource/after-delombok/SetterWithDollar.java | 10 ++++++++-- .../resource/after-delombok/SneakyThrowsMultiple.java | 12 ++++++------ .../transform/resource/after-delombok/SneakyThrowsPlain.java | 4 ++-- .../resource/after-delombok/SneakyThrowsSingle.java | 6 +++--- test/transform/resource/after-delombok/SynchronizedName.java | 10 ++++++---- 7 files changed, 34 insertions(+), 22 deletions(-) (limited to 'test/transform/resource/after-delombok') diff --git a/test/transform/resource/after-delombok/GetterWithDollar.java b/test/transform/resource/after-delombok/GetterWithDollar.java index 9e02ccb8..520f4ea5 100644 --- a/test/transform/resource/after-delombok/GetterWithDollar.java +++ b/test/transform/resource/after-delombok/GetterWithDollar.java @@ -1,7 +1,7 @@ class GetterWithDollar1 { int $i; @java.lang.SuppressWarnings("all") - public int getI() { + public int get$i() { return this.$i; } } @@ -9,6 +9,10 @@ class GetterWithDollar2 { int $i; int i; @java.lang.SuppressWarnings("all") + public int get$i() { + return this.$i; + } + @java.lang.SuppressWarnings("all") public int getI() { return this.i; } diff --git a/test/transform/resource/after-delombok/NonNullPlain.java b/test/transform/resource/after-delombok/NonNullPlain.java index 19869db1..0c58425c 100644 --- a/test/transform/resource/after-delombok/NonNullPlain.java +++ b/test/transform/resource/after-delombok/NonNullPlain.java @@ -3,15 +3,15 @@ class NonNullPlain { int i; @lombok.NonNull String s; + @java.lang.SuppressWarnings("all") + public void setI(@lombok.NonNull final int i) { + this.i = i; + } @lombok.NonNull @java.lang.SuppressWarnings("all") public int getI() { return this.i; } - @java.lang.SuppressWarnings("all") - public void setI(@lombok.NonNull final int i) { - this.i = i; - } @lombok.NonNull @java.lang.SuppressWarnings("all") public String getS() { diff --git a/test/transform/resource/after-delombok/SetterWithDollar.java b/test/transform/resource/after-delombok/SetterWithDollar.java index c26a1ccd..974efdcd 100644 --- a/test/transform/resource/after-delombok/SetterWithDollar.java +++ b/test/transform/resource/after-delombok/SetterWithDollar.java @@ -1,14 +1,20 @@ class SetterWithDollar1 { int $i; - public void setI(final int i) { - this.$i = i; + @java.lang.SuppressWarnings("all") + public void set$i(final int $i) { + this.$i = $i; } } class SetterWithDollar2 { int $i; int i; + @java.lang.SuppressWarnings("all") + public void set$i(final int $i) { + this.$i = $i; + } + @java.lang.SuppressWarnings("all") public void setI(final int i) { this.i = i; } diff --git a/test/transform/resource/after-delombok/SneakyThrowsMultiple.java b/test/transform/resource/after-delombok/SneakyThrowsMultiple.java index bab13990..42b275c6 100644 --- a/test/transform/resource/after-delombok/SneakyThrowsMultiple.java +++ b/test/transform/resource/after-delombok/SneakyThrowsMultiple.java @@ -7,10 +7,10 @@ class SneakyThrowsMultiple { try { System.out.println("test1"); throw new IOException(); - } catch (IOException $ex) { + } catch (final IOException $ex) { throw lombok.Lombok.sneakyThrow($ex); } - } catch (Throwable $ex) { + } catch (final Throwable $ex) { throw lombok.Lombok.sneakyThrow($ex); } } @@ -23,10 +23,10 @@ class SneakyThrowsMultiple { } else { throw new AWTException("WHAT"); } - } catch (AWTException $ex) { + } catch (final AWTException $ex) { throw lombok.Lombok.sneakyThrow($ex); } - } catch (IOException $ex) { + } catch (final IOException $ex) { throw lombok.Lombok.sneakyThrow($ex); } } @@ -35,10 +35,10 @@ class SneakyThrowsMultiple { try { System.out.println("test3"); throw new IOException(); - } catch (IOException $ex) { + } catch (final IOException $ex) { throw lombok.Lombok.sneakyThrow($ex); } - } catch (Throwable $ex) { + } catch (final Throwable $ex) { throw lombok.Lombok.sneakyThrow($ex); } } diff --git a/test/transform/resource/after-delombok/SneakyThrowsPlain.java b/test/transform/resource/after-delombok/SneakyThrowsPlain.java index d5abc478..28c39b40 100644 --- a/test/transform/resource/after-delombok/SneakyThrowsPlain.java +++ b/test/transform/resource/after-delombok/SneakyThrowsPlain.java @@ -2,7 +2,7 @@ class SneakyThrowsPlain { public void test() { try { System.out.println("test1"); - } catch (java.lang.Throwable $ex) { + } catch (final java.lang.Throwable $ex) { throw lombok.Lombok.sneakyThrow($ex); } } @@ -10,7 +10,7 @@ class SneakyThrowsPlain { public void test2() { try { System.out.println("test2"); - } catch (java.lang.Throwable $ex) { + } catch (final java.lang.Throwable $ex) { throw lombok.Lombok.sneakyThrow($ex); } } diff --git a/test/transform/resource/after-delombok/SneakyThrowsSingle.java b/test/transform/resource/after-delombok/SneakyThrowsSingle.java index 519d06a9..8901f827 100644 --- a/test/transform/resource/after-delombok/SneakyThrowsSingle.java +++ b/test/transform/resource/after-delombok/SneakyThrowsSingle.java @@ -3,7 +3,7 @@ class SneakyThrowsSingle { public void test() { try { System.out.println("test1"); - } catch (Throwable $ex) { + } catch (final Throwable $ex) { throw lombok.Lombok.sneakyThrow($ex); } } @@ -11,7 +11,7 @@ class SneakyThrowsSingle { try { System.out.println("test2"); throw new IOException(); - } catch (IOException $ex) { + } catch (final IOException $ex) { throw lombok.Lombok.sneakyThrow($ex); } } @@ -19,7 +19,7 @@ class SneakyThrowsSingle { try { System.out.println("test3"); throw new IOException(); - } catch (IOException $ex) { + } catch (final IOException $ex) { throw lombok.Lombok.sneakyThrow($ex); } } diff --git a/test/transform/resource/after-delombok/SynchronizedName.java b/test/transform/resource/after-delombok/SynchronizedName.java index 066e3bdf..e7dd23ff 100644 --- a/test/transform/resource/after-delombok/SynchronizedName.java +++ b/test/transform/resource/after-delombok/SynchronizedName.java @@ -2,7 +2,7 @@ class SynchronizedName { private Object read = new Object(); private static Object READ = new Object(); void test1() { - synchronized (read) { + synchronized (this.read) { System.out.println("one"); } } @@ -10,15 +10,17 @@ class SynchronizedName { System.out.println("two"); } static void test3() { - System.out.println("three"); + synchronized (SynchronizedName.read) { + System.out.println("three"); + } } void test4() { - synchronized (READ) { + synchronized (this.READ) { System.out.println("four"); } } void test5() { - synchronized (read) { + synchronized (this.read) { System.out.println("five"); } } -- cgit