From c2a1e845aba2a294269d406bdec209c736993aca Mon Sep 17 00:00:00 2001 From: Andrew Gvozdev Date: Thu, 18 Feb 2010 03:59:39 +0000 Subject: [PATCH] cleanup: warnings about arrays of generics fixed --- .../model/CConfigurationSpecSettings.java | 41 +++++++++++-------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationSpecSettings.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationSpecSettings.java index a2e4ec0fc79..ae5a488764f 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationSpecSettings.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationSpecSettings.java @@ -87,6 +87,15 @@ public class CConfigurationSpecSettings implements ICSettingsStorage{ // private CConfigBasedDescriptor fDescriptor; // private Map fExternalSettingsProviderMap; + private class DeltaSet { + public Set extSet; + public Set idSet; + public DeltaSet(Set extSet, Set idSet) { + this.extSet = extSet; + this.idSet = idSet; + } + } + public CConfigurationSpecSettings(ICConfigurationDescription des, ICStorageElement storage) throws CoreException{ fCfg = des; fRootStorageElement = storage; @@ -572,11 +581,10 @@ public class CConfigurationSpecSettings implements ICSettingsStorage{ private void checkReconsile(String extensionPointID, boolean toExt){ if(toExt){ - Set[] delta = getReferenceDelta(extensionPointID); + DeltaSet delta = getReferenceDelta(extensionPointID); if(delta != null){ - if(delta[0] != null){ - Set extSet = delta[0]; - for (ICConfigExtensionReference ref : extSet) { + if(delta.extSet != null){ + for (ICConfigExtensionReference ref : delta.extSet) { try { doRemove(ref); } catch (CoreException e) { @@ -584,9 +592,8 @@ public class CConfigurationSpecSettings implements ICSettingsStorage{ } } } - if(delta[1] != null){ - Set idSet =delta[1]; - for (String id : idSet) { + if(delta.idSet != null){ + for (String id : delta.idSet) { try { doCreate(extensionPointID, id); } catch (CoreException e) { @@ -875,7 +882,7 @@ public class CConfigurationSpecSettings implements ICSettingsStorage{ } return false; } - private Set[] getReferenceDelta(String extPointId){ + private DeltaSet getReferenceDelta(String extPointId){ if(!usesCache(fCfg)){ if(CCorePlugin.BINARY_PARSER_UNIQ_ID.equals(extPointId)){ ICTargetPlatformSetting tp = fCfg.getTargetPlatformSetting(); @@ -895,28 +902,28 @@ public class CConfigurationSpecSettings implements ICSettingsStorage{ } return null; } + - - private Set[] getReferenceDelta(ICConfigExtensionReference refs[], String[] extIds){ + private DeltaSet getReferenceDelta(ICConfigExtensionReference refs[], String[] extIds){ if(refs == null || refs.length == 0){ if(extIds == null || extIds.length == 0) return null; - return new Set[]{null, new HashSet(Arrays.asList(extIds))}; + return new DeltaSet(null, new HashSet(Arrays.asList(extIds))); } else if(extIds == null || extIds.length == 0){ Map map = createRefMap(refs); - return new Set[]{new HashSet(map.values()), null}; + return new DeltaSet(new HashSet(map.values()), null); } - + Set idSet = new HashSet(Arrays.asList(extIds)); Set idSetCopy = new HashSet(idSet); Map refsMap = createRefMap(refs); - + idSet.removeAll(refsMap.keySet()); refsMap.keySet().removeAll(idSetCopy); - + Set extSet = new HashSet(refsMap.values()); - - return new Set[]{extSet, idSet}; + + return new DeltaSet(extSet, idSet); } private Map createRefMap(ICConfigExtensionReference refs[]){