zoltanmeze commented on PR #518:
URL: https://github.com/apache/maven-surefire/pull/518#issuecomment-1095528603

   I believe it it a different issue, not throwing any 
`BufferOverflowException`.
   
   `CharsetDecoder#decode` in [decodeString call 
(here)](https://github.com/apache/maven-surefire/blob/master/surefire-api/src/main/java/org/apache/maven/surefire/api/stream/AbstractStreamDecoder.java#L322)
 results in overflow when there is not enough space left in the output char 
buffer. And output buffer is not cleared because the `!output.hasRemaining()` 
condition. Clearing after each chunk ensures underflow in `decodeString`, so it 
has always enough space to write decoded string into the the output buffer.
   
   You can verify this with the two included unit tests. Test method naming is 
probably not the best, in the first it doesn't needs to be a new line character 
after a 2-bytes encoded character, it can be anything else.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to