Uploaded image for project: 'Maven Checkstyle Plugin'
  1. Maven Checkstyle Plugin
  2. MCHECKSTYLE-344

StringIndexOutOfBoundsException in RuleUtil

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.17
    • Fix Version/s: 3.1.0
    • Component/s: checkstyle:check
    • Labels:
      None

      Description

      RuleUtil has a bug at line 95:

      		final int end = eventSrcName.lastIndexOf('.');
      		eventSrcName = eventSrcName.substring(0, end);		
      

      This code leads to a StringIndexOutOfBoundsException if the variable does not contain a period. I don't know if its a convention to have a period in that string, but either way the error message should me more expressive.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gboue Guillaume Boué
                Reporter:
                fdvxxii fdvxxii
              • Votes:
                2 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: