Commit Graph

980 Commits

Author SHA1 Message Date
Sam Brannen 917c41fd52 Use Set.of() for constant sets where appropriate 2022-11-21 16:49:07 +01:00
Sam Brannen abf3400c07 Use Assert.state() where appropriate 2022-11-15 12:31:10 +01:00
Sam Brannen 2aa78889d2 Use consistent wording in precondition error messages 2022-11-15 12:31:01 +01:00
Sam Brannen f26a7dee97 Fix broken tests, update copyright dates, and polish
See gh-29414
2022-11-08 20:07:53 +01:00
Kulwant Singh b2c8546013 Rely on automatic boxing/unboxing in tests
Closes gh-29414
2022-11-08 19:38:03 +01:00
Sam Brannen e058a6061a Move DataFieldMaxValueIncrementerTests to the appropriate package 2022-11-08 18:02:19 +01:00
Sam Brannen 8595493599 Polish contribution 2022-11-08 18:00:50 +01:00
Mahmoud Ben Hassine f9ed0721a8 Introduce DataFieldMaxValueIncrementer for SQL Server sequences
This commit introduces SqlServerSequenceMaxValueIncrementer to support
SQL Server sequences, complementing the existing
SqlServerMaxValueIncrementer for table-based support.

Closes gh-29447
2022-11-08 17:54:16 +01:00
Sam Brannen 210019cad1 Polish contribution
See gh-29379
2022-11-01 11:41:41 +01:00
Mahmoud Ben Hassine 39f24f0244 Introduce DataFieldMaxValueIncrementer for MariaDB
Closes gh-29379
2022-11-01 11:27:34 +01:00
Juergen Hoeller aaa22ad07d Remove square brackets with index/key expressions from generated SQL
See gh-27925
2022-10-19 18:23:49 +02:00
Juergen Hoeller d4fac82d68 Preserve square brackets for index/key expressions
Closes gh-27925
2022-10-18 22:39:53 +02:00
Juergen Hoeller 311048726e Upgrade to Derby 10.16
Closes gh-29344
2022-10-18 18:29:15 +02:00
Sébastien Deleuze 8ed1906f43 Refine SQLErrorCodesFactory reachability on native images
SQLErrorCodeSQLExceptionTranslator#USER_PROVIDED_ERROR_CODES_FILE_PRESENT
evaluation at build time combined with the lazy
SQLErrorCodesFactory#instance initialization allow to
avoid making SQLErrorCodesFactory constructor reachable
when no custom sql-error-codes.xml is provided.

Closes gh-29294
2022-10-10 12:11:19 +02:00
Sébastien Deleuze 42c3ac64ff Remove spring.spel.ignore and spring.xml.ignore flags
This commit also removes ResourcePropertiesPersister which
was introduced in 5.3 specifically for spring.xml.ignore
flag and which is expected to be used only internally by
Spring Framework. DefaultPropertiesPersister should be used
instead.

Closes gh-29277
2022-10-10 12:11:19 +02:00
Sam Brannen ae368a20b8 Merge branch '5.3.x'
# Conflicts:
#	spring-web/src/test/kotlin/org/springframework/http/codec/json/KotlinSerializationJsonDecoderTests.kt
#	spring-web/src/test/kotlin/org/springframework/http/codec/json/KotlinSerializationJsonEncoderTests.kt
2022-10-08 14:06:41 +02:00
Johnny Lim 1c1a0afbed Use AssertJ static imports consistently in 5.3.x
Closes gh-29282
2022-10-08 13:57:21 +02:00
Sébastien Deleuze ff81d64fb5 Add reflection hint for EmbeddedDataSourceProxy#shutdown
This commit adds a reflection hint on
EmbeddedDatabaseFactory$EmbeddedDataSourceProxy#shutdown when
EmbeddedDatabaseFactory is reachable in order to allow its usage
as bean destroy method.

Closes gh-29259
2022-10-05 14:08:09 +02:00
Sam Brannen b87d48b99b Merge branch '5.3.x' 2022-09-14 17:18:00 +02:00
Marc Wrobel ce49068ff9 Fix links in Javadoc and reference docs
- Fix broken links (by using a new URL, an alternative URL, or a
  Wayback Machine link)

- Use HTTPS where possible

- Remove https://issuetracker.springsource.com/browse/EBR-349: this
  link is dead and is also mentioned in
  https://jira.spring.io/browse/SPR-8093

- Clean up nohttp allowlist.lines

Closes gh-28876
2022-09-14 17:00:11 +02:00
Sam Brannen 8d92c57777 Merge branch '5.3.x'
# Conflicts:
#	spring-tx/src/main/java/org/springframework/jca/cci/core/support/CciDaoSupport.java
2022-09-14 16:52:55 +02:00
Marc Wrobel 92a231cf91 Fix typos in Javadoc, reference docs, and code
Closes gh-28822
2022-09-14 16:45:34 +02:00
Brian Clozel 0770d86936 Deprecate StreamUtils.emptyInput()
Closes gh-29125
2022-09-12 10:21:50 +02:00
Brian Clozel 2b5ca63339 Fix serialization compiler warnings with Java 18
As of Java 18, the serial lint warning in javac has been expanded to
check for class fields that are not marked as `Serializable`.
See https://www.oracle.com/java/technologies/javase/18all-relnotes.html#JDK-8202056

In the Spring Framework codebase, this can happen with `Map`, `Set` or
`List` attributes which are often assigned with an unmodifiable
implementation variant. Such implementations are `Serializable` but
cannot be used as field types.

This commit ensures that the following changes are applied:
* fields are marked as transient if they can't be serialized
* classes are marked as `Serializable` if this was missing
* `@SuppressWarnings("serial")` is applied where relevant
2022-09-09 20:24:26 +02:00
Sam Brannen 261124f497 Remove flaky executesHugeScriptInReasonableTime() tests
These tests often fail on the CI server and do not provide any
meaningful information when they fail, since only a proper benchmark
would suffice. Furthermore, the test method was introduced 10 years
ago to address deficiencies in JDK 7 which no longer exist.

See gh-14415
2022-09-08 13:18:05 +02:00
Brian Clozel c470262c8e Rewrite ConcurrentLruCache implementation
Prior to this commit, the `ConcurrentLruCache` implementation would not
perform well under certain conditions. As long as the cache capacity was
not reached, the cache would avoid maintaining an eviction queue
(reordering entries depending with least/most recently read). When the
cache capacity was reached, the LRU queue was updated for each
read/write operation. This decreased performance significantly under
contention when the capacity was reached.

This commit completely rewrites the internals of `ConcurrentLruCache`.
`ConcurrentLruCache` is now a specialized version of the
`ConcurrentLinkedHashMap` [1]. This change focuses on buferring read and
write operations, only processing them at certain times to avoid
contention.

