From e767bccc69db20942c4f08253c6f957dc12615d3 Mon Sep 17 00:00:00 2001 From: Chris Povirk Date: Tue, 4 Oct 2022 17:11:03 -0400 Subject: [PATCH] Use an indexed for loop to avoid defining an unused variable. --- .../java/org/junit/internal/runners/ErrorReportingRunner.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/junit/internal/runners/ErrorReportingRunner.java b/src/main/java/org/junit/internal/runners/ErrorReportingRunner.java index f52abab69439..20a0431b92fe 100644 --- a/src/main/java/org/junit/internal/runners/ErrorReportingRunner.java +++ b/src/main/java/org/junit/internal/runners/ErrorReportingRunner.java @@ -37,7 +37,7 @@ public ErrorReportingRunner(Throwable cause, Class... testClasses) { @Override public Description getDescription() { Description description = Description.createSuiteDescription(classNames); - for (Throwable each : causes) { + for (int i = 0; i < causes.size(); i++) { description.addChild(describeCause()); } return description;