Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0047093Openbravo ERPA. Platformpublic2021-06-11 19:322021-06-14 07:19
shuehner 
platform 
normalminorhave not tried
closedfixed 
5
 
PR21Q3 
Core
No
0047093: Remove use of guava library in java code of backoffice
Done to prepare eventually removing guava library entirely

List of files referencing it
src-test/src/org/openbravo/test/security/AllowedOrganizationsTest.java
src-test/src/org/openbravo/test/security/CrossOrganizationReference.java
src/org/openbravo/erpCommon/businessUtility/InitialSetupUtility.java
grep -Ir 'com\.google\.common'
No tags attached.
blocks design defect 0047092 closed meriem_azaf Remove guava library as it is no longer needed as a dependency of weld 
Issue History
2021-06-11 19:32shuehnerNew Issue
2021-06-11 19:32shuehnerAssigned To => platform
2021-06-11 19:32shuehnerModules => Core
2021-06-11 19:32shuehnerTriggers an Emergency Pack => No
2021-06-11 19:38hgbotNote Added: 0129419
2021-06-11 19:39shuehnerRelationship addedblocks 0047092
2021-06-14 07:19hgbotResolutionopen => fixed
2021-06-14 07:19hgbotStatusnew => closed
2021-06-14 07:19hgbotFixed in Version => PR21Q3
2021-06-14 07:19hgbotNote Added: 0129436
2021-06-14 07:19hgbotNote Added: 0129437

Notes
(0129419)
hgbot   
2021-06-11 19:38   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/393 [^]
(0129436)
hgbot   
2021-06-14 07:19   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 70f08e94b3f8fa81238d857aca4d242c2dcd0190
Author: Stefan Huehner <stefan.huehner@openbravo.com>
Date: 2021-06-14T07:17:11+02:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/70f08e94b3f8fa81238d857aca4d242c2dcd0190 [^]

fixes ISSUE-47093: Remove guava usage from java code

- InitialSetupUtility
  - Stop using Charsets.UTF_8 constants from guava library. Instead use
standard java StandardCharsets class
  - Simplify reading file by using Files.ReadString(Path,Charset)
    directly avoid the intermediate byte[]
- CrossOrganizationReference
  - Use standard Collections.reverse method instead of guava
    Lists.reverse
    Note that JDK function modify the argument in place instead of
returning a 'reversed' view. However with that usage here (cleanup after
unit-tests & .clear()-ing the list just afterwards no need to clone the
list.
- AllowedOrganizationTest
  - Change away from guava ImmutableMap.builder() replace it by standard
    java
    - Map.Of(Key,Value,Key,Value, ...) for the simple case
    - Map.ofEntries for the slightly more complex case.

---
M src-test/src/org/openbravo/test/security/AllowedOrganizationsTest.java
M src-test/src/org/openbravo/test/security/CrossOrganizationReference.java
M src/org/openbravo/erpCommon/businessUtility/InitialSetupUtility.java
---
(0129437)
hgbot   
2021-06-14 07:19   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/393 [^]