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
* are made available under the terms of the Eclipse Public License v1.0
* 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.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
@ -158,8 +157,11 @@ public class CConfigurationSpecSettings implements ICSettingsStorage{
if(base.fExtSettingsProvider != null)
fExtSettingsProvider = new CExternalSettingsHolder(base.fExtSettingsProvider);
if(base.fSessionPropertiesMap != null)
fSessionPropertiesMap = (HashMap<QualifiedName, Object>)base.fSessionPropertiesMap.clone();
if(base.fSessionPropertiesMap != null) {
@SuppressWarnings("unchecked")
HashMap<QualifiedName, Object> clone = (HashMap<QualifiedName, Object>)base.fSessionPropertiesMap.clone();
fSessionPropertiesMap = clone;
}
if(base.fEnvironment != null)
fEnvironment = EnvironmentVariableManager.fUserSupplier.cloneEnvironmentWithContext(fCfg, base.fEnvironment, des.isReadOnly());
@ -193,7 +195,8 @@ public class CConfigurationSpecSettings implements ICSettingsStorage{
return;
fOwnerId = ownerId;
COwnerConfiguration cfg = CProjectDescriptionManager.getInstance().getDescriptorManager().getOwnerConfiguration(fOwnerId);
CProjectDescriptionManager.getInstance().getDescriptorManager();
COwnerConfiguration cfg = CConfigBasedDescriptorManager.getOwnerConfiguration(fOwnerId);
fOwner = new COwner(cfg);
}
@ -548,6 +551,7 @@ public class CConfigurationSpecSettings implements ICSettingsStorage{
return fExtMap;
}
@SuppressWarnings("unchecked")
public Map<String, CConfigExtensionReference[]> getExtensionMapCopy(){
return (HashMap<String, CConfigExtensionReference[]>)getExtMap().clone();
}
@ -571,8 +575,8 @@ public class CConfigurationSpecSettings implements ICSettingsStorage{
Set[] delta = getReferenceDelta(extensionPointID);
if(delta != null){
if(delta[0] != null){
for(Iterator iter = delta[0].iterator(); iter.hasNext();){
ICConfigExtensionReference ref = (ICConfigExtensionReference)iter.next();
Set<ICConfigExtensionReference> extSet = delta[0];
for (ICConfigExtensionReference ref : extSet) {
try {
doRemove(ref);
} catch (CoreException e) {
@ -581,8 +585,8 @@ public class CConfigurationSpecSettings implements ICSettingsStorage{
}
}
if(delta[1] != null){
for(Iterator iter = delta[1].iterator(); iter.hasNext();){
String id = (String)iter.next();
Set<String> idSet =delta[1];
for (String id : idSet) {
try {
doCreate(extensionPointID, id);
} catch (CoreException e) {
@ -834,7 +838,9 @@ public class CConfigurationSpecSettings implements ICSettingsStorage{
private void copyExtensionInfo(CConfigurationSpecSettings other){
other.reconcileExtensionSettings(true);
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()) {
CConfigExtensionReference refs[] = entry.getValue();
refs = refs.clone();