Skip to content

Commit

Permalink
fixed/added missing default branch in CmwLightProtocol
Browse files Browse the repository at this point in the history
  • Loading branch information
RalphSteinhagen committed Nov 13, 2020
1 parent eec1e74 commit 5b1bff4
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public static CmwLightMessage recvMsg(final ZMQ.Socket socket, int tout) throws
return parseMsg(ZMsg.recvMsg(socket, tout));
}

public static CmwLightMessage parseMsg(final ZMsg data) throws RdaLightException {
public static CmwLightMessage parseMsg(final ZMsg data) throws RdaLightException { // NOPMD - NPath complexity acceptable (complex protocol)
AssertUtils.notNull("data", data);
final ZFrame firstFrame = data.pollFirst();
if (firstFrame != null && Arrays.equals(firstFrame.getData(), new byte[] { MessageType.SERVER_CONNECT_ACK.value() })) {
Expand Down Expand Up @@ -299,9 +299,12 @@ public static ZMsg serialiseMsg(final CmwLightMessage msg) throws RdaLightExcept
result.add(serialiseExceptionMessage(msg.exceptionMessage));
addDescriptor(result, FrameType.HEADER, FrameType.BODY_EXCEPTION);
break;
default:
}
return result;
default:
}

throw new RdaLightException("Invalid cmwMessage: " + msg);
}

Expand Down Expand Up @@ -428,11 +431,12 @@ private static Map<String, Object> readMap(final FieldDescription field) {
if (result == null) {
result = new HashMap<>();
}
if (false) { // find out how to see if the field is itself a map
result.put(dataField.getFieldName(), readMap(dataField));
} else {
result.put(dataField.getFieldName(), ((WireDataFieldDescription) dataField).data());
}
//if ( 'condition' ) {
// find out how to see if the field is itself a map
// result.put(dataField.getFieldName(), readMap(dataField))
// } else {
result.put(dataField.getFieldName(), ((WireDataFieldDescription) dataField).data());
//}
}
return result;
}
Expand Down

0 comments on commit 5b1bff4

Please sign in to comment.