This is an automated email from the ASF dual-hosted git repository. aherbert pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-geometry.git
commit e70f8eaeaf1a4fcee854471d1acd89ec73af110c Author: Alex Herbert <aherb...@apache.org> AuthorDate: Fri Apr 25 12:56:16 2025 +0100 sonar fix: one source of runtime exception in assertThrows --- .../commons/geometry/euclidean/threed/SimpleTriangle3DTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/SimpleTriangle3DTest.java b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/SimpleTriangle3DTest.java index 39732135..b5a29d92 100644 --- a/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/SimpleTriangle3DTest.java +++ b/commons-geometry-euclidean/src/test/java/org/apache/commons/geometry/euclidean/threed/SimpleTriangle3DTest.java @@ -85,7 +85,9 @@ class SimpleTriangle3DTest { Vector3D.of(0, 0, 1), Vector3D.of(1, 0, 1), Vector3D.of(0, 1, 1)); // act/assert - Assertions.assertThrows(UnsupportedOperationException.class, () -> tri.getVertices().add(Vector3D.of(-1, 0, 1))); + final List<Vector3D> vertices = tri.getVertices(); + final Vector3D v = Vector3D.of(-1, 0, 1); + Assertions.assertThrows(UnsupportedOperationException.class, () -> vertices.add(v)); } @Test