diff --git a/spring-beans/src/test/java/org/springframework/beans/BeanWrapperGenericsTests.java b/spring-beans/src/test/java/org/springframework/beans/BeanWrapperGenericsTests.java index 172497a390f..522e13c5b9b 100644 --- a/spring-beans/src/test/java/org/springframework/beans/BeanWrapperGenericsTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/BeanWrapperGenericsTests.java @@ -81,9 +81,9 @@ class BeanWrapperGenericsTests { BeanWrapper bw = new BeanWrapperImpl(gb); Set input = new HashSet<>(); input.add(new TestBean()); - assertThatExceptionOfType(TypeMismatchException.class).isThrownBy(() -> - bw.setPropertyValue("integerSet", input)) - .withMessageContaining("java.lang.Integer"); + assertThatExceptionOfType(TypeMismatchException.class) + .isThrownBy(() -> bw.setPropertyValue("integerSet", input)) + .withMessageContaining("java.lang.Integer"); } @Test diff --git a/spring-beans/src/test/java/org/springframework/beans/BeanWrapperTests.java b/spring-beans/src/test/java/org/springframework/beans/BeanWrapperTests.java index c62a9b01d90..b9c29372c12 100644 --- a/spring-beans/src/test/java/org/springframework/beans/BeanWrapperTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/BeanWrapperTests.java @@ -103,13 +103,13 @@ class BeanWrapperTests extends AbstractPropertyAccessorTests { pvs.addPropertyValue(new PropertyValue("age", "foobar")); pvs.addPropertyValue(new PropertyValue("name", newName)); pvs.addPropertyValue(new PropertyValue("touchy", invalidTouchy)); - assertThatExceptionOfType(PropertyBatchUpdateException.class).isThrownBy(() -> - accessor.setPropertyValues(pvs)) - .satisfies(ex -> { - assertThat(ex.getExceptionCount()).isEqualTo(2); - assertThat(ex.getPropertyAccessException("touchy").getPropertyChangeEvent() - .getNewValue()).isEqualTo(invalidTouchy); - }); + assertThatExceptionOfType(PropertyBatchUpdateException.class) + .isThrownBy(() -> accessor.setPropertyValues(pvs)) + .satisfies(ex -> { + assertThat(ex.getExceptionCount()).isEqualTo(2); + assertThat(ex.getPropertyAccessException("touchy").getPropertyChangeEvent() + .getNewValue()).isEqualTo(invalidTouchy); + }); // Test validly set property matches assertThat(target.getName()).as("Valid set property must stick").isEqualTo(newName); assertThat(target.getAge()).as("Invalid set property must retain old value").isEqualTo(0); @@ -119,9 +119,9 @@ class BeanWrapperTests extends AbstractPropertyAccessorTests { void checkNotWritablePropertyHoldPossibleMatches() { TestBean target = new TestBean(); BeanWrapper accessor = createAccessor(target); - assertThatExceptionOfType(NotWritablePropertyException.class).isThrownBy(() -> - accessor.setPropertyValue("ag", "foobar")) - .satisfies(ex -> assertThat(ex.getPossibleMatches()).containsExactly("age")); + assertThatExceptionOfType(NotWritablePropertyException.class) + .isThrownBy(() -> accessor.setPropertyValue("ag", "foobar")) + .satisfies(ex -> assertThat(ex.getPossibleMatches()).containsExactly("age")); } @Test // Can't be shared; there is no such thing as a read-only field @@ -294,9 +294,9 @@ class BeanWrapperTests extends AbstractPropertyAccessorTests { void incompletelyQuotedKeyLeadsToPropertyException() { TestBean target = new TestBean(); BeanWrapper accessor = createAccessor(target); - assertThatExceptionOfType(NotWritablePropertyException.class).isThrownBy(() -> - accessor.setPropertyValue("[']", "foobar")) - .satisfies(ex -> assertThat(ex.getPossibleMatches()).isNull()); + assertThatExceptionOfType(NotWritablePropertyException.class) + .isThrownBy(() -> accessor.setPropertyValue("[']", "foobar")) + .satisfies(ex -> assertThat(ex.getPossibleMatches()).isNull()); } diff --git a/spring-core/src/main/java/org/springframework/core/io/Resource.java b/spring-core/src/main/java/org/springframework/core/io/Resource.java index a7a1f1dc43b..91458934fed 100644 --- a/spring-core/src/main/java/org/springframework/core/io/Resource.java +++ b/spring-core/src/main/java/org/springframework/core/io/Resource.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. @@ -152,8 +152,7 @@ public interface Resource extends InputStreamSource { } /** - * Returns the contents of this resource as a string, using the specified - * charset. + * Return the contents of this resource as a string, using the specified charset. * @param charset the charset to use for decoding * @return the contents of this resource as a {@code String} * @throws java.io.FileNotFoundException if the resource cannot be resolved as diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/support/AbstractLobCreatingPreparedStatementCallback.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/support/AbstractLobCreatingPreparedStatementCallback.java index 42f415cba55..99135870c6c 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/support/AbstractLobCreatingPreparedStatementCallback.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/support/AbstractLobCreatingPreparedStatementCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 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. @@ -45,8 +45,8 @@ import org.springframework.util.Assert; * lobCreator.setBlobAsBinaryStream(ps, 2, contentStream, contentLength); * lobCreator.setClobAsString(ps, 3, description); * } - * } - * ); + * }); + * * * @author Juergen Hoeller * @since 1.0.2 diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/support/AbstractLobStreamingResultSetExtractor.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/support/AbstractLobStreamingResultSetExtractor.java index 5427df20526..7b6de1078e8 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/support/AbstractLobStreamingResultSetExtractor.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/support/AbstractLobStreamingResultSetExtractor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 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. @@ -41,13 +41,13 @@ import org.springframework.lang.Nullable; * final LobHandler lobHandler = new DefaultLobHandler(); // reusable object * * jdbcTemplate.query( - * "SELECT content FROM imagedb WHERE image_name=?", new Object[] {name}, - * new AbstractLobStreamingResultSetExtractor() { - * public void streamData(ResultSet rs) throws SQLException, IOException { - * FileCopyUtils.copy(lobHandler.getBlobAsBinaryStream(rs, 1), contentStream); - * } - * } - * ); + * "SELECT content FROM imagedb WHERE image_name=?", new Object[] {name}, + * new AbstractLobStreamingResultSetExtractor() { + * public void streamData(ResultSet rs) throws SQLException, IOException { + * FileCopyUtils.copy(lobHandler.getBlobAsBinaryStream(rs, 1), contentStream); + * } + * }); + * * * @author Juergen Hoeller * @since 1.0.2 diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/support/xml/SqlXmlValue.java b/spring-jdbc/src/main/java/org/springframework/jdbc/support/xml/SqlXmlValue.java index 3d45d467c28..d662a9271ae 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/support/xml/SqlXmlValue.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/support/xml/SqlXmlValue.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008 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. @@ -20,9 +20,7 @@ import org.springframework.jdbc.support.SqlValue; /** * Subinterface of {@link org.springframework.jdbc.support.SqlValue} - * that supports passing in XML data to specified column and adds a - * cleanup callback, to be invoked after the value has been set and - * the corresponding statement has been executed. + * that specifically indicates passing in XML data to a specified column. * * @author Thomas Risberg * @since 2.5.5 diff --git a/spring-web/src/main/java/org/springframework/http/converter/StringHttpMessageConverter.java b/spring-web/src/main/java/org/springframework/http/converter/StringHttpMessageConverter.java index 04adf380cf6..510a049c136 100644 --- a/spring-web/src/main/java/org/springframework/http/converter/StringHttpMessageConverter.java +++ b/spring-web/src/main/java/org/springframework/http/converter/StringHttpMessageConverter.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. @@ -95,8 +95,7 @@ public class StringHttpMessageConverter extends AbstractHttpMessageConverter= 0 && length <= Integer.MAX_VALUE ? - inputMessage.getBody().readNBytes((int) length) : - inputMessage.getBody().readAllBytes()); + inputMessage.getBody().readNBytes((int) length) : inputMessage.getBody().readAllBytes()); return new String(bytes, charset); } @@ -110,10 +109,9 @@ public class StringHttpMessageConverter extends AbstractHttpMessageConverter