1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 00:33:59 +03:00

test throws, trycatches and type argument

This commit is contained in:
Ayman Nadeem 2018-07-24 18:17:42 -04:00
parent 448999e68d
commit cc2cf50b98
12 changed files with 138 additions and 11 deletions

View File

@ -0,0 +1,8 @@
class Beyonce {
void x() {
BufferedReader newReader() throws FileNotFoundException {
new BufferedReader(new InputStreamReader(new FileInputStream(file), charset));
}
}
}
// this doesn't work

View File

@ -3,3 +3,4 @@ class Beyonce {
new BufferedReader(new InputStreamReader(new FileInputStream(file), charset));
}
}
// this doesn't work

View File

@ -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...");
}
}

View File

@ -0,0 +1,5 @@
class Test {
void printCollection(Collection<String> c) {
// a wildcard collection
}
}

View File

@ -0,0 +1,8 @@
class Test {
static void printCollection(Collection<?> c) {
// a wildcard collection
for (Object o : c) {
System.out.println(o);
}
}
}

View File

@ -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)+})+})+}) }))))))

View File

@ -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) }))))))

View File

@ -0,0 +1,17 @@
(Statements
(Class
(Identifier)
(Statements
(Method
(Void)
(Empty)
(Identifier)
(Annotation
(Identifier)
(GenericType
(Identifier)
(Identifier)))
(Statements
(Context
(Comment)
(Empty)))))))

View File

@ -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))))))))))

View File

@ -1,6 +0,0 @@
class Dino {
void hi() {
try (CustomAnalyzer analyzer = new CustomAnalyzer()){
}
}
}

View File

@ -1,5 +0,0 @@
class Dinosaur {
void apply() {
(T1)a[0];
}
}