diff options
author | aclement <aclement> | 2004-10-14 08:12:09 +0000 |
---|---|---|
committer | aclement <aclement> | 2004-10-14 08:12:09 +0000 |
commit | 6e155a6b9b78ec64f2fd4dc08152698277f1e7b7 (patch) | |
tree | a8209a54d2190e699cecb488c93825bcacf1b464 /runtime/src/org | |
parent | 234bea2297cc780d5bf38ebbc4087e938cc3b6e8 (diff) | |
download | aspectj-6e155a6b9b78ec64f2fd4dc08152698277f1e7b7.tar.gz aspectj-6e155a6b9b78ec64f2fd4dc08152698277f1e7b7.zip |
Fix for Bugzilla Bug 74238: Applet which uses cflow pointcut gets AccessControlException
Diffstat (limited to 'runtime/src/org')
-rw-r--r-- | runtime/src/org/aspectj/runtime/internal/CFlowCounter.java | 12 | ||||
-rw-r--r-- | runtime/src/org/aspectj/runtime/internal/CFlowStack.java | 12 |
2 files changed, 22 insertions, 2 deletions
diff --git a/runtime/src/org/aspectj/runtime/internal/CFlowCounter.java b/runtime/src/org/aspectj/runtime/internal/CFlowCounter.java index e48f67864..3e20cae28 100644 --- a/runtime/src/org/aspectj/runtime/internal/CFlowCounter.java +++ b/runtime/src/org/aspectj/runtime/internal/CFlowCounter.java @@ -50,7 +50,7 @@ public class CFlowCounter { private static ThreadStackFactory getThreadLocalStackFactoryFor11() { return new ThreadStackFactoryImpl11(); } private static void selectFactoryForVMVersion() { - String override = System.getProperty("aspectj.runtime.cflowstack.usethreadlocal","unspecified"); + String override = getSystemPropertyWithoutSecurityException("aspectj.runtime.cflowstack.usethreadlocal","unspecified"); boolean useThreadLocalImplementation = false; if (override.equals("unspecified")) { String v = System.getProperty("java.class.version","0.0"); @@ -67,6 +67,16 @@ public class CFlowCounter { } } + + private static String getSystemPropertyWithoutSecurityException (String aPropertyName, String aDefaultValue) { + try { + return System.getProperty(aPropertyName, aDefaultValue); + } + catch (SecurityException ex) { + return aDefaultValue; + } + } + // For debug ... public static String getThreadStackFactoryClassName() { return tsFactory.getClass().getName(); diff --git a/runtime/src/org/aspectj/runtime/internal/CFlowStack.java b/runtime/src/org/aspectj/runtime/internal/CFlowStack.java index 5e6eff590..e9d811124 100644 --- a/runtime/src/org/aspectj/runtime/internal/CFlowStack.java +++ b/runtime/src/org/aspectj/runtime/internal/CFlowStack.java @@ -121,7 +121,7 @@ public class CFlowStack { private static ThreadStackFactory getThreadLocalStackFactoryFor11() { return new ThreadStackFactoryImpl11(); } private static void selectFactoryForVMVersion() { - String override = System.getProperty("aspectj.runtime.cflowstack.usethreadlocal","unspecified"); + String override = getSystemPropertyWithoutSecurityException("aspectj.runtime.cflowstack.usethreadlocal","unspecified"); boolean useThreadLocalImplementation = false; if (override.equals("unspecified")) { String v = System.getProperty("java.class.version","0.0"); @@ -138,6 +138,16 @@ public class CFlowStack { } } + private static String getSystemPropertyWithoutSecurityException (String aPropertyName, String aDefaultValue) { + try { + return System.getProperty(aPropertyName, aDefaultValue); + } + catch (SecurityException ex) { + return aDefaultValue; + } + } + + // For debug ... public static String getThreadStackFactoryClassName() { return tsFactory.getClass().getName(); |