This is an automated email from the ASF dual-hosted git repository. ntimofeev pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/cayenne.git
The following commit(s) were added to refs/heads/master by this push: new f2c6c1cf0 CAY-2801 Incorrect equals() implementation in IdGenerationMarker could cause data missing in the commit f2c6c1cf0 is described below commit f2c6c1cf08e999289c1563d302bf87f001f9d595 Author: Nikita Timofeev <stari...@gmail.com> AuthorDate: Fri Mar 10 12:15:30 2023 +0300 CAY-2801 Incorrect equals() implementation in IdGenerationMarker could cause data missing in the commit --- RELEASE-NOTES.txt | 3 ++- .../main/java/org/apache/cayenne/access/flush/IdGenerationMarker.java | 4 +--- .../test/java/org/apache/cayenne/access/flush/EffectiveOpIdTest.java | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index d7ca09e9a..fba82465e 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -50,4 +50,5 @@ CAY-2765 dbimport: check excluded catalogs and schemas for the SQLServer CAY-2774 Overriding service ordering in DI List causes DIRuntimeException CAY-2782 Modeler: save button becomes active on DataMap comment field focus CAY-2783 DbEntity to ObjEntity synchronization should check mandatory flag for primitive java types -CAY-2792 Fix Insertion Order For Reflexive DataObjects \ No newline at end of file +CAY-2792 Fix Insertion Order For Reflexive DataObjects +CAY-2801 Incorrect equals() implementation in IdGenerationMarker could cause data missing in the commit \ No newline at end of file diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/flush/IdGenerationMarker.java b/cayenne-server/src/main/java/org/apache/cayenne/access/flush/IdGenerationMarker.java index 299e35261..5aead021b 100644 --- a/cayenne-server/src/main/java/org/apache/cayenne/access/flush/IdGenerationMarker.java +++ b/cayenne-server/src/main/java/org/apache/cayenne/access/flush/IdGenerationMarker.java @@ -31,10 +31,8 @@ import org.apache.cayenne.access.types.InternalUnsupportedTypeFactory; class IdGenerationMarker implements Serializable, InternalUnsupportedTypeFactory.Marker { private static final long serialVersionUID = -5339942931435878094L; - private final static IdGenerationMarker INSTANCE = new IdGenerationMarker(); - static IdGenerationMarker marker() { - return INSTANCE; + return new IdGenerationMarker(); } private IdGenerationMarker() { diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/flush/EffectiveOpIdTest.java b/cayenne-server/src/test/java/org/apache/cayenne/access/flush/EffectiveOpIdTest.java index 4877e0c6a..d9a7dbce0 100644 --- a/cayenne-server/src/test/java/org/apache/cayenne/access/flush/EffectiveOpIdTest.java +++ b/cayenne-server/src/test/java/org/apache/cayenne/access/flush/EffectiveOpIdTest.java @@ -40,6 +40,7 @@ public class EffectiveOpIdTest { EffectiveOpId effectiveOpId2 = new EffectiveOpId("test", Collections.singletonMap("pk", ObjectIdValueSupplier.getFor(id1, "pk"))); assertEquals(effectiveOpId1, effectiveOpId2); + assertNotEquals(id1.getReplacementIdMap().get("pk"), IdGenerationMarker.marker()); } } \ No newline at end of file