Skip to content

Commit 3c9ff87

Browse files
author
Vincent Potucek
committed
fix ignored exceptions
Signed-off-by: Vincent Potucek <[email protected]>
1 parent 8eacca1 commit 3c9ff87

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

integration-tests/src/test/java/org/springframework/aop/framework/autoproxy/AdvisorAutoProxyCreatorIntegrationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ public void before(Method method, Object[] args, Object target) throws Throwable
271271
TransactionInterceptor.currentTransactionStatus();
272272
throw new RuntimeException("Shouldn't have a transaction");
273273
}
274-
catch (NoTransactionException ex) {
274+
catch (NoTransactionException ignored) {
275275
// this is Ok
276276
}
277277
}

spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcut.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ private ShadowMatch getTargetShadowMatch(Method method, Class<?> targetClass) {
453453
ClassUtils.toClassArray(ifcs), targetClass.getClassLoader());
454454
targetMethod = ClassUtils.getMostSpecificMethod(targetMethod, compositeInterface);
455455
}
456-
catch (IllegalArgumentException ex) {
456+
catch (IllegalArgumentException ignored) {
457457
// Implemented interfaces probably expose conflicting method signatures...
458458
// Proceed with original target method.
459459
}
@@ -478,7 +478,7 @@ private ShadowMatch getShadowMatch(Method targetMethod, Method originalMethod) {
478478
try {
479479
shadowMatch = pointcutExpression.matchesMethodExecution(methodToMatch);
480480
}
481-
catch (ReflectionWorldException ex) {
481+
catch (ReflectionWorldException ignored) {
482482
// Failed to introspect target method, probably because it has been loaded
483483
// in a special ClassLoader. Let's try the declaring ClassLoader instead...
484484
try {
@@ -501,7 +501,7 @@ private ShadowMatch getShadowMatch(Method targetMethod, Method originalMethod) {
501501
try {
502502
shadowMatch = pointcutExpression.matchesMethodExecution(methodToMatch);
503503
}
504-
catch (ReflectionWorldException ex) {
504+
catch (ReflectionWorldException ignored) {
505505
// Could neither introspect the target class nor the proxy class ->
506506
// let's try the original method's declaring class before we give up...
507507
try {

spring-web/src/main/java/org/springframework/http/converter/ResourceHttpMessageConverter.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -157,22 +157,17 @@ protected void writeContent(Resource resource, HttpOutputMessage outputMessage)
157157
OutputStream out = outputMessage.getBody();
158158
in.transferTo(out);
159159
out.flush();
160+
// need to str
160161
}
161-
catch (NullPointerException ex) {
162-
// ignore, see SPR-13620
163-
}
162+
catch (NullPointerException ex) { } // ignore, see SPR-13620
164163
finally {
165164
try {
166165
in.close();
167166
}
168-
catch (Throwable ex) {
169-
// ignore, see SPR-12999
170-
}
167+
catch (Throwable ignored) { } // ignore, see SPR-12999
171168
}
172169
}
173-
catch (FileNotFoundException ex) {
174-
// ignore, see SPR-12999
175-
}
170+
catch (FileNotFoundException ignored) { } // ignore, see SPR-12999
176171
}
177172

178173
}

0 commit comments

Comments
 (0)