You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by "Dan Haywood (JIRA)" <ji...@apache.org> on 2013/09/17 01:34:52 UTC
[jira] [Updated] (ISIS-249) Fail early for enums that have no
default and are mandatory.
[ https://issues.apache.org/jira/browse/ISIS-249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dan Haywood updated ISIS-249:
-----------------------------
Fix Version/s: (was: core-1.3.0)
core-2.0.0
Assignee: Dan Haywood
> Fail early for enums that have no default and are mandatory.
> ------------------------------------------------------------
>
> Key: ISIS-249
> URL: https://issues.apache.org/jira/browse/ISIS-249
> Project: Isis
> Issue Type: Improvement
> Components: Core
> Affects Versions: 0.2.0-incubating
> Reporter: Dan Haywood
> Assignee: Dan Haywood
> Priority: Minor
> Fix For: core-2.0.0
>
>
> ... such that this would be an error, showing up as a ValidationFailure in the MetaModelValidator:
> // {{ Gender (attribute)
> private PersonGenderType gender;
> @MemberOrder(sequence = "4")
> public PersonGenderType getGender() {
> return gender;
> }
> public void setGender(final PersonGenderType gender) {
> this.gender = gender;
> }
>
> // }}
>
>
>
>
> but this would be ok, because the programmer has provided an explicit default method:
>
> // {{ Gender (attribute)
> private PersonGenderType gender;
> @MemberOrder(sequence = "4")
> public PersonGenderType getGender() {
> return gender;
> }
> public void setGender(final PersonGenderType gender) {
> this.gender = gender;
> }
>
> public PersonGenderType defaultGender() {
> return PersonGenderType.UNKNOWN;
> }
> // }}
>
>
>
> and this would be ok, because the property is optional
>
> // {{ Gender (attribute)
> private PersonGenderType gender;
> @MemberOrder(sequence = "4")
> @Optional
> public PersonGenderType getGender() {
> return gender;
> }
> public void setGender(final PersonGenderType gender) {
> this.gender = gender;
> }
> // }}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira