rootvector2 commented on PR #432:
URL:
https://github.com/apache/commons-beanutils/pull/432#issuecomment-5163900099
The repo's convention is `IAE` for this category:
`PropertyUtilsBean.getIndexedProperty` and `setIndexedProperty` both throw
`IllegalArgumentException` when the index parsed from the expression is
negative ("Invalid indexed property ..."), and `getIndex` itself already throws
`IAE` for a non-numeric subscript with the same "Invalid index value" message
this check reuses. `IndexOutOfBoundsException` is used for the other category,
a well-formed index that falls outside the actual array or `List` at access
time; `PropertyUtilsBean` propagates it from the underlying access. A negative
subscript is a malformed expression rather than an out-of-range access, and at
parse time there's no collection to be out of bounds of. One more practical
point: both `PropertyUtilsBean` call sites catch `IllegalArgumentException`
from `resolver.getIndex` and rewrap it with bean-class context, so an
`IndexOutOfBoundsException` thrown there would bypass those handlers and change
their existing message co
ntract.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]