When a cached entry is read, a read operation is queued and buffered
operations are drained if the buffer reached a fixed limit. When a new
cache entry is added or removed, a write operation is queued and
triggers a drain attempt. When the capacity is outgrown, the cache polls
items from the eviction queue, which maintains elements with the
least recently used ones first. Entries are removed until the capacity
is under control.

The behavior described here and the buffer sizes are optimized with the
number of available processors in mind. Work is localized as much as
possible on a per-thread basis to avoid contention on the eviction queue.

The new implementation has been tested with the JMH benchmark provided
here, comparing the former `COncurrentLruCache`, the new implementation
as well as the `ConcurrentLinkedHashMap` [1].

When testing with a cache reaching capacity, under contention, with a
10% cache miss, we're seeing a 40x improvement compared to the previous
implementation and performance on par with the reference.
See [2] for how to replicate the benchmark.

[1] https://github.com/ben-manes/concurrentlinkedhashmap
[2] https://github.com/spring-projects/spring-framework/wiki/Micro-Benchmarks

Closes gh-26320
2022-08-31 19:10:50 +02:00
ben-enfuse-io 21577c4777 Treat MariaDB as an independent database type
See gh-28355
2022-08-23 07:44:02 +02:00
Stephane Nicoll f9ee8a93ad Polish "Improve test coverage of RdbmsOperation"
See gh-28472
2022-07-29 17:36:33 +02:00
Jiayi Li 608be54a58 Improve test coverage of RdbmsOperation
See gh-28472
2022-07-29 17:28:00 +02:00
Sam Brannen 0fb9de5d0e Merge branch '5.3.x' 2022-07-13 16:36:01 +02:00
Marc Wrobel bd3499671c Fix typos in test code
This commit fixes typos in test class names, test method names, and
test variable names.

Closes gh-28807
2022-07-13 16:24:11 +02:00
Sam Brannen ddd11610cf Merge branch '5.3.x'
# Conflicts:
#	spring-jdbc/src/main/java/org/springframework/jdbc/datasource/DriverManagerDataSource.java
#	spring-orm/src/main/java/org/springframework/orm/jpa/JpaVendorAdapter.java
2022-07-13 13:46:34 +02:00
Marc Wrobel bca104798b Fix and improve Javadoc in spring-jdbc
Closes gh-28796
2022-07-13 13:42:48 +02:00
Juergen Hoeller dfae4eec2d Merge branch '5.3.x'
# Conflicts:
#	build.gradle
#	spring-core/src/main/java/org/springframework/cglib/core/ReflectUtils.java
#	spring-core/src/main/java/org/springframework/core/ResolvableType.java
#	spring-jdbc/src/main/java/org/springframework/jdbc/core/StatementCreatorUtils.java
#	spring-r2dbc/src/main/java/org/springframework/r2dbc/connection/R2dbcTransactionManager.java
2022-07-13 11:16:13 +02:00
Juergen Hoeller 5247eeba84 Support LocalDate/Time for SQL type mappings
Closes gh-28778
2022-07-13 11:09:30 +02:00
Sam Brannen 2af08cf163 Merge branch '5.3.x'
# Conflicts:
#	spring-core/src/test/java/org/springframework/core/annotation/TypeMappedAnnotationTests.java
#	spring-test/src/test/java/org/springframework/test/context/junit4/TimedSpringRunnerTests.java
#	spring-test/src/test/java/org/springframework/test/util/MetaAnnotationUtilsTests.java
#	spring-test/src/test/java/org/springframework/test/util/OverriddenMetaAnnotationAttributesTests.java
2022-07-09 16:24:04 +02:00
Sam Brannen d274e893a6 Remove superfluous static declaration for enum, annotation, & interface 2022-07-09 16:16:13 +02:00
Sam Brannen 729c4e5434 Merge branch '5.3.x' 2022-07-01 10:43:38 +02:00
Sam Brannen 5650e20edd Polishing 2022-07-01 10:42:23 +02:00
Johnny Lim 2885177f5b Add @since tag for new CannotGetJdbcConnectionException constructor
See gh-28669
Closes gh-28738
2022-07-01 10:39:35 +02:00
Stephane Nicoll a4ccec18f6 Merge branch '5.3.x' 2022-06-23 09:04:52 +02:00
Stephane Nicoll e98b602d4f Polish "Fix DataSourceUtils inconsistent exception handling"
See gh-28669
2022-06-23 09:01:39 +02:00
Kevin Schönfeld edfe5d2f18 Fix DataSourceUtils inconsistent exception handling
Align IllegalStateException with SQLException handling and propagate
the original exception.

See gh-28669

Co-authored-by: Christoph Mies <chr.mi@web.de>
2022-06-23 09:01:39 +02:00
Juergen Hoeller d7be1e0dab Polishing 2022-06-14 15:09:39 +02:00
Juergen Hoeller 083113d8a4 Use SQLExceptionSubclassTranslator by default (avoiding sql-error-codes.xml)
SQLErrorCodeSQLExceptionTranslator kicks in for user-provided sql-error-codes.xml files. It will still pick up Spring's legacy default error code mappings as well but only when triggered by a (potentially empty) user-provided file in the root of the classpath.

Closes gh-28216
2022-06-14 14:00:56 +02:00
Sam Brannen ee209de9cf Merge branch '5.3.x'
# Conflicts:
#	spring-beans/src/test/java/org/springframework/beans/factory/support/security/CallbacksSecurityTests.java
#	spring-context/src/test/java/org/springframework/ejb/access/LocalSlsbInvokerInterceptorTests.java
#	spring-context/src/test/java/org/springframework/ejb/access/SimpleRemoteSlsbInvokerInterceptorTests.java
#	spring-web/src/test/java/org/springframework/remoting/jaxws/JaxWsSupportTests.java
#	spring-webmvc/src/test/java/org/springframework/web/servlet/config/annotation/ViewResolutionIntegrationTests.java
2022-05-31 14:15:36 +02:00
Sam Brannen 1beb7068f6 Use new AssertJ exception assertions 2022-05-31 14:08:28 +02:00
Sam Brannen 70415b1781 Merge branch '5.3.x' 2022-05-17 15:41:08 +02:00
Sam Brannen 59c7bb1f86 Use Arrays.toString instead of Arrays.asList when generating Strings 2022-05-17 15:36:31 +02:00
Sam Brannen 874077d16e Apply "advanced" instanceof pattern matching 2022-05-17 11:24:32 +02:00
Juergen Hoeller c1a5b462c2 Merge branch '5.3.x'
# Conflicts:
#	build.gradle
2022-05-10 13:39:31 +02:00
Juergen Hoeller c81e11d537 Polishing 2022-05-10 13:07:00 +02:00
Sam Brannen 5f8a4bcdc5 Merge branch '5.3.x'
# Conflicts:
#	spring-context/src/main/java/org/springframework/jmx/export/MBeanExporter.java
#	spring-context/src/main/java/org/springframework/scripting/support/StandardScriptFactory.java
2022-05-09 20:08:37 +02:00
Sam Brannen e26d8839b3 Stop referring to features as Java 6/7 features where unnecessary 2022-05-09 19:09:06 +02:00
Juergen Hoeller 7e1782ea22 Merge branch '5.3.x'
# Conflicts:
#	build.gradle
#	spring-core/src/main/java/org/springframework/core/convert/Property.java
2022-04-08 13:10:34 +02:00
Juergen Hoeller 90103b0ae9 Consistent support for direct column matches in DataClassRowMapper
Closes gh-28243
2022-04-08 13:00:31 +02:00
Juergen Hoeller c3aed75b92 Merge branch '5.3.x'
# Conflicts:
#	build.gradle
2022-03-16 11:24:24 +01:00
Juergen Hoeller 46363c337b Avoid confusing debug log entries with DataClassRowMapper
Closes gh-28179
2022-03-16 11:21:43 +01:00
Sam Brannen 04fbfddb13 Polish contribution
See gh-28011
2022-02-05 19:12:13 +01:00
lijun695 1e0e477833 Apply "instanceof pattern matching" in AbstractRoutingDataSource
Closes gh-28011
2022-02-05 18:58:08 +01:00
Sam Brannen b3f786728e Use modern language features in tests 2022-02-03 15:35:32 +01:00
Sam Brannen 32cd73261a Apply "switch expressions" where applicable 2022-02-03 15:21:18 +01:00
Sam Brannen 54565e95b5 Merge branch '5.3.x' 2022-02-03 14:58:36 +01:00
Sam Brannen f8a5a8d7be Use modern language features in tests 2022-02-03 14:50:10 +01:00
Sam Brannen 8e2bb5f3af Merge branch '5.3.x' 2022-01-28 16:40:58 +01:00
Sam Brannen fb312d0ed5 Improve Javadoc for DatabasePopulator
See gh-27008
2022-01-28 16:40:35 +01:00
Sam Brannen 19da4e309f Merge branch '5.3.x' 2022-01-17 16:55:08 +01:00
Sam Brannen 420c4f3df3 Explicitly test BeanPropertyRowMapper.underscoreName(String)
See gh-27929
2022-01-17 16:54:03 +01:00
Sam Brannen 420ff46b2a Polishing 2022-01-17 16:54:03 +01:00
Marten Deinum 261bc2ad6a Fix regression in BeanPropertyRowMapper.underscoreName(String)
Commit 6316a35 introduced a regression for property names starting with
multiple uppercase letters (such as setEMail(...)).

This commit fixes that regression and includes an additional test to
cover this case.

See gh-27929
Closes gh-27941
2022-01-17 16:53:36 +01:00
Sam Brannen ab88ff374a Merge branch '5.3.x' 2022-01-08 17:24:53 +01:00
Sam Brannen 51d263bd06 Simplify H2SequenceMaxValueIncrementerTests
@hpoettker made me aware of the ModeEnum in H2 that allows the
parameterized test to be simplified, which was the primary impetus for
this commit.

See gh-27870
2022-01-08 17:24:19 +01:00
Sam Brannen b981e36174 Merge branch '5.3.x' 2022-01-07 16:18:52 +01:00
Sam Brannen 90072d06fb Test H2SequenceMaxValueIncrementer against all H2 2.0.x compatibility modes
See gh-27870
2022-01-07 16:17:11 +01:00
Sam Brannen 7769ded887 Merge branch '5.3.x' 2022-01-07 14:31:32 +01:00
Sam Brannen 75e1811470 Ensure H2SequenceMaxValueIncrementer works with all H2 compatibility modes
See gh-27870
2022-01-07 14:29:17 +01:00
Sam Brannen 18781e58ac Polish contribution
See gh-27870
2022-01-07 10:09:45 +01:00
Henning Poettker ed4e2289cd Support H2 1.4 & 2.0 in H2SequenceMaxValueIncrementer
Prior to this commit, H2SequenceMaxValueIncrementer only supported H2
database 1.4.

This commit updates H2SequenceMaxValueIncrementer's getSequenceQuery()
method so that the syntax used supports version 1.4 and 2.0 of the H2
database.

This commit also updates several test schemas so that they work with H2
1.4 and 2.0 as well as HSQL.

Closes gh-27870
2022-01-07 10:09:27 +01:00
a.yazychyan ab240f5d8e Use String.repeat() and pattern matching instanceof
Closes gh-27834
2022-01-03 17:11:23 +01:00
Juergen Hoeller 64b6beed5b Consistent support for square brackets around named parameter
See gh-27716
2021-12-14 11:34:48 +01:00
Sam Brannen a0d54105e9 Use new features in JUnit Jupiter 5.8.2
See gh-27744
2021-11-30 13:00:28 +01:00
Stephane Nicoll 974d326bf5 Merge branch '5.3.x' 2021-11-22 16:17:17 +01:00
Stephane Nicoll b67e97d388 Polish 2021-11-22 16:13:37 +01:00
Stephane Nicoll 5eafcac3d6 Merge branch '5.3.x' 2021-11-22 13:46:45 +01:00
Stephane Nicoll 23babe27bb Polish "Add tests for AbstractRoutingDataSource"
See gh-1330
2021-11-22 13:43:08 +01:00
Kazuki Shimizu bcb9f159ca Add tests for AbstractRoutingDataSource
See gh-1330
2021-11-22 13:43:08 +01:00
Stephane Nicoll bee0af2b26 Merge branch '5.3.x' 2021-11-22 13:21:28 +01:00
Stephane Nicoll 544f357661 Polish "Refine StoredProcedure#declareParameter Javadoc"
See gh-1000
2021-11-22 13:20:16 +01:00
awgtek ca4f338d75 Refine StoredProcedure#declareParameter Javadoc
See gh-1000
2021-11-22 13:18:24 +01:00
Juergen Hoeller 4750a9430c Early removal of 5.x-deprecated code
Closes gh-27686
2021-11-18 09:18:06 +01:00
Sam Brannen 971f665eb1 Apply "instanceof pattern matching" in spring-jdbc
This commit also applies additional clean-up tasks such as the following.

- final fields

This has only been applied to `src/main/java`.
2021-10-14 19:55:14 +02:00
Sam Brannen 4fc359f75e Merge branch '5.3.x' 2021-10-14 15:19:56 +02:00
Sam Brannen 0853baaa3f Fix Javadoc in [NamedParameter]JdbcOperations.queryForObject methods
This commit fixes the Javadoc in all queryForObject(...) methods in
JdbcOperations and NamedParameterJdbcOperations regarding what kinds of
exceptions are thrown under which conditions.

