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

Add an extra test for JDK-8292755

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 21
    • 17, 21
    • tools
    • None
    • b22

    Description

      This task will add a test case for JShell crashing by running the following example code. This bug has been fixed by https://bugs.openjdk.org/browse/JDK-8292755

      // Case A
      @FunctionalInterface
      interface RunnableWithThrowable {
          void run() throws Throwable;

          // You can also replace `static` with `default` and test again
          static RunnableWithThrowable getInstance() {
              return () -> { throw new NotExist(); };
          }
      }

      // Case B
      @FunctionalInterface
      interface RunnableWithGenericException<X extends Throwable> {
          void run() throws X;

          static RunnableWithGenericException<?> getInstance() {
              return () -> { throw new NotExist(); };
          }
      }

      Attachments

        Issue Links

          Activity

            People

              wxiao Weibing Xiao
              wxiao Weibing Xiao
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: