changeset 10948:390639f694ab

8063087: policytool reports error message with prefix of "java.lang.Exception" Reviewed-by: xuelei
author weijun
date Wed, 12 Nov 2014 10:47:08 +0800
parents 62fe5a5e2bae
children ed08e1d47bfd
files src/jdk.runtime/share/classes/sun/security/tools/policytool/PolicyTool.java
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.runtime/share/classes/sun/security/tools/policytool/PolicyTool.java	Tue Nov 11 20:11:34 2014 +0000
+++ b/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());
+        }
     }
 
     /**