Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.4, 2.5, 2.6
-
Fix Version/s: 2.9
-
Labels:None
-
Environment:Windows x
-
Number of attachments :
Description
1. In the pom.xml i set property <encoding>:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> <version>2.6</version> <configuration> <encoding>UTF-8</encoding> </configuration> </plugin>
2. When i run the checkstyle (mvn checkstyle:checkstyle) this property is not set to "charset" attribute.
3. I noticed that this functionality works for version 2.2. However it does not work for versions 2.4 and above. I think that this functionality does not work after some refactoring is done and this functionality is moved in org.apache.maven.plugin.checkstyle.DefaultCheckstyleExecutor -> "public Configuration getConfiguration( CheckstyleExecutorRequest request )".
The problem is that in this method the developer tries to find the Checker module and to set its "charset" attribute as a child of the "config" object. However the "config" object it the Checker module itself.
Fix is simple - just take out adding of "charset" attribute value from the for cycle.
I will attach the class with the new code and difference between the new and old code.
I hope this bug can be fixed soon.
Thanks!
Best regards,
Svetlomira
Issue Links
- is related to
-
MCHECKSTYLE-137
Checkstyle plugin rejects Unicode single character constants.
-
-
MCHECKSTYLE-173
Embedded error: Cannot set property 'charset' in module Checker to 'UTF-8,UTF-8': UTF-8,UTF-8
-
I have submitted the patch: 3167139