[SPR-8387] Fixed logic errors in DelegatingSmartContextLoader.processContextConfiguration() and ContextConfigurationAttributes.hasResources().
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4710 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
parent
d123102495
commit
539c6f95c9
|
|
@ -168,13 +168,13 @@ public class ContextConfigurationAttributes {
|
|||
/**
|
||||
* Determine if this {@code ContextConfigurationAttributes} instance has
|
||||
* either path-based resource locations or class-based resources.
|
||||
* @return <code>true</code> if neither the {@link #getLocations() locations}
|
||||
* nor the {@link #getClasses() classes} array is empty
|
||||
* @return <code>true</code> if either the {@link #getLocations() locations}
|
||||
* or the {@link #getClasses() classes} array is not empty
|
||||
* @see #getLocations()
|
||||
* @see #getClasses()
|
||||
*/
|
||||
public boolean hasResources() {
|
||||
return !ObjectUtils.isEmpty(getLocations()) && !ObjectUtils.isEmpty(getClasses());
|
||||
return !ObjectUtils.isEmpty(getLocations()) || !ObjectUtils.isEmpty(getClasses());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ public class DelegatingSmartContextLoader implements SmartContextLoader {
|
|||
|
||||
// If any loader claims to generate defaults but none actually did,
|
||||
// throw an exception.
|
||||
if (originallyHadResources && generatesDefaults() && !configAttributes.hasResources()) {
|
||||
if (generatesDefaults() && !originallyHadResources && !configAttributes.hasResources()) {
|
||||
throw new IllegalStateException(String.format("None of the SmartContextLoader candidates %s "
|
||||
+ "was able to generate defaults for context configuration [%s].", candidates, configAttributes));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue