Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-1853

Erroneous hint: Throwable method result is ignored

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 9.0
    • None
    • cnd - Editor
    • None

    Description

      In the following code the editor displays the warning "Throwable method result is ignored" at the commented line although that's not true.

      private String test() {
          try {
            throw new RuntimeException();
          } catch (RuntimeException e) {
            Throwable cause = e.getCause(); // <- Warning
            return "Error: " + (cause == null ? "null" : cause);
          }
        }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            groms Georg Romstorfer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: