Final-review observations from #504 that were deliberately left out of the PR — each is minor, and some are trade-off decisions rather than defects.
1. JRT.isJrtManagedSpecialVariable style consistency
isJrtManagedSpecialVariable is an ||-chain of equals while its sibling applySpecialVariable is a switch; both its call sites are cold, so this is consistency-only.
2. Dynamic (string) regexps are compiled on every call
JRT.matches, matchPosition, and replaceFirst/replaceAll compile dynamic string patterns with Pattern.compile(ere, regexpFlags()) on each invocation. This is pre-existing behavior that #504 merely relocated into the JRT; the IGNORECASE pattern-twin cache intentionally covers only precompiled regexp constants. If profiling ever shows a hot gsub(dynstr, ...) loop, a small string-keyed pattern cache would slot naturally next to JRT.caseAwarePattern.
3. gensub occurrence loop uses StringBuffer
Required while the project targets Java 8: Matcher.appendReplacement(StringBuilder, String) only exists since Java 9. Worth switching if/when maven.compiler.release moves past 8.
4. Redundant subarray re-check in the sort tie-break
GawkExtension.compareNumericThenText excludes Map operands, then its string tie-break calls compareStrings, which re-checks the same two instanceofs on a path where they can no longer be true. Harmless dead check; folding it away would tangle the comparator helpers, so it was left as-is.
Spun out of the final review of #504.
Final-review observations from #504 that were deliberately left out of the PR — each is minor, and some are trade-off decisions rather than defects.
1.
JRT.isJrtManagedSpecialVariablestyle consistencyisJrtManagedSpecialVariableis an||-chain ofequalswhile its siblingapplySpecialVariableis aswitch; both its call sites are cold, so this is consistency-only.2. Dynamic (string) regexps are compiled on every call
JRT.matches,matchPosition, andreplaceFirst/replaceAllcompile dynamic string patterns withPattern.compile(ere, regexpFlags())on each invocation. This is pre-existing behavior that #504 merely relocated into the JRT; the IGNORECASE pattern-twin cache intentionally covers only precompiled regexp constants. If profiling ever shows a hotgsub(dynstr, ...)loop, a small string-keyed pattern cache would slot naturally next toJRT.caseAwarePattern.3.
gensuboccurrence loop usesStringBufferRequired while the project targets Java 8:
Matcher.appendReplacement(StringBuilder, String)only exists since Java 9. Worth switching if/whenmaven.compiler.releasemoves past 8.4. Redundant subarray re-check in the sort tie-break
GawkExtension.compareNumericThenTextexcludesMapoperands, then its string tie-break callscompareStrings, which re-checks the same twoinstanceofs on a path where they can no longer be true. Harmless dead check; folding it away would tangle the comparator helpers, so it was left as-is.Spun out of the final review of #504.