Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0044022Openbravo ERPA. Platformpublic2020-05-11 11:282020-05-29 08:44
adrianromero 
alostale 
lowminoralways
closedfixed 
5
 
PR20Q3 
caristu
Core
No
0044022: Not needed cast in BuildValidation java class
Build validations must implement the following method:

public List<String> execute() {...

But if the object returned is not an ArrayList, the execution fails. The reason is that there is a cast from List to ArrayList here: https://code.openbravo.com/erp/devel/pi/file/tip/src-core/src/org/openbravo/buildvalidation/BuildValidation.java#l51 [^]

This cast is not needed.
Create an execute a validation with the following implementation.

public List<String> execute() {
  return Arrays.asList("This is an error message");
}
Just remove the cast
No tags attached.
Issue History
2020-05-11 11:28adrianromeroNew Issue
2020-05-11 11:28adrianromeroAssigned To => platform
2020-05-11 11:28adrianromeroModules => Core
2020-05-11 11:28adrianromeroTriggers an Emergency Pack => No
2020-05-15 07:32alostaleNote Added: 0119900
2020-05-15 07:32alostaleAssigned Toplatform => alostale
2020-05-15 07:32alostaleStatusnew => acknowledged
2020-05-19 10:00alostaleReview Assigned To => caristu
2020-05-19 13:26hgbotCheckin
2020-05-19 13:26hgbotNote Added: 0120032
2020-05-19 13:26hgbotStatusacknowledged => resolved
2020-05-19 13:26hgbotResolutionopen => fixed
2020-05-19 13:26hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/45513b1727ec2958a601af5e6f356fa210504bce [^]
2020-05-29 08:44caristuNote Added: 0120442
2020-05-29 08:44caristuStatusresolved => closed
2020-05-29 08:44caristuFixed in Version => 3.0PR20Q3

Notes
(0119900)
alostale   
2020-05-15 07:32   
MR: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/72 [^]
(0120032)
hgbot   
2020-05-19 13:26   
Repository: erp/devel/pi
Changeset: 45513b1727ec2958a601af5e6f356fa210504bce
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri May 15 07:24:19 2020 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/45513b1727ec2958a601af5e6f356fa210504bce [^]

fixed BUG-44022: Not needed cast in BuildValidation java class

The casting of the result of List<String> getErrors() method to
ArrayList was too restricitive and innecessary, causing runtime errors
in case the method returned any other List, which is allowed.

This casting has been removed.

---
M src-core/src/org/openbravo/buildvalidation/BuildValidation.java
---
(0120442)
caristu   
2020-05-29 08:44   
Reviewed