Uploaded image for project: 'SonarJava'
  1. SonarJava
  2. SONARJAVA-1554

FP on S2221: invocation of unknown methods should not raise issue

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.12
    • Component/s: None
    • Labels:
      None

      Description

      No issue should be raised if the body of try block contains call to unknown methods, as we don't know if these methods could throw Exception.

      class B {
        public void foo() {
          try {
            unknownMethod();
          } catch (Exception e) { // Compliant
          }
        }
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                michael.gumowski Michael Gumowski
                Reporter:
                michael.gumowski Michael Gumowski
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: