Skip to content
Merged
Show file tree
Hide file tree
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

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2022 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
Expand All @@ -21,7 +21,7 @@
public class Which {

public static String which( Class<?> clazz ) {
return which( clazz.getName(), SecureLoader.getClassClassLoader(clazz));
return which( clazz.getName(), clazz.getClassLoader());
}

/**
Expand All @@ -36,7 +36,7 @@ public static String which(String classname, ClassLoader loader) {
String classnameAsResource = classname.replace('.', '/') + ".class";

if(loader == null) {
loader = SecureLoader.getSystemClassLoader();
loader = ClassLoader.getSystemClassLoader();
}

URL it = loader.getResource(classnameAsResource);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void execute() throws BuildException {
// then use a MaskingClassLoader
// so that the XJC2 classes in the parent class loader
// won't interfere with loading XJC1 classes in a child class loader
ClassLoader ccl = SecureLoader.getContextClassLoader();
ClassLoader ccl = Thread.currentThread().getContextClassLoader();
try {
ClassLoader cl = createClassLoader();
@SuppressWarnings("unchecked")
Expand All @@ -66,7 +66,7 @@ public void execute() throws BuildException {
t.setTaskName(getTaskName());
root.configure(t);

SecureLoader.setContextClassLoader(cl);
Thread.currentThread().setContextClassLoader(cl);
try {
t.execute();
} finally {
Expand All @@ -81,7 +81,7 @@ public void execute() throws BuildException {
throw new BuildException(e);
} finally {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
SecureLoader.setContextClassLoader(ccl);
Thread.currentThread().setContextClassLoader(ccl);

//close/cleanup all classloaders but the one which loaded this class
while (cl != null && !ccl.equals(cl)) {
Expand Down Expand Up @@ -123,7 +123,7 @@ private ClassLoader getParentClassLoader(final ClassLoader cl) {
return loader == null ? null
: loader.getClass().getName().startsWith("org.gradle.") ? null : loader;
}
return SecureLoader.getParentClassLoader(cl);
return cl.getParent();
}

/**
Expand Down

This file was deleted.