cid#1326844: DP: Use doPrivileged

Change-Id: Id86b4afc0d00864e02c978e0b8d4aa1fde7263c3
This commit is contained in:
Stephan Bergmann
2016-02-24 15:08:14 +01:00
parent 13917e0755
commit abbf4777f2

View File

@@ -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;