commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ra...@apache.org
Subject svn commit: r612301 - /commons/proper/scxml/branches/J5/src/main/java/org/apache/commons/scxml/model/State.java
Date Tue, 15 Jan 2008 23:14:06 GMT
Author: rahul
Date: Tue Jan 15 15:14:02 2008
New Revision: 612301

URL: http://svn.apache.org/viewvc?rev=612301&view=rev
Log:
Use for-each to reduce clutter.

Modified:
    commons/proper/scxml/branches/J5/src/main/java/org/apache/commons/scxml/model/State.java

Modified: commons/proper/scxml/branches/J5/src/main/java/org/apache/commons/scxml/model/State.java
URL: http://svn.apache.org/viewvc/commons/proper/scxml/branches/J5/src/main/java/org/apache/commons/scxml/model/State.java?rev=612301&r1=612300&r2=612301&view=diff
==============================================================================
--- commons/proper/scxml/branches/J5/src/main/java/org/apache/commons/scxml/model/State.java
(original)
+++ commons/proper/scxml/branches/J5/src/main/java/org/apache/commons/scxml/model/State.java
Tue Jan 15 15:14:02 2008
@@ -207,8 +207,7 @@
      */
     public final Map<String, List<Transition>> getTransitions() {
         Map<String, List<Transition>> transitionsMap = new HashMap<String,
List<Transition>>();
-        for (int i = 0; i < transitions.size(); i++) {
-            Transition transition = transitions.get(i);
+        for (Transition transition : transitions) {
             String event = transition.getEvent();
             if (!transitionsMap.containsKey(event)) {
                 List<Transition> eventTransitions = new ArrayList<Transition>();
@@ -230,8 +229,7 @@
      */
     public final List<Transition> getTransitionsList(final String event) {
         List<Transition> matchingTransitions = null; // since we returned null upto
v0.6
-        for (int i = 0; i < transitions.size(); i++) {
-            Transition t = transitions.get(i);
+        for (Transition t : transitions) {
             if ((event == null && t.getEvent() == null)
                     || (event != null && event.equals(t.getEvent()))) {
                 if (matchingTransitions == null) {



Mime
View raw message