src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java

Print this page




  41  */
  42 
  43 
  44 class AllClassesQuery extends QueryHandler {
  45 
  46     boolean excludePlatform;
  47     boolean oqlSupported;
  48 
  49     public AllClassesQuery(boolean excludePlatform, boolean oqlSupported) {
  50         this.excludePlatform = excludePlatform;
  51         this.oqlSupported = oqlSupported;
  52     }
  53 
  54     public void run() {
  55         if (excludePlatform) {
  56             startHtml("All Classes (excluding platform)");
  57         } else {
  58             startHtml("All Classes (including platform)");
  59         }
  60 
  61         Iterator classes = snapshot.getClasses();
  62         String lastPackage = null;
  63         while (classes.hasNext()) {
  64             JavaClass clazz = (JavaClass) classes.next();
  65             if (excludePlatform && PlatformClasses.isPlatformClass(clazz)) {
  66                 // skip this..
  67                 continue;
  68             }
  69             String name = clazz.getName();
  70             int pos = name.lastIndexOf('.');
  71             String pkg;
  72             if (name.startsWith("[")) {         // Only in ancient heap dumps
  73                 pkg = "<Arrays>";
  74             } else if (pos == -1) {
  75                 pkg = "<Default Package>";
  76             } else {
  77                 pkg = name.substring(0, pos);
  78             }
  79             if (!pkg.equals(lastPackage)) {
  80                 out.print("<h2>Package ");
  81                 print(pkg);
  82                 out.println("</h2>");
  83             }
  84             lastPackage = pkg;




  41  */
  42 
  43 
  44 class AllClassesQuery extends QueryHandler {
  45 
  46     boolean excludePlatform;
  47     boolean oqlSupported;
  48 
  49     public AllClassesQuery(boolean excludePlatform, boolean oqlSupported) {
  50         this.excludePlatform = excludePlatform;
  51         this.oqlSupported = oqlSupported;
  52     }
  53 
  54     public void run() {
  55         if (excludePlatform) {
  56             startHtml("All Classes (excluding platform)");
  57         } else {
  58             startHtml("All Classes (including platform)");
  59         }
  60 
  61         Iterator<JavaClass> classes = snapshot.getClasses();
  62         String lastPackage = null;
  63         while (classes.hasNext()) {
  64             JavaClass clazz = classes.next();
  65             if (excludePlatform && PlatformClasses.isPlatformClass(clazz)) {
  66                 // skip this..
  67                 continue;
  68             }
  69             String name = clazz.getName();
  70             int pos = name.lastIndexOf('.');
  71             String pkg;
  72             if (name.startsWith("[")) {         // Only in ancient heap dumps
  73                 pkg = "<Arrays>";
  74             } else if (pos == -1) {
  75                 pkg = "<Default Package>";
  76             } else {
  77                 pkg = name.substring(0, pos);
  78             }
  79             if (!pkg.equals(lastPackage)) {
  80                 out.print("<h2>Package ");
  81                 print(pkg);
  82                 out.println("</h2>");
  83             }
  84             lastPackage = pkg;