Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0031479
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 07. Sales managementminorhave not tried2015-11-14 13:212015-11-23 21:17
ReportershuehnerView Statuspublic 
Assigned Toshuehner 
PrioritynormalResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revisiondcb3471fa95d
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tovmromanos
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0031479: NPE in CloneOrderActionHandler as result of logic error in code

DescriptionThis 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
Steps To ReproduceCheck Eclipse warning about NullPointerAccess.

Probably also reproducible by finding functional testing flow ensuring bdPriceList being null when accessing that part of the code.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
caused by defect 00207063.0MP14 closedjecharri To clone sales order is missing the list price value 
blocks feature request 0031477 newshuehner Tracking issue to reduce the huge number of eclipse warnings in pi 

-  Notes
(0081907)
hgbot (developer)
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 (developer)
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 (manager)
2015-11-17 13:41

Code review and testing (Clone an order) done
(0082248)
hudsonbot (developer)
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

- Issue History
Date Modified Username Field Change
2015-11-14 13:21 shuehner New Issue
2015-11-14 13:21 shuehner Assigned To => shuehner
2015-11-14 13:21 shuehner Modules => Core
2015-11-14 13:21 shuehner Triggers an Emergency Pack => No
2015-11-14 13:21 shuehner Relationship added blocks 0031477
2015-11-16 15:07 shuehner Review Assigned To => vmromanos
2015-11-16 19:18 hgbot Checkin
2015-11-16 19:18 hgbot Note Added: 0081907
2015-11-16 19:18 hgbot Status new => resolved
2015-11-16 19:18 hgbot Resolution open => fixed
2015-11-16 19:18 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/dcb3471fa95d264c5ba7ca283976cd7abc3ffbd4 [^]
2015-11-17 13:32 vmromanos Relationship added caused by 0020706
2015-11-17 13:40 hgbot Checkin
2015-11-17 13:40 hgbot Note Added: 0081922
2015-11-17 13:41 vmromanos Note Added: 0081924
2015-11-17 13:41 vmromanos Status resolved => closed
2015-11-23 21:17 hudsonbot Checkin
2015-11-23 21:17 hudsonbot Note Added: 0082248


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker