You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2020/07/06 08:27:15 UTC

[wicket] branch wicket-7.x updated: WICKET-6800 AjaxRequestHandler: Keep listeners in a LinkedHashSet instead of LinkedList for performance reason (#438)

This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a commit to branch wicket-7.x
in repository https://gitbox.apache.org/repos/asf/wicket.git


The following commit(s) were added to refs/heads/wicket-7.x by this push:
     new 48c2034  WICKET-6800 AjaxRequestHandler: Keep listeners in a LinkedHashSet instead of LinkedList for performance reason (#438)
48c2034 is described below

commit 48c203445da84860422a8b5b5c99bbe495c9a201
Author: Urs Joss <ur...@gmx.ch>
AuthorDate: Mon Jul 6 10:25:55 2020 +0200

    WICKET-6800 AjaxRequestHandler: Keep listeners in a LinkedHashSet instead of LinkedList for performance reason (#438)
    
    (cherry picked from commit 5c63eb59510d954f52150f069690a528849cd803)
---
 .../src/main/java/org/apache/wicket/ajax/AjaxRequestHandler.java  | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxRequestHandler.java b/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxRequestHandler.java
index 18cdf05..c0aa40b 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxRequestHandler.java
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/AjaxRequestHandler.java
@@ -19,7 +19,7 @@ package org.apache.wicket.ajax;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
-import java.util.LinkedList;
+import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -88,8 +88,8 @@ public class AjaxRequestHandler implements AjaxRequestTarget
 	 */
 	private final PartialPageUpdate update;
 
-	/** a list of listeners */
-	private List<AjaxRequestTarget.IListener> listeners = null;
+	/** a set of listeners */
+	private Set<AjaxRequestTarget.IListener> listeners = null;
 
 	/** */
 	private final Set<ITargetRespondListener> respondListeners = new HashSet<>();
@@ -190,7 +190,7 @@ public class AjaxRequestHandler implements AjaxRequestTarget
 
 		if (listeners == null)
 		{
-			listeners = new LinkedList<>();
+			listeners = new LinkedHashSet<>();
 		}
 
 		if (!listeners.contains(listener))