| | |
| | | |
| | | private void mask(Object value, IdentityHashMap<Object, Boolean> visited) { |
| | | if (value == null || value instanceof String || value.getClass().isEnum() || visited.put(value, Boolean.TRUE) != null) return; |
| | | // Path 的实现类(如 sun.nio.fs.UnixPath)本身是 Iterable;遍历其子路径会不断创建新对象, |
| | | // IdentityHashMap 无法识别该循环,因而会导致 StackOverflowError。 |
| | | // java.nio.file.Path 的实现类(如 sun.nio.fs.UnixPath)实现了 Iterable 接口; |
| | | // 遍历其子路径会不断创建新对象,IdentityHashMap 无法识别该循环,因而会导致 StackOverflowError。 |
| | | if (value instanceof java.nio.file.Path || isJdkType(value.getClass())) return; |
| | | if (value instanceof Map) { |
| | | for (Object entryObject : ((Map<?, ?>) value).entrySet()) { |