Fixes StringIndexOutOfBoundsException when cutting text (#5776)
Fixes StringIndexOutOfBoundsException when cutting text (#5776)

* Fixes StringIndexOutOfBoundsException when cutting text

* Incldue workaround as proposed at https://bugs.openjdk.java.net/browse/JDK-8176270

* Try to get right text

* Access input value the right way

* Fix checkstyle

Co-authored-by: Oliver Kopp <6e3b2ea5538f1752a10d3f04fddcdb11429e4200@gmail.com>

Siedlerchr/jabref,sauliusg/jabref,JabRef/jabref,sauliusg/jabref,Siedlerchr/jabref,JabRef/jabref,sauliusg/jabref,JabRef/jabref,Siedlerchr/jabref,sauliusg/jabref,JabRef/jabref,Siedlerchr/jabref