8063087: policytool reports error message with prefix of "java.lang.Exception"
Reviewed-by: xuelei
--- a/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/PolicyTool.java Tue Nov 11 20:11:34 2014 +0000
+++ b/jdk/src/jdk.runtime/share/classes/sun/security/tools/policytool/PolicyTool.java Wed Nov 12 10:47:08 2014 +0800
@@ -1400,7 +1400,13 @@
if (t instanceof NoDisplayException) {
return;
}
- displayErrorDialog(w, t.toString());
+ if (t.getClass() == Exception.class) {
+ // Exception is usually thrown inside policytool for user
+ // interaction error. There is no need to show the type.
+ displayErrorDialog(w, t.getLocalizedMessage());
+ } else {
+ displayErrorDialog(w, t.toString());
+ }
}
/**