--- old/jdk/src/java.logging/share/classes/java/util/logging/Logger.java 2015-10-09 21:41:54.000000000 +0200 +++ new/jdk/src/java.logging/share/classes/java/util/logging/Logger.java 2015-10-09 21:41:54.000000000 +0200 @@ -447,8 +447,7 @@ private static Logger demandLogger(String name, String resourceBundleName, Class caller) { LogManager manager = LogManager.getLogManager(); - SecurityManager sm = System.getSecurityManager(); - if (sm != null && !SystemLoggerHelper.disableCallerCheck) { + if (!SystemLoggerHelper.disableCallerCheck) { if (caller.getClassLoader() == null) { return manager.demandSystemLogger(name, resourceBundleName, caller); } @@ -1285,6 +1284,36 @@ } /** + * Log a message, specifying source class, method, and resource bundle, + * with an optional list of message parameters. + *

+ * If the logger is currently enabled for the given message + * level then a corresponding LogRecord is created and forwarded + * to all the registered output Handler objects. + *

+ * The {@code msg} string is localized using the given resource bundle. + * If the resource bundle is {@code null}, then the {@code msg} string is not + * localized. + *

+ * @param level One of the message level identifiers, e.g., SEVERE + * @param bundle Resource bundle to localize {@code msg}, + * can be {@code null}. + * @param msg The string message (or a key in the message catalog) + * @param params Parameters to the message (optional, may be none). + * @since 1.9 + */ + public void logrb(Level level, ResourceBundle bundle, String msg, Object... params) { + if (!isLoggable(level)) { + return; + } + LogRecord lr = new LogRecord(level, msg); + if (params != null && params.length != 0) { + lr.setParameters(params); + } + doLog(lr, bundle); + } + + /** * Log a message, specifying source class, method, and resource bundle name, * with associated Throwable information. *

@@ -1363,6 +1392,40 @@ doLog(lr, bundle); } + /** + * Log a message, specifying source class, method, and resource bundle, + * with associated Throwable information. + *

+ * If the logger is currently enabled for the given message + * level then the given arguments are stored in a LogRecord + * which is forwarded to all registered output handlers. + *

+ * The {@code msg} string is localized using the given resource bundle. + * If the resource bundle is {@code null}, then the {@code msg} string is not + * localized. + *

+ * Note that the thrown argument is stored in the LogRecord thrown + * property, rather than the LogRecord parameters property. Thus it is + * processed specially by output Formatters and is not treated + * as a formatting parameter to the LogRecord message property. + *

+ * @param level One of the message level identifiers, e.g., SEVERE + * @param bundle Resource bundle to localize {@code msg}, + * can be {@code null} + * @param msg The string message (or a key in the message catalog) + * @param thrown Throwable associated with the log message. + * @since 1.9 + */ + public void logrb(Level level, ResourceBundle bundle, String msg, + Throwable thrown) { + if (!isLoggable(level)) { + return; + } + LogRecord lr = new LogRecord(level, msg); + lr.setThrown(thrown); + doLog(lr, bundle); + } + //====================================================================== // Start of convenience methods for logging method entries and returns. //======================================================================