Consider inheritance when checking models
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 4.1k
- Forks
- 370
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 68
Description
We should be able to leverage inheritance when writing models for librarys. E.g., Collections.toArray(T[]) is specified to throw an NPE whenever the parameter is null. Right now, we need to add a model for Collections.toArray, ArrayDeque.toArray, LinkedList.toArray, etc. to get full safety. It'd be nice to just add a model for Collections.toArray and then catch this for any overriding method. Would need to be careful about performance when implementing this.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how models for Collections.toArray and overriding methods such as ArrayDeque.toArray and LinkedList.toArray are represented and checked. Review the existing model-handling entry points and consider the performance implications called out in the issue. Done means a model for Collections.toArray provides the expected null-safety behavior for overriding methods without unacceptable performance cost.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100