groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwagenleit...@apache.org
Subject [4/4] groovy git commit: minor refactor: remove use of raw types
Date Sun, 07 Aug 2016 02:59:28 GMT
minor refactor: remove use of raw types


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/ef86c2c4
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/ef86c2c4
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/ef86c2c4

Branch: refs/heads/master
Commit: ef86c2c4db4e3d6fb82be3fad1177f9d0364093f
Parents: 6b7c908
Author: John Wagenleitner <jwagenleitner@apache.org>
Authored: Sat Aug 6 19:53:17 2016 -0700
Committer: John Wagenleitner <jwagenleitner@apache.org>
Committed: Sat Aug 6 19:53:17 2016 -0700

----------------------------------------------------------------------
 .../groovy/jsr223/GroovyCompiledScript.java       |  4 ++--
 .../groovy/jsr223/GroovyScriptEngineImpl.java     | 18 +++++++++---------
 .../codehaus/groovy/jsr223/ScriptExtensions.java  |  4 ++--
 3 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/ef86c2c4/subprojects/groovy-jsr223/src/main/java/org/codehaus/groovy/jsr223/GroovyCompiledScript.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-jsr223/src/main/java/org/codehaus/groovy/jsr223/GroovyCompiledScript.java
b/subprojects/groovy-jsr223/src/main/java/org/codehaus/groovy/jsr223/GroovyCompiledScript.java
index e7bb44c..4962aa5 100644
--- a/subprojects/groovy-jsr223/src/main/java/org/codehaus/groovy/jsr223/GroovyCompiledScript.java
+++ b/subprojects/groovy-jsr223/src/main/java/org/codehaus/groovy/jsr223/GroovyCompiledScript.java
@@ -61,9 +61,9 @@ import javax.script.ScriptException;
 public class GroovyCompiledScript extends CompiledScript {
 
     private final GroovyScriptEngineImpl engine;
-    private final Class clasz;
+    private final Class<?> clasz;
 
-    public GroovyCompiledScript(GroovyScriptEngineImpl engine, Class clazz) {
+    public GroovyCompiledScript(GroovyScriptEngineImpl engine, Class<?> clazz) {
         this.engine = engine;
         this.clasz = clazz;
     }

http://git-wip-us.apache.org/repos/asf/groovy/blob/ef86c2c4/subprojects/groovy-jsr223/src/main/java/org/codehaus/groovy/jsr223/GroovyScriptEngineImpl.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-jsr223/src/main/java/org/codehaus/groovy/jsr223/GroovyScriptEngineImpl.java
b/subprojects/groovy-jsr223/src/main/java/org/codehaus/groovy/jsr223/GroovyScriptEngineImpl.java
index 406668a..8fe62a5 100644
--- a/subprojects/groovy-jsr223/src/main/java/org/codehaus/groovy/jsr223/GroovyScriptEngineImpl.java
+++ b/subprojects/groovy-jsr223/src/main/java/org/codehaus/groovy/jsr223/GroovyScriptEngineImpl.java
@@ -97,10 +97,10 @@ public class GroovyScriptEngineImpl extends AbstractScriptEngine implements
Comp
     private static boolean debug = false;
 
     // script-string-to-generated Class map
-    private final ManagedConcurrentValueMap<String, Class> classMap = new ManagedConcurrentValueMap<String,
Class>(ReferenceBundle.getSoftBundle());
+    private final ManagedConcurrentValueMap<String, Class<?>> classMap = new
ManagedConcurrentValueMap<String, Class<?>>(ReferenceBundle.getSoftBundle());
     // global closures map - this is used to simulate a single
     // global functions namespace 
-    private final ManagedConcurrentValueMap<String, Closure> globalClosures = new ManagedConcurrentValueMap<String,
Closure>(ReferenceBundle.getHardBundle());
+    private final ManagedConcurrentValueMap<String, Closure<?>> globalClosures
= new ManagedConcurrentValueMap<String, Closure<?>>(ReferenceBundle.getHardBundle());
     // class loader for Groovy generated classes
     private GroovyClassLoader loader;
     // lazily initialized factory
@@ -150,7 +150,7 @@ public class GroovyScriptEngineImpl extends AbstractScriptEngine implements
Comp
         } catch (ClassCastException cce) { /*ignore.*/ }
 
         try {
-            Class clazz = getScriptClass(script);
+            Class<?> clazz = getScriptClass(script);
             if (clazz == null) throw new ScriptException("Script class is null");
             return eval(clazz, ctx);
         } catch (Exception e) {
@@ -214,7 +214,7 @@ public class GroovyScriptEngineImpl extends AbstractScriptEngine implements
Comp
     }
 
     // package-privates
-    Object eval(Class scriptClass, final ScriptContext ctx) throws ScriptException {
+    Object eval(Class<?> scriptClass, final ScriptContext ctx) throws ScriptException
{
         /*
          * We use the following Binding instance so that global variable lookup
          * will be done in the current ScriptContext instance.
@@ -321,9 +321,9 @@ public class GroovyScriptEngineImpl extends AbstractScriptEngine implements
Comp
         }
     }
 
-    Class getScriptClass(String script)
+    Class<?> getScriptClass(String script)
             throws CompilationFailedException {
-        Class clazz = classMap.get(script);
+        Class<?> clazz = classMap.get(script);
         if (clazz != null) {
             return clazz;
         }
@@ -369,7 +369,7 @@ public class GroovyScriptEngineImpl extends AbstractScriptEngine implements
Comp
     }
 
     private Object callGlobal(String name, Object[] args, ScriptContext ctx) {
-        Closure closure = globalClosures.get(name);
+        Closure<?> closure = globalClosures.get(name);
         if (closure != null) {
             return closure.call(args);
         } else {
@@ -396,7 +396,7 @@ public class GroovyScriptEngineImpl extends AbstractScriptEngine implements
Comp
         }
         return (T) Proxy.newProxyInstance(
                 clazz.getClassLoader(),
-                new Class[]{clazz},
+                new Class<?>[]{clazz},
                 new InvocationHandler() {
                     public Object invoke(Object proxy, Method m, Object[] args)
                             throws Throwable {
@@ -411,7 +411,7 @@ public class GroovyScriptEngineImpl extends AbstractScriptEngine implements
Comp
         // check whether thread context loader can "see" Groovy Script class
         ClassLoader ctxtLoader = Thread.currentThread().getContextClassLoader();
         try {
-            Class c = ctxtLoader.loadClass(Script.class.getName());
+            Class<?> c = ctxtLoader.loadClass(Script.class.getName());
             if (c == Script.class) {
                 return ctxtLoader;
             }

http://git-wip-us.apache.org/repos/asf/groovy/blob/ef86c2c4/subprojects/groovy-jsr223/src/main/java/org/codehaus/groovy/jsr223/ScriptExtensions.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-jsr223/src/main/java/org/codehaus/groovy/jsr223/ScriptExtensions.java
b/subprojects/groovy-jsr223/src/main/java/org/codehaus/groovy/jsr223/ScriptExtensions.java
index 9181804..e591664 100644
--- a/subprojects/groovy-jsr223/src/main/java/org/codehaus/groovy/jsr223/ScriptExtensions.java
+++ b/subprojects/groovy-jsr223/src/main/java/org/codehaus/groovy/jsr223/ScriptExtensions.java
@@ -84,8 +84,8 @@ public class ScriptExtensions {
 
     @SuppressWarnings("unchecked")
     private static void storeBindingVars(ScriptEngine self, Binding binding) {
-        Set<Map.Entry> vars = binding.getVariables().entrySet();
-        for (Map.Entry me : vars) {
+        Set<Map.Entry<?, ?>> vars = binding.getVariables().entrySet();
+        for (Map.Entry<?, ?> me : vars) {
             self.put(me.getKey().toString(), me.getValue());
         }
     }


Mime
View raw message