1
1
/*
2
- * Copyright 2002-2014 the original author or authors.
2
+ * Copyright 2002-2016 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
17
17
package org .springframework .beans .factory ;
18
18
19
19
import org .springframework .beans .BeansException ;
20
+ import org .springframework .util .ClassUtils ;
20
21
import org .springframework .util .StringUtils ;
21
22
22
23
/**
@@ -74,7 +75,7 @@ public NoSuchBeanDefinitionException(Class<?> type) {
74
75
* @param message detailed message describing the problem
75
76
*/
76
77
public NoSuchBeanDefinitionException (Class <?> type , String message ) {
77
- super ("No qualifying bean of type [" + type . getName ( ) + "] is defined: " + message );
78
+ super ("No qualifying bean of type [" + ClassUtils . getQualifiedName ( type ) + "] is defined: " + message );
78
79
this .beanType = type ;
79
80
}
80
81
@@ -85,7 +86,8 @@ public NoSuchBeanDefinitionException(Class<?> type, String message) {
85
86
* @param message detailed message describing the problem
86
87
*/
87
88
public NoSuchBeanDefinitionException (Class <?> type , String dependencyDescription , String message ) {
88
- super ("No qualifying bean of type [" + type .getName () + "] found for dependency" +
89
+ super ("No qualifying bean" + (!StringUtils .hasLength (dependencyDescription ) ?
90
+ " of type [" + ClassUtils .getQualifiedName (type ) + "]" : "" ) + " found for dependency" +
89
91
(StringUtils .hasLength (dependencyDescription ) ? " [" + dependencyDescription + "]" : "" ) +
90
92
": " + message );
91
93
this .beanType = type ;
0 commit comments