maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Harrison (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MCHECKSTYLE-344) StringIndexOutOfBoundsException in RuleUtil
Date Fri, 26 Jan 2018 13:24:00 GMT

    [ https://issues.apache.org/jira/browse/MCHECKSTYLE-344?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16341045#comment-16341045
] 

James Harrison commented on MCHECKSTYLE-344:
--------------------------------------------

I've submitted a pull-request ([#1|https://github.com/apache/maven-checkstyle-plugin/pull/1])
to fix this issue.

> 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
>            Priority: Major
>
> {{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
(v7.6.3#76005)

Mime
View raw message