Commit Graph

13870 Commits

Author SHA1 Message Date
Philippe Marschall
19e77cd140 Remove use of Boolean constructors
Codacy warns us that there are several references to Boolean
constructors in the tests. Direct usage of the Boolean constructor is
discouraged and even deprecated in Java 9 [1]. Boolean constructor use
can easily be replaced with the constant instances.

This commit contains the following changes:

 - replace references to Boolean constructors with boolean constants in
   JSP tag tests
 - update the copyright year where necessary
 - BooleanComparatorTests is intentionally left unchanged as it should
   also work with the non-constant instances correctly

 [1] http://download.java.net/java/jdk9/docs/api/java/lang/Boolean.html#Boolean-boolean-

Issue: SPR-15076
2017-01-04 09:31:14 +01:00
Stephane Nicoll
4cd9710a0d Merge pull request #1282 from marschall:SPR-15077
* pr/1282:
  Avoid use of double constructor of BigDecimal
2017-01-04 09:30:55 +01:00
Philippe Marschall
3f97ab183e Avoid use of double constructor of BigDecimal
Codacy warns about an Error Prone [1] use of the double constructor of
BigDecimal in tests. The reason given is that it is a source of
precision loss if the number does not have an exact double
representation. The recommendation is to use the String constructor of
BigDecimal instead as it does not require using a lossy argument.

This commit contains the following changes:

 - replace usage of the double constructor of BigDecimal with the
   String constructor of BigDecimal in JdbcTemplateQueryTests
 - update the copyright year

 [1] http://errorprone.info/bugpattern/BigDecimalLiteralDouble

Issue: SPR-15077
2017-01-04 09:29:48 +01:00
Rob Winch
df98d304fd Fix ForwardedHeaderFilter with non-empty contextPath
Issue: SPR-15088
2017-01-03 14:51:31 -06:00
Sebastien Deleuze
e78ea34711 Temporary rollback to Kotlin 1.0.6
Kotlin 1.1-M04 has a bug that makes the generated bytecode
not compatible with Kotlin 1.0.x. This bug should be fixed in
Kotlin 1.1-M05.
2017-01-03 18:07:49 +01:00
Stephane Nicoll
d912f77a31 Merge pull request #1280 from marschall:SPR-15075
* pr/1280:
  Remove String#toCharArray from ScriptUtils
2017-01-03 18:02:10 +01:00
Philippe Marschall
35bd00beaf Remove String#toCharArray from ScriptUtils
ScriptUtils contains two calls to String#toCharArray for the sole
purpose to iterating over all chars in a String. Not only is this
unnecessary and can be replaced with String#charAt it also causes
additional allocator and heap pressure because String#toCharArray
rather than returning the backing array (which is gone in Java 9)
creates a copy.

This commit contains the following changes:

 - remove String#toCharArray from ScriptUtils and replace with
   String#charAt

Issue: SPR-15075
2017-01-03 17:57:22 +01:00
Brian Clozel
1ab0916bed Fix default content-type for ResourceRegion HTTP responses
Prior to this commit, the `ResourceRegionHttpMessageConverter` would
rely on the default implementation of `getDefaultContentType` to guess
the default Content-Type of the resource region to be written to the
HTTP response. That implementation fetches the first media type
provided in the HTTP request "Accept" header.

This behavior is not correct when converting resources and this commits
aligns this converter with the `ResourceHttpMessageConverter` which uses
JAF to guess the correct Content-Type of the given resource, or just
returns "application/octet-stream" as a default value.

Issue: SPR-15041
2017-01-02 22:04:20 +01:00
Sebastien Deleuze
badde3a479 Add Kotlin based ScriptTemplateView rendering test
Kotlin JSR 223 support currently requires kotlin-script-util
dependency (jcabi-aether, maven-core and aether-api can be
excluded since they are only used for live import of
dependencies and bring a lot of JARs in the classpath) and a
/META-INF/services/javax.script.ScriptEngineFactory
file specifying the ScriptEngineFactory to use, in that case
org.jetbrains.kotlin.script.jsr223.KotlinJsr223JvmLocalScriptEngineFactory.

