Skip to content

Commit

Permalink
LUCENE-5341: fix RAMDirectory to override getLockID()
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1564412 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Shai Erera committed Feb 4, 2014
1 parent 04e6678 commit 1878801
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lucene/core/src/java/org/apache/lucene/store/Directory.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -201,4 +206,5 @@ public void close() {
isOpen = false;
fileMap.clear();
}

}

0 comments on commit 1878801

Please sign in to comment.