RFR: 8247236: fieldDescriptor::print_on_for prints extra newline after NULL

Stefan Karlsson stefan.karlsson at oracle.com
Tue Jun 9 16:49:35 UTC 2020


Thanks, Coleen.

StefanK

On 2020-06-09 18:46, coleen.phillimore at oracle.com wrote:
>
> This change looks good and trivial.
> thanks,
> Coleen
>
> On 6/9/20 11:11 AM, Ioi Lam wrote:
>> Thanks Stefan for fixing this pet peeve of mime! It looks good to me.
>>
>> - Ioi
>>
>> On 6/9/20 8:05 AM, Stefan Karlsson wrote:
>>> Hi all,
>>>
>>> Please review this small patch to remove a newline that is 
>>> incorrectly printed after NULL.
>>>
>>> https://cr.openjdk.java.net/~stefank/8247236/webrev.01/
>>> https://bugs.openjdk.java.net/browse/JDK-8247236
>>>
>>> Ioi reported that this bug could be seen by running:
>>>
>>> ---
>>> (gdb) call pp(m)
>>> "Executing pp"
>>> java.lang.Class
>>> {0x00000007bf0008b0} - klass: 'java/lang/Class'
>>>  - ---- fields (total size 14 words):
>>>  - private volatile transient 'classRedefinedCount' 'I' @12 0
>>>  - private volatile transient strict 'cachedConstructor' 
>>> 'Ljava/lang/reflect/Constructor;' @40 NULL
>>>  (0)
>>>  - private transient 'name' 'Ljava/lang/String;' @44 NULL
>>>  (0)
>>>
>>> There are newlines between NULL and (0).
>>> ---
>>>
>>> This can be seen whenever an InstanceKlass is printed and one of the 
>>> oops are NULL. There's no newline if the object is non-null or if 
>>> printing primitives. Note, that this is only printed in non-product 
>>> builds, making it less likely that someone depends on the output 
>>> format.
>>>
>>> After the patch, the lines look like this:
>>>  - private volatile transient strict 'cachedConstructor' 
>>> 'Ljava/lang/reflect/Constructor;' @40 NULL (0)
>>>  - private transient 'name' 'Ljava/lang/String;' @44 NULL (0)
>>>
>>> Thanks,
>>> StefanK
>>
>



More information about the hotspot-dev mailing list