-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Signature failure does not halt compilation #77
Comments
Are you sure your What happens when you use the <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<executions>
<execution>
<id>check-java-version-compatibility</id>
<phase>test</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<signature>
<groupId>org.codehaus.mojo.signature</groupId>
<artifactId>java18</artifactId>
<version>1.0</version>
</signature>
</configuration>
</execution>
</executions>
</plugin> |
This is what I'm using:
I still get this if there's a signature issue, without failure:
I tried changing the phase to
|
Adding the following to the
|
Narrowing this down further -- this does not seem to be a configuration problem, but rather a problem that covariant return types are not flagged as errors. I am compiling with JDK 1.8, using The following code is correct:
The following gives the
The following code does report an error and halt the build, since
|
I had a quick look at where this So it is not coming from the signature itself. |
@famod Thanks. So |
Well, that would be wrong for the 1.8 signature, wouldn't it? |
@famod I think line 603 should say |
Treat covariant return type as an error (mojohaus#77)
Actually somebody already addressed this in #83. |
We likewise pushed out a release that broke Java 7/8 compatibility, so we're now looking at this issue. Is there any chance that #83 (or a similar PR) might be merged in the near future, or should we look into alternative ways of detecting this problem? (We'd use Here's an example of the problem:
As in #83 (comment), I wasn't able to find much detail about MANIMALSNIFFER-49, only an archive of the brief original post. |
Slightly more history:
The question wasn't directly answered, and I think Animal Sniffer came away assuming that the answer is "no," leading to:
I believe my snippet above gives a more direct answer of "yes." |
When will we have |
In d654707 we swapped compiling the uploaded artifacts to Java 11. This caused ABI issues with ByteBuffer, like clear() returning ByteBuffer instead of Buffer. There are source-level approaches to avoid the accidental ABI dependency on Java 11, but we have no tool able to detect such breakages. We use Animalsniffer for similar cases, but it fails to detect these[1]. Since we have no tool, source-level approaches can't gain the necessary confidence that all incompatibility fixes have been resolved. Java has had javac-level ways to address this, but they used to require setting bootclasspath. Since Java 9, though, they made it easier and we can use --release, which does exactly what we need. Fixes grpc#10432 1. mojohaus/animal-sniffer#77
In d654707 we swapped compiling the uploaded artifacts to Java 11. This caused ABI issues with ByteBuffer, like clear() returning ByteBuffer instead of Buffer. There are source-level approaches to avoid the accidental ABI dependency on Java 11, but we have no tool able to detect such breakages. We use Animalsniffer for similar cases, but it fails to detect these[1]. Since we have no tool, source-level approaches can't gain the necessary confidence that all incompatibility fixes have been resolved. Java has had javac-level ways to address this, but they used to require setting bootclasspath. Since Java 9, though, they made it easier and we can use --release, which does exactly what we need. Fixes #10432 1. mojohaus/animal-sniffer#77
In d654707 we swapped compiling the uploaded artifacts to Java 11. This caused ABI issues with ByteBuffer, like clear() returning ByteBuffer instead of Buffer. There are source-level approaches to avoid the accidental ABI dependency on Java 11, but we have no tool able to detect such breakages. We use Animalsniffer for similar cases, but it fails to detect these[1]. Since we have no tool, source-level approaches can't gain the necessary confidence that all incompatibility fixes have been resolved. Java has had javac-level ways to address this, but they used to require setting bootclasspath. Since Java 9, though, they made it easier and we can use --release, which does exactly what we need. Fixes grpc#10432 1. mojohaus/animal-sniffer#77
In d654707 we swapped compiling the uploaded artifacts to Java 11. This caused ABI issues with ByteBuffer, like clear() returning ByteBuffer instead of Buffer. There are source-level approaches to avoid the accidental ABI dependency on Java 11, but we have no tool able to detect such breakages. We use Animalsniffer for similar cases, but it fails to detect these[1]. Since we have no tool, source-level approaches can't gain the necessary confidence that all incompatibility fixes have been resolved. Java has had javac-level ways to address this, but they used to require setting bootclasspath. Since Java 9, though, they made it easier and we can use --release, which does exactly what we need. Fixes #10432 1. mojohaus/animal-sniffer#77
In d654707 we swapped compiling the uploaded artifacts to Java 11. This caused ABI issues with ByteBuffer, like clear() returning ByteBuffer instead of Buffer. There are source-level approaches to avoid the accidental ABI dependency on Java 11, but we have no tool able to detect such breakages. We use Animalsniffer for similar cases, but it fails to detect these[1]. Since we have no tool, source-level approaches can't gain the necessary confidence that all incompatibility fixes have been resolved. Java has had javac-level ways to address this, but they used to require setting bootclasspath. Since Java 9, though, they made it easier and we can use --release, which does exactly what we need. Fixes grpc#10432 1. mojohaus/animal-sniffer#77
I just got it into my head to try using old version 1.13 (before the bug was introduced) as a workaround. That turns out to produce an But the real discovery was that, when I was ensuring that I'd actually reintroduced the problem, I found that the current version of Animal Sniffer catches it! It looks like @olamy merged @ogolberg's fix for this in ba0d71e, and apparently I'd neglected to subscribe to that PR thread way back when. I've confirmed that the first fixed version is 1.21. Thanks for taking care of that! |
When using Animal Sniffer 1.18, even with a failure like the following, compilation continues and succeeds:
The fact that the build did not stop on this error has caused me to push out releases that broke runtime compatibility with JDK 1.7/1.8.
The text was updated successfully, but these errors were encountered: