[9] RFR: 8168921: Inconsistent Annotation.toString()

joe darcy joe.darcy at oracle.com
Mon Oct 31 17:11:44 UTC 2016


Hi Ivan,

The code change in src look fine, but please update the existing test

     test/java/lang/annotation/AnnotationToStringTest.java

rather than introducing a new test file.

Thanks,

-Joe


On 10/29/2016 6:42 PM, Ivan Gerasimov wrote:
> Hello!
>
> Suppose an annotation is of form
>
>     @interface MyAnnotation {
>         long value();
>     }
>
> Create the annotation object with 
> sun.reflect.annotation.AnnotationParser.annotationForMap(MyAnnotation.class, 
> Map.of("value", some_value)).
>
> Annotation.toString() method, called for the object, will produce a 
> string containing that 'some_value' with the optional 'L' suffix 
> appended.
> Normally, the suffix is not appended for values that can be 
> represented with int, and is appended otherwise.
> However, the logic does not hold for values Long.MIN_VALUE and 
> Integer.MIN_VALUE:  For the former the suffix is not appended and for 
> the later the suffix L is appended.
>
> Would you please help review the fix, which removes this tiny 
> inconsistency?
>
> BUGURL: https://bugs.openjdk.java.net/browse/JDK-8168921
> WEBREV: http://cr.openjdk.java.net/~igerasim/8168921/00/webrev/
>
> I also took a chance to perform some pico-optimizations around the 
> modified code.
>
> With kind regards,
> Ivan
>



More information about the core-libs-dev mailing list