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

Fix IndexOutOfBoundsException in S1166 (CatchUsesExceptionWithContextCheck:307)

    Details

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

      Description

      In the "sonarqube" analysis on cirrus-ci "SonarSource/peachee-languages" (e.g. 5 Apr 2021 21:30) we can see an IndexOutOfBoundsException raised by  CatchUsesExceptionWithContextCheck at line 307.

      304:  private static boolean hasDynamicExceptionMessageUsage(MethodInvocationTree mit) {
      305:    Arguments arguments = mit.arguments();
      306:    int argumentsCount = arguments.size();
      307:    ExpressionTree firstArg = arguments.get(0);
      

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alban.auzeill Alban Auzeill
                Reporter:
                alban.auzeill Alban Auzeill
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: