Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0044022
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminoralways2020-05-11 11:282020-05-29 08:44
ReporteradrianromeroView Statuspublic 
Assigned Toalostale 
PrioritylowResolutionfixedFixed in VersionPR20Q3
StatusclosedFix in branchFixed in SCM revision45513b1727ec
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tocaristu
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0044022: Not needed cast in BuildValidation java class

DescriptionBuild 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.
Steps To ReproduceCreate an execute a validation with the following implementation.

public List<String> execute() {
  return Arrays.asList("This is an error message");
}
Proposed SolutionJust remove the cast
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0119900)
alostale (manager)
2020-05-15 07:32

MR: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/72 [^]
(0120032)
hgbot (developer)
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 (developer)
2020-05-29 08:44

Reviewed

- Issue History
Date Modified Username Field Change
2020-05-11 11:28 adrianromero New Issue
2020-05-11 11:28 adrianromero Assigned To => platform
2020-05-11 11:28 adrianromero Modules => Core
2020-05-11 11:28 adrianromero Triggers an Emergency Pack => No
2020-05-15 07:32 alostale Note Added: 0119900
2020-05-15 07:32 alostale Assigned To platform => alostale
2020-05-15 07:32 alostale Status new => acknowledged
2020-05-19 10:00 alostale Review Assigned To => caristu
2020-05-19 13:26 hgbot Checkin
2020-05-19 13:26 hgbot Note Added: 0120032
2020-05-19 13:26 hgbot Status acknowledged => resolved
2020-05-19 13:26 hgbot Resolution open => fixed
2020-05-19 13:26 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/45513b1727ec2958a601af5e6f356fa210504bce [^]
2020-05-29 08:44 caristu Note Added: 0120442
2020-05-29 08:44 caristu Status resolved => closed
2020-05-29 08:44 caristu Fixed in Version => 3.0PR20Q3


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker