From a96590337db68e0ecd8d7cd2a9c5030e59373182 Mon Sep 17 00:00:00 2001 From: Anton Leherbauer Date: Thu, 5 Feb 2009 09:18:51 +0000 Subject: Bug 228236 - ConcurrentModificationException when opening source file - follow up --- .../ScannerConfigProfileManager.java | 48 ++++++++++------------ 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/ScannerConfigProfileManager.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/ScannerConfigProfileManager.java index ccac962bc48..8ccb4c7eee7 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/ScannerConfigProfileManager.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig2/ScannerConfigProfileManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2008 IBM Corporation and others. + * Copyright (c) 2004, 2009 IBM 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 @@ -150,21 +150,19 @@ public final class ScannerConfigProfileManager { } /** - * @return + * @return a list of available scanner config profile id's. */ public List getProfileIds() { - if (profileIds == null) { - synchronized (fLock) { - if (profileIds == null) { - profileIds = new ArrayList(); - IExtensionPoint extension = Platform.getExtensionRegistry(). - getExtensionPoint(MakeCorePlugin.PLUGIN_ID, ScannerConfigProfileManager.SI_PROFILE_SIMPLE_ID); - if (extension != null) { - IExtension[] extensions = extension.getExtensions(); - for (int i = 0; i < extensions.length; ++i) { - String rProfileId = extensions[i].getUniqueIdentifier(); - profileIds.add(rProfileId); - } + synchronized (fLock) { + if (profileIds == null) { + profileIds = new ArrayList(); + IExtensionPoint extension = Platform.getExtensionRegistry(). + getExtensionPoint(MakeCorePlugin.PLUGIN_ID, ScannerConfigProfileManager.SI_PROFILE_SIMPLE_ID); + if (extension != null) { + IExtension[] extensions = extension.getExtensions(); + for (int i = 0; i < extensions.length; ++i) { + String rProfileId = extensions[i].getUniqueIdentifier(); + profileIds.add(rProfileId); } } } @@ -173,7 +171,7 @@ public final class ScannerConfigProfileManager { } /** - * returns the list od profile IDs supported for this context + * returns the list of profile IDs supported for this context * @param context * @return */ @@ -181,18 +179,16 @@ public final class ScannerConfigProfileManager { if(context.isDefaultContext() || context.getProject() == null) return getProfileIds(); - if(contextAwareProfileIds == null){ - synchronized (fLock) { - if(contextAwareProfileIds == null){ - contextAwareProfileIds = new ArrayList(); - List all = getProfileIds(); + synchronized (fLock) { + if(contextAwareProfileIds == null){ + contextAwareProfileIds = new ArrayList(); + List all = getProfileIds(); - for(int i = 0; i < all.size(); i++){ - String id = all.get(i); - ScannerConfigProfile profile = getSCProfileConfiguration(id); - if(profile.supportsContext()) - contextAwareProfileIds.add(id); - } + for(int i = 0; i < all.size(); i++){ + String id = all.get(i); + ScannerConfigProfile profile = getSCProfileConfiguration(id); + if(profile.supportsContext()) + contextAwareProfileIds.add(id); } } } -- cgit v1.2.3