Issue: SPR-15059
2017-01-01 14:17:39 +01:00
Sebastien Deleuze
ef4340063e Upgrade to Kotlin 1.1-M04
Needed for Kotlin script and JSR 223 support, and a good target
for Spring Framework 5.0 since it will allow features like generating
Java 8 bytecode, JDK 9 support, annotation array attribute single
value without arrayOf(), etc.

We ensure Kotlin 1.0 compatibility by setting apiVersion and
languageVersion compiler options to 1.0.

Issue: SPR-15059
2017-01-01 13:48:08 +01:00
Stephane Nicoll
276cfd8993 Fix Jdiff generation with Java8 2016-12-30 14:53:16 +01:00
Juergen Hoeller
e8a082fbe1 Clarified setAutowireCandidate semantics (plus attribute reordering in BeanDefinition)
Issue: SPR-15072
2016-12-30 11:30:18 +01:00
Juergen Hoeller
ccabff6ba3 Upgrade to ASM 5.2
Issue: SPR-15071
2016-12-30 11:20:54 +01:00
Juergen Hoeller
311522bc86 Run reactive integration tests only as part of performance group 2016-12-29 22:41:23 +01:00
Juergen Hoeller
fc629bb508 Polishing 2016-12-29 22:39:36 +01:00
Juergen Hoeller
a5c6658d2c Track bean dependencies for calls between @Bean methods within @Configuration classes
Issue: SPR-15069
2016-12-29 22:38:00 +01:00
Juergen Hoeller
edc62be231 @Scheduled reliably applies after other post-processors and shuts down before TaskScheduler
Issue: SPR-14692
Issue: SPR-15067
2016-12-29 22:35:10 +01:00
Rossen Stoyanchev
a30ceafc2c Update image 2016-12-29 13:17:13 -05:00
Rossen Stoyanchev
58d79fffd8 Doc updates 2016-12-29 13:07:36 -05:00
Rossen Stoyanchev
5333f9cbf1 Doc updates 2016-12-29 13:01:36 -05:00
Rossen Stoyanchev
6bf12812f1 More documentation updates 2016-12-29 12:35:01 -05:00
Rossen Stoyanchev
e62b104e03 Resource cleanup on shutdown in ReactorNettyTcpClient 2016-12-28 21:37:12 -05:00
Rossen Stoyanchev
698c885e06 Reconnect failures delegated to TcpConnectionHandler
When connecting with a ReconnectStrategy we can only report the outcome
of the first connect to the ListenableFuture<Void> return value.

Failures for all subsequent attempts to reconnect however must be
channeled to TcpConnectHandler#afterConnectFailure which is used in
the STOMP broker relay for example to publish
BroadcastAvailability(true/false) events.
2016-12-28 21:37:07 -05:00
Rossen Stoyanchev
ea274ebc0a Fix decoding issue in Reactor TcpClient
When decoding STOMP messages unread portions of a given input ByteBuf
must be kept until more input is received and the next complete STOMP
frame can be parsed.

In Reactor Net 2.x this was handled for us through the "remainder"
field in NettyChannelHandlerBridge. The Reactor Netty 0.6 upgrade
however applied only a simple map operator on the input ByteBuf
after which the buffer is relased.

This commit replaces the use of a simple map operator for decoding
and installs a ByteToMessageDecoder in the Netty channel pipeline
which has a built-in ability to preserve and merge unread input into
subsequent input buffers.
2016-12-28 21:36:37 -05:00
Rossen Stoyanchev
fdf88c9795 Workaround for onReadIdle issue in Reactor TcpClient
https://github.com/reactor/reactor-netty/issues/22
2016-12-28 21:36:37 -05:00
Rossen Stoyanchev
2a3e01399a Polish ReactorNettyTcpClient 2016-12-28 21:36:37 -05:00
Juergen Hoeller
e38c020535 TypeDescriptor efficiently matches equal annotations as well
Issue: SPR-15060
2016-12-28 22:51:29 +01:00
Sebastien Deleuze
963ea062e4 Update Spring Web Reactive reference documentation
Issue: SPR-14912
2016-12-28 18:48:35 +01:00
Juergen Hoeller
209e7a700d Avoid FactoryBean initialization on isSingleton check for decorated bean definition
Issue: SPR-14892
Issue: SPR-15042
2016-12-28 17:27:06 +01:00
Juergen Hoeller
cff311b03c Remove outdated JpaExceptionTranslatorAspect
Issue: SPR-15047
2016-12-28 17:22:57 +01:00
Juergen Hoeller
9c62b1eaf7 Polishing 2016-12-28 17:22:18 +01:00
Sebastien Deleuze
4cd3309890 Remove snapshot repository
reactor-netty-0.6.0.RELEASE on Maven Central depends on
reactor-ipc-0.6.0.RELEASE so no need for this repository anymore.

