Uploaded image for project: 'Maven PMD Plugin'
  1. Maven PMD Plugin
  2. MPMD-369

System encoding conflicts with XML encoding in CpdViolationCheckMojo

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.20.0
    • 3.21.0
    • None
    • None

    Description

      ```
      @Override
      protected List<Duplication> getErrorDetails( File cpdFile )
      throws XmlPullParserException, IOException
      {
      try ( FileReader fileReader = new FileReader( cpdFile ) )

      { CpdXpp3Reader reader = new CpdXpp3Reader(); CpdErrorDetail details = reader.read( fileReader, false ); return details.getDuplications(); }

      }
      ```

      It passes or fails depending on the system encoding. Instead it should use an inputstream rather than a reader and rely on the XML parser to detect the encoding. This breaks integration tests on some but not all platforms, again depending on whether the system encoding is or is not compatible with ISO-8859-1

      Attachments

        Issue Links

          Activity

            People

              elharo Elliotte Rusty Harold
              elharo Elliotte Rusty Harold
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: