jshell crash when existing sealed class is updated to also be abstract

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • 26
    • Affects Version/s: 26
    • Component/s: tools
    • None

      1. start a new JShell
      2. paste the following and press enter:

      sealed interface Animal permits Mammal, Bird { }

      sealed class Mammal implements Animal
      permits Dog, Cat { }

      final class Dog extends Mammal { }
      final class Cat extends Mammal { }

      final class Bird implements Animal { }

      3. then go back, add `abstract` and press enter:

      Exception in thread "main" java.lang.VerifyError: verifier detected internal inconsistency or security problem
              at jdk.jdi/com.sun.tools.jdi.VirtualMachineImpl.redefineClasses(VirtualMachineImpl.java:401)
              at jdk.jshell/jdk.jshell.execution.JdiExecutionControl.redefine(JdiExecutionControl.java:90)
              at jdk.jshell/jdk.jshell.Unit.doRedefines(Unit.java:312)
              at jdk.jshell/jdk.jshell.Eval.lambda$compileAndLoad$16(Eval.java:1142)
              at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:196)
              at java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:722)

            Assignee:
            Jan Lahoda
            Reporter:
            Angelos Bimpoudis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: