Skip to content
Commits on Source (4)
jboss-logging (3.4.1-1) unstable; urgency=medium
* New upstream version 3.4.1.
-- Markus Koschany <apo@debian.org> Mon, 12 Aug 2019 00:45:34 +0200
jboss-logging (3.4.0-1) unstable; urgency=medium
* New upstream version 3.4.0.
......
#!/usr/bin/make -f
%:
dh $@ --buildsystem=maven
dh $@
......@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<version>3.4.0.Final</version>
<version>3.4.1.Final</version>
<packaging>jar</packaging>
<name>JBoss Logging 3</name>
<url>http://www.jboss.org</url>
......
......@@ -2526,8 +2526,16 @@ public abstract class Logger implements Serializable, BasicLogger {
* @return the typed logger
*/
public static <T> T getMessageLogger(final Class<T> type, final String category, final Locale locale) {
if (System.getSecurityManager() == null)
return doGetMessageLogger(type, category, locale);
return doPrivileged(new PrivilegedAction<T>() {
public T run() {
return doGetMessageLogger(type, category, locale);
}
});
}
private static <T> T doGetMessageLogger(final Class<T> type, final String category, final Locale locale) {
String language = locale.getLanguage();
String country = locale.getCountry();
String variant = locale.getVariant();
......@@ -2571,8 +2579,6 @@ public abstract class Logger implements Serializable, BasicLogger {
throw new IllegalArgumentException("Logger implementation " + loggerClass + " could not be instantiated", e.getCause());
}
}
});
}
private static String join(String interfaceName, String a, String b, String c, String d) {
final StringBuilder build = new StringBuilder();
......
......@@ -18,8 +18,6 @@
package org.jboss.logging;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Iterator;
import java.util.ServiceConfigurationError;
import java.util.ServiceLoader;
......@@ -41,11 +39,7 @@ final class LoggerProviders {
final ClassLoader cl = LoggerProviders.class.getClassLoader();
try {
// Check the system property
final String loggerProvider = AccessController.doPrivileged(new PrivilegedAction<String>() {
public String run() {
return System.getProperty(LOGGING_PROVIDER_KEY);
}
});
final String loggerProvider = SecurityActions.getSystemProperty(LOGGING_PROVIDER_KEY);
if (loggerProvider != null) {
if ("jboss".equalsIgnoreCase(loggerProvider)) {
return tryJBossLogManager(cl, "system property");
......
......@@ -18,8 +18,6 @@
package org.jboss.logging;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Locale;
/**
......@@ -51,12 +49,7 @@ class LoggingLocale {
}
private static Locale getDefaultLocale() {
final String bcp47Tag = AccessController.doPrivileged(new PrivilegedAction<String>() {
@Override
public String run() {
return System.getProperty("org.jboss.logging.locale", "");
}
});
final String bcp47Tag = SecurityActions.getSystemProperty("org.jboss.logging.locale", "");
if (bcp47Tag.trim().isEmpty()) {
return Locale.getDefault();
}
......
......@@ -55,8 +55,17 @@ public final class Messages {
* @return the bundle
*/
public static <T> T getBundle(final Class<T> type, final Locale locale) {
if (System.getSecurityManager() == null) {
return doGetBundle(type, locale);
}
return doPrivileged(new PrivilegedAction<T>() {
public T run() {
return doGetBundle(type, locale);
}
});
}
private static <T> T doGetBundle(final Class<T> type, final Locale locale) {
String language = locale.getLanguage();
String country = locale.getCountry();
String variant = locale.getVariant();
......@@ -94,8 +103,6 @@ public final class Messages {
throw new IllegalArgumentException("Bundle implementation " + bundleClass + " could not be instantiated", e);
}
}
});
}
private static String join(String interfaceName, String a, String b, String c, String d) {
final StringBuilder build = new StringBuilder();
......
/*
* JBoss, Home of Professional Open Source.
*
* Copyright 2019 Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.logging;
import java.security.AccessController;
import java.security.PrivilegedAction;
/**
* @author <a href="mailto:jperkins@redhat.com">James R. Perkins</a>
*/
@SuppressWarnings("SameParameterValue")
class SecurityActions {
static String getSystemProperty(final String key) {
if (System.getSecurityManager() == null) {
return System.getProperty(key);
}
return AccessController.doPrivileged(new PrivilegedAction<String>() {
@Override
public String run() {
return System.getProperty(key);
}
});
}
static String getSystemProperty(final String key, final String dft) {
if (System.getSecurityManager() == null) {
return System.getProperty(key, dft);
}
return AccessController.doPrivileged(new PrivilegedAction<String>() {
@Override
public String run() {
return System.getProperty(key, dft);
}
});
}
}
......@@ -30,9 +30,8 @@ final class Slf4jLoggerProvider extends AbstractLoggerProvider implements Logger
public Logger getLogger(final String name) {
org.slf4j.Logger l = LoggerFactory.getLogger(name);
try {
if (l instanceof LocationAwareLogger) {
return new Slf4jLocationAwareLogger(name, (LocationAwareLogger) l);
} catch (Throwable ignored) {
}
return new Slf4jLogger(name, l);
}
......