1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

cosmetics: generics

This commit is contained in:
Andrew Gvozdev 2010-01-25 18:35:42 +00:00
parent d87062029e
commit 5bd1de23dd

View file

@ -90,10 +90,10 @@ public class CExternalSettingsDeltaProcessor {
current = new ICSourceEntry[0]; current = new ICSourceEntry[0];
} }
} }
List newEntries = calculateUpdatedEntries(current, diff[0], diff[1]); List<ICSettingEntry> newEntries = calculateUpdatedEntries(current, diff[0], diff[1]);
if(newEntries != null){ if(newEntries != null){
try { try {
cfgDes.setSourceEntries((ICSourceEntry[])newEntries.toArray(new ICSourceEntry[newEntries.size()])); cfgDes.setSourceEntries(newEntries.toArray(new ICSourceEntry[newEntries.size()]));
} catch (WriteAccessException e) { } catch (WriteAccessException e) {
CCorePlugin.log(e); CCorePlugin.log(e);
} catch (CoreException e) { } catch (CoreException e) {
@ -121,10 +121,10 @@ public class CExternalSettingsDeltaProcessor {
} }
} }
List newEntries = calculateUpdatedEntries(current, diff[0], diff[1]); List<ICSettingEntry> newEntries = calculateUpdatedEntries(current, diff[0], diff[1]);
if(newEntries != null){ if(newEntries != null){
try { try {
bs.setOutputDirectories((ICOutputEntry[])newEntries.toArray(new ICOutputEntry[newEntries.size()])); bs.setOutputDirectories(newEntries.toArray(new ICOutputEntry[newEntries.size()]));
} catch (WriteAccessException e) { } catch (WriteAccessException e) {
CCorePlugin.log(e); CCorePlugin.log(e);
} }
@ -207,8 +207,8 @@ public class CExternalSettingsDeltaProcessor {
return changed; return changed;
} }
private static List calculateUpdatedEntries(ICSettingEntry current[], ICSettingEntry added[], ICSettingEntry removed[]){ private static List<ICSettingEntry> calculateUpdatedEntries(ICSettingEntry current[], ICSettingEntry added[], ICSettingEntry removed[]){
LinkedHashMap map = new LinkedHashMap(); LinkedHashMap<EntryContentsKey, ICSettingEntry> map = new LinkedHashMap<EntryContentsKey, ICSettingEntry>();
boolean changed = false; boolean changed = false;
if(added != null){ if(added != null){
CDataUtil.fillEntriesMapByContentsKey(map, added); CDataUtil.fillEntriesMapByContentsKey(map, added);
@ -227,14 +227,14 @@ public class CExternalSettingsDeltaProcessor {
for(int i = 0; i < removed.length; i++){ for(int i = 0; i < removed.length; i++){
ICSettingEntry entry = removed[i]; ICSettingEntry entry = removed[i];
EntryContentsKey cKey = new EntryContentsKey(entry); EntryContentsKey cKey = new EntryContentsKey(entry);
ICSettingEntry cur = (ICSettingEntry)map.get(cKey); ICSettingEntry cur = map.get(cKey);
if(cur != null && !cur.isBuiltIn()){ if(cur != null && !cur.isBuiltIn()){
map.remove(cKey); map.remove(cKey);
changed = true; changed = true;
} }
} }
} }
return changed ? new ArrayList(map.values()) : null; return changed ? new ArrayList<ICSettingEntry>(map.values()) : null;
} }
private static boolean isSettingCompatible(ICLanguageSetting setting, CExternalSetting provider){ private static boolean isSettingCompatible(ICLanguageSetting setting, CExternalSetting provider){