agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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.
@@ -781,29 +781,30 @@
buf.endTable();
}
});
// display exception table for this method
- TypeArray exceptionTable = method.getExceptionTable();
- // exception table is 4 tuple array of shorts
- int numEntries = (int)exceptionTable.getLength() / 4;
+ boolean hasException = method.hasExceptionTable();
+ if (hasException) {
+ ExceptionTableElement[] exceptionTable = method.getExceptionTable();
+ int numEntries = exceptionTable.length;
if (numEntries != 0) {
buf.h4("Exception Table");
buf.beginTable(1);
buf.beginTag("tr");
buf.headerCell("start bci");
buf.headerCell("end bci");
buf.headerCell("handler bci");
buf.headerCell("catch type");
buf.endTag("tr");
- for (int e = 0; e < numEntries; e += 4) {
+ for (int e = 0; e < numEntries; e ++) {
buf.beginTag("tr");
- buf.cell(Integer.toString(exceptionTable.getIntAt(e)));
- buf.cell(Integer.toString(exceptionTable.getIntAt(e + 1)));
- buf.cell(Integer.toString(exceptionTable.getIntAt(e + 2)));
- short cpIndex = (short) exceptionTable.getIntAt(e + 3);
+ buf.cell(Integer.toString(exceptionTable[e].getStartPC()));
+ buf.cell(Integer.toString(exceptionTable[e].getEndPC()));
+ buf.cell(Integer.toString(exceptionTable[e].getHandlerPC()));
+ short cpIndex = (short) exceptionTable[e].getCatchTypeIndex();
ConstantPool.CPSlot obj = cpIndex == 0? null : cpool.getSlotAt(cpIndex);
if (obj == null) {
buf.cell("Any");
} else if (obj.isMetaData()) {
buf.cell(obj.getSymbol().asString().replace('/', '.'));
@@ -813,10 +814,11 @@
buf.endTag("tr");
}
buf.endTable();
}
+ }
// display constant pool hyperlink
buf.h3("Constant Pool");
buf.append(genConstantPoolLink(cpool));
buf.genHTMLEpilogue();