Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2015-01-14 15:40:20 +0000
committerAnton Leherbauer2015-01-16 09:22:57 +0000
commitef004692928ae79534da675531a4f1c421ddb055 (patch)
treed2847bc474f1d9be43f1b1479aa31ecbf65ebb87
parenta0fd70a09e044b451ee3d51f893600732b3e2c1a (diff)
downloadorg.eclipse.cdt-ef004692928ae79534da675531a4f1c421ddb055.tar.gz
org.eclipse.cdt-ef004692928ae79534da675531a4f1c421ddb055.tar.xz
org.eclipse.cdt-ef004692928ae79534da675531a4f1c421ddb055.zip
Bug 443481 - Warnings about non-existing invalid project paths
Add a hidden preference "org.eclipse.cdt.core/validate_include_entries" which allows to disable validation of include entries if set to false in plugin_customization.ini. Change-Id: Ia80f875228a459589ab8a4e6733d3e2f723f78d3 Signed-off-by: Anton Leherbauer <anton.leherbauer@windriver.com> Reviewed-on: https://git.eclipse.org/r/39642 Tested-by: Hudson CI
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryUtil.java27
1 files changed, 16 insertions, 11 deletions
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryUtil.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryUtil.java
index 5dcda13c919..b97e0d3dca5 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryUtil.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryUtil.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 QNX Software Systems and others.
+ * Copyright (c) 2000, 2015 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
@@ -47,10 +47,13 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.preferences.DefaultScope;
public class PathEntryUtil {
- static PathEntryManager manager = PathEntryManager.getDefault();
+ static final PathEntryManager manager = PathEntryManager.getDefault();
static final IMarker[] NO_MARKERS = new IMarker[0];
+ static final boolean VALIDATE_INCLUDE_ENTRIES =
+ DefaultScope.INSTANCE.getNode(CCorePlugin.PLUGIN_ID).getBoolean("validate_include_entries", true); //$NON-NLS-1$
private PathEntryUtil() {
super();
@@ -426,15 +429,17 @@ public class PathEntryUtil {
switch (entry.getEntryKind()) {
case IPathEntry.CDT_INCLUDE: {
- IIncludeEntry include = (IIncludeEntry) entry;
- IPath includePath = include.getFullIncludePath();
- if (!isValidExternalPath(includePath)) {
- return new CModelStatus(ICModelStatusConstants.INVALID_PATHENTRY,
- CoreModelMessages.getFormattedString("PathEntryManager.2", includePath.toOSString())); //$NON-NLS-1$
- }
- if (!isValidBasePath(include.getBasePath())) {
- return new CModelStatus(ICModelStatusConstants.INVALID_PATHENTRY,
- CoreModelMessages.getFormattedString("PathEntryManager.1", includePath.toOSString())); //$NON-NLS-1$
+ if (VALIDATE_INCLUDE_ENTRIES) {
+ IIncludeEntry include = (IIncludeEntry) entry;
+ IPath includePath = include.getFullIncludePath();
+ if (!isValidExternalPath(includePath)) {
+ return new CModelStatus(ICModelStatusConstants.INVALID_PATHENTRY,
+ CoreModelMessages.getFormattedString("PathEntryManager.2", includePath.toOSString())); //$NON-NLS-1$
+ }
+ if (!isValidBasePath(include.getBasePath())) {
+ return new CModelStatus(ICModelStatusConstants.INVALID_PATHENTRY,
+ CoreModelMessages.getFormattedString("PathEntryManager.1", includePath.toOSString())); //$NON-NLS-1$
+ }
}
break;
}

Back to the top