Skip to content

[MPMD-369] System encoding conflicts with XML encoding in CpdViolationCheckMojo #339

Closed

Description

@jira-importer

Elliotte Rusty Harold opened MPMD-369 and commented

@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


Affects: 3.20.0

Remote Links:

Activity

  1. jira-importer commented on Apr 5, 2023

    @jira-importer
    Author

    Michael Osipov commented

    Beat me, but I have the feeling that I have seen this somewhere before.

  2. added
    bug
    priority:major
    on Jun 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugpriority:major

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions