diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-10-25 15:15:14 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-10-25 15:41:02 +0000 |
commit | 2f9bd9ac4dfe31ba58a660fd341be03648a8c9b7 (patch) | |
tree | 9acca58539b4741d60e598b8945efe062561f27f /scripting | |
parent | 1db8bc211fba3759769db6698bb73a74da742512 (diff) |
cid#1326721 to cid#1326726 Dm: Dubious method used
Change-Id: I5578dc3885945c013064cecf2ca86e7ca734368f
Diffstat (limited to 'scripting')
-rw-r--r-- | scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java index 7c28efb96e48..b77394d37d87 100644 --- a/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java +++ b/scripting/java/com/sun/star/script/framework/provider/javascript/ScriptEditorForJavaScript.java @@ -50,9 +50,9 @@ public class ScriptEditorForJavaScript implements ScriptEditor { private static Main rhinoWindow; private URL scriptURL; - // global list of ScriptEditors, key is URL of file being edited - private static Map<URL, ScriptEditorForJavaScript> BEING_EDITED = new - HashMap<URL, ScriptEditorForJavaScript>(); + // global list of ScriptEditors, key is [external form of URL] of file being edited + private static Map<String, ScriptEditorForJavaScript> BEING_EDITED = new + HashMap<String, ScriptEditorForJavaScript>(); static { try { @@ -98,7 +98,7 @@ public class ScriptEditorForJavaScript implements ScriptEditor { */ public static ScriptEditorForJavaScript getEditor(URL url) { synchronized (BEING_EDITED) { - return BEING_EDITED.get(url); + return BEING_EDITED.get(url.toExternalForm()); } } @@ -168,11 +168,11 @@ public class ScriptEditorForJavaScript implements ScriptEditor { new Runnable() { public void run() { synchronized (BEING_EDITED) { - ScriptEditorForJavaScript editor = BEING_EDITED.get(url); + ScriptEditorForJavaScript editor = BEING_EDITED.get(url.toExternalForm()); if (editor == null) { editor = new ScriptEditorForJavaScript(context, url); - BEING_EDITED.put(url, editor); + BEING_EDITED.put(url.toExternalForm(), editor); } } @@ -264,11 +264,11 @@ public class ScriptEditorForJavaScript implements ScriptEditor { // remove all scripts from BEING_EDITED synchronized (BEING_EDITED) { - java.util.Iterator<URL> iter = BEING_EDITED.keySet().iterator(); - java.util.ArrayList<URL> keysToRemove = new java.util.ArrayList<URL>(); + java.util.Iterator<String> iter = BEING_EDITED.keySet().iterator(); + java.util.ArrayList<String> keysToRemove = new java.util.ArrayList<String>(); while (iter.hasNext()) { - URL key = iter.next(); + String key = iter.next(); keysToRemove.add(key); } @@ -304,8 +304,8 @@ public class ScriptEditorForJavaScript implements ScriptEditor { public void run() { synchronized (BEING_EDITED) { - BEING_EDITED.remove(this.url); + BEING_EDITED.remove(this.url.toExternalForm()); } } } -}
\ No newline at end of file +} |