Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CloseableURLClassLoader: replace deprecated getPackage() #517

Merged
merged 1 commit into from
Feb 13, 2024
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 @@ -63,7 +63,7 @@
// @GuardedBy("loaders")
boolean closed = false; // note: protected by loaders, package private to avoid synthetic access.

private final AccessControlContext context;

Check warning on line 66 in bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/CloseableURLClassLoader.java

View check run for this annotation

Jenkins - Eclipse Equinox / Compiler and API Tools

Deprecation

NORMAL: The type AccessControlContext has been deprecated since version 17 and marked for removal
private final boolean verifyJars;
private final boolean registeredAsParallel;

Expand Down Expand Up @@ -138,7 +138,7 @@
this.jarFile = new JarFile(file, verify);
this.manifest = jarFile.getManifest();
this.jarURLStreamHandler = new CloseableJarURLStreamHandler(jarFile);
this.jarFileURLPrefixString = file.toURL().toString() + BANG_SLASH;

Check warning on line 141 in bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/CloseableURLClassLoader.java

View check run for this annotation

Jenkins - Eclipse Equinox / Compiler and API Tools

Deprecation

NORMAL: The method toURL() from the type File is deprecated
}

public URL getURL(String name) {
Expand Down Expand Up @@ -192,7 +192,7 @@
super(excludeFileJarURLS(urls), parent);
this.registeredAsParallel = CLOSEABLE_REGISTERED_AS_PARALLEL
&& this.getClass() == CloseableURLClassLoader.class;
this.context = AccessController.getContext();

Check warning on line 195 in bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/CloseableURLClassLoader.java

View check run for this annotation

Jenkins - Eclipse Equinox / Compiler and API Tools

Deprecation

NORMAL: The type AccessController has been deprecated since version 17 and marked for removal

Check warning on line 195 in bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/CloseableURLClassLoader.java

View check run for this annotation

Jenkins - Eclipse Equinox / Compiler and API Tools

Deprecation

NORMAL: The method getContext() from the type AccessController is deprecated
this.verifyJars = verifyJars;
for (URL url : urls) {
if (isFileJarURL(url)) {
Expand Down Expand Up @@ -280,7 +280,7 @@
@Override
protected Class<?> findClass(final String name) throws ClassNotFoundException {
try {
Class<?> clazz = AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>() {

Check warning on line 283 in bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/CloseableURLClassLoader.java

View check run for this annotation

Jenkins - Eclipse Equinox / Compiler and API Tools

Deprecation

NORMAL: The type AccessController has been deprecated since version 17 and marked for removal

Check warning on line 283 in bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/CloseableURLClassLoader.java

View check run for this annotation

Jenkins - Eclipse Equinox / Compiler and API Tools

Deprecation

NORMAL: The method doPrivileged(PrivilegedExceptionAction >, AccessControlContext) from the type AccessController is deprecated
@Override
public Class<?> run() throws ClassNotFoundException {
String resourcePath = name.replace('.', '/') + DOT_CLASS;
Expand Down Expand Up @@ -321,7 +321,7 @@
if (lastDot != -1) {
String packageName = name.substring(0, lastDot);
synchronized (pkgLock) {
Package pkg = getPackage(packageName);
Package pkg = getDefinedPackage(packageName);
if (pkg != null) {
checkForSealedPackage(pkg, packageName, manifest, connection.getJarFileURL());
} else {
Expand Down Expand Up @@ -394,7 +394,7 @@

@Override
public URL findResource(final String name) {
URL url = AccessController.doPrivileged(new PrivilegedAction<URL>() {

Check warning on line 397 in bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/CloseableURLClassLoader.java

View check run for this annotation

Jenkins - Eclipse Equinox / Compiler and API Tools

Deprecation

NORMAL: The type AccessController has been deprecated since version 17 and marked for removal

Check warning on line 397 in bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/CloseableURLClassLoader.java

View check run for this annotation

Jenkins - Eclipse Equinox / Compiler and API Tools

Deprecation

NORMAL: The method doPrivileged(PrivilegedAction , AccessControlContext) from the type AccessController is deprecated
@Override
public URL run() {
synchronized (loaders) {
Expand All @@ -417,7 +417,7 @@
@Override
public Enumeration<URL> findResources(final String name) throws IOException {
final List<URL> resources = new ArrayList<>();
AccessController.doPrivileged(new PrivilegedAction<>() {

Check warning on line 420 in bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/CloseableURLClassLoader.java

View check run for this annotation

Jenkins - Eclipse Equinox / Compiler and API Tools

Deprecation

NORMAL: The type AccessController has been deprecated since version 17 and marked for removal

Check warning on line 420 in bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/CloseableURLClassLoader.java

View check run for this annotation

Jenkins - Eclipse Equinox / Compiler and API Tools

Deprecation

NORMAL: The method doPrivileged(PrivilegedAction , AccessControlContext) from the type AccessController is deprecated
@Override
public Object run() {
synchronized (loaders) {
Expand Down
Loading