diff --git a/native/src/main/java/io/ballerina/stdlib/task/actions/TaskActions.java b/native/src/main/java/io/ballerina/stdlib/task/actions/TaskActions.java index d7c3b17d..12a80605 100644 --- a/native/src/main/java/io/ballerina/stdlib/task/actions/TaskActions.java +++ b/native/src/main/java/io/ballerina/stdlib/task/actions/TaskActions.java @@ -46,9 +46,9 @@ */ public class TaskActions { - private static int bound = 1000000; - private static String value = "1000"; - private static PrintStream console = System.err; + private static final int bound = 1000000; + private static final String value = "1000"; + private static final PrintStream console = System.err; static { Utils.disableQuartzLogs(); diff --git a/native/src/main/java/io/ballerina/stdlib/task/utils/TaskConstants.java b/native/src/main/java/io/ballerina/stdlib/task/utils/TaskConstants.java index fb11cc37..d1489657 100644 --- a/native/src/main/java/io/ballerina/stdlib/task/utils/TaskConstants.java +++ b/native/src/main/java/io/ballerina/stdlib/task/utils/TaskConstants.java @@ -48,7 +48,6 @@ public class TaskConstants { public static final String LOG_AND_CONTINUE = "LOG_AND_CONTINUE"; public static final String TERMINATE = "TERMINATE"; public static final String WAIT = "WAIT"; - public static final String QUARTZ_CLASS_NAME = "org.quartz"; public static final String QUARTZ = "quartz"; public static final BString ERR_POLICY = StringUtils.fromString("errorPolicy"); diff --git a/native/src/main/java/io/ballerina/stdlib/task/utils/Utils.java b/native/src/main/java/io/ballerina/stdlib/task/utils/Utils.java index ec655d50..cde732b8 100644 --- a/native/src/main/java/io/ballerina/stdlib/task/utils/Utils.java +++ b/native/src/main/java/io/ballerina/stdlib/task/utils/Utils.java @@ -54,7 +54,7 @@ */ public class Utils { - private static DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS"); + private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS"); public static BError createTaskError(String message) { return ErrorCreator.createDistinctError(TaskConstants.ERROR, ModuleUtils.getModule(), @@ -149,9 +149,7 @@ public static void printMessage(String msg, PrintStream console) { } public static void disableQuartzLogs() { - Logger quartzLogger = Logger.getLogger(TaskConstants.QUARTZ_CLASS_NAME); - quartzLogger.setLevel(Level.OFF); - LogManager.getLogManager().addLogger(quartzLogger); + Logger.getLogger("").setLevel(Level.OFF); LogManager logManager = LogManager.getLogManager(); Enumeration names = logManager.getLoggerNames(); for (String name : Collections.list(names)) {