diff options
Diffstat (limited to 'test/transform/resource/after-ecj')
26 files changed, 121 insertions, 40 deletions
diff --git a/test/transform/resource/after-ecj/Accessors.java b/test/transform/resource/after-ecj/Accessors.java index 292db928..c8fdc3bf 100644 --- a/test/transform/resource/after-ecj/Accessors.java +++ b/test/transform/resource/after-ecj/Accessors.java @@ -90,7 +90,7 @@ class AccessorsChain { return (other instanceof AccessorsPrefix3); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - final int PRIME = 31; + final int PRIME = 59; int result = 1; final java.lang.Object $fName = this.getName(); result = ((result * PRIME) + (($fName == null) ? 0 : $fName.hashCode())); diff --git a/test/transform/resource/after-ecj/DataExtended.java b/test/transform/resource/after-ecj/DataExtended.java index 1de635e3..bcfd26e3 100644 --- a/test/transform/resource/after-ecj/DataExtended.java +++ b/test/transform/resource/after-ecj/DataExtended.java @@ -22,7 +22,7 @@ return (other instanceof DataExtended); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - final int PRIME = 31; + final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.getX()); return result; diff --git a/test/transform/resource/after-ecj/DataIgnore.java b/test/transform/resource/after-ecj/DataIgnore.java index 7d99a20f..d0e72e15 100644 --- a/test/transform/resource/after-ecj/DataIgnore.java +++ b/test/transform/resource/after-ecj/DataIgnore.java @@ -20,7 +20,7 @@ return (other instanceof DataIgnore); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - final int PRIME = 31; + final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.getX()); return result; diff --git a/test/transform/resource/after-ecj/DataOnLocalClass.java b/test/transform/resource/after-ecj/DataOnLocalClass.java index 2f8dcca1..511291c2 100644 --- a/test/transform/resource/after-ecj/DataOnLocalClass.java +++ b/test/transform/resource/after-ecj/DataOnLocalClass.java @@ -36,7 +36,7 @@ class DataOnLocalClass1 { return (other instanceof Local); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - final int PRIME = 31; + final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.getX()); final java.lang.Object $name = this.getName(); @@ -86,7 +86,7 @@ class DataOnLocalClass2 { return (other instanceof Local.InnerLocal); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - final int PRIME = 31; + final int PRIME = 59; int result = 1; final java.lang.Object $name = this.getName(); result = ((result * PRIME) + (($name == null) ? 0 : $name.hashCode())); @@ -124,7 +124,7 @@ class DataOnLocalClass2 { return (other instanceof Local); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - final int PRIME = 31; + final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.getX()); return result; diff --git a/test/transform/resource/after-ecj/DataPlain.java b/test/transform/resource/after-ecj/DataPlain.java index 1b33070b..aa47fdaa 100644 --- a/test/transform/resource/after-ecj/DataPlain.java +++ b/test/transform/resource/after-ecj/DataPlain.java @@ -31,7 +31,7 @@ import lombok.Data; return (other instanceof Data1); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - final int PRIME = 31; + final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.getX()); final java.lang.Object $name = this.getName(); @@ -78,7 +78,7 @@ import lombok.Data; return (other instanceof Data2); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - final int PRIME = 31; + final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.getX()); final java.lang.Object $name = this.getName(); @@ -120,7 +120,7 @@ final @Data class Data3 { return true; } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - final int PRIME = 31; + final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.getX()); final java.lang.Object $name = this.getName(); @@ -167,7 +167,7 @@ final @Data @lombok.EqualsAndHashCode(callSuper = true) class Data4 extends java return (other instanceof Data4); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - final int PRIME = 31; + final int PRIME = 59; int result = 1; result = ((result * PRIME) + super.hashCode()); result = ((result * PRIME) + this.getX()); diff --git a/test/transform/resource/after-ecj/DataWithGetter.java b/test/transform/resource/after-ecj/DataWithGetter.java index 9d3dfd3e..2ce74ceb 100644 --- a/test/transform/resource/after-ecj/DataWithGetter.java +++ b/test/transform/resource/after-ecj/DataWithGetter.java @@ -30,7 +30,7 @@ return (other instanceof DataWithGetter); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - final int PRIME = 31; + final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.getX()); result = ((result * PRIME) + this.getY()); diff --git a/test/transform/resource/after-ecj/DataWithGetterNone.java b/test/transform/resource/after-ecj/DataWithGetterNone.java index b6b391c8..087d0762 100644 --- a/test/transform/resource/after-ecj/DataWithGetterNone.java +++ b/test/transform/resource/after-ecj/DataWithGetterNone.java @@ -30,7 +30,7 @@ return (other instanceof DataWithGetterNone); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - final int PRIME = 31; + final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.x); result = ((result * PRIME) + this.y); diff --git a/test/transform/resource/after-ecj/EqualsAndHashCode.java b/test/transform/resource/after-ecj/EqualsAndHashCode.java index 33ef799d..625a0f87 100644 --- a/test/transform/resource/after-ecj/EqualsAndHashCode.java +++ b/test/transform/resource/after-ecj/EqualsAndHashCode.java @@ -35,7 +35,7 @@ return (other instanceof EqualsAndHashCode); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - final int PRIME = 31; + final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.x); result = ((result * PRIME) + java.util.Arrays.hashCode(this.y)); @@ -52,6 +52,7 @@ final @lombok.EqualsAndHashCode class EqualsAndHashCode2 { long y; float f; double d; + boolean b; EqualsAndHashCode2() { super(); } @@ -69,10 +70,12 @@ final @lombok.EqualsAndHashCode class EqualsAndHashCode2 { return false; if ((java.lang.Double.compare(this.d, other.d) != 0)) return false; + if ((this.b != other.b)) + return false; return true; } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - final int PRIME = 31; + final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.x); final long $y = this.y; @@ -80,6 +83,7 @@ final @lombok.EqualsAndHashCode class EqualsAndHashCode2 { result = ((result * PRIME) + java.lang.Float.floatToIntBits(this.f)); final long $d = java.lang.Double.doubleToLongBits(this.d); result = ((result * PRIME) + (int) ($d ^ ($d >>> 32))); + result = ((result * PRIME) + (this.b ? 79 : 97)); return result; } } @@ -125,7 +129,7 @@ final @lombok.EqualsAndHashCode(callSuper = false) class EqualsAndHashCode3 exte return (other instanceof EqualsAndHashCode4); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - final int PRIME = 31; + final int PRIME = 59; int result = 1; result = ((result * PRIME) + super.hashCode()); return result; diff --git a/test/transform/resource/after-ecj/EqualsAndHashCodeWithSomeExistingMethods.java b/test/transform/resource/after-ecj/EqualsAndHashCodeWithSomeExistingMethods.java index cdd771a4..05f7ad97 100644 --- a/test/transform/resource/after-ecj/EqualsAndHashCodeWithSomeExistingMethods.java +++ b/test/transform/resource/after-ecj/EqualsAndHashCodeWithSomeExistingMethods.java @@ -57,7 +57,7 @@ import static lombok.AccessLevel.NONE; return (other instanceof EqualsAndHashCodeWithNoExistingMethods); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - final int PRIME = 31; + final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.x); return result; diff --git a/test/transform/resource/after-ecj/GetterLazyBoolean.java b/test/transform/resource/after-ecj/GetterLazyBoolean.java index a51b164f..c37eece2 100644 --- a/test/transform/resource/after-ecj/GetterLazyBoolean.java +++ b/test/transform/resource/after-ecj/GetterLazyBoolean.java @@ -57,9 +57,9 @@ return (other instanceof GetterLazyBoolean); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - final int PRIME = 31; + final int PRIME = 59; int result = 1; - result = ((result * PRIME) + (this.isBooleanValue() ? 1231 : 1237)); + result = ((result * PRIME) + (this.isBooleanValue() ? 79 : 97)); return result; } public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { diff --git a/test/transform/resource/after-ecj/GetterLazyEahcToString.java b/test/transform/resource/after-ecj/GetterLazyEahcToString.java index db2d4fcf..da9f6a83 100644 --- a/test/transform/resource/after-ecj/GetterLazyEahcToString.java +++ b/test/transform/resource/after-ecj/GetterLazyEahcToString.java @@ -46,7 +46,7 @@ return (other instanceof GetterLazyEahcToString); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - final int PRIME = 31; + final int PRIME = 59; int result = 1; final java.lang.Object $value = this.getValue(); result = ((result * PRIME) + (($value == null) ? 0 : $value.hashCode())); diff --git a/test/transform/resource/after-ecj/GetterSetterJavadoc.java b/test/transform/resource/after-ecj/GetterSetterJavadoc.java index 73f26180..b7fc15b8 100644 --- a/test/transform/resource/after-ecj/GetterSetterJavadoc.java +++ b/test/transform/resource/after-ecj/GetterSetterJavadoc.java @@ -22,7 +22,7 @@ return (other instanceof GetterSetterJavadoc1); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - final int PRIME = 31; + final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.getFieldName()); return result; diff --git a/test/transform/resource/after-ecj/LoggerCommons.java b/test/transform/resource/after-ecj/LoggerCommons.java index d63bb9c1..df102a12 100644 --- a/test/transform/resource/after-ecj/LoggerCommons.java +++ b/test/transform/resource/after-ecj/LoggerCommons.java @@ -14,4 +14,12 @@ import lombok.extern.apachecommons.CommonsLog; LoggerCommonsWithImport() { super(); } +} +@CommonsLog(topic = "DifferentName") class LoggerCommonsWithDifferentName { + private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog("DifferentName"); + <clinit>() { + } + LoggerCommonsWithDifferentName() { + super(); + } }
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/LoggerJul.java b/test/transform/resource/after-ecj/LoggerJul.java index c98dfe27..8aa4f59a 100644 --- a/test/transform/resource/after-ecj/LoggerJul.java +++ b/test/transform/resource/after-ecj/LoggerJul.java @@ -14,4 +14,12 @@ import lombok.extern.java.Log; LoggerJulWithImport() { super(); } +} +@Log(topic = "DifferentName") class LoggerJulWithDifferentName { + private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger("DifferentName"); + <clinit>() { + } + LoggerJulWithDifferentName() { + super(); + } }
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/LoggerLog4j.java b/test/transform/resource/after-ecj/LoggerLog4j.java index 6814be7b..948412e2 100644 --- a/test/transform/resource/after-ecj/LoggerLog4j.java +++ b/test/transform/resource/after-ecj/LoggerLog4j.java @@ -14,4 +14,12 @@ import lombok.extern.log4j.Log4j; LoggerLog4jWithImport() { super(); } +} +@Log4j(topic = "DifferentName") class LoggerLog4jWithDifferentName { + private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger("DifferentName"); + <clinit>() { + } + LoggerLog4jWithDifferentName() { + super(); + } }
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/LoggerLog4j2.java b/test/transform/resource/after-ecj/LoggerLog4j2.java index c1368e5d..c2fcd428 100644 --- a/test/transform/resource/after-ecj/LoggerLog4j2.java +++ b/test/transform/resource/after-ecj/LoggerLog4j2.java @@ -14,4 +14,12 @@ import lombok.extern.log4j.Log4j2; LoggerLog4j2WithImport() { super(); } +} +@Log4j2(topic = "DifferentName") class LoggerLog4j2WithDifferentName { + private static final org.apache.logging.log4j.Logger log = org.apache.logging.log4j.LogManager.getLogger("DifferentName"); + <clinit>() { + } + LoggerLog4j2WithDifferentName() { + super(); + } }
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/LoggerSlf4j.java b/test/transform/resource/after-ecj/LoggerSlf4j.java index 1ccf5c9e..9c5405cb 100644 --- a/test/transform/resource/after-ecj/LoggerSlf4j.java +++ b/test/transform/resource/after-ecj/LoggerSlf4j.java @@ -27,4 +27,13 @@ class LoggerSlf4jOuter { LoggerSlf4jOuter() { super(); } +} + +@Slf4j(topic = "DifferentLogger") class LoggerSlf4jWithDifferentLoggerName { + private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger("DifferentLogger"); + <clinit>() { + } + LoggerSlf4jWithDifferentLoggerName() { + super(); + } }
\ No newline at end of file diff --git a/test/transform/resource/after-ecj/LoggerXSlf4j.java b/test/transform/resource/after-ecj/LoggerXSlf4j.java index f05e1ae7..916859a4 100644 --- a/test/transform/resource/after-ecj/LoggerXSlf4j.java +++ b/test/transform/resource/after-ecj/LoggerXSlf4j.java @@ -14,4 +14,12 @@ import lombok.extern.slf4j.XSlf4j; LoggerXSlf4jWithImport() { super(); } +} +@XSlf4j(topic = "DifferentName") class LoggerXSlf4jWithDifferentName { + private static final org.slf4j.ext.XLogger log = org.slf4j.ext.XLoggerFactory.getXLogger("DifferentName"); + <clinit>() { + } + LoggerXSlf4jWithDifferentName() { + super(); + } }
\ No newline at end of file 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 index 5b354bdf..a532d48c 100644 --- a/test/transform/resource/after-ecj/ValInTryWithResources.java +++ b/test/transform/resource/after-ecj/ValInTryWithResources.java @@ -1 +1,14 @@ -//ignore: This is a J7 feature that isn't turned on in the ecj variant we use to run the tests. We need to update that ecj at some point and enable this test.
\ No newline at end of file +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; } } diff --git a/test/transform/resource/after-ecj/ValuePlain.java b/test/transform/resource/after-ecj/ValuePlain.java index d095913f..5ca32af8 100644 --- a/test/transform/resource/after-ecj/ValuePlain.java +++ b/test/transform/resource/after-ecj/ValuePlain.java @@ -23,7 +23,7 @@ final @lombok.Value class Value1 { return true; } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - final int PRIME = 31; + final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.getX()); final java.lang.Object $name = this.getName(); @@ -68,7 +68,7 @@ final @lombok.Value class Value1 { return (other instanceof Value2); } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - final int PRIME = 31; + final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.getX()); final java.lang.Object $name = this.getName(); @@ -106,7 +106,7 @@ final @Value class Value3 { return true; } public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() { - final int PRIME = 31; + final int PRIME = 59; int result = 1; result = ((result * PRIME) + this.getX()); result = ((result * PRIME) + this.getY()); |