1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 17:26:01 +02:00

cosmetics: generics

This commit is contained in:
Andrew Gvozdev 2010-01-23 05:18:44 +00:00
parent 82b1c4ed6b
commit 5e84f13c92
4 changed files with 26 additions and 26 deletions

View file

@ -31,7 +31,7 @@ import org.eclipse.core.runtime.Path;
public class CDefaultConfigurationData extends CConfigurationData {
protected String fDescription;
private HashMap fResourceDataMap = new HashMap();
private HashMap<IPath, CResourceData> fResourceDataMap = new HashMap<IPath, CResourceData>();
protected CFolderData fRootFolderData;
protected String fName;
protected String fId;
@ -199,7 +199,7 @@ public class CDefaultConfigurationData extends CConfigurationData {
@Override
public CResourceData[] getResourceDatas() {
return (CResourceData[])fResourceDataMap.values().toArray(new CResourceData[fResourceDataMap.size()]);
return fResourceDataMap.values().toArray(new CResourceData[fResourceDataMap.size()]);
}
@Override
@ -226,7 +226,7 @@ public class CDefaultConfigurationData extends CConfigurationData {
public CResourceData getResourceData(IPath path){
path = standardizePath(path);
return (CResourceData)fResourceDataMap.get(path);
return fResourceDataMap.get(path);
}
@Override

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2007 Intel Corporation and others.
* Copyright (c) 2007, 2010 Intel Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -58,16 +58,16 @@ public class CResourceDataContainer {
return getResourceDatas(kind, CResourceData.class);
}
public CResourceData[] getResourceDatas(int kind, Class clazz){
List list = getRcDataList(kind);
public CResourceData[] getResourceDatas(int kind, Class<CResourceData> clazz){
List<CResourceData> list = getRcDataList(kind);
CResourceData datas[] = (CResourceData[])Array.newInstance(clazz, list.size());
return (CResourceData[])list.toArray(datas);
return list.toArray(datas);
}
public List getRcDataList(final int kind){
final List list = new ArrayList();
public List<CResourceData> getRcDataList(final int kind){
final List<CResourceData> list = new ArrayList<CResourceData>();
fRcDataContainer.accept(new IPathSettingsContainerVisitor(){
public boolean visit(PathSettingsContainer container) {

View file

@ -112,8 +112,8 @@ public class CDataSerializer {
if(tpData != null)
factory.link(data, tpData);
} else if (SOURCE_ENTRIES.equals(childName)){
List list = LanguageSettingEntriesSerializer.loadEntriesList(child, ICSettingEntry.SOURCE_PATH);
ICSourceEntry[] entries = (ICSourceEntry[])list.toArray(new ICSourceEntry[list.size()]);
List<ICSettingEntry> list = LanguageSettingEntriesSerializer.loadEntriesList(child, ICSettingEntry.SOURCE_PATH);
ICSourceEntry[] entries = list.toArray(new ICSourceEntry[list.size()]);
data.setSourceEntries(entries);
}
}
@ -228,13 +228,13 @@ public class CDataSerializer {
child = children[i];
childName = child.getName();
if(OUTPUT_ENTRIES.equals(childName)){
List list = LanguageSettingEntriesSerializer.loadEntriesList(child);
List<ICSettingEntry> list = LanguageSettingEntriesSerializer.loadEntriesList(child);
for(int k = 0; k < list.size(); k++){
ICSettingEntry e = (ICSettingEntry)list.get(i);
ICSettingEntry e = list.get(i);
if(e.getKind() != ICSettingEntry.OUTPUT_PATH)
list.remove(i);
}
bData.setOutputDirectories((ICOutputEntry[])list.toArray(new ICOutputEntry[list.size()]));
bData.setOutputDirectories(list.toArray(new ICOutputEntry[list.size()]));
}
}
return bData;
@ -307,9 +307,9 @@ public class CDataSerializer {
}
public void loadEntries(CLanguageData lData, ICStorageElement el){
List entries = LanguageSettingEntriesSerializer.loadEntriesList(el);
List<ICSettingEntry> entries = LanguageSettingEntriesSerializer.loadEntriesList(el);
EntryStore store = new EntryStore();
store.addEntries((ICLanguageSettingEntry[])entries.toArray(new ICLanguageSettingEntry[entries.size()]));
store.addEntries(entries.toArray(new ICLanguageSettingEntry[entries.size()]));
int kinds[] = KindBasedStore.getLanguageEntryKinds();
int kind;
ICLanguageSettingEntry[] sortedEntries;

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2007 Intel Corporation and others.
* Copyright (c) 2007, 2010 Intel Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -67,18 +67,18 @@ public class LanguageSettingEntriesSerializer {
}
public static ICSettingEntry[] loadEntries(ICStorageElement el, int kindFilter){
List list = loadEntriesList(el, kindFilter);
return (ICSettingEntry[])list.toArray(new ICSettingEntry[list.size()]);
List<ICSettingEntry> list = loadEntriesList(el, kindFilter);
return list.toArray(new ICSettingEntry[list.size()]);
}
public static List loadEntriesList(ICStorageElement el){
public static List<ICSettingEntry> loadEntriesList(ICStorageElement el){
return loadEntriesList(el, 0);
}
public static List loadEntriesList(ICStorageElement el, int kindFilter){
public static List<ICSettingEntry> loadEntriesList(ICStorageElement el, int kindFilter){
ICStorageElement children[] = el.getChildren();
ICStorageElement child;
List list = new ArrayList();
List<ICSettingEntry> list = new ArrayList<ICSettingEntry>();
ICSettingEntry entry;
for(int i = 0; i < children.length; i++){
child = children[i];
@ -134,10 +134,10 @@ public class LanguageSettingEntriesSerializer {
return null;
}
private static void storePath(ICStorageElement el, String attr, IPath path){
if(path != null)
el.setAttribute(attr, path.toString());
}
// private static void storePath(ICStorageElement el, String attr, IPath path){
// if(path != null)
// el.setAttribute(attr, path.toString());
// }
private static IPath[] loadExclusions(ICStorageElement el){
String attr = el.getAttribute(ATTRIBUTE_EXCLUDING);