Author: keith
Date: Thu Apr 24 04:18:01 2008
New Revision: 16100

Log:

Renaming function injected to service from ConvertToString to 
org_wso2_mashup_ConvertToString to avoid name conflicts


Modified:
   
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java

Modified: 
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
==============================================================================
--- 
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
   (original)
+++ 
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
   Thu Apr 24 04:18:01 2008
@@ -732,21 +732,21 @@
             // convert a function to a string and get the full string 
corresponding to that
             // function. We need that to get the order of the parameter names 
in that function.
             // Rhino does not preserve the order of parameters as they are 
held in a map
-            String sourceStr = "function convertToString(){ " + "var code = " 
+ oriMethodName
-                    + ".toString();" + "return code;}";
+            String sourceStr = "function org_wso2_mashup_ConvertToString(){ " 
+ "var code = " +
+                    oriMethodName + ".toString();" + "return code;}";
             engine.getCx().evaluateString(engine, sourceStr, "", 0, null);
 
             // Get the function from the scope the javascript object is in
-            Object fObj = engine.get("convertToString", engine);
+            Object fObj = engine.get("org_wso2_mashup_ConvertToString", 
engine);
             if (!(fObj instanceof Function) || (fObj == Scriptable.NOT_FOUND)) 
{
-                throw new DeploymentException("Method " + "convertToString"
+                throw new DeploymentException("Method " + 
"org_wso2_mashup_ConvertToString"
                         + " is undefined or not a function");
             }
 
             Object functionArgs[] = { };
             Function f = (Function) fObj;
 
-            // Execute our convertToString function and get the function a 
string
+            // Execute our org_wso2_mashup_ConvertToString function and get 
the function a string
             Object args = f.call(engine.getCx(), engine, engine, functionArgs);
             String[] params = null;
             if (args instanceof String) {

_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev

Reply via email to