NSAmelchev commented on code in PR #12889:
URL: https://github.com/apache/ignite/pull/12889#discussion_r2966223076
##########
modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/SecurityAwareCustomMessageWrapper.java:
##########
@@ -95,37 +93,20 @@ public DiscoveryCustomMessage delegate() {
return ack == null ? null : new SecurityAwareCustomMessageWrapper(ack,
secSubjId);
}
- /** */
- public byte[] messageBytes() {
- if (delegate instanceof Message)
- return null;
-
- if (msgBytes != null)
- return msgBytes;
-
- try {
- return msgBytes = U.marshal(jdk(), delegate);
- }
- catch (IgniteCheckedException e) {
- throw new IgniteException(e);
- }
+ /** {@inheritDoc} */
+ @Override public short directType() {
+ return 501;
}
- /** */
- public void messageBytes(byte[] msgBytes) {
- if (F.isEmpty(msgBytes))
- return;
-
- try {
- delegate = U.unmarshal(jdk(), msgBytes, U.gridClassLoader());
- }
- catch (IgniteCheckedException e) {
- throw new RuntimeException(e);
- }
+ /** {@inheritDoc} */
+ @Override public void prepareMarshal(Marshaller marsh) throws
IgniteCheckedException {
+ if (!(delegate instanceof Message))
+ msgBytes = U.marshal(marsh, delegate);
}
/** {@inheritDoc} */
- @Override public short directType() {
- return 501;
+ @Override public void finishUnmarshal(Marshaller marsh, ClassLoader
clsLdr) throws IgniteCheckedException {
+ if (msgBytes != null)
+ delegate = U.unmarshal(marsh, msgBytes, U.gridClassLoader());
Review Comment:
```suggestion
delegate = U.unmarshal(marsh, msgBytes, clsLdr);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]