Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||||||
ID | ||||||||||||
0020137 | ||||||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||||||
defect | [Modules] APR Migration Tool | major | always | 2012-03-28 13:46 | 2012-03-28 13:46 | |||||||
Reporter | mirurita | View Status | public | |||||||||
Assigned To | mirurita | |||||||||||
Priority | normal | Resolution | open | Fixed in Version | ||||||||
Status | new | Fix in branch | Fixed in SCM revision | |||||||||
Projection | none | ETA | none | Target Version | ||||||||
OS | Any | Database | Any | Java version | ||||||||
OS Version | Database version | Ant version | ||||||||||
Product Version | SCM revision | |||||||||||
Regression date | ||||||||||||
Regression introduced by commit | ||||||||||||
Regression level | ||||||||||||
Review Assigned To | ||||||||||||
Regression introduced in release | ||||||||||||
Summary | 0020137: Migration tool methods modifying OrganizationStructureProvider class attributes | |||||||||||
Description | Due to issue 20129, using the public API if you get the OrganizationStructureProvider of your client and then you query (i.e.) for the children organization the object you get is a reference of the attribute of OrganizationStructureProvider (not a new instance). https://issues.openbravo.com/view.php?id=20129 [^] org.openbravo.erputil.aprmigrationtool.entity.MigrateSettlementPayments defaultFinancialAccount method: Set<String> organizations = OBContext.getOBContext().getOrganizationStructureProvider(org.getClient().getId()).getParentTree(org.getId(), true); organizations.add("0"); org.openbravo.erputil.aprmigrationtool.dao.MigrationToolDao defaultFinancialAccount method: Set<String> organizations = OBContext.getOBContext().getOrganizationStructureProvider(payment.getClient().getId()).getParentTree(payment.getOrganization().getId(), true); organizations.add("0"); | |||||||||||
Steps To Reproduce | 1) Check the value of the following attribute of OrganizationStructureProvider class: private Map<String, String> parentByOrganizationID = new HashMap<String, String>(); 2) Execute this code Set<String> organizations = OBContext.getOBContext().getOrganizationStructureProvider(org.getClient().getId()).getParentTree(org.getId(), true); organizations.add("0"); 3) Check again the value of: private Map<String, String> parentByOrganizationID = new HashMap<String, String>(); Realize that "0" is a new element of the Map. | |||||||||||
Proposed Solution | create a new instance as follows Set<String> organizations = new HashSet<String>(OBContext.getOBContext().getOrganizationStructureProvider(org.getClient().getId()).getParentTree(org.getId(), true)); organizations.add("0"); | |||||||||||
Tags | No tags attached. | |||||||||||
Attached Files | ||||||||||||
Relationships [ Relation Graph ] [ Dependency Graph ] | |
Issue History | |||
Date Modified | Username | Field | Change |
2012-03-28 13:46 | mirurita | New Issue | |
2012-03-28 13:46 | mirurita | Assigned To | => mirurita |
Copyright © 2000 - 2009 MantisBT Group |