aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/util/ResourceBundle.java
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2002-12-05 00:49:30 +0000
committerTom Tromey <tromey@gcc.gnu.org>2002-12-05 00:49:30 +0000
commit76508852a0241db33b2512c0b460cdf06f7e0ce5 (patch)
tree55c5e4e7a3fc1386a525f3b48aea94a0f0b26bef /libjava/java/util/ResourceBundle.java
parent67f1b906114cdfc69b72e7135f34162ec6a67cc0 (diff)
downloadgcc-76508852a0241db33b2512c0b460cdf06f7e0ce5.zip
gcc-76508852a0241db33b2512c0b460cdf06f7e0ce5.tar.gz
gcc-76508852a0241db33b2512c0b460cdf06f7e0ce5.tar.bz2
Makefile.in: Rebuilt.
* Makefile.in: Rebuilt. * Makefile.am (nat_source_files): Added natVMSecurityManager, natResourceBundle. * java/util/ResourceBundle.java (Security): Removed. (getCallingClassLoader): Now native. * java/util/natResourceBundle.cc: New file. * java/lang/natVMSecurityManager.cc: New file. * java/lang/VMSecurityManager.java (getClassContext): Now native. From-SVN: r59840
Diffstat (limited to 'libjava/java/util/ResourceBundle.java')
-rw-r--r--libjava/java/util/ResourceBundle.java45
1 files changed, 3 insertions, 42 deletions
diff --git a/libjava/java/util/ResourceBundle.java b/libjava/java/util/ResourceBundle.java
index bfb6b30..ecc63af 100644
--- a/libjava/java/util/ResourceBundle.java
+++ b/libjava/java/util/ResourceBundle.java
@@ -42,8 +42,6 @@ import java.lang.ref.Reference;
import java.lang.ref.SoftReference;
import java.io.InputStream;
import java.io.IOException;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
import gnu.classpath.Configuration;
/**
@@ -105,44 +103,7 @@ public abstract class ResourceBundle
*/
private Locale locale;
- /**
- * We override SecurityManager in order to access getClassContext().
- */
- private static final class Security extends SecurityManager
- {
- /**
- * Avoid accessor method of private constructor.
- */
- Security()
- {
- }
-
- /**
- * Return the ClassLoader of the class which called into this
- * ResourceBundle, or null if it cannot be determined.
- */
- ClassLoader getCallingClassLoader()
- {
- Class[] stack = getClassContext();
- for (int i = 0; i < stack.length; i++)
- if (stack[i] != Security.class && stack[i] != ResourceBundle.class)
- return stack[i].getClassLoader();
- return null;
- }
- }
-
- /** A security context for grabbing the correct class loader. */
- private static final Security security
- = (Security) AccessController.doPrivileged(new PrivilegedAction()
- {
- // This will always work since java.util classes have (all) system
- // permissions.
- public Object run()
- {
- return new Security();
- }
- }
- );
+ private static native ClassLoader getCallingClassLoader();
/**
* The resource bundle cache. This is a two-level hash map: The key
@@ -256,7 +217,7 @@ public abstract class ResourceBundle
public static final ResourceBundle getBundle(String baseName)
{
return getBundle(baseName, Locale.getDefault(),
- security.getCallingClassLoader());
+ getCallingClassLoader());
}
/**
@@ -274,7 +235,7 @@ public abstract class ResourceBundle
public static final ResourceBundle getBundle(String baseName,
Locale locale)
{
- return getBundle(baseName, locale, security.getCallingClassLoader());
+ return getBundle(baseName, locale, getCallingClassLoader());
}
/**