Re: RFR: JDK-8281462: Annotation toString output for enum not reusable for source input [v3]

2022-02-16 Thread Sam Brannen
On Fri, 11 Feb 2022 20:49:33 GMT, Joe Darcy wrote: >> Thanks, Joe. >> >> Regarding the RFE, do you plan to open an issue to address the documentation >> for `getCanonicalName`? > > Filed https://bugs.openjdk.java.net/browse/JDK-8281671 Thanks for filing that. - PR: https://git.op

Re: RFR: JDK-8281462: Annotation toString output for enum not reusable for source input [v3]

2022-02-11 Thread Mandy Chung
On Fri, 11 Feb 2022 20:34:43 GMT, Joe Darcy wrote: >> Two changes to the toString output for annotations to give better source >> fidelity: >> >> 1) For enum constants, call their name method rather than their toString >> method. An enum class can override the toString method to print somethin

Re: RFR: JDK-8281462: Annotation toString output for enum not reusable for source input [v3]

2022-02-11 Thread Joe Darcy
On Fri, 11 Feb 2022 15:30:58 GMT, Sam Brannen wrote: >> The getCanonicalName is not specified to behave that way, should be a RFE I >> suppose, but appears to in practice; changed as suggested in subsequent >> push. Thanks. > > Thanks, Joe. > > Regarding the RFE, do you plan to open an issue t

Re: RFR: JDK-8281462: Annotation toString output for enum not reusable for source input [v3]

2022-02-11 Thread Joe Darcy
On Fri, 11 Feb 2022 20:34:43 GMT, Joe Darcy wrote: >> Two changes to the toString output for annotations to give better source >> fidelity: >> >> 1) For enum constants, call their name method rather than their toString >> method. An enum class can override the toString method to print somethin

Re: RFR: JDK-8281462: Annotation toString output for enum not reusable for source input [v2]

2022-02-11 Thread Joe Darcy
On Fri, 11 Feb 2022 15:24:45 GMT, Sam Brannen wrote: >> Joe Darcy has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Respond to review feedback. > > src/java.base/share/classes/sun/reflect/annotation/AnnotationInvocationHandler.java > line

Re: RFR: JDK-8281462: Annotation toString output for enum not reusable for source input [v3]

2022-02-11 Thread Joe Darcy
> Two changes to the toString output for annotations to give better source > fidelity: > > 1) For enum constants, call their name method rather than their toString > method. An enum class can override the toString method to print something > other than the name. > > 2) Switch from using binary

Re: RFR: JDK-8281462: Annotation toString output for enum not reusable for source input [v2]

2022-02-11 Thread Sam Brannen
On Thu, 10 Feb 2022 22:12:57 GMT, Joe Darcy wrote: >> Two changes to the toString output for annotations to give better source >> fidelity: >> >> 1) For enum constants, call their name method rather than their toString >> method. An enum class can override the toString method to print somethin

Re: RFR: JDK-8281462: Annotation toString output for enum not reusable for source input [v2]

2022-02-11 Thread Sam Brannen
On Thu, 10 Feb 2022 22:09:16 GMT, Joe Darcy wrote: >> src/java.base/share/classes/sun/reflect/annotation/AnnotationInvocationHandler.java >> line 256: >> >>> 254: return Objects.toString(finalComponent.getCanonicalName(), >>> 255: "") + >>> 256:

Re: RFR: JDK-8281462: Annotation toString output for enum not reusable for source input [v2]

2022-02-11 Thread Sam Brannen
On Thu, 10 Feb 2022 22:12:57 GMT, Joe Darcy wrote: >> Two changes to the toString output for annotations to give better source >> fidelity: >> >> 1) For enum constants, call their name method rather than their toString >> method. An enum class can override the toString method to print somethin

Re: RFR: JDK-8281462: Annotation toString output for enum not reusable for source input [v2]

2022-02-10 Thread Jaikiran Pai
On Thu, 10 Feb 2022 22:08:27 GMT, Joe Darcy wrote: >> src/java.base/share/classes/sun/reflect/annotation/AnnotationInvocationHandler.java >> line 197: >> >>> 195: // Predicate above covers enum constants, including >>> 196: // those with specialized class bodies.

Re: RFR: JDK-8281462: Annotation toString output for enum not reusable for source input [v2]

2022-02-10 Thread Joe Darcy
On Thu, 10 Feb 2022 14:04:01 GMT, Jaikiran Pai wrote: > Hello Joe, would it be better to use the new syntax for `instanceof` here to > avoid the subsequent cast? > > ``` > else if (value instanceof Enum v) > > return toSourceString(v); > ``` Fair point; updated in subsequent push. Th

Re: RFR: JDK-8281462: Annotation toString output for enum not reusable for source input [v2]

2022-02-10 Thread Joe Darcy
On Thu, 10 Feb 2022 14:56:46 GMT, Sam Brannen wrote: >> Joe Darcy has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Respond to review feedback. > > src/java.base/share/classes/sun/reflect/annotation/AnnotationInvocationHandler.java > line

Re: RFR: JDK-8281462: Annotation toString output for enum not reusable for source input [v2]

2022-02-10 Thread Joe Darcy
> Two changes to the toString output for annotations to give better source > fidelity: > > 1) For enum constants, call their name method rather than their toString > method. An enum class can override the toString method to print something > other than the name. > > 2) Switch from using binary

Re: RFR: JDK-8281462: Annotation toString output for enum not reusable for source input

2022-02-10 Thread Sam Brannen
On Thu, 10 Feb 2022 05:49:47 GMT, Joe Darcy wrote: > Two changes to the toString output for annotations to give better source > fidelity: > > 1) For enum constants, call their name method rather than their toString > method. An enum class can override the toString method to print something >

Re: RFR: JDK-8281462: Annotation toString output for enum not reusable for source input

2022-02-10 Thread Jaikiran Pai
On Thu, 10 Feb 2022 05:49:47 GMT, Joe Darcy wrote: > Two changes to the toString output for annotations to give better source > fidelity: > > 1) For enum constants, call their name method rather than their toString > method. An enum class can override the toString method to print something >

RFR: JDK-8281462: Annotation toString output for enum not reusable for source input

2022-02-09 Thread Joe Darcy
Two changes to the toString output for annotations to give better source fidelity: 1) For enum constants, call their name method rather than their toString method. An enum class can override the toString method to print something other than the name. 2) Switch from using binary names (names wi