From 5cec38091dbe01c6e0c99f7f01b19077a1ab4c8d Mon Sep 17 00:00:00 2001 From: Andrew Gvozdev Date: Sat, 23 Jan 2010 06:13:39 +0000 Subject: [PATCH] cosmetics: generics --- .../core/settings/model/CExternalSetting.java | 6 +- .../model/util/PathSettingsContainer.java | 195 +++++++++--------- .../CConfigurationDataProviderDescriptor.java | 10 +- .../model/CConfigurationDescriptionCache.java | 8 +- .../model/CExternalSettingChangeEvent.java | 6 +- .../model/ResourceDescriptionHolder.java | 16 +- 6 files changed, 121 insertions(+), 120 deletions(-) diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CExternalSetting.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CExternalSetting.java index c06072754e1..6768253b104 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CExternalSetting.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CExternalSetting.java @@ -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 fStore = new KindBasedStore(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); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathSettingsContainer.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathSettingsContainer.java index 14788e7c8f5..f4f35c94bd3 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathSettingsContainer.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathSettingsContainer.java @@ -25,7 +25,7 @@ public final class PathSettingsContainer { private static final String ROOY_PATH_NAME = Path.ROOT.toString(); // private static final boolean DEBUG = true; // private static final int INIT_CHILDREN_MAP_CAPACITY = 2; - + // private Map fChildrenMap; // private Map fPatternMap; private PatternNameMap fPatternChildrenMap; @@ -34,17 +34,17 @@ public final class PathSettingsContainer { private String fName; private PathSettingsContainer fRootContainer; private PathSettingsContainer fDirectParentContainer; - private List fListeners; - + private List fListeners; + private boolean fIsPatternMode; - + private static final int ADDED = 1; private static final int REMOVED = 2; private static final int VALUE_CHANGED = 3; private static final int PATH_CHANGED = 4; - + private static class PatternSearchInfo { - Set fStoreSet; + Set fStoreSet; int fNumDoubleStarEls; } @@ -59,7 +59,7 @@ public final class PathSettingsContainer { private PathSettingsContainer(boolean pattternMode){ this(null, null, ROOY_PATH_NAME, pattternMode); } - + private PathSettingsContainer(PathSettingsContainer root, PathSettingsContainer parent, String name, boolean patternMode){ fRootContainer = root; fDirectParentContainer = parent; @@ -72,13 +72,13 @@ public final class PathSettingsContainer { fValue = INEXISTENT_VALUE; } } - + private PatternNameMap getPatternChildrenMap(boolean create){ if(fPatternChildrenMap == null && create) fPatternChildrenMap = new PatternNameMap(); return fPatternChildrenMap; } - + private PathSettingsContainer getExacChild(String name, boolean create){ PatternNameMap pMap = getPatternChildrenMap(create); if(pMap != null){ @@ -104,7 +104,7 @@ public final class PathSettingsContainer { return null; } - private List getChildren(String name){ + private List getChildren(String name){ PatternNameMap pMap = getPatternChildrenMap(false); if(pMap != null){ return pMap.getValues(name); @@ -112,39 +112,39 @@ public final class PathSettingsContainer { return null; } - + private void notifyChange(PathSettingsContainer container, int type, Object oldValue, boolean childrenAffected){ - List list = getListenersList(false); + List 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; } - + } } PathSettingsContainer parent = getParentContainer(); if(parent != null) parent.notifyChange(container, type, oldValue, childrenAffected); } - - private List getListenersList(boolean create){ + + private List getListenersList(boolean create){ if(fListeners == null && create) - fListeners = new ArrayList(); + fListeners = new ArrayList(); return fListeners; } - + public boolean hasChildren(){ PatternNameMap pMap = getPatternChildrenMap(false); return pMap != null && pMap.size() != 0; @@ -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; } @@ -171,13 +172,13 @@ public final class PathSettingsContainer { } return container; } - + static IPath toNormalizedContainerPath(IPath path){ return Path.ROOT.append(path); } public PathSettingsContainer[] getChildren(final boolean includeThis){ - final List list = new ArrayList(); + final List list = new ArrayList(); accept(new IPathSettingsContainerVisitor(){ public boolean visit(PathSettingsContainer container) { @@ -187,9 +188,9 @@ 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){ PathSettingsContainer cr = findContainer(path, false, true, fIsPatternMode, -1, null); if(cr != null) @@ -203,22 +204,22 @@ public final class PathSettingsContainer { return cr.getDirectChildren(); return new PathSettingsContainer[0]; } - + /* public PathSettingsContainer[] getDirectChildrenForPath(IPath path, boolean searchPatterns){ if(!searchPatterns) return getDirectChildrenForPath(path); - + if(!isRoot() && !PatternNameMap.isPatternName(fName)){ return getDirectParentContainer().getDirectChildrenForPath( new Path(fName).append(path), true); } return searchPatternsDirectChildrenForPath(path); } - + private PathSettingsContainer[] searchPatternsDirectChildrenForPath(IPath path){ Set set = new HashSet(); findContainer(path, false, false, path.segmentCount(), set); - + if(DEBUG){ for(Iterator iter = set.iterator(); iter.hasNext();){ PathSettingsContainer child = (PathSettingsContainer)iter.next(); @@ -226,22 +227,22 @@ public final class PathSettingsContainer { throw new IllegalStateException(); } } - + return (PathSettingsContainer[])set.toArray(new PathSettingsContainer[set.size()]); } */ public PathSettingsContainer[] getDirectChildren(){ - List list = doGetDirectChildren(null); + List 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 doGetDirectChildren(List list){ PatternNameMap pMap = getPatternChildrenMap(false); if(pMap != null){ if(list == null) - list = new ArrayList(); + list = new ArrayList(); for(Iterator iter = pMap.values().iterator(); iter.hasNext(); ){ PathSettingsContainer cr = (PathSettingsContainer)iter.next(); if(cr.fValue == INEXISTENT_VALUE){ @@ -253,7 +254,7 @@ public final class PathSettingsContainer { } return list; } - + public Object[] getValues(final boolean includeThis){ final List list = new ArrayList(); accept(new IPathSettingsContainerVisitor(){ @@ -273,13 +274,13 @@ public final class PathSettingsContainer { return fDirectParentContainer.getValidContainer(); return null; } - + private PathSettingsContainer getValidContainer(){ if(internalGetValue() == INEXISTENT_VALUE) return getDirectParentContainer().getValidContainer(); return this; } - + public Object removeChildContainer(IPath path){ PathSettingsContainer container = getChildContainer(path, false, true); Object value = null; @@ -289,7 +290,7 @@ public final class PathSettingsContainer { } return value; } - + public void remove(){ if(!isValid()) return; @@ -307,12 +308,12 @@ public final class PathSettingsContainer { fRootContainer = null; } } - + private void checkRemove(){ if(fValue == INEXISTENT_VALUE && !hasChildren()) remove(); } - + private void disconnectChild(PathSettingsContainer child){ getPatternChildrenMap(true).remove(child.getName()); } @@ -324,26 +325,26 @@ public final class PathSettingsContainer { public boolean isValid(){ return fValue != INEXISTENT_VALUE && fRootContainer != null; } - + public void removeChildren(){ PatternNameMap pMap = getPatternChildrenMap(false); if(pMap == null || pMap.size() == 0) return; - - + + 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(); } } - + private void deleteChild(PathSettingsContainer child){ getPatternChildrenMap(false).remove(child.getName()); } - + private String getName(){ return fName; } @@ -368,7 +369,7 @@ public final class PathSettingsContainer { // if(list != null){ // int size = list.size(); // PathSettingsContainer child, childFound; -// +// // for(int i = 0; i < size; i++){ // child = (PathSettingsContainer)list.get(i); // if(directChildren && child.fValue != INEXISTENT_VALUE){ @@ -378,8 +379,8 @@ public final class PathSettingsContainer { // } // // if(childFound.fValue != INEXISTENT_VALUE){ -// if(container == null -// || container.getValue() == INEXISTENT_VALUE +// if(container == null +// || container.getValue() == INEXISTENT_VALUE // || container.getPath().segmentCount() < childFound.getPath().segmentCount()){ // container = childFound; // } @@ -393,7 +394,7 @@ public final class PathSettingsContainer { // if(dsChild != null && !storeSet.contains(dsChild)){ // container = dsChild.findContainer(path, false, false, directChildren, storeSet); // } -// +// // if(container == null){ // if(isDoubleStarName()){ // if(path.segmentCount() != 0){ @@ -410,7 +411,7 @@ public final class PathSettingsContainer { } return container; } - + static boolean pathsEqual(IPath p1, IPath p2) { if (p1 == p2) return true; @@ -422,22 +423,22 @@ public final class PathSettingsContainer { while (--i >= 0) if (!p1.segment(i).equals(p2.segment(i))) return false; - + return true; } - + private PathSettingsContainer processPatterns(IPath path, int matchDepth, int depth, PatternSearchInfo psi){ - Set storeSet = psi.fStoreSet; + Set storeSet = psi.fStoreSet; PathSettingsContainer container = null; String name = path.segment(0); - List list = getChildren(name); + List 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 { @@ -445,14 +446,14 @@ public final class PathSettingsContainer { } if(childFound != null && childFound.fValue != INEXISTENT_VALUE){ - if(!exactPathFound + if(!exactPathFound && path.segmentCount() == 1 && child != childFound && name.equals(childFound.fName)){ container = childFound; exactPathFound = true; - } else if(container == null - || container.getValue() == INEXISTENT_VALUE + } else if(container == null + || container.getValue() == INEXISTENT_VALUE || container.getPath().segmentCount() < childFound.getPath().segmentCount()){ container = childFound; } @@ -472,11 +473,11 @@ public final class PathSettingsContainer { } else { childFound = child.findContainer(path, false, false, true, matchDepth, psi); } - + if(childFound != null && childFound.fValue != INEXISTENT_VALUE){ psi.fNumDoubleStarEls++; - if(container == null - || container.getValue() == INEXISTENT_VALUE + if(container == null + || container.getValue() == INEXISTENT_VALUE || container.getPath().segmentCount() < childFound.getPath().segmentCount() + depth - psi.fNumDoubleStarEls){ container = childFound; } @@ -484,7 +485,7 @@ public final class PathSettingsContainer { storeSet.add(container); } } - + if(container == null){ if(isDoubleStarName()){ if(path.segmentCount() > 1){ @@ -504,19 +505,19 @@ public final class PathSettingsContainer { } return container; } - + private int stepDepth(int depth){ return depth == 0 ? depth : depth-1; } - + public void accept(IPathSettingsContainerVisitor visitor){ doAccept(visitor); } - + private boolean doAccept(IPathSettingsContainerVisitor visitor){ if(fValue != INEXISTENT_VALUE && !visitor.visit(this)) return false; - + PatternNameMap pMap = getPatternChildrenMap(false); if(pMap != null){ for(Iterator iter = pMap.values().iterator(); iter.hasNext();){ @@ -527,8 +528,8 @@ public final class PathSettingsContainer { } return true; } - - + + public IPath getPath(){ if(fPath == null){ if(fDirectParentContainer != null) @@ -538,15 +539,15 @@ public final class PathSettingsContainer { } return fPath; } - + public void setPath(IPath path, boolean moveChildren){ if(path == null || isRoot() || path.equals(getPath()) || path.segmentCount() == 0) return; IPath oldPath = getPath(); - + fDirectParentContainer.disconnectChild(this); - + if(!moveChildren){ if(hasChildren()){ PathSettingsContainer cr = new PathSettingsContainer(fRootContainer, fDirectParentContainer, fName, fIsPatternMode); @@ -558,9 +559,9 @@ public final class PathSettingsContainer { } } } else { - + } - + PathSettingsContainer newParent = fRootContainer.findContainer(path.removeLastSegments(1), true, true, false, -1, null); PathSettingsContainer oldParent = fDirectParentContainer; fName = path.segment(path.segmentCount()-1); @@ -568,19 +569,19 @@ public final class PathSettingsContainer { setParent(newParent); newParent.connectChild(this); - + oldParent.checkRemove(); notifyChange(this, PATH_CHANGED, oldPath, moveChildren); } - + private Object internalGetValue(){ return fValue; } - + public boolean isRoot(){ return fRootContainer == this; } - + private Object internalSetValue(Object value){ Object oldValue = fValue; fValue = value; @@ -591,38 +592,38 @@ public final class PathSettingsContainer { } return oldValue; } - + public Object setValue(Object value){ if(fValue == INEXISTENT_VALUE) throw new IllegalStateException(); return internalSetValue(value); } - + public Object getValue(){ if(fValue == INEXISTENT_VALUE) throw new IllegalStateException(); return fValue; } - + public PathSettingsContainer getRootContainer(){ return fRootContainer; } - + private PathSettingsContainer getDirectParentContainer(){ return fDirectParentContainer; } - + public void addContainerListener(IPathSettingsContainerListener listenet){ - List list = getListenersList(true); + List list = getListenersList(true); list.add(listenet); } public void removeContainerListener(IPathSettingsContainerListener listenet){ - List list = getListenersList(false); + List list = getListenersList(false); if(list != null) list.remove(listenet); } - + private void setParent(PathSettingsContainer parent){ fDirectParentContainer = parent; } @@ -631,7 +632,7 @@ public final class PathSettingsContainer { public String toString() { return contributeToString(new StringBuffer(), 0).toString(); } - + private StringBuffer contributeToString(StringBuffer buf, int depth){ for (int i= 0; i < depth; i++) { buf.append('\t'); @@ -641,13 +642,13 @@ 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; } - + static boolean hasSpecChars(IPath path){ int count = path.segmentCount(); for(int i = 0; i < count; i++){ diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationDataProviderDescriptor.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationDataProviderDescriptor.java index b1ae62263e7..2a2cd85d3c6 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationDataProviderDescriptor.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationDataProviderDescriptor.java @@ -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 list = new ArrayList(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(){ diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationDescriptionCache.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationDescriptionCache.java index e2ee9b9d29a..95f54d667c7 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationDescriptionCache.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationDescriptionCache.java @@ -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 getReferenceInfo() { return getSpecSettings().getReferenceInfo(); } - public void setReferenceInfo(Map refs) { + public void setReferenceInfo(Map refs) { throw ExceptionFactory.createIsReadOnlyException(); } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CExternalSettingChangeEvent.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CExternalSettingChangeEvent.java index 13028d3dd13..01e23317e93 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CExternalSettingChangeEvent.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CExternalSettingChangeEvent.java @@ -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 fChangeInfoList = new ArrayList(); 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()]); } } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ResourceDescriptionHolder.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ResourceDescriptionHolder.java index c8339b45e07..6cca262c6a1 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ResourceDescriptionHolder.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ResourceDescriptionHolder.java @@ -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 list = new ArrayList(); 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 list = new ArrayList(); 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){