bluelinelabs / bluelinelabs/LoganSquare
Should provide safer examples for custom type converters
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 3.2k
- Forks
- 303
- PR merge metrics
- No merged PRs in 30d
Description
On the documentation for custom types:
https://github.com/bluelinelabs/LoganSquare/blob/master/docs/TypeConverters.md
It mentions using TestEnum.values()[index] or TestEnum.valueOf(string) to do the conversion. However, these can both cause uncaught exceptions (ArrayIndexOutOfBounds for the index lookup, IllegalArgumentException for the String lookup) if the values on the remote service ever change; for example, if a new value is added, but an older client doesn't have an enum value for it yet.
Contributor guide
No contributing guide indexed for this repository
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
Open docs/TypeConverters.md and review the custom type converter examples using TestEnum.values()[index] and TestEnum.valueOf(string). Update the examples to show safer handling when remote values are unknown or invalid, and ensure the documentation no longer presents paths that can raise uncaught exceptions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100