diff options
Diffstat (limited to 'test/pretty/resource/before')
-rw-r--r-- | test/pretty/resource/before/Cast.java | 2 | ||||
-rw-r--r-- | test/pretty/resource/before/ExoticJava.java | 45 | ||||
-rw-r--r-- | test/pretty/resource/before/TypeAnnotations.java | 23 |
3 files changed, 69 insertions, 1 deletions
diff --git a/test/pretty/resource/before/Cast.java b/test/pretty/resource/before/Cast.java index 95237b0f..e32150c3 100644 --- a/test/pretty/resource/before/Cast.java +++ b/test/pretty/resource/before/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/before/ExoticJava.java b/test/pretty/resource/before/ExoticJava.java new file mode 100644 index 00000000..b70b1e12 --- /dev/null +++ b/test/pretty/resource/before/ExoticJava.java @@ -0,0 +1,45 @@ +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, y[] = {10}; + ; + class MethodLocal implements Serializable, java.util.RandomAccess { + @SuppressWarnings({"unchecked", "rawtypes"}) + strictfp public final 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 = 0x1234ABCD; + int octal = 0127; + } + } +}
\ No newline at end of file diff --git a/test/pretty/resource/before/TypeAnnotations.java b/test/pretty/resource/before/TypeAnnotations.java new file mode 100644 index 00000000..a39337da --- /dev/null +++ b/test/pretty/resource/before/TypeAnnotations.java @@ -0,0 +1,23 @@ +// version 8: +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; + } +} |