mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
bug 319512: Missing type arguments on managedbuilder.core
This commit is contained in:
parent
40b90fc643
commit
9ba43eaffd
2 changed files with 29 additions and 29 deletions
|
@ -38,7 +38,7 @@ public class MatchObjectElement {
|
|||
private int fType;
|
||||
private String fString;
|
||||
private static ObjectTypeBasedStorage fTypeAssociationStorage = new ObjectTypeBasedStorage();
|
||||
private static Map fStringAssociationStorage = new HashMap();
|
||||
private static Map<String, TypeToStringAssociation> fStringAssociationStorage = new HashMap<String, TypeToStringAssociation>();
|
||||
|
||||
public static TypeToStringAssociation TOOL = new TypeToStringAssociation(IRealBuildObjectAssociation.OBJECT_TOOL, "tool"); //$NON-NLS-1$
|
||||
public static TypeToStringAssociation TOOLCHAIN = new TypeToStringAssociation(IRealBuildObjectAssociation.OBJECT_TOOLCHAIN, "toolChain"); //$NON-NLS-1$
|
||||
|
@ -61,7 +61,7 @@ public class MatchObjectElement {
|
|||
}
|
||||
|
||||
public static TypeToStringAssociation getAssociation(String str){
|
||||
return (TypeToStringAssociation)fStringAssociationStorage.get(str);
|
||||
return fStringAssociationStorage.get(str);
|
||||
}
|
||||
|
||||
public static TypeToStringAssociation getAssociation(int type){
|
||||
|
@ -94,8 +94,8 @@ public class MatchObjectElement {
|
|||
}
|
||||
|
||||
public class PatternElement {
|
||||
private HashSet fIds;
|
||||
private int fHash;
|
||||
private HashSet<String> fIds;
|
||||
private int fHashPE;
|
||||
private int fType;
|
||||
|
||||
private static final int SEARCH_TYPE_MASK = 0xff;
|
||||
|
@ -118,7 +118,7 @@ public class MatchObjectElement {
|
|||
|
||||
PatternElement(IConfigurationElement el, int defaultSearchType, int defaultIdType){
|
||||
String tmp = el.getAttribute(ATTR_OBJECT_IDS);
|
||||
fIds = new HashSet(Arrays.asList(CDataUtil.stringToArray(tmp, DELIMITER)));
|
||||
fIds = new HashSet<String>(Arrays.asList(CDataUtil.stringToArray(tmp, DELIMITER)));
|
||||
|
||||
int type = 0;
|
||||
tmp = el.getAttribute(ATTR_PATTERN_TYPE_SEARCH_SCOPE);
|
||||
|
@ -150,13 +150,13 @@ public class MatchObjectElement {
|
|||
fType = type;
|
||||
}
|
||||
|
||||
private PatternElement(HashSet ids, int type){
|
||||
private PatternElement(HashSet<String> ids, int type){
|
||||
fIds = ids;
|
||||
fType = type;
|
||||
}
|
||||
|
||||
public String[] getIds(){
|
||||
return (String[])fIds.toArray(new String[fIds.size()]);
|
||||
return fIds.toArray(new String[fIds.size()]);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -176,17 +176,17 @@ public class MatchObjectElement {
|
|||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
if(fHash == 0){
|
||||
fHash = fIds.hashCode();
|
||||
if(fHashPE == 0){
|
||||
fHashPE = fIds.hashCode();
|
||||
}
|
||||
return fHash;
|
||||
return fHashPE;
|
||||
}
|
||||
|
||||
public PatternElement merge(PatternElement el) throws IllegalArgumentException {
|
||||
if(el.fType != fType)
|
||||
throw new IllegalArgumentException();
|
||||
|
||||
HashSet set = new HashSet();
|
||||
HashSet<String> set = new HashSet<String>();
|
||||
set.addAll(fIds);
|
||||
set.addAll(el.fIds);
|
||||
return new PatternElement(set, fType);
|
||||
|
@ -212,7 +212,7 @@ public class MatchObjectElement {
|
|||
|
||||
fObjectType = assoc.getType();
|
||||
|
||||
Map patternMap = new HashMap();
|
||||
Map<PatternTypeKey, PatternElement> patternMap = new HashMap<PatternTypeKey, PatternElement>();
|
||||
int defaultSearchType = PatternElement.DEFAULT_PATTERN_SEARCH_TYPE;
|
||||
int defaultIdType = PatternElement.DEFAULT_PATTERN_ID_TYPE;
|
||||
|
||||
|
@ -228,7 +228,7 @@ public class MatchObjectElement {
|
|||
for(int i = 0; i < patternsChildren.length; i++){
|
||||
PatternElement el = new PatternElement(patternsChildren[i], defaultSearchType, defaultIdType);
|
||||
PatternTypeKey key = new PatternTypeKey(el);
|
||||
PatternElement cur = (PatternElement)patternMap.get(key);
|
||||
PatternElement cur = patternMap.get(key);
|
||||
if(cur != null){
|
||||
patternMap.put(key, cur.merge(el));
|
||||
} else {
|
||||
|
@ -241,7 +241,7 @@ public class MatchObjectElement {
|
|||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
fPatterns = (PatternElement[])patternMap.values().toArray(new PatternElement[patternMap.size()]);
|
||||
fPatterns = patternMap.values().toArray(new PatternElement[patternMap.size()]);
|
||||
}
|
||||
|
||||
public int getObjectType(){
|
||||
|
|
|
@ -43,7 +43,7 @@ public class RulesManager {
|
|||
|
||||
private ConflictDefinition[] fConflictDefinitions;
|
||||
|
||||
private Map fMatchObjectMap = new HashMap();
|
||||
private Map<MatchObjectElement, IObjectSet> fMatchObjectMap = new HashMap<MatchObjectElement, IObjectSet>();
|
||||
private PerTypeMapStorage fObjToChildSuperClassMap;
|
||||
private StarterJob fStarter;
|
||||
private boolean fIsStartInited;
|
||||
|
@ -103,7 +103,7 @@ public class RulesManager {
|
|||
fConflictDefinitions = new ConflictDefinition[0];
|
||||
} else {
|
||||
IExtension[] extensions = extensionPoint.getExtensions();
|
||||
List conflictDefs = new ArrayList();
|
||||
List<ConflictDefinition> conflictDefs = new ArrayList<ConflictDefinition>();
|
||||
for (int i = 0; i < extensions.length; ++i) {
|
||||
IExtension extension = extensions[i];
|
||||
IConfigurationElement[] elements = extension.getConfigurationElements();
|
||||
|
@ -123,7 +123,7 @@ public class RulesManager {
|
|||
}
|
||||
}
|
||||
|
||||
fConflictDefinitions = (ConflictDefinition[])conflictDefs.toArray(new ConflictDefinition[conflictDefs.size()]);
|
||||
fConflictDefinitions = conflictDefs.toArray(new ConflictDefinition[conflictDefs.size()]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -146,11 +146,11 @@ public class RulesManager {
|
|||
}
|
||||
|
||||
private IObjectSet resolve(MatchObjectElement el){
|
||||
IObjectSet oSet = (IObjectSet)fMatchObjectMap.get(el);
|
||||
IObjectSet oSet = fMatchObjectMap.get(el);
|
||||
if(oSet == null){
|
||||
int type = el.getObjectType();
|
||||
PatternElement[] patterns = el.getPatterns();
|
||||
HashSet objectsSet = new HashSet();
|
||||
HashSet<IRealBuildObjectAssociation> objectsSet = new HashSet<IRealBuildObjectAssociation>();
|
||||
for(int i = 0; i < patterns.length; i++){
|
||||
PatternElement pattern = patterns[i];
|
||||
processPattern(type, pattern, objectsSet);
|
||||
|
@ -171,19 +171,19 @@ public class RulesManager {
|
|||
|
||||
IRealBuildObjectAssociation[] allObjs = TcModificationUtil.getExtensionObjects(objType);
|
||||
Pattern pattern = Pattern.compile(id);
|
||||
List list = new ArrayList();
|
||||
List<IRealBuildObjectAssociation> list = new ArrayList<IRealBuildObjectAssociation>();
|
||||
|
||||
for(int i = 0; i < allObjs.length; i++){
|
||||
if(pattern.matcher(allObjs[i].getId()).matches())
|
||||
list.add(allObjs[i]);
|
||||
}
|
||||
|
||||
return (IRealBuildObjectAssociation[])list.toArray(new IRealBuildObjectAssociation[list.size()]);
|
||||
return list.toArray(new IRealBuildObjectAssociation[list.size()]);
|
||||
}
|
||||
|
||||
private Set processPattern(int objType, PatternElement el, Set set){
|
||||
private Set<IRealBuildObjectAssociation> processPattern(int objType, PatternElement el, Set<IRealBuildObjectAssociation> set){
|
||||
if(set == null)
|
||||
set = new HashSet();
|
||||
set = new HashSet<IRealBuildObjectAssociation>();
|
||||
|
||||
String ids[] = el.getIds();
|
||||
if(el.getSearchType() == PatternElement.TYPE_SEARCH_EXTENSION_OBJECT){
|
||||
|
@ -202,7 +202,7 @@ public class RulesManager {
|
|||
|
||||
set.add(obj.getRealBuildObject());
|
||||
|
||||
Set childRealSet = getChildSuperClassRealSet(obj, allReal);
|
||||
Set<IRealBuildObjectAssociation> childRealSet = getChildSuperClassRealSet(obj, allReal);
|
||||
|
||||
set.addAll(childRealSet);
|
||||
// for(int k = 0; k < allReal.length; k++){
|
||||
|
@ -230,15 +230,15 @@ public class RulesManager {
|
|||
return set;
|
||||
}
|
||||
|
||||
private Set getChildSuperClassRealSet(IRealBuildObjectAssociation obj, IRealBuildObjectAssociation[] all){
|
||||
private Set<IRealBuildObjectAssociation> getChildSuperClassRealSet(IRealBuildObjectAssociation obj, IRealBuildObjectAssociation[] all){
|
||||
if(fObjToChildSuperClassMap == null)
|
||||
fObjToChildSuperClassMap = new PerTypeMapStorage();
|
||||
|
||||
if(all == null)
|
||||
all = TcModificationUtil.getExtensionObjects(obj.getType());
|
||||
|
||||
Map map = fObjToChildSuperClassMap.getMap(obj.getType(), true);
|
||||
Set set = (Set)map.get(obj);
|
||||
Map<IRealBuildObjectAssociation, Set<IRealBuildObjectAssociation>> map = fObjToChildSuperClassMap.getMap(obj.getType(), true);
|
||||
Set<IRealBuildObjectAssociation> set = map.get(obj);
|
||||
if(set == null){
|
||||
set = createChildSuperClassRealSet(obj, all, null);
|
||||
map.put(obj, set);
|
||||
|
@ -247,9 +247,9 @@ public class RulesManager {
|
|||
return set;
|
||||
}
|
||||
|
||||
private static Set createChildSuperClassRealSet(IRealBuildObjectAssociation obj, IRealBuildObjectAssociation[] all, Set set){
|
||||
private static Set<IRealBuildObjectAssociation> createChildSuperClassRealSet(IRealBuildObjectAssociation obj, IRealBuildObjectAssociation[] all, Set<IRealBuildObjectAssociation> set){
|
||||
if(set == null)
|
||||
set = new HashSet();
|
||||
set = new HashSet<IRealBuildObjectAssociation>();
|
||||
|
||||
if(all == null)
|
||||
all = TcModificationUtil.getExtensionObjects(obj.getType());
|
||||
|
|
Loading…
Add table
Reference in a new issue