JDK-8282665 : [REDO] ByteBufferTest.java: replace endless recursion with RuntimeException in void ck(double x, double y)
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 19
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-03-04
  • Updated: 2024-02-22
  • Resolved: 2022-03-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 17 JDK 19
11.0.22-oracleFixed 17.0.9-oracleFixed 19 b13Fixed
Related Reports
Cloners :  
Relates :  
Relates :  
Relates :  
Description
We have two functions ck, that are supposed to compare the two inputs and make the test fail if they are not equal.

    void ck(long x, long y) {
        if (x != y) {
            throw new RuntimeException(" x = " + Long.toHexString(x) + ", y = " + Long.toHexString(y));
        }
    }

    void ck(double x, double y) {
        if (x == x && y == y && x != y) {
            ck(x, y);
        }
    }

The long throws a RuntimeException.
The one for double goes into an infinite recursion, and eventually throws a StackOverflowError. This does not make much sense.
I spoke with the original author [~psandoz], he agrees to replace it with an analogue RuntimeException.

    void ck(double x, double y) {
        if (x == x && y == y && x != y) {
            throw new RuntimeException(...);
        }
    }

Code introduced in JDK-8151163.
Bug in JDK-8282555 encountered both this endless recursion as the RuntimeException, of the respective ck functions.
Comments
[jdk11u-fix-request] Approval Request from Amos “Backporting for parity with jdk 11.0.22-oracle. No risk, test fix. Clean backort. SAP nightlies passed on 2023-11-30.”
30-11-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk11u-dev/pull/2309 Date: 2023-11-29 09:44:04 +0000
29-11-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/1470 Date: 2023-06-19 15:42:15 +0000
19-06-2023

Fix Request (17u): Should get backported for parity with 17.0.9-oracle. Applies cleanly.
19-06-2023

Changeset: d07f7c76 Author: Emanuel Peter <emanuel.peter@oracle.com> Committer: Tobias Hartmann <thartmann@openjdk.org> Date: 2022-03-09 08:59:37 +0000 URL: https://git.openjdk.java.net/jdk/commit/d07f7c76c5df1473bffa41f10a89ca1e21e001ef
09-03-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk/pull/7723 Date: 2022-03-07 08:41:18 +0000
07-03-2022