Skip to content

Commit

Permalink
EmptyMessage.set/getObject() and set/getArray() are now no-ops
Browse files Browse the repository at this point in the history
  • Loading branch information
belaban committed Jun 19, 2023
1 parent 432936c commit 012fe81
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/org/jgroups/EmptyMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ public EmptyMessage(Address dest) {
public byte[] getArray() {return null;}
public int getOffset() {return 0;}
public int getLength() {return 0;}
public EmptyMessage setArray(byte[] b, int off, int len) {throw new UnsupportedOperationException();}
public EmptyMessage setArray(ByteArray buf) {throw new UnsupportedOperationException();}
public <T extends Object> T getObject() {throw new UnsupportedOperationException();}
public EmptyMessage setObject(Object obj) {throw new UnsupportedOperationException();}
public EmptyMessage setArray(byte[] b, int off, int len) {return this;}
public EmptyMessage setArray(ByteArray buf) {return this;}
public <T extends Object> T getObject() {return null;}
public EmptyMessage setObject(Object obj) {return this;}

public void writePayload(DataOutput out) throws IOException {
// no payload to write
Expand Down
5 changes: 3 additions & 2 deletions src/org/jgroups/protocols/relay/Topology.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import org.jgroups.*;
import org.jgroups.annotations.ManagedOperation;
import org.jgroups.stack.IpAddress;
import org.jgroups.util.Bits;
import org.jgroups.util.SizeStreamable;
import org.jgroups.util.Util;

Expand Down Expand Up @@ -171,15 +172,15 @@ public int serializedSize() {

@Override
public void writeTo(DataOutput out) throws IOException {
Util.writeString(site, out);
Bits.writeString(site, out);
Util.writeAddress(addr, out);
Util.writeAddress(ip_addr, out);
out.writeBoolean(site_master);
}

@Override
public void readFrom(DataInput in) throws IOException, ClassNotFoundException {
site=Util.readString(in);
site=Bits.readString(in);
addr=Util.readAddress(in);
ip_addr=(IpAddress)Util.readAddress(in);
site_master=in.readBoolean();
Expand Down

0 comments on commit 012fe81

Please sign in to comment.