summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2006-05-11 12:39:18 +0000
committerMark Wielaard <mark@klomp.org>2006-05-11 12:39:18 +0000
commit4d18649bfaaff2ed6c2a4deec58d2700baf1495f (patch)
treefdd92fd1b5b55afc728bd7542fc46b3d3e86965a
parenta9dc38185eb7b4eac9ef5f4544153e92c1623ffb (diff)
downloadclasspath-4d18649bfaaff2ed6c2a4deec58d2700baf1495f.tar.gz
* java/util/logging/Logger.java (global): Initialize inside static
PrivilegedAction.
-rw-r--r--ChangeLog5
-rw-r--r--java/util/logging/Logger.java17
2 files changed, 21 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ed8a697d9..0a214d554 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2006-05-11 Mark Wielaard <mark@klomp.org>
+ * java/util/logging/Logger.java (global): Initialize inside static
+ PrivilegedAction.
+
+2006-05-11 Mark Wielaard <mark@klomp.org>
+
* java/awt/geom/GeneralPath.java (WIND_EVEN_ODD, WIND_NON_ZERO):
Fully qualify PathIterator constants
diff --git a/java/util/logging/Logger.java b/java/util/logging/Logger.java
index 567020ef7..29f19e440 100644
--- a/java/util/logging/Logger.java
+++ b/java/util/logging/Logger.java
@@ -41,6 +41,8 @@ package java.util.logging;
import java.util.List;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
/**
* A Logger is used for logging information about events. Usually, there
@@ -76,7 +78,20 @@ public class Logger
* products are supposed to create and use their own Loggers, so
* they can be controlled individually.
*/
- public static final Logger global = getLogger("global");
+ public static final Logger global;
+
+ static
+ {
+ // Our class might be initialized from an unprivileged context
+ global = (Logger) AccessController.doPrivileged
+ (new PrivilegedAction()
+ {
+ public Object run()
+ {
+ return getLogger("global");
+ }
+ });
+ }
/**