Skip to content

Commit 3517bbf

Browse files
committed
Fixed serialization issue
1 parent 1b61a0b commit 3517bbf

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

services-api/src/main/java/io/scalecube/services/ServiceMethodDefinition.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ public void writeExternal(ObjectOutput out) throws IOException {
8282
out.writeInt(tags.size());
8383
for (Entry<String, String> entry : tags.entrySet()) {
8484
out.writeUTF(entry.getKey());
85-
out.writeUTF(entry.getValue());
85+
out.writeObject(entry.getValue());
8686
}
8787

8888
// auth
8989
out.writeBoolean(isSecured);
9090
}
9191

9292
@Override
93-
public void readExternal(ObjectInput in) throws IOException {
93+
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
9494
// namespace
9595
action = in.readUTF();
9696

@@ -99,7 +99,7 @@ public void readExternal(ObjectInput in) throws IOException {
9999
Map<String, String> tags = new HashMap<>(tagsSize);
100100
for (int i = 0; i < tagsSize; i++) {
101101
String key = in.readUTF();
102-
String value = in.readUTF();
102+
String value = (String) in.readObject();
103103
tags.put(key, value);
104104
}
105105
this.tags = Collections.unmodifiableMap(tags);

services-api/src/main/java/io/scalecube/services/ServiceRegistration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public void writeExternal(ObjectOutput out) throws IOException {
7373
out.writeInt(tags.size());
7474
for (Entry<String, String> entry : tags.entrySet()) {
7575
out.writeUTF(entry.getKey());
76-
out.writeUTF(entry.getValue());
76+
out.writeObject(entry.getValue()); // value is nullable
7777
}
7878

7979
// methods
@@ -93,7 +93,7 @@ public void readExternal(ObjectInput in) throws IOException, ClassNotFoundExcept
9393
Map<String, String> tags = new HashMap<>(tagsSize);
9494
for (int i = 0; i < tagsSize; i++) {
9595
String key = in.readUTF();
96-
String value = in.readUTF();
96+
String value = (String) in.readObject(); // value is nullable
9797
tags.put(key, value);
9898
}
9999
this.tags = Collections.unmodifiableMap(tags);

0 commit comments

Comments
 (0)