-
Notifications
You must be signed in to change notification settings - Fork 44
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
SignatureChecker ignores annotation of enclosing class when checking field type #131
Comments
I think I hit this, as well. I attempted to work around it by putting Line 39 in 8c2eac0
(At first, I was using our own custom |
Values: https://www.mojohaus.org/animal-sniffer/animal-sniffer-annotations/apidocs/org/codehaus/mojo/animal_sniffer/IgnoreJRERequirement.html Context: This doesn't "fix" anything, but it prevents us from replicating an error I just made in the future: mojohaus/animal-sniffer#131 (comment) RELNOTES=n/a PiperOrigin-RevId: 348053776
Values: https://www.mojohaus.org/animal-sniffer/animal-sniffer-annotations/apidocs/org/codehaus/mojo/animal_sniffer/IgnoreJRERequirement.html Context: This doesn't "fix" anything, but it prevents us from replicating an error I just made in the future: mojohaus/animal-sniffer#131 (comment) RELNOTES=n/a PiperOrigin-RevId: 348062753
This is not fixed in 1.22; the comment on PR #139 erroneously referred to this issue (if I see that correctly). This can still be seen with the following simple example (using Java 5 signatures): import java.util.Optional;
import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
@IgnoreJRERequirement
class MyClass {
// BUG: This is not ignored
Optional<String> f;
// This is ignored due to @IgnoreJRERequirement, as desired
Optional<String> test() {
return null;
}
} |
Can confirm that this issue has not been fixed yet: mockito/mockito#2735 |
It looks like
SignatureChecker
ignores whether the enclosing class is annotated (and errors should be ignored) when processing field types:animal-sniffer/animal-sniffer/src/main/java/org/codehaus/mojo/animal_sniffer/SignatureChecker.java
Line 362 in 364fc20
This should probably be
checkType(Type.getType(descriptor), ignoreError);
.The text was updated successfully, but these errors were encountered: