Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0047962Openbravo ERPA. Platformpublic2021-11-03 13:122021-11-11 07:04
shuehner 
alostale 
normalminorhave not tried
closedfixed 
5
 
PR22Q1 
Core
No
0047962: OBSchedulerInitializerListener should not use System.out.println for logging
This file is using a single System.out.println instead of proper log4j usage.

https://gitlab.com/openbravo/product/openbravo/-/blob/master/src/org/openbravo/base/OBSchedulerInitializerListener.java#L157 [^]

That was added initially in this commit:
https://gitlab.com/openbravo/product/openbravo/-/commit/893bc475e92232ed0e71aee050848dab458d62e8#320d411275551c3035b76c3ab909e6c86a0b53e7_116_139 [^]

In which the connection could have been null.

However current code is getting the connection from the DAL session so that whole "if (connection != null)" maybe obsolete
https://gitlab.com/openbravo/product/openbravo/-/commit/893bc475e92232ed0e71aee050848dab458d62e8#320d411275551c3035b76c3ab909e6c86a0b53e7_116_139 [^]
Either
a.) Remove the if/else block having the System.out.println in connection cannot be null
b.) if that is not possible change it to proper log4j error usage
No tags attached.
blocks design defect 0036162 acknowledged Triage Platform Base clean up openbravo.log 
Issue History
2021-11-03 13:12shuehnerNew Issue
2021-11-03 13:12shuehnerAssigned To => platform
2021-11-03 13:12shuehnerModules => Core
2021-11-03 13:12shuehnerTriggers an Emergency Pack => No
2021-11-03 13:12shuehnerRelationship addedblocks 0036162
2021-11-03 13:17shuehnerIssue cloned0047963
2021-11-04 12:59hgbotNote Added: 0132844
2021-11-11 07:04hgbotNote Added: 0132949
2021-11-11 07:04hgbotResolutionopen => fixed
2021-11-11 07:04hgbotStatusnew => closed
2021-11-11 07:04hgbotNote Added: 0132950
2021-11-11 07:04hgbotFixed in Version => PR22Q1
2021-11-11 07:04hgbotNote Added: 0132951
2021-11-11 07:04alostaleAssigned Toplatform => alostale

Notes
(0132844)
hgbot   
2021-11-04 12:59   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/450 [^]
(0132949)
hgbot   
2021-11-11 07:04   
Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 2167bee67004c45fa630ee97917935af5d187f67
Author: Asier Lostalé <asier.lostale@openbravo.com>
Date: 2021-11-11T06:02:26+00:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/2167bee67004c45fa630ee97917935af5d187f67 [^]

related to ISSUE-47962: OBSchedulerInitializerListener clean up

Includes:
 * Applies Java formatting
 * Removes useless logs
 * Uses parameterized logs instead of String concatenation

---
M src/org/openbravo/base/OBSchedulerInitializerListener.java
---
(0132950)
hgbot   
2021-11-11 07:04   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/450 [^]
(0132951)
hgbot   
2021-11-11 07:04   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: b7993042d97e117cff2f9eacda63f1e88f023fa5
Author: Asier Lostalé <asier.lostale@openbravo.com>
Date: 2021-11-11T06:02:26+00:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/b7993042d97e117cff2f9eacda63f1e88f023fa5 [^]

fixed ISSUE-47962: OBSchedulerInitializerListener logs directly to stdout

This was log done in specific case of trying to get a connection being
it null. There is no need to handle this specific case which, in case it
can even occur, would be handled by the enclosing try/catch block.

---
M src/org/openbravo/base/OBSchedulerInitializerListener.java
---