JDK 9 RFR of JDK-8049794: Fix raw and unchecked warnings in jvmstat

Joe Darcy joe.darcy at oracle.com
Wed Jul 9 23:58:31 UTC 2014


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



More information about the serviceability-dev mailing list