You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (Jira)" <ji...@apache.org> on 2023/05/10 11:17:00 UTC

[jira] [Updated] (MPMD-369) System encoding conflicts with XML encoding in CpdViolationCheckMojo

     [ https://issues.apache.org/jira/browse/MPMD-369?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Osipov updated MPMD-369:
--------------------------------
    Affects Version/s: 3.20.0

> System encoding conflicts with XML encoding in CpdViolationCheckMojo
> --------------------------------------------------------------------
>
>                 Key: MPMD-369
>                 URL: https://issues.apache.org/jira/browse/MPMD-369
>             Project: Maven PMD Plugin
>          Issue Type: Bug
>    Affects Versions: 3.20.0
>            Reporter: Elliotte Rusty Harold
>            Assignee: Elliotte Rusty Harold
>            Priority: Major
>             Fix For: 3.21.0
>
>
> ```
>     @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



--
This message was sent by Atlassian Jira
(v8.20.10#820010)