JDK 14 RFR of JDK-8230626: Make UnknownFooException strings more informative
Jonathan Gibbons
jonathan.gibbons at oracle.com
Wed Sep 4 22:06:18 UTC 2019
Just curious,
Is there any particular reason to go for the "double single quote" style
of presentation?
-- Jon
On 9/4/19 2:19 PM, Joe Darcy wrote:
> Hello,
>
> Responding to some off-list input from Jon, please review the small
> enhancement for
>
> JDK-8230626: Make UnknownFooException strings more informative
> http://cr.openjdk.java.net/~darcy/8230626.0/
>
> Patch below; thanks,
>
> -Joe
>
> ---
> old/src/java.compiler/share/classes/javax/lang/model/element/UnknownAnnotationValueException.java
> 2019-09-04 14:16:30.437963468 -0700
> +++
> new/src/java.compiler/share/classes/javax/lang/model/element/UnknownAnnotationValueException.java
> 2019-09-04 14:16:30.141963468 -0700
> @@ -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;
> }
> ---
> old/src/java.compiler/share/classes/javax/lang/model/element/UnknownElementException.java
> 2019-09-04 14:16:31.153963468 -0700
> +++
> new/src/java.compiler/share/classes/javax/lang/model/element/UnknownElementException.java
> 2019-09-04 14:16:30.917963468 -0700
> @@ -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;
> }
> ---
> old/src/java.compiler/share/classes/javax/lang/model/type/UnknownTypeException.java
> 2019-09-04 14:16:31.777963468 -0700
> +++
> new/src/java.compiler/share/classes/javax/lang/model/type/UnknownTypeException.java
> 2019-09-04 14:16:31.545963468 -0700
> @@ -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;
> }
>
More information about the compiler-dev
mailing list