It may be needed to cleanup Gradle or Maven local cache
since preliminary version of reactor-netty-0.6.0.RELEASE
had a dependency on reactor-ipc-0.6.0.BUILD-SNAPSHOT.
2016-12-28 12:36:49 +01:00
Rossen Stoyanchev
4a380b8401 Add RequestDataValueProcessor in spring-web-reactive
Issue: SPR-15001
2016-12-27 17:42:01 -05:00
Rossen Stoyanchev
e4d39bb86f Refactor Undertow WebSocket client configuration model
This commit removes the statically created XnioWorker which is an
"active" component and should not be created automatically and could
lead to resource leaks. Instead XnioWorker is now required at
construction aligning better with WebSocketClient#connectionBuilder
which also does not have a "default" worker option.

Since the XnioWorker is the main input for creating a ConnectionBuilder
we now create the ConnectionBuider in a protected method and then allow
a Consumer<ConnectionBuilder> to configure it further as opposed to the
Function<URI, ConnectionBuilder> used previously.

This commit also removes default SSL context initialization for RxNetty
to better align with other client implementations.

Issue: SPR-14527
2016-12-27 16:02:40 -05:00
Rossen Stoyanchev
384e851bd1 Polish reactive WebSocketClient implementations 2016-12-27 13:44:59 -05:00
Sebastien Deleuze
c18ebdeee0 Upgrade to Kotlin 1.0.6 2016-12-27 18:12:58 +01:00
Sebastien Deleuze
58e113a591 Avoid NPE in AutoProxyRegistrar when no attribute found
Issue: SPR-15055
2016-12-27 16:37:01 +01:00
Juergen Hoeller
7818c650ba Cache ASM metadata at the context level (if supported)
Includes streamlined ClassPathBeanDefinitionScanner setup.

Issue: SPR-14654
2016-12-27 13:38:24 +01:00
Juergen Hoeller
048098119e PATCH does not work with the standard JDK HTTP library
Issue: SPR-15052
2016-12-27 13:32:43 +01:00
Sebastien Deleuze
6a850ee688 Polishing 2016-12-27 10:08:12 +01:00
Sebastien Deleuze
546687d5e4 Add Kotlin extension for RestTemplate
Issue: SPR-15056
2016-12-27 10:08:02 +01:00
Sebastien Deleuze
3626a1c7f9 Add Kotlin extensions for function Web API
Issue: SPR-15054
2016-12-27 08:47:58 +01:00
Juergen Hoeller
bb94ba6e3f DateFormatter's ISO patterns use XXX timezone notation (as per SimpleDateFormat's javadoc)
Issue: SPR-14675
2016-12-26 22:31:27 +01:00
Juergen Hoeller
64d6561cbb AbstractNestablePropertyAccessor's setPropertyValue refactored into several delegate methods
Issue: SPR-15053
2016-12-26 19:47:26 +01:00
Juergen Hoeller
47be2d8786 Upgrade to Undertow 1.4.8 and XNIO 3.4.3 2016-12-26 19:37:53 +01:00
Sebastien Deleuze
ff675f5226 Add Kotlin extensions for bean registration and retrieval
Issue: SPR-15048
2016-12-26 14:21:10 +01:00
Juergen Hoeller
a8741dd371 Polishing 2016-12-26 11:26:58 +01:00
Juergen Hoeller
f805427629 Detect generic type match behind interface-based proxy as well
Issue: SPR-14097
2016-12-26 11:23:07 +01:00
Juergen Hoeller
0208198804 Expose reflection metadata with ASM-driven method order
Issue: SPR-14505
2016-12-26 11:00:22 +01:00
Juergen Hoeller
fd41f63ec0 Clarify programmatic contract (no annotation-driven injection)
Issue: SPR-8704
2016-12-26 10:57:50 +01:00