svn commit: r682059 - in /ofbiz/trunk/framework/service/src/org/ofbiz/service/engine: BeanShellEngine.java GroovyEngine.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r682059 - in /ofbiz/trunk/framework/service/src/org/ofbiz/service/engine: BeanShellEngine.java GroovyEngine.java

doogie-3
Author: doogie
Date: Sat Aug  2 14:39:11 2008
New Revision: 682059

URL: http://svn.apache.org/viewvc?rev=682059&view=rev
Log:
More generics.

Modified:
    ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/BeanShellEngine.java
    ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GroovyEngine.java

Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/BeanShellEngine.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/BeanShellEngine.java?rev=682059&r1=682058&r2=682059&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/BeanShellEngine.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/BeanShellEngine.java Sat Aug  2 14:39:11 2008
@@ -26,7 +26,7 @@
 import org.ofbiz.base.util.GeneralException;
 import org.ofbiz.base.util.HttpClient;
 import org.ofbiz.base.util.HttpClientException;
-import org.ofbiz.base.util.UtilGenerics;
+import static org.ofbiz.base.util.UtilGenerics.cast;
 import org.ofbiz.base.util.UtilURL;
 import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.base.util.cache.UtilCache;
@@ -77,10 +77,10 @@
             
             if (resultObj != null && resultObj instanceof Map) {
                 Debug.logInfo("Got result Map from script return: " + resultObj, module);
-                return (Map<String, Object>) resultObj;
+                return cast(resultObj);
             } else if (context.get("result") != null && context.get("result") instanceof Map) {
                 Debug.logInfo("Got result Map from context: " + resultObj, module);
-                return (Map<String, Object>) context.get("result");
+                return cast(context.get("result"));
             }
         } catch (GeneralException e) {
             throw new GenericServiceException(e);

Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GroovyEngine.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GroovyEngine.java?rev=682059&r1=682058&r2=682059&view=diff
==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GroovyEngine.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/GroovyEngine.java Sat Aug  2 14:39:11 2008
@@ -22,6 +22,7 @@
 
 import org.ofbiz.base.util.GeneralException;
 import org.ofbiz.base.util.GroovyUtil;
+import static org.ofbiz.base.util.UtilGenerics.cast;
 import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.service.GenericServiceException;
 import org.ofbiz.service.ModelService;
@@ -62,9 +63,9 @@
             Object resultObj = GroovyUtil.runScriptAtLocation(location, context);
             
             if (resultObj != null && resultObj instanceof Map) {
-                return (Map<String, Object>) resultObj;
+                return cast(resultObj);
             } else if (context.get("result") != null && context.get("result") instanceof Map) {
-                return (Map<String, Object>) context.get("result");
+                return cast(context.get("result"));
             }
         } catch (GeneralException e) {
             throw new GenericServiceException(e);