diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/AbstractSqlParameterSource.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/AbstractSqlParameterSource.java index 7ca10b9440..626cfb5f07 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/AbstractSqlParameterSource.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/AbstractSqlParameterSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 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. @@ -64,11 +64,7 @@ public abstract class AbstractSqlParameterSource implements SqlParameterSource { @Override public int getSqlType(String paramName) { Assert.notNull(paramName, "Parameter name must not be null"); - Integer sqlType = this.sqlTypes.get(paramName); - if (sqlType != null) { - return sqlType; - } - return TYPE_UNKNOWN; + return this.sqlTypes.getOrDefault(paramName, TYPE_UNKNOWN); } /**