mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-22 16:35:25 +02:00
bug 319512: Missing type arguments on managedbuilder.core
This commit is contained in:
parent
334702ee05
commit
7c70ab5b89
1 changed files with 25 additions and 23 deletions
|
@ -46,9 +46,9 @@ public class ToolListModificationInfo {
|
||||||
return fRcInfo;
|
return fRcInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List getResultingToolList(List list) {
|
public List<ITool> getResultingToolList(List<ITool> list) {
|
||||||
if(list == null)
|
if(list == null)
|
||||||
list = new ArrayList(fResultingTools.length);
|
list = new ArrayList<ITool>(fResultingTools.length);
|
||||||
|
|
||||||
for(int i = 0; i < fResultingTools.length; i++){
|
for(int i = 0; i < fResultingTools.length; i++){
|
||||||
list.add(fResultingTools[i].getResultingTool());
|
list.add(fResultingTools[i].getResultingTool());
|
||||||
|
@ -103,7 +103,7 @@ public class ToolListModificationInfo {
|
||||||
|
|
||||||
|
|
||||||
public MultiStatus getModificationStatus(){
|
public MultiStatus getModificationStatus(){
|
||||||
List statusList = new ArrayList();
|
List<IModificationStatus> statusList = new ArrayList<IModificationStatus>();
|
||||||
|
|
||||||
ToolInfo[][] conflictInfos = calculateConflictingTools(fResultingTools);
|
ToolInfo[][] conflictInfos = calculateConflictingTools(fResultingTools);
|
||||||
ITool[][] conflicting = toToolArray(conflictInfos, true);
|
ITool[][] conflicting = toToolArray(conflictInfos, true);
|
||||||
|
@ -114,14 +114,14 @@ public class ToolListModificationInfo {
|
||||||
IConfiguration cfg = fRcInfo.getParent();
|
IConfiguration cfg = fRcInfo.getParent();
|
||||||
ITool[] nonManagedTools = null;
|
ITool[] nonManagedTools = null;
|
||||||
if(cfg.isManagedBuildOn() && cfg.supportsBuild(true)){
|
if(cfg.isManagedBuildOn() && cfg.supportsBuild(true)){
|
||||||
List list = new ArrayList();
|
List<ITool> list = new ArrayList<ITool>();
|
||||||
for(int i = 0; i < fResultingTools.length; i++){
|
for(int i = 0; i < fResultingTools.length; i++){
|
||||||
if(!fResultingTools[i].getInitialTool().supportsBuild(true)){
|
if(!fResultingTools[i].getInitialTool().supportsBuild(true)){
|
||||||
list.add(fResultingTools[i].getInitialTool());
|
list.add(fResultingTools[i].getInitialTool());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(list.size() != 0){
|
if(list.size() != 0){
|
||||||
nonManagedTools = (ITool[])list.toArray(new Tool[list.size()]);
|
nonManagedTools = list.toArray(new Tool[list.size()]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,15 +149,15 @@ public class ToolListModificationInfo {
|
||||||
|
|
||||||
private ToolInfo[] filterInfos(ToolInfo[] infos){
|
private ToolInfo[] filterInfos(ToolInfo[] infos){
|
||||||
if(fRcInfo instanceof FolderInfo){
|
if(fRcInfo instanceof FolderInfo){
|
||||||
Map map = createInitialToolToToolInfoMap(infos);
|
Map<ITool, ToolInfo> map = createInitialToolToToolInfoMap(infos);
|
||||||
ITool[] tools = (ITool[])new ArrayList(map.keySet()).toArray(new ITool[map.size()]);
|
ITool[] tools = new ArrayList<ITool>(map.keySet()).toArray(new ITool[map.size()]);
|
||||||
|
|
||||||
tools = ((FolderInfo)fRcInfo).filterTools(tools, fRcInfo.getParent().getManagedProject());
|
tools = ((FolderInfo)fRcInfo).filterTools(tools, fRcInfo.getParent().getManagedProject());
|
||||||
|
|
||||||
if(tools.length < infos.length){
|
if(tools.length < infos.length){
|
||||||
infos = new ToolInfo[tools.length];
|
infos = new ToolInfo[tools.length];
|
||||||
for(int i = 0; i < infos.length; i++){
|
for(int i = 0; i < infos.length; i++){
|
||||||
infos[i] = (ToolInfo)map.get(tools[i]);
|
infos[i] = map.get(tools[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -165,8 +165,8 @@ public class ToolListModificationInfo {
|
||||||
return infos;
|
return infos;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Map createInitialToolToToolInfoMap(ToolInfo[] infos){
|
private static Map<ITool, ToolInfo> createInitialToolToToolInfoMap(ToolInfo[] infos){
|
||||||
Map map = new LinkedHashMap();
|
Map<ITool, ToolInfo> map = new LinkedHashMap<ITool, ToolInfo>();
|
||||||
for(int i = 0; i < infos.length; i++){
|
for(int i = 0; i < infos.length; i++){
|
||||||
map.put(infos[i].getInitialTool(), infos[i]);
|
map.put(infos[i].getInitialTool(), infos[i]);
|
||||||
}
|
}
|
||||||
|
@ -176,17 +176,18 @@ public class ToolListModificationInfo {
|
||||||
|
|
||||||
|
|
||||||
private ToolInfo[][] doCalculateConflictingTools(ToolInfo[] infos){
|
private ToolInfo[][] doCalculateConflictingTools(ToolInfo[] infos){
|
||||||
HashSet set = new HashSet();
|
HashSet<ToolInfo> set = new HashSet<ToolInfo>();
|
||||||
set.addAll(Arrays.asList(infos));
|
set.addAll(Arrays.asList(infos));
|
||||||
List result = new ArrayList();
|
List<ToolInfo[]> result = new ArrayList<ToolInfo[]>();
|
||||||
for(Iterator iter = set.iterator(); iter.hasNext();){
|
for(Iterator<ToolInfo> iter = set.iterator(); iter.hasNext();){
|
||||||
ToolInfo ti = (ToolInfo)iter.next();
|
ToolInfo ti = iter.next();
|
||||||
ITool t = ti.getInitialTool();
|
ITool t = ti.getInitialTool();
|
||||||
iter.remove();
|
iter.remove();
|
||||||
HashSet tmp = (HashSet)set.clone();
|
@SuppressWarnings("unchecked")
|
||||||
List list = new ArrayList();
|
HashSet<ToolInfo> tmp = (HashSet<ToolInfo>)set.clone();
|
||||||
for(Iterator tmpIt = tmp.iterator(); tmpIt.hasNext();){
|
List<ITool> list = new ArrayList<ITool>();
|
||||||
ToolInfo otherTi = (ToolInfo)tmpIt.next();
|
for(Iterator<ToolInfo> tmpIt = tmp.iterator(); tmpIt.hasNext();){
|
||||||
|
ToolInfo otherTi = tmpIt.next();
|
||||||
ITool other = otherTi.getInitialTool();
|
ITool other = otherTi.getInitialTool();
|
||||||
String conflicts[] = getConflictingInputExts(t, other);
|
String conflicts[] = getConflictingInputExts(t, other);
|
||||||
if(conflicts.length != 0){
|
if(conflicts.length != 0){
|
||||||
|
@ -197,26 +198,27 @@ public class ToolListModificationInfo {
|
||||||
|
|
||||||
if(list.size() != 0){
|
if(list.size() != 0){
|
||||||
list.add(t);
|
list.add(t);
|
||||||
result.add(list.toArray(new ToolInfo[list.size()]));
|
ToolInfo[] arr = list.toArray(new ToolInfo[list.size()]);
|
||||||
|
result.add(arr);
|
||||||
}
|
}
|
||||||
set = tmp;
|
set = tmp;
|
||||||
iter = set.iterator();
|
iter = set.iterator();
|
||||||
}
|
}
|
||||||
|
|
||||||
return (ToolInfo[][])result.toArray(new ToolInfo[result.size()][]);
|
return result.toArray(new ToolInfo[result.size()][]);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String[] getConflictingInputExts(ITool tool1, ITool tool2){
|
private String[] getConflictingInputExts(ITool tool1, ITool tool2){
|
||||||
IProject project = fRcInfo.getParent().getOwner().getProject();
|
IProject project = fRcInfo.getParent().getOwner().getProject();
|
||||||
String ext1[] = ((Tool)tool1).getAllInputExtensions(project);
|
String ext1[] = ((Tool)tool1).getAllInputExtensions(project);
|
||||||
String ext2[] = ((Tool)tool2).getAllInputExtensions(project);
|
String ext2[] = ((Tool)tool2).getAllInputExtensions(project);
|
||||||
Set set1 = new HashSet(Arrays.asList(ext1));
|
Set<String> set1 = new HashSet<String>(Arrays.asList(ext1));
|
||||||
Set result = new HashSet();
|
Set<String> result = new HashSet<String>();
|
||||||
for(int i = 0; i < ext2.length; i++){
|
for(int i = 0; i < ext2.length; i++){
|
||||||
if(set1.remove(ext2[i]))
|
if(set1.remove(ext2[i]))
|
||||||
result.add(ext2[i]);
|
result.add(ext2[i]);
|
||||||
}
|
}
|
||||||
return (String[])result.toArray(new String[result.size()]);
|
return result.toArray(new String[result.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void apply(){
|
public void apply(){
|
||||||
|
|
Loading…
Add table
Reference in a new issue