Skip to content
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

Scala 2 BeanProperties are set twice when used in output type #16

Open
MateuszKubuszok opened this issue Oct 20, 2022 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@MateuszKubuszok
Copy link
Owner

When we create Java Beans in Scala 2 using @BeanProperty it will have 2 setters for each @BeanProperty val foo: Foo property:

def setFoo(foo: Foo): Unit
def foo_=(foo: Foo): Unit

Both of them will be called when setting up things in derived type class.

Find a reasonable way to avoid issues with this case e.g.

  • preferring only calling foo_= when both methods can be proven(?) to be generated by annotation
  • ditto but preferring setFoo
  • calling both of them BUT ensuring that pipe converting value to output type will be only called once (limiting side effects and computations in converter but ensuring that both fields are called)
  • using a flag to decide between behaviors above and selecting one of them as the default
@MateuszKubuszok MateuszKubuszok added the enhancement New feature or request label Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant