Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refs #2019
- Loading branch information
Showing
2 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
spotbugs-tests/src/test/java/edu/umd/cs/findbugs/detect/Issue2019Test.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,17 @@ | ||
package edu.umd.cs.findbugs.detect; | ||
|
||
import edu.umd.cs.findbugs.AbstractIntegrationTest; | ||
import org.junit.Test; | ||
|
||
|
||
public class Issue2019Test extends AbstractIntegrationTest { | ||
@Test | ||
public void test() { | ||
performAnalysis("ghIssues/Issue2019$ATNSimulator.class", | ||
"ghIssues/Issue2019$BaseParser.class", | ||
"ghIssues/Issue2019$Parser.class", | ||
"ghIssues/Issue2019$ParserATNSimulator.class", | ||
"ghIssues/Issue2019$Recognizer.class", | ||
"ghIssues/Issue2019.class"); | ||
} | ||
} |
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,44 @@ | ||
package ghIssues; | ||
|
||
/** | ||
* @see <a href="https://github.com/spotbugs/spotbugs/issues/2019">GitHub Issue</a> | ||
*/ | ||
public class Issue2019 { | ||
|
||
static class ATNSimulator { | ||
public int adaptivePredict() { | ||
return 0; | ||
} | ||
} | ||
|
||
static class ParserATNSimulator extends ATNSimulator { | ||
} | ||
|
||
static class Recognizer<ATNInterpreter extends ATNSimulator> { | ||
public ATNInterpreter getInterpreter() { | ||
return null; | ||
} | ||
} | ||
|
||
static class BaseParser extends Recognizer<ParserATNSimulator> { | ||
} | ||
|
||
public static class Parser extends BaseParser { | ||
|
||
public void text() { | ||
int _alt = 1; | ||
do { | ||
switch (_alt) { | ||
case 1: | ||
if (_alt == 1) { | ||
continue; | ||
} | ||
break; | ||
default: | ||
throw new RuntimeException(); | ||
} | ||
_alt = getInterpreter().adaptivePredict(); | ||
} while (_alt != 2); | ||
} | ||
|
||
}} |