Consistent descriptions for ConfigurationClass

Previously, a ConfigurationClass created from AnnotationMetadata
and a ConfigurationClass created from a class would have subtly
different descriptions. Given a class named com.example.Foo, the
former’s description would be “com.example.Foo”, whereas the latter’s
description would be “class com.example.Foo”.

This commit updates ConfigurationClass to make the description
consistent, preferring the description without “class” in it.

Closes gh-970
This commit is contained in:
Andy Wilkinson 2016-02-18 17:42:31 +00:00 committed by Stephane Nicoll
parent f33578ef0f
commit 65d144b1e5
1 changed files with 2 additions and 2 deletions

View File

@ -103,7 +103,7 @@ final class ConfigurationClass {
public ConfigurationClass(Class<?> clazz, String beanName) {
Assert.hasText(beanName, "Bean name must not be null");
this.metadata = new StandardAnnotationMetadata(clazz, true);
this.resource = new DescriptiveResource(clazz.toString());
this.resource = new DescriptiveResource(clazz.getName());
this.beanName = beanName;
}
@ -117,7 +117,7 @@ final class ConfigurationClass {
*/
public ConfigurationClass(Class<?> clazz, ConfigurationClass importedBy) {
this.metadata = new StandardAnnotationMetadata(clazz, true);
this.resource = new DescriptiveResource(clazz.toString());
this.resource = new DescriptiveResource(clazz.getName());
this.importedBy.add(importedBy);
}