-
Notifications
You must be signed in to change notification settings - Fork 291
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
Added support for Apache Validate #769
Conversation
@Asapin thanks for the contribution! Can you run |
I tried to run And if I run
and then it prints a list of seemingly all source files that exist in the project. Is this expected behavior (I doubt, but who knows)? Could it be because I'm using Windows? Update: tried to run this task in WSL Ubuntu. At first it complained that |
For now I just ran formatting on Mac and it works. @Asapin if you can please file an issue on GJF not working on Windows. We should probably fix by just switching to Spotless. I will try to review the change soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, and I appreciate the comprehensive test suite!
This reverts commit 0466a02.
This reverts commit 0466a02.
This reverts commit 0466a02.
This reverts commit 0466a02.
This reverts commit 0466a02.
Added support for Apache Validate: https://github.com/apache/commons-lang/blob/master/src/main/java/org/apache/commons/lang3/Validate.java
We recently started to use these Apache methods to validate some data but quickly found out that NullAway don't support them since they are not properly annotated. Here's a fix that adds support for these methods along with test cases for each method.
I noticed that Apache library generally has different validation methods for String, Map and Collection, but they all end up with the same signature when analyzed by NullAway (probably because these methods use generics).
Examples of such methods:
But I decided to add a separate unit test for each of these methods in case NullAway will change how it generates method's signature in the future