diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurerDelegate.java b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurerDelegate.java index 252757868e1..6c187a06921 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurerDelegate.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurerDelegate.java @@ -17,7 +17,7 @@ package org.springframework.jdbc.datasource.embedded; /** - * A {@link EmbeddedDatabaseConfigurer} delegate that can be used to customize + * An {@link EmbeddedDatabaseConfigurer} delegate that can be used to customize * the embedded database. * * @author Stephane Nicoll diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurers.java b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurers.java index 59373ac4aa8..e748d34164b 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurers.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseConfigurers.java @@ -53,8 +53,8 @@ public abstract class EmbeddedDatabaseConfigurers { } /** - * Customize the default configurer for the given embedded database type. The - * {@code customizer} operator typically uses + * Customize the default configurer for the given embedded database type. + *

The {@code customizer} typically uses * {@link EmbeddedDatabaseConfigurerDelegate} to customize things as necessary. * @param type the {@linkplain EmbeddedDatabaseType embedded database type} * @param customizer the customizer to return based on the default diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactory.java b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactory.java index 357e3f2eb06..479d6104f84 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactory.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseFactory.java @@ -45,11 +45,11 @@ import org.springframework.util.Assert; * for the database. *

  • Call {@link #setDatabaseName} to set an explicit name for the database. *
  • Call {@link #setDatabaseType} to set the database type if you wish to - * use one of the supported types with their default settings. + * use one of the pre-supported types with its default settings. *
  • Call {@link #setDatabaseConfigurer} to configure support for a custom * embedded database type, or * {@linkplain EmbeddedDatabaseConfigurers#customizeConfigurer customize} the - * default of a supported types. + * defaults for one of the pre-supported types. *
  • Call {@link #setDatabasePopulator} to change the algorithm used to * populate the database. *
  • Call {@link #setDataSourceFactory} to change the type of @@ -128,7 +128,7 @@ public class EmbeddedDatabaseFactory { /** * Set the type of embedded database to use. *

    Call this when you wish to configure one of the pre-supported types - * with their default settings. + * with its default settings. *

    Defaults to HSQL. * @param type the database type */ diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/core/namedparam/NamedParameterUtilsTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/core/namedparam/NamedParameterUtilsTests.java index ad42c8d2d2d..f020350a26a 100644 --- a/spring-jdbc/src/test/java/org/springframework/jdbc/core/namedparam/NamedParameterUtilsTests.java +++ b/spring-jdbc/src/test/java/org/springframework/jdbc/core/namedparam/NamedParameterUtilsTests.java @@ -293,7 +293,8 @@ class NamedParameterUtilsTests { "SELECT /*:doo*/':foo', :xxx FROM DUAL", "SELECT ':foo'/*:doo*/, :xxx FROM DUAL", "SELECT \":foo\"\":doo\", :xxx FROM DUAL", - "SELECT `:foo``:doo`, :xxx FROM DUAL",}) + "SELECT `:foo``:doo`, :xxx FROM DUAL" + }) void parseSqlStatementWithParametersInsideQuote(String sql) { ParsedSql parsedSql = NamedParameterUtils.parseSqlStatement(sql); assertThat(parsedSql.getTotalParameterCount()).isEqualTo(1); diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseBuilderTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseBuilderTests.java index eb1c41d27ac..d496f4a59f8 100644 --- a/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseBuilderTests.java +++ b/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/embedded/EmbeddedDatabaseBuilderTests.java @@ -36,33 +36,32 @@ import static org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType. */ class EmbeddedDatabaseBuilderTests { - private final EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder(new ClassRelativeResourceLoader( - getClass())); + private final EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder(new ClassRelativeResourceLoader(getClass())); @Test void addDefaultScripts() { doTwice(() -> { - EmbeddedDatabase db = new EmbeddedDatabaseBuilder()// - .addDefaultScripts()// - .build(); + EmbeddedDatabase db = new EmbeddedDatabaseBuilder() + .addDefaultScripts() + .build(); assertDatabaseCreatedAndShutdown(db); }); } @Test void addScriptWithBogusFileName() { - assertThatExceptionOfType(CannotReadScriptException.class).isThrownBy( - new EmbeddedDatabaseBuilder().addScript("bogus.sql")::build); + assertThatExceptionOfType(CannotReadScriptException.class) + .isThrownBy(new EmbeddedDatabaseBuilder().addScript("bogus.sql")::build); } @Test void addScript() { doTwice(() -> { - EmbeddedDatabase db = builder// - .addScript("db-schema.sql")// - .addScript("db-test-data.sql")// - .build(); + EmbeddedDatabase db = builder + .addScript("db-schema.sql") + .addScript("db-test-data.sql") + .build(); assertDatabaseCreatedAndShutdown(db); }); } @@ -70,9 +69,9 @@ class EmbeddedDatabaseBuilderTests { @Test void addScripts() { doTwice(() -> { - EmbeddedDatabase db = builder// - .addScripts("db-schema.sql", "db-test-data.sql")// - .build(); + EmbeddedDatabase db = builder + .addScripts("db-schema.sql", "db-test-data.sql") + .build(); assertDatabaseCreatedAndShutdown(db); }); } @@ -80,9 +79,9 @@ class EmbeddedDatabaseBuilderTests { @Test void addScriptsWithDefaultCommentPrefix() { doTwice(() -> { - EmbeddedDatabase db = builder// - .addScripts("db-schema-comments.sql", "db-test-data.sql")// - .build(); + EmbeddedDatabase db = builder + .addScripts("db-schema-comments.sql", "db-test-data.sql") + .build(); assertDatabaseCreatedAndShutdown(db); }); } @@ -90,10 +89,10 @@ class EmbeddedDatabaseBuilderTests { @Test void addScriptsWithCustomCommentPrefix() { doTwice(() -> { - EmbeddedDatabase db = builder// - .addScripts("db-schema-custom-comments.sql", "db-test-data.sql")// - .setCommentPrefix("~")// - .build(); + EmbeddedDatabase db = builder + .addScripts("db-schema-custom-comments.sql", "db-test-data.sql") + .setCommentPrefix("~") + .build(); assertDatabaseCreatedAndShutdown(db); }); } @@ -101,11 +100,11 @@ class EmbeddedDatabaseBuilderTests { @Test void addScriptsWithCustomBlockComments() { doTwice(() -> { - EmbeddedDatabase db = builder// - .addScripts("db-schema-block-comments.sql", "db-test-data.sql")// - .setBlockCommentStartDelimiter("{*")// - .setBlockCommentEndDelimiter("*}")// - .build(); + EmbeddedDatabase db = builder + .addScripts("db-schema-block-comments.sql", "db-test-data.sql") + .setBlockCommentStartDelimiter("{*") + .setBlockCommentEndDelimiter("*}") + .build(); assertDatabaseCreatedAndShutdown(db); }); } @@ -113,10 +112,10 @@ class EmbeddedDatabaseBuilderTests { @Test void setTypeToH2() { doTwice(() -> { - EmbeddedDatabase db = builder// - .setType(H2)// - .addScripts("db-schema.sql", "db-test-data.sql")// - .build(); + EmbeddedDatabase db = builder + .setType(H2) + .addScripts("db-schema.sql", "db-test-data.sql") + .build(); assertDatabaseCreatedAndShutdown(db); }); } @@ -132,7 +131,7 @@ class EmbeddedDatabaseBuilderTests { super.configureConnectionProperties(properties, databaseName); } })) - .addScripts("db-schema.sql", "db-test-data.sql")// + .addScripts("db-schema.sql", "db-test-data.sql") .build(); assertDatabaseCreatedAndShutdown(db); }); @@ -141,18 +140,17 @@ class EmbeddedDatabaseBuilderTests { @Test void setTypeToDerbyAndIgnoreFailedDrops() { doTwice(() -> { - EmbeddedDatabase db = builder// - .setType(DERBY)// - .ignoreFailedDrops(true)// - .addScripts("db-schema-derby-with-drop.sql", "db-test-data.sql").build(); + EmbeddedDatabase db = builder + .setType(DERBY) + .ignoreFailedDrops(true) + .addScripts("db-schema-derby-with-drop.sql", "db-test-data.sql").build(); assertDatabaseCreatedAndShutdown(db); }); } @Test void createSameSchemaTwiceWithoutUniqueDbNames() { - EmbeddedDatabase db1 = new EmbeddedDatabaseBuilder(new ClassRelativeResourceLoader(getClass())) - .addScripts("db-schema-without-dropping.sql").build(); + EmbeddedDatabase db1 = builder.addScripts("db-schema-without-dropping.sql").build(); try { assertThatExceptionOfType(ScriptStatementFailedException.class).isThrownBy(() -> new EmbeddedDatabaseBuilder(new ClassRelativeResourceLoader(getClass())).addScripts("db-schema-without-dropping.sql").build()); @@ -164,20 +162,20 @@ class EmbeddedDatabaseBuilderTests { @Test void createSameSchemaTwiceWithGeneratedUniqueDbNames() { - EmbeddedDatabase db1 = new EmbeddedDatabaseBuilder(new ClassRelativeResourceLoader(getClass()))// - .addScripts("db-schema-without-dropping.sql", "db-test-data.sql")// - .generateUniqueName(true)// - .build(); + EmbeddedDatabase db1 = builder + .addScripts("db-schema-without-dropping.sql", "db-test-data.sql") + .generateUniqueName(true) + .build(); JdbcTemplate template1 = new JdbcTemplate(db1); assertNumRowsInTestTable(template1, 1); template1.update("insert into T_TEST (NAME) values ('Sam')"); assertNumRowsInTestTable(template1, 2); - EmbeddedDatabase db2 = new EmbeddedDatabaseBuilder(new ClassRelativeResourceLoader(getClass()))// - .addScripts("db-schema-without-dropping.sql", "db-test-data.sql")// - .generateUniqueName(true)// - .build(); + EmbeddedDatabase db2 = new EmbeddedDatabaseBuilder(new ClassRelativeResourceLoader(getClass())) + .addScripts("db-schema-without-dropping.sql", "db-test-data.sql") + .generateUniqueName(true) + .build(); assertDatabaseCreated(db2); db1.shutdown(); diff --git a/spring-test/src/main/java/org/springframework/test/util/JsonPathExpectationsHelper.java b/spring-test/src/main/java/org/springframework/test/util/JsonPathExpectationsHelper.java index 65ec8d92580..00771118bed 100644 --- a/spring-test/src/main/java/org/springframework/test/util/JsonPathExpectationsHelper.java +++ b/spring-test/src/main/java/org/springframework/test/util/JsonPathExpectationsHelper.java @@ -58,6 +58,16 @@ public class JsonPathExpectationsHelper { private final Configuration configuration; + /** + * Construct a new {@code JsonPathExpectationsHelper} using the + * {@linkplain Configuration#defaultConfiguration() default configuration}. + * @param expression the {@link JsonPath} expression; never {@code null} or empty + * @since 6.2 + */ + public JsonPathExpectationsHelper(String expression) { + this(expression, (Configuration) null); + } + /** * Construct a new {@code JsonPathExpectationsHelper}. * @param expression the {@link JsonPath} expression; never {@code null} or empty @@ -72,16 +82,6 @@ public class JsonPathExpectationsHelper { this.configuration = (configuration != null) ? configuration : Configuration.defaultConfiguration(); } - /** - * Construct a new {@code JsonPathExpectationsHelper} using the - * {@linkplain Configuration#defaultConfiguration() default configuration}. - * @param expression the {@link JsonPath} expression; never {@code null} or empty - * @since 6.2 - */ - public JsonPathExpectationsHelper(String expression) { - this(expression, (Configuration) null); - } - /** * Construct a new {@code JsonPathExpectationsHelper}. * @param expression the {@link JsonPath} expression; never {@code null} or empty diff --git a/spring-test/src/main/java/org/springframework/test/web/reactive/server/JsonEncoderDecoder.java b/spring-test/src/main/java/org/springframework/test/web/reactive/server/JsonEncoderDecoder.java index bb1bc6fc72f..cc3907097d4 100644 --- a/spring-test/src/main/java/org/springframework/test/web/reactive/server/JsonEncoderDecoder.java +++ b/spring-test/src/main/java/org/springframework/test/web/reactive/server/JsonEncoderDecoder.java @@ -32,11 +32,11 @@ import org.springframework.lang.Nullable; /** * {@link Encoder} and {@link Decoder} that is able to handle a map to and from - * json. Used to configure the jsonpath infrastructure without having a hard + * JSON. Used to configure the jsonpath infrastructure without having a hard * dependency on the library. * - * @param encoder the json encoder - * @param decoder the json decoder + * @param encoder the JSON encoder + * @param decoder the JSON decoder * @author Stephane Nicoll * @author Rossen Stoyanchev * @since 6.2 @@ -69,9 +69,9 @@ record JsonEncoderDecoder(Encoder encoder, Decoder decoder) { /** * Find the first suitable {@link Encoder} that can encode a {@link Map} - * to json. + * to JSON. * @param writers the writers to inspect - * @return a suitable json {@link Encoder} or {@code null} + * @return a suitable JSON {@link Encoder} or {@code null} */ @Nullable private static Encoder findJsonEncoder(Collection> writers) { @@ -90,9 +90,9 @@ record JsonEncoderDecoder(Encoder encoder, Decoder decoder) { /** * Find the first suitable {@link Decoder} that can decode a {@link Map} to - * json. + * JSON. * @param readers the readers to inspect - * @return a suitable json {@link Decoder} or {@code null} + * @return a suitable JSON {@link Decoder} or {@code null} */ @Nullable private static Decoder findJsonDecoder(Collection> readers) { diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/function/SseServerResponse.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/function/SseServerResponse.java index 76b7dd75de8..38d5cc8ff04 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/function/SseServerResponse.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/function/SseServerResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2024 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.