Warning: session_start(): open(/var/lib/php/sessions/sess_2ded2jlt0dnjlp36re25t5s40r, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
static S migrateClassesInStructureText(S s, O... migrations) {
L tok = javaTokForStructure(s);
int n = l(tok);
for (int i = 0; i < l(migrations); i += 2) {
S from = cast migrations[i];
S fromPlusDollar = from + "$";
O to = migrations[i+1];
S replacement = to instanceof S ? (S) to : dropPrefix("main$", className((Class) to);
int changes = 0;
for (int j = 1; j < n; j += 2) {
S t = tok.get(j);
if (eq(t, from)) {
tok.set(j, replacement);
++changes;
} else if (startsWith(t, fromPlusDollar)) {
tok.set(j, replacement + t.substring(l(from)));
++changes;
}
}
if (changes > 0)
print("migrateClassesInStructureText: Replaced " + n2(changes, "occurrence") + " of " + from + " with " + to);
}
ret join(tok);
}
sS migrateClassesInStructureText(S s, MapSO migrations) {
ret migrateClassesInStructureText(s, mapToParams(migrations));
}