diff --git a/src/main/java/org/openbase/jps/core/JPService.java b/src/main/java/org/openbase/jps/core/JPService.java index a0b0dce..fbd8006 100644 --- a/src/main/java/org/openbase/jps/core/JPService.java +++ b/src/main/java/org/openbase/jps/core/JPService.java @@ -59,10 +59,10 @@ public class JPService { private static String[] args = new String[0]; static { - initJPSDefaultProperties(); + registerJPSDefaultProperties(); } - private static void initJPSDefaultProperties() { + private static void registerJPSDefaultProperties() { registerProperty(JPHelp.class); registerProperty(JPVerbose.class); registerProperty(JPLogLevel.class); @@ -959,7 +959,7 @@ public static String newLineFormatter(String text, String newLineOperator, int m /** * Method prints the info message and blocks the system input until the user confirms the message. - * Otherwise the cancel message will be printed and System.exit is called with the given exit code. + * Otherwise, the cancel message will be printed and System.exit is called with the given exit code. * * @param infoMessage the message to inform the user about the situation to confirm. * @param cancelMessage the message which is printed in case the user rejects the action. @@ -1018,50 +1018,30 @@ public static String[] getArgs() { } /** - * + * Reset the entire property configuration. */ - public static void reset() { //todo: make reset non public in next major release + public static void reset() { registeredPropertyClasses.clear(); initializedProperties.clear(); loadedProperties.clear(); overwrittenDefaultValueMap.clear(); argumentsAnalyzed = false; - initJPSDefaultProperties(); + registerJPSDefaultProperties(); } public static boolean testMode() { - try { - return JPService.getProperty(JPTestMode.class).getValue(); - } catch (JPServiceException ex) { - printError("Could not detect TestMode!", ex); - } - return false; + return JPService.getValue(JPTestMode.class, false); } public static boolean verboseMode() { - try { - return JPService.getProperty(JPVerbose.class).getValue(); - } catch (JPServiceException ex) { - printError("Could not detect VerboseMode!", ex); - } - return false; + return JPService.getValue(JPVerbose.class, false); } public static boolean forceMode() { - try { - return JPService.getProperty(JPForce.class).getValue(); - } catch (JPServiceException ex) { - printError("Could not detect ForceMode!", ex); - } - return false; + return JPService.getValue(JPForce.class, false); } public static boolean debugMode() { - try { - return JPService.getProperty(JPDebugMode.class).getValue(); - } catch (JPServiceException ex) { - printError("Could not detect DebugMode!", ex); - } - return false; + return JPService.getValue(JPDebugMode.class, false); } } diff --git a/src/main/java/org/openbase/jps/tools/FileHandler.java b/src/main/java/org/openbase/jps/tools/FileHandler.java index 98b8968..ab353a7 100644 --- a/src/main/java/org/openbase/jps/tools/FileHandler.java +++ b/src/main/java/org/openbase/jps/tools/FileHandler.java @@ -178,6 +178,6 @@ public boolean create(File file) throws IOException { public interface FileCreator { - public abstract boolean create(File file) throws Exception; + boolean create(File file) throws Exception; } }