Skip to content

Commit

Permalink
Changed registration of a different class with the same ID to a debug…
Browse files Browse the repository at this point in the history
… message.

The use case is in KryoNet's RMI, where we want to send the implementation of an object on the server as if it were the interface. This means the interface and the implementation use the same class ID.
  • Loading branch information
NathanSweet committed Jan 27, 2014
1 parent 9d694f3 commit 7c8bc3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/com/esotericsoftware/kryo/Kryo.java
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,8 @@ public Registration register (Registration registration) {
if (id < 0) throw new IllegalArgumentException("id must be > 0: " + id);

Registration existing = getRegistration(registration.getId());
if (existing != null && existing.getType() != registration.getType()) {
throw new KryoException("An existing registration with a different type already uses ID: " + registration.getId()
if (DEBUG && existing != null && existing.getType() != registration.getType()) {
debug("An existing registration with a different type already uses ID: " + registration.getId()
+ "\nExisting registration: " + existing + "\nUnable to set registration: " + registration);
}

Expand Down

0 comments on commit 7c8bc3b

Please sign in to comment.