From ac8a3055224f6b58464b38844baac4e299098717 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9A=AE=E5=9F=8E=E7=95=99=E9=A3=8E?= <2964556627@qq.com> Date: Mon, 22 Aug 2022 09:41:52 +0800 Subject: [PATCH 1/2] style: use double colon to optimize the writing method --- snack3/src/main/java/org/noear/snack/ONode.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/snack3/src/main/java/org/noear/snack/ONode.java b/snack3/src/main/java/org/noear/snack/ONode.java index d5aac2b..e1836ce 100644 --- a/snack3/src/main/java/org/noear/snack/ONode.java +++ b/snack3/src/main/java/org/noear/snack/ONode.java @@ -586,9 +586,7 @@ public class ONode { _d.tryInitObject(); if (map != null) { - map.forEach((k, v) -> { - set(k, v); - }); + map.forEach(this::set); } return this; } -- Gitee From 4c39b762705bf5f8ca5763636cef557b491614ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9A=AE=E5=9F=8E=E7=95=99=E9=A3=8E?= <2964556627@qq.com> Date: Mon, 22 Aug 2022 09:43:36 +0800 Subject: [PATCH 2/2] test: added the assertion not null --- snack3_demo/src/test/java/demo/Demo3.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/snack3_demo/src/test/java/demo/Demo3.java b/snack3_demo/src/test/java/demo/Demo3.java index 42c63cc..78dce70 100644 --- a/snack3_demo/src/test/java/demo/Demo3.java +++ b/snack3_demo/src/test/java/demo/Demo3.java @@ -92,6 +92,8 @@ public class Demo3 { String jsonArray = "[\"Android\",\"Java\",\"PHP\"]"; ONode ary0 = ONode.load(jsonArray); + Assert.assertNotNull(ary0); + List ary1 = ONode.deserialize(jsonArray,(new ArrayList(){}).getClass()); List ary2 = ONode.deserialize(jsonArray,(new TypeRef>(){}).getClass()); -- Gitee