8230626: Make UnknownFooException strings more informative
authordarcy
Wed, 04 Sep 2019 15:49:25 -0700
changeset 58011 f016cc0874f0
parent 58010 ef055f777569
child 58012 70cb43a67409
8230626: Make UnknownFooException strings more informative Reviewed-by: jjg, mr
src/java.compiler/share/classes/javax/lang/model/element/UnknownAnnotationValueException.java
src/java.compiler/share/classes/javax/lang/model/element/UnknownElementException.java
src/java.compiler/share/classes/javax/lang/model/type/UnknownTypeException.java
--- a/src/java.compiler/share/classes/javax/lang/model/element/UnknownAnnotationValueException.java	Wed Sep 04 13:57:26 2019 -0700
+++ b/src/java.compiler/share/classes/javax/lang/model/element/UnknownAnnotationValueException.java	Wed Sep 04 15:49:25 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -60,7 +60,7 @@
      * @param p an additional parameter, may be {@code null}
      */
     public UnknownAnnotationValueException(AnnotationValue av, Object p) {
-        super("Unknown annotation value: " + av);
+        super("Unknown annotation value: \"" + av + "\"");
         this.av = av;
         this.parameter = p;
     }
--- a/src/java.compiler/share/classes/javax/lang/model/element/UnknownElementException.java	Wed Sep 04 13:57:26 2019 -0700
+++ b/src/java.compiler/share/classes/javax/lang/model/element/UnknownElementException.java	Wed Sep 04 15:49:25 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,7 +58,7 @@
      * @param p an additional parameter, may be {@code null}
      */
     public UnknownElementException(Element e, Object p) {
-        super("Unknown element: " + e);
+        super("Unknown element: \"" + e + "\"");
         element = e;
         this.parameter = p;
     }
--- a/src/java.compiler/share/classes/javax/lang/model/type/UnknownTypeException.java	Wed Sep 04 13:57:26 2019 -0700
+++ b/src/java.compiler/share/classes/javax/lang/model/type/UnknownTypeException.java	Wed Sep 04 15:49:25 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,7 +58,7 @@
      * @param p an additional parameter, may be {@code null}
      */
     public UnknownTypeException(TypeMirror t, Object p) {
-        super("Unknown type: " + t);
+        super("Unknown type: \"" + t + "\"");
         type = t;
         this.parameter = p;
     }