JDK 9 RFR of JDK-8049794: Fix raw and unchecked warnings in jvmstat
Mandy Chung
mandy.chung at oracle.com
Wed Jul 9 21:48:45 UTC 2014
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.
Mandy
More information about the serviceability-dev
mailing list