You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "fdvxxii (JIRA)" <ji...@apache.org> on 2017/11/17 11:06:00 UTC

[jira] [Created] (MCHECKSTYLE-344) StringIndexOutOfBoundsException in RuleUtil

fdvxxii created MCHECKSTYLE-344:
-----------------------------------

             Summary: StringIndexOutOfBoundsException in RuleUtil
                 Key: MCHECKSTYLE-344
                 URL: https://issues.apache.org/jira/browse/MCHECKSTYLE-344
             Project: Maven Checkstyle Plugin
          Issue Type: Bug
          Components: checkstyle:check
    Affects Versions: 2.17
            Reporter: fdvxxii


{{RuleUtil}} has a bug at line 95:

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

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.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)