Swapped ArrayIndexOutOfBoundsException for plain array length check in AbstractFunctionPtg.getParameterClass(). (To help debugging when trying to find a real AIOOB)

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@653125 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Josh Micich 2008-05-03 20:13:56 +00:00
parent bbe3ee9b4d
commit 3774c3228f

View File

@ -147,10 +147,12 @@ public abstract class AbstractFunctionPtg extends OperationPtg {
}
public byte getParameterClass(int index) {
try {
return paramClass[index];
} catch (ArrayIndexOutOfBoundsException aioobe) {
if (index >= paramClass.length) {
// For var-arg (and other?) functions, the metadata does not list all the parameter
// operand classes. In these cases, all extra parameters are assumed to have the
// same operand class as the last one specified.
return paramClass[paramClass.length - 1];
}
return paramClass[index];
}
}