Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,27 @@ public AgentClassLoader(File javaagentFile) {
*/
public AgentClassLoader(
File javaagentFile, String internalJarFileName, boolean isSecurityManagerSupportEnabled) {
super(new URL[] {}, getParentClassLoader());
this(javaagentFile, internalJarFileName, isSecurityManagerSupportEnabled, null);
}

/**
* Construct a new AgentClassLoader with a custom parent ClassLoader. This is used by some 3rd
* party command-line utilities in order to reuse classes that are bundled as classdata files
* under `inst/`.
*
* @param javaagentFile Used for resource lookups.
* @param internalJarFileName File name of the internal jar
* @param isSecurityManagerSupportEnabled Whether this class loader should define classes with all
* permissions
* @param parentClassLoader Custom parent ClassLoader to use. If null, the default parent will be
* used.
*/
public AgentClassLoader(
File javaagentFile,
String internalJarFileName,
boolean isSecurityManagerSupportEnabled,
@Nullable ClassLoader parentClassLoader) {
super(new URL[] {}, parentClassLoader != null ? parentClassLoader : getParentClassLoader());
if (javaagentFile == null) {
throw new IllegalArgumentException("Agent jar location should be set");
}
Expand Down