1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

cosmetics: generics/enhanced loops

This commit is contained in:
Andrew Gvozdev 2010-01-25 15:47:23 +00:00
parent f3bd8f6e30
commit d0ef57bff8

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2007, 2009 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
@ -14,7 +14,6 @@ package org.eclipse.cdt.internal.core.settings.model;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
@ -158,8 +157,11 @@ public class CConfigurationSpecSettings implements ICSettingsStorage{
if(base.fExtSettingsProvider != null) if(base.fExtSettingsProvider != null)
fExtSettingsProvider = new CExternalSettingsHolder(base.fExtSettingsProvider); fExtSettingsProvider = new CExternalSettingsHolder(base.fExtSettingsProvider);
if(base.fSessionPropertiesMap != null) if(base.fSessionPropertiesMap != null) {
fSessionPropertiesMap = (HashMap<QualifiedName, Object>)base.fSessionPropertiesMap.clone(); @SuppressWarnings("unchecked")
HashMap<QualifiedName, Object> clone = (HashMap<QualifiedName, Object>)base.fSessionPropertiesMap.clone();
fSessionPropertiesMap = clone;
}
if(base.fEnvironment != null) if(base.fEnvironment != null)
fEnvironment = EnvironmentVariableManager.fUserSupplier.cloneEnvironmentWithContext(fCfg, base.fEnvironment, des.isReadOnly()); fEnvironment = EnvironmentVariableManager.fUserSupplier.cloneEnvironmentWithContext(fCfg, base.fEnvironment, des.isReadOnly());
@ -193,7 +195,8 @@ public class CConfigurationSpecSettings implements ICSettingsStorage{
return; return;
fOwnerId = ownerId; fOwnerId = ownerId;
COwnerConfiguration cfg = CProjectDescriptionManager.getInstance().getDescriptorManager().getOwnerConfiguration(fOwnerId); CProjectDescriptionManager.getInstance().getDescriptorManager();
COwnerConfiguration cfg = CConfigBasedDescriptorManager.getOwnerConfiguration(fOwnerId);
fOwner = new COwner(cfg); fOwner = new COwner(cfg);
} }
@ -548,6 +551,7 @@ public class CConfigurationSpecSettings implements ICSettingsStorage{
return fExtMap; return fExtMap;
} }
@SuppressWarnings("unchecked")
public Map<String, CConfigExtensionReference[]> getExtensionMapCopy(){ public Map<String, CConfigExtensionReference[]> getExtensionMapCopy(){
return (HashMap<String, CConfigExtensionReference[]>)getExtMap().clone(); return (HashMap<String, CConfigExtensionReference[]>)getExtMap().clone();
} }
@ -571,8 +575,8 @@ public class CConfigurationSpecSettings implements ICSettingsStorage{
Set[] delta = getReferenceDelta(extensionPointID); Set[] delta = getReferenceDelta(extensionPointID);
if(delta != null){ if(delta != null){
if(delta[0] != null){ if(delta[0] != null){
for(Iterator iter = delta[0].iterator(); iter.hasNext();){ Set<ICConfigExtensionReference> extSet = delta[0];
ICConfigExtensionReference ref = (ICConfigExtensionReference)iter.next(); for (ICConfigExtensionReference ref : extSet) {
try { try {
doRemove(ref); doRemove(ref);
} catch (CoreException e) { } catch (CoreException e) {
@ -581,8 +585,8 @@ public class CConfigurationSpecSettings implements ICSettingsStorage{
} }
} }
if(delta[1] != null){ if(delta[1] != null){
for(Iterator iter = delta[1].iterator(); iter.hasNext();){ Set<String> idSet =delta[1];
String id = (String)iter.next(); for (String id : idSet) {
try { try {
doCreate(extensionPointID, id); doCreate(extensionPointID, id);
} catch (CoreException e) { } catch (CoreException e) {
@ -834,7 +838,9 @@ public class CConfigurationSpecSettings implements ICSettingsStorage{
private void copyExtensionInfo(CConfigurationSpecSettings other){ private void copyExtensionInfo(CConfigurationSpecSettings other){
other.reconcileExtensionSettings(true); other.reconcileExtensionSettings(true);
if(other.fExtMap != null && other.fExtMap.size() != 0){ if(other.fExtMap != null && other.fExtMap.size() != 0){
fExtMap = (HashMap<String, CConfigExtensionReference[]>)other.fExtMap.clone(); @SuppressWarnings("unchecked")
HashMap<String, CConfigExtensionReference[]> clone = (HashMap<String, CConfigExtensionReference[]>)other.fExtMap.clone();
fExtMap = clone;
for (Map.Entry<String, CConfigExtensionReference[]> entry : fExtMap.entrySet()) { for (Map.Entry<String, CConfigExtensionReference[]> entry : fExtMap.entrySet()) {
CConfigExtensionReference refs[] = entry.getValue(); CConfigExtensionReference refs[] = entry.getValue();
refs = refs.clone(); refs = refs.clone();