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

2019-02-18 Thread richard (JIRA)


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

richard commented on MCHECKSTYLE-344:
-

Eolivelli responded in github PR and discussed doing a release sometime. They 
are working on merging some other PRs.

https://github.com/apache/maven-checkstyle-plugin/pull/1#issuecomment-464564860

> 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
>Assignee: Guillaume Boué
>Priority: Major
> Fix For: 3.0.1
>
>
> {{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)


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

2019-02-17 Thread Tim Jacomb (JIRA)


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

Tim Jacomb commented on MCHECKSTYLE-344:


Who is able to release this the fix was merged nearly a year ago?

> 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
>Assignee: Guillaume Boué
>Priority: Major
> Fix For: 3.0.1
>
>
> {{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)


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

2019-01-11 Thread Nikola (JIRA)


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

Nikola commented on MCHECKSTYLE-344:


Until 3.0.1 is released, workaround can be to name identifier with a dot, e.g. 
workaround.myCheckIdentifier

> 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
>Assignee: Guillaume Boué
>Priority: Major
> Fix For: 3.0.1
>
>
> {{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)


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

2018-11-13 Thread Daniel Wegener (JIRA)


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

Daniel Wegener commented on MCHECKSTYLE-344:



Hallo,

ich bin bis zum 17.11.2018 im Urlaub und bis dahin leider nicht erreichbar.

Beste Grüße

Daniel Wegener
Holisticon AG

Griegstraße 75, Haus 25
22763 Hamburg
Mobile: +49 176 1616 9025
Office: +49 40 6094 430-0
Fax:  +49 40 6094 430-30
E-Mail: daniel.wege...@holisticon.de
www.holisticon.de

Amtsgericht Hamburg, HRB 107396
Vorstand: Oliver Ihns, Dierk Harbeck
Aufsichtsrat: Sune Nilsson (Vorsitz)


> 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
>Assignee: Guillaume Boué
>Priority: Major
> Fix For: 3.0.1
>
>
> {{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)


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

2018-11-13 Thread JIRA


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

Manuel Jesús Recena Soto commented on MCHECKSTYLE-344:
--

+1 I would like to see this fix released.

> 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
>Assignee: Guillaume Boué
>Priority: Major
> Fix For: 3.0.1
>
>
> {{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)


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

2018-07-20 Thread James Harrison (JIRA)


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

James Harrison commented on MCHECKSTYLE-344:


[~gboue]: Would it be possible to release this fix? We are having to use a 
local build to work around this issue at the moment.

> 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
>Assignee: Guillaume Boué
>Priority: Major
> Fix For: 3.0.1
>
>
> {{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)


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

2018-06-12 Thread Daniel Ward (JIRA)


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

Daniel Ward commented on MCHECKSTYLE-344:
-

Do you know when 3.0.1 will be released?  I am suffering from this exact 
situation.  Is there a work-around?

> 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
>Assignee: Guillaume Boué
>Priority: Major
> Fix For: 3.0.1
>
>
> {{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)


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

2018-02-24 Thread Hudson (JIRA)

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

Hudson commented on MCHECKSTYLE-344:


Build succeeded in Jenkins: Maven TLP » maven-checkstyle-plugin » master #11

See 
https://builds.apache.org/job/maven-box/job/maven-checkstyle-plugin/job/master/11/

> 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
>Assignee: Guillaume Boué
>Priority: Major
> Fix For: 3.0.1
>
>
> {{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)


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

2018-02-24 Thread JIRA

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

Guillaume Boué commented on MCHECKSTYLE-344:


Fixed in 
[ca3eb97600576e0bee9f075b4bda0efdd0f6247d|https://gitbox.apache.org/repos/asf?p=maven-checkstyle-plugin.git;a=commit;h=ca3eb97600576e0bee9f075b4bda0efdd0f6247d].
 Thanks for the PR!

> 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
> Fix For: 3.0.1
>
>
> {{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)


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

2018-02-24 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on MCHECKSTYLE-344:


asfgit closed pull request #1: MCHECKSTYLE-344 Fix category resolution when 
reporting violation
URL: https://github.com/apache/maven-checkstyle-plugin/pull/1
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/src/main/java/org/apache/maven/plugins/checkstyle/RuleUtil.java 
b/src/main/java/org/apache/maven/plugins/checkstyle/RuleUtil.java
index 79e943e..ff53a3e 100644
--- a/src/main/java/org/apache/maven/plugins/checkstyle/RuleUtil.java
+++ b/src/main/java/org/apache/maven/plugins/checkstyle/RuleUtil.java
@@ -92,7 +92,7 @@ public static String getCategory( String eventSrcName )
 }
 
 int end = eventSrcName.lastIndexOf( '.' );
-eventSrcName = eventSrcName.substring( 0,  end );
+eventSrcName = end == -1 ? eventSrcName : eventSrcName.substring( 0,  
end );
 
 if ( CHECKSTYLE_PACKAGE.equals( eventSrcName ) )
 {
diff --git 
a/src/test/java/org/apache/maven/plugins/checkstyle/RuleUtilTest.java 
b/src/test/java/org/apache/maven/plugins/checkstyle/RuleUtilTest.java
index 4b827c4..457be55 100644
--- a/src/test/java/org/apache/maven/plugins/checkstyle/RuleUtilTest.java
+++ b/src/test/java/org/apache/maven/plugins/checkstyle/RuleUtilTest.java
@@ -1,6 +1,6 @@
 package org.apache.maven.plugins.checkstyle;
 
-import org.apache.maven.plugins.checkstyle.RuleUtil;
+import junit.framework.TestCase;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -21,8 +21,6 @@
  * under the License.
  */
 
-import junit.framework.TestCase;
-
 public class RuleUtilTest
 extends TestCase
 {
@@ -40,6 +38,7 @@ public void testGetCategory()
 assertEquals( "misc", RuleUtil.getCategory( CHECKSTYLE_PACKAGE + 
".FinalParametersCheck" ) );
 assertEquals( "test", RuleUtil.getCategory( CHECKSTYLE_PACKAGE + 
".test.FinalParametersCheck" ) );
 assertEquals( "extension", RuleUtil.getCategory( 
"test.FinalParametersCheck" ) );
+assertEquals( "extension", RuleUtil.getCategory( "copyright" ) );
 assertNull( RuleUtil.getCategory( (String) null ) );
 }
 


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> 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)


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

2018-02-21 Thread Jonathan Haber (JIRA)

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

Jonathan Haber commented on MCHECKSTYLE-344:


I just wanted to report that we're also experiencing this issue in our codebase 
and that the PR James sent looks good to me.

> 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)


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

2018-01-26 Thread James Harrison (JIRA)

[ 
https://issues.apache.org/jira/browse/MCHECKSTYLE-344?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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)


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

2018-01-26 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on MCHECKSTYLE-344:


jjlharrison opened a new pull request #1: MCHECKSTYLE-344 Fix category 
resolution when reporting violation
URL: https://github.com/apache/maven-checkstyle-plugin/pull/1
 
 
   Fix for 
[MCHECKSTYLE-344](https://issues.apache.org/jira/browse/MCHECKSTYLE-344).


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> 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)


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

2018-01-03 Thread richard (JIRA)

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

richard commented on MCHECKSTYLE-344:
-

We hit this as well in sevntu at 
https://travis-ci.org/sevntu-checkstyle/sevntu.checkstyle/jobs/324422086 .

{noformat}
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of 
range: -1
at java.lang.String.substring (String.java:1967)
at org.apache.maven.plugin.checkstyle.RuleUtil.getCategory 
(RuleUtil.java:95)
at 
org.apache.maven.plugin.checkstyle.CheckstyleViolationCheckMojo.countViolations 
(CheckstyleViolationCheckMojo.java:651)
at org.apache.maven.plugin.checkstyle.CheckstyleViolationCheckMojo.execute 
(CheckstyleViolationCheckMojo.java:576)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo 
(DefaultBuildPluginManager.java:134)
{noformat}

This is the result of a change in the XML file in Checkstyle starting with 
version 8.2 at https://github.com/checkstyle/checkstyle/issues/4607 .
By giving a module a unique id, we changed the XML file to print the id as the 
source instead of the full class name. This is why maven plugin is expecting a 
period in the source.

> 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)