chore(path): restore getArcs immutability

This commit is contained in:
Paul Alnet 2024-05-25 17:31:15 +02:00
parent 9c47703bc4
commit 51c2c8b29e
2 changed files with 1 additions and 4 deletions

View file

@ -207,8 +207,7 @@ public class Path {
* @return List of arcs in the path. * @return List of arcs in the path.
*/ */
public List<Arc> getArcs() { public List<Arc> getArcs() {
// return Collections.unmodifiableList(arcs); return Collections.unmodifiableList(arcs);
return arcs;
} }
/** /**

View file

@ -15,7 +15,6 @@ import org.insa.graphs.model.Path;
import org.insa.graphs.model.RoadInformation; import org.insa.graphs.model.RoadInformation;
import org.insa.graphs.model.RoadInformation.RoadType; import org.insa.graphs.model.RoadInformation.RoadType;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
public class PathTest { public class PathTest {
@ -84,7 +83,6 @@ public class PathTest {
} }
@Test(expected = UnsupportedOperationException.class) @Test(expected = UnsupportedOperationException.class)
@Ignore // Mutability required for marathon path-finding algo
public void testImmutability() { public void testImmutability() {
emptyPath.getArcs().add(a2b); emptyPath.getArcs().add(a2b);
} }