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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • 26
    • None
    • 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)

            jlahoda Jan Lahoda
            abimpoudis Angelos Bimpoudis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: