private Integer addMapping(ObjectStreamClass desc) throws IOException { SerializableDataKey key = new SerializableDataKey(desc); Integer value = Integer.valueOf(nextMapping++); put(key, value); put(value, key.getSerializedOsc()); /* * We could populate the local cache of ObjectStreamClass descriptors here, * it will only help performance on the first deserialization of the * associated class though, and forcing the ObjectStreamClass to go through * a serialization pass helps provide some insurance that everything is * working correctly. */ return value; }
private static boolean equals(SerializableDataKey k1, SerializableDataKey k2) { if (k1.forClass() != null && k2.forClass() != null) { return k1.forClass() == k2.forClass(); } else if (Arrays.equals(k1.getSerializedOsc(), k2.getSerializedOsc())) { if (k1.forClass() != null) { k2.setClass(k1.forClass()); } else if (k2.forClass() != null) { k1.setClass(k2.forClass()); } return true; } else { return false; } }
private static boolean equals(SerializableDataKey k1, SerializableDataKey k2) { if (k1.forClass() != null && k2.forClass() != null) { return k1.forClass() == k2.forClass(); } else if (Arrays.equals(k1.getSerializedOsc(), k2.getSerializedOsc())) { if (k1.forClass() != null) { k2.setClass(k1.forClass()); } else if (k2.forClass() != null) { k1.setClass(k2.forClass()); } return true; } else { return false; } }
private Integer addMapping(ObjectStreamClass desc) throws IOException { SerializableDataKey key = new SerializableDataKey(desc); Integer value = Integer.valueOf(nextMapping++); put(value, key.getSerializedOsc()); put(key, value); /* * We could populate the local cache of ObjectStreamClass descriptors here, it will only help performance on the * first deserialization of the associated class though, and forcing the ObjectStreamClass to go through a * serialization pass helps provide some insurance that everything is working correctly. */ return value; }
private static boolean equals(SerializableDataKey k1, ComparisonSerializableDataKey k2) { if (k1.forClass() != null && k2.forClass() != null) { return k1.forClass() == k2.forClass(); } else if (k1.getFieldCount() == k2.getFieldCount() && Arrays.equals(k1.getSerializedOsc(), k2.getSerializedOsc())) { if (k1.forClass() == null && k2.forClass() != null) { k1.setClass(k2.forClass()); } return true; } else { return false; } }
private static boolean equals(SerializableDataKey k1, ComparisonSerializableDataKey k2) { if (k1.forClass() != null && k2.forClass() != null) { return k1.forClass() == k2.forClass(); } else if (k1.getFieldCount() == k2.getFieldCount() && Arrays.equals(k1.getSerializedOsc(), k2.getSerializedOsc())) { if (k1.forClass() == null && k2.forClass() != null) { k1.setClass(k2.forClass()); } return true; } else { return false; } }