Closes gh-27559
2021-10-14 15:15:23 +02:00
Sam Brannen 49c8cb5a60 Merge branch '5.3.x' 2021-10-13 19:23:18 +02:00
Sam Brannen 89c7797ffb Commit in DatabasePopulatorUtils if Connection has auto-commit=false
Prior to this commit, DatabasePopulatorUtils.execute(...) did not
perform a commit for the current Connection. This works for most use
cases; however, when DatabasePopulatorUtils is used to execute
initialization scripts without a managed transaction -- for example,
via a DataSourceInitializer configured as a bean in the
ApplicationContext or via Spring Boot configuration in
application.properties -- if the underlying database is configured with
auto-commit=false, the results of executing the SQL scripts are not
committed to the database which can lead to data being silently lost.

This commit addresses this issue by committing the Connection for the
supplied DataSource if the connection is not configured for auto-commit
and is not transactional. Existing use cases running with a managed
transaction should therefore not be affected by this change.

Closes gh-27008
2021-10-13 19:10:09 +02:00
Sam Brannen 030ba52805 Merge branch '5.3.x' 2021-09-29 16:56:33 +02:00
Sam Brannen 96e4d3a530 Fail Gradle build for Javadoc warnings
In order to catch Javadoc errors in the build, we now enable the
`Xwerror` flag for the `javadoc` tool. In addition, we now use
`Xdoclint:syntax` instead of `Xdoclint:none` in order to validate
syntax within our Javadoc.

This commit fixes all resulting Javadoc errors and warnings.

This commit also upgrades to Undertow 2.2.12.Final and fixes the
artifact names for exclusions for the Servlet and annotations APIs.

The incorrect exclusion of the Servlet API resulted in the Servlet API
being on the classpath twice for the javadoc task, which resulted in the
following warnings in previous builds.

javadoc: warning - Multiple sources of package comments found for package "javax.servlet"
javadoc: warning - Multiple sources of package comments found for package "javax.servlet.http"
javadoc: warning - Multiple sources of package comments found for package "javax.servlet.descriptor"
javadoc: warning - Multiple sources of package comments found for package "javax.servlet.annotation"

Closes gh-27480
2021-09-29 14:02:37 +02:00
Sam Brannen 16bf39ea1b Merge branch '5.3.x' 2021-09-28 10:35:18 +02:00
Sam Brannen 2567b20949 Upgrade to spring-javaformat 0.0.28 and downgrade to Checkstyle 8.41
In order to be able to use text blocks and other new Java language
features, we are upgrading to a recent version of Checkstyle.

The latest version of spring-javaformat-checkstyle (0.0.28) is built
against Checkstyle 8.32 which does not include support for language
features such as text blocks. Support for text blocks was added in
Checkstyle 8.36.

In addition, there is a binary compatibility issue between
spring-javaformat-checkstyle 0.0.28 and Checkstyle 8.42. Thus we cannot
use Checkstyle 8.42 or higher.

In this commit, we therefore upgrade to spring-javaformat-checkstyle
0.0.28 and downgrade to Checkstyle 8.41.

This change is being applied to `5.3.x` as well as `main` in order to
benefit from the enhanced checking provided in more recent versions of
Checkstyle.

Closes gh-27481
2021-09-28 10:29:31 +02:00
Juergen Hoeller f440fb8baf Unit tests for record binding
See gh-27437
2021-09-23 16:13:20 +02:00
Juergen Hoeller d84ca2ba90 Jakarta EE 9 migration
Upgrades many dependency declarations; removes old EJB 2.x support and outdated Servlet-based integrations (Commons FileUpload, FreeMarker JSP support, Tiles).

Closes gh-22093
Closes gh-25354
Closes gh-26185
Closes gh-27423
See gh-27424
2021-09-17 09:14:07 +02:00
Brian Clozel cecc0849a8 Upgrade to Gradle 7.2
This commit upgrades Gradle to 7.2.
Gradle configuration names are updated accordingly.
This also upgrades Gradle build plugins.

See gh-26870
2021-09-13 09:37:35 +02:00
Juergen Hoeller 4fe3ca1b82 DataClassRowMapper suppresses setter method calls for constructor-bound properties
Closes gh-26569
2021-07-09 13:26:39 +02:00
Sam Brannen a2ef6badc4 Use StringBuilder.append(char) where possible
To slightly improve performance, this commit switches to
StringBuilder.append(char) instead of StringBuilder.append(String)
whenever we append a single character to a StringBuilder.

Closes gh-27098
2021-06-25 10:44:28 +02:00
Sam Brannen b677206159 Polish Javadoc 2021-06-15 17:22:11 +02:00
Sam Brannen 7c756027a0 Deprecate internal APIs in ScriptUtils in spring-jdbc
Many of the utility methods in ScriptUtils are public only because they
were once invoked from JdbdTestUtils in spring-test, which is no longer
the case. Consequently, there should no longer be a need for any
external clients to invoke such methods.

To address this, this commit formally deprecates the following methods
in ScriptUtils in spring-jdbc.

- readScript(...)
- containsSqlScriptDelimiters(...)
- splitSqlScript(...)

Closes gh-26947
2021-05-18 15:43:54 +02:00
Sam Brannen 4c642ccdcd Logically reorganize methods in ScriptUtils
See gh-26947
2021-05-18 14:56:49 +02:00
Sam Brannen c80c4e001a Add missing author tags and sync SQL script support for JDBC & R2DBC 2021-05-16 17:18:56 +02:00
Sam Brannen 4cfad25468 Polish ScriptUtils implementations 2021-05-14 15:15:12 +02:00
Sam Brannen 569ce840cf Ignore comments when searching for statement delimiter in ScriptUtils
Prior to this commit, the implementations of
ScriptUtils.containsSqlScriptDelimiters() in spring-jdbc and
spring-r2dbc did not ignore comments when searching for the statement
delimiter within an SQL script. This resulted in subtle bugs if a
comment contained a single single-quote or single double-quote, since
the absence of the closing single-quote or double-quote led the
algorithm to believe that it was still "within a text literal". Similar
issues could arise if a comment contained the sought statement
delimiter but the rest of the script did not contain the sought
statement delimiter. In such cases, the algorithms in ScriptUtils could
erroneously choose an incorrect statement delimiter -- for example,
using the fallback statement delimiter instead of the delimiter
specified by the user.

This commit avoids such bugs by ignoring single-line comments and block
comments when searching for the statement delimiter within an SQL
script.

Closes gh-26911
2021-05-14 14:23:27 +02:00
Sam Brannen 84e56bb5d9 Sync ScriptUtilsUnitTests implementations to simplify maintenance 2021-05-12 12:54:35 +02:00
Sam Brannen cda72e4a70 Ignore delimiter enclosed in double quotes in ScriptUtils
Prior to this commit, the containsSqlScriptDelimiters() method in
ScriptUtils ignored delimiters enclosed in single quotes but not those
enclosed within double quotes, which contradicts the algorithm in
splitSqlScript() and therefore constitutes a bug.

This commit fixes this bug in the ScriptUtils implementations in
spring-jdbc and spring-r2dbc.

Closes gh-26935
2021-05-12 12:07:55 +02:00
Juergen Hoeller be52ec8bd5 DataClassRowMapper exposes generic constructor parameters for type conversion
Closes gh-26881
2021-05-11 16:49:25 +02:00
Sam Brannen 697108cc42 Support safe-updates mode in MySQLMaxValueIncrementer
Prior to this commit, MySQLMaxValueIncrementer could not be used when
the MySQL database was configured to use safe-updates mode.

See https://dev.mysql.com/doc/refman/8.0/en/mysql-tips.html#safe-updates

This commit introduces a `limit 1` clause to the generated update
statement to allow MySQLMaxValueIncrementer to be compatible with
MySQL safe-updates mode.

Closes gh-26858
2021-04-29 15:37:40 +02:00
Sam Brannen 1f477a5c1c Polish Javadoc for ColumnMapRowMapper
See gh-26823
2021-04-20 19:27:56 +02:00
Marten Deinum ceac2a5c3c
Remove reference to Commons Collections in ColumnMapRowMapper Javadoc
This commit removes the outdated reference to Commons Collections
in the Javadoc for ColumnMapRowMapper.

Closes gh-26823
2021-04-20 19:22:57 +02:00
Sam Brannen 5b114b7208 Cross reference DataClassRowMapper from BeanPropertyRowMapper 2021-02-23 17:30:11 +01:00
Carsten Dimmek 8de10e9199 Accept nullable values in MapSqlParameterSource set operators
Closes gh-26288
2021-02-15 17:15:58 +01:00
Juergen Hoeller 634c7710f9 Remove trailing whitespace (Checkstyle)
See gh-26471
2021-02-15 11:34:38 +01:00
Yanming Zhou 2fbfd8a5db Avoid unnecessary wrapping for SqlParameterValue
Fix https://github.com/spring-projects/spring-framework/issues/26467
2021-02-15 11:15:37 +01:00
Sam Brannen 08ce6baedf Polishing 2021-02-04 11:08:25 +01:00
Sam Brannen 7a329eba5b Do not retain partial column metadata in SimpleJdbcInsert
Prior to this commit, if an SQLException was thrown while retrieving
column metadata from the database, SimpleJdbcInsert would generate an
INSERT statement that was syntactically valid but missing columns,
which could lead to data silently missing in the database (for nullable
columns).

This commit fixes this by clearing all collected column metadata if an
SQLException is thrown while processing the metadata. The result is
that an InvalidDataAccessApiUsageException will be thrown later while
generating the INSERT statement. The exception message now contains an
additional hint to make use of SimpleJdbcInsert#usingColumns() in order
to ensure that all required columns are included in the generated
INSERT statement.

SimpleJdbcCall can also encounter an SQLException while retrieving
column metadata for a stored procedure/function, but an exception is
not thrown since a later invocation of the stored procedure/function
will likely fail anyway due to missing arguments. Consequently, this
commit only improves the warning level log message by including a hint
to make use of SimpleJdbcCall#addDeclaredParameter().

Closes gh-26486
2021-02-03 18:47:19 +01:00
Sam Brannen 91d542e406 Polishing 2021-02-03 16:27:28 +01:00
Sébastien Deleuze 6d85a8a0cc Fix JdbcOperationsExtensions
This commit reverts some changes done in 2d5f9723fa
in order to fix JdbcOperations.queryForObject and
JdbcOperations.queryForList.

It is not possible to provide a vararg variant in Kotlin
for now due to a signature clash, but that will probably
make sense in Spring Framework 6 timeframe along to array
based variant removal for both Java and Kotlin.

Closes gh-26312
2021-01-04 14:57:31 +01:00
Juergen Hoeller a109b4c31a Translate PostgreSQL code 21000 (cardinality_violation)
Closes gh-26276
2020-12-16 22:27:57 +01:00
alexscari 9d124fffcb
Fix typo in Javadoc for AbstractJdbcCall
Closes gh-26254
2020-12-10 17:32:58 +01:00
Juergen Hoeller 66292cd7a1 Individually apply the SQL type from each SqlParameterSource argument
Closes gh-26071
2020-11-12 14:05:31 +01:00
Juergen Hoeller 6d67bdf04f Polishing 2020-11-04 23:43:43 +01:00
Сергей Цыпанов 0015fd6734 Improve URI/query strings sanitization 2020-11-04 16:28:51 +01:00
Juergen Hoeller f329748657 Merge branch '5.2.x' 2020-10-26 18:32:16 +01:00
Juergen Hoeller d12996a6a8 Polishing 2020-10-26 18:18:33 +01:00
Sam Brannen 6aa522b3c1 Apply LONG_RUNNING test group properly
See gh-24830
2020-09-25 14:25:16 +02:00
Brian Clozel e02d3f32b4 Requalify tests as LONG_RUNNING
Prior to this commit, some tests would belong to the PERFORMANCE
`TestGroup`, while they were not testing for performance but rather
performing functional tests that involve long running operations or
timeouts.

This commit moves those tests to the LONG_RUNNING `TestGroup`.

See gh-24830
2020-09-25 13:43:38 +02:00
Juergen Hoeller f89bd47188 Merge branch '5.2.x' 2020-09-25 12:52:56 +02:00
Juergen Hoeller e028ef8170 Add MariaDB to the supported database products for functions as well
Closes gh-25811
2020-09-25 12:47:31 +02:00
Juergen Hoeller 6c631e3d5c Merge branch '5.2.x'
# Conflicts:
#	spring-messaging/src/main/java/org/springframework/messaging/converter/MappingJackson2MessageConverter.java
2020-09-25 11:36:18 +02:00
Juergen Hoeller 392ad09990 Add MariaDB to the list of supported database products for procedures
Closes gh-25811
2020-09-25 11:25:05 +02:00
Juergen Hoeller ec225b07fa Remove unnecessary @SuppressWarnings 2020-09-18 10:22:53 +02:00
Sam Brannen 0556fdecaa Delete unused code in DataClassRowMapper 2020-09-15 14:25:33 +02:00
Juergen Hoeller 75f394ca85 Merge branch '5.2.x' 2020-09-07 17:54:51 +02:00
Juergen Hoeller e797398b10 CallParameterMetaData detects function return parameter specifically
Closes gh-25588
2020-09-07 17:51:23 +02:00
Juergen Hoeller 9d7849c539 Merge branch '5.2.x'
# Conflicts:
#	spring-expression/src/main/java/org/springframework/expression/spel/ast/MethodReference.java
2020-09-05 13:02:01 +02:00
Juergen Hoeller 939c76c4a5 Revise documentation notes on getParameterType performance issues
See gh-25679
2020-09-05 13:00:06 +02:00
Juergen Hoeller 40bf83c9e5 Restore original 4.x behavior for initialization of function return name
Closes gh-25707
2020-09-05 12:59:34 +02:00
Juergen Hoeller 33195da64f Fix assertion for the revised SQLExceptionTranslator contract in 5.3
See gh-25681
2020-09-03 19:34:54 +02:00
Juergen Hoeller 3aae0fc91b Merge branch '5.2.x' 2020-09-03 19:21:44 +02:00
Juergen Hoeller 670b9fd60b Retry SQLErrorCodesFactory retrieval if DatabaseMetaData access failed
Includes deprecation of JdbcUtils.extractDatabaseMetaData(DataSource, String) in favor of the now generified version of extractDatabaseMetaData(DataSource, DatabaseMetaDataCallback).

