*/
package org.opendaylight.controller.remote.rpc.messages;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.io.Serializable;
-import javax.annotation.Nullable;
+import org.eclipse.jdt.annotation.Nullable;
import org.opendaylight.controller.cluster.datastore.node.utils.stream.SerializationUtils;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
public class RpcResponse implements Serializable {
private static final long serialVersionUID = -4211279498688989245L;
+ @SuppressFBWarnings(value = "SE_BAD_FIELD", justification = "This field is not Serializable but this class "
+ + "implements writeReplace to delegate serialization to a Proxy class and thus instances of this class "
+ + "aren't serialized. FindBugs does not recognize this.")
private final NormalizedNode<?, ?> resultNormalizedNode;
- public RpcResponse(@Nullable final NormalizedNode<?, ?> inputNormalizedNode) {
+ public RpcResponse(final @Nullable NormalizedNode<?, ?> inputNormalizedNode) {
resultNormalizedNode = inputNormalizedNode;
}
- @Nullable
- public NormalizedNode<?, ?> getResultNormalizedNode() {
+ public @Nullable NormalizedNode<?, ?> getResultNormalizedNode() {
return resultNormalizedNode;
}
public Proxy() {
}
- Proxy(RpcResponse rpcResponse) {
+ Proxy(final RpcResponse rpcResponse) {
this.rpcResponse = rpcResponse;
}
@Override
- public void writeExternal(ObjectOutput out) throws IOException {
- SerializationUtils.serializeNormalizedNode(rpcResponse.getResultNormalizedNode(), out);
+ public void writeExternal(final ObjectOutput out) throws IOException {
+ SerializationUtils.writeNormalizedNode(out, rpcResponse.getResultNormalizedNode());
}
@Override
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+ public void readExternal(final ObjectInput in) {
rpcResponse = new RpcResponse(SerializationUtils.deserializeNormalizedNode(in));
}