1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Use a synchronized map since it's updated with an ImmediateExecutor. Discussed with Pawel. No net behavioral change.

This commit is contained in:
John Cortell 2009-09-25 22:55:14 +00:00
parent a6a34af6c4
commit d1d38f73dc

View file

@ -11,6 +11,8 @@
package org.eclipse.cdt.dsf.debug.ui.viewmodel.numberformat; package org.eclipse.cdt.dsf.debug.ui.viewmodel.numberformat;
import com.ibm.icu.text.MessageFormat; import com.ibm.icu.text.MessageFormat;
import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map; import java.util.Map;
@ -140,8 +142,9 @@ public class FormattedValueVMUtil {
// First retrieve the available formats for each update's element (if // First retrieve the available formats for each update's element (if
// needed). Store the result in a map (for internal use) and in the // needed). Store the result in a map (for internal use) and in the
// update object (if requested). After that's done, call another method // update object (if requested). After that's done, call another method
// to retrieve the formatted values. // to retrieve the formatted values. Note that we use a synchronized map
final Map<IPropertiesUpdate, String[]> availableFormats = new HashMap<IPropertiesUpdate, String[]>(updates.length * 4/3); // because it's updated by a request monitor with an ImmediateExecutor.
final Map<IPropertiesUpdate, String[]> availableFormats = Collections.synchronizedMap(new HashMap<IPropertiesUpdate, String[]>(updates.length * 4/3));
final CountingRequestMonitor countingRm = new CountingRequestMonitor( final CountingRequestMonitor countingRm = new CountingRequestMonitor(
service.getExecutor(), service.getExecutor(),
new RequestMonitor(service.getExecutor(), monitor) { new RequestMonitor(service.getExecutor(), monitor) {