mirror of https://github.com/apache/lucene.git
Improve exception message so you see expected/actual if lock file is messed with
This commit is contained in:
parent
ad152d23d5
commit
6c0e940b9b
|
@ -176,7 +176,7 @@ public final class NativeFSLockFactory extends FSLockFactory {
|
|||
// if it differs, someone deleted our lock file (and we are ineffective)
|
||||
FileTime ctime = Files.readAttributes(path, BasicFileAttributes.class).creationTime();
|
||||
if (!creationTime.equals(ctime)) {
|
||||
throw new AlreadyClosedException("Underlying file changed by an external force at " + creationTime + ", (lock=" + this + ")");
|
||||
throw new AlreadyClosedException("Underlying file changed by an external force at " + ctime + ", (lock=" + this + ")");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -199,7 +199,7 @@ public final class NativeFSLockFactory extends FSLockFactory {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "NativeFSLock(path=" + path + ",impl=" + lock + ",ctime=" + creationTime + ")";
|
||||
return "NativeFSLock(path=" + path + ",impl=" + lock + ",creationTime=" + creationTime + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ public final class SimpleFSLockFactory extends FSLockFactory {
|
|||
// if it differs, someone deleted our lock file (and we are ineffective)
|
||||
FileTime ctime = Files.readAttributes(path, BasicFileAttributes.class).creationTime();
|
||||
if (!creationTime.equals(ctime)) {
|
||||
throw new AlreadyClosedException("Underlying file changed by an external force at " + creationTime + ", (lock=" + this + ")");
|
||||
throw new AlreadyClosedException("Underlying file changed by an external force at " + ctime + ", (lock=" + this + ")");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -144,7 +144,7 @@ public final class SimpleFSLockFactory extends FSLockFactory {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SimpleFSLock(path=" + path + ",ctime=" + creationTime + ")";
|
||||
return "SimpleFSLock(path=" + path + ",creationTime=" + creationTime + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue