Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
b6b880ce
S
spring-framework
项目概览
爱吃血肠
/
spring-framework
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-framework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
b6b880ce
编写于
9月 19, 2018
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
上级
7481d734
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
13 deletion
+22
-13
spring-beans/src/main/java/org/springframework/beans/BeanUtils.java
...ns/src/main/java/org/springframework/beans/BeanUtils.java
+1
-2
spring-beans/src/main/java/org/springframework/beans/factory/support/DisposableBeanAdapter.java
...ramework/beans/factory/support/DisposableBeanAdapter.java
+1
-1
spring-context/src/main/java/org/springframework/context/support/GenericApplicationContext.java
...gframework/context/support/GenericApplicationContext.java
+2
-2
spring-context/src/test/java/org/springframework/context/annotation/AnnotationConfigApplicationContextTests.java
...t/annotation/AnnotationConfigApplicationContextTests.java
+18
-8
未找到文件。
spring-beans/src/main/java/org/springframework/beans/BeanUtils.java
浏览文件 @
b6b880ce
...
...
@@ -403,8 +403,7 @@ public abstract class BeanUtils {
/**
* Retrieve the JavaBeans {@code PropertyDescriptor}s of a given
* class.
* Retrieve the JavaBeans {@code PropertyDescriptor}s of a given class.
* @param clazz the Class to retrieve the PropertyDescriptors for
* @return an array of {@code PropertyDescriptors} for the given class
* @throws BeansException if PropertyDescriptor look fails
...
...
spring-beans/src/main/java/org/springframework/beans/factory/support/DisposableBeanAdapter.java
浏览文件 @
b6b880ce
...
...
@@ -115,7 +115,7 @@ class DisposableBeanAdapter implements DisposableBean, Runnable, Serializable {
this
.
destroyMethod
=
determineDestroyMethod
(
destroyMethodName
);
if
(
this
.
destroyMethod
==
null
)
{
if
(
beanDefinition
.
isEnforceDestroyMethod
())
{
throw
new
BeanDefinitionValidationException
(
"Could
n'
t find a destroy method named '"
+
throw
new
BeanDefinitionValidationException
(
"Could
no
t find a destroy method named '"
+
destroyMethodName
+
"' on bean with name '"
+
beanName
+
"'"
);
}
}
...
...
spring-context/src/main/java/org/springframework/context/support/GenericApplicationContext.java
浏览文件 @
b6b880ce
...
...
@@ -381,8 +381,8 @@ public class GenericApplicationContext extends AbstractApplicationContext implem
* @param beanName the name of the bean (may be {@code null})
* @param beanClass the class of the bean (resolving a public constructor
* to be autowired, possibly simply the default constructor)
* @param customizers one or more callbacks for customizing the
*
factory's
{@link BeanDefinition}, e.g. setting a lazy-init or primary flag
* @param customizers one or more callbacks for customizing the
factory's
* {@link BeanDefinition}, e.g. setting a lazy-init or primary flag
* @since 5.0
* @see #registerBean(String, Class, Supplier, BeanDefinitionCustomizer...)
*/
...
...
spring-context/src/test/java/org/springframework/context/annotation/AnnotationConfigApplicationContextTests.java
浏览文件 @
b6b880ce
...
...
@@ -105,6 +105,24 @@ public class AnnotationConfigApplicationContextTests {
}
}
@Test
public
void
getBeanByTypeAmbiguityRaisesException
()
{
ApplicationContext
context
=
new
AnnotationConfigApplicationContext
(
TwoTestBeanConfig
.
class
);
try
{
context
.
getBean
(
TestBean
.
class
);
}
catch
(
NoSuchBeanDefinitionException
ex
)
{
assertThat
(
ex
.
getMessage
(),
allOf
(
containsString
(
"No qualifying bean of type '"
+
TestBean
.
class
.
getName
()
+
"'"
),
containsString
(
"tb1"
),
containsString
(
"tb2"
)
)
);
}
}
/**
* Tests that Configuration classes are registered according to convention
* @see org.springframework.beans.factory.support.DefaultBeanNameGenerator#generateBeanName
...
...
@@ -370,14 +388,6 @@ public class AnnotationConfigApplicationContextTests {
}
}
static
class
ConfigMissingAnnotation
{
@Bean
public
TestBean
testBean
()
{
return
new
TestBean
();
}
}
@Configuration
static
class
TwoTestBeanConfig
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录