PDA

View Full Version : Java Enum bug in Resin Hessian 4.0.2


fil512
12-04-2009, 06:39 PM
Steps to reproduce in java 5:
1. create an enum (just a plain old enum, nothing fancy)
2. create a class that uses this enum
3. create a list of instances of these classes.
4. try to pass this list back as a return value from a method accessed through hessian spring remoting.

I've narrowed the bug down to the following very specific trigger conditions.
The list must contain at least 3 items.
The first two items shall have the same value for the enum.
The third item shall have a different value for the enum.

The error is that it is not able to assign null to the enum field.

The general condition that triggers this is any list of objects that have enum fields where somewhere down the list the enum value changes. As soon as the object with the different enum value is hit, you get the error.

I have tried about 4 different versions of caucho hessian and they all had this same error. Interestingly, when I tried burlap, I still got a hessian exception but the exception was that it couldn't assign a java.sql.TimeStamp to the enum value which is weird since I don't use java.sql.TimeStamp anywhere--I'm guessing it's trying a bunch of different strategies and just reporting failure on the last strategy.

fil512
12-04-2009, 06:42 PM
Steps to reproduce in java 6:
1. create an enum (just a plain old enum, nothing fancy)
2. create a class that uses this enum
3. create a list of instances of these classes.
4. try to pass this list back as a return value from a method accessed through hessian spring remoting.

I've narrowed the bug down to the following very specific trigger conditions.
The list must contain at least 3 items.
The first two items shall have the same value for the enum.
The third item shall have a different value for the enum.

The error is that it is not able to assign null to the enum field.

The general condition that triggers this is any list of objects that have enum fields where somewhere down the list the enum value changes. As soon as the object with the different enum value is hit, you get the error.

I have tried about 4 different versions of caucho hessian and they all had this same error. Interestingly, when I tried burlap, I still got a hessian exception but the exception was that it couldn't assign a java.sql.TimeStamp to the enum value which is weird since I don't use java.sql.TimeStamp anywhere--I'm guessing it's trying a bunch of different strategies and just reporting failure on the last strategy.

P.S. Tried posting this on the Hessian forum but my post didn't show up...?

alex
12-10-2009, 05:45 PM
Thanks, I've reported a bug: http://bugs.caucho.com/view.php?id=3801