提交 a9394536 authored 作者: Prashant Bhat's avatar Prashant Bhat

Make use of Objects.hashCode() present in Java7 and remove Utils.hashCode()

上级 642e6686
...@@ -8,10 +8,10 @@ package org.h2.table; ...@@ -8,10 +8,10 @@ package org.h2.table;
import java.sql.Connection; import java.sql.Connection;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Objects;
import org.h2.message.DbException; import org.h2.message.DbException;
import org.h2.util.JdbcUtils; import org.h2.util.JdbcUtils;
import org.h2.util.StringUtils; import org.h2.util.StringUtils;
import org.h2.util.Utils;
/** /**
* A connection for a linked table. The same connection may be used for multiple * A connection for a linked table. The same connection may be used for multiple
...@@ -95,10 +95,10 @@ public class TableLinkConnection { ...@@ -95,10 +95,10 @@ public class TableLinkConnection {
@Override @Override
public int hashCode() { public int hashCode() {
return Utils.hashCode(driver) return Objects.hashCode(driver)
^ Utils.hashCode(url) ^ Objects.hashCode(url)
^ Utils.hashCode(user) ^ Objects.hashCode(user)
^ Utils.hashCode(password); ^ Objects.hashCode(password);
} }
@Override @Override
......
...@@ -270,16 +270,6 @@ public class Utils { ...@@ -270,16 +270,6 @@ public class Utils {
return copy; return copy;
} }
/**
* Calculate the hash code of the given object. The object may be null.
*
* @param o the object
* @return the hash code, or 0 if the object is null
*/
public static int hashCode(Object o) {
return o == null ? 0 : o.hashCode();
}
/** /**
* Get the used memory in KB. * Get the used memory in KB.
* This method possibly calls System.gc(). * This method possibly calls System.gc().
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论