Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029427Openbravo ERPA. Platformpublic2015-03-26 11:552015-03-27 02:12
NaroaIriarte 
NaroaIriarte 
urgentmajorrandom
closedfixed 
5
 
3.0PR15Q2 
alostale
Core
No
0029427: It is possible to modify the object of the enum class ExporType.
It is possible to modify the object of the singleton. It is an object which belongs to an enum, and it is shared in all the instances, so, we do not want it to be modified.
Everywhere in the code it is possible to call the method "getExportParameters" of the "ExportType" enum, and using the method "put" of the Map for adding new values, it is modified. Executing the following code:

exportType.getExportParameters().put("ab", "ll");
 
Now the object it is modified. This should be avoided.
No tags attached.
related to feature request 0026763 closed gorkaion Ability to launch reports from process definitions 
related to defect 0029441 closed NaroaIriarte Exporting to XLS does not work in the new ReportingUtils class 
Issue History
2015-03-26 11:55NaroaIriarteNew Issue
2015-03-26 11:55NaroaIriarteAssigned To => NaroaIriarte
2015-03-26 11:55NaroaIriarteModules => Core
2015-03-26 11:55NaroaIriarteTriggers an Emergency Pack => No
2015-03-26 15:24alostaleReview Assigned To => alostale
2015-03-26 15:27alostaleRelationship addedrelated to 0026763
2015-03-26 15:30hgbotCheckin
2015-03-26 15:30hgbotNote Added: 0076014
2015-03-26 15:30hgbotStatusnew => resolved
2015-03-26 15:30hgbotResolutionopen => fixed
2015-03-26 15:30hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/b3dfa72fa77f6f9e857de9b37af6b7f292025b64 [^]
2015-03-26 15:32alostaleNote Added: 0076017
2015-03-26 15:32alostaleStatusresolved => closed
2015-03-26 15:32alostaleFixed in Version => 3.0PR15Q2
2015-03-27 02:12hudsonbotCheckin
2015-03-27 02:12hudsonbotNote Added: 0076044
2015-03-27 13:38NaroaIriarteRelationship addedrelated to 0029441

Notes
(0076014)
hgbot   
2015-03-26 15:30   
Repository: erp/devel/pi
Changeset: b3dfa72fa77f6f9e857de9b37af6b7f292025b64
Author: Naroa Iriarte <naroa.iriarte <at> openbravo.com>
Date: Thu Mar 26 13:59:54 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/b3dfa72fa77f6f9e857de9b37af6b7f292025b64 [^]

Fixed issue 29427: Modifiying the object of the enum ExportType is allowed.

The problem is that with the method getExportParemeters of the enum class ExportType, it is possible to get those
parameters in the Hasmap and after that, modify the object with the method "put".
This should not be allowed because this object belongs to an enum and all the instances have to share the same object,
we don't want to allow the modification of it.

For fixing this, an instance of the hashmap is done for making sure that if this method is called, it is only accessing
to the parameters of the current Map instance.

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/report/ReportingUtils.java
---
(0076017)
alostale   
2015-03-26 15:32   
code reviewed + tested
(0076044)
hudsonbot   
2015-03-27 02:12   
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/b8858c8b542b [^]
Maturity status: Test