This is an automated email from the ASF dual-hosted git repository.
mridulpathak pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/trunk by this push:
new 1234bc367a Allow copying a GenericValue that was deserialized
1234bc367a is described below
commit 1234bc367afd381424a11ba8a66ec3ee721ea179
Author: Mridul Pathak <[email protected]>
AuthorDate: Fri Oct 30 16:12:06 2026 +0530
Allow copying a GenericValue that was deserialized
GenericEntity keeps its Observable in a transient field, so it is null once
the entity has been deserialized. The copy constructor path used by
GenericValue.create and refreshFromValue built the new Observable from that
field directly and failed with "observable cannot be null" when the source
value came from a restored session. Both now read it through the existing lazy
getObservable().
---
.../entity/src/main/java/org/apache/ofbiz/entity/GenericEntity.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
a/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericEntity.java
b/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericEntity.java
index deddc52a95..fe41d13f43 100644
--- a/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericEntity.java
+++ b/framework/entity/src/main/java/org/apache/ofbiz/entity/GenericEntity.java
@@ -250,7 +250,7 @@ public class GenericEntity implements Map<String, Object>,
LocalizedMap<Object>,
}
this.delegatorName = value.delegatorName;
this.internalDelegator = value.internalDelegator;
- this.observable = new Observable(value.observable);
+ this.observable = new Observable(value.getObservable());
}
/**
@@ -292,7 +292,7 @@ public class GenericEntity implements Map<String, Object>,
LocalizedMap<Object>,
this.setDelegator(newValue.getDelegator());
this.generateHashCode = newValue.generateHashCode;
this.cachedHashCode = newValue.cachedHashCode;
- this.observable = new Observable(newValue.observable);
+ this.observable = new Observable(newValue.getObservable());
}
/**