Alwaysgaurav1 commented on PR #1813:
URL: https://github.com/apache/commons-lang/pull/1813#issuecomment-6185919235

   
   
   @garydgregory I have reviewed and addressed Copilot's latest comments:
   
   1. **Unicode escapes in tests (c194111f6):** Refactored 
`testLeftPadSurrogatePair` and `testRightPadSurrogatePair` to use Unicode 
escape sequences (`\uD83D\uDE00` and `\uD83C\uDF89`) to align with your 
refactoring in `testCenterSurrogatePair`.
   2. **`pads % padLen == 0` check (false positive):** `splitsSurrogatePair` 
guards with `index > 0 && index < str.length()`, so passing `0` safely 
short-circuits to `false` without out-of-bounds access.
   3. **`center` shortfall range (false positive):** Because `center` passes 
`size` directly to `rightPad(str, size, padStr)`, any 1-character shortfall 
from `leftPad` is added to `rightPad`'s target pad count. Even if `rightPad` 
also splits a surrogate pair, it only drops the extra char it just gained. The 
returned length is therefore guaranteed to be either `size` or `size - 1` 
(never `size - 2`).
   
   Local build, tests, and Checkstyle are all passing. Ready for CI workflow 
approval and review!


-- 
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