提交 80cb1fa8 authored 作者: Thomas Mueller's avatar Thomas Mueller

Formatting

上级 31b01cb2
...@@ -18,7 +18,7 @@ import java.nio.channels.FileLock; ...@@ -18,7 +18,7 @@ import java.nio.channels.FileLock;
* It is mainly useful for applications that call Thread.interrupt by mistake. * It is mainly useful for applications that call Thread.interrupt by mistake.
*/ */
public class FilePathRetryOnInterrupt extends FilePathWrapper { public class FilePathRetryOnInterrupt extends FilePathWrapper {
/** /**
* The prefix. * The prefix.
*/ */
...@@ -37,7 +37,8 @@ public class FilePathRetryOnInterrupt extends FilePathWrapper { ...@@ -37,7 +37,8 @@ public class FilePathRetryOnInterrupt extends FilePathWrapper {
} }
/** /**
* A file object that re-opens and re-tries the operation if the file was closed. * A file object that re-opens and re-tries the operation if the file was
* closed.
*/ */
class FileRetryOnInterrupt extends FileBase { class FileRetryOnInterrupt extends FileBase {
...@@ -51,11 +52,11 @@ class FileRetryOnInterrupt extends FileBase { ...@@ -51,11 +52,11 @@ class FileRetryOnInterrupt extends FileBase {
this.mode = mode; this.mode = mode;
open(); open();
} }
private void open() throws IOException { private void open() throws IOException {
channel = FileUtils.open(fileName, mode); channel = FileUtils.open(fileName, mode);
} }
private void reopen(int i, IOException e) throws IOException { private void reopen(int i, IOException e) throws IOException {
if (i > 20) { if (i > 20) {
throw e; throw e;
...@@ -68,7 +69,7 @@ class FileRetryOnInterrupt extends FileBase { ...@@ -68,7 +69,7 @@ class FileRetryOnInterrupt extends FileBase {
Thread.interrupted(); Thread.interrupted();
FileChannel before = channel; FileChannel before = channel;
// ensure we don't re-open concurrently; // ensure we don't re-open concurrently;
// sometimes we don't re-open, which is fine, // sometimes we don't re-open, which is fine,
// as this method is called in a loop // as this method is called in a loop
synchronized (this) { synchronized (this) {
if (before == channel) { if (before == channel) {
...@@ -77,7 +78,7 @@ class FileRetryOnInterrupt extends FileBase { ...@@ -77,7 +78,7 @@ class FileRetryOnInterrupt extends FileBase {
} }
} }
} }
private void reLock() throws IOException { private void reLock() throws IOException {
if (lock == null) { if (lock == null) {
return; return;
...@@ -93,7 +94,7 @@ class FileRetryOnInterrupt extends FileBase { ...@@ -93,7 +94,7 @@ class FileRetryOnInterrupt extends FileBase {
} }
lock.base = l2; lock.base = l2;
} }
@Override @Override
public void implCloseChannel() throws IOException { public void implCloseChannel() throws IOException {
try { try {
...@@ -218,12 +219,12 @@ class FileRetryOnInterrupt extends FileBase { ...@@ -218,12 +219,12 @@ class FileRetryOnInterrupt extends FileBase {
lock = new FileLockRetry(l, this); lock = new FileLockRetry(l, this);
return lock; return lock;
} }
/** /**
* A wrapped file lock. * A wrapped file lock.
*/ */
static class FileLockRetry extends FileLock { static class FileLockRetry extends FileLock {
/** /**
* The base lock. * The base lock.
*/ */
...@@ -243,7 +244,7 @@ class FileRetryOnInterrupt extends FileBase { ...@@ -243,7 +244,7 @@ class FileRetryOnInterrupt extends FileBase {
public void release() throws IOException { public void release() throws IOException {
base.release(); base.release();
} }
} }
@Override @Override
......
...@@ -223,8 +223,8 @@ public class Recover extends Tool implements DataHandler { ...@@ -223,8 +223,8 @@ public class Recover extends Tool implements DataHandler {
private static void verifyPageStore(DataHandler h) { private static void verifyPageStore(DataHandler h) {
if (h.getLobStorage() instanceof LobStorageMap) { if (h.getLobStorage() instanceof LobStorageMap) {
throw DbException.get(ErrorCode.FEATURE_NOT_SUPPORTED_1, throw DbException.get(ErrorCode.FEATURE_NOT_SUPPORTED_1,
"Restore page store recovery SQL script " + "Restore page store recovery SQL script " +
"can only be restored to a PageStore file"); "can only be restored to a PageStore file");
} }
} }
......
...@@ -71,7 +71,7 @@ public class DateTimeUtils { ...@@ -71,7 +71,7 @@ public class DateTimeUtils {
public static void resetCalendar() { public static void resetCalendar() {
CACHED_CALENDAR.remove(); CACHED_CALENDAR.remove();
} }
private static Calendar getCalendar() { private static Calendar getCalendar() {
Calendar c = CACHED_CALENDAR.get(); Calendar c = CACHED_CALENDAR.get();
if (c == null) { if (c == null) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论