diff --git a/src/main/java/cokr/xit/base/crypto/Cryptography.java b/src/main/java/cokr/xit/base/crypto/Cryptography.java index 2325eaa..df4b529 100644 --- a/src/main/java/cokr/xit/base/crypto/Cryptography.java +++ b/src/main/java/cokr/xit/base/crypto/Cryptography.java @@ -297,8 +297,7 @@ public abstract class Cryptography extends AbstractComponent { Predicate filter = valueType -> { if (obj == null) return false; - if (obj instanceof Map) { - Map map = (Map)obj; + if (obj instanceof Map map) { for (String key: valueType.getMapKeys()) { if (map.containsKey(key)) return true; diff --git a/src/main/java/cokr/xit/base/crypto/CryptographySupport.java b/src/main/java/cokr/xit/base/crypto/CryptographySupport.java index 1c01fbb..7e5b4bd 100644 --- a/src/main/java/cokr/xit/base/crypto/CryptographySupport.java +++ b/src/main/java/cokr/xit/base/crypto/CryptographySupport.java @@ -52,8 +52,7 @@ public class CryptographySupport extends MybatisPlugin { protected Object handle(ResultSetHandler resultSetHandler, Statement statement) throws SQLException { Object obj = super.handle(resultSetHandler, statement); - if (obj instanceof List) { - List list = (List)obj; + if (obj instanceof List list) { list.forEach(this::decrypt); } else { decrypt(obj);