gitgabrio commented on code in PR #3686:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/3686#discussion_r1796625430
##########
jbpm/jbpm-flow/src/main/java/org/jbpm/process/core/timer/BusinessCalendarImpl.java:
##########
@@ -103,26 +104,15 @@ public class BusinessCalendarImpl implements
BusinessCalendar {
public static final String WEEKEND_DAYS = "business.weekend.days";
public static final String TIMEZONE = "business.cal.timezone";
- private static final String DEFAULT_PROPERTIES_NAME =
"/jbpm.business.calendar.properties";
-
public BusinessCalendarImpl() {
- String propertiesLocation =
System.getProperty("jbpm.business.calendar.properties");
- if (propertiesLocation == null) {
- propertiesLocation = DEFAULT_PROPERTIES_NAME;
- }
businessCalendarConfiguration = new Properties();
-
- InputStream in =
this.getClass().getResourceAsStream(propertiesLocation);
- if (in != null) {
-
- try {
- businessCalendarConfiguration.load(in);
- } catch (IOException e) {
- logger.error("Error while loading properties for business
calendar", e);
-
- }
+ try (InputStream is =
Thread.currentThread().getContextClassLoader().getResourceAsStream("calendar.properties"))
{
+ businessCalendarConfiguration.load(is);
+ } catch (IOException e) {
+ logger.warn("Error while loading properties for business
calendar", e);
Review Comment:
Here the exception is logged as `WARN` and swallowed up, but then, inside
the `init` method, an exception is thrown.
So, the exception at this point should be logged as ERROR, since it leads to
failure in following code
Swallop up grave exceptions is not good practice, but in this case is
managed later on.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]