public void verifyIfBytesOfSerializedObjectChanged() { // this first check verifies if the variable value was not overwritten with another object if (deserializedObject == variableInstanceEntity.getCachedValue() && !variableInstanceEntity.isDeleted()) { byte[] bytes = type.serialize(deserializedObject, variableInstanceEntity); if (!Arrays.equals(originalBytes, bytes)) { // Add an additional check to prevent byte differences due to JDK changes etc Object originalObject = type.deserialize(originalBytes, variableInstanceEntity); byte[] refreshedOriginalBytes = type.serialize(originalObject, variableInstanceEntity); if (!Arrays.equals(refreshedOriginalBytes, bytes)) { variableInstanceEntity.setBytes(bytes); } } } } }
public void setValue(Object value, ValueFields valueFields) { byte[] bytes = serialize(value, valueFields); valueFields.setCachedValue(value); super.setValue(bytes, valueFields); if (trackDeserializedObjects && valueFields instanceof VariableInstanceEntity) { Context.getCommandContext().addCloseListener(new VerifyDeserializedObjectCommandContextCloseListener( new DeserializedObject(this, valueFields.getCachedValue(), bytes, (VariableInstanceEntity)valueFields))); } }
public void verifyIfBytesOfSerializedObjectChanged() { // this first check verifies if the variable value was not overwritten with another object if (deserializedObject == variableInstanceEntity.getCachedValue() && !variableInstanceEntity.isDeleted()) { byte[] bytes = type.serialize(deserializedObject, variableInstanceEntity); if (!Arrays.equals(originalBytes, bytes)) { // Add an additional check to prevent byte differences due to JDK changes etc Object originalObject = type.deserialize(originalBytes, variableInstanceEntity); byte[] refreshedOriginalBytes = type.serialize(originalObject, variableInstanceEntity); if (!Arrays.equals(refreshedOriginalBytes, bytes)) { variableInstanceEntity.setBytes(bytes); } } } } }
public void flush() { // this first check verifies if the variable value was not overwritten with another object if (deserializedObject == variableInstanceEntity.getCachedValue() && !variableInstanceEntity.isDeleted()) { byte[] bytes = type.serialize(deserializedObject, variableInstanceEntity); if (!Arrays.equals(originalBytes, bytes)) { // Add an additional check to prevent byte differences due to JDK changes etc Object originalObject = type.deserialize(originalBytes, variableInstanceEntity); byte[] refreshedOriginalBytes = type.serialize(originalObject, variableInstanceEntity); if (!Arrays.equals(refreshedOriginalBytes, bytes)) { variableInstanceEntity.setBytes(bytes); } } } } }
public void flush() { // this first check verifies if the variable value was not overwritten with another object if (deserializedObject==variableInstanceEntity.getCachedValue()) { byte[] bytes = SerializableType.serialize(deserializedObject, variableInstanceEntity); if (!Arrays.equals(originalBytes, bytes)) { variableInstanceEntity .getByteArrayValue() .setBytes(bytes); } } } }
public void setValue(Object value, ValueFields valueFields) { byte[] byteArray = serialize(value, valueFields); valueFields.setCachedValue(value); if(valueFields.getByteArrayValue() == null) { if(valueFields instanceof VariableInstanceEntity) { Context .getCommandContext() .getDbSqlSession() .addDeserializedObject(valueFields.getCachedValue(), byteArray, (VariableInstanceEntity)valueFields); } } super.setValue(byteArray, valueFields); }
public void setValue(Object value, ValueFields valueFields) { byte[] bytes = serialize(value, valueFields); valueFields.setCachedValue(value); super.setValue(bytes, valueFields); if (trackDeserializedObjects && valueFields instanceof VariableInstanceEntity) { Context.getCommandContext().addCloseListener(new VerifyDeserializedObjectCommandContextCloseListener( new DeserializedObject(this, valueFields.getCachedValue(), bytes, (VariableInstanceEntity)valueFields))); } }
@Override public void setValue(Object value, ValueFields valueFields) { byte[] byteArray = serialize(value, valueFields); valueFields.setCachedValue(value); if (valueFields.getBytes() == null) { // TODO why the null check? won't this cause issues when setValue is called the second this with a different object? if (valueFields instanceof VariableInstanceEntity) { // register the deserialized object for dirty checking. Context.getCommandContext() .getDbSqlSession() .addDeserializedObject(new DeserializedObject(this, valueFields.getCachedValue(), byteArray, (VariableInstanceEntity) valueFields)); } } super.setValue(byteArray, valueFields); }