Skip to content

Commit 6b3ce94

Browse files
WIP
1 parent 0772079 commit 6b3ce94

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/SecurityAwareCustomMessageWrapper.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
import org.apache.ignite.spi.discovery.DiscoverySpiCustomMessage;
2929
import org.jetbrains.annotations.Nullable;
3030

31-
import static org.apache.ignite.marshaller.Marshallers.jdk;
32-
3331
/** Custom message wrapper with ID of security subject that initiated the current message. */
3432
public class SecurityAwareCustomMessageWrapper extends DiscoverySpiCustomMessage implements MarshallableMessage {
3533
/** */
@@ -44,11 +42,12 @@ public class SecurityAwareCustomMessageWrapper extends DiscoverySpiCustomMessage
4442

4543
/** */
4644
// TODO: Should be removed in https://issues.apache.org/jira/browse/IGNITE-27627
45+
@Order(1)
4746
Message msg;
4847

4948
/** Serialized message bytes. */
5049
// TODO: Should be removed in https://issues.apache.org/jira/browse/IGNITE-27627
51-
@Order(1)
50+
@Order(2)
5251
byte[] msgBytes;
5352

5453
/** Default constructor for {@link MessageFactory}. */
@@ -101,13 +100,13 @@ public DiscoveryCustomMessage delegate() {
101100

102101
/** {@inheritDoc} */
103102
@Override public void prepareMarshal(Marshaller marsh) throws IgniteCheckedException {
104-
if (delegate instanceof Message)
105-
msgBytes = U.marshal(jdk(), delegate);
103+
if (!(delegate instanceof Message))
104+
msgBytes = U.marshal(marsh, delegate);
106105
}
107106

108107
/** {@inheritDoc} */
109108
@Override public void finishUnmarshal(Marshaller marsh, ClassLoader clsLdr) throws IgniteCheckedException {
110109
if (msgBytes != null)
111-
delegate = U.unmarshal(jdk(), msgBytes, U.gridClassLoader());
110+
delegate = U.unmarshal(marsh, msgBytes, U.gridClassLoader());
112111
}
113112
}

0 commit comments

Comments
 (0)