提交 a566e6a0 authored 作者: Thomas Mueller's avatar Thomas Mueller

Spaces instead of tabs

上级 e5e5a68e
......@@ -422,10 +422,10 @@ class FileDisk extends FileBase {
@Override
public FileChannel truncate(long newLength) throws IOException {
// compatibility with JDK FileChannel#truncate
if (readOnly) {
throw new NonWritableChannelException();
}
// compatibility with JDK FileChannel#truncate
if (readOnly) {
throw new NonWritableChannelException();
}
if (newLength < file.length()) {
file.setLength(newLength);
}
......
......@@ -265,10 +265,10 @@ class FileMem extends FileBase {
@Override
public FileChannel truncate(long newLength) throws IOException {
// compatibility with JDK FileChannel#truncate
if (readOnly) {
throw new NonWritableChannelException();
}
// compatibility with JDK FileChannel#truncate
if (readOnly) {
throw new NonWritableChannelException();
}
if (newLength < size()) {
data.touch(readOnly);
pos = Math.min(pos, newLength);
......
......@@ -204,10 +204,10 @@ class FileNioMapped extends FileBase {
@Override
public synchronized FileChannel truncate(long newLength) throws IOException {
// compatibility with JDK FileChannel#truncate
if (mode == MapMode.READ_ONLY) {
throw new NonWritableChannelException();
}
// compatibility with JDK FileChannel#truncate
if (mode == MapMode.READ_ONLY) {
throw new NonWritableChannelException();
}
if (newLength < size()) {
setFileLength(newLength);
}
......
......@@ -257,10 +257,10 @@ class FileNioMem extends FileBase {
@Override
public FileChannel truncate(long newLength) throws IOException {
// compatibility with JDK FileChannel#truncate
if (readOnly) {
throw new NonWritableChannelException();
}
// compatibility with JDK FileChannel#truncate
if (readOnly) {
throw new NonWritableChannelException();
}
if (newLength < size()) {
data.touch(readOnly);
pos = Math.min(pos, newLength);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论