-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from LoiNguyenCS/fix-cf-issue
Fix a crash in Checker Framework issue
- Loading branch information
Showing
23 changed files
with
362 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/test/java/org/checkerframework/specimin/LocalVarInExceptionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.checkerframework.specimin; | ||
|
||
import java.io.IOException; | ||
import org.junit.Test; | ||
|
||
/** | ||
* This test checks if Specimin can work when the parameter of the catch clause is used in the | ||
* associating block statement. | ||
*/ | ||
public class LocalVarInExceptionTest { | ||
@Test | ||
public void runTest() throws IOException { | ||
SpeciminTestExecutor.runTestWithoutJarPaths( | ||
"localvarinexception", | ||
new String[] {"com/example/Simple.java"}, | ||
new String[] {"com.example.Simple#bar()"}); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/test/java/org/checkerframework/specimin/UnionTypeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.checkerframework.specimin; | ||
|
||
import java.io.IOException; | ||
import org.junit.Test; | ||
|
||
/** This test checks if Specimin can work when there is an unsolved union type. */ | ||
public class UnionTypeTest { | ||
@Test | ||
public void runTest() throws IOException { | ||
SpeciminTestExecutor.runTestWithoutJarPaths( | ||
"uniontype", | ||
new String[] {"com/example/Simple.java"}, | ||
new String[] {"com.example.Simple#bar()"}); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/test/java/org/checkerframework/specimin/UnsolvedFieldInExistingFile.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.checkerframework.specimin; | ||
|
||
import java.io.IOException; | ||
import org.junit.Test; | ||
|
||
/** | ||
* This test checks if Specimin will not create a synthetic file for a class that already exist in | ||
* the input codebase. | ||
*/ | ||
public class UnsolvedFieldInExistingFile { | ||
@Test | ||
public void runTest() throws IOException { | ||
SpeciminTestExecutor.runTestWithoutJarPaths( | ||
"unsolvedFieldInExistingFile", | ||
new String[] {"com/example/Simple.java"}, | ||
new String[] {"com.example.Simple#bar()"}); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/test/java/org/checkerframework/specimin/VarTypeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.checkerframework.specimin; | ||
|
||
import java.io.IOException; | ||
import org.junit.Test; | ||
|
||
/** This test checks if Specimin can work when there is the var keyword in the input test. */ | ||
public class VarTypeTest { | ||
@Test | ||
public void runTest() throws IOException { | ||
SpeciminTestExecutor.runTestWithoutJarPaths( | ||
"vartype", | ||
new String[] {"com/example/Simple.java"}, | ||
new String[] {"com.example.Simple#bar()"}); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/test/resources/localvarinexception/expected/com/example/Simple.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.example; | ||
|
||
import javalanguage.Method; | ||
|
||
class Simple { | ||
|
||
void bar() { | ||
String x = ""; | ||
Method method = new Method(); | ||
try { | ||
method.solve(); | ||
} catch (UnsupportedOperationException e) { | ||
x = e.toString(); | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/test/resources/localvarinexception/expected/javalanguage/Method.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package javalanguage; | ||
|
||
public class Method { | ||
|
||
public Method() { | ||
throw new Error(); | ||
} | ||
|
||
public SolveReturnType solve() { | ||
throw new Error(); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
src/test/resources/localvarinexception/expected/javalanguage/SolveReturnType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package javalanguage; | ||
|
||
public class SolveReturnType { | ||
} |
Oops, something went wrong.