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

StringIndexOutOfBoundsException in RuleUtil

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.17
    • 3.1.0
    • checkstyle:check
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: