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;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.cdt.internal.core.model.CModelStatus;
import org.eclipse.core.runtime.CoreException;
/**
* 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
* <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
* <code>ICModelStatusConstants</code>
* @return the new C model exception
* @see ICModelStatusConstants
* @see org.eclipse.core.runtime.IStatus#ERROR
*/
@ -51,7 +49,6 @@ public class CModelException extends CoreException {
* <code>CModelException(exception,ICModelStatusConstants.CORE_EXCEPTION</code>.
*
* @param exception the <code>CoreException</code>
* @return the new C model exception
*/
public CModelException(CoreException 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.
*
* @param status the C-specific status object
* @return the new C model exception
*/
public CModelException(ICModelStatus 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>
* <li>CONTENT_TYPE_CHEADER
* <li>CONTENT_TYPE_CXXHEADER
@ -363,7 +363,6 @@ public class CoreModel {
* <li>CONTENT_TYPE_ASMSOURCE
* </ul>
* or null is return if no id match the list
* @param file
* @return the know id or null
*/
public static String getRegistedContentTypeId(IProject project, String name) {
@ -460,8 +459,7 @@ public class CoreModel {
* is equivalent to <code>newContainerEntry(path,false)</code>.
* <p>
*
* @param containerPath
* the id of the container
* @param id the id of the container
* @return a new container entry
*
*/
@ -649,14 +647,14 @@ public class CoreModel {
/**
* Creates and returns a new entry of kind <code>CDT_INCLUDE</code>
*
* @param resoourcePath
* @param resourcePath
* the affected project-relative resource path
* @param basePath
* the base path of the includePath
* @param includePath
* the absolute path of the include
* @param isSystemInclude
* wheter this include path should be consider the system
* whether this include path should be consider the system
* include path
* @param exclusionPatterns
* 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>
*
* @param resourcePath
* @param includeFile
* @return
*/
public static IIncludeFileEntry newIncludeFileEntry(IPath resourcePath, IPath includeFile) {
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>
*
* @param path
* @param resourcePath
* the affected project-relative resource path
* @param macroName
* the name of the macro
@ -761,7 +755,6 @@ public class CoreModel {
* the value of the macro
* @param exclusionPatterns
* exclusion patterns in the resource if a container
* @return
*/
public static IMacroEntry newMacroEntry(IPath resourcePath, String macroName, String macroValue, IPath[] exclusionPatterns) {
return newMacroEntry(resourcePath, macroName, macroValue, exclusionPatterns, false);
@ -778,7 +771,6 @@ public class CoreModel {
* the value of the macro
* @param exclusionPatterns
* exclusion patterns in the resource if a container
* @return
*/
public static IMacroEntry newMacroEntry(IPath resourcePath, String macroName, String macroValue, IPath[] exclusionPatterns, boolean isExported) {
return new MacroEntry(resourcePath, null, macroName, macroValue, exclusionPatterns, isExported);
@ -793,7 +785,6 @@ public class CoreModel {
* the base reference path
* @param macroName
* the name of the macro
* @return IMacroEntry
*/
public static IMacroEntry newMacroRefEntry(IPath resourcePath, IPath baseRef, String macroName) {
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>
*
* @param resourcePath
* @param macroFile
* @return
*/
public static IMacroFileEntry newMacroFileEntry(IPath resourcePath, IPath macroFile) {
return newMacroFileEntry(resourcePath, null, null, macroFile, null, false);
@ -821,7 +808,6 @@ public class CoreModel {
* the file path where the macros are define
* @param exclusionPatterns
* 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) {
return new MacroFileEntry(resourcePath, basePath, baseRef, macroFilePath, exclusionPatterns, isExported);
@ -862,8 +848,7 @@ public class CoreModel {
*
* @see PathEntryContainerInitializer
* @see IPathEntryContainer
* @see #setPathEntryContainer(IPath, ICProject[], IPathEntryContainer,
* IProgressMonitor)
* @see #setPathEntryContainer(ICProject[], IPathEntryContainer, IProgressMonitor)
*/
public static IPathEntryContainer getPathEntryContainer(IPath containerPath, ICProject project) throws CModelException {
return pathEntryManager.getPathEntryContainer(containerPath, project);
@ -892,13 +877,13 @@ public class CoreModel {
*
* @param affectedProjects -
* the set of projects for which this container is being bound
* @param newContainer -
* @param container -
* the container for the affected projects
* @param monitor
* a monitor to report progress
* @throws CModelException
* @see PathEntryContainerInitializer
* @see #getPathEntryContainer(IPath, IJavaProject)
* @see #getPathEntryContainer(IPath, ICProject)
* @see IPathEntryContainer
*/
public static void setPathEntryContainer(ICProject[] affectedProjects, IPathEntryContainer container, IProgressMonitor monitor)
@ -928,7 +913,7 @@ public class CoreModel {
* specifies an empty pathentry.
* <p>
*
* @param entries
* @param newEntries
* a list of entries
* @param monitor
* the given progress monitor
@ -1066,9 +1051,6 @@ public class CoreModel {
/**
* Return the IPathEntryStore of the project.
*
* @param project
* @return
* @throws CoreException
*/
public static IPathEntryStore getPathEntryStore(IProject project) throws CoreException {
@ -1110,7 +1092,6 @@ public class CoreModel {
* and during getResolvedPathEntries.
* <p>
* @param cProject the given C project
* @param PathEntry entries
* @return a status object with code <code>IStatus.OK</code> if
* the entries location are compatible, otherwise a status
* object indicating what is wrong with them
@ -1308,8 +1289,7 @@ public class CoreModel {
if (cProject != null) {
try {
IPathEntry[] resolvedPE = CoreModel.getRawPathEntries(cProject);
for (int i = 0; i < resolvedPE.length; i++) {
IPathEntry pe = resolvedPE[i];
for (IPathEntry pe : resolvedPE) {
// first check all containers
if (pe.getEntryKind() == IPathEntry.CDT_CONTAINER) {
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)
*/
@ -1398,7 +1378,7 @@ public class CoreModel {
* @param des
* @throws CoreException
*
* @see {@link #getProjectDescription(IProject, boolean)}
* @see #getProjectDescription(IProject, boolean)
* @see #createProjectDescription(IProject, boolean)
*/
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
* @param project
* @return
* answers whether the given project is a new-style project, i.e. CConfigurationDataProvider-driven
*/
public boolean isNewStyleProject(IProject project){
return descriptionManager.isNewStyleProject(project);
}
/**
* aswers whether the given project is a new-style project, i.e. CConfigurationDataProvider-driven
* @param des
* @return
* answers whether the given project is a new-style project, i.e. CConfigurationDataProvider-driven
*/
public boolean isNewStyleProject(ICProjectDescription des){
return descriptionManager.isNewStyleProject(des);

View file

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

View file

@ -12,6 +12,8 @@ package org.eclipse.cdt.core.model;
*******************************************************************************/
import java.util.EventObject;
import org.eclipse.cdt.internal.core.model.CShiftData;
/**
* 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

View file

@ -16,10 +16,6 @@ package org.eclipse.cdt.core.model;
* while inspecting the project.
*/
public interface IArchiveContainer extends ICElement, IParent, IOpenable {
/**
*
* @return
* @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 {
/**
*
* @return
* @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 {
/**
*
* @return
* @throws CModelException
*/
IBinaryElement[] getBinaryElements() throws CModelException;
}

View file

@ -27,7 +27,7 @@ public interface ICContainer extends ICElement, IParent, IOpenable {
* </p>
*
* @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
*/
Object[] getNonCResources() throws CModelException;
@ -56,7 +56,6 @@ public interface ICContainer extends ICElement, IParent, IOpenable {
/**
* Returns the all the binaries of this container.
*
* @return
* @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
* valid binary
* This is a handle-only operation. The celement
* may or may not exist.
*
* @return
* @throws CModelException
* This is a handle-only operation. The container may or may not exist.
*/
IBinary getBinary(String name);
/**
* Returns all the archive of this container
*
* @return
* @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.
*
* @param file
* @return
* @throws CModelException
*/
IArchive getArchive(String name);
/**
* Return al the child containers of this container.
*
* @return
* @throws CModelException
*/
ICContainer[] getCContainers() throws CModelException;

View file

@ -376,8 +376,6 @@ public interface ICElement extends IAdaptable {
* in a resource.
*
* @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();
@ -387,8 +385,6 @@ public interface ICElement extends IAdaptable {
* a corresponding resource.
*
* @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();
/**

View file

@ -20,9 +20,6 @@ public interface ICElementVisitor {
/**
* Visited a member if the ICElement tree. Returns whether to visit the children
* of this element.
*
* @param element
* @return
*/
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.
* </p>
*
* @see CCore#create(org.eclipse.core.resources.IWorkspaceRoot)
* @see CoreModel#create(org.eclipse.core.resources.IWorkspaceRoot)
*/
public interface ICModel extends ICElement, IParent, IOpenable {
/**

View file

@ -59,8 +59,6 @@ public interface ICModelStatusConstants {
* Status constant indicating that one or more elements
* supplied do not exist.
* 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;
@ -198,21 +196,21 @@ public interface ICModelStatusConstants {
/**
* Status indicating that a C element could not be created because
* the underlying resource is invalid.
* @see CCore
* @see CoreModel
*/
public static final int INVALID_RESOURCE = 995;
/**
* Status indicating that a C element could not be created because
* the underlying resource is not of an appropriate type.
* @see CCore
* @see CoreModel
*/
public static final int INVALID_RESOURCE_TYPE = 996;
/**
* Status indicating that a C element could not be created because
* the project owning underlying resource does not have the C nature.
* @see CCore
* @see CoreModel
*/
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
* elements such as , ICContainer, ITranslationUnit ....
* <code>CCore.create(project)</code>.
* <code>CoreModel.create(project)</code>.
* </p>
*
* @see CCore#create(org.eclipse.core.resources.IProject)
* @see IBuildEntry
* @see CoreModel#create(org.eclipse.core.resources.IProject)
*/
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
* @throws CModelException
*/
IArchiveContainer getArchiveContainer() throws CModelException;
/**
* Return the BinaryContainer of this Project.
* @return
* @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
* 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
* 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
*/
ISourceRoot[] getAllSourceRoots() throws CModelException;
@ -90,26 +87,22 @@ public interface ICProject extends IParent, IOpenable, ICElement {
/**
* Return the output entries.
*
* @return
* @throws CModelException
*/
public IOutputEntry[] getOutputEntries() throws CModelException;
/**
* @param resource
* @return
*/
boolean isOnOutputEntry(IResource resource);
/**
* @param resource
* @return
*/
boolean isOnSourceRoot(IResource resource);
/**
* @param element
* @return
*/
boolean isOnSourceRoot(ICElement element);
@ -123,7 +116,6 @@ public interface ICProject extends IParent, IOpenable, ICElement {
/**
* Return the include paths set on the project.
*
* @return
* @throws CModelException
*/
IIncludeReference[] getIncludeReferences() throws CModelException;
@ -245,7 +237,7 @@ public interface ICProject extends IParent, IOpenable, ICElement {
* </p>
*
* @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
*/
Object[] getNonCResources() throws CModelException;

View file

@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.cdt.core.model;
import org.eclipse.core.runtime.IAdaptable;
/**
* 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>,
* 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();
@ -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>
* 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);

View file

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

View file

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

View file

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

View file

@ -79,14 +79,6 @@ public interface ILanguage extends IAdaptable {
/**
* Return the AST completion node for the given offset.
*
* @param reader
* @param scanInfo
* @param fileCreator
* @param index
* @param log
* @param offset
* @return
* @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
* event's type is TYPE_FILE, or null otherwise.
* @see getProject()
* @see #getProject()
*
* @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(),
* as it is possible that this file may not live inside the workspace.
*
* @see getProject()
* @see #getProject()
*
* @since 4.0
*/
@ -80,9 +80,9 @@ public interface ILanguageMappingChangeEvent {
/**
* Returns the type of even being reported.
* @return the type of even being reported
* @see TYPE_WORKSPACE
* @see TYPE_PROJECT
* @see TYPE_FILE
* @see #TYPE_WORKSPACE
* @see #TYPE_PROJECT
* @see #TYPE_FILE
*
* @since 4.0
*/

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -30,14 +30,11 @@ public interface IParent {
/**
* 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.
* This is a convenience method, and may be more efficient than
* 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();

View file

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

View file

@ -26,10 +26,7 @@ package org.eclipse.cdt.core.model;
* </p>
* <p>
* This interface is not intended to be implemented by clients.
* Instances can be created via the <code>CoreModel.newRegion</code>.
* </p>
*
* @see CoreModel#newRegion()
*/
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>
* if this member is not declared in a translation unit (for example, a binary type).
* @return
* @throws CModelException
*/
ITranslationUnit getTranslationUnit();
}

View file

@ -19,22 +19,10 @@ import org.eclipse.core.runtime.IPath;
*/
public interface ISourceRoot extends ICContainer {
/**
* @param resource
* @return
*/
boolean isOnSourceEntry(IResource resource);
/**
* @param path
* @return
*/
boolean isOnSourceEntry(IPath path);
/**
* @param element
* @return
*/
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().
*
* @param type the type to set
* @see ILanguageMappingChangeEvent.TYPE_WORKSPACE
* @see ILanguageMappingChangeEvent.TYPE_PROJECT
* @see ILanguageMappingChangeEvent.TYPE_FILE
* @see ILanguageMappingChangeEvent#TYPE_WORKSPACE
* @see ILanguageMappingChangeEvent#TYPE_PROJECT
* @see ILanguageMappingChangeEvent#TYPE_FILE
*/
public void setType(int type) {
fType = type;

View file

@ -63,7 +63,6 @@ public class PathEntryContainerChanged {
/**
* Type of change.
* @return
*/
public int getType() {
return fType;
@ -71,15 +70,13 @@ public class PathEntryContainerChanged {
/**
* whether or not the change affected the include paths
* @return
*/
public boolean isIncludeChange() {
return (fType & INCLUDE_CHANGED) != 0;
}
/**
* Whether or not the chage affected the macro entries
* @return
* Whether or not the change affected the macro entries
*/
public boolean isMacroChange() {
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 containerSuggestion a suggestion to update the corresponding container definition
* @throws CoreException when <code>CoreModel#setPathEntryContainer</code> would throw any.
* @see CoreModel#setPathEntryContainer(IPath, ICProject[], IPathEntryContainer[], org.eclipse.core.runtime.IProgressMonitor)
* @see PathContainerInitializer#canUpdatePathContainer(IPath, ICProject)
* @see CoreModel#setPathEntryContainer(ICProject[], IPathEntryContainer, org.eclipse.core.runtime.IProgressMonitor)
* @see #canUpdatePathEntryContainer(IPath, ICProject)
*/
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 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.CConfigurationDataProvider;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.QualifiedName;
@ -35,8 +37,6 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
/**
* returns the human-readable configuration description
*
* @return
*/
String getDescription();
@ -45,13 +45,12 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
*
* @param des
* @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;
/**
* returns the project description this configuration belongsa to
* @return
* returns the project description this configuration belongs to
*/
ICProjectDescription getProjectDescription();
@ -59,7 +58,6 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* returns the "root" folder description
* The root folder description is the default one used for the project root folder
* The root folder description can not be null
* @return
*/
ICFolderDescription getRootFolderDescription();
@ -67,7 +65,6 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* returns the complete set of folder descriptions defined for this configuration
* The folder description is the settings holder for the specified folder
* @see ICFolderDescription
* @return
*/
ICFolderDescription[] getFolderDescriptions();
@ -75,7 +72,6 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* returns the complete set of file descriptions defined for this configuration
* The file description is the settings holder for the specified file
* @see ICFileDescription
* @return
*/
ICFileDescription[] getFileDescriptions();
@ -85,7 +81,6 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* @see ICResourceDescription
* @see ICFileDescription
* @see ICFolderDescription
* @return
*/
ICResourceDescription[] getResourceDescriptions();
@ -108,8 +103,7 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* @param des
* @throws CoreException
* @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;
@ -117,10 +111,9 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* creates a new file description for the specified path
* @param path project-relative file workspace path
* @param base resource description from which settings will be coppied/inheritted
* @return
* @throws CoreException
* @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;
@ -128,10 +121,9 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* creates a new folder description for the specified path
* @param path project-relative folder workspace path
* @param base resource description from which settings will be coppied/inheritted
* @return
* @throws CoreException
* @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;
@ -147,9 +139,7 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
/**
* This method should be used by the build system only for gettings
* the build-system contributed CConfigurationData
* @see org.eclipse.cdt.core.CConfigurationDataProvider extension point
* @see CConfigurationDataProvider
* @return
* @see CConfigurationDataProvider and the org.eclipse.cdt.core.CConfigurationDataProvider extension point
*/
CConfigurationData getConfigurationData();
@ -159,8 +149,8 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* Active configuratiuon is the one that is built by default.
* This configuration is returned by the {@link ICProjectDescription#getActiveConfiguration()} call
*
* @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
* @throws WriteAccessException when the configuration description is read-only,
* see {@link CoreModel#getProjectDescription(org.eclipse.core.resources.IProject, boolean)}
*/
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
* the build-system contributed CConfigurationData
*
* @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
* @throws WriteAccessException when the configuration description is read-only,
* see {@link CoreModel#getProjectDescription(org.eclipse.core.resources.IProject, boolean)}
*
* @see org.eclipse.cdt.core.CConfigurationDataProvider extension point
* @see CConfigurationDataProvider
* @see CConfigurationDataProvider and the extension point org.eclipse.cdt.core.CConfigurationDataProvider
*/
void setConfigurationData(String buildSystemId, CConfigurationData data) throws WriteAccessException;
/**
* returns whether or not the configuration description was modified
*
* @return
*/
boolean isModified();
/**
* returns the target platform settings for this configuration
* @see ICTargetPlatformSetting
*
* @return
*/
ICTargetPlatformSetting getTargetPlatformSetting();
/**
* returns the source entries for this configuration
* @see iCSourceEntry
* @return
* @see ICSourceEntry
*/
ICSourceEntry[] getSourceEntries();
@ -205,8 +189,8 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
*
* @param entries
*
* @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
* @throws WriteAccessException when the configuration description is read-only,
* see {@link CoreModel#getProjectDescription(org.eclipse.core.resources.IProject, boolean)}
*/
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
* if the current configuration does not reference any other configurations,
* empty map is returned
*
* @return
*/
Map<String, String> getReferenceInfo();
@ -229,7 +211,7 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* @param refs
*
* @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;
@ -240,7 +222,6 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* @see ICExternalSetting
* @see #getReferenceInfo()
* @see #setReferenceInfo(Map)
* @return
*/
ICExternalSetting[] getExternalSettings();
@ -257,9 +238,8 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* @param contentTypeIds
* @param extensions
* @param entries
* @return
* @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[],
String contentTypeIds[],
@ -277,7 +257,7 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
*
* @param setting
* @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;
@ -291,23 +271,19 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
* @see #getExternalSettings()
*
* @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;
/**
* returns the build setting for this configuration
*
* @return
*
* @see ICBuildSetting
*/
ICBuildSetting getBuildSetting();
/**
* returns the Cdt variable contributor that represent infomration on the
* CDT variables (Build Macros) contributed/usew with this contiguration
* @return
* returns the CDT variable contributor that represent information on the
* CDT variables (Build Macros) contributed/used with this configuration
*
* @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
* 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,
* i.e. modifications to the properties are not applied untill the setProjectDescription call
*
* @param name
* @return
* i.e. modifications to the properties are not applied until the setProjectDescription call
*/
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
* 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,
* 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 value
@ -340,7 +313,7 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
*
* @param name
* @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;
@ -384,7 +357,7 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
*
* @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;

View file

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

View file

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