diff --git a/lucene/core/src/java/org/apache/lucene/store/Directory.java b/lucene/core/src/java/org/apache/lucene/store/Directory.java index 0efc3f939779..9bf531a97492 100644 --- a/lucene/core/src/java/org/apache/lucene/store/Directory.java +++ b/lucene/core/src/java/org/apache/lucene/store/Directory.java @@ -152,12 +152,12 @@ public abstract void close() * "scopes" to the right index. */ public String getLockID() { - return this.toString(); + return this.toString(); } @Override public String toString() { - return super.toString() + " lockFactory=" + getLockFactory(); + return getClass().getSimpleName() + '@' + Integer.toHexString(hashCode()) + " lockFactory=" + getLockFactory(); } /** diff --git a/lucene/core/src/java/org/apache/lucene/store/RAMDirectory.java b/lucene/core/src/java/org/apache/lucene/store/RAMDirectory.java index 1730378430b8..9ae0d3639df2 100644 --- a/lucene/core/src/java/org/apache/lucene/store/RAMDirectory.java +++ b/lucene/core/src/java/org/apache/lucene/store/RAMDirectory.java @@ -102,6 +102,11 @@ private RAMDirectory(Directory dir, boolean closeDir, IOContext context) throws } } + @Override + public String getLockID() { + return "lucene-" + Integer.toHexString(hashCode()); + } + @Override public final String[] listAll() { ensureOpen(); @@ -201,4 +206,5 @@ public void close() { isOpen = false; fileMap.clear(); } + }