< prev index next >

agent/src/share/classes/sun/jvm/hotspot/utilities/PointerLocation.java

Print this page
rev 8331 : 8077842: Remove the level parameter passed around in GenCollectedHeap
Reviewed-by:

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -82,15 +82,15 @@
   public boolean isInHeap() {
     return (heap != null || (gen != null));
   }
 
   public boolean isInNewGen() {
-    return ((gen != null) && (gen.level() == 0));
+    return ((gen != null) && (gen == heap.getGen(0)));
   }
 
   public boolean isInOldGen() {
-    return ((gen != null) && (gen.level() == 1));
+    return ((gen != null) && (gen == heap.getGen(1)));
   }
 
   public boolean inOtherGen() {
     return (!isInNewGen() && !isInOldGen());
   }

@@ -205,12 +205,10 @@
       } else {
         if (isInNewGen()) {
           tty.print("In new generation ");
         } else if (isInOldGen()) {
           tty.print("In old generation ");
-        } else if (gen != null) {
-          tty.print("In Generation " + getGeneration().level());
         } else {
           tty.print("In unknown section of Java heap");
         }
         if (getGeneration() != null) {
           getGeneration().printOn(tty);
< prev index next >