-
Notifications
You must be signed in to change notification settings - Fork 578
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed IllegalArgumentException in OpcodeStack.constantToInt
This fixes issue #893 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
- Loading branch information
1 parent
c0cbb10
commit c28885f
Showing
4 changed files
with
36 additions
and
0 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
21 changes: 21 additions & 0 deletions
21
spotbugs-tests/src/test/java/edu/umd/cs/findbugs/ba/Issue893Test.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,21 @@ | ||
package edu.umd.cs.findbugs.ba; | ||
|
||
import static edu.umd.cs.findbugs.test.CountMatcher.containsExactly; | ||
import static org.hamcrest.MatcherAssert.assertThat; | ||
|
||
import org.junit.Test; | ||
|
||
import edu.umd.cs.findbugs.AbstractIntegrationTest; | ||
import edu.umd.cs.findbugs.test.matcher.BugInstanceMatcher; | ||
import edu.umd.cs.findbugs.test.matcher.BugInstanceMatcherBuilder; | ||
|
||
public class Issue893Test extends AbstractIntegrationTest { | ||
|
||
@Test | ||
public void test() { | ||
performAnalysis("ghIssues/Issue893.class"); | ||
BugInstanceMatcher bugTypeMatcher = new BugInstanceMatcherBuilder().build(); | ||
assertThat(getBugCollection(), containsExactly(0, bugTypeMatcher)); | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package ghIssues; | ||
|
||
public class Issue893 { | ||
public boolean test() throws Exception { | ||
Boolean b = Boolean.valueOf(true); | ||
// Line below should not throw IllegalArgumentException during analysis | ||
b &= Boolean.valueOf(false); | ||
return b; | ||
} | ||
} |