maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Edward Ciramella (JIRA)" <j...@codehaus.org>
Subject [jira] Commented: (MCHECKSTYLE-59) Checkstyle Report fails if propertyExpansion contains backslash characters
Date Fri, 26 Mar 2010 18:49:23 GMT

    [ http://jira.codehaus.org/browse/MCHECKSTYLE-59?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=215539#action_215539
] 

Edward Ciramella commented on MCHECKSTYLE-59:
---------------------------------------------

Sorry Olivier - 

I found my solution and figured it'd be good to post here in case someone else searches and
finds this thing.

I switched:

<module name="GenericIllegalRegexp">

to 

<module name="Regexp">

and everything is happy now.

Sorry for the noise!

> Checkstyle Report fails if propertyExpansion contains backslash characters
> --------------------------------------------------------------------------
>
>                 Key: MCHECKSTYLE-59
>                 URL: http://jira.codehaus.org/browse/MCHECKSTYLE-59
>             Project: Maven 2.x Checkstyle Plugin
>          Issue Type: Bug
>    Affects Versions: 2.1
>         Environment: Windows XP, JDK 1.4, Maven 2.0.4
>            Reporter: Carsten Karkola
>            Assignee: Dennis Lundberg
>             Fix For: 2.2
>
>         Attachments: MCHECKSTYLE-59-PATCH.patch, MCHECKSTYLE-59-PATCH2.patch
>
>
> The chechkstyle plugin fails on windows plattforms, if the propertyExpansion element
contains file names like 
>   mms.suppressions.file=${basedir}/../../project/resources/checkstyle/suppressions.xml
> The backslashes in ${basedir} (like D:\foo\bar) are missing (D:foobar) and checkstyle
fails. It seems to be an issue with StringInputStream.
> I've replaced the following old code in CheckstyleReport.java
> {code}
>             if ( StringUtils.isNotEmpty( propertyExpansion ) )
>             {
>                 p.load( new StringInputStream( propertyExpansion ) );
>             }
> {code}
> with the new Code
> {code}
>       if ( StringUtils.isNotEmpty( propertyExpansion ) ) {
>         BufferedReader reader = new BufferedReader(new StringReader(propertyExpansion));
>         String line = reader.readLine();
>         while (line != null) {
>           int delimPosition = line.indexOf('=');
>           if (delimPosition > -1) {
>             String name = line.substring(0, delimPosition).trim();
>             delimPosition++;
>             if (delimPosition < line.length()) {
>               String value = line.substring(delimPosition).trim();
>               if (value.length() > 0) {
>                 p.put(name, value);
>                 getLog().info("Property: " + name + " = " + p.getProperty(name));
>               }
>             }
>           }
>           line = reader.readLine();
>         }
>         reader.close();
>       }
> {code}
> and it works.
> Regards, carsten

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message