Matcher: Reduce diff vs. upstream OpenJDK 8u121-b13 (refactor part 2).
This is step 2 of verifying Matcher.java vs. upstream; step 1 was commit
d7f52f97f9b28135b5c83e9fbbfce44e52967b06 in http://r.android.com/694182
In this CL:
1. Rename the following fields to correspond to what their equivalents
are called upstream:
input -> text
matchOffsets -> groups
regionStart -> from
regionEnd -> to
Note that regionStart and regionEnd are better names because the
getters are called regionStart() and regionEnd(), but this CL reverts
to upstream's naming.
I would have liked to also rename appendPos -> lastAppendPos, but
that field is in the light greylist (accessed by apps through
reflection), so I'm not touching it for now.
2. Turn getMatchedGroupIndex() into an instance method so it can
access parentPattern.address rather than getting that value passed
as an argument.
3. Move the call to ensureMatch() into getMatchedGroupIndex(), rather
than calling it just before each place where that method is called.
This CL does not change behavor.
Bug: 80416774
Test: Treehugger
Test: At a later CL, run CtsLibcoreTestCases
Change-Id: I101e428a69c7a5adc46e9fd8477953be6c67ee66
1 file changed