Skip to content

Commit c0f4d78

Browse files
committed
Use Map.getOrDefault in getSqlType implementation
Issue: SPR-15238
1 parent 81aca78 commit c0f4d78

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/AbstractSqlParameterSource.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -64,11 +64,7 @@ public void registerTypeName(String paramName, String typeName) {
6464
@Override
6565
public int getSqlType(String paramName) {
6666
Assert.notNull(paramName, "Parameter name must not be null");
67-
Integer sqlType = this.sqlTypes.get(paramName);
68-
if (sqlType != null) {
69-
return sqlType;
70-
}
71-
return TYPE_UNKNOWN;
67+
return this.sqlTypes.getOrDefault(paramName, TYPE_UNKNOWN);
7268
}
7369

7470
/**

0 commit comments

Comments
 (0)