Fix abusive usage of assert in ArrayUtil [LUCENE-8969]
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 1.4k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 88
Description
Methods in `o.a.l.util.ArrayUtil` uses `assert` statements for argument checks.
It would be suitable to throw \`IllegalArgumentExceptions`s instead of assertions here, to improve traceability when the violations occur? Sometimes I had difficulty in identifying the cause of assertion errors...
---
Migrated from [LUCENE-8969](https://issues.apache.org/jira/browse/LUCENE-8969) by Tomoko Uchida (@mocobeta)
Contributor guide
Research direction
Locate o.a.l.util.ArrayUtil and review the methods that use assert statements for argument checks. Replace those checks with IllegalArgumentExceptions, then verify that invalid arguments consistently produce the intended exceptions and that the relevant tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100