You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to use java.lang.integer, as explained here & was advised by @DanielaSfregola to bring the issue up here.
Now I do it myself
lazy val jIntGen = Arbitrary.arbitrary[Int].map(_.asInstanceOf[Integer])
but I wonder if it is a biggie to add that to the set of default arbitraries, so to speak. it does not look so bad here, but with nested objects it kind of gets messy.
I guess, it is logical to add other java wrappers like java.lang.Double, lava.lang.Long and etc. if this request makes sense. If it does, I can try to raise a PR myself.
thank you in advance for reviewing the request,
Petr
The text was updated successfully, but these errors were encountered:
Stumbled upon this one. Note that Java boxed primitives can be null though, so you might want Arbitrary.arbitrary[Option[Int]].map(_.map(_.asInstanceOf[Integer].getOrElse(null))) to cover that edge case.
I need to use java.lang.integer, as explained here & was advised by @DanielaSfregola to bring the issue up here.
Now I do it myself
but I wonder if it is a biggie to add that to the set of default arbitraries, so to speak. it does not look so bad here, but with nested objects it kind of gets messy.
I guess, it is logical to add other java wrappers like java.lang.Double, lava.lang.Long and etc. if this request makes sense. If it does, I can try to raise a PR myself.
thank you in advance for reviewing the request,
Petr
The text was updated successfully, but these errors were encountered: