jdk/src/share/classes/com/sun/servicetag/RegistrationDocument.java
changeset 10419 12c063b39232
parent 5506 202f599c92aa
child 14342 8435a30053c1
--- a/jdk/src/share/classes/com/sun/servicetag/RegistrationDocument.java	Tue Aug 30 14:41:12 2011 +0100
+++ b/jdk/src/share/classes/com/sun/servicetag/RegistrationDocument.java	Tue Aug 30 11:53:11 2011 -0700
@@ -150,9 +150,7 @@
         } catch (ParserConfigurationException pce) {
             // Parser with specific options can't be built
             // should not reach here
-            InternalError x = new InternalError("Error in creating the new document");
-            x.initCause(pce);
-            throw x;
+            throw new InternalError("Error in creating the new document", pce);
         }
     }
 
@@ -172,9 +170,7 @@
         } catch (ParserConfigurationException pce) {
             // Parser with specified options can't be built
             // should not reach here
-            InternalError x = new InternalError("Error in creating the new document");
-            x.initCause(pce);
-            throw x;
+            throw new InternalError("Error in creating the new document", pce);
         }
     }
 
@@ -195,20 +191,14 @@
                 new StreamResult(new BufferedWriter(new OutputStreamWriter(os, "UTF-8"))));
         } catch (UnsupportedEncodingException ue) {
             // Should not reach here
-            InternalError x = new InternalError("Error generated during transformation");
-            x.initCause(ue);
-            throw x;
+            throw new InternalError("Error generated during transformation", ue);
         } catch (TransformerConfigurationException tce) {
             // Error generated by the parser
             // Should not reach here
-            InternalError x = new InternalError("Error in creating the new document");
-            x.initCause(tce);
-            throw x;
+            throw new InternalError("Error in creating the new document", tce);
         } catch (TransformerException te) {
             // Error generated by the transformer
-            InternalError x = new InternalError("Error generated during transformation");
-            x.initCause(te);
-            throw x;
+            throw new InternalError("Error generated during transformation", te);
         }
     }