Author: jleroux
Date: Tue May 17 17:47:48 2011 New Revision: 1104431 URL: http://svn.apache.org/viewvc?rev=1104431&view=rev Log: "Applied fix from trunk for revision: 1104423" ------------------------------------------------------------------------ r1104423 | jleroux | 2011-05-17 19:25:52 +0200 (mar., 17 mai 2011) | 5 lines A patch from Martin Kreidenweis "NullPointerException in GenericDelegator during testMode rollback" https://issues.apache.org/jira/browse/OFBIZ-4284 Test mode rollback doesn't work right in GenericDelegator for calls to removeByPrimary() key and removeByValue() when the row to be deleted didn't exist in the first place. It creates a TestOperation with a null value and subsequently fails to create that during rollback. First, the TestOperation shouldn't be created at all. Second, if null is passed to GenericDelegator.create() it tries to handle this, but fails with a NullPointerException. ------------------------------------------------------------------------ Modified: ofbiz/branches/release11.04/ (props changed) ofbiz/branches/release11.04/applications/order/script/org/ofbiz/order/customer/CheckoutMapProcs.xml (props changed) ofbiz/branches/release11.04/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyFinancialHistory.groovy (props changed) ofbiz/branches/release11.04/applications/product/script/org/ofbiz/product/test/InventoryTests.xml (props changed) ofbiz/branches/release11.04/framework/common/widget/HelpScreens.xml (props changed) ofbiz/branches/release11.04/framework/entity/src/org/ofbiz/entity/GenericDelegator.java ofbiz/branches/release11.04/framework/security/data/PasswordSecurityData.xml (props changed) ofbiz/branches/release11.04/specialpurpose/ebaystore/lib/ (props changed) ofbiz/branches/release11.04/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy (props changed) ofbiz/branches/release11.04/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy (props changed) ofbiz/branches/release11.04/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy (props changed) Propchange: ofbiz/branches/release11.04/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue May 17 17:47:48 2011 @@ -2,4 +2,4 @@ /ofbiz/branches/dojo1.4:951708-952957 /ofbiz/branches/jquery:952958-1044489 /ofbiz/branches/multitenant20100310:921280-927264 -/ofbiz/trunk:1100197,1100880 +/ofbiz/trunk:1100197,1100880,1104423 Propchange: ofbiz/branches/release11.04/applications/order/script/org/ofbiz/order/customer/CheckoutMapProcs.xml ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue May 17 17:47:48 2011 @@ -2,4 +2,4 @@ /ofbiz/branches/dojo1.4/applications/order/script/org/ofbiz/order/customer/CheckoutMapProcs.xml:951708-952957 /ofbiz/branches/jquery/applications/order/script/org/ofbiz/order/customer/CheckoutMapProcs.xml:952958-1044489 /ofbiz/branches/multitenant20100310/applications/order/script/org/ofbiz/order/customer/CheckoutMapProcs.xml:921280-927264 -/ofbiz/trunk/applications/order/script/org/ofbiz/order/customer/CheckoutMapProcs.xml:1100197,1100880 +/ofbiz/trunk/applications/order/script/org/ofbiz/order/customer/CheckoutMapProcs.xml:1100197,1100880,1104423 Propchange: ofbiz/branches/release11.04/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyFinancialHistory.groovy ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue May 17 17:47:48 2011 @@ -2,4 +2,4 @@ /ofbiz/branches/dojo1.4/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyFinancialHistory.groovy:951708-952957 /ofbiz/branches/jquery/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyFinancialHistory.groovy:952958-1044489 /ofbiz/branches/multitenant20100310/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyFinancialHistory.groovy:921280-927264 -/ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyFinancialHistory.groovy:1100197,1100880 +/ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/PartyFinancialHistory.groovy:1100197,1100880,1104423 Propchange: ofbiz/branches/release11.04/applications/product/script/org/ofbiz/product/test/InventoryTests.xml ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue May 17 17:47:48 2011 @@ -2,4 +2,4 @@ /ofbiz/branches/dojo1.4/applications/product/script/org/ofbiz/product/test/InventoryTests.xml:951708-952957 /ofbiz/branches/jquery/applications/product/script/org/ofbiz/product/test/InventoryTests.xml:952958-1044489 /ofbiz/branches/multitenant20100310/applications/product/script/org/ofbiz/product/test/InventoryTests.xml:921280-927264 -/ofbiz/trunk/applications/product/script/org/ofbiz/product/test/InventoryTests.xml:1100197,1100880 +/ofbiz/trunk/applications/product/script/org/ofbiz/product/test/InventoryTests.xml:1100197,1100880,1104423 Propchange: ofbiz/branches/release11.04/framework/common/widget/HelpScreens.xml ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue May 17 17:47:48 2011 @@ -2,4 +2,4 @@ /ofbiz/branches/dojo1.4/framework/common/widget/HelpScreens.xml:951708-952957 /ofbiz/branches/jquery/framework/common/widget/HelpScreens.xml:952958-1044489 /ofbiz/branches/multitenant20100310/framework/common/widget/HelpScreens.xml:921280-927264 -/ofbiz/trunk/framework/common/widget/HelpScreens.xml:1100197,1100880 +/ofbiz/trunk/framework/common/widget/HelpScreens.xml:1100197,1100880,1104423 Modified: ofbiz/branches/release11.04/framework/entity/src/org/ofbiz/entity/GenericDelegator.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release11.04/framework/entity/src/org/ofbiz/entity/GenericDelegator.java?rev=1104431&r1=1104430&r2=1104431&view=diff ============================================================================== --- ofbiz/branches/release11.04/framework/entity/src/org/ofbiz/entity/GenericDelegator.java (original) +++ ofbiz/branches/release11.04/framework/entity/src/org/ofbiz/entity/GenericDelegator.java Tue May 17 17:47:48 2011 @@ -861,7 +861,7 @@ public class GenericDelegator implements return value; } catch (GenericEntityException e) { - String errMsg = "Failure in create operation for entity [" + value.getEntityName() + "]: " + e.toString() + ". Rolling back transaction."; + String errMsg = "Failure in create operation for entity [" + (value != null ? value.getEntityName() : "null") + "]: " + e.toString() + ". Rolling back transaction."; Debug.logError(errMsg, module); try { // only rollback the transaction if we started one... @@ -995,7 +995,9 @@ public class GenericDelegator implements this.saveEntitySyncRemoveInfo(primaryKey); if (testMode) { - storeForTestRollback(new TestOperation(OperationType.DELETE, removedEntity)); + if (removedEntity != null) { + storeForTestRollback(new TestOperation(OperationType.DELETE, removedEntity)); + } } ecaRunner.evalRules(EntityEcaHandler.EV_RETURN, EntityEcaHandler.OP_REMOVE, primaryKey, false); @@ -1061,7 +1063,9 @@ public class GenericDelegator implements int num = helper.removeByPrimaryKey(value.getPrimaryKey()); if (testMode) { - storeForTestRollback(new TestOperation(OperationType.DELETE, removedValue)); + if (removedValue != null) { + storeForTestRollback(new TestOperation(OperationType.DELETE, removedValue)); + } } this.saveEntitySyncRemoveInfo(value.getPrimaryKey()); Propchange: ofbiz/branches/release11.04/framework/security/data/PasswordSecurityData.xml ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue May 17 17:47:48 2011 @@ -2,4 +2,4 @@ /ofbiz/branches/dojo1.4/applications/securityext/data/PasswordSecurityData.xml:951708-952957 /ofbiz/branches/jquery/applications/securityext/data/PasswordSecurityData.xml:952958-1044489 /ofbiz/branches/multitenant20100310/applications/securityext/data/PasswordSecurityData.xml:921280-927264 -/ofbiz/trunk/framework/security/data/PasswordSecurityData.xml:1100197,1100880 +/ofbiz/trunk/framework/security/data/PasswordSecurityData.xml:1100197,1100880,1104423 Propchange: ofbiz/branches/release11.04/specialpurpose/ebaystore/lib/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue May 17 17:47:48 2011 @@ -2,4 +2,4 @@ /ofbiz/branches/dojo1.4/specialpurpose/ebaystore/lib:951708-952957 /ofbiz/branches/jquery/specialpurpose/ebaystore/lib:952958-1044489 /ofbiz/branches/multitenant20100310/specialpurpose/ebaystore/lib:921280-927264 -/ofbiz/trunk/specialpurpose/ebaystore/lib:1100197,1100880 +/ofbiz/trunk/specialpurpose/ebaystore/lib:1100197,1100880,1104423 Propchange: ofbiz/branches/release11.04/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue May 17 17:47:48 2011 @@ -2,4 +2,4 @@ /ofbiz/branches/dojo1.4/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy:951708-952957 /ofbiz/branches/jquery/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy:952958-1044489 /ofbiz/branches/multitenant20100310/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy:921280-927264 -/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy:1100197,1100880 +/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/Facilities.groovy:1100197,1100880,1104423 Propchange: ofbiz/branches/release11.04/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue May 17 17:47:48 2011 @@ -2,4 +2,4 @@ /ofbiz/branches/dojo1.4/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy:951708-952957 /ofbiz/branches/jquery/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy:952958-1044489 /ofbiz/branches/multitenant20100310/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy:921280-927264 -/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy:1100197,1100880 +/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductList.groovy:1100197,1100880,1104423 Propchange: ofbiz/branches/release11.04/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue May 17 17:47:48 2011 @@ -2,4 +2,4 @@ /ofbiz/branches/dojo1.4/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy:951708-952957 /ofbiz/branches/jquery/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy:952958-1044489 /ofbiz/branches/multitenant20100310/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy:921280-927264 -/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy:1100197,1100880 +/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/WEB-INF/actions/ProductStockTake.groovy:1100197,1100880,1104423 |
Free forum by Nabble | Edit this page |