From d78135180c8f9e9f4c6c361679759d3eacb63be3 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Mon, 10 Feb 2014 21:56:35 +0100 Subject: [deps] Updated eclipse deps to 3.9 tree. This also enables testing java7 features on ecj. [Log] updated naming for @Log (topic= instead of mchmulder's 'value'). --- test/transform/resource/after-ecj/LoggerCommons.java | 2 +- test/transform/resource/after-ecj/LoggerJul.java | 2 +- test/transform/resource/after-ecj/LoggerLog4j.java | 2 +- test/transform/resource/after-ecj/LoggerLog4j2.java | 2 +- test/transform/resource/after-ecj/LoggerSlf4j.java | 2 +- test/transform/resource/after-ecj/LoggerXSlf4j.java | 2 +- .../resource/after-ecj/NonNullWithSneakyThrows.java | 3 ++- .../resource/after-ecj/SneakyThrowsMultiple.java | 18 ++++++++++++------ .../resource/after-ecj/SneakyThrowsPlain.java | 12 ++++++++---- .../resource/after-ecj/SneakyThrowsSingle.java | 9 ++++++--- test/transform/resource/after-ecj/ValComplex.java | 2 +- .../resource/after-ecj/ValInTryWithResources.java | 14 ++++++++++++++ test/transform/resource/after-ecj/ValLessSimple.java | 3 ++- 13 files changed, 51 insertions(+), 22 deletions(-) create mode 100644 test/transform/resource/after-ecj/ValInTryWithResources.java (limited to 'test/transform/resource/after-ecj') diff --git a/test/transform/resource/after-ecj/LoggerCommons.java b/test/transform/resource/after-ecj/LoggerCommons.java index 50d07a14..df102a12 100644 --- a/test/transform/resource/after-ecj/LoggerCommons.java +++ b/test/transform/resource/after-ecj/LoggerCommons.java @@ -15,7 +15,7 @@ import lombok.extern.apachecommons.CommonsLog; super(); } } -@CommonsLog("DifferentName") class LoggerCommonsWithDifferentName { +@CommonsLog(topic = "DifferentName") class LoggerCommonsWithDifferentName { private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog("DifferentName"); () { } diff --git a/test/transform/resource/after-ecj/LoggerJul.java b/test/transform/resource/after-ecj/LoggerJul.java index 3aa8181d..8aa4f59a 100644 --- a/test/transform/resource/after-ecj/LoggerJul.java +++ b/test/transform/resource/after-ecj/LoggerJul.java @@ -15,7 +15,7 @@ import lombok.extern.java.Log; super(); } } -@Log("DifferentName") class LoggerJulWithDifferentName { +@Log(topic = "DifferentName") class LoggerJulWithDifferentName { private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger("DifferentName"); () { } diff --git a/test/transform/resource/after-ecj/LoggerLog4j.java b/test/transform/resource/after-ecj/LoggerLog4j.java index a6c52d61..948412e2 100644 --- a/test/transform/resource/after-ecj/LoggerLog4j.java +++ b/test/transform/resource/after-ecj/LoggerLog4j.java @@ -15,7 +15,7 @@ import lombok.extern.log4j.Log4j; super(); } } -@Log4j("DifferentName") class LoggerLog4jWithDifferentName { +@Log4j(topic = "DifferentName") class LoggerLog4jWithDifferentName { private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger("DifferentName"); () { } diff --git a/test/transform/resource/after-ecj/LoggerLog4j2.java b/test/transform/resource/after-ecj/LoggerLog4j2.java index 3243ef2d..c2fcd428 100644 --- a/test/transform/resource/after-ecj/LoggerLog4j2.java +++ b/test/transform/resource/after-ecj/LoggerLog4j2.java @@ -15,7 +15,7 @@ import lombok.extern.log4j.Log4j2; super(); } } -@Log4j2("DifferentName") class LoggerLog4j2WithDifferentName { +@Log4j2(topic = "DifferentName") class LoggerLog4j2WithDifferentName { private static final org.apache.logging.log4j.Logger log = org.apache.logging.log4j.LogManager.getLogger("DifferentName"); () { } diff --git a/test/transform/resource/after-ecj/LoggerSlf4j.java b/test/transform/resource/after-ecj/LoggerSlf4j.java index a34f85d7..9c5405cb 100644 --- a/test/transform/resource/after-ecj/LoggerSlf4j.java +++ b/test/transform/resource/after-ecj/LoggerSlf4j.java @@ -29,7 +29,7 @@ class LoggerSlf4jOuter { } } -@Slf4j("DifferentLogger") class LoggerSlf4jWithDifferentLoggerName { +@Slf4j(topic = "DifferentLogger") class LoggerSlf4jWithDifferentLoggerName { private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger("DifferentLogger"); () { } diff --git a/test/transform/resource/after-ecj/LoggerXSlf4j.java b/test/transform/resource/after-ecj/LoggerXSlf4j.java index 4cd4cb94..916859a4 100644 --- a/test/transform/resource/after-ecj/LoggerXSlf4j.java +++ b/test/transform/resource/after-ecj/LoggerXSlf4j.java @@ -15,7 +15,7 @@ import lombok.extern.slf4j.XSlf4j; super(); } } -@XSlf4j("DifferentName") class LoggerXSlf4jWithDifferentName { +@XSlf4j(topic = "DifferentName") class LoggerXSlf4jWithDifferentName { private static final org.slf4j.ext.XLogger log = org.slf4j.ext.XLoggerFactory.getXLogger("DifferentName"); () { } diff --git a/test/transform/resource/after-ecj/NonNullWithSneakyThrows.java b/test/transform/resource/after-ecj/NonNullWithSneakyThrows.java index fac8dcdd..1a57be29 100644 --- a/test/transform/resource/after-ecj/NonNullWithSneakyThrows.java +++ b/test/transform/resource/after-ecj/NonNullWithSneakyThrows.java @@ -11,7 +11,8 @@ class NonNullWithSneakyThrows { } System.out.println(in); } - catch (final java.lang.Throwable $ex) { + catch (final java.lang.Throwable $ex) + { throw lombok.Lombok.sneakyThrow($ex); } } diff --git a/test/transform/resource/after-ecj/SneakyThrowsMultiple.java b/test/transform/resource/after-ecj/SneakyThrowsMultiple.java index 82eda411..65862c2b 100644 --- a/test/transform/resource/after-ecj/SneakyThrowsMultiple.java +++ b/test/transform/resource/after-ecj/SneakyThrowsMultiple.java @@ -13,11 +13,13 @@ class SneakyThrowsMultiple { System.out.println("test1"); throw new IOException(); } - catch (final IOException $ex) { + catch (final IOException $ex) + { throw lombok.Lombok.sneakyThrow($ex); } } - catch (final Throwable $ex) { + catch (final Throwable $ex) + { throw lombok.Lombok.sneakyThrow($ex); } } @@ -36,11 +38,13 @@ class SneakyThrowsMultiple { throw new AWTException("WHAT"); } } - catch (final AWTException $ex) { + catch (final AWTException $ex) + { throw lombok.Lombok.sneakyThrow($ex); } } - catch (final IOException $ex) { + catch (final IOException $ex) + { throw lombok.Lombok.sneakyThrow($ex); } } @@ -52,11 +56,13 @@ class SneakyThrowsMultiple { System.out.println("test3"); throw new IOException(); } - catch (final IOException $ex) { + catch (final IOException $ex) + { throw lombok.Lombok.sneakyThrow($ex); } } - catch (final Throwable $ex) { + catch (final Throwable $ex) + { throw lombok.Lombok.sneakyThrow($ex); } } diff --git a/test/transform/resource/after-ecj/SneakyThrowsPlain.java b/test/transform/resource/after-ecj/SneakyThrowsPlain.java index 1b45dc5a..df436891 100644 --- a/test/transform/resource/after-ecj/SneakyThrowsPlain.java +++ b/test/transform/resource/after-ecj/SneakyThrowsPlain.java @@ -6,7 +6,8 @@ class SneakyThrowsPlain { { System.out.println("constructor"); } - catch (final java.lang.Throwable $ex) { + catch (final java.lang.Throwable $ex) + { throw lombok.Lombok.sneakyThrow($ex); } } @@ -16,7 +17,8 @@ class SneakyThrowsPlain { { System.out.println("constructor2"); } - catch (final java.lang.Throwable $ex) { + catch (final java.lang.Throwable $ex) + { throw lombok.Lombok.sneakyThrow($ex); } } @@ -25,7 +27,8 @@ class SneakyThrowsPlain { { System.out.println("test1"); } - catch (final java.lang.Throwable $ex) { + catch (final java.lang.Throwable $ex) + { throw lombok.Lombok.sneakyThrow($ex); } } @@ -34,7 +37,8 @@ class SneakyThrowsPlain { { System.out.println("test2"); } - catch (final java.lang.Throwable $ex) { + catch (final java.lang.Throwable $ex) + { throw lombok.Lombok.sneakyThrow($ex); } } diff --git a/test/transform/resource/after-ecj/SneakyThrowsSingle.java b/test/transform/resource/after-ecj/SneakyThrowsSingle.java index eea593f2..073d690a 100644 --- a/test/transform/resource/after-ecj/SneakyThrowsSingle.java +++ b/test/transform/resource/after-ecj/SneakyThrowsSingle.java @@ -8,7 +8,8 @@ class SneakyThrowsSingle { { System.out.println("test1"); } - catch (final Throwable $ex) { + catch (final Throwable $ex) + { throw lombok.Lombok.sneakyThrow($ex); } } @@ -18,7 +19,8 @@ class SneakyThrowsSingle { System.out.println("test2"); throw new IOException(); } - catch (final IOException $ex) { + catch (final IOException $ex) + { throw lombok.Lombok.sneakyThrow($ex); } } @@ -28,7 +30,8 @@ class SneakyThrowsSingle { System.out.println("test3"); throw new IOException(); } - catch (final IOException $ex) { + catch (final IOException $ex) + { throw lombok.Lombok.sneakyThrow($ex); } } diff --git a/test/transform/resource/after-ecj/ValComplex.java b/test/transform/resource/after-ecj/ValComplex.java index 6e435e56..746e3088 100644 --- a/test/transform/resource/after-ecj/ValComplex.java +++ b/test/transform/resource/after-ecj/ValComplex.java @@ -16,7 +16,7 @@ public class ValComplex { final @val int field = 20; final @val int inner = 10; switch (field) { - case 5 : ; + case 5 : final @val char[] shouldBeCharArray2 = shouldBeCharArray; final @val int innerInner = inner; } diff --git a/test/transform/resource/after-ecj/ValInTryWithResources.java b/test/transform/resource/after-ecj/ValInTryWithResources.java new file mode 100644 index 00000000..a532d48c --- /dev/null +++ b/test/transform/resource/after-ecj/ValInTryWithResources.java @@ -0,0 +1,14 @@ +import lombok.val; +import java.io.IOException; +public class ValInTryWithResources { + public ValInTryWithResources() { + super(); + } + public void whyTryInsteadOfCleanup() throws IOException { + try (final @val java.io.InputStream in = getClass().getResourceAsStream("ValInTryWithResources.class")) + { + final @val java.io.InputStream i = in; + final @val int j = in.read(); + } + } +} diff --git a/test/transform/resource/after-ecj/ValLessSimple.java b/test/transform/resource/after-ecj/ValLessSimple.java index c7587f91..28772d68 100644 --- a/test/transform/resource/after-ecj/ValLessSimple.java +++ b/test/transform/resource/after-ecj/ValLessSimple.java @@ -32,7 +32,8 @@ public class ValLessSimple { { final @val int x = (1 / 0); } - catch (ArithmeticException e) { + catch (ArithmeticException e) + { final @val int y = 0; } } -- cgit