summaryrefslogtreecommitdiff
path: root/lib/jinterface/java_src/com/ericsson
diff options
context:
space:
mode:
authorSverker Eriksson <sverker@erlang.org>2022-01-31 14:40:08 +0100
committerSverker Eriksson <sverker@erlang.org>2022-01-31 14:40:08 +0100
commita73c4a215bed34cf08a5c3ebb76e75a4b2ae70cd (patch)
treef4ff0bc4eb82b0a4a95dfbf490e2fc2170914c25 /lib/jinterface/java_src/com/ericsson
parentf2191a95197a617319c92ae5ed38cd67ea57f898 (diff)
parent80d22b8df573e399f5834d6ce5bdcdd727ea0f9b (diff)
downloaderlang-a73c4a215bed34cf08a5c3ebb76e75a4b2ae70cd.tar.gz
Merge branch 'sverker/23/jinterface/write_pid-fix/OTP-17887' into sverker/jinterface/write_pid-fix/OTP-17887
Diffstat (limited to 'lib/jinterface/java_src/com/ericsson')
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpOutputStream.java27
1 files changed, 10 insertions, 17 deletions
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpOutputStream.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpOutputStream.java
index d8f4d442dd..502c830c48 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpOutputStream.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpOutputStream.java
@@ -700,24 +700,22 @@ public class OtpOutputStream extends ByteArrayOutputStream {
* the nodename.
*
* @param id
- * an arbitrary number. Only the low order 15 bits will be used.
+ * an arbitrary number.
*
* @param serial
- * another arbitrary number. Only the low order 13 bits will be
- * used.
+ * another arbitrary number.
*
* @param creation
- * yet another arbitrary number. Only the low order 2 bits will
- * be used.
+ * node incarnation number.
*
*/
public void write_pid(final String node, final int id, final int serial,
final int creation) {
write1(OtpExternal.newPidTag);
write_atom(node);
- write4BE(id & 0x7fff); // 15 bits
- write4BE(serial & 0x1fff); // 13 bits
- write1(creation & 0x3); // 2 bits
+ write4BE(id);
+ write4BE(serial);
+ write4BE(creation);
}
/**
@@ -813,12 +811,11 @@ public class OtpOutputStream extends ByteArrayOutputStream {
* the nodename.
*
* @param ids
- * an array of arbitrary numbers. Only the low order 18 bits of
- * the first number will be used. At most three numbers
+ * an array of arbitrary numbers. At most three numbers
* will be read from the array.
*
* @param creation
- * another arbitrary number. Only the low order 2 bits will be used.
+ * another arbitrary number.
*
*/
public void write_ref(final String node, final int[] ids, final int creation) {
@@ -834,13 +831,9 @@ public class OtpOutputStream extends ByteArrayOutputStream {
write_atom(node);
- write1(creation & 0x3); // 2 bits
+ write4BE(creation);
- // first int gets truncated to 18 bits
- write4BE(ids[0] & 0x3ffff);
-
- // remaining ones are left as is
- for (int i = 1; i < arity; i++) {
+ for (int i = 0; i < arity; i++) {
write4BE(ids[i]);
}
}