Uploaded image for project: 'Maven Checkstyle Plugin'
  1. Maven Checkstyle Plugin
  2. MCHECKSTYLE-1

Use of 'severity' attribute in module configuration file causes UnsupportedOperationException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0
    • None
    • None
    • Windows XP, J2SDK 1.4.2_10, maven-checkstyle-plugin 2.0-beta-2-SNAPSHOT, Maven 2.0.2-SNAPSHOT

    Description

      When I provide the Checkstyle plugin with a customised config file, it causes it to crash unpleasantly when generating the report. It appears that this is due to calling the 'remove' method on Arrays$ArrayList, which doesn't implement the method. The call is actually removing the 'severity' property from the list of columns before going on to process the rest. Wrapping the list in an actual ArrayList (java.util.ArrayList) solves the problem.

      To replicate, add <configLocation>your-rules.xml</configLocation> to the plugin configuration, and ensure that at least two modules in your-rules.xml have the severity property set, something like:

      <?xml version="1.0"?>
      <!DOCTYPE module PUBLIC
      "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
      "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">

      <module name="Checker">
      <module name="PackageHtml">
      <property name="severity" value="warning" />
      </module>

      <module name="NewlineAtEndOfFile">
      <property name="severity" value="info" />
      </module>
      </module>

      Attachments

        1. trace.txt
          3 kB
          Nick Giles

        Activity

          People

            fgiust Fabrizio Giustina
            uroshnor Nick Giles
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: