Skip to content

Conversation

@scottf
Copy link
Contributor

@scottf scottf commented Aug 7, 2025

No description provided.

*/
Message next(Duration maxWait) throws IOException, InterruptedException, JetStreamStatusCheckedException, JetStreamApiException;
@Nullable
Message next(@Nullable Duration maxWait) throws IOException, InterruptedException, JetStreamStatusCheckedException, JetStreamApiException;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it's weird to have the only parameter of a method be nullable, but I've annotated based on implementation and the underlying implementations handles if the value is not present.

* @throws InterruptedException the connection is not connected
*/
void forceReconnect(ForceReconnectOptions options) throws IOException, InterruptedException;
void forceReconnect(@Nullable ForceReconnectOptions options) throws IOException, InterruptedException;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto nullable on only parameter

serverName = readString(jv, SERVER_NAME, "N/A");
version = readString(jv, VERSION, "0.0.0");
go = readString(jv, GO, "0.0.0");
host = readString(jv, HOST, "N/A");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defaults were added so getters can be marked as @NonNull


if (bytesRead > 0) {
connection.getNatsStatistics().registerRead(bytesRead);
connection.getStatisticsCollector().registerRead(bytesRead);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename of non-public api

@scottf scottf requested a review from MauriceVanVeen August 10, 2025 15:50
Copy link
Member

@MauriceVanVeen MauriceVanVeen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

}

KeyValueEntry existingOnly(KeyValueEntry kve) {
Debug.info("_get", kve);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this intended?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, which is why I don't commit the Debug class. I see now that the build failed.

@scottf scottf merged commit 3a01717 into main Aug 11, 2025
5 checks passed
@scottf scottf deleted the connection-nullability branch August 11, 2025 14:17
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

Successfully merging this pull request may close these issues.

3 participants