diff options
author | Artur <artur@vaadin.com> | 2017-04-13 10:26:13 +0300 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-04-13 10:26:13 +0300 |
commit | 71e4d797fe6a3629f9e489b06e2566e139577bfd (patch) | |
tree | b72de5971ca0502303d11a9cb74d348916b2f818 /client/src | |
parent | 4454e6bdc13dec8198c9e5e95557fcf59f9f97e4 (diff) | |
download | vaadin-framework-71e4d797fe6a3629f9e489b06e2566e139577bfd.tar.gz vaadin-framework-71e4d797fe6a3629f9e489b06e2566e139577bfd.zip |
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
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/main/java/com/vaadin/client/ResourceLoader.java | 7 |
1 files changed, 4 insertions, 3 deletions
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<String, Collection<ResourceLoadListener>> listenerMap) { Collection<ResourceLoadListener> listeners = listenerMap.get(url); if (listeners == null) { - listeners = new HashSet<>(); + listeners = new ArrayList<>(); listeners.add(listener); listenerMap.put(url, listeners); return true; |