Fixed ArrayPtg.toString to not crash when partially initialised

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@691687 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Josh Micich 2008-09-03 17:03:02 +00:00
parent 1d65e27522
commit 50852e25ee

View File

@ -94,10 +94,14 @@ public final class ArrayPtg extends Ptg {
buffer.append("columns = ").append(getColumnCount()).append("\n");
buffer.append("rows = ").append(getRowCount()).append("\n");
for (int x=0;x<getColumnCount();x++) {
for (int y=0;y<getRowCount();y++) {
Object o = token_3_arrayValues[getValueIndex(x, y)];
buffer.append("[").append(x).append("][").append(y).append("] = ").append(o).append("\n");
if (token_3_arrayValues == null) {
buffer.append(" #values#uninitialised#\n");
} else {
for (int x=0;x<getColumnCount();x++) {
for (int y=0;y<getRowCount();y++) {
Object o = token_3_arrayValues[getValueIndex(x, y)];
buffer.append("[").append(x).append("][").append(y).append("] = ").append(o).append("\n");
}
}
}
return buffer.toString();