Polishing regarding JDK baseline upgrade

Closes gh-28440
This commit is contained in:
lihan
2022-05-10 21:11:07 +08:00
committed by Sam Brannen
parent 5c5c89e9fe
commit a892ce80c1
9 changed files with 21 additions and 26 deletions

View File

@@ -286,9 +286,8 @@ public class HandlerMethod {
*/
public HandlerMethod createWithResolvedBean() {
Object handler = this.bean;
if (this.bean instanceof String) {
if (this.bean instanceof String beanName) {
Assert.state(this.beanFactory != null, "Cannot resolve bean name without BeanFactory");
String beanName = (String) this.bean;
handler = this.beanFactory.getBean(beanName);
}
return new HandlerMethod(this, handler);