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