Skip to content

Patching does not respect the encoding attribute of maven-compiler-plugin #689

@garyhodgson

Description

@garyhodgson

Running error-prone with the -XepPatchChecks compiler option on a codebase using en encoding other than UTF-8 results in corrupted characters.

It appears that the patch logic hardcodes the UTF_8 Charset when reading (and writing?) the source files, e.g. here, thus ignoring the 'encoding' attribute of the maven-compiler-plugin (which defaults to project.build.sourceEncoding)

I don't know if this is necessarily something to fix. We only noticed it in an older codebase that is not yet migrated to UTF-8 and our workaround is to disable errorprone until we migrate. Perhaps just a warning in the documentation would suffice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions