--- old/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/HeapRegion.java 2019-02-13 16:34:55.558271593 +0100 +++ new/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/HeapRegion.java 2019-02-13 16:34:55.186271606 +0100 @@ -32,6 +32,7 @@ import sun.jvm.hotspot.debugger.Address; import sun.jvm.hotspot.debugger.OopHandle; import sun.jvm.hotspot.gc.shared.CompactibleSpace; +import sun.jvm.hotspot.gc.shared.LiveRegionsProvider; import sun.jvm.hotspot.memory.MemRegion; import sun.jvm.hotspot.runtime.VM; import sun.jvm.hotspot.runtime.VMObjectFactory; @@ -43,7 +44,7 @@ // Mirror class for HeapRegion. Currently we don't actually include // any of its fields but only iterate over it. -public class HeapRegion extends CompactibleSpace { +public class HeapRegion extends CompactibleSpace implements LiveRegionsProvider { // static int GrainBytes; static private CIntegerField grainBytesField; static private AddressField topField; @@ -86,8 +87,8 @@ } @Override - public List getLiveRegions() { - List res = new ArrayList(); + public List getLiveRegions() { + List res = new ArrayList<>(); res.add(new MemRegion(bottom(), top())); return res; }