Skip to content

Commit c40b48c

Browse files
authored
Merge pull request #225 from gdjs2/master
Format the code & Replace the Long(String) by Long.valueOf(String)
2 parents 6bd265e + 39f21f6 commit c40b48c

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

APIJSONORM/src/main/java/apijson/JSONResponse.java

+7-11
Original file line numberDiff line numberDiff line change
@@ -505,16 +505,12 @@ public static String formatColon(@NotNull String key) {
505505
public static String formatHyphen(@NotNull String key, boolean firstCase) {
506506
String name = "";
507507

508-
StringTokenizer parts = new StringTokenizer(key, "-");
509-
name += parts.nextToken();
510-
while(parts.hasMoreTokens())
511-
{
512-
String part = parts.nextToken();
513-
name += firstCase ? StringUtil.firstCase(part, true) : part;
514-
}
515-
516-
return name;
508+
StringTokenizer parts = new StringTokenizer(key, "-");
509+
name += parts.nextToken();
510+
while(parts.hasMoreTokens()) {
511+
String part = parts.nextToken();
512+
name += firstCase ? StringUtil.firstCase(part, true) : part;
513+
}
514+
return name;
517515
}
518-
519-
520516
}

APIJSONORM/src/main/java/apijson/orm/AbstractVerifier.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ public boolean verifyAccess(SQLConfig config) throws Exception {
277277
if (id instanceof Number == false) {//不能准确地判断Long,可能是Integer
278278
throw new UnsupportedDataTypeException(table + ".id类型错误,id类型必须是Long!");
279279
}
280-
if (list.contains(new Long("" + id)) == false) {//Integer等转为Long才能正确判断。强转崩溃
280+
if (list.contains(Long.valueOf("" + id)) == false) {//Integer等转为Long才能正确判断。强转崩溃
281281
throw new IllegalAccessException(visitorIdkey + " = " + id + " 的 " + table
282282
+ " 不允许 " + role.name() + " 用户的 " + method.name() + " 请求!");
283283
}

0 commit comments

Comments
 (0)