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 1522d3b7bc0f..177d01ce574e 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 @@ -745,7 +745,8 @@ protected Set doFindPathMatchingFileResources(Resource rootDirResource FileSystem fileSystem; try { fileSystem = FileSystems.getFileSystem(rootDirResource.getURI().resolve("/")); - } catch (Exception e) { + } + catch (Exception ex) { fileSystem = FileSystems.newFileSystem(rootDirResource.getURI().resolve("/"), Map.of(), ClassUtils.getDefaultClassLoader()); } @@ -769,17 +770,20 @@ protected Set doFindPathMatchingFileResources(Resource rootDirResource if (getPathMatcher().match(patternPath.toString(), file.toString())) { try { result.add(new UrlResource(file.toUri())); - } catch (MalformedURLException e) { + } + catch (MalformedURLException ex) { // ignore } } }); - } catch (NoSuchFileException e) { + } + catch (NoSuchFileException ex) { // ignore } try { fileSystem.close(); - } catch (UnsupportedOperationException e) { + } + catch (UnsupportedOperationException ex) { // ignore } return result;