jdk/src/share/classes/sun/management/GarbageCollectorImpl.java
changeset 11530 a9d059c15b80
parent 9698 8b66cd6c5ebc
child 14342 8435a30053c1
equal deleted inserted replaced
11529:e08d565262ce 11530:a9d059c15b80
    68     // TODO: If the hotspot implementation begins to have pools
    68     // TODO: If the hotspot implementation begins to have pools
    69     // dynamically created and removed, this needs to be modified.
    69     // dynamically created and removed, this needs to be modified.
    70     private String[] poolNames = null;
    70     private String[] poolNames = null;
    71     synchronized String[] getAllPoolNames() {
    71     synchronized String[] getAllPoolNames() {
    72         if (poolNames == null) {
    72         if (poolNames == null) {
    73             List pools = ManagementFactory.getMemoryPoolMXBeans();
    73             List<MemoryPoolMXBean> pools = ManagementFactory.getMemoryPoolMXBeans();
    74             poolNames = new String[pools.size()];
    74             poolNames = new String[pools.size()];
    75             int i = 0;
    75             int i = 0;
    76             for (ListIterator iter = pools.listIterator();
    76             for (MemoryPoolMXBean m : pools) {
    77                  iter.hasNext();
    77                 poolNames[i++] = m.getName();
    78                  i++) {
       
    79                 MemoryPoolMXBean p = (MemoryPoolMXBean) iter.next();
       
    80                 poolNames[i] = p.getName();
       
    81             }
    78             }
    82         }
    79         }
    83         return poolNames;
    80         return poolNames;
    84     }
    81     }
    85 
    82