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

javac not considering a function which only throws RuntimeExceptions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 8u221
    • core-libs
    • x86_64
    • windows_10

      A DESCRIPTION OF THE PROBLEM :
      I refactored single line below
      throw new RuntimeException("Error");
      into a function
      public void throwException() throws RuntimeException {
      throw new RuntimeException("Error");
      }

      There was a method
      public String test(String msg) throws RuntimeException {
      If(msg == null)
        throwException();
      else
        return msg;
      }

      The above method is showing compilation error which is not logical.
        



            psonal Pallavi Sonal (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: