From 0477ba4de4a4bce91af6ea4ef8ea97932e783bd1 Mon Sep 17 00:00:00 2001
From: Sam Brannen <104798+sbrannen@users.noreply.github.com>
Date: Fri, 18 Apr 2025 16:59:37 +0200
Subject: [PATCH 1/3] Remove obsolete RmiInvocationWrapperRTD.xml file
Closes gh-34779
(cherry picked from commit e7402bc365acdbbbbb8c9aa6f0502cdd8f0f6f85)
---
.../remoting/rmi/RmiInvocationWrapperRTD.xml | 11 -----------
1 file changed, 11 deletions(-)
delete mode 100644 spring-context/src/main/resources/org/springframework/remoting/rmi/RmiInvocationWrapperRTD.xml
diff --git a/spring-context/src/main/resources/org/springframework/remoting/rmi/RmiInvocationWrapperRTD.xml b/spring-context/src/main/resources/org/springframework/remoting/rmi/RmiInvocationWrapperRTD.xml
deleted file mode 100644
index 3ea5d627e90..00000000000
--- a/spring-context/src/main/resources/org/springframework/remoting/rmi/RmiInvocationWrapperRTD.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
From 1841ad3472706d79894c12bc1bccac5dc4a925f3 Mon Sep 17 00:00:00 2001
From: Juergen Hoeller
Date: Tue, 22 Apr 2025 12:17:03 +0200
Subject: [PATCH 2/3] Consistently use local copy of volatile mainThreadPrefix
field
Closes gh-34746
---
.../beans/factory/support/DefaultListableBeanFactory.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java
index 44f24cc912d..29271d5b011 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java
@@ -1066,8 +1066,9 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
@Nullable
protected Boolean isCurrentThreadAllowedToHoldSingletonLock() {
String mainThreadPrefix = this.mainThreadPrefix;
- if (this.mainThreadPrefix != null) {
- // We only differentiate in the preInstantiateSingletons phase.
+ if (mainThreadPrefix != null) {
+ // We only differentiate in the preInstantiateSingletons phase, using
+ // the volatile mainThreadPrefix field as an indicator for that phase.
PreInstantiation preInstantiation = this.preInstantiationThread.get();
if (preInstantiation != null) {
@@ -1087,7 +1088,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
}
else if (this.strictLocking == null) {
// No explicit locking configuration -> infer appropriate locking.
- if (mainThreadPrefix != null && !getThreadNamePrefix().equals(mainThreadPrefix)) {
+ if (!getThreadNamePrefix().equals(mainThreadPrefix)) {
// An unmanaged thread (assumed to be application-internal) with lenient locking,
// and not part of the same thread pool that provided the main bootstrap thread
// (excluding scenarios where we are hit by multiple external bootstrap threads).
From b83e07ff8c6ddbfb1b4f0f551d3dcba138a5e040 Mon Sep 17 00:00:00 2001
From: Juergen Hoeller
Date: Tue, 22 Apr 2025 12:17:18 +0200
Subject: [PATCH 3/3] Ignore NoSuchFileException from getJarFile() as well
Closes gh-34764
---
.../io/support/PathMatchingResourcePatternResolver.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java b/spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java
index 7fe7c54b082..4a73678fd86 100644
--- a/spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java
+++ b/spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java
@@ -36,6 +36,7 @@ import java.nio.file.FileSystemNotFoundException;
import java.nio.file.FileSystems;
import java.nio.file.FileVisitOption;
import java.nio.file.Files;
+import java.nio.file.NoSuchFileException;
import java.nio.file.Path;
import java.util.Collections;
import java.util.Enumeration;
@@ -874,9 +875,9 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
rootEntryPath = (jarEntry != null ? jarEntry.getName() : "");
closeJarFile = !jarCon.getUseCaches();
}
- catch (ZipException | FileNotFoundException ex) {
+ catch (ZipException | FileNotFoundException | NoSuchFileException ex) {
// Happens in case of a non-jar file or in case of a cached root directory
- // without specific subdirectory present, respectively.
+ // without the specific subdirectory present, respectively.
return Collections.emptySet();
}
}
@@ -1275,7 +1276,7 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
}
/**
- * Return a alternative form of the resource, i.e. with or without a leading slash.
+ * Return an alternative form of the resource, i.e. with or without a leading slash.
* @param path the file path (with or without a leading slash)
* @return the alternative form or {@code null}
*/