mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
cosmetics: generics
This commit is contained in:
parent
8e6a604b18
commit
5cec38091d
6 changed files with 121 additions and 120 deletions
|
@ -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
|
||||
|
@ -19,7 +19,7 @@ import org.eclipse.cdt.core.settings.model.util.KindBasedStore;
|
|||
|
||||
public final class CExternalSetting implements ICExternalSetting {
|
||||
// private EntryStore fEntryStore = new EntryStore();
|
||||
private KindBasedStore fStore = new KindBasedStore(false);
|
||||
private KindBasedStore<CEntriesSet> fStore = new KindBasedStore<CEntriesSet>(false);
|
||||
private String[] fContentTypeIds;
|
||||
private String[] fLanguageIds;
|
||||
private String[] fExtensions;
|
||||
|
@ -77,7 +77,7 @@ public final class CExternalSetting implements ICExternalSetting {
|
|||
// }
|
||||
|
||||
private CEntriesSet getEntriesSet(int kind, boolean create) {
|
||||
CEntriesSet set = (CEntriesSet)fStore.get(kind);
|
||||
CEntriesSet set = fStore.get(kind);
|
||||
if (set == null && create) {
|
||||
set = new CEntriesSet();
|
||||
fStore.put(kind, set);
|
||||
|
|
|
@ -34,7 +34,7 @@ public final class PathSettingsContainer {
|
|||
private String fName;
|
||||
private PathSettingsContainer fRootContainer;
|
||||
private PathSettingsContainer fDirectParentContainer;
|
||||
private List fListeners;
|
||||
private List<IPathSettingsContainerListener> fListeners;
|
||||
|
||||
private boolean fIsPatternMode;
|
||||
|
||||
|
@ -44,7 +44,7 @@ public final class PathSettingsContainer {
|
|||
private static final int PATH_CHANGED = 4;
|
||||
|
||||
private static class PatternSearchInfo {
|
||||
Set fStoreSet;
|
||||
Set<PathSettingsContainer> fStoreSet;
|
||||
int fNumDoubleStarEls;
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ public final class PathSettingsContainer {
|
|||
return null;
|
||||
}
|
||||
|
||||
private List getChildren(String name){
|
||||
private List<PathSettingsContainer> getChildren(String name){
|
||||
PatternNameMap pMap = getPatternChildrenMap(false);
|
||||
if(pMap != null){
|
||||
return pMap.getValues(name);
|
||||
|
@ -114,21 +114,21 @@ public final class PathSettingsContainer {
|
|||
|
||||
|
||||
private void notifyChange(PathSettingsContainer container, int type, Object oldValue, boolean childrenAffected){
|
||||
List list = getListenersList(false);
|
||||
List<IPathSettingsContainerListener> list = getListenersList(false);
|
||||
if(list != null && list.size() > 0){
|
||||
for(Iterator iter = list.iterator(); iter.hasNext();){
|
||||
for (IPathSettingsContainerListener listener : list) {
|
||||
switch(type){
|
||||
case ADDED:
|
||||
((IPathSettingsContainerListener)iter.next()).containerAdded(container);
|
||||
listener.containerAdded(container);
|
||||
break;
|
||||
case REMOVED:
|
||||
((IPathSettingsContainerListener)iter.next()).aboutToRemove(container);
|
||||
listener.aboutToRemove(container);
|
||||
break;
|
||||
case VALUE_CHANGED:
|
||||
((IPathSettingsContainerListener)iter.next()).containerValueChanged(container, oldValue);
|
||||
listener.containerValueChanged(container, oldValue);
|
||||
break;
|
||||
case PATH_CHANGED:
|
||||
((IPathSettingsContainerListener)iter.next()).containerPathChanged(container, (IPath)oldValue, childrenAffected);
|
||||
listener.containerPathChanged(container, (IPath)oldValue, childrenAffected);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -139,9 +139,9 @@ public final class PathSettingsContainer {
|
|||
parent.notifyChange(container, type, oldValue, childrenAffected);
|
||||
}
|
||||
|
||||
private List getListenersList(boolean create){
|
||||
private List<IPathSettingsContainerListener> getListenersList(boolean create){
|
||||
if(fListeners == null && create)
|
||||
fListeners = new ArrayList();
|
||||
fListeners = new ArrayList<IPathSettingsContainerListener>();
|
||||
return fListeners;
|
||||
}
|
||||
|
||||
|
@ -163,7 +163,8 @@ public final class PathSettingsContainer {
|
|||
} else if(!exactPath){
|
||||
for(;
|
||||
container.internalGetValue() == INEXISTENT_VALUE;
|
||||
container = container.getDirectParentContainer());
|
||||
container = container.getDirectParentContainer()) {
|
||||
}
|
||||
} else if(container.internalGetValue() == INEXISTENT_VALUE){
|
||||
container = null;
|
||||
}
|
||||
|
@ -177,7 +178,7 @@ public final class PathSettingsContainer {
|
|||
}
|
||||
|
||||
public PathSettingsContainer[] getChildren(final boolean includeThis){
|
||||
final List list = new ArrayList();
|
||||
final List<PathSettingsContainer> list = new ArrayList<PathSettingsContainer>();
|
||||
accept(new IPathSettingsContainerVisitor(){
|
||||
|
||||
public boolean visit(PathSettingsContainer container) {
|
||||
|
@ -187,7 +188,7 @@ public final class PathSettingsContainer {
|
|||
}
|
||||
});
|
||||
|
||||
return (PathSettingsContainer[])list.toArray(new PathSettingsContainer[list.size()]);
|
||||
return list.toArray(new PathSettingsContainer[list.size()]);
|
||||
}
|
||||
|
||||
public PathSettingsContainer[] getChildrenForPath(IPath path, boolean includePath){
|
||||
|
@ -231,17 +232,17 @@ public final class PathSettingsContainer {
|
|||
}
|
||||
*/
|
||||
public PathSettingsContainer[] getDirectChildren(){
|
||||
List list = doGetDirectChildren(null);
|
||||
List<PathSettingsContainer> list = doGetDirectChildren(null);
|
||||
if(list == null || list.size() == 0)
|
||||
return new PathSettingsContainer[0];
|
||||
return (PathSettingsContainer[])list.toArray(new PathSettingsContainer[list.size()]);
|
||||
return list.toArray(new PathSettingsContainer[list.size()]);
|
||||
}
|
||||
|
||||
private List doGetDirectChildren(List list){
|
||||
private List<PathSettingsContainer> doGetDirectChildren(List<PathSettingsContainer> list){
|
||||
PatternNameMap pMap = getPatternChildrenMap(false);
|
||||
if(pMap != null){
|
||||
if(list == null)
|
||||
list = new ArrayList();
|
||||
list = new ArrayList<PathSettingsContainer>();
|
||||
for(Iterator iter = pMap.values().iterator(); iter.hasNext(); ){
|
||||
PathSettingsContainer cr = (PathSettingsContainer)iter.next();
|
||||
if(cr.fValue == INEXISTENT_VALUE){
|
||||
|
@ -334,9 +335,9 @@ public final class PathSettingsContainer {
|
|||
Collection c = pMap.values();
|
||||
PathSettingsContainer childContainers[] = (PathSettingsContainer[])c.toArray(new PathSettingsContainer[c.size()]);
|
||||
|
||||
for(int i = 0; i < childContainers.length; i++){
|
||||
childContainers[i].removeChildren();
|
||||
childContainers[i].remove();
|
||||
for (PathSettingsContainer childContainer : childContainers) {
|
||||
childContainer.removeChildren();
|
||||
childContainer.remove();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -427,17 +428,17 @@ public final class PathSettingsContainer {
|
|||
}
|
||||
|
||||
private PathSettingsContainer processPatterns(IPath path, int matchDepth, int depth, PatternSearchInfo psi){
|
||||
Set storeSet = psi.fStoreSet;
|
||||
Set<PathSettingsContainer> storeSet = psi.fStoreSet;
|
||||
PathSettingsContainer container = null;
|
||||
String name = path.segment(0);
|
||||
List list = getChildren(name);
|
||||
List<PathSettingsContainer> list = getChildren(name);
|
||||
PathSettingsContainer child, childFound;
|
||||
boolean exactPathFound = false;
|
||||
if(list != null){
|
||||
int size = list.size();
|
||||
|
||||
for(int i = 0; i < size; i++){
|
||||
child = (PathSettingsContainer)list.get(i);
|
||||
child = list.get(i);
|
||||
if(matchDepth == 0 && child.fValue != INEXISTENT_VALUE){
|
||||
childFound = child;
|
||||
} else {
|
||||
|
@ -613,12 +614,12 @@ public final class PathSettingsContainer {
|
|||
}
|
||||
|
||||
public void addContainerListener(IPathSettingsContainerListener listenet){
|
||||
List list = getListenersList(true);
|
||||
List<IPathSettingsContainerListener> list = getListenersList(true);
|
||||
list.add(listenet);
|
||||
}
|
||||
|
||||
public void removeContainerListener(IPathSettingsContainerListener listenet){
|
||||
List list = getListenersList(false);
|
||||
List<IPathSettingsContainerListener> list = getListenersList(false);
|
||||
if(list != null)
|
||||
list.remove(listenet);
|
||||
}
|
||||
|
@ -641,8 +642,8 @@ public final class PathSettingsContainer {
|
|||
PathSettingsContainer[] directChildren = getDirectChildren();
|
||||
if(directChildren.length != 0){
|
||||
int nextDepth = depth + 1;
|
||||
for(int i = 0; i < directChildren.length; i++){
|
||||
directChildren[i].contributeToString(buf, nextDepth);
|
||||
for (PathSettingsContainer child : directChildren) {
|
||||
child.contributeToString(buf, nextDepth);
|
||||
}
|
||||
}
|
||||
return buf;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 Intel Corporation and others.
|
||||
* Copyright (c) 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
|
||||
|
@ -59,14 +59,14 @@ public class CConfigurationDataProviderDescriptor {
|
|||
|
||||
StringTokenizer t = new StringTokenizer(value, DELIMITER);
|
||||
int num = t.countTokens();
|
||||
List list = new ArrayList(num);
|
||||
List<String> list = new ArrayList<String>(num);
|
||||
for(int i = 0; i < num; i++){
|
||||
String v = t.nextToken().trim();
|
||||
if(v.length() != 0)
|
||||
list.add(v);
|
||||
}
|
||||
|
||||
return (String[])list.toArray(new String[list.size()]);
|
||||
return list.toArray(new String[list.size()]);
|
||||
|
||||
}
|
||||
|
||||
|
@ -108,11 +108,11 @@ public class CConfigurationDataProviderDescriptor {
|
|||
}
|
||||
|
||||
public String[] getNatureIds(){
|
||||
return (String[])fNatureIds.clone();
|
||||
return fNatureIds.clone();
|
||||
}
|
||||
|
||||
public String[] getConflictingNatureIds(){
|
||||
return (String[])fConflictingNatureIds.clone();
|
||||
return fConflictingNatureIds.clone();
|
||||
}
|
||||
|
||||
/* public String[] getBuilderIds(){
|
||||
|
|
|
@ -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
|
||||
|
@ -378,7 +378,7 @@ public class CConfigurationDescriptionCache extends CDefaultConfigurationData
|
|||
@Override
|
||||
public ICSourceEntry[] getSourceEntries() {
|
||||
initSourceEntries();
|
||||
return (ICSourceEntry[])fProjSourceEntries.clone();
|
||||
return fProjSourceEntries.clone();
|
||||
}
|
||||
|
||||
private void initSourceEntries(){
|
||||
|
@ -397,11 +397,11 @@ public class CConfigurationDescriptionCache extends CDefaultConfigurationData
|
|||
throw ExceptionFactory.createIsReadOnlyException();
|
||||
}
|
||||
|
||||
public Map getReferenceInfo() {
|
||||
public Map<String, String> getReferenceInfo() {
|
||||
return getSpecSettings().getReferenceInfo();
|
||||
}
|
||||
|
||||
public void setReferenceInfo(Map refs) {
|
||||
public void setReferenceInfo(Map<String, String> refs) {
|
||||
throw ExceptionFactory.createIsReadOnlyException();
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
@ -15,7 +15,7 @@ import java.util.Arrays;
|
|||
import java.util.List;
|
||||
|
||||
class CExternalSettingChangeEvent {
|
||||
private List fChangeInfoList = new ArrayList();
|
||||
private List<CExternalSettingsContainerChangeInfo> fChangeInfoList = new ArrayList<CExternalSettingsContainerChangeInfo>();
|
||||
|
||||
CExternalSettingChangeEvent(CExternalSettingsContainerChangeInfo[] infos){
|
||||
fChangeInfoList.addAll(Arrays.asList(infos));
|
||||
|
@ -26,7 +26,7 @@ class CExternalSettingChangeEvent {
|
|||
// }
|
||||
|
||||
public CExternalSettingsContainerChangeInfo[] getChangeInfos(){
|
||||
return (CExternalSettingsContainerChangeInfo[])fChangeInfoList.toArray(
|
||||
return fChangeInfoList.toArray(
|
||||
new CExternalSettingsContainerChangeInfo[fChangeInfoList.size()]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
@ -43,7 +43,7 @@ public class ResourceDescriptionHolder {
|
|||
}
|
||||
|
||||
public void setCurrentPath(IPath path){
|
||||
//TODO: do we need to move choldren here?
|
||||
//TODO: do we need to move children here?
|
||||
fPathSettingContainer.setPath(path, true);
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ public class ResourceDescriptionHolder {
|
|||
}
|
||||
|
||||
public ICResourceDescription[] getResourceDescriptions(final int kind){
|
||||
final List list = new ArrayList();
|
||||
final List<ICResourceDescription> list = new ArrayList<ICResourceDescription>();
|
||||
fPathSettingContainer.accept(new IPathSettingsContainerVisitor(){
|
||||
|
||||
public boolean visit(PathSettingsContainer container) {
|
||||
|
@ -68,15 +68,15 @@ public class ResourceDescriptionHolder {
|
|||
});
|
||||
|
||||
if(kind == ICSettingBase.SETTING_FILE)
|
||||
return (ICFileDescription[])list.toArray(new ICFileDescription[list.size()]);
|
||||
return list.toArray(new ICFileDescription[list.size()]);
|
||||
else if(kind == ICSettingBase.SETTING_FOLDER)
|
||||
return (ICFolderDescription[])list.toArray(new ICFolderDescription[list.size()]);
|
||||
return list.toArray(new ICFolderDescription[list.size()]);
|
||||
|
||||
return (ICResourceDescription[])list.toArray(new ICResourceDescription[list.size()]);
|
||||
return list.toArray(new ICResourceDescription[list.size()]);
|
||||
}
|
||||
|
||||
public ICResourceDescription[] getResourceDescriptions(){
|
||||
final List list = new ArrayList();
|
||||
final List<Object> list = new ArrayList<Object>();
|
||||
fPathSettingContainer.accept(new IPathSettingsContainerVisitor(){
|
||||
|
||||
public boolean visit(PathSettingsContainer container) {
|
||||
|
@ -85,7 +85,7 @@ public class ResourceDescriptionHolder {
|
|||
}
|
||||
|
||||
});
|
||||
return (ICResourceDescription[])list.toArray(new ICResourceDescription[list.size()]);
|
||||
return list.toArray(new ICResourceDescription[list.size()]);
|
||||
}
|
||||
|
||||
public void removeResurceDescription(IPath path){
|
||||
|
|
Loading…
Add table
Reference in a new issue