summaryrefslogtreecommitdiff
path: root/odk/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-02-24 15:08:14 +0100
committerStephan Bergmann <sbergman@redhat.com>2016-02-24 15:08:51 +0100
commitabbf4777f29374025d576ef8daa3f6dcba02ddf5 (patch)
treec2e3a791e09d4cf62243d5dd406fb387aabee989 /odk/source
parent13917e0755bb864f22d0cf75a43854acbdb1eaec (diff)
cid#1326844: DP: Use doPrivileged
Change-Id: Id86b4afc0d00864e02c978e0b8d4aa1fde7263c3
Diffstat (limited to 'odk/source')
-rw-r--r--odk/source/com/sun/star/lib/loader/Loader.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/odk/source/com/sun/star/lib/loader/Loader.java b/odk/source/com/sun/star/lib/loader/Loader.java
index d73260f593d5..d86cf810c558 100644
--- a/odk/source/com/sun/star/lib/loader/Loader.java
+++ b/odk/source/com/sun/star/lib/loader/Loader.java
@@ -32,6 +32,8 @@ import java.util.jar.Attributes;
import java.util.jar.Manifest;
import java.util.StringTokenizer;
import java.util.ArrayList;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
/**
* This class can be used as a loader for application classes which use UNO.
@@ -167,11 +169,16 @@ public final class Loader {
}
// copy urls to array
- URL[] urls = new URL[vec.size()];
+ final URL[] urls = new URL[vec.size()];
vec.toArray( urls );
// instantiate class loader
- m_Loader = new CustomURLClassLoader( urls );
+ m_Loader = AccessController.doPrivileged(
+ new PrivilegedAction<ClassLoader>() {
+ public ClassLoader run() {
+ return new CustomURLClassLoader(urls);
+ }
+ });
}
return m_Loader;