Kaydet (Commit) abbf4777 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

cid#1326844: DP: Use doPrivileged

Change-Id: Id86b4afc0d00864e02c978e0b8d4aa1fde7263c3
üst 13917e07
...@@ -32,6 +32,8 @@ import java.util.jar.Attributes; ...@@ -32,6 +32,8 @@ import java.util.jar.Attributes;
import java.util.jar.Manifest; import java.util.jar.Manifest;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import java.util.ArrayList; 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. * This class can be used as a loader for application classes which use UNO.
...@@ -167,11 +169,16 @@ public final class Loader { ...@@ -167,11 +169,16 @@ public final class Loader {
} }
// copy urls to array // copy urls to array
URL[] urls = new URL[vec.size()]; final URL[] urls = new URL[vec.size()];
vec.toArray( urls ); vec.toArray( urls );
// instantiate class loader // 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; return m_Loader;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment