Skip to content

Commit 9b66e52

Browse files
committed
Fix SonarQube issues
* "Exception" should not be caught when not required by called methods (java:S2221) Makes sense to check just for RuntimeException, as there are no checked exceptions there.
1 parent 48ea0e2 commit 9b66e52

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/com/itextpdf/rups/model/FilePathPreProcessor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private static Optional<String> fromUrlEncoded(File currentDir, String urlEncode
123123
if (isFile(currentDir, decoded)) {
124124
return Optional.of(decoded);
125125
}
126-
} catch (Exception ignored) {
126+
} catch (RuntimeException ignored) {
127127
// Ignored
128128
}
129129
return Optional.empty();
@@ -165,7 +165,7 @@ private static Optional<String> fromFileUri(String fileUriString) {
165165
path = path.replace(File.separatorChar, '/');
166166
}
167167
return Optional.of(path);
168-
} catch (Exception ignored) {
168+
} catch (RuntimeException ignored) {
169169
// Ignored
170170
}
171171
return Optional.empty();
@@ -183,7 +183,7 @@ private static Optional<String> fromFileUri(String fileUriString) {
183183
private static boolean isFile(File currentDir, String path) {
184184
try {
185185
return new File(currentDir, path).isFile();
186-
} catch (Exception ignored) {
186+
} catch (RuntimeException ignored) {
187187
// Ignored
188188
}
189189
return false;

0 commit comments

Comments
 (0)