mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 17:26:01 +02:00
cosmetics: generics
This commit is contained in:
parent
82b1c4ed6b
commit
5e84f13c92
4 changed files with 26 additions and 26 deletions
|
@ -31,7 +31,7 @@ import org.eclipse.core.runtime.Path;
|
||||||
|
|
||||||
public class CDefaultConfigurationData extends CConfigurationData {
|
public class CDefaultConfigurationData extends CConfigurationData {
|
||||||
protected String fDescription;
|
protected String fDescription;
|
||||||
private HashMap fResourceDataMap = new HashMap();
|
private HashMap<IPath, CResourceData> fResourceDataMap = new HashMap<IPath, CResourceData>();
|
||||||
protected CFolderData fRootFolderData;
|
protected CFolderData fRootFolderData;
|
||||||
protected String fName;
|
protected String fName;
|
||||||
protected String fId;
|
protected String fId;
|
||||||
|
@ -199,7 +199,7 @@ public class CDefaultConfigurationData extends CConfigurationData {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CResourceData[] getResourceDatas() {
|
public CResourceData[] getResourceDatas() {
|
||||||
return (CResourceData[])fResourceDataMap.values().toArray(new CResourceData[fResourceDataMap.size()]);
|
return fResourceDataMap.values().toArray(new CResourceData[fResourceDataMap.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -226,7 +226,7 @@ public class CDefaultConfigurationData extends CConfigurationData {
|
||||||
|
|
||||||
public CResourceData getResourceData(IPath path){
|
public CResourceData getResourceData(IPath path){
|
||||||
path = standardizePath(path);
|
path = standardizePath(path);
|
||||||
return (CResourceData)fResourceDataMap.get(path);
|
return fResourceDataMap.get(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -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
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -58,16 +58,16 @@ public class CResourceDataContainer {
|
||||||
return getResourceDatas(kind, CResourceData.class);
|
return getResourceDatas(kind, CResourceData.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CResourceData[] getResourceDatas(int kind, Class clazz){
|
public CResourceData[] getResourceDatas(int kind, Class<CResourceData> clazz){
|
||||||
List list = getRcDataList(kind);
|
List<CResourceData> list = getRcDataList(kind);
|
||||||
|
|
||||||
CResourceData datas[] = (CResourceData[])Array.newInstance(clazz, list.size());
|
CResourceData datas[] = (CResourceData[])Array.newInstance(clazz, list.size());
|
||||||
|
|
||||||
return (CResourceData[])list.toArray(datas);
|
return list.toArray(datas);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List getRcDataList(final int kind){
|
public List<CResourceData> getRcDataList(final int kind){
|
||||||
final List list = new ArrayList();
|
final List<CResourceData> list = new ArrayList<CResourceData>();
|
||||||
fRcDataContainer.accept(new IPathSettingsContainerVisitor(){
|
fRcDataContainer.accept(new IPathSettingsContainerVisitor(){
|
||||||
|
|
||||||
public boolean visit(PathSettingsContainer container) {
|
public boolean visit(PathSettingsContainer container) {
|
||||||
|
|
|
@ -112,8 +112,8 @@ public class CDataSerializer {
|
||||||
if(tpData != null)
|
if(tpData != null)
|
||||||
factory.link(data, tpData);
|
factory.link(data, tpData);
|
||||||
} else if (SOURCE_ENTRIES.equals(childName)){
|
} else if (SOURCE_ENTRIES.equals(childName)){
|
||||||
List list = LanguageSettingEntriesSerializer.loadEntriesList(child, ICSettingEntry.SOURCE_PATH);
|
List<ICSettingEntry> list = LanguageSettingEntriesSerializer.loadEntriesList(child, ICSettingEntry.SOURCE_PATH);
|
||||||
ICSourceEntry[] entries = (ICSourceEntry[])list.toArray(new ICSourceEntry[list.size()]);
|
ICSourceEntry[] entries = list.toArray(new ICSourceEntry[list.size()]);
|
||||||
data.setSourceEntries(entries);
|
data.setSourceEntries(entries);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -228,13 +228,13 @@ public class CDataSerializer {
|
||||||
child = children[i];
|
child = children[i];
|
||||||
childName = child.getName();
|
childName = child.getName();
|
||||||
if(OUTPUT_ENTRIES.equals(childName)){
|
if(OUTPUT_ENTRIES.equals(childName)){
|
||||||
List list = LanguageSettingEntriesSerializer.loadEntriesList(child);
|
List<ICSettingEntry> list = LanguageSettingEntriesSerializer.loadEntriesList(child);
|
||||||
for(int k = 0; k < list.size(); k++){
|
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)
|
if(e.getKind() != ICSettingEntry.OUTPUT_PATH)
|
||||||
list.remove(i);
|
list.remove(i);
|
||||||
}
|
}
|
||||||
bData.setOutputDirectories((ICOutputEntry[])list.toArray(new ICOutputEntry[list.size()]));
|
bData.setOutputDirectories(list.toArray(new ICOutputEntry[list.size()]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return bData;
|
return bData;
|
||||||
|
@ -307,9 +307,9 @@ public class CDataSerializer {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadEntries(CLanguageData lData, ICStorageElement el){
|
public void loadEntries(CLanguageData lData, ICStorageElement el){
|
||||||
List entries = LanguageSettingEntriesSerializer.loadEntriesList(el);
|
List<ICSettingEntry> entries = LanguageSettingEntriesSerializer.loadEntriesList(el);
|
||||||
EntryStore store = new EntryStore();
|
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 kinds[] = KindBasedStore.getLanguageEntryKinds();
|
||||||
int kind;
|
int kind;
|
||||||
ICLanguageSettingEntry[] sortedEntries;
|
ICLanguageSettingEntry[] sortedEntries;
|
||||||
|
|
|
@ -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
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -67,18 +67,18 @@ public class LanguageSettingEntriesSerializer {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ICSettingEntry[] loadEntries(ICStorageElement el, int kindFilter){
|
public static ICSettingEntry[] loadEntries(ICStorageElement el, int kindFilter){
|
||||||
List list = loadEntriesList(el, kindFilter);
|
List<ICSettingEntry> list = loadEntriesList(el, kindFilter);
|
||||||
return (ICSettingEntry[])list.toArray(new ICSettingEntry[list.size()]);
|
return list.toArray(new ICSettingEntry[list.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List loadEntriesList(ICStorageElement el){
|
public static List<ICSettingEntry> loadEntriesList(ICStorageElement el){
|
||||||
return loadEntriesList(el, 0);
|
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 children[] = el.getChildren();
|
||||||
ICStorageElement child;
|
ICStorageElement child;
|
||||||
List list = new ArrayList();
|
List<ICSettingEntry> list = new ArrayList<ICSettingEntry>();
|
||||||
ICSettingEntry entry;
|
ICSettingEntry entry;
|
||||||
for(int i = 0; i < children.length; i++){
|
for(int i = 0; i < children.length; i++){
|
||||||
child = children[i];
|
child = children[i];
|
||||||
|
@ -134,10 +134,10 @@ public class LanguageSettingEntriesSerializer {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void storePath(ICStorageElement el, String attr, IPath path){
|
// private static void storePath(ICStorageElement el, String attr, IPath path){
|
||||||
if(path != null)
|
// if(path != null)
|
||||||
el.setAttribute(attr, path.toString());
|
// el.setAttribute(attr, path.toString());
|
||||||
}
|
// }
|
||||||
|
|
||||||
private static IPath[] loadExclusions(ICStorageElement el){
|
private static IPath[] loadExclusions(ICStorageElement el){
|
||||||
String attr = el.getAttribute(ATTRIBUTE_EXCLUDING);
|
String attr = el.getAttribute(ATTRIBUTE_EXCLUDING);
|
||||||
|
|
Loading…
Add table
Reference in a new issue