Author: alexsmirnov
Date: 2010-12-20 18:48:52 -0500 (Mon, 20 Dec 2010)
New Revision: 20703
Modified:
trunk/cdk/generator/src/main/resources/META-INF/templates/_attribute_accessors.ftl
Log:
RESOLVED - issue RF-9776: CDK: code with potential NPEs is generated
https://issues.jboss.org/browse/RF-9776
Modified:
trunk/cdk/generator/src/main/resources/META-INF/templates/_attribute_accessors.ftl
===================================================================
---
trunk/cdk/generator/src/main/resources/META-INF/templates/_attribute_accessors.ftl 2010-12-20
23:33:39 UTC (rev 20702)
+++
trunk/cdk/generator/src/main/resources/META-INF/templates/_attribute_accessors.ftl 2010-12-20
23:48:52 UTC (rev 20703)
@@ -6,9 +6,7 @@
</#if>
public ${attribute.typeName} ${attribute.getterName}() {
- <#if attribute.typeForCasting?contains("Boolean")>
- return Boolean.valueOf(getStateHelper().eval(Properties.${propertyKey}<#if
attribute.defaultValue?exists>, ${attribute.defaultValue}</#if>).toString());
- <#elseif attribute.bindingAttribute || attribute.literal >
+ <#if attribute.bindingAttribute || attribute.literal >
return (${attribute.typeForCasting})
getStateHelper().get(Properties.${propertyKey});
<#else>
return (${attribute.typeForCasting})
getStateHelper().eval(Properties.${propertyKey}<#if attribute.defaultValue?exists>,
${attribute.defaultValue}</#if>);