Skip to content
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

Thorough check on nullable/non-nullable arguments #140

Open
aalmiray opened this issue Oct 29, 2017 · 7 comments
Open

Thorough check on nullable/non-nullable arguments #140

aalmiray opened this issue Oct 29, 2017 · 7 comments
Assignees
Milestone

Comments

@aalmiray
Copy link
Contributor

For example DeferredRunnable(StartPolicy) does not check if its argument is null or not, perhaps assign a default value just like DeferredCallable does.

It might be a good idea to state the nullability of arguments and return types. This has been done in part in DeferredManager on the type safe versions of when, race, and settle.

@saturnism saturnism self-assigned this Dec 17, 2017
@saturnism saturnism added this to the 2.0.0 milestone Dec 17, 2017
@saturnism
Copy link
Member

thinking of using FindBugs and JSR 305 annotations, and going through all the input params thoroughly on DeferredManager and callbacks.

Should we do this before or after #157?

@aalmiray
Copy link
Contributor Author

aalmiray commented Dec 17, 2017

I'm a big fan of JSR-305 and I use whenever I can. This being said there are a few problems with it https://blog.codefx.org/java/jsr-305-java-9/

I think it would be better to perform a static analysis of the code without applying annotations to the source. We can do this with Findbugs and IntelliJ (both of them).

@saturnism
Copy link
Member

eak :( what should we use?
There are several options that can provide kotlin interop - https://kotlinlang.org/docs/reference/java-interop.html

@aalmiray
Copy link
Contributor Author

The thing is, if we choose existing @Nonnull/@Nullable we'll add an extra dependency to JDeferred, right now core only depends on slf4j-api. What worries me by bringing JSR-305 is the fact that someone may get in trouble setting up JDeferred with the module system.

@saturnism
Copy link
Member

hm, can it be an optional dependency? i.e., in normal cases and be optional during the runtime?

@aalmiray
Copy link
Contributor Author

The annotations from JSR-305 have runtime as retention policy. I'm afraid adding it's not possible to add them as an optional dependency.

@saturnism
Copy link
Member

doh! will put that on hold then, and just add null checks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants