jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesQuery.java
changeset 25798 0b2f54e47bc4
parent 5506 202f599c92aa
equal deleted inserted replaced
25797:671124b407ce 25798:0b2f54e47bc4
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    71             error("Class not found");
    71             error("Class not found");
    72         } else {
    72         } else {
    73             out.print("<strong>");
    73             out.print("<strong>");
    74             printClass(clazz);
    74             printClass(clazz);
    75             out.print("</strong><br><br>");
    75             out.print("</strong><br><br>");
    76             Enumeration objects = clazz.getInstances(includeSubclasses);
    76             Enumeration<JavaHeapObject> objects = clazz.getInstances(includeSubclasses);
    77             long totalSize = 0;
    77             long totalSize = 0;
    78             long instances = 0;
    78             long instances = 0;
    79             while (objects.hasMoreElements()) {
    79             while (objects.hasMoreElements()) {
    80                 JavaHeapObject obj = (JavaHeapObject) objects.nextElement();
    80                 JavaHeapObject obj = objects.nextElement();
    81                 if (newObjects && !obj.isNew())
    81                 if (newObjects && !obj.isNew())
    82                     continue;
    82                     continue;
    83                 printThing(obj);
    83                 printThing(obj);
    84                 out.println("<br>");
    84                 out.println("<br>");
    85                 totalSize += obj.getSize();
    85                 totalSize += obj.getSize();