diff --git a/test/fixtures/java/corpus/Throws.A.java b/test/fixtures/java/corpus/Throws.A.java new file mode 100644 index 000000000..90ec69066 --- /dev/null +++ b/test/fixtures/java/corpus/Throws.A.java @@ -0,0 +1,8 @@ +class Beyonce { + void x() { + BufferedReader newReader() throws FileNotFoundException { + new BufferedReader(new InputStreamReader(new FileInputStream(file), charset)); + } + } +} +// this doesn't work diff --git a/test/fixtures/java/corpus/throws.java b/test/fixtures/java/corpus/Throws.B.java similarity index 88% rename from test/fixtures/java/corpus/throws.java rename to test/fixtures/java/corpus/Throws.B.java index 09c46ce9f..af6d79f40 100644 --- a/test/fixtures/java/corpus/throws.java +++ b/test/fixtures/java/corpus/Throws.B.java @@ -3,3 +3,4 @@ class Beyonce { new BufferedReader(new InputStreamReader(new FileInputStream(file), charset)); } } +// this doesn't work diff --git a/test/fixtures/java/corpus/try-catches.java b/test/fixtures/java/corpus/TryCatches.A.java similarity index 100% rename from test/fixtures/java/corpus/try-catches.java rename to test/fixtures/java/corpus/TryCatches.A.java diff --git a/test/fixtures/java/corpus/TryCatches.B.java b/test/fixtures/java/corpus/TryCatches.B.java new file mode 100644 index 000000000..38c6a7110 --- /dev/null +++ b/test/fixtures/java/corpus/TryCatches.B.java @@ -0,0 +1,8 @@ +class Example2{ + public static void main(String args[]){ + try{ + int data = 50; + } catch (ArithmeticException e){System.out.println(e);} + System.out.println("rest of the code..."); +} +} diff --git a/test/fixtures/java/corpus/TypeArgument.A.java b/test/fixtures/java/corpus/TypeArgument.A.java new file mode 100644 index 000000000..bd3dc56fc --- /dev/null +++ b/test/fixtures/java/corpus/TypeArgument.A.java @@ -0,0 +1,5 @@ +class Test { + void printCollection(Collection c) { + // a wildcard collection + } + } diff --git a/test/fixtures/java/corpus/TypeArgument.B.java b/test/fixtures/java/corpus/TypeArgument.B.java new file mode 100644 index 000000000..c03794d44 --- /dev/null +++ b/test/fixtures/java/corpus/TypeArgument.B.java @@ -0,0 +1,8 @@ +class Test { + static void printCollection(Collection c) { + // a wildcard collection + for (Object o : c) { + System.out.println(o); + } + } + } diff --git a/test/fixtures/java/corpus/TypeArgument.diffA-B.txt b/test/fixtures/java/corpus/TypeArgument.diffA-B.txt new file mode 100644 index 000000000..325a3e3cd --- /dev/null +++ b/test/fixtures/java/corpus/TypeArgument.diffA-B.txt @@ -0,0 +1,31 @@ +(Statements + (Class + (Identifier) + (Statements + (Method + (Void) + {+(AccessibilityModifier)+} + (Empty) + (Identifier) + (Annotation + (Identifier) + (GenericType + (Identifier) + {+(Wildcard)+} + {-(Identifier)-})) + (Statements + (Context + (Comment) + { (Empty) + ->(ForEach + {+(Variable + {+(Identifier)+} + {+(Identifier)+})+} + {+(Identifier)+} + {+(Statements + {+(Call + {+(MemberAccess + {+(MemberAccess + {+(Identifier)+})+})+} + {+(Identifier)+} + {+(Empty)+})+})+}) })))))) diff --git a/test/fixtures/java/corpus/TypeArgument.diffB-A.txt b/test/fixtures/java/corpus/TypeArgument.diffB-A.txt new file mode 100644 index 000000000..8b6a6046f --- /dev/null +++ b/test/fixtures/java/corpus/TypeArgument.diffB-A.txt @@ -0,0 +1,31 @@ +(Statements + (Class + (Identifier) + (Statements + (Method + (Void) + {-(AccessibilityModifier)-} + (Empty) + (Identifier) + (Annotation + (Identifier) + (GenericType + (Identifier) + {+(Identifier)+} + {-(Wildcard)-})) + (Statements + (Context + (Comment) + { (ForEach + {-(Variable + {-(Identifier)-} + {-(Identifier)-})-} + {-(Identifier)-} + {-(Statements + {-(Call + {-(MemberAccess + {-(MemberAccess + {-(Identifier)-})-})-} + {-(Identifier)-} + {-(Empty)-})-})-}) + ->(Empty) })))))) diff --git a/test/fixtures/java/corpus/TypeArgument.parseA.txt b/test/fixtures/java/corpus/TypeArgument.parseA.txt new file mode 100644 index 000000000..1a3a41a18 --- /dev/null +++ b/test/fixtures/java/corpus/TypeArgument.parseA.txt @@ -0,0 +1,17 @@ +(Statements + (Class + (Identifier) + (Statements + (Method + (Void) + (Empty) + (Identifier) + (Annotation + (Identifier) + (GenericType + (Identifier) + (Identifier))) + (Statements + (Context + (Comment) + (Empty))))))) diff --git a/test/fixtures/java/corpus/TypeArgument.parseB.txt b/test/fixtures/java/corpus/TypeArgument.parseB.txt new file mode 100644 index 000000000..e7d4324c1 --- /dev/null +++ b/test/fixtures/java/corpus/TypeArgument.parseB.txt @@ -0,0 +1,29 @@ +(Statements + (Class + (Identifier) + (Statements + (Method + (Void) + (AccessibilityModifier) + (Empty) + (Identifier) + (Annotation + (Identifier) + (GenericType + (Identifier) + (Wildcard))) + (Statements + (Context + (Comment) + (ForEach + (Variable + (Identifier) + (Identifier)) + (Identifier) + (Statements + (Call + (MemberAccess + (MemberAccess + (Identifier))) + (Identifier) + (Empty)))))))))) diff --git a/test/fixtures/java/corpus/tryWithResourcesStatement.java b/test/fixtures/java/corpus/tryWithResourcesStatement.java deleted file mode 100644 index f6ef073a6..000000000 --- a/test/fixtures/java/corpus/tryWithResourcesStatement.java +++ /dev/null @@ -1,6 +0,0 @@ -class Dino { - void hi() { - try (CustomAnalyzer analyzer = new CustomAnalyzer()){ - } - } -} diff --git a/test/fixtures/java/corpus/type-argument.java b/test/fixtures/java/corpus/type-argument.java deleted file mode 100644 index 10b339657..000000000 --- a/test/fixtures/java/corpus/type-argument.java +++ /dev/null @@ -1,5 +0,0 @@ -class Dinosaur { - void apply() { - (T1)a[0]; - } -}