mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Merge branch '2.4.x' into 2.5.x
Closes gh-28262
This commit is contained in:
commit
d47260637b
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -276,7 +276,7 @@ public class Restarter {
|
||||
Assert.notNull(this.mainClassName, "Unable to find the main class to restart");
|
||||
URL[] urls = this.urls.toArray(new URL[0]);
|
||||
ClassLoaderFiles updatedFiles = new ClassLoaderFiles(this.classLoaderFiles);
|
||||
ClassLoader classLoader = new RestartClassLoader(this.applicationClassLoader, urls, updatedFiles, this.logger);
|
||||
ClassLoader classLoader = new RestartClassLoader(this.applicationClassLoader, urls, updatedFiles);
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Starting application " + this.mainClassName + " with URLs " + Arrays.asList(urls));
|
||||
}
|
||||
|
@ -42,8 +42,6 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
public class RestartClassLoader extends URLClassLoader implements SmartClassLoader {
|
||||
|
||||
private final Log logger;
|
||||
|
||||
private final ClassLoaderFileRepository updatedFiles;
|
||||
|
||||
/**
|
||||
@ -73,14 +71,16 @@ public class RestartClassLoader extends URLClassLoader implements SmartClassLoad
|
||||
* URLs were created.
|
||||
* @param urls the urls managed by the classloader
|
||||
* @param logger the logger used for messages
|
||||
* @deprecated since 2.4.11 for removal in 2.7.0 in favor of
|
||||
* {@link #RestartClassLoader(ClassLoader, URL[], ClassLoaderFileRepository)}
|
||||
*/
|
||||
@Deprecated
|
||||
public RestartClassLoader(ClassLoader parent, URL[] urls, ClassLoaderFileRepository updatedFiles, Log logger) {
|
||||
super(urls, parent);
|
||||
Assert.notNull(parent, "Parent must not be null");
|
||||
Assert.notNull(updatedFiles, "UpdatedFiles must not be null");
|
||||
Assert.notNull(logger, "Logger must not be null");
|
||||
this.updatedFiles = updatedFiles;
|
||||
this.logger = logger;
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Created RestartClassLoader " + toString());
|
||||
}
|
||||
@ -187,14 +187,6 @@ public class RestartClassLoader extends URLClassLoader implements SmartClassLoad
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
if (this.logger.isDebugEnabled()) {
|
||||
this.logger.debug("Finalized classloader " + toString());
|
||||
}
|
||||
super.finalize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isClassReloadable(Class<?> classType) {
|
||||
return (classType.getClassLoader() instanceof RestartClassLoader);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
* Copyright 2012-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -44,11 +44,6 @@ class FileDescriptor {
|
||||
this.closer = closer;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
close();
|
||||
}
|
||||
|
||||
/**
|
||||
* Acquire an instance of the actual {@link Handle}. The caller must
|
||||
* {@link Handle#close() close} the resulting handle when done.
|
||||
|
Loading…
Reference in New Issue
Block a user