Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0031479Openbravo ERP07. Sales managementpublic2015-11-14 13:212015-11-23 21:17
shuehner 
shuehner 
normalminorhave not tried
closedfixed 
5
 
 
vmromanos
Core
No
0031479: NPE in CloneOrderActionHandler as result of logic error in code
This class has a logic error in its code leading to NPE always in case of bdPriceList being null

Stopped by eclipse warning: NullPointerAccess

- if (!"".equals(bdPriceList) || bdPriceList != null
+ if (!"".equals(bdPriceList) && bdPriceList != null
             || !bdPriceList.equals(BigDecimal.ZERO.setScale(bdPriceList.scale()))) {

Problem is wrong use of || where apparently && was intended.
Result if when unfixed and bdPriceList is null that the null check does not work in practice and the following check for ZERO triggers an NPE
Check Eclipse warning about NullPointerAccess.

Probably also reproducible by finding functional testing flow ensuring bdPriceList being null when accessing that part of the code.
No tags attached.
caused by defect 00207063.0MP14 closed jecharri To clone sales order is missing the list price value 
blocks feature request 0031477 new shuehner Tracking issue to reduce the huge number of eclipse warnings in pi 
Issue History
2015-11-14 13:21shuehnerNew Issue
2015-11-14 13:21shuehnerAssigned To => shuehner
2015-11-14 13:21shuehnerModules => Core
2015-11-14 13:21shuehnerTriggers an Emergency Pack => No
2015-11-14 13:21shuehnerRelationship addedblocks 0031477
2015-11-16 15:07shuehnerReview Assigned To => vmromanos
2015-11-16 19:18hgbotCheckin
2015-11-16 19:18hgbotNote Added: 0081907
2015-11-16 19:18hgbotStatusnew => resolved
2015-11-16 19:18hgbotResolutionopen => fixed
2015-11-16 19:18hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/dcb3471fa95d264c5ba7ca283976cd7abc3ffbd4 [^]
2015-11-17 13:32vmromanosRelationship addedcaused by 0020706
2015-11-17 13:40hgbotCheckin
2015-11-17 13:40hgbotNote Added: 0081922
2015-11-17 13:41vmromanosNote Added: 0081924
2015-11-17 13:41vmromanosStatusresolved => closed
2015-11-23 21:17hudsonbotCheckin
2015-11-23 21:17hudsonbotNote Added: 0082248

Notes
(0081907)
hgbot   
2015-11-16 19:18   
Repository: erp/devel/pi
Changeset: dcb3471fa95d264c5ba7ca283976cd7abc3ffbd4
Author: Stefan Hühner <stefan.huehner <at> openbravo.com>
Date: Sat Nov 14 13:22:20 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/dcb3471fa95d264c5ba7ca283976cd7abc3ffbd4 [^]

Fixed 31479: Fix NPE with bdPriceList being null.

Fix logic error in if-condition to ensure the bdPriceList != null
check works as intended.

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/businesslogic/CloneOrderActionHandler.java
---
(0081922)
hgbot   
2015-11-17 13:40   
Repository: erp/devel/pi
Changeset: daa748385c724d989214db8048708fb2f18a8606
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Tue Nov 17 13:39:07 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/daa748385c724d989214db8048708fb2f18a8606 [^]

Related to issue 31479: code review improvements

List Price is only set when bdPriceList is not Zero (or null)

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/businesslogic/CloneOrderActionHandler.java
---
(0081924)
vmromanos   
2015-11-17 13:41   
Code review and testing (Clone an order) done
(0082248)
hudsonbot   
2015-11-23 21:17   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/7b56bebaaa88 [^]
Maturity status: Test