Skip to content

Commit

Permalink
8278937: JCK test for java_awt/geom/Line2D.Float fails after 8277868
Browse files Browse the repository at this point in the history
Reviewed-by: jdv, kcr, rriggs
  • Loading branch information
prrace committed Dec 17, 2021
1 parent a68f28c commit e45e0b0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/java.desktop/share/classes/java/awt/geom/Line2D.java
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ public static int relativeCCW(double x1, double y1,
}
}
}
return java.lang.Double.compare(ccw, 0.0);
return (ccw < 0.0) ? -1 : ((ccw > 0.0) ? 1 : 0);
}

/**
Expand Down
8 changes: 7 additions & 1 deletion src/java.desktop/share/classes/sun/awt/geom/Curve.java
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,13 @@ public static double round(double v) {
}

public static int orderof(double x1, double x2) {
return Double.compare(x1, x2);
if (x1 < x2) {
return -1;
}
if (x1 > x2) {
return 1;
}
return 0;
}

public static long signeddiffbits(double y1, double y2) {
Expand Down
13 changes: 12 additions & 1 deletion src/java.desktop/share/classes/sun/java2d/Spans.java
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,18 @@ boolean contains(float pos) {
*/
@Override
public int compareTo(Span otherSpan) {
return Float.compare(mStart, otherSpan.getStart());
float otherStart = otherSpan.getStart();
int result;

if (mStart < otherStart) {
result = -1;
} else if (mStart > otherStart) {
result = 1;
} else {
result = 0;
}

return result;
}

public String toString() {
Expand Down

1 comment on commit e45e0b0

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.