提交 4e54e999 编写于 作者: C coffeys

8185855: Debug exception stacks should be clearer

Reviewed-by: mullan, ascarpino
上级 1f86a9b8
......@@ -88,8 +88,8 @@ class IdentityScope extends Identity {
try {
Class.forName(classname);
} catch (ClassNotFoundException e) {
//Security.error("unable to establish a system scope from " +
// classname);
System.err.println("unable to establish a system scope from " +
classname);
e.printStackTrace();
}
}
......
......@@ -1051,7 +1051,7 @@ public abstract class Signature extends SignatureSpi {
debug.println("Further warnings of this type will "
+ "be suppressed");
}
new Exception("Call trace").printStackTrace();
new Exception("Debug call trace").printStackTrace();
}
}
Exception lastException = null;
......
......@@ -275,7 +275,7 @@ public final class ProviderList {
}
if (debug != null) {
debug.println("Loading all providers");
new Exception("Call trace").printStackTrace();
new Exception("Debug Info. Call trace:").printStackTrace();
}
int n = 0;
for (int i = 0; i < configs.length; i++) {
......
......@@ -347,7 +347,6 @@ public class PKCS8Key implements PrivateKey {
}
} catch (IOException e) {
// e.printStackTrace ();
throw new InvalidKeyException("IOException : " +
e.getMessage());
}
......
......@@ -186,6 +186,7 @@ public class AuthPolicyFile extends javax.security.auth.Policy {
} catch (Exception e) {
// ignore, treat it like we have no keystore
if (debug != null) {
debug.println("Debug info only. No keystore.");
e.printStackTrace();
}
return null;
......@@ -260,7 +261,7 @@ public class AuthPolicyFile extends javax.security.auth.Policy {
loaded_one = true;
} catch (Exception e) {
if (debug != null) {
debug.println("error reading policy " + e);
debug.println("Debug info only. Error reading policy " + e);
e.printStackTrace();
}
// ignore that policy
......
......@@ -434,18 +434,6 @@ abstract class DSA extends SignatureSpi {
return printable;
}
private static void debug(Exception e) {
if (debug) {
e.printStackTrace();
}
}
private static void debug(String s) {
if (debug) {
System.err.println(s);
}
}
/**
* Standard SHA224withDSA implementation as defined in FIPS186-3.
*/
......
......@@ -563,7 +563,8 @@ public class PolicyFile extends java.security.Policy {
loaded_policy = true;
} catch (Exception e) {
if (debug != null) {
debug.println("error reading policy "+e);
debug.println(
"Debug info only. Error reading policy " +e);
e.printStackTrace();
}
// ignore that policy
......@@ -616,6 +617,7 @@ public class PolicyFile extends java.security.Policy {
} catch (Exception e) {
// ignore, treat it like we have no keystore
if (debug != null) {
debug.println("Debug info only. Ignoring exception.");
e.printStackTrace();
}
}
......
......@@ -75,8 +75,8 @@ public class AnchorCertificates {
} catch (Exception e) {
if (debug != null) {
debug.println("Error parsing cacerts");
e.printStackTrace();
}
e.printStackTrace();
}
return null;
}
......
......@@ -380,8 +380,9 @@ public class SignatureFileVerifier {
if (e.getMessage() != null) {
debug.println(key + ": " + e.getMessage());
} else {
debug.println(key + ": " + algorithm +
" was disabled, no exception msg given.");
debug.println("Debug info only. " + key + ": " +
algorithm +
" was disabled, no exception msg given.");
e.printStackTrace();
}
}
......
......@@ -124,7 +124,8 @@ public class CertificateExtensions implements CertAttrSet<Extension> {
unparseableExtensions.put(ext.getExtensionId().toString(),
new UnparseableExtension(ext, e));
if (debug != null) {
debug.println("Error parsing extension: " + ext);
debug.println("Debug info only." +
" Error parsing extension: " + ext);
e.printStackTrace();
HexDumpEncoder h = new HexDumpEncoder();
System.err.println(h.encodeBuffer(ext.getExtensionValue()));
......
......@@ -393,7 +393,6 @@ public class X509Key implements PublicKey {
throw new InvalidKeyException ("excess key data");
} catch (IOException e) {
// e.printStackTrace ();
throw new InvalidKeyException("IOException: " +
e.getMessage());
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册