bluelinelabs / bluelinelabs/LoganSquare

Should provide safer examples for custom type converters

Open
#127 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.