From: Walter M. <wal...@us...> - 2008-01-25 18:23:15
|
User: walterim Date: 08/01/25 10:23:16 Modified: andromda-jsf2/src/main/resources/templates/jsf2/converters EnumerationConverter.java.vsl Log: Corrected bug when using enumeration of type 'char' Revision Changes Path 1.3 +5 -1 cartridges/andromda-jsf2/src/main/resources/templates/jsf2/converters/EnumerationConverter.java.vsl Index: EnumerationConverter.java.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-jsf2/src/main/resources/templates/jsf2/converters/EnumerationConverter.java.vsl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- EnumerationConverter.java.vsl 9 Sep 2007 11:02:58 -0000 1.2 +++ EnumerationConverter.java.vsl 25 Jan 2008 18:23:16 -0000 1.3 @@ -34,8 +34,12 @@ return value != null && value.trim().length() > 0 ? ${enumeration.fullyQualifiedName}.${enumeration.fromOperationName}(value) : null; #elseif ($enumeration.literalType.primitive) try { +#if(${enumeration.literalType.fullyQualifiedName} == "char") + char v = value.charAt(0); +#else #set ($parseSuffix = $stringUtils.capitalize($enumeration.literalType.name)) ${enumeration.literalType.fullyQualifiedName} v = ${enumeration.literalType.wrapperName}.parse${parseSuffix}(value); +#end return ${enumeration.fullyQualifiedName}.${enumeration.fromOperationName}(v); } catch (Exception ex) { throw new javax.faces.convert.ConverterException(ex); |