You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2009/09/11 12:48:50 UTC

svn commit: r813773 - /myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/ApplicationProxy.java

Author: werpu
Date: Fri Sep 11 10:48:50 2009
New Revision: 813773

URL: http://svn.apache.org/viewvc?rev=813773&view=rev
Log:
http://issues.apache.org/jira/browse/EXTSCRIPT-1

improved the behavior reloading

Modified:
    myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/ApplicationProxy.java

Modified: myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/ApplicationProxy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/ApplicationProxy.java?rev=813773&r1=813772&r2=813773&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/ApplicationProxy.java (original)
+++ myfaces/extensions/scripting/trunk/core/myfaces2-extensions/src/main/java/org/apache/myfaces/scripting/jsf/dynamicdecorators/implemetations/ApplicationProxy.java Fri Sep 11 10:48:50 2009
@@ -428,12 +428,16 @@
         //still direct casts are forbidden, but parent casts are ok, which should
         //be enough for behavior replacements on the user side, which this mechanism should
         //cover for now
-        if (retVal instanceof BehaviorBase && ProxyUtils.isDynamic(retVal.getClass())) { //we might have casts here
-            retVal = (Behavior) ProxyUtils.getWeaver().reloadScriptingInstance(retVal);
-        } else if (ProxyUtils.isDynamic(retVal.getClass())) {
-            retVal = (Behavior) ProxyUtils.createMethodReloadingProxyFromObject(retVal, Behavior.class);
+        boolean isDynamic = ProxyUtils.isDynamic(retVal.getClass());
+        if (!isDynamic) {
+            return retVal;
+        } else if (retVal instanceof BehaviorBase) {
+            //we might have casts here against one of the parents
+            //of this object
+            return (Behavior) ProxyUtils.getWeaver().reloadScriptingInstance(retVal);
+        } else {
+            return (Behavior) ProxyUtils.createMethodReloadingProxyFromObject(retVal, Behavior.class);
         }
-        return retVal;
     }
 
     @Override