[hibernate-issues] [Hibernate-JIRA] Created: (ANN-664) IllegalArgumentException with @Enumerated(EnumType.ORDINAL)

Pavel (JIRA) noreply at atlassian.com
Thu Oct 11 05:50:39 EDT 2007


IllegalArgumentException with @Enumerated(EnumType.ORDINAL)
-----------------------------------------------------------

                 Key: ANN-664
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-664
             Project: Hibernate Annotations
          Issue Type: Bug
    Affects Versions: 3.2.0.ga
            Reporter: Pavel


i have enum

  public enum RunType {
    DELETED(-1),
    UNKNOW(0),
    MANUAL(1),
    AUTO(2);
    
    private final int value;

    RunType(int value) { this.value = value; }
    
    public int value() { return value; }
  }

when value equls -1 i have IllegalArgumentException

code from EnumType.nullSafeGet
			if ( ordinal < 0 || ordinal >= values.length ) {
				throw new IllegalArgumentException( "Unknown ordinal value for enum " + enumClass + ": " + ordinal );
			}


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list