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

javac not considering a function which only throws RuntimeExceptions

    XMLWordPrintable

Details

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

    Description

      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.
        



      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: