diff --git a/src/main/java/org/t246osslab/easybuggy/core/utils/ApplicationUtils.java b/src/main/java/org/t246osslab/easybuggy/core/utils/ApplicationUtils.java index b19624bd..03adf923 100644 --- a/src/main/java/org/t246osslab/easybuggy/core/utils/ApplicationUtils.java +++ b/src/main/java/org/t246osslab/easybuggy/core/utils/ApplicationUtils.java @@ -171,7 +171,7 @@ public static String getAdminAddress() { private static String getProperty(ResourceBundle bundle, String key, String defaultValue) { try { - return bundle.getString(key); + return getProperty(bundle, key); } catch (Exception e) { log.error("Exception occurs: ", e); } @@ -180,19 +180,23 @@ private static String getProperty(ResourceBundle bundle, String key, String defa private static int getProperty(ResourceBundle bundle, String key, int defaultValue) { try { - return Integer.parseInt(bundle.getString(key)); + return Integer.parseInt(getProperty(bundle, key)); } catch (Exception e) { log.error("Exception occurs: ", e); } return defaultValue; } - + private static long getProperty(ResourceBundle bundle, String key, long defaultValue) { try { - return Long.parseLong(bundle.getString(key)); + return Long.parseLong(getProperty(bundle, key)); } catch (Exception e) { log.error("Exception occurs: ", e); } return defaultValue; } + + private static String getProperty(ResourceBundle bundle, String key) { + return System.getProperty(key) != null ? System.getProperty(key) : bundle.getString(key); + } }