Skip to content

Commit f8e98af

Browse files
committed
Merge branch 'findbugs' into spotbugs
Conflicts: src/main/java/com/mebigfatguy/fbcontrib/detect/UnitTestAssertionOddities.java
2 parents fbb95c2 + a173cac commit f8e98af

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/main/java/com/mebigfatguy/fbcontrib/detect/UnitTestAssertionOddities.java

+7
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ private enum TestFrameworkType {
8787
private static final String MBEAN_CLASS = "org/meanbean/test/BeanTester";
8888
private static final String MBEAN_METHOD = "testBean";
8989

90+
private static final String RESULTSACTION_CLASS = "org/springframework/test/web/servlet/ResultActions";
91+
9092
private BugReporter bugReporter;
9193
private JavaClass testCaseClass;
9294
private JavaClass testAnnotationClass;
@@ -338,6 +340,11 @@ public void sawOpcode(int seen) {
338340
if (MBEAN_METHOD.equals(methodName)) {
339341
sawAssert = true;
340342
}
343+
} else if (RESULTSACTION_CLASS.equals(className)) {
344+
String methodName = getMethodName();
345+
if ("andExpect".equals(methodName) || "andExpectAll".equals(methodName)) {
346+
sawAssert = true;
347+
}
341348
}
342349
} else if ((seen == Const.ATHROW) && (stack.getStackDepth() > 0)) {
343350
OpcodeStack.Item item = stack.getStackItem(0);

src/main/java/com/mebigfatguy/fbcontrib/detect/WriteOnlyCollection.java

+1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ public class WriteOnlyCollection extends MissingMethodsDetector {
130130
nim.add("addLast");
131131
nim.add("clear");
132132
nim.add("ensureCapacity");
133+
nim.add("forEach");
133134
nim.add("insertElementAt");
134135
nim.add("push");
135136
nim.add("put");

0 commit comments

Comments
 (0)