diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/TcModificationUtil.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/TcModificationUtil.java index 170295719a9..74046f68bd3 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/TcModificationUtil.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/TcModificationUtil.java @@ -363,7 +363,7 @@ public class TcModificationUtil { return set; } - public static Map getRealToObjectsMap(IRealBuildObjectAssociation[] objs, Map map){ + public static Map getRealToObjectsMap(IRealBuildObjectAssociation[] objs, Map map){ if(map == null) map = new LinkedHashMap(); for(int i = 0; i < objs.length; i++){ diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolListModification.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolListModification.java index 6aa1303bb08..f564d29fdfa 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolListModification.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/tcmodification/ToolListModification.java @@ -16,7 +16,6 @@ import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -384,19 +383,21 @@ public abstract class ToolListModification implements IToolListModification { public ToolListModification(ResourceInfo rcInfo, ToolListModification base){ fRcInfo = rcInfo; Tool[] initialTools = (Tool[])rcInfo.getTools(); - Map initRealToToolMap = TcModificationUtil.getRealToObjectsMap(initialTools, new LinkedHashMap()); + @SuppressWarnings("unchecked") + Map initRealToToolMap = (Map) TcModificationUtil.getRealToObjectsMap(initialTools, null); Tool[] updatedTools = base.getTools(true, false); - Map updatedRealToToolMap = TcModificationUtil.getRealToObjectsMap(updatedTools, new LinkedHashMap()); - for(Iterator iter = updatedRealToToolMap.entrySet().iterator(); iter.hasNext(); ){ - Map.Entry entry = (Map.Entry)iter.next(); - Object real = entry.getKey(); - Object initial = initRealToToolMap.get(real); + @SuppressWarnings("unchecked") + Map updatedRealToToolMap = (Map) TcModificationUtil.getRealToObjectsMap(updatedTools, null); + Set> entrySet = updatedRealToToolMap.entrySet(); + for (Entry entry : entrySet) { + Tool real = entry.getKey(); + Tool initial = initRealToToolMap.get(real); if(initial != null){ entry.setValue(initial); } else { - IRealBuildObjectAssociation updated = (IRealBuildObjectAssociation)entry.getValue(); + Tool updated = entry.getValue(); if(!updated.isExtensionBuildObject()){ - updated = updated.getExtensionObject(); + updated = (Tool) updated.getExtensionObject(); entry.setValue(updated); } } @@ -656,7 +657,8 @@ public abstract class ToolListModification implements IToolListModification { clearToolInfo(map.values().toArray(new Tool[map.size()])); PerTypeMapStorage storage = getCompleteObjectStore(); - Map toolMap = storage.getMap(IRealBuildObjectAssociation.OBJECT_TOOL, true); + @SuppressWarnings("unchecked") + Map toolMap = storage.getMap(IRealBuildObjectAssociation.OBJECT_TOOL, true); if(rmSet != null) TcModificationUtil.removePaths(toolMap, realRemoved, rmSet); if(addSet != null) @@ -701,8 +703,10 @@ public abstract class ToolListModification implements IToolListModification { } filteredTools = filterTools(allTools); - Map filteredMap = TcModificationUtil.getRealToObjectsMap(filteredTools, null); - Map allMap = TcModificationUtil.getRealToObjectsMap(allTools, null); + @SuppressWarnings("unchecked") + Map filteredMap = (Map) TcModificationUtil.getRealToObjectsMap(filteredTools, null); + @SuppressWarnings("unchecked") + Map allMap = (Map) TcModificationUtil.getRealToObjectsMap(allTools, null); allMap.keySet().removeAll(filteredMap.keySet()); fFilteredOutTools = allMap; // tools = filteredTools;