diff options
Diffstat (limited to 'test/pretty/resource/after')
-rw-r--r-- | test/pretty/resource/after/Cast.java | 2 | ||||
-rw-r--r-- | test/pretty/resource/after/CastWithIntersection.java | 2 | ||||
-rw-r--r-- | test/pretty/resource/after/DefaultMethod.java | 2 | ||||
-rw-r--r-- | test/pretty/resource/after/Enum.java | 9 | ||||
-rw-r--r-- | test/pretty/resource/after/ExoticJava.java | 46 | ||||
-rw-r--r-- | test/pretty/resource/after/ForLoop.java | 7 | ||||
-rw-r--r-- | test/pretty/resource/after/Interfaces.java | 5 | ||||
-rw-r--r-- | test/pretty/resource/after/Lambda.java | 13 | ||||
-rw-r--r-- | test/pretty/resource/after/TypeAnnotations.java | 22 |
9 files changed, 93 insertions, 15 deletions
diff --git a/test/pretty/resource/after/Cast.java b/test/pretty/resource/after/Cast.java index 95237b0f..e32150c3 100644 --- a/test/pretty/resource/after/Cast.java +++ b/test/pretty/resource/after/Cast.java @@ -1,6 +1,6 @@ import java.util.*; public class Cast { public void test(List<?> list) { - RandomAccess r = (/*before*/ RandomAccess /*after*/)list; + RandomAccess r = (/*before*/ RandomAccess /*after*/) list; } }
\ No newline at end of file diff --git a/test/pretty/resource/after/CastWithIntersection.java b/test/pretty/resource/after/CastWithIntersection.java index 2eebdee1..dc0904f6 100644 --- a/test/pretty/resource/after/CastWithIntersection.java +++ b/test/pretty/resource/after/CastWithIntersection.java @@ -1,6 +1,6 @@ import java.util.*; public class CastWithIntersection { public void test(List<?> list) { - RandomAccess r = (RandomAccess & java.io.Serializable)list; + RandomAccess r = (RandomAccess & java.io.Serializable) list; } }
\ No newline at end of file diff --git a/test/pretty/resource/after/DefaultMethod.java b/test/pretty/resource/after/DefaultMethod.java index 864ba60f..fe9594b8 100644 --- a/test/pretty/resource/after/DefaultMethod.java +++ b/test/pretty/resource/after/DefaultMethod.java @@ -3,6 +3,6 @@ interface DefaultMethod { default boolean isEmpty() { return size() == 0; } - default strictfp void run() { + strictfp default void run() { } }
\ No newline at end of file diff --git a/test/pretty/resource/after/Enum.java b/test/pretty/resource/after/Enum.java index dd738b5b..a3b2b643 100644 --- a/test/pretty/resource/after/Enum.java +++ b/test/pretty/resource/after/Enum.java @@ -1,13 +1,8 @@ enum Ranks { - CLUBS, - HEARTS, - DIAMONDS, - SPADES; + CLUBS, HEARTS, DIAMONDS, SPADES; } enum Complex { - RED("ff0000"), - GREEN("00ff00"), - BLUE("0000f"); + RED("ff0000"), GREEN("00ff00"), BLUE("0000f"); private final String webColour; Complex(String webColour) { this.webColour = webColour; diff --git a/test/pretty/resource/after/ExoticJava.java b/test/pretty/resource/after/ExoticJava.java new file mode 100644 index 00000000..fb9a9131 --- /dev/null +++ b/test/pretty/resource/after/ExoticJava.java @@ -0,0 +1,46 @@ +import static java.lang.String.*; +import java.io.*; +class ExoticJava<V> { + public <T> ExoticJava(T genericsInConstructor, V genericsInType) { + System.out.println(new <String>ExoticJava<Integer>("Hello", 5)); + } + public void test() { + int x = 5; + int[] y = {10}; + ; + class MethodLocal implements Serializable, java.util.RandomAccess { + @SuppressWarnings({"unchecked", "rawtypes"}) + public final strictfp int foo() { + int x = super.hashCode(); + x <<= 5; + do { + x <<= 5; + } while (Boolean.FALSE); + return x; + } + } + for (int i = 10, j[] = {20}; i < 5; i++, j[0]++) { + String z = ""; + try ( + PrintWriter pw = new PrintWriter(System.out); + PrintWriter p2 = new PrintWriter(System.out)) { + pw.println(); + } finally { + synchronized (z) { + System.out.println(z); + } + } + if ((y == null)) { + } + if (((y == null))) ; + { + ; + } + java.util.List<String> list = new java.util.ArrayList<>(); + assert Boolean.TRUE : "That\'s weird"; + double d = -1.8E12; + long loooong = 305441741; + int octal = 87; + } + } +}
\ No newline at end of file diff --git a/test/pretty/resource/after/ForLoop.java b/test/pretty/resource/after/ForLoop.java index 615f6e8a..f3b1bf4e 100644 --- a/test/pretty/resource/after/ForLoop.java +++ b/test/pretty/resource/after/ForLoop.java @@ -8,4 +8,11 @@ public class ForLoop { } // after loop } + + { + int i; + for (i = 0; i < 10; i++) { + System.out.println(i); + } + } } diff --git a/test/pretty/resource/after/Interfaces.java b/test/pretty/resource/after/Interfaces.java index 6c0a6770..f7f386c0 100644 --- a/test/pretty/resource/after/Interfaces.java +++ b/test/pretty/resource/after/Interfaces.java @@ -1,10 +1,7 @@ @SuppressWarnings("all") interface Interfaces { enum Ranks { - CLUBS, - HEARTS, - DIAMONDS, - SPADES; + CLUBS, HEARTS, DIAMONDS, SPADES; } int x = 10; void y(); diff --git a/test/pretty/resource/after/Lambda.java b/test/pretty/resource/after/Lambda.java index 54d7caa0..949c4c04 100644 --- a/test/pretty/resource/after/Lambda.java +++ b/test/pretty/resource/after/Lambda.java @@ -4,4 +4,15 @@ public class Lambda { java.util.Comparator<Integer> c2 = (Integer a, Integer b) -> { return a - b; }; -}
\ No newline at end of file + java.util.function.Function<String, String> fnc = (String c) -> c; + void testLambdaInArgsList(String name, java.util.function.Function<String, String> f) { + } + void testLambdaInArgsList2(java.util.function.Function<String, String> f, String name) { + } + void test() { + testLambdaInArgsList("hello", (String c) -> c); + testLambdaInArgsList("hello", c -> c); + testLambdaInArgsList2((String c) -> c, "hello"); + testLambdaInArgsList2(c -> c, "hello"); + } +} diff --git a/test/pretty/resource/after/TypeAnnotations.java b/test/pretty/resource/after/TypeAnnotations.java new file mode 100644 index 00000000..760b5ef8 --- /dev/null +++ b/test/pretty/resource/after/TypeAnnotations.java @@ -0,0 +1,22 @@ +import java.lang.annotation.ElementType; +import java.lang.annotation.Target; +import java.util.List; +import java.util.Map; +public class TypeAnnotations { + @Target({ElementType.TYPE_USE, ElementType.LOCAL_VARIABLE}) + @interface Foo { + } + @Target(ElementType.TYPE_USE) + @interface Bar { + } + public List<@Foo String> test(@Foo String param) { + @Bar + String local = "bar"; + @Foo + java.io.@Foo File[] array = {}; + return new java.util.@Foo ArrayList<java.lang.@Foo String>(); + } + public <@Foo T extends java.lang.@Foo Number> T test2(@Bar String... varargs) { + return null; + } +} |