mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 06:32:10 +02:00
Bug 328883 - AbstractCachingVMProvider throws ClassCastException
This commit is contained in:
parent
c0f40ceb47
commit
4dea12d98e
3 changed files with 7 additions and 8 deletions
|
@ -560,11 +560,11 @@ public class FormattedValueRetriever {
|
||||||
if (update.getProperties().contains(PROP_ACTIVE_FORMAT_VALUE) &&
|
if (update.getProperties().contains(PROP_ACTIVE_FORMAT_VALUE) &&
|
||||||
format.equals(activeFormat))
|
format.equals(activeFormat))
|
||||||
{
|
{
|
||||||
PropertiesUpdateStatus.getPropertiesStatus(update).setStatus(
|
PropertiesUpdateStatus.makePropertiesStatus(update.getStatus()).setStatus(
|
||||||
new String[] { PROP_ACTIVE_FORMAT_VALUE, formatProperty },
|
new String[] { PROP_ACTIVE_FORMAT_VALUE, formatProperty },
|
||||||
staleDataStatus);
|
staleDataStatus);
|
||||||
} else {
|
} else {
|
||||||
PropertiesUpdateStatus.getPropertiesStatus(update).setStatus(formatProperty, staleDataStatus);
|
PropertiesUpdateStatus.makePropertiesStatus(update.getStatus()).setStatus(formatProperty, staleDataStatus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -203,8 +203,7 @@ public class PropertiesUpdateStatus extends DsfMultiStatus {
|
||||||
* Convenience method that returns and optionally creates a properties
|
* Convenience method that returns and optionally creates a properties
|
||||||
* update status object for the given update.
|
* update status object for the given update.
|
||||||
*/
|
*/
|
||||||
public static PropertiesUpdateStatus getPropertiesStatus(IPropertiesUpdate update) {
|
public static PropertiesUpdateStatus makePropertiesStatus(IStatus updateStatus) {
|
||||||
IStatus updateStatus = update.getStatus();
|
|
||||||
if (updateStatus instanceof PropertiesUpdateStatus) {
|
if (updateStatus instanceof PropertiesUpdateStatus) {
|
||||||
return (PropertiesUpdateStatus)updateStatus;
|
return (PropertiesUpdateStatus)updateStatus;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1177,13 +1177,13 @@ public class AbstractCachingVMProvider extends AbstractVMProvider
|
||||||
String missingProperty = itr.next();
|
String missingProperty = itr.next();
|
||||||
if ( !updatePolicyExt.canUpdateDirtyProperty(entry, missingProperty) ) {
|
if ( !updatePolicyExt.canUpdateDirtyProperty(entry, missingProperty) ) {
|
||||||
itr.remove();
|
itr.remove();
|
||||||
PropertiesUpdateStatus.getPropertiesStatus(update).setStatus(
|
PropertiesUpdateStatus.makePropertiesStatus(update.getStatus()).setStatus(
|
||||||
missingProperty,
|
missingProperty,
|
||||||
DsfUIPlugin.newErrorStatus(IDsfStatusConstants.INVALID_STATE, "Cache contains stale data. Refresh view.", null ));//$NON-NLS-1$
|
DsfUIPlugin.newErrorStatus(IDsfStatusConstants.INVALID_STATE, "Cache contains stale data. Refresh view.", null ));//$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
PropertiesUpdateStatus.getPropertiesStatus(update).setStatus(
|
PropertiesUpdateStatus.makePropertiesStatus(update.getStatus()).setStatus(
|
||||||
missingProperties.toArray(new String[missingProperties.size()]),
|
missingProperties.toArray(new String[missingProperties.size()]),
|
||||||
DsfUIPlugin.newErrorStatus(IDsfStatusConstants.INVALID_STATE, "Cache contains stale data. Refresh view.", null ));//$NON-NLS-1$
|
DsfUIPlugin.newErrorStatus(IDsfStatusConstants.INVALID_STATE, "Cache contains stale data. Refresh view.", null ));//$NON-NLS-1$
|
||||||
missingProperties.clear();
|
missingProperties.clear();
|
||||||
|
@ -1210,7 +1210,7 @@ public class AbstractCachingVMProvider extends AbstractVMProvider
|
||||||
new ViewerDataRequestMonitor<Map<String, Object>>(getExecutor(), update) {
|
new ViewerDataRequestMonitor<Map<String, Object>>(getExecutor(), update) {
|
||||||
@Override
|
@Override
|
||||||
protected void handleCompleted() {
|
protected void handleCompleted() {
|
||||||
PropertiesUpdateStatus missUpdateStatus = (PropertiesUpdateStatus)getStatus();
|
PropertiesUpdateStatus missUpdateStatus = PropertiesUpdateStatus.makePropertiesStatus(getStatus());
|
||||||
Map<String, Object> cachedProperties;
|
Map<String, Object> cachedProperties;
|
||||||
PropertiesUpdateStatus cachedStatus;
|
PropertiesUpdateStatus cachedStatus;
|
||||||
if (!isCanceled() && flushCounter == entry.fFlushCounter) {
|
if (!isCanceled() && flushCounter == entry.fFlushCounter) {
|
||||||
|
@ -1295,7 +1295,7 @@ public class AbstractCachingVMProvider extends AbstractVMProvider
|
||||||
for (String property : update.getProperties()) {
|
for (String property : update.getProperties()) {
|
||||||
update.setProperty(property, cachedProperties.get(property));
|
update.setProperty(property, cachedProperties.get(property));
|
||||||
}
|
}
|
||||||
PropertiesUpdateStatus updateStatus = PropertiesUpdateStatus.getPropertiesStatus(update);
|
PropertiesUpdateStatus updateStatus = PropertiesUpdateStatus.makePropertiesStatus(update.getStatus());
|
||||||
updateStatus = PropertiesUpdateStatus.mergePropertiesStatus(
|
updateStatus = PropertiesUpdateStatus.mergePropertiesStatus(
|
||||||
updateStatus, cachedStatus, update.getProperties());
|
updateStatus, cachedStatus, update.getProperties());
|
||||||
update.setStatus(updateStatus);
|
update.setStatus(updateStatus);
|
||||||
|
|
Loading…
Add table
Reference in a new issue