Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8202401

[Nestmates] jshell tests fail due to class redefinition limitation on nested types

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: repo-valhalla
    • Fix Version/s: repo-valhalla
    • Component/s: tools
    • Labels:

      Description

      Tests:
       - jdk/jshell/ClassesTest.java
       - jdk/jshell/GetResourceTest.java
       - jdk/jshell/ForwardReferenceTest.java

      Typical failure mode is:

      java.lang.AssertionError: Expected no signature-change, got: signature-change
         expected-event: STEInfo key: MAIN_SNIPPET before: VALID status: VALID sig: false cause: null
         got-event: key: 3 before: VALID status: VALID sig: true cause: null expected [false] but found [true]

      This occurs when a test involves nested types. As jshell tries to use class redefinition when possible, it will hit errors if trying to redefine classes in a way that would modify the NestHost or NestMembers attributes. It then falls back to an alternative technique. For the tests this results in a "signature-change" that is unexpected.

      The simple fix is to change the "expects signature-change parameter" from false to true for those test cases.

        Attachments

          Activity

            People

            • Assignee:
              dholmes David Holmes
              Reporter:
              dholmes David Holmes
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: