mikemccand commented on PR #15900: URL: https://github.com/apache/lucene/pull/15900#issuecomment-4178478655
> This code catches the `IndexOutOfBoundsException` as this is cheaper than validating the arguments first (it may happen that the term only consists of surrogates and its utf16 length is larger than the maximum length. +1 But can we shrink wrap the `try`/`except` (move `termAttribute.setLength(truncateAtChar);` out)? It doesn't throw `IOOBE` right? -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
