Author: rahul
Date: Fri Jun 15 15:21:12 2007
New Revision: 547816

URL: http://svn.apache.org/viewvc?view=rev&rev=547816
Log:
Inconsistency: State.getIsFinal and State.setIsFinal
SCXML-44

While its a pain to change method names, I agree the existing ones are bogus 
and I'd rather improve for v1.0.
 - Initiating deprecation cycle for older variants
 - Removing any internal usage of the now deprecated methods

Modified:
    
jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/Status.java
    
jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/io/SCXMLDigester.java
    
jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/io/SCXMLParser.java
    
jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/io/SCXMLSerializer.java
    
jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Final.java
    
jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/State.java
    
jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/semantics/SCXMLSemanticsImpl.java
    
jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/SCXMLExecutorTest.java
    
jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/StatusTest.java

Modified: 
jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/Status.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/Status.java?view=diff&rev=547816&r1=547815&r2=547816
==============================================================================
--- 
jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/Status.java
 (original)
+++ 
jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/Status.java
 Fri Jun 15 15:21:12 2007
@@ -58,7 +58,7 @@
         boolean rslt = true;
         for (Iterator i = states.iterator(); i.hasNext();) {
             State s = (State) i.next();
-            if (!s.getIsFinal()) {
+            if (!s.isFinal()) {
                 rslt = false;
                 break;
             }

Modified: 
jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/io/SCXMLDigester.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/io/SCXMLDigester.java?view=diff&rev=547816&r1=547815&r2=547816
==============================================================================
--- 
jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/io/SCXMLDigester.java
 (original)
+++ 
jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/io/SCXMLDigester.java
 Fri Jun 15 15:21:12 2007
@@ -952,7 +952,7 @@
             public void end(final String namespace, final String name) {
                 Transition t = (Transition) getDigester().peek(1);
                 State exitState = new State();
-                exitState.setIsFinal(true);
+                exitState.setFinal(true);
                 t.getTargets().add(exitState);
             }
         });

Modified: 
jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/io/SCXMLParser.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/io/SCXMLParser.java?view=diff&rev=547816&r1=547815&r2=547816
==============================================================================
--- 
jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/io/SCXMLParser.java
 (original)
+++ 
jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/io/SCXMLParser.java
 Fri Jun 15 15:21:12 2007
@@ -959,7 +959,7 @@
             public void end(final String namespace, final String name) {
                 Transition t = (Transition) getDigester().peek(1);
                 State exitState = new State();
-                exitState.setIsFinal(true);
+                exitState.setFinal(true);
                 t.getTargets().add(exitState);
             }
         });

Modified: 
jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/io/SCXMLSerializer.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/io/SCXMLSerializer.java?view=diff&rev=547816&r1=547815&r2=547816
==============================================================================
--- 
jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/io/SCXMLSerializer.java
 (original)
+++ 
jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/io/SCXMLSerializer.java
 Fri Jun 15 15:21:12 2007
@@ -125,7 +125,7 @@
             final State s, final String indent) {
         b.append(indent).append("<state");
         serializeTransitionTargetAttributes(b, s);
-        boolean f = s.getIsFinal();
+        boolean f = s.isFinal();
         if (f) {
             b.append(" final=\"true\"");
         }

Modified: 
jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Final.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Final.java?view=diff&rev=547816&r1=547815&r2=547816
==============================================================================
--- 
jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Final.java
 (original)
+++ 
jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/Final.java
 Fri Jun 15 15:21:12 2007
@@ -36,7 +36,7 @@
      */
     public Final() {
         super();
-        this.setIsFinal(true);
+        this.setFinal(true);
     }
 
 }

Modified: 
jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/State.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/State.java?view=diff&rev=547816&r1=547815&r2=547816
==============================================================================
--- 
jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/State.java
 (original)
+++ 
jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/model/State.java
 Fri Jun 15 15:21:12 2007
@@ -93,18 +93,39 @@
      * Is this state a &quot;final&quot; state.
      *
      * @return boolean Returns the isFinal.
+     * @deprecated Use [EMAIL PROTECTED] #isFinal()} instead
      */
     public final boolean getIsFinal() {
         return isFinal;
     }
 
     /**
+     * Is this state a &quot;final&quot; state.
+     *
+     * @return boolean Returns the isFinal.
+     */
+    public final boolean isFinal() {
+        return isFinal;
+    }
+
+    /**
      * Set whether this is a &quot;final&quot; state.
      *
      * @param isFinal
      *            The isFinal to set.
+     * @deprecated Use [EMAIL PROTECTED] #setFinal(boolean)} instead
      */
     public final void setIsFinal(final boolean isFinal) {
+        this.isFinal = isFinal;
+    }
+
+    /**
+     * Set whether this is a &quot;final&quot; state.
+     *
+     * @param isFinal
+     *            The isFinal to set.
+     */
+    public final void setFinal(final boolean isFinal) {
         this.isFinal = isFinal;
     }
 

Modified: 
jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/semantics/SCXMLSemanticsImpl.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/semantics/SCXMLSemanticsImpl.java?view=diff&rev=547816&r1=547815&r2=547816
==============================================================================
--- 
jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/semantics/SCXMLSemanticsImpl.java
 (original)
+++ 
jakarta/commons/proper/scxml/trunk/src/main/java/org/apache/commons/scxml/semantics/SCXMLSemanticsImpl.java
 Fri Jun 15 15:21:12 2007
@@ -244,7 +244,7 @@
             //3.2.1 and 3.4 (.done events)
             if (tt instanceof State) {
                 State ts = (State) tt;
-                if (ts.getIsFinal()) {
+                if (ts.isFinal()) {
                     State parent = (State) ts.getParent();
                     String prefix = "";
                     if (parent != null) {

Modified: 
jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/SCXMLExecutorTest.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/SCXMLExecutorTest.java?view=diff&rev=547816&r1=547815&r2=547816
==============================================================================
--- 
jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/SCXMLExecutorTest.java
 (original)
+++ 
jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/SCXMLExecutorTest.java
 Fri Jun 15 15:21:12 2007
@@ -273,6 +273,7 @@
             assertEquals(1, currentStates.size());
             assertEquals("ninety", ((State)currentStates.iterator().
                 next()).getId());
+            assertTrue(exec.getCurrentStatus().isFinal());
         } catch (Exception e) {
             fail(e.getMessage());
         }

Modified: 
jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/StatusTest.java
URL: 
http://svn.apache.org/viewvc/jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/StatusTest.java?view=diff&rev=547816&r1=547815&r2=547816
==============================================================================
--- 
jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/StatusTest.java
 (original)
+++ 
jakarta/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/StatusTest.java
 Fri Jun 15 15:21:12 2007
@@ -47,7 +47,7 @@
     
     public void testIsFinalStateFalse() {
         State state = new State();
-        state.setIsFinal(false);
+        state.setFinal(false);
         
         status.getStates().add(state);
         
@@ -56,7 +56,7 @@
     
     public void testIsFinalStateHasParent() {
         State state = new State();
-        state.setIsFinal(true);
+        state.setFinal(true);
         state.setParent(new State());
         
         status.getStates().add(state);
@@ -66,7 +66,7 @@
     
     public void testIsFinalStateHasEvent() {
         State state = new State();
-        state.setIsFinal(true);
+        state.setFinal(true);
         
         status.getStates().add(state);
         status.getEvents().add(new TriggerEvent("name", 
TriggerEvent.CALL_EVENT));
@@ -76,7 +76,7 @@
     
     public void testIsFinalState() {
         State state = new State();
-        state.setIsFinal(true);
+        state.setFinal(true);
         
         status.getStates().add(state);
         



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to