Skip to content

Commit 405647a

Browse files
committed
style(geometry): fix code style again
1 parent 29c806b commit 405647a

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

src/main/java/com/thealgorithms/geometry/BentleyOttmann.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public int hashCode() {
127127
* Comparator for segments in the status structure (sweep line).
128128
* Orders segments by their y-coordinate at the current sweep line position.
129129
*/
130-
private final static class StatusComparator implements Comparator<Segment> {
130+
private static final class StatusComparator implements Comparator<Segment> {
131131
@Override
132132
public int compare(Segment s1, Segment s2) {
133133
if (s1.id == s2.id) {

src/test/java/com/thealgorithms/geometry/BentleyOttmannTest.java

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package com.thealgorithms.geometry;
22

33
import static org.junit.jupiter.api.Assertions.assertEquals;
4-
import static org.junit.jupiter.api.Assertions.assertTrue;
5-
import static org.junit.jupiter.api.Assertions.assertThrows;
64
import static org.junit.jupiter.api.Assertions.assertFalse;
75
import static org.junit.jupiter.api.Assertions.assertNotNull;
6+
import static org.junit.jupiter.api.Assertions.assertThrows;
7+
import static org.junit.jupiter.api.Assertions.assertTrue;
88

99
import java.awt.geom.Point2D;
1010
import java.util.ArrayList;
@@ -172,8 +172,8 @@ void testGridPattern() {
172172
void testTriangleIntersections() {
173173
// Three segments forming a triangle
174174
List<Object> segments = List.of(newSegment(0, 0, 4, 0), // base
175-
newSegment(0, 0, 2, 3), // left side
176-
newSegment(4, 0, 2, 3) // right side
175+
newSegment(0, 0, 2, 3), // left side
176+
newSegment(4, 0, 2, 3) // right side
177177
);
178178

179179
Set<Point2D.Double> intersections = BentleyOttmann.findIntersections(cast(segments));
@@ -194,8 +194,6 @@ void testCrossingDiagonals() {
194194
assertEquals(1, intersections.size());
195195
}
196196

197-
198-
199197
@Test
200198
void testVerySmallSegments() {
201199
List<Object> segments = List.of(newSegment(0.001, 0.001, 0.002, 0.002), newSegment(0.001, 0.002, 0.002, 0.001));
@@ -221,9 +219,9 @@ void testSegmentsShareCommonPoint() {
221219
void testSegmentsAtAngles() {
222220
// Segments at 45, 90, 135 degrees
223221
List<Object> segments = List.of(newSegment(0, 2, 4, 2), // horizontal
224-
newSegment(2, 0, 2, 4), // vertical
225-
newSegment(0, 0, 4, 4), // 45 degrees
226-
newSegment(0, 4, 4, 0) // 135 degrees
222+
newSegment(2, 0, 2, 4), // vertical
223+
newSegment(0, 0, 4, 4), // 45 degrees
224+
newSegment(0, 4, 4, 0) // 135 degrees
227225
);
228226

229227
Set<Point2D.Double> intersections = BentleyOttmann.findIntersections(cast(segments));
@@ -262,8 +260,8 @@ void testPerformanceWithManySegments() {
262260
void testIssueExample() {
263261
// Example from the GitHub issue
264262
List<Object> segments = List.of(newSegment(1, 1, 5, 5), // Segment A
265-
newSegment(1, 5, 5, 1), // Segment B
266-
newSegment(3, 0, 3, 6) // Segment C
263+
newSegment(1, 5, 5, 1), // Segment B
264+
newSegment(3, 0, 3, 6) // Segment C
267265
);
268266

269267
Set<Point2D.Double> intersections = BentleyOttmann.findIntersections(cast(segments));
@@ -276,11 +274,10 @@ void testIssueExample() {
276274
@Test
277275
void testEventTypeOrdering() {
278276
// Multiple events at the same point with different types
279-
List<Object> segments = List.of(
280-
newSegment(2, 2, 6, 2), // ends at (2,2)
281-
newSegment(0, 2, 2, 2), // ends at (2,2)
282-
newSegment(2, 2, 2, 6), // starts at (2,2)
283-
newSegment(2, 0, 2, 2) // ends at (2,2)
277+
List<Object> segments = List.of(newSegment(2, 2, 6, 2), // ends at (2,2)
278+
newSegment(0, 2, 2, 2), // ends at (2,2)
279+
newSegment(2, 2, 2, 6), // starts at (2,2)
280+
newSegment(2, 0, 2, 2) // ends at (2,2)
284281
);
285282

286283
Set<Point2D.Double> intersections = BentleyOttmann.findIntersections(cast(segments));

0 commit comments

Comments
 (0)