Closes gh-25681
Closes gh-25686
2020-09-03 19:16:14 +02:00
Juergen Hoeller e20bff9c64 Consistent data class constructor resolution with clear error message
MVC data class processor constructs target instance even in case of binding failure, as long as the corresponding method parameter is not marked as optional.

Closes gh-24372
2020-09-01 19:10:32 +02:00
Сергей Цыпанов 1f3e52d932 gh-25650 Replace remaining usage of LinkedList with ArrayList in tests 2020-08-31 14:33:14 +02:00
Juergen Hoeller bb9e79daa7 Polishing 2020-08-28 19:58:56 +02:00
Juergen Hoeller d37eaa5941 Introduce DataClassRowMapper with record-style constructor binding support
Closes gh-24695
2020-08-28 18:52:35 +02:00
Juergen Hoeller 874574513c Replace remaining usage of LinkedList with ArrayList/ArrayDeque
Closes gh-25650
2020-08-26 18:32:08 +02:00
Juergen Hoeller d198c4426f Extract ConcurrentLruCache for reuse in NamedParameterJdbcTemplate
Closes gh-24197
2020-08-26 14:35:01 +02:00
Juergen Hoeller ff11467a0c Avoid resizing of fixed-size HashMap/LinkedHashMap variants
Closes gh-25349
2020-08-25 19:26:18 +02:00
Juergen Hoeller f4c0ceb1cc Merge branch '5.2.x'
# Conflicts:
#	build.gradle
#	spring-tx/src/main/java/org/springframework/dao/support/PersistenceExceptionTranslationInterceptor.java
#	spring-web/src/main/java/org/springframework/web/bind/support/WebRequestDataBinder.java
#	spring-webmvc/src/main/java/org/springframework/web/servlet/HandlerExecutionChain.java
#	spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMapping.java
2020-08-07 13:15:36 +02:00
Juergen Hoeller 94eee6a32a Provide access to AbstractRoutingDataSource's resolved target DataSources
Closes gh-25544
2020-08-07 13:00:35 +02:00
Sébastien Deleuze 5c456db3cc Upgrade to Kotlin 1.4 RC
- The compiler is configured to retain compatibility with Kotlin 1.3.
- Explicit API mode is not yet enabled but could be in the future.
- Some exceptions thrown by Kotlin have changed to NullPointerException,
  see https://youtrack.jetbrains.com/issue/KT-22275 for more details.

Closes gh-24171
2020-07-30 10:18:33 +02:00
Juergen Hoeller e4e54b3c4a Merge branch '5.2.x' 2020-07-19 20:01:21 +02:00
Juergen Hoeller 43e315f10c Unwrap SqlParameterValue for disposable value detection in cleanupParameters
Closes gh-22972
2020-07-19 19:59:15 +02:00
Juergen Hoeller 4f2aaa49a9 Replace javadoc references to deprecated query methods
See gh-25272
2020-07-19 18:59:26 +02:00
Juergen Hoeller 198d64d539 Merge branch '5.2.x'
# Conflicts:
#	build.gradle
2020-07-17 17:52:08 +02:00
Juergen Hoeller 30bf870810 Check JDBC 4 getFunctions (for compatibility with PostgreSQL driver 42.2.11)
Closes gh-25399
2020-07-17 17:47:53 +02:00
Johnny Lim 364939b2a3
Remove redundant Character.toLowerCase() in BeanPropertyRowMapper
This commit removes a redundant Character.toLowerCase() invocation in
BeanPropertyRowMapper.underscoreName().

Closes gh-25361
2020-07-06 15:31:18 +02:00
Sébastien Deleuze 06b364fefe Leverage spring.ignore.xml flag to avoid SQLStateSQLExceptionTranslator
Closes gh-25335
2020-06-30 07:34:50 +02:00
Sam Brannen b33d2fe683 Clean up warnings in Gradle build, polishing, etc. 2020-06-24 15:02:24 +02:00
Sam Brannen 751739442b Polishing 2020-06-24 13:49:33 +02:00
Sam Brannen 0e83aaa756 Fix hanging test
Partially reverts 1edc08fb84
2020-06-23 18:08:24 +02:00
Sam Brannen 1edc08fb84 Polishing 2020-06-23 17:45:23 +02:00
Juergen Hoeller d0209e5f1f Nullability refinements and related polishing 2020-06-23 16:55:09 +02:00
Marten Deinum 8eedd9d5cc Use JDBC 4 API for connection validation
With this commit use the JDBC 4.0 isValid method to
validate the connection. This is favorable over a
validation query.
2020-06-23 16:50:57 +02:00
Marten Deinum 6316a353bb Reduce String creation in BeanPropertyRowMapper
Prior to this commit the BeanPropertyRowMapper used
String.substring and String.toLowerCase to parse the
field names. This would generate more String than needed.

Instead one could iterate over the internal char[] of the
String and use the Character methods instead. This reduces
the String creation.

Closes gh-25301
2020-06-23 08:53:41 +02:00
Sam Brannen 9d5881e0ad Suppress warnings, remove unused code, etc. 2020-06-20 17:15:35 +02:00
Juergen Hoeller 2d5f9723fa Deprecate superseded Object[] signatures in JdbcOperations/JdbcTemplate
Closes gh-25272
2020-06-18 17:47:27 +02:00
Sébastien Deleuze 6b355df903 Revert "Upgrade to Kotlin 1.4 M2"
This reverts commit 2a74eff10f.

Some regressions require to wait at least Kotlin 1.4 M3.
2020-06-18 14:06:39 +02:00
Sam Brannen 30263137c4 Suppress warnings in Gradle build 2020-06-18 10:55:44 +02:00
Juergen Hoeller 17cab9660c Deprecate TransactionSynchronizationAdapter
Closes gh-21725
2020-06-17 11:02:31 +02:00
Juergen Hoeller d36407d585 Deprecate rarely used bean definition variants
Closes gh-24875
2020-06-17 10:59:55 +02:00
Сергей Цыпанов 7949937655 Remove redundant assignment of default values to volatile fields 2020-06-17 10:50:51 +02:00
Sam Brannen 8099fc8178 Use try-with-resources language construct where feasible
Closes gh-2063

