commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ra...@apache.org
Subject svn commit: r651770 - in /commons/proper/scxml/branches/J6/src/main/java/org/apache/commons/scxml: SCInstance.java SCXMLExecutor.java
Date Sat, 26 Apr 2008 01:26:19 GMT
Author: rahul
Date: Fri Apr 25 18:26:17 2008
New Revision: 651770

URL: http://svn.apache.org/viewvc?rev=651770&view=rev
Log:
Type safety improvements.

Modified:
    commons/proper/scxml/branches/J6/src/main/java/org/apache/commons/scxml/SCInstance.java
    commons/proper/scxml/branches/J6/src/main/java/org/apache/commons/scxml/SCXMLExecutor.java

Modified: commons/proper/scxml/branches/J6/src/main/java/org/apache/commons/scxml/SCInstance.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/branches/J6/src/main/java/org/apache/commons/scxml/SCInstance.java?rev=651770&r1=651769&r2=651770&view=diff
==============================================================================
--- commons/proper/scxml/branches/J6/src/main/java/org/apache/commons/scxml/SCInstance.java
(original)
+++ commons/proper/scxml/branches/J6/src/main/java/org/apache/commons/scxml/SCInstance.java
Fri Apr 25 18:26:17 2008
@@ -68,7 +68,7 @@
      * The <code>Invoker</code> classes <code>Map</code>, keyed by
      * &lt;invoke&gt; target types (specified using "targettype" attribute).
      */
-    private final Map<String, Class> invokerClasses;
+    private final Map<String, Class<? extends Invoker>> invokerClasses;
 
     /**
      * The <code>Map</code> of active <code>Invoker</code>s, keyed
by
@@ -100,7 +100,7 @@
         this.notificationRegistry = new NotificationRegistry();
         this.contexts = Collections.synchronizedMap(new HashMap<TransitionTarget, Context>());
         this.histories = Collections.synchronizedMap(new HashMap<History, Set<TransitionTarget>>());
-        this.invokerClasses = Collections.synchronizedMap(new HashMap<String, Class>());
+        this.invokerClasses = Collections.synchronizedMap(new HashMap<String, Class<?
extends Invoker>>());
         this.invokers = Collections.synchronizedMap(new HashMap<TransitionTarget, Invoker>());
         this.completions = Collections.synchronizedMap(new HashMap<TransitionTarget, Boolean>());
         this.evaluator = null;
@@ -284,7 +284,7 @@
      * @param invokerClass The <code>Invoker</code> <code>Class</code>.
      */
     void registerInvokerClass(final String targettype,
-            final Class invokerClass) {
+            final Class<? extends Invoker> invokerClass) {
         invokerClasses.put(targettype, invokerClass);
     }
 
@@ -314,14 +314,14 @@
      */
     public Invoker newInvoker(final String targettype)
     throws InvokerException {
-        Class invokerClass = invokerClasses.get(targettype);
+        Class<? extends Invoker> invokerClass = invokerClasses.get(targettype);
         if (invokerClass == null) {
             throw new InvokerException("No Invoker registered for "
                 + "targettype \"" + targettype + "\"");
         }
         Invoker invoker = null;
         try {
-            invoker = (Invoker) invokerClass.newInstance();
+            invoker = invokerClass.newInstance();
         } catch (InstantiationException ie) {
             throw new InvokerException(ie.getMessage(), ie.getCause());
         } catch (IllegalAccessException iae) {

Modified: commons/proper/scxml/branches/J6/src/main/java/org/apache/commons/scxml/SCXMLExecutor.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/branches/J6/src/main/java/org/apache/commons/scxml/SCXMLExecutor.java?rev=651770&r1=651769&r2=651770&view=diff
==============================================================================
--- commons/proper/scxml/branches/J6/src/main/java/org/apache/commons/scxml/SCXMLExecutor.java
(original)
+++ commons/proper/scxml/branches/J6/src/main/java/org/apache/commons/scxml/SCXMLExecutor.java
Fri Apr 25 18:26:17 2008
@@ -25,6 +25,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.commons.scxml.invoke.Invoker;
 import org.apache.commons.scxml.model.Datamodel;
 import org.apache.commons.scxml.model.History;
 import org.apache.commons.scxml.model.ModelException;
@@ -433,7 +434,7 @@
      * @param invokerClass The <code>Invoker</code> <code>Class</code>.
      */
     public void registerInvokerClass(final String targettype,
-            final Class invokerClass) {
+            final Class<? extends Invoker> invokerClass) {
         scInstance.registerInvokerClass(targettype, invokerClass);
     }
 



Mime
View raw message