lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dna...@apache.org
Subject svn commit: r185088 - /lucene/java/trunk/src/java/org/apache/lucene/index/IndexModifier.java
Date Mon, 06 Jun 2005 22:57:18 GMT
Author: dnaber
Date: Mon Jun  6 15:57:18 2005
New Revision: 185088

URL: http://svn.apache.org/viewcvs?rev=185088&view=rev
Log:
simplify set... methods

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/index/IndexModifier.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/IndexModifier.java
URL: http://svn.apache.org/viewcvs/lucene/java/trunk/src/java/org/apache/lucene/index/IndexModifier.java?rev=185088&r1=185087&r2=185088&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/IndexModifier.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/IndexModifier.java Mon Jun  6 15:57:18
2005
@@ -311,11 +311,12 @@
    * @see IndexWriter#setInfoStream(PrintStream)
    * @throws IllegalStateException if the index is closed
    */
-  public void setInfoStream(PrintStream infoStream) throws IOException {
+  public void setInfoStream(PrintStream infoStream) {
     synchronized(directory) {
       assureOpen();
-      createIndexWriter();
-      indexWriter.setInfoStream(infoStream);
+      if (indexWriter != null) {
+        indexWriter.setInfoStream(infoStream);
+      }
       this.infoStream = infoStream;
     }
   }
@@ -339,11 +340,12 @@
    * @see IndexWriter#setUseCompoundFile(boolean)
    * @throws IllegalStateException if the index is closed
    */
-  public void setUseCompoundFile(boolean useCompoundFile) throws IOException {
+  public void setUseCompoundFile(boolean useCompoundFile) {
     synchronized(directory) {
       assureOpen();
-      createIndexWriter();
-      indexWriter.setUseCompoundFile(useCompoundFile);
+      if (indexWriter != null) {
+        indexWriter.setUseCompoundFile(useCompoundFile);
+      }
       this.useCompoundFile = useCompoundFile;
     }
   }
@@ -374,11 +376,12 @@
    * @see IndexWriter#setMaxFieldLength(int)
    * @throws IllegalStateException if the index is closed
    */
-  public void setMaxFieldLength(int maxFieldLength) throws IOException {
+  public void setMaxFieldLength(int maxFieldLength) {
     synchronized(directory) {
       assureOpen();
-      createIndexWriter();
-      indexWriter.setMaxFieldLength(maxFieldLength);
+      if (indexWriter != null) {
+        indexWriter.setMaxFieldLength(maxFieldLength);
+      }
       this.maxFieldLength = maxFieldLength;
     }
   }
@@ -409,11 +412,12 @@
    * @see IndexWriter#setMaxBufferedDocs(int)
    * @throws IllegalStateException if the index is closed
    */
-  public void setMaxBufferedDocs(int maxBufferedDocs) throws IOException {
+  public void setMaxBufferedDocs(int maxBufferedDocs) {
     synchronized(directory) {
       assureOpen();
-      createIndexWriter();
-      indexWriter.setMaxBufferedDocs(maxBufferedDocs);
+      if (indexWriter != null) {
+        indexWriter.setMaxBufferedDocs(maxBufferedDocs);
+      }
       this.maxBufferedDocs = maxBufferedDocs;
     }
   }
@@ -443,11 +447,12 @@
    * @see IndexWriter#setMergeFactor(int)
    * @throws IllegalStateException if the index is closed
    */
-  public void setMergeFactor(int mergeFactor) throws IOException {
+  public void setMergeFactor(int mergeFactor) {
     synchronized(directory) {
       assureOpen();
-      createIndexWriter();
-      indexWriter.setMergeFactor(mergeFactor);
+      if (indexWriter != null) {
+        indexWriter.setMergeFactor(mergeFactor);
+      }
       this.mergeFactor = mergeFactor;
     }
   }



Mime
View raw message