Polish Bean Override internals and tests
This commit is contained in:
@@ -243,6 +243,8 @@ public abstract class BeanOverrideHandler {
|
||||
!Objects.equals(this.strategy, that.strategy)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// by-name lookup
|
||||
if (this.beanName != null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
* Copyright 2002-2025 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.
|
||||
@@ -109,8 +109,7 @@ class BeanOverrideRegistry {
|
||||
|
||||
void inject(Object target, BeanOverrideHandler handler) {
|
||||
String beanName = this.handlerToBeanNameMap.get(handler);
|
||||
Assert.state(StringUtils.hasLength(beanName),
|
||||
() -> "No bean found for BeanOverrideHandler: " + handler);
|
||||
Assert.state(StringUtils.hasLength(beanName), () -> "No bean found for BeanOverrideHandler: " + handler);
|
||||
inject(handler.getField(), target, beanName);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
* Copyright 2002-2025 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.
|
||||
|
||||
Reference in New Issue
Block a user