You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by wt...@apache.org on 2016/04/25 22:55:43 UTC

svn commit: r1740897 - /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/flow/FlowHandlerImpl.java

Author: wtlucy
Date: Mon Apr 25 20:55:43 2016
New Revision: 1740897

URL: http://svn.apache.org/viewvc?rev=1740897&view=rev
Log:
MYFACES-4044 Improve Ambiguous Flow ID Handling

Modified:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/flow/FlowHandlerImpl.java

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/flow/FlowHandlerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/flow/FlowHandlerImpl.java?rev=1740897&r1=1740896&r2=1740897&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/flow/FlowHandlerImpl.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/flow/FlowHandlerImpl.java Mon Apr 25 20:55:43 2016
@@ -128,8 +128,14 @@ public class FlowHandlerImpl extends Flo
         if (duplicateFlow != null)
         {
             // There are two flows with the same flowId.
+            // Raise an exception if flows share a duplicate ID and definingDocumentId
+            if (toAdd.getDefiningDocumentId().equals(duplicateFlow.getDefiningDocumentId()))
+            {
+                throw new IllegalArgumentException("There cannot be multiple flows with both the" 
+                                                   + " same ID and the same definingDocumentId");
+            }
             // Give priority to the flow with no defining document id
-            if ("".equals(toAdd.getDefiningDocumentId()))
+            else if ("".equals(toAdd.getDefiningDocumentId()))
             {
                 _flowMapById.put(id, toAdd);
             }