Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0040575Openbravo ERP02. Master data managementpublic2019-04-10 11:482019-06-28 12:44
shuehner 
shuehner 
normalminorhave not tried
closedfixed 
5
 
3.0PR19Q33.0PR19Q3 
Sandrahuguet
Core
No
0040575: SL_BPartnerLocation should be cleaned up to not run .toString() on a String variable
Probably effect of copy'n'paste without good reason:
        String hql = "" + //
            "select count(distinct c.id) " + //
            "from BusinessPartnerLocation bpl " + //
            "inner join bpl.locationAddress as ad " + //
            "inner join ad.country as c " + //
            "where bpl.businessPartner.id = :bPartnerId " + //
            "and bpl.taxLocation = true " + //
            "and c.id <> :countryId "; //
        Query<Long> query = OBDal.getInstance()
            .getSession()
            .createQuery(hql.toString(), Long.class);

That extra toString is just useless. Probably confusing hql variable to be StringBuffer/StringBuilder.

All toString for 'hql' variable in that file (several) should be removed.
-
No tags attached.
Issue History
2019-04-10 11:48shuehnerNew Issue
2019-04-10 11:48shuehnerAssigned To => Triage Finance
2019-04-10 11:48shuehnerModules => Core
2019-04-10 11:48shuehnerTriggers an Emergency Pack => No
2019-05-13 12:38shuehnerTarget Version => 3.0PR19Q3
2019-06-25 10:14shuehnerAssigned ToTriage Finance => shuehner
2019-06-27 17:52shuehnerSummarySL_BParnterLocation should be cleaned up to not run .toString() on a String variable => SL_BPartnerLocation should be cleaned up to not run .toString() on a String variable
2019-06-27 17:58hgbotCheckin
2019-06-27 17:58hgbotNote Added: 0113072
2019-06-27 17:58hgbotStatusnew => resolved
2019-06-27 17:58hgbotResolutionopen => fixed
2019-06-27 17:58hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/3610767cf5cefd4162e9da8407a846d93c47f0a6 [^]
2019-06-28 11:17SandrahuguetReview Assigned To => Sandrahuguet
2019-06-28 12:44SandrahuguetNote Added: 0113104
2019-06-28 12:44SandrahuguetStatusresolved => closed
2019-06-28 12:44SandrahuguetFixed in Version => 3.0PR19Q3

Notes
(0113072)
hgbot   
2019-06-27 17:58   
Repository: erp/devel/pi
Changeset: 3610767cf5cefd4162e9da8407a846d93c47f0a6
Author: Stefan Hühner <stefan.huehner <at> openbravo.com>
Date: Thu Jun 27 17:54:04 2019 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/3610767cf5cefd4162e9da8407a846d93c47f0a6 [^]

Fixed 40575. Remove useless use of <String>.toString

Probably confusion with StringBuilder/String when writing that code.

---
M src/org/openbravo/erpCommon/ad_callouts/SL_BPartnerLocation.java
---
(0113104)
Sandrahuguet   
2019-06-28 12:44   
code review + testing ok