diff options
author | Denis Lila <[email protected]> | 2011-04-05 12:39:14 -0400 |
---|---|---|
committer | Denis Lila <[email protected]> | 2011-04-05 12:39:14 -0400 |
commit | b5b1409c7ab8d77a1f73409d5b3d7a0eacb598af (patch) | |
tree | 631280247922e4e5c1b5b57576f4b35af3891900 | |
parent | 8c55999a5dd8968ba23a783b3bcdd904ab6a6460 (diff) |
Fix concurrent access problem to downloadOptions.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | netx/net/sourceforge/jnlp/cache/ResourceTracker.java | 7 |
2 files changed, 9 insertions, 4 deletions
@@ -1,5 +1,11 @@ 2011-04-05 Denis Lila <[email protected]> + * netx/net/sourceforge/jnlp/cache/ResourceTracker.java: + Remove unused imports, add import. + (downloadOptions): Make ConcurrentHashMap. + +2011-04-05 Denis Lila <[email protected]> + * plugin/icedteanp/IcedTeaNPPlugin.cc (plugin_start_appletviewer): Replace hardcoded indices with a variable; roll up free calls in a loop; fix whitespace; diff --git a/netx/net/sourceforge/jnlp/cache/ResourceTracker.java b/netx/net/sourceforge/jnlp/cache/ResourceTracker.java index 4ef0e0d..c42cc99 100644 --- a/netx/net/sourceforge/jnlp/cache/ResourceTracker.java +++ b/netx/net/sourceforge/jnlp/cache/ResourceTracker.java @@ -29,9 +29,8 @@ import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import java.util.jar.JarOutputStream; import java.util.jar.Pack200; import java.util.jar.Pack200.Unpacker; @@ -120,8 +119,8 @@ public class ResourceTracker { /** resources requested to be downloaded */ private static ArrayList<Resource> queue = new ArrayList<Resource>(); - private static Map<Resource, DownloadOptions> downloadOptions = - new HashMap<Resource, DownloadOptions>(); + private static ConcurrentHashMap<Resource, DownloadOptions> downloadOptions = + new ConcurrentHashMap<Resource, DownloadOptions>(); /** resource trackers threads are working for (used for load balancing across multi-tracker downloads) */ private static ArrayList<ResourceTracker> active = |