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

Joseph D. Darcy joe.darcy at oracle.com
Wed Nov 2 17:42:35 UTC 2016


Looks good Ivan; thanks,

-Joe

On 11/2/2016 8:58 AM, Ivan Gerasimov wrote:
> Thank you Joe for review!
>
>
> On 31.10.2016 20:11, joe darcy wrote:
>> 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.
>>
>
> Yes, right, this is better.  Here's the updated webrev:
> http://cr.openjdk.java.net/~igerasim/8168921/01/webrev/
>
> With kind regards,
> Ivan
>
>> 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