1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-10 09:45:39 +02:00

cosmetics: generics, loops

This commit is contained in:
Andrew Gvozdev 2010-01-28 21:23:44 +00:00
parent a62de2fbe6
commit 402838f2a6

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 * 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
@ -10,7 +10,6 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.core.settings.model; package org.eclipse.cdt.internal.core.settings.model;
import java.util.Iterator;
import java.util.Map; import java.util.Map;
import org.eclipse.cdt.core.settings.model.extension.CDataObject; import org.eclipse.cdt.core.settings.model.extension.CDataObject;
@ -54,11 +53,10 @@ public class ProxyProvider implements IProxyProvider {
} }
protected void fillCache(){ protected void fillCache(){
Map map = fCache.getCachedProxiesMap(); Map<String, CDataProxy> map = fCache.getCachedProxiesMap();
CDataObject datas[] =fScope.getChildren(); CDataObject datas[] =fScope.getChildren();
for(int i = 0; i < datas.length; i++){ for (CDataObject data : datas) {
CDataObject data = datas[i];
CDataProxy proxy = fCache.getCachedProxy(data.getId()); CDataProxy proxy = fCache.getCachedProxy(data.getId());
if(proxy == null || proxy.getType() != data.getType()){ if(proxy == null || proxy.getType() != data.getType()){
proxy = fFactory.createProxy(data); proxy = fFactory.createProxy(data);
@ -72,8 +70,8 @@ public class ProxyProvider implements IProxyProvider {
} }
if(!map.isEmpty()){ if(!map.isEmpty()){
for(Iterator iter = map.values().iterator(); iter.hasNext();){ for (CDataProxy proxy : map.values()) {
fCache.removeCachedProxy((CDataProxy)iter.next()); fCache.removeCachedProxy(proxy);
} }
} }
} }
@ -105,8 +103,7 @@ public class ProxyProvider implements IProxyProvider {
if(proxies.length > 0){ if(proxies.length > 0){
CDataProxy[] tmp = new CDataProxy[proxies.length]; CDataProxy[] tmp = new CDataProxy[proxies.length];
int num = 0; int num = 0;
for(int i = 0; i < proxies.length; i++){ for (CDataProxy proxy : proxies) {
CDataProxy proxy = proxies[i];
if((proxy.getType() & kind) == proxy.getType()) if((proxy.getType() & kind) == proxy.getType())
tmp[num++] = proxy; tmp[num++] = proxy;
} }
@ -129,8 +126,8 @@ public class ProxyProvider implements IProxyProvider {
public void invalidateCache() { public void invalidateCache() {
fProxiesCached = false; fProxiesCached = false;
CDataProxy[] proxies = fCache.getCachedProxies(); CDataProxy[] proxies = fCache.getCachedProxies();
for(int i = 0; i < proxies.length; i++){ for (CDataProxy proxy : proxies) {
proxies[i].doClearData(); proxy.doClearData();
} }
} }