Mercurial > hg > release > icedtea-web-1.8
changeset 1266:26be3170e944
Fixed download service
* netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (fillInPartJars) for-each loop replaced by indexed loop to prevent ConcurrentModificationException
* tests/reproducers/signed/DownloadService/testcases/DownloadServiceTest.java: small refactoring in favour of diamond operator
author | Jiri Vanek <jvanek@redhat.com> |
---|---|
date | Mon, 20 Jul 2015 12:59:57 +0200 |
parents | 90be136f00b7 |
children | 44f4568a01aa |
files | ChangeLog NEWS netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java tests/reproducers/signed/DownloadService/testcases/DownloadServiceTest.java |
diffstat | 4 files changed, 16 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Thu Jul 16 12:03:45 2015 +0200 +++ b/ChangeLog Mon Jul 20 12:59:57 2015 +0200 @@ -1,3 +1,11 @@ +2015-07-20 Jiri Vanek <jvanek@redhat.com> + + Fixed download service + * /netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: (fillInPartJars) + for-each loop replaced by indexed loop to prevent ConcurrentModificationException + * tests/reproducers/signed/DownloadService/testcases/DownloadServiceTest.java: + small refactoring in favour of diamond operator + 2015-07-16 Jiri Vanek <jvanek@redhat.com> Fixing various reproducers
--- a/NEWS Thu Jul 16 12:03:45 2015 +0200 +++ b/NEWS Mon Jul 20 12:59:57 2015 +0200 @@ -9,6 +9,7 @@ CVE-XXXX-YYYY: http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=XXXX-YYYY New in release 1.7 (2015-XX-XX): +* fixed DownloadService * comments in deployment.properties now should persists load/save * fixed bug in caching of files with query * fixed issues with recreating of existing shortcut
--- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Thu Jul 16 12:03:45 2015 +0200 +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Mon Jul 20 12:59:57 2015 +0200 @@ -1204,8 +1204,9 @@ * @param jars jar archives to be added */ protected void fillInPartJars(List<JARDesc> jars) { - for (JARDesc desc : jars) { - String part = desc.getPart(); + //can not use iterator, will rise ConcurrentModificationException on jars.add(jar); + for (int x = 0 ; x< jars.size() ; x++) { + String part = jars.get(x).getPart(); // "available" field can be affected by two different threads // working in loadClass(String)
--- a/tests/reproducers/signed/DownloadService/testcases/DownloadServiceTest.java Thu Jul 16 12:03:45 2015 +0200 +++ b/tests/reproducers/signed/DownloadService/testcases/DownloadServiceTest.java Mon Jul 20 12:59:57 2015 +0200 @@ -48,11 +48,11 @@ import org.junit.Test; public class DownloadServiceTest { - private static ServerAccess server = new ServerAccess(); + private static final ServerAccess server = new ServerAccess(); private final String exitString = "Exiting DownloadService.."; - private static List<String> checkCache = new ArrayList<String>(); - private static List<String> manageJnlpResources = new ArrayList<String>(); - private static List<String> manageExternalResources = new ArrayList<String>(); + private static final List<String> checkCache = new ArrayList<>(); + private static final List<String> manageJnlpResources = new ArrayList<>(); + private static final List<String> manageExternalResources = new ArrayList<>(); @BeforeClass public static void initalizeClass() throws MalformedURLException {