jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r630832 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core: fs/ fs/db/ persistence/bundle/util/ query/lucene/ util/ xml/
Date Mon, 25 Feb 2008 12:39:06 GMT
Author: stefan
Date: Mon Feb 25 04:39:04 2008
New Revision: 630832

URL: http://svn.apache.org/viewvc?rev=630832&view=rev
Log:
JCR-1413: [PATCH] retain exception stack traces

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/FileSystemPathUtil.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/DatabaseFileSystem.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/OracleFileSystem.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/DbNameIndex.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/HashMapIndex.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/NGKDbNameIndex.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/PostgreSQLNameIndex.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DocOrderNodeIteratorImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexingConfigurationImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/DOMBuilder.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SysViewSAXEventGenerator.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/FileSystemPathUtil.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/FileSystemPathUtil.java?rev=630832&r1=630831&r2=630832&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/FileSystemPathUtil.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/FileSystemPathUtil.java
Mon Feb 25 04:39:04 2008
@@ -140,7 +140,9 @@
                 try {
                     out.write(Integer.parseInt(pathOrName.substring(i + 1, i + 3), 16));
                 } catch (NumberFormatException e) {
-                    throw new IllegalArgumentException();
+                    IllegalArgumentException iae = new IllegalArgumentException("Failed to
unescape escape sequence");
+                    iae.initCause(e);
+                    throw iae;
                 }
                 i += 2;
             } else {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/DatabaseFileSystem.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/DatabaseFileSystem.java?rev=630832&r1=630831&r2=630832&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/DatabaseFileSystem.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/DatabaseFileSystem.java
Mon Feb 25 04:39:04 2008
@@ -773,7 +773,9 @@
                         }
 
                     } catch (Exception e) {
-                        throw new IOException(e.getMessage());
+                        IOException ioe = new IOException(e.getMessage());
+                        ioe.initCause(e);
+                        throw ioe;
                     } finally {
                         if (in != null) {
                             in.close();
@@ -872,7 +874,9 @@
                         }
 
                     } catch (Exception e) {
-                        throw new IOException(e.getMessage());
+                        IOException ioe = new IOException(e.getMessage());
+                        ioe.initCause(e);
+                        throw ioe;
                     } finally {
                         if (in != null) {
                             in.close();

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/OracleFileSystem.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/OracleFileSystem.java?rev=630832&r1=630831&r2=630832&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/OracleFileSystem.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/OracleFileSystem.java
Mon Feb 25 04:39:04 2008
@@ -398,7 +398,9 @@
                             }
                         }
                     } catch (Exception e) {
-                        throw new IOException(e.getMessage());
+                        IOException ioe = new IOException(e.getMessage());
+                        ioe.initCause(e);
+                        throw ioe;
                     } finally {
                         if (blob != null) {
                             try {
@@ -509,7 +511,9 @@
                             }
                         }
                     } catch (Exception e) {
-                        throw new IOException(e.getMessage());
+                        IOException ioe = new IOException(e.getMessage());
+                        ioe.initCause(e);
+                        throw ioe;
                     } finally {
                         if (blob != null) {
                             try {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/DbNameIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/DbNameIndex.java?rev=630832&r1=630831&r2=630832&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/DbNameIndex.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/DbNameIndex.java
Mon Feb 25 04:39:04 2008
@@ -143,7 +143,9 @@
                 return rs.getInt(1);
             }
         } catch (Exception e) {
-            throw new IllegalStateException("Unable to insert index: " + e);
+            IllegalStateException ise = new IllegalStateException("Unable to insert index
for string: " + string);
+            ise.initCause(e);
+            throw ise;
         } finally {
             closeResultSet(rs);
         }
@@ -165,7 +167,9 @@
                 return rs.getInt(1);
             }
         } catch (Exception e) {
-            throw new IllegalStateException("Unable to read index: " + e);
+            IllegalStateException ise = new IllegalStateException("Unable to read index for
string: " + string);
+            ise.initCause(e);
+            throw ise;
         } finally {
             closeResultSet(rs);
         }
@@ -187,7 +191,9 @@
                 return rs.getString(1);
             }
         } catch (Exception e) {
-            throw new IllegalStateException("Unable to read name: " + e);
+            IllegalStateException ise = new IllegalStateException("Unable to read name for
index: " + index);
+            ise.initCause(e);
+            throw ise;
         } finally {
             closeResultSet(rs);
         }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/HashMapIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/HashMapIndex.java?rev=630832&r1=630831&r2=630832&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/HashMapIndex.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/HashMapIndex.java
Mon Feb 25 04:39:04 2008
@@ -131,7 +131,9 @@
             try {
                 load();
             } catch (Exception e) {
-                throw new IllegalStateException("Unable to load lookup table: " + e);
+                IllegalStateException ise = new IllegalStateException("Unable to load lookup
table for uri: " + nsUri);
+                ise.initCause(e);
+                throw ise;
             }
             idx = (Integer) stringToIndex.get(nsUri);
         }
@@ -143,7 +145,9 @@
             try {
                 save();
             } catch (Exception e) {
-                throw new IllegalStateException("Unable to store lookup table: "  + e);
+                IllegalStateException ise = new IllegalStateException("Unable to store lookup
table for uri: "  + nsUri);
+                ise.initCause(e);
+                throw ise;
             }
         }
         return idx.intValue();
@@ -162,7 +166,9 @@
             try {
                 load();
             } catch (Exception e) {
-                throw new IllegalStateException("Unable to load lookup table: " + e);
+                IllegalStateException ise = new IllegalStateException("Unable to load lookup
table for index: " + i);
+                ise.initCause(e);
+                throw ise;
             }
             s = (String) indexToString.get(idx);
         }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/NGKDbNameIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/NGKDbNameIndex.java?rev=630832&r1=630831&r2=630832&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/NGKDbNameIndex.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/NGKDbNameIndex.java
Mon Feb 25 04:39:04 2008
@@ -63,7 +63,9 @@
             connectionManager.executeStmt(nameInsertSQL, new Object[]{string});
             return getIndex(string);
         } catch (Exception e) {
-            throw new IllegalStateException("Unable to insert index: " + e);
+            IllegalStateException ise = new IllegalStateException("Unable to insert index
for string: " + string);
+            ise.initCause(e);
+            throw ise;
         } finally {
             closeResultSet(rs);
         }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/PostgreSQLNameIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/PostgreSQLNameIndex.java?rev=630832&r1=630831&r2=630832&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/PostgreSQLNameIndex.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/PostgreSQLNameIndex.java
Mon Feb 25 04:39:04 2008
@@ -63,7 +63,9 @@
             connectionManager.executeStmt(nameInsertSQL, new Object[]{string});
             return getGeneratedKey();
         } catch (Exception e) {
-            throw new IllegalStateException("Unable to insert index: " + e);
+            IllegalStateException ise = new IllegalStateException("Unable to insert index
for string: " + string);
+            ise.initCause(e);
+            throw ise ;
         }
     }
 
