Unverified 提交 3219fd40 authored 作者: Noel Grandin's avatar Noel Grandin 提交者: GitHub

Merge pull request #691 from prashantbhat/PR-01

Make use of Objects.hashCode() present in Java7 and remove Utils.hash…
......@@ -8,10 +8,10 @@ package org.h2.table;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Objects;
import org.h2.message.DbException;
import org.h2.util.JdbcUtils;
import org.h2.util.StringUtils;
import org.h2.util.Utils;
/**
* A connection for a linked table. The same connection may be used for multiple
......@@ -95,10 +95,10 @@ public class TableLinkConnection {
@Override
public int hashCode() {
return Utils.hashCode(driver)
^ Utils.hashCode(url)
^ Utils.hashCode(user)
^ Utils.hashCode(password);
return Objects.hashCode(driver)
^ Objects.hashCode(url)
^ Objects.hashCode(user)
^ Objects.hashCode(password);
}
@Override
......
......@@ -270,16 +270,6 @@ public class Utils {
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.
* This method possibly calls System.gc().
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论