diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2010-07-21 23:52:28 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2010-07-21 23:52:28 +0200 |
commit | 59e585a0c68959eb72be34524bdad19df5dc8a4d (patch) | |
tree | 72860f9fce0a62bb1d0e8dbe3a021f4bd8f20ab4 /test/transform/resource/after-delombok | |
parent | 1a9f8f168aa17f77c6e27d0a740b5f7614fb5c90 (diff) | |
download | lombok-59e585a0c68959eb72be34524bdad19df5dc8a4d.tar.gz lombok-59e585a0c68959eb72be34524bdad19df5dc8a4d.tar.bz2 lombok-59e585a0c68959eb72be34524bdad19df5dc8a4d.zip |
refactored the tests to prepare running ecj as well as delombok.
Diffstat (limited to 'test/transform/resource/after-delombok')
26 files changed, 891 insertions, 0 deletions
diff --git a/test/transform/resource/after-delombok/ClassNamedAfterGetter.java b/test/transform/resource/after-delombok/ClassNamedAfterGetter.java new file mode 100644 index 00000000..769aaf7c --- /dev/null +++ b/test/transform/resource/after-delombok/ClassNamedAfterGetter.java @@ -0,0 +1,7 @@ +class GetFoo { + private int foo; + @java.lang.SuppressWarnings("all") + public int getFoo() { + return this.foo; + } +} diff --git a/test/transform/resource/after-delombok/CleanupName.java b/test/transform/resource/after-delombok/CleanupName.java new file mode 100644 index 00000000..cd29eb68 --- /dev/null +++ b/test/transform/resource/after-delombok/CleanupName.java @@ -0,0 +1,18 @@ +class CleanupName { + void test() { + Object o = "Hello World!"; + try { + System.out.println(o); + } finally { + o.toString(); + } + } + void test2() { + Object o = "Hello World too!"; + try { + System.out.println(o); + } finally { + o.toString(); + } + } +} diff --git a/test/transform/resource/after-delombok/CleanupPlain.java b/test/transform/resource/after-delombok/CleanupPlain.java new file mode 100644 index 00000000..35d51543 --- /dev/null +++ b/test/transform/resource/after-delombok/CleanupPlain.java @@ -0,0 +1,18 @@ +import java.io.*; +class CleanupPlain { + void test() throws Exception { + InputStream in = new FileInputStream("in"); + try { + OutputStream out = new FileOutputStream("out"); + try { + if (in.markSupported()) { + out.flush(); + } + } finally { + out.close(); + } + } finally { + in.close(); + } + } +} diff --git a/test/transform/resource/after-delombok/CommentsInterspersed.java b/test/transform/resource/after-delombok/CommentsInterspersed.java new file mode 100644 index 00000000..5aaafe42 --- /dev/null +++ b/test/transform/resource/after-delombok/CommentsInterspersed.java @@ -0,0 +1,16 @@ +/* cmt *//* cmt2 */ /* cmt3 */ /*bla */ +public class CommentsInterspersed { + /** javadoc for field */ + private int x; + /* bla2 */ private String test = "foo"; //$NON-NLS-1$ + /** Javadoc on method */ + public native void gwtTest(); /*-{ + javascript; + }-*/ + @java.lang.SuppressWarnings("all") + public String getTest() { + return this.test; + } +} //haha! +//hahaha! +//hahahaha! diff --git a/test/transform/resource/after-delombok/DataExtended.java b/test/transform/resource/after-delombok/DataExtended.java new file mode 100644 index 00000000..6f55bc2c --- /dev/null +++ b/test/transform/resource/after-delombok/DataExtended.java @@ -0,0 +1,37 @@ +class DataExtended { + int x; + @java.lang.SuppressWarnings("all") + public DataExtended() { + } + @java.lang.SuppressWarnings("all") + public int getX() { + return this.x; + } + @java.lang.SuppressWarnings("all") + public void setX(final int x) { + this.x = x; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public boolean equals(final java.lang.Object o) { + if (o == this) return true; + if (o == null) return false; + if (o.getClass() != this.getClass()) return false; + final DataExtended other = (DataExtended)o; + if (this.getX() != other.getX()) return false; + return true; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public int hashCode() { + final int PRIME = 31; + int result = 1; + result = result * PRIME + this.getX(); + return result; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "DataExtended(x=" + this.x + ")"; + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/DataIgnore.java b/test/transform/resource/after-delombok/DataIgnore.java new file mode 100644 index 00000000..7e81432d --- /dev/null +++ b/test/transform/resource/after-delombok/DataIgnore.java @@ -0,0 +1,36 @@ +class DataIgnore { + final int x; + String $name; + @java.beans.ConstructorProperties({"x"}) + @java.lang.SuppressWarnings("all") + public DataIgnore(final int x) { + this.x = x; + } + @java.lang.SuppressWarnings("all") + public int getX() { + return this.x; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public boolean equals(final java.lang.Object o) { + if (o == this) return true; + if (o == null) return false; + if (o.getClass() != this.getClass()) return false; + final DataIgnore other = (DataIgnore)o; + if (this.getX() != other.getX()) return false; + return true; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public int hashCode() { + final int PRIME = 31; + int result = 1; + result = result * PRIME + this.getX(); + return result; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "DataIgnore(x=" + this.getX() + ")"; + } +} diff --git a/test/transform/resource/after-delombok/DataPlain.java b/test/transform/resource/after-delombok/DataPlain.java new file mode 100644 index 00000000..1e11a33d --- /dev/null +++ b/test/transform/resource/after-delombok/DataPlain.java @@ -0,0 +1,92 @@ +class Data1 { + final int x; + String name; + @java.beans.ConstructorProperties({"x"}) + @java.lang.SuppressWarnings("all") + public Data1(final int x) { + this.x = x; + } + @java.lang.SuppressWarnings("all") + public int getX() { + return this.x; + } + @java.lang.SuppressWarnings("all") + public String getName() { + return this.name; + } + @java.lang.SuppressWarnings("all") + public void setName(final String name) { + this.name = name; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public boolean equals(final java.lang.Object o) { + if (o == this) return true; + if (o == null) return false; + if (o.getClass() != this.getClass()) return false; + final Data1 other = (Data1)o; + if (this.getX() != other.getX()) return false; + if (this.getName() == null ? other.getName() != null : !this.getName().equals(other.getName())) return false; + return true; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public int hashCode() { + final int PRIME = 31; + int result = 1; + result = result * PRIME + this.getX(); + result = result * PRIME + (this.getName() == null ? 0 : this.getName().hashCode()); + return result; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "Data1(x=" + this.getX() + ", name=" + this.getName() + ")"; + } +} +class Data2 { + final int x; + String name; + @java.beans.ConstructorProperties({"x"}) + @java.lang.SuppressWarnings("all") + public Data2(final int x) { + this.x = x; + } + @java.lang.SuppressWarnings("all") + public int getX() { + return this.x; + } + @java.lang.SuppressWarnings("all") + public String getName() { + return this.name; + } + @java.lang.SuppressWarnings("all") + public void setName(final String name) { + this.name = name; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public boolean equals(final java.lang.Object o) { + if (o == this) return true; + if (o == null) return false; + if (o.getClass() != this.getClass()) return false; + final Data2 other = (Data2)o; + if (this.getX() != other.getX()) return false; + if (this.getName() == null ? other.getName() != null : !this.getName().equals(other.getName())) return false; + return true; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public int hashCode() { + final int PRIME = 31; + int result = 1; + result = result * PRIME + this.getX(); + result = result * PRIME + (this.getName() == null ? 0 : this.getName().hashCode()); + return result; + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "Data2(x=" + this.getX() + ", name=" + this.getName() + ")"; + } +} diff --git a/test/transform/resource/after-delombok/GetterAccessLevel.java b/test/transform/resource/after-delombok/GetterAccessLevel.java new file mode 100644 index 00000000..6d977d87 --- /dev/null +++ b/test/transform/resource/after-delombok/GetterAccessLevel.java @@ -0,0 +1,49 @@ +class GetterAccessLevel { + boolean isNone; + boolean isPrivate; + boolean isPackage; + boolean isProtected; + boolean isPublic; + String noneString; + String privateString; + String packageString; + String protectedString; + String publicString; + String value; + @java.lang.SuppressWarnings("all") + private boolean isPrivate() { + return this.isPrivate; + } + @java.lang.SuppressWarnings("all") + boolean isPackage() { + return this.isPackage; + } + @java.lang.SuppressWarnings("all") + protected boolean isProtected() { + return this.isProtected; + } + @java.lang.SuppressWarnings("all") + public boolean isPublic() { + return this.isPublic; + } + @java.lang.SuppressWarnings("all") + private String getPrivateString() { + return this.privateString; + } + @java.lang.SuppressWarnings("all") + String getPackageString() { + return this.packageString; + } + @java.lang.SuppressWarnings("all") + protected String getProtectedString() { + return this.protectedString; + } + @java.lang.SuppressWarnings("all") + public String getPublicString() { + return this.publicString; + } + @java.lang.SuppressWarnings("all") + public String getValue() { + return this.value; + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/GetterAlreadyExists.java b/test/transform/resource/after-delombok/GetterAlreadyExists.java new file mode 100644 index 00000000..6a5377ba --- /dev/null +++ b/test/transform/resource/after-delombok/GetterAlreadyExists.java @@ -0,0 +1,140 @@ +class Getter1 { + boolean foo; + boolean hasFoo() { + return true; + } +} +class Getter2 { + boolean foo; + boolean isFoo() { + return true; + } +} +class Getter3 { + boolean foo; + boolean getFoo() { + return true; + } +} +class Getter4 { + String foo; + String hasFoo() { + return null; + } + @java.lang.SuppressWarnings("all") + public String getFoo() { + return this.foo; + } +} +class Getter5 { + String foo; + String isFoo() { + return null; + } + @java.lang.SuppressWarnings("all") + public String getFoo() { + return this.foo; + } +} +class Getter6 { + String foo; + String getFoo() { + return null; + } +} +class Getter7 { + String foo; + boolean hasFoo() { + return false; + } + @java.lang.SuppressWarnings("all") + public String getFoo() { + return this.foo; + } +} +class Getter8 { + String foo; + boolean isFoo() { + return false; + } + @java.lang.SuppressWarnings("all") + public String getFoo() { + return this.foo; + } +} +class Getter9 { + String foo; + boolean getFoo() { + return false; + } +} +class Getter10 { + boolean foo; + static boolean hasFoo() { + return false; + } +} +class Getter11 { + boolean foo; + static boolean isFoo() { + return false; + } +} +class Getter12 { + boolean foo; + static boolean getFoo() { + return false; + } +} +class Getter13 { + String foo; + static boolean hasFoo() { + return false; + } + @java.lang.SuppressWarnings("all") + public String getFoo() { + return this.foo; + } +} +class Getter14 { + String foo; + static boolean isFoo() { + return false; + } + @java.lang.SuppressWarnings("all") + public String getFoo() { + return this.foo; + } +} +class Getter15 { + String foo; + static boolean getFoo() { + return false; + } +} +class Getter16 { + String foo; + static String hasFoo() { + return false; + } + @java.lang.SuppressWarnings("all") + public String getFoo() { + return this.foo; + } +} +class Getter17 { + String foo; + static String isFoo() { + return false; + } + @java.lang.SuppressWarnings("all") + public String getFoo() { + return this.foo; + } +} +class Getter18 { + String foo; + static String getFoo() { + return false; + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/GetterBoolean.java b/test/transform/resource/after-delombok/GetterBoolean.java new file mode 100644 index 00000000..a727e49b --- /dev/null +++ b/test/transform/resource/after-delombok/GetterBoolean.java @@ -0,0 +1,23 @@ +class Getter { + boolean foo; + boolean isBar; + boolean hasBaz; + @java.lang.SuppressWarnings("all") + public boolean isFoo() { + return this.foo; + } + @java.lang.SuppressWarnings("all") + public boolean isBar() { + return this.isBar; + } + @java.lang.SuppressWarnings("all") + public boolean hasBaz() { + return this.hasBaz; + } +} +class MoreGetter { + boolean foo; + boolean hasFoo() { + return true; + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/GetterOnClass.java b/test/transform/resource/after-delombok/GetterOnClass.java new file mode 100644 index 00000000..bd15ce35 --- /dev/null +++ b/test/transform/resource/after-delombok/GetterOnClass.java @@ -0,0 +1,59 @@ +class GetterOnClass1 { + boolean isNone; + boolean isPublic; + @java.lang.SuppressWarnings("all") + public boolean isPublic() { + return this.isPublic; + } +} +class GetterOnClass2 { + boolean isNone; + boolean isProtected; + boolean isPackage; + @java.lang.SuppressWarnings("all") + protected boolean isProtected() { + return this.isProtected; + } + @java.lang.SuppressWarnings("all") + boolean isPackage() { + return this.isPackage; + } +} +class GetterOnClass3 { + boolean isNone; + boolean isPackage; + @java.lang.SuppressWarnings("all") + boolean isPackage() { + return this.isPackage; + } +} +class GetterOnClass4 { + boolean isNone; + boolean isPrivate; + @java.lang.SuppressWarnings("all") + private boolean isPrivate() { + return this.isPrivate; + } +} +class GetterOnClass5 { + boolean isNone; + boolean isPublic; + @java.lang.SuppressWarnings("all") + public boolean isPublic() { + return this.isPublic; + } +} +class GetterOnClass6 { + String couldBeNull; + @lombok.NonNull + String nonNull; + @java.lang.SuppressWarnings("all") + public String getCouldBeNull() { + return this.couldBeNull; + } + @lombok.NonNull + @java.lang.SuppressWarnings("all") + public String getNonNull() { + return this.nonNull; + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/GetterPlain.java b/test/transform/resource/after-delombok/GetterPlain.java new file mode 100644 index 00000000..359d46e2 --- /dev/null +++ b/test/transform/resource/after-delombok/GetterPlain.java @@ -0,0 +1,12 @@ +class GetterPlain { + int i; + int foo; + @java.lang.SuppressWarnings("all") + public int getI() { + return this.i; + } + @java.lang.SuppressWarnings("all") + public int getFoo() { + return this.foo; + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/GetterWithDollar.java b/test/transform/resource/after-delombok/GetterWithDollar.java new file mode 100644 index 00000000..9e02ccb8 --- /dev/null +++ b/test/transform/resource/after-delombok/GetterWithDollar.java @@ -0,0 +1,15 @@ +class GetterWithDollar1 { + int $i; + @java.lang.SuppressWarnings("all") + public int getI() { + return this.$i; + } +} +class GetterWithDollar2 { + int $i; + int i; + @java.lang.SuppressWarnings("all") + public int getI() { + return this.i; + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/NonNullPlain.java b/test/transform/resource/after-delombok/NonNullPlain.java new file mode 100644 index 00000000..19869db1 --- /dev/null +++ b/test/transform/resource/after-delombok/NonNullPlain.java @@ -0,0 +1,25 @@ +class NonNullPlain { + @lombok.NonNull + int i; + @lombok.NonNull + String s; + @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() { + return this.s; + } + @java.lang.SuppressWarnings("all") + public void setS(@lombok.NonNull final String s) { + if (s == null) throw new java.lang.NullPointerException("s"); + this.s = s; + } +} diff --git a/test/transform/resource/after-delombok/SetterAccessLevel.java b/test/transform/resource/after-delombok/SetterAccessLevel.java new file mode 100644 index 00000000..dce4cc2f --- /dev/null +++ b/test/transform/resource/after-delombok/SetterAccessLevel.java @@ -0,0 +1,28 @@ +class SetterAccessLevel { + boolean isNone; + boolean isPrivate; + boolean isPackage; + boolean isProtected; + boolean isPublic; + boolean value; + @java.lang.SuppressWarnings("all") + private void setIsPrivate(final boolean isPrivate) { + this.isPrivate = isPrivate; + } + @java.lang.SuppressWarnings("all") + void setIsPackage(final boolean isPackage) { + this.isPackage = isPackage; + } + @java.lang.SuppressWarnings("all") + protected void setIsProtected(final boolean isProtected) { + this.isProtected = isProtected; + } + @java.lang.SuppressWarnings("all") + public void setIsPublic(final boolean isPublic) { + this.isPublic = isPublic; + } + @java.lang.SuppressWarnings("all") + public void setValue(final boolean value) { + this.value = value; + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/SetterAlreadyExists.java b/test/transform/resource/after-delombok/SetterAlreadyExists.java new file mode 100644 index 00000000..e4992b29 --- /dev/null +++ b/test/transform/resource/after-delombok/SetterAlreadyExists.java @@ -0,0 +1,35 @@ +class Setter1 { + boolean foo; + void setFoo(boolean foo) { + } +} +class Setter2 { + boolean foo; + void setFoo(String foo) { + } +} +class Setter3 { + String foo; + void setFoo(boolean foo) { + } +} +class Setter4 { + String foo; + void setFoo(String foo) { + } +} +class Setter5 { + String foo; + void setFoo() { + } +} +class Setter6 { + String foo; + void setFoo(String foo, int x) { + } +} +class Setter7 { + String foo; + static void setFoo() { + } +} diff --git a/test/transform/resource/after-delombok/SetterOnClass.java b/test/transform/resource/after-delombok/SetterOnClass.java new file mode 100644 index 00000000..05528ff8 --- /dev/null +++ b/test/transform/resource/after-delombok/SetterOnClass.java @@ -0,0 +1,59 @@ +class SetterOnClass1 { + boolean isNone; + boolean isPublic; + @java.lang.SuppressWarnings("all") + public void setIsPublic(final boolean isPublic) { + this.isPublic = isPublic; + } +} +class SetterOnClass2 { + boolean isNone; + boolean isProtected; + boolean isPackage; + @java.lang.SuppressWarnings("all") + protected void setIsProtected(final boolean isProtected) { + this.isProtected = isProtected; + } + @java.lang.SuppressWarnings("all") + void setIsPackage(final boolean isPackage) { + this.isPackage = isPackage; + } +} +class SetterOnClass3 { + boolean isNone; + boolean isPackage; + @java.lang.SuppressWarnings("all") + void setIsPackage(final boolean isPackage) { + this.isPackage = isPackage; + } +} +class SetterOnClass4 { + boolean isNone; + boolean isPrivate; + @java.lang.SuppressWarnings("all") + private void setIsPrivate(final boolean isPrivate) { + this.isPrivate = isPrivate; + } +} +class SetterOnClass5 { + boolean isNone; + boolean isPublic; + @java.lang.SuppressWarnings("all") + public void setIsPublic(final boolean isPublic) { + this.isPublic = isPublic; + } +} +class SetterOnClass6 { + String couldBeNull; + @lombok.NonNull + String nonNull; + @java.lang.SuppressWarnings("all") + public void setCouldBeNull(final String couldBeNull) { + this.couldBeNull = couldBeNull; + } + @java.lang.SuppressWarnings("all") + public void setNonNull(@lombok.NonNull final String nonNull) { + if (nonNull == null) throw new java.lang.NullPointerException("nonNull"); + this.nonNull = nonNull; + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/SetterPlain.java b/test/transform/resource/after-delombok/SetterPlain.java new file mode 100644 index 00000000..39aa7b61 --- /dev/null +++ b/test/transform/resource/after-delombok/SetterPlain.java @@ -0,0 +1,12 @@ +class SetterPlain { + int i; + int foo; + @java.lang.SuppressWarnings("all") + public void setI(final int i) { + this.i = i; + } + @java.lang.SuppressWarnings("all") + public void setFoo(final int foo) { + this.foo = foo; + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/SetterWithDollar.java b/test/transform/resource/after-delombok/SetterWithDollar.java new file mode 100644 index 00000000..c26a1ccd --- /dev/null +++ b/test/transform/resource/after-delombok/SetterWithDollar.java @@ -0,0 +1,15 @@ +class SetterWithDollar1 { + int $i; + + public void setI(final int i) { + this.$i = i; + } +} +class SetterWithDollar2 { + int $i; + int i; + + public void setI(final int i) { + this.i = i; + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/SneakyThrowsMultiple.java b/test/transform/resource/after-delombok/SneakyThrowsMultiple.java new file mode 100644 index 00000000..bab13990 --- /dev/null +++ b/test/transform/resource/after-delombok/SneakyThrowsMultiple.java @@ -0,0 +1,45 @@ +import java.awt.AWTException; +import java.io.IOException; +import java.util.Random; +class SneakyThrowsMultiple { + public void test() { + try { + try { + System.out.println("test1"); + throw new IOException(); + } catch (IOException $ex) { + throw lombok.Lombok.sneakyThrow($ex); + } + } catch (Throwable $ex) { + throw lombok.Lombok.sneakyThrow($ex); + } + } + public void test2() { + try { + try { + System.out.println("test2"); + if (new Random().nextBoolean()) { + throw new IOException(); + } else { + throw new AWTException("WHAT"); + } + } catch (AWTException $ex) { + throw lombok.Lombok.sneakyThrow($ex); + } + } catch (IOException $ex) { + throw lombok.Lombok.sneakyThrow($ex); + } + } + public void test3() { + try { + try { + System.out.println("test3"); + throw new IOException(); + } catch (IOException $ex) { + throw lombok.Lombok.sneakyThrow($ex); + } + } catch (Throwable $ex) { + throw lombok.Lombok.sneakyThrow($ex); + } + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/SneakyThrowsPlain.java b/test/transform/resource/after-delombok/SneakyThrowsPlain.java new file mode 100644 index 00000000..d5abc478 --- /dev/null +++ b/test/transform/resource/after-delombok/SneakyThrowsPlain.java @@ -0,0 +1,17 @@ +class SneakyThrowsPlain { + public void test() { + try { + System.out.println("test1"); + } catch (java.lang.Throwable $ex) { + throw lombok.Lombok.sneakyThrow($ex); + } + } + + public void test2() { + try { + System.out.println("test2"); + } catch (java.lang.Throwable $ex) { + throw lombok.Lombok.sneakyThrow($ex); + } + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/SneakyThrowsSingle.java b/test/transform/resource/after-delombok/SneakyThrowsSingle.java new file mode 100644 index 00000000..519d06a9 --- /dev/null +++ b/test/transform/resource/after-delombok/SneakyThrowsSingle.java @@ -0,0 +1,26 @@ +import java.io.IOException; +class SneakyThrowsSingle { + public void test() { + try { + System.out.println("test1"); + } catch (Throwable $ex) { + throw lombok.Lombok.sneakyThrow($ex); + } + } + public void test2() { + try { + System.out.println("test2"); + throw new IOException(); + } catch (IOException $ex) { + throw lombok.Lombok.sneakyThrow($ex); + } + } + public void test3() { + try { + System.out.println("test3"); + throw new IOException(); + } catch (IOException $ex) { + throw lombok.Lombok.sneakyThrow($ex); + } + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/SynchronizedName.java b/test/transform/resource/after-delombok/SynchronizedName.java new file mode 100644 index 00000000..066e3bdf --- /dev/null +++ b/test/transform/resource/after-delombok/SynchronizedName.java @@ -0,0 +1,25 @@ +class SynchronizedName { + private Object read = new Object(); + private static Object READ = new Object(); + void test1() { + synchronized (read) { + System.out.println("one"); + } + } + void test2() { + System.out.println("two"); + } + static void test3() { + System.out.println("three"); + } + void test4() { + synchronized (READ) { + System.out.println("four"); + } + } + void test5() { + synchronized (read) { + System.out.println("five"); + } + } +} diff --git a/test/transform/resource/after-delombok/SynchronizedPlain.java b/test/transform/resource/after-delombok/SynchronizedPlain.java new file mode 100644 index 00000000..695a3089 --- /dev/null +++ b/test/transform/resource/after-delombok/SynchronizedPlain.java @@ -0,0 +1,28 @@ +class SynchronizedPlain1 { + void test() { + synchronized (this.$lock) { + System.out.println("one"); + } + } + void test2() { + synchronized (this.$lock) { + System.out.println("two"); + } + } + @java.lang.SuppressWarnings("all") + private final java.lang.Object $lock = new java.lang.Object[0]; +} +class SynchronizedPlain2 { + static void test() { + synchronized (SynchronizedPlain2.$LOCK) { + System.out.println("three"); + } + } + static void test2() { + synchronized (SynchronizedPlain2.$LOCK) { + System.out.println("four"); + } + } + @java.lang.SuppressWarnings("all") + private static final java.lang.Object $LOCK = new java.lang.Object[0]; +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/ToStringInner.java b/test/transform/resource/after-delombok/ToStringInner.java new file mode 100644 index 00000000..fc376a77 --- /dev/null +++ b/test/transform/resource/after-delombok/ToStringInner.java @@ -0,0 +1,36 @@ +class ToStringOuter { + final int x; + String name; + class ToStringInner { + final int y; + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "ToStringInner(y=" + this.y + ")"; + } + } + static class ToStringStaticInner { + final int y; + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "ToStringStaticInner(y=" + this.y + ")"; + } + } + class ToStringMiddle { + class ToStringMoreInner { + final String name; + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "ToStringMoreInner(name=" + this.name + ")"; + } + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "ToStringOuter(x=" + this.x + ", name=" + this.name + ")"; + } +}
\ No newline at end of file diff --git a/test/transform/resource/after-delombok/ToStringPlain.java b/test/transform/resource/after-delombok/ToStringPlain.java new file mode 100644 index 00000000..20227464 --- /dev/null +++ b/test/transform/resource/after-delombok/ToStringPlain.java @@ -0,0 +1,18 @@ +class ToString1 { + final int x; + String name; + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "ToString1(x=" + this.x + ", name=" + this.name + ")"; + } +} +class ToString2 { + final int x; + String name; + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "ToString2(x=" + this.x + ", name=" + this.name + ")"; + } +}
\ No newline at end of file |