diff --git a/src/main/java/org/junit/internal/runners/ErrorReportingRunner.java b/src/main/java/org/junit/internal/runners/ErrorReportingRunner.java index 20a0431b92fe..227f5a03bac0 100644 --- a/src/main/java/org/junit/internal/runners/ErrorReportingRunner.java +++ b/src/main/java/org/junit/internal/runners/ErrorReportingRunner.java @@ -37,6 +37,10 @@ public ErrorReportingRunner(Throwable cause, Class... testClasses) { @Override public Description getDescription() { Description description = Description.createSuiteDescription(classNames); + /* + * Use an indexed loop instead of a foreach: That avoids declaring a variable that some + * tools will see as "unused." + */ for (int i = 0; i < causes.size(); i++) { description.addChild(describeCause()); }