On Wed, 5 Feb 2025 20:33:09 GMT, Andy Goryachev <ango...@openjdk.org> wrote:

>> modules/javafx.graphics/src/main/java/com/sun/javafx/text/PrismCaretInfo.java
>>  line 48:
>> 
>>> 46:     @Override
>>> 47:     public Rectangle2D getSegmentAt(int index) {
>>> 48:         return parts[index];
>> 
>> do we need a bound check here?
>
> no special handling is needed here I think: an exception will be thrown

While true, I think we should throw `IndexOutOfBoundsException` rather than 
`ArrayIndexOutOfBoundsException` (use `Objects.checkIndex()` for that). This 
should also be specified with a `@throws` javadoc tag in `CaretInfo`.

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1596#discussion_r1986027817

Reply via email to