-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
And nullable/nonnullable annotation to improve Kotlin API #54
Conversation
centrifuge/src/main/java/io/github/centrifugal/centrifuge/Client.java
Outdated
Show resolved
Hide resolved
centrifuge/src/main/java/io/github/centrifugal/centrifuge/Client.java
Outdated
Show resolved
Hide resolved
centrifuge/src/main/java/io/github/centrifugal/centrifuge/Dns.java
Outdated
Show resolved
Hide resolved
centrifuge/src/main/java/io/github/centrifugal/centrifuge/package-info.java
Show resolved
Hide resolved
@PhilipDukhov many thanks, I'll go through the changes one more time very soon and if no other comments will appear proceed with merging. |
Awesome 👍 |
@PhilipDukhov hello, unfortunately I think this requires more careful research. I just noticed that all my Java code that uses this SDK started to have various warnings like this: Also it started complaining to possible NullPointerException where it can't be thrown: I see more clearly now how Not sure this all can be fixed quickly. Seems that I'll have to revert the change for now :( |
Opened #61 |
Right now, when used from Kotlin, library generates a lot of optional parameters - that's default behaviour for Java interop, as there's no build-in nullability checks.
With this PR I've added
ParametersAreNonnullByDefault
annotation to the lib package - this makes all arguments non nullable by default for IDEA linter and for Kotlin interop.Also I've added a couple
Nullable
annotation for parameters that actually can be null - after adding@ParametersAreNonnullByDefault
, IDEA showed me such places with warnings.Also fixed a couple of warned placed