File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/java.desktop/macosx/classes/sun/lwawt/macosx Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2011, 2016 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2011, 2021 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -288,7 +288,9 @@ public String call() throws Exception {
288
288
final AccessibleEditableText aet = ac .getAccessibleEditableText ();
289
289
if (aet == null ) return null ;
290
290
291
- return aet .getTextRange (location , location + length );
291
+ int currentLength = aet .getCharCount ();
292
+ return aet .getTextRange (Math .min (currentLength , location ),
293
+ Math .min (currentLength , location + length ));
292
294
}
293
295
}, c );
294
296
}
You can’t perform that action at this time.
0 commit comments