提交 f430a1e4 authored 作者: noelgrandin's avatar noelgrandin

no need to check for null because calling instanceof, because "null instanceof <class> ==> false"

上级 08efb070
...@@ -307,7 +307,7 @@ public class DbException extends RuntimeException { ...@@ -307,7 +307,7 @@ public class DbException extends RuntimeException {
public static DbException convertIOException(IOException e, String message) { public static DbException convertIOException(IOException e, String message) {
if (message == null) { if (message == null) {
Throwable t = e.getCause(); Throwable t = e.getCause();
if (t != null && t instanceof DbException) { if (t instanceof DbException) {
return (DbException) t; return (DbException) t;
} }
return get(ErrorCode.IO_EXCEPTION_1, e, e.toString()); return get(ErrorCode.IO_EXCEPTION_1, e, e.toString());
......
...@@ -52,7 +52,7 @@ public class DbUpgrade { ...@@ -52,7 +52,7 @@ public class DbUpgrade {
i2.putAll(info); i2.putAll(info);
// clone so that the password (if set as a char array) is not cleared // clone so that the password (if set as a char array) is not cleared
Object o = info.get("password"); Object o = info.get("password");
if (o != null && o instanceof char[]) { if (o instanceof char[]) {
i2.put("password", StringUtils.cloneCharArray((char[]) o)); i2.put("password", StringUtils.cloneCharArray((char[]) o));
} }
info = i2; info = i2;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论