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