Author: kentam Date: Wed Jan 5 15:21:06 2005 New Revision: 124303 URL: http://svn.apache.org/viewcvs?view=rev&rev=124303 Log: The changes made to ControlBean.vm and ControlMacro.vm in r124238 was to accomodate IDE (such as Eclipse 3.1Mx) that are not fully JDK5 compliant. I have limited the changes to ControlBean.vm only and reverted any changes made in ControlMacros.vm, so only one file will need to be reverted when this is no longer required. I have also commented on how to remove this change in the code.
Contributor: Hoi Lam Modified: incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ControlBean.vm incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ControlMacros.vm Modified: incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ControlBean.vm Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ControlBean.vm?view=diff&rev=124303&p1=incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ControlBean.vm&r1=124302&p2=incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ControlBean.vm&r2=124303 ============================================================================== --- incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ControlBean.vm (original) +++ incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ControlBean.vm Wed Jan 5 15:21:06 2005 @@ -155,12 +155,35 @@ } finally { + ##Wrapping primitives with their corresponding wrapper class + ##will not be necessary once Javelin and other IDEs become + ##fully compliant with JDK5. + ##In this case, we can replace the if statement below with: + ## #if ($returnType == "void") + ## Object rv = null; + ## #else + ## Object rv = retval; #if ($returnType == "void") Object rv = null; + #elseif ($returnType == "int") + Object rv = Integer.valueOf(retval); + #elseif ($returnType == "long") + Object rv = Long.valueOf(retval); + #elseif ($returnType == "boolean") + Object rv = Boolean.valueOf(retval); + #elseif ($returnType == "byte") + Object rv = Byte.valueOf(retval); + #elseif ($returnType == "short") + Object rv = Short.valueOf(retval); + #elseif ($returnType == "char") + Object rv = Character.valueOf(retval); + #elseif ($returnType == "float") + Object rv = Float.valueOf(retval); + #elseif ($returnType == "double") + Object rv = Double.valueOf(retval); #else - Object rv = #wrapPrimitive("retval" $returnType); + Object rv = retval; #end - #if ($operation.interceptorServiceNames.size() == 0) postInvoke(${operation.methodField}, argArray, rv, thrown, null); #else Modified: incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ControlMacros.vm Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ControlMacros.vm?view=diff&rev=124303&p1=incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ControlMacros.vm&r1=124302&p2=incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ControlMacros.vm&r2=124303 ============================================================================== --- incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ControlMacros.vm (original) +++ incubator/beehive/trunk/controls/src/runtime/org/apache/beehive/controls/runtime/generator/ControlMacros.vm Wed Jan 5 15:21:06 2005 @@ -29,9 +29,6 @@ ## A simple helper macro that converts a primitive type to the equivalent object ## #macro (toObject $type)#if ($type == "int")Integer#elseif ($type == "long")Long#elseif ($type == "boolean")Boolean#elseif ($type == "byte")Byte#elseif ($type == "short")Short#elseif ($type == "char")Character#elseif ($type == "float")Float#elseif ($type == "double")Double#else${type}#end#end -## A simple helper that wraps a primitive variable in its corresponding wrapper class -#macro (wrapPrimitive $varName $varType)#if ($varType == "int")new Integer($varName)#elseif ($varType == "long")new Long($varName)#elseif ($varType == "boolean")new Boolean($varName)#elseif ($varType == "byte")new Byte($varName)#elseif ($varType == "short")new Short($varName)#elseif ($varType == "char")new Character($varName)#elseif ($varType == "float")new Float($varName)#elseif ($varType == "double")new Double($varName)#else$varName#end -#end ## ## A simple helper macro that converts a object type to the equivalent primitive ##
