fix npe in server auth functionality

This commit is contained in:
Grahame Grieve 2024-10-18 20:50:26 +08:00
parent 6996fdf31a
commit cb0759cc00
2 changed files with 22 additions and 0 deletions

View File

@ -722,6 +722,27 @@ public class Utilities {
return s.toString();
}
public static String javaTokenize(String cs, boolean capFirst) {
if (cs == null)
return "";
StringBuilder s = new StringBuilder();
boolean upcase = capFirst;
for (int i = 0; i < cs.length(); i++) {
char c = cs.charAt(i);
if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '_') {
if (upcase) {
s.append(Character.toUpperCase(c));
upcase = false;
} else {
s.append(c);
}
} else {
upcase = true;
}
}
return s.toString();
}
public static boolean isToken(String tail) {
if (tail == null || tail.length() == 0)

View File

@ -135,6 +135,7 @@ public class ValidatorCli {
new TxTestsTask(),
new TransformTask(),
new VersionTask(),
new CodeGenTask(),
defaultCliTask);
}