Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036435Openbravo ERPZ. Otherspublic2017-07-06 13:282017-09-21 16:49
alostale 
markmm82 
normalminorhave not tried
closedfixed 
5
 
3.0PR17Q4 
aferraz
Core
No
0036435: unlikely argument type warnings
Compiling with ecj >= 3.13 (ie. using Eclipse Oxygen) some "unlikely argument" warnings can be found in code.
1. Open openbravo with eclipse oxygen
2. Import standard openbravo preferences
3. Compile
  -> check warns:
# Eclipse Compiler for Java(TM) v20170516-1929, 3.13.0, Copyright IBM Corp 2000, 2015. All rights reserved.
----------
2. INFO in /home/alostale/ws/projects/license/openbravo/src/org/openbravo/common/datasource/StockReservationPickAndEditDataSource.java (at line 1682)
    if (orderline != null && !"".equals(orderline)) {
                                        ^^^^^^^^^
Unlikely argument type for equals(): OrderLine seems to be unrelated to String
----------
----------
3. WARNING in /home/alostale/ws/projects/license/openbravo/src/org/openbravo/costing/LCCostMatchFromInvoiceHandler.java (at line 200)
    localIl.getLandedCostCostList().remove(matchToRemove);
                                           ^^^^^^^^^^^^^
Unlikely argument type LCMatched for remove(Object) on a Collection<LandedCostCost>
----------
----------
4. INFO in /home/alostale/ws/projects/license/openbravo/src/org/openbravo/erpCommon/ad_forms/ProductInfo.java (at line 327)
    if (_qty == null || "".equals(_qty)) {
                                  ^^^^
Unlikely argument type for equals(): BigDecimal seems to be unrelated to String
----------
----------
5. INFO in /home/alostale/ws/projects/license/openbravo/src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java (at line 973)
    .equals(getAccountBPartner(bpartnerId, as, isReceipt, true, conn))) {
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Unlikely argument type for equals(): Account seems to be unrelated to String
----------
----------
6. INFO in /home/alostale/ws/projects/license/openbravo/src/org/openbravo/erpCommon/ad_callouts/SL_InOut_BPartner.java (at line 244)
    if ((!bpartner.equals(""))
                          ^^
Unlikely argument type for equals(): String seems to be unrelated to BusinessPartner
----------
----------
7. INFO in /home/alostale/ws/projects/license/openbravo/src/org/openbravo/erpCommon/ad_process/ConvertQuotationIntoOrder.java (at line 284)
    if (!"".equals(bdPriceList) && bdPriceList != null
                   ^^^^^^^^^^^
Unlikely argument type for equals(): BigDecimal seems to be unrelated to String
----------
8. INFO in /home/alostale/ws/projects/license/openbravo/src/org/openbravo/erpCommon/ad_process/ConvertQuotationIntoOrder.java (at line 297)
    if (!"".equals(bdPriceStd) && bdPriceStd != null
                   ^^^^^^^^^^
Unlikely argument type for equals(): BigDecimal seems to be unrelated to String
----------
----------
10. INFO in /home/alostale/ws/projects/license/openbravo/src-test/src/org/openbravo/test/costing/TestCosting.java (at line 13180)
    .equals(DOLLAR_ID)))))
            ^^^^^^^^^
Unlikely argument type for equals(): String seems to be unrelated to Currency
----------
No tags attached.
related to defect 0036434 closed alostale Openbravo ERP unlikely argument type warnings 
related to defect 0036446 closed marvintm Retail Modules New warnings have appeared in new version of Eclipse 
blocks feature request 0031477 new shuehner Openbravo ERP Tracking issue to reduce the huge number of eclipse warnings in pi 
Issue History
2017-07-06 13:28alostaleNew Issue
2017-07-06 13:28alostaleAssigned To => Triage Finance
2017-07-06 13:28alostaleModules => Core
2017-07-06 13:28alostaleTriggers an Emergency Pack => No
2017-07-06 13:28alostaleIssue generated from0036434
2017-07-06 13:28alostaleRelationship addedrelated to 0036434
2017-07-06 13:31alostaleRelationship addedblocks 0031477
2017-07-06 13:42alostaleDescription Updatedbug_revision_view_page.php?rev_id=15471#r15471
2017-07-06 16:39vmromanosAssigned ToTriage Finance => collazoandy4
2017-07-10 10:48aferrazAssigned Tocollazoandy4 => markmm82
2017-07-10 15:39markmm82Statusnew => scheduled
2017-07-11 13:00hgbotCheckin
2017-07-11 13:00hgbotNote Added: 0098015
2017-07-11 13:00hgbotStatusscheduled => resolved
2017-07-11 13:00hgbotResolutionopen => fixed
2017-07-11 13:00hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/f47b0f799713fba544a3c31c31e3ea8cc7824a35 [^]
2017-07-11 13:00hgbotCheckin
2017-07-11 13:00hgbotNote Added: 0098016
2017-07-11 13:02aferrazReview Assigned To => aferraz
2017-07-11 13:02aferrazNote Added: 0098017
2017-07-11 13:02aferrazStatusresolved => closed
2017-07-11 13:02aferrazFixed in Version => 3.0PR17Q4
2017-07-12 09:31alostaleRelationship addedrelated to 0036446
2017-07-27 09:47hgbotCheckin
2017-07-27 09:47hgbotNote Added: 0098235
2017-07-27 09:48hgbotCheckin
2017-07-27 09:48hgbotNote Added: 0098236
2017-07-27 09:48hgbotCheckin
2017-07-27 09:48hgbotNote Added: 0098237
2017-07-27 09:49hgbotCheckin
2017-07-27 09:49hgbotNote Added: 0098238
2017-09-21 16:49hudsonbotCheckin
2017-09-21 16:49hudsonbotNote Added: 0099269
2017-09-21 16:49hudsonbotCheckin
2017-09-21 16:49hudsonbotNote Added: 0099270

Notes
(0098015)
hgbot   
2017-07-11 13:00   
Repository: erp/devel/pi
Changeset: f47b0f799713fba544a3c31c31e3ea8cc7824a35
Author: Mark <markmm82 <at> gmail.com>
Date: Mon Jul 10 12:15:53 2017 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/f47b0f799713fba544a3c31c31e3ea8cc7824a35 [^]

Fixes issue 36435: Unlikely argument type warnings

StockReservationPickAndEditDataSource.java
- Fixed comparison between Empty String and OrderLine object.

LCCostMatchFromInvoiceHandler.java
- Remove the matchToRemove object from localIl.getLandedCostMatchedList() instead
  of localIl.getLandedCostCostList() list.

SL_InOut_BPartner.java
- Replaced two nested IFs for only one that includes all conditions of both of them.
- Used StringUtils methods to avoid NPE.

DocFINReconciliation.java
- Used StringUtils methods to avoid NPE.
- Created two new variables to store accounts required for processing, and avoid
  calculate them twice.

ProductInfo.java
- Removed comparison with Empty String, because it is not needed.

ConvertQuotationIntoOrder.java
- Removed comparison with Empty String, because it is not needed.
- Use BigDecimal.compareTo to compare two BigDecimal objects.

---
M src/org/openbravo/common/datasource/StockReservationPickAndEditDataSource.java
M src/org/openbravo/costing/LCCostMatchFromInvoiceHandler.java
M src/org/openbravo/erpCommon/ad_callouts/SL_InOut_BPartner.java
M src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java
M src/org/openbravo/erpCommon/ad_forms/ProductInfo.java
M src/org/openbravo/erpCommon/ad_process/ConvertQuotationIntoOrder.java
---
(0098016)
hgbot   
2017-07-11 13:00   
Repository: erp/devel/pi
Changeset: a99ac166135ba40d38b3bb57e582107ccc8c7320
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Tue Jul 11 12:30:29 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/a99ac166135ba40d38b3bb57e582107ccc8c7320 [^]

Related to issue 36435: Fix warning also in TestCosting.java

---
M src-test/src/org/openbravo/test/costing/TestCosting.java
M src/org/openbravo/costing/LCCostMatchFromInvoiceHandler.java
---
(0098017)
aferraz   
2017-07-11 13:02   
Code review OK
(0098235)
hgbot   
2017-07-27 09:47   
Repository: erp/pmods/org.openbravo.sepa.iso20022.credittransfer.customertobank
Changeset: b15e9f025867996fc7ecf240139923afc862ca91
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Thu Jul 27 09:45:56 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.sepa.iso20022.credittransfer.customertobank/rev/b15e9f025867996fc7ecf240139923afc862ca91 [^]

Related to issue 36435: Unlikely argument type warnings

---
M src/org/openbravo/sepa/iso20022/credittransfer/customertobank/pain/x001/x001/x03/report/CreditTransfer.java
M src/org/openbravo/sepa/iso20022/credittransfer/customertobank/pain/x001/x001/x04/report/CreditTransfer.java
---
(0098236)
hgbot   
2017-07-27 09:48   
Repository: erp/pmods/org.openbravo.sepa.iso20022.coredirectdebit.customertobank
Changeset: 7b7d0998207fea11e11ecb1d8a384c7aa7d1739c
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Thu Jul 27 09:44:49 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.sepa.iso20022.coredirectdebit.customertobank/rev/7b7d0998207fea11e11ecb1d8a384c7aa7d1739c [^]

Related to issue 36435: Unlikely argument type warnings

---
M src/org/openbravo/sepa/iso20022/coredirectdebit/customertobank/pain/x008/x001/x02/report/CoreDirectDebit.java
M src/org/openbravo/sepa/iso20022/coredirectdebit/customertobank/pain/x008/x001/x03/report/CoreDirectDebit.java
---
(0098237)
hgbot   
2017-07-27 09:48   
Repository: erp/mods/org.openbravo.module.taxreportlauncher
Changeset: ff83388c7aff45ef979491785aa7b9514db8b0a9
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Thu Jul 27 09:41:23 2017 +0200
URL: http://code.openbravo.com/erp/mods/org.openbravo.module.taxreportlauncher/rev/ff83388c7aff45ef979491785aa7b9514db8b0a9 [^]

Related to issue 36435: Unlikely argument type warnings

---
M src/org/openbravo/module/taxreportlauncher/Utility/OBTL_Utility.java
---
(0098238)
hgbot   
2017-07-27 09:49   
Repository: erp/mods/org.openbravo.report.improved.balancesheet
Changeset: 30974158c773a5cf2976dffe852cf6631119d68a
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Thu Jul 27 09:37:54 2017 +0200
URL: http://code.openbravo.com/erp/mods/org.openbravo.report.improved.balancesheet/rev/30974158c773a5cf2976dffe852cf6631119d68a [^]

Related to issue 36435: Unlikely argument type warnings

---
M src/org/openbravo/report/improved/balancesheet/ad_reports/GeneralAccountingReports.java
---
(0099269)
hudsonbot   
2017-09-21 16:49   
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/9750b78d3e5c [^]
Maturity status: Test
(0099270)
hudsonbot   
2017-09-21 16:49   
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/9750b78d3e5c [^]
Maturity status: Test