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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • repo-valhalla
    • repo-valhalla
    • tools

    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

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

            Dates

              Created:
              Updated:
              Resolved: