Hello.

I decided to upgrade to MyFaces 1.2.4 (from 1.1.something) today, and I
noticed something odd - some of my converters stopped working. I traced
the problem to ApplicationImpl.internalCreateConverter, which appears to
have a bug.

My converter is bound in faces-config.xml to an interface type called
EnumCoded. My enum classes implement EnumCoded, like this:

public enum PickListActionType implements EnumCoded {
..... etc...
}

I have a converter called a GenericEnumTypeConverter, which knows how to
deal with these and is declared like this:

<converter>
 <converter-for-class>EnumCoded</converter-for-class>
 <converter-class>GenericEnumTypeConverter</converter-class>
</converter>

This used to work in MyFaces 1.1, but in 1.2 it looks like the fact that
my type is an enum takes precedence over the fact that it implements
EnumCoded interface, so I end up with the built-in EnumConverter instead
of my GenericEnumTypeConverter.

The solution seems to be to simply reverse the checks on lines 757 and
763 in ApplicationImpl.internalCreateConverter(), so that we check for
interfaces before defaulting to EnumConverter.


Does this look right? Thank you for you help.


Val


Reply via email to