Skip to content

Commit 66fd5d3

Browse files
committed
[broker-23] add NotNull annotations to fields
1 parent 6453677 commit 66fd5d3

File tree

7 files changed

+14
-13
lines changed

7 files changed

+14
-13
lines changed

src/main/java/com/ss/mqtt/broker/model/MqttVersion.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ public enum MqttVersion {
6262
return availableVersions[level];
6363
}
6464

65-
private final String name;
66-
private final byte[] nameInBytes;
65+
private final @NotNull MqttPacketOutFactory packetOutFactory;
66+
private final byte @NotNull [] nameInBytes;
67+
private final @NotNull String name;
6768
private final byte version;
68-
private final MqttPacketOutFactory packetOutFactory;
6969

7070
MqttVersion(@NotNull String name, int version, @NotNull MqttPacketOutFactory packetOutFactory) {
7171
this.name = name;

src/main/java/com/ss/mqtt/broker/model/PacketProperty.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ public enum PacketProperty {
6464
}
6565

6666
private final @Getter byte id;
67-
private final @Getter PacketDataType dataType;
68-
private final Object defaultValue;
67+
private final @Getter @NotNull PacketDataType dataType;
68+
private final @Nullable Object defaultValue;
6969

7070
PacketProperty(int id, @NotNull PacketDataType dataType) {
7171
this(id, dataType, null);

src/main/java/com/ss/mqtt/broker/model/SharedSubscriber.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
public class SharedSubscriber implements Subscriber {
1414

1515
private final @NotNull SharedTopicFilter topicFilter;
16-
private final ConcurrentArray<SingleSubscriber> subscribers;
17-
private final AtomicInteger current;
16+
private final @NotNull ConcurrentArray<SingleSubscriber> subscribers;
17+
private final @NotNull AtomicInteger current;
1818

1919
public SharedSubscriber(@NotNull SubscribeTopicFilter topic) {
2020
subscribers = ConcurrentArray.ofType(Subscriber.class);

src/main/java/com/ss/mqtt/broker/model/data/type/StringPair.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
import lombok.Getter;
55
import lombok.RequiredArgsConstructor;
66
import lombok.ToString;
7+
import org.jetbrains.annotations.NotNull;
78

89
@Getter
910
@ToString
1011
@EqualsAndHashCode
1112
@RequiredArgsConstructor
1213
public class StringPair {
1314

14-
private final String name;
15-
private final String value;
15+
private final @NotNull String name;
16+
private final @NotNull String value;
1617
}

src/main/java/com/ss/mqtt/broker/network/client/AbstractMqttClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ public abstract class AbstractMqttClient implements UnsafeMqttClient {
3232
}
3333

3434
protected final @NotNull MqttConnection connection;
35-
protected final MqttClientReleaseHandler releaseHandler;
36-
protected final AtomicBoolean released;
35+
protected final @NotNull MqttClientReleaseHandler releaseHandler;
36+
protected final @NotNull AtomicBoolean released;
3737

3838
private volatile @Setter @NotNull String clientId;
3939
private volatile @Setter @Getter @Nullable MqttSession session;

src/main/java/com/ss/mqtt/broker/service/impl/FileCredentialsSource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
public class FileCredentialsSource extends AbstractCredentialSource {
1414

15-
private final String fileName;
15+
private final @NotNull String fileName;
1616

1717
public FileCredentialsSource(@NotNull String fileName) {
1818
this.fileName = fileName;

src/main/java/com/ss/mqtt/broker/service/impl/SimpleSubscriptionService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*/
2424
public class SimpleSubscriptionService implements SubscriptionService {
2525

26-
private final TopicSubscribers topicSubscribers = new TopicSubscribers();
26+
private final @NotNull TopicSubscribers topicSubscribers = new TopicSubscribers();
2727

2828
@Override
2929
public <A> @NotNull ActionResult forEachTopicSubscriber(

0 commit comments

Comments
 (0)