]
Ryan Emerson updated ISPN-10862:
--------------------------------
Sprint: DataGrid Sprint #36 (was: DataGrid Sprint #36, DataGrid Sprint #37)
SpringCache unwrapping NullValue singleton fails with Java
Serialization
------------------------------------------------------------------------
Key: ISPN-10862
URL:
https://issues.jboss.org/browse/ISPN-10862
Project: Infinispan
Issue Type: Bug
Components: Spring Integration
Affects Versions: 10.0.0.Final
Reporter: Ryan Emerson
Assignee: Ryan Emerson
Priority: Blocker
Fix For: 10.0.1.Final, 10.1.0.Final
Our spring integration makes use of the {{NullValue.NULL}} singleton when wrapping null
values, however the singleton semantics are not respected when Java Serialization is used
as this was previously enforced by a {{Externalizer}} implementation.
Therefore, the NullValue wrapper is never unwrapped.
.SpringCache
private ValueWrapper wrap(Object value) {
if (value == null) {
return null;
}
if (value == NullValue.NULL) {
return NullValue.NULL;
}
return new SimpleValueWrapper(value);
}
private <T> T unwrapNull(Object value) {
if (value == NullValue.NULL) {
return null;
}
return (T) value;
}
{code}