[ https://issues.apache.org/jira/browse/MSHARED-1045?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17506974#comment-17506974 ]
Andrei Silviu Dragnea commented on MSHARED-1045: ------------------------------------------------ I am just a user of the Maven Scoverage plugin which got broken by this update. I wanted to make sure this change was not accidental, since the version update suggests it is a backwards compatible change (I do not know if Maven respects semver or not), even though it is not. I researched the problem more and the only safe way of updating this is either increasing the major version or defining a new interface altogether. But maybe there are other solutions for deprecating a method of an interface that I am not aware of. > MSHARED-1024 breaks binary backwards compatibility > -------------------------------------------------- > > Key: MSHARED-1045 > URL: https://issues.apache.org/jira/browse/MSHARED-1045 > Project: Maven Shared Components > Issue Type: Bug > Reporter: Andrei Silviu Dragnea > Priority: Major > > [https://github.com/apache/maven-reporting-api/pull/2] breaks binary > backwards compatibility of interface `MavenReport`, because replacing > `org.codehaus.doxia.sink.Sink` with `org.apache.maven.doxia.sink.Sink` > changes the signature of method: > {code:java} > void generate( Sink sink, Locale locale ) throws MavenReportException;{code} > So nothing compiled against version `3.0` of the `maven-reporting-api` works > with `3.1.0` anymore. > I suggest either reverting this commit in a new release or updating the code > in a backwards-compatible manner with two mutually recursive default > implementations for both the old and new signature (this requires Java 8 > support though): > > {code:java} > @Deprecated > default void generate( org.codehaus.doxia.sink.Sink sink, Locale locale ) > throws MavenReportException { > generate((Sink) sink, locale); > } > default void generate( Sink sink, Locale locale ) throws MavenReportException > { > generate((org.codehaus.doxia.sink.Sink) sink, locale); > } {code} > The solution above can result in `ClassCastException`s though, because some > `org.apache.maven.doxia.sink.Sink` maybe do not implement > `org.codehaus.doxia.sink`. I do not know any way of safely evolving the type > of an input parameter for a method. -- This message was sent by Atlassian Jira (v8.20.1#820001)