Bug 534224 (RHQ-1040)
| Summary: | PropertySimple should have no public no-arg constructor | ||
|---|---|---|---|
| Product: | [Other] RHQ Project | Reporter: | Heiko W. Rupp <hrupp> |
| Component: | Core Server | Assignee: | RHQ Project Maintainer <rhq-maint> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | medium | Docs Contact: | |
| Priority: | low | ||
| Version: | unspecified | Keywords: | FutureFeature, Improvement |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| URL: | http://jira.rhq-project.org/browse/RHQ-1040 | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Enhancement | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2010-08-18 14:54:47 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
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. Hm. 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. |
The current implementation has a public no-arg constructor for PropertySimple(). This allows for the following PropertySimple ps = new PropertySimple(); ps.setStringValue("fooBar"); config.put(ps); 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;