Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
普通程序员一名
spring-framework
提交
6c14eaad
S
spring-framework
项目概览
普通程序员一名
/
spring-framework
与 Fork 源项目一致
从无法访问的项目Fork
通知
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,发现更多精彩内容 >>
提交
6c14eaad
编写于
12月 18, 2012
作者:
P
Phillip Webb
提交者:
Chris Beams
12月 28, 2012
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix [cast] compiler warnings
上级
b0986049
变更
63
隐藏空白更改
内联
并排
Showing
63 changed file
with
122 addition
and
122 deletion
+122
-122
spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAdviceParameterNameDiscoverer.java
...ork/aop/aspectj/AspectJAdviceParameterNameDiscoverer.java
+1
-1
spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJAwareAdvisorAutoProxyCreator.java
...spectj/autoproxy/AspectJAwareAdvisorAutoProxyCreator.java
+1
-1
spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactoryTests.java
...spectj/annotation/AbstractAspectJAdvisorFactoryTests.java
+1
-1
spring-aspects/src/main/java/org/springframework/mock/staticmock/AbstractMethodMockingControl.aj
...framework/mock/staticmock/AbstractMethodMockingControl.aj
+1
-1
spring-beans/src/main/java/org/springframework/beans/ExtendedBeanInfo.java
...main/java/org/springframework/beans/ExtendedBeanInfo.java
+1
-1
spring-beans/src/main/java/org/springframework/beans/factory/config/CustomEditorConfigurer.java
...ramework/beans/factory/config/CustomEditorConfigurer.java
+1
-1
spring-beans/src/test/java/org/springframework/beans/BeanWrapperTests.java
...test/java/org/springframework/beans/BeanWrapperTests.java
+9
-9
spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
...mework/beans/factory/DefaultListableBeanFactoryTests.java
+2
-2
spring-beans/src/test/java/org/springframework/beans/factory/config/ObjectFactoryCreatingFactoryBeanTests.java
...factory/config/ObjectFactoryCreatingFactoryBeanTests.java
+1
-1
spring-beans/src/test/java/org/springframework/beans/factory/config/PropertiesFactoryBeanTests.java
...work/beans/factory/config/PropertiesFactoryBeanTests.java
+8
-8
spring-beans/src/test/java/org/springframework/beans/factory/support/ManagedListTests.java
...ringframework/beans/factory/support/ManagedListTests.java
+3
-3
spring-beans/src/test/java/org/springframework/beans/factory/support/ManagedSetTests.java
...pringframework/beans/factory/support/ManagedSetTests.java
+3
-3
spring-context-support/src/test/java/org/springframework/scheduling/quartz/QuartzSupportTests.java
...springframework/scheduling/quartz/QuartzSupportTests.java
+7
-7
spring-context/src/main/java/org/springframework/instrument/classloading/websphere/WebSphereClassLoaderAdapter.java
...t/classloading/websphere/WebSphereClassLoaderAdapter.java
+1
-1
spring-context/src/main/java/org/springframework/validation/AbstractErrors.java
...n/java/org/springframework/validation/AbstractErrors.java
+1
-1
spring-context/src/test/java/org/springframework/aop/aspectj/AfterReturningAdviceBindingTests.java
...amework/aop/aspectj/AfterReturningAdviceBindingTests.java
+1
-1
spring-context/src/test/java/org/springframework/context/AbstractApplicationContextTests.java
...ingframework/context/AbstractApplicationContextTests.java
+1
-1
spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractJmxAssemblerTests.java
...ework/jmx/export/assembler/AbstractJmxAssemblerTests.java
+2
-2
spring-context/src/test/java/org/springframework/jmx/support/MBeanServerConnectionFactoryBeanTests.java
...rk/jmx/support/MBeanServerConnectionFactoryBeanTests.java
+3
-3
spring-context/src/test/java/org/springframework/scheduling/config/ScheduledTasksBeanDefinitionParserTests.java
...uling/config/ScheduledTasksBeanDefinitionParserTests.java
+1
-1
spring-context/src/test/java/org/springframework/scheduling/timer/TimerSupportTests.java
...g/springframework/scheduling/timer/TimerSupportTests.java
+1
-1
spring-core/src/main/java/org/springframework/core/GenericCollectionTypeResolver.java
...g/springframework/core/GenericCollectionTypeResolver.java
+2
-2
spring-core/src/main/java/org/springframework/core/annotation/AnnotationAttributes.java
...springframework/core/annotation/AnnotationAttributes.java
+1
-1
spring-core/src/test/java/org/springframework/core/convert/support/CollectionToCollectionConverterTests.java
...convert/support/CollectionToCollectionConverterTests.java
+2
-2
spring-core/src/test/java/org/springframework/core/convert/support/DefaultConversionTests.java
...ramework/core/convert/support/DefaultConversionTests.java
+1
-1
spring-core/src/test/java/org/springframework/core/type/AnnotationMetadataTests.java
...rg/springframework/core/type/AnnotationMetadataTests.java
+1
-1
spring-expression/src/test/java/org/springframework/expression/spel/EvaluationTests.java
.../org/springframework/expression/spel/EvaluationTests.java
+1
-1
spring-expression/src/test/java/org/springframework/expression/spel/ParsingTests.java
...ava/org/springframework/expression/spel/ParsingTests.java
+1
-1
spring-jdbc/src/main/java/org/springframework/jdbc/datasource/lookup/BeanFactoryDataSourceLookup.java
...k/jdbc/datasource/lookup/BeanFactoryDataSourceLookup.java
+1
-1
spring-jdbc/src/test/java/org/springframework/jdbc/object/SqlQueryTests.java
...t/java/org/springframework/jdbc/object/SqlQueryTests.java
+3
-3
spring-jdbc/src/test/java/org/springframework/jdbc/support/SQLErrorCodesFactoryTests.java
...ringframework/jdbc/support/SQLErrorCodesFactoryTests.java
+1
-1
spring-jms/src/main/java/org/springframework/jms/support/destination/BeanFactoryDestinationResolver.java
...s/support/destination/BeanFactoryDestinationResolver.java
+1
-1
spring-orm/src/main/java/org/springframework/orm/hibernate3/HibernateAccessor.java
...org/springframework/orm/hibernate3/HibernateAccessor.java
+1
-1
spring-orm/src/test/java/org/springframework/orm/jpa/support/OpenEntityManagerInViewTests.java
...amework/orm/jpa/support/OpenEntityManagerInViewTests.java
+4
-4
spring-orm/src/test/java/org/springframework/orm/jpa/support/PersistenceInjectionTests.java
...gframework/orm/jpa/support/PersistenceInjectionTests.java
+11
-11
spring-orm/src/test/java/org/springframework/orm/jpa/support/SharedEntityManagerFactoryTests.java
...work/orm/jpa/support/SharedEntityManagerFactoryTests.java
+1
-1
spring-oxm/src/test/java/org/springframework/oxm/castor/CastorUnmarshallerTests.java
...g/springframework/oxm/castor/CastorUnmarshallerTests.java
+3
-3
spring-struts/src/main/java/org/springframework/web/struts/DelegatingActionProxy.java
...org/springframework/web/struts/DelegatingActionProxy.java
+1
-1
spring-struts/src/main/java/org/springframework/web/struts/DelegatingRequestProcessor.java
...pringframework/web/struts/DelegatingRequestProcessor.java
+1
-1
spring-struts/src/main/java/org/springframework/web/struts/DelegatingTilesRequestProcessor.java
...framework/web/struts/DelegatingTilesRequestProcessor.java
+1
-1
spring-test-mvc/src/main/java/org/springframework/test/web/servlet/result/FlashAttributeResultMatchers.java
...test/web/servlet/result/FlashAttributeResultMatchers.java
+1
-1
spring-test/src/main/java/org/springframework/mock/web/portlet/MockPortletRequest.java
.../springframework/mock/web/portlet/MockPortletRequest.java
+1
-1
spring-tx/src/test/java/org/springframework/jca/cci/CciTemplateTests.java
...st/java/org/springframework/jca/cci/CciTemplateTests.java
+1
-1
spring-web/src/main/java/org/springframework/http/converter/json/MappingJackson2HttpMessageConverter.java
...p/converter/json/MappingJackson2HttpMessageConverter.java
+1
-1
spring-web/src/main/java/org/springframework/http/converter/json/MappingJacksonHttpMessageConverter.java
...tp/converter/json/MappingJacksonHttpMessageConverter.java
+1
-1
spring-web/src/main/java/org/springframework/web/bind/UnsatisfiedServletRequestParameterException.java
...web/bind/UnsatisfiedServletRequestParameterException.java
+1
-1
spring-web/src/main/java/org/springframework/web/context/support/HttpRequestHandlerServlet.java
...mework/web/context/support/HttpRequestHandlerServlet.java
+2
-2
spring-web/src/main/java/org/springframework/web/util/HtmlUtils.java
...src/main/java/org/springframework/web/util/HtmlUtils.java
+1
-1
spring-web/src/test/java/org/springframework/http/converter/xml/Jaxb2RootElementHttpMessageConverterTest.java
...nverter/xml/Jaxb2RootElementHttpMessageConverterTest.java
+3
-3
spring-webmvc-portlet/src/test/java/org/springframework/context/AbstractApplicationContextTests.java
...ingframework/context/AbstractApplicationContextTests.java
+1
-1
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/AbstractMessageConverterMethodArgumentResolver.java
...ation/AbstractMessageConverterMethodArgumentResolver.java
+1
-1
spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/CheckboxTag.java
...rg/springframework/web/servlet/tags/form/CheckboxTag.java
+1
-1
spring-webmvc/src/main/java/org/springframework/web/servlet/view/BeanNameViewResolver.java
...pringframework/web/servlet/view/BeanNameViewResolver.java
+1
-1
spring-webmvc/src/main/java/org/springframework/web/servlet/view/XmlViewResolver.java
...org/springframework/web/servlet/view/XmlViewResolver.java
+1
-1
spring-webmvc/src/test/java/org/springframework/web/context/AbstractApplicationContextTests.java
...ramework/web/context/AbstractApplicationContextTests.java
+1
-1
spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/ServletAnnotationControllerTests.java
...vlet/mvc/annotation/ServletAnnotationControllerTests.java
+1
-1
spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ServletAnnotationControllerHandlerMethodTests.java
...tation/ServletAnnotationControllerHandlerMethodTests.java
+1
-1
spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/RadioButtonTagTests.java
...gframework/web/servlet/tags/form/RadioButtonTagTests.java
+1
-1
spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/SelectTagTests.java
...springframework/web/servlet/tags/form/SelectTagTests.java
+2
-2
spring-webmvc/src/test/java/org/springframework/web/servlet/view/BaseViewTests.java
...a/org/springframework/web/servlet/view/BaseViewTests.java
+1
-1
spring-webmvc/src/test/java/org/springframework/web/servlet/view/InternalResourceViewTests.java
...framework/web/servlet/view/InternalResourceViewTests.java
+5
-5
spring-webmvc/src/test/java/org/springframework/web/servlet/view/freemarker/FreeMarkerConfigurerTests.java
...eb/servlet/view/freemarker/FreeMarkerConfigurerTests.java
+2
-2
spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/VelocityConfigurerTests.java
...rk/web/servlet/view/velocity/VelocityConfigurerTests.java
+3
-3
未找到文件。
spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAdviceParameterNameDiscoverer.java
浏览文件 @
6c14eaad
...
...
@@ -700,7 +700,7 @@ public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscov
// 1 primitive arg, and one candidate...
for
(
int
i
=
0
;
i
<
this
.
argumentTypes
.
length
;
i
++)
{
if
(
isUnbound
(
i
)
&&
this
.
argumentTypes
[
i
].
isPrimitive
())
{
bindParameterName
(
i
,
(
String
)
varNames
.
get
(
0
));
bindParameterName
(
i
,
varNames
.
get
(
0
));
break
;
}
}
...
...
spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJAwareAdvisorAutoProxyCreator.java
浏览文件 @
6c14eaad
...
...
@@ -77,7 +77,7 @@ public class AspectJAwareAdvisorAutoProxyCreator extends AbstractAdvisorAutoProx
// sort it
List
<
PartiallyComparableAdvisorHolder
>
sorted
=
(
List
<
PartiallyComparableAdvisorHolder
>)
PartialOrder
.
sort
(
partiallyComparableAdvisors
);
PartialOrder
.
sort
(
partiallyComparableAdvisors
);
if
(
sorted
==
null
)
{
// TODO: work harder to give a better error message here.
throw
new
IllegalArgumentException
(
"Advice precedence circularity error"
);
...
...
spring-aop/src/test/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactoryTests.java
浏览文件 @
6c14eaad
...
...
@@ -386,7 +386,7 @@ public abstract class AbstractAspectJAdvisorFactoryTests {
),
CannotBeUnlocked
.
class
);
assertTrue
(
proxy
instanceof
Lockable
);
Lockable
lockable
=
(
Lockable
)
proxy
;
Lockable
lockable
=
proxy
;
assertTrue
(
"Already locked"
,
lockable
.
locked
());
lockable
.
lock
();
assertTrue
(
"Real target ignores locking"
,
lockable
.
locked
());
...
...
spring-aspects/src/main/java/org/springframework/mock/staticmock/AbstractMethodMockingControl.aj
浏览文件 @
6c14eaad
...
...
@@ -114,7 +114,7 @@ public abstract aspect AbstractMethodMockingControl percflow(mockStaticsTestMeth
if
(
responseType
==
CallResponse
.
return_
)
{
return
call
.
returnValue
(
lastSig
,
args
);
}
else
if
(
responseType
==
CallResponse
.
throw_
)
{
return
(
RuntimeException
)
call
.
throwException
(
lastSig
,
args
);
return
call
.
throwException
(
lastSig
,
args
);
}
else
if
(
responseType
==
CallResponse
.
nothing
)
{
//
do
nothing
}
...
...
spring-beans/src/main/java/org/springframework/beans/ExtendedBeanInfo.java
浏览文件 @
6c14eaad
...
...
@@ -495,7 +495,7 @@ class PropertyDescriptorUtils {
// copy all attributes (emulating behavior of private FeatureDescriptor#addTable)
Enumeration
<
String
>
keys
=
source
.
attributeNames
();
while
(
keys
.
hasMoreElements
())
{
String
key
=
(
String
)
keys
.
nextElement
();
String
key
=
keys
.
nextElement
();
target
.
setValue
(
key
,
source
.
getValue
(
key
));
}
...
...
spring-beans/src/main/java/org/springframework/beans/factory/config/CustomEditorConfigurer.java
浏览文件 @
6c14eaad
...
...
@@ -197,7 +197,7 @@ public class CustomEditorConfigurer implements BeanFactoryPostProcessor, BeanCla
else
if
(
value
instanceof
String
)
{
Class
editorClass
=
ClassUtils
.
forName
((
String
)
value
,
this
.
beanClassLoader
);
Assert
.
isAssignable
(
PropertyEditor
.
class
,
editorClass
);
beanFactory
.
registerCustomEditor
(
requiredType
,
(
Class
<?
extends
PropertyEditor
>)
editorClass
);
beanFactory
.
registerCustomEditor
(
requiredType
,
editorClass
);
}
else
{
throw
new
IllegalArgumentException
(
"Mapped value ["
+
value
+
"] for custom editor key ["
+
...
...
spring-beans/src/test/java/org/springframework/beans/BeanWrapperTests.java
浏览文件 @
6c14eaad
...
...
@@ -995,15 +995,15 @@ public final class BeanWrapperTests {
bw
.
setPropertyValues
(
pvs
);
assertEquals
(
tb5
,
bean
.
getArray
()[
0
]);
assertEquals
(
tb4
,
bean
.
getArray
()[
1
]);
assertEquals
(
tb3
,
(
(
TestBean
)
bean
.
getList
().
get
(
0
)));
assertEquals
(
tb2
,
(
(
TestBean
)
bean
.
getList
().
get
(
1
)));
assertEquals
(
tb0
,
(
(
TestBean
)
bean
.
getList
().
get
(
2
)));
assertEquals
(
null
,
(
(
TestBean
)
bean
.
getList
().
get
(
3
)));
assertEquals
(
tb1
,
(
(
TestBean
)
bean
.
getList
().
get
(
4
)));
assertEquals
(
tb1
,
(
(
TestBean
)
bean
.
getMap
().
get
(
"key1"
)));
assertEquals
(
tb0
,
(
(
TestBean
)
bean
.
getMap
().
get
(
"key2"
)));
assertEquals
(
tb4
,
(
(
TestBean
)
bean
.
getMap
().
get
(
"key5"
)));
assertEquals
(
tb5
,
(
(
TestBean
)
bean
.
getMap
().
get
(
"key9"
)));
assertEquals
(
tb3
,
(
bean
.
getList
().
get
(
0
)));
assertEquals
(
tb2
,
(
bean
.
getList
().
get
(
1
)));
assertEquals
(
tb0
,
(
bean
.
getList
().
get
(
2
)));
assertEquals
(
null
,
(
bean
.
getList
().
get
(
3
)));
assertEquals
(
tb1
,
(
bean
.
getList
().
get
(
4
)));
assertEquals
(
tb1
,
(
bean
.
getMap
().
get
(
"key1"
)));
assertEquals
(
tb0
,
(
bean
.
getMap
().
get
(
"key2"
)));
assertEquals
(
tb4
,
(
bean
.
getMap
().
get
(
"key5"
)));
assertEquals
(
tb5
,
(
bean
.
getMap
().
get
(
"key9"
)));
assertEquals
(
tb5
,
bw
.
getPropertyValue
(
"array[0]"
));
assertEquals
(
tb4
,
bw
.
getPropertyValue
(
"array[1]"
));
assertEquals
(
tb3
,
bw
.
getPropertyValue
(
"list[0]"
));
...
...
spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
浏览文件 @
6c14eaad
...
...
@@ -497,7 +497,7 @@ public class DefaultListableBeanFactoryTests {
int
count
=
(
new
PropertiesBeanDefinitionReader
(
lbf
)).
registerBeanDefinitions
(
p
,
PREFIX
);
assertTrue
(
"2 beans registered, not "
+
count
,
count
==
2
);
TestBean
kerry
=
(
TestBean
)
lbf
.
getBean
(
"kerry"
,
TestBean
.
class
);
TestBean
kerry
=
lbf
.
getBean
(
"kerry"
,
TestBean
.
class
);
assertTrue
(
"Kerry name is Kerry"
,
"Kerry"
.
equals
(
kerry
.
getName
()));
ITestBean
spouse
=
kerry
.
getSpouse
();
assertTrue
(
"Kerry spouse is non null"
,
spouse
!=
null
);
...
...
@@ -516,7 +516,7 @@ public class DefaultListableBeanFactoryTests {
assertTrue
(
"1 beans registered, not "
+
count
,
count
==
1
);
assertEquals
(
1
,
lbf
.
getBeanDefinitionCount
());
TestBean
tb
=
(
TestBean
)
lbf
.
getBean
(
"tb"
,
TestBean
.
class
);
TestBean
tb
=
lbf
.
getBean
(
"tb"
,
TestBean
.
class
);
assertEquals
(
"my.value"
,
tb
.
getSomeMap
().
get
(
"my.key"
));
}
...
...
spring-beans/src/test/java/org/springframework/beans/factory/config/ObjectFactoryCreatingFactoryBeanTests.java
浏览文件 @
6c14eaad
...
...
@@ -113,7 +113,7 @@ public class ObjectFactoryCreatingFactoryBeanTests {
factory
.
setTargetBeanName
(
targetBeanName
);
factory
.
setBeanFactory
(
beanFactory
);
factory
.
afterPropertiesSet
();
ObjectFactory
<?>
objectFactory
=
(
ObjectFactory
<?>)
factory
.
getObject
();
ObjectFactory
<?>
objectFactory
=
factory
.
getObject
();
Object
actualSingleton
=
objectFactory
.
getObject
();
assertSame
(
expectedSingleton
,
actualSingleton
);
...
...
spring-beans/src/test/java/org/springframework/beans/factory/config/PropertiesFactoryBeanTests.java
浏览文件 @
6c14eaad
...
...
@@ -42,7 +42,7 @@ public final class PropertiesFactoryBeanTests {
PropertiesFactoryBean
pfb
=
new
PropertiesFactoryBean
();
pfb
.
setLocation
(
TEST_PROPS
);
pfb
.
afterPropertiesSet
();
Properties
props
=
(
Properties
)
pfb
.
getObject
();
Properties
props
=
pfb
.
getObject
();
assertEquals
(
"99"
,
props
.
getProperty
(
"tb.array[0].age"
));
}
...
...
@@ -51,7 +51,7 @@ public final class PropertiesFactoryBeanTests {
PropertiesFactoryBean
pfb
=
new
PropertiesFactoryBean
();
pfb
.
setLocation
(
TEST_PROPS_XML
);
pfb
.
afterPropertiesSet
();
Properties
props
=
(
Properties
)
pfb
.
getObject
();
Properties
props
=
pfb
.
getObject
();
assertEquals
(
"99"
,
props
.
getProperty
(
"tb.array[0].age"
));
}
...
...
@@ -62,7 +62,7 @@ public final class PropertiesFactoryBeanTests {
localProps
.
setProperty
(
"key2"
,
"value2"
);
pfb
.
setProperties
(
localProps
);
pfb
.
afterPropertiesSet
();
Properties
props
=
(
Properties
)
pfb
.
getObject
();
Properties
props
=
pfb
.
getObject
();
assertEquals
(
"value2"
,
props
.
getProperty
(
"key2"
));
}
...
...
@@ -75,7 +75,7 @@ public final class PropertiesFactoryBeanTests {
localProps
.
setProperty
(
"tb.array[0].age"
,
"0"
);
pfb
.
setProperties
(
localProps
);
pfb
.
afterPropertiesSet
();
Properties
props
=
(
Properties
)
pfb
.
getObject
();
Properties
props
=
pfb
.
getObject
();
assertEquals
(
"99"
,
props
.
getProperty
(
"tb.array[0].age"
));
assertEquals
(
"value2"
,
props
.
getProperty
(
"key2"
));
}
...
...
@@ -100,7 +100,7 @@ public final class PropertiesFactoryBeanTests {
pfb
.
setPropertiesArray
(
new
Properties
[]
{
props1
,
props2
,
props3
});
pfb
.
afterPropertiesSet
();
Properties
props
=
(
Properties
)
pfb
.
getObject
();
Properties
props
=
pfb
.
getObject
();
assertEquals
(
"99"
,
props
.
getProperty
(
"tb.array[0].age"
));
assertEquals
(
"value2"
,
props
.
getProperty
(
"key2"
));
assertEquals
(
"framework"
,
props
.
getProperty
(
"spring"
));
...
...
@@ -119,7 +119,7 @@ public final class PropertiesFactoryBeanTests {
pfb
.
setProperties
(
localProps
);
pfb
.
setLocalOverride
(
true
);
pfb
.
afterPropertiesSet
();
Properties
props
=
(
Properties
)
pfb
.
getObject
();
Properties
props
=
pfb
.
getObject
();
assertEquals
(
"0"
,
props
.
getProperty
(
"tb.array[0].age"
));
assertEquals
(
"value2"
,
props
.
getProperty
(
"key2"
));
}
...
...
@@ -133,10 +133,10 @@ public final class PropertiesFactoryBeanTests {
localProps
.
setProperty
(
"key2"
,
"value2"
);
pfb
.
setProperties
(
localProps
);
pfb
.
afterPropertiesSet
();
Properties
props
=
(
Properties
)
pfb
.
getObject
();
Properties
props
=
pfb
.
getObject
();
assertEquals
(
"99"
,
props
.
getProperty
(
"tb.array[0].age"
));
assertEquals
(
"value2"
,
props
.
getProperty
(
"key2"
));
Properties
newProps
=
(
Properties
)
pfb
.
getObject
();
Properties
newProps
=
pfb
.
getObject
();
assertTrue
(
props
!=
newProps
);
assertEquals
(
"99"
,
newProps
.
getProperty
(
"tb.array[0].age"
));
assertEquals
(
"value2"
,
newProps
.
getProperty
(
"key2"
));
...
...
spring-beans/src/test/java/org/springframework/beans/factory/support/ManagedListTests.java
浏览文件 @
6c14eaad
...
...
@@ -33,7 +33,7 @@ public class ManagedListTests extends TestCase {
ManagedList
child
=
new
ManagedList
();
child
.
add
(
"three"
);
child
.
setMergeEnabled
(
true
);
List
mergedList
=
(
List
)
child
.
merge
(
parent
);
List
mergedList
=
child
.
merge
(
parent
);
assertEquals
(
"merge() obviously did not work."
,
3
,
mergedList
.
size
());
}
...
...
@@ -72,7 +72,7 @@ public class ManagedListTests extends TestCase {
parent
.
add
(
"two"
);
ManagedList
child
=
new
ManagedList
();
child
.
setMergeEnabled
(
true
);
List
mergedList
=
(
List
)
child
.
merge
(
parent
);
List
mergedList
=
child
.
merge
(
parent
);
assertEquals
(
"merge() obviously did not work."
,
2
,
mergedList
.
size
());
}
...
...
@@ -84,7 +84,7 @@ public class ManagedListTests extends TestCase {
ManagedList
child
=
new
ManagedList
();
child
.
add
(
"one"
);
child
.
setMergeEnabled
(
true
);
List
mergedList
=
(
List
)
child
.
merge
(
parent
);
List
mergedList
=
child
.
merge
(
parent
);
assertEquals
(
"merge() obviously did not work."
,
3
,
mergedList
.
size
());
}
...
...
spring-beans/src/test/java/org/springframework/beans/factory/support/ManagedSetTests.java
浏览文件 @
6c14eaad
...
...
@@ -33,7 +33,7 @@ public class ManagedSetTests extends TestCase {
ManagedSet
child
=
new
ManagedSet
();
child
.
add
(
"three"
);
child
.
setMergeEnabled
(
true
);
Set
mergedSet
=
(
Set
)
child
.
merge
(
parent
);
Set
mergedSet
=
child
.
merge
(
parent
);
assertEquals
(
"merge() obviously did not work."
,
3
,
mergedSet
.
size
());
}
...
...
@@ -72,7 +72,7 @@ public class ManagedSetTests extends TestCase {
parent
.
add
(
"two"
);
ManagedSet
child
=
new
ManagedSet
();
child
.
setMergeEnabled
(
true
);
Set
mergedSet
=
(
Set
)
child
.
merge
(
parent
);
Set
mergedSet
=
child
.
merge
(
parent
);
assertEquals
(
"merge() obviously did not work."
,
2
,
mergedSet
.
size
());
}
...
...
@@ -84,7 +84,7 @@ public class ManagedSetTests extends TestCase {
ManagedSet
child
=
new
ManagedSet
();
child
.
add
(
"one"
);
child
.
setMergeEnabled
(
true
);
Set
mergedSet
=
(
Set
)
child
.
merge
(
parent
);
Set
mergedSet
=
child
.
merge
(
parent
);
assertEquals
(
"merge() obviously did not work."
,
2
,
mergedSet
.
size
());
}
...
...
spring-context-support/src/test/java/org/springframework/scheduling/quartz/QuartzSupportTests.java
浏览文件 @
6c14eaad
...
...
@@ -118,7 +118,7 @@ public class QuartzSupportTests {
}
mijdfb
.
setTargetMethod
(
"doSomething"
);
mijdfb
.
afterPropertiesSet
();
JobDetail
jobDetail1
=
(
JobDetail
)
mijdfb
.
getObject
();
JobDetail
jobDetail1
=
mijdfb
.
getObject
();
SimpleTriggerBean
trigger1
=
new
SimpleTriggerBean
();
trigger1
.
setBeanName
(
"myTrigger1"
);
...
...
@@ -210,7 +210,7 @@ public class QuartzSupportTests {
mijdfb
.
setTargetObject
(
task1
);
mijdfb
.
setTargetMethod
(
"doSomething"
);
mijdfb
.
afterPropertiesSet
();
JobDetail
jobDetail1
=
(
JobDetail
)
mijdfb
.
getObject
();
JobDetail
jobDetail1
=
mijdfb
.
getObject
();
SimpleTriggerBean
trigger1
=
new
SimpleTriggerBean
();
trigger1
.
setBeanName
(
"myTrigger1"
);
...
...
@@ -304,7 +304,7 @@ public class QuartzSupportTests {
mijdfb
.
setTargetObject
(
task1
);
mijdfb
.
setTargetMethod
(
"doSomething"
);
mijdfb
.
afterPropertiesSet
();
JobDetail
jobDetail1
=
(
JobDetail
)
mijdfb
.
getObject
();
JobDetail
jobDetail1
=
mijdfb
.
getObject
();
SimpleTriggerBean
trigger1
=
new
SimpleTriggerBean
();
trigger1
.
setBeanName
(
"myTrigger1"
);
...
...
@@ -446,7 +446,7 @@ public class QuartzSupportTests {
mijdfb
.
setTargetObject
(
task1
);
mijdfb
.
setTargetMethod
(
"doWait"
);
mijdfb
.
afterPropertiesSet
();
JobDetail
jobDetail1
=
(
JobDetail
)
mijdfb
.
getObject
();
JobDetail
jobDetail1
=
mijdfb
.
getObject
();
SimpleTriggerBean
trigger0
=
new
SimpleTriggerBean
();
trigger0
.
setBeanName
(
"myTrigger1"
);
...
...
@@ -532,7 +532,7 @@ public class QuartzSupportTests {
mijdfb
.
setTargetObject
(
task1
);
mijdfb
.
setTargetMethod
(
"doSomething"
);
mijdfb
.
afterPropertiesSet
();
JobDetail
jobDetail1
=
(
JobDetail
)
mijdfb
.
getObject
();
JobDetail
jobDetail1
=
mijdfb
.
getObject
();
SimpleTrigger
trigger1
=
new
SimpleTrigger
();
trigger1
.
setName
(
"myTrigger1"
);
...
...
@@ -618,7 +618,7 @@ public class QuartzSupportTests {
try
{
schedulerFactoryBean
.
afterPropertiesSet
();
schedulerFactoryBean
.
start
();
Scheduler
returnedScheduler
=
(
Scheduler
)
schedulerFactoryBean
.
getObject
();
Scheduler
returnedScheduler
=
schedulerFactoryBean
.
getObject
();
assertEquals
(
tb
,
returnedScheduler
.
getContext
().
get
(
"testBean"
));
assertEquals
(
ac
,
returnedScheduler
.
getContext
().
get
(
"appCtx"
));
}
...
...
@@ -659,7 +659,7 @@ public class QuartzSupportTests {
mijdfb
.
setTargetMethod
(
"doSomething"
);
mijdfb
.
setJobListenerNames
(
names
);
mijdfb
.
afterPropertiesSet
();
JobDetail
jobDetail
=
(
JobDetail
)
mijdfb
.
getObject
();
JobDetail
jobDetail
=
mijdfb
.
getObject
();
List
result
=
Arrays
.
asList
(
jobDetail
.
getJobListenerNames
());
assertEquals
(
Arrays
.
asList
(
names
),
result
);
}
...
...
spring-context/src/main/java/org/springframework/instrument/classloading/websphere/WebSphereClassLoaderAdapter.java
浏览文件 @
6c14eaad
...
...
@@ -93,7 +93,7 @@ class WebSphereClassLoaderAdapter {
public
ClassLoader
getThrowawayClassLoader
()
{
try
{
ClassLoader
loader
=
(
ClassLoader
)
cloneConstructor
.
newInstance
(
getClassLoader
());
ClassLoader
loader
=
cloneConstructor
.
newInstance
(
getClassLoader
());
// clear out the transformers (copied as well)
List
<?>
list
=
(
List
<?>)
transformerList
.
get
(
loader
);
list
.
clear
();
...
...
spring-context/src/main/java/org/springframework/validation/AbstractErrors.java
浏览文件 @
6c14eaad
...
...
@@ -186,7 +186,7 @@ public abstract class AbstractErrors implements Errors, Serializable {
public
FieldError
getFieldError
(
String
field
)
{
List
<
FieldError
>
fieldErrors
=
getFieldErrors
(
field
);
return
(!
fieldErrors
.
isEmpty
()
?
(
FieldError
)
fieldErrors
.
get
(
0
)
:
null
);
return
(!
fieldErrors
.
isEmpty
()
?
fieldErrors
.
get
(
0
)
:
null
);
}
...
...
spring-context/src/test/java/org/springframework/aop/aspectj/AfterReturningAdviceBindingTests.java
浏览文件 @
6c14eaad
...
...
@@ -137,7 +137,7 @@ public final class AfterReturningAdviceBindingTests {
@Test
public
void
testReturningBeanArray
()
{
this
.
testBeanTarget
.
setSpouse
(
new
TestBean
());
ITestBean
[]
spouses
=
(
ITestBean
[])
this
.
testBeanTarget
.
getSpouses
();
ITestBean
[]
spouses
=
this
.
testBeanTarget
.
getSpouses
();
mockCollaborator
.
testBeanArrayArg
(
spouses
);
replay
(
mockCollaborator
);
testBeanProxy
.
getSpouses
();
...
...
spring-context/src/test/java/org/springframework/context/AbstractApplicationContextTests.java
浏览文件 @
6c14eaad
...
...
@@ -94,7 +94,7 @@ public abstract class AbstractApplicationContextTests extends AbstractListableBe
}
public
void
testGrandparentTypedDefinitionFound
()
throws
Exception
{
TestBean
dad
=
(
TestBean
)
applicationContext
.
getBean
(
"father"
,
TestBean
.
class
);
TestBean
dad
=
applicationContext
.
getBean
(
"father"
,
TestBean
.
class
);
assertTrue
(
"Dad has correct name"
,
dad
.
getName
().
equals
(
"Albert"
));
}
...
...
spring-context/src/test/java/org/springframework/jmx/export/assembler/AbstractJmxAssemblerTests.java
浏览文件 @
6c14eaad
...
...
@@ -145,14 +145,14 @@ public abstract class AbstractJmxAssemblerTests extends AbstractJmxTests {
ModelMBeanOperationInfo
get
=
info
.
getOperation
(
"getName"
);
assertNotNull
(
"get operation should not be null"
,
get
);
assertEquals
(
"get operation should have visibility of four"
,
(
Integer
)
get
.
getDescriptor
().
getFieldValue
(
"visibility"
),
get
.
getDescriptor
().
getFieldValue
(
"visibility"
),
new
Integer
(
4
));
assertEquals
(
"get operation should have role \"getter\""
,
"getter"
,
get
.
getDescriptor
().
getFieldValue
(
"role"
));
ModelMBeanOperationInfo
set
=
info
.
getOperation
(
"setName"
);
assertNotNull
(
"set operation should not be null"
,
set
);
assertEquals
(
"set operation should have visibility of four"
,
(
Integer
)
set
.
getDescriptor
().
getFieldValue
(
"visibility"
),
set
.
getDescriptor
().
getFieldValue
(
"visibility"
),
new
Integer
(
4
));
assertEquals
(
"set operation should have role \"setter\""
,
"setter"
,
set
.
getDescriptor
().
getFieldValue
(
"role"
));
}
...
...
spring-context/src/test/java/org/springframework/jmx/support/MBeanServerConnectionFactoryBeanTests.java
浏览文件 @
6c14eaad
...
...
@@ -62,7 +62,7 @@ public class MBeanServerConnectionFactoryBeanTests extends AbstractMBeanServerTe
bean
.
afterPropertiesSet
();
try
{
MBeanServerConnection
connection
=
(
MBeanServerConnection
)
bean
.
getObject
();
MBeanServerConnection
connection
=
bean
.
getObject
();
assertNotNull
(
"Connection should not be null"
,
connection
);
// perform simple MBean count test
...
...
@@ -100,7 +100,7 @@ public class MBeanServerConnectionFactoryBeanTests extends AbstractMBeanServerTe
bean
.
setConnectOnStartup
(
false
);
bean
.
afterPropertiesSet
();
MBeanServerConnection
connection
=
(
MBeanServerConnection
)
bean
.
getObject
();
MBeanServerConnection
connection
=
bean
.
getObject
();
assertTrue
(
AopUtils
.
isAopProxy
(
connection
));
JMXConnectorServer
connector
=
null
;
...
...
@@ -122,7 +122,7 @@ public class MBeanServerConnectionFactoryBeanTests extends AbstractMBeanServerTe
bean
.
setConnectOnStartup
(
false
);
bean
.
afterPropertiesSet
();
MBeanServerConnection
connection
=
(
MBeanServerConnection
)
bean
.
getObject
();
MBeanServerConnection
connection
=
bean
.
getObject
();
assertTrue
(
AopUtils
.
isAopProxy
(
connection
));
bean
.
destroy
();
}
...
...
spring-context/src/test/java/org/springframework/scheduling/config/ScheduledTasksBeanDefinitionParserTests.java
浏览文件 @
6c14eaad
...
...
@@ -52,7 +52,7 @@ public class ScheduledTasksBeanDefinitionParserTests {
public
void
setup
()
{
this
.
context
=
new
ClassPathXmlApplicationContext
(
"scheduledTasksContext.xml"
,
ScheduledTasksBeanDefinitionParserTests
.
class
);
this
.
registrar
=
(
ScheduledTaskRegistrar
)
this
.
context
.
getBeansOfType
(
this
.
registrar
=
this
.
context
.
getBeansOfType
(
ScheduledTaskRegistrar
.
class
).
values
().
iterator
().
next
();
this
.
testBean
=
this
.
context
.
getBean
(
"testBean"
);
}
...
...
spring-context/src/test/java/org/springframework/scheduling/timer/TimerSupportTests.java
浏览文件 @
6c14eaad
...
...
@@ -39,7 +39,7 @@ public class TimerSupportTests extends TestCase {
mittfb
.
setTargetObject
(
task1
);
mittfb
.
setTargetMethod
(
"doSomething"
);
mittfb
.
afterPropertiesSet
();
final
TimerTask
timerTask1
=
(
TimerTask
)
mittfb
.
getObject
();
final
TimerTask
timerTask1
=
mittfb
.
getObject
();
final
TestRunnable
timerTask2
=
new
TestRunnable
();
...
...
spring-core/src/main/java/org/springframework/core/GenericCollectionTypeResolver.java
浏览文件 @
6c14eaad
...
...
@@ -322,7 +322,7 @@ public abstract class GenericCollectionTypeResolver {
Type
resolvedType
=
type
;
if
(
type
instanceof
TypeVariable
&&
typeVariableMap
!=
null
)
{
Type
mappedType
=
typeVariableMap
.
get
(
(
TypeVariable
)
type
);
Type
mappedType
=
typeVariableMap
.
get
(
type
);
if
(
mappedType
!=
null
)
{
resolvedType
=
mappedType
;
}
...
...
@@ -383,7 +383,7 @@ public abstract class GenericCollectionTypeResolver {
}
Type
paramType
=
paramTypes
[
typeIndex
];
if
(
paramType
instanceof
TypeVariable
&&
typeVariableMap
!=
null
)
{
Type
mappedType
=
typeVariableMap
.
get
(
(
TypeVariable
)
paramType
);
Type
mappedType
=
typeVariableMap
.
get
(
paramType
);
if
(
mappedType
!=
null
)
{
paramType
=
mappedType
;
}
...
...
spring-core/src/main/java/org/springframework/core/annotation/AnnotationAttributes.java
浏览文件 @
6c14eaad
...
...
@@ -106,7 +106,7 @@ public class AnnotationAttributes extends LinkedHashMap<String, Object> {
@SuppressWarnings
(
"unchecked"
)
public
<
T
>
Class
<?
extends
T
>
getClass
(
String
attributeName
)
{
return
(
Class
<
T
>)
doGet
(
attributeName
,
Class
.
class
);
return
doGet
(
attributeName
,
Class
.
class
);
}
public
Class
<?>[]
getClassArray
(
String
attributeName
)
{
...
...
spring-core/src/test/java/org/springframework/core/convert/support/CollectionToCollectionConverterTests.java
浏览文件 @
6c14eaad
...
...
@@ -71,8 +71,8 @@ public class CollectionToCollectionConverterTests {
@SuppressWarnings
(
"unchecked"
)
List
<
String
>
result
=
(
List
<
String
>)
conversionService
.
convert
(
list
,
sourceType
,
targetType
);
assertFalse
(
list
.
equals
(
result
));
assertEquals
(
(
Integer
)
9
,
result
.
get
(
0
));
assertEquals
(
(
Integer
)
37
,
result
.
get
(
1
));
assertEquals
(
9
,
result
.
get
(
0
));
assertEquals
(
37
,
result
.
get
(
1
));
}
public
ArrayList
<
Integer
>
scalarListTarget
;
...
...
spring-core/src/test/java/org/springframework/core/convert/support/DefaultConversionTests.java
浏览文件 @
6c14eaad
...
...
@@ -298,7 +298,7 @@ public class DefaultConversionTests {
@Test
public
void
testSpr7766
()
throws
Exception
{
ConverterRegistry
registry
=
(
(
ConverterRegistry
)
conversionService
);
ConverterRegistry
registry
=
(
conversionService
);
registry
.
addConverter
(
new
ColorConverter
());
List
<
Color
>
colors
=
(
List
<
Color
>)
conversionService
.
convert
(
new
String
[]
{
"ffffff"
,
"#000000"
},
TypeDescriptor
.
valueOf
(
String
[].
class
),
new
TypeDescriptor
(
new
MethodParameter
(
getClass
().
getMethod
(
"handlerMethod"
,
List
.
class
),
0
)));
assertEquals
(
2
,
colors
.
size
());
...
...
spring-core/src/test/java/org/springframework/core/type/AnnotationMetadataTests.java
浏览文件 @
6c14eaad
...
...
@@ -147,7 +147,7 @@ public class AnnotationMetadataTests {
assertThat
(
specialAttrs
.
getString
(
"clazz"
),
is
(
String
.
class
.
getName
()));
AnnotationAttributes
nestedAnno
=
specialAttrs
.
getAnnotation
(
"nestedAnno"
);
assertArrayEquals
(
new
String
[]{
String
.
class
.
getName
()},
(
String
[])
nestedAnno
.
getStringArray
(
"classArray"
));
assertArrayEquals
(
new
String
[]{
String
.
class
.
getName
()},
nestedAnno
.
getStringArray
(
"classArray"
));
assertArrayEquals
(
new
String
[]{
String
.
class
.
getName
()},
nestedAnno
.
getStringArray
(
"classArray"
));
AnnotationAttributes
[]
nestedAnnoArray
=
specialAttrs
.
getAnnotationArray
(
"nestedAnnoArray"
);
...
...
spring-expression/src/test/java/org/springframework/expression/spel/EvaluationTests.java
浏览文件 @
6c14eaad
...
...
@@ -1312,7 +1312,7 @@ public class EvaluationTests extends ExpressionTestCase {
e
=
parser
.
parseExpression
(
"#wibble=#wibble+#wibble"
);
String
s
=
e
.
getValue
(
ctx
,
String
.
class
);
assertEquals
(
"hello worldhello world"
,
s
);
assertEquals
(
"hello worldhello world"
,
(
String
)
ctx
.
lookupVariable
(
"wibble"
));
assertEquals
(
"hello worldhello world"
,
ctx
.
lookupVariable
(
"wibble"
));
ctx
.
setVariable
(
"wobble"
,
3
);
e
=
parser
.
parseExpression
(
"#wobble++"
);
...
...
spring-expression/src/test/java/org/springframework/expression/spel/ParsingTests.java
浏览文件 @
6c14eaad
...
...
@@ -457,7 +457,7 @@ public class ParsingTests {
*/
public
void
parseCheck
(
String
expression
,
String
expectedStringFormOfAST
)
{
try
{
SpelExpression
e
=
(
SpelExpression
)
parser
.
parseRaw
(
expression
);
SpelExpression
e
=
parser
.
parseRaw
(
expression
);
if
(
e
!=
null
&&
!
e
.
toStringAST
().
equals
(
expectedStringFormOfAST
))
{
SpelUtilities
.
printAbstractSyntaxTree
(
System
.
err
,
e
);
}
...
...
spring-jdbc/src/main/java/org/springframework/jdbc/datasource/lookup/BeanFactoryDataSourceLookup.java
浏览文件 @
6c14eaad
...
...
@@ -70,7 +70,7 @@ public class BeanFactoryDataSourceLookup implements DataSourceLookup, BeanFactor
public
DataSource
getDataSource
(
String
dataSourceName
)
throws
DataSourceLookupFailureException
{
Assert
.
state
(
this
.
beanFactory
!=
null
,
"BeanFactory is required"
);
try
{
return
(
DataSource
)
this
.
beanFactory
.
getBean
(
dataSourceName
,
DataSource
.
class
);
return
this
.
beanFactory
.
getBean
(
dataSourceName
,
DataSource
.
class
);
}
catch
(
BeansException
ex
)
{
throw
new
DataSourceLookupFailureException
(
...
...
spring-jdbc/src/test/java/org/springframework/jdbc/object/SqlQueryTests.java
浏览文件 @
6c14eaad
...
...
@@ -953,7 +953,7 @@ public class SqlQueryTests extends AbstractJdbcTests {
public
List
findCustomers
(
List
ids
)
{
Map
params
=
new
HashMap
();
params
.
put
(
"ids"
,
ids
);
return
(
List
)
executeByNamedParam
(
params
);
return
executeByNamedParam
(
params
);
}
}
...
...
@@ -1026,7 +1026,7 @@ public class SqlQueryTests extends AbstractJdbcTests {
public
List
findCustomers
(
Integer
id
)
{
Map
params
=
new
HashMap
();
params
.
put
(
"id1"
,
id
);
return
(
List
)
executeByNamedParam
(
params
);
return
executeByNamedParam
(
params
);
}
}
...
...
@@ -1067,7 +1067,7 @@ public class SqlQueryTests extends AbstractJdbcTests {
public
List
findCustomers
(
Integer
id1
)
{
Map
params
=
new
HashMap
();
params
.
put
(
"id1"
,
id1
);
return
(
List
)
executeByNamedParam
(
params
);
return
executeByNamedParam
(
params
);
}
}
...
...
spring-jdbc/src/test/java/org/springframework/jdbc/support/SQLErrorCodesFactoryTests.java
浏览文件 @
6c14eaad
...
...
@@ -198,7 +198,7 @@ public class SQLErrorCodesFactoryTests extends TestCase {
TestSQLErrorCodesFactory
sf
=
new
TestSQLErrorCodesFactory
();
assertEquals
(
1
,
sf
.
getErrorCodes
(
"Oracle"
).
getCustomTranslations
().
length
);
CustomSQLErrorCodesTranslation
translation
=
(
CustomSQLErrorCodesTranslation
)
sf
.
getErrorCodes
(
"Oracle"
).
getCustomTranslations
()[
0
];
sf
.
getErrorCodes
(
"Oracle"
).
getCustomTranslations
()[
0
];
assertEquals
(
CustomErrorCodeException
.
class
,
translation
.
getExceptionClass
());
assertEquals
(
1
,
translation
.
getErrorCodes
().
length
);
}
...
...
spring-jms/src/main/java/org/springframework/jms/support/destination/BeanFactoryDestinationResolver.java
浏览文件 @
6c14eaad
...
...
@@ -73,7 +73,7 @@ public class BeanFactoryDestinationResolver implements DestinationResolver, Bean
Assert
.
state
(
this
.
beanFactory
!=
null
,
"BeanFactory is required"
);
try
{
return
(
Destination
)
this
.
beanFactory
.
getBean
(
destinationName
,
Destination
.
class
);
return
this
.
beanFactory
.
getBean
(
destinationName
,
Destination
.
class
);
}
catch
(
BeansException
ex
)
{
throw
new
DestinationResolutionException
(
...
...
spring-orm/src/main/java/org/springframework/orm/hibernate3/HibernateAccessor.java
浏览文件 @
6c14eaad
...
...
@@ -208,7 +208,7 @@ public abstract class HibernateAccessor implements InitializingBean, BeanFactory
if
(
this
.
beanFactory
==
null
)
{
throw
new
IllegalStateException
(
"Cannot get entity interceptor via bean name if no bean factory set"
);
}
return
(
Interceptor
)
this
.
beanFactory
.
getBean
((
String
)
this
.
entityInterceptor
,
Interceptor
.
class
);
return
this
.
beanFactory
.
getBean
((
String
)
this
.
entityInterceptor
,
Interceptor
.
class
);
}
return
(
Interceptor
)
this
.
entityInterceptor
;
}
...
...
spring-orm/src/test/java/org/springframework/orm/jpa/support/OpenEntityManagerInViewTests.java
浏览文件 @
6c14eaad
...
...
@@ -228,8 +228,8 @@ public class OpenEntityManagerInViewTests extends TestCase {
replay
(
manager
,
factory
);
final
EntityManagerFactory
factory2
=
(
EntityManagerFactory
)
createMock
(
EntityManagerFactory
.
class
);
final
EntityManager
manager2
=
(
EntityManager
)
createMock
(
EntityManager
.
class
);
final
EntityManagerFactory
factory2
=
createMock
(
EntityManagerFactory
.
class
);
final
EntityManager
manager2
=
createMock
(
EntityManager
.
class
);
expect
(
factory2
.
createEntityManager
()).
andReturn
(
manager2
);
expect
(
manager2
.
isOpen
()).
andReturn
(
true
);
...
...
@@ -292,8 +292,8 @@ public class OpenEntityManagerInViewTests extends TestCase {
replay
(
manager
,
factory
);
final
EntityManagerFactory
factory2
=
(
EntityManagerFactory
)
createMock
(
EntityManagerFactory
.
class
);
final
EntityManager
manager2
=
(
EntityManager
)
createMock
(
EntityManager
.
class
);
final
EntityManagerFactory
factory2
=
createMock
(
EntityManagerFactory
.
class
);
final
EntityManager
manager2
=
createMock
(
EntityManager
.
class
);
expect
(
factory2
.
createEntityManager
()).
andReturn
(
manager2
);
expect
(
manager2
.
isOpen
()).
andReturn
(
true
);
...
...
spring-orm/src/test/java/org/springframework/orm/jpa/support/PersistenceInjectionTests.java
浏览文件 @
6c14eaad
...
...
@@ -256,7 +256,7 @@ public class PersistenceInjectionTests extends AbstractEntityManagerFactoryBeanT
public
void
testPublicPersistenceUnitSetterWithOverriding
()
{
EntityManagerFactory
mockEmf2
=
(
EntityManagerFactory
)
MockControl
.
createControl
(
EntityManagerFactory
.
class
).
getMock
();
MockControl
.
createControl
(
EntityManagerFactory
.
class
).
getMock
();
GenericApplicationContext
gac
=
new
GenericApplicationContext
();
gac
.
getDefaultListableBeanFactory
().
registerSingleton
(
"entityManagerFactory"
,
mockEmf
);
...
...
@@ -274,7 +274,7 @@ public class PersistenceInjectionTests extends AbstractEntityManagerFactoryBeanT
public
void
testPublicPersistenceUnitSetterWithUnitIdentifiedThroughBeanName
()
{
EntityManagerFactory
mockEmf2
=
(
EntityManagerFactory
)
MockControl
.
createControl
(
EntityManagerFactory
.
class
).
getMock
();
MockControl
.
createControl
(
EntityManagerFactory
.
class
).
getMock
();
GenericApplicationContext
gac
=
new
GenericApplicationContext
();
gac
.
getDefaultListableBeanFactory
().
registerSingleton
(
"entityManagerFactory"
,
mockEmf
);
...
...
@@ -329,7 +329,7 @@ public class PersistenceInjectionTests extends AbstractEntityManagerFactoryBeanT
@Ignore
public
void
ignoreTestPersistenceUnitsFromJndi
()
{
mockEmf
.
createEntityManager
();
Object
mockEm
=
(
EntityManager
)
MockControl
.
createControl
(
EntityManager
.
class
).
getMock
();
Object
mockEm
=
MockControl
.
createControl
(
EntityManager
.
class
).
getMock
();
emfMc
.
setReturnValue
(
mockEm
,
1
);
emfMc
.
replay
();
...
...
@@ -428,9 +428,9 @@ public class PersistenceInjectionTests extends AbstractEntityManagerFactoryBeanT
}
public
void
testPersistenceContextsFromJndi
()
{
Object
mockEm
=
(
EntityManager
)
MockControl
.
createControl
(
EntityManager
.
class
).
getMock
();
Object
mockEm2
=
(
EntityManager
)
MockControl
.
createControl
(
EntityManager
.
class
).
getMock
();
Object
mockEm3
=
(
EntityManager
)
MockControl
.
createControl
(
EntityManager
.
class
).
getMock
();
Object
mockEm
=
MockControl
.
createControl
(
EntityManager
.
class
).
getMock
();
Object
mockEm2
=
MockControl
.
createControl
(
EntityManager
.
class
).
getMock
();
Object
mockEm3
=
MockControl
.
createControl
(
EntityManager
.
class
).
getMock
();
Map
<
String
,
String
>
persistenceContexts
=
new
HashMap
<
String
,
String
>();
persistenceContexts
.
put
(
""
,
"pc1"
);
...
...
@@ -467,9 +467,9 @@ public class PersistenceInjectionTests extends AbstractEntityManagerFactoryBeanT
}
public
void
testPersistenceContextsFromJndiWithDefaultUnit
()
{
Object
mockEm
=
(
EntityManager
)
MockControl
.
createControl
(
EntityManager
.
class
).
getMock
();
Object
mockEm2
=
(
EntityManager
)
MockControl
.
createControl
(
EntityManager
.
class
).
getMock
();
Object
mockEm3
=
(
EntityManager
)
MockControl
.
createControl
(
EntityManager
.
class
).
getMock
();
Object
mockEm
=
MockControl
.
createControl
(
EntityManager
.
class
).
getMock
();
Object
mockEm2
=
MockControl
.
createControl
(
EntityManager
.
class
).
getMock
();
Object
mockEm3
=
MockControl
.
createControl
(
EntityManager
.
class
).
getMock
();
Map
<
String
,
String
>
persistenceContexts
=
new
HashMap
<
String
,
String
>();
persistenceContexts
.
put
(
"System"
,
"pc1"
);
...
...
@@ -507,8 +507,8 @@ public class PersistenceInjectionTests extends AbstractEntityManagerFactoryBeanT
}
public
void
testSinglePersistenceContextFromJndi
()
{
Object
mockEm
=
(
EntityManager
)
MockControl
.
createControl
(
EntityManager
.
class
).
getMock
();
Object
mockEm2
=
(
EntityManager
)
MockControl
.
createControl
(
EntityManager
.
class
).
getMock
();
Object
mockEm
=
MockControl
.
createControl
(
EntityManager
.
class
).
getMock
();
Object
mockEm2
=
MockControl
.
createControl
(
EntityManager
.
class
).
getMock
();
Map
<
String
,
String
>
persistenceContexts
=
new
HashMap
<
String
,
String
>();
persistenceContexts
.
put
(
"System"
,
"pc1"
);
...
...
spring-orm/src/test/java/org/springframework/orm/jpa/support/SharedEntityManagerFactoryTests.java
浏览文件 @
6c14eaad
...
...
@@ -61,7 +61,7 @@ public class SharedEntityManagerFactoryTests {
assertTrue
(
EntityManager
.
class
.
isAssignableFrom
(
proxyFactoryBean
.
getObjectType
()));
assertTrue
(
proxyFactoryBean
.
isSingleton
());
EntityManager
proxy
=
(
EntityManager
)
proxyFactoryBean
.
getObject
();
EntityManager
proxy
=
proxyFactoryBean
.
getObject
();
assertSame
(
proxy
,
proxyFactoryBean
.
getObject
());
assertFalse
(
proxy
.
contains
(
o
));
...
...
spring-oxm/src/test/java/org/springframework/oxm/castor/CastorUnmarshallerTests.java
浏览文件 @
6c14eaad
...
...
@@ -66,7 +66,7 @@ public class CastorUnmarshallerTests extends AbstractUnmarshallerTests {
protected
void
testFlight
(
Object
o
)
{
Flight
flight
=
(
Flight
)
o
;
assertNotNull
(
"Flight is null"
,
flight
);
assertEquals
(
"Number is invalid"
,
42L
,
(
long
)
flight
.
getNumber
());
assertEquals
(
"Number is invalid"
,
42L
,
flight
.
getNumber
());
}
@Override
...
...
@@ -104,10 +104,10 @@ public class CastorUnmarshallerTests extends AbstractUnmarshallerTests {
assertEquals
(
"Invalid amount of items"
,
2
,
order
.
getOrderItemCount
());
OrderItem
item
=
order
.
getOrderItem
(
0
);
assertEquals
(
"Invalid items"
,
"1"
,
item
.
getId
());
assertEquals
(
"Invalid items"
,
15
,
(
int
)
item
.
getQuantity
());
assertEquals
(
"Invalid items"
,
15
,
item
.
getQuantity
());
item
=
order
.
getOrderItem
(
1
);
assertEquals
(
"Invalid items"
,
"3"
,
item
.
getId
());
assertEquals
(
"Invalid items"
,
20
,
(
int
)
item
.
getQuantity
());
assertEquals
(
"Invalid items"
,
20
,
item
.
getQuantity
());
}
@Test
...
...
spring-struts/src/main/java/org/springframework/web/struts/DelegatingActionProxy.java
浏览文件 @
6c14eaad
...
...
@@ -127,7 +127,7 @@ public class DelegatingActionProxy extends Action {
protected
Action
getDelegateAction
(
ActionMapping
mapping
)
throws
BeansException
{
WebApplicationContext
wac
=
getWebApplicationContext
(
getServlet
(),
mapping
.
getModuleConfig
());
String
beanName
=
determineActionBeanName
(
mapping
);
return
(
Action
)
wac
.
getBean
(
beanName
,
Action
.
class
);
return
wac
.
getBean
(
beanName
,
Action
.
class
);
}
/**
...
...
spring-struts/src/main/java/org/springframework/web/struts/DelegatingRequestProcessor.java
浏览文件 @
6c14eaad
...
...
@@ -177,7 +177,7 @@ public class DelegatingRequestProcessor extends RequestProcessor {
if
(!
getWebApplicationContext
().
containsBean
(
beanName
))
{
return
null
;
}
return
(
Action
)
getWebApplicationContext
().
getBean
(
beanName
,
Action
.
class
);
return
getWebApplicationContext
().
getBean
(
beanName
,
Action
.
class
);
}
/**
...
...
spring-struts/src/main/java/org/springframework/web/struts/DelegatingTilesRequestProcessor.java
浏览文件 @
6c14eaad
...
...
@@ -126,7 +126,7 @@ public class DelegatingTilesRequestProcessor extends TilesRequestProcessor {
if
(!
getWebApplicationContext
().
containsBean
(
beanName
))
{
return
null
;
}
return
(
Action
)
getWebApplicationContext
().
getBean
(
beanName
,
Action
.
class
);
return
getWebApplicationContext
().
getBean
(
beanName
,
Action
.
class
);
}
/**
...
...
spring-test-mvc/src/main/java/org/springframework/test/web/servlet/result/FlashAttributeResultMatchers.java
浏览文件 @
6c14eaad
...
...
@@ -59,7 +59,7 @@ public class FlashAttributeResultMatchers {
return
new
ResultMatcher
()
{
@SuppressWarnings
(
"unchecked"
)
public
void
match
(
MvcResult
result
)
throws
Exception
{
assertEquals
(
"Flash attribute"
,
value
,
(
T
)
result
.
getFlashMap
().
get
(
name
));
assertEquals
(
"Flash attribute"
,
value
,
result
.
getFlashMap
().
get
(
name
));
}
};
}
...
...
spring-test/src/main/java/org/springframework/mock/web/portlet/MockPortletRequest.java
浏览文件 @
6c14eaad
...
...
@@ -269,7 +269,7 @@ public class MockPortletRequest implements PortletRequest {
public
String
getProperty
(
String
key
)
{
Assert
.
notNull
(
key
,
"Property key must not be null"
);
List
<
String
>
list
=
this
.
properties
.
get
(
key
);
return
(
list
!=
null
&&
list
.
size
()
>
0
?
(
String
)
list
.
get
(
0
)
:
null
);
return
(
list
!=
null
&&
list
.
size
()
>
0
?
list
.
get
(
0
)
:
null
);
}
public
Enumeration
<
String
>
getProperties
(
String
key
)
{
...
...
spring-tx/src/test/java/org/springframework/jca/cci/CciTemplateTests.java
浏览文件 @
6c14eaad
...
...
@@ -699,7 +699,7 @@ public class CciTemplateTests {
replay
(
connectionFactory
,
connection
,
interaction
);
CciTemplate
ct
=
new
CciTemplate
(
connectionFactory
);
Record
tmpOutputRecord
=
(
Record
)
ct
.
execute
(
interactionSpec
,
Record
tmpOutputRecord
=
ct
.
execute
(
interactionSpec
,
inputOutputRecord
);
assertNull
(
tmpOutputRecord
);
...
...
spring-web/src/main/java/org/springframework/http/converter/json/MappingJackson2HttpMessageConverter.java
浏览文件 @
6c14eaad
...
...
@@ -129,7 +129,7 @@ public class MappingJackson2HttpMessageConverter extends AbstractHttpMessageConv
@Override
public
boolean
canRead
(
Class
<?>
clazz
,
MediaType
mediaType
)
{
return
canRead
(
(
Type
)
clazz
,
null
,
mediaType
);
return
canRead
(
clazz
,
null
,
mediaType
);
}
public
boolean
canRead
(
Type
type
,
Class
<?>
contextClass
,
MediaType
mediaType
)
{
...
...
spring-web/src/main/java/org/springframework/http/converter/json/MappingJacksonHttpMessageConverter.java
浏览文件 @
6c14eaad
...
...
@@ -127,7 +127,7 @@ public class MappingJacksonHttpMessageConverter extends AbstractHttpMessageConve
@Override
public
boolean
canRead
(
Class
<?>
clazz
,
MediaType
mediaType
)
{
return
canRead
(
(
Type
)
clazz
,
null
,
mediaType
);
return
canRead
(
clazz
,
null
,
mediaType
);
}
public
boolean
canRead
(
Type
type
,
Class
<?>
contextClass
,
MediaType
mediaType
)
{
...
...
spring-web/src/main/java/org/springframework/web/bind/UnsatisfiedServletRequestParameterException.java
浏览文件 @
6c14eaad
...
...
@@ -48,7 +48,7 @@ public class UnsatisfiedServletRequestParameterException extends ServletRequestB
public
UnsatisfiedServletRequestParameterException
(
String
[]
paramConditions
,
Map
actualParams
)
{
super
(
""
);
this
.
paramConditions
=
paramConditions
;
this
.
actualParams
=
(
Map
<
String
,
String
[]>)
actualParams
;
this
.
actualParams
=
actualParams
;
}
...
...
spring-web/src/main/java/org/springframework/web/context/support/HttpRequestHandlerServlet.java
浏览文件 @
6c14eaad
...
...
@@ -55,7 +55,7 @@ public class HttpRequestHandlerServlet extends HttpServlet {
@Override
public
void
init
()
throws
ServletException
{
WebApplicationContext
wac
=
WebApplicationContextUtils
.
getRequiredWebApplicationContext
(
getServletContext
());
this
.
target
=
(
HttpRequestHandler
)
wac
.
getBean
(
getServletName
(),
HttpRequestHandler
.
class
);
this
.
target
=
wac
.
getBean
(
getServletName
(),
HttpRequestHandler
.
class
);
}
...
...
@@ -68,7 +68,7 @@ public class HttpRequestHandlerServlet extends HttpServlet {
this
.
target
.
handleRequest
(
request
,
response
);
}
catch
(
HttpRequestMethodNotSupportedException
ex
)
{
String
[]
supportedMethods
=
((
HttpRequestMethodNotSupportedException
)
ex
)
.
getSupportedMethods
();
String
[]
supportedMethods
=
ex
.
getSupportedMethods
();
if
(
supportedMethods
!=
null
)
{
response
.
setHeader
(
"Allow"
,
StringUtils
.
arrayToDelimitedString
(
supportedMethods
,
", "
));
}
...
...
spring-web/src/main/java/org/springframework/web/util/HtmlUtils.java
浏览文件 @
6c14eaad
...
...
@@ -126,7 +126,7 @@ public abstract class HtmlUtils {
char
character
=
input
.
charAt
(
i
);
if
(
characterEntityReferences
.
isMappedToReference
(
character
))
{
escaped
.
append
(
HtmlCharacterEntityReferences
.
HEX_REFERENCE_START
);
escaped
.
append
(
Integer
.
toString
(
(
int
)
character
,
16
));
escaped
.
append
(
Integer
.
toString
(
character
,
16
));
escaped
.
append
(
HtmlCharacterEntityReferences
.
REFERENCE_END
);
}
else
{
...
...
spring-web/src/test/java/org/springframework/http/converter/xml/Jaxb2RootElementHttpMessageConverterTest.java
浏览文件 @
6c14eaad
...
...
@@ -76,7 +76,7 @@ public class Jaxb2RootElementHttpMessageConverterTest {
public
void
readXmlRootElement
()
throws
Exception
{
byte
[]
body
=
"<rootElement><type s=\"Hello World\"/></rootElement>"
.
getBytes
(
"UTF-8"
);
MockHttpInputMessage
inputMessage
=
new
MockHttpInputMessage
(
body
);
RootElement
result
=
(
RootElement
)
converter
.
read
(
(
Class
)
RootElement
.
class
,
inputMessage
);
RootElement
result
=
(
RootElement
)
converter
.
read
(
RootElement
.
class
,
inputMessage
);
assertEquals
(
"Invalid result"
,
"Hello World"
,
result
.
type
.
s
);
}
...
...
@@ -85,7 +85,7 @@ public class Jaxb2RootElementHttpMessageConverterTest {
public
void
readXmlRootElementSubclass
()
throws
Exception
{
byte
[]
body
=
"<rootElement><type s=\"Hello World\"/></rootElement>"
.
getBytes
(
"UTF-8"
);
MockHttpInputMessage
inputMessage
=
new
MockHttpInputMessage
(
body
);
RootElementSubclass
result
=
(
RootElementSubclass
)
converter
.
read
(
(
Class
)
RootElementSubclass
.
class
,
inputMessage
);
RootElementSubclass
result
=
(
RootElementSubclass
)
converter
.
read
(
RootElementSubclass
.
class
,
inputMessage
);
assertEquals
(
"Invalid result"
,
"Hello World"
,
result
.
type
.
s
);
}
...
...
@@ -94,7 +94,7 @@ public class Jaxb2RootElementHttpMessageConverterTest {
public
void
readXmlType
()
throws
Exception
{
byte
[]
body
=
"<foo s=\"Hello World\"/>"
.
getBytes
(
"UTF-8"
);
MockHttpInputMessage
inputMessage
=
new
MockHttpInputMessage
(
body
);
Type
result
=
(
Type
)
converter
.
read
(
(
Class
)
Type
.
class
,
inputMessage
);
Type
result
=
(
Type
)
converter
.
read
(
Type
.
class
,
inputMessage
);
assertEquals
(
"Invalid result"
,
"Hello World"
,
result
.
s
);
}
...
...
spring-webmvc-portlet/src/test/java/org/springframework/context/AbstractApplicationContextTests.java
浏览文件 @
6c14eaad
...
...
@@ -94,7 +94,7 @@ public abstract class AbstractApplicationContextTests extends AbstractListableBe
}
public
void
testGrandparentTypedDefinitionFound
()
throws
Exception
{
TestBean
dad
=
(
TestBean
)
applicationContext
.
getBean
(
"father"
,
TestBean
.
class
);
TestBean
dad
=
applicationContext
.
getBean
(
"father"
,
TestBean
.
class
);
assertTrue
(
"Dad has correct name"
,
dad
.
getName
().
equals
(
"Albert"
));
}
...
...
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/AbstractMessageConverterMethodArgumentResolver.java
浏览文件 @
6c14eaad
...
...
@@ -132,7 +132,7 @@ public abstract class AbstractMessageConverterMethodArgumentResolver implements
logger
.
debug
(
"Reading ["
+
targetType
+
"] as \""
+
contentType
+
"\" using ["
+
converter
+
"]"
);
}
return
(
T
)
genericConverter
.
read
(
targetType
,
contextClass
,
inputMessage
);
return
genericConverter
.
read
(
targetType
,
contextClass
,
inputMessage
);
}
}
if
(
targetClass
!=
null
)
{
...
...
spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/CheckboxTag.java
浏览文件 @
6c14eaad
...
...
@@ -86,7 +86,7 @@ public class CheckboxTag extends AbstractSingleCheckedElementTag {
if
(
value
==
null
)
{
throw
new
IllegalArgumentException
(
"Attribute 'value' is required when binding to non-boolean values"
);
}
Object
resolvedValue
=
(
value
instanceof
String
?
evaluate
(
"value"
,
(
String
)
value
)
:
value
);
Object
resolvedValue
=
(
value
instanceof
String
?
evaluate
(
"value"
,
value
)
:
value
);
renderFromValue
(
resolvedValue
,
tagWriter
);
}
}
...
...
spring-webmvc/src/main/java/org/springframework/web/servlet/view/BeanNameViewResolver.java
浏览文件 @
6c14eaad
...
...
@@ -72,7 +72,7 @@ public class BeanNameViewResolver extends WebApplicationObjectSupport implements
// Allow for ViewResolver chaining.
return
null
;
}
return
(
View
)
context
.
getBean
(
viewName
,
View
.
class
);
return
context
.
getBean
(
viewName
,
View
.
class
);
}
}
spring-webmvc/src/main/java/org/springframework/web/servlet/view/XmlViewResolver.java
浏览文件 @
6c14eaad
...
...
@@ -106,7 +106,7 @@ public class XmlViewResolver extends AbstractCachingViewResolver
protected
View
loadView
(
String
viewName
,
Locale
locale
)
throws
BeansException
{
BeanFactory
factory
=
initFactory
();
try
{
return
(
View
)
factory
.
getBean
(
viewName
,
View
.
class
);
return
factory
.
getBean
(
viewName
,
View
.
class
);
}
catch
(
NoSuchBeanDefinitionException
ex
)
{
// to allow for ViewResolver chaining
...
...
spring-webmvc/src/test/java/org/springframework/web/context/AbstractApplicationContextTests.java
浏览文件 @
6c14eaad
...
...
@@ -100,7 +100,7 @@ public abstract class AbstractApplicationContextTests extends AbstractListableBe
}
public
void
testGrandparentTypedDefinitionFound
()
throws
Exception
{
TestBean
dad
=
(
TestBean
)
applicationContext
.
getBean
(
"father"
,
TestBean
.
class
);
TestBean
dad
=
applicationContext
.
getBean
(
"father"
,
TestBean
.
class
);
assertTrue
(
"Dad has correct name"
,
dad
.
getName
().
equals
(
"Albert"
));
}
...
...
spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/annotation/ServletAnnotationControllerTests.java
浏览文件 @
6c14eaad
...
...
@@ -338,7 +338,7 @@ public class ServletAnnotationControllerTests {
MockHttpServletResponse
response
=
new
MockHttpServletResponse
();
servlet
.
service
(
request
,
response
);
assertEquals
(
"Invalid response status"
,
HttpServletResponse
.
SC_METHOD_NOT_ALLOWED
,
response
.
getStatus
());
String
allowHeader
=
(
String
)
response
.
getHeader
(
"Allow"
);
String
allowHeader
=
response
.
getHeader
(
"Allow"
);
assertNotNull
(
"No Allow header"
,
allowHeader
);
Set
<
String
>
allowedMethods
=
new
HashSet
<
String
>();
allowedMethods
.
addAll
(
Arrays
.
asList
(
StringUtils
.
delimitedListToStringArray
(
allowHeader
,
", "
)));
...
...
spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ServletAnnotationControllerHandlerMethodTests.java
浏览文件 @
6c14eaad
...
...
@@ -292,7 +292,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl
MockHttpServletResponse
response
=
new
MockHttpServletResponse
();
getServlet
().
service
(
request
,
response
);
assertEquals
(
"Invalid response status"
,
HttpServletResponse
.
SC_METHOD_NOT_ALLOWED
,
response
.
getStatus
());
String
allowHeader
=
(
String
)
response
.
getHeader
(
"Allow"
);
String
allowHeader
=
response
.
getHeader
(
"Allow"
);
assertNotNull
(
"No Allow header"
,
allowHeader
);
Set
<
String
>
allowedMethods
=
new
HashSet
<
String
>();
allowedMethods
.
addAll
(
Arrays
.
asList
(
StringUtils
.
delimitedListToStringArray
(
allowHeader
,
", "
)));
...
...
spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/RadioButtonTagTests.java
浏览文件 @
6c14eaad
...
...
@@ -267,7 +267,7 @@ public class RadioButtonTagTests extends AbstractFormTagTests {
}
public
String
getAsText
()
{
return
"F"
+
(
Float
)
getValue
();
return
"F"
+
getValue
();
}
}
...
...
spring-webmvc/src/test/java/org/springframework/web/servlet/tags/form/SelectTagTests.java
浏览文件 @
6c14eaad
...
...
@@ -242,7 +242,7 @@ public class SelectTagTests extends AbstractFormTagTests {
if
(
value
==
null
)
{
return
null
;
}
return
((
Country
)
value
)
.
getName
();
return
value
.
getName
();
}
});
getPageContext
().
getRequest
().
setAttribute
(
BindingResult
.
MODEL_KEY_PREFIX
+
"testBean"
,
bindingResult
);
...
...
@@ -295,7 +295,7 @@ public class SelectTagTests extends AbstractFormTagTests {
if
(
value
==
null
)
{
return
""
;
}
return
((
Country
)
value
)
.
getName
();
return
value
.
getName
();
}
});
getPageContext
().
getRequest
().
setAttribute
(
BindingResult
.
MODEL_KEY_PREFIX
+
"testBean"
,
bindingResult
);
...
...
spring-webmvc/src/test/java/org/springframework/web/servlet/view/BaseViewTests.java
浏览文件 @
6c14eaad
...
...
@@ -297,7 +297,7 @@ public class BaseViewTests extends TestCase {
private
void
checkContainsAll
(
Map
expected
,
Map
<
String
,
Object
>
actual
)
{
Set
<
String
>
keys
=
expected
.
keySet
();
for
(
Iterator
<
String
>
iter
=
keys
.
iterator
();
iter
.
hasNext
();)
{
String
key
=
(
String
)
iter
.
next
();
String
key
=
iter
.
next
();
//System.out.println("Checking model key " + key);
assertTrue
(
"Value for model key '"
+
key
+
"' must match"
,
actual
.
get
(
key
)
==
expected
.
get
(
key
));
}
...
...
spring-webmvc/src/test/java/org/springframework/web/servlet/view/InternalResourceViewTests.java
浏览文件 @
6c14eaad
...
...
@@ -84,7 +84,7 @@ public class InternalResourceViewTests extends TestCase {
Set
<
String
>
keys
=
model
.
keySet
();
for
(
Iterator
<
String
>
it
=
keys
.
iterator
();
it
.
hasNext
();)
{
String
key
=
(
String
)
it
.
next
();
String
key
=
it
.
next
();
assertEquals
(
model
.
get
(
key
),
request
.
getAttribute
(
key
));
}
...
...
@@ -129,7 +129,7 @@ public class InternalResourceViewTests extends TestCase {
Set
<
String
>
keys
=
model
.
keySet
();
for
(
Iterator
<
String
>
it
=
keys
.
iterator
();
it
.
hasNext
();)
{
String
key
=
(
String
)
it
.
next
();
String
key
=
it
.
next
();
assertEquals
(
model
.
get
(
key
),
request
.
getAttribute
(
key
));
}
...
...
@@ -153,7 +153,7 @@ public class InternalResourceViewTests extends TestCase {
expectLastCall
().
andReturn
(
null
);
Set
<
String
>
keys
=
model
.
keySet
();
for
(
Iterator
<
String
>
iter
=
keys
.
iterator
();
iter
.
hasNext
();)
{
String
key
=
(
String
)
iter
.
next
();
String
key
=
iter
.
next
();
request
.
setAttribute
(
key
,
model
.
get
(
key
));
expectLastCall
().
times
(
1
);
}
...
...
@@ -186,7 +186,7 @@ public class InternalResourceViewTests extends TestCase {
expectLastCall
().
andReturn
(
null
);
Set
<
String
>
keys
=
model
.
keySet
();
for
(
Iterator
<
String
>
iter
=
keys
.
iterator
();
iter
.
hasNext
();)
{
String
key
=
(
String
)
iter
.
next
();
String
key
=
iter
.
next
();
request
.
setAttribute
(
key
,
model
.
get
(
key
));
expectLastCall
().
times
(
1
);
}
...
...
@@ -220,7 +220,7 @@ public class InternalResourceViewTests extends TestCase {
expectLastCall
().
andReturn
(
null
);
Set
<
String
>
keys
=
model
.
keySet
();
for
(
Iterator
<
String
>
iter
=
keys
.
iterator
();
iter
.
hasNext
();)
{
String
key
=
(
String
)
iter
.
next
();
String
key
=
iter
.
next
();
request
.
setAttribute
(
key
,
model
.
get
(
key
));
expectLastCall
().
times
(
1
);
}
...
...
spring-webmvc/src/test/java/org/springframework/web/servlet/view/freemarker/FreeMarkerConfigurerTests.java
浏览文件 @
6c14eaad
...
...
@@ -73,7 +73,7 @@ public class FreeMarkerConfigurerTests extends TestCase {
FreeMarkerConfigurationFactoryBean
fcfb
=
new
FreeMarkerConfigurationFactoryBean
();
fcfb
.
setTemplateLoaderPath
(
"file:/mydir"
);
fcfb
.
afterPropertiesSet
();
Configuration
cfg
=
(
Configuration
)
fcfb
.
getObject
();
Configuration
cfg
=
fcfb
.
getObject
();
assertTrue
(
cfg
.
getTemplateLoader
()
instanceof
SpringTemplateLoader
);
}
...
...
@@ -97,7 +97,7 @@ public class FreeMarkerConfigurerTests extends TestCase {
});
fcfb
.
afterPropertiesSet
();
assertTrue
(
fcfb
.
getObject
()
instanceof
Configuration
);
Configuration
fc
=
(
Configuration
)
fcfb
.
getObject
();
Configuration
fc
=
fcfb
.
getObject
();
Template
ft
=
fc
.
getTemplate
(
"test"
);
assertEquals
(
"test"
,
FreeMarkerTemplateUtils
.
processTemplateIntoString
(
ft
,
new
HashMap
()));
}
...
...
spring-webmvc/src/test/java/org/springframework/web/servlet/view/velocity/VelocityConfigurerTests.java
浏览文件 @
6c14eaad
...
...
@@ -69,7 +69,7 @@ public class VelocityConfigurerTests extends TestCase {
vefb
.
setVelocityPropertiesMap
(
map
);
vefb
.
afterPropertiesSet
();
assertTrue
(
vefb
.
getObject
()
instanceof
VelocityEngine
);
VelocityEngine
ve
=
(
VelocityEngine
)
vefb
.
getObject
();
VelocityEngine
ve
=
vefb
.
getObject
();
assertEquals
(
"/mydir"
,
ve
.
getProperty
(
"myprop"
));
assertEquals
(
value
,
ve
.
getProperty
(
"myentry"
));
}
...
...
@@ -79,7 +79,7 @@ public class VelocityConfigurerTests extends TestCase {
vefb
.
setResourceLoaderPath
(
"file:/mydir"
);
vefb
.
afterPropertiesSet
();
assertTrue
(
vefb
.
getObject
()
instanceof
VelocityEngine
);
VelocityEngine
ve
=
(
VelocityEngine
)
vefb
.
getObject
();
VelocityEngine
ve
=
vefb
.
getObject
();
assertEquals
(
new
File
(
"/mydir"
).
getAbsolutePath
(),
ve
.
getProperty
(
VelocityEngine
.
FILE_RESOURCE_LOADER_PATH
));
}
...
...
@@ -104,7 +104,7 @@ public class VelocityConfigurerTests extends TestCase {
});
vefb
.
afterPropertiesSet
();
assertTrue
(
vefb
.
getObject
()
instanceof
VelocityEngine
);
VelocityEngine
ve
=
(
VelocityEngine
)
vefb
.
getObject
();
VelocityEngine
ve
=
vefb
.
getObject
();
assertEquals
(
"test"
,
VelocityEngineUtils
.
mergeTemplateIntoString
(
ve
,
"test"
,
new
HashMap
()));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录