From 3a46e2e60c6282d5d8d9a64e5d1dac5130252784 Mon Sep 17 00:00:00 2001 From: ZhouXY108 Date: Tue, 27 Jun 2023 01:11:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=98=E9=87=8F=E5=90=8D?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/jdbc/SimpleJdbcTemplate.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/java/xyz/zhouxy/plusone/commons/jdbc/SimpleJdbcTemplate.java b/src/main/java/xyz/zhouxy/plusone/commons/jdbc/SimpleJdbcTemplate.java index 51d274f..9200c7b 100644 --- a/src/main/java/xyz/zhouxy/plusone/commons/jdbc/SimpleJdbcTemplate.java +++ b/src/main/java/xyz/zhouxy/plusone/commons/jdbc/SimpleJdbcTemplate.java @@ -51,23 +51,23 @@ public class SimpleJdbcTemplate { public static Object[] buildParams(final Object... params) { return Arrays.stream(params) - .map(p -> { - if (p instanceof Optional) { - return OptionalUtil.orElseNull((Optional) p); + .map(param -> { + if (param instanceof Optional) { + return OptionalUtil.orElseNull((Optional) param); } - if (p instanceof OptionalInt) { - OptionalInt _p = ((OptionalInt) p); - return _p.isPresent() ? _p.getAsInt() : null; + if (param instanceof OptionalInt) { + OptionalInt p = ((OptionalInt) param); + return p.isPresent() ? p.getAsInt() : null; } - if (p instanceof OptionalLong) { - OptionalLong _p = ((OptionalLong) p); - return _p.isPresent() ? _p.getAsLong() : null; + if (param instanceof OptionalLong) { + OptionalLong p = ((OptionalLong) param); + return p.isPresent() ? p.getAsLong() : null; } - if (p instanceof OptionalDouble) { - OptionalDouble _p = ((OptionalDouble) p); - return _p.isPresent() ? _p.getAsDouble() : null; + if (param instanceof OptionalDouble) { + OptionalDouble p = ((OptionalDouble) param); + return p.isPresent() ? p.getAsDouble() : null; } - return p; + return param; }) .toArray(); }