Use Map.getOrDefault in getSqlType implementation
Issue: SPR-15238
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user