Red Hat Bugzilla – Bug 534224
PropertySimple should have no public no-arg constructor
Last modified: 2010-08-18 10:54:47 EDT
The current implementation has a public no-arg constructor for PropertySimple().
This allows for the following
PropertySimple ps = new PropertySimple();
yielding in a NPE later on when doing the writeExternal(), as there has never been a name set for this property.
We should require the name here, especially as the superclass marks the name as required:
@Column(name = "NAME", nullable = false)
private String name;
a protected no-arg ctor is needed according to the JPA spec. Seam requires the no-arg ctor to be public if you want to use it for bijection. so, this method needs to stay. please close this case if you agree, or post back if i'm missing the point.
I understand the Seam requirement, which is sad to be there.
Again, a PropertySimple without a name is incomplete. So we should prevent its usage when no name is present.
As just requiring the name via a constructor with arguments (and hiding the empty one) is not possible, one can perhaps print an error in writeExternal() and some @PrePersist hooks.
I've at least added a comment about this in rev2022
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-1040
mass add of key word FutureFeature to help track
mass move to component = core server
Per 17-Aug-2010 triage, closing this bug. It can be reopened if considered a critical issue.