From 65684f6b50cecbfe50936422d3bef8a1e2e5ebff Mon Sep 17 00:00:00 2001 From: Chris Povirk Date: Mon, 10 Oct 2022 16:22:16 -0400 Subject: [PATCH] Add a comment. --- .../java/org/junit/internal/runners/ErrorReportingRunner.java | 4 ++++ 1 file changed, 4 insertions(+) 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()); }