@@ -84,7 +86,9 @@
                 rs.close();
             }
         } catch (Exception e) {
-            throw new IllegalStateException("Unable to read index: " + e);
+            IllegalStateException ise = new IllegalStateException("Unable to read generated
index");
+            ise.initCause(e);
+            throw ise;
         }
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DocOrderNodeIteratorImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DocOrderNodeIteratorImpl.java?rev=630832&r1=630831&r2=630832&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DocOrderNodeIteratorImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/DocOrderNodeIteratorImpl.java
Mon Feb 25 04:39:04 2008
@@ -181,7 +181,9 @@
                                 log.warn("Node " + n1.getNodeId() + " does not exist anymore:
" + e);
                                 // node does not exist anymore
                                 invalidIDs.add(n1.getNodeId());
-                                throw new SortFailedException();
+                                SortFailedException sfe = new SortFailedException();
+                                sfe.initCause(e);
+                                throw sfe;
                             }
                             NodeImpl node2;
                             try {
@@ -190,7 +192,9 @@
                                 log.warn("Node " + n2.getNodeId() + " does not exist anymore:
" + e);
                                 // node does not exist anymore
                                 invalidIDs.add(n2.getNodeId());
-                                throw new SortFailedException();
+                                SortFailedException sfe = new SortFailedException();
+                                sfe.initCause(e);
+                                throw sfe;
                             }
                             Path.Element[] path1 = node1.getPrimaryPath().getElements();
                             Path.Element[] path2 = node2.getPrimaryPath().getElements();

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexingConfigurationImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexingConfigurationImpl.java?rev=630832&r1=630831&r2=630832&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexingConfigurationImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexingConfigurationImpl.java
Mon Feb 25 04:39:04 2008
@@ -722,7 +722,9 @@
                         try {
                             return (NodeState) ism.getItemState(cne.getId());
                         } catch (ItemStateException e) {
-                            throw new NoSuchElementException();
+                            NoSuchElementException nsee = new NoSuchElementException("No
node with id " + cne.getId() + " found in child axis");
+                            nsee.initCause(e);
+                            throw nsee;
                         }
                     }
                 };

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/DOMBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/DOMBuilder.java?rev=630832&r1=630831&r2=630832&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/DOMBuilder.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/DOMBuilder.java
Mon Feb 25 04:39:04 2008
@@ -80,9 +80,13 @@
             transformer.transform(
                     new DOMSource(document), new StreamResult(xml));
         } catch (TransformerConfigurationException e) {
-            throw new IOException(e.getMessage());
+            IOException ioe = new IOException(e.getMessage());
+            ioe.initCause(e);
+            throw ioe;
         } catch (TransformerException e) {
-            throw new IOException(e.getMessage());
+            IOException ioe = new IOException(e.getMessage());
+            ioe.initCause(e);
+            throw ioe;
         }
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SysViewSAXEventGenerator.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SysViewSAXEventGenerator.java?rev=630832&r1=630831&r2=630832&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SysViewSAXEventGenerator.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SysViewSAXEventGenerator.java
Mon Feb 25 04:39:04 2008
@@ -211,7 +211,9 @@
                         try {
                             contentHandler.characters(cbuf, off, len);
                         } catch (SAXException se) {
-                            throw new IOException(se.toString());
+                            IOException ioe = new IOException(se.toString());
+                            ioe.initCause(se);
+                            throw ioe;
                         }
                     }
                 };



Mime
View raw message