X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=osgi%2Fruntime%2Forg.argeo.osgi.boot%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fosgi%2Fboot%2FOsgiBootUtils.java;h=acc0302e62b2178690052f192946edf36f277da5;hb=3f6778125ace0c2cf816a8cf532ef8210f24394e;hp=a9067a213c04e912985fb139651db012c4b3ff3b;hpb=9047fe4c52b416bf5168838565ab2ded119a80b7;p=lgpl%2Fargeo-commons.git diff --git a/osgi/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/osgi/boot/OsgiBootUtils.java b/osgi/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/osgi/boot/OsgiBootUtils.java index a9067a213..acc0302e6 100644 --- a/osgi/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/osgi/boot/OsgiBootUtils.java +++ b/osgi/runtime/org.argeo.osgi.boot/src/main/java/org/argeo/osgi/boot/OsgiBootUtils.java @@ -16,6 +16,7 @@ package org.argeo.osgi.boot; +/** Utilities, mostly related to logging. */ public class OsgiBootUtils { public static void info(Object obj) { @@ -23,7 +24,7 @@ public class OsgiBootUtils { } public static void debug(Object obj) { - System.out.println("# OSGiBOOT DBG # " + obj); + System.out.println("# OSGiBOOT DBG # " + obj); } public static void warn(Object obj) { @@ -35,14 +36,18 @@ public class OsgiBootUtils { // System.err.println("# WARN " + obj); } - //FIXE: returns null when defaultValue is "" + /** + * Gets a property value + * + * @return null when defaultValue is "" + */ public static String getProperty(String name, String defaultValue) { final String value; if (defaultValue != null) value = System.getProperty(name, defaultValue); else value = System.getProperty(name); - + if (value == null || value.equals("")) return null; else @@ -53,36 +58,4 @@ public class OsgiBootUtils { return getProperty(name, null); } - public static String getPropertyCompat(String name, String oldName) { - return getPropertyCompat(name, oldName, null); - } - - public static String getPropertyCompat(String name, String oldName, - String defaultValue) { - String res = null; - - if (defaultValue != null) { - res = getProperty(name, defaultValue); - if (res.equals(defaultValue)) { - res = getProperty(oldName, defaultValue); - if (!res.equals(defaultValue)) - warnDeprecated(name, oldName); - } - } else { - res = getProperty(name, null); - if (res == null) { - res = getProperty(oldName, null); - if (res != null) - warnDeprecated(name, oldName); - } - } - return res; - } - - public static void warnDeprecated(String name, String oldName) { - warn("Property '" + oldName - + "' is deprecated and will be removed soon, use '" + name - + "' instead."); - } - }