[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    Code review request for 6985460: PlatformLogger throws ArrayStoreException
From:       David.Holmes () oracle ! com (David Holmes)
Date:       2010-10-22 0:29:58
Message-ID: 4CC0DB06.2090000 () oracle ! com
[Download RAW message or body]

Mandy Chung said the following on 10/22/10 09:19:
> Looking closer at the java.util.logging.LogRecord and Formatter 
> implementation, I don't think the conversion from Object[] to String[] 
> is needed at all (I confess that I couldn't recall why it was added in 
> the first place). 

That simplifies things then :)

> I also spot another bug that didn't filter the frame from 
> LoggingProxyImpl class (a regression caused when LoggingProxy was added 
> in the fix for 6876135).

Okay, this looks alright as well.

David

> 
> The new webrev is at:
>    http://cr.openjdk.java.net/~mchung/6985460/webrev.01/
> 
> Thanks
> Mandy
> 
> On 10/21/10 13:37, David Holmes wrote:
>> Okay I'm confused by this one. The AWT code passes an XIConSize[] 
>> where a Object[] is expected. Something strikes me as wrong that this 
>> "works" but I guess that's just the way arrays are. And its okay as 
>> long as the array is read-only.
>>
>> What is really wrong in this case is that the doLog method mutates the 
>> array that is passed in to it! It has no business doing that. Someone 
>> seems to have assumed that the varargs array is always one created by 
>> the compiler, but it need not be. In which case allocating a new 
>> String[] to fill in is definitely the right thing to do.
>>
>> David
>>
>> Mandy Chung said the following on 10/22/10 05:25:
>>>  Hi Dan,
>>>
>>> Can you review a simple fix for:
>>>     6985460: PlatformLogger throws ArrayStoreException when 
>>> j.u.logging is initialized
>>>
>>> Webrev at:
>>>    http://cr.openjdk.java.net/~mchung/6985460/webrev.00/
>>>
>>> ArrayStoreException was thrown when it attempts to write a String 
>>> object into a non-String type.
>>>
>>> Thanks
>>> Mandy
> 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic