diff --git a/Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/edge/routing/ArticulatedEdgeRouter.java b/Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/edge/routing/ArticulatedEdgeRouter.java index 7ae6d495fd..7bdafa0a9f 100644 --- a/Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/edge/routing/ArticulatedEdgeRouter.java +++ b/Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/edge/routing/ArticulatedEdgeRouter.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -25,7 +25,7 @@ import java.util.List; import java.util.Map.Entry; import java.util.concurrent.atomic.AtomicInteger; -import org.apache.commons.collections4.*; +import org.apache.commons.collections4.map.LazyMap; import edu.uci.ics.jung.algorithms.layout.Layout; import edu.uci.ics.jung.graph.Graph; @@ -241,10 +241,7 @@ class ArticulatedEdgeRouter> Layout layout = viewer.getGraphLayout(); Graph graph = layout.getGraph(); - Set prototype = new HashSet<>(); - Factory> factory = FactoryUtils.prototypeFactory(prototype); - Map> map = MapUtils.lazyMap(new HashMap>(), factory); - + LazyMap> map = LazyMap.lazyMap(new HashMap>(), () -> new HashSet<>()); Map vertexBoundsMap = getVertexBounds(); Set> entrySet = vertexBoundsMap.entrySet(); for (Entry entry : entrySet) { diff --git a/Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/layout/LayoutPositions.java b/Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/layout/LayoutPositions.java index d2b7c9ef6c..fc936197de 100644 --- a/Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/layout/LayoutPositions.java +++ b/Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/layout/LayoutPositions.java @@ -17,9 +17,7 @@ package ghidra.graph.viewer.layout; import java.awt.geom.Point2D; import java.util.*; - -import org.apache.commons.collections4.TransformerUtils; -import org.apache.commons.collections4.map.TransformedMap; +import java.util.Map.Entry; import edu.uci.ics.jung.algorithms.layout.Layout; import ghidra.graph.VisualGraph; @@ -78,13 +76,34 @@ public class LayoutPositions> { } private void setVertexLocations(Map newVertexLocations) { - this.vertexLocations = TransformedMap.transformedMap(newVertexLocations, - TransformerUtils.nopTransformer(), TransformerUtils.cloneTransformer()); + + Map newMap = new HashMap<>(); + Set> entries = newVertexLocations.entrySet(); + for (Entry entry : entries) { + V key = entry.getKey(); + Point2D value = entry.getValue(); + newMap.put(key, (Point2D) value.clone()); + } + + this.vertexLocations = newMap; } private void setEdgeArticulations(Map> newEdgeArticulations) { - this.edgeArticulations = TransformedMap.transformedMap(newEdgeArticulations, - TransformerUtils.nopTransformer(), TransformerUtils.cloneTransformer()); + + Map> newMap = new HashMap<>(); + Set>> entries = newEdgeArticulations.entrySet(); + for (Entry> entry : entries) { + E key = entry.getKey(); + List value = entry.getValue(); + List newList = new ArrayList<>(); + for (Point2D p : value) { + newList.add(p); + } + + newMap.put(key, newList); + } + + this.edgeArticulations = newMap; } public Map getVertexLocations() {