Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
b541fc93
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,发现更多精彩内容 >>
提交
b541fc93
编写于
3月 05, 2015
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
上级
1e26d17a
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
65 addition
and
63 deletion
+65
-63
spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.java
...k/beans/factory/config/PropertyPlaceholderConfigurer.java
+2
-3
spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionBuilder.java
...ramework/beans/factory/support/BeanDefinitionBuilder.java
+2
-2
spring-context/src/main/java/org/springframework/context/annotation/Role.java
...ain/java/org/springframework/context/annotation/Role.java
+9
-9
spring-context/src/main/java/org/springframework/scheduling/annotation/ProxyAsyncConfiguration.java
...mework/scheduling/annotation/ProxyAsyncConfiguration.java
+1
-1
spring-core/src/test/java/org/springframework/core/convert/support/ByteBufferConverterTests.java
...mework/core/convert/support/ByteBufferConverterTests.java
+8
-5
spring-core/src/test/java/org/springframework/tests/TestGroup.java
...re/src/test/java/org/springframework/tests/TestGroup.java
+3
-2
spring-jms/src/main/java/org/springframework/jms/annotation/JmsBootstrapConfiguration.java
...ngframework/jms/annotation/JmsBootstrapConfiguration.java
+1
-1
spring-oxm/src/test/java/org/springframework/oxm/castor/CastorMarshallerTests.java
...org/springframework/oxm/castor/CastorMarshallerTests.java
+31
-31
spring-oxm/src/test/java/org/springframework/oxm/castor/CastorUnmarshallerTests.java
...g/springframework/oxm/castor/CastorUnmarshallerTests.java
+5
-7
spring-web/src/main/java/org/springframework/web/bind/annotation/RequestBody.java
.../org/springframework/web/bind/annotation/RequestBody.java
+3
-2
未找到文件。
spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.java
浏览文件 @
b541fc93
/*
* Copyright 2002-201
3
the original author or authors.
* Copyright 2002-201
5
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -219,8 +219,7 @@ public class PropertyPlaceholderConfigurer extends PlaceholderConfigurerSupport
throws
BeansException
{
StringValueResolver
valueResolver
=
new
PlaceholderResolvingStringValueResolver
(
props
);
this
.
doProcessProperties
(
beanFactoryToProcess
,
valueResolver
);
doProcessProperties
(
beanFactoryToProcess
,
valueResolver
);
}
/**
...
...
spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionBuilder.java
浏览文件 @
b541fc93
/*
* Copyright 2002-201
4
the original author or authors.
* Copyright 2002-201
5
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -269,7 +269,7 @@ public class BeanDefinitionBuilder {
*/
public
BeanDefinitionBuilder
addDependsOn
(
String
beanName
)
{
if
(
this
.
beanDefinition
.
getDependsOn
()
==
null
)
{
this
.
beanDefinition
.
setDependsOn
(
new
String
[]
{
beanName
}
);
this
.
beanDefinition
.
setDependsOn
(
beanName
);
}
else
{
String
[]
added
=
ObjectUtils
.
addObjectToArray
(
this
.
beanDefinition
.
getDependsOn
(),
beanName
);
...
...
spring-context/src/main/java/org/springframework/context/annotation/Role.java
浏览文件 @
b541fc93
/*
* Copyright 2002-201
1
the original author or authors.
* Copyright 2002-201
5
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -28,16 +28,16 @@ import org.springframework.beans.factory.config.BeanDefinition;
* Indicates the 'role' hint for a given bean.
*
* <p>May be used on any class directly or indirectly annotated with
* {@link org.springframework.stereotype.Component} or on methods
annotated with
* {@link Bean}.
* {@link org.springframework.stereotype.Component} or on methods
*
annotated with
{@link Bean}.
*
* <p>If this annotation is not present on a Component or Bean definition,
the
* default value of {@link BeanDefinition#ROLE_APPLICATION} will apply.
* <p>If this annotation is not present on a Component or Bean definition,
*
the
default value of {@link BeanDefinition#ROLE_APPLICATION} will apply.
*
* <p>If Role is present on a {@link Configuration @Configuration} class,
this
*
indicates the role of the configuration class bean definition and does not
*
cascade to all @{@code Bean} methods defined within. This behavior is
* different than that of the @{@link Lazy} annotation, for example.
* <p>If Role is present on a {@link Configuration @Configuration} class,
*
this indicates the role of the configuration class bean definition and
*
does not cascade to all @{@code Bean} methods defined within. This behavior
*
is
different than that of the @{@link Lazy} annotation, for example.
*
* @author Chris Beams
* @since 3.1
...
...
spring-context/src/main/java/org/springframework/scheduling/annotation/ProxyAsyncConfiguration.java
浏览文件 @
b541fc93
...
...
@@ -45,7 +45,7 @@ public class ProxyAsyncConfiguration extends AbstractAsyncConfiguration {
public
AsyncAnnotationBeanPostProcessor
asyncAdvisor
()
{
Assert
.
notNull
(
this
.
enableAsync
,
"@EnableAsync annotation metadata was not injected"
);
AsyncAnnotationBeanPostProcessor
bpp
=
new
AsyncAnnotationBeanPostProcessor
();
Class
<?
extends
Annotation
>
customAsyncAnnotation
=
enableAsync
.
getClass
(
"annotation"
);
Class
<?
extends
Annotation
>
customAsyncAnnotation
=
this
.
enableAsync
.
getClass
(
"annotation"
);
if
(
customAsyncAnnotation
!=
AnnotationUtils
.
getDefaultValue
(
EnableAsync
.
class
,
"annotation"
))
{
bpp
.
setAsyncAnnotationType
(
customAsyncAnnotation
);
}
...
...
spring-core/src/test/java/org/springframework/core/convert/support/ByteBufferConverterTests.java
浏览文件 @
b541fc93
/*
* Copyright 2002-201
3
the original author or authors.
* Copyright 2002-201
5
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -35,6 +35,7 @@ public class ByteBufferConverterTests {
private
GenericConversionService
conversionService
;
@Before
public
void
setup
()
{
this
.
conversionService
=
new
GenericConversionService
();
...
...
@@ -43,6 +44,7 @@ public class ByteBufferConverterTests {
this
.
conversionService
.
addConverter
(
new
OtherTypeToByteArrayConverter
());
}
@Test
public
void
byteArrayToByteBuffer
()
throws
Exception
{
byte
[]
bytes
=
new
byte
[]
{
1
,
2
,
3
};
...
...
@@ -78,6 +80,7 @@ public class ByteBufferConverterTests {
assertThat
(
bytes
,
equalTo
(
convert
.
array
()));
}
private
static
class
OtherType
{
private
byte
[]
bytes
;
...
...
@@ -88,8 +91,8 @@ public class ByteBufferConverterTests {
}
private
static
class
ByteArrayToOtherTypeConverter
implements
Converter
<
byte
[],
OtherType
>
{
private
static
class
ByteArrayToOtherTypeConverter
implements
Converter
<
byte
[],
OtherType
>
{
@Override
public
OtherType
convert
(
byte
[]
source
)
{
...
...
@@ -97,8 +100,8 @@ public class ByteBufferConverterTests {
}
}
private
static
class
OtherTypeToByteArrayConverter
implements
Converter
<
OtherType
,
byte
[]>
{
private
static
class
OtherTypeToByteArrayConverter
implements
Converter
<
OtherType
,
byte
[]>
{
@Override
public
byte
[]
convert
(
OtherType
source
)
{
...
...
spring-core/src/test/java/org/springframework/tests/TestGroup.java
浏览文件 @
b541fc93
/*
* Copyright 2002-201
3
the original author or authors.
* Copyright 2002-201
5
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -34,7 +34,6 @@ import static java.lang.String.*;
*/
public
enum
TestGroup
{
/**
* Tests that take a considerable amount of time to run. Any test lasting longer than
* 500ms should be considered a candidate in order to avoid making the overall test
...
...
@@ -68,6 +67,7 @@ public enum TestGroup {
*/
CUSTOM_COMPILATION
;
/**
* Parse the specified comma separated string of groups.
* @param value the comma separated string of groups
...
...
@@ -102,4 +102,5 @@ public enum TestGroup {
}
return
groups
;
}
}
spring-jms/src/main/java/org/springframework/jms/annotation/JmsBootstrapConfiguration.java
浏览文件 @
b541fc93
...
...
@@ -29,7 +29,7 @@ import org.springframework.jms.config.JmsListenerEndpointRegistry;
* a default {@link JmsListenerEndpointRegistry}.
*
* <p>This configuration class is automatically imported when using the @{@link EnableJms}
* annotation.
See {@link EnableJms} Javadoc for complete usage
.
* annotation.
See the {@link EnableJms} javadocs for complete usage details
.
*
* @author Stephane Nicoll
* @since 4.1
...
...
spring-oxm/src/test/java/org/springframework/oxm/castor/CastorMarshallerTests.java
浏览文件 @
b541fc93
/*
* Copyright 2002-201
4
the original author or authors.
* Copyright 2002-201
5
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -55,55 +55,56 @@ public class CastorMarshallerTests extends AbstractMarshallerTests {
/**
* Represents the expected result that doesn't contain the xml declaration.
*/
private
static
final
String
DOCUMENT_EXPECTED_STRING
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+
"<tns:flights xmlns:tns=\"http://samples.springframework.org/flight\">"
+
"<tns:flight><tns:number>42</tns:number></tns:flight></tns:flights>"
;
private
static
final
String
DOCUMENT_EXPECTED_STRING
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+
"<tns:flights xmlns:tns=\"http://samples.springframework.org/flight\">"
+
"<tns:flight><tns:number>42</tns:number></tns:flight></tns:flights>"
;
/**
* Represents the expected result that doesn't contain the xml namespaces.
*/
private
static
final
String
SUPPRESSED_NAMESPACE_EXPECTED_STRING
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><flights><flight><number>42</number></flight></flights>"
;
private
static
final
String
SUPPRESSED_NAMESPACE_EXPECTED_STRING
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><flights><flight><number>42</number></flight></flights>"
;
/**
* Represents the expected result with modified root element name.
*/
private
static
final
String
ROOT_ELEMENT_EXPECTED_STRING
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+
"<tns:canceledFlights xmlns:tns=\"http://samples.springframework.org/flight\">"
+
"<tns:flight><tns:number>42</tns:number></tns:flight></tns:canceledFlights>"
;
private
static
final
String
ROOT_ELEMENT_EXPECTED_STRING
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+
"<tns:canceledFlights xmlns:tns=\"http://samples.springframework.org/flight\">"
+
"<tns:flight><tns:number>42</tns:number></tns:flight></tns:canceledFlights>"
;
/**
* Represents the expected result with 'xsi:type' attribute.
*/
private
static
final
String
XSI_EXPECTED_STRING
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+
"<objects><castor-object xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""
+
" xmlns:java=\"http://java.sun.com\""
+
" xsi:type=\"java:org.springframework.oxm.castor.CastorObject\">"
+
"<name>test</name><value>8</value></castor-object></objects>"
;
private
static
final
String
XSI_EXPECTED_STRING
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+
"<objects><castor-object xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""
+
" xmlns:java=\"http://java.sun.com\""
+
" xsi:type=\"java:org.springframework.oxm.castor.CastorObject\">"
+
"<name>test</name><value>8</value></castor-object></objects>"
;
/**
* Represents the expected result with suppressed 'xsi:type' attribute.
*/
private
static
final
String
SUPPRESSED_XSI_EXPECTED_STRING
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+
"<objects><castor-object><name>test</name><value>8</value></castor-object></objects>"
;
private
static
final
String
SUPPRESSED_XSI_EXPECTED_STRING
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+
"<objects><castor-object><name>test</name><value>8</value></castor-object></objects>"
;
/**
* Represents the expected result with 'xsi:type' attribute for root element.
*/
private
static
final
String
ROOT_WITH_XSI_EXPECTED_STRING
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+
"<objects xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""
+
" xmlns:java=\"http://java.sun.com\""
+
" xsi:type=\"java:java.util.Arrays$ArrayList\">"
+
"<castor-object xsi:type=\"java:org.springframework.oxm.castor.CastorObject\">"
+
"<name>test</name><value>8</value></castor-object></objects>"
;
private
static
final
String
ROOT_WITH_XSI_EXPECTED_STRING
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+
"<objects xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""
+
" xmlns:java=\"http://java.sun.com\""
+
" xsi:type=\"java:java.util.Arrays$ArrayList\">"
+
"<castor-object xsi:type=\"java:org.springframework.oxm.castor.CastorObject\">"
+
"<name>test</name><value>8</value></castor-object></objects>"
;
/**
* Represents the expected result without 'xsi:type' attribute for root element.
*/
private
static
final
String
ROOT_WITHOUT_XSI_EXPECTED_STRING
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+
"<objects><castor-object xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""
+
" xmlns:java=\"http://java.sun.com\""
+
" xsi:type=\"java:org.springframework.oxm.castor.CastorObject\">"
+
"<name>test</name><value>8</value></castor-object></objects>"
;
private
static
final
String
ROOT_WITHOUT_XSI_EXPECTED_STRING
=
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+
"<objects><castor-object xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""
+
" xmlns:java=\"http://java.sun.com\""
+
" xsi:type=\"java:org.springframework.oxm.castor.CastorObject\">"
+
"<name>test</name><value>8</value></castor-object></objects>"
;
@Override
...
...
@@ -277,9 +278,9 @@ public class CastorMarshallerTests extends AbstractMarshallerTests {
}
/**
* Asserts the values of xpath expression evaluation is exactly the same as expected value.
</p> The xpath may contain
*
the xml namespace prefixes, since namespaces from flight example are being registered.
*
* Asserts the values of xpath expression evaluation is exactly the same as expected value.
*
<p>The xpath may contain the xml namespace prefixes, since namespaces from flight example
*
are being registered.
* @param msg the error message that will be used in case of test failure
* @param expected the expected value
* @param xpath the xpath to evaluate
...
...
@@ -302,8 +303,6 @@ public class CastorMarshallerTests extends AbstractMarshallerTests {
/**
* Creates a instance of {@link CastorObject} for testing.
*
* @return a instance of {@link CastorObject}
*/
private
CastorObject
createCastorObject
()
{
CastorObject
castorObject
=
new
CastorObject
();
...
...
@@ -311,4 +310,5 @@ public class CastorMarshallerTests extends AbstractMarshallerTests {
castorObject
.
setValue
(
8
);
return
castorObject
;
}
}
spring-oxm/src/test/java/org/springframework/oxm/castor/CastorUnmarshallerTests.java
浏览文件 @
b541fc93
/*
* Copyright 2002-201
4
the original author or authors.
* Copyright 2002-201
5
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -47,15 +47,16 @@ public class CastorUnmarshallerTests extends AbstractUnmarshallerTests {
*/
protected
static
final
String
EXTRA_ATTRIBUTES_STRING
=
"<tns:flights xmlns:tns=\"http://samples.springframework.org/flight\">"
+
"<tns:flight status=\"canceled\"><tns:number>42</tns:number></tns:flight></tns:flights>"
;
"<tns:flight status=\"canceled\"><tns:number>42</tns:number></tns:flight></tns:flights>"
;
/**
* Represents the xml with additional element that is not mapped in Castor config.
*/
protected
static
final
String
EXTRA_ELEMENTS_STRING
=
"<tns:flights xmlns:tns=\"http://samples.springframework.org/flight\">"
+
"<tns:flight><tns:number>42</tns:number><tns:date>2011-06-14</tns:date>"
+
"</tns:flight></tns:flights>"
;
"<tns:flight><tns:number>42</tns:number><tns:date>2011-06-14</tns:date>"
+
"</tns:flight></tns:flights>"
;
@Override
protected
void
testFlights
(
Object
o
)
{
...
...
@@ -237,7 +238,6 @@ public class CastorUnmarshallerTests extends AbstractUnmarshallerTests {
@Test
public
void
unmarshalSaxSourceExternalEntities
()
throws
Exception
{
final
AtomicReference
<
XMLReader
>
result
=
new
AtomicReference
<
XMLReader
>();
CastorMarshaller
marshaller
=
new
CastorMarshaller
()
{
@Override
...
...
@@ -248,13 +248,11 @@ public class CastorUnmarshallerTests extends AbstractUnmarshallerTests {
};
// 1. external-general-entities disabled (default)
marshaller
.
unmarshal
(
new
SAXSource
(
new
InputSource
(
"1"
)));
assertNotNull
(
result
.
get
());
assertEquals
(
false
,
result
.
get
().
getFeature
(
"http://xml.org/sax/features/external-general-entities"
));
// 2. external-general-entities disabled (default)
result
.
set
(
null
);
marshaller
.
setProcessExternalEntities
(
true
);
marshaller
.
unmarshal
(
new
SAXSource
(
new
InputSource
(
"1"
)));
...
...
spring-web/src/main/java/org/springframework/web/bind/annotation/RequestBody.java
浏览文件 @
b541fc93
/*
* Copyright 2002-201
2
the original author or authors.
* Copyright 2002-201
5
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -33,11 +33,11 @@ import org.springframework.http.converter.HttpMessageConverter;
* <p>Supported for annotated handler methods in Servlet environments.
*
* @author Arjen Poutsma
* @since 3.0
* @see RequestHeader
* @see ResponseBody
* @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter
* @see org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
* @since 3.0
*/
@Target
(
ElementType
.
PARAMETER
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
...
...
@@ -49,6 +49,7 @@ public @interface RequestBody {
* <p>Default is {@code true}, leading to an exception thrown in case
* there is no body content. Switch this to {@code false} if you prefer
* {@code null} to be passed when the body content is {@code null}.
* @since 3.2
*/
boolean
required
()
default
true
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录