Polishing

This commit is contained in:
Juergen Hoeller
2018-07-20 16:45:17 +02:00
parent 5007d01c17
commit c3f6403f61
19 changed files with 80 additions and 63 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -248,12 +248,12 @@ class DisposableBeanAdapter implements DisposableBean, Runnable, Serializable {
try {
if (System.getSecurityManager() != null) {
AccessController.doPrivileged((PrivilegedExceptionAction<Object>) () -> {
((DisposableBean) bean).destroy();
((DisposableBean) this.bean).destroy();
return null;
}, acc);
}, this.acc);
}
else {
((DisposableBean) bean).destroy();
((DisposableBean) this.bean).destroy();
}
}
catch (Throwable ex) {
@@ -326,7 +326,7 @@ class DisposableBeanAdapter implements DisposableBean, Runnable, Serializable {
});
try {
AccessController.doPrivileged((PrivilegedExceptionAction<Object>) () ->
destroyMethod.invoke(bean, args), acc);
destroyMethod.invoke(this.bean, args), this.acc);
}
catch (PrivilegedActionException pax) {
throw (InvocationTargetException) pax.getException();
@@ -334,12 +334,12 @@ class DisposableBeanAdapter implements DisposableBean, Runnable, Serializable {
}
else {
ReflectionUtils.makeAccessible(destroyMethod);
destroyMethod.invoke(bean, args);
destroyMethod.invoke(this.bean, args);
}
}
catch (InvocationTargetException ex) {
String msg = "Invocation of destroy method '" + this.destroyMethodName +
"' failed on bean with name '" + this.beanName + "'";
String msg = "Destroy method '" + this.destroyMethodName + "' on bean with name '" +
this.beanName + "' threw an exception";
if (logger.isDebugEnabled()) {
logger.warn(msg, ex.getTargetException());
}
@@ -348,7 +348,7 @@ class DisposableBeanAdapter implements DisposableBean, Runnable, Serializable {
}
}
catch (Throwable ex) {
logger.error("Couldn't invoke destroy method '" + this.destroyMethodName +
logger.error("Failed to invoke destroy method '" + this.destroyMethodName +
"' on bean with name '" + this.beanName + "'", ex);
}
}