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 getOutputPath()/getOutputName() causes StackOverflowError #92
The getOutputPath() and getOutputName() 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 the first time the output path is queried and crashes with StackOverflowError.
Location
src/main/java/org/apache/maven/reporting/MavenReport.java:91-93 and :100-102
The output path is queried during every report render. An implementation that overrides neither method (legal now that both are default) throws StackOverflowError on first access. Historically getOutputName() was abstract and mandatory, so implementations ported to the new API that omit both methods now crash at runtime instead of failing to compile.
Steps to reproduce
Implement MavenReport without overriding either getOutputPath() or getOutputName().
Call getOutputPath() (or getOutputName()).
Observe StackOverflowError.
Suggested fix
Make at least one of the methods non-default/abstract, or replace the default delegation with a fail-fast fallback, e.g.:
MavenReportTest only covers implementations that override the method; it never exercises an implementation that overrides neither, which is the case that overflows.
The throwing default would break reports that follow the deprecation and implement only getOutputPath(): released maven-site-plugin 3.22.0 (AbstractSiteRenderingMojo lines 376 and 554) and doxia-sitetools 2.1.0 (DefaultSiteTool line 1494) still call report.getOutputName(). Making either method abstract is a source break in a minor release. The override check in #93 keeps both directions working; I'd tighten it to m.isDefault() && m.getDeclaringClass() == MavenReport.class so a sub-interface that redeclares getOutputName() is not rejected, and reuse it for #91.
Activity
slachiewicz commentedon Oct 11, 2026
The throwing default would break reports that follow the deprecation and implement only
getOutputPath(): released maven-site-plugin 3.22.0 (AbstractSiteRenderingMojolines 376 and 554) and doxia-sitetools 2.1.0 (DefaultSiteToolline 1494) still callreport.getOutputName(). Making either method abstract is a source break in a minor release. The override check in #93 keeps both directions working; I'd tighten it tom.isDefault() && m.getDeclaringClass() == MavenReport.classso a sub-interface that redeclaresgetOutputName()is not rejected, and reuse it for #91.slawekjaranowski commentedon Oct 11, 2026
Revert "Add default implementation for deprecated getOutputName method"