instanceof 관련 수정

master
mjkhan21 7 months ago
parent d0f296f481
commit c8e3cca90f

@ -297,8 +297,7 @@ public abstract class Cryptography extends AbstractComponent {
Predicate<TargetValue> filter = valueType -> { Predicate<TargetValue> filter = valueType -> {
if (obj == null) if (obj == null)
return false; return false;
if (obj instanceof Map) { if (obj instanceof Map<?, ?> map) {
Map<?, ?> map = (Map<?, ?>)obj;
for (String key: valueType.getMapKeys()) { for (String key: valueType.getMapKeys()) {
if (map.containsKey(key)) if (map.containsKey(key))
return true; return true;

@ -52,8 +52,7 @@ public class CryptographySupport extends MybatisPlugin {
protected Object handle(ResultSetHandler resultSetHandler, Statement statement) throws SQLException { protected Object handle(ResultSetHandler resultSetHandler, Statement statement) throws SQLException {
Object obj = super.handle(resultSetHandler, statement); Object obj = super.handle(resultSetHandler, statement);
if (obj instanceof List) { if (obj instanceof List<?> list) {
List<?> list = (List<?>)obj;
list.forEach(this::decrypt); list.forEach(this::decrypt);
} else { } else {
decrypt(obj); decrypt(obj);

Loading…
Cancel
Save