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

Gary D. Gregory commented on FTPSERVER-506:
-------------------------------------------

Yes, indeed, you are missing something ;)

It is good that 1.1.4 is back to being compatible with 1.1.2 :)

1.2.0 now breaks binary compatibility, it is implemented in exactly the 
opposite of what it should be:
 * The method "String getEnabledProtocol()" existed in 1.1.2 and can stay as is.
 * If you add a new method to an existing interface and it's not a default 
method, you break both source and binary compatibility.
 * In 1.2.0, the EXISTING method "String getEnabledProtocol()" was changed to a 
default method (not necesssary for this ticket) and a NEW method "String[] 
getEnabledProtocols();" was added but NOT as a default method. 
 * The PR [https://github.com/apache/mina-ftpserver/pull/12] shows how to get 
your cake and eat it too: Add a new method to an interface AND keep the binary 
compatibility.

For reference:
 * 1.1.2 
[https://github.com/apache/mina-ftpserver/blob/ftpserver-parent-1.1.2/core/src/main/java/org/apache/ftpserver/ssl/SslConfiguration.java]
 * 1.2.0 
[https://github.com/apache/mina-ftpserver/blob/1.2.0/core/src/main/java/org/apache/ftpserver/ssl/SslConfiguration.java]

It is trivial to avoid these issues by using Maven plugins for JApiCmp or 
RevApi, see Apache Commons for example usage of JApiCmp.

 

> Binary compatibility is broken in ftpserver-core since 1.1.3, 1.2.0 vs 1.1.2
> ----------------------------------------------------------------------------
>
>                 Key: FTPSERVER-506
>                 URL: https://issues.apache.org/jira/browse/FTPSERVER-506
>             Project: FtpServer
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1.3, 1.1.4, 1.2.0
>            Reporter: Gary D. Gregory
>            Priority: Major
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> Over at Apache Commons, when we update Commons Net from 1.1.2 to 1.1.3, we 
> get compile errors:
> {noformat}
> [INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ 
> commons-net ---
> [INFO] Changes detected - recompiling the module!
> [INFO] Compiling 63 source files to 
> /home/runner/work/commons-net/commons-net/target/test-classes
> [INFO] -------------------------------------------------------------
> Error:  COMPILATION ERROR : 
> [INFO] -------------------------------------------------------------
> Error:  
> /home/runner/work/commons-net/commons-net/src/test/java/org/apache/commons/net/ftp/NoProtocolSslConfigurationProxy.java:[30,8]
>  org.apache.commons.net.ftp.NoProtocolSslConfigurationProxy is not abstract 
> and does not override abstract method getEnabledProtocols() in 
> org.apache.ftpserver.ssl.SslConfiguration
> Error:  
> /home/runner/work/commons-net/commons-net/src/test/java/org/apache/commons/net/ftp/NoProtocolSslConfigurationProxy.java:[32,5]
>  method does not override or implement a method from a supertype
> [INFO] 2 errors 
> [INFO] -------------------------------------------------------------
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Total time:  20.310 s
> [INFO] Finished at: 2022-03-04T02:17:14Z
> [INFO] 
> ------------------------------------------------------------------------
> Error:  Failed to execute goal 
> org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile 
> (default-testCompile) on project commons-net: Compilation failure: 
> Compilation failure: 
> Error:  
> /home/runner/work/commons-net/commons-net/src/test/java/org/apache/commons/net/ftp/NoProtocolSslConfigurationProxy.java:[30,8]
>  org.apache.commons.net.ftp.NoProtocolSslConfigurationProxy is not abstract 
> and does not override abstract method getEnabledProtocols() in 
> org.apache.ftpserver.ssl.SslConfiguration
> Error:  
> /home/runner/work/commons-net/commons-net/src/test/java/org/apache/commons/net/ftp/NoProtocolSslConfigurationProxy.java:[32,5]
>  method does not override or implement a method from a supertype
> Error:  -> [Help 1]
> Error:  
> Error:  To see the full stack trace of the errors, re-run Maven with the -e 
> switch.
> Error:  Re-run Maven using the -X switch to enable full debug logging.
> Error:  
> Error:  For more information about the errors and possible solutions, please 
> read the following articles:
> Error:  [Help 1] 
> http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
> Error: Process completed with exit code 1.
> {noformat}
> See PR Bump ftpserver-core from 1.1.2 to 1.1.3 Java CI #429: 
> https://github.com/apache/commons-net/runs/5416642453?check_suite_focus=true
> Please don't break BC! That should be rule #1 IMO.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org

Reply via email to