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

Code hint "Add @throws tag" for generic exception in Java shows up even if already present

    XMLWordPrintableJSON

Details

    Description

      The code hint "Add @throws tag" for a generic exception shows up, even if I already added the tag.
      The following code reproduces the problem:

      /**
       * Some method.
       *
       * @param <X>
       * @throws X Some throwable.
       */
      public static <X extends Exception> void someMethod() throws X { }

      The hint appears at the line with the method declaration. The JavaDoc `throws` tag is already defined, and yet the hint appears or doesn't go away. If I click on the hint entry in order to apply it, another `throws` tag isĀ inserted, leaving the following code:

      /**
       * Some method.
       *
       * @param <X>
       * @throws X
       * @throws X Some throwable.
       */
      public static <X extends Exception> void someMethod() throws X { }

      Still, the hint is visible.

      Obviously, the expected behaviour is that the hint is not visible if the `throws` tag exists for this particular generic exception type.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              MC Emperor Maurits de Jong
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 10m
                  2h 10m