Fixes a bug showing up after [JDK-8132995](https://bugs.openjdk.org/browse/JDK-8132995) when there are capturing groups outside the match.
------------- Commit messages: - 8312976: MatchResult produces StringIndexOutOfBoundsException for groups outside match Changes: https://git.openjdk.org/jdk/pull/15053/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15053&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8312976 Stats: 75 lines in 2 files changed: 67 ins; 0 del; 8 mod Patch: https://git.openjdk.org/jdk/pull/15053.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15053/head:pull/15053 PR: https://git.openjdk.org/jdk/pull/15053