mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-10-09 19:09:03 +00:00
Polish "Optimize DevTools resource lookup performance"
See gh-46289
This commit is contained in:
-1
@@ -33,7 +33,6 @@ import org.springframework.boot.devtools.restart.classloader.ClassLoaderFile;
|
||||
import org.springframework.boot.devtools.restart.classloader.ClassLoaderFile.Kind;
|
||||
import org.springframework.boot.devtools.restart.classloader.ClassLoaderFileURLStreamHandler;
|
||||
import org.springframework.boot.devtools.restart.classloader.ClassLoaderFiles;
|
||||
import org.springframework.boot.devtools.restart.classloader.ClassLoaderFiles.SourceDirectory;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.support.AbstractApplicationContext;
|
||||
import org.springframework.core.io.AbstractResource;
|
||||
|
||||
+3
-1
@@ -42,6 +42,7 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
public class ClassLoaderFiles implements ClassLoaderFileRepository, Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1;
|
||||
|
||||
private final Map<String, SourceDirectory> sourceDirectories;
|
||||
@@ -142,7 +143,7 @@ public class ClassLoaderFiles implements ClassLoaderFileRepository, Serializable
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClassLoaderFile getFile(String name) {
|
||||
public @Nullable ClassLoaderFile getFile(String name) {
|
||||
return this.filesByName.get(name);
|
||||
}
|
||||
|
||||
@@ -150,6 +151,7 @@ public class ClassLoaderFiles implements ClassLoaderFileRepository, Serializable
|
||||
* Returns a set of all file entries across all source directories for efficient
|
||||
* iteration.
|
||||
* @return a set of all file entries
|
||||
* @since 4.0.0
|
||||
*/
|
||||
public Set<Entry<String, ClassLoaderFile>> getFileEntries() {
|
||||
return Collections.unmodifiableSet(this.filesByName.entrySet());
|
||||
|
||||
Reference in New Issue
Block a user