Co-authored-by: igor-suhorukov <igor.suhorukov@gmail.com>
2020-06-16 22:57:45 +02:00
Sam Brannen 456d2c46e3 Suppress warnings in Gradle build
See gh-24655
2020-06-16 17:43:40 +02:00
Sam Brannen 50391ad3d7 Add @author tags for JDBC KeyHolder support
See gh-24655
2020-06-16 17:37:11 +02:00
Sébastien Deleuze 2a74eff10f Upgrade to Kotlin 1.4 M2
- The compiler is configured to retain compatibility with Kotlin 1.3.
- Explicit API mode is not yet enabled but could be in the future.
- A workaround for Gradle build is required for now, see
  https://youtrack.jetbrains.com/issue/KT-39610 for more details.
- Some exceptions thrown by Kotlin have changed to NullPointerException,
  see https://youtrack.jetbrains.com/issue/KT-22275 for more details.

Closes gh-24171
2020-06-16 15:21:57 +02:00
Sam Brannen cc301011b2 Polish JDBC KeyHolder support
See gh-24655
2020-06-16 14:17:43 +02:00
eXsio b50cf9dad2 Support user-defined key type in JDBC KeyHolder
Prior to this commit, the JDBC KeyHolder API only supported keys of
type Number. However, a generated key can be a UUID or something else,
and developers shouldn't have to go manually through complex
collections to access it.

This commit adds a new getKeyAs(Class<T> keyType) method to the
KeyHolder API that allows the user to specify the key type.

Closes gh-24655
2020-06-16 12:04:09 +02:00
Juergen Hoeller e955e52f2f Refactor method name dispatching to switch statements
Closes gh-25163
2020-05-29 23:07:25 +02:00
Juergen Hoeller 42ff01b5aa Merge branch '5.2.x' 2020-05-29 15:57:32 +02:00
Juergen Hoeller 08474aa921 Clarify JDBC-defined negative values returned from batchUpdate
Closes gh-25138
2020-05-29 15:51:19 +02:00
Juergen Hoeller 929244215c Merge branch '5.2.x'
# Conflicts:
#	build.gradle
2020-05-26 23:37:53 +02:00
Juergen Hoeller 27d5fdc5aa Polishing 2020-05-26 23:35:38 +02:00
Juergen Hoeller 4018b462f1 JdbcOperations polishing (backported from master) 2020-05-22 16:35:34 +02:00
Juergen Hoeller d56ca04162 Introduce queryForStream on JdbcTemplate and NamedParameterJdbcTemplate
Closes gh-18474
2020-05-19 14:08:52 +02:00
Juergen Hoeller 26c205589b Merge branch '5.2.x'
# Conflicts:
#	build.gradle
#	spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java
#	spring-context/src/main/java/org/springframework/validation/beanvalidation/MethodValidationInterceptor.java
2020-05-14 00:33:37 +02:00
Juergen Hoeller fe33822fa7 Polishing 2020-05-14 00:23:20 +02:00
Juergen Hoeller e9cded560d Introduce JdbcTransactionManager with SQLExceptionTranslator support
Closes gh-24064
2020-05-06 16:41:35 +02:00
Juergen Hoeller 251501587b Consistent nullability of arguments array in JdbcOperations/Template
Closes gh-24839
2020-04-03 21:15:00 +02:00
Juergen Hoeller 6177e38eb6 Close-suppressing Connection proxy exposes target isClosed() state
Closes gh-24853
2020-04-03 21:13:53 +02:00
Sam Brannen e26764d249 Remove duplicate words in documentation and polish Javadoc 2020-03-31 12:17:58 +02:00
Qimiao Chen 7c831d2ef4
Replace anonymous inner classes with lambdas in tests
Closes gh-24808
2020-03-30 12:02:23 +02:00
Juergen Hoeller 910d2788e9 Polishing 2020-03-23 18:02:55 +01:00
Sam Brannen 5e1e689739 Polishing 2020-03-17 15:06:10 +01:00
Qimiao Chen 5f2e298c08
Extract isDebugEnabled() checks to local variables
Closes gh-24683
2020-03-16 15:25:05 +01:00
Juergen Hoeller 6db20eb773 Avoid package import cycles 2020-02-25 14:55:53 +01:00
Sam Brannen c2367b3ad2 Polish contribution
See gh-24383
2020-02-04 14:48:13 +01:00
Hyunjin Choi 1acf5a7424
Use dedicated catch block for ScriptException
Closes gh-24383
2020-02-04 14:45:52 +01:00
Sam Brannen 7575616d26 Update copyright date
See gh-24385
2020-02-04 14:23:18 +01:00
Hyunjin Choi b4cf88499c
Use try-with-resource in ScriptUtils
Closes gh-24385
2020-02-04 14:21:59 +01:00
Juergen Hoeller d93403a257 Alphabetical order for database names
See gh-24443
2020-01-28 21:06:04 +01:00
wilrosco c86e164b03 Add Informix to the list of supported database products for procedure calls
Hi guys,

We're facing an issue in our application when we try to call a procedure in Informix database, 
our app uses standard JDBC (spring-jdbc and com.ibm.informix.jdbc.4.50.3) without Hibernate 
to connect to the database  

Issue:
When we trying to execute any procedure call in our Informix database there is no data returned.

Diagnostic:
It points to the Java class called CallMetaDataProviderFactory in spring-jdbc project.

Taking a look of this class there is no explicit support for Informix procedure calls, so I added "Informix Dynamic Server" to the 
list of supported databases and now I can execute procedures call without issues.

Basically I added the line "Informix Dynamic Server" to the list called "supportedDatabaseProductsForProcedures" 
of CallMetaDataProviderFactory class in my local environment and it worked as expected.


I really appreciate any feedback/suggestion for this approach due we would like to continue using the framework 
normally in our development without losing updates using a workaround in our end.

