From df60919bb0962dc27fe9b0926ab8f0e8f8a6767a Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 25 Feb 2020 15:32:05 +0100 Subject: [PATCH] Polishing --- .../embedded/AbstractEmbeddedDatabaseConfigurer.java | 7 +++++-- .../http/codec/json/Jackson2Tokenizer.java | 8 ++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/AbstractEmbeddedDatabaseConfigurer.java b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/AbstractEmbeddedDatabaseConfigurer.java index 82816ba95392..62e89c4a2079 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/AbstractEmbeddedDatabaseConfigurer.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/embedded/AbstractEmbeddedDatabaseConfigurer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2020 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. @@ -57,9 +57,12 @@ public void shutdown(DataSource dataSource, String databaseName) { try { con.close(); } - catch (Throwable ex) { + catch (SQLException ex) { logger.debug("Could not close JDBC Connection on shutdown", ex); } + catch (Throwable ex) { + logger.debug("Unexpected exception on closing JDBC Connection", ex); + } } } } diff --git a/spring-web/src/main/java/org/springframework/http/codec/json/Jackson2Tokenizer.java b/spring-web/src/main/java/org/springframework/http/codec/json/Jackson2Tokenizer.java index 4a173521fbd4..9234799314da 100644 --- a/spring-web/src/main/java/org/springframework/http/codec/json/Jackson2Tokenizer.java +++ b/spring-web/src/main/java/org/springframework/http/codec/json/Jackson2Tokenizer.java @@ -229,8 +229,8 @@ private void raiseLimitException() { * @param objectMapper the current mapper instance * @param tokenizeArrays if {@code true} and the "top level" JSON object is * an array, each element is returned individually immediately after it is received - * @param forceUseOfBigDecimal if {@code true}, any floating point values encountered in source will use - * {@link java.math.BigDecimal} + * @param forceUseOfBigDecimal if {@code true}, any floating point values encountered + * in source will use {@link java.math.BigDecimal} * @param maxInMemorySize maximum memory size * @return the resulting token buffers */ @@ -244,8 +244,8 @@ public static Flux tokenize(Flux dataBuffers, JsonFacto context = ((DefaultDeserializationContext) context).createInstance( objectMapper.getDeserializationConfig(), parser, objectMapper.getInjectableValues()); } - Jackson2Tokenizer tokenizer = new Jackson2Tokenizer(parser, context, tokenizeArrays, forceUseOfBigDecimal, - maxInMemorySize); + Jackson2Tokenizer tokenizer = + new Jackson2Tokenizer(parser, context, tokenizeArrays, forceUseOfBigDecimal, maxInMemorySize); return dataBuffers.flatMap(tokenizer::tokenize, Flux::error, tokenizer::endOfInput); } catch (IOException ex) {