From 1cdd8591fb3cc66b4e064cadfd825cca951fdf34 Mon Sep 17 00:00:00 2001 From: Steve Kieffer Date: Mon, 26 Aug 2024 12:03:22 -0400 Subject: [PATCH] Use static method instead of deprecated json parser constructor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (Applying suggestions from code review) Co-authored-by: Sören Domrös --- .../src/org/eclipse/elk/graph/json/test/EdgeCoordsTest.xtend | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/org.eclipse.elk.graph.json.test/src/org/eclipse/elk/graph/json/test/EdgeCoordsTest.xtend b/test/org.eclipse.elk.graph.json.test/src/org/eclipse/elk/graph/json/test/EdgeCoordsTest.xtend index b251128d2..6f9318b8f 100644 --- a/test/org.eclipse.elk.graph.json.test/src/org/eclipse/elk/graph/json/test/EdgeCoordsTest.xtend +++ b/test/org.eclipse.elk.graph.json.test/src/org/eclipse/elk/graph/json/test/EdgeCoordsTest.xtend @@ -141,8 +141,7 @@ class EdgeCoordsTest { val mode = p.get(0) val expectedString = p.get(1) - val parser = new JsonParser() - val jsonGraph = parser.parse(graph).asJsonObject + val jsonGraph = JsonParser.parseString(graph).asJsonObject jsonGraph.get("properties").asJsonObject.addProperty( "org.eclipse.elk.json.edgeCoords", mode @@ -166,7 +165,7 @@ class EdgeCoordsTest { val computedSec = edge2.get("sections").asJsonArray .get(0).asJsonObject - val expectedSec = parser.parse(expectedString).asJsonObject + val expectedSec = JsonParser.parseString(expectedString).asJsonObject assertEquals(expectedSec, computedSec) }