Polishing
This commit is contained in:
@@ -93,12 +93,13 @@ public abstract class AbstractAdvisingBeanPostProcessor extends ProxyProcessorSu
|
||||
|
||||
if (bean instanceof Advised advised) {
|
||||
if (!advised.isFrozen() && isEligible(AopUtils.getTargetClass(bean))) {
|
||||
// Add our local Advisor to the existing proxy's Advisor chain...
|
||||
// Add our local Advisor to the existing proxy's Advisor chain.
|
||||
if (this.beforeExistingAdvisors) {
|
||||
advised.addAdvisor(0, this.advisor);
|
||||
}
|
||||
else if (advised.getTargetSource() == AdvisedSupport.EMPTY_TARGET_SOURCE && advised.getAdvisorCount() > 0) {
|
||||
// No target, leave last advisor in place
|
||||
else if (advised.getTargetSource() == AdvisedSupport.EMPTY_TARGET_SOURCE &&
|
||||
advised.getAdvisorCount() > 0) {
|
||||
// No target, leave last Advisor in place and add new Advisor right before.
|
||||
advised.addAdvisor(advised.getAdvisorCount() - 1, this.advisor);
|
||||
return bean;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 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.
|
||||
@@ -200,12 +200,15 @@ class DisposableBeanAdapter implements DisposableBean, Runnable, Serializable {
|
||||
((DisposableBean) this.bean).destroy();
|
||||
}
|
||||
catch (Throwable ex) {
|
||||
String msg = "Invocation of destroy method failed on bean with name '" + this.beanName + "'";
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.warn(msg, ex);
|
||||
}
|
||||
else {
|
||||
logger.warn(msg + ": " + ex);
|
||||
if (logger.isWarnEnabled()) {
|
||||
String msg = "Invocation of destroy method failed on bean with name '" + this.beanName + "'";
|
||||
if (logger.isDebugEnabled()) {
|
||||
// Log at warn level like below but add the exception stacktrace only with debug level
|
||||
logger.warn(msg, ex);
|
||||
}
|
||||
else {
|
||||
logger.warn(msg + ": " + ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 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.
|
||||
@@ -261,7 +261,7 @@ public class ApplicationListenerMethodAdapter implements GenericApplicationListe
|
||||
return new Object[] {event};
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "deprecation", "unchecked" })
|
||||
@SuppressWarnings({"deprecation", "unchecked"})
|
||||
protected void handleResult(Object result) {
|
||||
if (reactiveStreamsPresent && new ReactiveResultHandler().subscribeToPublisher(result)) {
|
||||
if (logger.isTraceEnabled()) {
|
||||
|
||||
@@ -263,7 +263,7 @@ public class MethodReference extends SpelNodeImpl {
|
||||
for (int i = 0; i < getChildCount(); i++) {
|
||||
sj.add(getChild(i).toStringAST());
|
||||
}
|
||||
return this.name + sj.toString();
|
||||
return this.name + sj;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -283,12 +283,12 @@ public class MethodReference extends SpelNodeImpl {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (executor.didArgumentConversionOccur()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Class<?> clazz = executor.getMethod().getDeclaringClass();
|
||||
return Modifier.isPublic(clazz.getModifiers()) || executor.getPublicDeclaringClass() != null;
|
||||
return (Modifier.isPublic(clazz.getModifiers()) || executor.getPublicDeclaringClass() != null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -166,7 +166,6 @@ class DefaultDatabaseClient implements DatabaseClient {
|
||||
* closed
|
||||
*/
|
||||
private Publisher<Void> closeConnection(Connection connection) {
|
||||
|
||||
return ConnectionFactoryUtils.currentConnectionFactory(
|
||||
obtainConnectionFactory()).then().onErrorResume(Exception.class,
|
||||
e -> Mono.from(connection.close()));
|
||||
@@ -192,8 +191,7 @@ class DefaultDatabaseClient implements DatabaseClient {
|
||||
new CloseSuppressingInvocationHandler(con));
|
||||
}
|
||||
|
||||
private static Mono<Long> sumRowsUpdated(
|
||||
Function<Connection, Flux<Result>> resultFunction, Connection it) {
|
||||
private static Mono<Long> sumRowsUpdated(Function<Connection, Flux<Result>> resultFunction, Connection it) {
|
||||
return resultFunction.apply(it)
|
||||
.flatMap(Result::getRowsUpdated)
|
||||
.cast(Number.class)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 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.
|
||||
@@ -94,8 +94,7 @@ class JettyClientHttpRequest extends AbstractClientHttpRequest {
|
||||
.as(chunks -> ReactiveRequest.Content.fromPublisher(chunks, getContentType()));
|
||||
this.builder.content(content);
|
||||
sink.success();
|
||||
})
|
||||
.then(doCommit());
|
||||
}).then(doCommit());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -284,6 +284,7 @@ public class DispatcherServlet extends FrameworkServlet {
|
||||
*/
|
||||
private static final String DEFAULT_STRATEGIES_PREFIX = "org.springframework.web.servlet";
|
||||
|
||||
|
||||
/** Additional logger to use when no mapped handler is found for a request. */
|
||||
protected static final Log pageNotFoundLogger = LogFactory.getLog(PAGE_NOT_FOUND_LOG_CATEGORY);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user