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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0020659
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorhave not tried2012-06-01 10:052012-06-07 12:37
ReportermtaalView Statuspublic 
Assigned ToAugustoMauch 
PrioritynormalResolutionfixedFixed in Version3.0MP13
StatusclosedFix in branchFixed in SCM revisionb9a5fed6dd96
ProjectionnoneETAnoneTarget Version3.0MP13
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0020659: OrganizationStructureProvider throws NPE if passed org id does not belong to the client

DescriptionThe OrganizationStructureProvider class throws an NPE in this line (271):
    return new HashSet<String>(childByOrganizationID.get(orgId));

this because childByOrganizationID.get(orgId) returns null and the HashSet constructor can't handle that.

It is nicer to either throw a more meaningfull exception (organization not valid for client or something) or return an empty result.
Steps To ReproduceGet the organization structure provider from the context:
      Set<String> orgChildTree = OBContext.getOBContext().getOrganizationStructureProvider()
          .getChildTree(strOrg, true);

the strOrg should be a non-existing id
a NPE will be thrown

it is nice to check this issue through a junit testcase
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0049619)
hgbot (developer)
2012-06-05 15:09

Repository: erp/devel/pi
Changeset: b9a5fed6dd96ef644fcf8c6e31260a4f93ccf340
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Jun 05 15:08:23 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/b9a5fed6dd96ef644fcf8c6e31260a4f93ccf340 [^]

Fixes issue 20659: An empty set is returned when an invalid orgid is provided

The method getChildOrg of OrganizationStructureProvider now returns and empty set instead of null if an invalid orgid is provided.

A test has been added to test this behaviour.: Enter commit message. Lines beginning with 'HG:' are removed.

---
M src-test/org/openbravo/test/dal/IssuesTest.java
M src/org/openbravo/dal/security/OrganizationStructureProvider.java
---
(0049667)
guilleaer (developer)
2012-06-07 12:37

code reviewed and tested in pi@0bc61ab27f73

- Issue History
Date Modified Username Field Change
2012-06-01 10:05 mtaal New Issue
2012-06-01 10:05 mtaal Assigned To => marvintm
2012-06-01 10:05 mtaal Modules => Core
2012-06-04 12:13 marvintm Assigned To marvintm => AugustoMauch
2012-06-05 15:09 hgbot Checkin
2012-06-05 15:09 hgbot Note Added: 0049619
2012-06-05 15:09 hgbot Status new => resolved
2012-06-05 15:09 hgbot Resolution open => fixed
2012-06-05 15:09 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/b9a5fed6dd96ef644fcf8c6e31260a4f93ccf340 [^]
2012-06-07 12:37 guilleaer Note Added: 0049667
2012-06-07 12:37 guilleaer Status resolved => closed
2012-06-07 12:37 guilleaer Fixed in Version => 3.0MP13


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker