Skip to content

Conversation

@elharo
Copy link
Contributor

@elharo elharo commented Aug 19, 2025

@wendigo fixes #1241

On inspection I realized that the existing code is working at cross-purposes to the design of Java in that it catches an exception and converts it to null. That is, it converts an exception to an error flag that has to be explicitly checked for. Instead the exception should be caught and handled. I deprecated the method and replaced all usages within this plugin. Since the method is protected inside what should be (but isn't) a static utility class, I doubt anyone else is subclassing and invoking this, but just in case I left it in.

@elharo elharo requested a review from Copilot August 19, 2025 18:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes issue #1241 by specifying UTF-8 encoding when reading log files instead of using platform-dependent encoding. This ensures consistent behavior across different operating systems and environments where the default platform encoding may vary.

  • Replaces platform encoding (null) with explicit UTF-8 encoding specification
  • Improves cross-platform compatibility for log file reading

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

logError("MavenInvocationException: " + e.getMessage(), e);

String invokerLogContent = JavadocUtil.readFile(invokerLogFile, null /* platform encoding */);
String invokerLogContent = JavadocUtil.readFile(invokerLogFile, "UTF-8");
Copy link

Copilot AI Aug 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using StandardCharsets.UTF_8 instead of the string literal "UTF-8" to avoid potential typos and improve type safety.

Suggested change
String invokerLogContent = JavadocUtil.readFile(invokerLogFile, "UTF-8");
String invokerLogContent = JavadocUtil.readFile(invokerLogFile, StandardCharsets.UTF_8.name());

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tend to agree with the bot here.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are other places like that

logError("MavenInvocationException: " + e.getMessage(), e);

String invokerLogContent = JavadocUtil.readFile(invokerLogFile, null /* platform encoding */);
String invokerLogContent = JavadocUtil.readFile(invokerLogFile, "UTF-8");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tend to agree with the bot here.

@elharo elharo marked this pull request as ready for review August 20, 2025 11:22
@elharo
Copy link
Contributor Author

elharo commented Aug 20, 2025

looks flaky

@olamy olamy added the bug Something isn't working label Aug 20, 2025
@olamy olamy added this to the 3.11.4 milestone Aug 21, 2025
@olamy olamy merged commit 9252698 into master Aug 21, 2025
184 of 231 checks passed
@olamy olamy deleted the i1241 branch August 21, 2025 01:33
@olamy olamy changed the title Specify UTF-8 Ensure UTF-8 charset is used to avoid IllegalArgumentException: Null charset name Aug 21, 2025
@olamy olamy modified the milestones: 3.11.4, 3.12.0 Aug 27, 2025
github-merge-queue bot pushed a commit to camunda/camunda that referenced this pull request Oct 17, 2025
## Description

Since last upgrade of `maven-javadoc-plugin` charset difinition is
required. Ref: apache/maven-javadoc-plugin#1245

## Checklist

<!--- Please delete options that are not relevant. Boxes should be
checked by reviewer. -->
- [ ] Enable backports when necessary (fex. [for bug
fixes](https://github.com/camunda/camunda/blob/main/CONTRIBUTING.md#backporting-changes)
or [for CI
changes](https://github.com/camunda/camunda/wiki/CI-&-Automation#when-to-backport-ci-changes)).

## Related issues

closes #
github-merge-queue bot pushed a commit to camunda/camunda that referenced this pull request Oct 17, 2025
## Description

Since last upgrade of `maven-javadoc-plugin` charset difinition is
required. Ref: apache/maven-javadoc-plugin#1245

## Checklist

<!--- Please delete options that are not relevant. Boxes should be
checked by reviewer. -->
- [ ] Enable backports when necessary (fex. [for bug
fixes](https://github.com/camunda/camunda/blob/main/CONTRIBUTING.md#backporting-changes)
or [for CI
changes](https://github.com/camunda/camunda/wiki/CI-&-Automation#when-to-backport-ci-changes)).

## Related issues

closes #
github-merge-queue bot pushed a commit to camunda/camunda that referenced this pull request Oct 17, 2025
## Description

Since last upgrade of `maven-javadoc-plugin` charset difinition is
required. Ref: apache/maven-javadoc-plugin#1245

## Checklist

<!--- Please delete options that are not relevant. Boxes should be
checked by reviewer. -->
- [ ] Enable backports when necessary (fex. [for bug
fixes](https://github.com/camunda/camunda/blob/main/CONTRIBUTING.md#backporting-changes)
or [for CI
changes](https://github.com/camunda/camunda/wiki/CI-&-Automation#when-to-backport-ci-changes)).

## Related issues

closes #
liliancavalet added a commit to camunda/camunda that referenced this pull request Oct 17, 2025
## Description

Since last upgrade of `maven-javadoc-plugin` charset difinition is
required. Ref: apache/maven-javadoc-plugin#1245

## Checklist

<!--- Please delete options that are not relevant. Boxes should be
checked by reviewer. -->
- [ ] Enable backports when necessary (fex. [for bug
fixes](https://github.com/camunda/camunda/blob/main/CONTRIBUTING.md#backporting-changes)
or [for CI
changes](https://github.com/camunda/camunda/wiki/CI-&-Automation#when-to-backport-ci-changes)).

## Related issues

closes #
github-merge-queue bot pushed a commit to camunda/camunda that referenced this pull request Oct 17, 2025
## Description

After reading [this issue
](apache/maven-javadoc-plugin#1245) thoroughly I
understood that the actual fix
was provided on javadoc 3.12.0 version

## Checklist

<!--- Please delete options that are not relevant. Boxes should be
checked by reviewer. -->
- [ ] Enable backports when necessary (fex. [for bug
fixes](https://github.com/camunda/camunda/blob/main/CONTRIBUTING.md#backporting-changes)
or [for CI
changes](https://github.com/camunda/camunda/wiki/CI-&-Automation#when-to-backport-ci-changes)).

## Related issues

closes #
liliancavalet added a commit to camunda/camunda that referenced this pull request Oct 17, 2025
## Description

After reading [this issue
](apache/maven-javadoc-plugin#1245) thoroughly I
understood that the actual fix
was provided on javadoc 3.12.0 version

## Checklist

<!--- Please delete options that are not relevant. Boxes should be
checked by reviewer. -->
- [ ] Enable backports when necessary (fex. [for bug
fixes](https://github.com/camunda/camunda/blob/main/CONTRIBUTING.md#backporting-changes)
or [for CI
changes](https://github.com/camunda/camunda/wiki/CI-&-Automation#when-to-backport-ci-changes)).

## Related issues

closes #
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Null charset name

3 participants