Wim C created BUILDR-672:
----------------------------

             Summary: Buildr checkstyle plugin is always returning a new 
instance of the properties Hash
                 Key: BUILDR-672
                 URL: https://issues.apache.org/jira/browse/BUILDR-672
             Project: Buildr
          Issue Type: Bug
          Components: Extensions
    Affects Versions: 1.4.12
            Reporter: Wim C
            Priority: Minor


If we use properties in the checkstyle configuration file (see snippt below), 
we can not set these properties on the checkstyle extension.
The checkstyle.properties method is always returning a new instance of the 
properties Hash.

{code:xml}
  <module name="SuppressionFilter">
    <property name="file" value="${config.dir}/suppressions.xml"/>
  </module>
{code}

Possible solution :

{code:ruby}
    def properties
      @properties ||= original_properties
    end

    private
    def original_properties
      properties = {:basedir => self.project.base_dir}
      properties['checkstyle.suppressions.file'] = self.suppressions_file if 
File.exist?(self.suppressions_file)
      properties['checkstyle.import-control.file'] = self.import_control_file 
if File.exist?(self.import_control_file)
      properties
    end
{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to