Skip to content

Conversation

@rober710
Copy link

@rober710 rober710 commented Dec 22, 2025

Color output in maven stopped working some time ago in Fedora. I don't remember if the issue started happening in Fedora 41 or Fedora 43, though.

Debugging the issue, it seems that (at least with JDK 21), reading n bytes from an input stream, where n is lower than the buffer length, doesn't clear the remaining buffer with zeroes, leaving those bytes as were retrieved from a previous read. This causes the comparison in JansiLoader.contentsEquals to fail, as it's comparing the full buffer length, instead of taking into account the number of bytes read in each iteration.

I'm seing the JDK target in the pom as 8, but in the github actions, I see the JDK is 9 and 11. May I update the target in the pom to JDK 9 as well? That allows me to use the equals method that supports comparing ranges. Otherwise, I'll have to manually clear the buffer with zeroes before reading, so that the comparison works.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant