Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

LUCENE-758: fix javadocs to clarify that RAMDirectory(Directory) makes a full copy of the original Directory

Michael McCandless411575b600a2
diff --git a/CHANGES.txt b/CHANGES.txt
index 2733f2c2811..6061ed92f78 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -382,6 +382,9 @@ Documentation
9. Added some text about what is contained in releases. (Eric Haszlakiewicz via Grant Ingersoll)
+ 10. LUCENE-758: Fix javadoc to clarify that RAMDirectory(Directory)
+ makes a full copy of the starting Directory. (Mike McCandless)
+
Build
1. Added in clover test code coverage per http://issues.apache.org/jira/browse/LUCENE-721 To enable clover code coverage, you must have clover.jar in the ANT classpath and specify -Drun.clover=true on the command line.(Michael Busch and Grant Ingersoll)
diff --git a/src/java/org/apache/lucene/store/RAMDirectory.java b/src/java/org/apache/lucene/store/RAMDirectory.java
index 357c3ae3380..502ca300566 100644
--- a/src/java/org/apache/lucene/store/RAMDirectory.java
+++ b/src/java/org/apache/lucene/store/RAMDirectory.java
@@ -58,6 +58,12 @@ public class RAMDirectory extends Directory implements Serializable {
* a disk-based index into memory.
* <P>
* This should be used only with indices that can fit into memory.
+ * <P>
+ * Note that the resulting <code>RAMDirectory</code> instance is fully
+ * independent from the original <code>Directory</code> (it is a
+ * complete copy). Any subsequent changes to the
+ * original <code>Directory</code> will not be visible in the
+ * <code>RAMDirectory</code> instance.
*
* @param dir a <code>Directory</code> value
* @exception IOException if an error occurs
@@ -97,6 +103,8 @@ public class RAMDirectory extends Directory implements Serializable {
* Creates a new <code>RAMDirectory</code> instance from the {@link FSDirectory}.
*
* @param dir a <code>File</code> specifying the index directory
+ *
+ * @see #RAMDirectory(Directory)
*/
public RAMDirectory(File dir) throws IOException {
this(FSDirectory.getDirectory(dir, false), true);
@@ -106,6 +114,8 @@ public class RAMDirectory extends Directory implements Serializable {
* Creates a new <code>RAMDirectory</code> instance from the {@link FSDirectory}.
*
* @param dir a <code>String</code> specifying the full index directory path
+ *
+ * @see #RAMDirectory(Directory)
*/
public RAMDirectory(String dir) throws IOException {
this(FSDirectory.getDirectory(dir, false), true);