You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by GitBox <gi...@apache.org> on 2018/06/13 14:57:57 UTC

[GitHub] pnicolucci closed pull request #7: MYFACES-4237: improve performance when checking for duplicate ids

pnicolucci closed pull request #7: MYFACES-4237: improve performance when checking for duplicate ids
URL: https://github.com/apache/myfaces/pull/7
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/CheckDuplicateIdFaceletUtils.java b/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/CheckDuplicateIdFaceletUtils.java
index f0dd9c4c7..0543196f3 100644
--- a/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/CheckDuplicateIdFaceletUtils.java
+++ b/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/CheckDuplicateIdFaceletUtils.java
@@ -55,14 +55,12 @@ private static void checkIdsStatefulComponents (FacesContext context,
         
         id = component.getClientId (context);
         
-        if (existingIds.contains (id))
+        if (!existingIds.add (id))
         {
             DuplicateIdException duplicateIdException = createAndQueueException(context, component, id);
             throw duplicateIdException;
         }
         
-        existingIds.add (id);
-        
         int facetCount = component.getFacetCount();
         if (facetCount > 0)
         {
@@ -102,14 +100,12 @@ private static void checkIds (FacesContext context, UIComponent component, Set<S
         
         id = component.getClientId (context);
         
-        if (existingIds.contains (id))
+        if (!existingIds.add (id))
         {
             DuplicateIdException duplicateIdException = createAndQueueException(context, component, id);
             throw duplicateIdException;
         }
         
-        existingIds.add (id);
-        
         int facetCount = component.getFacetCount();
         if (facetCount > 0)
         {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services