Skip to content

Commit

Permalink
Run spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
WarpspeedSCP authored and KengoTODA committed Aug 17, 2020
1 parent b4a884e commit e1d0091
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package edu.umd.cs.findbugs.ba;

import edu.umd.cs.findbugs.AbstractIntegrationTest;
import edu.umd.cs.findbugs.BugInstance;
import edu.umd.cs.findbugs.test.matcher.BugInstanceMatcher;
import edu.umd.cs.findbugs.test.matcher.BugInstanceMatcherBuilder;

import org.hamcrest.MatcherAssert;
import org.junit.Test;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,30 +47,30 @@ public void visitCode(Code obj) {
public void sawOpcode(int seen) {

switch (seen) {
case Const.INSTANCEOF: {
// Initialise the bug instance here.
currBug = new BugInstance(this, "JUA_DONT_ASSERT_INSTANCEOF_IN_TESTS", NORMAL_PRIORITY);
String operand = getDottedClassConstantOperand();
currBug.addTypeOfNamedClass(operand); // {0}
case Const.INSTANCEOF: {
// Initialise the bug instance here.
currBug = new BugInstance(this, "JUA_DONT_ASSERT_INSTANCEOF_IN_TESTS", NORMAL_PRIORITY);
String operand = getDottedClassConstantOperand();
currBug.addTypeOfNamedClass(operand); // {0}

break;
}
case Const.INVOKESTATIC: {
if (getPrevOpcode(1) == Const.INSTANCEOF) {
String ciOp = getClassConstantOperand();
String ncOp = getNameConstantOperand();
break;
}
case Const.INVOKESTATIC: {
if (getPrevOpcode(1) == Const.INSTANCEOF) {
String ciOp = getClassConstantOperand();
String ncOp = getNameConstantOperand();

if ("org/junit/Assert".equals(ciOp) &&
"assertTrue".equals(ncOp)) {
// This condition only triggers if the previous opcode was instanceof,
// so currBug is guaranteed to be a new BugInstance.
currBug.addClassAndMethod(this) // {2}
.addSourceLine(this); // {3}
bugReporter.reportBug(currBug);
}
if ("org/junit/Assert".equals(ciOp) &&
"assertTrue".equals(ncOp)) {
// This condition only triggers if the previous opcode was instanceof,
// so currBug is guaranteed to be a new BugInstance.
currBug.addClassAndMethod(this) // {2}
.addSourceLine(this); // {3}
bugReporter.reportBug(currBug);
}
}
}
}

}
}

0 comments on commit e1d0091

Please sign in to comment.