Skip to content

Commit

Permalink
翻转equals调用,防止空对象调用
Browse files Browse the repository at this point in the history
Signed-off-by: hecy7 <hecy7@asiainfo.com>
  • Loading branch information
MiKKiYang committed Dec 11, 2023
1 parent a8f4900 commit 169a0bf
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ public static float javaVersion() {
}

public static boolean isJava6() {
return JAVA_VERSION_STR.equals("1.6");
return "1.6".equals(JAVA_VERSION_STR);
}

public static boolean isJava7() {
return JAVA_VERSION_STR.equals("1.7");
return "1.7".equals(JAVA_VERSION_STR);
}

public static boolean isJava8() {
return JAVA_VERSION_STR.equals("1.8");
return "1.8".equals(JAVA_VERSION_STR);
}

public static boolean isJava9() {
return JAVA_VERSION_STR.equals("9");
return "9".equals(JAVA_VERSION_STR);
}

public static boolean isLessThanJava9() {
Expand Down

0 comments on commit 169a0bf

Please sign in to comment.