Allow Property impl to transform value before setting
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start with Property#isValidValue and the SettingsManager path used when an application sets a value. Inspect LowercaseStringSetProperty, collection properties, and InlineArrayProperty to compare resource loading with programmatic setting. Done requires an agreed transformation or rejection behavior for these cases, with tests covering the resulting behavior.
Written by the indexing model from the issue text.
Description
A property like LowercaseStringSetProperty or any other property type where not every value of the Java type is considered valid, proper validation/transformation happens when values are loaded from the resource, but if a property's value is programmatically set later on, no such validation occurs. While there is Property#isValidValue and it gets called when a value is set, this makes the SettingsManager throw an exception if it's false.
Ideally, values are valid when the application sets them for a property, but it might make sense to promote the idea that properties manage their values a bit more by maybe allowing the property to slightly transform the value (or throw if the value is unusable) also when a property's value is set by the application.
Examples:
- A set with upper-case text is set for a LowercaseStringSetProperty
- A collection is provided for any collection property where one of the entries is null (I believe nothing checks this at all at the moment)
- InlineArrayProperty does not escape the chosen delimiter in the value -> would need to be done by the developer himself
- Dominant language
- Java
- Stars
- 44
- Forks
- 21
- Avg merge
- 7d 11h
- Merged PRs (30d)
- 2
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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.
More from AuthMe/ConfigMe
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
-
architecture
Difficulty 4/5 3-5 days Newbie friendliness 38/100
-
PropertyValue: Specify if value is default or notMay be free again @ljacqu claimed this 78 days ago, and no pull request is open. Open
Similar issues
-
test(setup): GitHub configuration tests fail when the temp path is long enough for YAML foldingOpenbug good first issue help wanted priority medium size S
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
martin-francois/symphony-trello#776 · 1 comment ·
Maintainers usually reply within 1 day
-
Console.printHexOpengood first issue kernel
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
JackFurton/who-would-build-a-kernel-in-java#33 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
objectionary/eo#9182 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
objectionary/hone-maven-plugin#1293 ·
Maintainers usually reply within 1 day
-
1.severity: security
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
NixOS/nixpkgs#569828 · 1 reaction ·
Maintainers usually reply within 1 day