lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dna...@apache.org
Subject svn commit: r231078 - /lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java
Date Tue, 09 Aug 2005 18:41:52 GMT
Author: dnaber
Date: Tue Aug  9 11:41:47 2005
New Revision: 231078

URL: http://svn.apache.org/viewcvs?rev=231078&view=rev
Log:
catch security exception so this class can be used from an applet;
tiny improvement to the exception output (no toString())

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

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java
URL: http://svn.apache.org/viewcvs/lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java?rev=231078&r1=231077&r2=231078&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java Tue Aug  9 11:41:47
2005
@@ -32,8 +32,6 @@
 import org.apache.lucene.util.BitVector;
 
 /**
- * FIXME: Describe class <code>SegmentReader</code> here.
- *
  * @version $Id$
  */
 class SegmentReader extends IndexReader {
@@ -92,7 +90,7 @@
   private Hashtable norms = new Hashtable();
 
   /** The class which implements SegmentReader. */
-  private static final Class IMPL;
+  private static Class IMPL;
   static {
     try {
       String name =
@@ -100,7 +98,13 @@
                            SegmentReader.class.getName());
       IMPL = Class.forName(name);
     } catch (ClassNotFoundException e) {
-      throw new RuntimeException("cannot load SegmentReader class: " + e.toString());
+      throw new RuntimeException("cannot load SegmentReader class: " + e);
+    } catch (SecurityException se) {
+      try {
+        IMPL = Class.forName(SegmentReader.class.getName());
+      } catch (ClassNotFoundException e) {
+        throw new RuntimeException("cannot load default SegmentReader class: " + e);
+      }
     }
   }
 
@@ -123,7 +127,7 @@
     try {
       instance = (SegmentReader)IMPL.newInstance();
     } catch (Exception e) {
-      throw new RuntimeException("cannot load SegmentReader class: " + e.toString());
+      throw new RuntimeException("cannot load SegmentReader class: " + e);
     }
     instance.init(dir, sis, closeDir, ownDir);
     instance.initialize(si);



Mime
View raw message