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:26:53 UTC

[wicket] branch wicket-8.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-8.x
in repository https://gitbox.apache.org/repos/asf/wicket.git


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

commit 1b41c78dd7c7dd9eb153ec408f56d9029416fed2
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 1dad048..72dbd6d 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;
@@ -87,8 +87,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<>();
@@ -191,7 +191,7 @@ public class AjaxRequestHandler implements AjaxRequestTarget
 
 		if (listeners == null)
 		{
-			listeners = new LinkedList<>();
+			listeners = new LinkedHashSet<>();
 		}
 
 		if (!listeners.contains(listener))