1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 18:26:01 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2014-01-02 16:44:38 -08:00
parent cafab91ca1
commit c95730601b
10 changed files with 284 additions and 284 deletions

View file

@ -12,9 +12,6 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.model; package org.eclipse.cdt.core.model;
import java.net.URI;
import java.util.List;
import org.eclipse.cdt.core.CCProjectNature; import org.eclipse.cdt.core.CCProjectNature;
import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.CProjectNature; import org.eclipse.cdt.core.CProjectNature;
@ -62,6 +59,9 @@ import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.content.IContentType; import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.core.runtime.jobs.ISchedulingRule; import org.eclipse.core.runtime.jobs.ISchedulingRule;
import java.net.URI;
import java.util.List;
/** /**
* @noextend This class is not intended to be subclassed by clients. * @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients. * @noinstantiate This class is not intended to be instantiated by clients.
@ -72,9 +72,6 @@ public class CoreModel {
private static PathEntryManager pathEntryManager = PathEntryManager.getDefault(); private static PathEntryManager pathEntryManager = PathEntryManager.getDefault();
private static CProjectDescriptionManager descriptionManager = CProjectDescriptionManager.getInstance(); private static CProjectDescriptionManager descriptionManager = CProjectDescriptionManager.getInstance();
// private static String FILE_EXT_PATTERN = "*."; //$NON-NLS-1$
// private static int FILE_EXT_PATTERN_LENGTH = FILE_EXT_PATTERN.length();
public final static String CORE_MODEL_ID = CCorePlugin.PLUGIN_ID + ".coremodel"; //$NON-NLS-1$ public final static String CORE_MODEL_ID = CCorePlugin.PLUGIN_ID + ".coremodel"; //$NON-NLS-1$
/** /**
@ -101,8 +98,8 @@ public class CoreModel {
/** /**
* Returns the C model element corresponding to the given handle identifier * Returns the C model element corresponding to the given handle identifier
* generated by <code>ICElement.getHandleIdentifier()</code>, or * generated by {@code ICElement.getHandleIdentifier()}, or
* <code>null</code> if unable to create the associated element. * {@code null} if unable to create the associated element.
* *
* @param handleIdentifier the given handle identifier * @param handleIdentifier the given handle identifier
* @return the C element corresponding to the handle identifier * @return the C element corresponding to the handle identifier
@ -153,7 +150,7 @@ public class CoreModel {
* Returns the C model. * Returns the C model.
* *
* @param root the given root * @param root the given root
* @return the C model, or <code>null</code> if the root is null * @return the C model, or {@code null} if the root is null
*/ */
public static ICModel create(IWorkspaceRoot root) { public static ICModel create(IWorkspaceRoot root) {
if (root == null) { if (root == null) {
@ -161,6 +158,7 @@ public class CoreModel {
} }
return manager.getCModel(); return manager.getCModel();
} }
/** /**
* Returns the default ICModel. * Returns the default ICModel.
*/ */
@ -279,8 +277,9 @@ public class CoreModel {
if (contentType != null) { if (contentType != null) {
String id = contentType.getId(); String id = contentType.getId();
if (CCorePlugin.CONTENT_TYPE_CHEADER.equals(id) if (CCorePlugin.CONTENT_TYPE_CHEADER.equals(id)
|| CCorePlugin.CONTENT_TYPE_CXXHEADER.equals(id)) || CCorePlugin.CONTENT_TYPE_CXXHEADER.equals(id)) {
return false; return false;
}
return CCorePlugin.CONTENT_TYPE_CSOURCE.equals(id) return CCorePlugin.CONTENT_TYPE_CSOURCE.equals(id)
|| CCorePlugin.CONTENT_TYPE_CXXSOURCE.equals(id) || CCorePlugin.CONTENT_TYPE_CXXSOURCE.equals(id)
@ -384,34 +383,26 @@ public class CoreModel {
* Return true if project has C nature. * Return true if project has C nature.
*/ */
public static boolean hasCNature(IProject project) { public static boolean hasCNature(IProject project) {
boolean ok = false;
try { try {
ok = (project.isOpen() && project.hasNature(CProjectNature.C_NATURE_ID)); return project.isOpen() && project.hasNature(CProjectNature.C_NATURE_ID);
} catch (CoreException e) { } catch (CoreException e) {
//throws exception if the project is not open.
//System.out.println (e);
//e.printStackTrace();
} }
return ok; return false;
} }
/** /**
* Return true if project has C++ nature. * Return true if project has C++ nature.
*/ */
public static boolean hasCCNature(IProject project) { public static boolean hasCCNature(IProject project) {
boolean ok = false;
try { try {
ok = (project.isOpen() && project.hasNature(CCProjectNature.CC_NATURE_ID)); return project.isOpen() && project.hasNature(CCProjectNature.CC_NATURE_ID);
} catch (CoreException e) { } catch (CoreException e) {
//throws exception if the project is not open.
//System.out.println (e);
//e.printStackTrace();
} }
return ok; return false;
} }
/** /**
* Creates and returns a new non-exported entry of kind <code>CDT_PROJECT</code> * Creates and returns a new non-exported entry of kind {@code CDT_PROJECT}
* for the project identified by the given absolute path. * for the project identified by the given absolute path.
* <p> * <p>
* A project entry is used to denote a prerequisite project. The * A project entry is used to denote a prerequisite project. The
@ -421,7 +412,7 @@ public class CoreModel {
* to the workspace root. * to the workspace root.
* <p> * <p>
* The resulting entry is not exported to dependent projects. This method * The resulting entry is not exported to dependent projects. This method
* is equivalent to <code>newProjectEntry(path,false)</code>. * is equivalent to {@code newProjectEntry(path, false)}.
* <p> * <p>
* *
* @param projectPath * @param projectPath
@ -435,7 +426,7 @@ public class CoreModel {
} }
/** /**
* Creates and returns a new entry of kind <code>CDT_PROJECT</code> for * Creates and returns a new entry of kind {@code CDT_PROJECT} for
* the project identified by the given workspace-relative path. * the project identified by the given workspace-relative path.
* <p> * <p>
* A project entry is used to denote a prerequisite project. All the * A project entry is used to denote a prerequisite project. All the
@ -456,13 +447,13 @@ public class CoreModel {
} }
/** /**
* Creates and returns a new entry of kind <code>CDT_CONTAINER</code> for * Creates and returns a new entry of kind {@code CDT_CONTAINER} for
* the given path. The path of the container will be used during resolution * the given path. The path of the container will be used during resolution
* so as to map this container entry to a set of other entries the * so as to map this container entry to a set of other entries the
* container is acting for. * container is acting for.
* <p> * <p>
* The resulting entry is not exported to dependent projects. This method * The resulting entry is not exported to dependent projects. This method
* is equivalent to <code>newContainerEntry(path,false)</code>. * is equivalent to {@code newContainerEntry(path, false)}.
* <p> * <p>
* *
* @param id the id of the container * @param id the id of the container
@ -474,13 +465,13 @@ public class CoreModel {
} }
/** /**
* Creates and returns a new entry of kind <code>CDT_CONTAINER</code> for * Creates and returns a new entry of kind {@code CDT_CONTAINER} for
* the given path. The path of the container will be used during resolution * the given path. The path of the container will be used during resolution
* so as to map this container entry to a set of other entries the * so as to map this container entry to a set of other entries the
* container is acting for. * container is acting for.
* <p> * <p>
* The resulting entry is not exported to dependent projects. This method * The resulting entry is not exported to dependent projects. This method
* is equivalent to <code>newContainerEntry(path,false)</code>. * is equivalent to {@code newContainerEntry(path,false)}.
* <p> * <p>
*/ */
public static IContainerEntry newContainerEntry(IPath id, boolean isExported) { public static IContainerEntry newContainerEntry(IPath id, boolean isExported) {
@ -488,7 +479,7 @@ public class CoreModel {
} }
/** /**
* Creates and returns a new entry of kind <code>CDT_LIBRARY</code> * Creates and returns a new entry of kind {@code CDT_LIBRARY}
* for the archive or folder identified by the given absolute path. * for the archive or folder identified by the given absolute path.
* *
* @param resourcePath * @param resourcePath
@ -506,7 +497,7 @@ public class CoreModel {
/** /**
* Creates and returns a new entry of kind <code>CDT_LIBRARY</code> * Creates and returns a new entry of kind {@code CDT_LIBRARY}
* for the archive or folder identified by the given absolute path. * for the archive or folder identified by the given absolute path.
* *
* Note that this operation does not attempt to validate or access the * Note that this operation does not attempt to validate or access the
@ -521,12 +512,12 @@ public class CoreModel {
* the path of the library * the path of the library
* @param sourceAttachmentPath * @param sourceAttachmentPath
* the project-relative path of the corresponding source archive or * the project-relative path of the corresponding source archive or
* folder, or <code>null</code> if none. * folder, or {@code null} if none.
* @param sourceAttachmentRootPath * @param sourceAttachmentRootPath
* the location of the root within the source archive or folder * the location of the root within the source archive or folder
* or <code>null</code>. * or {@code null}.
* @param sourceAttachmentPrefixMapping * @param sourceAttachmentPrefixMapping
* prefix mapping or <code>null</code>. * prefix mapping or {@code null}.
* @param isExported * @param isExported
* whether the entry is exported * whether the entry is exported
* @return a new library entry * @return a new library entry
@ -538,7 +529,7 @@ public class CoreModel {
} }
/** /**
* Creates and returns a new entry of kind <code>CDT_OUTPUT</code> for * Creates and returns a new entry of kind {@code CDT_OUTPUT} for
* the project's output folder * the project's output folder
* <p> * <p>
* *
@ -552,7 +543,7 @@ public class CoreModel {
} }
/** /**
* Creates and returns a new entry of kind <code>CDT_OUPUT</code> for * Creates and returns a new entry of kind {@code CDT_OUPUT} for
* the project * the project
* *
* @param outputPath * @param outputPath
@ -567,20 +558,20 @@ public class CoreModel {
} }
/** /**
* Creates and returns a new entry of kind <code>CDT_SOURCE</code> for * Creates and returns a new entry of kind {@code CDT_SOURCE} for
* the project's source folder identified by the given absolute * the project's source folder identified by the given absolute
* workspace-relative path. * workspace-relative path.
* <p> * <p>
* The source folder is referred to using an absolute path relative to the * The source folder is referred to using an absolute path relative to the
* workspace root, e.g. <code>/Project/src</code>. A project's source * workspace root, e.g. {@code /Project/src}. A project's source
* folders are located with that project. That is, a source entry * folders are located with that project. That is, a source entry
* specifying the path <code>/P1/src</code> is only usable for project * specifying the path {@code /P1/src} is only usable for project
* <code>P1</code>. * {@code P1}.
* </p> * </p>
* </p> * </p>
* <p> * <p>
* Note that all sources/binaries inside a project are contributed as a * Note that all sources/binaries inside a project are contributed as a
* whole through a project entry (see <code>newProjectEntry</code>). * whole through a project entry (see {@code newProjectEntry}).
* Particular source entries cannot be selectively exported. * Particular source entries cannot be selectively exported.
* </p> * </p>
* *
@ -594,17 +585,17 @@ public class CoreModel {
} }
/** /**
* Creates and returns a new entry of kind <code>CDT_SOURCE</code> for * Creates and returns a new entry of kind {@code CDT_SOURCE} for
* the project's source folder identified by the given absolute * the project's source folder identified by the given absolute
* workspace-relative path but excluding all source files with paths * workspace-relative path but excluding all source files with paths
* matching any of the given patterns. This specifies that all package * matching any of the given patterns. This specifies that all package
* fragments within the root will have children of type <code>ICompilationUnit</code>. * fragments within the root will have children of type {@code ICompilationUnit}.
* <p> * <p>
* The source folder is referred to using an absolute path relative to the * The source folder is referred to using an absolute path relative to the
* workspace root, e.g. <code>/Project/src</code>. A project's source * workspace root, e.g. {@code /Project/src}. A project's source
* folders are located with that project. That is, a source entry * folders are located with that project. That is, a source entry
* specifying the path <code>/P1/src</code> is only usable for project * specifying the path {@code /P1/src} is only usable for project
* <code>P1</code>. * {@code P1}.
* </p> * </p>
* *
* @param sourcePath * @param sourcePath
@ -619,7 +610,7 @@ public class CoreModel {
} }
/** /**
* Creates and returns a new entry of kind <code>CDT_INCLUDE</code> * Creates and returns a new entry of kind {@code CDT_INCLUDE}
* *
* @param resourcePath * @param resourcePath
* the affected project-relative resource path * the affected project-relative resource path
@ -634,7 +625,7 @@ public class CoreModel {
} }
/** /**
* * Creates and returns a new entry of kind <code>CDT_INCLUDE</code> * * Creates and returns a new entry of kind {@code CDT_INCLUDE}
* *
* @param resourcePath * @param resourcePath
* the affected project-relative resource path * the affected project-relative resource path
@ -651,7 +642,7 @@ public class CoreModel {
} }
/** /**
* Creates and returns a new entry of kind <code>CDT_INCLUDE</code> * Creates and returns a new entry of kind {@code CDT_INCLUDE}
* *
* @param resourcePath * @param resourcePath
* the affected project-relative resource path * the affected project-relative resource path
@ -671,7 +662,7 @@ public class CoreModel {
} }
/** /**
* Creates and returns a new entry of kind <code>CDT_INCLUDE</code> * Creates and returns a new entry of kind {@code CDT_INCLUDE}
* *
* @param resourcePath * @param resourcePath
* the affected project-relative resource path * the affected project-relative resource path
@ -694,7 +685,7 @@ public class CoreModel {
} }
/** /**
* Creates and returns a new entry of kind <code>CDT_INCLUDE</code> * Creates and returns a new entry of kind {@code CDT_INCLUDE}
* *
* @param resourcePath * @param resourcePath
* the affected project-relative resource path * the affected project-relative resource path
@ -709,14 +700,14 @@ public class CoreModel {
} }
/** /**
* Creates a new entry of kind <code>CDT_INCLUDE_FILE</code> * Creates a new entry of kind {@code CDT_INCLUDE_FILE}
*/ */
public static IIncludeFileEntry newIncludeFileEntry(IPath resourcePath, IPath includeFile) { public static IIncludeFileEntry newIncludeFileEntry(IPath resourcePath, IPath includeFile) {
return newIncludeFileEntry(resourcePath, null, null, includeFile, null, false); return newIncludeFileEntry(resourcePath, null, null, includeFile, null, false);
} }
/** /**
* Creates and returns a new entry of kind <code>CDT_INCLUDE_FILE</code> * Creates and returns a new entry of kind {@code CDT_INCLUDE_FILE}
* *
* @param resourcePath * @param resourcePath
* the affected project-relative resource path * the affected project-relative resource path
@ -736,7 +727,7 @@ public class CoreModel {
} }
/** /**
* Creates and returns an entry kind <code>CDT_MACRO</code> * Creates and returns an entry kind {@code CDT_MACRO}
* *
* @param resourcePath * @param resourcePath
* the affected project-relative resource path * the affected project-relative resource path
@ -751,7 +742,7 @@ public class CoreModel {
} }
/** /**
* Creates and returns an entry kind <code>CDT_MACRO</code> * Creates and returns an entry kind {@code CDT_MACRO}
* *
* @param resourcePath * @param resourcePath
* the affected project-relative resource path * the affected project-relative resource path
@ -767,7 +758,7 @@ public class CoreModel {
} }
/** /**
* Creates and returns an entry kind <code>CDT_MACRO</code> * Creates and returns an entry kind {@code CDT_MACRO}
* *
* @param resourcePath * @param resourcePath
* the affected workspace-relative resource path * the affected workspace-relative resource path
@ -783,7 +774,7 @@ public class CoreModel {
} }
/** /**
* Creates and returns an entry kind <code>CDT_MACRO</code> * Creates and returns an entry kind {@code CDT_MACRO}
* *
* @param resourcePath * @param resourcePath
* the affected workspace-relative resource path * the affected workspace-relative resource path
@ -797,14 +788,14 @@ public class CoreModel {
} }
/** /**
* Creates an entry kind <code>CDT_MACRO_FILE</code> * Creates an entry kind {@code CDT_MACRO_FILE}
*/ */
public static IMacroFileEntry newMacroFileEntry(IPath resourcePath, IPath macroFile) { public static IMacroFileEntry newMacroFileEntry(IPath resourcePath, IPath macroFile) {
return newMacroFileEntry(resourcePath, null, null, macroFile, null, false); return newMacroFileEntry(resourcePath, null, null, macroFile, null, false);
} }
/** /**
* Creates and returns an entry kind <code>CDT_MACRO_FILE</code> * Creates and returns an entry kind {@code CDT_MACRO_FILE}
* *
* @param resourcePath * @param resourcePath
* the affected workspace-relative resource path * the affected workspace-relative resource path
@ -822,20 +813,20 @@ public class CoreModel {
/** /**
* Answers the project specific value for a given container. In case this * Answers the project specific value for a given container. In case this
* container path could not be resolved, then will answer <code>null</code>. * container path could not be resolved, then will answer {@code null}.
* Both the container path and the project context are supposed to be * Both the container path and the project context are supposed to be
* non-null. * non-null.
* <p> * <p>
* The containerPath is a formed by a first ID segment followed with extra * The containerPath is a formed by a first ID segment followed with extra
* segments, which can be used as additional hints for resolution. If no * segments, which can be used as additional hints for resolution. If no
* container was ever recorded for this container path onto this project * container was ever recorded for this container path onto this project
* (using <code>setPathEntryContainer</code>, then a <code>PathEntryContainerInitializer</code> * (using {@code setPathEntryContainer}, then a {@code PathEntryContainerInitializer}
* will be activated if any was registered for this container ID onto the * will be activated if any was registered for this container ID onto the
* extension point "org.eclipse.cdt.core.PathEntryContainerInitializer". * extension point "org.eclipse.cdt.core.PathEntryContainerInitializer".
* <p> * <p>
* PathEntry container values are persisted locally to the workspace, but * PathEntry container values are persisted locally to the workspace, but
* are not preserved from a session to another. It is thus highly * are not preserved from a session to another. It is thus highly
* recommended to register a <code>PathEntryContainerInitializer</code> * recommended to register a {@code PathEntryContainerInitializer}
* for each referenced container (through the extension point * for each referenced container (through the extension point
* "org.eclipse.cdt.core.PathEntryContainerInitializer"). * "org.eclipse.cdt.core.PathEntryContainerInitializer").
* <p> * <p>
@ -844,7 +835,7 @@ public class CoreModel {
* the name of the container, which needs to be resolved * the name of the container, which needs to be resolved
* @param project * @param project
* a specific project in which the container is being resolved * a specific project in which the container is being resolved
* @return the corresponding container or <code>null</code> if unable to * @return the corresponding container or {@code null} if unable to
* find one. * find one.
* *
* @exception CModelException * @exception CModelException
@ -861,7 +852,7 @@ public class CoreModel {
} }
/** /**
* Bind a container reference path to some actual containers (<code>IPathEntryContainer</code>). * Bind a container reference path to some actual containers ({@code IPathEntryContainer}).
* This API must be invoked whenever changes in container need to be * This API must be invoked whenever changes in container need to be
* reflected onto the CModel. * reflected onto the CModel.
* <p> * <p>
@ -872,11 +863,11 @@ public class CoreModel {
* <p> * <p>
* PathEntry container values are persisted locally to the workspace, but * PathEntry container values are persisted locally to the workspace, but
* are not preserved from a session to another. It is thus highly * are not preserved from a session to another. It is thus highly
* recommended to register a <code>PathEntryContainerInitializer</code> * recommended to register a {@code PathEntryContainerInitializer}
* for each referenced container (through the extension point * for each referenced container (through the extension point
* "org.eclipse.cdt.core.PathEntryContainerInitializer"). * "org.eclipse.cdt.core.PathEntryContainerInitializer").
* <p> * <p>
* Note: setting a container to <code>null</code> will cause it to be * Note: setting a container to {@code null} will cause it to be
* lazily resolved again whenever its value is required. In particular, * lazily resolved again whenever its value is required. In particular,
* this will cause a registered initializer to be invoked again. * this will cause a registered initializer to be invoked again.
* <p> * <p>
@ -898,9 +889,9 @@ public class CoreModel {
} }
/** /**
* Helper method use by a pathentry container implementing <code>IPathEntryContainerExtension</code> * Helper method use by a path entry container implementing {@code IPathEntryContainerExtension}
* It notify the model of changes. * It notify the model of changes.
* Note: the paths in the <code>PathEntryContainerChanged[]</code> array must be on * Note: the paths in the {@code PathEntryContainerChanged[]} array must be on
* source that the container was set too. If not the changes will be silently ignore. * source that the container was set too. If not the changes will be silently ignore.
* *
* @param container * @param container
@ -914,7 +905,7 @@ public class CoreModel {
/** /**
* Sets the pathentries of this project using a list of entries. * Sets the pathentries of this project using a list of entries.
* <p> * <p>
* Setting the pathentries to <code>null</code> specifies a default * Setting the pathentries to {@code null} specifies a default
* classpath (the project root). Setting the pathentry to an empty array * classpath (the project root). Setting the pathentry to an empty array
* specifies an empty pathentry. * specifies an empty pathentry.
* <p> * <p>
@ -932,7 +923,7 @@ public class CoreModel {
/** /**
* Returns the raw pathentries for the project. This corresponds to the * Returns the raw pathentries for the project. This corresponds to the
* exact set of entries which were assigned using <code>setRawPathEntries</code> * exact set of entries which were assigned using {@code setRawPathEntries}
* <p> * <p>
* *
* @return the raw entires for the project * @return the raw entires for the project
@ -1038,7 +1029,7 @@ public class CoreModel {
/** /**
* Helper method finding the pathentry container initializer registered for * Helper method finding the pathentry container initializer registered for
* a given container ID or <code>null</code> if none was found while * a given container ID or {@code null} if none was found while
* iterating over the contributions to extension point to the extension * iterating over the contributions to extension point to the extension
* point "org.eclipse.cdt.core.PathEntryContainerInitializer". * point "org.eclipse.cdt.core.PathEntryContainerInitializer".
* <p> * <p>
@ -1049,7 +1040,7 @@ public class CoreModel {
* @param containerID - * @param containerID -
* a containerID identifying a registered initializer * a containerID identifying a registered initializer
* @return ClasspathContainerInitializer - the registered classpath * @return ClasspathContainerInitializer - the registered classpath
* container initializer or <code>null</code> if none was found. * container initializer or {@code null} if none was found.
*/ */
public static PathEntryContainerInitializer getPathEntryContainerInitializer(String containerID) { public static PathEntryContainerInitializer getPathEntryContainerInitializer(String containerID) {
return pathEntryManager.getPathEntryContainerInitializer(containerID); return pathEntryManager.getPathEntryContainerInitializer(containerID);
@ -1077,28 +1068,37 @@ public class CoreModel {
* Validate a given path entries for a project, using the following rules: * Validate a given path entries for a project, using the following rules:
* <ul> * <ul>
* <li> Entries cannot collide with each other; that is, all entry paths must be unique. * <li> Entries cannot collide with each other; that is, all entry paths must be unique.
* <li> The output entry location path can be empty, if not they must be located inside the project. * <li> The output entry location path can be empty, if not they must be located inside
* the project.
* <li> Source entry location can be null, if not they must be located inside the project, * <li> Source entry location can be null, if not they must be located inside the project,
* <li> A project entry cannot refer to itself directly (that is, a project cannot prerequisite itself). * <li> A project entry cannot refer to itself directly (that is, a project cannot
* <li> Source entries or output locations cannot coincidate or be nested in each other, except for the following scenarii listed below: * prerequisite itself).
* <ul><li> A source folder can coincidate with its own output location, in which case this output can then contain library archives. * <li> Source entries or output locations cannot coincide or be nested in each other, except
* However, a specific output location cannot coincidate with any library or a distinct source folder than the one referring to it. </li> * for the following scenarios listed below:
* <li> A source/library folder can be nested in any source folder as long as the nested folder is excluded from the enclosing one. </li> * <ul>
* <li> An output location can be nested in a source folder, if the source folder coincidates with the project itself, or if the output * <li> A source folder can coincide with its own output location, in which case this
* location is excluded from the source folder. </li> * output can then contain library archives. However, a specific output location
* cannot coincide with any library or a distinct source folder than the one
* referring to it.</li>
* <li> A source/library folder can be nested in any source folder as long as
* the nested folder is excluded from the enclosing one. </li>
* <li> An output location can be nested in a source folder, if the source folder
* coincides with the project itself, or if the output location is excluded from
* the source folder. </li>
* </ul> * </ul>
* </ul> * </ul>
* *
* Note that the entries are not validated automatically. Only bound variables or containers are considered * Note that the entries are not validated automatically. Only bound variables or containers
* in the checking process (this allows to perform a consistency check on an entry which has references to * are considered in the checking process (this allows to perform a consistency check on
* yet non existing projects, folders, ...). * an entry which has references to yet non existing projects, folders, ...).
* <p>
* This validation is intended to anticipate issues prior to assigning it to a project. In particular, it will automatically
* be performed during the setting operation (if validation fails, the classpath setting will not complete)
* and during getResolvedPathEntries.
* <p> * <p>
* This validation is intended to anticipate issues prior to assigning it to a project.
* In particular, it will automatically be performed during the setting operation
* (if validation fails, the classpath setting will not complete) and during
* {@link #getResolvedPathEntries}.
*
* @param cProject the given C project * @param cProject the given C project
* @return a status object with code <code>IStatus.OK</code> if * @return a status object with code {@code IStatus.OK} if
* the entries location are compatible, otherwise a status * the entries location are compatible, otherwise a status
* object indicating what is wrong with them * object indicating what is wrong with them
*/ */
@ -1108,14 +1108,16 @@ public class CoreModel {
/** /**
* Returns a C model status describing the problem related to this entry if any, * Returns a C model status describing the problem related to this entry if any,
* a status object with code <code>IStatus.OK</code> if the entry is fine (that is, if the * a status object with code {@code IStatus.OK} if the entry is fine (that is, if the
* given entry denotes a valid element). * given entry denotes a valid element).
* *
* @param cProject the given C project * @param cProject the given C project
* @param entry the given entry * @param entry the given entry
* @param checkSourceAttachment a flag to determine if source attachement should be checked * @param checkSourceAttachment a flag to determine if source attachment should be checked
* @param recurseInContainers flag indicating whether validation should be applied to container entries recursively * @param recurseInContainers flag indicating whether validation should be applied to container
* @return a c model status describing the problem related to this entry if any, a status object with code <code>IStatus.OK</code> if the entry is fine * entries recursively
* @return a c model status describing the problem related to this entry if any, a status object
* with code {@code IStatus.OK} if the entry is fine
*/ */
public static ICModelStatus validatePathEntry(ICProject cProject, IPathEntry entry, boolean checkSourceAttachment, boolean recurseInContainers){ public static ICModelStatus validatePathEntry(ICProject cProject, IPathEntry entry, boolean checkSourceAttachment, boolean recurseInContainers){
return pathEntryManager.validatePathEntry(cProject, entry, checkSourceAttachment, recurseInContainers); return pathEntryManager.validatePathEntry(cProject, entry, checkSourceAttachment, recurseInContainers);
@ -1184,7 +1186,7 @@ public class CoreModel {
* </p> * </p>
* *
* @param action the action to perform * @param action the action to perform
* @param monitor a progress monitor, or <code>null</code> if progress * @param monitor a progress monitor, or {@code null} if progress
* reporting and cancellation are not desired * reporting and cancellation are not desired
* @exception CoreException if the operation failed. * @exception CoreException if the operation failed.
* @since 2.1 * @since 2.1
@ -1216,13 +1218,13 @@ public class CoreModel {
* <p> * <p>
* The supplied scheduling rule is used to determine whether this operation can be * The supplied scheduling rule is used to determine whether this operation can be
* run simultaneously with workspace changes in other threads. See * run simultaneously with workspace changes in other threads. See
* <code>IWorkspace.run(...)</code> for more details. * {@code IWorkspace.run(...)} for more details.
* </p> * </p>
* *
* @param action the action to perform * @param action the action to perform
* @param rule the scheduling rule to use when running this operation, or * @param rule the scheduling rule to use when running this operation, or
* <code>null</code> if there are no scheduling restrictions for this operation. * {@code null} if there are no scheduling restrictions for this operation.
* @param monitor a progress monitor, or <code>null</code> if progress * @param monitor a progress monitor, or {@code null} if progress
* reporting and cancellation are not desired * reporting and cancellation are not desired
* @exception CoreException if the operation failed. * @exception CoreException if the operation failed.
* @since 3.0 * @since 3.0
@ -1239,7 +1241,7 @@ public class CoreModel {
/** /**
* The method returns whether scanner information for a resource is empty or not. * The method returns whether scanner information for a resource is empty or not.
* If <code>null</code> is supplied the method returns <code>true</code>. * If {@code null} is supplied the method returns {@code true}.
* *
* @param resource * @param resource
* @since 3.0 * @since 3.0
@ -1251,9 +1253,9 @@ public class CoreModel {
IProject project = resource.getProject(); IProject project = resource.getProject();
CProjectDescriptionManager mngr = CProjectDescriptionManager.getInstance(); CProjectDescriptionManager mngr = CProjectDescriptionManager.getInstance();
ICProjectDescription des = mngr.getProjectDescription(project, false); ICProjectDescription des = mngr.getProjectDescription(project, false);
if(des != null){ if (des != null){
ICConfigurationDescription indexCfg = des.getDefaultSettingConfiguration(); ICConfigurationDescription indexCfg = des.getDefaultSettingConfiguration();
if(indexCfg != null){ if (indexCfg != null){
if (!mngr.isNewStyleCfg(indexCfg)) { if (!mngr.isNewStyleCfg(indexCfg)) {
return oldIsScannerInformationEmpty(resource); return oldIsScannerInformationEmpty(resource);
} }
@ -1269,28 +1271,27 @@ public class CoreModel {
} }
} }
return true; return true;
} else { } else {
ICLanguageSetting lSetting = indexCfg.getLanguageSettingForFile(resource.getProjectRelativePath(), false); ICLanguageSetting lSetting = indexCfg.getLanguageSettingForFile(resource.getProjectRelativePath(), false);
if(lSetting != null && lSetting instanceof CLanguageSettingCache){ if (lSetting != null && lSetting instanceof CLanguageSettingCache){
if(!((CLanguageSettingCache)lSetting).containsDiscoveredScannerInfo()) if (!((CLanguageSettingCache)lSetting).containsDiscoveredScannerInfo())
lSetting = null; lSetting = null;
} }
if(lSetting != null){ if (lSetting != null){
ICLanguageSettingEntry[] entries = lSetting.getSettingEntries(ICSettingEntry.INCLUDE_PATH); ICLanguageSettingEntry[] entries = lSetting.getSettingEntries(ICSettingEntry.INCLUDE_PATH);
if(entries.length != 0) if (entries.length != 0)
return false; return false;
entries = lSetting.getSettingEntries(ICSettingEntry.MACRO); entries = lSetting.getSettingEntries(ICSettingEntry.MACRO);
if(entries.length != 0) if (entries.length != 0)
return false; return false;
entries = lSetting.getSettingEntries(ICSettingEntry.INCLUDE_FILE); entries = lSetting.getSettingEntries(ICSettingEntry.INCLUDE_FILE);
if(entries.length != 0) if (entries.length != 0)
return false; return false;
entries = lSetting.getSettingEntries(ICSettingEntry.MACRO_FILE); entries = lSetting.getSettingEntries(ICSettingEntry.MACRO_FILE);
if(entries.length != 0) if (entries.length != 0)
return false; return false;
} }
} }
@ -1345,7 +1346,7 @@ public class CoreModel {
} }
/** /**
* this method is a full equivalent to <code>createProjectDescription(project, loadIfExists, false)</code>. * this method is a full equivalent to {@code createProjectDescription(project, loadIfExists, false)}.
* *
* @see #createProjectDescription(IProject, boolean, boolean) * @see #createProjectDescription(IProject, boolean, boolean)
*/ */
@ -1443,8 +1444,8 @@ public class CoreModel {
/** /**
* Forces the cached data of the specified projects to be re-calculated. * Forces the cached data of the specified projects to be re-calculated.
* if the <code>projects</code> argument is <code>null</code> al projects * If the {@code projects} argument is {@code null}, all projects
* within the workspace are updated * within the workspace are updated.
* *
* @param projects * @param projects
* @param monitor * @param monitor
@ -1455,14 +1456,16 @@ public class CoreModel {
} }
/** /**
* Answers whether the given project is a new-style project, i.e. CConfigurationDataProvider-driven * Answers whether the given project is a new-style project,
* i.e. CConfigurationDataProvider-driven.
*/ */
public boolean isNewStyleProject(IProject project){ public boolean isNewStyleProject(IProject project){
return descriptionManager.isNewStyleProject(project); return descriptionManager.isNewStyleProject(project);
} }
/** /**
* Answers whether the given project is a new-style project, i.e. CConfigurationDataProvider-driven * Answers whether the given project is a new-style project,
* i.e. CConfigurationDataProvider-driven
*/ */
public boolean isNewStyleProject(ICProjectDescription des){ public boolean isNewStyleProject(ICProjectDescription des){
return descriptionManager.isNewStyleProject(des); return descriptionManager.isNewStyleProject(des);

View file

@ -14,9 +14,9 @@ package org.eclipse.cdt.core.model;
/** /**
* Common protocol for C elements that have associated source code. * Common protocol for C elements that have associated source code.
* <p> * <p>
* Note: For <code>IBinary</code>, <code>IArchive</code> and other members * Note: For {@code IBinary}, {@code IArchive} and other members
* derived from a binary type, the implementation returns source iff the * derived from a binary type, the implementation returns source iff the element
* element has attached source code and debuging information. * has attached source code and debugging information.
* *
* @noextend This interface is not intended to be extended by clients. * @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients. * @noimplement This interface is not intended to be implemented by clients.
@ -27,9 +27,8 @@ public interface ISourceReference {
* <p> * <p>
* For binary files, this returns the source of the entire translation unit * For binary files, this returns the source of the entire translation unit
* associated with the binary file (if there is one). * associated with the binary file (if there is one).
* </p>
* *
* @return the source code, or <code>null</code> if this element has no * @return the source code, or {@code null} if this element has no
* associated source code * associated source code
* @exception CModelException if this element does not exist or if an * @exception CModelException if this element does not exist or if an
* exception occurs while accessing its corresponding resource * exception occurs while accessing its corresponding resource
@ -41,9 +40,8 @@ public interface ISourceReference {
* <p> * <p>
* For binary files, this returns the range of the entire translation unit * For binary files, this returns the range of the entire translation unit
* associated with the binary file (if there is one). * associated with the binary file (if there is one).
* </p>
* *
* @return the source range, or <code>null</code> if if this element has no * @return the source range, or {@code null} if if this element has no
* associated source code * associated source code
* @exception CModelException if this element does not exist or if an * @exception CModelException if this element does not exist or if an
* exception occurs while accessing its corresponding resource * exception occurs while accessing its corresponding resource
@ -51,7 +49,7 @@ public interface ISourceReference {
ISourceRange getSourceRange() throws CModelException; ISourceRange getSourceRange() throws CModelException;
/** /**
* Returns the translation unit in which this member is declared, or <code>null</code> * Returns the translation unit in which this member is declared, or {@code null}
* if this member is not declared in a translation unit (for example, a binary type). * if this member is not declared in a translation unit (for example, a binary type).
*/ */
ITranslationUnit getTranslationUnit(); ITranslationUnit getTranslationUnit();

View file

@ -59,9 +59,9 @@ public interface IIndexManager extends IPDOMManager {
public static final int ADD_EXTENSION_FRAGMENTS_NAVIGATION = 0x8; public static final int ADD_EXTENSION_FRAGMENTS_NAVIGATION = 0x8;
/** /**
* Constant for passing to getIndex methods. This constant, when set, indicates that the each index * Constant for passing to getIndex methods. This constant, when set, indicates that the each
* content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not * index content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which
* disabled for content assist shall be included in the resulting index. * is not disabled for content assist shall be included in the resulting index.
* *
* @since 5.4 * @since 5.4
*/ */
@ -199,18 +199,23 @@ public interface IIndexManager extends IPDOMManager {
IIndex getIndex(ICProject[] projects) throws CoreException; IIndex getIndex(ICProject[] projects) throws CoreException;
/** /**
* Returns the index for the given project. You can specify to add dependencies or dependent projects. * Returns the index for the given project. You can specify to add dependencies or dependent
* projects.
*
* @param project the project to get the index for * @param project the project to get the index for
* @param options <code>0</code> or a combination of {@link #ADD_DEPENDENCIES} and {@link #ADD_DEPENDENT}. * @param options <code>0</code> or a combination of {@link #ADD_DEPENDENCIES} and
* {@link #ADD_DEPENDENT}.
* @return an index for the project * @return an index for the project
* @throws CoreException * @throws CoreException
*/ */
IIndex getIndex(ICProject project, int options) throws CoreException; IIndex getIndex(ICProject project, int options) throws CoreException;
/** /**
* Returns the index for the given projects. You can specify to add dependencies or dependent projects. * Returns the index for the given projects. You can specify to add dependencies or dependent
* projects.
* @param projects the projects to get the index for * @param projects the projects to get the index for
* @param options <code>0</code> or a combination of {@link #ADD_DEPENDENCIES} and {@link #ADD_DEPENDENT}. * @param options <code>0</code> or a combination of {@link #ADD_DEPENDENCIES} and
* {@link #ADD_DEPENDENT}.
* @return an index for the projects * @return an index for the projects
* @throws CoreException * @throws CoreException
*/ */
@ -242,8 +247,8 @@ public interface IIndexManager extends IPDOMManager {
/** /**
* Joins the indexer and reports progress. * Joins the indexer and reports progress.
* @param waitMaxMillis time limit in millis after which the method returns with <code>false</code>, * @param waitMaxMillis time limit in milliseconds after which the method returns with
* or {@link #FOREVER}. * {@code false}, or {@link #FOREVER}.
* @param monitor a monitor to report progress. * @param monitor a monitor to report progress.
* @return <code>true</code>, if the indexer went idle in the given time. * @return <code>true</code>, if the indexer went idle in the given time.
*/ */
@ -305,13 +310,14 @@ public interface IIndexManager extends IPDOMManager {
/** /**
* Export index for usage within a team. * Export index for usage within a team.
* @param project a project for which the pdom is to be exported. * @param project a project for which the PDOM is to be exported.
* @param location the target location for the database. * @param location the target location for the database.
* @param options currently none are supported. * @param options currently none are supported.
* @throws CoreException * @throws CoreException
* @since 4.0 * @since 4.0
*/ */
public void export(ICProject project, String location, int options, IProgressMonitor monitor) throws CoreException; public void export(ICProject project, String location, int options, IProgressMonitor monitor)
throws CoreException;
/** /**
* Adds a participant for the indexer-setup * Adds a participant for the indexer-setup

View file

@ -328,7 +328,7 @@ public interface IIndexFragment {
IIndexFragmentFile[] getDefectiveFiles() throws CoreException; IIndexFragmentFile[] getDefectiveFiles() throws CoreException;
/** /**
* @return an array of files containg unresolved includes. * @return an array of files containing unresolved includes.
*/ */
IIndexFragmentFile[] getFilesWithUnresolvedIncludes() throws CoreException; IIndexFragmentFile[] getFilesWithUnresolvedIncludes() throws CoreException;

View file

@ -10,7 +10,6 @@
* Andrew Ferguson (Symbian) * Andrew Ferguson (Symbian)
* Sergey Prigogin (Google) * Sergey Prigogin (Google)
******************************************************************************/ ******************************************************************************/
package org.eclipse.cdt.internal.core.index; package org.eclipse.cdt.internal.core.index;
import org.eclipse.cdt.core.dom.ast.IASTName; import org.eclipse.cdt.core.dom.ast.IASTName;
@ -26,7 +25,6 @@ import org.eclipse.core.runtime.CoreException;
* The interface that an actual storage for an index has to implement. * The interface that an actual storage for an index has to implement.
*/ */
public interface IWritableIndexFragment extends IIndexFragment { public interface IWritableIndexFragment extends IIndexFragment {
/** /**
* Clears the entire fragment. * Clears the entire fragment.
*/ */

View file

@ -1546,9 +1546,9 @@ public class PDOMManager implements IWritableIndexManager, IListener {
/** /**
* Checks whether the index is in sync with the file system. * Checks whether the index is in sync with the file system.
* @param cproject the project to check * @param cproject the project to check
* @return <code>null</code> when the content in the project fragment of the specified project's index * @return {@code null} when the content in the project fragment of the specified project's
* is complete (contains all sources) and up to date; or an @link{IStatus} indicating the first * index is complete (contains all sources) and up to date; or an {@link IStatus} indicating
* occurrence of an index file found not up-to-date, along with its include trail. * the first occurrence of an index file found not up-to-date, along with its include trail.
* @throws CoreException in case of a file access or other internal error * @throws CoreException in case of a file access or other internal error
*/ */
public IStatus getProjectContentSyncState(ICProject cproject) throws CoreException { public IStatus getProjectContentSyncState(ICProject cproject) throws CoreException {

View file

@ -8,7 +8,6 @@
* Contributors: * Contributors:
* Andrew Ferguson (Symbian) - Initial implementation * Andrew Ferguson (Symbian) - Initial implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.ui.tests.search; package org.eclipse.cdt.ui.tests.search;
import junit.framework.TestSuite; import junit.framework.TestSuite;

View file

@ -13,7 +13,6 @@ package org.eclipse.cdt.internal.ui.actions;
import org.eclipse.cdt.core.index.IIndexManager; import org.eclipse.cdt.core.index.IIndexManager;
public class UpdateUnresolvedIncludesAction extends AbstractUpdateIndexAction { public class UpdateUnresolvedIncludesAction extends AbstractUpdateIndexAction {
@Override @Override
protected int getUpdateOptions() { protected int getUpdateOptions() {
return IIndexManager.UPDATE_UNRESOLVED_INCLUDES; return IIndexManager.UPDATE_UNRESOLVED_INCLUDES;

View file

@ -10,7 +10,6 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.ui.actions; package org.eclipse.cdt.internal.ui.actions;
/** /**
* Handler for {@link org.eclipse.cdt.internal.ui.actions.UpdateIndexWithModifiedFilesAction} * Handler for {@link org.eclipse.cdt.internal.ui.actions.UpdateIndexWithModifiedFilesAction}
* *
@ -18,7 +17,6 @@ package org.eclipse.cdt.internal.ui.actions;
* @noinstantiate This class is not intended to be instantiated by clients. * @noinstantiate This class is not intended to be instantiated by clients.
*/ */
public class UpdateUnresolvedIncludesHandler extends AbstractUpdateIndexHandler { public class UpdateUnresolvedIncludesHandler extends AbstractUpdateIndexHandler {
private final UpdateUnresolvedIncludesAction updateAction = new UpdateUnresolvedIncludesAction(); private final UpdateUnresolvedIncludesAction updateAction = new UpdateUnresolvedIncludesAction();
@Override @Override

View file

@ -24,7 +24,6 @@ import org.eclipse.cdt.core.index.IIndexFileLocation;
* @author Doug Schaefer * @author Doug Schaefer
*/ */
public class CSearchElement implements IAdaptable { public class CSearchElement implements IAdaptable {
private final IIndexFileLocation location; private final IIndexFileLocation location;
public CSearchElement(IIndexFileLocation loc) { public CSearchElement(IIndexFileLocation loc) {