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

javac not considering a function which only throws RuntimeExceptions

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 8u221
    • Fix Version/s: None
    • Component/s: core-libs
    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      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

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

              Dates

              Created:
              Updated:
              Resolved: