From a9f41ac547a5e95b79a324273f269d268de508ef Mon Sep 17 00:00:00 2001 From: Anton Leherbauer Date: Thu, 30 Jun 2011 10:01:54 +0200 Subject: Bug 348569 - Ever growing resource tree with cyclic symbolic links --- .../model/org/eclipse/cdt/core/model/tests/Bug311189.java | 7 ++++--- .../core/settings/model/ResourceChangeHandler.java | 14 ++++++++++---- 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'core') diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/Bug311189.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/Bug311189.java index ac957652365..3949ba43306 100644 --- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/Bug311189.java +++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/model/tests/Bug311189.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 Broadcom Corporation and others. + * Copyright (c) 2010, 2011 Broadcom 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 @@ -7,6 +7,7 @@ * * Contributors: * James Blackburn (Broadcom Corp) - initial API and implementation + * Wind River Systems - Bug 348569 *******************************************************************************/ package org.eclipse.cdt.core.model.tests; @@ -57,7 +58,7 @@ public class Bug311189 extends BaseTestCase { final IPathEntry sourceEntry = new SourceEntry(srcFolder.getFullPath(), new IPath[0]); // create a source folder and set it as a source entry - srcFolder.create(true, false, null); + srcFolder.create(true, true, null); CoreModel.setRawPathEntries(CoreModel.getDefault().create(project), new IPathEntry[] {sourceEntry}, null); IPathEntry[] rawEntries = CoreModel.getPathEntryStore(project).getRawPathEntries(); assertTrue ("Path entry unset!", Arrays.asList(rawEntries).contains(sourceEntry)); @@ -69,7 +70,7 @@ public class Bug311189 extends BaseTestCase { Job.getJobManager().beginRule(project, null); // Delete the source folder, and re-recreate it srcFolder.delete(true, null); - srcFolder.create(true, false, null); + srcFolder.create(true, true, null); } finally { Job.getJobManager().endRule(project); } diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ResourceChangeHandler.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ResourceChangeHandler.java index fc0841e672e..63684384157 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ResourceChangeHandler.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ResourceChangeHandler.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2010 Intel Corporation and others. + * Copyright (c) 2007, 2011 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 @@ -8,9 +8,11 @@ * Contributors: * Intel Corporation - Initial API and implementation * Broadcom Corporation - Bug 311189 and clean-up + * Wind River Systems - Bug 348569 *******************************************************************************/ package org.eclipse.cdt.internal.core.settings.model; +import java.net.URI; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -30,6 +32,7 @@ import org.eclipse.cdt.core.settings.model.ICSourceEntry; import org.eclipse.cdt.core.settings.model.WriteAccessException; import org.eclipse.cdt.core.settings.model.util.CDataUtil; import org.eclipse.cdt.core.settings.model.util.ResourceChangeHandlerBase; +import org.eclipse.core.filesystem.EFS; import org.eclipse.core.resources.IFolder; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; @@ -204,11 +207,14 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements // Bug 311189 -- if the resource still exists now, don't treat as a remove! if (to == null) { - // Workaround for platform Bug 317783 - if (from.getWorkspace().validateFiltered(from).isOK()) - from.refreshLocal(IResource.DEPTH_ZERO, null); if (from.exists()) continue; + // Workaround for platform Bug 317783 + if (from.getWorkspace().validateFiltered(from).isOK()) { + URI uri = from.getLocationURI(); + if (uri != null && EFS.getStore(uri).fetchInfo().exists()) + continue; + } } ICProjectDescription prjDesc = getProjectDescription(from); -- cgit v1.2.3