Skip to content

Commit e45e0b0

Browse files
committed
8278937: JCK test for java_awt/geom/Line2D.Float fails after 8277868
Reviewed-by: jdv, kcr, rriggs
1 parent a68f28c commit e45e0b0

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

src/java.desktop/share/classes/java/awt/geom/Line2D.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ public static int relativeCCW(double x1, double y1,
532532
}
533533
}
534534
}
535-
return java.lang.Double.compare(ccw, 0.0);
535+
return (ccw < 0.0) ? -1 : ((ccw > 0.0) ? 1 : 0);
536536
}
537537

538538
/**

src/java.desktop/share/classes/sun/awt/geom/Curve.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,13 @@ public static double round(double v) {
730730
}
731731

732732
public static int orderof(double x1, double x2) {
733-
return Double.compare(x1, x2);
733+
if (x1 < x2) {
734+
return -1;
735+
}
736+
if (x1 > x2) {
737+
return 1;
738+
}
739+
return 0;
734740
}
735741

736742
public static long signeddiffbits(double y1, double y2) {

src/java.desktop/share/classes/sun/java2d/Spans.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,18 @@ boolean contains(float pos) {
317317
*/
318318
@Override
319319
public int compareTo(Span otherSpan) {
320-
return Float.compare(mStart, otherSpan.getStart());
320+
float otherStart = otherSpan.getStart();
321+
int result;
322+
323+
if (mStart < otherStart) {
324+
result = -1;
325+
} else if (mStart > otherStart) {
326+
result = 1;
327+
} else {
328+
result = 0;
329+
}
330+
331+
return result;
321332
}
322333

323334
public String toString() {

0 commit comments

Comments
 (0)