Hi guys,
yesterday, I was stuck for a couple of hours (it was late, and my brain
was half sleeping. The only part working was my right half, the one in
charge of emotion and slang ...), trying to understand why the kerberos
codec was not accepting my correct hand crafted PDU. At the end, I
realized that instead of getting the value I affected to a constant, it
took the ordinal.
Such an enum declaration:
public enum MyEnum {
VA(10),
VB(20),
VB(30);
private int value;
private MyEnum( int value ) (
this.value = value;
}
public int getValue() {
return value;
}
}
will return 20 when doing VB.getValue() but *1* when doing
VB.getOrdinal()...
Don't be as idiot as I was : use getValue instead of getOrdinal, which
is based on the field order. Also always declare a 'value' field, not an
'ordinal' field, as it was done in many case...
I should have knew it, but anyway. I hope it can spare you some time...
--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com