From 72835f10b9b07921978da419abf2a182abf67967 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 1 Feb 2024 14:58:13 +0100 Subject: [PATCH] Polishing --- .../org/springframework/core/io/Resource.java | 5 ++--- ...ractLobCreatingPreparedStatementCallback.java | 6 +++--- .../AbstractLobStreamingResultSetExtractor.java | 16 ++++++++-------- .../jdbc/core/support/SqlLobValue.java | 4 ++-- .../jdbc/support/xml/SqlXmlValue.java | 6 ++---- .../converter/StringHttpMessageConverter.java | 7 +++---- 6 files changed, 20 insertions(+), 24 deletions(-) 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/core/support/SqlLobValue.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/support/SqlLobValue.java index 621921436a0..02543c84c6d 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/support/SqlLobValue.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/support/SqlLobValue.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 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. @@ -209,7 +209,7 @@ public class SqlLobValue implements DisposableSqlTypeValue { } /** - * Close the LobCreator, if any. + * Close the LobCreator. */ @Override public void cleanup() { 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 8b8793e277e..6da38db05bf 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. @@ -106,10 +106,9 @@ public class StringHttpMessageConverter extends AbstractHttpMessageConverter