|
|
@ -87,7 +87,7 @@ class NoSuchBeanDefinitionFailureAnalyzer
|
|
|
|
cause);
|
|
|
|
cause);
|
|
|
|
StringBuilder message = new StringBuilder();
|
|
|
|
StringBuilder message = new StringBuilder();
|
|
|
|
message.append(String.format("%s required %s that could not be found.%n",
|
|
|
|
message.append(String.format("%s required %s that could not be found.%n",
|
|
|
|
(description != null ? description : "A component"),
|
|
|
|
(description != null) ? description : "A component",
|
|
|
|
getBeanDescription(cause)));
|
|
|
|
getBeanDescription(cause)));
|
|
|
|
for (AutoConfigurationResult result : autoConfigurationResults) {
|
|
|
|
for (AutoConfigurationResult result : autoConfigurationResults) {
|
|
|
|
message.append(String.format("\t- %s%n", result));
|
|
|
|
message.append(String.format("\t- %s%n", result));
|
|
|
@ -97,9 +97,8 @@ class NoSuchBeanDefinitionFailureAnalyzer
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String action = String.format("Consider %s %s in your configuration.",
|
|
|
|
String action = String.format("Consider %s %s in your configuration.",
|
|
|
|
(!autoConfigurationResults.isEmpty()
|
|
|
|
(!autoConfigurationResults.isEmpty()
|
|
|
|
|| !userConfigurationResults.isEmpty()
|
|
|
|
|| !userConfigurationResults.isEmpty())
|
|
|
|
? "revisiting the entries above or defining"
|
|
|
|
? "revisiting the entries above or defining" : "defining",
|
|
|
|
: "defining"),
|
|
|
|
|
|
|
|
getBeanDescription(cause));
|
|
|
|
getBeanDescription(cause));
|
|
|
|
return new FailureAnalysis(message.toString(), action, cause);
|
|
|
|
return new FailureAnalysis(message.toString(), action, cause);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -201,8 +200,8 @@ class NoSuchBeanDefinitionFailureAnalyzer
|
|
|
|
|
|
|
|
|
|
|
|
Source(String source) {
|
|
|
|
Source(String source) {
|
|
|
|
String[] tokens = source.split("#");
|
|
|
|
String[] tokens = source.split("#");
|
|
|
|
this.className = (tokens.length > 1 ? tokens[0] : source);
|
|
|
|
this.className = (tokens.length > 1) ? tokens[0] : source;
|
|
|
|
this.methodName = (tokens.length != 2 ? null : tokens[1]);
|
|
|
|
this.methodName = (tokens.length != 2) ? null : tokens[1];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public String getClassName() {
|
|
|
|
public String getClassName() {
|
|
|
@ -262,8 +261,8 @@ class NoSuchBeanDefinitionFailureAnalyzer
|
|
|
|
private boolean hasName(MethodMetadata methodMetadata, String name) {
|
|
|
|
private boolean hasName(MethodMetadata methodMetadata, String name) {
|
|
|
|
Map<String, Object> attributes = methodMetadata
|
|
|
|
Map<String, Object> attributes = methodMetadata
|
|
|
|
.getAnnotationAttributes(Bean.class.getName());
|
|
|
|
.getAnnotationAttributes(Bean.class.getName());
|
|
|
|
String[] candidates = (attributes != null ? (String[]) attributes.get("name")
|
|
|
|
String[] candidates = (attributes != null) ? (String[]) attributes.get("name")
|
|
|
|
: null);
|
|
|
|
: null;
|
|
|
|
if (candidates != null) {
|
|
|
|
if (candidates != null) {
|
|
|
|
for (String candidate : candidates) {
|
|
|
|
for (String candidate : candidates) {
|
|
|
|
if (candidate.equals(name)) {
|
|
|
|
if (candidate.equals(name)) {
|
|
|
|