Source:
<code>private void handleBinaryWebSocketMessage(BinaryCarbonMessage binaryCarbonMessage, PatternPathRouter.RoutableDestination<Object> routableEndpoint, Session session) { Object webSocketEndpoint = routableEndpoint.getDestination(); Map<String, String> paramValues = routableEndpoint.getGroupNameValues(); Method method = new EndpointDispatcher().getOnBinaryMessageMethod(webSocketEndpoint); try { List<Object> parameterList = new LinkedList<>(); Arrays.stream(method.getParameters()).forEach( parameter -> { if (parameter.getType() == ByteBuffer.class) { parameterList.add(binaryCarbonMessage.readBytes()); } else if (parameter.getType() == byte[].class) { ByteBuffer buffer = binaryCarbonMessage.readBytes(); byte[] bytes = new byte[buffer.capacity()]; for (int i = 0; i < buffer.capacity(); i++) { bytes[i] = buffer.get(); } parameterList.add(bytes); } else if (parameter.getType() == boolean.class) { parameterList.add(binaryCarbonMessage.isFinalFragment()); } else if (parameter.getType() == Session.class) { parameterList.add(session); } else if (parameter.getType() == String.class) { PathParam pathParam = parameter.getAnnotation(PathParam.class); if (pathParam != null) { parameterList.add(paramValues.get(pathParam.value())); } else { <START> parameterList.add(null); <END> throw new IllegalArgumentException("String parameters without" + " @PathParam annotation"); } } else { parameterList.add(null); } } ); executeMethod(method, webSocketEndpoint, parameterList, session); } catch (Throwable throwable) { handleError(binaryCarbonMessage, throwable, routableEndpoint, session); } }</code><technical_language>If throwing, do need add a null list</technical_language>

Target:
private void handleBinaryWebSocketMessage(BinaryCarbonMessage binaryCarbonMessage, PatternPathRouter.RoutableDestination<Object> routableEndpoint, Session session) { Object webSocketEndpoint = routableEndpoint.getDestination(); Map<String, String> paramValues = routableEndpoint.getGroupNameValues(); Optional<Method> methodOptional = new EndpointDispatcher().getOnBinaryMessageMethod(webSocketEndpoint); try { methodOptional.ifPresent( method -> { List<Object> parameterList = new LinkedList<>(); Arrays.stream(method.getParameters()).forEach( parameter -> { if (parameter.getType() == ByteBuffer.class) { parameterList.add(binaryCarbonMessage.readBytes()); } else if (parameter.getType() == byte[].class) { ByteBuffer buffer = binaryCarbonMessage.readBytes(); byte[] bytes = new byte[buffer.capacity()]; for (int i = 0; i < buffer.capacity(); i++) { bytes[i] = buffer.get(); } parameterList.add(bytes); } else if (parameter.getType() == boolean.class) { parameterList.add(binaryCarbonMessage.isFinalFragment()); } else if (parameter.getType() == Session.class) { parameterList.add(session); } else if (parameter.getType() == String.class) { PathParam pathParam = parameter.getAnnotation(PathParam.class); if (pathParam != null) { parameterList.add(paramValues.get(pathParam.value())); } else { throw new IllegalArgumentException("String parameters without" + " @PathParam annotation"); } } else { parameterList.add(null); } } ); executeMethod(method, webSocketEndpoint, parameterList, session); } ); } catch (Throwable throwable) { handleError(throwable, routableEndpoint, session); } }