diff --git a/transport/src/main/java/io/netty/channel/socket/SctpData.java b/transport/src/main/java/io/netty/channel/socket/SctpData.java
index 25804872c0..123de98f9e 100644
--- a/transport/src/main/java/io/netty/channel/socket/SctpData.java
+++ b/transport/src/main/java/io/netty/channel/socket/SctpData.java
@@ -29,7 +29,7 @@ public final class SctpData implements SctpMessage {
private final ByteBuf payloadBuffer;
- private MessageInfo msgInfo;
+ private final MessageInfo msgInfo;
/**
* Essential data that is being carried within SCTP Data Chunk
@@ -41,6 +41,7 @@ public final class SctpData implements SctpMessage {
this.protocolIdentifier = protocolIdentifier;
this.streamIdentifier = streamIdentifier;
this.payloadBuffer = payloadBuffer;
+ this.msgInfo = null;
}
public SctpData(MessageInfo msgInfo, ByteBuf payloadBuffer) {
diff --git a/transport/src/main/java/io/netty/channel/socket/SctpNotification.java b/transport/src/main/java/io/netty/channel/socket/SctpNotification.java
index a02e4bac73..95fa304249 100644
--- a/transport/src/main/java/io/netty/channel/socket/SctpNotification.java
+++ b/transport/src/main/java/io/netty/channel/socket/SctpNotification.java
@@ -18,8 +18,8 @@ package io.netty.channel.socket;
import com.sun.nio.sctp.Notification;
public final class SctpNotification implements SctpMessage {
- private Notification notification;
- private Object attachment;
+ private final Notification notification;
+ private final Object attachment;
public SctpNotification(Notification notification, Object attachment) {
@@ -27,10 +27,17 @@ public final class SctpNotification implements SctpMessage {
this.attachment = attachment;
}
+ /**
+ * Return the {@link Notification}
+ */
public Notification notification() {
return notification;
}
+ /**
+ * Return the attachment of this {@link SctpNotification}, or
+ * null
if no attachment was provided
+ */
public Object attachment() {
return attachment;
}
diff --git a/transport/src/main/java/io/netty/channel/socket/SctpNotificationHandler.java b/transport/src/main/java/io/netty/channel/socket/SctpNotificationHandler.java
index b409a027d5..103a317e60 100644
--- a/transport/src/main/java/io/netty/channel/socket/SctpNotificationHandler.java
+++ b/transport/src/main/java/io/netty/channel/socket/SctpNotificationHandler.java
@@ -22,7 +22,6 @@ import com.sun.nio.sctp.Notification;
import com.sun.nio.sctp.PeerAddressChangeNotification;
import com.sun.nio.sctp.SendFailedNotification;
import com.sun.nio.sctp.ShutdownNotification;
-import io.netty.channel.ChannelPipeline;
public class SctpNotificationHandler extends AbstractNotificationHandler