aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Ross2012-11-15 08:12:05 (EST)
committerThomas Watson2012-11-15 11:48:46 (EST)
commitaa71c24487baece4e5fe04af8e1fada1ebb672e5 (patch)
treec17813a2ee576a6e66c7d0adb1a00ee78ab027a2
parent62253d37bb8c8e142385f863c8af4c54409c9c55 (diff)
downloadrt.equinox.framework-aa71c24487baece4e5fe04af8e1fada1ebb672e5.zip
rt.equinox.framework-aa71c24487baece4e5fe04af8e1fada1ebb672e5.tar.gz
rt.equinox.framework-aa71c24487baece4e5fe04af8e1fada1ebb672e5.tar.bz2
Bug 394339 - NLS needs to use a privileged action when initializing the ignoreWarnings field.v20121115-164846
-rw-r--r--bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/util/NLS.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/util/NLS.java b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/util/NLS.java
index c7776d2..dbe8f0e 100644
--- a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/util/NLS.java
+++ b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/util/NLS.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -57,7 +57,11 @@ public abstract class NLS {
private static String[] nlSuffixes;
private static final String PROP_WARNINGS = "osgi.nls.warnings"; //$NON-NLS-1$
private static final String IGNORE = "ignore"; //$NON-NLS-1$
- private static final boolean ignoreWarnings = IGNORE.equals(FrameworkProperties.getProperty(PROP_WARNINGS));
+ private static final boolean ignoreWarnings = AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
+ public Boolean run() {
+ return IGNORE.equals(FrameworkProperties.getProperty(PROP_WARNINGS));
+ }
+ });
/*
* NOTE do not change the name of this field; it is set by the Framework using reflection