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

Only (code)generate propertyChangeSupport field if it does not already exist? #171

Open
mediahype opened this issue May 24, 2017 · 3 comments
Labels

Comments

@mediahype
Copy link
Contributor

As soon as a Bean property gets set = "bound" the code generator generates:

private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);

And then I cannot save my Bean to mongo anymore (I use morphia), the error is:

Caused by: org.mongodb.morphia.mapping.MappingException: Error mapping field:java.beans.PropertyChangeSupport.map

I also cannot mark propertyChangeSupport transient, because it gets overwritten by the code generator.

How could this be solved? My (amateur) idea is in the topic.

@jodastephen
Copy link
Member

Sounds like it should be generated as private final transient. And yes, if already present it should not be generated.

@jodastephen jodastephen added the RFE label Jun 7, 2017
@mediahype
Copy link
Contributor Author

Hi Stephen,

I took a look at the codegen code and found it trivial to change the field to private final transient in all cases.

In the end, this would be all I need. My proposal was only for the case that some folks rely on the previous behaviour.

So if you are satisfied with only making it private final transient I can do a pull request.
If you want to implement "Only (code)generate propertyChangeSupport field if it does not already exist" aswell, then I think I would need some words from you how to go about it.

@jodastephen
Copy link
Member

If you could PR the first part, we can keep an RFE open for the second, thanks

jodastephen added a commit that referenced this issue Sep 20, 2017
#171: codegen: propertyChangeSupport
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants