Browse Source

use the annotation meta data in problem reporting

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@1266 50f2f4bb-b051-0410-bef5-90022cba6387
pull/1/head
Christian Dupuis 17 years ago
parent
commit
34b1a72a25
  1. 4
      org.springframework.context/src/main/java/org/springframework/context/annotation/ConfigurationClass.java
  2. 2
      org.springframework.context/src/main/java/org/springframework/context/annotation/ConfigurationClassMethod.java

4
org.springframework.context/src/main/java/org/springframework/context/annotation/ConfigurationClass.java

@ -144,7 +144,7 @@ final class ConfigurationClass { @@ -144,7 +144,7 @@ final class ConfigurationClass {
public FinalConfigurationProblem() {
super(String.format("@Configuration class '%s' may not be final. Remove the final modifier to continue.",
getSimpleName()), new Location(getResource()));
getSimpleName()), new Location(getResource(), ConfigurationClass.this));
}
}
@ -155,7 +155,7 @@ final class ConfigurationClass { @@ -155,7 +155,7 @@ final class ConfigurationClass {
public OverloadedMethodProblem(String methodName, int count) {
super(String.format("@Configuration class '%s' has %s overloaded factory methods of name '%s'. " +
"Only one factory method of the same name allowed.",
getSimpleName(), count, methodName), new Location(getResource()));
getSimpleName(), count, methodName), new Location(getResource(), ConfigurationClass.this));
}
}

2
org.springframework.context/src/main/java/org/springframework/context/annotation/ConfigurationClassMethod.java

@ -53,7 +53,7 @@ final class ConfigurationClassMethod { @@ -53,7 +53,7 @@ final class ConfigurationClassMethod {
}
public Location getResourceLocation() {
return new Location(this.declaringClass.getResource(), this.metadata.getMethodName());
return new Location(this.declaringClass.getResource(), metadata);
}
public void validate(ProblemReporter problemReporter) {

Loading…
Cancel
Save