Skip to content
Permalink
Browse files
Fix custom marshal check on reading side
This encapsulates the check in a method called 'isCustomUnmarshalled()'
- this needs a better name.
  • Loading branch information
ngmr committed Apr 17, 2015
1 parent c73d835 commit 92289be9f9bfddcf5d80a830514ecff8dcec2c99
Showing 1 changed file with 12 additions and 9 deletions.
@@ -509,17 +509,18 @@ public void write(org.omg.CORBA.portable.OutputStream out, Object value) {
}

public boolean isCustomMarshalled() {
if (_is_externalizable)
return true;

if (_write_object_method != null)
if (isCustomUnmarshalled())
return true;

if (_super_descriptor != null)
return _super_descriptor.isCustomMarshalled();

return false;
}

private boolean isCustomUnmarshalled() {
return (_is_externalizable || (_write_object_method != null));
}

public java.io.Serializable writeReplace(java.io.Serializable val) {
if (_write_replace_method != null) {
@@ -848,13 +849,15 @@ protected void readValue(ObjectReader reader, java.io.Serializable value)

// System.out.println ("readValue "+getJavaClass());

if (isCustomMarshalled()) {
Byte customMarshalStreamFormatVersion;
Boolean wasDefaultWriteObjectCalled;
if (isCustomUnmarshalled()) {

// read custom marshalling value header
byte streamFormatVersion = reader.readByte();
boolean writeDefaultStateCalled = reader.readBoolean();
logger.log(Level.FINE, "Reading value in streamFormatVersion=" + streamFormatVersion
+ " IsCalleddefaultWriteObject=" + writeDefaultStateCalled);
customMarshalStreamFormatVersion = reader.readByte();
wasDefaultWriteObjectCalled = reader.readBoolean();
logger.log(Level.FINE, "Reading value in streamFormatVersion=" + customMarshalStreamFormatVersion
+ " defaultWriteObject=" + wasDefaultWriteObjectCalled);
}

if (_read_object_method != null) {

0 comments on commit 92289be

Please sign in to comment.