1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-28 19:35:36 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2011-05-24 03:06:55 +00:00
parent 2d93ca6df4
commit 7b391787c6

View file

@ -43,7 +43,6 @@ import org.eclipse.cdt.ui.CUIPlugin;
*/ */
@Deprecated @Deprecated
public class CPElement { public class CPElement {
public static final String SOURCEATTACHMENT = "sourcepath"; //$NON-NLS-1$ public static final String SOURCEATTACHMENT = "sourcepath"; //$NON-NLS-1$
public static final String SOURCEATTACHMENTROOT = "rootpath"; //$NON-NLS-1$ public static final String SOURCEATTACHMENTROOT = "rootpath"; //$NON-NLS-1$
public static final String EXCLUSION = "exclusion"; //$NON-NLS-1$ public static final String EXCLUSION = "exclusion"; //$NON-NLS-1$
@ -96,45 +95,45 @@ public class CPElement {
fCachedEntry = null; fCachedEntry = null;
switch (entryKind) { switch (entryKind) {
case IPathEntry.CDT_OUTPUT : case IPathEntry.CDT_OUTPUT:
createAttributeElement(EXCLUSION, new Path[0]); createAttributeElement(EXCLUSION, new Path[0]);
break; break;
case IPathEntry.CDT_SOURCE : case IPathEntry.CDT_SOURCE:
createAttributeElement(EXCLUSION, new Path[0]); createAttributeElement(EXCLUSION, new Path[0]);
break; break;
case IPathEntry.CDT_LIBRARY : case IPathEntry.CDT_LIBRARY:
createAttributeElement(LIBRARY, new Path("")); //$NON-NLS-1$ createAttributeElement(LIBRARY, new Path("")); //$NON-NLS-1$
createAttributeElement(SOURCEATTACHMENT, null); createAttributeElement(SOURCEATTACHMENT, null);
createAttributeElement(BASE_REF, new Path("")); //$NON-NLS-1$ createAttributeElement(BASE_REF, new Path("")); //$NON-NLS-1$
createAttributeElement(BASE, new Path("")); //$NON-NLS-1$ createAttributeElement(BASE, new Path("")); //$NON-NLS-1$
break; break;
case IPathEntry.CDT_INCLUDE : case IPathEntry.CDT_INCLUDE:
createAttributeElement(INCLUDE, new Path("")); //$NON-NLS-1$ createAttributeElement(INCLUDE, new Path("")); //$NON-NLS-1$
createAttributeElement(EXCLUSION, new Path[0]); createAttributeElement(EXCLUSION, new Path[0]);
createAttributeElement(SYSTEM_INCLUDE, Boolean.valueOf(true)); createAttributeElement(SYSTEM_INCLUDE, Boolean.valueOf(true));
createAttributeElement(BASE_REF, new Path("")); //$NON-NLS-1$ createAttributeElement(BASE_REF, new Path("")); //$NON-NLS-1$
createAttributeElement(BASE, new Path("")); //$NON-NLS-1$ createAttributeElement(BASE, new Path("")); //$NON-NLS-1$
break; break;
case IPathEntry.CDT_INCLUDE_FILE : case IPathEntry.CDT_INCLUDE_FILE:
createAttributeElement(INCLUDE_FILE, new Path("")); //$NON-NLS-1$ createAttributeElement(INCLUDE_FILE, new Path("")); //$NON-NLS-1$
createAttributeElement(EXCLUSION, new Path[0]); createAttributeElement(EXCLUSION, new Path[0]);
createAttributeElement(BASE_REF, new Path("")); //$NON-NLS-1$ createAttributeElement(BASE_REF, new Path("")); //$NON-NLS-1$
createAttributeElement(BASE, new Path("")); //$NON-NLS-1$ createAttributeElement(BASE, new Path("")); //$NON-NLS-1$
break; break;
case IPathEntry.CDT_MACRO : case IPathEntry.CDT_MACRO:
createAttributeElement(MACRO_NAME, ""); //$NON-NLS-1$ createAttributeElement(MACRO_NAME, ""); //$NON-NLS-1$
createAttributeElement(MACRO_VALUE, ""); //$NON-NLS-1$ createAttributeElement(MACRO_VALUE, ""); //$NON-NLS-1$
createAttributeElement(EXCLUSION, new Path[0]); createAttributeElement(EXCLUSION, new Path[0]);
createAttributeElement(BASE_REF, new Path("")); //$NON-NLS-1$ createAttributeElement(BASE_REF, new Path("")); //$NON-NLS-1$
createAttributeElement(BASE, new Path("")); //$NON-NLS-1$ createAttributeElement(BASE, new Path("")); //$NON-NLS-1$
break; break;
case IPathEntry.CDT_MACRO_FILE : case IPathEntry.CDT_MACRO_FILE:
createAttributeElement(MACROS_FILE, new Path("")); //$NON-NLS-1$ createAttributeElement(MACROS_FILE, new Path("")); //$NON-NLS-1$
createAttributeElement(EXCLUSION, new Path[0]); createAttributeElement(EXCLUSION, new Path[0]);
createAttributeElement(BASE_REF, new Path("")); //$NON-NLS-1$ createAttributeElement(BASE_REF, new Path("")); //$NON-NLS-1$
createAttributeElement(BASE, new Path("")); //$NON-NLS-1$ createAttributeElement(BASE, new Path("")); //$NON-NLS-1$
break; break;
case IPathEntry.CDT_CONTAINER : case IPathEntry.CDT_CONTAINER:
try { try {
IPathEntryContainer container = CoreModel.getPathEntryContainer(fPath, fCProject); IPathEntryContainer container = CoreModel.getPathEntryContainer(fPath, fCProject);
if (container != null) { if (container != null) {
@ -145,8 +144,7 @@ public class CPElement {
entries = extContainer.getPathEntries(res.getFullPath(), entries = extContainer.getPathEntries(res.getFullPath(),
IPathEntry.CDT_INCLUDE | IPathEntry.CDT_MACRO | IPathEntry.CDT_INCLUDE | IPathEntry.CDT_MACRO |
IPathEntry.CDT_INCLUDE_FILE | IPathEntry.CDT_MACRO_FILE); IPathEntry.CDT_INCLUDE_FILE | IPathEntry.CDT_MACRO_FILE);
} } else {
else {
entries = container.getPathEntries(); entries = container.getPathEntries();
} }
for (IPathEntry entrie : entries) { for (IPathEntry entrie : entries) {
@ -165,7 +163,8 @@ public class CPElement {
} catch (CModelException e) { } catch (CModelException e) {
} }
break; break;
default : default:
break;
} }
} }
@ -184,22 +183,22 @@ public class CPElement {
IPath base = (IPath)getAttribute(BASE); IPath base = (IPath)getAttribute(BASE);
IPath baseRef = (IPath)getAttribute(BASE_REF); IPath baseRef = (IPath)getAttribute(BASE_REF);
switch (fEntryKind) { switch (fEntryKind) {
case IPathEntry.CDT_OUTPUT : case IPathEntry.CDT_OUTPUT:
return CoreModel.newOutputEntry(fPath, exclusionPattern); return CoreModel.newOutputEntry(fPath, exclusionPattern);
case IPathEntry.CDT_SOURCE : case IPathEntry.CDT_SOURCE:
return CoreModel.newSourceEntry(fPath, exclusionPattern); return CoreModel.newSourceEntry(fPath, exclusionPattern);
case IPathEntry.CDT_LIBRARY : case IPathEntry.CDT_LIBRARY:
IPath libraryPath = (IPath)getAttribute(LIBRARY); IPath libraryPath = (IPath)getAttribute(LIBRARY);
IPath attach = (IPath)getAttribute(SOURCEATTACHMENT); IPath attach = (IPath)getAttribute(SOURCEATTACHMENT);
if (!baseRef.isEmpty()) { if (!baseRef.isEmpty()) {
return CoreModel.newLibraryRefEntry(fPath, baseRef, libraryPath); return CoreModel.newLibraryRefEntry(fPath, baseRef, libraryPath);
} }
return CoreModel.newLibraryEntry(fPath, base, libraryPath, attach, null, null, isExported()); return CoreModel.newLibraryEntry(fPath, base, libraryPath, attach, null, null, isExported());
case IPathEntry.CDT_PROJECT : case IPathEntry.CDT_PROJECT:
return CoreModel.newProjectEntry(fPath, isExported()); return CoreModel.newProjectEntry(fPath, isExported());
case IPathEntry.CDT_CONTAINER : case IPathEntry.CDT_CONTAINER:
return CoreModel.newContainerEntry(fPath, isExported()); return CoreModel.newContainerEntry(fPath, isExported());
case IPathEntry.CDT_INCLUDE : case IPathEntry.CDT_INCLUDE:
IPath include = (IPath)getAttribute(INCLUDE); IPath include = (IPath)getAttribute(INCLUDE);
if (!baseRef.isEmpty()) { if (!baseRef.isEmpty()) {
return CoreModel.newIncludeRefEntry(fPath, baseRef, include); return CoreModel.newIncludeRefEntry(fPath, baseRef, include);
@ -210,18 +209,18 @@ public class CPElement {
IPath includeFile = (IPath)getAttribute(INCLUDE_FILE); IPath includeFile = (IPath)getAttribute(INCLUDE_FILE);
return CoreModel.newIncludeFileEntry(fPath, baseRef, base, includeFile, return CoreModel.newIncludeFileEntry(fPath, baseRef, base, includeFile,
exclusionPattern, isExported()); exclusionPattern, isExported());
case IPathEntry.CDT_MACRO : case IPathEntry.CDT_MACRO:
String macroName = (String)getAttribute(MACRO_NAME); String macroName = (String)getAttribute(MACRO_NAME);
String macroValue = (String)getAttribute(MACRO_VALUE); String macroValue = (String)getAttribute(MACRO_VALUE);
if (!baseRef.isEmpty()) { if (!baseRef.isEmpty()) {
return CoreModel.newMacroRefEntry(fPath, baseRef, macroName); return CoreModel.newMacroRefEntry(fPath, baseRef, macroName);
} }
return CoreModel.newMacroEntry(fPath, macroName, macroValue, exclusionPattern, isExported()); return CoreModel.newMacroEntry(fPath, macroName, macroValue, exclusionPattern, isExported());
case IPathEntry.CDT_MACRO_FILE : case IPathEntry.CDT_MACRO_FILE:
IPath macrosFile = (IPath)getAttribute(MACROS_FILE); IPath macrosFile = (IPath)getAttribute(MACROS_FILE);
return CoreModel.newMacroFileEntry(fPath, baseRef, base, macrosFile, return CoreModel.newMacroFileEntry(fPath, baseRef, base, macrosFile,
exclusionPattern, isExported()); exclusionPattern, isExported());
default : default:
return null; return null;
} }
} }
@ -241,19 +240,19 @@ public class CPElement {
appendEncodePath(fPath, buf).append(';'); appendEncodePath(fPath, buf).append(';');
buf.append(Boolean.valueOf(fIsExported)).append(';'); buf.append(Boolean.valueOf(fIsExported)).append(';');
switch (fEntryKind) { switch (fEntryKind) {
case IPathEntry.CDT_OUTPUT : case IPathEntry.CDT_OUTPUT:
case IPathEntry.CDT_SOURCE : case IPathEntry.CDT_SOURCE:
case IPathEntry.CDT_INCLUDE : case IPathEntry.CDT_INCLUDE:
case IPathEntry.CDT_INCLUDE_FILE : case IPathEntry.CDT_INCLUDE_FILE:
case IPathEntry.CDT_MACRO : case IPathEntry.CDT_MACRO:
case IPathEntry.CDT_MACRO_FILE : case IPathEntry.CDT_MACRO_FILE:
IPath[] exclusion = (IPath[])getAttribute(EXCLUSION); IPath[] exclusion = (IPath[])getAttribute(EXCLUSION);
buf.append('[').append(exclusion.length).append(']'); buf.append('[').append(exclusion.length).append(']');
for (IPath element : exclusion) { for (IPath element : exclusion) {
appendEncodePath(element, buf); appendEncodePath(element, buf);
} }
switch (fEntryKind) { switch (fEntryKind) {
case IPathEntry.CDT_INCLUDE : case IPathEntry.CDT_INCLUDE:
IPath baseRef = (IPath)getAttribute(BASE_REF); IPath baseRef = (IPath)getAttribute(BASE_REF);
appendEncodePath(baseRef, buf); appendEncodePath(baseRef, buf);
IPath base = (IPath)getAttribute(BASE); IPath base = (IPath)getAttribute(BASE);
@ -261,7 +260,7 @@ public class CPElement {
IPath include = (IPath)getAttribute(INCLUDE); IPath include = (IPath)getAttribute(INCLUDE);
appendEncodePath(include, buf); appendEncodePath(include, buf);
break; break;
case IPathEntry.CDT_INCLUDE_FILE : case IPathEntry.CDT_INCLUDE_FILE:
baseRef = (IPath)getAttribute(BASE_REF); baseRef = (IPath)getAttribute(BASE_REF);
appendEncodePath(baseRef, buf); appendEncodePath(baseRef, buf);
base = (IPath)getAttribute(BASE); base = (IPath)getAttribute(BASE);
@ -269,7 +268,7 @@ public class CPElement {
IPath includeFile = (IPath)getAttribute(INCLUDE_FILE); IPath includeFile = (IPath)getAttribute(INCLUDE_FILE);
appendEncodePath(includeFile, buf); appendEncodePath(includeFile, buf);
break; break;
case IPathEntry.CDT_MACRO : case IPathEntry.CDT_MACRO:
baseRef = (IPath)getAttribute(BASE_REF); baseRef = (IPath)getAttribute(BASE_REF);
appendEncodePath(baseRef, buf); appendEncodePath(baseRef, buf);
base = (IPath)getAttribute(BASE); base = (IPath)getAttribute(BASE);
@ -277,7 +276,7 @@ public class CPElement {
String symbol = (String)getAttribute(MACRO_NAME); String symbol = (String)getAttribute(MACRO_NAME);
buf.append(symbol).append(';'); buf.append(symbol).append(';');
break; break;
case IPathEntry.CDT_MACRO_FILE : case IPathEntry.CDT_MACRO_FILE:
baseRef = (IPath)getAttribute(BASE_REF); baseRef = (IPath)getAttribute(BASE_REF);
appendEncodePath(baseRef, buf); appendEncodePath(baseRef, buf);
base = (IPath)getAttribute(BASE); base = (IPath)getAttribute(BASE);
@ -285,10 +284,11 @@ public class CPElement {
IPath macrosFile = (IPath)getAttribute(MACROS_FILE); IPath macrosFile = (IPath)getAttribute(MACROS_FILE);
appendEncodePath(macrosFile, buf); appendEncodePath(macrosFile, buf);
break; break;
default : default:
break;
} }
break; break;
case IPathEntry.CDT_LIBRARY : case IPathEntry.CDT_LIBRARY:
IPath baseRef = (IPath)getAttribute(BASE_REF); IPath baseRef = (IPath)getAttribute(BASE_REF);
appendEncodePath(baseRef, buf); appendEncodePath(baseRef, buf);
IPath base = (IPath)getAttribute(BASE); IPath base = (IPath)getAttribute(BASE);
@ -298,7 +298,8 @@ public class CPElement {
IPath library = (IPath)getAttribute(LIBRARY); IPath library = (IPath)getAttribute(LIBRARY);
appendEncodePath(library, buf); appendEncodePath(library, buf);
break; break;
default : default:
break;
} }
buf.setLength(buf.length() - 1); buf.setLength(buf.length() - 1);
return buf; return buf;
@ -344,8 +345,7 @@ public class CPElement {
if (group != null) { if (group != null) {
createAttributeElement(PARENT, group); createAttributeElement(PARENT, group);
} }
} } else {
else {
attribute.setValue(group); attribute.setValue(group);
} }
} }
@ -395,20 +395,20 @@ public class CPElement {
public Object[] getChildren() { public Object[] getChildren() {
switch (fEntryKind) { switch (fEntryKind) {
case IPathEntry.CDT_OUTPUT : case IPathEntry.CDT_OUTPUT:
case IPathEntry.CDT_SOURCE : case IPathEntry.CDT_SOURCE:
case IPathEntry.CDT_INCLUDE : case IPathEntry.CDT_INCLUDE:
case IPathEntry.CDT_INCLUDE_FILE : case IPathEntry.CDT_INCLUDE_FILE:
case IPathEntry.CDT_MACRO : case IPathEntry.CDT_MACRO:
case IPathEntry.CDT_MACRO_FILE : case IPathEntry.CDT_MACRO_FILE:
if (getInherited() == null && getParentContainer() == null) { if (getInherited() == null && getParentContainer() == null) {
return new Object[]{findAttributeElement(EXCLUSION)}; return new Object[]{findAttributeElement(EXCLUSION)};
} }
break; break;
// case IPathEntry.CDT_LIBRARY : // case IPathEntry.CDT_LIBRARY:
// return new Object[] { findAttributeElement(SOURCEATTACHMENT) }; // return new Object[] { findAttributeElement(SOURCEATTACHMENT) };
case IPathEntry.CDT_CONTAINER : { case IPathEntry.CDT_CONTAINER: {
List<Object> list = new ArrayList<Object>(); List<Object> list = new ArrayList<Object>();
for (int i = 0; i < fChildren.size(); i++) { for (int i = 0; i < fChildren.size(); i++) {
Object curr = fChildren.get(i); Object curr = fChildren.get(i);
@ -438,23 +438,23 @@ public class CPElement {
return false; return false;
} }
switch (fEntryKind) { switch (fEntryKind) {
case IPathEntry.CDT_LIBRARY : case IPathEntry.CDT_LIBRARY:
return (getAttribute(LIBRARY).equals(elem.getAttribute(LIBRARY)) return (getAttribute(LIBRARY).equals(elem.getAttribute(LIBRARY))
&& getAttribute(BASE).equals(elem.getAttribute(BASE)) && getAttribute(BASE_REF).equals( && getAttribute(BASE).equals(elem.getAttribute(BASE)) && getAttribute(BASE_REF).equals(
elem.getAttribute(BASE_REF))); elem.getAttribute(BASE_REF)));
case IPathEntry.CDT_INCLUDE : case IPathEntry.CDT_INCLUDE:
return (getAttribute(INCLUDE).equals(elem.getAttribute(INCLUDE)) return (getAttribute(INCLUDE).equals(elem.getAttribute(INCLUDE))
&& getAttribute(BASE_REF).equals(elem.getAttribute(BASE_REF)) && getAttribute(BASE).equals( && getAttribute(BASE_REF).equals(elem.getAttribute(BASE_REF)) && getAttribute(BASE).equals(
elem.getAttribute(BASE))); elem.getAttribute(BASE)));
case IPathEntry.CDT_INCLUDE_FILE : case IPathEntry.CDT_INCLUDE_FILE:
return (getAttribute(INCLUDE_FILE).equals(elem.getAttribute(INCLUDE_FILE)) return (getAttribute(INCLUDE_FILE).equals(elem.getAttribute(INCLUDE_FILE))
&& getAttribute(BASE_REF).equals(elem.getAttribute(BASE_REF)) && getAttribute(BASE).equals( && getAttribute(BASE_REF).equals(elem.getAttribute(BASE_REF)) && getAttribute(BASE).equals(
elem.getAttribute(BASE))); elem.getAttribute(BASE)));
case IPathEntry.CDT_MACRO : case IPathEntry.CDT_MACRO:
return (getAttribute(MACRO_NAME).equals(elem.getAttribute(MACRO_NAME)) return (getAttribute(MACRO_NAME).equals(elem.getAttribute(MACRO_NAME))
&& getAttribute(BASE_REF).equals(elem.getAttribute(BASE_REF)) && getAttribute(BASE).equals( && getAttribute(BASE_REF).equals(elem.getAttribute(BASE_REF)) && getAttribute(BASE).equals(
elem.getAttribute(BASE))); elem.getAttribute(BASE)));
case IPathEntry.CDT_MACRO_FILE : case IPathEntry.CDT_MACRO_FILE:
return (getAttribute(MACROS_FILE).equals(elem.getAttribute(MACROS_FILE)) return (getAttribute(MACROS_FILE).equals(elem.getAttribute(MACROS_FILE))
&& getAttribute(BASE_REF).equals(elem.getAttribute(BASE_REF)) && getAttribute(BASE).equals( && getAttribute(BASE_REF).equals(elem.getAttribute(BASE_REF)) && getAttribute(BASE).equals(
elem.getAttribute(BASE))); elem.getAttribute(BASE)));
@ -472,27 +472,27 @@ public class CPElement {
final int HASH_FACTOR = 89; final int HASH_FACTOR = 89;
int hashCode = fPath.hashCode() + fEntryKind; int hashCode = fPath.hashCode() + fEntryKind;
switch (fEntryKind) { switch (fEntryKind) {
case IPathEntry.CDT_LIBRARY : case IPathEntry.CDT_LIBRARY:
hashCode = hashCode * HASH_FACTOR + getAttribute(LIBRARY).hashCode(); hashCode = hashCode * HASH_FACTOR + getAttribute(LIBRARY).hashCode();
hashCode = hashCode * HASH_FACTOR + getAttribute(BASE).hashCode(); hashCode = hashCode * HASH_FACTOR + getAttribute(BASE).hashCode();
hashCode = hashCode * HASH_FACTOR + getAttribute(BASE_REF).hashCode(); hashCode = hashCode * HASH_FACTOR + getAttribute(BASE_REF).hashCode();
break; break;
case IPathEntry.CDT_INCLUDE : case IPathEntry.CDT_INCLUDE:
hashCode = hashCode * HASH_FACTOR + getAttribute(INCLUDE).hashCode(); hashCode = hashCode * HASH_FACTOR + getAttribute(INCLUDE).hashCode();
hashCode = hashCode * HASH_FACTOR + getAttribute(BASE_REF).hashCode(); hashCode = hashCode * HASH_FACTOR + getAttribute(BASE_REF).hashCode();
hashCode = hashCode * HASH_FACTOR + getAttribute(BASE).hashCode(); hashCode = hashCode * HASH_FACTOR + getAttribute(BASE).hashCode();
break; break;
case IPathEntry.CDT_INCLUDE_FILE : case IPathEntry.CDT_INCLUDE_FILE:
hashCode = hashCode * HASH_FACTOR + getAttribute(INCLUDE_FILE).hashCode(); hashCode = hashCode * HASH_FACTOR + getAttribute(INCLUDE_FILE).hashCode();
hashCode = hashCode * HASH_FACTOR + getAttribute(BASE_REF).hashCode(); hashCode = hashCode * HASH_FACTOR + getAttribute(BASE_REF).hashCode();
hashCode = hashCode * HASH_FACTOR + getAttribute(BASE).hashCode(); hashCode = hashCode * HASH_FACTOR + getAttribute(BASE).hashCode();
break; break;
case IPathEntry.CDT_MACRO : case IPathEntry.CDT_MACRO:
hashCode = hashCode * HASH_FACTOR + getAttribute(MACRO_NAME).hashCode(); hashCode = hashCode * HASH_FACTOR + getAttribute(MACRO_NAME).hashCode();
hashCode = hashCode * HASH_FACTOR + getAttribute(BASE_REF).hashCode(); hashCode = hashCode * HASH_FACTOR + getAttribute(BASE_REF).hashCode();
hashCode = hashCode * HASH_FACTOR + getAttribute(BASE).hashCode(); hashCode = hashCode * HASH_FACTOR + getAttribute(BASE).hashCode();
break; break;
case IPathEntry.CDT_MACRO_FILE : case IPathEntry.CDT_MACRO_FILE:
hashCode = hashCode * HASH_FACTOR + getAttribute(MACROS_FILE).hashCode(); hashCode = hashCode * HASH_FACTOR + getAttribute(MACROS_FILE).hashCode();
hashCode = hashCode * HASH_FACTOR + getAttribute(BASE_REF).hashCode(); hashCode = hashCode * HASH_FACTOR + getAttribute(BASE_REF).hashCode();
hashCode = hashCode * HASH_FACTOR + getAttribute(BASE).hashCode(); hashCode = hashCode * HASH_FACTOR + getAttribute(BASE).hashCode();
@ -527,7 +527,7 @@ public class CPElement {
IWorkspaceRoot root = CUIPlugin.getWorkspace().getRoot(); IWorkspaceRoot root = CUIPlugin.getWorkspace().getRoot();
IPathEntry entry = getPathEntry(); IPathEntry entry = getPathEntry();
switch (getEntryKind()) { switch (getEntryKind()) {
case IPathEntry.CDT_CONTAINER : case IPathEntry.CDT_CONTAINER:
try { try {
if ((CoreModel.getPathEntryContainer(fPath, fCProject) == null)) { if ((CoreModel.getPathEntryContainer(fPath, fCProject) == null)) {
fStatus = new Status(IStatus.WARNING, CUIPlugin.PLUGIN_ID, -1, fStatus = new Status(IStatus.WARNING, CUIPlugin.PLUGIN_ID, -1,
@ -536,12 +536,12 @@ public class CPElement {
} catch (CModelException e) { } catch (CModelException e) {
} }
break; break;
case IPathEntry.CDT_LIBRARY : case IPathEntry.CDT_LIBRARY:
if (!((ILibraryEntry)entry).getFullLibraryPath().toFile().exists()) { if (!((ILibraryEntry)entry).getFullLibraryPath().toFile().exists()) {
fStatus = new Status(IStatus.WARNING, CUIPlugin.PLUGIN_ID, -1, CPathEntryMessages.CPElement_status_libraryPathNotFound, null); fStatus = new Status(IStatus.WARNING, CUIPlugin.PLUGIN_ID, -1, CPathEntryMessages.CPElement_status_libraryPathNotFound, null);
} }
break; break;
case IPathEntry.CDT_SOURCE : case IPathEntry.CDT_SOURCE:
path = fPath.removeTrailingSeparator(); path = fPath.removeTrailingSeparator();
res = root.findMember(path); res = root.findMember(path);
if (res == null) { if (res == null) {
@ -551,7 +551,7 @@ public class CPElement {
fStatus = new Status(IStatus.WARNING, CUIPlugin.PLUGIN_ID, -1, CPathEntryMessages.CPElement_status_sourcePathMissing, null); fStatus = new Status(IStatus.WARNING, CUIPlugin.PLUGIN_ID, -1, CPathEntryMessages.CPElement_status_sourcePathMissing, null);
} }
break; break;
case IPathEntry.CDT_OUTPUT : case IPathEntry.CDT_OUTPUT:
path = fPath.removeTrailingSeparator(); path = fPath.removeTrailingSeparator();
res = root.findMember(path); res = root.findMember(path);
if (res == null) { if (res == null) {
@ -561,7 +561,7 @@ public class CPElement {
fStatus = new Status(IStatus.WARNING, CUIPlugin.PLUGIN_ID, -1, CPathEntryMessages.CPElement_status_outputPathMissing, null); fStatus = new Status(IStatus.WARNING, CUIPlugin.PLUGIN_ID, -1, CPathEntryMessages.CPElement_status_outputPathMissing, null);
} }
break; break;
case IPathEntry.CDT_INCLUDE : case IPathEntry.CDT_INCLUDE:
path = fPath.removeTrailingSeparator(); path = fPath.removeTrailingSeparator();
res = root.findMember(path); res = root.findMember(path);
if (res == null) { if (res == null) {
@ -578,7 +578,7 @@ public class CPElement {
fStatus = new Status(IStatus.WARNING, CUIPlugin.PLUGIN_ID, -1, CPathEntryMessages.CPElement_status_includePathNotFound, null); fStatus = new Status(IStatus.WARNING, CUIPlugin.PLUGIN_ID, -1, CPathEntryMessages.CPElement_status_includePathNotFound, null);
} }
break; break;
case IPathEntry.CDT_INCLUDE_FILE : case IPathEntry.CDT_INCLUDE_FILE:
path = fPath.removeTrailingSeparator(); path = fPath.removeTrailingSeparator();
res = root.findMember(path); res = root.findMember(path);
if (res == null) { if (res == null) {
@ -595,7 +595,7 @@ public class CPElement {
fStatus = new Status(IStatus.WARNING, CUIPlugin.PLUGIN_ID, -1, CPathEntryMessages.CPElement_status_includeFilePathNotFound, null); fStatus = new Status(IStatus.WARNING, CUIPlugin.PLUGIN_ID, -1, CPathEntryMessages.CPElement_status_includeFilePathNotFound, null);
} }
break; break;
case IPathEntry.CDT_MACRO : case IPathEntry.CDT_MACRO:
path = fPath.removeTrailingSeparator(); path = fPath.removeTrailingSeparator();
res = root.findMember(path); res = root.findMember(path);
if (res == null) { if (res == null) {
@ -609,7 +609,7 @@ public class CPElement {
} }
} }
break; break;
case IPathEntry.CDT_MACRO_FILE : case IPathEntry.CDT_MACRO_FILE:
path = fPath.removeTrailingSeparator(); path = fPath.removeTrailingSeparator();
res = root.findMember(path); res = root.findMember(path);
if (res == null) { if (res == null) {
@ -626,7 +626,7 @@ public class CPElement {
fStatus = new Status(IStatus.WARNING, CUIPlugin.PLUGIN_ID, -1, CPathEntryMessages.CPElement_status_macrosFilePathNotFound, null); fStatus = new Status(IStatus.WARNING, CUIPlugin.PLUGIN_ID, -1, CPathEntryMessages.CPElement_status_macrosFilePathNotFound, null);
} }
break; break;
case IPathEntry.CDT_PROJECT : case IPathEntry.CDT_PROJECT:
res = root.findMember(fPath); res = root.findMember(fPath);
if (res == null) { if (res == null) {
fStatus = new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, -1, CPathEntryMessages.CPElement_status_missingProjectPath, null); fStatus = new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, -1, CPathEntryMessages.CPElement_status_missingProjectPath, null);
@ -689,16 +689,16 @@ public class CPElement {
IResource res = null; IResource res = null;
switch (curr.getEntryKind()) { switch (curr.getEntryKind()) {
case IPathEntry.CDT_CONTAINER : case IPathEntry.CDT_CONTAINER:
res = (element instanceof ICProject) ? null : element.getResource(); res = (element instanceof ICProject) ? null : element.getResource();
break; break;
case IPathEntry.CDT_LIBRARY : case IPathEntry.CDT_LIBRARY:
library = ((ILibraryEntry)curr).getLibraryPath(); library = ((ILibraryEntry)curr).getLibraryPath();
sourceAttachment = ((ILibraryEntry)curr).getSourceAttachmentPath(); sourceAttachment = ((ILibraryEntry)curr).getSourceAttachmentPath();
base = ((ILibraryEntry)curr).getBasePath(); base = ((ILibraryEntry)curr).getBasePath();
baseRef = ((ILibraryEntry)curr).getBaseReference(); baseRef = ((ILibraryEntry)curr).getBaseReference();
break; break;
case IPathEntry.CDT_SOURCE : case IPathEntry.CDT_SOURCE:
path = path.removeTrailingSeparator(); path = path.removeTrailingSeparator();
res = root.findMember(path); res = root.findMember(path);
if (res == null) { if (res == null) {
@ -708,7 +708,7 @@ public class CPElement {
} }
exclusion = ((ISourceEntry)curr).getExclusionPatterns(); exclusion = ((ISourceEntry)curr).getExclusionPatterns();
break; break;
case IPathEntry.CDT_OUTPUT : case IPathEntry.CDT_OUTPUT:
path = path.removeTrailingSeparator(); path = path.removeTrailingSeparator();
res = root.findMember(path); res = root.findMember(path);
if (res == null) { if (res == null) {
@ -718,7 +718,7 @@ public class CPElement {
} }
exclusion = ((IOutputEntry)curr).getExclusionPatterns(); exclusion = ((IOutputEntry)curr).getExclusionPatterns();
break; break;
case IPathEntry.CDT_INCLUDE : case IPathEntry.CDT_INCLUDE:
path = path.removeTrailingSeparator(); path = path.removeTrailingSeparator();
res = root.findMember(path); res = root.findMember(path);
if (res == null) { if (res == null) {
@ -732,7 +732,7 @@ public class CPElement {
base = ((IIncludeEntry)curr).getBasePath(); base = ((IIncludeEntry)curr).getBasePath();
include = ((IIncludeEntry)curr).getIncludePath(); include = ((IIncludeEntry)curr).getIncludePath();
break; break;
case IPathEntry.CDT_INCLUDE_FILE : case IPathEntry.CDT_INCLUDE_FILE:
path = path.removeTrailingSeparator(); path = path.removeTrailingSeparator();
res = root.findMember(path); res = root.findMember(path);
if (res == null) { if (res == null) {
@ -745,7 +745,7 @@ public class CPElement {
baseRef = ((IIncludeFileEntry)curr).getBaseReference(); baseRef = ((IIncludeFileEntry)curr).getBaseReference();
base = ((IIncludeFileEntry)curr).getBasePath(); base = ((IIncludeFileEntry)curr).getBasePath();
break; break;
case IPathEntry.CDT_MACRO : case IPathEntry.CDT_MACRO:
path = path.removeTrailingSeparator(); path = path.removeTrailingSeparator();
res = root.findMember(path); res = root.findMember(path);
if (res == null) { if (res == null) {
@ -759,7 +759,7 @@ public class CPElement {
baseRef = ((IMacroEntry)curr).getBaseReference(); baseRef = ((IMacroEntry)curr).getBaseReference();
base = ((IMacroEntry)curr).getBasePath(); base = ((IMacroEntry)curr).getBasePath();
break; break;
case IPathEntry.CDT_MACRO_FILE : case IPathEntry.CDT_MACRO_FILE:
path = path.removeTrailingSeparator(); path = path.removeTrailingSeparator();
res = root.findMember(path); res = root.findMember(path);
if (res == null) { if (res == null) {
@ -772,7 +772,7 @@ public class CPElement {
baseRef = ((IMacroFileEntry)curr).getBaseReference(); baseRef = ((IMacroFileEntry)curr).getBaseReference();
base = ((IMacroFileEntry)curr).getBasePath(); base = ((IMacroFileEntry)curr).getBasePath();
break; break;
case IPathEntry.CDT_PROJECT : case IPathEntry.CDT_PROJECT:
res = root.findMember(path); res = root.findMember(path);
break; break;
} }