1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

bug 319512: Missing type arguments on managedbuilder.core

This commit is contained in:
Andrew Gvozdev 2010-10-02 05:31:04 +00:00
parent 786416e2fc
commit 945f453d62
6 changed files with 35 additions and 25 deletions

View file

@ -130,7 +130,8 @@ public class ConfigurationModification extends FolderInfoModification implements
fInCompatibleBuilders = new HashMap<IBuilder, BuilderCompatibilityInfoElement>(); fInCompatibleBuilders = new HashMap<IBuilder, BuilderCompatibilityInfoElement>();
ConflictMatchSet conflicts = getParentConflictMatchSet(); ConflictMatchSet conflicts = getParentConflictMatchSet();
IBuilder sysBs[] = getAllSysBuilders(); IBuilder sysBs[] = getAllSysBuilders();
Map<Builder, List<ConflictMatch>> conflictMap = conflicts.fObjToConflictListMap; @SuppressWarnings("unchecked")
Map<Builder, List<ConflictMatch>> conflictMap = (Map<Builder, List<ConflictMatch>>) conflicts.fObjToConflictListMap;
for(int i = 0; i < sysBs.length; i++){ for(int i = 0; i < sysBs.length; i++){
Builder b = (Builder) sysBs[i]; Builder b = (Builder) sysBs[i];
List<ConflictMatch> l = conflictMap.get(b); List<ConflictMatch> l = conflictMap.get(b);

View file

@ -174,7 +174,8 @@ public class FolderInfoModification extends ToolListModification implements IFol
ConflictMatchSet parentConflicts = getParentConflictMatchSet(); ConflictMatchSet parentConflicts = getParentConflictMatchSet();
ToolChain sysTCs[] = (ToolChain[])getAllSysToolChains(); ToolChain sysTCs[] = (ToolChain[])getAllSysToolChains();
Map<ToolChain, List<ConflictMatch>> conflictMap = parentConflicts.fObjToConflictListMap; @SuppressWarnings("unchecked")
Map<ToolChain, List<ConflictMatch>> conflictMap = (Map<ToolChain, List<ConflictMatch>>) parentConflicts.fObjToConflictListMap;
for (ToolChain tc : sysTCs) { for (ToolChain tc : sysTCs) {
List<ConflictMatch> l = conflictMap.get(tc); List<ConflictMatch> l = conflictMap.get(tc);
ToolChainCompatibilityInfoElement info = new ToolChainCompatibilityInfoElement(tc, l); ToolChainCompatibilityInfoElement info = new ToolChainCompatibilityInfoElement(tc, l);
@ -309,8 +310,10 @@ public class FolderInfoModification extends ToolListModification implements IFol
TreeMap<IPath, PerTypeSetStorage> pathMap = getCompletePathMapStorage(); TreeMap<IPath, PerTypeSetStorage> pathMap = getCompletePathMapStorage();
PerTypeSetStorage oSet = pathMap.get(path); PerTypeSetStorage oSet = pathMap.get(path);
Set<Tool> toolSet = oSet.getSet(IRealBuildObjectAssociation.OBJECT_TOOL, false); @SuppressWarnings("unchecked")
Set<ToolChain> tcSet = oSet.getSet(IRealBuildObjectAssociation.OBJECT_TOOLCHAIN, false); Set<Tool> toolSet = (Set<Tool>) oSet.getSet(IRealBuildObjectAssociation.OBJECT_TOOL, false);
@SuppressWarnings("unchecked")
Set<ToolChain> tcSet = (Set<ToolChain>) oSet.getSet(IRealBuildObjectAssociation.OBJECT_TOOLCHAIN, false);
ToolChain curTc = tcSet.iterator().next(); ToolChain curTc = tcSet.iterator().next();
@ -359,7 +362,9 @@ public class FolderInfoModification extends ToolListModification implements IFol
for (Entry<IPath, PerTypeSetStorage> entry : entrySet) { for (Entry<IPath, PerTypeSetStorage> entry : entrySet) {
PerTypeSetStorage cst = entry.getValue(); PerTypeSetStorage cst = entry.getValue();
@SuppressWarnings("unchecked")
Set<ToolChain> ctc = (Set<ToolChain>) cst.getSet(IRealBuildObjectAssociation.OBJECT_TOOLCHAIN, false); Set<ToolChain> ctc = (Set<ToolChain>) cst.getSet(IRealBuildObjectAssociation.OBJECT_TOOLCHAIN, false);
@SuppressWarnings("unchecked")
Set<Tool> ct = (Set<Tool>) cst.getSet(IRealBuildObjectAssociation.OBJECT_TOOL, false); Set<Tool> ct = (Set<Tool>) cst.getSet(IRealBuildObjectAssociation.OBJECT_TOOL, false);
@ -384,8 +389,10 @@ public class FolderInfoModification extends ToolListModification implements IFol
ToolChainApplicabilityPaths tcApplicability = getToolChainApplicabilityPaths(); ToolChainApplicabilityPaths tcApplicability = getToolChainApplicabilityPaths();
PerTypeMapStorage storage = getCompleteObjectStore(); PerTypeMapStorage storage = getCompleteObjectStore();
Map<ToolChain, Set> tcMap = storage.getMap(IRealBuildObjectAssociation.OBJECT_TOOLCHAIN, false); @SuppressWarnings("unchecked")
Map<Tool, Set> toolMap = storage.getMap(IRealBuildObjectAssociation.OBJECT_TOOL, false); Map<ToolChain, Set<IPath>> tcMap = storage.getMap(IRealBuildObjectAssociation.OBJECT_TOOLCHAIN, false);
@SuppressWarnings("unchecked")
Map<Tool, Set<IPath>> toolMap = storage.getMap(IRealBuildObjectAssociation.OBJECT_TOOL, false);
TcModificationUtil.removePaths(tcMap, fRealToolChain, tcApplicability.fFolderInfoPaths); TcModificationUtil.removePaths(tcMap, fRealToolChain, tcApplicability.fFolderInfoPaths);

View file

@ -18,7 +18,7 @@ import org.eclipse.cdt.managedbuilder.internal.core.IRealBuildObjectAssociation;
public class PerTypeSetStorage implements Cloneable { public class PerTypeSetStorage implements Cloneable {
private ObjectTypeBasedStorage fStorage = new ObjectTypeBasedStorage(); private ObjectTypeBasedStorage fStorage = new ObjectTypeBasedStorage();
public Set getSet(int type, boolean create){ public Set<? extends IRealBuildObjectAssociation> getSet(int type, boolean create){
Set<IRealBuildObjectAssociation> set = (Set<IRealBuildObjectAssociation>)fStorage.get(type); Set<IRealBuildObjectAssociation> set = (Set<IRealBuildObjectAssociation>)fStorage.get(type);
if(set == null && create){ if(set == null && create){
set = createSet(null); set = createSet(null);
@ -63,7 +63,7 @@ public class PerTypeSetStorage implements Cloneable {
for(int i = 0; i < types.length; i++){ for(int i = 0; i < types.length; i++){
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
Set<IRealBuildObjectAssociation> o = (Set<IRealBuildObjectAssociation>) fStorage.get(types[i]); Set<IRealBuildObjectAssociation> o = (Set<IRealBuildObjectAssociation>) fStorage.get(types[i]);
if(o != null && !((Set<IRealBuildObjectAssociation>)o).isEmpty()) if(o != null && !o.isEmpty())
return false; return false;
} }
return true; return true;

View file

@ -525,26 +525,27 @@ public class TcModificationUtil {
public static TreeMap<IPath,PerTypeSetStorage> createPathMap(PerTypeMapStorage storage){ public static TreeMap<IPath,PerTypeSetStorage> createPathMap(PerTypeMapStorage storage){
int[] types = ObjectTypeBasedStorage.getSupportedObjectTypes(); int[] types = ObjectTypeBasedStorage.getSupportedObjectTypes();
TreeMap result = new TreeMap(PathComparator.INSTANCE); TreeMap<IPath,PerTypeSetStorage> result = new TreeMap<IPath,PerTypeSetStorage>(PathComparator.INSTANCE);
for(int i = 0; i < types.length; i++){ for(int i = 0; i < types.length; i++){
int type = types[i]; int type = types[i];
Map map = storage.getMap(type, false); Map<IRealBuildObjectAssociation, Set<IPath>> map = storage.getMap(type, false);
if(map == null) if(map == null)
continue; continue;
for(Iterator iter = map.entrySet().iterator(); iter.hasNext(); ){ Set<Entry<IRealBuildObjectAssociation, Set<IPath>>> entrySet = map.entrySet();
Map.Entry entry = (Map.Entry)iter.next(); for (Entry<IRealBuildObjectAssociation, Set<IPath>> entry : entrySet) {
SortedSet pathSet = (SortedSet)entry.getValue(); IRealBuildObjectAssociation pathKey = entry.getKey();
Set<IPath> pathSet = entry.getValue();
for(Iterator pathIter = pathSet.iterator(); pathIter.hasNext(); ){ for (IPath path : pathSet) {
Object path = pathIter.next(); PerTypeSetStorage oset = result.get(path);
PerTypeSetStorage oset = (PerTypeSetStorage)result.get(path);
if(oset == null){ if(oset == null){
oset = new PerTypeSetStorage(); oset = new PerTypeSetStorage();
result.put(path, oset); result.put(path, oset);
} }
oset.getSet(type, true).add(entry.getKey()); @SuppressWarnings("unchecked")
Set<IRealBuildObjectAssociation> set = (Set<IRealBuildObjectAssociation>) oset.getSet(type, true);
set.add(pathKey);
} }
} }
} }

View file

@ -175,9 +175,9 @@ public class ToolChainModificationManager implements
public static class ConflictMatchSet { public static class ConflictMatchSet {
ConflictMatch[] fConflicts; ConflictMatch[] fConflicts;
Map fObjToConflictListMap; Map<? extends IRealBuildObjectAssociation, List<ConflictMatch>> fObjToConflictListMap;
ConflictMatchSet(ConflictMatch[] coflicts, Map objToConflictMap){ ConflictMatchSet(ConflictMatch[] coflicts, Map<? extends IRealBuildObjectAssociation, List<ConflictMatch>> objToConflictMap){
fConflicts = coflicts; fConflicts = coflicts;
fObjToConflictListMap = objToConflictMap; fObjToConflictListMap = objToConflictMap;
} }

View file

@ -180,7 +180,8 @@ public abstract class ToolListModification implements IToolListModification {
fCompatibleTools = new HashMap<Tool, ToolCompatibilityInfoElement>(); fCompatibleTools = new HashMap<Tool, ToolCompatibilityInfoElement>();
fInCompatibleTools = new HashMap<Tool, ToolCompatibilityInfoElement>(); fInCompatibleTools = new HashMap<Tool, ToolCompatibilityInfoElement>();
Tool sysTools[] = getTools(false, true); Tool sysTools[] = getTools(false, true);
Map<Tool, List<ConflictMatch>> conflictMap = conflicts.fObjToConflictListMap; @SuppressWarnings("unchecked")
Map<Tool, List<ConflictMatch>> conflictMap = (Map<Tool, List<ConflictMatch>>) conflicts.fObjToConflictListMap;
for(int i = 0; i < sysTools.length; i++){ for(int i = 0; i < sysTools.length; i++){
Tool t = sysTools[i]; Tool t = sysTools[i];
List<ConflictMatch> l = conflictMap.get(t); List<ConflictMatch> l = conflictMap.get(t);
@ -528,7 +529,7 @@ public abstract class ToolListModification implements IToolListModification {
PerTypeSetStorage storage = entry.getValue(); PerTypeSetStorage storage = entry.getValue();
for(int i = 0; i < types.length; i++){ for(int i = 0; i < types.length; i++){
type = types[i]; type = types[i];
Set<IRealBuildObjectAssociation> set = storage.getSet(type, false); Set<? extends IRealBuildObjectAssociation> set = storage.getSet(type, false);
if(set != null){ if(set != null){
apply(rcInfo, type, set); apply(rcInfo, type, set);
} }
@ -536,7 +537,7 @@ public abstract class ToolListModification implements IToolListModification {
} }
} }
private void apply(ResourceInfo rcInfo, int type, Set<IRealBuildObjectAssociation> set) throws CoreException { private void apply(ResourceInfo rcInfo, int type, Set<? extends IRealBuildObjectAssociation> set) throws CoreException {
switch(type){ switch(type){
case IRealBuildObjectAssociation.OBJECT_TOOL: case IRealBuildObjectAssociation.OBJECT_TOOL:
ToolListModificationInfo info = rcInfo == fRcInfo ? getModificationInfo() : ToolListModificationInfo info = rcInfo == fRcInfo ? getModificationInfo() :
@ -574,8 +575,8 @@ public abstract class ToolListModification implements IToolListModification {
} }
public IToolModification[] getProjectToolModifications() { public IToolModification[] getProjectToolModifications() {
Map map = getMap(true); Map<Tool, IToolModification> map = getMap(true);
return (ProjToolCompatibilityStatusInfo[])map.values().toArray(new ProjToolCompatibilityStatusInfo[map.size()]); return map.values().toArray(new ProjToolCompatibilityStatusInfo[map.size()]);
} }
public ITool[] getProjectTools() { public ITool[] getProjectTools() {