From fd1a9d7c0994ec93881e2986844856b781a22c6d Mon Sep 17 00:00:00 2001 From: Roel Spilker Date: Thu, 1 May 2014 00:03:01 +0200 Subject: [java8] Support in delombok for intersection typecast and lambdas --- test/pretty/resource/after/CastWithIntersection.java | 6 ++++++ test/pretty/resource/after/Lambda.java | 7 +++++++ test/pretty/resource/after/MultiCatch.java | 9 +++++++++ test/pretty/resource/before/CastWithIntersection.java | 7 +++++++ test/pretty/resource/before/Lambda.java | 8 ++++++++ test/pretty/resource/before/MultiCatch.java | 10 ++++++++++ 6 files changed, 47 insertions(+) create mode 100644 test/pretty/resource/after/CastWithIntersection.java create mode 100644 test/pretty/resource/after/Lambda.java create mode 100644 test/pretty/resource/after/MultiCatch.java create mode 100644 test/pretty/resource/before/CastWithIntersection.java create mode 100644 test/pretty/resource/before/Lambda.java create mode 100644 test/pretty/resource/before/MultiCatch.java (limited to 'test') diff --git a/test/pretty/resource/after/CastWithIntersection.java b/test/pretty/resource/after/CastWithIntersection.java new file mode 100644 index 00000000..2eebdee1 --- /dev/null +++ b/test/pretty/resource/after/CastWithIntersection.java @@ -0,0 +1,6 @@ +import java.util.*; +public class CastWithIntersection { + public void test(List list) { + RandomAccess r = (RandomAccess & java.io.Serializable)list; + } +} \ No newline at end of file diff --git a/test/pretty/resource/after/Lambda.java b/test/pretty/resource/after/Lambda.java new file mode 100644 index 00000000..54d7caa0 --- /dev/null +++ b/test/pretty/resource/after/Lambda.java @@ -0,0 +1,7 @@ +public class Lambda { + Runnable r = () -> System.out.println(); + java.util.Comparator c1 = (a, b) -> a - b; + java.util.Comparator c2 = (Integer a, Integer b) -> { + return a - b; + }; +} \ No newline at end of file diff --git a/test/pretty/resource/after/MultiCatch.java b/test/pretty/resource/after/MultiCatch.java new file mode 100644 index 00000000..f0414c2e --- /dev/null +++ b/test/pretty/resource/after/MultiCatch.java @@ -0,0 +1,9 @@ +public class MultiCatch { + public void test() { + try { + System.out.println(); + } catch (IllegalArgumentException | IllegalStateException e) { + e.printStackTrace(); + } + } +} \ No newline at end of file diff --git a/test/pretty/resource/before/CastWithIntersection.java b/test/pretty/resource/before/CastWithIntersection.java new file mode 100644 index 00000000..ce97cba0 --- /dev/null +++ b/test/pretty/resource/before/CastWithIntersection.java @@ -0,0 +1,7 @@ +// version 8: +import java.util.*; +public class CastWithIntersection { + public void test(List list) { + RandomAccess r = (RandomAccess & java.io.Serializable) list; + } +} \ No newline at end of file diff --git a/test/pretty/resource/before/Lambda.java b/test/pretty/resource/before/Lambda.java new file mode 100644 index 00000000..e7784df5 --- /dev/null +++ b/test/pretty/resource/before/Lambda.java @@ -0,0 +1,8 @@ +// version 8: +public class Lambda { + Runnable r = () -> System.out.println(); + java.util.Comparator c1 = (a, b) -> a - b; + java.util.Comparator c2 = (Integer a, Integer b) -> { + return a - b; + }; +} \ No newline at end of file diff --git a/test/pretty/resource/before/MultiCatch.java b/test/pretty/resource/before/MultiCatch.java new file mode 100644 index 00000000..590fe382 --- /dev/null +++ b/test/pretty/resource/before/MultiCatch.java @@ -0,0 +1,10 @@ +// version 7: +public class MultiCatch { + public void test() { + try { + System.out.println(); + } catch (IllegalArgumentException | IllegalStateException e) { + e.printStackTrace(); + } + } +} \ No newline at end of file -- cgit