static LS tok_makeArgumentsToAllFunctionsFinal(LS tok) { bool change = false; for (LS tokF : findFullFunctionDefs(tok, true)) { IntRange r = tok_findArgs(tokF); if (r == null) continue; //print("Args: " + subList(tokF, r)); Map bracketMap = getBracketMapIncludingAngleBrackets(tokF); int i = r.start+1; while (i < r.end-2) { if (neqGet(tokF, i, "final")) { tokPrepend(tokF, i, "final "); set change; } while (i < r.end && neqGet(tokF, i, ",")) i = or(bracketMap.get(i), i)+2; i += 2; } } if (change) reTok(tok); ret tok; } sS tok_makeArgumentsToAllFunctionsFinal(S s) { ret join(tok_makeArgumentsToAllFunctionsFinal(javaTok(s))); }