Merge pull request #225 from gdjs2/master

Format the code & Replace the Long(String) by Long.valueOf(String)
This commit is contained in:
TommyLemon 2021-04-25 20:09:16 +08:00 committed by GitHub
commit c40b48c78b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 12 deletions

View File

@ -507,14 +507,10 @@ public class JSONResponse extends apijson.JSONObject {
StringTokenizer parts = new StringTokenizer(key, "-");
name += parts.nextToken();
while(parts.hasMoreTokens())
{
while(parts.hasMoreTokens()) {
String part = parts.nextToken();
name += firstCase ? StringUtil.firstCase(part, true) : part;
}
return name;
}
}

View File

@ -277,7 +277,7 @@ public abstract class AbstractVerifier<T> implements Verifier<T>, IdCallback {
if (id instanceof Number == false) {//不能准确地判断Long可能是Integer
throw new UnsupportedDataTypeException(table + ".id类型错误id类型必须是Long");
}
if (list.contains(new Long("" + id)) == false) {//Integer等转为Long才能正确判断强转崩溃
if (list.contains(Long.valueOf("" + id)) == false) {//Integer等转为Long才能正确判断强转崩溃
throw new IllegalAccessException(visitorIdkey + " = " + id + "" + table
+ " 不允许 " + role.name() + " 用户的 " + method.name() + " 请求!");
}