From 71e4d797fe6a3629f9e489b06e2566e139577bfd Mon Sep 17 00:00:00 2001 From: Artur Date: Thu, 13 Apr 2017 10:26:13 +0300 Subject: Notify a resource load listener many times if it has been added many times (#9075) This is what the javadoc promises and what DependencyLoader relies on --- client/src/main/java/com/vaadin/client/ResourceLoader.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'client/src') diff --git a/client/src/main/java/com/vaadin/client/ResourceLoader.java b/client/src/main/java/com/vaadin/client/ResourceLoader.java index c52e6f16d0..69cb11dc9f 100644 --- a/client/src/main/java/com/vaadin/client/ResourceLoader.java +++ b/client/src/main/java/com/vaadin/client/ResourceLoader.java @@ -16,6 +16,7 @@ package com.vaadin.client; +import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; @@ -401,12 +402,12 @@ public class ResourceLoader { if (rules === undefined) { rules = sheet.rules; } - + if (rules === null) { // Style sheet loaded, but can't access length because of XSS -> assume there's something there return 1; } - + // Return length so we can distinguish 0 (probably 404 error) from normal case. return rules.length; } catch (err) { @@ -423,7 +424,7 @@ public class ResourceLoader { Map> listenerMap) { Collection listeners = listenerMap.get(url); if (listeners == null) { - listeners = new HashSet<>(); + listeners = new ArrayList<>(); listeners.add(listener); listenerMap.put(url, listeners); return true; -- cgit v1.2.3