diff --git a/src/main/java/org/junit/internal/runners/ErrorReportingRunner.java b/src/main/java/org/junit/internal/runners/ErrorReportingRunner.java index f52abab69439..227f5a03bac0 100644 --- a/src/main/java/org/junit/internal/runners/ErrorReportingRunner.java +++ b/src/main/java/org/junit/internal/runners/ErrorReportingRunner.java @@ -37,7 +37,11 @@ public ErrorReportingRunner(Throwable cause, Class... testClasses) { @Override public Description getDescription() { Description description = Description.createSuiteDescription(classNames); - for (Throwable each : causes) { + /* + * 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()); } return description;