Uploaded image for project: 'Java'
  1. Java
  2. SONARJAVA-125

Rule S00112: Generic exceptions Error, RuntimeException, Throwable and Exception should never be thrown

    Details

      Description

      http://jira.sonarsource.com/browse/RSPEC-112

      As described in this thread: http://markmail.org/thread/5ewdhxhb5f3a3uv5

      This rule flagged the following code:

      public Error createError() {
        return new Error(); // <--- flagged this line
      }
      

      The Error class in question isn't even a Throwable.

      The PMD rule key is AvoidThrowingRawExceptionTypes

        Issue Links

          Activity

          Hide
          fabemn OLD - Fabrice Bellingard added a comment -

          Perfect!

          Manually tested.

          Show
          fabemn OLD - Fabrice Bellingard added a comment - Perfect! Manually tested.
          Hide
          godin OLD - Evgeny Mandrikov added a comment -

          Integration tests were updated.

          Show
          godin OLD - Evgeny Mandrikov added a comment - Integration tests were updated.

            People

            • Assignee:
              godin OLD - Evgeny Mandrikov
              Reporter:
              ganncamp OLD - GAC
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: