From 7cf13bb21cde88bef04b7c0cdc25ec3b29fe45df Mon Sep 17 00:00:00 2001 From: James Blackburn Date: Sun, 13 Feb 2011 16:29:06 +0000 Subject: [PATCH] Bug 331882 - Unnecessary calls to getProjectDescription(IProject, true) are very expensive --- .../org/eclipse/cdt/internal/core/model/TranslationUnit.java | 5 +++-- .../src/org/eclipse/cdt/core/resources/ACBuilder.java | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java index 5a7c16ea736..ded1c8d5117 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 QNX Software Systems and others. + * Copyright (c) 2000, 2011 QNX Software Systems 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 @@ -11,6 +11,7 @@ * IBM Corporation * Anton Leherbauer (Wind River Systems) * Warren Paul (Nokia) - Bug 218266 + * James Blackburn (Broadcom Corp.) *******************************************************************************/ package org.eclipse.cdt.internal.core.model; @@ -704,7 +705,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit { ICProject cProject = getCProject(); IProject project= cProject.getProject(); - ICProjectDescription description = CoreModel.getDefault().getProjectDescription(project, true); + ICProjectDescription description = CoreModel.getDefault().getProjectDescription(project, false); ICConfigurationDescription configuration; if (description == null) { diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/ACBuilder.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/ACBuilder.java index 2f4019275f2..d7569f64213 100644 --- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/ACBuilder.java +++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/ACBuilder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 QNX Software Systems and others. + * Copyright (c) 2000, 2011 QNX Software Systems 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 @@ -8,6 +8,7 @@ * Contributors: * QNX Software Systems - Initial API and implementation * IBM Corporation + * James Blackburn (Broadcom Corp.) *******************************************************************************/ package org.eclipse.cdt.core.resources; @@ -166,7 +167,7 @@ public abstract class ACBuilder extends IncrementalProjectBuilder implements IMa @SuppressWarnings("nls") private String cfgIdToNames(String strIds) { IProject project = getProject(); - ICProjectDescription prjDesc = CoreModel.getDefault().getProjectDescription(project); + ICProjectDescription prjDesc = CoreModel.getDefault().getProjectDescription(project, false); if (prjDesc==null) return strIds;