rename deproxy to deproxyIfInitialized
authorAndreas Müller <a.mueller@bgbm.org>
Mon, 29 Jun 2020 07:24:02 +0000 (09:24 +0200)
committerAndreas Müller <a.mueller@bgbm.org>
Mon, 29 Jun 2020 07:24:02 +0000 (09:24 +0200)
eu.etaxonomy.taxeditor.cdmlib/src/main/java/org/hibernate/collection/internal/AbstractPersistentCollection.java
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/operation/RemotingCdmUpdateOperationTest.java

index e9c3f4c..a6b66ad 100644 (file)
@@ -1336,8 +1336,8 @@ public abstract class AbstractPersistentCollection implements Serializable, Pers
                                        throw new HibernateException("commonService not initialized (null)");
                                }
 
                                        throw new HibernateException("commonService not initialized (null)");
                                }
 
-                               //Object obj = ProxyUtils.deproxy(cachedCommonService.initializeCollection(this));
-                               Object obj = ProxyUtils.deproxy(cachedCommonService.initializeCollection(cdmBase.getUuid(), fieldName));
+                               //Object obj = ProxyUtils.deproxyIfInitialized(cachedCommonService.initializeCollection(this));
+                               Object obj = ProxyUtils.deproxyIfInitialized(cachedCommonService.initializeCollection(cdmBase.getUuid(), fieldName));
                                if(ProxyUtils.isUninitializedProxy(obj)) {
                                    throw new HibernateException("Persistent Collection initialized but is still a proxy");
                                }
                                if(ProxyUtils.isUninitializedProxy(obj)) {
                                    throw new HibernateException("Persistent Collection initialized but is still a proxy");
                                }
index 4bc3aff..c02ac97 100644 (file)
@@ -62,11 +62,11 @@ public class RemotingCdmUpdateOperationTest extends BaseOperationTest {
 
     @Test
     public void testUpdateResultWithCdmEntities() throws ExecutionException {
 
     @Test
     public void testUpdateResultWithCdmEntities() throws ExecutionException {
-        TaxonNode taxonNode1 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid1));
-        TaxonNode taxonNode2 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid2));
-        TaxonNode taxonNode3 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid3));
-        TaxonNode taxonNode4 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid4));
-        TaxonNode taxonNode5 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid5));
+        TaxonNode taxonNode1 = ProxyUtils.deproxyIfInitialized(taxonNodeService.load(taxonNodeUuid1));
+        TaxonNode taxonNode2 = ProxyUtils.deproxyIfInitialized(taxonNodeService.load(taxonNodeUuid2));
+        TaxonNode taxonNode3 = ProxyUtils.deproxyIfInitialized(taxonNodeService.load(taxonNodeUuid3));
+        TaxonNode taxonNode4 = ProxyUtils.deproxyIfInitialized(taxonNodeService.load(taxonNodeUuid4));
+        TaxonNode taxonNode5 = ProxyUtils.deproxyIfInitialized(taxonNodeService.load(taxonNodeUuid5));
 
         taxonNodes = new HashSet<>();
         taxonNodes.add(taxonNode1);
 
         taxonNodes = new HashSet<>();
         taxonNodes.add(taxonNode1);
@@ -89,11 +89,11 @@ public class RemotingCdmUpdateOperationTest extends BaseOperationTest {
 
     @Test
     public void testUpdateResultWithCdmIdentities() throws ExecutionException {
 
     @Test
     public void testUpdateResultWithCdmIdentities() throws ExecutionException {
-        TaxonNode taxonNode1 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid1));
-        TaxonNode taxonNode2 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid2));
-        TaxonNode taxonNode3 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid3));
-        TaxonNode taxonNode4 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid4));
-        TaxonNode taxonNode5 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid5));
+        TaxonNode taxonNode1 = ProxyUtils.deproxyIfInitialized(taxonNodeService.load(taxonNodeUuid1));
+        TaxonNode taxonNode2 = ProxyUtils.deproxyIfInitialized(taxonNodeService.load(taxonNodeUuid2));
+        TaxonNode taxonNode3 = ProxyUtils.deproxyIfInitialized(taxonNodeService.load(taxonNodeUuid3));
+        TaxonNode taxonNode4 = ProxyUtils.deproxyIfInitialized(taxonNodeService.load(taxonNodeUuid4));
+        TaxonNode taxonNode5 = ProxyUtils.deproxyIfInitialized(taxonNodeService.load(taxonNodeUuid5));
 
         taxonNodes = new HashSet<>();
         taxonNodes.add(taxonNode1);
 
         taxonNodes = new HashSet<>();
         taxonNodes.add(taxonNode1);
@@ -122,11 +122,11 @@ public class RemotingCdmUpdateOperationTest extends BaseOperationTest {
 
     @Test
     public void testUpdateResultWithLoadedCdmIdentities() throws ExecutionException {
 
     @Test
     public void testUpdateResultWithLoadedCdmIdentities() throws ExecutionException {
-        TaxonNode taxonNode1 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid1));
-        TaxonNode taxonNode2 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid2));
-        TaxonNode taxonNode3 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid3));
-        TaxonNode taxonNode4 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid4));
-        TaxonNode taxonNode5 = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid5));
+        TaxonNode taxonNode1 = ProxyUtils.deproxyIfInitialized(taxonNodeService.load(taxonNodeUuid1));
+        TaxonNode taxonNode2 = ProxyUtils.deproxyIfInitialized(taxonNodeService.load(taxonNodeUuid2));
+        TaxonNode taxonNode3 = ProxyUtils.deproxyIfInitialized(taxonNodeService.load(taxonNodeUuid3));
+        TaxonNode taxonNode4 = ProxyUtils.deproxyIfInitialized(taxonNodeService.load(taxonNodeUuid4));
+        TaxonNode taxonNode5 = ProxyUtils.deproxyIfInitialized(taxonNodeService.load(taxonNodeUuid5));
 
         taxonNodes = new HashSet<>();
         taxonNodes.add(taxonNode1);
 
         taxonNodes = new HashSet<>();
         taxonNodes.add(taxonNode1);
@@ -157,7 +157,7 @@ public class RemotingCdmUpdateOperationTest extends BaseOperationTest {
 
     @Test
     public void testDataChange() throws ExecutionException {
 
     @Test
     public void testDataChange() throws ExecutionException {
-        TaxonNode taxonNode = (TaxonNode) ProxyUtils.deproxy(taxonNodeService.load(taxonNodeUuid1));
+        TaxonNode taxonNode = ProxyUtils.deproxyIfInitialized(taxonNodeService.load(taxonNodeUuid1));
         CdmEntityIdentifier cei = new CdmEntityIdentifier(taxonNode.getId(), TaxonNode.class);
 
         taxonNodes = new HashSet<>();
         CdmEntityIdentifier cei = new CdmEntityIdentifier(taxonNode.getId(), TaxonNode.class);
 
         taxonNodes = new HashSet<>();