[ 
https://issues.apache.org/jira/browse/MSHARED-1032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17733939#comment-17733939
 ] 

Benjamin Marwell commented on MSHARED-1032:
-------------------------------------------

Ha, I wish I knew which plugin I was trying to modify when I stumbled over 
this. Probably the checkstyle-plugin.

Maybe I did not mean "double call", but instead "called on two occurences", but 
that is hard to guess from now. If it was from two different entry points, it 
should be two different methods (imho). The default can be that one calls 
another...

 

Then there's the exception issue, yes, which can be solved right afterwards.

> API change: let canGenerateReport() throw an Exception
> ------------------------------------------------------
>
>                 Key: MSHARED-1032
>                 URL: https://issues.apache.org/jira/browse/MSHARED-1032
>             Project: Maven Shared Components
>          Issue Type: Improvement
>          Components: maven-reporting-api
>    Affects Versions: maven-reporting-api-3.0
>            Reporter: Benjamin Marwell
>            Priority: Major
>              Labels: doxia-2.0.0-stack
>
> Hi everyone,
> the [{{AbstractReportMojo}} in 
> reporting-impl|https://maven.apache.org/shared/maven-reporting-impl/apidocs/org/apache/maven/reporting/AbstractMavenReport.html]
>  implements a method [{{canGenerateReport()}} from 
> reporting-api|https://maven.apache.org/shared/maven-reporting-api/apidocs/org/apache/maven/reporting/MavenReport.html].
> However, it is unable to throw any exceptions. Not even {{MojoExecutionEx}} 
> or {{MavenReportEx}}, which is most unfortunate.
> It is being used twice:
> Once in {{execute() throws MojoExEx}}
> and in
> {{generate() throws MavenReportEx}} (and is called by execute()).
> This way, there is no way for reporting plugins to scan for files, because 
> {{FileUtils::getFiles}} DOES throw a {{{}IOException{}}}, which then cannot 
> be wrapped. However, the {{IOException}} from that method is useless anyway, 
> because it is never declared in any methods it calls.
> Therefore please consider:
>  * Declaring any Exception on {{canGenerateReport()}}
>  * Removing the declared {{IOException}} in PlexusUtils ([PR 
> exists|https://github.com/codehaus-plexus/plexus-utils/issues/180]) and 
> Maven-Utils (issue: tbd).
> Thanks!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to