Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for Apache Validate (#769)
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 doesn'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: ```java public static <T extends Collection<?>> T notEmpty(final T collection) { } public static <T extends Map<?, ?>> T notEmpty(final T map) { } public static <T extends CharSequence> T notEmpty(final T chars) { } ``` 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.
- Loading branch information