1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

Fix warnings.

This commit is contained in:
Markus Schorn 2008-04-18 09:23:06 +00:00
parent 5b1f6b5408
commit 7af8d03be8
36 changed files with 132 additions and 293 deletions

View file

@ -11,9 +11,8 @@
package org.eclipse.cdt.core.model; package org.eclipse.cdt.core.model;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.cdt.internal.core.model.CModelStatus; import org.eclipse.cdt.internal.core.model.CModelStatus;
import org.eclipse.core.runtime.CoreException;
/** /**
* A checked exception representing a failure in the C model. * A checked exception representing a failure in the C model.
@ -34,10 +33,9 @@ public class CModelException extends CoreException {
* The exception contains a C-specific status object with severity * The exception contains a C-specific status object with severity
* <code>IStatus.ERROR</code> and the given status code. * <code>IStatus.ERROR</code> and the given status code.
* *
* @param exception the <code>Throwable</code> * @param e the {@link Throwable}
* @param code one of the C-specific status codes declared in * @param code one of the C-specific status codes declared in
* <code>ICModelStatusConstants</code> * <code>ICModelStatusConstants</code>
* @return the new C model exception
* @see ICModelStatusConstants * @see ICModelStatusConstants
* @see org.eclipse.core.runtime.IStatus#ERROR * @see org.eclipse.core.runtime.IStatus#ERROR
*/ */
@ -51,7 +49,6 @@ public class CModelException extends CoreException {
* <code>CModelException(exception,ICModelStatusConstants.CORE_EXCEPTION</code>. * <code>CModelException(exception,ICModelStatusConstants.CORE_EXCEPTION</code>.
* *
* @param exception the <code>CoreException</code> * @param exception the <code>CoreException</code>
* @return the new C model exception
*/ */
public CModelException(CoreException exception) { public CModelException(CoreException exception) {
this(new CModelStatus(exception)); this(new CModelStatus(exception));
@ -61,7 +58,6 @@ public class CModelException extends CoreException {
* Creates a C model exception for the given C-specific status object. * Creates a C model exception for the given C-specific status object.
* *
* @param status the C-specific status object * @param status the C-specific status object
* @return the new C model exception
*/ */
public CModelException(ICModelStatus status) { public CModelException(ICModelStatus status) {
super(status); super(status);

View file

@ -354,7 +354,7 @@ public class CoreModel {
} }
/** /**
* Return the registed content type id, for example: * Return the registered content type id, for example:
* <ul> * <ul>
* <li>CONTENT_TYPE_CHEADER * <li>CONTENT_TYPE_CHEADER
* <li>CONTENT_TYPE_CXXHEADER * <li>CONTENT_TYPE_CXXHEADER
@ -363,7 +363,6 @@ public class CoreModel {
* <li>CONTENT_TYPE_ASMSOURCE * <li>CONTENT_TYPE_ASMSOURCE
* </ul> * </ul>
* or null is return if no id match the list * or null is return if no id match the list
* @param file
* @return the know id or null * @return the know id or null
*/ */
public static String getRegistedContentTypeId(IProject project, String name) { public static String getRegistedContentTypeId(IProject project, String name) {
@ -460,8 +459,7 @@ public class CoreModel {
* is equivalent to <code>newContainerEntry(path,false)</code>. * is equivalent to <code>newContainerEntry(path,false)</code>.
* <p> * <p>
* *
* @param containerPath * @param id the id of the container
* the id of the container
* @return a new container entry * @return a new container entry
* *
*/ */
@ -649,14 +647,14 @@ 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</code>
* *
* @param resoourcePath * @param resourcePath
* the affected project-relative resource path * the affected project-relative resource path
* @param basePath * @param basePath
* the base path of the includePath * the base path of the includePath
* @param includePath * @param includePath
* the absolute path of the include * the absolute path of the include
* @param isSystemInclude * @param isSystemInclude
* wheter this include path should be consider the system * whether this include path should be consider the system
* include path * include path
* @param exclusionPatterns * @param exclusionPatterns
* exclusion patterns in the resource if a container * exclusion patterns in the resource if a container
@ -706,10 +704,6 @@ public class CoreModel {
/** /**
* Creates a new entry of kind <code>CDT_INCLUDE_FILE</code> * Creates a new entry of kind <code>CDT_INCLUDE_FILE</code>
*
* @param resourcePath
* @param includeFile
* @return
*/ */
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);
@ -738,7 +732,7 @@ public class CoreModel {
/** /**
* Creates and returns an entry kind <code>CDT_MACRO</code> * Creates and returns an entry kind <code>CDT_MACRO</code>
* *
* @param path * @param resourcePath
* the affected project-relative resource path * the affected project-relative resource path
* @param macroName * @param macroName
* the name of the macro * the name of the macro
@ -761,7 +755,6 @@ public class CoreModel {
* the value of the macro * the value of the macro
* @param exclusionPatterns * @param exclusionPatterns
* exclusion patterns in the resource if a container * exclusion patterns in the resource if a container
* @return
*/ */
public static IMacroEntry newMacroEntry(IPath resourcePath, String macroName, String macroValue, IPath[] exclusionPatterns) { public static IMacroEntry newMacroEntry(IPath resourcePath, String macroName, String macroValue, IPath[] exclusionPatterns) {
return newMacroEntry(resourcePath, macroName, macroValue, exclusionPatterns, false); return newMacroEntry(resourcePath, macroName, macroValue, exclusionPatterns, false);
@ -778,7 +771,6 @@ public class CoreModel {
* the value of the macro * the value of the macro
* @param exclusionPatterns * @param exclusionPatterns
* exclusion patterns in the resource if a container * exclusion patterns in the resource if a container
* @return
*/ */
public static IMacroEntry newMacroEntry(IPath resourcePath, String macroName, String macroValue, IPath[] exclusionPatterns, boolean isExported) { public static IMacroEntry newMacroEntry(IPath resourcePath, String macroName, String macroValue, IPath[] exclusionPatterns, boolean isExported) {
return new MacroEntry(resourcePath, null, macroName, macroValue, exclusionPatterns, isExported); return new MacroEntry(resourcePath, null, macroName, macroValue, exclusionPatterns, isExported);
@ -793,7 +785,6 @@ public class CoreModel {
* the base reference path * the base reference path
* @param macroName * @param macroName
* the name of the macro * the name of the macro
* @return IMacroEntry
*/ */
public static IMacroEntry newMacroRefEntry(IPath resourcePath, IPath baseRef, String macroName) { public static IMacroEntry newMacroRefEntry(IPath resourcePath, IPath baseRef, String macroName) {
return new MacroEntry(resourcePath, baseRef, macroName, null, APathEntry.NO_EXCLUSION_PATTERNS, false); return new MacroEntry(resourcePath, baseRef, macroName, null, APathEntry.NO_EXCLUSION_PATTERNS, false);
@ -801,10 +792,6 @@ public class CoreModel {
/** /**
* Creates an entry kind <code>CDT_MACRO_FILE</code> * Creates an entry kind <code>CDT_MACRO_FILE</code>
*
* @param resourcePath
* @param macroFile
* @return
*/ */
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);
@ -821,7 +808,6 @@ public class CoreModel {
* the file path where the macros are define * the file path where the macros are define
* @param exclusionPatterns * @param exclusionPatterns
* exclusion patterns in the resource if a container * exclusion patterns in the resource if a container
* @return
*/ */
public static IMacroFileEntry newMacroFileEntry(IPath resourcePath, IPath basePath, IPath baseRef, IPath macroFilePath, IPath[] exclusionPatterns, boolean isExported) { public static IMacroFileEntry newMacroFileEntry(IPath resourcePath, IPath basePath, IPath baseRef, IPath macroFilePath, IPath[] exclusionPatterns, boolean isExported) {
return new MacroFileEntry(resourcePath, basePath, baseRef, macroFilePath, exclusionPatterns, isExported); return new MacroFileEntry(resourcePath, basePath, baseRef, macroFilePath, exclusionPatterns, isExported);
@ -862,8 +848,7 @@ public class CoreModel {
* *
* @see PathEntryContainerInitializer * @see PathEntryContainerInitializer
* @see IPathEntryContainer * @see IPathEntryContainer
* @see #setPathEntryContainer(IPath, ICProject[], IPathEntryContainer, * @see #setPathEntryContainer(ICProject[], IPathEntryContainer, IProgressMonitor)
* IProgressMonitor)
*/ */
public static IPathEntryContainer getPathEntryContainer(IPath containerPath, ICProject project) throws CModelException { public static IPathEntryContainer getPathEntryContainer(IPath containerPath, ICProject project) throws CModelException {
return pathEntryManager.getPathEntryContainer(containerPath, project); return pathEntryManager.getPathEntryContainer(containerPath, project);
@ -892,13 +877,13 @@ public class CoreModel {
* *
* @param affectedProjects - * @param affectedProjects -
* the set of projects for which this container is being bound * the set of projects for which this container is being bound
* @param newContainer - * @param container -
* the container for the affected projects * the container for the affected projects
* @param monitor * @param monitor
* a monitor to report progress * a monitor to report progress
* @throws CModelException * @throws CModelException
* @see PathEntryContainerInitializer * @see PathEntryContainerInitializer
* @see #getPathEntryContainer(IPath, IJavaProject) * @see #getPathEntryContainer(IPath, ICProject)
* @see IPathEntryContainer * @see IPathEntryContainer
*/ */
public static void setPathEntryContainer(ICProject[] affectedProjects, IPathEntryContainer container, IProgressMonitor monitor) public static void setPathEntryContainer(ICProject[] affectedProjects, IPathEntryContainer container, IProgressMonitor monitor)
@ -928,7 +913,7 @@ public class CoreModel {
* specifies an empty pathentry. * specifies an empty pathentry.
* <p> * <p>
* *
* @param entries * @param newEntries
* a list of entries * a list of entries
* @param monitor * @param monitor
* the given progress monitor * the given progress monitor
@ -1066,9 +1051,6 @@ public class CoreModel {
/** /**
* Return the IPathEntryStore of the project. * Return the IPathEntryStore of the project.
*
* @param project
* @return
* @throws CoreException * @throws CoreException
*/ */
public static IPathEntryStore getPathEntryStore(IProject project) throws CoreException { public static IPathEntryStore getPathEntryStore(IProject project) throws CoreException {
@ -1110,7 +1092,6 @@ public class CoreModel {
* and during getResolvedPathEntries. * and during getResolvedPathEntries.
* <p> * <p>
* @param cProject the given C project * @param cProject the given C project
* @param PathEntry entries
* @return a status object with code <code>IStatus.OK</code> if * @return a status object with code <code>IStatus.OK</code> 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
@ -1308,8 +1289,7 @@ public class CoreModel {
if (cProject != null) { if (cProject != null) {
try { try {
IPathEntry[] resolvedPE = CoreModel.getRawPathEntries(cProject); IPathEntry[] resolvedPE = CoreModel.getRawPathEntries(cProject);
for (int i = 0; i < resolvedPE.length; i++) { for (IPathEntry pe : resolvedPE) {
IPathEntry pe = resolvedPE[i];
// first check all containers // first check all containers
if (pe.getEntryKind() == IPathEntry.CDT_CONTAINER) { if (pe.getEntryKind() == IPathEntry.CDT_CONTAINER) {
IPathEntryContainer peContainer = CoreModel.getPathEntryContainer( IPathEntryContainer peContainer = CoreModel.getPathEntryContainer(
@ -1344,7 +1324,7 @@ public class CoreModel {
} }
/** /**
* this method is a full equivalent to {@link #createProjectDescription(IProject, boolean, false)} * this method is a full equivalent to <code>createProjectDescription(project, loadIfExists, false)</code>.
* *
* @see #createProjectDescription(IProject, boolean, boolean) * @see #createProjectDescription(IProject, boolean, boolean)
*/ */
@ -1398,7 +1378,7 @@ public class CoreModel {
* @param des * @param des
* @throws CoreException * @throws CoreException
* *
* @see {@link #getProjectDescription(IProject, boolean)} * @see #getProjectDescription(IProject, boolean)
* @see #createProjectDescription(IProject, boolean) * @see #createProjectDescription(IProject, boolean)
*/ */
public void setProjectDescription(IProject project, ICProjectDescription des) throws CoreException { public void setProjectDescription(IProject project, ICProjectDescription des) throws CoreException {
@ -1454,18 +1434,14 @@ public class CoreModel {
} }
/** /**
* aswers 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
* @param project
* @return
*/ */
public boolean isNewStyleProject(IProject project){ public boolean isNewStyleProject(IProject project){
return descriptionManager.isNewStyleProject(project); return descriptionManager.isNewStyleProject(project);
} }
/** /**
* aswers 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
* @param des
* @return
*/ */
public boolean isNewStyleProject(ICProjectDescription des){ public boolean isNewStyleProject(ICProjectDescription des){
return descriptionManager.isNewStyleProject(des); return descriptionManager.isNewStyleProject(des);

View file

@ -15,7 +15,6 @@ package org.eclipse.cdt.core.model;
import java.net.URI; import java.net.URI;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -72,11 +71,11 @@ public class CoreModelUtil {
if (exclusionPatterns == null) if (exclusionPatterns == null)
return false; return false;
char[] path = resourcePath.toString().toCharArray(); char[] path = resourcePath.toString().toCharArray();
for (int i = 0, length = exclusionPatterns.length; i < length; i++) { for (char[] exclusionPattern : exclusionPatterns) {
if (prefixOfCharArray(exclusionPatterns[i], path)) { if (prefixOfCharArray(exclusionPattern, path)) {
return true; return true;
} }
if (pathMatch(exclusionPatterns[i], path, true, '/')) { if (pathMatch(exclusionPattern, path, true, '/')) {
return true; return true;
} }
} }
@ -547,8 +546,7 @@ public class CoreModelUtil {
public static ITranslationUnit findTranslationUnitForLocation(IPath location, ICProject preferredProject) throws CModelException { public static ITranslationUnit findTranslationUnitForLocation(IPath location, ICProject preferredProject) throws CModelException {
IFile[] files= ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(location); IFile[] files= ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(location);
if (files.length > 0) { if (files.length > 0) {
for (int i = 0; i < files.length; i++) { for (IFile file : files) {
IFile file = files[i];
ITranslationUnit tu= findTranslationUnit(file); ITranslationUnit tu= findTranslationUnit(file);
if (tu != null) { if (tu != null) {
return tu; return tu;
@ -584,8 +582,7 @@ public class CoreModelUtil {
public static ITranslationUnit findTranslationUnitForLocation(URI locationURI, ICProject preferredProject) throws CModelException { public static ITranslationUnit findTranslationUnitForLocation(URI locationURI, ICProject preferredProject) throws CModelException {
IFile[] files= ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(locationURI); IFile[] files= ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(locationURI);
if (files.length > 0) { if (files.length > 0) {
for (int i = 0; i < files.length; i++) { for (IFile file : files) {
IFile file = files[i];
ITranslationUnit tu= findTranslationUnit(file); ITranslationUnit tu= findTranslationUnit(file);
if (tu != null) { if (tu != null) {
return tu; return tu;
@ -684,17 +681,16 @@ public class CoreModelUtil {
*/ */
public static ICConfigurationDescription[] getReferencedConfigurationDescriptions(ICConfigurationDescription cfgDes, boolean writable){ public static ICConfigurationDescription[] getReferencedConfigurationDescriptions(ICConfigurationDescription cfgDes, boolean writable){
List result = new ArrayList(); List<ICConfigurationDescription> result = new ArrayList<ICConfigurationDescription>();
if(cfgDes != null) { if(cfgDes != null) {
Map map = cfgDes.getReferenceInfo(); Map<String, String> map = cfgDes.getReferenceInfo();
if(map.size() != 0){ if(map.size() != 0){
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
CoreModel model = CoreModel.getDefault(); CoreModel model = CoreModel.getDefault();
for(Iterator iter = map.entrySet().iterator(); iter.hasNext();){ for (Map.Entry<String,String> entry : map.entrySet()) {
Map.Entry entry = (Map.Entry)iter.next(); String projName = entry.getKey();
String projName = (String)entry.getKey(); String cfgId = entry.getValue();
String cfgId = (String)entry.getValue();
IProject project = root.getProject(projName); IProject project = root.getProject(projName);
if(!project.exists()) if(!project.exists())
continue; continue;
@ -715,7 +711,7 @@ public class CoreModelUtil {
} }
} }
return (ICConfigurationDescription[]) result.toArray(new ICConfigurationDescription[result.size()]); return result.toArray(new ICConfigurationDescription[result.size()]);
} }
/** /**
@ -730,24 +726,23 @@ public class CoreModelUtil {
* @see CoreModelUtil#getReferencedConfigurationDescriptions(ICConfigurationDescription, boolean) * @see CoreModelUtil#getReferencedConfigurationDescriptions(ICConfigurationDescription, boolean)
*/ */
public static ICConfigurationDescription[] getReferencingConfigurationDescriptions(ICConfigurationDescription cfgDes, boolean writable) { public static ICConfigurationDescription[] getReferencingConfigurationDescriptions(ICConfigurationDescription cfgDes, boolean writable) {
List result = new ArrayList(); List<ICConfigurationDescription> result = new ArrayList<ICConfigurationDescription>();
if(cfgDes!=null) { if(cfgDes!=null) {
CoreModel core= CoreModel.getDefault(); CoreModel core= CoreModel.getDefault();
IProject[] projects= ResourcesPlugin.getWorkspace().getRoot().getProjects(); IProject[] projects= ResourcesPlugin.getWorkspace().getRoot().getProjects();
for (int i=0; i<projects.length; i++) { for (IProject cproject : projects) {
IProject cproject= projects[i];
ICProjectDescription prjDes= core.getProjectDescription(cproject, writable); ICProjectDescription prjDes= core.getProjectDescription(cproject, writable);
//in case this is not a CDT project the description will be null, so check for null //in case this is not a CDT project the description will be null, so check for null
if(prjDes != null){ if(prjDes != null){
ICConfigurationDescription[] cfgDscs= prjDes.getConfigurations(); ICConfigurationDescription[] cfgDscs= prjDes.getConfigurations();
for(int j=0; j<cfgDscs.length; j++) { for (ICConfigurationDescription cfgDsc : cfgDscs) {
ICConfigurationDescription[] references = getReferencedConfigurationDescriptions(cfgDscs[j], false); ICConfigurationDescription[] references = getReferencedConfigurationDescriptions(cfgDsc, false);
for (int k=0; k<references.length; k++) { for (ICConfigurationDescription reference : references) {
if(references[k]!=null if(reference!=null
&& references[k].getId().equals(cfgDes.getId())) { && reference.getId().equals(cfgDes.getId())) {
result.add(cfgDscs[j]); result.add(cfgDsc);
break; break;
} }
} }
@ -756,7 +751,7 @@ public class CoreModelUtil {
} }
} }
return (ICConfigurationDescription[]) result.toArray(new ICConfigurationDescription[result.size()]); return result.toArray(new ICConfigurationDescription[result.size()]);
} }
/** /**
@ -767,16 +762,16 @@ public class CoreModelUtil {
public static String[] getBinaryParserIds(ICConfigurationDescription[] cfgs) { public static String[] getBinaryParserIds(ICConfigurationDescription[] cfgs) {
if (cfgs == null || cfgs.length == 0) if (cfgs == null || cfgs.length == 0)
return null; return null;
ArrayList pids = new ArrayList(); ArrayList<String> pids = new ArrayList<String>();
for (int i=0; i<cfgs.length; i++) { for (ICConfigurationDescription cfg : cfgs) {
ICTargetPlatformSetting tps = cfgs[i].getTargetPlatformSetting(); ICTargetPlatformSetting tps = cfg.getTargetPlatformSetting();
String[] ids = tps.getBinaryParserIds(); String[] ids = tps.getBinaryParserIds();
for (int j = 0; j < ids.length; j++) { for (int j = 0; j < ids.length; j++) {
if (!pids.contains(ids[j])) if (!pids.contains(ids[j]))
pids.add(ids[j]); pids.add(ids[j]);
} }
} }
return (String[])pids.toArray(new String[pids.size()]); return pids.toArray(new String[pids.size()]);
} }
/** /**
@ -787,8 +782,8 @@ public class CoreModelUtil {
public static void setBinaryParserIds(ICConfigurationDescription[] cfgs, String[] pids) { public static void setBinaryParserIds(ICConfigurationDescription[] cfgs, String[] pids) {
if (cfgs == null || cfgs.length == 0) if (cfgs == null || cfgs.length == 0)
return; return;
for (int i=0; i<cfgs.length; i++) { for (ICConfigurationDescription cfg : cfgs) {
cfgs[i].getTargetPlatformSetting().setBinaryParserIds(pids); cfg.getTargetPlatformSetting().setBinaryParserIds(pids);
} }
} }
} }

View file

@ -12,6 +12,8 @@ package org.eclipse.cdt.core.model;
*******************************************************************************/ *******************************************************************************/
import java.util.EventObject; import java.util.EventObject;
import org.eclipse.cdt.internal.core.model.CShiftData;
/** /**
* An element changed event describes a change to the structure or contents * An element changed event describes a change to the structure or contents
* of a tree of C elements. The changes to the elements are described by * of a tree of C elements. The changes to the elements are described by

View file

@ -16,10 +16,6 @@ package org.eclipse.cdt.core.model;
* while inspecting the project. * while inspecting the project.
*/ */
public interface IArchiveContainer extends ICElement, IParent, IOpenable { public interface IArchiveContainer extends ICElement, IParent, IOpenable {
/**
*
* @return
* @throws CModelException
*/
public IArchive[] getArchives() throws CModelException; public IArchive[] getArchives() throws CModelException;
} }

View file

@ -17,10 +17,5 @@ package org.eclipse.cdt.core.model;
*/ */
public interface IBinaryContainer extends ICElement, IParent, IOpenable { public interface IBinaryContainer extends ICElement, IParent, IOpenable {
/**
*
* @return
* @throws CModelException
*/
public IBinary[] getBinaries() throws CModelException; public IBinary[] getBinaries() throws CModelException;
} }

View file

@ -15,10 +15,5 @@ package org.eclipse.cdt.core.model;
*/ */
public interface IBinaryModule extends IParent, IBinaryElement { public interface IBinaryModule extends IParent, IBinaryElement {
/**
*
* @return
* @throws CModelException
*/
IBinaryElement[] getBinaryElements() throws CModelException; IBinaryElement[] getBinaryElements() throws CModelException;
} }

View file

@ -27,7 +27,7 @@ public interface ICContainer extends ICElement, IParent, IOpenable {
* </p> * </p>
* *
* @return an array of non-C resources directly contained in this project * @return an array of non-C resources directly contained in this project
* @exception JavaModelException 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
*/ */
Object[] getNonCResources() throws CModelException; Object[] getNonCResources() throws CModelException;
@ -56,7 +56,6 @@ public interface ICContainer extends ICElement, IParent, IOpenable {
/** /**
* Returns the all the binaries of this container. * Returns the all the binaries of this container.
* *
* @return
* @throws CModelException * @throws CModelException
*/ */
IBinary[] getBinaries() throws CModelException; IBinary[] getBinaries() throws CModelException;
@ -64,36 +63,26 @@ public interface ICContainer extends ICElement, IParent, IOpenable {
/** /**
* Return the binary for this name, it must be a * Return the binary for this name, it must be a
* valid binary * valid binary
* This is a handle-only operation. The celement * This is a handle-only operation. The container may or may not exist.
* may or may not exist.
*
* @return
* @throws CModelException
*/ */
IBinary getBinary(String name); IBinary getBinary(String name);
/** /**
* Returns all the archive of this container * Returns all the archive of this container
* *
* @return
* @throws CModelException * @throws CModelException
*/ */
IArchive[] getArchives() throws CModelException; IArchive[] getArchives() throws CModelException;
/** /**
* This is a handle-only operation. The celement * This is a handle-only operation. The container
* may or may not exist. * may or may not exist.
*
* @param file
* @return
* @throws CModelException
*/ */
IArchive getArchive(String name); IArchive getArchive(String name);
/** /**
* Return al the child containers of this container. * Return al the child containers of this container.
* *
* @return
* @throws CModelException * @throws CModelException
*/ */
ICContainer[] getCContainers() throws CModelException; ICContainer[] getCContainers() throws CModelException;

View file

@ -376,8 +376,6 @@ public interface ICElement extends IAdaptable {
* in a resource. * in a resource.
* *
* @return the underlying resource, or <code>null</code> if none * @return the underlying resource, or <code>null</code> if none
* @exception CModelException if this element does not exist or if an
* exception occurs while accessing its underlying resource
*/ */
IResource getUnderlyingResource(); IResource getUnderlyingResource();
@ -387,8 +385,6 @@ public interface ICElement extends IAdaptable {
* a corresponding resource. * a corresponding resource.
* *
* @return the corresponding resource, or <code>null</code> if none * @return the corresponding resource, or <code>null</code> if none
* @exception CModelException if this element does not exist or if an
* exception occurs while accessing its resource
*/ */
IResource getResource(); IResource getResource();
/** /**

View file

@ -20,9 +20,6 @@ public interface ICElementVisitor {
/** /**
* Visited a member if the ICElement tree. Returns whether to visit the children * Visited a member if the ICElement tree. Returns whether to visit the children
* of this element. * of this element.
*
* @param element
* @return
*/ */
public boolean visit(ICElement element) throws CoreException; public boolean visit(ICElement element) throws CoreException;

View file

@ -25,7 +25,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
* delete operations on multiple C elements. * delete operations on multiple C elements.
* </p> * </p>
* *
* @see CCore#create(org.eclipse.core.resources.IWorkspaceRoot) * @see CoreModel#create(org.eclipse.core.resources.IWorkspaceRoot)
*/ */
public interface ICModel extends ICElement, IParent, IOpenable { public interface ICModel extends ICElement, IParent, IOpenable {
/** /**

View file

@ -59,8 +59,6 @@ public interface ICModelStatusConstants {
* Status constant indicating that one or more elements * Status constant indicating that one or more elements
* supplied do not exist. * supplied do not exist.
* The element(s) can be retrieved using <code>getElements</code> on the status object. * The element(s) can be retrieved using <code>getElements</code> on the status object.
*
* @see ICModelStatus#isDoesNotExist
*/ */
public static final int ELEMENT_DOES_NOT_EXIST = 969; public static final int ELEMENT_DOES_NOT_EXIST = 969;
@ -198,21 +196,21 @@ public interface ICModelStatusConstants {
/** /**
* Status indicating that a C element could not be created because * Status indicating that a C element could not be created because
* the underlying resource is invalid. * the underlying resource is invalid.
* @see CCore * @see CoreModel
*/ */
public static final int INVALID_RESOURCE = 995; public static final int INVALID_RESOURCE = 995;
/** /**
* Status indicating that a C element could not be created because * Status indicating that a C element could not be created because
* the underlying resource is not of an appropriate type. * the underlying resource is not of an appropriate type.
* @see CCore * @see CoreModel
*/ */
public static final int INVALID_RESOURCE_TYPE = 996; public static final int INVALID_RESOURCE_TYPE = 996;
/** /**
* Status indicating that a C element could not be created because * Status indicating that a C element could not be created because
* the project owning underlying resource does not have the C nature. * the project owning underlying resource does not have the C nature.
* @see CCore * @see CoreModel
*/ */
public static final int INVALID_PROJECT = 997; public static final int INVALID_PROJECT = 997;

View file

@ -22,11 +22,10 @@ import org.eclipse.core.runtime.IProgressMonitor;
/** /**
* A C project represents a view of a project resource in terms of C * A C project represents a view of a project resource in terms of C
* elements such as , ICContainer, ITranslationUnit .... * elements such as , ICContainer, ITranslationUnit ....
* <code>CCore.create(project)</code>. * <code>CoreModel.create(project)</code>.
* </p> * </p>
* *
* @see CCore#create(org.eclipse.core.resources.IProject) * @see CoreModel#create(org.eclipse.core.resources.IProject)
* @see IBuildEntry
*/ */
public interface ICProject extends IParent, IOpenable, ICElement { public interface ICProject extends IParent, IOpenable, ICElement {
@ -42,14 +41,12 @@ public interface ICProject extends IParent, IOpenable, ICElement {
/** /**
* Return the ArchiveContainer of this Project. * Return the ArchiveContainer of this Project.
* @return
* @throws CModelException * @throws CModelException
*/ */
IArchiveContainer getArchiveContainer() throws CModelException; IArchiveContainer getArchiveContainer() throws CModelException;
/** /**
* Return the BinaryContainer of this Project. * Return the BinaryContainer of this Project.
* @return
* @throws CModelException * @throws CModelException
*/ */
IBinaryContainer getBinaryContainer() throws CModelException; IBinaryContainer getBinaryContainer() throws CModelException;
@ -66,11 +63,11 @@ public interface ICProject extends IParent, IOpenable, ICElement {
/** /**
* Returns all of the existing source roots that exist * Returns all of the existing source roots that exist
* on the pathentry, in the order they are defined by the ".cdtproject". * on the project, in the order they are defined by the ".cdtproject".
* *
* @return all of the existing package fragment roots that exist * @return all of the existing package fragment roots that exist
* on the classpath * on the classpath
* @exception JavaModelException 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
*/ */
ISourceRoot[] getAllSourceRoots() throws CModelException; ISourceRoot[] getAllSourceRoots() throws CModelException;
@ -90,26 +87,22 @@ public interface ICProject extends IParent, IOpenable, ICElement {
/** /**
* Return the output entries. * Return the output entries.
* *
* @return
* @throws CModelException * @throws CModelException
*/ */
public IOutputEntry[] getOutputEntries() throws CModelException; public IOutputEntry[] getOutputEntries() throws CModelException;
/** /**
* @param resource * @param resource
* @return
*/ */
boolean isOnOutputEntry(IResource resource); boolean isOnOutputEntry(IResource resource);
/** /**
* @param resource * @param resource
* @return
*/ */
boolean isOnSourceRoot(IResource resource); boolean isOnSourceRoot(IResource resource);
/** /**
* @param element * @param element
* @return
*/ */
boolean isOnSourceRoot(ICElement element); boolean isOnSourceRoot(ICElement element);
@ -123,7 +116,6 @@ public interface ICProject extends IParent, IOpenable, ICElement {
/** /**
* Return the include paths set on the project. * Return the include paths set on the project.
* *
* @return
* @throws CModelException * @throws CModelException
*/ */
IIncludeReference[] getIncludeReferences() throws CModelException; IIncludeReference[] getIncludeReferences() throws CModelException;
@ -245,7 +237,7 @@ public interface ICProject extends IParent, IOpenable, ICElement {
* </p> * </p>
* *
* @return an array of non-C resources directly contained in this project * @return an array of non-C resources directly contained in this project
* @exception JavaModelException 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
*/ */
Object[] getNonCResources() throws CModelException; Object[] getNonCResources() throws CModelException;

View file

@ -10,6 +10,8 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.model; package org.eclipse.cdt.core.model;
import org.eclipse.core.runtime.IAdaptable;
/** /**
* Additions to the <code>ICElement</code> hierarchy provided by * Additions to the <code>ICElement</code> hierarchy provided by

View file

@ -23,9 +23,6 @@ public interface IFunctionDeclaration extends IDeclaration {
* *
* <p>For example, a source method declaring <code>"void f(int a) throw (x1, x2);"</code>, * <p>For example, a source method declaring <code>"void f(int a) throw (x1, x2);"</code>,
* would return the array <code>{"x1", "x2"}</code>. * would return the array <code>{"x1", "x2"}</code>.
*
* @exception CModelException if this element does not exist or if an
* exception occurs while accessing its corresponding resource.
*/ */
String[] getExceptions(); String[] getExceptions();
@ -40,9 +37,6 @@ public interface IFunctionDeclaration extends IDeclaration {
* *
* <p>For example, a method declared as <code>public void foo(String text, int length=9)</code> * <p>For example, a method declared as <code>public void foo(String text, int length=9)</code>
* would return the array <code>{"9"}</code>. * would return the array <code>{"9"}</code>.
*
* @exception CModelException if this argument does not exist or if an
* exception occurs while accessing its corresponding resource.
*/ */
String getParameterInitializer(int pos); String getParameterInitializer(int pos);

View file

@ -28,15 +28,11 @@ public interface IIncludeEntry extends IPathEntry {
/** /**
* Return the includePath with the base path. * Return the includePath with the base path.
*
* @return
*/ */
IPath getFullIncludePath(); IPath getFullIncludePath();
/** /**
* Return the reference path * Return the reference path
*
* @return
*/ */
IPath getBaseReference(); IPath getBaseReference();

View file

@ -23,8 +23,6 @@ public interface IIncludeFileEntry extends IPathEntry {
/** /**
* Return the includeFilePath with the base path. * Return the includeFilePath with the base path.
*
* @return
*/ */
IPath getFullIncludeFilePath(); IPath getFullIncludeFilePath();
@ -36,8 +34,6 @@ public interface IIncludeFileEntry extends IPathEntry {
/** /**
* Return the reference path * Return the reference path
*
* @return
*/ */
IPath getBaseReference(); IPath getBaseReference();

View file

@ -20,22 +20,16 @@ public interface IIncludeReference extends IParent, ICElement {
/** /**
* Returns the pathEntry * Returns the pathEntry
*
* @return
*/ */
IIncludeEntry getIncludeEntry(); IIncludeEntry getIncludeEntry();
/** /**
* Return the affected path * Return the affected path
* @return
*/ */
IPath getAffectedPath(); IPath getAffectedPath();
/** /**
* Return true if the path is on the include path Entry * Return true if the path is on the include path Entry
*
* @param path
* @return
*/ */
boolean isOnIncludeEntry(IPath path); boolean isOnIncludeEntry(IPath path);

View file

@ -79,14 +79,6 @@ public interface ILanguage extends IAdaptable {
/** /**
* Return the AST completion node for the given offset. * Return the AST completion node for the given offset.
*
* @param reader
* @param scanInfo
* @param fileCreator
* @param index
* @param log
* @param offset
* @return
* @throws CoreException * @throws CoreException
*/ */
public IASTCompletionNode getCompletionNode(CodeReader reader, IScannerInfo scanInfo, ICodeReaderFactory fileCreator, IIndex index, IParserLogService log, int offset) throws CoreException; public IASTCompletionNode getCompletionNode(CodeReader reader, IScannerInfo scanInfo, ICodeReaderFactory fileCreator, IIndex index, IParserLogService log, int offset) throws CoreException;

View file

@ -46,7 +46,7 @@ public interface ILanguageMappingChangeEvent {
* *
* @return a String corresponding to the full path to the file for which settings have changed if this * @return a String corresponding to the full path to the file for which settings have changed if this
* event's type is TYPE_FILE, or null otherwise. * event's type is TYPE_FILE, or null otherwise.
* @see getProject() * @see #getProject()
* *
* @since 4.0 * @since 4.0
*/ */
@ -61,7 +61,7 @@ public interface ILanguageMappingChangeEvent {
* In order to obtain the full context for the file it may be required that you also call getProject(), * In order to obtain the full context for the file it may be required that you also call getProject(),
* as it is possible that this file may not live inside the workspace. * as it is possible that this file may not live inside the workspace.
* *
* @see getProject() * @see #getProject()
* *
* @since 4.0 * @since 4.0
*/ */
@ -80,9 +80,9 @@ public interface ILanguageMappingChangeEvent {
/** /**
* Returns the type of even being reported. * Returns the type of even being reported.
* @return the type of even being reported * @return the type of even being reported
* @see TYPE_WORKSPACE * @see #TYPE_WORKSPACE
* @see TYPE_PROJECT * @see #TYPE_PROJECT
* @see TYPE_FILE * @see #TYPE_FILE
* *
* @since 4.0 * @since 4.0
*/ */

View file

@ -14,7 +14,7 @@ package org.eclipse.cdt.core.model;
* Listens to changes in language mappings. * Listens to changes in language mappings.
* *
* @author crecoskie * @author crecoskie
* @ since 4.0 * @since 4.0
*/ */
public interface ILanguageMappingChangeListener { public interface ILanguageMappingChangeListener {

View file

@ -63,21 +63,17 @@ public interface ILibraryEntry extends IPathEntry {
/** /**
* Return the base reference. * Return the base reference.
*
* @return
*/ */
IPath getBaseReference(); IPath getBaseReference();
/** /**
* Return the library path. * Return the library path.
* @return
*/ */
IPath getLibraryPath(); IPath getLibraryPath();
/** /**
* Returns the complete path, equivalent to: * Returns the complete path, equivalent to:
* getBasepath().append(getPath()); * getBasepath().append(getPath());
* @return
*/ */
IPath getFullLibraryPath(); IPath getFullLibraryPath();

View file

@ -17,7 +17,6 @@ public interface ILibraryReference extends IParent, ICElement {
/** /**
* Return the pathEntry. * Return the pathEntry.
* @return
*/ */
ILibraryEntry getLibraryEntry(); ILibraryEntry getLibraryEntry();
} }

View file

@ -40,7 +40,6 @@ public interface IMacroEntry extends IPathEntry {
/** /**
* Return the base path. * Return the base path.
* @return
*/ */
IPath getBasePath(); IPath getBasePath();

View file

@ -28,7 +28,6 @@ public interface IMacroFileEntry extends IPathEntry {
/** /**
* Return the base path. * Return the base path.
* @return
*/ */
IPath getBasePath(); IPath getBasePath();

View file

@ -30,14 +30,11 @@ public interface IParent {
/** /**
* returns the children of a certain type * returns the children of a certain type
*/ */
public List getChildrenOfType(int type) throws CModelException; public List<ICElement> getChildrenOfType(int type) throws CModelException;
/** /**
* Returns whether this element has one or more immediate children. * Returns whether this element has one or more immediate children.
* This is a convenience method, and may be more efficient than * This is a convenience method, and may be more efficient than
* testing whether <code>getChildren</code> is an empty array. * testing whether <code>getChildren</code> is an empty array.
*
* @exception CModelException if this element does not exist or if an
* exception occurs while accessing its corresponding resource
*/ */
boolean hasChildren(); boolean hasChildren();

View file

@ -37,7 +37,6 @@ public interface IPathEntryContainerExtension extends IPathEntryContainer {
* Returns whether there are any path entries for the resource. * Returns whether there are any path entries for the resource.
* *
* @param path Workspace relative path. * @param path Workspace relative path.
* @return
*/ */
boolean isEmpty(IPath path); boolean isEmpty(IPath path);
} }

View file

@ -26,10 +26,7 @@ package org.eclipse.cdt.core.model;
* </p> * </p>
* <p> * <p>
* This interface is not intended to be implemented by clients. * This interface is not intended to be implemented by clients.
* Instances can be created via the <code>CoreModel.newRegion</code>.
* </p> * </p>
*
* @see CoreModel#newRegion()
*/ */
public interface IRegion { public interface IRegion {
/** /**

View file

@ -52,8 +52,6 @@ public interface ISourceReference {
/** /**
* 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</code>
* 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).
* @return
* @throws CModelException
*/ */
ITranslationUnit getTranslationUnit(); ITranslationUnit getTranslationUnit();
} }

View file

@ -19,22 +19,10 @@ import org.eclipse.core.runtime.IPath;
*/ */
public interface ISourceRoot extends ICContainer { public interface ISourceRoot extends ICContainer {
/**
* @param resource
* @return
*/
boolean isOnSourceEntry(IResource resource); boolean isOnSourceEntry(IResource resource);
/**
* @param path
* @return
*/
boolean isOnSourceEntry(IPath path); boolean isOnSourceEntry(IPath path);
/**
* @param element
* @return
*/
boolean isOnSourceEntry(ICElement element); boolean isOnSourceEntry(ICElement element);
} }

View file

@ -178,9 +178,9 @@ public class LanguageMappingChangeEvent implements ILanguageMappingChangeEvent {
* Sets the type of this event. This type will be returned by getType(). * Sets the type of this event. This type will be returned by getType().
* *
* @param type the type to set * @param type the type to set
* @see ILanguageMappingChangeEvent.TYPE_WORKSPACE * @see ILanguageMappingChangeEvent#TYPE_WORKSPACE
* @see ILanguageMappingChangeEvent.TYPE_PROJECT * @see ILanguageMappingChangeEvent#TYPE_PROJECT
* @see ILanguageMappingChangeEvent.TYPE_FILE * @see ILanguageMappingChangeEvent#TYPE_FILE
*/ */
public void setType(int type) { public void setType(int type) {
fType = type; fType = type;

View file

@ -63,7 +63,6 @@ public class PathEntryContainerChanged {
/** /**
* Type of change. * Type of change.
* @return
*/ */
public int getType() { public int getType() {
return fType; return fType;
@ -71,15 +70,13 @@ public class PathEntryContainerChanged {
/** /**
* whether or not the change affected the include paths * whether or not the change affected the include paths
* @return
*/ */
public boolean isIncludeChange() { public boolean isIncludeChange() {
return (fType & INCLUDE_CHANGED) != 0; return (fType & INCLUDE_CHANGED) != 0;
} }
/** /**
* Whether or not the chage affected the macro entries * Whether or not the change affected the macro entries
* @return
*/ */
public boolean isMacroChange() { public boolean isMacroChange() {
return (fType & MACRO_CHANGED) != 0; return (fType & MACRO_CHANGED) != 0;

View file

@ -59,8 +59,8 @@ public abstract class PathEntryContainerInitializer {
* @param project the project for which the container is to be updated * @param project the project for which the container is to be updated
* @param containerSuggestion a suggestion to update the corresponding container definition * @param containerSuggestion a suggestion to update the corresponding container definition
* @throws CoreException when <code>CoreModel#setPathEntryContainer</code> would throw any. * @throws CoreException when <code>CoreModel#setPathEntryContainer</code> would throw any.
* @see CoreModel#setPathEntryContainer(IPath, ICProject[], IPathEntryContainer[], org.eclipse.core.runtime.IProgressMonitor) * @see CoreModel#setPathEntryContainer(ICProject[], IPathEntryContainer, org.eclipse.core.runtime.IProgressMonitor)
* @see PathContainerInitializer#canUpdatePathContainer(IPath, ICProject) * @see #canUpdatePathEntryContainer(IPath, ICProject)
*/ */
public void requestPathEntryContainerUpdate(IPath containerPath, ICProject project, IPathEntryContainer containerSuggestion) throws CoreException { public void requestPathEntryContainerUpdate(IPath containerPath, ICProject project, IPathEntryContainer containerSuggestion) throws CoreException {

View file

@ -13,7 +13,9 @@ package org.eclipse.cdt.core.settings.model;
import java.util.Map; import java.util.Map;
import org.eclipse.cdt.core.cdtvariables.ICdtVariablesContributor; import org.eclipse.cdt.core.cdtvariables.ICdtVariablesContributor;
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData; import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
import org.eclipse.cdt.core.settings.model.extension.CConfigurationDataProvider;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.QualifiedName; import org.eclipse.core.runtime.QualifiedName;
@ -35,8 +37,6 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
/** /**
* returns the human-readable configuration description * returns the human-readable configuration description
*
* @return
*/ */
String getDescription(); String getDescription();
@ -45,13 +45,12 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* *
* @param des * @param des
* @throws WriteAccessException when the configuration description is read-only * @throws WriteAccessException when the configuration description is read-only
* the description is read only if it was queried/returned by the {@link CoreModel#getProjectDescription(org.eclipse.core.resources.IProject, false)} call * see {@link CoreModel#getProjectDescription(org.eclipse.core.resources.IProject, boolean)}
*/ */
void setDescription(String des) throws WriteAccessException; void setDescription(String des) throws WriteAccessException;
/** /**
* returns the project description this configuration belongsa to * returns the project description this configuration belongs to
* @return
*/ */
ICProjectDescription getProjectDescription(); ICProjectDescription getProjectDescription();
@ -59,7 +58,6 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* returns the "root" folder description * returns the "root" folder description
* The root folder description is the default one used for the project root folder * The root folder description is the default one used for the project root folder
* The root folder description can not be null * The root folder description can not be null
* @return
*/ */
ICFolderDescription getRootFolderDescription(); ICFolderDescription getRootFolderDescription();
@ -67,7 +65,6 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* returns the complete set of folder descriptions defined for this configuration * returns the complete set of folder descriptions defined for this configuration
* The folder description is the settings holder for the specified folder * The folder description is the settings holder for the specified folder
* @see ICFolderDescription * @see ICFolderDescription
* @return
*/ */
ICFolderDescription[] getFolderDescriptions(); ICFolderDescription[] getFolderDescriptions();
@ -75,7 +72,6 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* returns the complete set of file descriptions defined for this configuration * returns the complete set of file descriptions defined for this configuration
* The file description is the settings holder for the specified file * The file description is the settings holder for the specified file
* @see ICFileDescription * @see ICFileDescription
* @return
*/ */
ICFileDescription[] getFileDescriptions(); ICFileDescription[] getFileDescriptions();
@ -85,7 +81,6 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* @see ICResourceDescription * @see ICResourceDescription
* @see ICFileDescription * @see ICFileDescription
* @see ICFolderDescription * @see ICFolderDescription
* @return
*/ */
ICResourceDescription[] getResourceDescriptions(); ICResourceDescription[] getResourceDescriptions();
@ -108,8 +103,7 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* @param des * @param des
* @throws CoreException * @throws CoreException
* @throws WriteAccessException when the configuration description is read-only * @throws WriteAccessException when the configuration description is read-only
* the description is read only if it was queried/returned by the {@link CoreModel#getProjectDescription(org.eclipse.core.resources.IProject, false)} call * see {@link CoreModel#getProjectDescription(org.eclipse.core.resources.IProject, boolean)}
*
*/ */
void removeResourceDescription(ICResourceDescription des) throws CoreException, WriteAccessException; void removeResourceDescription(ICResourceDescription des) throws CoreException, WriteAccessException;
@ -117,10 +111,9 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* creates a new file description for the specified path * creates a new file description for the specified path
* @param path project-relative file workspace path * @param path project-relative file workspace path
* @param base resource description from which settings will be coppied/inheritted * @param base resource description from which settings will be coppied/inheritted
* @return
* @throws CoreException * @throws CoreException
* @throws WriteAccessException when the configuration description is read-only * @throws WriteAccessException when the configuration description is read-only
* the description is read only if it was queried/returned by the {@link CoreModel#getProjectDescription(org.eclipse.core.resources.IProject, false)} call * see {@link CoreModel#getProjectDescription(org.eclipse.core.resources.IProject, boolean)}
*/ */
ICFileDescription createFileDescription(IPath path, ICResourceDescription base) throws CoreException, WriteAccessException; ICFileDescription createFileDescription(IPath path, ICResourceDescription base) throws CoreException, WriteAccessException;
@ -128,10 +121,9 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* creates a new folder description for the specified path * creates a new folder description for the specified path
* @param path project-relative folder workspace path * @param path project-relative folder workspace path
* @param base resource description from which settings will be coppied/inheritted * @param base resource description from which settings will be coppied/inheritted
* @return
* @throws CoreException * @throws CoreException
* @throws WriteAccessException when the configuration description is read-only * @throws WriteAccessException when the configuration description is read-only
* the description is read only if it was queried/returned by the {@link CoreModel#getProjectDescription(org.eclipse.core.resources.IProject, false)} call * see {@link CoreModel#getProjectDescription(org.eclipse.core.resources.IProject, boolean)}
*/ */
ICFolderDescription createFolderDescription(IPath path, ICFolderDescription base) throws CoreException, WriteAccessException; ICFolderDescription createFolderDescription(IPath path, ICFolderDescription base) throws CoreException, WriteAccessException;
@ -147,9 +139,7 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
/** /**
* This method should be used by the build system only for gettings * This method should be used by the build system only for gettings
* the build-system contributed CConfigurationData * the build-system contributed CConfigurationData
* @see org.eclipse.cdt.core.CConfigurationDataProvider extension point * @see CConfigurationDataProvider and the org.eclipse.cdt.core.CConfigurationDataProvider extension point
* @see CConfigurationDataProvider
* @return
*/ */
CConfigurationData getConfigurationData(); CConfigurationData getConfigurationData();
@ -159,8 +149,8 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* Active configuratiuon is the one that is built by default. * Active configuratiuon is the one that is built by default.
* This configuration is returned by the {@link ICProjectDescription#getActiveConfiguration()} call * This configuration is returned by the {@link ICProjectDescription#getActiveConfiguration()} call
* *
* @throws WriteAccessException when the configuration description is read-only * @throws WriteAccessException when the configuration description is read-only,
* the description is read only if it was queried/returned by the {@link CoreModel#getProjectDescription(org.eclipse.core.resources.IProject, false)} call * see {@link CoreModel#getProjectDescription(org.eclipse.core.resources.IProject, boolean)}
*/ */
void setActive() throws WriteAccessException; void setActive() throws WriteAccessException;
@ -168,33 +158,27 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* This method should be used by the build system only for updating * This method should be used by the build system only for updating
* the build-system contributed CConfigurationData * the build-system contributed CConfigurationData
* *
* @throws WriteAccessException when the configuration description is read-only * @throws WriteAccessException when the configuration description is read-only,
* the description is read only if it was queried/returned by the {@link CoreModel#getProjectDescription(org.eclipse.core.resources.IProject, false)} call * see {@link CoreModel#getProjectDescription(org.eclipse.core.resources.IProject, boolean)}
* *
* @see org.eclipse.cdt.core.CConfigurationDataProvider extension point * @see CConfigurationDataProvider and the extension point org.eclipse.cdt.core.CConfigurationDataProvider
* @see CConfigurationDataProvider
*/ */
void setConfigurationData(String buildSystemId, CConfigurationData data) throws WriteAccessException; void setConfigurationData(String buildSystemId, CConfigurationData data) throws WriteAccessException;
/** /**
* returns whether or not the configuration description was modified * returns whether or not the configuration description was modified
*
* @return
*/ */
boolean isModified(); boolean isModified();
/** /**
* returns the target platform settings for this configuration * returns the target platform settings for this configuration
* @see ICTargetPlatformSetting * @see ICTargetPlatformSetting
*
* @return
*/ */
ICTargetPlatformSetting getTargetPlatformSetting(); ICTargetPlatformSetting getTargetPlatformSetting();
/** /**
* returns the source entries for this configuration * returns the source entries for this configuration
* @see iCSourceEntry * @see ICSourceEntry
* @return
*/ */
ICSourceEntry[] getSourceEntries(); ICSourceEntry[] getSourceEntries();
@ -205,8 +189,8 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* *
* @param entries * @param entries
* *
* @throws WriteAccessException when the configuration description is read-only * @throws WriteAccessException when the configuration description is read-only,
* the description is read only if it was queried/returned by the {@link CoreModel#getProjectDescription(org.eclipse.core.resources.IProject, false)} call * see {@link CoreModel#getProjectDescription(org.eclipse.core.resources.IProject, boolean)}
*/ */
void setSourceEntries(ICSourceEntry[] entries) throws CoreException, WriteAccessException; void setSourceEntries(ICSourceEntry[] entries) throws CoreException, WriteAccessException;
@ -216,8 +200,6 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* the map contains the project_name<->configuration_id associations * the map contains the project_name<->configuration_id associations
* if the current configuration does not reference any other configurations, * if the current configuration does not reference any other configurations,
* empty map is returned * empty map is returned
*
* @return
*/ */
Map<String, String> getReferenceInfo(); Map<String, String> getReferenceInfo();
@ -229,7 +211,7 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* @param refs * @param refs
* *
* @throws WriteAccessException when the configuration description is read-only * @throws WriteAccessException when the configuration description is read-only
* the description is read only if it was queried/returned by the {@link CoreModel#getProjectDescription(org.eclipse.core.resources.IProject, false)} call * see {@link CoreModel#getProjectDescription(org.eclipse.core.resources.IProject, boolean)}
*/ */
void setReferenceInfo(Map<String, String> refs) throws WriteAccessException; void setReferenceInfo(Map<String, String> refs) throws WriteAccessException;
@ -240,7 +222,6 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* @see ICExternalSetting * @see ICExternalSetting
* @see #getReferenceInfo() * @see #getReferenceInfo()
* @see #setReferenceInfo(Map) * @see #setReferenceInfo(Map)
* @return
*/ */
ICExternalSetting[] getExternalSettings(); ICExternalSetting[] getExternalSettings();
@ -257,9 +238,8 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* @param contentTypeIds * @param contentTypeIds
* @param extensions * @param extensions
* @param entries * @param entries
* @return
* @throws WriteAccessException when the configuration description is read-only * @throws WriteAccessException when the configuration description is read-only
* the description is read only if it was queried/returned by the {@link CoreModel#getProjectDescription(org.eclipse.core.resources.IProject, false)} call * see {@link CoreModel#getProjectDescription(org.eclipse.core.resources.IProject, boolean)}
*/ */
ICExternalSetting createExternalSetting(String languageIDs[], ICExternalSetting createExternalSetting(String languageIDs[],
String contentTypeIds[], String contentTypeIds[],
@ -277,7 +257,7 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* *
* @param setting * @param setting
* @throws WriteAccessException when the configuration description is read-only * @throws WriteAccessException when the configuration description is read-only
* the description is read only if it was queried/returned by the {@link CoreModel#getProjectDescription(org.eclipse.core.resources.IProject, false)} call * see {@link CoreModel#getProjectDescription(org.eclipse.core.resources.IProject, boolean)}
*/ */
void removeExternalSetting(ICExternalSetting setting) throws WriteAccessException; void removeExternalSetting(ICExternalSetting setting) throws WriteAccessException;
@ -291,23 +271,19 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* @see #getExternalSettings() * @see #getExternalSettings()
* *
* @throws WriteAccessException when the configuration description is read-only * @throws WriteAccessException when the configuration description is read-only
* the description is read only if it was queried/returned by the {@link CoreModel#getProjectDescription(org.eclipse.core.resources.IProject, false)} call * see {@link CoreModel#getProjectDescription(org.eclipse.core.resources.IProject, boolean)}
*/ */
void removeExternalSettings() throws WriteAccessException; void removeExternalSettings() throws WriteAccessException;
/** /**
* returns the build setting for this configuration * returns the build setting for this configuration
*
* @return
*
* @see ICBuildSetting * @see ICBuildSetting
*/ */
ICBuildSetting getBuildSetting(); ICBuildSetting getBuildSetting();
/** /**
* returns the Cdt variable contributor that represent infomration on the * returns the CDT variable contributor that represent information on the
* CDT variables (Build Macros) contributed/usew with this contiguration * CDT variables (Build Macros) contributed/used with this configuration
* @return
* *
* @see ICdtVariablesContributor * @see ICdtVariablesContributor
*/ */
@ -317,10 +293,7 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* the get/setSettionsProperty methods allow to associate the session properties mechanism on the configuration level * the get/setSettionsProperty methods allow to associate the session properties mechanism on the configuration level
* session properties are not persisted and are not restored on the next eclipse session * session properties are not persisted and are not restored on the next eclipse session
* the scope of configuration session properties is the current configuration description, * the scope of configuration session properties is the current configuration description,
* i.e. modifications to the properties are not applied untill the setProjectDescription call * i.e. modifications to the properties are not applied until the setProjectDescription call
*
* @param name
* @return
*/ */
Object getSessionProperty(QualifiedName name); Object getSessionProperty(QualifiedName name);
@ -328,7 +301,7 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* the get/setSettionsProperty methods allow to associate the session properties mechanism on the configuration level * the get/setSettionsProperty methods allow to associate the session properties mechanism on the configuration level
* session properties are not persisted and are not restored on the next eclipse session * session properties are not persisted and are not restored on the next eclipse session
* the scope of configuration session properties is the current configuration description, * the scope of configuration session properties is the current configuration description,
* i.e. modifications to the properties are not applied untill the setProjectDescription call * i.e. modifications to the properties are not applied until the setProjectDescription call
* *
* @param name * @param name
* @param value * @param value
@ -340,7 +313,7 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* *
* @param name * @param name
* @throws WriteAccessException when the configuration description is read-only * @throws WriteAccessException when the configuration description is read-only
* the description is read only if it was queried/returned by the {@link CoreModel#getProjectDescription(org.eclipse.core.resources.IProject, false)} call * see {@link CoreModel#getProjectDescription(org.eclipse.core.resources.IProject, boolean)}
*/ */
void setName(String name) throws WriteAccessException; void setName(String name) throws WriteAccessException;
@ -384,7 +357,7 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* *
* @param ids the ids of externalSettinsProvider extensions * @param ids the ids of externalSettinsProvider extensions
* *
* @see ICProjectDescriptionManager#updateExternalSettingsProviders(String[]) * @see ICProjectDescriptionManager#updateExternalSettingsProviders(String[], org.eclipse.core.runtime.IProgressMonitor)
*/ */
void updateExternalSettingsProviders(String[] ids) throws WriteAccessException; void updateExternalSettingsProviders(String[] ids) throws WriteAccessException;

View file

@ -11,15 +11,12 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.core.model; package org.eclipse.cdt.internal.core.model;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator;
import java.util.Map; import java.util.Map;
import org.eclipse.cdt.core.model.CModelException; import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.ICElement; import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.ICElementDelta;
import org.eclipse.cdt.core.model.ICModelStatus; import org.eclipse.cdt.core.model.ICModelStatus;
import org.eclipse.cdt.core.model.ICModelStatusConstants; import org.eclipse.cdt.core.model.ICModelStatusConstants;
import org.eclipse.cdt.core.model.ICProject; import org.eclipse.cdt.core.model.ICProject;
@ -53,14 +50,14 @@ public class CopyResourceElementsOperation extends MultiOperation {
/** /**
* The list of new resources created during this operation. * The list of new resources created during this operation.
*/ */
protected ArrayList fCreatedElements; protected ArrayList<ICElement> fCreatedElements;
/** /**
* Table specifying deltas for elements being * Table specifying deltas for elements being
* copied/moved/renamed. Keyed by elements' project(s), and * copied/moved/renamed. Keyed by elements' project(s), and
* values are the corresponding deltas. * values are the corresponding deltas.
*/ */
protected Map fDeltasPerProject= new HashMap(1); protected Map<ICProject, CElementDelta> fDeltasPerProject= new HashMap<ICProject, CElementDelta>(1);
public CopyResourceElementsOperation(ICElement[] src, ICElement[] dst, boolean force) { public CopyResourceElementsOperation(ICElement[] src, ICElement[] dst, boolean force) {
super(src, dst, force); super(src, dst, force);
@ -72,7 +69,7 @@ public class CopyResourceElementsOperation extends MultiOperation {
* it does not exist yet. * it does not exist yet.
*/ */
private CElementDelta getDeltaFor(ICProject cProject) { private CElementDelta getDeltaFor(ICProject cProject) {
CElementDelta delta = (CElementDelta) fDeltasPerProject.get(cProject); CElementDelta delta = fDeltasPerProject.get(cProject);
if (delta == null) { if (delta == null) {
delta = new CElementDelta(cProject); delta = new CElementDelta(cProject);
fDeltasPerProject.put(cProject, delta); fDeltasPerProject.put(cProject, delta);
@ -114,8 +111,8 @@ public class CopyResourceElementsOperation extends MultiOperation {
* Process all of the changed deltas generated by this operation. * Process all of the changed deltas generated by this operation.
*/ */
protected void processDeltas() { protected void processDeltas() {
for (Iterator deltas = this.fDeltasPerProject.values().iterator(); deltas.hasNext();){ for (CElementDelta elementDelta : this.fDeltasPerProject.values()) {
addDelta((ICElementDelta) deltas.next()); addDelta(elementDelta);
} }
} }
@ -125,7 +122,7 @@ public class CopyResourceElementsOperation extends MultiOperation {
* The package statement in the compilation unit is updated if necessary. * The package statement in the compilation unit is updated if necessary.
* The main type of the compilation unit is renamed if necessary. * The main type of the compilation unit is renamed if necessary.
* *
* @exception JavaModelException if the operation is unable to * @exception CModelException if the operation is unable to
* complete * complete
*/ */
private void processResource(ICElement source, ICElement dest) throws CModelException { private void processResource(ICElement source, ICElement dest) throws CModelException {
@ -208,7 +205,7 @@ public class CopyResourceElementsOperation extends MultiOperation {
*/ */
@Override @Override
protected void processElements() throws CModelException { protected void processElements() throws CModelException {
fCreatedElements = new ArrayList(fElementsToProcess.length); fCreatedElements = new ArrayList<ICElement>(fElementsToProcess.length);
try { try {
super.processElements(); super.processElements();
} catch (CModelException cme) { } catch (CModelException cme) {
@ -247,15 +244,15 @@ public class CopyResourceElementsOperation extends MultiOperation {
@Override @Override
protected void verify(ICElement element) throws CModelException { protected void verify(ICElement element) throws CModelException {
if (element == null || !element.exists()) if (element == null || !element.exists())
error(ICModelStatusConstants.ELEMENT_DOES_NOT_EXIST, element); error(ICModelStatusConstants.ELEMENT_DOES_NOT_EXIST, element);
else if (element.isReadOnly() && (isRename() || isMove()))
if (element.isReadOnly() && (isRename() || isMove()))
error(ICModelStatusConstants.READ_ONLY, element); error(ICModelStatusConstants.READ_ONLY, element);
else {
CElement dest = (CElement) getDestinationParent(element); CElement dest = (CElement) getDestinationParent(element);
verifyDestination(element, dest); verifyDestination(element, dest);
if (fRenamings != null) { if (fRenamings != null) {
verifyRenaming(element); verifyRenaming(element);
}
} }
} }
} }

View file

@ -14,11 +14,11 @@ package org.eclipse.cdt.internal.core.model;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.ICElement; import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.ICElementDelta; import org.eclipse.cdt.core.model.ICElementDelta;
import org.eclipse.cdt.core.model.ICModelStatus; import org.eclipse.cdt.core.model.ICModelStatus;
import org.eclipse.cdt.core.model.ICModelStatusConstants; import org.eclipse.cdt.core.model.ICModelStatusConstants;
import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.ITranslationUnit; import org.eclipse.cdt.core.model.ITranslationUnit;
import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResource;
@ -44,35 +44,35 @@ public abstract class MultiOperation extends CModelOperation {
* Keyed by elements being processed, and * Keyed by elements being processed, and
* values are the corresponding destination parent. * values are the corresponding destination parent.
*/ */
protected Map fParentElements; protected Map<ICElement, ICElement> fParentElements;
/** /**
* Table specifying insertion positions for elements being * Table specifying insertion positions for elements being
* copied/moved/renamed. Keyed by elements being processed, and * copied/moved/renamed. Keyed by elements being processed, and
* values are the corresponding insertion point. * values are the corresponding insertion point.
* @see processElements(IProgressMonitor) * @see #processElements()
*/ */
protected Map fInsertBeforeElements= new HashMap(1); protected Map<ICElement, ICElement> fInsertBeforeElements= new HashMap<ICElement, ICElement>(1);
/** /**
* This table presents the data in <code>fRenamingList</code> in a more * This table presents the data in <code>fRenamingList</code> in a more
* convenient way. * convenient way.
*/ */
protected Map fRenamings; protected Map<ICElement, String> fRenamings;
/** /**
* Creates a new <code>MultiOperation</code>. * Creates a new <code>MultiOperation</code>.
*/ */
protected MultiOperation(ICElement[] elementsToProcess, ICElement[] parentElements, boolean force) { protected MultiOperation(ICElement[] elementsToProcess, ICElement[] parentElements, boolean force) {
super(elementsToProcess, parentElements, force); super(elementsToProcess, parentElements, force);
fParentElements = new HashMap(elementsToProcess.length); fParentElements = new HashMap<ICElement, ICElement>(elementsToProcess.length);
if (elementsToProcess.length == parentElements.length) { if (elementsToProcess.length == parentElements.length) {
for (int i = 0; i < elementsToProcess.length; i++) { for (int i = 0; i < elementsToProcess.length; i++) {
fParentElements.put(elementsToProcess[i], parentElements[i]); fParentElements.put(elementsToProcess[i], parentElements[i]);
} }
} else { //same destination for all elements to be moved/copied/renamed } else { //same destination for all elements to be moved/copied/renamed
for (int i = 0; i < elementsToProcess.length; i++) { for (ICElement elementsToProces : elementsToProcess) {
fParentElements.put(elementsToProcess[i], parentElements[0]); fParentElements.put(elementsToProces, parentElements[0]);
} }
} }
} }
@ -114,7 +114,7 @@ public abstract class MultiOperation extends CModelOperation {
* Returns the parent of the element being copied/moved/renamed. * Returns the parent of the element being copied/moved/renamed.
*/ */
protected ICElement getDestinationParent(ICElement child) { protected ICElement getDestinationParent(ICElement child) {
return (ICElement)fParentElements.get(child); return fParentElements.get(child);
} }
/** /**
@ -128,7 +128,7 @@ public abstract class MultiOperation extends CModelOperation {
*/ */
protected String getNewNameFor(ICElement element) { protected String getNewNameFor(ICElement element) {
if (fRenamings != null) { if (fRenamings != null) {
return (String) fRenamings.get(element); return fRenamings.get(element);
} }
return null; return null;
} }
@ -139,7 +139,7 @@ public abstract class MultiOperation extends CModelOperation {
*/ */
private void initializeRenamings() { private void initializeRenamings() {
if (fRenamingsList != null && fRenamingsList.length == fElementsToProcess.length) { if (fRenamingsList != null && fRenamingsList.length == fElementsToProcess.length) {
fRenamings = new HashMap(fRenamingsList.length); fRenamings = new HashMap<ICElement, String>(fRenamingsList.length);
for (int i = 0; i < fRenamingsList.length; i++) { for (int i = 0; i < fRenamingsList.length; i++) {
if (fRenamingsList[i] != null) { if (fRenamingsList[i] != null) {
fRenamings.put(fElementsToProcess[i], fRenamingsList[i]); fRenamings.put(fElementsToProcess[i], fRenamingsList[i]);
@ -172,11 +172,10 @@ public abstract class MultiOperation extends CModelOperation {
if (fDeltas != null) { if (fDeltas != null) {
CElementDelta rootDelta = newCElementDelta(); CElementDelta rootDelta = newCElementDelta();
boolean insertedTree = false; boolean insertedTree = false;
for (int i = 0; i < fDeltas.length; i++) { for (ICElementDelta delta : fDeltas) {
ICElementDelta delta = fDeltas[i];
ICElementDelta[] children = delta.getAffectedChildren(); ICElementDelta[] children = delta.getAffectedChildren();
for (int j = 0; j < children.length; j++) { for (ICElementDelta element : children) {
CElementDelta projectDelta = (CElementDelta) children[j]; CElementDelta projectDelta = (CElementDelta) element;
rootDelta.insertDeltaTree(projectDelta.getElement(), projectDelta); rootDelta.insertDeltaTree(projectDelta.getElement(), projectDelta);
insertedTree = true; insertedTree = true;
} }
@ -204,10 +203,10 @@ public abstract class MultiOperation extends CModelOperation {
beginTask(getMainTaskName(), fElementsToProcess.length); beginTask(getMainTaskName(), fElementsToProcess.length);
ICModelStatus[] errors = new ICModelStatus[3]; ICModelStatus[] errors = new ICModelStatus[3];
int errorsCounter = 0; int errorsCounter = 0;
for (int i = 0; i < fElementsToProcess.length; i++) { for (ICElement elementsToProces : fElementsToProcess) {
try { try {
verify(fElementsToProcess[i]); verify(elementsToProces);
processElement(fElementsToProcess[i]); processElement(elementsToProces);
} catch (CModelException jme) { } catch (CModelException jme) {
if (errorsCounter == errors.length) { if (errorsCounter == errors.length) {
// resize // resize
@ -273,7 +272,7 @@ public abstract class MultiOperation extends CModelOperation {
if (destination == null || !destination.exists()) { if (destination == null || !destination.exists()) {
error(ICModelStatusConstants.ELEMENT_DOES_NOT_EXIST, destination); error(ICModelStatusConstants.ELEMENT_DOES_NOT_EXIST, destination);
} }
if (element.getElementType() == ICElement.C_UNIT) { else if (element.getElementType() == ICElement.C_UNIT) {
IResource res = destination.getResource(); IResource res = destination.getResource();
if (!(res instanceof IContainer)) { if (!(res instanceof IContainer)) {
error(ICModelStatusConstants.INVALID_DESTINATION, element); error(ICModelStatusConstants.INVALID_DESTINATION, element);
@ -307,7 +306,7 @@ public abstract class MultiOperation extends CModelOperation {
* its parent is the destination container of this <code>element</code>. * its parent is the destination container of this <code>element</code>.
*/ */
protected void verifySibling(ICElement element, ICElement destination) throws CModelException { protected void verifySibling(ICElement element, ICElement destination) throws CModelException {
ICElement insertBeforeElement = (ICElement) fInsertBeforeElements.get(element); ICElement insertBeforeElement = fInsertBeforeElements.get(element);
if (insertBeforeElement != null) { if (insertBeforeElement != null) {
if (!insertBeforeElement.exists() || !insertBeforeElement.getParent().equals(destination)) { if (!insertBeforeElement.exists() || !insertBeforeElement.getParent().equals(destination)) {
error(ICModelStatusConstants.INVALID_SIBLING, insertBeforeElement); error(ICModelStatusConstants.INVALID_SIBLING, insertBeforeElement);