Skip to content

Commit

Permalink
Merge pull request #225 from gdjs2/master
Browse files Browse the repository at this point in the history
Format the code & Replace the Long(String) by Long.valueOf(String)
  • Loading branch information
TommyLemon authored Apr 25, 2021
2 parents 6bd265e + 39f21f6 commit c40b48c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
18 changes: 7 additions & 11 deletions APIJSONORM/src/main/java/apijson/JSONResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -505,16 +505,12 @@ public static String formatColon(@NotNull String key) {
public static String formatHyphen(@NotNull String key, boolean firstCase) {
String name = "";

StringTokenizer parts = new StringTokenizer(key, "-");
name += parts.nextToken();
while(parts.hasMoreTokens())
{
String part = parts.nextToken();
name += firstCase ? StringUtil.firstCase(part, true) : part;
}

return name;
StringTokenizer parts = new StringTokenizer(key, "-");
name += parts.nextToken();
while(parts.hasMoreTokens()) {
String part = parts.nextToken();
name += firstCase ? StringUtil.firstCase(part, true) : part;
}
return name;
}


}
2 changes: 1 addition & 1 deletion APIJSONORM/src/main/java/apijson/orm/AbstractVerifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public boolean verifyAccess(SQLConfig config) throws Exception {
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() + " 请求!");
}
Expand Down

0 comments on commit c40b48c

Please sign in to comment.