Many thanks in advance.
2020-01-28 20:57:52 +01:00
Juergen Hoeller 60c7af3625 Mention HikariCP next to DBCP and C3P0 in connection pool notes
Closes gh-24405
2020-01-24 14:54:02 +01:00
Sam Brannen 734db23f4e Fix Checkstyle violation
See gh-gh-24358
2020-01-15 14:09:11 +01:00
Sam Brannen f527ca7515 Update copyright date 2020-01-15 14:04:50 +01:00
hyeonisism 89b8449999 Simplify getParsedSql() method in NamedParameterJdbcTemplate
Closes gh-24358
2020-01-15 14:01:38 +01:00
Sam Brannen 798744838c Revise exception handling in AbstractEmbeddedDatabaseConfigurer
See gh-24337
2020-01-13 12:51:31 +01:00
Sam Brannen 7cd4ddf5fc Rename test fixture package in spring-beans
See gh-23550
2020-01-02 16:01:35 +01:00
Sam Brannen 4260c34b47 Rename test fixture package in spring-core
See gh-23550
2020-01-02 16:01:34 +01:00
Sam Brannen 61d4ee594d Use Gradle test fixture support for spring-beans and spring-context
See gh-23550
2020-01-02 16:01:34 +01:00
Sam Brannen 5718bf424b Use Gradle test fixture support for spring-core
See gh-23550
2020-01-02 16:01:34 +01:00
Juergen Hoeller 02b40223e5 Polishing 2019-12-12 16:43:00 +01:00
perceptron8 dafe57fc6e Add BeanPropertyRowMapper.newInstance(mappedClass, conversionService)
Similar to SingleColumnRowMapper.newInstance(requiredType,
conversionService) which was added in #1678.
2019-12-12 15:40:55 +01:00
Juergen Hoeller a5f2d8c222 Mark SqlRowSet accessor methods as nullable (for alignment with JDBC)
Closes gh-24042
2019-11-20 17:37:40 +01:00
Juergen Hoeller 990bfd8772 Support for new MySQL 8 error code 3572
Closes gh-23972
2019-11-11 15:55:26 +01:00
Juergen Hoeller 773b2f06a1 Avoid Connection.isReadOnly() call in resetConnectionAfterTransaction
Closes gh-23747
2019-10-30 00:25:17 +01:00
Juergen Hoeller 2861fc65bd Polishing 2019-09-27 10:17:56 +02:00
Kwon Young Jae 6063c00e4e Delete obsolete comment in RowMapperTests
Closes gh-23643
2019-09-16 14:10:33 +02:00
康智冬 0d742cf3d0 Fix typos related to indefinite articles for SQL acronym
Closes gh-23603
2019-09-07 16:04:47 +02:00
Phillip Webb deba2ed1b3 Add blank line between java and javax imports
See gh-23539
2019-09-04 22:05:46 -07:00
Brian Clozel d4089747b8 Use dependency management in Framework build
Prior to this commit, the Spring Framework build would partially use the
dependency management plugin to import and enforce BOMs.

This commit applies the dependency management plugin to all Java
projects and regroups all version management declaration in the root
`build.gradle` file (versions and exclusions).

Some versions are overridden in specific modules for
backwards-compatibility reasons or extended support.

This commit also adds the Gradle versions plugin that checks for
dependency upgrades in artifact repositories and produces a report; you
can use the following:

    ./gradlew dependencyUpdates
2019-09-02 18:01:09 +02:00
Sebastien Deleuze ca02cc1194 Migrate to AssertJ in Kotlin tests
Closes gh-23475
2019-09-02 15:59:26 +02:00
Sam Brannen ad6231ad29 Add missing @Override annotations 2019-08-23 13:50:58 +02:00
Brian Clozel e9523161f0 Revert "Revert "Refactor Gradle tasks in Spring Framework build""
This reverts commit fb0d618751.
2019-08-20 20:26:43 +02:00
Stephane Nicoll fb0d618751 Revert "Refactor Gradle tasks in Spring Framework build"
This reverts commit 1539ba8991.
2019-08-20 20:07:11 +02:00
Brian Clozel 1539ba8991 Refactor Gradle tasks in Spring Framework build
This commit reorganizes tasks and scripts in the build to only apply
them where they're needed. We're considering here 3 "types" of projects
in our build:
* the root project, handling documentation, publishing, etc
* framework modules (a project that's published as a spring artifact)
* internal modules, such as the BOM, our coroutines support and our
integration-tests

With this change, we're strealining the project configuration for all
spring modules and only applying plugins when needed (typically our
kotlin support).

See gh-23282
2019-08-20 18:17:02 +02:00
Sam Brannen 288461a541 Introduce @EnabledForTestGroups in Spring's test suite
Closes gh-23476
2019-08-17 14:47:24 +02:00
Sam Brannen 979508a7f3 Remove JUnit 4 dependency from all modules except spring-test
This commit removes the JUnit 4 dependency from all modules except
spring-test which provides explicit JUnit 4 support.

This commit also includes the following.

- migration from JUnit 4 assertions to JUnit Jupiter assertions in all
  Kotlin tests
- migration from JUnit 4 assumptions in Spring's TestGroup support to
  JUnit Jupiter assumptions, based on org.opentest4j.TestAbortedException
- introduction of a new TestGroups utility class than can be used from
  existing JUnit 4 tests in the spring-test module in order to perform
  assumptions using JUnit 4's Assume class

See gh-23451
2019-08-17 11:37:21 +02:00
Sam Brannen 3f3e41923f Migrate rest of test suite from JUnit 4 to JUnit Jupiter
This commit migrates the rest of Spring's test suite to JUnit Jupiter,
except spring-test which will be migrated in a separate commit.

See gh-23451
2019-08-17 11:36:58 +02:00
Sam Brannen 6c0e550b86 Polish contribution
See gh-23445
2019-08-10 14:07:15 +02:00
zhuzhuman978 849bbf00b5 Simplify if statements and replace try-finally with try-with-resources
Closes gh-23445
2019-08-10 14:03:18 +02:00
Juergen Hoeller 53d067399d Merge branch '5.1.x' 2019-08-02 01:46:26 +02:00
Juergen Hoeller 7c2e2d40af Polishing 2019-08-02 01:39:02 +02:00
Juergen Hoeller d8e624e97e Consistent suppression of get/clearWarnings without target connection
See gh-23346
2019-08-02 01:19:16 +02:00
Juergen Hoeller fd86f34057 Merge branch '5.1.x' 2019-08-01 15:27:06 +02:00
Juergen Hoeller 871bb57e02 TransactionAwareDataSourceProxy locally handles get/clearWarnings call
Closes gh-23346
2019-08-01 15:26:00 +02:00
Sebastien Deleuze 095fd5bcb3 Use Kotlin BOM
Close gh-23316
2019-07-19 10:43:54 +02:00
Sam Brannen c788be30fe Polish contribution
See gh-23289
2019-07-15 19:08:20 +02:00
Phillip Webb b5e4e02337 Polish ScriptUtilsUnitTests 2019-07-15 14:43:03 +02:00
Phillip Webb 17914fc44b Add multi-prefix comment support for SQL scripts
Update `ResourceDatabasePopulator` and `ScriptUtils` so that more than
one comment prefix can be used when processing SQL scripts. This
feature is particularly useful when dealing with scripts provided by
Quartz since they often use a mix `--` and `#`.

Closes gh-23289
2019-07-15 14:43:03 +02:00
Juergen Hoeller 42c0d8ec7f Merge branch '5.1.x' 2019-06-12 14:14:40 +02:00
Juergen Hoeller 1ccd99ebe7 Polishing 2019-06-12 14:11:39 +02:00
Juergen Hoeller 98a49b46b7 NamedParameterJdbcTemplate only treats Iterables like Collections
Closes gh-22981
2019-06-12 13:29:07 +02:00
Juergen Hoeller 7dc92aa05d Polishing 2019-06-11 20:57:27 +02:00