-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add parameter to silently ignore randomization exceptions #340
Comments
Good idea! 👍 Not sure if the name |
@PascalSchumacher Thanks for the feedback! Indeed that's what I also thought about the parameter name (See code comment here). But if we agree on the idea, it is already great! For naming, we know it's hard.. Especially when I work after 🕙 pm, I don't expect to come up with a good name 😄 More seriously, what would be a good name for this parameter? I was thinking of something similar to the expressive PS: As a side note, I do apologise if I'm bothering you too much lately, I'm really focusing on closing all issues for RB. After closing all issues, I will release v3.9 and declare the project as being in maintenance mode (only dependency updates and bug fixes, but no more features). I will probably move the project to jeasy.org and rename it to easy-random (with a bump of version to v4). |
I like P.S.: You are not bothering me. 😃 If I do have the time I will just delay/skip replying. |
@PascalSchumacher Thank you! I really appreciate all your efforts! I renamed the parameter to |
@PascalSchumacher I was doing a last review of v3.9 and in hindsight, I'm not sure Moreover, the documentation of the parameter is confusing:
That's not true. RB will still try to randomize abstract types, and when it fails it will swallow the exception and set the field to null. Lastly, the name can be confusing to users that might think that setting
Probably my first intuition for |
Well, then let's go with |
Thanks! |
While working on replacing JPopulator with RB in Netflix's AWSObjectMapper (I'm happy to see RB used in Netflix OSS BTW 😄 ), I noticed a difference in behaviour between JPopulator and RB.
JPopulator used to return
null
for types that it cannot instantiate (mainly abstract classes and interfaces). This has been changed in RB in issue #39 to throw an exception by default. I have suggested at that time to add a "silentMode" but looks like I chose to declare the exception in the API instead. However, this exception has been made aRuntimeException
in #63.So IMO, making this behaviour configurable through a silent mode parameter makes sense, especially for backward compatibility regarding people upgrading from JPopulator to RB.
@PascalSchumacher WDTY? Please see branch
silent-mode
for details.The text was updated successfully, but these errors were encountered: