From abbf4777f29374025d576ef8daa3f6dcba02ddf5 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 24 Feb 2016 15:08:14 +0100 Subject: [PATCH] cid#1326844: DP: Use doPrivileged Change-Id: Id86b4afc0d00864e02c978e0b8d4aa1fde7263c3 --- odk/source/com/sun/star/lib/loader/Loader.java | 11 +++++++++-- 1 file 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() { + public ClassLoader run() { + return new CustomURLClassLoader(urls); + } + }); } return m_Loader;