[hibernate-dev] ArrayIndexOutOfBoundsException in ReflectionHelper.parametersResolveToSameTypes

Ales Justin ales.justin at gmail.com
Thu Dec 12 05:26:45 EST 2013


> Can you confirm that some static method is involved here (which was the case for HV-818)? I can't see one on your Email class but maybe there is one on AbstractEntity?

AbstractEntity -- static method at the bottom:

(but Email is not the only one that extends AbstractEntity,
where my issues went away when I removed any BV annotations,
but might be that no other entity uses BV stuff)

@MappedSuperclass
public abstract class AbstractEntity implements Serializable {
    private static long serialVersionUID = 3l;
    private Long id;

    public AbstractEntity() {
    }

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Transient
    public String getInfo() {
        return getClass().getSimpleName() + "#" + getId();
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null)
            return false;
        if (getClass().equals(obj.getClass()) == false)
            return false;

        AbstractEntity other = (AbstractEntity) obj;
        return safeGet(id) == safeGet(other.getId());
    }

    public String toString() {
        return getInfo();
    }

    @Override
    public int hashCode() {
        return new Long(safeGet(id)).intValue();
    }

    protected static long safeGet(Long x) {
        return x == null ? 0 : x;
    }
}





More information about the hibernate-dev mailing list