Github user britter commented on a diff in the pull request:
— Diff: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/TestSetRunListener.java —
@@ -76,7 +76,7 @@ public TestSetRunListener( ConsoleReporter consoleReporter, FileReporter fileRep
StatisticsReporter statisticsReporter, boolean trimStackTrace,
boolean isPlainFormat, boolean briefOrPlainFormat )
- this.consoleReporter = consoleReporter;
+ this.consoleReporter = consoleReporter != null ? consoleReporter : new NullConsoleReporter();
> All of these classes are in surefire-common project. Therefore it would be nice not to create a new object new NullConsoleReporter() but instead keep it as static final constant in abstract Factory in surefire-common.
Agreed, I can change this.
> I would say that the caller should pass non-null consistent object into this class TestSetRunListener via constructor
Yes it would certainly be better to enforce this kinds of invariants. We can do it like this, but then the constructor of `TestSetRunListener` has to check for null parameters and throw an exception if null is passed.
> If we accepted such paradigm then all such occurrences in this PR would have to change it.
I don't understand. Change the whole surefire code base for all occurrences of this pattern?