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

List:       openjdk-serviceability-dev
Subject:    Re: JDK 9 RFR of JDK-8049794: Fix raw and unchecked warnings in jvmstat
From:       Joe Darcy <joe.darcy () oracle ! com>
Date:       2014-07-09 23:58:31
Message-ID: 53BDD727.2030707 () oracle ! com
[Download RAW message or body]

On 07/09/2014 02:48 PM, Mandy Chung wrote:
>
> On 7/9/2014 2:36 PM, Joe Darcy wrote:
>> Hello,
>>
>> Please review these changes to address
>>
>>     JDK-8049794: Fix raw and unchecked warnings in jvmstat
>>     http://cr.openjdk.java.net/~darcy/8049794.0/
>>
>
> I looked through the patch and the generified types look right except 
> this:
>
>> --- 
>> old/src/share/classes/sun/jvmstat/perfdata/monitor/v1_0/PerfDataBuffer.java 
>> 2014-07-09 14:30:56.000000000 -0700
>> +++ 
>> new/src/share/classes/sun/jvmstat/perfdata/monitor/v1_0/PerfDataBuffer.java 
>> 2014-07-09 14:30:55.000000000 -0700
>> ...
>>      /**
>>       * Method to dump debugging information
>>       */
>> -    private void dumpAll(Map map, int lvmid) {
>> +    private void dumpAll(Map<?, Monitor> map, int lvmid) {
>>          if (DEBUG) {
>> -            Set keys = map.keySet();
>> +            Set<?> keys = map.keySet();
>>
>>              System.err.println("Dump for " + lvmid);
>>              int j = 0;
>> -            for (Iterator i = keys.iterator(); i.hasNext(); j++) {
>> -                Monitor monitor = (Monitor)map.get(i.next());
>> +            for (Iterator<?> i = keys.iterator(); i.hasNext(); j++) {
>> +                Monitor monitor = map.get(i.next());
>>                  System.err.println(j + "\t" + monitor.getName()
>>                                     + "=" + monitor.getValue());
>>              }
>
> dumpAll method is called from the pollFor(Map<String, Monitor> map, 
> String name, long timeLimit) method.  I think it can take 
> Map<String,Monitor> map argument instead.
>

Hi Mandy,

I made the changes you suggested and that works fine (and matches the 
analogous code in the v2_0 case). I'll push as amended.

Thanks for the review,

-Joe

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

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