Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0037329 | Openbravo ERP | A. Platform | public | 2017-11-20 14:38 | 2018-01-03 12:39 |
|
Reporter | alostale | |
Assigned To | alostale | |
Priority | normal | Severity | trivial | Reproducibility | have not tried |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | | |
Target Version | | Fixed in Version | 3.0PR18Q1 | |
Merge Request Status | |
Review Assigned To | caristu |
OBNetwork customer | |
Web browser | |
Modules | Core |
Support ticket | |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0037329: make a more generic Utility.arrayListToString |
Description | Currently, there is a Utility.arrayListToString which generates a String representing all the elements in an ArrayList separated by commas and optionally quoted. This is useful to generate SQL queries with IN clauses. The API is unnecessarily limited to ArrayList.
It would be useful, in for some cases, to be more generic allowing any Collection instance instead of just ArrayList. |
Steps To Reproduce | See, for example, UpdateActuals [1] where a new ArrayList needs to be created from a Set to perform this operation.
---
[1] https://code.openbravo.com/erp/devel/pi/file/e9a105538e89/src/org/openbravo/erpCommon/ad_process/UpdateActuals.java#l100 [^] |
Proposed Solution | Create a more generic API that allows to create this String for Collections instead of just ArrayList. Additionally implement it in a more performant manner.
See metrics taken for new method compared with old one:
elements 1
commaSeparated: 0 ms
arrayListToString: 0 ms
elements 10
commaSeparated: 0 ms
arrayListToString: 1 ms
elements 100
commaSeparated: 0 ms
arrayListToString: 0 ms
elements 1000
commaSeparated: 2 ms
arrayListToString: 76 ms
elements 10000
commaSeparated: 2 ms
arrayListToString: 2936 ms
elements 100000
commaSeparated: 31 ms
arrayListToString: 135858 ms
|
Additional Information | |
Tags | No tags attached. |
Relationships | related to | defect | 0037324 | | closed | alostale | slow login having many preferences |
|
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2017-11-20 14:38 | alostale | New Issue | |
2017-11-20 14:38 | alostale | Assigned To | => platform |
2017-11-20 14:38 | alostale | Modules | => Core |
2017-11-20 14:38 | alostale | Triggers an Emergency Pack | => No |
2017-11-20 14:42 | alostale | Steps to Reproduce Updated | bug_revision_view_page.php?rev_id=16321#r16321 |
2017-11-20 14:42 | alostale | Proposed Solution updated | |
2017-11-20 14:42 | alostale | Relationship added | related to 0037324 |
2017-11-20 14:42 | alostale | Assigned To | platform => alostale |
2017-11-20 14:42 | alostale | Review Assigned To | => caristu |
2017-11-21 09:58 | hgbot | Checkin | |
2017-11-21 09:58 | hgbot | Note Added: 0100639 | |
2017-11-21 09:58 | hgbot | Status | new => resolved |
2017-11-21 09:58 | hgbot | Resolution | open => fixed |
2017-11-21 09:58 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/4399ee25ce29f9bfae0280dfedda54e875abeee9 [^] |
2017-11-21 10:06 | alostale | Note Added: 0100640 | |
2017-11-21 10:12 | hgbot | Checkin | |
2017-11-21 10:12 | hgbot | Note Added: 0100642 | |
2017-11-21 10:14 | hgbot | Checkin | |
2017-11-21 10:14 | hgbot | Note Added: 0100643 | |
2017-11-24 12:52 | caristu | Note Added: 0100702 | |
2017-11-24 12:52 | caristu | Status | resolved => closed |
2017-11-24 12:52 | caristu | Fixed in Version | => 3.0PR18Q1 |
2017-12-04 10:20 | hgbot | Checkin | |
2017-12-04 10:20 | hgbot | Note Added: 0100911 | |
2017-12-04 10:20 | hgbot | Status | closed => resolved |
2017-12-04 10:20 | hgbot | Fixed in SCM revision | http://code.openbravo.com/erp/devel/pi/rev/4399ee25ce29f9bfae0280dfedda54e875abeee9 [^] => http://code.openbravo.com/erp/devel/pi/rev/1930cd6e575642a6e47ca9d8e5552615cae41821 [^] |
2017-12-04 10:21 | hgbot | Checkin | |
2017-12-04 10:21 | hgbot | Note Added: 0100912 | |
2017-12-15 11:04 | caristu | Note Added: 0101054 | |
2017-12-15 11:04 | caristu | Status | resolved => closed |
2017-12-29 14:38 | hgbot | Checkin | |
2017-12-29 14:38 | hgbot | Note Added: 0101294 | |
2018-01-03 12:39 | hudsonbot | Checkin | |
2018-01-03 12:39 | hudsonbot | Note Added: 0101446 | |
2018-01-03 12:39 | hudsonbot | Checkin | |
2018-01-03 12:39 | hudsonbot | Note Added: 0101447 | |
Notes |
|
(0100639)
|
hgbot
|
2017-11-21 09:58
|
|
Repository: erp/devel/pi
Changeset: 4399ee25ce29f9bfae0280dfedda54e875abeee9
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Mon Nov 20 14:48:56 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/4399ee25ce29f9bfae0280dfedda54e875abeee9 [^]
fixes 37329: implemented a more generic Utility.arrayListToString
Implemented a more generic alternative to Utility.arrayListToString:
* Receives as parameter a generic Collections instead of limiting it to
ArrayList instances
* Implemented it in a more performant manner based on OpenJDK
AbstractCollection.toString
---
M src/org/openbravo/erpCommon/utility/Utility.java
---
|
|
|
|
Changesets related to this issue that were not automatically detected:
changeset: 33027:f2e2f4826906
user: Asier Lostalé <asier.lostale@openbravo.com>
date: Mon Nov 20 14:49:56 2017 +0100
summary: related to 37329: implemented a more generic Utility.arrayListToString
changeset: 33028:d7b72a4dec05
user: Asier Lostalé <asier.lostale@openbravo.com>
date: Mon Nov 20 14:58:19 2017 +0100
summary: related to 37329: use new method where old was used |
|
|
(0100642)
|
hgbot
|
2017-11-21 10:12
|
|
|
|
(0100643)
|
hgbot
|
2017-11-21 10:14
|
|
|
|
|
Code reviewed + tested OK. |
|
|
(0100911)
|
hgbot
|
2017-12-04 10:20
|
|
Repository: erp/devel/pi
Changeset: 1930cd6e575642a6e47ca9d8e5552615cae41821
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Mon Dec 04 10:11:14 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/1930cd6e575642a6e47ca9d8e5552615cae41821 [^]
fixes 37329: implemented a more generic Utility.arrayListToString
Moved new commaSeparated API from generic Utility to a more specific new class
StringCollectionUtils. This also removes Utility class dependencies allowing to
use new API from central components with limited compilation dependencies.
---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/ADAlertDatasourceService.java
M modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DataSourceServlet.java
M src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java
M src/org/openbravo/erpCommon/ad_process/UpdateActuals.java
M src/org/openbravo/erpCommon/businessUtility/Preferences.java
M src/org/openbravo/erpCommon/obps/ActivationKey.java
M src/org/openbravo/erpCommon/utility/Utility.java
A src/org/openbravo/erpCommon/utility/StringCollectionUtils.java
---
|
|
|
(0100912)
|
hgbot
|
2017-12-04 10:21
|
|
Repository: erp/devel/api-checks
Changeset: d0c3d7dc51cfbc68dcc23720833c3718f43c2697
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Mon Dec 04 10:20:24 2017 +0100
URL: http://code.openbravo.com/erp/devel/api-checks/rev/d0c3d7dc51cfbc68dcc23720833c3718f43c2697 [^]
related to issue 37329: API change false positive
Utiliy.commaSeparated was already included in Java API although it was not yet
published. This method has been now moved to another class, just accepting this
change as false positive.
---
M java/reference/java.japi.gz
---
|
|
|
|
|
|
(0101294)
|
hgbot
|
2017-12-29 14:38
|
|
Repository: erp/devel/api-checks
Changeset: 275dc8d2a7ed41a9ed1527e297da07f704f6ccdc
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Mon Dec 04 10:20:24 2017 +0100
URL: http://code.openbravo.com/erp/devel/api-checks/rev/275dc8d2a7ed41a9ed1527e297da07f704f6ccdc [^]
related to issue 37329: API change false positive
Utiliy.commaSeparated was already included in Java API although it was not yet
published. This method has been now moved to another class, just accepting this
change as false positive.
---
M java/reference/java.japi.gz
---
|
|
|
|
|
|
|
|