diff --git a/AceGWT/src/edu/ycp/cs/dh/acegwt/client/ace/AceEditor.java b/AceGWT/src/edu/ycp/cs/dh/acegwt/client/ace/AceEditor.java index eff93a9..f9a282e 100644 --- a/AceGWT/src/edu/ycp/cs/dh/acegwt/client/ace/AceEditor.java +++ b/AceGWT/src/edu/ycp/cs/dh/acegwt/client/ace/AceEditor.java @@ -20,9 +20,6 @@ package edu.ycp.cs.dh.acegwt.client.ace; -import java.util.HashMap; -import java.util.List; - import com.google.gwt.core.client.JavaScriptObject; import com.google.gwt.core.client.JsArray; import com.google.gwt.dom.client.Element; @@ -32,6 +29,11 @@ import com.google.gwt.user.client.ui.HasText; import com.google.gwt.user.client.ui.RequiresResize; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + /** * A GWT widget for the Ajax.org Code Editor (ACE). * @@ -702,17 +704,18 @@ public native void removeMarker(int markerId) /*-{ /** * Gets all the displayed markers. - * @return A Mapping between markerID and the displayed range. + * @return An unmodifiable Mapping between markerID and the displayed range. */ - public HashMap getMarkers() { - return this.markers; + public Map getMarkers() { + return Collections.unmodifiableMap(this.markers); } /** * Remove all the displayed markers. */ public void removeAllMarkers() { - for (Integer id : this.markers.keySet()) { + Integer[] ids = this.markers.keySet().toArray(new Integer[this.markers.size()]); + for (Integer id : ids) { removeMarker(id); } }