diff --git a/src/java/org/apache/lucene/index/SegmentReader.java b/src/java/org/apache/lucene/index/SegmentReader.java index 7d69a05fc17..aea1b636f43 100644 --- a/src/java/org/apache/lucene/index/SegmentReader.java +++ b/src/java/org/apache/lucene/index/SegmentReader.java @@ -100,7 +100,7 @@ class SegmentReader extends IndexReader { SegmentReader.class.getName()); IMPL = Class.forName(name); } catch (ClassNotFoundException e) { - throw new RuntimeException("cannot load SegmentReader class: " + e.getMessage()); + throw new RuntimeException("cannot load SegmentReader class: " + e.toString()); } } @@ -123,7 +123,7 @@ class SegmentReader extends IndexReader { try { instance = (SegmentReader)IMPL.newInstance(); } catch (Exception e) { - throw new RuntimeException("cannot load SegmentReader class: " + e.getMessage()); + throw new RuntimeException("cannot load SegmentReader class: " + e.toString()); } instance.init(dir, sis, closeDir, ownDir); instance.initialize(si); diff --git a/src/java/org/apache/lucene/store/FSDirectory.java b/src/java/org/apache/lucene/store/FSDirectory.java index f82ecc28ea9..b5678c0a296 100644 --- a/src/java/org/apache/lucene/store/FSDirectory.java +++ b/src/java/org/apache/lucene/store/FSDirectory.java @@ -65,7 +65,7 @@ public class FSDirectory extends Directory { FSDirectory.class.getName()); IMPL = Class.forName(name); } catch (ClassNotFoundException e) { - throw new RuntimeException("cannot load FSDirectory class: " + e.getMessage()); + throw new RuntimeException("cannot load FSDirectory class: " + e.toString()); } } @@ -115,7 +115,7 @@ public class FSDirectory extends Directory { try { dir = (FSDirectory)IMPL.newInstance(); } catch (Exception e) { - throw new RuntimeException("cannot load FSDirectory class: " + e.getMessage()); + throw new RuntimeException("cannot load FSDirectory class: " + e.toString()); } dir.init(file, create); DIRECTORIES.put(file, dir); @@ -262,14 +262,14 @@ public class FSDirectory extends Directory { try { in.close(); } catch (IOException e) { - throw new RuntimeException("Cannot close input stream: " + e.getMessage()); + throw new RuntimeException("Cannot close input stream: " + e.toString()); } } if (out != null) { try { out.close(); } catch (IOException e) { - throw new RuntimeException("Cannot close output stream: " + e.getMessage()); + throw new RuntimeException("Cannot close output stream: " + e.toString()); } } }