Merge "Add bounds checks before accessing ArrayList." into klp-dev