Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8282573: ByteBufferTest.java: replace endless recursion with RuntimeException in void ck(double x, double y) #7674

Closed
wants to merge 3 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -217,7 +217,9 @@ void ck(long x, long y) {

void ck(double x, double y) {
if (x == x && y == y && x != y) {
Copy link
Member

Choose a reason for hiding this comment

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

What are the x == x and y == y checks good for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed it. @PaulSandoz agreed that this method was very suspect. I should try removing it. There is an off chance it could create some NaN issues on odd platforms.

ck(x, y);
throw new RuntimeException(" x = " + Double.toString(x) + ", y = " + Double.toString(y)
Copy link
Member

Choose a reason for hiding this comment

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

You might want to add some explanation to the exception:
s/" x = "/"Expected x == y: x = "

or something like that.

+ " (x = " + Long.toHexString(Double.doubleToRawLongBits(x))
+ ", y = " + Long.toHexString(Double.doubleToRawLongBits(y)) + ")");
}
}