dropbox-sdk-java icon indicating copy to clipboard operation
dropbox-sdk-java copied to clipboard

Use JSR 305 Nullable/Nonnull annotations?

Open fge opened this issue 10 years ago • 2 comments

Such annotations can help immensely when programming with the API, as it tells the API user what to expect.

Two examples from DbxClient:

  • .startGetFile() can have null as its second argument; it will also never return null; therefore:
@Nonnull
DbxClient.Downloader startGetFile(String path, @Nullable String rev)
  • .getMetadata() can return null:
@Nullable
DbxEntry getMetadata(String path)

fge avatar Dec 07 '14 11:12 fge

The SDK itself currently uses the Checker Framework's Nullness Checker. (It seemed like the best available option when I looked into this last year.)

I just posted a question on their mailing list asking how best to move forward: https://groups.google.com/forum/#!topic/checker-framework-discuss/TETwy3IAqNg

cakoose avatar Dec 07 '14 18:12 cakoose

+1, providing nullability information via annotations would be great. I know @wdziemia has requested this as well. We don't have a timeline on this, but I'll tag this as something we do want to add in the future.

handstandsam avatar Sep 23 '22 12:09 handstandsam