An out of boundx exception
java.lang.ArrayIndexOutOfBoundsException: 0
at
com.meterware.httpunit.SelectionFormControl$Options.get(FormControl.j
ava:1293)
is possible Since
public Object get( int index ) {
return _options[ index ];
}
does not check whether the index is valid.
I think:
public Object get( int index ) {
if (index < 0 || index >= _options.length) {
String msg="invalid index "+index+" for
Options ";
for (int i = 0; i < _options.length; i++) {
msg=msg+(_options[i]._text);
if (i>0)
msg=msg+",";
}
throw new RuntimeException(msg);
}
return _options[ index ];
}
would be an improvement
For empty options you now get:
java.lang.RuntimeException: invalid index 0 for Options
when the options are available they would be listed
Logged In: YES
user_id=1220573
Originator: YES
version 868 has an improved version with test
Logged In: YES
user_id=1220573
Originator: YES
The change is now in the subversion repository and will be in the next build