You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
High: mutual recursion between default generate() overloads causes StackOverflowError #91
The two generate(...) default methods in MavenReport delegate to each other. Because both are default, an implementation is allowed to override neither. Such an implementation compiles cleanly but recurses infinitely at runtime and crashes with StackOverflowError.
Location
src/main/java/org/apache/maven/reporting/MavenReport.java:60-62 and :76-78
Any MavenReport implementation that overrides neither overload causes a StackOverflowError when the report is generated. This is a denial-of-service / crash for the Maven report runner. The previous contract made generate abstract, so this is a runtime regression introduced by making both methods default. The Javadoc states an implementation "must override at least one of them", but nothing enforces this at compile time or fails fast at runtime.
Steps to reproduce
Implement MavenReport without overriding either generate(...) method.
Make at least one of the methods non-default/abstract, or replace the default delegation with a fail-fast fallback, e.g.:
defaultvoidgenerate(Sinksink, SinkFactorysinkFactory, Localelocale) throwsMavenReportException {
thrownewMavenReportException("This report does not implement generate(...)");
}
Test gap
MavenReportTest only covers implementations that override exactly one overload; it never exercises an implementation that overrides neither, which is the case that overflows.
Activity
Make generate(Sink, Locale) abstract again
Make generate(Sink, Locale) abstract again