From 201c5b03c7be6e073ba26671f3893ca96c10643e Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Mon, 6 Aug 2007 18:50:57 +0000 Subject: [PATCH] Another patch from Elias: avoid CME when setting pass-through properties. --- src/java/com/threerings/getdown/data/Application.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/getdown/data/Application.java b/src/java/com/threerings/getdown/data/Application.java index 704d94d..f56b8af 100644 --- a/src/java/com/threerings/getdown/data/Application.java +++ b/src/java/com/threerings/getdown/data/Application.java @@ -780,13 +780,18 @@ public class Application } // pass along any pass-through arguments + Map passProps = new HashMap(); for (Map.Entry entry : System.getProperties().entrySet()) { String key = (String)entry.getKey(); if (key.startsWith(PROP_PASSTHROUGH_PREFIX)) { key = key.substring(PROP_PASSTHROUGH_PREFIX.length()); - System.setProperty(key, (String)entry.getValue()); + passProps.put(key, (String)entry.getValue()); } } + // we can't set these in the above loop lest we get a ConcurrentModificationException + for (Map.Entry entry : passProps.entrySet()) { + System.setProperty(entry.getKey(), entry.getValue()); + } // make a note that we're running in "applet" mode System.setProperty("applet", "true");