Rename exception variables in empty catch blocks
The Spring codebase sometimes ignores exceptions in catch blocks on purpose. This is often called out by an inline comment. We should make this more obvious by renaming the exception argument in the catch block to declare whether the exception is "ignored" or "expected". See gh-35047 Signed-off-by: Vincent Potucek <vpotucek@me.com> [brian.clozel@broadcom.com: rework commit message] Signed-off-by: Brian Clozel <brian.clozel@broadcom.com>
This commit is contained in:
committed by
Brian Clozel
parent
cd3ac44fb0
commit
0d4dfb6c1f
@@ -73,7 +73,8 @@ class BridgeMethodResolver {
|
||||
} finally {
|
||||
is.close();
|
||||
}
|
||||
} catch (IOException ignored) {}
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
}
|
||||
return resolved;
|
||||
}
|
||||
|
||||
@@ -62,8 +62,8 @@ public class MethodProxy {
|
||||
try {
|
||||
proxy.init();
|
||||
}
|
||||
catch (CodeGenerationException ex) {
|
||||
// Ignore - to be retried when actually needed later on (possibly not at all)
|
||||
catch (CodeGenerationException ignored) {
|
||||
// to be retried when actually needed later on (possibly not at all)
|
||||
}
|
||||
}
|
||||
// SPRING PATCH END
|
||||
|
||||
@@ -438,8 +438,7 @@ public class SpringFactoriesLoader {
|
||||
return constructor;
|
||||
}
|
||||
}
|
||||
catch (UnsupportedOperationException ex) {
|
||||
// ignore
|
||||
catch (UnsupportedOperationException ignored) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -229,8 +229,7 @@ public abstract class FileCopyUtils {
|
||||
try {
|
||||
closeable.close();
|
||||
}
|
||||
catch (IOException ex) {
|
||||
// ignore
|
||||
catch (IOException ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user