From d32457111229d3c7871d47da3bfcdc69d68b7beb Mon Sep 17 00:00:00 2001 From: John Cortell Date: Mon, 28 Sep 2009 20:23:46 +0000 Subject: [PATCH] [290607] Additional fix to avoid providing properties not requested. --- .../numberformat/FormattedValueVMUtil.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/FormattedValueVMUtil.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/FormattedValueVMUtil.java index d97e3e0f720..7713126c9e0 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/FormattedValueVMUtil.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/numberformat/FormattedValueVMUtil.java @@ -266,16 +266,16 @@ public class FormattedValueVMUtil { // PROP_FORMATTED_VALUE_ACTIVE_FORMAT_VALUE, and the active format // has not been explicitly requested, then we need an additional // iteration to provide it. - boolean activeFormatRequested = false; // does the update object ask for PROP_FORMATTED_VALUE_ACTIVE_FORMAT_VALUE? - boolean activeFormatHandled = false; // have we come across a specific format request that is the active format? - for (Iterator itr = update.getProperties().iterator(); itr.hasNext() || (activeFormatRequested && !activeFormatHandled);) { + boolean activeFormatValueRequested = false; // does the update object ask for PROP_FORMATTED_VALUE_ACTIVE_FORMAT_VALUE? + boolean activeFormatValueHandled = false; // have we come across a specific format request that is the active format? + for (Iterator itr = update.getProperties().iterator(); itr.hasNext() || (activeFormatValueRequested && !activeFormatValueHandled);) { String nextFormat; if (itr.hasNext()) { String propertyName = itr.next(); if (propertyName.startsWith(IDebugVMConstants.PROP_FORMATTED_VALUE_BASE)) { nextFormat = FormattedValueVMUtil.getFormatFromProperty(propertyName); if (nextFormat.equals(activeFormat)) { - activeFormatHandled = true; + activeFormatValueHandled = true; } // if we know the supported formats (we may not), then no-op if this format is unsupported if (availableFormats != null && !isFormatAvailable(nextFormat, availableFormats)) { @@ -284,7 +284,7 @@ public class FormattedValueVMUtil { } else if (propertyName.equals(IDebugVMConstants.PROP_FORMATTED_VALUE_ACTIVE_FORMAT_VALUE)) { assert activeFormat != null : "Our caller should have provided the available formats if this property was specified; given available formats, an 'active' nomination is guaranteed."; //$NON-NLS-1$ - activeFormatRequested = true; + activeFormatValueRequested = true; continue; // we may end up making an additional run } else { @@ -293,9 +293,10 @@ public class FormattedValueVMUtil { } else { // the additional iteration to handle the active format nextFormat = activeFormat; - activeFormatHandled = true; + activeFormatValueHandled = true; } + final boolean _activeFormatValueRequested = activeFormatValueRequested; final FormattedValueDMContext formattedValueDmc = service.getFormattedValueContext(dmc, nextFormat); service.getFormattedExpressionValue( formattedValueDmc, @@ -309,7 +310,7 @@ public class FormattedValueVMUtil { update.setProperty( FormattedValueVMUtil.getPropertyForFormatId(format), getData().getFormattedValue()); - if (format.equals(activeFormat)) { + if (_activeFormatValueRequested && format.equals(activeFormat)) { update.setProperty( IDebugVMConstants.PROP_FORMATTED_VALUE_ACTIVE_FORMAT_VALUE, getData().getFormattedValue());