Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,18 @@ protected void encodeRequestData(Channel channel, ObjectOutput out, Object data,
Object[] args = inv.getArguments();
if (args != null) {
for (int i = 0; i < args.length; i++) {
out.writeObject(callbackServiceCodec.encodeInvocationArgument(channel, inv, i));
Object arg = callbackServiceCodec.encodeInvocationArgument(channel, inv, i);
try {
out.writeObject(arg);
} catch (IOException e) {
Throwable cause = e.getCause() != null ? e.getCause().getCause() : null;
if (cause instanceof IllegalArgumentException
&& cause.getMessage() != null
&& cause.getMessage().contains("has not implement Serializable")) {
throw new IOException(arg.getClass().getName() + " must implement java.io.Serializable", e);
}
throw e;
}
}
}
out.writeAttachments(inv.getObjectAttachments());
Expand All @@ -313,7 +324,17 @@ protected void encodeResponseData(Channel channel, ObjectOutput out, Object data
out.writeByte(attach ? RESPONSE_NULL_VALUE_WITH_ATTACHMENTS : RESPONSE_NULL_VALUE);
} else {
out.writeByte(attach ? RESPONSE_VALUE_WITH_ATTACHMENTS : RESPONSE_VALUE);
out.writeObject(ret);
try {
out.writeObject(ret);
} catch (IOException e) {
Throwable cause = e.getCause() != null ? e.getCause().getCause() : null;
if (cause instanceof IllegalArgumentException
&& cause.getMessage() != null
&& cause.getMessage().contains("has not implement Serializable")) {
throw new IOException(ret.getClass().getName() + " must implement java.io.Serializable", e);
}
throw e;
}
}
} else {
out.writeByte(attach ? RESPONSE_WITH_EXCEPTION_WITH_ATTACHMENTS : RESPONSE_WITH_EXCEPTION);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ void testPerm() {
}

@Test
@Disabled
public void testNonSerializedParameter() {
DemoService service = new DemoServiceImpl();
int port = NetUtils.getAvailablePort();
Expand All @@ -258,7 +257,6 @@ public void testNonSerializedParameter() {
}

@Test
@Disabled
public void testReturnNonSerialized() {
DemoService service = new DemoServiceImpl();
int port = NetUtils.getAvailablePort();
Expand Down
Loading