[kaffe] CVS kaffe (robilad): improved Class.newInstance exception messages

Kaffe CVS cvs-commits at kaffe.org
Thu Feb 10 14:47:14 PST 2005


PatchSet 5512 
Date: 2005/02/10 22:41:25
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
improved Class.newInstance exception messages

2005-02-10  Dalibor Topic  <robilad at kaffe.org>

* libraries/javalib/java/lang/Class.java (newInstance):
Improved exception messages.

Members: 
	ChangeLog:1.3556->1.3557 
	libraries/javalib/java/lang/Class.java:1.52->1.53 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3556 kaffe/ChangeLog:1.3557
--- kaffe/ChangeLog:1.3556	Thu Feb 10 22:23:46 2005
+++ kaffe/ChangeLog	Thu Feb 10 22:41:25 2005
@@ -1,5 +1,10 @@
 2005-02-10  Dalibor Topic  <robilad at kaffe.org>
 
+	* libraries/javalib/java/lang/Class.java (newInstance): 
+	Improved exception messages.
+
+2005-02-10  Dalibor Topic  <robilad at kaffe.org>
+
 	* libraries/clib/net/PlainSocketImpl.c (gnu_java_net_PlainSocketImpl_socketAccept): 
 	Improved debug code.
 
Index: kaffe/libraries/javalib/java/lang/Class.java
diff -u kaffe/libraries/javalib/java/lang/Class.java:1.52 kaffe/libraries/javalib/java/lang/Class.java:1.53
--- kaffe/libraries/javalib/java/lang/Class.java:1.52	Sun Jan  9 17:26:31 2005
+++ kaffe/libraries/javalib/java/lang/Class.java	Thu Feb 10 22:41:28 2005
@@ -425,11 +425,15 @@
 		throw (RuntimeException) e.getTargetException();
 	    }
 	    else {
-		throw new InstantiationException(e.getTargetException().getMessage());
+		InstantiationException ie = new InstantiationException(e.getTargetException().getMessage());
+		ie.initCause(e);
+		throw ie;
 	    }
 	}
 	catch (NoSuchMethodException e) {
-	    throw new InstantiationException(e.getMessage());
+	    InstantiationException ie = new InstantiationException(e.getMessage());
+	    ie.initCause(e);
+	    throw ie;
 	}
     }
 }




More information about the kaffe mailing list