From 385292dc41c62e96a083c41c9c686825db251d63 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Sun, 25 Sep 2022 17:41:58 +0200 Subject: [PATCH] Fix Checkstyle violations See gh-29163 --- .../support/PathMatchingResourcePatternResolver.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 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 1522d3b7bc..177d01ce57 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 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol 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 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol 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;