uber / NullAway

A tool to help eliminate NullPointerExceptions (NPEs) in your Java code with low build-time overhead
MIT License
3.62k stars 290 forks source link

MethodRef Javadocs wrong for method with multiple arguments (space after comma doesn't work) #972

Closed robinst closed 3 months ago

robinst commented 3 months ago

Steps to reproduce:

  1. Add a LibraryModels implementation
  2. Implement e.g. the castToNonNullMethods method and return a method ref with a signature like "<T>castToNonNull(T, java.lang.String)" (notice the space after the comma!)

Expected: It works, because the Javadocs example has a comma, see: https://github.com/uber/NullAway/blob/6cec433e639f7a7eab449e742a71380d0e107692/nullaway/src/main/java/com/uber/nullaway/LibraryModels.java#L189-L190 Actual: The space doesn't make it work. Removing the space makes it work:

-"<T>castToNonNull(T, java.lang.String)"
+"<T>castToNonNull(T,java.lang.String)"

The Javadocs should probably be fixed, or spaces could be removed by methodRef.

msridhar commented 3 months ago

Thanks for the report, I've put up #973 to fix the documentation.

robinst commented 3 months ago

Perfect, thank you!