From e6421509987c01e06b7c79ef406cc01ff174ae81 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Mon, 16 Jul 2012 22:04:39 +0200 Subject: Updated tests to reflect changes to delombok (delombok now kills super(), because attrib adds them even in places where that's wrong). Also split up the SynchronizedName test into separate cases for each expected failure mode. --- test/transform/resource/after-delombok/DataPlain.java | 1 - test/transform/resource/after-delombok/SneakyThrowsPlain.java | 1 - test/transform/resource/after-delombok/SynchronizedName.java | 11 ++--------- .../resource/after-delombok/SynchronizedNameNoSuchField.java | 7 +++++++ .../after-delombok/SynchronizedNameStaticToInstanceRef.java | 9 +++++++++ 5 files changed, 18 insertions(+), 11 deletions(-) create mode 100644 test/transform/resource/after-delombok/SynchronizedNameNoSuchField.java create mode 100644 test/transform/resource/after-delombok/SynchronizedNameStaticToInstanceRef.java (limited to 'test/transform/resource/after-delombok') diff --git a/test/transform/resource/after-delombok/DataPlain.java b/test/transform/resource/after-delombok/DataPlain.java index cb002e07..a8cb37af 100644 --- a/test/transform/resource/after-delombok/DataPlain.java +++ b/test/transform/resource/after-delombok/DataPlain.java @@ -155,7 +155,6 @@ final class Data3 { final class Data4 extends java.util.Timer { int x; Data4() { - super(); } @java.lang.SuppressWarnings("all") public int getX() { diff --git a/test/transform/resource/after-delombok/SneakyThrowsPlain.java b/test/transform/resource/after-delombok/SneakyThrowsPlain.java index 5c0890b5..f712ab55 100644 --- a/test/transform/resource/after-delombok/SneakyThrowsPlain.java +++ b/test/transform/resource/after-delombok/SneakyThrowsPlain.java @@ -1,6 +1,5 @@ class SneakyThrowsPlain { SneakyThrowsPlain() { - super(); try { System.out.println("constructor"); } catch (final java.lang.Throwable $ex) { diff --git a/test/transform/resource/after-delombok/SynchronizedName.java b/test/transform/resource/after-delombok/SynchronizedName.java index e7dd23ff..ab3c0431 100644 --- a/test/transform/resource/after-delombok/SynchronizedName.java +++ b/test/transform/resource/after-delombok/SynchronizedName.java @@ -1,19 +1,12 @@ class SynchronizedName { private Object read = new Object(); private static Object READ = new Object(); + void test1() { synchronized (this.read) { System.out.println("one"); } } - void test2() { - System.out.println("two"); - } - static void test3() { - synchronized (SynchronizedName.read) { - System.out.println("three"); - } - } void test4() { synchronized (this.READ) { System.out.println("four"); @@ -24,4 +17,4 @@ class SynchronizedName { System.out.println("five"); } } -} +} \ No newline at end of file diff --git a/test/transform/resource/after-delombok/SynchronizedNameNoSuchField.java b/test/transform/resource/after-delombok/SynchronizedNameNoSuchField.java new file mode 100644 index 00000000..d252985f --- /dev/null +++ b/test/transform/resource/after-delombok/SynchronizedNameNoSuchField.java @@ -0,0 +1,7 @@ +class SynchronizedNameNoSuchField { + private Object read = new Object(); + private static Object READ = new Object(); + void test2() { + System.out.println("two"); + } +} \ No newline at end of file diff --git a/test/transform/resource/after-delombok/SynchronizedNameStaticToInstanceRef.java b/test/transform/resource/after-delombok/SynchronizedNameStaticToInstanceRef.java new file mode 100644 index 00000000..8441570b --- /dev/null +++ b/test/transform/resource/after-delombok/SynchronizedNameStaticToInstanceRef.java @@ -0,0 +1,9 @@ +class SynchronizedNameStaticToInstanceRef { + private Object read = new Object(); + private static Object READ = new Object(); + static void test3() { + synchronized (SynchronizedNameStaticToInstanceRef.read) { + System.out.println("three"); + } + } +} \ No newline at end of file -- cgit