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

Fix a compile-time ambiguity when compiling with JDK7.

Patch by lukas.eder@gmail.com
上级 73a36a68
...@@ -46,6 +46,7 @@ Change Log ...@@ -46,6 +46,7 @@ Change Log
</ul><li>Support ALTER TABLE ADD ... AFTER. Patch from Andrew Gaul (argaul at gmail.com). Fixes issue 401. </ul><li>Support ALTER TABLE ADD ... AFTER. Patch from Andrew Gaul (argaul at gmail.com). Fixes issue 401.
</ul><li>Improved OSGi support. H2 now registers itself as a DataSourceFactory service. Fixes issue 365. </ul><li>Improved OSGi support. H2 now registers itself as a DataSourceFactory service. Fixes issue 365.
</ul><li>Add a DISK_SPACE_USED system function. Fixes issue 270. </ul><li>Add a DISK_SPACE_USED system function. Fixes issue 270.
</ul><li>Fix a compile-time ambiguity when compiling with JDK7.
</li></ul> </li></ul>
<h2>Version 1.3.170 (2012-11-30)</h2> <h2>Version 1.3.170 (2012-11-30)</h2>
......
...@@ -295,7 +295,8 @@ class FileMem extends FileBase { ...@@ -295,7 +295,8 @@ class FileMem extends FileBase {
return null; return null;
} }
} }
FileLock lock = new FileLock(null, position, size, shared) { // Cast null to FileChannel to avoid JDK 1.7 ambiguity
FileLock lock = new FileLock((FileChannel) null, position, size, shared) {
@Override @Override
public boolean isValid() { public boolean isValid() {
......
...@@ -317,7 +317,8 @@ class FileZip extends FileBase { ...@@ -317,7 +317,8 @@ class FileZip extends FileBase {
public synchronized FileLock tryLock(long position, long size, boolean shared) throws IOException { public synchronized FileLock tryLock(long position, long size, boolean shared) throws IOException {
if (shared) { if (shared) {
return new FileLock(null, position, size, shared) { // Cast null to FileChannel to avoid JDK 1.7 ambiguity
return new FileLock((FileChannel) null, position, size, shared) {
@Override @Override
public boolean isValid() { public boolean isValid() {
......
...@@ -398,7 +398,8 @@ class FileZip2 extends FileBase { ...@@ -398,7 +398,8 @@ class FileZip2 extends FileBase {
public synchronized FileLock tryLock(long position, long size, boolean shared) throws IOException { public synchronized FileLock tryLock(long position, long size, boolean shared) throws IOException {
if (shared) { if (shared) {
return new FileLock(null, position, size, shared) { // Cast null to FileChannel to avoid JDK 1.7 ambiguity
return new FileLock((FileChannel) null, position, size, shared) {
@Override @Override
public boolean isValid() { public boolean isValid() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论