Skip to content

Commit 31f3372

Browse files
committed
Setting nonnull for all params by default
1 parent 15a937f commit 31f3372

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

opamp-client/src/main/java/io/opentelemetry/opamp/client/internal/OpampClient.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
package io.opentelemetry.opamp.client.internal;
77

88
import io.opentelemetry.opamp.client.internal.response.MessageData;
9-
import javax.annotation.Nonnull;
9+
import javax.annotation.Nullable;
1010
import opamp.proto.AgentDescription;
1111
import opamp.proto.RemoteConfigStatus;
1212
import opamp.proto.ServerErrorResponse;
@@ -67,7 +67,7 @@ interface Callbacks {
6767
*
6868
* @param client The relevant {@link OpampClient} instance.
6969
*/
70-
void onConnect(@Nonnull OpampClient client);
70+
void onConnect(OpampClient client);
7171

7272
/**
7373
* Called when the connection to the Server cannot be established. May be called after {@link
@@ -77,7 +77,7 @@ interface Callbacks {
7777
* @param client The relevant {@link OpampClient} instance.
7878
* @param throwable The exception.
7979
*/
80-
void onConnectFailed(@Nonnull OpampClient client, Throwable throwable);
80+
void onConnectFailed(OpampClient client, @Nullable Throwable throwable);
8181

8282
/**
8383
* Called when the Server reports an error in response to some previously sent request. Useful
@@ -88,7 +88,7 @@ interface Callbacks {
8888
* @param client The relevant {@link OpampClient} instance.
8989
* @param errorResponse The error returned by the Server.
9090
*/
91-
void onErrorResponse(@Nonnull OpampClient client, @Nonnull ServerErrorResponse errorResponse);
91+
void onErrorResponse(OpampClient client, ServerErrorResponse errorResponse);
9292

9393
/**
9494
* Called when the Agent receives a message that needs processing. See {@link MessageData}
@@ -102,6 +102,6 @@ interface Callbacks {
102102
* @param client The relevant {@link OpampClient} instance.
103103
* @param messageData The server response data that needs processing.
104104
*/
105-
void onMessage(@Nonnull OpampClient client, @Nonnull MessageData messageData);
105+
void onMessage(OpampClient client, MessageData messageData);
106106
}
107107
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
@ParametersAreNonnullByDefault
7+
package io.opentelemetry.opamp.client.internal;
8+
9+
import javax.annotation.ParametersAreNonnullByDefault;

opamp-client/src/main/java/io/opentelemetry/opamp/client/internal/state/InMemoryState.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
abstract class InMemoryState<T> implements State<T> {
1717
private final AtomicReference<T> state = new AtomicReference<>();
1818

19-
public InMemoryState(@Nonnull T initialValue) {
19+
public InMemoryState(T initialValue) {
2020
state.set(initialValue);
2121
}
2222

23-
public void set(@Nonnull T value) {
23+
public void set(T value) {
2424
state.set(value);
2525
}
2626

0 commit comments

Comments
 (0)