diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMethodDeclaration.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMethodDeclaration.java
index c29a448491a..cb927bb4d2a 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMethodDeclaration.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IMethodDeclaration.java
@@ -13,7 +13,7 @@ package org.eclipse.cdt.core.model;
/**
* Represents the declaration method of a class
- *
+ *
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
@@ -46,7 +46,7 @@ public interface IMethodDeclaration extends IMember, IFunctionDeclaration {
/**
* Returns whether this method is declared pure virtual.
*
- *
For example, a source method declared as virtual void m() = 0;
.
+ *
For example, a source method declared as virtual void m() = 0;
.
*
* @exception CModelException if this element does not exist or if an
* exception occurs while accessing its corresponding resource.
@@ -57,14 +57,15 @@ public interface IMethodDeclaration extends IMember, IFunctionDeclaration {
* Returns if this method is static or not
* @return boolean
*/
+ @Override
public boolean isStatic() throws CModelException;
-
+
/**
* Returns if this method is inline or not
* @return boolean
*/
public boolean isInline() throws CModelException;
-
+
/**
* Returns whether this method is declared virtual.
*
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IUsing.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IUsing.java
index 03282893ae0..06b1bffffdb 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IUsing.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/IUsing.java
@@ -12,7 +12,7 @@ package org.eclipse.cdt.core.model;
/**
* Represents a "using" declaration in C translation unit.
- *
+ *
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
@@ -21,6 +21,7 @@ public interface IUsing extends ICElement, ISourceManipulation, ISourceReference
* Returns the name of the package the statement refers to.
* This is a handle-only method.
*/
+ @Override
String getElementName();
boolean isDirective();
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/LanguageManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/LanguageManager.java
index fad740bbfd5..4b8fe51bb81 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/LanguageManager.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/LanguageManager.java
@@ -59,7 +59,7 @@ public class LanguageManager {
private static final String ELEMENT_PDOM_LINKAGE_FACTORY = "pdomLinkageFactory"; //$NON-NLS-1$
private static final String ATTRIBUTE_CLASS = "class"; //$NON-NLS-1$
private static final String ATTRIBUTE_ID = "id"; //$NON-NLS-1$
-
+
private static LanguageManager instance;
private Map fLanguageCache = new HashMap();
private Map fPDOMLinkageFactoryCache= new HashMap();
@@ -81,19 +81,19 @@ public class LanguageManager {
Map map = getDescriptorCache();
return map.get(id);
}
-
+
private HashMap getDescriptorCache() {
if (fIdToLanguageDescriptorCache == null) {
fIdToLanguageDescriptorCache = createDescriptorCache();
}
return fIdToLanguageDescriptorCache;
}
-
+
public ILanguageDescriptor[] getLanguageDescriptors() {
HashMap map = getDescriptorCache();
return map.values().toArray(new ILanguageDescriptor[map.size()]);
}
-
+
private HashMap createDescriptorCache() {
HashMap map = new HashMap();
IConfigurationElement[] configs= Platform.getExtensionRegistry().getConfigurationElementsFor(LANGUAGE_EXTENSION_POINT_ID);
@@ -106,18 +106,18 @@ public class LanguageManager {
}
return map;
}
-
+
private HashMap> getContentTypeToDescriptorCache() {
if (fContentTypeToDescriptorListCache == null) {
fContentTypeToDescriptorListCache = createContentTypeToDescriptorCache();
}
return fContentTypeToDescriptorListCache;
}
-
+
public Map getContentTypeIdToLanguageDescriptionsMap() {
HashMap map = new HashMap();
Map> cache = getContentTypeToDescriptorCache();
-
+
for (Entry> entry : cache.entrySet()) {
List list = entry.getValue();
if (list.size() > 0) {
@@ -125,11 +125,11 @@ public class LanguageManager {
map.put(entry.getKey(), dess);
}
}
-
+
return map;
}
-
+
private HashMap> createContentTypeToDescriptorCache() {
HashMap> map = new HashMap>();
Map dc = getDescriptorCache();
@@ -150,7 +150,7 @@ public class LanguageManager {
}
return map;
}
-
+
public ILanguage getLanguage(String id) {
ILanguage language = fLanguageCache.get(id);
if (language != null)
@@ -160,14 +160,16 @@ public class LanguageManager {
for (int j = 0; j < configs.length; ++j) {
final IConfigurationElement languageElem = configs[j];
if (ELEMENT_LANGUAGE.equals(languageElem.getName())) {
- String langId = getLanguageID(languageElem);
+ String langId = getLanguageID(languageElem);
if (langId.equals(id)) {
final ILanguage[] result= new ILanguage[]{null};
SafeRunner.run(new ISafeRunnable() {
+ @Override
public void handleException(Throwable exception) {
CCorePlugin.log(exception);
}
+ @Override
public void run() throws Exception {
result[0]= (ILanguage)languageElem.createExecutableExtension(ATTRIBUTE_CLASS);
}
@@ -185,15 +187,15 @@ public class LanguageManager {
private String getLanguageID(final IConfigurationElement languageElem) {
return languageElem.getNamespaceIdentifier() + NAMESPACE_SEPARATOR + languageElem.getAttribute(ATTRIBUTE_ID);
}
-
+
public ILanguage getLanguage(IContentType contentType) {
String contentTypeID= contentType.getId();
return getLanguageForContentTypeID(contentTypeID);
}
-
+
public ILanguage getLanguageForContentTypeID(String contentTypeID) {
cacheAllLanguages();
-
+
ILanguage language = fContentTypeToLanguageCache.get(contentTypeID);
if (language != null || fContentTypeToLanguageCache.containsKey(contentTypeID))
return language;
@@ -202,7 +204,7 @@ public class LanguageManager {
for (int j = 0; j < configs.length; ++j) {
final IConfigurationElement languageElem = configs[j];
if (ELEMENT_LANGUAGE.equals(languageElem.getName())) {
- IConfigurationElement[] assocContentTypes = languageElem.getChildren(ELEMENT_CONTENT_TYPE);
+ IConfigurationElement[] assocContentTypes = languageElem.getChildren(ELEMENT_CONTENT_TYPE);
for (int k = 0; k < assocContentTypes.length; ++k) {
if (contentTypeID.equals(assocContentTypes[k].getAttribute(ATTRIBUTE_ID))) {
String id= getLanguageID(languageElem);
@@ -216,8 +218,8 @@ public class LanguageManager {
fContentTypeToLanguageCache.put(contentTypeID, null);
return null;
}
-
- /**
+
+ /**
* @deprecated use getRegisteredContentTypes() instead.
*/
@Deprecated
@@ -229,19 +231,19 @@ public class LanguageManager {
allTypes.add(CCorePlugin.CONTENT_TYPE_CXXHEADER);
allTypes.add(CCorePlugin.CONTENT_TYPE_CXXSOURCE);
- IContentTypeManager manager = Platform.getContentTypeManager();
+ IContentTypeManager manager = Platform.getContentTypeManager();
IConfigurationElement[] configs= Platform.getExtensionRegistry().getConfigurationElementsFor(LANGUAGE_EXTENSION_POINT_ID);
for (int j = 0; j < configs.length; ++j) {
final IConfigurationElement languageElem = configs[j];
if (ELEMENT_LANGUAGE.equals(languageElem.getName())) {
- IConfigurationElement[] contentTypes = languageElem.getChildren(ELEMENT_CONTENT_TYPE);
+ IConfigurationElement[] contentTypes = languageElem.getChildren(ELEMENT_CONTENT_TYPE);
for (int k = 0; k < contentTypes.length; ++k) {
- IContentType langContType = manager.getContentType(contentTypes[k].getAttribute(ATTRIBUTE_ID));
+ IContentType langContType = manager.getContentType(contentTypes[k].getAttribute(ATTRIBUTE_ID));
allTypes.add(langContType.getId());
}
}
}
-
+
return allTypes;
}
@@ -253,7 +255,7 @@ public class LanguageManager {
Set contentTypes= collectContentTypeIds();
return contentTypes.toArray(new String[contentTypes.size()]);
}
-
+
private Set collectContentTypeIds() {
HashSet allTypes = new HashSet();
allTypes.add(CCorePlugin.CONTENT_TYPE_ASMSOURCE);
@@ -262,26 +264,26 @@ public class LanguageManager {
allTypes.add(CCorePlugin.CONTENT_TYPE_CXXHEADER);
allTypes.add(CCorePlugin.CONTENT_TYPE_CXXSOURCE);
- IContentTypeManager manager = Platform.getContentTypeManager();
+ IContentTypeManager manager = Platform.getContentTypeManager();
IConfigurationElement[] configs= Platform.getExtensionRegistry().getConfigurationElementsFor(LANGUAGE_EXTENSION_POINT_ID);
for (int j = 0; j < configs.length; ++j) {
final IConfigurationElement languageElem = configs[j];
if (ELEMENT_LANGUAGE.equals(languageElem.getName())) {
- IConfigurationElement[] contentTypes = languageElem.getChildren(ELEMENT_CONTENT_TYPE);
+ IConfigurationElement[] contentTypes = languageElem.getChildren(ELEMENT_CONTENT_TYPE);
for (int k = 0; k < contentTypes.length; ++k) {
- IContentType langContType = manager.getContentType(contentTypes[k].getAttribute(ATTRIBUTE_ID));
+ IContentType langContType = manager.getContentType(contentTypes[k].getAttribute(ATTRIBUTE_ID));
allTypes.add(langContType.getId());
}
}
}
-
+
return allTypes;
}
public boolean isContributedContentType(String contentTypeId) {
return contentTypeId != null && getLanguageForContentTypeID(contentTypeId) != null;
}
-
+
/**
* @deprecated use {@link #getContributedModelBuilderFor(ITranslationUnit)}, instead.
* @noreference This method is not intended to be referenced by clients.
@@ -309,36 +311,38 @@ public class LanguageManager {
}
/**
- * Returns mappings between IDs and IPDOMLinkageFactory. The IDs are defined in {@link ILinkage}.
+ * Returns mappings between IDs and IPDOMLinkageFactory. The IDs are defined in {@link ILinkage}.
* @return a map.
* @since 4.0
*/
public Map getPDOMLinkageFactoryMappings() {
if (!fPDOMLinkageFactoryCache.isEmpty())
return Collections.unmodifiableMap(fPDOMLinkageFactoryCache);
-
+
fPDOMLinkageFactoryCache.clear();
final IPDOMLinkageFactory[] result = new IPDOMLinkageFactory[] {null};
-
+
// read configuration
IConfigurationElement[] configs= Platform.getExtensionRegistry().getConfigurationElementsFor(LANGUAGE_EXTENSION_POINT_ID);
for (final IConfigurationElement element : configs) {
if (ELEMENT_PDOM_LINKAGE_FACTORY.equals(element.getName())) {
SafeRunner.run(new ISafeRunnable() {
+ @Override
public void handleException(Throwable exception) {
CCorePlugin.log(exception);
}
+ @Override
public void run() throws Exception {
result[0] = (IPDOMLinkageFactory) element.createExecutableExtension(ATTRIBUTE_CLASS);
}}
- );
+ );
fPDOMLinkageFactoryCache.put(element.getAttribute(ATTRIBUTE_ID), result[0]);
- }
- }
+ }
+ }
return Collections.unmodifiableMap(fPDOMLinkageFactoryCache);
- }
-
+ }
+
/**
* Returns all of the languages registered with the Platform
.
* @return all of the languages registered with the Platform
.
@@ -361,13 +365,15 @@ public class LanguageManager {
for (int j = 0; j < configs.length; ++j) {
final IConfigurationElement languageElem = configs[j];
if (ELEMENT_LANGUAGE.equals(languageElem.getName())) {
- String langId = getLanguageID(languageElem);
+ String langId = getLanguageID(languageElem);
final ILanguage[] result= new ILanguage[] { null };
SafeRunner.run(new ISafeRunnable() {
+ @Override
public void handleException(Throwable exception) {
CCorePlugin.log(exception);
}
+ @Override
public void run() throws Exception {
result[0]= (ILanguage) languageElem.createExecutableExtension(ATTRIBUTE_CLASS);
}
@@ -379,7 +385,7 @@ public class LanguageManager {
}
fIsFullyCached = true;
}
-
+
/**
* Returns the language configuration for the workspace.
* @return the language configuration for the workspace
@@ -391,16 +397,16 @@ public class LanguageManager {
if (fWorkspaceMappings != null) {
return fWorkspaceMappings;
}
-
+
LanguageMappingStore store = new LanguageMappingStore();
fWorkspaceMappings = store.decodeWorkspaceMappings();
return fWorkspaceMappings;
}
}
-
+
/**
* Saves the workspace language configuration to persistent storage and notifies
- * all ILanguageMappingChangeListeners
of changes.
+ * all ILanguageMappingChangeListeners
of changes.
* @param affectedContentTypes
* @throws CoreException
* @since 4.0
@@ -410,18 +416,18 @@ public class LanguageManager {
if (fWorkspaceMappings == null) {
return;
}
-
+
LanguageMappingStore store = new LanguageMappingStore();
store.storeMappings(fWorkspaceMappings);
}
-
+
// Notify listeners that the language mappings have changed.
LanguageMappingChangeEvent event = new LanguageMappingChangeEvent();
event.setType(ILanguageMappingChangeEvent.TYPE_WORKSPACE);
event.setAffectedContentTypes(affectedContentTypes);
notifyLanguageChangeListeners(event);
}
-
+
/**
* Returns the language configuration for the given project.
* @param project
@@ -435,18 +441,18 @@ public class LanguageManager {
if (mappings != null) {
return mappings;
}
-
+
LanguageMappingStore store = new LanguageMappingStore();
mappings = store.decodeMappings(project);
fLanguageConfigurationCache.put(project, mappings);
return mappings;
}
}
-
+
/**
* Saves the language configuration for the given project to persistent
* storage and notifies all ILanguageMappingChangeListeners
- * of changes.
+ * of changes.
* @param project
* @param affectedContentTypes
* @throws CoreException
@@ -458,7 +464,7 @@ public class LanguageManager {
LanguageMappingStore store = new LanguageMappingStore();
store.storeMappings(project, mappings);
}
-
+
// Notify listeners that the language mappings have changed.
LanguageMappingChangeEvent event = new LanguageMappingChangeEvent();
event.setType(ILanguageMappingChangeEvent.TYPE_PROJECT);
@@ -466,7 +472,7 @@ public class LanguageManager {
event.setAffectedContentTypes(affectedContentTypes);
notifyLanguageChangeListeners(event);
}
-
+
/**
* Returns an ILanguage representing the language to be used for the given file.
* @since 4.0
@@ -475,20 +481,20 @@ public class LanguageManager {
* @param project the IProject that this file is in the context of. This field cannot be null.
* @param configuration the active build configuration, or null
if build configurations
* are not relevant to determining the language.
- * @throws CoreException
+ * @throws CoreException
*/
public ILanguage getLanguageForFile(String fullPathToFile, IProject project, ICConfigurationDescription configuration) throws CoreException {
if (project == null)
throw new IllegalArgumentException("project must not be null in call to LanguageManager.getLanguageForFile(String, IProject)"); //$NON-NLS-1$
-
+
IContentType contentType = CContentTypes.getContentType(project, fullPathToFile);
-
+
if (contentType == null) {
return null;
}
-
+
String contentTypeID = contentType.getId();
-
+
return LanguageMappingResolver.computeLanguage(project, fullPathToFile, configuration, contentTypeID, false)[0].language;
}
@@ -507,7 +513,7 @@ public class LanguageManager {
public ILanguage getLanguageForFile(IPath pathToFile, IProject project, ICConfigurationDescription configuration) throws CoreException {
return getLanguageForFile(pathToFile, project, configuration, null);
}
-
+
/**
* Returns an ILanguage representing the language to be used for the given file.
* @return an ILanguage representing the language to be used for the given file
@@ -536,7 +542,7 @@ public class LanguageManager {
}
contentTypeID= ct.getId();
}
-
+
return LanguageMappingResolver.computeLanguage(project, pathToFile.toPortableString(), configuration, contentTypeID, false)[0].language;
}
@@ -566,7 +572,7 @@ public class LanguageManager {
public ILanguage getLanguageForFile(IFile file, ICConfigurationDescription configuration,
String contentTypeId) throws CoreException {
IProject project = file.getProject();
-
+
if (contentTypeId == null) {
IPath location = file.getLocation();
String filename;
@@ -581,36 +587,36 @@ public class LanguageManager {
}
contentTypeId= contentType.getId();
}
-
+
return LanguageMappingResolver.computeLanguage(project, file.getProjectRelativePath().toPortableString(), configuration, contentTypeId, false)[0].language;
}
-
+
/**
* Adds a listener that will be notified of changes in language mappings.
- *
+ *
* @param listener the ILanguageMappingChangeListener to add
*/
public void registerLanguageChangeListener(ILanguageMappingChangeListener listener) {
fLanguageChangeListeners.add(listener);
}
-
+
/**
* Removes a language mapping change listener.
- *
+ *
* @param listener the ILanguageMappingChangeListener to remove.
*/
public void unregisterLanguageChangeListener(ILanguageMappingChangeListener listener) {
fLanguageChangeListeners.remove(listener);
}
-
+
/**
* Notifies all language mappings change listeners of a change in the mappings.
- *
+ *
* @param event the ILanguageMappingsChange event to be broadcast.
*/
public void notifyLanguageChangeListeners(ILanguageMappingChangeEvent event) {
Object[] listeners = fLanguageChangeListeners.getListeners();
-
+
for (Object obj : listeners) {
ILanguageMappingChangeListener listener = (ILanguageMappingChangeListener) obj;
listener.handleLanguageMappingChangeEvent(event);
@@ -620,7 +626,7 @@ public class LanguageManager {
/**
* Saves the language configuration for the given file to persistent
* storage and notifies all ILanguageMappingChangeListeners
- * of changes.
+ * of changes.
* @param file
* @throws CoreException
* @since 4.0
@@ -632,7 +638,7 @@ public class LanguageManager {
LanguageMappingStore store = new LanguageMappingStore();
store.storeMappings(project, mappings);
}
-
+
// Notify listeners that the language mappings have changed.
LanguageMappingChangeEvent event = new LanguageMappingChangeEvent();
event.setType(ILanguageMappingChangeEvent.TYPE_FILE);
@@ -645,10 +651,10 @@ public class LanguageManager {
* Returns language binding to a particular content type for given project.
* This method will check project settings, workspace settings and default
* bindings (in that order)
- *
+ *
* @param contentType content type of the file
* @param project C/C++ workspace project
- * @return CDT language object
+ * @return CDT language object
* @since 5.4
*/
public ILanguage getLanguage(IContentType contentType, IProject project) {
@@ -659,11 +665,11 @@ public class LanguageManager {
* Returns language binding to a particular content type for given project.
* This method will check project settings, workspace settings and default
* bindings (in that order)
- *
+ *
* @param contentType content type of the file
* @param project C/C++ workspace project
* @param configurationDescription build configuration or null
- * @return CDT language object
+ * @return CDT language object
* @since 5.4
*/
public ILanguage getLanguage(IContentType contentType,
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/LanguageMappingChangeEvent.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/LanguageMappingChangeEvent.java
index 6487fc25cfd..540b46adf58 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/LanguageMappingChangeEvent.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/LanguageMappingChangeEvent.java
@@ -19,9 +19,9 @@ import org.eclipse.core.runtime.content.IContentType;
/**
* A minimal implementation of ILanguageMappingsChangeEvent.
- *
+ *
* @noextend This interface is not intended to be extended by clients.
- * @noinstantiate This class is not intended to be instantiated by clients.
+ * @noinstantiate This class is not intended to be instantiated by clients.
*/
public class LanguageMappingChangeEvent implements ILanguageMappingChangeEvent {
@@ -35,6 +35,7 @@ public class LanguageMappingChangeEvent implements ILanguageMappingChangeEvent {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ILanguageMappingsChangeEvent#getAffectedContentTypes()
*/
+ @Override
public IContentType[] getAffectedContentTypes() {
return fContentTypes;
}
@@ -42,6 +43,7 @@ public class LanguageMappingChangeEvent implements ILanguageMappingChangeEvent {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ILanguageMappingsChangeEvent#getFile()
*/
+ @Override
public IFile getFile() {
return fFile;
}
@@ -49,11 +51,12 @@ public class LanguageMappingChangeEvent implements ILanguageMappingChangeEvent {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ILanguageMappingsChangeEvent#getFilename()
*/
+ @Override
public String getFilename() {
-
+
// if the filename has been set, use it. otherwise get the path from
// either the IFile or the IPath if we have one
-
+
if(fFileName != null)
return fFileName;
else {
@@ -65,30 +68,31 @@ public class LanguageMappingChangeEvent implements ILanguageMappingChangeEvent {
else {
// use the URI if there is one
URI uri = fFile.getLocationURI();
-
+
if(uri != null)
return uri.toString();
}
-
+
}
else { // no file, use path
if(fPath != null)
return fPath.toString();
-
+
}
}
-
+
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ILanguageMappingsChangeEvent#getPath()
*/
+ @Override
public IPath getPath() {
-
+
if(fPath != null)
return fPath;
-
+
else { // try to get the path from the file if we have one
if(fFile != null)
{
@@ -96,31 +100,33 @@ public class LanguageMappingChangeEvent implements ILanguageMappingChangeEvent {
return location;
}
}
-
+
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ILanguageMappingsChangeEvent#getProject()
*/
+ @Override
public IProject getProject() {
-
+
if(fProject != null)
return fProject;
-
+
else { // try to get the project from the file if we have one
-
+
if(fFile != null)
return fFile.getProject();
-
+
}
-
- return null;
+
+ return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ILanguageMappingsChangeEvent#getType()
*/
+ @Override
public int getType() {
return fType;
}
@@ -128,7 +134,7 @@ public class LanguageMappingChangeEvent implements ILanguageMappingChangeEvent {
/**
* Sets the associated IContentTypes for this event. The provided array will be returned
* subsequently by getAffectedContentTypes.
- *
+ *
* @param affectedContentTypes
*/
public void setAffectedContentTypes(IContentType[] affectedContentTypes) {
@@ -138,7 +144,7 @@ public class LanguageMappingChangeEvent implements ILanguageMappingChangeEvent {
/**
* Sets the associated IFile for this event. This file will be returned subsequently
* by getFile().
- *
+ *
* @param file the IFile to set
*/
public void setFile(IFile file) {
@@ -148,7 +154,7 @@ public class LanguageMappingChangeEvent implements ILanguageMappingChangeEvent {
/**
* Sets the associated String filename for this event. This filename will be returned subsequently
* by getFileName().
- *
+ *
* @param fileName the fFileName to set
*/
public void setFileName(String fileName) {
@@ -158,7 +164,7 @@ public class LanguageMappingChangeEvent implements ILanguageMappingChangeEvent {
/**
* Sets the associated IPath for this event. This path will be returned subsequently
* by getPath().
- *
+ *
* @param path the IPath to set
*/
public void setPath(IPath path) {
@@ -168,16 +174,16 @@ public class LanguageMappingChangeEvent implements ILanguageMappingChangeEvent {
/**
* Sets the associated project for this event. This project will be returned subsequently
* by getProject().
- *
+ *
* @param project the IProject to set
*/
public void setProject(IProject project) {
fProject = project;
}
-
+
/**
* 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
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/util/CDTListComparator.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/util/CDTListComparator.java
index 14cfa3a2610..294af9234ac 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/util/CDTListComparator.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/util/CDTListComparator.java
@@ -25,19 +25,20 @@ public class CDTListComparator implements Comparator {
comparator = new CDTListComparator();
return comparator;
}
+ @Override
public int compare(Object a, Object b) {
- if (a == null || b == null)
+ if (a == null || b == null)
return 0;
if (a instanceof ICLanguageSetting) {
ICLanguageSetting c1 = (ICLanguageSetting)a;
ICLanguageSetting c2 = (ICLanguageSetting)b;
return c1.getName().compareToIgnoreCase(c2.getName());
- }
+ }
if (a instanceof ICLanguageSettingEntry) {
ICLanguageSettingEntry c1 = (ICLanguageSettingEntry)a;
ICLanguageSettingEntry c2 = (ICLanguageSettingEntry)b;
return c1.getName().compareToIgnoreCase(c2.getName());
- }
+ }
if (a instanceof ICConfigurationDescription) {
ICConfigurationDescription c1 = (ICConfigurationDescription)a;
ICConfigurationDescription c2 = (ICConfigurationDescription)b;
@@ -46,7 +47,7 @@ public class CDTListComparator implements Comparator {
if (a instanceof ICdtVariable) {
ICdtVariable c1 = (ICdtVariable) a;
ICdtVariable c2 = (ICdtVariable) b;
- return c1.getName().compareToIgnoreCase(c2.getName());
+ return c1.getName().compareToIgnoreCase(c2.getName());
}
return a.toString().compareTo(b.toString());
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ACExclusionFilterEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ACExclusionFilterEntry.java
index 061696b7136..098b5c62313 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ACExclusionFilterEntry.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ACExclusionFilterEntry.java
@@ -40,11 +40,12 @@ public abstract class ACExclusionFilterEntry extends ACPathEntry implements ICEx
protected final boolean isFile() {
return false;
}
-
+
/**
* Returns the exclusion patterns
* @return IPath[]
*/
+ @Override
public IPath[] getExclusionPatterns() {
return exclusionPatterns.length != 0 ? (IPath[])exclusionPatterns.clone() : exclusionPatterns;
}
@@ -52,6 +53,7 @@ public abstract class ACExclusionFilterEntry extends ACPathEntry implements ICEx
/**
* Returns a char based representation of the exclusions patterns full path.
*/
+ @Override
public char[][] fullExclusionPatternChars() {
if (this.fullCharExclusionPatterns == UNINIT_PATTERNS) {
int length = this.exclusionPatterns.length;
@@ -61,18 +63,18 @@ public abstract class ACExclusionFilterEntry extends ACPathEntry implements ICEx
path = getLocation();
IPath prefixPath = path.removeTrailingSeparator();
for (int i = 0; i < length; i++) {
- this.fullCharExclusionPatterns[i] =
+ this.fullCharExclusionPatterns[i] =
prefixPath.append(this.exclusionPatterns[i]).toString().toCharArray();
}
}
return this.fullCharExclusionPatterns;
}
-
+
@Override
public boolean equals(Object other) {
if(!super.equals(other))
return false;
-
+
ACExclusionFilterEntry otherEntry = (ACExclusionFilterEntry)other;
return Arrays.equals(exclusionPatterns, otherEntry.exclusionPatterns);
}
@@ -86,7 +88,7 @@ public abstract class ACExclusionFilterEntry extends ACPathEntry implements ICEx
public boolean equalsByContents(ICSettingEntry entry) {
if(!super.equalsByContents(entry))
return false;
-
+
ACExclusionFilterEntry otherEntry = (ACExclusionFilterEntry)entry;
return Arrays.equals(exclusionPatterns, otherEntry.exclusionPatterns);
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ACPathEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ACPathEntry.java
index 363b4d6a9a1..3835d6e878b 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ACPathEntry.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ACPathEntry.java
@@ -20,7 +20,7 @@ public abstract class ACPathEntry extends ACSettingEntry
// IPath fFullPath;
// IPath fLocation;
// private IPath fPath;
-
+
ACPathEntry(IResource rc, int flags) {
super(rc.getFullPath().toString(), flags | RESOLVED | VALUE_WORKSPACE_PATH);
// fFullPath = rc.getFullPath();
@@ -37,7 +37,7 @@ public abstract class ACPathEntry extends ACSettingEntry
ACPathEntry(String value, int flags) {
super(value, flags);
}
-
+
ACPathEntry(IPath path, int flags) {
super(path.toString(), flags /*| RESOLVED*/);
// fPath = path;
@@ -47,6 +47,7 @@ public abstract class ACPathEntry extends ACSettingEntry
// fLocation = path;
}
+ @Override
public IPath getFullPath() {
if(isValueWorkspacePath())
return new Path(getValue());
@@ -56,19 +57,20 @@ public abstract class ACPathEntry extends ACSettingEntry
}
return null;
}
-
+
protected IPath fullPathForLocation(IPath location){
IResource rcs[] = isFile() ?
(IResource[])ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(location)
: (IResource[])ResourcesPlugin.getWorkspace().getRoot().findContainersForLocation(location);
-
+
if(rcs.length > 0)
return rcs[0].getFullPath();
return null;
}
-
+
protected abstract boolean isFile();
+ @Override
public IPath getLocation() {
if(!isValueWorkspacePath())
return new Path(getValue());
@@ -80,7 +82,8 @@ public abstract class ACPathEntry extends ACSettingEntry
}
return null;
}
-
+
+ @Override
public boolean isValueWorkspacePath() {
return checkFlags(VALUE_WORKSPACE_PATH);
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ACSettingEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ACSettingEntry.java
index 37420be10a1..840047ff044 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ACSettingEntry.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ACSettingEntry.java
@@ -18,107 +18,115 @@ import org.eclipse.cdt.internal.core.SafeStringInterner;
public abstract class ACSettingEntry implements ICSettingEntry {
int fFlags;
String fName;
-
+
ACSettingEntry(String name, int flags){
fName = SafeStringInterner.safeIntern(name);
fFlags = flags;
}
+ @Override
public boolean isBuiltIn() {
return checkFlags(BUILTIN);
}
+ @Override
public boolean isReadOnly() {
return checkFlags(READONLY);
}
-
+
protected boolean checkFlags(int flags){
return (fFlags & flags) == flags;
}
-
+
+ @Override
public String getName() {
return fName;
}
+ @Override
public String getValue() {
- //name and value differ only for macro entry and have the same contents
+ //name and value differ only for macro entry and have the same contents
//for all other entries
return fName;
}
+ @Override
public boolean isResolved() {
return checkFlags(RESOLVED);
}
-
+
@Override
public boolean equals(Object other){
if(other == this)
return true;
-
+
if(!(other instanceof ACSettingEntry))
return false;
-
+
ACSettingEntry e = (ACSettingEntry)other;
-
+
if(getKind() != e.getKind())
return false;
-
+
if(fFlags != e.fFlags)
return false;
-
+
if(!fName.equals(e.fName))
return false;
-
+
return true;
}
-
+
@Override
public int hashCode(){
- return getKind() + fFlags + fName.hashCode();
+ return getKind() + fFlags + fName.hashCode();
}
+ @Override
public int getFlags() {
return fFlags;
}
+ @Override
public boolean equalsByContents(ICSettingEntry entry) {
return equalsByName(entry);
}
-
+
protected int getByNameMatchFlags(){
return (fFlags & (~ (BUILTIN | READONLY | RESOLVED)));
}
+ @Override
public final boolean equalsByName(ICSettingEntry entry) {
if(entry == this)
return true;
-
+
if(!(entry instanceof ACSettingEntry))
return false;
-
+
ACSettingEntry e = (ACSettingEntry)entry;
-
+
if(getKind() != e.getKind())
return false;
-
+
if(getByNameMatchFlags()
!= e.getByNameMatchFlags())
return false;
-
+
if(!fName.equals(e.fName))
return false;
-
+
return true;
}
-
+
public final int codeForNameKey(){
- return getKind() + getByNameMatchFlags() + fName.hashCode();
+ return getKind() + getByNameMatchFlags() + fName.hashCode();
}
-
+
public int codeForContentsKey(){
return codeForNameKey();
}
-
+
@Override
public final String toString(){
StringBuffer buf = new StringBuffer();
@@ -127,7 +135,7 @@ public abstract class ACSettingEntry implements ICSettingEntry {
buf.append(" ; flags: ").append(LanguageSettingEntriesSerializer.composeFlagsString(getFlags())); //$NON-NLS-1$
return buf.toString();
}
-
+
protected abstract String contentsToString();
-
+
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CExternalSetting.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CExternalSetting.java
index 6768253b104..5872650ccdd 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CExternalSetting.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CExternalSetting.java
@@ -29,14 +29,14 @@ public final class CExternalSetting implements ICExternalSetting {
fLanguageIds = base.getCompatibleLanguageIds();
fContentTypeIds = base.getCompatibleContentTypeIds();
fExtensions = base.getCompatibleExtensions();
-
+
// fEntryStore = new EntryStore();
initEntryStore(base.getEntries());
}
public CExternalSetting(ICExternalSetting base, ICSettingEntry entries[]) {
this(base);
-
+
initEntryStore(entries);
}
@@ -48,25 +48,25 @@ public final class CExternalSetting implements ICExternalSetting {
fContentTypeIds = contentTypeIds.clone();
if (extensions != null)
fExtensions = extensions.clone();
-
+
initEntryStore(entries);
}
-
+
private void initEntryStore(ICSettingEntry entries[]) {
ICSettingEntry entry;
for (int i = 0; i < entries.length; i++) {
entry = entries[i];
-
+
addEntry(entry);
}
-
+
// trimToSize();
}
-
+
private void addEntry(ICSettingEntry entry) {
getEntriesSet(entry.getKind(), true).addEntry(entry);
}
-
+
// private void trimToSize() {
// int kinds[] = KindBasedStore.getSupportedKinds();
// for (int i = 0; i < kinds.length; i++) {
@@ -75,7 +75,7 @@ public final class CExternalSetting implements ICExternalSetting {
// set.trimToSize();
// }
// }
-
+
private CEntriesSet getEntriesSet(int kind, boolean create) {
CEntriesSet set = fStore.get(kind);
if (set == null && create) {
@@ -85,24 +85,28 @@ public final class CExternalSetting implements ICExternalSetting {
return set;
}
+ @Override
public String[] getCompatibleContentTypeIds() {
if (fContentTypeIds != null)
return fContentTypeIds.clone();
return null;
}
+ @Override
public String[] getCompatibleExtensions() {
if (fExtensions != null)
return fExtensions.clone();
return null;
}
+ @Override
public String[] getCompatibleLanguageIds() {
if (fLanguageIds != null)
return fLanguageIds.clone();
return null;
}
+ @Override
public ICSettingEntry[] getEntries(int kind) {
CEntriesSet set = getEntriesSet(kind, false);
if (set != null)
@@ -114,6 +118,7 @@ public final class CExternalSetting implements ICExternalSetting {
// return fId;
// }
+ @Override
public ICSettingEntry[] getEntries() {
List result = new ArrayList();
int kinds[] = KindBasedStore.getAllEntryKinds();
@@ -122,7 +127,7 @@ public final class CExternalSetting implements ICExternalSetting {
if (list != null)
result.addAll(Arrays.asList(list.toArray()));
}
-
+
return result.toArray(new ICSettingEntry[result.size()]);
}
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CIncludeFileEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CIncludeFileEntry.java
index fa6081596cd..beb55889422 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CIncludeFileEntry.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CIncludeFileEntry.java
@@ -28,6 +28,7 @@ public final class CIncludeFileEntry extends ACPathEntry implements
super(rc, flags);
}
+ @Override
public final int getKind() {
return INCLUDE_FILE;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CIncludePathEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CIncludePathEntry.java
index ec1b0146079..9b88425ee54 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CIncludePathEntry.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CIncludePathEntry.java
@@ -27,10 +27,12 @@ public final class CIncludePathEntry extends ACPathEntry implements ICIncludePat
super(rc, flags);
}
+ @Override
public boolean isLocal() {
return checkFlags(LOCAL);
}
+ @Override
public final int getKind() {
return INCLUDE_PATH;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CLibraryFileEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CLibraryFileEntry.java
index a0b3f5e896d..4d693cf33d8 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CLibraryFileEntry.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CLibraryFileEntry.java
@@ -20,7 +20,7 @@ public final class CLibraryFileEntry extends ACPathEntry implements
private IPath fSourceAttachmentPath;
private IPath fSourceAttachmentRootPath;
private IPath fSourceAttachmentPrefixMapping;
-
+
public CLibraryFileEntry(String value, int flags) {
this(value, flags, null, null, null);
}
@@ -33,8 +33,8 @@ public final class CLibraryFileEntry extends ACPathEntry implements
this(rc, flags, null, null, null);
}
- public CLibraryFileEntry(String value,
- int flags,
+ public CLibraryFileEntry(String value,
+ int flags,
IPath sourceAttachmentPath,
IPath sourceAttachmentRootPath,
IPath sourceAttachmentPrefixMapping) {
@@ -43,7 +43,7 @@ public final class CLibraryFileEntry extends ACPathEntry implements
}
public CLibraryFileEntry(IPath location,
- int flags,
+ int flags,
IPath sourceAttachmentPath,
IPath sourceAttachmentRootPath,
IPath sourceAttachmentPrefixMapping) {
@@ -51,26 +51,27 @@ public final class CLibraryFileEntry extends ACPathEntry implements
setSourceAttachmentSettings(sourceAttachmentPath, sourceAttachmentRootPath, sourceAttachmentPrefixMapping);
}
- public CLibraryFileEntry(IFile rc,
- int flags,
+ public CLibraryFileEntry(IFile rc,
+ int flags,
IPath sourceAttachmentPath,
IPath sourceAttachmentRootPath,
IPath sourceAttachmentPrefixMapping) {
super(rc, flags);
setSourceAttachmentSettings(sourceAttachmentPath, sourceAttachmentRootPath, sourceAttachmentPrefixMapping);
}
-
+
private void setSourceAttachmentSettings(IPath sourceAttachmentPath,
IPath sourceAttachmentRootPath,
IPath sourceAttachmentPrefixMapping){
if(sourceAttachmentPath == null)
return;
-
+
fSourceAttachmentPath = sourceAttachmentPath;
fSourceAttachmentRootPath = sourceAttachmentRootPath != null ? sourceAttachmentRootPath : Path.EMPTY;
fSourceAttachmentPrefixMapping = sourceAttachmentPrefixMapping != null ? sourceAttachmentPrefixMapping : Path.EMPTY;
}
+ @Override
public final int getKind() {
return LIBRARY_FILE;
}
@@ -80,14 +81,17 @@ public final class CLibraryFileEntry extends ACPathEntry implements
return true;
}
+ @Override
public IPath getSourceAttachmentPath() {
return fSourceAttachmentPath;
}
+ @Override
public IPath getSourceAttachmentPrefixMapping() {
return fSourceAttachmentPrefixMapping;
}
+ @Override
public IPath getSourceAttachmentRootPath() {
return fSourceAttachmentRootPath;
}
@@ -108,10 +112,10 @@ public final class CLibraryFileEntry extends ACPathEntry implements
public boolean equals(Object other) {
if(other == this)
return true;
-
+
if(!super.equals(other))
return false;
-
+
return sourceAttachmentSettingsEqual((CLibraryFileEntry)other);
}
@@ -119,13 +123,13 @@ public final class CLibraryFileEntry extends ACPathEntry implements
public boolean equalsByContents(ICSettingEntry entry) {
if(entry == this)
return true;
-
+
if(!super.equalsByContents(entry))
return false;
-
+
return sourceAttachmentSettingsEqual((CLibraryFileEntry)entry);
}
-
+
private boolean sourceAttachmentSettingsEqual(CLibraryFileEntry otherEntry){
if(!CDataUtil.objectsEqual(fSourceAttachmentPath, otherEntry.fSourceAttachmentPath))
return false;
@@ -135,11 +139,11 @@ public final class CLibraryFileEntry extends ACPathEntry implements
return false;
return true;
}
-
+
@Override
protected String contentsToString() {
String result = super.contentsToString();
-
+
if(fSourceAttachmentPath != null){
StringBuffer buf = new StringBuffer();
buf.append(result);
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CLibraryPathEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CLibraryPathEntry.java
index f980921c382..90b832a5b09 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CLibraryPathEntry.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CLibraryPathEntry.java
@@ -28,6 +28,7 @@ public final class CLibraryPathEntry extends ACPathEntry implements
super(rc, flags);
}
+ @Override
public final int getKind() {
return LIBRARY_PATH;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CMacroEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CMacroEntry.java
index 451efd313d8..df0c903803d 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CMacroEntry.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CMacroEntry.java
@@ -29,6 +29,7 @@ public final class CMacroEntry extends ACSettingEntry implements ICMacroEntry{
return fValue;
}
+ @Override
public final int getKind() {
return MACRO;
}
@@ -49,7 +50,7 @@ public final class CMacroEntry extends ACSettingEntry implements ICMacroEntry{
public boolean equalsByContents(ICSettingEntry entry) {
if(!super.equalsByContents(entry))
return false;
-
+
return fValue.equals(((CMacroEntry)entry).fValue);
}
@@ -57,5 +58,5 @@ public final class CMacroEntry extends ACSettingEntry implements ICMacroEntry{
protected String contentsToString() {
return new StringBuffer().append(fName).append('=').append(fValue).toString();
}
-
+
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CMacroFileEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CMacroFileEntry.java
index 076ddd8dcfb..10114fccfd2 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CMacroFileEntry.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CMacroFileEntry.java
@@ -28,10 +28,11 @@ public final class CMacroFileEntry extends ACPathEntry implements
super(rc, flags);
}
+ @Override
public final int getKind() {
return MACRO_FILE;
}
-
+
@Override
public final boolean isFile() {
return true;
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/COutputEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/COutputEntry.java
index a256d3551e5..d682cbcc663 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/COutputEntry.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/COutputEntry.java
@@ -27,6 +27,7 @@ public final class COutputEntry extends ACExclusionFilterEntry implements ICOutp
super(value, exclusionPatterns, flags | VALUE_WORKSPACE_PATH);
}
+ @Override
public final int getKind() {
return OUTPUT_PATH;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CSourceEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CSourceEntry.java
index 5adb0d93e9e..f0fcdfc3646 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CSourceEntry.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/CSourceEntry.java
@@ -27,6 +27,7 @@ public final class CSourceEntry extends ACExclusionFilterEntry implements ICSour
super(value, exclusionPatterns, flags | VALUE_WORKSPACE_PATH);
}
+ @Override
public final int getKind() {
return SOURCE_PATH;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICConfigurationDescription.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICConfigurationDescription.java
index 6e54e180496..eac75d44021 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICConfigurationDescription.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICConfigurationDescription.java
@@ -175,6 +175,7 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
/**
* Returns whether or not the configuration description was modified
*/
+ @Override
boolean isModified();
/**
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICMacroEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICMacroEntry.java
index 64004033c9a..a53f5b1754f 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICMacroEntry.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICMacroEntry.java
@@ -19,5 +19,6 @@ public interface ICMacroEntry extends ICLanguageSettingEntry {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICSettingEntry#getValue()
*/
+ @Override
String getValue();
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICProjectDescription.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICProjectDescription.java
index 321ac95c8b2..0199ba259f3 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICProjectDescription.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICProjectDescription.java
@@ -20,11 +20,11 @@ import org.eclipse.core.runtime.QualifiedName;
* The ICProjectDescription is the root element for obtaining the CDT project settings
* it can be obtained by the {@link CoreModel#getProjectDescription(IProject, boolean)} call
* @see CoreModel#getProjectDescription(IProject)
- * @see CoreModel#getProjectDescription(IProject, boolean)
+ * @see CoreModel#getProjectDescription(IProject, boolean)
*
*/
-public interface ICProjectDescription extends ICSettingContainer,
- ICSettingObject,
+public interface ICProjectDescription extends ICSettingContainer,
+ ICSettingObject,
ICSettingsStorage,
ICProjectDescriptionPreferences {
@@ -32,7 +32,7 @@ public interface ICProjectDescription extends ICSettingContainer,
* @return {@link ICConfigurationDescription}[] containing all configurations in the project
*/
ICConfigurationDescription[] getConfigurations();
-
+
/**
* Returns the Project's active configuration. This is the configuration which is built by default
* @see ICProjectDescriptionPreferences#setConfigurationRelations(int)
@@ -42,9 +42,9 @@ public interface ICProjectDescription extends ICSettingContainer,
/**
* sets active configuration for this project description
- *
+ *
* @param cfg
- *
+ *
* @throws WriteAccessException when the project description is read-only
* the description is read only if it was queried/returned by the CoreModel.getProjectDescription(org.eclipse.core.resources.IProject, false)
call
*/
@@ -52,7 +52,7 @@ public interface ICProjectDescription extends ICSettingContainer,
/**
* creates/adds a new configuration for this project description
- *
+ *
* @param id configuration id
* @param name configuration name
* @param base the configuration description from which the settings are to be copied
@@ -60,15 +60,15 @@ public interface ICProjectDescription extends ICSettingContainer,
* @throws CoreException
* @throws WriteAccessException when the project description is read-only
* the description is read only if it was queried/returned by the CoreModel#getProjectDescription(org.eclipse.core.resources.IProject, false)
call
- *
+ *
*/
ICConfigurationDescription createConfiguration(String id, String name, ICConfigurationDescription base) throws CoreException, WriteAccessException;
/**
* creates/adds a new configuration for this project description
* This method is typically used by the Build System-specific code for creating new configurations
- *
- * @param buildSystemId build system id, i.e. the extension id contributing to the
+ *
+ * @param buildSystemId build system id, i.e. the extension id contributing to the
* org.eclipse.cdt.core.CConfigurationDataProvider extension point
* @param data CConfigurationData to be associated with this configuration
* @return {@link ICConfigurationDescription} created
@@ -89,7 +89,7 @@ public interface ICProjectDescription extends ICSettingContainer,
* @return {@link ICConfigurationDescription} of the given id or null if not found
*/
ICConfigurationDescription getConfigurationById(String id);
-
+
/**
* Remove Configuration of the given name from the project description
* @param name String name of the configuration to remove
@@ -105,23 +105,24 @@ public interface ICProjectDescription extends ICSettingContainer,
* the description is read only if it was queried/returned by the CoreModel.getProjectDescription(IProject, false)
call
*/
void removeConfiguration(ICConfigurationDescription cfg) throws WriteAccessException;
-
+
/**
* @return IProject this project description is associated with
*/
IProject getProject();
-
+
/**
* @return true if the project description was modified, false otherwise
*/
+ @Override
boolean isModified();
-
+
/**
* the get/setSettionsProperty methods allow to associate the session properties with the given project description
* session properties are not persisted and are not restored on the next eclipse session
* the scope of project description session properties is the current project description,
* i.e. modifications to the properties are not applied until the setProjectDescription call
- *
+ *
* @param name
*/
Object getSessionProperty(QualifiedName name);
@@ -131,16 +132,16 @@ public interface ICProjectDescription extends ICSettingContainer,
* session properties are not persisted and are not restored on the next eclipse session
* the scope of project description session properties is the current project description,
* i.e. modifications to the properties are not applied until the setProjectDescription call
- *
+ *
* @param name
* @param value
*/
void setSessionProperty(QualifiedName name, Object value);
-
+
/**
* Returns the default setting ICConfigurationDescription. This is the configuration
- * used by the CDT editor and views.
- *
+ * used by the CDT editor and views.
+ *
* @see ICProjectDescriptionPreferences#setConfigurationRelations(int)
* @return the default {@link ICConfigurationDescription}
*/
@@ -153,28 +154,28 @@ public interface ICProjectDescription extends ICSettingContainer,
* @param cfg
*/
void setDefaultSettingConfiguration(ICConfigurationDescription cfg);
-
+
/**
* when true specifies that the project creation is in progress.
* Sometimes project creation might be performed via multiple steps, e.g.
* the New Project Wizard may create a temporary project with temporary settings
* and delete it on cancel, etc.
- *
+ *
* Thus the project may exist as well as the project may contain the associated ICProjectDescription,
* but its initialization may not be completed.
- *
+ *
* once the flag is set to false it can never be reset back to true.
- * if {@link ICProjectDescriptionManager#setProjectDescription(IProject, ICProjectDescription)} is called
+ * if {@link ICProjectDescriptionManager#setProjectDescription(IProject, ICProjectDescription)} is called
* for the description containing the true "isCdtProjectCreating" state,
* but the project already contains the project description with the false "isCdtProjectCreating" state
* the true state will be ignored, i.e. the resulting setting will contain false "isCdtProjectCreating" state
- *
+ *
* so only the newly created descriptions (created via a {@link ICProjectDescriptionManager#createProjectDescription(IProject, boolean, boolean)}) may contain
* true "isCdtProjectCreating" state
- *
- *
+ *
+ *
* @return boolean
- *
+ *
* @see ICProjectDescriptionManager#createProjectDescription(IProject, boolean, boolean)
* @see #setCdtProjectCreated()
*/
@@ -182,7 +183,7 @@ public interface ICProjectDescription extends ICSettingContainer,
/**
* sets the project creation state to false
- *
+ *
* @see #isCdtProjectCreating()
* @see ICProjectDescriptionManager#createProjectDescription(IProject, boolean, boolean)
*/
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/MultiItemsHolder.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/MultiItemsHolder.java
index cca81f3960f..4ca7069c6fd 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/MultiItemsHolder.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/MultiItemsHolder.java
@@ -25,21 +25,22 @@ public abstract class MultiItemsHolder implements ICMultiItemsHolder {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICMultiItemsHolder#getItems()
*/
+ @Override
public abstract Object[] getItems();
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICMultiItemsHolder#setStringListMode(int)
*/
/**
- * This method is put here to prevent UI from
- * accessing constructors in "internal" dirs.
- *
+ * This method is put here to prevent UI from
+ * accessing constructors in "internal" dirs.
+ *
* Creates multiple configuration description.
- * If there's 1 cfg.desc in array,
- * it's returned itself.
- *
+ * If there's 1 cfg.desc in array,
+ * it's returned itself.
+ *
* @param rds - array of cfg.descs
- *
+ *
* @return multiple cfg.description or single cfg.desc.
*/
public static ICConfigurationDescription createCDescription(ICConfigurationDescription[] rds) {
@@ -51,16 +52,16 @@ public abstract class MultiItemsHolder implements ICMultiItemsHolder {
return new MultiConfigDescription(rds);
}
/**
- * This method is put here to prevent UI from
- * accessing constructors in "internal" dirs.
- *
+ * This method is put here to prevent UI from
+ * accessing constructors in "internal" dirs.
+ *
* Creates multiple resource description, it
* can be either MultiFile or MultiFolder.
- * If there's 1 description in array,
- * it's returned itself.
- *
+ * If there's 1 description in array,
+ * it's returned itself.
+ *
* @param rds - array of resource descs
- *
+ *
* @return multiple res.description or single res.desc.
*/
public static ICResourceDescription createRDescription(ICResourceDescription[] rds) {
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/MultiLanguageSetting.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/MultiLanguageSetting.java
index e6cf701c1e5..6b51d2e9363 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/MultiLanguageSetting.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/MultiLanguageSetting.java
@@ -15,21 +15,22 @@ import java.util.List;
/**
- * This class is intended to hold "similar" Language Setting objects.
+ * This class is intended to hold "similar" Language Setting objects.
* Normally, they should have the same name.
*/
public class MultiLanguageSetting extends MultiItemsHolder implements ICLanguageSetting {
ICLanguageSetting[] items = null;
ICConfigurationDescription cfgd = null;
-
+
public MultiLanguageSetting(List data, ICConfigurationDescription cf) {
items = data.toArray(new ICLanguageSetting[data.size()]);
cfgd = cf;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICLanguageSetting#getLanguageId()
*/
+ @Override
public String getLanguageId() {
return items[0].getLanguageId(); // Assuming language is the same.
}
@@ -48,6 +49,7 @@ public class MultiLanguageSetting extends MultiItemsHolder implements ICLanguage
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICLanguageSetting#getSettingEntriesList(int)
*/
+ @Override
public List getSettingEntriesList(int kind) {
return Arrays.asList(getSettingEntries(kind));
}
@@ -75,6 +77,7 @@ public class MultiLanguageSetting extends MultiItemsHolder implements ICLanguage
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICLanguageSetting#getSupportedEntryKinds()
*/
+ @Override
public int getSupportedEntryKinds() {
int res = 0;
for (ICLanguageSetting item : items)
@@ -85,11 +88,13 @@ public class MultiLanguageSetting extends MultiItemsHolder implements ICLanguage
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICLanguageSetting#setLanguageId(java.lang.String)
*/
+ @Override
public void setLanguageId(String id) {} // Do nothing
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICLanguageSetting#setSettingEntries(int, org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry[])
*/
+ @Override
public void setSettingEntries(int kind, ICLanguageSettingEntry[] entries) {
for (ICLanguageSetting item : items)
item.setSettingEntries(kind, entries);
@@ -98,6 +103,7 @@ public class MultiLanguageSetting extends MultiItemsHolder implements ICLanguage
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICLanguageSetting#setSettingEntries(int, java.util.List)
*/
+ @Override
public void setSettingEntries(int kind, List entriesList) {
for (ICLanguageSetting item : items)
item.setSettingEntries(kind, entriesList);
@@ -106,6 +112,7 @@ public class MultiLanguageSetting extends MultiItemsHolder implements ICLanguage
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICLanguageSetting#setSourceContentTypeIds(java.lang.String[])
*/
+ @Override
public void setSourceContentTypeIds(String[] ids) {
for (ICLanguageSetting item : items)
item.setSourceContentTypeIds(ids);
@@ -114,6 +121,7 @@ public class MultiLanguageSetting extends MultiItemsHolder implements ICLanguage
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICLanguageSetting#setSourceExtensions(java.lang.String[])
*/
+ @Override
public void setSourceExtensions(String[] exts) {
for (ICLanguageSetting item : items)
item.setSourceExtensions(exts);
@@ -122,6 +130,7 @@ public class MultiLanguageSetting extends MultiItemsHolder implements ICLanguage
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICLanguageSetting#supportsEntryKind(int)
*/
+ @Override
public boolean supportsEntryKind(int kind) {
for (ICLanguageSetting item : items)
if (item.supportsEntryKind(kind))
@@ -132,6 +141,7 @@ public class MultiLanguageSetting extends MultiItemsHolder implements ICLanguage
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICSettingObject#getConfiguration()
*/
+ @Override
public ICConfigurationDescription getConfiguration() {
if (DEBUG)
System.out.println("Bad multi access: MultiLanguageSetting.getConfiguration()"); //$NON-NLS-1$
@@ -141,6 +151,7 @@ public class MultiLanguageSetting extends MultiItemsHolder implements ICLanguage
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICSettingObject#getId()
*/
+ @Override
public String getId() { // IDs are different
if (DEBUG)
System.out.println("Bad multi access: MultiLanguageSetting.getId()"); //$NON-NLS-1$
@@ -150,6 +161,7 @@ public class MultiLanguageSetting extends MultiItemsHolder implements ICLanguage
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICSettingObject#getName()
*/
+ @Override
public String getName() { // names are proposed to be equal
return items[0].getName();
}
@@ -157,6 +169,7 @@ public class MultiLanguageSetting extends MultiItemsHolder implements ICLanguage
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICSettingObject#getParent()
*/
+ @Override
public ICSettingContainer getParent() {
if (DEBUG)
System.out.println("Bad multi access: MultiLanguageSetting.getParent()"); //$NON-NLS-1$
@@ -166,6 +179,7 @@ public class MultiLanguageSetting extends MultiItemsHolder implements ICLanguage
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICSettingObject#getType()
*/
+ @Override
public int getType() {
int x = items[0].getType();
for (ICLanguageSetting item : items)
@@ -177,6 +191,7 @@ public class MultiLanguageSetting extends MultiItemsHolder implements ICLanguage
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICSettingObject#isReadOnly()
*/
+ @Override
public boolean isReadOnly() {
for (int i=0; i clazz){
List list = getRcDataList(kind);
CResourceData datas[] = (CResourceData[])Array.newInstance(clazz, list.size());
-
+
return list.toArray(datas);
}
-
+
public List getRcDataList(final int kind){
- final List list = new ArrayList();
+ final List list = new ArrayList();
fRcDataContainer.accept(new IPathSettingsContainerVisitor(){
+ @Override
public boolean visit(PathSettingsContainer container) {
if(fIncludeCurrent || container != fRcDataContainer){
CResourceData data = (CResourceData)container.getValue();
@@ -79,7 +80,7 @@ public class CResourceDataContainer {
return true;
}
});
-
+
return list;
}
@@ -93,16 +94,16 @@ public class CResourceDataContainer {
public void removeResourceData(IPath path) {
fRcDataContainer.removeChildContainer(path);
}
-
+
public void addResourceData(CResourceData data){
PathSettingsContainer cr = fRcDataContainer.getChildContainer(data.getPath(), true, true);
cr.setValue(data);
}
-
+
public CFileData getFileData(IPath path){
return (CFileData)getResourceData(path, true, ICSettingBase.SETTING_FILE);
}
-
+
public CFolderData getFolderData(IPath path){
return (CFolderData)getResourceData(path, true, ICSettingBase.SETTING_FOLDER);
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/KindBasedStore.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/KindBasedStore.java
index c9ce9d75018..3ced074d468 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/KindBasedStore.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/KindBasedStore.java
@@ -16,9 +16,9 @@ import org.eclipse.cdt.core.settings.model.ICSettingEntry;
/**
* A storage where stored data is organized by "kind".
* In most cases kind is one of {@link ICLanguageSettingEntry}, i.e. include path, macro etc.
- *
+ *
* @param - stored type
- *
+ *
* @see ICSettingEntry#INCLUDE_PATH
* @see ICSettingEntry#INCLUDE_FILE
* @see ICSettingEntry#MACRO
@@ -41,8 +41,8 @@ public class KindBasedStore implements Cloneable {
private static final int INDEX_SOURCE_PATH = 6;
private static final int INDEX_OUPUT_PATH = 7;
private static final int ALL_STORAGE_SIZE = 8;
-
- public static final int ORED_LANG_ENTRY_KINDS =
+
+ public static final int ORED_LANG_ENTRY_KINDS =
ICLanguageSettingEntry.INCLUDE_PATH
| ICLanguageSettingEntry.INCLUDE_FILE
| ICLanguageSettingEntry.MACRO
@@ -50,7 +50,7 @@ public class KindBasedStore implements Cloneable {
| ICLanguageSettingEntry.LIBRARY_PATH
| ICLanguageSettingEntry.LIBRARY_FILE;
- public static final int ORED_ALL_ENTRY_KINDS =
+ public static final int ORED_ALL_ENTRY_KINDS =
ICLanguageSettingEntry.INCLUDE_PATH
| ICLanguageSettingEntry.INCLUDE_FILE
| ICLanguageSettingEntry.MACRO
@@ -59,7 +59,7 @@ public class KindBasedStore implements Cloneable {
| ICLanguageSettingEntry.LIBRARY_FILE
| ICLanguageSettingEntry.SOURCE_PATH
| ICLanguageSettingEntry.OUTPUT_PATH;
-
+
private static final int LANG_ENTRY_KINDS[] = new int[]{
ICLanguageSettingEntry.INCLUDE_PATH,
ICLanguageSettingEntry.INCLUDE_FILE,
@@ -81,7 +81,7 @@ public class KindBasedStore implements Cloneable {
};
// private static final int INEXISTENT_INDEX = -1;
-
+
private Object[] fEntryStorage;
public KindBasedStore(){
@@ -162,11 +162,11 @@ public class KindBasedStore implements Cloneable {
fEntryStorage[index] = object;
return old;
}
-
+
private class KindBasedInfo implements IKindBasedInfo {
int fIdex;
int fKind;
-
+
KindBasedInfo(int num, boolean isKind){
if(isKind){
fIdex = kindToIndex(num);
@@ -176,26 +176,29 @@ public class KindBasedStore implements Cloneable {
fKind = indexToKind(num);
}
}
-
+
+ @Override
public T getInfo() {
@SuppressWarnings("unchecked")
T info = (T)fEntryStorage[fIdex];
return info;
}
+ @Override
public int getKind() {
return fKind;
}
+ @Override
public T setInfo(T newInfo) {
@SuppressWarnings("unchecked")
T old = (T)fEntryStorage[fIdex];
fEntryStorage[fIdex] = newInfo;
return old;
}
-
+
}
-
+
public IKindBasedInfo[] getContents(){
@SuppressWarnings("unchecked")
IKindBasedInfo infos[] = new IKindBasedInfo[fEntryStorage.length];
@@ -204,11 +207,11 @@ public class KindBasedStore implements Cloneable {
}
return infos;
}
-
+
public IKindBasedInfo getInfo(int kind){
return new KindBasedInfo(kind, true);
}
-
+
public void clear(){
for(int i = 0; i < fEntryStorage.length; i++){
fEntryStorage[i] = null;
@@ -226,6 +229,6 @@ public class KindBasedStore implements Cloneable {
}
return null;
}
-
-
+
+
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathEntryTranslator.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathEntryTranslator.java
index f399fdbbdde..4a9db6d9ebb 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathEntryTranslator.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathEntryTranslator.java
@@ -990,6 +990,7 @@ public class PathEntryTranslator {
final Set set = new HashSet();
fStorage.accept(new IPathSettingsContainerVisitor() {
+ @Override
public boolean visit(PathSettingsContainer container) {
PathEntryCollector clr = (PathEntryCollector)container.getValue();
clr.getLocalCollectedEntries(kind, list, set);
@@ -2033,6 +2034,7 @@ public class PathEntryTranslator {
final int kinds[] = KindBasedStore.getLanguageEntryKinds();
rcDatas.accept(new IPathSettingsContainerVisitor() {
+ @Override
public boolean visit(PathSettingsContainer container) {
CResourceData data = (CResourceData)container.getValue();
if (data != null) {
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathSettingsContainer.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathSettingsContainer.java
index 5f7bf9568ae..54476b5479f 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathSettingsContainer.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathSettingsContainer.java
@@ -181,6 +181,7 @@ public final class PathSettingsContainer {
final List list = new ArrayList();
accept(new IPathSettingsContainerVisitor(){
+ @Override
public boolean visit(PathSettingsContainer container) {
if(container != PathSettingsContainer.this || includeThis)
list.add(container);
@@ -258,6 +259,7 @@ public final class PathSettingsContainer {
final List list = new ArrayList();
accept(new IPathSettingsContainerVisitor(){
+ @Override
public boolean visit(PathSettingsContainer container) {
if(container != PathSettingsContainer.this || includeThis)
list.add(container.getValue());
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PatternNameMap.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PatternNameMap.java
index 63832c37365..34f8da91ae5 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PatternNameMap.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PatternNameMap.java
@@ -17,13 +17,13 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.NoSuchElementException;
import java.util.Map.Entry;
+import java.util.NoSuchElementException;
import org.eclipse.cdt.core.model.CoreModelUtil;
public class PatternNameMap {
- private static final char[] SPEC_CHARS = new char[]{'*', '?'};
+ private static final char[] SPEC_CHARS = new char[]{'*', '?'};
static final String DOUBLE_STAR_PATTERN = "**"; //$NON-NLS-1$
private Map fChildrenMap;
@@ -38,7 +38,7 @@ public class PatternNameMap {
StringCharArray(String string){
fString = string;
}
-
+
char[] getCharArray(){
if(fCharArray == null){
fCharArray = fString.toCharArray();
@@ -50,10 +50,10 @@ public class PatternNameMap {
public boolean equals(Object obj) {
if(obj == this)
return true;
-
+
if(!(obj instanceof StringCharArray))
return false;
-
+
return fString.equals(((StringCharArray)obj).fString);
}
@@ -67,25 +67,28 @@ public class PatternNameMap {
return fString;
}
}
-
+
private class EmptyIterator implements Iterator{
+ @Override
public boolean hasNext() {
return false;
}
+ @Override
public PathSettingsContainer next() {
throw new NoSuchElementException();
}
+ @Override
public void remove() {
throw new IllegalStateException();
}
-
+
}
-
+
private class ValuesCollection extends AbstractCollection {
-
+
private class Iter implements Iterator {
private Iterator> fEntrySetIter;
private Entry fCur;
@@ -93,15 +96,18 @@ public class PatternNameMap {
Iter (Iterator> entryIter){
this.fEntrySetIter = entryIter;
}
+ @Override
public boolean hasNext() {
return fEntrySetIter.hasNext();
}
+ @Override
public PathSettingsContainer next() {
fCur = fEntrySetIter.next();
return fCur.getValue();
}
+ @Override
public void remove() {
fEntrySetIter.remove();
String name = fCur.getKey();
@@ -122,12 +128,12 @@ public class PatternNameMap {
public int size() {
return PatternNameMap.this.size();
}
-
+
@Override
public void clear(){
PatternNameMap.this.clear();
}
-
+
@Override
public boolean contains(Object o){
return fChildrenMap != null ? fChildrenMap.containsValue(o) : false;
@@ -137,15 +143,15 @@ public class PatternNameMap {
public /* PathSettingsContainer */ Object get(String name){
return fChildrenMap != null ? fChildrenMap.get(name) : null;
}
-
+
public int size(){
return fChildrenMap != null ? fChildrenMap.size() : 0;
}
-
+
public boolean isEmpty(){
return fChildrenMap == null || fChildrenMap.isEmpty();
}
-
+
public boolean hasPatterns(){
return fContainsDoubleStar || hasPatternsMap();
}
@@ -157,7 +163,7 @@ public class PatternNameMap {
public List getValues(String name){
if(fChildrenMap == null)
return null;
-
+
PathSettingsContainer val = fChildrenMap.get(name);
if(hasPatternsMap()){
List list;
@@ -167,10 +173,10 @@ public class PatternNameMap {
} else {
list = null;
}
-
+
Map.Entry entry;
StringCharArray strCA;
- char[] nameCharArray = name.toCharArray();
+ char[] nameCharArray = name.toCharArray();
for(Iterator> iter = fPatternMap.entrySet().iterator(); iter.hasNext();){
entry = iter.next();
strCA = entry.getKey();
@@ -188,19 +194,19 @@ public class PatternNameMap {
}
return null;
}
-
+
public boolean containsDoubleStar(){
return fContainsDoubleStar;
}
-
+
public /* PathSettingsContainer */ Object put(String name, /* PathSettingsContainer */Object value){
return put(name, (PathSettingsContainer)value);
}
-
+
private PathSettingsContainer put(String name, PathSettingsContainer value){
if(value == null)
return (PathSettingsContainer)remove(name);
-
+
PathSettingsContainer oldValue;
if(fChildrenMap == null){
fChildrenMap = new HashMap();
@@ -208,22 +214,22 @@ public class PatternNameMap {
} else {
oldValue = fChildrenMap.get(name);
}
-
+
fChildrenMap.put(name, value);
-
+
if(DOUBLE_STAR_PATTERN.equals(name)){
fContainsDoubleStar = true;
} else if(isPatternName(name)){
StringCharArray strCA = new StringCharArray(name);
if(fPatternMap == null)
fPatternMap = new HashMap();
-
+
fPatternMap.put(strCA, value);
}
-
+
return oldValue;
}
-
+
public /* PathSettingsContainer */ Object remove(String name){
if(fChildrenMap != null){
PathSettingsContainer oldVal = fChildrenMap.remove(name);
@@ -240,7 +246,7 @@ public class PatternNameMap {
}
return null;
}
-
+
private void removePattern(String name){
if (fPatternMap != null){
fPatternMap.remove(new StringCharArray(name));
@@ -248,7 +254,7 @@ public class PatternNameMap {
fPatternMap = null;
}
}
-
+
private static boolean hasSpecChars(String str){
for(int i = 0; i < SPEC_CHARS.length; i++){
if(str.indexOf(SPEC_CHARS[i]) != -1)
@@ -261,13 +267,13 @@ public class PatternNameMap {
//TODO: check escape chars
return hasSpecChars(str);
}
-
+
public void clear(){
fChildrenMap = null;
fPatternMap = null;
fContainsDoubleStar = false;
}
-
+
public Collection values(){
if(fValues == null)
fValues = new ValuesCollection();
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/ResourceChangeHandlerBase.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/ResourceChangeHandlerBase.java
index 569c767d3b5..4fa7a6dff8a 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/ResourceChangeHandlerBase.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/ResourceChangeHandlerBase.java
@@ -50,7 +50,7 @@ public abstract class ResourceChangeHandlerBase implements IResourceChangeListen
void handleProjectClose(IProject project);
/**
- * Call-back ticked at end of a resource change event
+ * Call-back ticked at end of a resource change event
*/
void done();
}
@@ -66,7 +66,7 @@ public abstract class ResourceChangeHandlerBase implements IResourceChangeListen
fHandler = handler;
// fRootDelta = rootDelta;
}
-
+
private IResource getResource(IPath path, IResource baseResource){
switch(baseResource.getType()){
case IResource.FILE:
@@ -80,24 +80,25 @@ public abstract class ResourceChangeHandlerBase implements IResourceChangeListen
throw new IllegalArgumentException();
}
}
-
+
private boolean checkInitHandleResourceMove(IResource fromRc, IResource toRc){
if(fMoveMap.put(fromRc, toRc) == null){
return fHandler.handleResourceMove(fromRc, toRc);
}
-
+
return true;
}
-
+
+ @Override
public boolean visit(IResourceDelta delta) throws CoreException {
IResource dResource = delta.getResource();
-
+
if(dResource.getType() == IResource.PROJECT && !shouldVisit((IProject)dResource))
return false;
-
+
boolean resume = true;
boolean removed = false;
-
+
switch (delta.getKind()) {
case IResourceDelta.REMOVED:
removed = true;
@@ -126,29 +127,30 @@ public abstract class ResourceChangeHandlerBase implements IResourceChangeListen
break;
}
-
+
return resume; // visit the children
}
}
-
+
/*
- * I R e s o u r c e C h a n g e L i s t e n e r
+ * I R e s o u r c e C h a n g e L i s t e n e r
*/
/* (non-Javadoc)
- *
+ *
* Handle the renaming and deletion of project resources
* This is necessary in order to update ResourceConfigurations and AdditionalInputs
- *
+ *
* @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
*/
+ @Override
public void resourceChanged(IResourceChangeEvent event) {
if (event.getSource() instanceof IWorkspace) {
IResourceMoveHandler handler = createResourceMoveHandler(event);
doHandleResourceMove(event, handler);
}
}
-
+
protected boolean shouldVisit(IProject project){
try {
return project.isOpen() ? project.hasNature(CProjectNature.C_NATURE_ID) : true;
@@ -165,7 +167,7 @@ public abstract class ResourceChangeHandlerBase implements IResourceChangeListen
protected void doHahdleResourceMove(IResourceChangeEvent event, IResourceMoveHandler handler) {
doHandleResourceMove(event, handler);
}
-
+
/**
* @since 5.1
*/
@@ -194,9 +196,9 @@ public abstract class ResourceChangeHandlerBase implements IResourceChangeListen
default :
break;
}
-
+
handler.done();
}
-
+
protected abstract IResourceMoveHandler createResourceMoveHandler(IResourceChangeEvent event);
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/XmlStorageElement.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/XmlStorageElement.java
index ae07d2800a9..b471cccdd13 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/XmlStorageElement.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/XmlStorageElement.java
@@ -58,14 +58,14 @@ public class XmlStorageElement implements ICStorageElement {
fElement = element;
fParent = parent;
fParentRefAlowed = alowReferencingParent;
-
+
if(attributeFilters != null && attributeFilters.length != 0)
fAttributeFilters = attributeFilters.clone();
-
+
if(childFilters != null && childFilters.length != 0)
fChildFilters = childFilters.clone();
}
-
+
// public String[] getAttributeFilters(){
// if(fAttributeFilters != null)
// return (String[])fAttributeFilters.clone();
@@ -77,7 +77,7 @@ public class XmlStorageElement implements ICStorageElement {
// return (String[])fChildFilters.clone();
// return null;
// }
-//
+//
// public boolean isParentRefAlowed(){
// return fParentRefAlowed;
// }
@@ -85,7 +85,7 @@ public class XmlStorageElement implements ICStorageElement {
private void createChildren(){
if(fChildrenCreated)
return;
-
+
fChildrenCreated = true;
NodeList list = fElement.getChildNodes();
int size = list.getLength();
@@ -97,16 +97,16 @@ public class XmlStorageElement implements ICStorageElement {
}
}
}
-
+
private XmlStorageElement createAddChild(Element element,
boolean alowReferencingParent,
String[] attributeFilters,
String[] childFilters){
XmlStorageElement child = createChild(element, alowReferencingParent, attributeFilters, childFilters);
fChildList.add(child);
- return child;
+ return child;
}
-
+
protected XmlStorageElement createChild(Element element,
boolean alowReferencingParent,
String[] attributeFilters,
@@ -114,6 +114,7 @@ public class XmlStorageElement implements ICStorageElement {
return new XmlStorageElement(element, this, alowReferencingParent, attributeFilters, childFilters);
}
+ @Override
public ICStorageElement[] getChildren() {
return getChildren(XmlStorageElement.class);
}
@@ -136,16 +137,18 @@ public class XmlStorageElement implements ICStorageElement {
return fChildList.toArray(children);
}
+ @Override
public ICStorageElement getParent() {
return fParentRefAlowed ? fParent : null;
}
+ @Override
public String getAttribute(String name) {
if(isPropertyAlowed(name) && fElement.hasAttribute(name))
return fElement.getAttribute(name);
return null;
}
-
+
private boolean isPropertyAlowed(String name){
if(fAttributeFilters != null){
return checkString(name, fAttributeFilters);
@@ -173,15 +176,16 @@ public class XmlStorageElement implements ICStorageElement {
// protected void childRemoved(ICStorageElement child) {
// fChildList.remove(child);
// }
-
+
protected void removed(){
// fElement.getParentNode().removeChild(fElement);
fElement = null;
// if(fParent != null)
// ((XmlStorageElement)fParent).childRemoved(this);
}
-
+
+ @Override
public void removeChild(ICStorageElement el) {
if(el instanceof XmlStorageElement){
ICStorageElement[] children = getChildren();
@@ -202,19 +206,22 @@ public class XmlStorageElement implements ICStorageElement {
}
}
}
-
+
}
+ @Override
public void removeAttribute(String name) {
if(isPropertyAlowed(name))
fElement.removeAttribute(name);
}
+ @Override
public void setAttribute(String name, String value) {
if(isPropertyAlowed(name))
fElement.setAttribute(name, value);
}
-
+
+ @Override
public void clear(){
createChildren();
@@ -222,14 +229,14 @@ public class XmlStorageElement implements ICStorageElement {
for(int i = 0; i < children.length; i++){
removeChild(children[i]);
}
-
+
NamedNodeMap map = fElement.getAttributes();
for(int i = 0; i < map.getLength(); i++){
Node attr = map.item(i);
if(isPropertyAlowed(attr.getNodeName()))
map.removeNamedItem(attr.getNodeName());
}
-
+
NodeList list = fElement.getChildNodes();
for(int i = 0; i < list.getLength(); i++){
Node node = list.item(i);
@@ -237,8 +244,8 @@ public class XmlStorageElement implements ICStorageElement {
fElement.removeChild(node);
}
}
-
- public ICStorageElement createChild(String name,
+
+ public ICStorageElement createChild(String name,
boolean alowReferencingParent,
String[] attributeFilters,
String[] childFilters) {
@@ -249,14 +256,17 @@ public class XmlStorageElement implements ICStorageElement {
return createAddChild(childElement, alowReferencingParent, attributeFilters, childFilters);
}
+ @Override
public String getName() {
return fElement.getNodeName();
}
+ @Override
public ICStorageElement createChild(String name) {
return createChild(name, true, null, null);
}
+ @Override
public String getValue() {
Text text = getTextChild();
if(text != null)
@@ -264,6 +274,7 @@ public class XmlStorageElement implements ICStorageElement {
return null;
}
+ @Override
public void setValue(String value) {
Text text = getTextChild();
if(value != null){
@@ -279,7 +290,7 @@ public class XmlStorageElement implements ICStorageElement {
}
}
}
-
+
private Text getTextChild(){
NodeList nodes = fElement.getChildNodes();
Text text = null;
@@ -293,16 +304,17 @@ public class XmlStorageElement implements ICStorageElement {
return text;
}
-
+
+ @Override
public ICStorageElement importChild(ICStorageElement el) throws UnsupportedOperationException {
return addChild(el, true, null, null);
}
- public ICStorageElement addChild(ICStorageElement el,
+ public ICStorageElement addChild(ICStorageElement el,
boolean alowReferencingParent,
String[] attributeFilters,
String[] childFilters) throws UnsupportedOperationException {
-
+
if(!isChildAlowed(el.getName()))
return null;
@@ -316,14 +328,14 @@ public class XmlStorageElement implements ICStorageElement {
} else {
xmlEl = (Element)xmlEl.cloneNode(true);
}
-
+
xmlEl = (Element)fElement.appendChild(xmlEl);
return createAddChild(xmlEl, alowReferencingParent, attributeFilters, childFilters);
} else {
throw new UnsupportedOperationException();
}
}
-
+
public String[] getAttributeFilters(){
if(fAttributeFilters != null)
return fAttributeFilters.clone();
@@ -339,20 +351,20 @@ public class XmlStorageElement implements ICStorageElement {
public boolean isParentRefAlowed(){
return fParentRefAlowed;
}
-
+
public boolean matches(ICStorageElement el){
if(!getName().equals(el.getName()))
return false;
-
+
if (!valuesMatch(getValue(), el.getValue()))
return false;
-
+
String[] attrs = getAttributeNames();
String[] otherAttrs = el.getAttributeNames();
if(attrs.length != otherAttrs.length)
return false;
-
+
if(attrs.length != 0){
Set set = new HashSet(Arrays.asList(attrs));
set.removeAll(Arrays.asList(otherAttrs));
@@ -365,21 +377,21 @@ public class XmlStorageElement implements ICStorageElement {
}
}
-
-
+
+
XmlStorageElement[] children = (XmlStorageElement[])getChildren();
ICStorageElement[] otherChildren = el.getChildren();
-
+
if(children.length != otherChildren.length)
return false;
-
+
if(children.length != 0){
for(int i = 0; i < children.length; i++){
if(!children[i].matches(otherChildren[i]))
return false;
}
}
-
+
return true;
}
@@ -393,6 +405,7 @@ public class XmlStorageElement implements ICStorageElement {
}
}
+ @Override
public String[] getAttributeNames() {
NamedNodeMap nodeMap = fElement.getAttributes();
int length = nodeMap.getLength();
@@ -409,6 +422,7 @@ public class XmlStorageElement implements ICStorageElement {
/**
* @since 5.1
*/
+ @Override
public ICStorageElement createCopy() throws UnsupportedOperationException, CoreException {
// todo Auto-generated method stub
return null;
@@ -417,6 +431,7 @@ public class XmlStorageElement implements ICStorageElement {
/**
* @since 5.1
*/
+ @Override
public boolean equals(ICStorageElement other) {
// todo Auto-generated method stub
return false;
@@ -425,6 +440,7 @@ public class XmlStorageElement implements ICStorageElement {
/**
* @since 5.1
*/
+ @Override
public ICStorageElement[] getChildrenByName(String name) {
// todo Auto-generated method stub
return null;
@@ -433,6 +449,7 @@ public class XmlStorageElement implements ICStorageElement {
/**
* @since 5.1
*/
+ @Override
public boolean hasAttribute(String name) {
// todo Auto-generated method stub
return false;
@@ -441,6 +458,7 @@ public class XmlStorageElement implements ICStorageElement {
/**
* @since 5.1
*/
+ @Override
public boolean hasChildren() {
// todo Auto-generated method stub
return false;
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ASTCache.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ASTCache.java
index 3068febd2e0..3738e9246db 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ASTCache.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ASTCache.java
@@ -3,8 +3,8 @@
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
+ *
+ * Contributors:
* Anton Leherbauer (Wind River Systems) - initial API and implementation
* Markus Schorn (Wind River Systems)
* Sergey Prigogin (Google)
@@ -29,7 +29,7 @@ import org.eclipse.core.runtime.Status;
/**
* Provides a shared AST of a single translation unit at a time.
- *
+ *
* @since 4.0
*/
public class ASTCache {
@@ -43,7 +43,7 @@ public class ASTCache {
public static int PARSE_MODE_FULL = ITranslationUnit.AST_CONFIGURE_USING_SOURCE_CONTEXT
| ITranslationUnit.AST_SKIP_TRIVIAL_EXPRESSIONS_IN_AGGREGATE_INITIALIZERS
| ITranslationUnit.AST_PARSE_INACTIVE_CODE;
-
+
/** Fast parse mode (use PDOM) */
public static int PARSE_MODE_FAST = ITranslationUnit.AST_SKIP_ALL_HEADERS
| ITranslationUnit.AST_CONFIGURE_USING_SOURCE_CONTEXT
@@ -52,28 +52,28 @@ public class ASTCache {
/**
* Do something with an AST.
- *
+ *
* @see #runOnAST(ILanguage, IASTTranslationUnit)
*/
public static interface ASTRunnable {
/**
* Do something with the given AST.
- *
+ *
* @param lang the language with which the AST has been created.
* @param ast the translation unit AST, may be null
* @return a status object
*/
IStatus runOnAST(ILanguage lang, IASTTranslationUnit ast) throws CoreException;
}
-
+
private final int fParseMode;
private final Object fCacheMutex= new Object();
-
+
/** The active translation unit for which to cache the AST */
private ITranslationUnit fActiveTU;
/** The cached AST if any */
private IASTTranslationUnit fAST;
- /**
+ /**
* The timestamp of the last index write access at the time
* the AST got cached. A cached AST becomes invalid on any index
* write access afterwards.
@@ -107,11 +107,11 @@ public class ASTCache {
IProgressMonitor progressMonitor) {
if (tUnit == null)
return null;
-
+
while (true) {
if (progressMonitor != null && progressMonitor.isCanceled())
return null;
-
+
final boolean isActiveElement;
synchronized (fCacheMutex) {
isActiveElement= tUnit.equals(fActiveTU);
@@ -132,7 +132,7 @@ public class ASTCache {
if (!wait) {
// no AST, no wait - we are done
if (DEBUG)
- System.out.println(DEBUG_PREFIX + getThreadName() + "returning null (WAIT_NO) for: " + tUnit.getElementName()); //$NON-NLS-1$
+ System.out.println(DEBUG_PREFIX + getThreadName() + "returning null (WAIT_NO) for: " + tUnit.getElementName()); //$NON-NLS-1$
return null;
}
}
@@ -141,12 +141,12 @@ public class ASTCache {
try {
// Wait for AST
if (DEBUG)
- System.out.println(DEBUG_PREFIX + getThreadName() + "waiting for AST for: " + tUnit.getElementName()); //$NON-NLS-1$
+ System.out.println(DEBUG_PREFIX + getThreadName() + "waiting for AST for: " + tUnit.getElementName()); //$NON-NLS-1$
fCacheMutex.wait();
// Check whether active element is still valid
if (fAST != null) {
if (DEBUG)
- System.out.println(DEBUG_PREFIX + getThreadName() + "...got AST for: " + tUnit.getElementName()); //$NON-NLS-1$
+ System.out.println(DEBUG_PREFIX + getThreadName() + "...got AST for: " + tUnit.getElementName()); //$NON-NLS-1$
return fAST;
}
// try again
@@ -158,20 +158,20 @@ public class ASTCache {
return null;
}
}
-
+
if (isActiveElement)
aboutToBeReconciled(tUnit);
-
+
if (DEBUG)
- System.err.println(DEBUG_PREFIX + getThreadName() + "creating AST for " + tUnit.getElementName()); //$NON-NLS-1$
-
+ System.err.println(DEBUG_PREFIX + getThreadName() + "creating AST for " + tUnit.getElementName()); //$NON-NLS-1$
+
IASTTranslationUnit ast= null;
try {
ast= createAST(tUnit, index, progressMonitor);
if (progressMonitor != null && progressMonitor.isCanceled())
ast= null;
else if (DEBUG && ast != null)
- System.err.println(DEBUG_PREFIX + getThreadName() + "created AST for: " + tUnit.getElementName()); //$NON-NLS-1$
+ System.err.println(DEBUG_PREFIX + getThreadName() + "created AST for: " + tUnit.getElementName()); //$NON-NLS-1$
} finally {
if (isActiveElement) {
if (fAST != null) {
@@ -191,7 +191,7 @@ public class ASTCache {
* Executes {@link ASTRunnable#runOnAST(ILanguage, IASTTranslationUnit)} with the AST
* provided by this cache for the given translation unit. Handles acquiring
* and releasing the index read-lock for the client.
- *
+ *
* @param tUnit
* the translation unit
* @param wait
@@ -212,7 +212,7 @@ public class ASTCache {
} catch (InterruptedException e) {
return Status.CANCEL_STATUS;
}
-
+
try {
IASTTranslationUnit ast= acquireSharedAST(tUnit, index, wait, monitor);
ILanguage lang= (tUnit instanceof TranslationUnit) ? ((TranslationUnit) tUnit).getLanguageOfContext() : tUnit.getLanguage();
@@ -286,12 +286,12 @@ public class ASTCache {
assert Thread.holdsLock(fCacheMutex);
if (fActiveTU != null && !fActiveTU.equals(tUnit)) {
if (DEBUG && tUnit != null) // don't report call from disposeAST()
- System.out.println(DEBUG_PREFIX + getThreadName() + "don't cache AST for inactive: " + toString(tUnit)); //$NON-NLS-1$
+ System.out.println(DEBUG_PREFIX + getThreadName() + "don't cache AST for inactive: " + toString(tUnit)); //$NON-NLS-1$
return;
}
if (DEBUG && (tUnit != null || ast != null)) // don't report call from disposeAST()
- System.out.println(DEBUG_PREFIX + getThreadName() + "caching AST: " + toString(ast) + " for: " + toString(tUnit)); //$NON-NLS-1$ //$NON-NLS-2$
+ System.out.println(DEBUG_PREFIX + getThreadName() + "caching AST: " + toString(ast) + " for: " + toString(tUnit)); //$NON-NLS-1$ //$NON-NLS-2$
if (fAST != null)
disposeAST();
@@ -310,10 +310,10 @@ public class ASTCache {
synchronized (fCacheMutex) {
if (fAST == null)
return;
-
+
if (DEBUG)
- System.out.println(DEBUG_PREFIX + getThreadName() + "disposing AST: " + toString(fAST) + " for: " + toString(fActiveTU)); //$NON-NLS-1$ //$NON-NLS-2$
-
+ System.out.println(DEBUG_PREFIX + getThreadName() + "disposing AST: " + toString(fAST) + " for: " + toString(fActiveTU)); //$NON-NLS-1$ //$NON-NLS-2$
+
fAST= null;
cache(null, null);
}
@@ -321,7 +321,7 @@ public class ASTCache {
/**
* Creates a new translation unit AST.
- *
+ *
* @param tUnit the translation unit for which to create the AST
* @param index the index for AST generation, needs to be read-locked.
* @param progressMonitor a progress monitor, may be null
@@ -331,9 +331,10 @@ public class ASTCache {
if (progressMonitor != null && progressMonitor.isCanceled())
return null;
- final IASTTranslationUnit root[]= new IASTTranslationUnit[1];
-
+ final IASTTranslationUnit root[]= new IASTTranslationUnit[1];
+
SafeRunner.run(new ISafeRunnable() {
+ @Override
public void run() throws CoreException {
try {
if (progressMonitor != null && progressMonitor.isCanceled()) {
@@ -345,18 +346,19 @@ public class ASTCache {
root[0]= null;
}
}
+ @Override
public void handleException(Throwable ex) {
IStatus status= new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, IStatus.OK, "Error in CDT Core during AST creation", ex); //$NON-NLS-1$
CCorePlugin.getDefault().getLog().log(status);
}
});
-
+
return root[0];
}
/**
* Set the given translation unit as active element to cache an AST for.
- *
+ *
* @param tUnit the translation unit
*/
public void setActiveElement(ITranslationUnit tUnit) {
@@ -369,12 +371,12 @@ public class ASTCache {
cache(null, tUnit);
}
if (DEBUG)
- System.out.println(DEBUG_PREFIX + getThreadName() + "active element is: " + toString(tUnit)); //$NON-NLS-1$
+ System.out.println(DEBUG_PREFIX + getThreadName() + "active element is: " + toString(tUnit)); //$NON-NLS-1$
}
/**
* Check whether the given translation unit is the active element of this cache.
- *
+ *
* @param tUnit the translation unit
* @return true
, if this cache manages the given translation unit
*/
@@ -385,7 +387,7 @@ public class ASTCache {
}
/**
- * Informs that reconciling (computation of the AST) for the given element
+ * Informs that reconciling (computation of the AST) for the given element
* is about to be started.
*
* @param tUnit the translation unit
@@ -393,15 +395,15 @@ public class ASTCache {
public void aboutToBeReconciled(ITranslationUnit tUnit) {
if (tUnit == null)
return;
-
+
synchronized (fCacheMutex) {
if (fActiveTU == null || !fActiveTU.equals(tUnit)) {
return;
}
-
+
if (DEBUG)
- System.out.println(DEBUG_PREFIX + getThreadName() + "about to reconcile: " + toString(tUnit)); //$NON-NLS-1$
-
+ System.out.println(DEBUG_PREFIX + getThreadName() + "about to reconcile: " + toString(tUnit)); //$NON-NLS-1$
+
fIsReconciling= true;
cache(null, tUnit);
}
@@ -409,7 +411,7 @@ public class ASTCache {
/**
* Informs that reconciling of the AST of the given translation unit has finished.
- *
+ *
* @param ast the translation unit AST
* @param tUnit the translation unit
*/
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Archive.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Archive.java
index 925412a4caa..70e4e0be82e 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Archive.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Archive.java
@@ -11,7 +11,7 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.model;
-
+
import java.util.Map;
import org.eclipse.cdt.core.IBinaryParser.IBinaryArchive;
@@ -42,6 +42,7 @@ public class Archive extends Openable implements IArchive {
binaryArchive = ar;
}
+ @Override
public IBinary[] getBinaries() throws CModelException {
ICElement[] e = getChildren();
IBinary[] b = new IBinary[e.length];
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ArchiveContainer.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ArchiveContainer.java
index 5186b5e36fc..34a6d54e3e8 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ArchiveContainer.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ArchiveContainer.java
@@ -11,7 +11,7 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.model;
-
+
import java.util.Map;
import org.eclipse.cdt.core.CCorePlugin;
@@ -30,6 +30,7 @@ public class ArchiveContainer extends Openable implements IArchiveContainer {
super (cProject, null, CCorePlugin.getResourceString("CoreModel.ArchiveContainer.Archives"), ICElement.C_VCONTAINER); //$NON-NLS-1$
}
+ @Override
public IArchive[] getArchives() throws CModelException {
((ArchiveContainerInfo)getElementInfo()).sync();
ICElement[] e = getChildren();
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/AsmLabel.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/AsmLabel.java
index 332118ce9a9..6a6027bd36a 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/AsmLabel.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/AsmLabel.java
@@ -26,7 +26,7 @@ public class AsmLabel extends SourceManipulation implements IAsmLabel, IParent {
/**
* Create a new assembly label.
- *
+ *
* @param parent the parent element (must be ITranslationUnit)
* @param name the name of the label
* @param global if true
, the label is declared global (visible to the linker)
@@ -41,6 +41,7 @@ public class AsmLabel extends SourceManipulation implements IAsmLabel, IParent {
/*
* @see org.eclipse.cdt.core.model.IAsmLabel#isGlobal()
*/
+ @Override
public final boolean isGlobal() {
return fIsGlobal;
}
@@ -55,7 +56,7 @@ public class AsmLabel extends SourceManipulation implements IAsmLabel, IParent {
}
return false;
}
-
+
public static boolean equals(AsmLabel lhs, AsmLabel rhs) {
if (CElement.equals(lhs, rhs)) {
return lhs.fIndex == rhs.fIndex && lhs.fIsGlobal == rhs.fIsGlobal;
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/AsmModelBuilder.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/AsmModelBuilder.java
index 10e783a7264..a9bf1726d20 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/AsmModelBuilder.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/AsmModelBuilder.java
@@ -22,14 +22,14 @@ import org.eclipse.cdt.core.parser.IToken;
import org.eclipse.cdt.core.parser.OffsetLimitReachedException;
import org.eclipse.cdt.internal.core.parser.scanner.ILexerLog;
import org.eclipse.cdt.internal.core.parser.scanner.Lexer;
-import org.eclipse.cdt.internal.core.parser.scanner.Token;
import org.eclipse.cdt.internal.core.parser.scanner.Lexer.LexerOptions;
+import org.eclipse.cdt.internal.core.parser.scanner.Token;
/**
* A simple model builder for assembly translation units.
* Recognizes preprocessor directives (#include and #define)
* and labels.
- *
+ *
* @see AssemblyLanguage
* @since 5.0
*/
@@ -41,8 +41,10 @@ public class AsmModelBuilder implements IContributedModelBuilder {
}
private static final class LexerLog implements ILexerLog {
+ @Override
public void handleComment(boolean isBlockComment, int offset, int endOffset) {
}
+ @Override
public void handleProblem(int problemID, char[] info, int offset, int endOffset) {
}
}
@@ -52,7 +54,7 @@ public class AsmModelBuilder implements IContributedModelBuilder {
}
private static final Map fgDirectives;
-
+
static {
fgDirectives= new HashMap();
fgDirectives.put("globl", AsmDirective.GLOBAL); //$NON-NLS-1$
@@ -63,12 +65,12 @@ public class AsmModelBuilder implements IContributedModelBuilder {
fgDirectives.put("long", AsmDirective.DATA); //$NON-NLS-1$
fgDirectives.put("word", AsmDirective.DATA); //$NON-NLS-1$
}
-
+
private TranslationUnit fTranslationUnit;
private char fLineSeparatorChar;
private Map fGlobals;
private Map fLabels;
-
+
private int fLastLabelEndOffset;
private AsmLabel fLastGlobalLabel;
private SourceManipulation fLastLabel;
@@ -76,7 +78,7 @@ public class AsmModelBuilder implements IContributedModelBuilder {
/**
* Creates a model builder for the given assembly translation unit.
- *
+ *
* @param tu the translation unit
*/
public AsmModelBuilder(ITranslationUnit tu) {
@@ -85,7 +87,7 @@ public class AsmModelBuilder implements IContributedModelBuilder {
/**
* Configure the line separator character (in addition to normal newlines).
- *
+ *
* @param lineSeparatorChar
*/
public void setLineSeparatorCharacter(char lineSeparatorChar) {
@@ -95,6 +97,7 @@ public class AsmModelBuilder implements IContributedModelBuilder {
/*
* @see org.eclipse.cdt.core.model.IContributedModelBuilder#parse(boolean)
*/
+ @Override
public void parse(boolean quickParseMode) throws Exception {
char[] source = fTranslationUnit.getContents();
if (source == null) {
@@ -111,7 +114,7 @@ public class AsmModelBuilder implements IContributedModelBuilder {
/**
* Build the model.
- *
+ *
* @param source
* @throws CModelException
*/
@@ -124,7 +127,7 @@ public class AsmModelBuilder implements IContributedModelBuilder {
final LexerOptions lexerOptions= new LexerOptions();
fLexer= new Lexer(source, lexerOptions, new LexerLog(), null);
-
+
// if true the next token is the first on a (logical) line
boolean firstTokenOnLine= true;
// next token can be an instruction or a label
@@ -207,7 +210,7 @@ public class AsmModelBuilder implements IContributedModelBuilder {
fixupLastGlobalLabel();
}
}
-
+
/**
* @return the next token from the scanner or null
on end-of-input.
*/
@@ -313,8 +316,8 @@ public class AsmModelBuilder implements IContributedModelBuilder {
/**
* Set the body position of the last global label.
- *
- * @throws CModelException
+ *
+ * @throws CModelException
*/
private void fixupLastGlobalLabel() throws CModelException {
if (fLastLabel != null && fLastLabel != fLastGlobalLabel) {
@@ -327,8 +330,8 @@ public class AsmModelBuilder implements IContributedModelBuilder {
/**
* Set the body position of the last label.
- *
- * @throws CModelException
+ *
+ * @throws CModelException
*/
private void fixupLastLabel() throws CModelException {
if (fLastLabelEndOffset > 0) {
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Binary.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Binary.java
index 5e13712ffc5..f918f7f0fb3 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Binary.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Binary.java
@@ -12,7 +12,7 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.model;
-
+
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
@@ -22,13 +22,13 @@ import java.util.Map;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.CCorePreferenceConstants;
-import org.eclipse.cdt.core.ISourceFinder;
-import org.eclipse.cdt.core.ISymbolReader;
import org.eclipse.cdt.core.IBinaryParser.IBinaryExecutable;
import org.eclipse.cdt.core.IBinaryParser.IBinaryFile;
import org.eclipse.cdt.core.IBinaryParser.IBinaryObject;
import org.eclipse.cdt.core.IBinaryParser.IBinaryShared;
import org.eclipse.cdt.core.IBinaryParser.ISymbol;
+import org.eclipse.cdt.core.ISourceFinder;
+import org.eclipse.cdt.core.ISymbolReader;
import org.eclipse.cdt.core.model.BinaryFilePresentation;
import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.CoreModel;
@@ -58,7 +58,7 @@ public class Binary extends Openable implements IBinary {
private long longBSS;
private String endian;
private String soname;
-
+
private long fLastModification;
private IBinaryObject binaryObject;
@@ -84,22 +84,27 @@ public class Binary extends Openable implements IBinary {
showInBinaryContainer= determineShowInBinaryContainer(bin);
}
+ @Override
public boolean isSharedLib() {
return getType() == IBinaryFile.SHARED;
}
+ @Override
public boolean isExecutable() {
return getType() == IBinaryFile.EXECUTABLE;
}
+ @Override
public boolean isObject() {
return getType() == IBinaryFile.OBJECT;
}
+ @Override
public boolean isCore() {
return getType() == IBinaryFile.CORE;
}
+ @Override
public boolean hasDebug() {
if (isObject() || isExecutable() || isSharedLib()) {
if (hasDebug == null || hasChanged()) {
@@ -112,6 +117,7 @@ public class Binary extends Openable implements IBinary {
return Boolean.valueOf(hasDebug).booleanValue();
}
+ @Override
public String getCPU() {
if (isObject() || isExecutable() || isSharedLib() || isCore()) {
if (cpu == null || hasChanged()) {
@@ -122,6 +128,7 @@ public class Binary extends Openable implements IBinary {
return (cpu == null ? "" : cpu); //$NON-NLS-1$
}
+ @Override
public String[] getNeededSharedLibs() {
if (isExecutable() || isSharedLib()) {
if (needed == null || hasChanged()) {
@@ -134,6 +141,7 @@ public class Binary extends Openable implements IBinary {
return (needed == null ? new String[0] : needed);
}
+ @Override
public long getText() {
if (isObject() || isExecutable() || isSharedLib()) {
if (longText == -1 || hasChanged()) {
@@ -146,6 +154,7 @@ public class Binary extends Openable implements IBinary {
return longText;
}
+ @Override
public long getData() {
if (isObject() || isExecutable() || isSharedLib()) {
if (longData == -1 || hasChanged()) {
@@ -158,6 +167,7 @@ public class Binary extends Openable implements IBinary {
return longData;
}
+ @Override
public long getBSS() {
if (isObject() || isExecutable() || isSharedLib()) {
if (longBSS == -1 || hasChanged()) {
@@ -170,6 +180,7 @@ public class Binary extends Openable implements IBinary {
return longBSS;
}
+ @Override
public String getSoname() {
if (isSharedLib()) {
if (soname == null || hasChanged()) {
@@ -182,6 +193,7 @@ public class Binary extends Openable implements IBinary {
return (soname == null ? "" : soname); //$NON-NLS-1$
}
+ @Override
public boolean isLittleEndian() {
if (isObject() || isExecutable() || isSharedLib() || isCore()) {
if (endian == null || hasChanged()) {
@@ -290,7 +302,7 @@ public class Binary extends Openable implements IBinary {
break;
}
}
- }
+ }
ok = true;
}
}
@@ -311,34 +323,34 @@ public class Binary extends Openable implements IBinary {
ISourceFinder srcFinder = (ISourceFinder) getAdapter(ISourceFinder.class);
try {
for (String filename : sourceFiles) {
-
+
// Find the file locally
if (srcFinder != null) {
String localPath = srcFinder.toLocalPath(filename);
if (localPath != null) {
- filename = localPath;
+ filename = localPath;
}
}
-
+
// Be careful how you use this File object. If filename is a relative path, the resulting File
// object will apply the relative path to the working directory, which is not what we want.
// Stay away from methods that return or use the absolute path of the object. Note that
// File.isAbsolute() returns false when the object was constructed with a relative path.
File file = new File(filename);
-
+
// Create a translation unit for this file and add it as a child of the binary
String id = CoreModel.getRegistedContentTypeId(getCProject().getProject(), file.getName());
if (id == null) {
// Don't add files we can't get an ID for.
continue;
}
-
+
// See if this source file is already in the project.
// We check this to determine if we should create a TranslationUnit or ExternalTranslationUnit
IFile wkspFile = null;
if (file.isAbsolute()) {
IFile[] filesInWP = ResourceLookup.findFilesForLocation(new Path(filename));
-
+
for (IFile element : filesInWP) {
if (element.isAccessible()) {
wkspFile = element;
@@ -346,7 +358,7 @@ public class Binary extends Openable implements IBinary {
}
}
}
-
+
TranslationUnit tu;
if (wkspFile != null)
tu = new TranslationUnit(this, wkspFile, id);
@@ -362,12 +374,12 @@ public class Binary extends Openable implements IBinary {
tu = new ExternalTranslationUnit(this, Path.fromOSString(filename), id);
}
else {
- tu = new ExternalTranslationUnit(this, URIUtil.toURI(filename, true), id);
+ tu = new ExternalTranslationUnit(this, URIUtil.toURI(filename, true), id);
}
}
-
+
if (! info.includesChild(tu))
- info.addChild(tu);
+ info.addChild(tu);
}
return true;
}
@@ -376,11 +388,11 @@ public class Binary extends Openable implements IBinary {
srcFinder.dispose();
}
}
-
+
}
return false;
}
-
+
private void addFunction(OpenableInfo info, ISymbol symbol, Map hash) throws CModelException {
IPath filename= symbol.getFilename();
BinaryFunction function = null;
@@ -431,7 +443,7 @@ public class Binary extends Openable implements IBinary {
variable.setLines(symbol.getStartLine(), symbol.getEndLine());
info.addChild(variable);
}
-
+
//if (variable != null) {
// if (!external) {
// variable.getVariableInfo().setAccessControl(IConstants.AccStatic);
@@ -441,7 +453,7 @@ public class Binary extends Openable implements IBinary {
/**
* @see org.eclipse.cdt.core.model.IOpenable#getBuffer()
- *
+ *
* overridden from default as we do not need to create our children to provider a buffer since the buffer just contains
* IBinaryOject contents which is not model specific.
*/
@@ -465,11 +477,11 @@ public class Binary extends Openable implements IBinary {
protected IBuffer openBuffer(IProgressMonitor pm) throws CModelException {
// create buffer - translation units only use default buffer factory
- BufferManager bufManager = getBufferManager();
+ BufferManager bufManager = getBufferManager();
IBuffer buffer = getBufferFactory().createBuffer(this);
- if (buffer == null)
+ if (buffer == null)
return null;
-
+
// set the buffer source
if (buffer.getCharacters() == null){
IBinaryObject bin = getBinaryObject();
@@ -496,13 +508,13 @@ public class Binary extends Openable implements IBinary {
// add buffer to buffer cache
bufManager.addBuffer(buffer);
-
+
// listen to buffer changes
buffer.addBufferChangedListener(this);
-
+
return buffer;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.model.Openable#hasBuffer()
*/
@@ -534,6 +546,7 @@ public class Binary extends Openable implements IBinary {
super.closing(info);
}
+ @Override
public boolean showInBinaryContainer() {
return showInBinaryContainer;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryContainer.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryContainer.java
index c6b70e48a1f..f1f548a59a7 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryContainer.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryContainer.java
@@ -11,7 +11,7 @@
*******************************************************************************/
package org.eclipse.cdt.internal.core.model;
-
+
import java.util.ArrayList;
import java.util.Map;
@@ -38,6 +38,7 @@ public class BinaryContainer extends Openable implements IBinaryContainer {
}
}
+ @Override
public IBinary[] getBinaries() throws CModelException {
sync();
ICElement[] e = getChildren();
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryElement.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryElement.java
index 199919dab4f..7d76c3118e1 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryElement.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryElement.java
@@ -50,6 +50,7 @@ public class BinaryElement extends CElement implements IBinaryElement, ISourceMa
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ISourceManipulation#copy(org.eclipse.cdt.core.model.ICElement, org.eclipse.cdt.core.model.ICElement, java.lang.String, boolean, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public void copy(ICElement container, ICElement sibling, String rename, boolean replace, IProgressMonitor monitor)
throws CModelException {
throw new CModelException(new CModelStatus(ICModelStatusConstants.READ_ONLY, this));
@@ -58,6 +59,7 @@ public class BinaryElement extends CElement implements IBinaryElement, ISourceMa
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ISourceManipulation#delete(boolean, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public void delete(boolean force, IProgressMonitor monitor) throws CModelException {
throw new CModelException(new CModelStatus(ICModelStatusConstants.READ_ONLY, this));
}
@@ -65,6 +67,7 @@ public class BinaryElement extends CElement implements IBinaryElement, ISourceMa
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ISourceManipulation#move(org.eclipse.cdt.core.model.ICElement, org.eclipse.cdt.core.model.ICElement, java.lang.String, boolean, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public void move(ICElement container, ICElement sibling, String rename, boolean replace, IProgressMonitor monitor)
throws CModelException {
throw new CModelException(new CModelStatus(ICModelStatusConstants.READ_ONLY, this));
@@ -73,6 +76,7 @@ public class BinaryElement extends CElement implements IBinaryElement, ISourceMa
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ISourceManipulation#rename(java.lang.String, boolean, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public void rename(String name, boolean replace, IProgressMonitor monitor) throws CModelException {
throw new CModelException(new CModelStatus(ICModelStatusConstants.READ_ONLY, this));
}
@@ -80,6 +84,7 @@ public class BinaryElement extends CElement implements IBinaryElement, ISourceMa
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ISourceReference#getSource()
*/
+ @Override
public String getSource() throws CModelException {
ITranslationUnit tu = getTranslationUnit();
if (tu != null) {
@@ -100,11 +105,12 @@ public class BinaryElement extends CElement implements IBinaryElement, ISourceMa
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ISourceReference#getSourceRange()
*/
+ @Override
public ISourceRange getSourceRange() throws CModelException {
return new SourceRange(getStartPos(),
getLength(),
getIdStartPos(),
- getIdLength(),
+ getIdLength(),
getStartLine(),
getEndLine());
}
@@ -112,6 +118,7 @@ public class BinaryElement extends CElement implements IBinaryElement, ISourceMa
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ISourceReference#getTranslationUnit()
*/
+ @Override
public ITranslationUnit getTranslationUnit() {
if (fSourceTU == null) {
ITranslationUnit tu = null;
@@ -171,6 +178,7 @@ public class BinaryElement extends CElement implements IBinaryElement, ISourceMa
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IBinaryElement#getAddress()
*/
+ @Override
public IAddress getAddress() throws CModelException {
return addr;
}
@@ -212,6 +220,7 @@ public class BinaryElement extends CElement implements IBinaryElement, ISourceMa
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IBinaryElement#getBinary()
*/
+ @Override
public IBinary getBinary() {
ICElement current = this;
do {
@@ -245,10 +254,12 @@ public class BinaryElement extends CElement implements IBinaryElement, ISourceMa
return 0;
}
+ @Override
public boolean isActive() {
return true;
}
+ @Override
public int getIndex() {
return 0;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryFunction.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryFunction.java
index a3ede9dd495..d9d33b98dac 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryFunction.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryFunction.java
@@ -26,6 +26,7 @@ public class BinaryFunction extends BinaryElement implements IBinaryFunction {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IFunctionDeclaration#getExceptions()
*/
+ @Override
public String[] getExceptions() {
return new String[0];
}
@@ -33,6 +34,7 @@ public class BinaryFunction extends BinaryElement implements IBinaryFunction {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IFunctionDeclaration#getNumberOfParameters()
*/
+ @Override
public int getNumberOfParameters() {
// TODO Auto-generated method stub
return 0;
@@ -41,6 +43,7 @@ public class BinaryFunction extends BinaryElement implements IBinaryFunction {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IFunctionDeclaration#getParameterInitializer(int)
*/
+ @Override
public String getParameterInitializer(int pos) {
// TODO Auto-generated method stub
return new String();
@@ -49,6 +52,7 @@ public class BinaryFunction extends BinaryElement implements IBinaryFunction {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IFunctionDeclaration#getParameterTypes()
*/
+ @Override
public String[] getParameterTypes() {
// TODO Auto-generated method stub
return new String[0];
@@ -57,6 +61,7 @@ public class BinaryFunction extends BinaryElement implements IBinaryFunction {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IFunctionDeclaration#getReturnType()
*/
+ @Override
public String getReturnType() {
// TODO Auto-generated method stub
return new String();
@@ -65,6 +70,7 @@ public class BinaryFunction extends BinaryElement implements IBinaryFunction {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IFunctionDeclaration#getSignature()
*/
+ @Override
public String getSignature() {
return getElementName();
}
@@ -72,6 +78,7 @@ public class BinaryFunction extends BinaryElement implements IBinaryFunction {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IDeclaration#isStatic()
*/
+ @Override
public boolean isStatic() {
// TODO Auto-generated method stub
return false;
@@ -80,6 +87,7 @@ public class BinaryFunction extends BinaryElement implements IBinaryFunction {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IDeclaration#isConst()
*/
+ @Override
public boolean isConst() {
// TODO Auto-generated method stub
return false;
@@ -88,6 +96,7 @@ public class BinaryFunction extends BinaryElement implements IBinaryFunction {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IDeclaration#isVolatile()
*/
+ @Override
public boolean isVolatile() {
// TODO Auto-generated method stub
return false;
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryModule.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryModule.java
index 6f41a5b97bd..8e6c45b64f0 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryModule.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryModule.java
@@ -41,6 +41,7 @@ public class BinaryModule extends Parent implements IBinaryModule {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IBinaryModule#getBinaryElements()
*/
+ @Override
public IBinaryElement[] getBinaryElements() throws CModelException {
ICElement[] e = getChildren();
IBinaryElement[] b = new IBinaryElement[e.length];
@@ -51,13 +52,15 @@ public class BinaryModule extends Parent implements IBinaryModule {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IBinaryElement#getAddress()
*/
+ @Override
public IAddress getAddress() throws CModelException {
- return null;
+ return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IBinaryElement#getBinary()
*/
+ @Override
public IBinary getBinary() {
return (IBinary)getParent();
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryRunner.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryRunner.java
index cba4fe9450b..cd4d11c62d0 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryRunner.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryRunner.java
@@ -80,9 +80,9 @@ public class BinaryRunner {
}
addDelta(cdelta);
}
-
+
}
-
+
private final ICProject cproject;
private final Job runnerJob; // final fields don't need synchronization
private IOutputEntry[] entries = new IOutputEntry[0];
@@ -182,6 +182,7 @@ public class BinaryRunner {
textContentType = mgr.getContentType("org.eclipse.core.runtime.text"); //$NON-NLS-1$
}
+ @Override
public boolean visit(IResourceProxy proxy) throws CoreException {
if (vMonitor.isCanceled()) {
return false;
@@ -189,13 +190,13 @@ public class BinaryRunner {
vMonitor.worked(1);
// Attempt to speed things up by rejecting up front
// Things we know should not be Binary files.
-
+
// check if it's a file resource
// and bail out early
if (proxy.getType() != IResource.FILE) {
return true;
}
-
+
// check against known content types
String name = proxy.getName();
IContentType contentType = CCorePlugin.getContentType(project, name);
@@ -228,7 +229,7 @@ public class BinaryRunner {
}
return true;
}
-
+
private boolean isOnOutputEntry(IOutputEntry entry, IPath path) {
if (entry.getPath().isPrefixOf(path) && !CoreModelUtil.isExcluded(path, entry.fullExclusionPatternChars())) {
return true;
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryVariable.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryVariable.java
index 79216fdd342..278a2b1d632 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryVariable.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryVariable.java
@@ -26,6 +26,7 @@ public class BinaryVariable extends BinaryElement implements IVariable {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IVariable#getInitializer()
*/
+ @Override
public String getInitializer() {
// TODO Auto-generated method stub
return ""; //$NON-NLS-1$
@@ -34,6 +35,7 @@ public class BinaryVariable extends BinaryElement implements IVariable {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IVariableDeclaration#getTypeName()
*/
+ @Override
public String getTypeName() {
// TODO Auto-generated method stub
return ""; //$NON-NLS-1$
@@ -42,6 +44,7 @@ public class BinaryVariable extends BinaryElement implements IVariable {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IVariableDeclaration#setTypeName(java.lang.String)
*/
+ @Override
public void setTypeName(String type) {
// TODO Auto-generated method stub
}
@@ -49,6 +52,7 @@ public class BinaryVariable extends BinaryElement implements IVariable {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IDeclaration#isStatic()
*/
+ @Override
public boolean isStatic() {
// TODO Auto-generated method stub
return false;
@@ -57,6 +61,7 @@ public class BinaryVariable extends BinaryElement implements IVariable {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IDeclaration#isConst()
*/
+ @Override
public boolean isConst() {
// TODO Auto-generated method stub
return false;
@@ -65,9 +70,10 @@ public class BinaryVariable extends BinaryElement implements IVariable {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IDeclaration#isVolatile()
*/
+ @Override
public boolean isVolatile() {
// TODO Auto-generated method stub
return false;
}
-
+
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Buffer.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Buffer.java
index 23b34a1f1c3..b43b23f9b0e 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Buffer.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Buffer.java
@@ -61,6 +61,7 @@ public class Buffer implements IBuffer {
/**
* @see IBuffer
*/
+ @Override
public void addBufferChangedListener(IBufferChangedListener listener) {
if (this.changeListeners == null) {
this.changeListeners = new ArrayList(5);
@@ -72,6 +73,7 @@ public class Buffer implements IBuffer {
/**
* @see org.eclipse.cdt.core.model.IBuffer#append(char[])
*/
+ @Override
public void append(char[] text) {
if (!isReadOnly()) {
if (text == null || text.length == 0) {
@@ -89,6 +91,7 @@ public class Buffer implements IBuffer {
/**
* @see org.eclipse.cdt.core.model.IBuffer#append(java.lang.String)
*/
+ @Override
public void append(String text) {
if (text == null) {
return;
@@ -99,6 +102,7 @@ public class Buffer implements IBuffer {
/**
* @see org.eclipse.cdt.core.model.IBuffer#close()
*/
+ @Override
public void close() {
BufferChangedEvent event = null;
synchronized (this.lock) {
@@ -115,6 +119,7 @@ public class Buffer implements IBuffer {
/**
* @see org.eclipse.cdt.core.model.IBuffer#getChar(int)
*/
+ @Override
public char getChar(int position) {
synchronized (this.lock) {
if (position < this.gapStart) {
@@ -128,6 +133,7 @@ public class Buffer implements IBuffer {
/**
* @see org.eclipse.cdt.core.model.IBuffer#getCharacters()
*/
+ @Override
public char[] getCharacters() {
if (this.contents == null) return null;
synchronized (this.lock) {
@@ -145,6 +151,7 @@ public class Buffer implements IBuffer {
/**
* @see org.eclipse.cdt.core.model.IBuffer#getContents()
*/
+ @Override
public String getContents() {
if (this.contents == null) return null;
return new String(this.getCharacters());
@@ -153,6 +160,7 @@ public class Buffer implements IBuffer {
/**
* @see org.eclipse.cdt.core.model.IBuffer#getLength()
*/
+ @Override
public int getLength() {
synchronized (this.lock) {
int length = this.gapEnd - this.gapStart;
@@ -163,6 +171,7 @@ public class Buffer implements IBuffer {
/**
* @see org.eclipse.cdt.core.model.IBuffer#getOwner()
*/
+ @Override
public IOpenable getOwner() {
return this.owner;
}
@@ -170,6 +179,7 @@ public class Buffer implements IBuffer {
/**
* @see org.eclipse.cdt.core.model.IBuffer#getText(int, int)
*/
+ @Override
public String getText(int offset, int length) {
if (this.contents == null)
return ""; //$NON-NLS-1$
@@ -190,6 +200,7 @@ public class Buffer implements IBuffer {
/**
* @see org.eclipse.cdt.core.model.IBuffer#getUnderlyingResource()
*/
+ @Override
public IResource getUnderlyingResource() {
return this.file;
}
@@ -197,6 +208,7 @@ public class Buffer implements IBuffer {
/**
* @see org.eclipse.cdt.core.model.IBuffer#hasUnsavedChanges()
*/
+ @Override
public boolean hasUnsavedChanges() {
return (this.flags & F_HAS_UNSAVED_CHANGES) != 0;
}
@@ -204,6 +216,7 @@ public class Buffer implements IBuffer {
/**
* @see org.eclipse.cdt.core.model.IBuffer#isClosed()
*/
+ @Override
public boolean isClosed() {
return (this.flags & F_IS_CLOSED) != 0;
}
@@ -211,6 +224,7 @@ public class Buffer implements IBuffer {
/**
* @see org.eclipse.cdt.core.model.IBuffer#isReadOnly()
*/
+ @Override
public boolean isReadOnly() {
if (this.file == null) {
return (this.flags & F_IS_READ_ONLY) != 0;
@@ -227,9 +241,11 @@ public class Buffer implements IBuffer {
for (int i = 0, size = this.changeListeners.size(); i < size; ++i) {
final IBufferChangedListener listener = this.changeListeners.get(i);
SafeRunner.run(new ISafeRunnable() {
+ @Override
public void handleException(Throwable exception) {
Util.log(exception, "Exception occurred in listener of buffer change notification", ICLogConstants.CDT); //$NON-NLS-1$
}
+ @Override
public void run() throws Exception {
listener.bufferChanged(event);
}
@@ -240,6 +256,7 @@ public class Buffer implements IBuffer {
/**
* @see IBuffer
*/
+ @Override
public void removeBufferChangedListener(IBufferChangedListener listener) {
if (this.changeListeners != null) {
this.changeListeners.remove(listener);
@@ -251,6 +268,7 @@ public class Buffer implements IBuffer {
/**
* @see org.eclipse.cdt.core.model.IBuffer#replace(int, int, char[])
*/
+ @Override
public void replace(int position, int length, char[] text) {
if (!isReadOnly()) {
int textLength = text == null ? 0 : text.length;
@@ -277,13 +295,14 @@ public class Buffer implements IBuffer {
if (textLength > 0) {
string = new String(text);
}
- notifyChanged(new BufferChangedEvent(this, position, length, string));
+ notifyChanged(new BufferChangedEvent(this, position, length, string));
}
}
/**
* @see org.eclipse.cdt.core.model.IBuffer#replace(int, int, java.lang.String)
*/
+ @Override
public void replace(int position, int length, String text) {
this.replace(position, length, text == null ? null : text.toCharArray());
}
@@ -291,16 +310,17 @@ public class Buffer implements IBuffer {
/**
* @see org.eclipse.cdt.core.model.IBuffer#save(org.eclipse.core.runtime.IProgressMonitor, boolean)
*/
+ @Override
public void save(IProgressMonitor progress, boolean force)
throws CModelException {
- // determine if saving is required
+ // determine if saving is required
if (isReadOnly() || this.file == null) {
return;
}
synchronized (this.lock) {
if (!hasUnsavedChanges())
return;
-
+
// use a platform operation to update the resource contents
try {
String encoding = null;
@@ -312,19 +332,19 @@ public class Buffer implements IBuffer {
}
String contents = this.getContents();
if (contents == null) return;
- byte[] bytes = encoding == null
- ? contents.getBytes()
+ byte[] bytes = encoding == null
+ ? contents.getBytes()
: contents.getBytes(encoding);
ByteArrayInputStream stream = new ByteArrayInputStream(bytes);
if (this.file.exists()) {
this.file.setContents(
- stream,
- force ? IResource.FORCE | IResource.KEEP_HISTORY : IResource.KEEP_HISTORY,
+ stream,
+ force ? IResource.FORCE | IResource.KEEP_HISTORY : IResource.KEEP_HISTORY,
null);
} else {
this.file.create(stream, force, null);
- }
+ }
} catch (IOException e) {
throw new CModelException(e, ICModelStatusConstants.IO_EXCEPTION);
}
@@ -340,15 +360,16 @@ public class Buffer implements IBuffer {
/**
* @see org.eclipse.cdt.core.model.IBuffer#setContents(char[])
*/
+ @Override
public void setContents(char[] newContents) {
- // allow special case for first initialization
+ // allow special case for first initialization
// after creation by buffer factory
if (this.contents == null) {
this.contents = newContents;
this.flags &= ~ (F_HAS_UNSAVED_CHANGES);
return;
}
-
+
if (!isReadOnly()) {
String string = null;
if (newContents != null) {
@@ -368,13 +389,14 @@ public class Buffer implements IBuffer {
/**
* @see org.eclipse.cdt.core.model.IBuffer#setContents(java.lang.String)
*/
+ @Override
public void setContents(String newContents) {
this.setContents(newContents.toCharArray());
}
-
+
/**
* Moves the gap to location and adjust its size to the
- * anticipated change size. The size represents the expected
+ * anticipated change size. The size represents the expected
* range of the gap that will be filled after the gap has been moved.
* Thus the gap is resized to actual size + the specified size and
* moved to the given position.
@@ -414,7 +436,7 @@ public class Buffer implements IBuffer {
this.gapStart = newGapStart;
this.gapEnd = newGapEnd;
}
-
+
/**
* Sets this Buffer
to be read only.
*/
@@ -425,7 +447,7 @@ public class Buffer implements IBuffer {
this.flags &= ~(F_IS_READ_ONLY);
}
}
-
+
@Override
public String toString() {
StringBuffer buffer = new StringBuffer();
@@ -442,7 +464,7 @@ public class Buffer implements IBuffer {
for (int i = 0; i < length; i++) {
char car = contents[i];
switch (car) {
- case '\n':
+ case '\n':
buffer.append("\\n\n"); //$NON-NLS-1$
break;
case '\r':
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BufferManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BufferManager.java
index 370c5c755ed..2a2c26ef5f8 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BufferManager.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BufferManager.java
@@ -22,7 +22,7 @@ import org.eclipse.core.resources.IResource;
/**
* The buffer manager manages the set of open buffers.
* It implements an LRU cache of buffers.
- *
+ *
* This class is similar to the JDT BufferManager class
*/
@@ -92,17 +92,18 @@ public class BufferManager implements IBufferFactory {
/**
* @see org.eclipse.cdt.internal.core.model.IBufferFactory#createBuffer(org.eclipse.cdt.core.model.IOpenable)
*/
+ @Override
public IBuffer createBuffer(IOpenable owner) {
ICElement element = (ICElement)owner;
IResource resource = element.getResource();
- return
+ return
new Buffer(
- resource instanceof IFile ? (IFile)resource : null,
- owner,
+ resource instanceof IFile ? (IFile)resource : null,
+ owner,
element.isReadOnly());
}
-
+
/**
* Returns the open buffer associated with the given owner,
* or null
if the owner does not have an open
@@ -128,7 +129,7 @@ public class BufferManager implements IBufferFactory {
}
/**
* Returns an enumeration of all open buffers.
- *
+ *
* The Enumeration
answered is thread safe.
*
* @see OverflowingLRUCache
@@ -140,8 +141,8 @@ public class BufferManager implements IBufferFactory {
return openBuffers.elements();
}
}
-
-
+
+
/**
* Removes a buffer from the table of open buffers.
*/
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CContainer.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CContainer.java
index 93354258423..dfcb3193f4c 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CContainer.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CContainer.java
@@ -50,9 +50,10 @@ public class CContainer extends Openable implements ICContainer {
/**
* Returns a the collection of binary files in this ccontainer
- *
+ *
* @see ICContainer#getBinaries()
*/
+ @Override
public IBinary[] getBinaries() throws CModelException {
List> list = getChildrenOfType(C_BINARY);
IBinary[] array = new IBinary[list.size()];
@@ -63,6 +64,7 @@ public class CContainer extends Openable implements ICContainer {
/**
* @see ICContainer#getBinary(String)
*/
+ @Override
public IBinary getBinary(String name) {
IFile file = getContainer().getFile(new Path(name));
return getBinary(file);
@@ -78,9 +80,10 @@ public class CContainer extends Openable implements ICContainer {
/**
* Returns a the collection of archive files in this ccontainer
- *
+ *
* @see ICContainer#getArchives()
*/
+ @Override
public IArchive[] getArchives() throws CModelException {
List> list = getChildrenOfType(C_ARCHIVE);
IArchive[] array = new IArchive[list.size()];
@@ -91,6 +94,7 @@ public class CContainer extends Openable implements ICContainer {
/**
* @see ICContainer#getArchive(String)
*/
+ @Override
public IArchive getArchive(String name) {
IFile file = getContainer().getFile(new Path(name));
return getArchive(file);
@@ -107,6 +111,7 @@ public class CContainer extends Openable implements ICContainer {
/**
* @see ICContainer#getTranslationUnits()
*/
+ @Override
public ITranslationUnit[] getTranslationUnits() throws CModelException {
List> list = getChildrenOfType(C_UNIT);
ITranslationUnit[] array = new ITranslationUnit[list.size()];
@@ -116,9 +121,10 @@ public class CContainer extends Openable implements ICContainer {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.model.ICContainer#getTranslationUnit(java.lang.String)
*/
+ @Override
public ITranslationUnit getTranslationUnit(String name) {
IFile file = getContainer().getFile(new Path(name));
return getTranslationUnit(file);
@@ -131,9 +137,10 @@ public class CContainer extends Openable implements ICContainer {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.model.ICContainer#getCContainers()
*/
+ @Override
public ICContainer[] getCContainers() throws CModelException {
List> list = getChildrenOfType(C_CCONTAINER);
ICContainer[] array = new ICContainer[list.size()];
@@ -143,9 +150,10 @@ public class CContainer extends Openable implements ICContainer {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.model.ICContainer#getCContainer(java.lang.String)
*/
+ @Override
public ICContainer getCContainer(String name) {
IFolder folder = getContainer().getFolder(new Path(name));
return getCContainer(folder);
@@ -195,9 +203,10 @@ public class CContainer extends Openable implements ICContainer {
/*
* (non-Javadoc) Returns an array of non-c resources contained in the
* receiver.
- *
+ *
* @see org.eclipse.cdt.core.model.ICContainer#getNonCResources()
*/
+ @Override
public Object[] getNonCResources() throws CModelException {
return ((CContainerInfo) getElementInfo()).getNonCResources(getResource());
}
@@ -273,7 +282,7 @@ public class CContainer extends Openable implements ICContainer {
}
return celement;
}
-
+
@Override
public ICElement getHandleFromMemento(String token, MementoTokenizer memento) {
switch (token.charAt(0)) {
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElement.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElement.java
index 2624bc16bfc..7a1f3f31d24 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElement.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElement.java
@@ -41,7 +41,7 @@ import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.PlatformObject;
public abstract class CElement extends PlatformObject implements ICElement {
-
+
public static final char CEM_ESCAPE = '\\';
public static final char CEM_CPROJECT = '=';
public static final char CEM_SOURCEROOT = '/';
@@ -53,7 +53,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
protected static final CElement[] NO_ELEMENTS = new CElement[0];
protected int fType;
-
+
protected ICElement fParent;
protected String fName;
@@ -63,7 +63,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
fName= name;
fType= type;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
*/
@@ -79,8 +79,8 @@ public abstract class CElement extends PlatformObject implements ICElement {
}
return super.getAdapter(adapter);
}
-
-
+
+
// setters
public void setElementType (int type) {
@@ -90,44 +90,50 @@ public abstract class CElement extends PlatformObject implements ICElement {
public void setElementName(String name) {
fName = name;
}
-
+
public void setParent (ICElement parent) {
fParent = parent;
}
-
+
// getters
-
+
+ @Override
public int getElementType() {
return fType;
- }
+ }
+ @Override
public String getElementName() {
return fName;
}
-
+
+ @Override
public ICElement getParent() {
return fParent;
}
+ @Override
public IPath getPath() {
IResource res = getUnderlyingResource();
if (res != null)
return res.getFullPath();
return new Path(getElementName());
}
-
+
+ @Override
public URI getLocationURI() {
IResource res = getUnderlyingResource();
-
+
if(res != null) {
return res.getLocationURI();
}
-
+
else {
return null;
}
}
+ @Override
public boolean exists() {
try {
return getElementInfo() != null;
@@ -201,7 +207,8 @@ public abstract class CElement extends PlatformObject implements ICElement {
}
return new ICElement[]{this};
}
-
+
+ @Override
public boolean isReadOnly () {
IResource r = getUnderlyingResource();
if (r != null) {
@@ -209,14 +216,16 @@ public abstract class CElement extends PlatformObject implements ICElement {
if (attributes != null) {
return attributes.isReadOnly();
}
- }
+ }
return false;
}
+ @Override
public boolean isStructureKnown() throws CModelException {
return getElementInfo().isStructureKnown();
}
+ @Override
public ICModel getCModel () {
ICElement current = this;
do {
@@ -225,6 +234,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
return null;
}
+ @Override
public ICProject getCProject() {
ICElement current = this;
do {
@@ -236,6 +246,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
protected void addChild(ICElement e) throws CModelException {
}
+ @Override
public IResource getUnderlyingResource() {
IResource res = getResource();
if (res == null) {
@@ -247,6 +258,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
return res;
}
+ @Override
public abstract IResource getResource() ;
protected abstract CElementInfo createElementInfo();
@@ -263,7 +275,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
}
return false;
}
-
+
public static boolean equals(ICElement lhs, ICElement rhs) {
if (lhs == rhs) {
return true;
@@ -277,19 +289,19 @@ public abstract class CElement extends PlatformObject implements ICElement {
!lhsName.equals(rhsName)) {
return false;
}
-
+
if (lhs instanceof ISourceReference && rhs instanceof ISourceReference) {
if (((ISourceReference) lhs).getIndex() != ((ISourceReference) rhs).getIndex()) {
return false;
}
}
-
+
ICElement lhsParent= lhs.getParent();
ICElement rhsParent= rhs.getParent();
if (lhsParent == rhsParent) {
return true;
}
-
+
return lhsParent != null && lhsParent.equals(rhsParent);
}
@@ -370,7 +382,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
return "UNKNOWN"; //$NON-NLS-1$
}
}
-
+
/**
* Close the C Element
* @throws CModelException
@@ -398,7 +410,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
*
Subclasses that are not IOpenable's must override this method.
*/
public IOpenable getOpenableParent() {
- if (fParent instanceof IOpenable) {
+ if (fParent instanceof IOpenable) {
return (IOpenable)fParent;
}
return null;
@@ -455,6 +467,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
/**
* @see ICElement
*/
+ @Override
public ICElement getAncestor(int ancestorType) {
ICElement element = this;
while (element != null) {
@@ -477,14 +490,14 @@ public abstract class CElement extends PlatformObject implements ICElement {
}
return parent != null;
}
-
+
/**
* Creates and returns and not present exception for this element.
*/
protected CModelException newNotPresentException() {
return new CModelException(new CModelStatus(ICModelStatusConstants.ELEMENT_DOES_NOT_EXIST, this));
}
-
+
/**
* Returns the hash code for this Java element. By default,
* the hash code for an element is a combination of its name
@@ -497,7 +510,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
public int hashCode() {
return hashCode(this);
}
-
+
public static int hashCode(ICElement elem) {
ICElement parent= elem.getParent();
if (parent == null) {
@@ -505,7 +518,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
}
return Util.combineHashCodes(elem.getElementName().hashCode(), parent.hashCode());
}
-
+
/*
* Test to see if two objects are identical
* Subclasses should override accordingly
@@ -513,10 +526,11 @@ public abstract class CElement extends PlatformObject implements ICElement {
public boolean isIdentical(CElement otherElement){
return this.equals(otherElement);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ICElement#accept(org.eclipse.cdt.core.model.ICElementVisitor)
*/
+ @Override
public void accept(ICElementVisitor visitor) throws CoreException {
// Visit me, return right away if the visitor doesn't want to visit my children
if (!visitor.visit(this))
@@ -533,13 +547,14 @@ public abstract class CElement extends PlatformObject implements ICElement {
/*
* @see org.eclipse.cdt.core.model.ICElement#getHandleIdentifier()
*/
+ @Override
public String getHandleIdentifier() {
return getHandleMemento();
}
/**
* Builds a string representation of this element.
- *
+ *
* @return the string representation
*/
public String getHandleMemento(){
@@ -550,7 +565,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
/**
* Append this elements memento string to the given buffer.
- *
+ *
* @param buff the buffer building the memento string
*/
public void getHandleMemento(StringBuilder buff) {
@@ -567,7 +582,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
/**
* Creates a C element handle from the given memento.
- *
+ *
* @param memento the memento tokenizer
*/
public ICElement getHandleFromMemento(MementoTokenizer memento) {
@@ -579,7 +594,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
/**
* Creates a C element handle from the given memento.
* The given token is the current delimiter indicating the type of the next token(s).
- *
+ *
* @param token the curren memento token
* @param memento the memento tokenizer
*/
@@ -587,7 +602,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
/**
* Escape special characters in the given name and append the result to buffer.
- *
+ *
* @param buffer the buffer to build the memento string
* @param mementoName the name to escape
*/
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementDelta.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementDelta.java
index abc9162b7f5..7106893b5c5 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementDelta.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CElementDelta.java
@@ -103,12 +103,12 @@ public class CElementDelta implements ICElementDelta {
fChangeFlags |= F_CHILDREN;
}
- // if a child delta is added to a translation unit delta or below,
+ // if a child delta is added to a translation unit delta or below,
// it's a fine grained delta
if (!(fChangedElement.getElementType() >= ICElement.C_UNIT)) {
fineGrained();
}
-
+
if (fAffectedChildren.length == 0) {
fAffectedChildren = new ICElementDelta[] {child};
return;
@@ -189,7 +189,7 @@ public class CElementDelta implements ICElementDelta {
return;
}
break;
- default:
+ default:
// unknown -> existing child becomes the child with the existing child's flags
int flags = existingChild.getFlags();
fAffectedChildren[existingChildIndex] = child;
@@ -201,7 +201,7 @@ public class CElementDelta implements ICElementDelta {
/**
* Creates the nested deltas resulting from an add operation.
* Convenience method for creating add deltas.
- * The constructor should be used to create the root delta
+ * The constructor should be used to create the root delta
* and then an add operation should call this method.
*/
public void added(ICElement element) {
@@ -242,7 +242,7 @@ public class CElementDelta implements ICElementDelta {
/**
* Creates the nested deltas resulting from a change operation.
* Convenience method for creating change deltas.
- * The constructor should be used to create the root delta
+ * The constructor should be used to create the root delta
* and then a change operation should call this method.
*/
public void changed(ICElement element, int changeFlag) {
@@ -329,6 +329,7 @@ public class CElementDelta implements ICElementDelta {
/**
* @see ICElementDelta
*/
+ @Override
public ICElementDelta[] getAddedChildren() {
return getChildrenOfType(ADDED);
}
@@ -336,6 +337,7 @@ public class CElementDelta implements ICElementDelta {
/**
* @see ICElementDelta
*/
+ @Override
public ICElementDelta[] getAffectedChildren() {
return fAffectedChildren;
}
@@ -366,6 +368,7 @@ public class CElementDelta implements ICElementDelta {
/**
* @see ICElementDelta
*/
+ @Override
public ICElementDelta[] getChangedChildren() {
return getChildrenOfType(CHANGED);
}
@@ -415,6 +418,7 @@ public class CElementDelta implements ICElementDelta {
/**
* @see ICElementDelta
*/
+ @Override
public ICElement getElement() {
return fChangedElement;
}
@@ -422,6 +426,7 @@ public class CElementDelta implements ICElementDelta {
/**
* @see ICElementDelta
*/
+ @Override
public int getFlags() {
return fChangeFlags;
}
@@ -429,6 +434,7 @@ public class CElementDelta implements ICElementDelta {
/**
* @see ICElementDelta
*/
+ @Override
public int getKind() {
return fKind;
}
@@ -436,6 +442,7 @@ public class CElementDelta implements ICElementDelta {
/**
* @see ICElementDelta
*/
+ @Override
public ICElement getMovedFromElement() {
return fMovedFromHandle;
}
@@ -443,6 +450,7 @@ public class CElementDelta implements ICElementDelta {
/**
* @see ICElementDelta
*/
+ @Override
public ICElement getMovedToElement() {
return fMovedToHandle;
}
@@ -450,6 +458,7 @@ public class CElementDelta implements ICElementDelta {
/**
* @see ICElementDelta
*/
+ @Override
public ICElementDelta[] getRemovedChildren() {
return getChildrenOfType(REMOVED);
}
@@ -457,6 +466,7 @@ public class CElementDelta implements ICElementDelta {
/**
* Return the collection of resource deltas. Return null if none.
*/
+ @Override
public IResourceDelta[] getResourceDeltas() {
if (resourceDeltas == null)
return null;
@@ -493,7 +503,7 @@ public class CElementDelta implements ICElementDelta {
/**
* Creates the nested deltas resulting from an move operation.
* Convenience method for creating the "move from" delta.
- * The constructor should be used to create the root delta
+ * The constructor should be used to create the root delta
* and then the move operation should call this method.
*/
public void movedFrom(ICElement movedFromElement, ICElement movedToElement) {
@@ -507,7 +517,7 @@ public class CElementDelta implements ICElementDelta {
/**
* Creates the nested deltas resulting from an move operation.
* Convenience method for creating the "move to" delta.
- * The constructor should be used to create the root delta
+ * The constructor should be used to create the root delta
* and then the move operation should call this method.
*/
public void movedTo(ICElement movedToElement, ICElement movedFromElement) {
@@ -563,7 +573,7 @@ public class CElementDelta implements ICElementDelta {
/**
* Creates the nested deltas resulting from an delete operation.
* Convenience method for creating removed deltas.
- * The constructor should be used to create the root delta
+ * The constructor should be used to create the root delta
* and then the delete operation should call this method.
*/
public void removed(ICElement element) {
@@ -580,7 +590,7 @@ public class CElementDelta implements ICElementDelta {
/**
* Creates the nested deltas resulting from a change operation.
* Convenience method for creating change deltas.
- * The constructor should be used to create the root delta
+ * The constructor should be used to create the root delta
* and then a change operation should call this method.
*/
public void binaryParserChanged(ICElement element) {
@@ -593,7 +603,7 @@ public class CElementDelta implements ICElementDelta {
/**
* Creates the nested deltas resulting from a change operation.
* Convenience method for creating change deltas.
- * The constructor should be used to create the root delta
+ * The constructor should be used to create the root delta
* and then a change operation should call this method.
*/
public void sourceAttached(ICElement element) {
@@ -606,7 +616,7 @@ public class CElementDelta implements ICElementDelta {
/**
* Creates the nested deltas resulting from a change operation.
* Convenience method for creating change deltas.
- * The constructor should be used to create the root delta
+ * The constructor should be used to create the root delta
* and then a change operation should call this method.
*/
public void sourceDetached(ICElement element) {
@@ -616,7 +626,7 @@ public class CElementDelta implements ICElementDelta {
insertDeltaTree(element, detachedDelta);
}
- /**
+ /**
* Returns a string representation of this delta's
* structure suitable for debug purposes.
*
@@ -761,7 +771,7 @@ public class CElementDelta implements ICElementDelta {
return buffer.toString();
}
- /**
+ /**
* Returns a string representation of this delta's
* structure suitable for debug purposes.
*/
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModel.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModel.java
index 1ea7dceea65..9460c2b47b2 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModel.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModel.java
@@ -10,7 +10,7 @@
* Anton Leherbauer (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.internal.core.model;
-
+
import java.util.List;
import java.util.Map;
@@ -48,6 +48,7 @@ public class CModel extends Openable implements ICModel {
return super.equals(o);
}
+ @Override
public ICProject[] getCProjects() throws CModelException {
List> list = getChildrenOfType(C_PROJECT);
ICProject[] array= new ICProject[list.size()];
@@ -58,9 +59,10 @@ public class CModel extends Openable implements ICModel {
/**
* ICModel#getCProject(String)
*/
+ @Override
public ICProject getCProject(String name) {
- IProject project = ((IWorkspaceRoot) getResource()).getProject(name);
- return CModelManager.getDefault().create(project);
+ IProject project = ((IWorkspaceRoot) getResource()).getProject(name);
+ return CModelManager.getDefault().create(project);
}
/**
@@ -101,11 +103,13 @@ public class CModel extends Openable implements ICModel {
}
return null;
}
-
+
+ @Override
public IWorkspace getWorkspace() {
return getUnderlyingResource().getWorkspace();
}
+ @Override
public void copy(ICElement[] elements, ICElement[] containers, ICElement[] siblings,
String[] renamings, boolean replace, IProgressMonitor monitor) throws CModelException {
if (elements != null && elements[0] != null && elements[0].getElementType() <= ICElement.C_UNIT ) {
@@ -117,6 +121,7 @@ public class CModel extends Openable implements ICModel {
}
}
+ @Override
public void delete(ICElement[] elements, boolean force, IProgressMonitor monitor)
throws CModelException {
CModelOperation op;
@@ -128,6 +133,7 @@ public class CModel extends Openable implements ICModel {
op.runOperation(monitor);
}
+ @Override
public void move(ICElement[] elements, ICElement[] containers, ICElement[] siblings,
String[] renamings, boolean replace, IProgressMonitor monitor) throws CModelException {
if (elements != null && elements[0] != null && elements[0].getElementType() <= ICElement.C_UNIT) {
@@ -139,6 +145,7 @@ public class CModel extends Openable implements ICModel {
}
}
+ @Override
public void rename(ICElement[] elements, ICElement[] destinations, String[] renamings,
boolean force, IProgressMonitor monitor) throws CModelException {
CModelOperation op;
@@ -210,6 +217,7 @@ public class CModel extends Openable implements ICModel {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ICModel#getNonCResources()
*/
+ @Override
public Object[] getNonCResources() throws CModelException {
return ((CModelInfo) getElementInfo()).getNonCResources();
}
@@ -241,12 +249,12 @@ public class CModel extends Openable implements ICModel {
}
return null;
}
-
+
@Override
public void getHandleMemento(StringBuilder buff) {
buff.append(getElementName());
}
-
+
@Override
protected char getHandleMementoDelimiter() {
Assert.isTrue(false, "Should not be called"); //$NON-NLS-1$
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java
index b5a07055e55..8b3966eb81b 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelBuilder2.java
@@ -104,7 +104,7 @@ public class CModelBuilder2 implements IContributedModelBuilder {
/**
* Create a model builder for the given translation unit.
- *
+ *
* @param tu the translation unit (must be a {@link TranslationUnit}
* @param newElements element cache
* @param monitor the progress monitor
@@ -118,10 +118,11 @@ public class CModelBuilder2 implements IContributedModelBuilder {
/*
* @see org.eclipse.cdt.core.model.IContributedModelBuilder#parse(boolean)
*/
+ @Override
public void parse(boolean quickParseMode) throws Exception {
final IIndexManager indexManager= CCorePlugin.getIndexManager();
IIndex index= indexManager.getIndex(fTranslationUnit.getCProject(), IIndexManager.ADD_DEPENDENCIES);
-
+
try {
if (index != null) {
try {
@@ -229,6 +230,7 @@ public class CModelBuilder2 implements IContributedModelBuilder {
// sort by offset
final List children= getElementInfo(fTranslationUnit).internalGetChildren();
Collections.sort(children, new Comparator() {
+ @Override
public int compare(ICElement o1, ICElement o2) {
final SourceManipulationInfo info1= getSourceManipulationInfo((SourceManipulation) o1);
final SourceManipulationInfo info2= getSourceManipulationInfo((SourceManipulation) o2);
@@ -589,7 +591,7 @@ public class CModelBuilder2 implements IContributedModelBuilder {
final Enumeration element= new Enumeration (parent, enumName);
setIndex(element);
element.setActive(enumSpecifier.isActive());
-
+
// add to parent
parent.addChild(element);
EnumerationInfo info= (EnumerationInfo) getElementInfo(element);
@@ -600,7 +602,7 @@ public class CModelBuilder2 implements IContributedModelBuilder {
final IASTFileLocation enumLocation= enumSpecifier.getFileLocation();
info.setIdPos(enumLocation.getNodeOffset(), type.length());
}
- // add enumerators
+ // add enumerators
final IASTEnumerator[] enumerators= enumSpecifier.getEnumerators();
for (final IASTEnumerator enumerator : enumerators) {
createEnumerator(element, enumerator);
@@ -967,7 +969,7 @@ public class CModelBuilder2 implements IContributedModelBuilder {
element.setParameterTypes(parameterTypes);
element.setReturnType(returnType);
setIndex(element);
-
+
info= (FunctionInfo) getElementInfo(element);
info.setConst(cppFunctionDeclarator.isConst());
}
@@ -978,7 +980,7 @@ public class CModelBuilder2 implements IContributedModelBuilder {
element.setParameterTypes(parameterTypes);
element.setReturnType(returnType);
setIndex(element);
-
+
info= (FunctionInfo) getElementInfo(element);
}
element.setActive(functionDeclaration.isActive());
@@ -1053,7 +1055,7 @@ public class CModelBuilder2 implements IContributedModelBuilder {
element.setParameterTypes(parameterTypes);
element.setReturnType(returnType);
setIndex(element);
-
+
info= (FunctionInfo)getElementInfo(element);
info.setConst(cppFunctionDeclarator.isConst());
}
@@ -1073,7 +1075,7 @@ public class CModelBuilder2 implements IContributedModelBuilder {
return null;
}
element.setActive(declarator.isActive());
-
+
// TODO [cmodel] correctly resolve isStatic
info.setStatic(declSpecifier.getStorageClass() == IASTDeclSpecifier.sc_static);
@@ -1281,7 +1283,7 @@ public class CModelBuilder2 implements IContributedModelBuilder {
/**
* Determine the scope for given name.
- *
+ *
* @param astName
* @return the scope or null
*/
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java
index 4dd7d8d4c96..6cb6cd4ac45 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelManager.java
@@ -230,7 +230,7 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
}
if (res != null && !res.exists()) {
res = null;
- }
+ }
}
// In case this is an external resource see if we can find
@@ -343,7 +343,7 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
break;
}
}
-
+
// check for binary on output entry
if (celement == null && cproject.isOnOutputEntry(file)) {
IBinaryFile bin = createBinaryFile(file);
@@ -371,12 +371,12 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
if (cproject.isOnOutputEntry(file)) {
IPath resourcePath = file.getParent().getFullPath();
ICElement cfolder = cproject.findElement(resourcePath);
-
+
// Check if folder is a source root and use that instead
ISourceRoot sourceRoot = cproject.findSourceRoot(resourcePath);
if (sourceRoot != null)
cfolder = sourceRoot;
-
+
if (bin.getType() == IBinaryFile.ARCHIVE) {
ArchiveContainer vlib = (ArchiveContainer)cproject.getArchiveContainer();
celement = new Archive(cfolder, file, (IBinaryArchive)bin);
@@ -405,7 +405,7 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
if (!Util.isNonZeroLengthFile(path)) {
return null;
}
-
+
try {
IIncludeReference[] includeReferences = cproject.getIncludeReferences();
for (IIncludeReference includeReference : includeReferences) {
@@ -414,7 +414,7 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
if (headerContentTypeId == null) {
headerContentTypeId= CoreModel.hasCCNature(project) ? CCorePlugin.CONTENT_TYPE_CXXHEADER : CCorePlugin.CONTENT_TYPE_CHEADER;
}
-
+
// TODO: use URI
return new ExternalTranslationUnit(includeReference, URIUtil.toURI(path), headerContentTypeId);
}
@@ -439,7 +439,7 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
if (headerContentTypeId == null) {
headerContentTypeId= CoreModel.hasCCNature(project) ? CCorePlugin.CONTENT_TYPE_CXXHEADER : CCorePlugin.CONTENT_TYPE_CHEADER;
}
-
+
// TODO: use URI
return new ExternalTranslationUnit(includeReference, URIUtil.toURI(includePath), headerContentTypeId);
}
@@ -449,10 +449,10 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
}
return null;
}
-
+
/**
* Creates a translation unit in the given project for the given location.
- *
+ *
* @param cproject
* @param locationURI
* @return ITranslationUnit
@@ -465,9 +465,9 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
if(!locationURI.isAbsolute()) {
throw new IllegalArgumentException();
}
-
+
final IProject project= cproject.getProject();
-
+
IFileStore fileStore = null;
try {
fileStore = EFS.getStore(locationURI);
@@ -475,12 +475,12 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
CCorePlugin.log(e1);
return null;
}
-
+
final String contentTypeId = CoreModel.getRegistedContentTypeId(project, fileStore.getName());
if (!Util.isNonZeroLengthFile(locationURI)) {
return null;
}
-
+
try {
IIncludeReference[] includeReferences = cproject.getIncludeReferences();
for (IIncludeReference includeReference : includeReferences) {
@@ -492,7 +492,7 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
if (headerContentTypeId == null) {
headerContentTypeId= CoreModel.hasCCNature(project) ? CCorePlugin.CONTENT_TYPE_CXXHEADER : CCorePlugin.CONTENT_TYPE_CHEADER;
}
-
+
return new ExternalTranslationUnit(includeReference, locationURI, headerContentTypeId);
}
}
@@ -502,11 +502,11 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
// if the file exists and it has a known C/C++ file extension then just create
// an external translation unit for it.
IFileInfo info = fileStore.fetchInfo();
-
+
if (contentTypeId != null && info != null && info.exists()) {
return new ExternalTranslationUnit(cproject, locationURI, contentTypeId);
}
-
+
return null;
}
@@ -632,7 +632,7 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
if (parsers.length == 0) {
return null;
}
-
+
// Only if file has no extension, has an extension that is an integer
// or is a binary file content type
String ext = file.getFileExtension();
@@ -650,7 +650,7 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
baseFileName = baseFileName.removeFileExtension();
ext = baseFileName.getFileExtension();
} while (ext != null && ext.length() > 0);
-
+
boolean isBinary= false;
final IContentTypeManager ctm = Platform.getContentTypeManager();
final IContentType ctbin = ctm.getContentType(CCorePlugin.CONTENT_TYPE_BINARYFILE);
@@ -662,7 +662,7 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
return null;
}
}
-
+
URI fileUri = file.getLocationURI();
//Avoid name special devices, empty files and the like
if (!Util.isNonZeroLengthFile(fileUri)) {
@@ -677,9 +677,9 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
}
//return null;
}
-
+
int hints = 0;
-
+
for (BinaryParserConfig parser2 : parsers) {
IBinaryParser parser = null;
try {
@@ -850,10 +850,11 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
* on the platform, and that the C Model should update any required
* internal structures such that its elements remain consistent.
* Translates IResourceDeltas
into ICElementDeltas
.
- *
+ *
* @see IResourceDelta
* @see IResource
*/
+ @Override
public void resourceChanged(IResourceChangeEvent event) {
if (event.getSource() instanceof IWorkspace) {
IResourceDelta delta = event.getDelta();
@@ -861,7 +862,7 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
switch (event.getType()) {
case IResourceChangeEvent.PRE_DELETE:
try {
- if (resource.getType() == IResource.PROJECT &&
+ if (resource.getType() == IResource.PROJECT &&
( ((IProject)resource).hasNature(CProjectNature.C_NATURE_ID) ||
((IProject)resource).hasNature(CCProjectNature.CC_NATURE_ID) )){
this.preDeleteProject((IProject) resource);}
@@ -871,7 +872,7 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
case IResourceChangeEvent.PRE_CLOSE:
try {
- if (resource.getType() == IResource.PROJECT &&
+ if (resource.getType() == IResource.PROJECT &&
( ((IProject)resource).hasNature(CProjectNature.C_NATURE_ID) ||
((IProject)resource).hasNature(CCProjectNature.CC_NATURE_ID) )){
this.preCloseProject((IProject) resource);}
@@ -899,6 +900,7 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
}
}
+ @Override
public void handleEvent(CProjectDescriptionEvent event) {
switch(event.getEventType()) {
case CProjectDescriptionEvent.APPLIED:
@@ -961,6 +963,7 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
/* (non-Javadoc)
* @see org.eclipse.core.runtime.content.IContentTypeManager.IContentTypeListener#contentTypeChanged()
*/
+ @Override
public void contentTypeChanged(ContentTypeChangeEvent event) {
ContentTypeProcessor.processContentTypeChanges(new ContentTypeChangeEvent[]{ event });
}
@@ -975,12 +978,12 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
public void fireShift(ICElement element, int offset, int size, int lines) {
ICElementDelta delta = new CShiftData(element, offset, size, lines);
- fire(delta, ElementChangedEvent.POST_SHIFT);
+ fire(delta, ElementChangedEvent.POST_SHIFT);
}
-
+
/**
- * Fire C Model deltas, flushing them after the fact.
- * If the firing mode has been turned off, this has no effect.
+ * Fire C Model deltas, flushing them after the fact.
+ * If the firing mode has been turned off, this has no effect.
*/
@SuppressWarnings("deprecation")
void fire(ICElementDelta customDeltas, int eventType) {
@@ -1077,7 +1080,7 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
notifyListeners(deltaToNotify, ElementChangedEvent.POST_SHIFT, listeners, listenerMask, listenerCount);
}
}
-
+
public void notifyListeners(ICElementDelta deltaToNotify, int eventType,
IElementChangedListener[] listeners, int[] listenerMask, int listenerCount) {
@@ -1093,10 +1096,12 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
// wrap callbacks with Safe runnable for subsequent listeners to be called when some are causing grief
SafeRunner.run(new ISafeRunnable() {
+ @Override
public void handleException(Throwable exception) {
//CCorePlugin.log(exception, "Exception occurred in listener of C element change notification"); //$NON-NLS-1$
CCorePlugin.log(exception);
}
+ @Override
public void run() throws Exception {
listener.elementChanged(extraEvent);
}
@@ -1192,7 +1197,7 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
/*
* Puts the infos in the given map (keys are ICElements and values are CElementInfos)
* in the C model cache in an atomic way.
- * First checks that the info for the opened element (or one of its ancestors) has not been
+ * First checks that the info for the opened element (or one of its ancestors) has not been
* added to the cache. If it is the case, another thread has opened the element (or one of
* its ancestors). So returns without updating the cache.
*/
@@ -1306,10 +1311,10 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
movedTo= delta.getMovedToPath();
}
LocalProjectScope.deletePreferences(res.getFullPath(), movedTo);
- }
+ }
}
}
-
+
private void preDeleteProject(IProject project) {
// remove binary parsers
binaryParsersMap.remove(project);
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelOperation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelOperation.java
index cfa141c61f3..6c3efc54a06 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelOperation.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelOperation.java
@@ -198,6 +198,7 @@ public abstract class CModelOperation implements IWorkspaceRunnable, IProgressMo
/**
* @see IProgressMonitor
*/
+ @Override
public void beginTask(String name, int totalWork) {
if (fMonitor != null) {
fMonitor.beginTask(name, totalWork);
@@ -320,6 +321,7 @@ public abstract class CModelOperation implements IWorkspaceRunnable, IProgressMo
/**
* @see IProgressMonitor
*/
+ @Override
public void done() {
if (fMonitor != null) {
fMonitor.done();
@@ -436,7 +438,7 @@ public abstract class CModelOperation implements IWorkspaceRunnable, IProgressMo
}
/**
- * Returns the scheduling rule for this operation (i.e. the resource that needs to be locked
+ * Returns the scheduling rule for this operation (i.e. the resource that needs to be locked
* while this operation is running.
* Subclasses can override.
*/
@@ -477,6 +479,7 @@ public abstract class CModelOperation implements IWorkspaceRunnable, IProgressMo
return !this.isReadOnly() && this.hasModifiedResource;
}
+ @Override
public void internalWorked(double work) {
if (fMonitor != null) {
fMonitor.internalWorked(work);
@@ -486,6 +489,7 @@ public abstract class CModelOperation implements IWorkspaceRunnable, IProgressMo
/**
* @see IProgressMonitor
*/
+ @Override
public boolean isCanceled() {
if (fMonitor != null) {
return fMonitor.isCanceled();
@@ -543,7 +547,7 @@ public abstract class CModelOperation implements IWorkspaceRunnable, IProgressMo
/*
* Returns the stack of operations running in the current thread.
- * Returns an empty stack if no operations are currently running in this thread.
+ * Returns an empty stack if no operations are currently running in this thread.
*/
protected ArrayList getCurrentOperationStack() {
ArrayList stack = operationStacks.get();
@@ -562,7 +566,7 @@ public abstract class CModelOperation implements IWorkspaceRunnable, IProgressMo
ArrayList stack = getCurrentOperationStack();
int size = stack.size();
if (size > 0) {
- if (size == 1) { // top level operation
+ if (size == 1) { // top level operation
operationStacks.set(null); // release reference (see http://bugs.eclipse.org/bugs/show_bug.cgi?id=33927)
}
return stack.remove(size-1);
@@ -593,6 +597,7 @@ public abstract class CModelOperation implements IWorkspaceRunnable, IProgressMo
* @see IWorkspaceRunnable
* @exception CoreException if the operation fails
*/
+ @Override
public void run(IProgressMonitor monitor) throws CoreException {
CModelManager manager= CModelManager.getDefault();
int previousDeltaCount = manager.fCModelDeltas.size();
@@ -649,6 +654,7 @@ public abstract class CModelOperation implements IWorkspaceRunnable, IProgressMo
/**
* @see IProgressMonitor
*/
+ @Override
public void setCanceled(boolean b) {
if (fMonitor != null) {
fMonitor.setCanceled(b);
@@ -666,6 +672,7 @@ public abstract class CModelOperation implements IWorkspaceRunnable, IProgressMo
/**
* @see IProgressMonitor
*/
+ @Override
public void setTaskName(String name) {
if (fMonitor != null) {
fMonitor.setTaskName(name);
@@ -675,6 +682,7 @@ public abstract class CModelOperation implements IWorkspaceRunnable, IProgressMo
/**
* @see IProgressMonitor
*/
+ @Override
public void subTask(String name) {
if (fMonitor != null) {
fMonitor.subTask(name);
@@ -698,6 +706,7 @@ public abstract class CModelOperation implements IWorkspaceRunnable, IProgressMo
/**
* @see IProgressMonitor
*/
+ @Override
public void worked(int work) {
if (fMonitor != null) {
fMonitor.worked(work);
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelStatus.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelStatus.java
index 620ad312f00..51f37a0a2fb 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelStatus.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CModelStatus.java
@@ -157,6 +157,7 @@ public class CModelStatus extends Status implements ICModelStatus, ICModelStatus
/**
* @see ICModelStatus
*/
+ @Override
public ICElement[] getElements() {
return fElements;
}
@@ -289,6 +290,7 @@ public class CModelStatus extends Status implements ICModelStatus, ICModelStatus
return exception.toString();
}
+ @Override
public IPath getPath() {
if (fPath == null) {
return Path.EMPTY;
@@ -316,6 +318,7 @@ public class CModelStatus extends Status implements ICModelStatus, ICModelStatus
/**
* @see ICModelStatus
*/
+ @Override
public String getString() {
if (fString == null) {
return EMPTY_STRING;
@@ -333,6 +336,7 @@ public class CModelStatus extends Status implements ICModelStatus, ICModelStatus
/**
* @see ICModelStatus
*/
+ @Override
public boolean doesNotExist() {
return getCode() == ELEMENT_DOES_NOT_EXIST;
}
@@ -381,7 +385,7 @@ public class CModelStatus extends Status implements ICModelStatus, ICModelStatus
/**
* Creates and returns a new ICModelStatus
that is a a
* multi-status status.
- *
+ *
* @see IStatus#isMultiStatus()
*/
public static ICModelStatus newMultiStatus(ICModelStatus[] children) {
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProject.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProject.java
index 758a83019a8..2fc62218e2b 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProject.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CProject.java
@@ -72,18 +72,22 @@ public class CProject extends Openable implements ICProject {
super(parent, project, ICElement.C_PROJECT);
}
+ @Override
public IBinaryContainer getBinaryContainer() throws CModelException {
return ((CProjectInfo) getElementInfo()).getBinaryContainer();
}
+ @Override
public IArchiveContainer getArchiveContainer() throws CModelException {
return ((CProjectInfo) getElementInfo()).getArchiveContainer();
}
+ @Override
public IProject getProject() {
return getUnderlyingResource().getProject();
}
+ @Override
public ICElement findElement(IPath path) throws CModelException {
ICElement celem = null;
if (path.isAbsolute()) {
@@ -134,13 +138,13 @@ public class CProject extends Openable implements ICProject {
*/
@Override
public boolean equals(Object o) {
-
+
if (this == o)
return true;
-
+
if (!(o instanceof CProject))
return false;
-
+
CProject other = (CProject) o;
return getProject().equals(other.getProject());
}
@@ -156,6 +160,7 @@ public class CProject extends Openable implements ICProject {
return getProject().hashCode();
}
+ @Override
public IIncludeReference[] getIncludeReferences() throws CModelException {
CProjectInfo pinfo = (CProjectInfo)CModelManager.getDefault().peekAtInfo(this);
IIncludeReference[] incRefs = null;
@@ -179,6 +184,7 @@ public class CProject extends Openable implements ICProject {
return incRefs;
}
+ @Override
public ILibraryReference[] getLibraryReferences() throws CModelException {
CProjectInfo pinfo = (CProjectInfo)CModelManager.getDefault().peekAtInfo(this);
ILibraryReference[] libRefs = null;
@@ -240,6 +246,7 @@ public class CProject extends Openable implements ICProject {
/**
* @see ICProject#getRequiredProjectNames()
*/
+ @Override
public String[] getRequiredProjectNames() throws CModelException {
return projectPrerequisites(getResolvedPathEntries());
}
@@ -252,6 +259,7 @@ public class CProject extends Openable implements ICProject {
/**
* @see org.eclipse.cdt.core.model.ICProject#getOption(String, boolean)
*/
+ @Override
public String getOption(String optionName, boolean inheritCCoreOptions) {
if (CModelManager.OptionNames.contains(optionName)) {
IEclipsePreferences preferences = getPreferences();
@@ -269,6 +277,7 @@ public class CProject extends Openable implements ICProject {
/**
* @see org.eclipse.cdt.core.model.ICProject#getOptions(boolean)
*/
+ @Override
public Map getOptions(boolean inheritCCoreOptions) {
// initialize to the defaults from CCorePlugin options pool
Map options= inheritCCoreOptions ? CCorePlugin.getOptions() : new HashMap(5);
@@ -296,6 +305,7 @@ public class CProject extends Openable implements ICProject {
/**
* @see org.eclipse.cdt.core.model.ICProject#setOption(java.lang.String, java.lang.String)
*/
+ @Override
public void setOption(String optionName, String optionValue) {
if (!CModelManager.OptionNames.contains(optionName))
return; // unrecognized option
@@ -307,7 +317,7 @@ public class CProject extends Openable implements ICProject {
} else {
projectPreferences.put(optionName, optionValue);
}
-
+
// Dump changes
try {
projectPreferences.flush();
@@ -319,6 +329,7 @@ public class CProject extends Openable implements ICProject {
/**
* @see org.eclipse.cdt.core.model.ICProject#setOptions(Map)
*/
+ @Override
public void setOptions(Map newOptions) {
Preferences preferences = new Preferences();
setPreferences(preferences); // always reset (26255)
@@ -397,6 +408,7 @@ public class CProject extends Openable implements ICProject {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ICProject#getResolvedCPathEntries()
*/
+ @Override
public IPathEntry[] getResolvedPathEntries() throws CModelException {
return CoreModel.getResolvedPathEntries(this);
}
@@ -404,6 +416,7 @@ public class CProject extends Openable implements ICProject {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ICProject#getRawCPathEntries()
*/
+ @Override
public IPathEntry[] getRawPathEntries() throws CModelException {
return CoreModel.getRawPathEntries(this);
}
@@ -411,6 +424,7 @@ public class CProject extends Openable implements ICProject {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ICProject#setRawCPathEntries(org.eclipse.cdt.core.model.IPathEntry[], org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public void setRawPathEntries(IPathEntry[] newEntries, IProgressMonitor monitor) throws CModelException {
CoreModel.setRawPathEntries(this, newEntries, monitor);
}
@@ -418,6 +432,7 @@ public class CProject extends Openable implements ICProject {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ICProject#getSourceRoot(org.eclipse.cdt.core.model.ISourceEntry)
*/
+ @Override
public ISourceRoot getSourceRoot(ISourceEntry entry) throws CModelException {
return getSourceRoot(new CSourceEntry(entry.getPath(), entry.getExclusionPatterns(), 0));
}
@@ -444,6 +459,7 @@ public class CProject extends Openable implements ICProject {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ICProject#findSourceRoot()
*/
+ @Override
public ISourceRoot findSourceRoot(IResource res) {
try {
ISourceRoot[] roots = getAllSourceRoots();
@@ -460,6 +476,7 @@ public class CProject extends Openable implements ICProject {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ICProject#findSourceRoot()
*/
+ @Override
public ISourceRoot findSourceRoot(IPath path) {
try {
ISourceRoot[] roots = getAllSourceRoots();
@@ -472,10 +489,11 @@ public class CProject extends Openable implements ICProject {
}
return null;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ICProject#getSourceRoots()
*/
+ @Override
public ISourceRoot[] getSourceRoots() throws CModelException {
Object[] children = getChildren();
ArrayList result = new ArrayList(children.length);
@@ -489,10 +507,11 @@ public class CProject extends Openable implements ICProject {
/**
* Get all source roots.
- *
+ *
* @return all source roots
* @throws CModelException
*/
+ @Override
public ISourceRoot[] getAllSourceRoots() throws CModelException {
CProjectInfo pinfo = (CProjectInfo)CModelManager.getDefault().peekAtInfo(this);
ISourceRoot[] roots = null;
@@ -510,6 +529,7 @@ public class CProject extends Openable implements ICProject {
return roots;
}
+ @Override
public IOutputEntry[] getOutputEntries() throws CModelException {
CProjectInfo pinfo = (CProjectInfo) CModelManager.getDefault().peekAtInfo(this);
IOutputEntry[] outs = null;
@@ -528,7 +548,7 @@ public class CProject extends Openable implements ICProject {
}
/**
- *
+ *
*/
public IOutputEntry[] getOutputEntries(IPathEntry[] entries) throws CModelException {
ArrayList list = new ArrayList(entries.length);
@@ -543,11 +563,12 @@ public class CProject extends Openable implements ICProject {
}
/**
- *
+ *
*/
+ @Override
public boolean isOnOutputEntry(IResource resource) {
IPath path = resource.getFullPath();
-
+
// ensure that folders are only excluded if all of their children are excluded
if (resource.getType() == IResource.FOLDER || resource.getType() == IResource.PROJECT) {
path = path.append("*"); //$NON-NLS-1$
@@ -606,7 +627,7 @@ public class CProject extends Openable implements ICProject {
if(cfg != null)
entries = cfg.getResolvedSourceEntries();
}
-
+
if(entries != null){
ArrayList list = new ArrayList(entries.length);
for (ICSourceEntry sourceEntry : entries) {
@@ -624,14 +645,14 @@ public class CProject extends Openable implements ICProject {
List sourceRoots = computeSourceRoots();
List children = new ArrayList(sourceRoots.size());
children.addAll(sourceRoots);
-
+
boolean projectIsSourceRoot = false;
for (ISourceRoot sourceRoot : sourceRoots)
if (sourceRoot.getResource().equals(getProject())) {
projectIsSourceRoot = true;
break;
}
-
+
// Now look for output folders
try {
IResource[] resources = getProject().members();
@@ -644,7 +665,7 @@ public class CProject extends Openable implements ICProject {
break;
}
}
-
+
// Not in source folder, check if it's a container on output entry
// Also make sure I'm not a source root since my SourceRoot object would
// have already added this.
@@ -655,7 +676,7 @@ public class CProject extends Openable implements ICProject {
} catch (CoreException e) {
// ignore
}
-
+
info.setChildren(children);
if (info instanceof CProjectInfo) {
CProjectInfo pinfo = (CProjectInfo)info;
@@ -664,10 +685,11 @@ public class CProject extends Openable implements ICProject {
}
return true;
}
-
+
/*
* @see ICProject
*/
+ @Override
public boolean isOnSourceRoot(ICElement element) {
try {
ISourceRoot[] roots = getSourceRoots();
@@ -685,6 +707,7 @@ public class CProject extends Openable implements ICProject {
/*
* @see ICProject
*/
+ @Override
public boolean isOnSourceRoot(IResource resource) {
try {
ISourceRoot[] roots = getSourceRoots();
@@ -713,6 +736,7 @@ public class CProject extends Openable implements ICProject {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ICProject#getNonCResources()
*/
+ @Override
public Object[] getNonCResources() throws CModelException {
return ((CProjectInfo) getElementInfo()).getNonCResources(getResource());
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CShiftData.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CShiftData.java
index 36169004ec2..31987214fbf 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CShiftData.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/CShiftData.java
@@ -17,7 +17,7 @@ import org.eclipse.core.resources.IResourceDelta;
/**
* In this case, no delta for specific element passed
* Instead we'll notify Outline about offsets change.
- *
+ *
* @author Oleg Krasilnikov
*/
public class CShiftData implements ICElementDelta {
@@ -26,7 +26,7 @@ public class CShiftData implements ICElementDelta {
private final int offset;
private final int size;
private final int lines;
-
+
public CShiftData(ICElement element, int offset, int size, int lines) {
this.element = element;
this.offset = offset;
@@ -37,18 +37,19 @@ public class CShiftData implements ICElementDelta {
public int getOffset() {
return offset;
}
-
+
public int getSize() {
return size;
}
-
+
public int getLines() {
return lines;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ICElementDelta#getAddedChildren()
*/
+ @Override
public ICElementDelta[] getAddedChildren() {
return new ICElementDelta[0];
}
@@ -56,6 +57,7 @@ public class CShiftData implements ICElementDelta {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ICElementDelta#getAffectedChildren()
*/
+ @Override
public ICElementDelta[] getAffectedChildren() {
return new ICElementDelta[0];
}
@@ -63,6 +65,7 @@ public class CShiftData implements ICElementDelta {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ICElementDelta#getChangedChildren()
*/
+ @Override
public ICElementDelta[] getChangedChildren() {
return new ICElementDelta[0];
}
@@ -70,6 +73,7 @@ public class CShiftData implements ICElementDelta {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ICElementDelta#getElement()
*/
+ @Override
public ICElement getElement() {
return element;
}
@@ -77,6 +81,7 @@ public class CShiftData implements ICElementDelta {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ICElementDelta#getFlags()
*/
+ @Override
public int getFlags() {
return 0;
}
@@ -84,6 +89,7 @@ public class CShiftData implements ICElementDelta {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ICElementDelta#getKind()
*/
+ @Override
public int getKind() {
return 0;
}
@@ -91,6 +97,7 @@ public class CShiftData implements ICElementDelta {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ICElementDelta#getMovedFromElement()
*/
+ @Override
public ICElement getMovedFromElement() {
return null;
}
@@ -98,6 +105,7 @@ public class CShiftData implements ICElementDelta {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ICElementDelta#getMovedToElement()
*/
+ @Override
public ICElement getMovedToElement() {
return null;
}
@@ -105,6 +113,7 @@ public class CShiftData implements ICElementDelta {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ICElementDelta#getRemovedChildren()
*/
+ @Override
public ICElementDelta[] getRemovedChildren() {
return new ICElementDelta[0];
}
@@ -112,6 +121,7 @@ public class CShiftData implements ICElementDelta {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ICElementDelta#getResourceDeltas()
*/
+ @Override
public IResourceDelta[] getResourceDeltas() {
return null;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DefaultPathEntryStore.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DefaultPathEntryStore.java
index 3f6e49de5ff..64fa28dda13 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DefaultPathEntryStore.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/DefaultPathEntryStore.java
@@ -72,9 +72,9 @@ public class DefaultPathEntryStore implements IPathEntryStore, ICDescriptorListe
List listeners;
IProject fProject;
-
+
/**
- *
+ *
*/
public DefaultPathEntryStore(IProject project) {
fProject = project;
@@ -84,6 +84,7 @@ public class DefaultPathEntryStore implements IPathEntryStore, ICDescriptorListe
CCorePlugin.getDefault().getCDescriptorManager().addDescriptorListener(this);
}
+ @Override
public IPathEntry[] getRawPathEntries() throws CoreException {
ICDescriptor cdesc = CCorePlugin.getDefault().getCProjectDescription(fProject, false);
if (cdesc != null) {
@@ -91,17 +92,18 @@ public class DefaultPathEntryStore implements IPathEntryStore, ICDescriptorListe
ICStorageElement entry = cdesc.getProjectStorageElement(PATH_ENTRY_ID);
for (ICStorageElement childNode : entry.getChildrenByName(PATH_ENTRY))
pathEntries.add(decodePathEntry(fProject, childNode));
- IPathEntry[] entries = new IPathEntry[pathEntries.size()];
+ IPathEntry[] entries = new IPathEntry[pathEntries.size()];
pathEntries.toArray(entries);
return entries;
}
return NO_PATHENTRIES;
}
+ @Override
public void setRawPathEntries(IPathEntry[] newRawEntries) throws CoreException {
if (Arrays.equals(newRawEntries, getRawPathEntries())) {
return;
- }
+ }
ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(fProject, true);
ICStorageElement rootElement = descriptor.getProjectStorageElement(PATH_ENTRY_ID);
// Clear out all current children
@@ -116,11 +118,11 @@ public class DefaultPathEntryStore implements IPathEntryStore, ICDescriptorListe
static IPathEntry decodePathEntry(IProject project, ICStorageElement element) throws CModelException {
IPath projectPath = project.getFullPath();
-
+
// kind
String kindAttr = element.getAttribute(ATTRIBUTE_KIND);
int kind = PathEntry.kindFromString(kindAttr);
-
+
// exported flag
boolean isExported = false;
if (element.hasAttribute(ATTRIBUTE_EXPORTED)) {
@@ -157,13 +159,13 @@ public class DefaultPathEntryStore implements IPathEntryStore, ICDescriptorListe
}
}
}
-
+
// recreate the entry
switch (kind) {
case IPathEntry.CDT_PROJECT :
return CoreModel.newProjectEntry(path, isExported);
case IPathEntry.CDT_LIBRARY : {
- IPath libraryPath = new Path(element.getAttribute(ATTRIBUTE_LIBRARY));
+ IPath libraryPath = new Path(element.getAttribute(ATTRIBUTE_LIBRARY));
// source attachment info (optional)
IPath sourceAttachmentPath = element.hasAttribute(ATTRIBUTE_SOURCEPATH) ? new Path(
element.getAttribute(ATTRIBUTE_SOURCEPATH)) : null;
@@ -171,7 +173,7 @@ public class DefaultPathEntryStore implements IPathEntryStore, ICDescriptorListe
element.getAttribute(ATTRIBUTE_ROOTPATH)) : null;
IPath sourceAttachmentPrefixMapping = element.hasAttribute(ATTRIBUTE_PREFIXMAPPING) ? new Path(
element.getAttribute(ATTRIBUTE_PREFIXMAPPING)) : null;
-
+
if (!baseRef.isEmpty()) {
return CoreModel.newLibraryRefEntry(path, baseRef, libraryPath);
}
@@ -207,7 +209,7 @@ public class DefaultPathEntryStore implements IPathEntryStore, ICDescriptorListe
case IPathEntry.CDT_INCLUDE_FILE: {
// include path info
IPath includeFilePath = new Path(element.getAttribute(ATTRIBUTE_INCLUDE_FILE));
- return CoreModel.newIncludeFileEntry(path, basePath, baseRef, includeFilePath, exclusionPatterns, isExported);
+ return CoreModel.newIncludeFileEntry(path, basePath, baseRef, includeFilePath, exclusionPatterns, isExported);
}
case IPathEntry.CDT_MACRO : {
String macroName = element.getAttribute(ATTRIBUTE_NAME);
@@ -276,7 +278,7 @@ public class DefaultPathEntryStore implements IPathEntryStore, ICDescriptorListe
element.setAttribute(ATTRIBUTE_LIBRARY, libraryPath.toString());
IPath sourcePath = lib.getSourceAttachmentPath();
if (sourcePath != null) {
- // translate to project relative from absolute
+ // translate to project relative from absolute
if (projectPath != null && projectPath.isPrefixOf(sourcePath)) {
if (sourcePath.segment(0).equals(projectPath.segment(0))) {
sourcePath = sourcePath.removeFirstSegments(1);
@@ -356,9 +358,10 @@ public class DefaultPathEntryStore implements IPathEntryStore, ICDescriptorListe
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.ICDescriptorListener#descriptorChanged(org.eclipse.cdt.core.CDescriptorEvent)
*/
+ @Override
public void descriptorChanged(CDescriptorEvent event) {
if (event.getType() == CDescriptorEvent.CDTPROJECT_CHANGED
/*|| event.getType() == CDescriptorEvent.CDTPROJECT_ADDED*/) {
@@ -373,13 +376,15 @@ public class DefaultPathEntryStore implements IPathEntryStore, ICDescriptorListe
/* (non-Javadoc)
* @see org.eclipse.cdt.core.resources.IPathEntryStore#addPathEntryStoreListener(org.eclipse.cdt.core.resources.IPathEntryStoreListener)
*/
- public void addPathEntryStoreListener(IPathEntryStoreListener listener) {
+ @Override
+ public void addPathEntryStoreListener(IPathEntryStoreListener listener) {
listeners.add(listener);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.resources.IPathEntryStore#removePathEntryStoreListener(org.eclipse.cdt.core.resources.IPathEntryStoreListener)
*/
+ @Override
public void removePathEntryStoreListener(IPathEntryStoreListener listener) {
listeners.remove(listener);
}
@@ -396,6 +401,7 @@ public class DefaultPathEntryStore implements IPathEntryStore, ICDescriptorListe
/* (non-Javadoc)
* @see org.eclipse.cdt.core.resources.IPathEntryStore#fireClosedChangedEvent(IProject)
*/
+ @Override
public void close() {
PathEntryStoreChangedEvent evt = new PathEntryStoreChangedEvent(this, fProject, PathEntryStoreChangedEvent.STORE_CLOSED);
IPathEntryStoreListener[] observers = new IPathEntryStoreListener[listeners.size()];
@@ -406,14 +412,17 @@ public class DefaultPathEntryStore implements IPathEntryStore, ICDescriptorListe
CCorePlugin.getDefault().getCDescriptorManager().removeDescriptorListener(this);
}
+ @Override
public IProject getProject() {
return fProject;
}
+ @Override
public ICExtensionReference getExtensionReference() {
return null;
}
+ @Override
public ICConfigExtensionReference getConfigExtensionReference() {
return null;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Enumeration.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Enumeration.java
index f7f21071909..d2e74975683 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Enumeration.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Enumeration.java
@@ -19,7 +19,7 @@ import org.eclipse.cdt.core.model.IEnumeration;
public class Enumeration extends SourceManipulation implements IEnumeration{
public Enumeration(ICElement parent, String name) {
- super(parent, name, ICElement.C_ENUMERATION);
+ super(parent, name, ICElement.C_ENUMERATION);
}
@Override
@@ -34,6 +34,7 @@ public class Enumeration extends SourceManipulation implements IEnumeration{
/**
* @see org.eclipse.cdt.core.model.IVariableDeclaration#getTypeName()
*/
+ @Override
public String getTypeName() throws CModelException {
return getEnumerationInfo().getTypeName();
}
@@ -48,6 +49,7 @@ public class Enumeration extends SourceManipulation implements IEnumeration{
/**
* @see org.eclipse.cdt.core.model.IDeclaration#isConst()
*/
+ @Override
public boolean isConst() throws CModelException {
return getEnumerationInfo().isConst();
}
@@ -55,6 +57,7 @@ public class Enumeration extends SourceManipulation implements IEnumeration{
/**
* @see org.eclipse.cdt.core.model.IDeclaration#isStatic()
*/
+ @Override
public boolean isStatic() throws CModelException {
return getEnumerationInfo().isStatic();
}
@@ -62,6 +65,7 @@ public class Enumeration extends SourceManipulation implements IEnumeration{
/**
* @see org.eclipse.cdt.core.model.IDeclaration#isVolatile()
*/
+ @Override
public boolean isVolatile() throws CModelException {
return getEnumerationInfo().isVolatile();
}
@@ -88,6 +92,6 @@ public class Enumeration extends SourceManipulation implements IEnumeration{
*/
public void setVolatile(boolean isVolatile) throws CModelException {
getEnumerationInfo().setVolatile(isVolatile);
- }
+ }
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Enumerator.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Enumerator.java
index 7ad4be5bf8c..ed42a229fac 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Enumerator.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Enumerator.java
@@ -16,19 +16,20 @@ import org.eclipse.cdt.core.model.IEnumerator;
public class Enumerator extends SourceManipulation implements IEnumerator{
String constantExpression = ""; //$NON-NLS-1$
-
+
public Enumerator(ICElement parent, String name) {
super(parent, name, ICElement.C_ENUMERATOR);
}
-
+
@Override
protected CElementInfo createElementInfo () {
return new SourceManipulationInfo(this);
}
-
+
/**
* @see org.eclipse.cdt.core.model.IEnumerator#getConstantExpression()
*/
+ @Override
public String getConstantExpression() {
return constantExpression;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Field.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Field.java
index 25b1d69a051..8778c7a431e 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Field.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Field.java
@@ -17,11 +17,12 @@ import org.eclipse.cdt.core.model.IField;
import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
public class Field extends VariableDeclaration implements IField {
-
+
public Field(ICElement parent, String name) {
super(parent, name, ICElement.C_FIELD);
}
+ @Override
public boolean isMutable() throws CModelException{
return getFieldInfo().isMutable();
}
@@ -70,6 +71,7 @@ public class Field extends VariableDeclaration implements IField {
getFieldInfo().setStatic(isStatic);
}
+ @Override
public ASTAccessVisibility getVisibility() throws CModelException {
return getFieldInfo().getVisibility();
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionDeclaration.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionDeclaration.java
index 3f6f6984621..6cfd7499b20 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionDeclaration.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionDeclaration.java
@@ -20,7 +20,7 @@ import org.eclipse.cdt.core.model.IFunctionDeclaration;
public class FunctionDeclaration extends SourceManipulation implements IFunctionDeclaration {
protected String[] fParameterTypes;
protected String returnType;
-
+
public FunctionDeclaration(ICElement parent, String name) {
super(parent, name, ICElement.C_FUNCTION_DECLARATION);
fParameterTypes= fgEmptyStrings;
@@ -31,6 +31,7 @@ public class FunctionDeclaration extends SourceManipulation implements IFunction
fParameterTypes= fgEmptyStrings;
}
+ @Override
public String getReturnType(){
if (returnType != null) {
return returnType;
@@ -42,22 +43,25 @@ public class FunctionDeclaration extends SourceManipulation implements IFunction
returnType = type;
}
+ @Override
public int getNumberOfParameters() {
return fParameterTypes == null ? 0 : fParameterTypes.length;
}
+ @Override
public String[] getParameterTypes() {
return fParameterTypes;
}
-
+
public void setParameterTypes(String[] parameterTypes) {
fParameterTypes = parameterTypes;
- }
-
+ }
+
+ @Override
public String getSignature() throws CModelException{
return getSignature(this);
}
-
+
public static String getSignature(IFunctionDeclaration func) {
StringBuffer sig = new StringBuffer(func.getElementName());
sig.append(getParameterClause(func.getParameterTypes()));
@@ -68,17 +72,17 @@ public class FunctionDeclaration extends SourceManipulation implements IFunction
sig.append(" volatile"); //$NON-NLS-1$
}
} catch (CModelException e) {
- }
+ }
return sig.toString();
}
-
+
public String getParameterClause() {
return getParameterClause(getParameterTypes());
}
-
+
public static String getParameterClause(String[] paramTypes){
StringBuffer sig = new StringBuffer();
-
+
if(paramTypes.length > 0){
sig.append("("); //$NON-NLS-1$
int i = 0;
@@ -92,13 +96,15 @@ public class FunctionDeclaration extends SourceManipulation implements IFunction
else{
sig.append("()"); //$NON-NLS-1$
}
- return sig.toString();
+ return sig.toString();
}
-
+
+ @Override
public String getParameterInitializer(int pos) {
return ""; //$NON-NLS-1$
}
-
+
+ @Override
public String[] getExceptions(){
return new String[] {};
}
@@ -107,11 +113,11 @@ public class FunctionDeclaration extends SourceManipulation implements IFunction
protected CElementInfo createElementInfo () {
return new FunctionInfo(this);
}
-
+
protected FunctionInfo getFunctionInfo() throws CModelException{
return (FunctionInfo) getElementInfo();
}
-
+
@Override
public boolean equals(Object other) {
if (other instanceof IFunctionDeclaration) {
@@ -119,17 +125,18 @@ public class FunctionDeclaration extends SourceManipulation implements IFunction
}
return false;
}
-
+
public static boolean equals(IFunctionDeclaration lhs, IFunctionDeclaration rhs) {
- return CElement.equals(lhs, rhs) &&
+ return CElement.equals(lhs, rhs) &&
Util.equalArraysOrNull(lhs.getParameterTypes(), rhs.getParameterTypes()) &&
lhs.getReturnType().equals(rhs.getReturnType());
}
-
+
/**
- * FunctionDeclarations and Functions can not be constant
+ * FunctionDeclarations and Functions can not be constant
* @see org.eclipse.cdt.core.model.IDeclaration#isConst()
*/
+ @Override
public boolean isConst() throws CModelException{
return getFunctionInfo().isConst();
}
@@ -142,6 +149,7 @@ public class FunctionDeclaration extends SourceManipulation implements IFunction
* Returns the isStatic.
* @return boolean
*/
+ @Override
public boolean isStatic() throws CModelException {
return getFunctionInfo().isStatic();
}
@@ -150,6 +158,7 @@ public class FunctionDeclaration extends SourceManipulation implements IFunction
* Returns the isVolatile.
* @return boolean
*/
+ @Override
public boolean isVolatile() throws CModelException {
return getFunctionInfo().isVolatile();
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionTemplate.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionTemplate.java
index 7767d79bb40..116af256f8b 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionTemplate.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionTemplate.java
@@ -16,23 +16,25 @@ import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.IFunctionTemplate;
public class FunctionTemplate extends Function implements IFunctionTemplate {
-
+
protected Template fTemplate;
-
+
public FunctionTemplate(ICElement parent, String name) {
super(parent, name, ICElement.C_TEMPLATE_FUNCTION);
fTemplate = new Template(name);
}
-
+
/**
* Returns the parameterTypes.
* @see org.eclipse.cdt.core.model.ITemplate#getTemplateParameterTypes()
* @return String[]
*/
+ @Override
public String[] getTemplateParameterTypes() {
return fTemplate.getTemplateParameterTypes();
}
+ @Override
public String[] getTemplateArguments() {
return fTemplate.getTemplateArguments();
}
@@ -47,6 +49,7 @@ public class FunctionTemplate extends Function implements IFunctionTemplate {
/**
* @see org.eclipse.cdt.core.model.ITemplate#getNumberOfTemplateParameters()
*/
+ @Override
public int getNumberOfTemplateParameters() {
return fTemplate.getNumberOfTemplateParameters();
}
@@ -55,13 +58,14 @@ public class FunctionTemplate extends Function implements IFunctionTemplate {
* @see org.eclipse.cdt.core.model.ITemplate#getTemplateSignature()
*/
/*
- * The signature in the outline view will be:
- * The class X followed by its template parameters,
- * then the scope resolution, then the function name,
- * followed by its template parameters, folowed by its
- * normal parameter list, then a colon then the function's
+ * The signature in the outline view will be:
+ * The class X followed by its template parameters,
+ * then the scope resolution, then the function name,
+ * followed by its template parameters, folowed by its
+ * normal parameter list, then a colon then the function's
* return type.
- */
+ */
+ @Override
public String getTemplateSignature() throws CModelException {
StringBuffer sig = new StringBuffer(fTemplate.getTemplateSignature());
sig.append(this.getParameterClause());
@@ -71,7 +75,7 @@ public class FunctionTemplate extends Function implements IFunctionTemplate {
if (isVolatile()) {
sig.append(" volatile"); //$NON-NLS-1$
}
- if ((this.getReturnType() != null) && (this.getReturnType().length() > 0)) {
+ if ((this.getReturnType() != null) && (this.getReturnType().length() > 0)) {
sig.append(" : "); //$NON-NLS-1$
sig.append(this.getReturnType());
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionTemplateDeclaration.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionTemplateDeclaration.java
index 4f6c18ba4a3..ebcdf95a416 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionTemplateDeclaration.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/FunctionTemplateDeclaration.java
@@ -24,14 +24,17 @@ public class FunctionTemplateDeclaration extends FunctionDeclaration implements
fTemplate = new Template(name);
}
+ @Override
public String[] getTemplateParameterTypes() {
return fTemplate.getTemplateParameterTypes();
}
+ @Override
public String[] getTemplateArguments() {
return fTemplate.getTemplateArguments();
}
+ @Override
public String getTemplateSignature() throws CModelException {
StringBuffer sig = new StringBuffer(fTemplate.getTemplateSignature());
sig.append(this.getParameterClause());
@@ -40,14 +43,15 @@ public class FunctionTemplateDeclaration extends FunctionDeclaration implements
if(isVolatile())
sig.append(" volatile"); //$NON-NLS-1$
- if((this.getReturnType() != null) && (this.getReturnType().length() > 0)){
+ if((this.getReturnType() != null) && (this.getReturnType().length() > 0)){
sig.append(" : "); //$NON-NLS-1$
sig.append(this.getReturnType());
}
-
+
return sig.toString();
}
+ @Override
public int getNumberOfTemplateParameters() {
return fTemplate.getNumberOfTemplateParameters();
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Include.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Include.java
index 595814c1068..78bac12264d 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Include.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Include.java
@@ -16,7 +16,7 @@ import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.IInclude;
public class Include extends SourceManipulation implements IInclude {
-
+
private String fullPath;
private final boolean standard;
private boolean fIsResolved= true;
@@ -26,10 +26,12 @@ public class Include extends SourceManipulation implements IInclude {
standard = isStandard;
}
+ @Override
public String getIncludeName() {
return getElementName();
}
+ @Override
public boolean isStandard() {
return standard;
}
@@ -37,6 +39,7 @@ public class Include extends SourceManipulation implements IInclude {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IInclude#getFullFileName()
*/
+ @Override
public String getFullFileName() {
return fullPath;
}
@@ -44,6 +47,7 @@ public class Include extends SourceManipulation implements IInclude {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IInclude#isLocal()
*/
+ @Override
public boolean isLocal() {
return !isStandard();
}
@@ -63,6 +67,7 @@ public class Include extends SourceManipulation implements IInclude {
/*
* @see org.eclipse.cdt.core.model.IInclude#isResolved()
*/
+ @Override
public boolean isResolved() {
return fIsResolved;
}
@@ -77,13 +82,13 @@ public class Include extends SourceManipulation implements IInclude {
}
return false;
}
-
+
public static boolean equals(IInclude lhs, IInclude rhs) {
return CElement.equals(lhs, rhs)
- && lhs.isActive() == rhs.isActive()
+ && lhs.isActive() == rhs.isActive()
&& lhs.isResolved() == rhs.isResolved()
&& lhs.isLocal() == rhs.isLocal()
- && (lhs.getFullFileName() == rhs.getFullFileName()
+ && (lhs.getFullFileName() == rhs.getFullFileName()
|| lhs.getFullFileName() != null && lhs.getFullFileName().equals(rhs.getFullFileName()));
}
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeEntry.java
index 9088cafda72..b0868045283 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeEntry.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeEntry.java
@@ -33,18 +33,20 @@ public class IncludeEntry extends APathEntry implements IIncludeEntry {
/**
* Returns the include path
- *
+ *
* @return IPath
*/
+ @Override
public IPath getIncludePath() {
return includePath;
}
/**
* Whether or not it a system include path
- *
+ *
* @return boolean
*/
+ @Override
public boolean isSystemInclude() {
return isSystemInclude;
}
@@ -95,6 +97,7 @@ public class IncludeEntry extends APathEntry implements IIncludeEntry {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IIncludeEntry#getFullIncludePath()
*/
+ @Override
public IPath getFullIncludePath() {
final IPath inc = getIncludePath();
if (!basePath.isEmpty()) {
@@ -110,7 +113,7 @@ public class IncludeEntry extends APathEntry implements IIncludeEntry {
}
return loc.append(inc);
}
-
+
if (!inc.isAbsolute()) {
IPath resPath = getPath();
IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(resPath.append(inc));
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeFileEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeFileEntry.java
index ae0ad3748af..cbac4944b5f 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeFileEntry.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeFileEntry.java
@@ -33,9 +33,10 @@ public class IncludeFileEntry extends APathEntry implements IIncludeFileEntry {
/**
* Returns the include path
- *
+ *
* @return IPath
*/
+ @Override
public IPath getIncludeFilePath() {
return includeFilePath;
}
@@ -83,6 +84,7 @@ public class IncludeFileEntry extends APathEntry implements IIncludeFileEntry {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IIncludeEntry#getFullIncludePath()
*/
+ @Override
public IPath getFullIncludeFilePath() {
final IPath inc = getIncludeFilePath();
if (!basePath.isEmpty()) {
@@ -98,7 +100,7 @@ public class IncludeFileEntry extends APathEntry implements IIncludeFileEntry {
}
return loc.append(inc);
}
-
+
if (!inc.isAbsolute()) {
IPath resPath = getPath();
IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(resPath.append(inc));
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeReference.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeReference.java
index 881f595c761..41dcef85022 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeReference.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/IncludeReference.java
@@ -41,7 +41,7 @@ import org.eclipse.core.runtime.Path;
* IncludeReference
*/
public class IncludeReference extends Openable implements IIncludeReference {
-
+
final IIncludeEntry fIncludeEntry;
final IPath fPath;
@@ -76,7 +76,7 @@ public class IncludeReference extends Openable implements IIncludeReference {
}
return file != null && file.isDirectory();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.model.CElement#createElementInfo()
*/
@@ -88,6 +88,7 @@ public class IncludeReference extends Openable implements IIncludeReference {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IIncludeReference#getIncludeEntry()
*/
+ @Override
public IIncludeEntry getIncludeEntry() {
return fIncludeEntry;
}
@@ -103,6 +104,7 @@ public class IncludeReference extends Openable implements IIncludeReference {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IIncludeReference#getAffectedPath()
*/
+ @Override
public IPath getAffectedPath() {
return fIncludeEntry.getPath();
}
@@ -124,7 +126,7 @@ public class IncludeReference extends Openable implements IIncludeReference {
String[] names = null;
if (file != null && file.isDirectory()) {
names = file.list();
-
+
if (names != null) {
IPath path = new Path(file.getAbsolutePath());
for (String name : names) {
@@ -175,8 +177,9 @@ public class IncludeReference extends Openable implements IIncludeReference {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IIncludeReference#isOnIncludeEntry(org.eclipse.core.runtime.IPath)
*/
+ @Override
public boolean isOnIncludeEntry(IPath path) {
- if (fIncludeEntry.getFullIncludePath().isPrefixOf(path)
+ if (fIncludeEntry.getFullIncludePath().isPrefixOf(path)
&& !CoreModelUtil.isExcluded(path, fIncludeEntry.fullExclusionPatternChars())) {
return true;
}
@@ -190,7 +193,7 @@ public class IncludeReference extends Openable implements IIncludeReference {
public IPath getPath() {
return fPath;
}
-
+
@Override
public ICElement getHandleFromMemento(String token, MementoTokenizer memento) {
return null;
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LanguageDescriptor.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LanguageDescriptor.java
index d2091a5f7ea..2cfe0932635 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LanguageDescriptor.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LanguageDescriptor.java
@@ -31,19 +31,22 @@ public class LanguageDescriptor extends CExtensionDescriptor implements
private String fContentTypeIds[];
private String fId;
private IContentType[] fContentTypes;
-
+
public LanguageDescriptor(IConfigurationElement el) {
super(el);
}
+ @Override
public ILanguage getLanguage() {
if(fLanguage == null){
SafeRunner.run(new ISafeRunnable(){
+ @Override
public void handleException(Throwable exception) {
CCorePlugin.log(exception);
}
+ @Override
public void run() throws Exception {
fLanguage = (ILanguage)getConfigurationElement().createExecutableExtension(ATTRIBUTE_CLASS);
}
@@ -52,13 +55,14 @@ public class LanguageDescriptor extends CExtensionDescriptor implements
return fLanguage;
}
+ @Override
public String[] getContentTypeIds() {
if(fContentTypeIds == null){
fContentTypeIds = calculateCintentTypeIds();
}
return fContentTypeIds;
}
-
+
private String[] calculateCintentTypeIds(){
IConfigurationElement el = getConfigurationElement();
IConfigurationElement children[] = el.getChildren();
@@ -80,10 +84,10 @@ public class LanguageDescriptor extends CExtensionDescriptor implements
ids = t;
}
}
-
+
return ids;
}
-
+
@Override
public String getId(){
if(fId == null)
@@ -91,26 +95,27 @@ public class LanguageDescriptor extends CExtensionDescriptor implements
return fId;
}
+ @Override
public IContentType[] getContentTypes() {
if(fContentTypes == null){
fContentTypes = calculateContentTypes(getContentTypeIds());
}
return fContentTypes;
}
-
+
private IContentType[] calculateContentTypes(String ids[]){
IContentType cTypes[] = new IContentType[ids.length];
if(ids.length > 0){
int num = 0;
- IContentTypeManager manager = Platform.getContentTypeManager();
-
+ IContentTypeManager manager = Platform.getContentTypeManager();
+
for (int k = 0; k < ids.length; ++k) {
IContentType langContType = manager.getContentType(ids[k]);
if(langContType != null)
cTypes[num++] = langContType;
}
-
+
if(num < ids.length){
IContentType tmp[] = new IContentType[num];
System.arraycopy(cTypes, 0, tmp, 0, num);
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryEntry.java
index 42a51f27d10..b156448dad1 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryEntry.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryEntry.java
@@ -25,7 +25,7 @@ public class LibraryEntry extends APathEntry implements ILibraryEntry {
IPath sourceAttachmentPrefixMapping;
/**
- *
+ *
* @param basePath
* @param baseRef
* @param libraryPath
@@ -58,6 +58,7 @@ public class LibraryEntry extends APathEntry implements ILibraryEntry {
*
* @return the path to the source archive or folder, or null
if none
*/
+ @Override
public IPath getSourceAttachmentPath() {
return sourceAttachmentPath;
}
@@ -72,10 +73,11 @@ public class LibraryEntry extends APathEntry implements ILibraryEntry {
* @return the path within the source archive or folder, or null
if
* not applicable
*/
+ @Override
public IPath getSourceAttachmentRootPath() {
return sourceAttachmentRootPath;
}
-
+
/**
* Returns the path to map the source paths with to the source achive or folder
* An empty path indicates that the is a one-to-one mapping of source paths to the
@@ -86,6 +88,7 @@ public class LibraryEntry extends APathEntry implements ILibraryEntry {
* @return the path mapping within the source archive or folder, or null
if
* not applicable
*/
+ @Override
public IPath getSourceAttachmentPrefixMapping() {
return sourceAttachmentPrefixMapping;
}
@@ -143,6 +146,7 @@ public class LibraryEntry extends APathEntry implements ILibraryEntry {
return super.equals(obj);
}
+ @Override
public IPath getFullLibraryPath() {
IPath p;
IPath lib = getLibraryPath();
@@ -178,6 +182,7 @@ public class LibraryEntry extends APathEntry implements ILibraryEntry {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ILibraryEntry#getLibraryPath()
*/
+ @Override
public IPath getLibraryPath() {
return libraryPath;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryReference.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryReference.java
index 159683f31e7..680093f7bd7 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryReference.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryReference.java
@@ -62,6 +62,7 @@ public class LibraryReference extends Parent implements ILibraryReference {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ILibraryReference#getLibraryEntry()
*/
+ @Override
public ILibraryEntry getLibraryEntry() {
return entry;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryReferenceArchive.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryReferenceArchive.java
index 48ac4a07d6e..b1c637ffd76 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryReferenceArchive.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryReferenceArchive.java
@@ -39,7 +39,7 @@ public class LibraryReferenceArchive extends Archive implements ILibraryReferenc
return null;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ICElement#getPath()
@@ -64,6 +64,7 @@ public class LibraryReferenceArchive extends Archive implements ILibraryReferenc
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ILibraryReference#getLibraryEntry()
*/
+ @Override
public ILibraryEntry getLibraryEntry() {
return entry;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryReferenceShared.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryReferenceShared.java
index 0a6c7582712..6f4e78aab24 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryReferenceShared.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/LibraryReferenceShared.java
@@ -9,7 +9,7 @@
* QNX Software Systems - Initial API and implementation
* Created on Apr 2, 2003
*
- * To change this generated comment go to
+ * To change this generated comment go to
* Window>Preferences>Java>Code Generation>Code Template
* /
*******************************************************************************/
@@ -79,6 +79,7 @@ public class LibraryReferenceShared extends Binary implements ILibraryReference
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ILibraryReference#getLibraryEntry()
*/
+ @Override
public ILibraryEntry getLibraryEntry() {
return entry;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Macro.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Macro.java
index 49c4aed6107..2d300d750e0 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Macro.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Macro.java
@@ -15,9 +15,9 @@ import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.IMacro;
public class Macro extends SourceManipulation implements IMacro {
-
+
private boolean fFunctionStyle = false;
-
+
public void setFunctionStyle(boolean isFunctionStyle) {
this.fFunctionStyle = isFunctionStyle;
}
@@ -26,10 +26,12 @@ public class Macro extends SourceManipulation implements IMacro {
super(parent, name, ICElement.C_MACRO);
}
+ @Override
public String getIdentifierList() {
return ""; //$NON-NLS-1$
}
+ @Override
public String getTokenSequence() {
return ""; //$NON-NLS-1$
}
@@ -39,6 +41,7 @@ public class Macro extends SourceManipulation implements IMacro {
return new SourceManipulationInfo(this);
}
+ @Override
public boolean isFunctionStyle() {
return fFunctionStyle;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MacroEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MacroEntry.java
index 0ea521a1376..d35450fb39d 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MacroEntry.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MacroEntry.java
@@ -32,6 +32,7 @@ public class MacroEntry extends APathEntry implements IMacroEntry {
* Returns the macro name.
* @return String
*/
+ @Override
public String getMacroName() {
return macroName;
}
@@ -40,6 +41,7 @@ public class MacroEntry extends APathEntry implements IMacroEntry {
* Returns the macro value.
* @return String
*/
+ @Override
public String getMacroValue() {
return macroValue;
}
@@ -84,7 +86,7 @@ public class MacroEntry extends APathEntry implements IMacroEntry {
}
return super.equals(obj);
}
-
+
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MacroFileEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MacroFileEntry.java
index 7d4091ed197..faef460f5cd 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MacroFileEntry.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MacroFileEntry.java
@@ -32,9 +32,10 @@ public class MacroFileEntry extends APathEntry implements IMacroFileEntry {
/**
* Returns the macro file path
- *
+ *
* @return IPath
*/
+ @Override
public IPath getMacroFilePath() {
return macroFilePath;
}
@@ -81,6 +82,7 @@ public class MacroFileEntry extends APathEntry implements IMacroFileEntry {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IIncludeEntry#getFullIncludePath()
*/
+ @Override
public IPath getFullMacroFilePath() {
IPath p;
IPath inc = getMacroFilePath();
@@ -95,7 +97,7 @@ public class MacroFileEntry extends APathEntry implements IMacroFileEntry {
p = loc.append(inc);
return p;
}
-
+
p = inc;
if (!p.isAbsolute()) {
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodDeclaration.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodDeclaration.java
index 920f2e42463..75df25f7350 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodDeclaration.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodDeclaration.java
@@ -19,7 +19,7 @@ import org.eclipse.cdt.core.model.IMethodDeclaration;
import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
public class MethodDeclaration extends FunctionDeclaration implements IMethodDeclaration{
-
+
boolean isConst = false;
boolean isConstructor = false;
boolean isDestructor = false;
@@ -31,11 +31,13 @@ public class MethodDeclaration extends FunctionDeclaration implements IMethodDec
public MethodDeclaration(ICElement parent, String name, int type){
super(parent, name, type);
}
-
+
+ @Override
public boolean isConstructor(){
return isConstructor;
}
+ @Override
public boolean isDestructor() {
return isDestructor;
}
@@ -48,10 +50,12 @@ public class MethodDeclaration extends FunctionDeclaration implements IMethodDec
this.isDestructor = isDestructor;
}
+ @Override
public boolean isOperator(){
return getElementName().startsWith("operator"); //$NON-NLS-1$
}
+ @Override
public boolean isPureVirtual() throws CModelException{
return getMethodInfo().isPureVirtual();
}
@@ -60,6 +64,7 @@ public class MethodDeclaration extends FunctionDeclaration implements IMethodDec
getMethodInfo().setPureVirtual(isPureVirtual);
}
+ @Override
public boolean isInline() throws CModelException{
return getMethodInfo().isInline();
}
@@ -68,6 +73,7 @@ public class MethodDeclaration extends FunctionDeclaration implements IMethodDec
getMethodInfo().setInline(isInline);
}
+ @Override
public boolean isVirtual() throws CModelException{
return getMethodInfo().isVirtual();
}
@@ -76,6 +82,7 @@ public class MethodDeclaration extends FunctionDeclaration implements IMethodDec
getMethodInfo().setVirtual(isVirtual);
}
+ @Override
public boolean isFriend() throws CModelException{
return getMethodInfo().isFriend();
}
@@ -94,23 +101,24 @@ public class MethodDeclaration extends FunctionDeclaration implements IMethodDec
this.isConst = isConst;
}
+ @Override
public ASTAccessVisibility getVisibility() throws CModelException{
return getMethodInfo().getVisibility();
}
-
+
public void setVisibility(ASTAccessVisibility visibility) throws CModelException{
getMethodInfo().setVisibility(visibility);
}
-
+
@Override
protected CElementInfo createElementInfo () {
return new MethodInfo(this);
}
-
+
protected MethodInfo getMethodInfo() throws CModelException{
return (MethodInfo) getElementInfo();
}
-
+
@Override
public boolean equals(Object other) {
if (other instanceof IMethodDeclaration) {
@@ -127,6 +135,6 @@ public class MethodDeclaration extends FunctionDeclaration implements IMethodDec
return false;
}
}
-
+
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodTemplate.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodTemplate.java
index 460a7128bfe..30bea0771a7 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodTemplate.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodTemplate.java
@@ -18,21 +18,23 @@ import org.eclipse.cdt.core.model.IMethodTemplate;
public class MethodTemplate extends Method implements IMethodTemplate {
protected Template fTemplate;
-
+
public MethodTemplate(ICElement parent, String name) {
super(parent, name, ICElement.C_TEMPLATE_METHOD);
fTemplate = new Template(name);
}
-
+
/**
* Returns the parameterTypes.
* @see org.eclipse.cdt.core.model.ITemplate#getTemplateParameterTypes()
* @return String[]
*/
+ @Override
public String[] getTemplateParameterTypes() {
return fTemplate.getTemplateParameterTypes();
}
+ @Override
public String[] getTemplateArguments() {
return fTemplate.getTemplateArguments();
}
@@ -48,22 +50,24 @@ public class MethodTemplate extends Method implements IMethodTemplate {
/**
* @see org.eclipse.cdt.core.model.ITemplate#getNumberOfTemplateParameters()
*/
+ @Override
public int getNumberOfTemplateParameters() {
return fTemplate.getNumberOfTemplateParameters();
}
/**
* @see org.eclipse.cdt.core.model.ITemplate#getTemplateSignature()
- */
+ */
/*
- * The signature in the outline view will be:
- * The class X followed by its template parameters,
- * then the scope resolution, then the function name,
- * followed by its template parameters, folowed by its
- * normal parameter list, then a colon then the function's
+ * The signature in the outline view will be:
+ * The class X followed by its template parameters,
+ * then the scope resolution, then the function name,
+ * followed by its template parameters, folowed by its
+ * normal parameter list, then a colon then the function's
* return type.
- */
+ */
+ @Override
public String getTemplateSignature() throws CModelException {
StringBuffer sig = new StringBuffer(fTemplate.getTemplateSignature());
sig.append(this.getParameterClause());
@@ -72,11 +76,11 @@ public class MethodTemplate extends Method implements IMethodTemplate {
if(isVolatile())
sig.append(" volatile"); //$NON-NLS-1$
- if((this.getReturnType() != null) && (this.getReturnType().length() > 0)){
+ if((this.getReturnType() != null) && (this.getReturnType().length() > 0)){
sig.append(" : "); //$NON-NLS-1$
sig.append(this.getReturnType());
}
-
+
return sig.toString();
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodTemplateDeclaration.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodTemplateDeclaration.java
index 083f5c0f5db..dc1135ee76e 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodTemplateDeclaration.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/MethodTemplateDeclaration.java
@@ -24,14 +24,17 @@ public class MethodTemplateDeclaration extends MethodDeclaration implements IMet
fTemplate = new Template(name);
}
+ @Override
public String[] getTemplateParameterTypes() {
return fTemplate.getTemplateParameterTypes();
}
+ @Override
public String[] getTemplateArguments() {
return fTemplate.getTemplateArguments();
}
+ @Override
public String getTemplateSignature() throws CModelException {
StringBuffer sig = new StringBuffer(fTemplate.getTemplateSignature());
sig.append(this.getParameterClause());
@@ -40,15 +43,16 @@ public class MethodTemplateDeclaration extends MethodDeclaration implements IMet
if(isVolatile())
sig.append(" volatile"); //$NON-NLS-1$
- if((this.getReturnType() != null) && (this.getReturnType().length() > 0)){
+ if((this.getReturnType() != null) && (this.getReturnType().length() > 0)){
sig.append(" : "); //$NON-NLS-1$
sig.append(this.getReturnType());
}
-
+
return sig.toString();
}
+ @Override
public int getNumberOfTemplateParameters() {
return fTemplate.getNumberOfTemplateParameters();
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Namespace.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Namespace.java
index 52524b8e2af..c62ecc3cf4d 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Namespace.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Namespace.java
@@ -27,6 +27,7 @@ public class Namespace extends SourceManipulation implements INamespace{
* Returns the typeName.
* @return String
*/
+ @Override
public String getTypeName() {
return typeName;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/NullBinaryParser.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/NullBinaryParser.java
index 625bc43d97e..763499babdc 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/NullBinaryParser.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/NullBinaryParser.java
@@ -25,6 +25,7 @@ public class NullBinaryParser extends PlatformObject implements IBinaryParser {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.IBinaryParser#getBinary(org.eclipse.core.runtime.IPath)
*/
+ @Override
public IBinaryFile getBinary(byte[] data, IPath path) throws IOException {
throw new IOException(CCorePlugin.getResourceString("CoreModel.NullBinaryParser.Not_binary_file")); //$NON-NLS-1$
}
@@ -32,6 +33,7 @@ public class NullBinaryParser extends PlatformObject implements IBinaryParser {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.IBinaryParser#getBinary(org.eclipse.core.runtime.IPath)
*/
+ @Override
public IBinaryFile getBinary(IPath path) throws IOException {
throw new IOException(CCorePlugin.getResourceString("CoreModel.NullBinaryParser.Not_binary_file")); //$NON-NLS-1$
}
@@ -39,6 +41,7 @@ public class NullBinaryParser extends PlatformObject implements IBinaryParser {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.IBinaryParser#getFormat()
*/
+ @Override
public String getFormat() {
return CCorePlugin.getResourceString("CoreModel.NullBinaryParser.Null_Format"); //$NON-NLS-1$
}
@@ -46,6 +49,7 @@ public class NullBinaryParser extends PlatformObject implements IBinaryParser {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.IBinaryParser#isBinary(byte[], org.eclipse.core.runtime.IPath)
*/
+ @Override
public boolean isBinary(byte[] array, IPath path) {
return false;
}
@@ -53,6 +57,7 @@ public class NullBinaryParser extends PlatformObject implements IBinaryParser {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.IBinaryParser#getBufferSize()
*/
+ @Override
public int getHintBufferSize() {
return 0;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Openable.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Openable.java
index c2f1fa6d455..d305e3c5177 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Openable.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Openable.java
@@ -9,7 +9,7 @@
* QNX Software Systems - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.core.model;
-
+
import java.util.Enumeration;
import java.util.Map;
@@ -27,7 +27,7 @@ import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
public abstract class Openable extends Parent implements IOpenable {
- protected IResource resource;
+ protected IResource resource;
public Openable(ICElement parent, IPath path, int type) {
// Check if the file is under the workspace.
@@ -38,7 +38,7 @@ public abstract class Openable extends Parent implements IOpenable {
public Openable(ICElement parent, IResource resource, int type) {
this(parent, resource, resource.getName(), type);
}
-
+
public Openable(ICElement parent, IResource res, String name, int type) {
super(parent, name, type);
resource = res;
@@ -57,6 +57,7 @@ public abstract class Openable extends Parent implements IOpenable {
*
* @see IBufferChangedListener
*/
+ @Override
public void bufferChanged(BufferChangedEvent event) {
if (event.getBuffer().isClosed()) {
CModelManager.getDefault().getElementsOutOfSynchWithBuffers().remove(this);
@@ -64,7 +65,7 @@ public abstract class Openable extends Parent implements IOpenable {
} else {
CModelManager.getDefault().getElementsOutOfSynchWithBuffers().put(this, this);
}
- }
+ }
/**
* Builds this element's structure and properties in the given
@@ -103,6 +104,7 @@ public abstract class Openable extends Parent implements IOpenable {
/**
* @see org.eclipse.cdt.core.model.IOpenable#getBuffer()
*/
+ @Override
public IBuffer getBuffer() throws CModelException {
if (hasBuffer()) {
// ensure element is open
@@ -132,7 +134,7 @@ public abstract class Openable extends Parent implements IOpenable {
protected BufferManager getBufferManager() {
return BufferManager.getDefaultBufferManager();
}
-
+
/**
* Returns true if this element may have an associated source buffer,
* otherwise false. Subclasses must override as required.
@@ -143,6 +145,7 @@ public abstract class Openable extends Parent implements IOpenable {
/**
* @see org.eclipse.cdt.core.model.IOpenable#hasUnsavedChanges()
*/
+ @Override
public boolean hasUnsavedChanges() throws CModelException{
if (isReadOnly() || !isOpen()) {
return false;
@@ -165,22 +168,24 @@ public abstract class Openable extends Parent implements IOpenable {
}
}
}
-
+
return false;
}
/**
* Subclasses must override as required.
- *
+ *
* @see org.eclipse.cdt.core.model.IOpenable#isConsistent()
*/
+ @Override
public boolean isConsistent() throws CModelException {
return true;
}
/**
* @see org.eclipse.cdt.core.model.IOpenable#isOpen()
- */
+ */
+ @Override
public boolean isOpen() {
return CModelManager.getDefault().getInfo(this) != null;
}
@@ -203,10 +208,12 @@ public abstract class Openable extends Parent implements IOpenable {
/**
* @see org.eclipse.cdt.core.model.IOpenable#makeConsistent(IProgressMonitor)
*/
+ @Override
public void makeConsistent(IProgressMonitor pm) throws CModelException {
makeConsistent(pm, false);
}
-
+
+ @Override
public void makeConsistent(IProgressMonitor monitor, boolean forced) throws CModelException {
// only translation units can be inconsistent
// other openables cannot be inconsistent so default is to do nothing
@@ -215,6 +222,7 @@ public abstract class Openable extends Parent implements IOpenable {
/**
* @see org.eclipse.cdt.core.model.IOpenable#open(IProgressMonitor)
*/
+ @Override
public void open(IProgressMonitor pm) throws CModelException {
getElementInfo(pm);
}
@@ -249,7 +257,7 @@ public abstract class Openable extends Parent implements IOpenable {
if (CModelManager.VERBOSE){
System.out.println("OPENING Element ("+ Thread.currentThread()+"): " + this); //$NON-NLS-1$//$NON-NLS-2$
}
-
+
// open the parent if necessary
openParent(info, newElements, monitor);
if (monitor != null && monitor.isCanceled())
@@ -268,7 +276,7 @@ public abstract class Openable extends Parent implements IOpenable {
newElements.remove(this);
throw e;
}
-
+
// remove out of sync buffer for this element
CModelManager.getDefault().getElementsOutOfSynchWithBuffers().remove(this);
}
@@ -276,6 +284,7 @@ public abstract class Openable extends Parent implements IOpenable {
/**
* @see org.eclipse.cdt.core.model.IOpenable#save(IProgressMonitor, boolean)
*/
+ @Override
public void save(IProgressMonitor pm, boolean force) throws CModelException {
IResource res = getResource();
if (res != null) {
@@ -289,7 +298,7 @@ public abstract class Openable extends Parent implements IOpenable {
throw new CModelException(new CModelStatus(ICModelStatusConstants.READ_ONLY, this));
}
IBuffer buf = getBuffer();
- if (buf != null) {
+ if (buf != null) {
buf.save(pm, force);
this.makeConsistent(pm); // update the element info of this element
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntry.java
index b308cf25b3f..0c5f610cd13 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntry.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntry.java
@@ -28,27 +28,30 @@ public class PathEntry implements IPathEntry {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.IPathEntry#getEntryKind()
*/
+ @Override
public IPath getPath() {
return path;
}
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.IPathEntry#getEntryKind()
*/
+ @Override
public int getEntryKind() {
return entryKind;
}
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.IPathEntry#isExported()
*/
+ @Override
public boolean isExported() {
return isExported;
}
@@ -80,7 +83,7 @@ public class PathEntry implements IPathEntry {
}
return super.equals(obj);
}
-
+
/**
* Returns the kind from its String
form.
*/
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryManager.java
index 68e2035a743..a85ebce90c0 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryManager.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryManager.java
@@ -114,7 +114,7 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
// Synchronized the access of the cache entries.
protected Map> resolvedMap = new Hashtable>();
private Map resolvedInfoMap = new Hashtable();
- private ThreadLocalMap resolveInfoValidState = new ThreadLocalMap();
+ private ThreadLocalMap resolveInfoValidState = new ThreadLocalMap();
// Accessing the map is synch with the class
private Map storeMap = new HashMap();
@@ -122,7 +122,7 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
private static PathEntryManager pathEntryManager;
protected ConcurrentLinkedQueue markerProblems = new ConcurrentLinkedQueue();
-
+
//Setting up a generate markers job, it does not get scheduled
Job markerTask = new GenerateMarkersJob("PathEntry Marker Job"); //$NON-NLS-1$
@@ -132,11 +132,11 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
private class PathEntryProblem {
IProject project;
ICModelStatus[] problems;
-
+
public PathEntryProblem(IProject project, ICModelStatus[] problems) {
this.project = project;
this.problems = problems;
- }
+ }
}
private class PathEntryContainerLock implements IPathEntryContainer {
@@ -153,27 +153,30 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.model.IPathEntryContainer#getPathEntries()
*/
+ @Override
public IPathEntry[] getPathEntries() {
return NO_PATHENTRIES;
}
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.model.IPathEntryContainer#getDescription()
*/
+ @Override
public String getDescription() {
return new String("Lock container"); //$NON-NLS-1$
}
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.model.IPathEntryContainer#getPath()
*/
+ @Override
public IPath getPath() {
return Path.EMPTY;
}
@@ -294,8 +297,8 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
IMacroEntry[] macros = macroList.toArray(new IMacroEntry[macroList.size()]);
macroList.clear();
-
- // For the macros the closest symbol will override
+
+ // For the macros the closest symbol will override
// /projec/src/file.c --> NDEBUG=1
// /project/src --> NDEBUG=0
//
@@ -387,7 +390,7 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
// includes with the closest match to the resource will come first
// /project/src/file.c --> /usr/local/include
// /project --> /usr/include
- //
+ //
// /usr/local/include must come first.
//
int count = resPath.segmentCount();
@@ -422,7 +425,7 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
}
}
}
- return entryList;
+ return entryList;
}
/**
@@ -440,7 +443,7 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
}
return null;
}
-
+
public PathEntryResolveInfo getResolveInfo(ICProject cproject, boolean useCache) throws CModelException{
PathEntryResolveInfo info = resolvedInfoMap.get(cproject);
if (info == null && useCache){
@@ -450,20 +453,20 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
if (info == null || !useCache || !getResolveInfoValidState(cproject)){
Object[] resolved = getResolvedPathEntries(cproject, false, false);
if (resolved != null)
- info = (PathEntryResolveInfo)resolved[1];
+ info = (PathEntryResolveInfo)resolved[1];
}
return info;
}
-
+
private void setResolveInfoValidState(ICProject cproject, boolean valid){
Object v = valid ? null : Boolean.FALSE;
resolveInfoValidState.set(cproject, v);
}
-
+
private boolean getResolveInfoValidState(ICProject cproject){
return resolveInfoValidState.get(cproject) == null;
}
-
+
protected IPathEntry[] removeCachedResolvedPathEntries(ICProject cproject) {
ArrayList resolvedListEntries = resolvedMap.remove(cproject);
resolvedInfoMap.remove(cproject);
@@ -523,7 +526,7 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
/**
* This method will not expand container extending IPathEntryContainerExtension
- *
+ *
* @param cproject
* @param generateMarkers
* @return
@@ -745,12 +748,14 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
// causing some grief
SafeRunner.run(new ISafeRunnable() {
+ @Override
public void handleException(Throwable exception) {
- IStatus status = new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID,
+ IStatus status = new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID,
"Exception occurred in container initializer: " + initializer, exception); //$NON-NLS-1$
CCorePlugin.log(status);
}
+ @Override
public void run() throws Exception {
initializer.initialize(containerPath, project);
ok[0] = true;
@@ -777,7 +782,7 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
* A containerID is the first segment of any container path, used to
* identify the registered container initializer.
*
- *
+ *
* @param containerID -
* a containerID identifying a registered initializer
* @return PathEntryContainerInitializer - the registered container
@@ -1011,7 +1016,7 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
throw new CModelException(e);
}
}
-
+
/**
* Collects path entry errors for each project and generate error markers for these errors
* @param project - Project with path entry errors
@@ -1031,7 +1036,7 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
}
@Override
- public IStatus runInWorkspace(IProgressMonitor monitor) {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
while (markerProblems.peek() != null && !monitor.isCanceled()) {
PathEntryProblem problem = markerProblems.poll();
IProject project = problem.project;
@@ -1044,7 +1049,7 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
return Status.OK_STATUS;
}
}
-
+
private boolean needDelta(ICProject cproject){
try {
PathEntryStoreProxy store = (PathEntryStoreProxy)getPathEntryStore(cproject.getProject(), false);
@@ -1172,7 +1177,7 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
flag = ICElementDelta.F_CHANGED_PATHENTRY_INCLUDE;
break;
}
- case IPathEntry.CDT_MACRO: {
+ case IPathEntry.CDT_MACRO: {
IMacroEntry macro = (IMacroEntry)entry;
IPath path = macro.getPath();
celement = CoreModel.getDefault().create(path);
@@ -1286,7 +1291,7 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
// }
// return store;
}
-
+
// private IPathEntryStore createDefaultStore(IProject project){
// if (CProjectDescriptionManager.getInstance().isNewStyleIndexCfg(project)){
// return new ConfigBasedPathEntryStore(project);
@@ -1296,9 +1301,10 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.resources.IPathEntryStoreListener#pathEntryStoreChanged(org.eclipse.cdt.core.resources.PathEntryChangedEvent)
*/
+ @Override
public void pathEntryStoreChanged(PathEntryStoreChangedEvent event) {
IProject project = event.getProject();
@@ -1329,9 +1335,10 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.model.IElementChangedListener#elementChanged(org.eclipse.cdt.core.model.ElementChangedEvent)
*/
+ @Override
public void elementChanged(ElementChangedEvent event) {
try {
if (processDelta(event.getDelta()) == true) {
@@ -1369,7 +1376,7 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
protected boolean processDelta(ICElementDelta delta) throws CModelException {
int kind = delta.getKind();
ICElement element = delta.getElement();
- int type = element.getElementType();
+ int type = element.getElementType();
// handle open, closing and removing of projects
if ( type == ICElement.C_PROJECT) {
@@ -1392,11 +1399,11 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
containerRemove(cproject);
}
}
- }
+ }
return true;
}
// project change, traverse children.
- }
+ }
if (element instanceof IWorkingCopy) {
return false;
}
@@ -1464,7 +1471,7 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
updatePathEntry.schedule();
}
}
-
+
public ICModelStatus validatePathEntry(ICProject cProject, IPathEntry[] entries) {
return PathEntryUtil.validatePathEntry(cProject, entries);
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryStoreProxy.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryStoreProxy.java
index c47e8e4d7a5..1982e27b43b 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryStoreProxy.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryStoreProxy.java
@@ -30,12 +30,12 @@ import org.eclipse.core.runtime.CoreException;
public class PathEntryStoreProxy extends AbstractCExtensionProxy implements IPathEntryStore, IPathEntryStoreListener {
private List fListeners;
private IPathEntryStore fStore;
-
+
public PathEntryStoreProxy(IProject project){
super(project, PathEntryManager.PATHENTRY_STORE_UNIQ_ID);
fListeners = Collections.synchronizedList(new ArrayList());
}
-
+
public IPathEntryStore getStore(){
providerRequested();
return fStore;
@@ -43,13 +43,15 @@ public class PathEntryStoreProxy extends AbstractCExtensionProxy implements IPat
/* (non-Javadoc)
* @see org.eclipse.cdt.core.resources.IPathEntryStore#addPathEntryStoreListener(org.eclipse.cdt.core.resources.IPathEntryStoreListener)
*/
- public void addPathEntryStoreListener(IPathEntryStoreListener listener) {
+ @Override
+ public void addPathEntryStoreListener(IPathEntryStoreListener listener) {
fListeners.add(listener);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.resources.IPathEntryStore#removePathEntryStoreListener(org.eclipse.cdt.core.resources.IPathEntryStoreListener)
*/
+ @Override
public void removePathEntryStoreListener(IPathEntryStoreListener listener) {
fListeners.remove(listener);
}
@@ -58,7 +60,7 @@ public class PathEntryStoreProxy extends AbstractCExtensionProxy implements IPat
PathEntryStoreChangedEvent evt = new PathEntryStoreChangedEvent(this, project, PathEntryStoreChangedEvent.CONTENT_CHANGED);
notifyListeners(evt);
}
-
+
private void notifyListeners(PathEntryStoreChangedEvent evt){
IPathEntryStoreListener[] observers = new IPathEntryStoreListener[fListeners.size()];
fListeners.toArray(observers);
@@ -86,30 +88,35 @@ public class PathEntryStoreProxy extends AbstractCExtensionProxy implements IPat
return super.getProject();
}
+ @Override
public ICExtensionReference getExtensionReference() {
//TODO: calculate
return null;
}
+ @Override
public ICConfigExtensionReference getConfigExtensionReference() {
return null;
}
+ @Override
public IPathEntry[] getRawPathEntries() throws CoreException {
providerRequested();
return fStore.getRawPathEntries();
}
+ @Override
public void setRawPathEntries(IPathEntry[] entries) throws CoreException {
providerRequested();
fStore.setRawPathEntries(entries);
}
+ @Override
public void pathEntryStoreChanged(PathEntryStoreChangedEvent event) {
notifyListeners(event);
}
-
+
@Override
protected Object createDefaultProvider(ICConfigurationDescription cfgDes,
boolean newStile) {
@@ -148,10 +155,10 @@ public class PathEntryStoreProxy extends AbstractCExtensionProxy implements IPat
@Override
protected boolean doHandleEvent(CProjectDescriptionEvent event) {
IPathEntryStore oldStore = fStore;
- boolean result = super.doHandleEvent(event);
+ boolean result = super.doHandleEvent(event);
if(!result)
postProcessProviderChange(fStore, oldStore);
-
+
return result;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ProgressMonitorAndCanceler.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ProgressMonitorAndCanceler.java
index 2f605a2d291..a7a08f869db 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ProgressMonitorAndCanceler.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ProgressMonitorAndCanceler.java
@@ -16,24 +16,25 @@ import org.eclipse.core.runtime.NullProgressMonitor;
/**
* A progress monitor accepting a ICancelable
object to receive the cancel request.
- *
+ *
* @since 5.0
*/
public class ProgressMonitorAndCanceler extends NullProgressMonitor implements ICanceler {
private ICancelable fCancelable;
+ @Override
public void setCancelable(ICancelable cancelable) {
fCancelable= cancelable;
checkCanceled();
}
-
+
@Override
public void setCanceled(boolean canceled) {
super.setCanceled(canceled);
checkCanceled();
}
-
+
private void checkCanceled() {
if (fCancelable != null && isCanceled()) {
fCancelable.cancel();
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Region.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Region.java
index 565b706e310..049eaf787de 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Region.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Region.java
@@ -32,7 +32,7 @@ public class Region implements IRegion {
/**
* Creates an empty region.
- *
+ *
* @see IRegion
*/
public Region() {
@@ -42,6 +42,7 @@ public class Region implements IRegion {
/**
* @see IRegion#add(ICElement)
*/
+ @Override
public void add(ICElement element) {
if (!contains(element)) {
// "new" element added to region
@@ -54,6 +55,7 @@ public class Region implements IRegion {
/**
* @see IRegion
*/
+ @Override
public boolean contains(ICElement element) {
int size = fRootElements.size();
@@ -77,7 +79,7 @@ public class Region implements IRegion {
/**
* Returns a collection of all the parents of this element in bottom-up
* order.
- *
+ *
*/
private ArrayList getAncestors(ICElement element) {
ArrayList parents = new ArrayList();
@@ -93,6 +95,7 @@ public class Region implements IRegion {
/**
* @see IRegion
*/
+ @Override
public ICElement[] getElements() {
int size = fRootElements.size();
ICElement[] roots = new ICElement[size];
@@ -106,6 +109,7 @@ public class Region implements IRegion {
/**
* @see IRegion#remove(ICElement)
*/
+ @Override
public boolean remove(ICElement element) {
removeAllChildren(element);
@@ -115,7 +119,7 @@ public class Region implements IRegion {
/**
* Removes any children of this element that are contained within this
* region as this parent is about to be added to the region.
- *
+ *
*
* Children are all children, not just direct children.
*/
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulation.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulation.java
index 389bb1f97f0..aa4957e8f8f 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulation.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceManipulation.java
@@ -52,6 +52,7 @@ public class SourceManipulation extends Parent implements ISourceManipulation, I
/**
* @see ISourceManipulation
*/
+ @Override
public void copy(ICElement container, ICElement sibling, String rename, boolean force,
IProgressMonitor monitor) throws CModelException {
if (container == null) {
@@ -73,6 +74,7 @@ public class SourceManipulation extends Parent implements ISourceManipulation, I
/**
* @see ISourceManipulation
*/
+ @Override
public void delete(boolean force, IProgressMonitor monitor) throws CModelException {
ICElement[] elements = new ICElement[] {this};
getCModel().delete(elements, force, monitor);
@@ -81,6 +83,7 @@ public class SourceManipulation extends Parent implements ISourceManipulation, I
/**
* @see ISourceManipulation
*/
+ @Override
public void move(ICElement container, ICElement sibling, String rename, boolean force,
IProgressMonitor monitor) throws CModelException {
if (container == null) {
@@ -102,6 +105,7 @@ public class SourceManipulation extends Parent implements ISourceManipulation, I
/**
* @see ISourceManipulation
*/
+ @Override
public void rename(String name, boolean force, IProgressMonitor monitor) throws CModelException {
if (name == null) {
throw new IllegalArgumentException("element.nullName"); //$NON-NLS-1$
@@ -115,6 +119,7 @@ public class SourceManipulation extends Parent implements ISourceManipulation, I
/**
* @see IMember
*/
+ @Override
public ITranslationUnit getTranslationUnit() {
try {
return getSourceManipulationInfo().getTranslationUnit();
@@ -152,6 +157,7 @@ public class SourceManipulation extends Parent implements ISourceManipulation, I
/**
* @see ISourceReference
*/
+ @Override
public String getSource() throws CModelException {
return getSourceManipulationInfo().getSource();
}
@@ -159,6 +165,7 @@ public class SourceManipulation extends Parent implements ISourceManipulation, I
/**
* @see ISourceReference
*/
+ @Override
public ISourceRange getSourceRange() throws CModelException {
return getSourceManipulationInfo().getSourceRange();
}
@@ -175,7 +182,7 @@ public class SourceManipulation extends Parent implements ISourceManipulation, I
public IResource getResource() {
return null;
}
-
+
@Override
protected CElementInfo createElementInfo () {
return new SourceManipulationInfo(this);
@@ -184,9 +191,9 @@ public class SourceManipulation extends Parent implements ISourceManipulation, I
protected SourceManipulationInfo getSourceManipulationInfo() throws CModelException {
return (SourceManipulationInfo)getElementInfo();
}
-
+
public boolean isIdentical(SourceManipulation other) throws CModelException{
- return (this.equals(other)
+ return (this.equals(other)
&& (this.getSourceManipulationInfo().hasSameContentsAs(other.getSourceManipulationInfo())));
}
@@ -199,7 +206,7 @@ public class SourceManipulation extends Parent implements ISourceManipulation, I
if (openableParent == null) {
return;
}
-
+
newElements.put(this, info);
CElementInfo openableParentInfo = (CElementInfo) CModelManager.getDefault().getInfo(openableParent);
@@ -215,7 +222,7 @@ public class SourceManipulation extends Parent implements ISourceManipulation, I
//
}
}
-
+
public void setIdPos(int startPos, int length) {
try {
getSourceManipulationInfo().setIdPos(startPos, length);
@@ -301,7 +308,7 @@ public class SourceManipulation extends Parent implements ISourceManipulation, I
case ICElement.C_TEMPLATE_METHOD:
case ICElement.C_TEMPLATE_METHOD_DECLARATION:
for (ICElement element2 : children) {
- if (elementType == element2.getElementType()
+ if (elementType == element2.getElementType()
&& elementName.equals(element2.getElementName())) {
assert element2 instanceof IFunctionDeclaration;
String[] functionParams= ((IFunctionDeclaration)element2).getParameterTypes();
@@ -316,7 +323,7 @@ public class SourceManipulation extends Parent implements ISourceManipulation, I
case ICElement.C_TEMPLATE_STRUCT:
case ICElement.C_TEMPLATE_UNION:
for (ICElement element2 : children) {
- if (elementType == element2.getElementType()
+ if (elementType == element2.getElementType()
&& elementName.equals(element2.getElementName())) {
assert element2 instanceof ITemplate;
String[] templateParams= ((ITemplate)element2).getTemplateParameterTypes();
@@ -329,7 +336,7 @@ public class SourceManipulation extends Parent implements ISourceManipulation, I
break;
default:
for (ICElement element2 : children) {
- if (elementType == element2.getElementType()
+ if (elementType == element2.getElementType()
&& elementName.equals(element2.getElementName())) {
element= (CElement) element2;
break;
@@ -362,14 +369,16 @@ public class SourceManipulation extends Parent implements ISourceManipulation, I
return CElement.CEM_SOURCEELEMENT;
}
+ @Override
public boolean isActive() {
return fIsActive;
}
+ @Override
public int getIndex() {
return fIndex;
}
-
+
public void setActive(boolean active) {
fIsActive= active;
}
@@ -377,12 +386,12 @@ public class SourceManipulation extends Parent implements ISourceManipulation, I
public void setIndex(int i) {
fIndex= (short) i;
}
-
+
@Override
public int hashCode() {
return Util.combineHashCodes(fIndex, super.hashCode());
}
-
+
@Override
public boolean equals(Object other) {
if (other instanceof ISourceReference) {
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceRange.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceRange.java
index 82cf253af0f..9e4a982b190 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceRange.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceRange.java
@@ -50,6 +50,7 @@ class SourceRange implements ISourceRange {
/**
* @see ISourceRange
*/
+ @Override
public int getLength() {
return length;
}
@@ -57,24 +58,29 @@ class SourceRange implements ISourceRange {
/**
* @see ISourceRange
*/
+ @Override
public int getStartPos() {
return startPos;
}
/**
*/
+ @Override
public int getIdStartPos() {
return idStartPos;
}
+ @Override
public int getIdLength() {
return idLength;
}
+ @Override
public int getStartLine() {
return startLine;
}
+ @Override
public int getEndLine() {
return endLine;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceRoot.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceRoot.java
index 2334508fabc..c4fafe18743 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceRoot.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/SourceRoot.java
@@ -50,6 +50,7 @@ public class SourceRoot extends CContainer implements ISourceRoot {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ISourceRoot#isOnclasspath(org.eclipse.cdt.core.model.ICElement)
*/
+ @Override
public boolean isOnSourceEntry(ICElement element) {
IPath path = element.getPath();
return this.isOnSourceEntry(path);
@@ -58,13 +59,15 @@ public class SourceRoot extends CContainer implements ISourceRoot {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ISourceRoot#isOnSourceEntry(org.eclipse.core.resources.IResource)
*/
+ @Override
public boolean isOnSourceEntry(IResource res) {
IPath path = res.getFullPath();
return isOnSourceEntry(path);
}
+ @Override
public boolean isOnSourceEntry(IPath path) {
- if (sourceEntry.getFullPath().isPrefixOf(path)
+ if (sourceEntry.getFullPath().isPrefixOf(path)
&& !CoreModelUtil.isExcluded(path, sourceEntry.fullExclusionPatternChars())) {
return true;
}
@@ -86,7 +89,7 @@ public class SourceRoot extends CContainer implements ISourceRoot {
}
((CElement)getParent()).getHandleMemento(buff);
buff.append(getHandleMementoDelimiter());
- escapeMementoName(buff, path.toString());
+ escapeMementoName(buff, path.toString());
}
/**
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Structure.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Structure.java
index 295e289104d..342a0bf3006 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Structure.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Structure.java
@@ -24,19 +24,21 @@ import org.eclipse.cdt.core.model.IStructure;
import org.eclipse.cdt.core.parser.ast.ASTAccessVisibility;
public class Structure extends StructureDeclaration implements IStructure {
-
+
Map superClassesNames = new TreeMap();
public Structure(ICElement parent, int kind, String name) {
super(parent, name, kind);
}
+ @Override
public IField[] getFields() throws CModelException {
List fields = new ArrayList();
fields.addAll(getChildrenOfType(ICElement.C_FIELD));
return fields.toArray(new IField[fields.size()]);
}
+ @Override
public IField getField(String name) {
try {
IField[] fields = getFields();
@@ -50,6 +52,7 @@ public class Structure extends StructureDeclaration implements IStructure {
return null;
}
+ @Override
public IMethodDeclaration[] getMethods() throws CModelException {
List methods = new ArrayList();
methods.addAll(getChildrenOfType(ICElement.C_METHOD_DECLARATION));
@@ -57,6 +60,7 @@ public class Structure extends StructureDeclaration implements IStructure {
return methods.toArray(new IMethodDeclaration[methods.size()]);
}
+ @Override
public IMethodDeclaration getMethod(String name) {
try {
IMethodDeclaration[] methods = getMethods();
@@ -70,6 +74,7 @@ public class Structure extends StructureDeclaration implements IStructure {
return null;
}
+ @Override
public boolean isAbstract() throws CModelException {
IMethodDeclaration[] methods = getMethods();
for (IMethodDeclaration method : methods) {
@@ -79,14 +84,16 @@ public class Structure extends StructureDeclaration implements IStructure {
return false;
}
+ @Override
public String[] getSuperClassesNames(){
return superClassesNames.keySet().toArray(new String[superClassesNames.keySet().size()]);
}
+ @Override
public ASTAccessVisibility getSuperClassAccess(String name){
return superClassesNames.get(name);
}
-
+
public void addSuperClass(String name) {
superClassesNames.put(name, ASTAccessVisibility.PUBLIC);
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/StructureDeclaration.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/StructureDeclaration.java
index 2d1ec33a8e9..6d15e29e56a 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/StructureDeclaration.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/StructureDeclaration.java
@@ -24,6 +24,7 @@ public class StructureDeclaration extends SourceManipulation implements IStructu
super(parent, name, kind);
}
+ @Override
public String getTypeName() throws CModelException {
return getStructureInfo().getTypeName();
}
@@ -32,14 +33,17 @@ public class StructureDeclaration extends SourceManipulation implements IStructu
getStructureInfo().setTypeName(type);
}
+ @Override
public boolean isUnion() throws CModelException {
return getStructureInfo().isUnion();
}
+ @Override
public boolean isClass() throws CModelException {
return getStructureInfo().isClass();
}
+ @Override
public boolean isStruct() throws CModelException {
return getStructureInfo().isStruct();
}
@@ -56,6 +60,7 @@ public class StructureDeclaration extends SourceManipulation implements IStructu
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IDeclaration#isStatic()
*/
+ @Override
public boolean isStatic() throws CModelException {
return getStructureInfo().isStatic();
}
@@ -63,6 +68,7 @@ public class StructureDeclaration extends SourceManipulation implements IStructu
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IDeclaration#isConst()
*/
+ @Override
public boolean isConst() throws CModelException {
return getStructureInfo().isConst();
}
@@ -70,6 +76,7 @@ public class StructureDeclaration extends SourceManipulation implements IStructu
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IDeclaration#isVolatile()
*/
+ @Override
public boolean isVolatile() throws CModelException {
return getStructureInfo().isVolatile();
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/StructureTemplate.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/StructureTemplate.java
index a2460e76eb5..8e435caf05b 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/StructureTemplate.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/StructureTemplate.java
@@ -17,7 +17,7 @@ import org.eclipse.cdt.core.model.IStructureTemplate;
public class StructureTemplate extends Structure implements IStructureTemplate {
protected Template fTemplate;
-
+
public StructureTemplate(ICElement parent, int kind, String name) {
super(parent, kind, name);
fTemplate = new Template(name);
@@ -27,10 +27,12 @@ public class StructureTemplate extends Structure implements IStructureTemplate {
* @see org.eclipse.cdt.core.model.ITemplate#getTemplateParameterTypes()
* @return String[]
*/
+ @Override
public String[] getTemplateParameterTypes() {
return fTemplate.getTemplateParameterTypes();
}
+ @Override
public String[] getTemplateArguments() {
return fTemplate.getTemplateArguments();
}
@@ -46,13 +48,15 @@ public class StructureTemplate extends Structure implements IStructureTemplate {
/**
* @see org.eclipse.cdt.core.model.ITemplate#getNumberOfTemplateParameters()
*/
+ @Override
public int getNumberOfTemplateParameters() {
return fTemplate.getNumberOfTemplateParameters();
}
/**
* @see org.eclipse.cdt.core.model.ITemplate#getTemplateSignature()
- */
+ */
+ @Override
public String getTemplateSignature() {
return fTemplate.getTemplateSignature();
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/StructureTemplateDeclaration.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/StructureTemplateDeclaration.java
index 5c20c5de040..ca3ade5f4b5 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/StructureTemplateDeclaration.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/StructureTemplateDeclaration.java
@@ -25,10 +25,12 @@ public class StructureTemplateDeclaration extends StructureDeclaration implement
fTemplate = new Template(name);
}
+ @Override
public String[] getTemplateParameterTypes() {
return fTemplate.getTemplateParameterTypes();
}
+ @Override
public String[] getTemplateArguments() {
return fTemplate.getTemplateArguments();
}
@@ -37,10 +39,12 @@ public class StructureTemplateDeclaration extends StructureDeclaration implement
fTemplate.setTemplateInfo(templateParameterTypes, null);
}
+ @Override
public String getTemplateSignature() throws CModelException {
return fTemplate.getTemplateSignature();
}
+ @Override
public int getNumberOfTemplateParameters() {
return fTemplate.getNumberOfTemplateParameters();
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Template.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Template.java
index 56b1c162177..6aecf587947 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Template.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Template.java
@@ -18,7 +18,7 @@ public class Template implements ITemplate {
protected String[] fTemplateParameterTypes;
protected String[] fTemplateArgs;
protected String fName;
-
+
public Template(String name) {
fName = name;
fTemplateParameterTypes= fgEmptyList;
@@ -29,10 +29,12 @@ public class Template implements ITemplate {
* @see org.eclipse.cdt.core.model.ITemplate#getTemplateParameterTypes()
* @return String[]
*/
+ @Override
public String[] getTemplateParameterTypes() {
return fTemplateParameterTypes;
}
+ @Override
public String[] getTemplateArguments() {
return fTemplateArgs;
}
@@ -48,13 +50,15 @@ public class Template implements ITemplate {
}
}
+ @Override
public int getNumberOfTemplateParameters() {
return fTemplateParameterTypes == null ? 0 : fTemplateParameterTypes.length;
}
/**
* @see org.eclipse.cdt.core.model.ITemplate#getTemplateSignature()
- */
+ */
+ @Override
public String getTemplateSignature() {
StringBuffer sig = new StringBuffer(fName);
if(getNumberOfTemplateParameters() > 0){
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java
index 908aa8fdcaa..56921c2368c 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TranslationUnit.java
@@ -117,10 +117,12 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
setContentTypeID(idType);
}
+ @Override
public ITranslationUnit getTranslationUnit() {
return this;
}
+ @Override
public IInclude createInclude(String includeName, boolean isStd, ICElement sibling,
IProgressMonitor monitor) throws CModelException {
CreateIncludeOperation op = new CreateIncludeOperation(includeName, isStd, this);
@@ -131,6 +133,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
return getInclude(includeName);
}
+ @Override
public IUsing createUsing(String usingName, boolean isDirective, ICElement sibling,
IProgressMonitor monitor) throws CModelException {
CreateIncludeOperation op = new CreateIncludeOperation(usingName, isDirective, this);
@@ -141,6 +144,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
return getUsing(usingName);
}
+ @Override
public INamespace createNamespace(String namespace, ICElement sibling,
IProgressMonitor monitor) throws CModelException {
CreateNamespaceOperation op = new CreateNamespaceOperation(namespace, this);
@@ -151,6 +155,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
return getNamespace(namespace);
}
+ @Override
public ICElement getElementAtLine(int line) throws CModelException {
ICElement[] celements = getChildren();
for (ICElement celement : celements) {
@@ -164,6 +169,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
return null;
}
+ @Override
public ICElement getElementAtOffset(int pos) throws CModelException {
ICElement e = getSourceElementAtOffset(pos);
if (e == this) {
@@ -172,6 +178,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
return e;
}
+ @Override
public ICElement[] getElementsAtOffset(int pos) throws CModelException {
ICElement[] e = getSourceElementsAtOffset(pos);
if (e.length == 1 && e[0] == this) {
@@ -180,6 +187,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
return e;
}
+ @Override
public ICElement getElement(String name) {
if (name == null || name.length() == 0) {
return null;
@@ -218,6 +226,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
return current;
}
+ @Override
public IInclude getInclude(String name) {
try {
ICElement[] celements = getChildren();
@@ -233,6 +242,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
return null;
}
+ @Override
public IInclude[] getIncludes() throws CModelException {
ICElement[] celements = getChildren();
ArrayList aList = new ArrayList();
@@ -244,6 +254,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
return aList.toArray(new IInclude[0]);
}
+ @Override
public IUsing getUsing(String name) {
try {
ICElement[] celements = getChildren();
@@ -259,6 +270,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
return null;
}
+ @Override
public IUsing[] getUsings() throws CModelException {
ICElement[] celements = getChildren();
ArrayList aList = new ArrayList();
@@ -270,6 +282,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
return aList.toArray(new IUsing[0]);
}
+ @Override
public INamespace getNamespace(String name) {
try {
String[] names = name.split("::"); //$NON-NLS-1$
@@ -298,6 +311,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
return null;
}
+ @Override
public INamespace[] getNamespaces() throws CModelException {
ICElement[] celements = getChildren();
ArrayList elementList = new ArrayList();
@@ -313,6 +327,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
location = loc;
}
+ @Override
public IPath getLocation() {
if (location == null) {
IFile file = getFile();
@@ -324,7 +339,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
}
return UNCPathConverter.toPath(location);
}
-
+
@Override
public URI getLocationURI() {
if (location == null) {
@@ -346,28 +361,34 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
return null;
}
+ @Override
public void copy(ICElement container, ICElement sibling, String rename, boolean force,
IProgressMonitor monitor) throws CModelException {
getSourceManipulationInfo().copy(container, sibling, rename, force, monitor);
}
+ @Override
public void delete(boolean force, IProgressMonitor monitor) throws CModelException {
getSourceManipulationInfo().delete(force, monitor);
}
+ @Override
public void move(ICElement container, ICElement sibling, String rename, boolean force,
IProgressMonitor monitor) throws CModelException {
getSourceManipulationInfo().move(container, sibling, rename, force, monitor);
}
+ @Override
public void rename(String name, boolean force, IProgressMonitor monitor) throws CModelException {
getSourceManipulationInfo().rename(name, force, monitor);
}
+ @Override
public String getSource() throws CModelException {
return getSourceManipulationInfo().getSource();
}
+ @Override
public ISourceRange getSourceRange() throws CModelException {
return getSourceManipulationInfo().getSourceRange();
}
@@ -391,9 +412,9 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
/**
* Returns true if this handle represents the same Java element
* as the given handle.
- *
+ *
* Compilation units must also check working copy state;
- *
+ *
* @see Object#equals(java.lang.Object)
*/
@Override
@@ -402,6 +423,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
return super.equals(o) && !((ITranslationUnit) o).isWorkingCopy();
}
+ @Override
public IWorkingCopy findSharedWorkingCopy() {
return CModelManager.getDefault().findSharedWorkingCopy(null, this);
}
@@ -442,6 +464,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
return unitInfo.isStructureKnown();
}
+ @Override
public char[] getContents() {
try {
IBuffer buffer = this.getBuffer();
@@ -451,19 +474,23 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
}
}
+ @Override
public IWorkingCopy getSharedWorkingCopy(IProgressMonitor monitor, IProblemRequestor requestor)
throws CModelException {
return CModelManager.getDefault().getSharedWorkingCopy(null, this, requestor, monitor);
}
+ @Override
public IWorkingCopy getWorkingCopy() throws CModelException {
return this.getWorkingCopy(null, null);
}
+ @Override
public IWorkingCopy getWorkingCopy(IProgressMonitor monitor) throws CModelException {
return getWorkingCopy(monitor, null);
}
+ @Override
public IWorkingCopy getWorkingCopy(IProgressMonitor monitor, IBufferFactory factory) throws CModelException {
WorkingCopy workingCopy;
IFile file= getFile();
@@ -513,7 +540,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
if (!computeAST && isConsistent()) {
return null;
}
-
+
// create a new info and make it the current info
// (this will remove the info and its children just before storing the new infos)
CModelManager manager = CModelManager.getDefault();
@@ -559,6 +586,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
return true;
}
+ @Override
public boolean isWorkingCopy() {
return false;
}
@@ -601,6 +629,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
return buffer;
}
+ @Override
public Map, ?> parse() {
throw new UnsupportedOperationException("Deprecated method"); //$NON-NLS-1$
}
@@ -655,10 +684,12 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
return problemRequestor;
}
+ @Override
public boolean isHeaderUnit() {
return isHeaderContentType(contentTypeId);
}
+ @Override
public boolean isSourceUnit() {
return isSourceContentType(contentTypeId);
}
@@ -678,16 +709,19 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
|| LanguageManager.getInstance().isContributedContentType(contentType);
}
+ @Override
public boolean isCLanguage() {
return CCorePlugin.CONTENT_TYPE_CSOURCE.equals(contentTypeId)
|| CCorePlugin.CONTENT_TYPE_CHEADER.equals(contentTypeId);
}
+ @Override
public boolean isCXXLanguage() {
return CCorePlugin.CONTENT_TYPE_CXXSOURCE.equals(contentTypeId)
|| CCorePlugin.CONTENT_TYPE_CXXHEADER.equals(contentTypeId);
}
+ @Override
public boolean isASMLanguage() {
return CCorePlugin.CONTENT_TYPE_ASMSOURCE.equals(contentTypeId);
}
@@ -705,20 +739,21 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
} catch (CoreException e) {
CCorePlugin.log(e);
}
-
+
}
return false;
}
+ @Override
public ILanguage getLanguage() throws CoreException {
ILanguage language = null;
-
+
ICProject cProject = getCProject();
IProject project= cProject.getProject();
-
+
ICProjectDescription description = CoreModel.getDefault().getProjectDescription(project, false);
ICConfigurationDescription configuration;
-
+
if (description == null) {
// TODO: Sometimes, CoreModel returns a null ICProjectDescription
// so for now, fall back to configuration-less language determination.
@@ -726,7 +761,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
} else {
configuration = description.getActiveConfiguration();
}
-
+
IFile file= getFile();
if (file != null) {
language = LanguageManager.getInstance().getLanguageForFile(file, configuration, contentTypeId);
@@ -738,6 +773,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
return language;
}
+ @Override
public String getContentTypeId() {
return contentTypeId;
}
@@ -759,9 +795,10 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
* Contributed languages' model builders need to be able to indicate whether or
* not the parse of a translation unit was successful without having access to
* the CElementInfo
object associated with the translation unit
- *
+ *
* @param wasSuccessful
*/
+ @Override
public void setIsStructureKnown(boolean wasSuccessful) {
try {
this.getElementInfo().setIsStructureKnown(wasSuccessful);
@@ -769,10 +806,12 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
}
}
+ @Override
public IASTTranslationUnit getAST() throws CoreException {
return getAST(null, 0, null);
}
+ @Override
public IASTTranslationUnit getAST(IIndex index, int style) throws CoreException {
return getAST(index, style, null);
}
@@ -782,12 +821,12 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
ITranslationUnit configureWith = getConfigureWith(contextToHeader);
if (configureWith == this)
contextToHeader= null;
-
+
IScannerInfo scanInfo= configureWith.getScannerInfo((style & AST_SKIP_IF_NO_BUILD_INFO) == 0);
if (scanInfo == null) {
return null;
}
-
+
FileContent fileContent= FileContent.create(this);
if (fileContent == null) {
return null;
@@ -833,19 +872,19 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
} else {
fileContentsProvider= IncludeFileContentProvider.getSavedFilesProvider();
}
-
+
if (index != null && (style & AST_SKIP_INDEXED_HEADERS) != 0) {
IndexBasedFileContentProvider ibcf= new IndexBasedFileContentProvider(index, pathResolver, linkageID,
fileContentsProvider);
ibcf.setContextToHeaderGap(contextToHeader);
fileContentsProvider= ibcf;
}
-
+
if (fileContentsProvider instanceof InternalFileContentProvider) {
final ProjectIndexerIncludeResolutionHeuristics heuristics = new ProjectIndexerIncludeResolutionHeuristics(cprj.getProject(), pathResolver);
((InternalFileContentProvider) fileContentsProvider).setIncludeResolutionHeuristics(heuristics);
}
-
+
return fileContentsProvider;
}
@@ -874,7 +913,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
}
}
}
-
+
if (best != null && contextOfBest != best) {
return new IIndexFile[] { contextOfBest, best };
}
@@ -897,10 +936,10 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
}
return indexFile;
}
-
+
/**
* Returns true
if the given file was parsed in a context of a source file.
- * @throws CoreException
+ * @throws CoreException
*/
private boolean isSourceFile(IIndexFile indexFile) throws CoreException {
String path = indexFile.getLocation().getURI().getPath();
@@ -912,28 +951,29 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
}
private ITranslationUnit getConfigureWith(IIndexFile[] contextToHeader) throws CoreException {
- if (contextToHeader != null) {
+ if (contextToHeader != null) {
ITranslationUnit configureWith = CoreModelUtil.findTranslationUnitForLocation(
contextToHeader[0].getLocation(), getCProject());
- if (configureWith != null)
+ if (configureWith != null)
return configureWith;
}
return this;
}
+ @Override
public IASTCompletionNode getCompletionNode(IIndex index, int style, int offset) throws CoreException {
IIndexFile[] contextToHeader = getContextToHeader(index, style);
ITranslationUnit configureWith = getConfigureWith(contextToHeader);
if (configureWith == this)
contextToHeader= null;
-
+
IScannerInfo scanInfo = configureWith.getScannerInfo((style & ITranslationUnit.AST_SKIP_IF_NO_BUILD_INFO) == 0);
if (scanInfo == null) {
return null;
}
-
+
FileContent fileContent= FileContent.create(this);
-
+
ILanguage language= configureWith.getLanguage();
fLanguageOfContext= language;
if (language != null) {
@@ -952,6 +992,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
return null;
}
+ @Override
@Deprecated
public org.eclipse.cdt.core.parser.CodeReader getCodeReader() {
IPath location= getLocation();
@@ -960,12 +1001,12 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
if (isWorkingCopy()) {
return new org.eclipse.cdt.core.parser.CodeReader(location.toOSString(), getContents());
}
-
+
IResource res= getResource();
try {
if (res instanceof IFile)
return InternalParserUtil.createWorkspaceFileReader(location.toOSString(), (IFile) res, null);
- else
+ else
return InternalParserUtil.createExternalFileReader(location.toOSString(), null);
} catch (CoreException e) {
CCorePlugin.log(e);
@@ -975,6 +1016,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
return null;
}
+ @Override
public IScannerInfo getScannerInfo(boolean force) {
IResource resource = getResource();
ICProject project = getCProject();
@@ -984,7 +1026,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
if (!force && CoreModel.isScannerInformationEmpty(infoResource)) {
return null;
}
-
+
IScannerInfoProvider provider = CCorePlugin.getDefault().getScannerInfoProvider(rproject);
if (provider != null) {
IScannerInfo scanInfo = provider.getScannerInformation(infoResource);
@@ -996,7 +1038,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
}
return null;
}
-
+
/**
* Return the language of the context this file was parsed in. Works only after using
* {@link #getAST(IIndex, int, IProgressMonitor)} with the flag {@link ITranslationUnit#AST_CONFIGURE_USING_SOURCE_CONTEXT}.
@@ -1159,30 +1201,35 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
}
}
}
-
+
@Override
protected char getHandleMementoDelimiter() {
return CElement.CEM_TRANSLATIONUNIT;
}
+ @Override
public boolean isActive() {
return true;
}
+ @Override
public int getIndex() {
return 0;
}
+ @Override
@Deprecated
public IWorkingCopy findSharedWorkingCopy(IBufferFactory bufferFactory) {
return CModelManager.getDefault().findSharedWorkingCopy(bufferFactory, this);
}
+ @Override
@Deprecated
public IWorkingCopy getSharedWorkingCopy(IProgressMonitor monitor, IBufferFactory factory, IProblemRequestor requestor) throws CModelException {
return CModelManager.getDefault().getSharedWorkingCopy(factory, this, requestor, monitor);
}
+ @Override
@Deprecated
public IWorkingCopy getSharedWorkingCopy(IProgressMonitor monitor, IBufferFactory factory) throws CModelException {
return CModelManager.getDefault().getSharedWorkingCopy(factory, this, null, monitor);
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TypeDef.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TypeDef.java
index 5d920eacb91..6ee2833b92f 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TypeDef.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/TypeDef.java
@@ -24,6 +24,7 @@ public class TypeDef extends SourceManipulation implements ITypeDef {
* Returns the typeName.
* @return String
*/
+ @Override
public String getTypeName() {
return typeName;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Using.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Using.java
index 2b96827a662..3a1d6dd200e 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Using.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Using.java
@@ -31,6 +31,7 @@ public class Using extends SourceManipulation implements IUsing {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IUsing#isDirective()
*/
+ @Override
public boolean isDirective() {
return directive;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Variable.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Variable.java
index f04e6855cc0..35245ce2d99 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Variable.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/Variable.java
@@ -15,7 +15,7 @@ import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.IVariable;
public class Variable extends VariableDeclaration implements IVariable {
-
+
public Variable(ICElement parent, String name) {
super(parent, name, ICElement.C_VARIABLE);
}
@@ -24,6 +24,7 @@ public class Variable extends VariableDeclaration implements IVariable {
super(parent, name, kind);
}
+ @Override
public String getInitializer() {
return ""; //$NON-NLS-1$
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/VariableDeclaration.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/VariableDeclaration.java
index a72529dd332..122dbc1c318 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/VariableDeclaration.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/VariableDeclaration.java
@@ -16,7 +16,7 @@ import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.IVariableDeclaration;
public class VariableDeclaration extends SourceManipulation implements IVariableDeclaration {
-
+
public VariableDeclaration(ICElement parent, String name) {
super(parent, name, ICElement.C_VARIABLE_DECLARATION);
}
@@ -25,14 +25,17 @@ public class VariableDeclaration extends SourceManipulation implements IVariable
super(parent, name, type);
}
+ @Override
public String getTypeName() throws CModelException {
return getVariableInfo().getTypeName();
}
+ @Override
public void setTypeName(String type) throws CModelException {
getVariableInfo().setTypeString(type);
}
+ @Override
public boolean isConst() throws CModelException {
return getVariableInfo().isConst();
}
@@ -41,6 +44,7 @@ public class VariableDeclaration extends SourceManipulation implements IVariable
getVariableInfo().setConst(isConst);
}
+ @Override
public boolean isVolatile() throws CModelException {
return getVariableInfo().isVolatile();
}
@@ -49,6 +53,7 @@ public class VariableDeclaration extends SourceManipulation implements IVariable
getVariableInfo().setVolatile(isVolatile);
}
+ @Override
public boolean isStatic() throws CModelException {
return getVariableInfo().isStatic();
}
@@ -60,7 +65,7 @@ public class VariableDeclaration extends SourceManipulation implements IVariable
public VariableInfo getVariableInfo() throws CModelException{
return (VariableInfo) getElementInfo();
}
-
+
@Override
protected CElementInfo createElementInfo () {
return new VariableInfo(this);
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/VariableTemplate.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/VariableTemplate.java
index 0cac69111da..2f5b3fd1245 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/VariableTemplate.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/VariableTemplate.java
@@ -17,15 +17,16 @@ public class VariableTemplate extends Variable implements ITemplate {
protected static final String[] fgEmptyList= new String[] {};
protected String[] templateParameterTypes;
-
+
public VariableTemplate(ICElement parent, String name) {
super(parent, name, ICElement.C_TEMPLATE_VARIABLE);
- templateParameterTypes= fgEmptyList;
+ templateParameterTypes= fgEmptyList;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ITemplate#getNumberOfTemplateParameters()
*/
+ @Override
public int getNumberOfTemplateParameters() {
return templateParameterTypes == null ? 0 : templateParameterTypes.length;
}
@@ -33,10 +34,12 @@ public class VariableTemplate extends Variable implements ITemplate {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ITemplate#getTemplateParameterTypes()
*/
+ @Override
public String[] getTemplateParameterTypes() {
return templateParameterTypes;
}
+ @Override
public String[] getTemplateArguments() {
return fgEmptyList;
}
@@ -51,6 +54,7 @@ public class VariableTemplate extends Variable implements ITemplate {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ITemplate#getTemplateSignature()
*/
+ @Override
public String getTemplateSignature() throws CModelException {
StringBuffer sig = new StringBuffer(getElementName());
if(getNumberOfTemplateParameters() > 0){
@@ -67,10 +71,10 @@ public class VariableTemplate extends Variable implements ITemplate {
else{
sig.append("<>"); //$NON-NLS-1$
}
-
+
sig.append(" : "); //$NON-NLS-1$
sig.append(this.getTypeName());
-
+
return sig.toString();
}
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/WorkingCopy.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/WorkingCopy.java
index ff68ab605b7..3e03e1b09f2 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/WorkingCopy.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/WorkingCopy.java
@@ -38,13 +38,13 @@ import org.eclipse.core.runtime.IProgressMonitor;
* the timestamp of the resource it was created from.
*/
public class WorkingCopy extends TranslationUnit implements IWorkingCopy {
-
+
/**
* If set, this is the factory that will be used to create the buffer.
*/
protected IBufferFactory bufferFactory;
/**
- * A counter of the number of time clients have asked for this
+ * A counter of the number of time clients have asked for this
* working copy. It is set to 1, if the working
* copy is not managed. When destroyed, this counter is
* set to 0. Once destroyed, this working copy cannot be opened
@@ -74,6 +74,7 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy {
/**
* @see org.eclipse.cdt.core.model.IWorkingCopy#commit(boolean, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public void commit(boolean force, IProgressMonitor monitor) throws CModelException {
ITranslationUnit original = this.getOriginalElement();
if (original.exists()) {
@@ -94,8 +95,8 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy {
ByteArrayInputStream stream = new ByteArrayInputStream(bytes);
if (originalRes.exists()) {
originalRes.setContents(
- stream,
- force ? IResource.FORCE | IResource.KEEP_HISTORY : IResource.KEEP_HISTORY,
+ stream,
+ force ? IResource.FORCE | IResource.KEEP_HISTORY : IResource.KEEP_HISTORY,
null);
} else {
originalRes.create(
@@ -108,12 +109,13 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy {
} catch (CoreException e) {
throw new CModelException(e);
}
- }
+ }
}
-
+
/**
* @see org.eclipse.cdt.core.model.IWorkingCopy#destroy()
*/
+ @Override
public void destroy() {
if (--this.useCount > 0) {
return;
@@ -151,17 +153,18 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy {
*/
@Override
public boolean equals(Object o) {
- return this == o;
+ return this == o;
}
/**
* Returns the original element the specified working copy element was created from,
* or null
if this is not a working copy element.
- *
+ *
* @param workingCopyElement the specified working copy element
* @return the original element the specified working copy element was created from,
* or null
if this is not a working copy element
*/
+ @Override
public ICElement getOriginal(ICElement workingCopyElement) {
// It has to come from the same workingCopy, meaning ours.
if (workingCopyElement instanceof ISourceReference) {
@@ -207,10 +210,11 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy {
}
return current;
}
-
+
/**
* @see org.eclipse.cdt.core.model.IWorkingCopy#getOriginalElement()
*/
+ @Override
public ITranslationUnit getOriginalElement() {
IFile file= getFile();
if (file != null) {
@@ -224,12 +228,12 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy {
*/
@Override
public IWorkingCopy getSharedWorkingCopy(IProgressMonitor monitor, IProblemRequestor requestor) {
- return this;
+ return this;
}
/**
* @see org.eclipse.cdt.core.model.ITranslationUnit#getWorkingCopy()
- */
+ */
@Override
public IWorkingCopy getWorkingCopy() {
return this;
@@ -246,6 +250,7 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy {
/**
* @see IWorkingCopy
*/
+ @Override
public boolean isBasedOn(IResource resource) {
if (resource.getType() != IResource.FILE) {
return false;
@@ -282,12 +287,12 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy {
public void open(IProgressMonitor monitor) throws CModelException {
if (this.useCount == 0) { // was destroyed
throw newNotPresentException();
- }
+ }
super.open(monitor);
//if (monitor != null && monitor.isCanceled()) return;
//if (this.problemRequestor != null && this.problemRequestor.isActive()){
// this.problemRequestor.beginReporting();
- // TranslationUnitProblemFinder.process(this, this.problemRequestor, monitor);
+ // TranslationUnitProblemFinder.process(this, this.problemRequestor, monitor);
// this.problemRequestor.endReporting();
//}
}
@@ -298,10 +303,10 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy {
@Override
protected IBuffer openBuffer(IProgressMonitor pm) throws CModelException {
if (this.useCount == 0) throw newNotPresentException();
-
+
// create buffer - working copies may use custom buffer factory
IBuffer buffer = getBufferFactory().createBuffer(this);
- if (buffer == null)
+ if (buffer == null)
return null;
// set the buffer source if needed
@@ -333,20 +338,22 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy {
// listen to buffer changes
buffer.addBufferChangedListener(this);
- return buffer;
+ return buffer;
}
-
+
/**
* @see org.eclipse.cdt.core.model.IWorkingCopy#reconcile()
*/
+ @Override
public IMarker[] reconcile() throws CModelException {
reconcile(false, null);
return null;
}
-
+
/**
* @see org.eclipse.cdt.core.model.IWorkingCopy#reconcile(boolean, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public void reconcile(boolean forceProblemDetection, IProgressMonitor monitor) throws CModelException {
reconcile(false, forceProblemDetection, monitor);
}
@@ -354,6 +361,7 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy {
/**
* @see org.eclipse.cdt.core.model.IWorkingCopy#restore()
*/
+ @Override
public void restore() throws CModelException{
if (this.useCount == 0) throw newNotPresentException(); //was destroyed
@@ -362,7 +370,7 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy {
if (buffer == null) return;
buffer.setContents(original.getContents());
updateTimeStamp(original);
- makeConsistent(null);
+ makeConsistent(null);
}
/**
@@ -375,7 +383,7 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy {
}
// computes fine-grain deltas in case the working copy is being reconciled already
// (if not it would miss one iteration of deltas).
- this.reconcile();
+ this.reconcile();
}
/**
@@ -394,6 +402,7 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy {
/*
* @see org.eclipse.cdt.core.model.IWorkingCopy#reconcile(boolean, boolean, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public IASTTranslationUnit reconcile(boolean computeAST, boolean forceProblemDetection, IProgressMonitor monitor)
throws CModelException {
if (this.useCount == 0)
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/CElementHandle.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/CElementHandle.java
index 36932ec7aa2..5ac310c1370 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/CElementHandle.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/CElementHandle.java
@@ -8,7 +8,7 @@
* Contributors:
* Markus Schorn - initial API and implementation
* Anton Leherbauer (Wind River Systems)
- *******************************************************************************/
+ *******************************************************************************/
package org.eclipse.cdt.internal.core.model.ext;
import java.net.URI;
@@ -42,7 +42,7 @@ import org.eclipse.jface.text.Region;
abstract class CElementHandle implements ICElementHandle, ISourceReference {
protected static final String[] EMPTY_STRING_ARRAY = new String[0];
private static final ICElement[] NO_CHILDREN = new ICElement[0];
-
+
private ICElement fParent;
private String fName;
private int fType;
@@ -54,7 +54,7 @@ abstract class CElementHandle implements ICElementHandle, ISourceReference {
public CElementHandle(ICElement parent, int type, String name) {
fParent= parent;
fType= type;
- // anonymous types are assigned a name in the index, we
+ // anonymous types are assigned a name in the index, we
// undo this here
if (name.length() > 0 && name.charAt(0)=='{') {
fName= ""; //$NON-NLS-1$
@@ -64,7 +64,7 @@ abstract class CElementHandle implements ICElementHandle, ISourceReference {
}
fRegion= new Region(0,0);
}
-
+
@Override
public boolean equals(Object obj) {
if (obj instanceof ICElement) {
@@ -79,6 +79,7 @@ abstract class CElementHandle implements ICElementHandle, ISourceReference {
}
+ @Override
@SuppressWarnings("rawtypes")
public Object getAdapter(Class adapter) {
return null;
@@ -89,6 +90,7 @@ abstract class CElementHandle implements ICElementHandle, ISourceReference {
fTimestamp= timestamp;
}
+ @Override
public ISourceRange getSourceRange() throws CModelException {
IRegion region= fRegion;
ITranslationUnit tu= getTranslationUnit();
@@ -103,10 +105,12 @@ abstract class CElementHandle implements ICElementHandle, ISourceReference {
return new SourceRange(startpos, length);
}
+ @Override
public String getSource() throws CModelException {
return null;
}
-
+
+ @Override
public ITranslationUnit getTranslationUnit() {
ICElement parent= fParent;
do {
@@ -118,58 +122,72 @@ abstract class CElementHandle implements ICElementHandle, ISourceReference {
while (parent != null);
return null;
}
-
+
+ @Override
public void accept(ICElementVisitor visitor) throws CoreException {
}
+ @Override
public boolean exists() {
return true;
}
+ @Override
public ICElement getAncestor(int ancestorType) {
return null;
}
+ @Override
public ICModel getCModel() {
return fParent.getCModel();
}
+ @Override
public ICProject getCProject() {
return fParent.getCProject();
}
+ @Override
public String getElementName() {
return fName;
}
+ @Override
public int getElementType() {
return fType;
}
+ @Override
public ICElement getParent() {
return fParent;
}
+ @Override
public IPath getPath() {
return getTranslationUnit().getPath();
}
+ @Override
public URI getLocationURI() {
return getTranslationUnit().getLocationURI();
}
-
+
+ @Override
public IResource getResource() {
return getTranslationUnit().getResource();
}
+ @Override
public IResource getUnderlyingResource() {
return getResource();
}
+ @Override
public boolean isReadOnly() {
return true;
}
+ @Override
public boolean isStructureKnown() throws CModelException {
return false;
}
@@ -185,7 +203,7 @@ abstract class CElementHandle implements ICElementHandle, ISourceReference {
public void rename(String name, boolean replace, IProgressMonitor monitor) throws CModelException {
}
-
+
public void setTypeName(String type) throws CModelException {
}
@@ -224,7 +242,7 @@ abstract class CElementHandle implements ICElementHandle, ISourceReference {
public boolean isFriend() throws CModelException {
return false;
}
-
+
public boolean isInline() throws CModelException {
return false;
}
@@ -248,7 +266,7 @@ abstract class CElementHandle implements ICElementHandle, ISourceReference {
public String getInitializer() {
return null;
}
-
+
public boolean isAbstract() throws CModelException {
return false;
}
@@ -260,7 +278,7 @@ abstract class CElementHandle implements ICElementHandle, ISourceReference {
public String[] getSuperClassesNames() {
return EMPTY_STRING_ARRAY;
}
-
+
protected String[] extractParameterTypes(IFunction func) {
IParameter[] params= func.getParameters();
String[] parameterTypes= new String[params.length];
@@ -273,7 +291,7 @@ abstract class CElementHandle implements ICElementHandle, ISourceReference {
}
return parameterTypes;
}
-
+
protected ASTAccessVisibility getVisibility(IBinding binding) {
if (binding instanceof ICPPMember) {
ICPPMember member= (ICPPMember) binding;
@@ -292,6 +310,7 @@ abstract class CElementHandle implements ICElementHandle, ISourceReference {
/**
* @see ICElement
*/
+ @Override
public String getHandleIdentifier() {
ICElement cModelElement= mapToModelElement();
if (cModelElement != null) {
@@ -309,10 +328,12 @@ abstract class CElementHandle implements ICElementHandle, ISourceReference {
}
}
+ @Override
public boolean isActive() {
return true;
}
+ @Override
public int getIndex() {
return fIndex;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/EnumerationHandle.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/EnumerationHandle.java
index 0321f531be8..c1323ad2d53 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/EnumerationHandle.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/EnumerationHandle.java
@@ -7,7 +7,7 @@
*
* Contributors:
* Markus Schorn - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/
package org.eclipse.cdt.internal.core.model.ext;
@@ -21,6 +21,7 @@ public class EnumerationHandle extends CElementHandle implements org.eclipse.cdt
super(parent, ICElement.C_ENUMERATION, enumeration.getName());
}
+ @Override
public boolean isStatic() throws CModelException {
return false;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/EnumeratorHandle.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/EnumeratorHandle.java
index 4114ae59e26..1bb1260867d 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/EnumeratorHandle.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/EnumeratorHandle.java
@@ -7,7 +7,7 @@
*
* Contributors:
* Markus Schorn - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/
package org.eclipse.cdt.internal.core.model.ext;
@@ -20,6 +20,7 @@ public class EnumeratorHandle extends CElementHandle implements org.eclipse.cdt.
super(parent, ICElement.C_ENUMERATOR, enumerator.getName());
}
+ @Override
public String getConstantExpression() {
return null;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/FieldHandle.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/FieldHandle.java
index 21664def22e..2055a2a7117 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/FieldHandle.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/FieldHandle.java
@@ -7,7 +7,7 @@
*
* Contributors:
* Markus Schorn - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/
package org.eclipse.cdt.internal.core.model.ext;
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
@@ -33,11 +33,13 @@ public class FieldHandle extends CElementHandle implements org.eclipse.cdt.core.
public String getTypeName() {
return fTypeName;
}
-
+
+ @Override
public ASTAccessVisibility getVisibility() throws CModelException {
return fVisibility;
}
+ @Override
public boolean isStatic() throws CModelException {
return fIsStatic;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/FunctionDeclarationHandle.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/FunctionDeclarationHandle.java
index 9484e3377e3..1d7bbe616e9 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/FunctionDeclarationHandle.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/FunctionDeclarationHandle.java
@@ -8,7 +8,7 @@
* Contributors:
* Markus Schorn - initial API and implementation
* Anton Leherbauer (Wind River Systems)
- *******************************************************************************/
+ *******************************************************************************/
package org.eclipse.cdt.internal.core.model.ext;
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
@@ -43,22 +43,27 @@ public class FunctionDeclarationHandle extends CElementHandle implements IFuncti
return false;
}
+ @Override
public int getNumberOfParameters() {
return fParameterTypes.length;
}
+ @Override
public String[] getParameterTypes() {
return fParameterTypes;
}
+ @Override
public String getReturnType() {
return fReturnType;
}
-
+
+ @Override
public String getSignature() throws CModelException {
return FunctionDeclaration.getSignature(this);
}
+ @Override
public boolean isStatic() throws CModelException {
return fIsStatic;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/FunctionTemplateDeclarationHandle.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/FunctionTemplateDeclarationHandle.java
index 0b8b97eb01a..2250f366f9a 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/FunctionTemplateDeclarationHandle.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/FunctionTemplateDeclarationHandle.java
@@ -7,7 +7,7 @@
*
* Contributors:
* Markus Schorn - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/
package org.eclipse.cdt.internal.core.model.ext;
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
@@ -55,18 +55,22 @@ public class FunctionTemplateDeclarationHandle extends FunctionDeclarationHandle
fTemplate.setTemplateInfo(null, args);
}
+ @Override
public String[] getTemplateArguments() {
return fTemplate.getTemplateArguments();
}
+ @Override
public int getNumberOfTemplateParameters() {
return fTemplate.getNumberOfTemplateParameters();
}
+ @Override
public String[] getTemplateParameterTypes() {
return fTemplate.getTemplateParameterTypes();
}
+ @Override
public String getTemplateSignature() throws CModelException {
return fTemplate.getTemplateSignature();
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/MacroHandle.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/MacroHandle.java
index 39c6ca8a6f2..ee32044b52b 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/MacroHandle.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/MacroHandle.java
@@ -7,7 +7,7 @@
*
* Contributors:
* Markus Schorn - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/
package org.eclipse.cdt.internal.core.model.ext;
import org.eclipse.cdt.core.index.IIndexMacro;
@@ -24,14 +24,17 @@ public class MacroHandle extends CElementHandle implements IMacro {
fFunctionStyle= macro.isFunctionStyle();
}
+ @Override
public String getIdentifierList() {
return ""; //$NON-NLS-1$
}
+ @Override
public String getTokenSequence() {
return ""; //$NON-NLS-1$
}
+ @Override
public boolean isFunctionStyle() {
return fFunctionStyle;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/MethodDeclarationHandle.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/MethodDeclarationHandle.java
index ea4b3923a6b..83c35245dc5 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/MethodDeclarationHandle.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/MethodDeclarationHandle.java
@@ -7,7 +7,7 @@
*
* Contributors:
* Markus Schorn - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/
package org.eclipse.cdt.internal.core.model.ext;
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
@@ -27,11 +27,11 @@ public class MethodDeclarationHandle extends CElementHandle implements IMethodDe
private boolean fIsStatic;
private boolean fIsConstructor;
private boolean fIsDestructor;
-
+
public MethodDeclarationHandle(ICElement parent, ICPPMethod method) {
this(parent, ICElement.C_METHOD_DECLARATION, method);
}
-
+
protected MethodDeclarationHandle(ICElement parent, int type, ICPPMethod method) {
super(parent, type, method.getName());
fParameterTypes= extractParameterTypes(method);
@@ -39,7 +39,7 @@ public class MethodDeclarationHandle extends CElementHandle implements IMethodDe
fVisibility= getVisibility(method);
fIsStatic= method.isStatic();
fIsConstructor= method instanceof ICPPConstructor;
- if (!fIsConstructor)
+ if (!fIsConstructor)
fIsDestructor= method.isDestructor();
}
@@ -52,34 +52,42 @@ public class MethodDeclarationHandle extends CElementHandle implements IMethodDe
return false;
}
+ @Override
public int getNumberOfParameters() {
return fParameterTypes.length;
}
+ @Override
public String[] getParameterTypes() {
return fParameterTypes;
}
+ @Override
public String getReturnType() {
return fReturnType;
}
-
+
+ @Override
public String getSignature() throws CModelException {
return FunctionDeclaration.getSignature(this);
}
+ @Override
public boolean isStatic() throws CModelException {
return fIsStatic;
}
+ @Override
public ASTAccessVisibility getVisibility() throws CModelException {
return fVisibility;
}
-
+
+ @Override
public boolean isConstructor() throws CModelException {
return fIsConstructor;
}
+ @Override
public boolean isDestructor() throws CModelException {
return fIsDestructor;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/SourceRange.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/SourceRange.java
index 53a7f6013a2..3a2759b387a 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/SourceRange.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/SourceRange.java
@@ -7,7 +7,7 @@
*
* Contributors:
* Markus Schorn - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/
package org.eclipse.cdt.internal.core.model.ext;
@@ -23,26 +23,32 @@ public class SourceRange implements ISourceRange {
fLength= length;
}
+ @Override
public int getEndLine() {
return -1;
}
+ @Override
public int getIdLength() {
return fLength;
}
+ @Override
public int getIdStartPos() {
return fOffset;
}
+ @Override
public int getLength() {
return fLength;
}
+ @Override
public int getStartLine() {
return -1;
}
+ @Override
public int getStartPos() {
return fOffset;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/StructureHandle.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/StructureHandle.java
index 8d2d2629108..85b9418b745 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/StructureHandle.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/StructureHandle.java
@@ -7,7 +7,7 @@
*
* Contributors:
* Markus Schorn - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/
package org.eclipse.cdt.internal.core.model.ext;
@@ -36,34 +36,42 @@ public class StructureHandle extends CElementHandle implements IStructure {
return ICElement.C_CLASS;
}
+ @Override
public IField getField(String name) {
return null;
}
+ @Override
public IField[] getFields() throws CModelException {
return EMPTY_FIELDS;
}
+ @Override
public IMethodDeclaration getMethod(String name) {
return null;
}
+ @Override
public IMethodDeclaration[] getMethods() throws CModelException {
return EMPTY_METHODS;
}
-
+
+ @Override
public boolean isClass() throws CModelException {
return getElementType() == ICElement.C_CLASS;
}
+ @Override
public boolean isStruct() throws CModelException {
return getElementType() == ICElement.C_STRUCT;
}
+ @Override
public boolean isUnion() throws CModelException {
return getElementType() == ICElement.C_UNION;
}
+ @Override
public boolean isStatic() throws CModelException {
return false;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/StructureTemplateHandle.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/StructureTemplateHandle.java
index 1e2f1ff8726..55632606c0b 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/StructureTemplateHandle.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/StructureTemplateHandle.java
@@ -8,7 +8,7 @@
* Contributors:
* Markus Schorn - initial API and implementation
* Anton Leherbauer (Wind River Systems)
- *******************************************************************************/
+ *******************************************************************************/
package org.eclipse.cdt.internal.core.model.ext;
import java.util.ArrayList;
@@ -75,18 +75,22 @@ public class StructureTemplateHandle extends StructureHandle implements IStructu
fTemplate.setTemplateInfo(null, args.toArray(new String[args.size()]));
}
+ @Override
public int getNumberOfTemplateParameters() {
return fTemplate.getNumberOfTemplateParameters();
}
+ @Override
public String[] getTemplateParameterTypes() {
return fTemplate.getTemplateParameterTypes();
}
+ @Override
public String[] getTemplateArguments() {
return fTemplate.getTemplateArguments();
}
+ @Override
public String getTemplateSignature() throws CModelException {
return fTemplate.getTemplateSignature();
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/VariableHandle.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/VariableHandle.java
index 49a24d37819..5f49ac891d6 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/VariableHandle.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/VariableHandle.java
@@ -7,7 +7,7 @@
*
* Contributors:
* Markus Schorn - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/
package org.eclipse.cdt.internal.core.model.ext;
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
@@ -29,7 +29,8 @@ public class VariableHandle extends CElementHandle implements org.eclipse.cdt.co
public String getTypeName() {
return fTypeName;
}
-
+
+ @Override
public boolean isStatic() throws CModelException {
return fIsStatic;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/AbstractCExtensionProxy.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/AbstractCExtensionProxy.java
index 61b39f3bfe4..9be3f96767b 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/AbstractCExtensionProxy.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/AbstractCExtensionProxy.java
@@ -58,11 +58,11 @@ public abstract class AbstractCExtensionProxy implements ICProjectDescriptionLis
}
return null;
}
-
+
protected IProject getProject(){
return fProject;
}
-
+
private boolean checkUpdateProvider(ICProjectDescription des, boolean recreate, boolean rescan){
Object newProvider = null;
Object oldProvider = null;
@@ -79,7 +79,7 @@ public abstract class AbstractCExtensionProxy implements ICProjectDescriptionLis
newStyle = CProjectDescriptionManager.getInstance().isNewStyleCfg(cfg);
}
}
-
+
if(ref != null){
if(recreate || !ref.getID().equals(fExtId)){
try {
@@ -90,52 +90,52 @@ public abstract class AbstractCExtensionProxy implements ICProjectDescriptionLis
}
}
}
-
+
if(newProvider == null){
if(recreate || fProvider == null || newStyle != fIsNewStyle){
newStyle = isNewStyleCfg(cfg);
newProvider = createDefaultProvider(cfg, newStyle);
}
}
-
+
if(newProvider != null){
if(fProvider != null){
deinitializeProvider(fProvider);
oldProvider = fProvider;
}
-
+
fProvider = newProvider;
if(ref != null)
fExtId = ref.getID();
-
+
fIsNewStyle = newStyle;
-
+
initializeProvider(fProvider);
}
-
+
fInited = true;
}
}
-
+
if(newProvider != null){
postProcessProviderChange(newProvider, oldProvider);
return true;
}
return false;
}
-
+
protected boolean isNewStyleCfg(ICConfigurationDescription des){
return CProjectDescriptionManager.getInstance().isNewStyleCfg(des);
}
-
+
protected abstract boolean isValidProvider(Object o);
-
+
protected abstract void initializeProvider(Object o);
-
+
protected abstract void deinitializeProvider(Object o);
-
+
protected abstract Object createDefaultProvider(ICConfigurationDescription cfgDes, boolean newStile);
-
+
protected void postProcessProviderChange(Object newProvider, Object oldProvider){
}
@@ -146,13 +146,14 @@ public abstract class AbstractCExtensionProxy implements ICProjectDescriptionLis
}
}
+ @Override
public void handleEvent(CProjectDescriptionEvent event) {
if(!fProject.equals(event.getProject()))
return;
-
+
doHandleEvent(event);
}
-
+
protected boolean doHandleEvent(CProjectDescriptionEvent event){
boolean force = false;
switch(event.getEventType()){
@@ -167,7 +168,7 @@ public abstract class AbstractCExtensionProxy implements ICProjectDescriptionLis
}
break;
}
-
+
return false;
}
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CBuildSetting.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CBuildSetting.java
index 0ad7c081b38..8c30a0b2c51 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CBuildSetting.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CBuildSetting.java
@@ -25,6 +25,7 @@ public class CBuildSetting extends CDataProxy implements ICBuildSetting {
super(data, cfg, cfg);
}
+ @Override
public IPath getBuilderCWD() {
CBuildData data = getBuildData(false);
return data.getBuilderCWD();
@@ -34,11 +35,13 @@ public class CBuildSetting extends CDataProxy implements ICBuildSetting {
return (CBuildData)getData(write);
}
+ @Override
public String[] getErrorParserIDs() {
CBuildData data = getBuildData(false);
return data.getErrorParserIDs();
}
+ @Override
public ICOutputEntry[] getOutputDirectories() {
CBuildData data = getBuildData(false);
ICOutputEntry[] entries = data.getOutputDirectories();
@@ -47,16 +50,19 @@ public class CBuildSetting extends CDataProxy implements ICBuildSetting {
return entries;
}
+ @Override
public void setBuilderCWD(IPath path) {
CBuildData data = getBuildData(true);
data.setBuilderCWD(path);
}
+ @Override
public void setErrorParserIDs(String[] ids) {
CBuildData data = getBuildData(true);
data.setErrorParserIDs(ids);
}
+ @Override
public void setOutputDirectories(ICOutputEntry[] entries) {
CBuildData data = getBuildData(true);
IProject project = getProject();
@@ -69,16 +75,19 @@ public class CBuildSetting extends CDataProxy implements ICBuildSetting {
CExternalSettingsManager.getInstance().restoreOutputEntryDefaults(getConfiguration());
}
}
-
+
+ @Override
public final int getType() {
return ICSettingBase.SETTING_BUILD;
}
+ @Override
public IEnvironmentContributor getBuildEnvironmentContributor() {
CBuildData data = getBuildData(false);
return data.getBuildEnvironmentContributor();
}
+ @Override
public ICOutputEntry[] getResolvedOutputDirectories() {
ICOutputEntry[] entries = getOutputDirectories();
return CDataUtil.resolveEntries(entries, getConfiguration());
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CBuildSettingCache.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CBuildSettingCache.java
index 14570e3c43a..41c7df773bc 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CBuildSettingCache.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CBuildSettingCache.java
@@ -33,26 +33,26 @@ public class CBuildSettingCache extends CDefaultBuildData implements
CBuildSettingCache(CBuildData base, CConfigurationDescriptionCache cfgCache){
super(/*base.getId(), base*/);
-
+
fId = base.getId();
-
+
fCfgCache = cfgCache;
-
+
fCfgCache.addBuildSetting(this);
-
+
copySettingsFrom(base);
}
-
+
void initEnvironmentCache(){
fEnvironment = new StorableEnvironment(
EnvironmentVariableManager.getDefault().getVariables(fCfgCache, false),
true);
}
-
+
public StorableEnvironment getCachedEnvironment(){
return fEnvironment;
}
-
+
public StorableEnvironment getResolvedEnvironment(){
if(fResolvedEnvironment == null){
fResolvedEnvironment = new StorableEnvironment(
@@ -62,14 +62,17 @@ public class CBuildSettingCache extends CDefaultBuildData implements
return fResolvedEnvironment;
}
+ @Override
public ICConfigurationDescription getConfiguration() {
return fCfgCache;
}
+ @Override
public ICSettingContainer getParent() {
return fCfgCache;
}
+ @Override
public boolean isReadOnly() {
return true;
}
@@ -98,6 +101,7 @@ public class CBuildSettingCache extends CDefaultBuildData implements
return fCfgCache.getConfigurationData().getBuildData().getBuildEnvironmentContributor();
}
+ @Override
public ICOutputEntry[] getResolvedOutputDirectories() {
if(fResolvedOutputEntries == null){
ICOutputEntry[] entries = getOutputDirectories();
@@ -105,24 +109,24 @@ public class CBuildSettingCache extends CDefaultBuildData implements
}
return fResolvedOutputEntries;
}
-
+
@Override
public ICOutputEntry[] getOutputDirectories() {
initOutputEntries();
return fProjOutputEntries.clone();
}
-
+
private void initOutputEntries(){
if(fProjOutputEntries == null){
- IProject project = getProject();
+ IProject project = getProject();
fProjOutputEntries = CDataUtil.adjustEntries(fOutputEntries, true, project);
}
}
-
+
private IProject getProject(){
ICConfigurationDescription cfg = getConfiguration();
return cfg.isPreferenceConfiguration() ? null : cfg.getProjectDescription().getProject();
}
-
+
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigExtensionReference.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigExtensionReference.java
index 751e50cc8b5..5a14accc7c1 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigExtensionReference.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigExtensionReference.java
@@ -33,10 +33,12 @@ public class CConfigExtensionReference implements ICConfigExtensionReference {
fId = base.fId;
}
+ @Override
public String getExtensionPoint() {
return fExtPoint;
}
+ @Override
public String getID() {
return fId;
}
@@ -64,15 +66,18 @@ public class CConfigExtensionReference implements ICConfigExtensionReference {
return fExtPoint.hashCode() + fId.hashCode();
}
+ @Override
public void setExtensionData(String key, String value) throws CoreException {
getInfo().setAttribute(key, value);
fCfgSettings.setModified();
}
+ @Override
public String getExtensionData(String key) {
return getInfo().getAttribute(key);
}
+ @Override
public ICConfigurationDescription getConfiguration() {
return fCfgSettings.getConfigurarion();
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationDescription.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationDescription.java
index 0edac50159b..0f2af5f4b18 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationDescription.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationDescription.java
@@ -69,7 +69,7 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
super(data, cr, null);
if(!(cr instanceof ICProjectDescription))
fIsPreference = true;
-
+
if(data instanceof CConfigurationDescriptionCache)
fCfgCache = (CConfigurationDescriptionCache)data;
@@ -81,7 +81,7 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
/**
* Creating a new configuration as a copy of an existing base CConfigurationDescription
- *
+ *
* @param id
* @param name
* @param base
@@ -114,9 +114,9 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
*/
CConfigurationDescription(String id, String name, ICStorageElement el, CProjectDescription projectDes) throws CoreException {
super(null, projectDes, null);
-
+
setConfiguration(this);
-
+
ICStorageElement storage = CProjectDescriptionManager.getInstance().createStorage(projectDes, id);
fCfgSpecSettings = new CConfigurationSpecSettings(this, storage, el);
fCfgSpecSettings.setId(id);
@@ -134,9 +134,9 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
CConfigurationDescription(String id, String name, String bsId, ICStorageElement el, ICDataProxyContainer cr) throws CoreException {
super(null, cr, null);
fIsPreference = true;
-
+
setConfiguration(this);
-
+
fCfgSpecSettings = new CConfigurationSpecSettings(this, el);
fCfgSpecSettings.setId(id);
fCfgSpecSettings.setName(name);
@@ -152,11 +152,11 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
setData(CProjectDescriptionManager.getInstance().createData(this, cache, data, true, null));
}
}
-
+
// public CConfigurationDescriptionCache getCache(){
// return fCfgCache;
// }
-
+
@Override
public String getId() {
String id = super.getId();
@@ -183,11 +183,13 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
return name;
}
+ @Override
public String getDescription() {
CConfigurationData data = getConfigurationData(false);
return data.getDescription();
}
-
+
+ @Override
public CConfigurationData getConfigurationData(boolean write){
CConfigurationData data = (CConfigurationData)getData(write);
if(data == null)
@@ -195,6 +197,7 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
return data;
}
+ @Override
public ICProjectDescription getProjectDescription() {
if(fIsPreference)
return null;
@@ -205,22 +208,26 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
return getRcHolder().getResourceDescriptions(kind);
}
+ @Override
public ICFolderDescription getRootFolderDescription() {
return (ICFolderDescription)getRcHolder().getCurrentResourceDescription();
}
+ @Override
public boolean isActive() {
if(fIsPreference)
return false;
return getProjectDescription().getActiveConfiguration() == this;
}
-
+
+ @Override
public void setActive() throws WriteAccessException{
if(fIsPreference)
return;
getProjectDescription().setActiveConfiguration(this);
}
-
+
+ @Override
public void removeResourceDescription(ICResourceDescription des)
throws CoreException {
CConfigurationData data = getConfigurationData(true);
@@ -229,10 +236,12 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
data.removeResourceData((CResourceData)((CDataProxy)des).getData(false));
}
+ @Override
public final int getType() {
return ICSettingBase.SETTING_CONFIGURATION;
}
+ @Override
public CDataProxy createProxy(CDataObject data) {
switch(data.getType()){
case ICSettingBase.SETTING_FOLDER:
@@ -242,8 +251,8 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
case ICSettingBase.SETTING_TARGET_PLATFORM:
return new CTargetPlatformSetting((CTargetPlatformData)data, this);
case ICSettingBase.SETTING_BUILD:
- return new CBuildSetting((CBuildData)data, this);
-
+ return new CBuildSetting((CBuildData)data, this);
+
}
return null;
}
@@ -252,6 +261,7 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
protected IProxyProvider createChildProxyProvider() {
ICDataScope scope = new ICDataScope(){
+ @Override
public CDataObject[] getChildren() {
CConfigurationData data = getConfigurationData(false);
List list = new ArrayList();
@@ -267,16 +277,17 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
return list.toArray(new CDataObject[list.size()]);
}
+ @Override
public boolean isStatic() {
return !containsWritableData();
}
-
+
};
IProxyCache cache = getCfgProxyCache();
-
+
return new ProxyProvider(scope, cache, this);
}
-
+
protected ResourceDescriptionHolder createHolder(CFolderDescription des){
PathSettingsContainer container = des.getPathContainer();
if(container == null){
@@ -302,13 +313,13 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
fCache = new CfgProxyCache(getPathContainer());
return fCache;
}
-
+
private PathSettingsContainer getPathContainer(){
if(fPathContainer == null)
fPathContainer = PathSettingsContainer.createRootContainer();
return fPathContainer;
}
-
+
private ResourceDescriptionHolder getRcHolder(){
if(fRcHolder == null)
fRcHolder = new ProviderBasedRcDesHolder(getChildrenProxyProvider(),
@@ -316,32 +327,39 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
true);
return fRcHolder;
}
-
+
+ @Override
public ICResourceDescription getResourceDescription(IPath path, boolean exactPath) {
return getRcHolder().getResourceDescription(path, exactPath);
}
+ @Override
public void setDescription(String des) throws WriteAccessException {
getConfigurationData(true).setDescription(des);
}
+ @Override
public ICResourceDescription[] getResourceDescriptions() {
return getResourceDescriptions(ICSettingBase.SETTING_FILE | ICSettingBase.SETTING_FOLDER);
}
+ @Override
public ICStorageElement getStorage(String id, boolean create) throws CoreException {
return getSpecSettings().getStorage(id, create);
}
-
+
+ @Override
public ICStorageElement importStorage(String id, ICStorageElement el) throws UnsupportedOperationException, CoreException {
return getSpecSettings().importStorage(id, el);
}
+ @Override
public void removeStorage(String id) throws CoreException {
getSpecSettings().removeStorage(id);
}
+ @Override
public void setReadOnly(boolean readOnly, boolean keepModify) {
try {
getSpecSettings().setReadOnly(readOnly, keepModify);
@@ -350,6 +368,7 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
}
}
+ @Override
public CConfigurationSpecSettings getSpecSettings() throws CoreException{
if(fCfgSpecSettings == null){
if(fCfgCache != null){
@@ -373,6 +392,7 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
return fCfgSpecSettings;
}
+ @Override
public String getBuildSystemId() {
try {
return getSpecSettings().getBuildSystemId();
@@ -381,6 +401,7 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
return null;
}
+ @Override
public CConfigurationData getConfigurationData() {
CConfigurationData data = getConfigurationData(true);
if(data instanceof CConfigurationDescriptionCache){
@@ -388,7 +409,8 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
}
return data;
}
-
+
+ @Override
public void setConfigurationData(String buildSystemId, CConfigurationData data) throws WriteAccessException {
String oldId = getId();
setData(data);
@@ -404,6 +426,7 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
}
}
+ @Override
public boolean isModified() {
try {
CConfigurationSpecSettings settings = getSpecSettings();
@@ -413,16 +436,16 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
}
return !(getConfigurationData(false) instanceof CConfigurationDescriptionCache);
}
-
+
void removeConfiguration(){
// CProjectDescriptionManager mngr = CProjectDescriptionManager.getInstance();
-// CConfigurationData data = getConfigurationData(true);//fCfgCache.getBaseData();
+// CConfigurationData data = getConfigurationData(true);//fCfgCache.getBaseData();
//
// try {
// mngr.removeData(this, data);
// } catch (CoreException e) {
// }
-
+
try {
getSpecSettings().removeConfiguration();
} catch (CoreException e) {
@@ -432,6 +455,7 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
remove();
}
+ @Override
public ICFileDescription createFileDescription(IPath path, ICResourceDescription base) throws CoreException, WriteAccessException {
CConfigurationData data = getConfigurationData(true);
CResourceData baseRcData = (CResourceData)((CDataProxy)base).getData(true);
@@ -450,11 +474,11 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
CLanguageData baseLangData = baseLang != null ? (CLanguageData)baseLang.getData(false) : null;
createdData = data.createFileData(path, (CFolderData)baseRcData, baseLangData);
}
-
-
+
+
if(createdData == null)
throw ExceptionFactory.createCoreException(SettingsModelMessages.getString("CConfigurationDescription.0")); //$NON-NLS-1$
-
+
CDataProxy proxy = getChildrenProxyProvider().getProxy(createdData);
if(!(proxy instanceof ICFileDescription))
throw ExceptionFactory.createCoreException(SettingsModelMessages.getString("CConfigurationDescription.1") + proxy.getClass().getName()); //$NON-NLS-1$
@@ -462,14 +486,15 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
return (ICFileDescription)proxy;
}
+ @Override
public ICFolderDescription createFolderDescription(IPath path, ICFolderDescription base) throws CoreException, WriteAccessException {
CConfigurationData data = getConfigurationData(true);
CFolderData baseRcData = (CFolderData)((CDataProxy)base).getData(true);
CFolderData createdData = data.createFolderData(path, baseRcData);
-
+
if(createdData == null)
throw ExceptionFactory.createCoreException(SettingsModelMessages.getString("CConfigurationDescription.2")); //$NON-NLS-1$
-
+
CDataProxy proxy = getChildrenProxyProvider().getProxy(createdData);
if(!(proxy instanceof ICFolderDescription))
throw ExceptionFactory.createCoreException(SettingsModelMessages.getString("CConfigurationDescription.3") + proxy.getClass().getName()); //$NON-NLS-1$
@@ -477,19 +502,23 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
return (ICFolderDescription)proxy;
}
+ @Override
public ICTargetPlatformSetting getTargetPlatformSetting() {
CConfigurationData data = getConfigurationData(false);
return (ICTargetPlatformSetting)getChildrenProxyProvider().getProxy(data.getTargetPlatformData());
}
+ @Override
public ICFileDescription[] getFileDescriptions() {
return (ICFileDescription[])getRcHolder().getResourceDescriptions(ICSettingBase.SETTING_FILE);
}
+ @Override
public ICFolderDescription[] getFolderDescriptions() {
return (ICFolderDescription[])getRcHolder().getResourceDescriptions(ICSettingBase.SETTING_FOLDER);
}
+ @Override
public ICSourceEntry[] getSourceEntries() {
CConfigurationData data = getConfigurationData(false);
ICSourceEntry[] srcEntries = data.getSourceEntries();
@@ -498,20 +527,21 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
// return getRcHolder().calculateSourceEntriesFromPaths(proj, srcPaths);
}
+ @Override
public void setSourceEntries(ICSourceEntry[] entries) throws CoreException {
CConfigurationData data = getConfigurationData(true);
IProject project = fIsPreference ? null : getProjectDescription().getProject();
if(entries != null){
entries = CDataUtil.adjustEntries(entries, false, project);
}
-
+
data.setSourceEntries(entries);
if(entries == null){
CExternalSettingsManager.getInstance().restoreSourceEntryDefaults(this);
}
}
-
+
// private ICResourceDescription createResourceDescription(IPath path, ICResourceDescription base){
// if(fIsPreference)
// return null;
@@ -533,10 +563,11 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
// }
// }
// }
-//
+//
// return des;
// }
+ @Override
public Map getReferenceInfo() {
try {
CConfigurationSpecSettings specs = getSpecSettings();
@@ -546,6 +577,7 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
return new HashMap(0);
}
+ @Override
public void setReferenceInfo(Map refs) {
try {
CConfigurationSpecSettings specs = getSpecSettings();
@@ -554,6 +586,7 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
}
}
+ @Override
public ICExternalSetting createExternalSetting(String[] languageIDs,
String[] contentTypeIDs, String[] extensions,
ICSettingEntry[] entries) {
@@ -564,6 +597,7 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
return null;
}
+ @Override
public ICExternalSetting[] getExternalSettings() {
try {
return getSpecSettings().getExternalSettings();
@@ -572,6 +606,7 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
return null;
}
+ @Override
public void removeExternalSetting(ICExternalSetting setting) {
try {
getSpecSettings().removeExternalSetting(setting);
@@ -579,6 +614,7 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
}
}
+ @Override
public void removeExternalSettings() {
try {
getSpecSettings().removeExternalSettings();
@@ -586,11 +622,13 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
}
}
+ @Override
public ICBuildSetting getBuildSetting() {
CConfigurationData data = getConfigurationData(false);
return (ICBuildSetting)getChildrenProxyProvider().getProxy(data.getBuildData());
}
+ @Override
public void setSessionProperty(QualifiedName name, Object value){
try {
getSpecSettings().setSettionProperty(name, value);
@@ -598,6 +636,7 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
}
}
+ @Override
public Object getSessionProperty(QualifiedName name) {
try {
return getSpecSettings().getSettionProperty(name);
@@ -606,15 +645,17 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
return null;
}
+ @Override
public ICdtVariablesContributor getBuildVariablesContributor() {
CConfigurationData data = getConfigurationData(false);
return data.getBuildVariablesContributor();
}
+ @Override
public void setName(String name) {
if(name.equals(getName()))
return;
-
+
getConfigurationData(true).setName(name);
try {
getSpecSettings().setName(name);
@@ -622,11 +663,13 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
}
}
+ @Override
public ICConfigExtensionReference create(String extensionPoint,
String extension) throws CoreException {
return getSpecSettings().create(extensionPoint, extension);
}
+ @Override
public ICConfigExtensionReference[] get(String extensionPointID) {
try {
return getSpecSettings().get(extensionPointID);
@@ -635,31 +678,35 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
return new ICConfigExtensionReference[0];
}
+ @Override
public void remove(ICConfigExtensionReference ext) throws CoreException {
getSpecSettings().remove(ext);
}
+ @Override
public void remove(String extensionPoint) throws CoreException {
getSpecSettings().remove(extensionPoint);
}
+ @Override
public boolean isPreferenceConfiguration() {
return fIsPreference;
}
-
+
@Override
protected boolean containsWritableData(){
if(super.containsWritableData())
return true;
-
+
CConfigurationDescriptionCache data = (CConfigurationDescriptionCache)doGetData();
return data.isInitializing();
}
+ @Override
public ICLanguageSetting getLanguageSettingForFile(IPath path, boolean ignoreExcludeStatus) {
return CProjectDescriptionManager.getLanguageSettingForFile(this, path, ignoreExcludeStatus);
}
-
+
boolean isExcluded(IPath path){
// if(path.segmentCount() == 0)
// return false;
@@ -689,7 +736,7 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
boolean canExclude(IPath path, boolean isFolder, boolean exclude){
if(isExcluded(path) == exclude)
return true;
-
+
return getUpdatedSourceEntries(path, isFolder, exclude) != null;
}
@@ -717,7 +764,7 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
}
}
}
-
+
if(newEntries == null){
try {
newEntries = CDataUtil.setExcluded(path, isFolder, exclude, getResolvedSourceEntries(), false);
@@ -726,10 +773,11 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
} catch (CoreException e) {
}
}
-
+
return newEntries;
}
+ @Override
public String[] getExternalSettingsProviderIds() {
try {
return getSpecSettings().getExternalSettingsProviderIds();
@@ -739,6 +787,7 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
return new String[0];
}
+ @Override
public void setExternalSettingsProviderIds(String[] ids) {
try {
getSpecSettings().setExternalSettingsProviderIds(ids);
@@ -746,7 +795,8 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
CCorePlugin.log(e);
}
}
-
+
+ @Override
public void updateExternalSettingsProviders(String[] ids) {
try {
getSpecSettings().updateExternalSettingsProviders(ids);
@@ -755,11 +805,13 @@ public class CConfigurationDescription extends CDataProxyContainer implements IC
}
}
+ @Override
public ICSourceEntry[] getResolvedSourceEntries() {
ICSourceEntry[] entries = getSourceEntries();
return CDataUtil.resolveEntries(entries, this);
}
+ @Override
public CConfigurationStatus getConfigurationStatus() {
CConfigurationData data = getConfigurationData(false);
CConfigurationStatus status = data.getStatus();
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationDescriptionCache.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationDescriptionCache.java
index 95f54d667c7..0f537ed8b63 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationDescriptionCache.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationDescriptionCache.java
@@ -75,31 +75,31 @@ public class CConfigurationDescriptionCache extends CDefaultConfigurationData
fInitializing = true;
fParent = parent;
fSpecSettings = new CConfigurationSpecSettings(this, storage);
-
+
fId = fSpecSettings.getId();
fName = fSpecSettings.getName();
-
+
// loadData();
}
-
+
public boolean isInitializing(){
return fInitializing;
}
-
+
void loadData(CSettingEntryFactory factory) throws CoreException{
if(fDataLoadded)
return;
-
+
fDataLoadded = true;
-
+
fData = CProjectDescriptionManager.getInstance().loadData(this, null);
-
+
fSettingsFactory = factory;
-
+
copySettingsFrom(fData, true);
-
+
fSettingsFactory = null;
-
+
fSpecSettings.reconcileExtensionSettings(true);
((CBuildSettingCache)fBuildData).initEnvironmentCache();
ICdtVariable vars[] = CdtVariableManager.getDefault().getVariables(this);
@@ -121,25 +121,25 @@ public class CConfigurationDescriptionCache extends CDefaultConfigurationData
fData = base;
// base = CProjectDescriptionManager.getInstance().applyData(this, baseDescription, base);
// fData = base;
- }
-
+ }
+
fBaseCache = baseCache;
}
-
+
CConfigurationDescriptionCache getBaseCache(){
return fBaseCache;
}
-
+
boolean applyData(CSettingEntryFactory factory, SettingsContext context) throws CoreException{
- boolean modified = true;
+ boolean modified = true;
if(fBaseDescription != null){
-
+
fData = CProjectDescriptionManager.getInstance().applyData(this, fBaseDescription, fData, context, null);
fDataLoadded = true;
fName = fData.getName();
fId = fData.getId();
fSettingsFactory = factory;
-
+
if((context.getAllConfigurationSettingsFlags() & IModificationContext.CFG_DATA_SETTINGS_UNMODIFIED) == 0 || fBaseCache == null){
copySettingsFrom(fData, true);
} else {
@@ -148,26 +148,26 @@ public class CConfigurationDescriptionCache extends CDefaultConfigurationData
if(!modified)
modified = (context.getAllConfigurationSettingsFlags() & IModificationContext.CFG_DATA_STORAGE_UNMODIFIED) == 0;
}
-
+
fSettingsFactory = null;
-
+
ICdtVariable vars[] = CdtVariableManager.getDefault().getVariables(this);
fMacros = new StorableCdtVariables(vars, true);
fSpecSettings.serialize();
fSpecSettings.setModified(false);
-
+
}
-
+
fBaseDescription = null;
fBaseCache = null;
-
+
return modified;
}
-
+
CSettingEntryFactory getSettingsFactory(){
return fSettingsFactory;
}
-
+
public StorableCdtVariables getCachedVariables(){
return fMacros;
}
@@ -175,7 +175,7 @@ public class CConfigurationDescriptionCache extends CDefaultConfigurationData
protected void setId(String id) throws CoreException {
throw ExceptionFactory.createIsReadOnlyException();
}
-
+
@Override
public CFileData copyFileData(IPath path, CFileData base, boolean clone) {
return new CFileDescriptionCache(base, this);
@@ -202,20 +202,22 @@ public class CConfigurationDescriptionCache extends CDefaultConfigurationData
fRcHolder.addResourceDescription(des.getPath(), des);
fChildList.add(des);
}
-
+
void addTargetPlatformSetting(ICTargetPlatformSetting tpS){
fChildList.add(tpS);
}
-
+
void addBuildSetting(ICBuildSetting bs){
fChildList.add(bs);
fBuildData = (CBuildData)bs;
}
+ @Override
public ICProjectDescription getProjectDescription() {
return fParent;
}
+ @Override
public ICResourceDescription getResourceDescription(IPath path, boolean exactPath) {
return fRcHolder.getResourceDescription(path, exactPath);
}
@@ -224,16 +226,19 @@ public class CConfigurationDescriptionCache extends CDefaultConfigurationData
return fRcHolder.getResourceDescriptions(kind);
}
+ @Override
public ICFolderDescription getRootFolderDescription() {
return (ICFolderDescription)fRootFolderData;
}
+ @Override
public boolean isActive() {
if(isPreferenceConfiguration())
return false;
return fParent.getActiveConfiguration() == this;
}
+ @Override
public void removeResourceDescription(ICResourceDescription des)
throws CoreException {
throw new CoreException(new DescriptionStatus(SettingsModelMessages.getString("CConfigurationDescriptionCache.0"))); //$NON-NLS-1$
@@ -269,46 +274,57 @@ public class CConfigurationDescriptionCache extends CDefaultConfigurationData
throw ExceptionFactory.createIsReadOnlyException();
}
+ @Override
public ICSettingObject[] getChildSettings() {
return fChildList.toArray(new ICSettingObject[fChildList.size()]);
}
+ @Override
public ICConfigurationDescription getConfiguration() {
return this;
}
+ @Override
public ICSettingContainer getParent() {
return fParent;
}
+ @Override
public ICResourceDescription[] getResourceDescriptions() {
return fRcHolder.getResourceDescriptions();
}
-
+
+ @Override
public ICStorageElement getStorage(String id, boolean create) throws CoreException {
return getSpecSettings().getStorage(id, create);
}
-
+
+ @Override
public void removeStorage(String id) throws CoreException {
getSpecSettings().removeStorage(id);
}
-
+
+ @Override
public ICStorageElement importStorage(String id, ICStorageElement el) throws UnsupportedOperationException, CoreException {
return getSpecSettings().importStorage(id, el);
}
+ @Override
public CConfigurationSpecSettings getSpecSettings() /*throws CoreException*/{
return fSpecSettings;
}
+ @Override
public String getBuildSystemId() {
return fSpecSettings.getBuildSystemId();
}
+ @Override
public CConfigurationData getConfigurationData() {
return fData;
}
+ @Override
public void setConfigurationData(String bsId, CConfigurationData data) throws WriteAccessException {
throw ExceptionFactory.createIsReadOnlyException();
}
@@ -318,42 +334,49 @@ public class CConfigurationDescriptionCache extends CDefaultConfigurationData
return false;
}
+ @Override
public CConfigurationData getConfigurationData(boolean write) throws WriteAccessException {
if(write)
throw ExceptionFactory.createIsReadOnlyException();
-
+
return this;
}
+ @Override
public void setActive() throws WriteAccessException {
throw ExceptionFactory.createIsReadOnlyException();
}
-
+
/* public CConfigurationData getBaseData(){
return fData;
}
*/
+ @Override
public ICFileDescription createFileDescription(IPath path, ICResourceDescription base) throws CoreException, WriteAccessException {
throw ExceptionFactory.createIsReadOnlyException();
}
+ @Override
public ICFolderDescription createFolderDescription(IPath path, ICFolderDescription base) throws CoreException, WriteAccessException {
throw ExceptionFactory.createIsReadOnlyException();
}
-
+
ResourceDescriptionHolder createHolderForRc(IPath path){
return new ResourceDescriptionHolder(fPathSettingContainer.getChildContainer(path, true, true), false);
}
+ @Override
public boolean isReadOnly() {
return !fInitializing;
}
+ @Override
public void setReadOnly(boolean readOnly, boolean keepModify) {
if (readOnly)
throw ExceptionFactory.createIsReadOnlyException();
}
+ @Override
public ICTargetPlatformSetting getTargetPlatformSetting() {
return (ICTargetPlatformSetting)getTargetPlatformData();
}
@@ -363,10 +386,12 @@ public class CConfigurationDescriptionCache extends CDefaultConfigurationData
return new CTargetPlatformSettingCache(base, this);
}
+ @Override
public ICFileDescription[] getFileDescriptions() {
return (ICFileDescription[])fRcHolder.getResourceDescriptions(ICSettingBase.SETTING_FILE);
}
+ @Override
public ICFolderDescription[] getFolderDescriptions() {
return (ICFolderDescription[])fRcHolder.getResourceDescriptions(ICSettingBase.SETTING_FOLDER);
}
@@ -380,14 +405,14 @@ public class CConfigurationDescriptionCache extends CDefaultConfigurationData
initSourceEntries();
return fProjSourceEntries.clone();
}
-
+
private void initSourceEntries(){
if(fProjSourceEntries == null){
- IProject project = getProject();
+ IProject project = getProject();
fProjSourceEntries = CDataUtil.adjustEntries(fSourceEntries, true, project);
}
}
-
+
private IProject getProject(){
return isPreferenceConfiguration() ? null : getProjectDescription().getProject();
}
@@ -397,50 +422,59 @@ public class CConfigurationDescriptionCache extends CDefaultConfigurationData
throw ExceptionFactory.createIsReadOnlyException();
}
+ @Override
public Map getReferenceInfo() {
return getSpecSettings().getReferenceInfo();
}
+ @Override
public void setReferenceInfo(Map refs) {
throw ExceptionFactory.createIsReadOnlyException();
}
+ @Override
public ICExternalSetting createExternalSetting(String[] languageIDs,
String[] contentTypeIds, String[] extensions,
ICSettingEntry[] entries) {
if(!fInitializing)
throw ExceptionFactory.createIsReadOnlyException();
-
+
return fSpecSettings.createExternalSetting(languageIDs, contentTypeIds, extensions, entries);
}
+ @Override
public ICExternalSetting[] getExternalSettings() {
return fSpecSettings.getExternalSettings();
}
+ @Override
public void removeExternalSetting(ICExternalSetting setting) {
if(!fInitializing)
throw ExceptionFactory.createIsReadOnlyException();
-
+
fSpecSettings.removeExternalSetting(setting);
}
+ @Override
public void removeExternalSettings() {
if(!fInitializing)
throw ExceptionFactory.createIsReadOnlyException();
-
+
fSpecSettings.removeExternalSettings();
}
-
+
+ @Override
public ICBuildSetting getBuildSetting() {
return (ICBuildSetting)getBuildData();
}
+ @Override
public void setSessionProperty(QualifiedName name, Object value) {
fSpecSettings.setSettionProperty(name, value);
//throw ExceptionFactory.createIsReadOnlyException();
}
+ @Override
public Object getSessionProperty(QualifiedName name) {
return fSpecSettings.getSettionProperty(name);
}
@@ -450,6 +484,7 @@ public class CConfigurationDescriptionCache extends CDefaultConfigurationData
return fData.getBuildVariablesContributor();
}
+ @Override
public ICConfigExtensionReference create(String extensionPoint,
String extension) throws CoreException {
if(!fInitializing)
@@ -457,32 +492,37 @@ public class CConfigurationDescriptionCache extends CDefaultConfigurationData
return fSpecSettings.create(extensionPoint, extension);
}
+ @Override
public ICConfigExtensionReference[] get(String extensionPointID) {
return fSpecSettings.get(extensionPointID);
}
+ @Override
public void remove(ICConfigExtensionReference ext) throws CoreException {
if(!fInitializing)
throw ExceptionFactory.createIsReadOnlyException();
fSpecSettings.remove(ext);
}
+ @Override
public void remove(String extensionPoint) throws CoreException {
if(!fInitializing)
throw ExceptionFactory.createIsReadOnlyException();
fSpecSettings.remove(extensionPoint);
}
-
+
+ @Override
public boolean isPreferenceConfiguration() {
return getProjectDescription() == null;
}
-
+
void doneInitialization(){
CProjectDescriptionManager.getInstance().notifyCached(this, fData, null);
fInitializing = false;
fSpecSettings.doneInitialization();
}
-
+
+ @Override
public ICLanguageSetting getLanguageSettingForFile(IPath path, boolean ignoreExcludeStatus) {
return CProjectDescriptionManager.getLanguageSettingForFile(this, path, ignoreExcludeStatus);
}
@@ -502,26 +542,30 @@ public class CConfigurationDescriptionCache extends CDefaultConfigurationData
IProject project = getProject();
if(project != null)
path = project.getFullPath().append(path);
-
+
return CDataUtil.isExcluded(path, fProjSourceEntries);
}
+ @Override
public String[] getExternalSettingsProviderIds() {
return fSpecSettings.getExternalSettingsProviderIds();
}
+ @Override
public void setExternalSettingsProviderIds(String[] ids) {
if(!fInitializing)
throw ExceptionFactory.createIsReadOnlyException();
fSpecSettings.setExternalSettingsProviderIds(ids);
}
+ @Override
public void updateExternalSettingsProviders(String[] ids) {
if(!fInitializing)
throw ExceptionFactory.createIsReadOnlyException();
fSpecSettings.updateExternalSettingsProviders(ids);
}
+ @Override
public ICSourceEntry[] getResolvedSourceEntries() {
if(fResolvedSourceEntries == null){
ICSourceEntry[] entries = getSourceEntries();
@@ -530,6 +574,7 @@ public class CConfigurationDescriptionCache extends CDefaultConfigurationData
return fResolvedSourceEntries;
}
+ @Override
public CConfigurationStatus getConfigurationStatus() {
CConfigurationStatus status = getStatus();
return status != null ? status : CConfigurationStatus.CFG_STATUS_OK;
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationSpecSettings.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationSpecSettings.java
index ae5a488764f..416bce252a1 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationSpecSettings.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CConfigurationSpecSettings.java
@@ -16,8 +16,8 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
-import java.util.Set;
import java.util.Map.Entry;
+import java.util.Set;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.settings.model.CExternalSetting;
@@ -267,10 +267,12 @@ public class CConfigurationSpecSettings implements ICSettingsStorage{
return fSettingsStorageElement;
}
+ @Override
public ICStorageElement getStorage(String id,boolean create) throws CoreException {
return getStorageBase().getStorage(id, create);
}
+ @Override
public void removeStorage(String id) throws CoreException {
getStorageBase().removeStorage(id);
}
@@ -389,10 +391,12 @@ public class CConfigurationSpecSettings implements ICSettingsStorage{
encodeProjectExtensions(extEl);
}
+ @Override
public boolean isReadOnly(){
return fCfg.isReadOnly();
}
+ @Override
public void setReadOnly(boolean readOnly, boolean keepModify) {
fCfg.setReadOnly(readOnly, keepModify);
}
@@ -499,6 +503,7 @@ public class CConfigurationSpecSettings implements ICSettingsStorage{
fExtSettingsProvider.removeExternalSettings();
}
+ @Override
public boolean isModified(){
if(fIsModified)
return true;
@@ -838,6 +843,7 @@ public class CConfigurationSpecSettings implements ICSettingsStorage{
}
}
+ @Override
public ICStorageElement importStorage(String id, ICStorageElement el) throws CoreException {
return getStorageBase().importStorage(id, el);
}
@@ -902,7 +908,7 @@ public class CConfigurationSpecSettings implements ICSettingsStorage{
}
return null;
}
-
+
private DeltaSet getReferenceDelta(ICConfigExtensionReference refs[], String[] extIds){
if(refs == null || refs.length == 0){
@@ -913,16 +919,16 @@ public class CConfigurationSpecSettings implements ICSettingsStorage{
Map map = createRefMap(refs);
return new DeltaSet(new HashSet(map.values()), null);
}
-
+
Set idSet = new HashSet(Arrays.asList(extIds));
Set idSetCopy = new HashSet(idSet);
Map refsMap = createRefMap(refs);
-
+
idSet.removeAll(refsMap.keySet());
refsMap.keySet().removeAll(idSetCopy);
-
+
Set extSet = new HashSet(refsMap.values());
-
+
return new DeltaSet(extSet, idSet);
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CDataProxy.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CDataProxy.java
index f2c0aa3548a..068ce5f1161 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CDataProxy.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CDataProxy.java
@@ -23,10 +23,10 @@ public abstract class CDataProxy implements ICSettingObject {
private int fFlags;
private CConfigurationDescription fConfiguration;
private String fId;
-
+
private static final int F_RESCAN = 1;
// private static final int F_WRITABLE = 1 << 1;
-
+
CDataProxy(CDataObject data, ICDataProxyContainer parent, CConfigurationDescription cfg) {
fData = data;
if(fData != null)
@@ -35,26 +35,27 @@ public abstract class CDataProxy implements ICSettingObject {
fConfiguration = cfg;
}
+ @Override
public ICSettingContainer getParent() {
return fParent;
}
-
+
protected void setRescan(boolean rescan){
if(isRescan() == rescan)
return;
-
+
if(rescan)
addFlags(F_RESCAN);
else
clearFlags(F_RESCAN);
}
-
+
protected boolean isRescan(){
if(checkFlags(F_RESCAN))
return true;
return false;//fData == null ? true : !fData.isValid();
}
-
+
private boolean checkFlags(int flags){
return (fFlags & flags) == flags;
}
@@ -66,16 +67,16 @@ public abstract class CDataProxy implements ICSettingObject {
private void clearFlags(int flags){
fFlags &= (~flags);
}
-
+
protected CDataObject getData(boolean write){
checkUpdate(write);
- return fData;
+ return fData;
}
-
+
protected CDataObject doGetData(){
return fData;
}
-
+
protected boolean containsWritableData(){
return !(fData instanceof ICachedData);
}
@@ -88,35 +89,35 @@ public abstract class CDataProxy implements ICSettingObject {
else
clearFlags(F_WRITABLE);
}
-*/
+*/
/* void setData(CDataObject data, boolean write){
fData = data;
setWritable(write);
setRescan(false);
}
*/
-
+
/* void updateData(CDataObject data){
fData = data;
setRescan(false);
}
-*/
+*/
void setData(CDataObject data){
fId = data.getId();
fData = data;
}
-
+
void internalSetId(String id){
fId = id;
}
-
+
void doClearData(){
fData = null;
setRescan(true);
}
final protected void checkUpdate(boolean write){
- if((write && !containsWritableData())
+ if((write && !containsWritableData())
|| isRescan())
fParent.updateChild(this, write);
}
@@ -125,16 +126,19 @@ public abstract class CDataProxy implements ICSettingObject {
fData = null;
fParent = null;
}
-
+
+ @Override
public boolean isValid(){
checkUpdate(false);
return fData != null ? fData.isValid() : false;
}
-
+
+ @Override
public ICConfigurationDescription getConfiguration() {
return fConfiguration;
}
+ @Override
public String getId() {
return fId;
// CDataObject data = getData(false);
@@ -146,31 +150,33 @@ public abstract class CDataProxy implements ICSettingObject {
return data != null ? data.getKind() : 0;
}
*/
+ @Override
public String getName() {
CDataObject data = getData(false);
return data != null ? data.getName() : null;
}
-
+
void setConfiguration(CConfigurationDescription cfg){
fConfiguration = cfg;
}
-
+
+ @Override
public boolean isReadOnly() {
return false;
}
-
+
protected IProject getProject(){
ICConfigurationDescription cfg = getConfiguration();
if(cfg == null)
return null;
-
+
ICProjectDescription projDes = cfg.getProjectDescription();
if(projDes == null)
return null;
-
+
return projDes.getProject();
}
-
+
/**
* This method is intended for debugging purpose only.
*/
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CDataProxyContainer.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CDataProxyContainer.java
index 80d77ab7f63..b93a4b2cbf1 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CDataProxyContainer.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CDataProxyContainer.java
@@ -15,11 +15,11 @@ import org.eclipse.cdt.core.settings.model.extension.CDataObject;
public abstract class CDataProxyContainer extends CDataProxy implements ICDataProxyContainer{
private IProxyProvider fChildProxyProvider;
-
+
CDataProxyContainer(CDataObject data, ICDataProxyContainer parent, CConfigurationDescription cfg) {
super(data, parent, cfg);
}
-
+
/* protected class ChildrenDataScope implements ICDataScope{
public boolean isStatic() {
return isWritable();
@@ -40,7 +40,7 @@ public abstract class CDataProxyContainer extends CDataProxy implements ICDataPr
return provider.getProxy(id);
}
-
+
public ICSettingObject[] getChildrenOfKind(int kind){
IProxyProvider provider = getChildrenProxyProvider();
@@ -56,9 +56,10 @@ public abstract class CDataProxyContainer extends CDataProxy implements ICDataPr
fChildProxyProvider = createChildProxyProvider();
return fChildProxyProvider;
}
-
+
protected abstract IProxyProvider createChildProxyProvider();
+ @Override
public ICSettingObject[] getChildSettings() {
IProxyProvider provider = getChildrenProxyProvider();
@@ -68,29 +69,30 @@ public abstract class CDataProxyContainer extends CDataProxy implements ICDataPr
return provider.getProxies();
}
+ @Override
public void updateChild(CDataProxy child, boolean write){
getData(write);
getChildrenProxyProvider().cacheValues();
}
-
+
@Override
protected void setRescan(boolean rescan){
if(isRescan() == rescan)
return;
-
+
super.setRescan(rescan);
-
+
if(rescan){
setRescanChildren();
}
}
-
+
@Override
void setData(CDataObject data) {
super.setData(data);
setRescanChildren();
}
-
+
protected void setRescanChildren(){
IProxyProvider provider = getChildrenProxyProvider();
if(provider == null)
@@ -102,12 +104,12 @@ public abstract class CDataProxyContainer extends CDataProxy implements ICDataPr
for(int i = 0; i < proxies.length; i++){
proxies[i].setRescan(true);
}
-
+
}
public ICSettingObject getChildSettingById(String id) {
return getChildrenProxyProvider().getProxy(id);
}
-
-
+
+
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CExternalSettingsManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CExternalSettingsManager.java
index 1368e5063a9..6f8c9966869 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CExternalSettingsManager.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CExternalSettingsManager.java
@@ -42,13 +42,13 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP
private static final int OP_CHANGED = 1;
private static final int OP_ADDED = 2;
private static final int OP_REMOVED = 3;
-
+
private static final QualifiedName EXTERNAL_SETTING_PROPERTY = new QualifiedName(CCorePlugin.PLUGIN_ID, "externalSettings"); //$NON-NLS-1$
private static final String EXTERNAL_SETTING_STORAGE_ID = CCorePlugin.PLUGIN_ID + ".externalSettings"; //$NON-NLS-1$
-
+
private Map fFactoryMap = new HashMap();
private static CExternalSettingsManager fInstance;
-
+
private CExternalSettingsManager(){
}
@@ -67,14 +67,14 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP
CProjectDescriptionManager.getInstance().removeCProjectDescriptionListener(this);
}
-
+
public static CExternalSettingsManager getInstance(){
if(fInstance == null){
fInstance = new CExternalSettingsManager();
}
return fInstance;
}
-
+
/**
* A simple class representing an external settings container.
* These are uniquely identifiable by the factoryId + factory
@@ -83,7 +83,7 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP
public final static class CContainerRef {
private final String fFactoryId;
private final String fContainerId;
-
+
public CContainerRef(String factoryId, String containerId){
fFactoryId = factoryId;
fContainerId = containerId;
@@ -101,15 +101,15 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP
public boolean equals(Object obj) {
if(obj == this)
return true;
-
+
if(obj == null)
return false;
-
+
if(!(obj instanceof CContainerRef))
return false;
-
+
CContainerRef other = (CContainerRef)obj;
-
+
if(!fContainerId.equals(other.fContainerId))
return false;
@@ -129,14 +129,14 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP
private static class ContainerDescriptor {
private FactoryDescriptor fFactoryDr;
private CExternalSettingsHolder fHolder;
-
+
private CExternalSettingsContainer fContainer;
/** Stash error messages so we're not too noisy if things go wrong */
private static Set failingProvidersMessages;
private ContainerDescriptor(FactoryDescriptor factoryDr,
- String containerId,
+ String containerId,
IProject project,
ICConfigurationDescription cfgDes,
CExternalSetting[] previousSettings){
@@ -162,7 +162,7 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP
}
return fHolder.getExternalSettings();
}
-
+
}
/**
@@ -170,13 +170,13 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP
*/
static class NullContainer extends CExternalSettingsContainer {
static final NullContainer INSTANCE = new NullContainer();
-
+
@Override
public CExternalSetting[] getExternalSettings() {
return new CExternalSetting[0];
}
}
-
+
private static class NullFactory extends CExternalSettingContainerFactory {
static NullFactory INSTANCE = new NullFactory();
@@ -186,15 +186,15 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP
return NullContainer.INSTANCE;
}
}
-
+
private class FactoryDescriptor {
private CExternalSettingContainerFactory fFactory;
private String fId;
-
+
private FactoryDescriptor(String id){
fId = id;
}
-
+
private CExternalSettingContainerFactory getFactory(){
if(fFactory == null){
fFactory = createFactory(fId);
@@ -203,7 +203,7 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP
}
return fFactory;
}
-
+
private CExternalSettingContainerFactory createFactory(String id) {
if(id.equals(CfgExportSettingContainerFactory.FACTORY_ID))
return CfgExportSettingContainerFactory.getInstance();
@@ -211,7 +211,7 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP
return ExtensionContainerFactory.getInstance();
return NullFactory.INSTANCE;
}
-
+
public void shutdown(){
if(fFactory != null){
fFactory.removeListener(CExternalSettingsManager.this);
@@ -220,35 +220,36 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP
}
}
}
-
+
private interface ICfgContainer {
ICConfigurationDescription getConfguration(boolean write);
}
-
+
private static class CfgContainer implements ICfgContainer {
private ICConfigurationDescription fCfgDes;
-
+
CfgContainer(ICConfigurationDescription cfgDes){
fCfgDes = cfgDes;
}
-
+
+ @Override
public ICConfigurationDescription getConfguration(boolean write) {
return fCfgDes;
}
-
+
}
-
+
private class CfgContainerRefInfoContainer {
private ICfgContainer fCfgContainer;
private CSettingsRefInfo fRefInfo;
private boolean fWriteWasRequested;
-
+
CfgContainerRefInfoContainer(ICfgContainer container){
fCfgContainer = container;
}
-
+
public CSettingsRefInfo getRefInfo(boolean write) {
- if(fRefInfo == null
+ if(fRefInfo == null
|| (write && !fWriteWasRequested)){
ICConfigurationDescription cfg = fCfgContainer.getConfguration(write);
fRefInfo = CExternalSettingsManager.this.getRefInfo(cfg, write);
@@ -257,20 +258,20 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP
return fRefInfo;
}
}
-
+
private static class HolderContainer {
private CfgContainerRefInfoContainer fRIContainer;
private CRefSettingsHolder fHolder;
private boolean fWriteWasRequested;
private CContainerRef fCRef;
-
+
HolderContainer(CfgContainerRefInfoContainer cr, CContainerRef cref){
fRIContainer = cr;
fCRef = cref;
}
-
+
CRefSettingsHolder getHolder(boolean write){
- if(fHolder == null
+ if(fHolder == null
|| (write && !fWriteWasRequested)){
CSettingsRefInfo ri = fRIContainer.getRefInfo(write);
fHolder = ri.get(fCRef);
@@ -278,42 +279,43 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP
}
return fHolder;
}
-
+
void setHolder(CRefSettingsHolder holder){
fRIContainer.getRefInfo(true).put(holder);
fWriteWasRequested = true;
fHolder = holder;
}
-
+
void removeHolder(){
fWriteWasRequested = true;
fHolder = null;
fRIContainer.getRefInfo(true).remove(fCRef);
}
}
-
+
private static class CfgListCfgContainer implements ICfgContainer{
private ProjDesCfgList fList;
private int fNum;
-
+
CfgListCfgContainer(ProjDesCfgList list, int num){
fList = list;
fNum = num;
}
-
+
+ @Override
public ICConfigurationDescription getConfguration(boolean write) {
return fList.get(fNum, write);
}
}
-
+
/**
- * A simple container type that contains a Project Description & and associated list
+ * A simple container type that contains a Project Description & and associated list
* of configuration descriptions.
*/
private static class ProjDesCfgList {
private ICProjectDescription fProjDes;
private List fCfgList = new ArrayList();
-
+
public ProjDesCfgList(ICProjectDescription des, Set idSet){
fProjDes = des;
ICConfigurationDescription[] cfgs = des.getConfigurations();
@@ -326,14 +328,14 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP
public boolean isWritable(){
return !fProjDes.isReadOnly();
}
-
+
public ICConfigurationDescription get(int num, boolean write) {
if(write && fProjDes.isReadOnly()){
makeWritable();
}
return fCfgList.get(num);
}
-
+
private void makeWritable(){
ICProjectDescription writeDes = CProjectDescriptionManager.getInstance().getProjectDescription(fProjDes.getProject());
fProjDes = writeDes;
@@ -346,12 +348,12 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP
fCfgList.remove(i);
}
}
-
+
public int size() {
return fCfgList.size();
}
}
-
+
private FactoryDescriptor getFactoryDescriptor(String id){
FactoryDescriptor dr = fFactoryMap.get(id);
if(dr == null){
@@ -360,20 +362,21 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP
}
return dr;
}
-
+
CExternalSettingContainerFactory getFactory(String id){
FactoryDescriptor dr = getFactoryDescriptor(id);
return dr.getFactory();
}
- private volatile IWorkspaceRunnable workspaceReconcileRunnable;
+ private volatile IWorkspaceRunnable workspaceReconcileRunnable;
/**
* External settings call-back from the setting container factories
* to notify that settings have changed in a container.
- *
+ *
* Schedules a runnable to update any referencing projects
*/
+ @Override
public void settingsChanged(final IProject project, final String cfgId, final CExternalSettingChangeEvent event) {
// Performance: If workspace reconcile already scheduled, then nothing to do...
// Current project && cfgId always null (i.e. always reconcile at the workspace level) but don't assume this for the future
@@ -385,6 +388,7 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP
// Modifying the project description in an asynchronous runnable is likely bad...
// Unfortunately there's nothing else we can do as it's not safe to modify the referencing configurations in place
r = new IWorkspaceRunnable() {
+ @Override
@SuppressWarnings("unchecked")
public void run(IProgressMonitor monitor) throws CoreException {
// Unset workspaceReconcileRunnable
@@ -483,36 +487,36 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP
return new ProjDesCfgList(des, cfgIdSet);
}
-
- private boolean processContainerChange(int op,
- ICfgContainer cr,
- CfgContainerRefInfoContainer riContainer,
+
+ private boolean processContainerChange(int op,
+ ICfgContainer cr,
+ CfgContainerRefInfoContainer riContainer,
CContainerRef crInfo){
ICConfigurationDescription cfg = cr.getConfguration(false);
- ExtSettingsDelta[] deltas = checkExternalSettingsChange(op,
+ ExtSettingsDelta[] deltas = checkExternalSettingsChange(op,
cfg.getProjectDescription().getProject(), cfg, riContainer, crInfo);
-
+
if(deltas != null)
return CExternalSettingsDeltaProcessor.applyDelta(cr.getConfguration(true), deltas);
return false;
}
-
+
private static class RefInfoContainer{
CSettingsRefInfo fRefInfo;
int fInstanceId;
-
+
RefInfoContainer(CSettingsRefInfo ri, int id){
fRefInfo = ri;
fInstanceId = id;
}
}
-
+
private CSettingsRefInfo getRefInfo(ICConfigurationDescription cfg, boolean write){
if(write && cfg.isReadOnly())
throw new IllegalArgumentException(SettingsModelMessages.getString("CExternalSettingsManager.3")); //$NON-NLS-1$
-
+
RefInfoContainer cr = (RefInfoContainer)cfg.getSessionProperty(EXTERNAL_SETTING_PROPERTY);
CSettingsRefInfo ri;
boolean setCr = false;
@@ -528,15 +532,15 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP
ri = cr.fRefInfo;
setCr = false;
}
-
+
if(setCr){
cr = new RefInfoContainer(ri, cfg.hashCode());
cfg.setSessionProperty(EXTERNAL_SETTING_PROPERTY, cr);
}
-
+
return ri;
}
-
+
private CSettingsRefInfo load(ICConfigurationDescription cfg){
try {
ICStorageElement el = cfg.getStorage(EXTERNAL_SETTING_STORAGE_ID, false);
@@ -556,13 +560,14 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP
* writable, store cached external settings into the configuration
* - LOADED: Check whether a reconcile is needed and update the settings atomically
*/
+ @Override
public void handleEvent(CProjectDescriptionEvent event) {
switch(event.getEventType()){
case CProjectDescriptionEvent.DATA_APPLIED: {
ICProjectDescription des = event.getNewCProjectDescription();
if(des == null)
return;
-
+
ICConfigurationDescription[] cfgs = des.getConfigurations();
for(int i = 0; i < cfgs.length; i++){
ICConfigurationDescription cfg = cfgs[i];
@@ -577,7 +582,7 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP
// If the project description has no references, short-circuit:
boolean needsReconcile = false;
for (ICConfigurationDescription desc : event.getNewCProjectDescription().getConfigurations()) {
- if (!desc.getReferenceInfo().isEmpty() ||
+ if (!desc.getReferenceInfo().isEmpty() ||
(desc.getExternalSettingsProviderIds() != null && desc.getExternalSettingsProviderIds().length > 0)) {
needsReconcile = true;
break;
@@ -591,6 +596,7 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP
// us to reconcile / update the cached configuration during load
final IProject project = event.getProject();
IWorkspaceRunnable r = new IWorkspaceRunnable(){
+ @Override
@SuppressWarnings("unchecked")
public void run(IProgressMonitor monitor) throws CoreException {
if (!project.isAccessible())
@@ -631,12 +637,12 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP
CCorePlugin.log(e);
}
}
-
+
public void containerContentsChanged(ICConfigurationDescription cfg, CContainerRef cr){
CfgContainer ccr = new CfgContainer(cfg);
processContainerChange(OP_CHANGED, ccr, new CfgContainerRefInfoContainer(ccr), cr);
}
-
+
public void addContainer(ICConfigurationDescription cfg, CContainerRef cr){
CfgContainer ccr = new CfgContainer(cfg);
processContainerChange(OP_ADDED, ccr, new CfgContainerRefInfoContainer(ccr), cr);
@@ -646,16 +652,16 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP
CfgContainer ccr = new CfgContainer(cfg);
processContainerChange(OP_REMOVED, ccr, new CfgContainerRefInfoContainer(ccr), cr);
}
-
+
public CContainerRef[] getReferences(ICConfigurationDescription cfg, String factoryId){
CSettingsRefInfo info = getRefInfo(cfg, false);
return info.getReferences(factoryId);
}
-
- private ExtSettingsDelta[] checkExternalSettingsChange(int op,
- IProject proj,
- ICConfigurationDescription cfgDes,
- CfgContainerRefInfoContainer riContainer,
+
+ private ExtSettingsDelta[] checkExternalSettingsChange(int op,
+ IProject proj,
+ ICConfigurationDescription cfgDes,
+ CfgContainerRefInfoContainer riContainer,
CContainerRef cr){
HolderContainer hCr = new HolderContainer(riContainer, cr);
CRefSettingsHolder holder = hCr.getHolder(false);
@@ -688,7 +694,7 @@ public class CExternalSettingsManager implements ICExternalSettingsListener, ICP
hCr.removeHolder();
return deltas;
}
-
+
public void restoreSourceEntryDefaults(ICConfigurationDescription cfg){
CfgContainer cr = new CfgContainer(cfg);
CfgContainerRefInfoContainer ric = new CfgContainerRefInfoContainer(cr);
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CFileDescription.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CFileDescription.java
index 49a07e96697..95e95ceea01 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CFileDescription.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CFileDescription.java
@@ -31,21 +31,25 @@ public class CFileDescription extends CDataProxyContainer implements
super(data, cfg, cfg);
}
+ @Override
public IPath getPath() {
CResourceData data = (CResourceData)getData(false);
return ResourceDescriptionHolder.normalizePath(data.getPath());
}
+ @Override
public boolean isExcluded() {
CConfigurationDescription cfg = (CConfigurationDescription)getConfiguration();
return cfg.isExcluded(getPath());
}
+ @Override
public void setExcluded(boolean excluded) {
CConfigurationDescription cfg = (CConfigurationDescription)getConfiguration();
cfg.setExcluded(getPath(), false, excluded);
}
+ @Override
public void setPath(IPath path) {
path = ResourceDescriptionHolder.normalizePath(path);
if(getPath().equals(path))
@@ -53,7 +57,7 @@ public class CFileDescription extends CDataProxyContainer implements
CResourceData data = (CResourceData)getData(true);
data.setPath(path);
}
-
+
@Override
void setData(CDataObject data) {
super.setData(data);
@@ -64,20 +68,24 @@ public class CFileDescription extends CDataProxyContainer implements
}
}
+ @Override
public IPath getCachedPath() {
if(fCache != null)
return fCache.getPath();
return null;
}
+ @Override
public final int getType() {
return ICSettingBase.SETTING_FILE;
}
+ @Override
public void setPathContainer(PathSettingsContainer cr) {
fCache = cr;
}
+ @Override
public ICLanguageSetting getLanguageSetting() {
CFileData data = getFileData(false);
IProxyProvider provider = getChildrenProxyProvider();
@@ -86,7 +94,7 @@ public class CFileDescription extends CDataProxyContainer implements
return (ICLanguageSetting)provider.getProxy(lData);
return null;
}
-
+
protected CFileData getFileData(boolean write){
return (CFileData)getData(write);
}
@@ -95,26 +103,29 @@ public class CFileDescription extends CDataProxyContainer implements
protected IProxyProvider createChildProxyProvider() {
ICDataScope scope = new ICDataScope(){
+ @Override
public CDataObject[] getChildren() {
return new CLanguageData[]{getFileData(false).getLanguageData()};
}
+ @Override
public boolean isStatic() {
return !containsWritableData();
}
-
+
};
IProxyCache cache = new MapProxyCache();
-
+
return new ProxyProvider(scope, cache, this);
}
-
+
+ @Override
public CDataProxy createProxy(CDataObject data) {
if(data instanceof CLanguageData)
return new CLanguageSetting((CLanguageData)data, this, (CConfigurationDescription)getConfiguration());
return null;
}
-
+
private ResourceDescriptionHolder getRcHolder(){
if(fRcHolder == null){
fRcHolder = ((CConfigurationDescription)getConfiguration()).createHolder(this);
@@ -122,14 +133,17 @@ public class CFileDescription extends CDataProxyContainer implements
return fRcHolder;
}
+ @Override
public ICFolderDescription getParentFolderDescription() {
return getRcHolder().getParentFolderDescription();
}
+ @Override
public PathSettingsContainer getPathContainer() {
return fCache;
}
+ @Override
public boolean canExclude(boolean exclude) {
CConfigurationDescription cfg = (CConfigurationDescription)getConfiguration();
return cfg.canExclude(getPath(), false, exclude);
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CFileDescriptionCache.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CFileDescriptionCache.java
index 873c832446a..ec209fc84c8 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CFileDescriptionCache.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CFileDescriptionCache.java
@@ -34,16 +34,18 @@ public class CFileDescriptionCache extends CDefaultFileData implements
copyDataFrom(base, true);
}
-
+
@Override
protected CLanguageData copyLanguageData(CLanguageData data, boolean clone) {
return new CLanguageSettingCache(data, this);
}
+ @Override
public void setExcluded(boolean excluded) throws WriteAccessException {
throw ExceptionFactory.createIsReadOnlyException();
}
-
+
+ @Override
public boolean canExclude(boolean exclude) {
return exclude == isExcluded();
}
@@ -59,26 +61,31 @@ public class CFileDescriptionCache extends CDefaultFileData implements
throw ExceptionFactory.createIsReadOnlyException();
}
+ @Override
public ICConfigurationDescription getConfiguration() {
return fCfg;
}
+ @Override
public ICSettingContainer getParent() {
return fCfg;
}
+ @Override
public ICLanguageSetting getLanguageSetting() {
return (ICLanguageSetting)fLanguageData;
}
+ @Override
public ICSettingObject[] getChildSettings() {
return new ICSettingObject[]{(ICSettingObject)fLanguageData};
}
+ @Override
public boolean isReadOnly() {
return true;
}
-
+
private ResourceDescriptionHolder getRcDesHolder(){
if(fRcDesHolder == null)
fRcDesHolder = fCfg.createHolderForRc(getPath());
@@ -86,6 +93,7 @@ public class CFileDescriptionCache extends CDefaultFileData implements
}
+ @Override
public ICFolderDescription getParentFolderDescription() {
return getRcDesHolder().getParentFolderDescription();
}
@@ -100,6 +108,7 @@ public class CFileDescriptionCache extends CDefaultFileData implements
return true;
}
+ @Override
public boolean isExcluded() {
return fCfg.isExcluded(getPath());
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CFolderDescription.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CFolderDescription.java
index f030725d679..63e98ae13b2 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CFolderDescription.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CFolderDescription.java
@@ -27,32 +27,36 @@ public class CFolderDescription extends CDataProxyContainer implements
ICFolderDescription, IProxyFactory, IInternalResourceDescription {
private ResourceDescriptionHolder fRcHolder;
private PathSettingsContainer fCache;
-
+
CFolderDescription(CFolderData data, CConfigurationDescription cfg) {
super(data, cfg, cfg);
}
+ @Override
public IPath getPath() {
CResourceData data = (CResourceData)getData(false);
return ResourceDescriptionHolder.normalizePath(data.getPath());
}
+ @Override
public boolean isExcluded() {
CConfigurationDescription cfg = (CConfigurationDescription)getConfiguration();
return cfg.isExcluded(getPath());
}
+ @Override
public void setExcluded(boolean excluded) {
CConfigurationDescription cfg = (CConfigurationDescription)getConfiguration();
cfg.setExcluded(getPath(), true, excluded);
}
+ @Override
public void setPath(IPath path) {
path = ResourceDescriptionHolder.normalizePath(path);
if(getPath().equals(path))
return;
-
+
CResourceData data = (CResourceData)getData(true);
data.setPath(path);
}
@@ -65,36 +69,42 @@ public class CFolderDescription extends CDataProxyContainer implements
protected IProxyProvider createChildProxyProvider() {
ICDataScope scope = new ICDataScope(){
+ @Override
public CDataObject[] getChildren() {
return getFolderData(false).getLanguageDatas();
}
+ @Override
public boolean isStatic() {
return !containsWritableData();
}
-
+
};
IProxyCache cache = new MapProxyCache();
-
+
return new ProxyProvider(scope, cache, this);
}
+ @Override
public ICResourceDescription getNestedResourceDescription(IPath relPath, boolean exactPath) {
return getRcHolder().getResourceDescription(relPath, exactPath);
}
+ @Override
public ICResourceDescription[] getNestedResourceDescriptions(int kind) {
return getRcHolder().getResourceDescriptions(kind);
}
+ @Override
public ICLanguageSetting getLanguageSettingForFile(String fileName) {
IProject project = getConfiguration().getProjectDescription().getProject();
return CProjectDescriptionManager.getInstance().findLanguagSettingForFile(fileName, project, getLanguageSettings());
}
+ @Override
public ICLanguageSetting[] getLanguageSettings() {
IProxyProvider provider = getChildrenProxyProvider();
CFolderData data = (CFolderData)getData(false);
@@ -107,12 +117,13 @@ public class CFolderDescription extends CDataProxyContainer implements
}
+ @Override
public CDataProxy createProxy(CDataObject data) {
if(data instanceof CLanguageData)
return new CLanguageSetting((CLanguageData)data, this, (CConfigurationDescription)getConfiguration());
return null;
}
-
+
private ResourceDescriptionHolder getRcHolder(){
if(fRcHolder == null){
fRcHolder = ((CConfigurationDescription)getConfiguration()).createHolder(this);
@@ -130,43 +141,50 @@ public class CFolderDescription extends CDataProxyContainer implements
}
}
+ @Override
public IPath getCachedPath() {
if(fCache != null)
return fCache.getPath();
return null;
}
+ @Override
public final int getType() {
return ICSettingBase.SETTING_FOLDER;
}
+ @Override
public void setPathContainer(PathSettingsContainer cr) {
fCache = cr;
}
-
+
+ @Override
public PathSettingsContainer getPathContainer(){
return fCache;
}
+ @Override
public ICResourceDescription[] getNestedResourceDescriptions() {
return getNestedResourceDescriptions(ICSettingBase.SETTING_FILE | ICSettingBase.SETTING_FOLDER);
}
+ @Override
public ICFolderDescription getParentFolderDescription() {
return getRcHolder().getParentFolderDescription();
}
+ @Override
public ICLanguageSetting createLanguageSettingForContentTypes(
String languageId, String[] typeIds) throws CoreException {
CFolderData data = getFolderData(true);
-
+
CLanguageData lData = data.createLanguageDataForContentTypes(languageId, typeIds);
if(lData == null)
throw ExceptionFactory.createCoreException(SettingsModelMessages.getString("CFolderDescription.0")); //$NON-NLS-1$
-
+
CDataProxy proxy = getChildrenProxyProvider().getProxy(lData);
if(!(proxy instanceof ICLanguageSetting))
throw ExceptionFactory.createCoreException(SettingsModelMessages.getString("CFolderDescription.1") + proxy.getClass().getName()); //$NON-NLS-1$
@@ -175,14 +193,15 @@ public class CFolderDescription extends CDataProxyContainer implements
}
+ @Override
public ICLanguageSetting createLanguageSettingForExtensions(
String languageId, String[] extensions) throws CoreException {
CFolderData data = getFolderData(true);
-
+
CLanguageData lData = data.createLanguageDataForExtensions(languageId, extensions);
if(lData == null)
throw ExceptionFactory.createCoreException(SettingsModelMessages.getString("CFolderDescription.2")); //$NON-NLS-1$
-
+
CDataProxy proxy = getChildrenProxyProvider().getProxy(lData);
if(!(proxy instanceof ICLanguageSetting))
throw ExceptionFactory.createCoreException(SettingsModelMessages.getString("CFolderDescription.3") + proxy.getClass().getName()); //$NON-NLS-1$
@@ -190,10 +209,12 @@ public class CFolderDescription extends CDataProxyContainer implements
return (ICLanguageSetting)proxy;
}
+ @Override
public boolean isRoot() {
return getPath().segmentCount() == 0;
}
-
+
+ @Override
public boolean canExclude(boolean exclude) {
CConfigurationDescription cfg = (CConfigurationDescription)getConfiguration();
return cfg.canExclude(getPath(), true, exclude);
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CFolderDescriptionCache.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CFolderDescriptionCache.java
index adbb0655c37..c9f7bfd4f76 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CFolderDescriptionCache.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CFolderDescriptionCache.java
@@ -34,35 +34,42 @@ public class CFolderDescriptionCache extends CDefaultFolderData implements
super(base.getId(), base.getPath(), cfg, null);
fCfg = cfg;
fCfg.addResourceDescription(this);
-
+
copyDataFrom(base, true);
}
-
+
+ @Override
public ICLanguageSetting getLanguageSettingForFile(String fileName) {
IProject project = getConfiguration().getProjectDescription().getProject();
return CProjectDescriptionManager.getInstance().findLanguagSettingForFile(fileName, project, getLanguageSettings());
}
+ @Override
public ICLanguageSetting[] getLanguageSettings() {
return fLanguageDatas.toArray(new CLanguageSettingCache[fLanguageDatas.size()]);
}
+ @Override
public ICResourceDescription getNestedResourceDescription(IPath relPath, boolean exactPath) {
return getRcDesHolder().getResourceDescription(relPath, exactPath);
}
+ @Override
public ICResourceDescription[] getNestedResourceDescriptions(int kind) {
return getRcDesHolder().getResourceDescriptions(kind);
}
+ @Override
public ICConfigurationDescription getConfiguration() {
return fCfg;
}
+ @Override
public ICSettingContainer getParent() {
return fCfg;
}
+ @Override
public ICSettingObject[] getChildSettings() {
return getLanguageSettings();
}
@@ -72,10 +79,12 @@ public class CFolderDescriptionCache extends CDefaultFolderData implements
return new CLanguageSettingCache(base, this);
}
+ @Override
public void setExcluded(boolean excluded) {
throw ExceptionFactory.createIsReadOnlyException();
}
+ @Override
public boolean canExclude(boolean exclude) {
return exclude == isExcluded();
}
@@ -88,21 +97,24 @@ public class CFolderDescriptionCache extends CDefaultFolderData implements
public void setName(String name) throws WriteAccessException {
throw ExceptionFactory.createIsReadOnlyException();
}
-
+
+ @Override
public ICResourceDescription[] getNestedResourceDescriptions() {
return getNestedResourceDescriptions(ICSettingBase.SETTING_FILE | ICSettingBase.SETTING_FOLDER);
}
-
+
private ResourceDescriptionHolder getRcDesHolder(){
if(fRcDesHolder == null)
fRcDesHolder = fCfg.createHolderForRc(getPath());
return fRcDesHolder;
}
+ @Override
public boolean isReadOnly() {
return true;
}
+ @Override
public ICFolderDescription getParentFolderDescription() {
return getRcDesHolder().getParentFolderDescription();
}
@@ -111,11 +123,13 @@ public class CFolderDescriptionCache extends CDefaultFolderData implements
throw ExceptionFactory.createIsReadOnlyException();
}
+ @Override
public ICLanguageSetting createLanguageSettingForContentTypes(
String languageId, String[] typeIds) {
throw ExceptionFactory.createIsReadOnlyException();
}
+ @Override
public ICLanguageSetting createLanguageSettingForExtensions(
String languageId, String[] extensions) {
throw ExceptionFactory.createIsReadOnlyException();
@@ -133,10 +147,11 @@ public class CFolderDescriptionCache extends CDefaultFolderData implements
throw ExceptionFactory.createIsReadOnlyException();
}
+ @Override
public boolean isRoot() {
return getPath().segmentCount() == 0;
}
-
+
@Override
public IPath getPath() {
return ResourceDescriptionHolder.normalizePath(super.getPath());
@@ -147,6 +162,7 @@ public class CFolderDescriptionCache extends CDefaultFolderData implements
return true;
}
+ @Override
public boolean isExcluded() {
return fCfg.isExcluded(getPath());
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CLanguageSetting.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CLanguageSetting.java
index 7b2c1139b6e..f195379e48c 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CLanguageSetting.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CLanguageSetting.java
@@ -30,6 +30,7 @@ public class CLanguageSetting extends CDataProxy implements
super(data, parent, cfg);
}
+ @Override
public final int getType() {
return ICSettingBase.SETTING_LANGUAGE;
}
@@ -39,16 +40,18 @@ public class CLanguageSetting extends CDataProxy implements
// return data.getHeaderContentType();
// }
+ @Override
public String getLanguageId() {
CLanguageData data = getCLanguageData(false);
return data.getLanguageId();
}
-
+
+ @Override
public void setLanguageId(String id){
CLanguageData data = getCLanguageData(true);
data.setLanguageId(id);
}
-
+
private CLanguageData getCLanguageData(boolean write){
return (CLanguageData)getData(write);
}
@@ -57,11 +60,13 @@ public class CLanguageSetting extends CDataProxy implements
// return getSettingEntries(ICLanguageSettingEntry.ALL);
// }
+ @Override
public ICLanguageSettingEntry[] getSettingEntries(int kind) {
CLanguageData data = getCLanguageData(false);
return data.getEntries(kind);
}
+ @Override
public List getSettingEntriesList(int kind) {
CLanguageData data = getCLanguageData(false);
ICLanguageSettingEntry entries[] = data.getEntries(kind);
@@ -70,6 +75,7 @@ public class CLanguageSetting extends CDataProxy implements
return new ArrayList();
}
+ @Override
public String[] getSourceContentTypeIds() {
CLanguageData data = getCLanguageData(false);
String ids[] = data.getSourceContentTypeIds();
@@ -78,15 +84,17 @@ public class CLanguageSetting extends CDataProxy implements
return CDefaultLanguageData.EMPTY_STRING_ARRAY;
}
+ @Override
public int getSupportedEntryKinds() {
CLanguageData data = getCLanguageData(false);
return data.getSupportedEntryKinds();
}
+ @Override
public boolean supportsEntryKind(int kind) {
return (getSupportedEntryKinds() & kind) == kind;
}
-
+
/* public String[] getHeaderExtensions() {
CLanguageData data = getCLanguageData(false);
IContentType type = data.getHeaderContentType();
@@ -100,10 +108,11 @@ public class CLanguageSetting extends CDataProxy implements
else
exts = new String[0];
}
-
+
return exts;
}
*/
+ @Override
public String[] getSourceExtensions() {
CLanguageData data = getCLanguageData(false);
return CDataUtil.getSourceExtensions(getProject(), data);
@@ -118,17 +127,17 @@ public class CLanguageSetting extends CDataProxy implements
// else
// exts = CDefaultLanguageData.EMPTY_STRING_ARRAY;
// }
-//
+//
// if(exts == null)
// exts = CDefaultLanguageData.EMPTY_STRING_ARRAY;
// return exts;
}
-
+
/*
private Map fillNameToEntryMap(ICLanguageSettingEntry entries[], Map map){
if(map == null)
map = new HashMap();
-
+
for(int i = 0; i < entries.length; i++){
ICLanguageSettingEntry entry = entries[i];
map.put(entry.getName(), entry);
@@ -136,14 +145,14 @@ public class CLanguageSetting extends CDataProxy implements
return map;
}
-
+
private class SettingChangeInfo implements ICSettingsChangeInfo {
CLanguageData fData;
ICLanguageSettingEntry fNewEntries[];
int fKind;
ICLanguageSettingEntryInfo fAddedInfo[];
ICLanguageSettingEntry fRemoved[];
-
+
SettingChangeInfo(int kind, ICLanguageSettingEntry newEntries[], CLanguageData data){
fNewEntries = newEntries;
fData = data;
@@ -170,11 +179,11 @@ public class CLanguageSetting extends CDataProxy implements
ICLanguageSettingEntry entry = oldEntries[i];
if(entry.getKind() != fKind)
continue;
-
+
list.add(entry);
}
-
-
+
+
}
return fNewEntries;
}
@@ -187,19 +196,19 @@ public class CLanguageSetting extends CDataProxy implements
// TODO Auto-generated method stub
return null;
}
-
+
}
public void changeEntries(ICLanguageSettingEntryInfo[] added, ICLanguageSettingEntry[] removed) {
CLanguageData data = getCLanguageData(true);
- Map map = null;
+ Map map = null;
if(added != null && added.length > 0){
map = sortEntries(added, true, map);
}
if(removed != null && removed.length > 0){
map = sortEntries(removed, false, map);
}
-
+
if(map != null){
for(Iterator iter = map.entrySet().iterator(); iter.hasNext();){
Map.Entry entry = (Map.Entry)iter.next();
@@ -208,21 +217,21 @@ public class CLanguageSetting extends CDataProxy implements
List aList = lists[0];
List rList = lists[1];
ICLanguageSettingEntry sortedAdded[] = aList != null ?
- (ICLanguageSettingEntry[])aList.toArray(new ICLanguageSettingEntry[aList.size()])
+ (ICLanguageSettingEntry[])aList.toArray(new ICLanguageSettingEntry[aList.size()])
: null;
ICLanguageSettingEntry sortedRemoved[] = rList != null ?
- (ICLanguageSettingEntry[])rList.toArray(new ICLanguageSettingEntry[rList.size()])
+ (ICLanguageSettingEntry[])rList.toArray(new ICLanguageSettingEntry[rList.size()])
: null;
-
+
data.changeEntries(kind, sortedAdded, sortedRemoved);
}
}
}
-
+
private Map sortEntries(ICLanguageSettingEntry entries[], boolean added, Map map){
if(map == null)
map = new HashMap();
-
+
int index = added ? 0 : 1;
for(int i = 0; i < entries.length; i++){
ICLanguageSettingEntry entry = entries[i];
@@ -244,6 +253,7 @@ public class CLanguageSetting extends CDataProxy implements
return map;
}
*/
+ @Override
public void setSettingEntries(int kind, ICLanguageSettingEntry[] entries) {
CLanguageData data = getCLanguageData(true);
EntryStore store = new EntryStore();
@@ -266,11 +276,11 @@ public class CLanguageSetting extends CDataProxy implements
}
}
}
- }
-
+ }
+
setSettingEntries(kind, data, store);
}
-
+
private int[] flagsToArray(int flags){
int arr[] = new int[32];
int num = 0;
@@ -287,12 +297,13 @@ public class CLanguageSetting extends CDataProxy implements
return result;
}
+ @Override
public void setSettingEntries(int kind, List list) {
CLanguageData data = getCLanguageData(true);
EntryStore store = new EntryStore();
// KindBasedStore nameSetStore = new KindBasedStore();
int eKind;
-
+
if(list != null){
if(list.size() != 0){
for(ICLanguageSettingEntry entry : list){
@@ -310,10 +321,10 @@ public class CLanguageSetting extends CDataProxy implements
}
}
}
-
+
setSettingEntries(kind, data, store);
}
-
+
private void setSettingEntries(int kind, CLanguageData data, EntryStore store){
int oredk = getSupportedEntryKinds();
int kinds[] = flagsToArray(oredk);
@@ -344,22 +355,25 @@ public class CLanguageSetting extends CDataProxy implements
// return getSettingEntries();
// }
+ @Override
public ICLanguageSettingEntry[] getResolvedSettingEntries(int kind) {
ICLanguageSettingEntry entries[] = getSettingEntries(kind);
entries = CDataUtil.resolveEntries(entries, getConfiguration());
return entries;
}
+ @Override
public void setSourceContentTypeIds(String[] ids) {
CLanguageData data = getCLanguageData(true);
-
+
data.setSourceContentTypeIds(ids);
}
+ @Override
public void setSourceExtensions(String[] exts) {
CLanguageData data = getCLanguageData(true);
-
+
data.setSourceExtensions(exts);
}
-
+
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CLanguageSettingCache.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CLanguageSettingCache.java
index 27d5c9c9e33..abddfa77cae 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CLanguageSettingCache.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CLanguageSettingCache.java
@@ -54,29 +54,30 @@ public class CLanguageSettingCache extends CDefaultLanguageData implements
return getSettingEntries();
}
*/
+ @Override
public ICLanguageSettingEntry[] getResolvedSettingEntries(int kind) {
ICLanguageSettingEntry[] entries = getSettingEntries(kind);
if(entries.length != 0){
if(fResolvedEntriesStore == null){
fResolvedEntriesStore = new EntryStore();
}
-
+
ICLanguageSettingEntry[] resolved = fResolvedEntriesStore.getEntries(kind);
if(resolved.length == 0){
resolved = CDataUtil.resolveEntries(entries, getConfiguration());
fResolvedEntriesStore.storeEntries(kind, resolved);
}
-
+
entries = resolved;
}
return entries;
}
-
+
private IProject getProject(){
return getConfiguration().getProjectDescription().getProject();
}
-
+
@Override
public String[] getSourceExtensions() {
if(fCachedExtensions == null ){
@@ -91,17 +92,18 @@ public class CLanguageSettingCache extends CDefaultLanguageData implements
else
exts = CDefaultLanguageData.EMPTY_STRING_ARRAY;
}
-
+
if(exts == null)
exts = CDefaultLanguageData.EMPTY_STRING_ARRAY;
fCachedExtensions = exts;
}
-
+
if(fCachedExtensions.length != 0)
return fCachedExtensions.clone();
return fCachedExtensions;
}
+ @Override
public ICLanguageSettingEntry[] getSettingEntries(int kind) {
// int kinds[] = KindBasedStore.getSupportedKinds();
// List list = new ArrayList();
@@ -114,7 +116,8 @@ public class CLanguageSettingCache extends CDefaultLanguageData implements
// return (ICLanguageSettingEntry[])list.toArray(new ICLanguageSettingEntry[list.size()]);
return fStore.getEntries(kind);
}
-
+
+ @Override
public List getSettingEntriesList(int kind) {
// int kinds[] = KindBasedStore.getSupportedKinds();
// List list = new ArrayList();
@@ -127,7 +130,7 @@ public class CLanguageSettingCache extends CDefaultLanguageData implements
// return (ICLanguageSettingEntry[])list.toArray(new ICLanguageSettingEntry[list.size()]);
return fStore.getEntriesList(kind);
}
-
+
@Override
public void setLanguageId(String id) {
@@ -138,6 +141,7 @@ public class CLanguageSettingCache extends CDefaultLanguageData implements
throw ExceptionFactory.createIsReadOnlyException();
}
+ @Override
public void setSettingEntries(int kind, List entriesList) {
throw ExceptionFactory.createIsReadOnlyException();
}
@@ -147,22 +151,27 @@ public class CLanguageSettingCache extends CDefaultLanguageData implements
throw ExceptionFactory.createIsReadOnlyException();
}
+ @Override
public void setSettingEntries(int kind, ICLanguageSettingEntry[] entries) {
throw ExceptionFactory.createIsReadOnlyException();
}
+ @Override
public boolean supportsEntryKind(int kind) {
return (getSupportedEntryKinds() & kind) == kind;
}
+ @Override
public ICConfigurationDescription getConfiguration() {
return fParent.getConfiguration();
}
+ @Override
public ICSettingContainer getParent() {
return fParent;
}
+ @Override
public boolean isReadOnly() {
return true;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescription.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescription.java
index 1867e78157a..fdc44e08985 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescription.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescription.java
@@ -31,12 +31,12 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.QualifiedName;
-public class CProjectDescription implements ICProjectDescription, ICDataProxyContainer {
+public class CProjectDescription implements ICProjectDescription, ICDataProxyContainer {
private static final String ACTIVE_CFG = "activeConfiguration"; //$NON-NLS-1$
private static final QualifiedName ACTIVE_CFG_PROPERTY = new QualifiedName(CCorePlugin.PLUGIN_ID, ACTIVE_CFG);
private static final String SETTING_CFG = "settingConfiguration"; //$NON-NLS-1$
private static final QualifiedName SETTING_CFG_PROPERTY = new QualifiedName(CCorePlugin.PLUGIN_ID, SETTING_CFG);
-
+
private CfgIdPair fActiveCfgInfo;
private CfgIdPair fSettingCfgInfo;
private CProjectDescriptionPreferences fPrefs;
@@ -62,7 +62,7 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
private QualifiedName fPersistanceName;
private boolean fNeedsPersistance;
private boolean fIsCfgModified;
-
+
CfgIdPair(CfgIdPair base){
fId = base.fId;
fPersistanceName = base.fPersistanceName;
@@ -71,7 +71,7 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
CfgIdPair(QualifiedName persistanceName){
fPersistanceName = persistanceName;
}
-
+
public String getId(){
if(fId == null){
fId = load();
@@ -84,7 +84,7 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
}
return fId;
}
-
+
public ICConfigurationDescription getConfiguration() {
if(fCfg == null){
String id = getId();
@@ -101,20 +101,20 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
}
return fCfg;
}
-
+
public void setConfiguration(ICConfigurationDescription cfg){
if(cfg.getProjectDescription() != CProjectDescription.this)
throw new IllegalArgumentException();
-
+
if(cfg.getId().equals(getId()))
return;
-
+
fCfg = cfg;
fId = cfg.getId();
fIsCfgModified = true;
fNeedsPersistance = true;
}
-
+
public void configurationRemoved(ICConfigurationDescription cfg){
if(cfg.getProjectDescription() != CProjectDescription.this)
throw new IllegalArgumentException();
@@ -126,7 +126,7 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
fCfg = null;
getConfiguration();
}
-
+
private String load(){
try {
return getProject().getPersistentProperty(fPersistanceName);
@@ -174,13 +174,13 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
el = getStorage(CProjectDescriptionManager.MODULE_ID, false);
}
- fPrefs = new CProjectDescriptionPreferences(el,
- (CProjectDescriptionPreferences)mngr.getProjectDescriptionWorkspacePreferences(false),
+ fPrefs = new CProjectDescriptionPreferences(el,
+ (CProjectDescriptionPreferences)mngr.getProjectDescriptionWorkspacePreferences(false),
false);
fPropertiesMap = new HashMap();
}
-
+
public void updateProject(IProject project){
fProject = project;
}
@@ -188,7 +188,7 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
public void loadDatas(){
if(!fIsReadOnly || !fIsLoading)
return;
-
+
CSettingEntryFactory factory = new CSettingEntryFactory();
for(Iterator iter = fCfgMap.values().iterator(); iter.hasNext();){
CConfigurationDescriptionCache cache = (CConfigurationDescriptionCache)iter.next();
@@ -200,16 +200,16 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
iter.remove();
}
}
-
+
// doneInitializing();
-
+
// fIsLoading = false;
}
public boolean applyDatas(SettingsContext context){
if(!fIsReadOnly || !fIsApplying)
return false;
-
+
CSettingEntryFactory factory = new CSettingEntryFactory();
boolean modified = false;
for (Iterator iter = fCfgMap.values().iterator(); iter.hasNext();) {
@@ -224,14 +224,14 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
iter.remove();
}
}
-
+
// doneInitializing();
-
+
// fIsApplying = false;
-
+
return modified;
}
-
+
/**
* Called when the read-only project description has / is being set
* fIsApplying => false
@@ -241,13 +241,13 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
public void doneApplying(){
doneInitializing();
fIsApplying = false;
-
+
try {
getStorageBase().setReadOnly(true, false);
} catch (CoreException e1) {
CCorePlugin.log(e1);
}
-
+
setModified(false);
}
@@ -255,7 +255,7 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
doneInitializing();
fIsLoading = false;
}
-
+
public void setLoading(boolean loading){
fIsLoading = loading;
}
@@ -280,8 +280,8 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
}
/**
- * Create a project description based on another project description
- *
+ * Create a project description based on another project description
+ *
* @param base
* @param saving
* @param storage
@@ -298,9 +298,9 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
fIsLoading = base.fIsLoading;
fIsApplying = saving || base.fIsApplying;
fIsCreating = isCreating;
-
+
fPrefs = new CProjectDescriptionPreferences(base.fPrefs, (CProjectDescriptionPreferences)CProjectDescriptionManager.getInstance().getProjectDescriptionWorkspacePreferences(false), false);
-
+
for(Iterator iter = base.fCfgMap.values().iterator(); iter.hasNext();){
try {
IInternalCCfgInfo cfgDes = (IInternalCCfgInfo)iter.next();
@@ -322,18 +322,18 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
CCorePlugin.log(e);
}
}
-
+
@SuppressWarnings("unchecked")
HashMap cloneMap = (HashMap)base.fPropertiesMap.clone();
fPropertiesMap = cloneMap;
}
-
+
/**
* Convert the current CConfigurationDescriptions to cached versions
* This occurs during the SetCProjectDescription Operation
*/
void switchToCachedConfigurationDescriptions() throws CoreException {
-
+
for (Map.Entry e : fCfgMap.entrySet()) {
if (e.getValue() instanceof CConfigurationDescription) {
CConfigurationDescription cfgDes = (CConfigurationDescription)e.getValue();
@@ -343,7 +343,7 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
baseCache = (CConfigurationDescriptionCache)baseData;
baseData = baseCache.getConfigurationData();
}
- CConfigurationDescriptionCache cache = new CConfigurationDescriptionCache(cfgDes, baseData, baseCache,
+ CConfigurationDescriptionCache cache = new CConfigurationDescriptionCache(cfgDes, baseData, baseCache,
cfgDes.getSpecSettings(), this, null);
e.setValue(cache);
}
@@ -353,7 +353,8 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
void configurationCreated(ICConfigurationDescription des){
fCfgMap.put(des.getId(), des);
}
-
+
+ @Override
public ICConfigurationDescription createConfiguration(String id, String name,
ICConfigurationDescription base) throws CoreException{
if(fIsReadOnly)
@@ -363,21 +364,24 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
return cfg;
}
+ @Override
public ICConfigurationDescription getActiveConfiguration() {
return fActiveCfgInfo.getConfiguration();
}
private String getFirstCfgId(){
if(!fCfgMap.isEmpty()){
- return fCfgMap.keySet().iterator().next();
+ return fCfgMap.keySet().iterator().next();
}
return null;
}
+ @Override
public ICConfigurationDescription getConfigurationById(String id) {
return fCfgMap.get(id);
}
+ @Override
public ICConfigurationDescription getConfigurationByName(String name) {
for(Iterator iter = fCfgMap.values().iterator(); iter.hasNext();){
ICConfigurationDescription cfg = iter.next();
@@ -387,22 +391,24 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
return null;
}
+ @Override
public ICConfigurationDescription[] getConfigurations() {
return fCfgMap.values().toArray(new ICConfigurationDescription[fCfgMap.size()]);
}
+ @Override
public void removeConfiguration(String name) throws WriteAccessException {
if(fIsReadOnly)
throw ExceptionFactory.createIsReadOnlyException();
-
-
+
+
CConfigurationDescription cfgDes = (CConfigurationDescription)getConfigurationByName(name);
if(cfgDes != null){
cfgDes.removeConfiguration();
}
-
+
}
-
+
void configurationRemoved(CConfigurationDescription des){
fCfgMap.remove(des.getId());
fIsModified = true;
@@ -411,35 +417,40 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
fSettingCfgInfo.configurationRemoved(des);
}
+ @Override
public void removeConfiguration(ICConfigurationDescription cfg) throws WriteAccessException {
if(fIsReadOnly)
throw ExceptionFactory.createIsReadOnlyException();
-
+
((CConfigurationDescription)cfg).removeConfiguration();
}
+ @Override
public void setActiveConfiguration(
ICConfigurationDescription cfg) throws WriteAccessException {
if(fIsReadOnly)
throw ExceptionFactory.createIsReadOnlyException();
if(cfg == null)
throw new NullPointerException();
-
+
fActiveCfgInfo.setConfiguration(cfg);
-
+
if(getConfigurationRelations() == CONFIGS_LINK_SETTINGS_AND_ACTIVE)
fSettingCfgInfo.setConfiguration(cfg);
}
-
+
+ @Override
public IProject getProject() {
return fProject;
}
+ @Override
public ICStorageElement getStorage(String moduleId, boolean create) throws CoreException {
return getStorageBase().getStorage(moduleId, create);
}
+ @Override
public ICStorageElement importStorage(String id, ICStorageElement el) throws UnsupportedOperationException, CoreException {
return getStorageBase().importStorage(id, el);
}
@@ -448,40 +459,48 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
// return getStorageBase().containsStorage(id);
// }
+ @Override
public ICSettingObject[] getChildSettings() {
return getConfigurations();
}
+ @Override
public ICConfigurationDescription getConfiguration() {
return null;
}
+ @Override
public String getId() {
//TODO:
return null;
}
+ @Override
public final int getType() {
return ICSettingBase.SETTING_PROJECT;
}
+ @Override
public String getName() {
return fProject.getName();
}
+ @Override
public ICSettingContainer getParent() {
return null;
}
+ @Override
public boolean isValid() {
return /*fProject.exists() &&*/ fCfgMap.size() > 0;
}
+ @Override
public void updateChild(CDataProxy child, boolean write) {
if(write){
try {
String oldId = child.getId();
- CConfigurationDescription cfgDes = ((CConfigurationDescription)child);
+ CConfigurationDescription cfgDes = ((CConfigurationDescription)child);
cfgDes.doWritable();
updateMap(cfgDes, oldId);
} catch (CoreException e) {
@@ -489,7 +508,7 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
}
}
}
-
+
void updateMap(CConfigurationDescription des, String oldId){
if(!oldId.equals(des.getId())){
fCfgMap.remove(oldId);
@@ -500,17 +519,17 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
public ICStorageElement getRootStorageElement() throws CoreException {
if (fRootStorageElement == null)
throw ExceptionFactory.createCoreException("CProjectDescription ICStorageElement == null"); //$NON-NLS-1$
-
+
// if(fRootStorageElement == null){
// fRootStorageElement = CProjectDescriptionManager.getInstance().createStorage(fProject, true, true, isReadOnly());
// }
return fRootStorageElement;
}
-
+
// ICStorageElement doGetCachedRootStorageElement(){
// return fRootStorageElement;
// }
-
+
ICSettingsStorage getStorageBase() throws CoreException{
if(fStorage == null)
// fStorage = new CStorage((InternalXmlStorageElement)getRootStorageElement());
@@ -518,6 +537,7 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
return fStorage;
}
+ @Override
public ICConfigurationDescription createConfiguration(String buildSystemId, CConfigurationData data) throws CoreException {
if(fIsReadOnly)
throw ExceptionFactory.createIsReadOnlyException();
@@ -525,7 +545,7 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
configurationCreated(cfg);
return cfg;
}
-
+
public CConfigurationDescription createConvertedConfiguration(String id, String name, ICStorageElement el) throws CoreException{
if(fIsReadOnly)
throw ExceptionFactory.createIsReadOnlyException();
@@ -534,10 +554,11 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
return cfg;
}
+ @Override
public boolean isModified() {
if(fIsModified)
return true;
-
+
if(fActiveCfgInfo.fIsCfgModified)
return true;
@@ -556,10 +577,10 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
return false;
}
-
+
private void setModified(boolean modified){
fIsModified = modified;
-
+
if(!modified){
fActiveCfgInfo.fIsCfgModified = false;
@@ -571,10 +592,12 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
}
}
+ @Override
public boolean isReadOnly() {
return fIsReadOnly && !(fIsLoading || fIsApplying);
}
+ @Override
public void setReadOnly(boolean readOnly, boolean keepModify) {
fIsReadOnly = readOnly;
try {
@@ -587,14 +610,16 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
public ICSettingObject getChildSettingById(String id) {
return getConfigurationById(id);
}
-
+
+ @Override
public ICConfigurationDescription getDefaultSettingConfiguration(){
if(getConfigurationRelations() == CONFIGS_LINK_SETTINGS_AND_ACTIVE)
return getActiveConfiguration();
-
+
return fSettingCfgInfo.getConfiguration();
}
+ @Override
public void setDefaultSettingConfiguration(ICConfigurationDescription cfg) throws WriteAccessException {
if(fIsReadOnly)
throw ExceptionFactory.createIsReadOnlyException();
@@ -602,24 +627,27 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
throw new NullPointerException();
fSettingCfgInfo.setConfiguration(cfg);
-
+
if(getConfigurationRelations() == CONFIGS_LINK_SETTINGS_AND_ACTIVE)
fActiveCfgInfo.setConfiguration(cfg);
}
+ @Override
public Object getSessionProperty(QualifiedName name) {
return fPropertiesMap.get(name);
}
+ @Override
public void setSessionProperty(QualifiedName name, Object value) {
if(value != null)
fPropertiesMap.put(name, value);
else
fPropertiesMap.remove(name);
-
+
fIsModified = true;
}
+ @Override
public void removeStorage(String id) throws CoreException {
getStorageBase().removeStorage(id);
}
@@ -627,7 +655,7 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
void switchToCachedAppliedData(CProjectDescription appliedCache){
if(fIsReadOnly)
return;
-
+
ICConfigurationDescription[] cfgs = appliedCache.getConfigurations();
for(int i = 0; i < cfgs.length; i++){
CConfigurationDescriptionCache cfgCache = (CConfigurationDescriptionCache)cfgs[i];
@@ -641,14 +669,14 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
}
}
}
-
+
// boolean checkPersistCfgChanges(boolean force){
// boolean stored = false;
// stored |= checkPersistActiveCfg(force);
// stored |= checkPersistSettingCfg(force);
// return stored;
// }
-
+
boolean checkPersistActiveCfg(String oldId, boolean force){
return fActiveCfgInfo.store(oldId, force);
}
@@ -669,30 +697,36 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
return fPrefs;
}
+ @Override
public int getConfigurationRelations() {
return fPrefs.getConfigurationRelations();
}
+ @Override
public boolean isDefaultConfigurationRelations() {
return fPrefs.isDefaultConfigurationRelations();
}
+ @Override
public void setConfigurationRelations(int status) {
fPrefs.setConfigurationRelations(status);
}
+ @Override
public void useDefaultConfigurationRelations() {
fPrefs.useDefaultConfigurationRelations();
}
+ @Override
public boolean isCdtProjectCreating() {
return fIsCreating;
}
+ @Override
public void setCdtProjectCreated() {
if(!fIsCreating)
return;
-
+
if(fIsReadOnly)
throw ExceptionFactory.createIsReadOnlyException();
@@ -703,9 +737,9 @@ public class CProjectDescription implements ICProjectDescription, ICDataProxyCon
public void touch() throws WriteAccessException {
if(fIsReadOnly)
throw ExceptionFactory.createIsReadOnlyException();
-
+
fIsModified = true;
}
-
-
+
+
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionDelta.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionDelta.java
index d1b58c260d1..45bd1fb3b02 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionDelta.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionDelta.java
@@ -29,7 +29,7 @@ public class CProjectDescriptionDelta implements ICDescriptionDelta {
private static final int KIND_MASK = 3;
private static final int FLAGS_OFFSET = 2;
-
+
public CProjectDescriptionDelta(ICSettingObject newSetting, ICSettingObject oldSetting){
fNewSetting = newSetting;
fOldSetting = oldSetting;
@@ -44,46 +44,52 @@ public class CProjectDescriptionDelta implements ICDescriptionDelta {
setDeltaKind(REMOVED);
}
}
-
+
void addChild(CProjectDescriptionDelta child){
fChildList.add(child);
child.setParent(this);
}
-
+
private void setParent(CProjectDescriptionDelta parent){
fParent = parent;
}
+ @Override
public ICDescriptionDelta[] getChildren() {
return fChildList.toArray(new CProjectDescriptionDelta[fChildList.size()]);
}
+ @Override
public ICSettingObject getOldSetting() {
return fOldSetting;
}
+ @Override
public ICSettingObject getSetting() {
return fSetting;
}
+ @Override
public int getSettingType() {
return fSetting.getType();
}
+ @Override
public ICDescriptionDelta getParent() {
return fParent;
}
-
+
public boolean isEmpty(){
- return fChildList.size() == 0
- && getDeltaKind() == CHANGED
+ return fChildList.size() == 0
+ && getDeltaKind() == CHANGED
&& getChangeFlags() == 0;
}
+ @Override
public int getChangeFlags() {
return (fStatus & (~KIND_MASK)) >> FLAGS_OFFSET;
}
-
+
void addChangeFlags(int flags){
flags |= getChangeFlags();
setChangeFlags(flags);
@@ -102,10 +108,12 @@ public class CProjectDescriptionDelta implements ICDescriptionDelta {
fStatus = (fStatus & (~KIND_MASK)) | (kind & KIND_MASK);
}
+ @Override
public int getDeltaKind() {
return fStatus & KIND_MASK;
}
+ @Override
public ICSettingObject getNewSetting() {
return fNewSetting;
}
@@ -115,14 +123,17 @@ public class CProjectDescriptionDelta implements ICDescriptionDelta {
checkSettingEntriesChangeFlag();
}
+ @Override
public int getAddedEntriesKinds() {
return fAddedLanguageEntriesKinds;
}
+ @Override
public int getRemovedEntriesKinds() {
return fRemovedLanguageEntriesKinds;
}
+ @Override
public int getReorderedEntriesKinds() {
return fReorderedLanguageEntriesKinds;
}
@@ -136,7 +147,7 @@ public class CProjectDescriptionDelta implements ICDescriptionDelta {
fReorderedLanguageEntriesKinds = kinds;
checkSettingEntriesChangeFlag();
}
-
+
private void checkSettingEntriesChangeFlag(){
if(fAddedLanguageEntriesKinds != 0
|| fRemovedLanguageEntriesKinds != 0
@@ -145,12 +156,12 @@ public class CProjectDescriptionDelta implements ICDescriptionDelta {
else
removeChangeFlags(SETTING_ENTRIES);
}
-
+
@SuppressWarnings("nls")
private static String flagsToString(int flags) {
StringBuilder str = new StringBuilder();
str.append(", flags=0x" + Integer.toHexString(flags));
-
+
str.append(":");
if ((flags&ACTIVE_CFG)!=0) str.append("ACTIVE_CFG|");
if ((flags&NAME)!=0) str.append("NAME|");
@@ -175,7 +186,7 @@ public class CProjectDescriptionDelta implements ICDescriptionDelta {
if (str.charAt(str.length()-1)=='|') str.deleteCharAt(str.length()-1);
return str.toString();
}
-
+
/**
* Helper method to make debugging easier.
*/
@@ -183,10 +194,10 @@ public class CProjectDescriptionDelta implements ICDescriptionDelta {
@Override
public String toString() {
StringBuilder str = new StringBuilder();
-
+
String type = fSetting.getClass().getSimpleName();
str.append("[" + type + "]");
-
+
int kind = getDeltaKind();
str.append(", kind="+kind);
switch (kind) {
@@ -195,16 +206,16 @@ public class CProjectDescriptionDelta implements ICDescriptionDelta {
case CHANGED: str.append(":CHANGED");break;
default: str.append(":");
}
-
+
str.append(flagsToString(getChangeFlags()));
-
+
ICDescriptionDelta[] children = getChildren();
if (children==null) {
str.append(", no children");
} else {
str.append(", " + getChildren().length + " children");
}
-
+
return str.toString();
}
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionManager.java
index c23c8f9e6b9..2143b5e9488 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionManager.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionManager.java
@@ -188,6 +188,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
fRunnables.add(runnable);
}
+ @Override
public void run(IProgressMonitor monitor) throws CoreException {
try {
monitor.beginTask(fName, fRunnables.size());
@@ -245,6 +246,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
private ICDataProxyContainer fPrefUpdater = new ICDataProxyContainer(){
+ @Override
public void updateChild(CDataProxy child, boolean write) {
if(write){
try {
@@ -255,6 +257,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
}
}
+ @Override
public ICSettingObject[] getChildSettings() {
return fPreferenceMap.values().toArray(new CConfigurationDescriptionCache[fPreferenceMap.size()]);
}
@@ -396,6 +399,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
CProjectDescriptionStorageManager.getInstance().shutdown();
}
+ @Override
public ICProjectDescription getProjectDescription(IProject project, boolean write) {
return getProjectDescription(project, true, write);
}
@@ -407,6 +411,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
return getProjectDescription(project, flags);
}
+ @Override
public ICProjectDescription getProjectDescription(IProject project, int flags) {
try {
return getProjectDescriptionInternal(project, flags);
@@ -419,7 +424,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
}
/**
- * Base method for getting a Project's Description
+ * Base method for getting a Project's Description
* @param project
* @param flags
* @return ICProjectDescription
@@ -428,7 +433,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
private ICProjectDescription getProjectDescriptionInternal(IProject project, int flags) throws CoreException {
AbstractCProjectDescriptionStorage storage = getProjectDescriptionStorage(project);
return storage.getProjectDescription(flags, new NullProgressMonitor());
- }
+ }
/**
* Run the workspace modification in the current thread using the workspace scheduling rule
@@ -510,6 +515,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
private static void runAtomic(final IWorkspaceRunnable r, ISchedulingRule rule, IProgressMonitor monitor) throws CoreException{
IWorkspace wsp = ResourcesPlugin.getWorkspace();
wsp.run(new IWorkspaceRunnable(){
+ @Override
public void run(IProgressMonitor monitor) throws CoreException {
try {
r.run(monitor);
@@ -521,6 +527,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
}, rule, IWorkspace.AVOID_UPDATE, monitor);
}
+ @Override
public void updateProjectDescriptions(IProject[] projects, IProgressMonitor monitor) throws CoreException{
if(monitor == null)
monitor = new NullProgressMonitor();
@@ -542,6 +549,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
fi[0] = num;
runWspModification(new IWorkspaceRunnable(){
+ @Override
public void run(IProgressMonitor monitor) throws CoreException {
monitor.beginTask(SettingsModelMessages.getString("CProjectDescriptionManager.13"), fi[0]); //$NON-NLS-1$
@@ -605,10 +613,12 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
fConverters = dess;
}
+ @Override
public ICProjectDescription createProjectDescription(IProject project, boolean loadIfExists) throws CoreException{
return createProjectDescription(project, loadIfExists, false);
}
+ @Override
public ICProjectDescription createProjectDescription(IProject project, boolean loadIfExists, boolean creating) throws CoreException{
int flags = ICProjectDescriptionManager.GET_WRITABLE | ICProjectDescriptionManager.GET_CREATE_DESCRIPTION;
flags |= loadIfExists ? 0 : ICProjectDescriptionManager.GET_EMPTY_PROJECT_DESCRIPTION;
@@ -634,6 +644,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
return provider;
}
+ @Override
public ICProjectDescription getProjectDescription(IProject project){
return getProjectDescription(project, true);
}
@@ -811,10 +822,12 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
return false;
}
+ @Override
public void setProjectDescription(IProject project, ICProjectDescription des) throws CoreException {
setProjectDescription(project, des, false, null);
}
+ @Override
public void setProjectDescription(IProject project, ICProjectDescription des, boolean force, IProgressMonitor monitor) throws CoreException {
int flags = force ? SET_FORCE : 0;
setProjectDescription(project, des, flags, monitor);
@@ -826,6 +839,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
/** ThreadLocal flag to let CDescriptor know whether already in a setProjectDescription */
ThreadLocal settingProjectDescription = new ThreadLocal(){@Override protected Boolean initialValue() {return false;}};
+ @Override
public void setProjectDescription(IProject project, ICProjectDescription des, int flags, IProgressMonitor monitor) throws CoreException {
try {
settingProjectDescription.set(true);
@@ -2164,10 +2178,12 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
* Methods for manipulating the set of project description listeners
*/
+ @Override
public void addCProjectDescriptionListener(ICProjectDescriptionListener listener, int eventTypes) {
fListeners.add(new ListenerDescriptor(listener, eventTypes));
}
+ @Override
public void removeCProjectDescriptionListener(ICProjectDescriptionListener listener) {
for (ListenerDescriptor listenerDescriptor : fListeners) {
if (listenerDescriptor.fListener.equals(listener)) {
@@ -2202,6 +2218,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
}
}
+ @Override
public ICConfigurationDescription getPreferenceConfiguration(String buildSystemId) throws CoreException {
return getPreferenceConfiguration(buildSystemId, true);
}
@@ -2215,6 +2232,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
}
}
+ @Override
public ICConfigurationDescription getPreferenceConfiguration(String buildSystemId, boolean write) throws CoreException {
ICConfigurationDescription des = getLoaddedPreference(buildSystemId);
if(des == null){
@@ -2244,6 +2262,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
return des;
}
+ @Override
public void setPreferenceConfiguration(String buildSystemId, ICConfigurationDescription des) throws CoreException{
if(!needSavePreference(buildSystemId, des))
return;
@@ -2448,10 +2467,12 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
return false;
}
+ @Override
public boolean isNewStyleProject(IProject project){
return isNewStyleProject(getProjectDescription(project, false));
}
+ @Override
public boolean isNewStyleProject(ICProjectDescription des){
if(des == null)
return false;
@@ -2594,7 +2615,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
if(!langDatasEqual(parentLData, childLData))
return true;
}
-
+
return false;
}
@@ -2651,6 +2672,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
}
+ @Override
public ICProjectDescriptionWorkspacePreferences getProjectDescriptionWorkspacePreferences(
boolean write) {
if(fPreferences == null){
@@ -2670,6 +2692,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
return prefs;
}
+ @Override
public boolean setProjectDescriptionWorkspacePreferences(ICProjectDescriptionWorkspacePreferences prefs,
boolean updateProjects,
IProgressMonitor monitor) {
@@ -2741,6 +2764,7 @@ public class CProjectDescriptionManager implements ICProjectDescriptionManager {
throw ExceptionFactory.createCoreException(SettingsModelMessages.getString("CProjectDescriptionManager.14")); //$NON-NLS-1$
}
+ @Override
public void updateExternalSettingsProviders(String[] ids, IProgressMonitor monitor){
ExtensionContainerFactory.updateReferencedProviderIds(ids, monitor);
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionPreferences.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionPreferences.java
index 5663d181eb2..0851488f26c 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionPreferences.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CProjectDescriptionPreferences.java
@@ -20,7 +20,7 @@ public class CProjectDescriptionPreferences implements ICProjectDescriptionPrefe
private static final int DEFAULT_RELATIONS = CONFIGS_INDEPENDENT;
private boolean fIsReadOnly;
private boolean fIsModified;
-
+
private Integer fConfigRelations;
private CProjectDescriptionPreferences fSuperPreference;
@@ -40,21 +40,22 @@ public class CProjectDescriptionPreferences implements ICProjectDescriptionPrefe
if(el.getAttribute(ATTR_CONFIG_RELATIONS) != null)
fConfigRelations = new Integer(CDataUtil.getInteger(el, ATTR_CONFIG_RELATIONS, DEFAULT_RELATIONS));
}
-
+
this.fSuperPreference = superPreference;
}
-
+
protected CProjectDescriptionPreferences getSuperPreferences(){
if(isReadOnly())
return fSuperPreference;
return (CProjectDescriptionPreferences)CProjectDescriptionManager.getInstance().getProjectDescriptionWorkspacePreferences(false);
}
-
+
void serialize(ICStorageElement el){
if(fConfigRelations != null)
CDataUtil.setInteger(el, ATTR_CONFIG_RELATIONS, fConfigRelations.intValue());
}
-
+
+ @Override
public int getConfigurationRelations() {
if(fConfigRelations != null)
return fConfigRelations.intValue();
@@ -64,56 +65,59 @@ public class CProjectDescriptionPreferences implements ICProjectDescriptionPrefe
return DEFAULT_RELATIONS;
}
+ @Override
public boolean isDefaultConfigurationRelations() {
return fConfigRelations == null;
}
+ @Override
public void setConfigurationRelations(int status) {
if(fIsReadOnly)
throw ExceptionFactory.createIsReadOnlyException();
if(fConfigRelations != null && fConfigRelations.intValue() == status)
return;
-
+
fConfigRelations = new Integer(status);
fIsModified = true;
}
+ @Override
public void useDefaultConfigurationRelations() {
if(fIsReadOnly)
throw ExceptionFactory.createIsReadOnlyException();
-
+
if(fConfigRelations == null)
return;
-
+
fConfigRelations = null;
fIsModified = true;
}
public boolean isModified(){
return fIsModified
- || (fSuperPreference != null
+ || (fSuperPreference != null
&& !fSuperPreference.settingsEqual((CProjectDescriptionPreferences)CProjectDescriptionManager.getInstance().getProjectDescriptionWorkspacePreferences(false)));
}
-
+
void setModified(boolean modified){
fIsModified = modified;
}
-
+
public boolean isReadOnly(){
return fIsReadOnly;
}
-
+
void setReadOnly(boolean readOnly){
fIsReadOnly = readOnly;
}
-
+
public boolean settingsEqual(CProjectDescriptionPreferences other){
if(isDefaultConfigurationRelations() != other.isDefaultConfigurationRelations())
return false;
if(getConfigurationRelations() != other.getConfigurationRelations())
return false;
-
+
return true;
}
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CTargetPlatformSetting.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CTargetPlatformSetting.java
index 1efb5adccab..d75d4215a85 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CTargetPlatformSetting.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CTargetPlatformSetting.java
@@ -20,20 +20,23 @@ public class CTargetPlatformSetting extends CDataProxy implements
super(data, cfg, cfg);
}
+ @Override
public final int getType() {
return SETTING_TARGET_PLATFORM;
}
+ @Override
public String[] getBinaryParserIds() {
CTargetPlatformData data = getTargetPlatformData(false);
return data.getBinaryParserIds();
}
+ @Override
public void setBinaryParserIds(String[] ids) {
CTargetPlatformData data = getTargetPlatformData(true);
data.setBinaryParserIds(ids);
}
-
+
private CTargetPlatformData getTargetPlatformData(boolean write){
return (CTargetPlatformData)getData(write);
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CTargetPlatformSettingCache.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CTargetPlatformSettingCache.java
index f86d9d76b68..330f7bea97c 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CTargetPlatformSettingCache.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CTargetPlatformSettingCache.java
@@ -21,23 +21,26 @@ public class CTargetPlatformSettingCache extends CDefaultTargetPlatformData
private CConfigurationDescriptionCache fCfgCache;
CTargetPlatformSettingCache(CTargetPlatformData base, CConfigurationDescriptionCache cfgCache){
fId = base.getId();
-
+
fCfgCache = cfgCache;
-
+
fCfgCache.addTargetPlatformSetting(this);
-
+
copyDataFrom(base);
}
-
-
+
+
+ @Override
public ICConfigurationDescription getConfiguration() {
return fCfgCache;
}
+ @Override
public ICSettingContainer getParent() {
return fCfgCache;
}
+ @Override
public boolean isReadOnly() {
return true;
}
@@ -46,7 +49,7 @@ public class CTargetPlatformSettingCache extends CDefaultTargetPlatformData
public void setBinaryParserIds(String[] ids) {
if(!fCfgCache.isInitializing())
throw ExceptionFactory.createIsReadOnlyException();
-
+
super.setBinaryParserIds(ids);
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CfgExportSettingContainerFactory.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CfgExportSettingContainerFactory.java
index 0eac0c0c420..4a733d7480f 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CfgExportSettingContainerFactory.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CfgExportSettingContainerFactory.java
@@ -7,7 +7,7 @@
*
* Contributors:
* Intel Corporation - Initial API and implementation
- * James Blackburn (Broadcom Corp.)
+ * James Blackburn (Broadcom Corp.)
*******************************************************************************/
package org.eclipse.cdt.internal.core.settings.model;
@@ -34,10 +34,10 @@ import org.eclipse.core.runtime.CoreException;
/**
* A class responsible for persisting CDT Projects and Configuration IDs as referenced
- * by other configurations in other projects.
+ * by other configurations in other projects.
* The user controls this via RefsTab. This External settings factory listens
* for CProjectDescription model changes and notifies the {@link CExternalSettingsManager},
- * which is a listener, of changes to the set of external settings.
+ * which is a listener, of changes to the set of external settings.
* {@link ICConfigurationDescription#setReferenceInfo(Map)} and {@link ICConfigurationDescription#getReferenceInfo()}
*/
public class CfgExportSettingContainerFactory extends
@@ -57,20 +57,20 @@ public class CfgExportSettingContainerFactory extends
private CfgExportSettingContainerFactory(){
}
-
+
public static CfgExportSettingContainerFactory getInstance(){
if(fInstance == null)
fInstance = new CfgExportSettingContainerFactory();
return fInstance;
}
-
+
@Override
public void startup(){
- CProjectDescriptionManager.getInstance().addCProjectDescriptionListener(this,
+ CProjectDescriptionManager.getInstance().addCProjectDescriptionListener(this,
CProjectDescriptionEvent.APPLIED
| CProjectDescriptionEvent.LOADED);
}
-
+
@Override
public void shutdown(){
CProjectDescriptionManager.getInstance().removeCProjectDescriptionListener(this);
@@ -84,7 +84,7 @@ public class CfgExportSettingContainerFactory extends
final private String fId;
final private String fProjName, fCfgId;
final private CExternalSetting[] prevSettings;
-
+
CfgRefContainer(String containerId, String projName, String cfgId, CExternalSetting[] previousSettings){
fId = containerId;
fProjName = projName;
@@ -98,9 +98,9 @@ public class CfgExportSettingContainerFactory extends
if (project.isAccessible()) {
ICProjectDescription des = CProjectDescriptionManager.getInstance().getProjectDescription(project, false);
if(des != null){
- ICConfigurationDescription cfg = fCfgId.length() != 0 ?
+ ICConfigurationDescription cfg = fCfgId.length() != 0 ?
des.getConfigurationById(fCfgId) : des.getActiveConfiguration();
-
+
if(cfg != null){
CExternalSetting[] es;
ICExternalSetting[] ies = cfg.getExternalSettings();
@@ -146,7 +146,7 @@ public class CfgExportSettingContainerFactory extends
private static CContainerRef createContainerRef(String projName, String cfgId){
return new CContainerRef(FACTORY_ID, createId(projName, cfgId));
}
-
+
public static Map getReferenceMap(ICConfigurationDescription cfg){
CContainerRef[] refs = CExternalSettingsManager.getInstance().getReferences(cfg, FACTORY_ID);
Map map = new LinkedHashMap();
@@ -164,15 +164,15 @@ public class CfgExportSettingContainerFactory extends
public static void setReferenceMap(ICConfigurationDescription cfg, Map map){
Map oldRefs = getReferenceMap(cfg);
Map newRefs = new LinkedHashMap(map);
-
+
// We need to preserve order. The API we have with the external settings manager allows us to
- // add and remove individual items.
+ // add and remove individual items.
// In the future this could be fixed, but for the moment, remove and replace all the referenced items
// from the first item that doens't match.
Iterator> oldIter = oldRefs.entrySet().iterator();
Iterator> newIter = newRefs.entrySet().iterator();
-
+
while (oldIter.hasNext() && newIter.hasNext()) {
Map.Entry oldEntry = oldIter.next();
Map.Entry newEntry = newIter.next();
@@ -209,7 +209,7 @@ public class CfgExportSettingContainerFactory extends
private static String[] parseId(String id) throws CoreException {
if(id == null)
throw new NullPointerException();
-
+
String projName, cfgId;
int index = id.indexOf(DELIMITER);
if(index != -1){
@@ -219,10 +219,10 @@ public class CfgExportSettingContainerFactory extends
projName = id;
cfgId = ACTIVE_CONFIG_ID;
}
-
+
if((projName = projName.trim()).length() == 0)
throw ExceptionFactory.createCoreException(SettingsModelMessages.getString("CfgExportSettingContainerFactory.2")); //$NON-NLS-1$
-
+
return new String[]{projName, cfgId};
}
@@ -230,6 +230,7 @@ public class CfgExportSettingContainerFactory extends
* Notify the ExternalSettingManager that there's been a change in the configuration which may require referencing configs to update
* their cache of the external settings
*/
+ @Override
public void handleEvent(CProjectDescriptionEvent event) {
switch(event.getEventType()){
case CProjectDescriptionEvent.LOADED: {
@@ -255,9 +256,9 @@ public class CfgExportSettingContainerFactory extends
case CProjectDescriptionEvent.APPLIED:
String[] ids = getContainerIds(event.getProjectDelta());
if(ids.length != 0){
- CExternalSettingsContainerChangeInfo[] changeInfos =
+ CExternalSettingsContainerChangeInfo[] changeInfos =
new CExternalSettingsContainerChangeInfo[ids.length];
-
+
for(int i = 0; i < changeInfos.length; i++){
changeInfos[i] = new CExternalSettingsContainerChangeInfo(
CExternalSettingsContainerChangeInfo.CONTAINER_CONTENTS,
@@ -268,7 +269,7 @@ public class CfgExportSettingContainerFactory extends
}
}
}
-
+
/**
* Returns the set of containers (Project configurations) (project_name;config_id) for the project descriptions
* reported as changed by the ICDescriptionDelta
@@ -279,7 +280,7 @@ public class CfgExportSettingContainerFactory extends
if(delta == null)
return new String[0];
int deltaKind = delta.getDeltaKind();
-
+
Set cfgIds = new HashSet();
switch(deltaKind){
case ICDescriptionDelta.ADDED:
@@ -305,7 +306,7 @@ public class CfgExportSettingContainerFactory extends
if(ids.length != 0){
String projName = ((ICProjectDescription)delta.getSetting()).getProject().getName();
int i = 0;
- for (String config : cfgIds)
+ for (String config : cfgIds)
ids[i++] = createId(projName, config);
}
return ids;
@@ -327,7 +328,7 @@ public class CfgExportSettingContainerFactory extends
break;
case ICDescriptionDelta.CHANGED:
int changeFlags = delta.getChangeFlags();
- if((changeFlags &
+ if((changeFlags &
(ICDescriptionDelta.EXTERNAL_SETTINGS_ADDED
| ICDescriptionDelta.EXTERNAL_SETTINGS_REMOVED)) != 0){
c.add(delta.getSetting().getId());
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CfgProxyCache.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CfgProxyCache.java
index 012f0764dcc..76e09779b87 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CfgProxyCache.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/CfgProxyCache.java
@@ -22,19 +22,22 @@ import org.eclipse.core.runtime.IPath;
public class CfgProxyCache implements IProxyCache {
private HashMap fProxyMap = new HashMap();
private PathSettingsContainer fPathContainer;
-
+
CfgProxyCache(PathSettingsContainer pathDesContainer){
fPathContainer = pathDesContainer;
fPathContainer.addContainerListener(new IPathSettingsContainerListener(){
+ @Override
public void aboutToRemove(PathSettingsContainer container) {
CDataProxy proxy = (CDataProxy)container.getValue();
if(proxy != null)
fProxyMap.remove(proxy.getId());
}
+ @Override
public void containerAdded(PathSettingsContainer container) {
}
+ @Override
public void containerValueChanged(PathSettingsContainer container, Object oldValue) {
CDataProxy proxy = (CDataProxy)container.getValue();
if(proxy != null)
@@ -44,13 +47,15 @@ public class CfgProxyCache implements IProxyCache {
}
}
+ @Override
public void containerPathChanged(PathSettingsContainer container, IPath oldPath, boolean childrenMoved) {
// TODO Auto-generated method stub
-
+
}
});
}
-
+
+ @Override
public void addCachedProxy(CDataProxy proxy) {
if(proxy instanceof IInternalResourceDescription){
IInternalResourceDescription des = (IInternalResourceDescription)proxy;
@@ -63,34 +68,41 @@ public class CfgProxyCache implements IProxyCache {
}
}
+ @Override
public void clear() {
fPathContainer.removeChildren();
fProxyMap.clear();
}
+ @Override
public CDataProxy[] getCachedProxies() {
Collection c = fProxyMap.values();
return c.toArray(new CDataProxy[c.size()]);
}
+ @Override
public CDataProxy getCachedProxy(String id) {
return fProxyMap.get(id);
}
+ @Override
public void removeCachedProxy(String id) {
CDataProxy proxy = fProxyMap.get(id);
removeCachedProxy(proxy);
}
+ @Override
@SuppressWarnings("unchecked")
public Map getCachedProxiesMap() {
return (Map)fProxyMap.clone();
}
+ @Override
public CDataProxy getCachedProxy(CDataObject data) {
return getCachedProxy(data.getId());
}
+ @Override
public void removeCachedProxy(CDataProxy proxy) {
if(proxy instanceof IInternalResourceDescription){
fPathContainer.removeChildContainer(((IInternalResourceDescription)proxy).getCachedPath());
@@ -110,18 +122,18 @@ public class CfgProxyCache implements IProxyCache {
// proxy = (CDataProxy)proxyIter.next();
// if(data.getType() != proxy.getType())
// continue;
-//
+//
// switch(data.getType()){
// case ICSettingBase.SETTING_TARGET_PLATFORM:
// case ICSettingBase.SETTING_FILE:
// case ICSettingBase.SETTING_FOLDER:
//// if(((CResourceData)data).getPath().equals(((CResourceDescription)proxy).getPath()))
// }
-//
+//
// if(result == null)
// result = new HashMap();
-//
-//
+//
+//
// }
// }
// }
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ConfigBasedPathEntryContainer.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ConfigBasedPathEntryContainer.java
index 20046c07108..5c402931f3d 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ConfigBasedPathEntryContainer.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ConfigBasedPathEntryContainer.java
@@ -28,15 +28,18 @@ public class ConfigBasedPathEntryContainer implements IPathEntryContainer {
public ConfigBasedPathEntryContainer(IPathEntry entries[]){
this.fEntries = entries.clone();
}
-
+
+ @Override
public String getDescription() {
return "Configuration Description info container"; //$NON-NLS-1$
}
+ @Override
public IPath getPath() {
return CONTAINER_PATH;
}
+ @Override
public IPathEntry[] getPathEntries() {
return fEntries.clone();
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ConfigBasedPathEntryStore.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ConfigBasedPathEntryStore.java
index 804bcd4cc90..2b557be5f47 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ConfigBasedPathEntryStore.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ConfigBasedPathEntryStore.java
@@ -60,6 +60,7 @@ public class ConfigBasedPathEntryStore implements IPathEntryStore, ICProjectDesc
/* (non-Javadoc)
* @see org.eclipse.cdt.core.resources.IPathEntryStore#addPathEntryStoreListener(org.eclipse.cdt.core.resources.IPathEntryStoreListener)
*/
+ @Override
public void addPathEntryStoreListener(IPathEntryStoreListener listener) {
fListeners.add(listener);
}
@@ -67,6 +68,7 @@ public class ConfigBasedPathEntryStore implements IPathEntryStore, ICProjectDesc
/* (non-Javadoc)
* @see org.eclipse.cdt.core.resources.IPathEntryStore#removePathEntryStoreListener(org.eclipse.cdt.core.resources.IPathEntryStoreListener)
*/
+ @Override
public void removePathEntryStoreListener(IPathEntryStoreListener listener) {
fListeners.remove(listener);
}
@@ -83,6 +85,7 @@ public class ConfigBasedPathEntryStore implements IPathEntryStore, ICProjectDesc
/* (non-Javadoc)
* @see org.eclipse.cdt.core.resources.IPathEntryStore#fireClosedChangedEvent(IProject)
*/
+ @Override
public void close() {
PathEntryStoreChangedEvent evt = new PathEntryStoreChangedEvent(this, fProject, PathEntryStoreChangedEvent.STORE_CLOSED);
IPathEntryStoreListener[] observers = new IPathEntryStoreListener[fListeners.size()];
@@ -93,19 +96,23 @@ public class ConfigBasedPathEntryStore implements IPathEntryStore, ICProjectDesc
CProjectDescriptionManager.getInstance().removeCProjectDescriptionListener(this);
}
+ @Override
public IProject getProject() {
return fProject;
}
+ @Override
@Deprecated
public ICExtensionReference getExtensionReference() {
return null;
}
+ @Override
public ICConfigExtensionReference getConfigExtensionReference() {
return null;
}
+ @Override
public IPathEntry[] getRawPathEntries() throws CoreException {
ICConfigurationDescription cfg = getIndexCfg(fProject);
List[] es = getEntries(fProject, cfg);
@@ -118,6 +125,7 @@ public class ConfigBasedPathEntryStore implements IPathEntryStore, ICProjectDesc
return new IPathEntry[0];
}
+ @Override
public void setRawPathEntries(IPathEntry[] entries) throws CoreException {
ICConfigurationDescription cfg = getIndexCfg(fProject);
List es[] = getEntries(fProject, cfg);
@@ -162,6 +170,7 @@ public class ConfigBasedPathEntryStore implements IPathEntryStore, ICProjectDesc
}
}
+ @Override
public void handleEvent(CProjectDescriptionEvent event) {
IProject project = event.getProject();
if(!fProject.equals(project))
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/DescriptionScannerInfoProvider.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/DescriptionScannerInfoProvider.java
index 2a5b536b634..f6317eb69e9 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/DescriptionScannerInfoProvider.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/DescriptionScannerInfoProvider.java
@@ -75,6 +75,7 @@ public class DescriptionScannerInfoProvider implements IScannerInfoProvider, ICP
return fProject;
}
+ @Override
public IScannerInfo getScannerInformation(IResource resource) {
if(!fInited)
updateProjCfgInfo(CProjectDescriptionManager.getInstance().getProjectDescription(fProject, false));
@@ -262,12 +263,14 @@ public class DescriptionScannerInfoProvider implements IScannerInfoProvider, ICP
return values;
}
+ @Override
public void subscribe(IResource resource,
IScannerInfoChangeListener listener) {
// TODO Auto-generated method stub
}
+ @Override
public void unsubscribe(IResource resource,
IScannerInfoChangeListener listener) {
// TODO Auto-generated method stub
@@ -278,6 +281,7 @@ public class DescriptionScannerInfoProvider implements IScannerInfoProvider, ICP
CProjectDescriptionManager.getInstance().removeCProjectDescriptionListener(this);
}
+ @Override
public void handleEvent(CProjectDescriptionEvent event) {
if(!event.getProject().equals(fProject))
return;
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ICProjectDescriptionStorageType.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ICProjectDescriptionStorageType.java
index d33264ddf9e..06e6cfef99f 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ICProjectDescriptionStorageType.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ICProjectDescriptionStorageType.java
@@ -95,16 +95,18 @@ public interface ICProjectDescriptionStorageType {
return false;
return true;
}
+ @Override
public boolean createsCProjectXMLFile() {
return storageType.createsCProjectXMLFile();
}
+ @Override
public AbstractCProjectDescriptionStorage getProjectDescriptionStorage(CProjectDescriptionStorageTypeProxy type, IProject project, Version version) {
return storageType.getProjectDescriptionStorage(type, project, version);
}
private static Version getVersion(IConfigurationElement element, String id, Version defaultValue) throws IllegalArgumentException{
String value = element.getAttribute(id);
- if (value==null)
+ if (value==null)
return defaultValue;
Version v;
try {
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/MapProxyCache.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/MapProxyCache.java
index 61221d2225d..3dae04ee5d9 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/MapProxyCache.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/MapProxyCache.java
@@ -26,6 +26,7 @@ public class MapProxyCache implements IProxyCache {
return fMap;
}
+ @Override
public CDataProxy[] getCachedProxies() {
Map map = getMap(false);
if(map != null){
@@ -35,6 +36,7 @@ public class MapProxyCache implements IProxyCache {
return new CDataProxy[0];
}
+ @Override
public CDataProxy getCachedProxy(String id) {
Map map = getMap(false);
if(map != null)
@@ -42,29 +44,35 @@ public class MapProxyCache implements IProxyCache {
return null;
}
+ @Override
public void removeCachedProxy(String id) {
Map map = getMap(false);
if(map != null)
map.remove(id);
}
+ @Override
public void clear() {
fMap.clear();
}
+ @Override
public void addCachedProxy(CDataProxy proxy) {
getMap(true).put(proxy.getId(), proxy);
}
+ @Override
@SuppressWarnings("unchecked")
public Map getCachedProxiesMap() {
return (Map)getMap(true).clone();
}
+ @Override
public CDataProxy getCachedProxy(CDataObject data) {
return getCachedProxy(data.getId());
}
+ @Override
public void removeCachedProxy(CDataProxy proxy) {
removeCachedProxy(proxy.getId());
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/MultiConfigDescription.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/MultiConfigDescription.java
index a6838481d1c..653b0c662bd 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/MultiConfigDescription.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/MultiConfigDescription.java
@@ -64,6 +64,7 @@ public class MultiConfigDescription extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICConfigurationDescription#create(java.lang.String, java.lang.String)
*/
+ @Override
public ICConfigExtensionReference create(String extensionPoint,
String extension) throws CoreException {
if (DEBUG)
@@ -74,6 +75,7 @@ public class MultiConfigDescription extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICConfigurationDescription#createExternalSetting(java.lang.String[], java.lang.String[], java.lang.String[], org.eclipse.cdt.core.settings.model.ICSettingEntry[])
*/
+ @Override
public ICExternalSetting createExternalSetting(String[] languageIDs,
String[] contentTypeIds, String[] extensions,
ICSettingEntry[] entries) throws WriteAccessException {
@@ -85,6 +87,7 @@ public class MultiConfigDescription extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICConfigurationDescription#createFileDescription(org.eclipse.core.runtime.IPath, org.eclipse.cdt.core.settings.model.ICResourceDescription)
*/
+ @Override
public ICFileDescription createFileDescription(IPath path,
ICResourceDescription base) throws CoreException,
WriteAccessException {
@@ -95,6 +98,7 @@ public class MultiConfigDescription extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICConfigurationDescription#createFolderDescription(org.eclipse.core.runtime.IPath, org.eclipse.cdt.core.settings.model.ICFolderDescription)
*/
+ @Override
public ICFolderDescription createFolderDescription(IPath path,
ICFolderDescription base) throws CoreException,
WriteAccessException {
@@ -106,6 +110,7 @@ public class MultiConfigDescription extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICConfigurationDescription#get(java.lang.String)
*/
+ @Override
public ICConfigExtensionReference[] get(String extensionPointID) {
if (DEBUG)
System.out.println("Bad multi access: MultiConfigDescription.get()"); //$NON-NLS-1$
@@ -115,27 +120,31 @@ public class MultiConfigDescription extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICConfigurationDescription#getBuildSetting()
*/
+ @Override
public ICBuildSetting getBuildSetting() {
if (DEBUG)
System.out.println("Bad multi access: MultiConfigDescription.getBuildSetting()"); //$NON-NLS-1$
return null;
}
+ @Override
public String[][] getErrorParserIDs() {
- String[][] out = new String[fCfgs.length][];
+ String[][] out = new String[fCfgs.length][];
for (int i=0; i lst = new ArrayList();
- for (int i=0; i lst = new ArrayList();
- for (int i=0; i getReferenceInfo() {
if (DEBUG)
System.out.println("Bad multi access: MultiConfigDescription.getReferenceInfo()"); //$NON-NLS-1$
@@ -247,6 +267,7 @@ public class MultiConfigDescription extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICConfigurationDescription#getResolvedSourceEntries()
*/
+ @Override
public ICSourceEntry[] getResolvedSourceEntries() {
return new ICSourceEntry[0];
}
@@ -254,6 +275,7 @@ public class MultiConfigDescription extends MultiItemsHolder implements
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICConfigurationDescription#getResourceDescription(org.eclipse.core.runtime.IPath, boolean)
*/
+ @Override
public ICResourceDescription getResourceDescription(IPath path,
boolean isForFolder) {
ArrayList lst = new ArrayList();
@@ -281,13 +303,14 @@ public class MultiConfigDescription extends MultiItemsHolder implements
return new MultiFileDescription(
lst.toArray(new ICFileDescription[lst.size()]));
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICConfigurationDescription#getResourceDescriptions()
*/
+ @Override
public ICResourceDescription[] getResourceDescriptions() {
ArrayList lst = new ArrayList();
- for (int i=0; i refs) throws WriteAccessException {
for (int i=0; i comp) {
ICLanguageSetting[][] ls = new ICLanguageSetting[fRess.length][];
for (int i=0; i incs, boolean toAll) {
for (int i=0; i 0){
@@ -116,6 +123,7 @@ public class ProxyProvider implements IProxyProvider {
return proxies;
}
+ @Override
public void cacheValues() {
if(!fProxiesCached || !fScope.isStatic()){
fillCache();
@@ -123,6 +131,7 @@ public class ProxyProvider implements IProxyProvider {
}
}
+ @Override
public void invalidateCache() {
fProxiesCached = false;
CDataProxy[] proxies = fCache.getCachedProxies();
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ResourceChangeHandler.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ResourceChangeHandler.java
index 63684384157..84f5161df5c 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ResourceChangeHandler.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ResourceChangeHandler.java
@@ -76,6 +76,7 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements
/** Map of moved & removed resources: 'from' -> 'to'; 'to' may be null for removed resources */
Map fMovedResources = new HashMap();
+ @Override
public void handleProjectClose(IProject project) {
fMngr.projectClosedRemove(project);
}
@@ -121,6 +122,7 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements
return updatedList != null ? updatedList.toArray(new ICSourceEntry[updatedList.size()]) : null;
}
+ @Override
public boolean handleResourceMove(IResource fromRc, IResource toRc) {
boolean proceed = true;
IProject fromProject = fromRc.getProject();
@@ -135,7 +137,7 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements
break;
case IResource.FOLDER:
case IResource.FILE:
- // Only handle move in the same project
+ // Only handle move in the same project
// TODO: should we treat this as a remove?
if (!toProject.equals(fromProject))
break;
@@ -163,6 +165,7 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements
return des;
}
+ @Override
public boolean handleResourceRemove(IResource rc) {
boolean proceed = true;
IProject project = rc.getProject();
@@ -182,6 +185,7 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements
return proceed;
}
+ @Override
public void done() {
// If the resource's project was moved / removed, don't consider the path for source entry removal
for (Iterator it = fMovedResources.keySet().iterator(); it.hasNext() ; ) {
@@ -198,6 +202,7 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements
// Run it in the Workspace, so we don't trip Bug 311189
CProjectDescriptionManager.runWspModification(new IWorkspaceRunnable(){
+ @Override
public void run(IProgressMonitor monitor) throws CoreException {
for (Map.Entry entry : fMovedResources.entrySet()) {
IResource from = entry.getKey();
@@ -209,7 +214,7 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements
if (to == null) {
if (from.exists())
continue;
- // Workaround for platform Bug 317783
+ // Workaround for platform Bug 317783
if (from.getWorkspace().validateFiltered(from).isOK()) {
URI uri = from.getLocationURI();
if (uri != null && EFS.getStore(uri).fetchInfo().exists())
@@ -283,6 +288,7 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements
/* (non-Javadoc)
* @see org.eclipse.core.resources.ISaveParticipant#saving(org.eclipse.core.resources.ISaveContext)
*/
+ @Override
public void saving(ISaveContext context) throws CoreException {
//Request a resource delta to be used on next activation.
context.needDelta();
@@ -291,18 +297,21 @@ public class ResourceChangeHandler extends ResourceChangeHandlerBase implements
/* (non-Javadoc)
* @see org.eclipse.core.resources.ISaveParticipant#doneSaving(org.eclipse.core.resources.ISaveContext)
*/
+ @Override
public void doneSaving(ISaveContext context) {
}
/* (non-Javadoc)
* @see org.eclipse.core.resources.ISaveParticipant#prepareToSave(org.eclipse.core.resources.ISaveContext)
*/
+ @Override
public void prepareToSave(ISaveContext context) throws CoreException {
}
/* (non-Javadoc)
* @see org.eclipse.core.resources.ISaveParticipant#rollback(org.eclipse.core.resources.ISaveContext)
*/
+ @Override
public void rollback(ISaveContext context) {
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ResourceDescriptionHolder.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ResourceDescriptionHolder.java
index 6cca262c6a1..20c96ff05fb 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ResourceDescriptionHolder.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ResourceDescriptionHolder.java
@@ -24,7 +24,7 @@ import org.eclipse.core.runtime.IPath;
public class ResourceDescriptionHolder {
private PathSettingsContainer fPathSettingContainer;
private boolean fIncludeCurrent;
-
+
public ResourceDescriptionHolder(PathSettingsContainer pathContainer,
boolean includeCurrent){
fPathSettingContainer = pathContainer;
@@ -37,11 +37,11 @@ public class ResourceDescriptionHolder {
return (ICResourceDescription)container.getValue();
return null;
}
-
+
public IPath getCurrentPath(){
return fPathSettingContainer.getPath();
}
-
+
public void setCurrentPath(IPath path){
//TODO: do we need to move children here?
fPathSettingContainer.setPath(path, true);
@@ -51,11 +51,12 @@ public class ResourceDescriptionHolder {
PathSettingsContainer container = fPathSettingContainer.getChildContainer(path, true, true);
container.setValue(des);
}
-
+
public ICResourceDescription[] getResourceDescriptions(final int kind){
final List list = new ArrayList();
fPathSettingContainer.accept(new IPathSettingsContainerVisitor(){
+ @Override
public boolean visit(PathSettingsContainer container) {
ICResourceDescription des = (ICResourceDescription)container.getValue();
if((container != fPathSettingContainer || fIncludeCurrent)
@@ -64,14 +65,14 @@ public class ResourceDescriptionHolder {
}
return true;
}
-
+
});
-
+
if(kind == ICSettingBase.SETTING_FILE)
return list.toArray(new ICFileDescription[list.size()]);
else if(kind == ICSettingBase.SETTING_FOLDER)
return list.toArray(new ICFolderDescription[list.size()]);
-
+
return list.toArray(new ICResourceDescription[list.size()]);
}
@@ -79,11 +80,12 @@ public class ResourceDescriptionHolder {
final List list = new ArrayList();
fPathSettingContainer.accept(new IPathSettingsContainerVisitor(){
+ @Override
public boolean visit(PathSettingsContainer container) {
list.add(container.getValue());
return true;
}
-
+
});
return list.toArray(new ICResourceDescription[list.size()]);
}
@@ -91,32 +93,32 @@ public class ResourceDescriptionHolder {
public void removeResurceDescription(IPath path){
fPathSettingContainer.removeChildContainer(path);
}
-
+
public ICResourceDescription getCurrentResourceDescription(){
return (ICResourceDescription)fPathSettingContainer.getValue();
}
-
+
public ICResourceDescription[] getDirectChildren(){
PathSettingsContainer dc[] = fPathSettingContainer.getDirectChildren();
ICResourceDescription rcDess[] = new ICResourceDescription[dc.length];
-
+
for(int i = 0; i < dc.length; i++){
rcDess[i] = (ICResourceDescription)dc[i].getValue();
}
-
+
return rcDess;
}
-
+
// public ICSourceEntry[] calculateSourceEntriesFromPaths(IProject project, IPath paths[]){
// if(paths == null || paths.length == 0)
// paths = new IPath[]{new Path("")}; //$NON-NLS-1$
-//
+//
//// Set set = new HashSet(paths.length);
// PathSettingsContainer cr = PathSettingsContainer.createRootContainer();
// IPath pi, pj;
// List entriesList = new ArrayList(paths.length);
// IPath projPath = project != null ? project.getFullPath() : null;
-//
+//
// for(int i = 0; i < paths.length; i++){
// pi = paths[i];
//// set.clear();
@@ -129,7 +131,7 @@ public class ResourceDescriptionHolder {
// cr.getChildContainer(pj, true, true);
// }
// }
-//
+//
// PathSettingsContainer children[] = fPathSettingContainer.getDirectChildrenForPath(pi);
// for(int k = 0; k < children.length; k++){
// PathSettingsContainer child = children[k];
@@ -138,14 +140,14 @@ public class ResourceDescriptionHolder {
// IPath parentExclusionPath = parentExclusion.getPath();
// if(parentExclusionPath.segmentCount() > 0 && !parentExclusionPath.equals(childPath) && parentExclusionPath.isPrefixOf(childPath))
// continue;
-//
+//
// ICResourceDescription rcDes = (ICResourceDescription)child.getValue();
// if(rcDes.isExcluded()){
//// set.add(rcDes.getPath());
// cr.getChildContainer(childPath, true, true);
// }
// }
-//
+//
// PathSettingsContainer exclusions[] = cr.getChildren(false);
//// IPath exlusionPaths[] = new IPath[set.size()];
// IPath exlusionPaths[] = new IPath[exclusions.length];
@@ -165,14 +167,14 @@ public class ResourceDescriptionHolder {
//
// return (ICSourceEntry[])entriesList.toArray(new ICSourceEntry[entriesList.size()]);
// }
-
+
public ICFolderDescription getParentFolderDescription(){
PathSettingsContainer parent = fPathSettingContainer.getParentContainer();
if(parent != null)
return (ICFolderDescription)parent.getValue();
return null;
}
-
+
public static IPath normalizePath(IPath path){
return path.makeRelative();
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ScannerInfoProviderProxy.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ScannerInfoProviderProxy.java
index 89e13e57c98..e314ffce39b 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ScannerInfoProviderProxy.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/ScannerInfoProviderProxy.java
@@ -32,12 +32,13 @@ public class ScannerInfoProviderProxy extends AbstractCExtensionProxy implements
super(project, CCorePlugin.BUILD_SCANNER_INFO_UNIQ_ID);
}
+ @Override
public IScannerInfo getScannerInformation(IResource resource) {
providerRequested();
return fProvider.getScannerInformation(resource);
}
-
-
+
+
protected void notifyInfoListeners(IResource rc, IScannerInfo info) {
// Call in the cavalry
List listeners = getListeners().get(rc);
@@ -51,13 +52,14 @@ public class ScannerInfoProviderProxy extends AbstractCExtensionProxy implements
}
}
-
+
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.parser.IScannerInfoProvider#subscribe(org.eclipse.core.resources.IResource,
* org.eclipse.cdt.core.parser.IScannerInfoChangeListener)
*/
+ @Override
public synchronized void subscribe(IResource resource, IScannerInfoChangeListener listener) {
if (resource == null || listener == null) {
return;
@@ -89,10 +91,11 @@ public class ScannerInfoProviderProxy extends AbstractCExtensionProxy implements
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.parser.IScannerInfoProvider#unsubscribe(org.eclipse.core.resources.IResource,
* org.eclipse.cdt.core.parser.IScannerInfoChangeListener)
*/
+ @Override
public synchronized void unsubscribe(IResource resource, IScannerInfoChangeListener listener) {
if (resource == null || listener == null) {
return;
@@ -107,6 +110,7 @@ public class ScannerInfoProviderProxy extends AbstractCExtensionProxy implements
}
}
+ @Override
public void changeNotification(IResource rc, IScannerInfo info) {
notifyInfoListeners(rc, info);
}
@@ -134,7 +138,7 @@ public class ScannerInfoProviderProxy extends AbstractCExtensionProxy implements
fProvider = provider;
provider.subscribe(getProject(), this);
}
-
+
@Override
protected void postProcessProviderChange(Object newProvider,
Object oldProvider) {
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/SettingsContext.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/SettingsContext.java
index fcaf631fffd..3bc353f3a1c 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/SettingsContext.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/SettingsContext.java
@@ -21,21 +21,22 @@ import org.eclipse.core.runtime.IProgressMonitor;
public final class SettingsContext implements IModificationContext{
private static final int USER_FLAGS_MASK = 0x0000ffff;
public static final int CFG_DATA_CACHED = 1 << 15;
-
+
private IProjectDescription fEDes;
private IProject fProject;
private CompositeWorkspaceRunnable fRunnable;
private int fFlags;
-
-
+
+
public SettingsContext(IProject project){
fProject = project;
}
+ @Override
public IProject getProject(){
return fProject;
}
-
+
void init(CConfigurationDescriptionCache cfg){
int flags = 0;
if(cfg.getBaseCache() != null)
@@ -48,16 +49,18 @@ public final class SettingsContext implements IModificationContext{
if(eDes == null && create){
if(fProject == null)
throw ExceptionFactory.createCoreException(SettingsModelMessages.getString("SettingsContext.0")); //$NON-NLS-1$
-
+
eDes = fProject.getDescription();
}
return eDes;
}
-
+
+ @Override
public IProjectDescription getEclipseProjectDescription() throws CoreException{
return getEclipseProjectDescription(true);
}
-
+
+ @Override
public void setEclipseProjectDescription(IProjectDescription des)
throws CoreException {
if(fEDes == null)
@@ -71,28 +74,30 @@ public final class SettingsContext implements IModificationContext{
fRunnable = new CompositeWorkspaceRunnable(null);
return fRunnable;
}
-
+
+ @Override
public void addWorkspaceRunnable(IWorkspaceRunnable runnable){
getCompositeWorkspaceRunnable(true).add(runnable);
}
-
+
public IWorkspaceRunnable createOperationRunnable() {
CompositeWorkspaceRunnable result = new CompositeWorkspaceRunnable(null);
-
+
IWorkspaceRunnable r = getSetEclipseProjectDescriptionRunnable();
if(r != null)
result.add(r);
r = getCompositeWorkspaceRunnable(false);
if(r != null)
result.add(r);
-
+
return result.isEmpty() ? null : result;
}
-
+
private IWorkspaceRunnable getSetEclipseProjectDescriptionRunnable(){
if(fEDes != null){
return new IWorkspaceRunnable(){
+ @Override
public void run(IProgressMonitor monitor)
throws CoreException {
fProject.setDescription(fEDes, monitor);
@@ -106,12 +111,14 @@ public final class SettingsContext implements IModificationContext{
return fFlags;
}
+ @Override
public void setConfigurationSettingsFlags(int flags) {
- //system flags are read only;
+ //system flags are read only;
flags &= USER_FLAGS_MASK;
fFlags |= flags;
}
+ @Override
public boolean isBaseDataCached() {
return (fFlags & CFG_DATA_CACHED) != 0;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/SynchronizedStorageElement.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/SynchronizedStorageElement.java
index 25ff82ac532..b8385ac9036 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/SynchronizedStorageElement.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/SynchronizedStorageElement.java
@@ -76,7 +76,7 @@ public class SynchronizedStorageElement implements ICStorageElement {
public static SynchronizedStorageElement synchronizedElement(ICStorageElement el, Object lock) {
return new SynchronizedStorageElement(el, lock);
}
-
+
/**
* @return the lock used to synchronize this SynchronizedStorage and its children
*/
@@ -85,18 +85,21 @@ public class SynchronizedStorageElement implements ICStorageElement {
}
+ @Override
public void clear() {
synchronized (fLock) {
fEl.clear();
}
}
+ @Override
public ICStorageElement createChild(String name) {
synchronized (fLock) {
return new SynchronizedStorageElement(fEl.createChild(name), fLock);
}
}
+ @Override
public ICStorageElement createCopy() throws UnsupportedOperationException,
CoreException {
synchronized (fLock) {
@@ -104,6 +107,7 @@ public class SynchronizedStorageElement implements ICStorageElement {
}
}
+ @Override
public boolean equals(ICStorageElement other) {
synchronized (fLock) {
if (other instanceof SynchronizedStorageElement)
@@ -112,24 +116,28 @@ public class SynchronizedStorageElement implements ICStorageElement {
}
}
+ @Override
public String getAttribute(String name) {
synchronized (fLock) {
return fEl.getAttribute(name);
}
}
+ @Override
public String[] getAttributeNames() {
synchronized (fLock) {
return fEl.getAttributeNames();
}
}
+ @Override
public ICStorageElement[] getChildren() {
synchronized (fLock) {
return createSynchronizedChildren(fEl.getChildren());
}
}
+ @Override
public ICStorageElement[] getChildrenByName(String name) {
synchronized (fLock) {
return createSynchronizedChildren(fEl.getChildrenByName(name));
@@ -143,12 +151,14 @@ public class SynchronizedStorageElement implements ICStorageElement {
return synchChildren;
}
+ @Override
public String getName() {
synchronized (fLock) {
return fEl.getName();
}
}
+ @Override
public ICStorageElement getParent() {
synchronized (fLock) {
if (fEl.getParent() == null ||
@@ -158,24 +168,28 @@ public class SynchronizedStorageElement implements ICStorageElement {
}
}
+ @Override
public String getValue() {
synchronized (fLock) {
return fEl.getValue();
}
}
+ @Override
public boolean hasAttribute(String name) {
synchronized (fLock) {
return fEl.hasAttribute(name);
}
}
+ @Override
public boolean hasChildren() {
synchronized (fLock) {
return fEl.hasChildren();
}
}
+ @Override
public ICStorageElement importChild(ICStorageElement el)
throws UnsupportedOperationException {
synchronized (fLock) {
@@ -183,12 +197,14 @@ public class SynchronizedStorageElement implements ICStorageElement {
}
}
+ @Override
public void removeAttribute(String name) {
synchronized (fLock) {
fEl.removeAttribute(name);
}
}
+ @Override
public void removeChild(ICStorageElement el) {
synchronized (fLock) {
if (el instanceof SynchronizedStorageElement)
@@ -197,12 +213,14 @@ public class SynchronizedStorageElement implements ICStorageElement {
}
}
+ @Override
public void setAttribute(String name, String value) {
synchronized (fLock) {
fEl.setAttribute(name, value);
}
}
+ @Override
public void setValue(String value) {
synchronized (fLock) {
fEl.setValue(value);
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml/XmlProjectDescriptionStorage.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml/XmlProjectDescriptionStorage.java
index a7ef3579cca..8ad92ba26c8 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml/XmlProjectDescriptionStorage.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml/XmlProjectDescriptionStorage.java
@@ -155,14 +155,16 @@ public class XmlProjectDescriptionStorage extends AbstractCProjectDescriptionSto
fElement = el;
}
+ @Override
public void run(IProgressMonitor monitor) throws CoreException {
JobChangeAdapter notifyJobCanceller = new NotifyJobCanceller();
try {
// See Bug 249951 & Bug 310007
Job.getJobManager().addJobChangeListener(notifyJobCanceller);
- // Ensure we can check a null-job into the workspace
+ // Ensure we can check a null-job into the workspace
// i.e. if notification is currently in progress wait for it to finish...
ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
+ @Override
public void run(IProgressMonitor monitor) throws CoreException {
}
}, null, IWorkspace.AVOID_UPDATE, null);
@@ -172,7 +174,7 @@ public class XmlProjectDescriptionStorage extends AbstractCProjectDescriptionSto
((ContributedEnvironment) CCorePlugin.getDefault().getBuildEnvironmentManager().getContributedEnvironment()).serialize(fDes);
} finally {
serializingLock.release();
- Job.getJobManager().removeJobChangeListener(notifyJobCanceller);
+ Job.getJobManager().removeJobChangeListener(notifyJobCanceller);
}
}
@@ -313,7 +315,7 @@ public class XmlProjectDescriptionStorage extends AbstractCProjectDescriptionSto
// the suggested solution is to use modStamp + modTime
//
// Both values are cached in resourceInfo, so this is fast.
- return resource.getModificationStamp() + resource.getLocalTimeStamp();
+ return resource.getModificationStamp() + resource.getLocalTimeStamp();
}
/**
@@ -736,6 +738,7 @@ public class XmlProjectDescriptionStorage extends AbstractCProjectDescriptionSto
// try refreshing
final Throwable[] t = new Throwable[1];
Job job = CProjectDescriptionManager.runWspModification(new IWorkspaceRunnable() {
+ @Override
public void run(IProgressMonitor monitor) throws CoreException {
try {
rscFile.refreshLocal(IResource.DEPTH_ZERO, null);
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml/XmlProjectDescriptionStorageFactory.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml/XmlProjectDescriptionStorageFactory.java
index c3b6a2e1b67..202afc37850 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml/XmlProjectDescriptionStorageFactory.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml/XmlProjectDescriptionStorageFactory.java
@@ -21,10 +21,12 @@ import org.osgi.framework.Version;
*/
public class XmlProjectDescriptionStorageFactory implements ICProjectDescriptionStorageType {
+ @Override
public AbstractCProjectDescriptionStorage getProjectDescriptionStorage(CProjectDescriptionStorageTypeProxy type, IProject project, Version version) {
return new XmlProjectDescriptionStorage(type, project, version);
}
+ @Override
public boolean createsCProjectXMLFile() {
return true;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml/XmlStorage.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml/XmlStorage.java
index b599f7d22f4..7f693007f43 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml/XmlStorage.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml/XmlStorage.java
@@ -74,6 +74,7 @@ public class XmlStorage implements ICSettingsStorage {
}
}
+ @Override
public boolean isReadOnly(){
return fIsReadOnly;
}
@@ -127,6 +128,7 @@ public class XmlStorage implements ICSettingsStorage {
return getStorage(id, false) != null;
}
+ @Override
public ICStorageElement importStorage(String id, ICStorageElement el) throws UnsupportedOperationException {
if(fIsReadOnly)
throw ExceptionFactory.createIsReadOnlyException();
@@ -173,6 +175,7 @@ public class XmlStorage implements ICSettingsStorage {
}
}
+ @Override
public ICStorageElement getStorage(String id, boolean create){
initChildren();
@@ -199,6 +202,7 @@ public class XmlStorage implements ICSettingsStorage {
return child;
}
+ @Override
public void removeStorage(String id){
initChildren();
InternalXmlStorageElement se = fStorageElementMap.remove(id);
@@ -208,7 +212,7 @@ public class XmlStorage implements ICSettingsStorage {
throw ExceptionFactory.createIsReadOnlyException();
synchronized (fLock) {
- synchronized (se.fLock){
+ synchronized (se.fLock){
fIsDirty = true;
Node nextSibling = se.fElement.getNextSibling();
fElement.removeChild(se.fElement);
@@ -223,6 +227,7 @@ public class XmlStorage implements ICSettingsStorage {
}
}
+ @Override
public boolean isModified(){
if(fIsDirty)
return true;
@@ -236,6 +241,7 @@ public class XmlStorage implements ICSettingsStorage {
return false;
}
+ @Override
public void setReadOnly(boolean readOnly, boolean keepModify){
fIsReadOnly = readOnly;
fIsDirty &= keepModify;
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml/XmlStorageElement.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml/XmlStorageElement.java
index 148ce441030..91b62ed3a2b 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml/XmlStorageElement.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml/XmlStorageElement.java
@@ -40,7 +40,7 @@ import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
public class XmlStorageElement implements ICStorageElement {
-
+
protected static final String[] emptyStringList = new String[0];
// Lock to prevent concurrent access to XML DOM which isn't thread-safe for read (Bug 319245)
@@ -72,11 +72,11 @@ public class XmlStorageElement implements ICStorageElement {
if(attributeFilters != null && attributeFilters.length != 0)
fAttributeFilters = attributeFilters.clone();
-
+
if(childFilters != null && childFilters.length != 0)
fChildFilters = childFilters.clone();
}
-
+
/**
* Create ICStorageElement children from Xml tree
*/
@@ -98,7 +98,7 @@ public class XmlStorageElement implements ICStorageElement {
fChildrenCreated = true;
}
}
-
+
private XmlStorageElement createAddChild(Element element,
boolean alowReferencingParent,
String[] attributeFilters,
@@ -109,7 +109,7 @@ public class XmlStorageElement implements ICStorageElement {
return child;
}
}
-
+
protected XmlStorageElement createChild(Element element,
boolean alowReferencingParent,
String[] attributeFilters,
@@ -117,6 +117,7 @@ public class XmlStorageElement implements ICStorageElement {
return new XmlStorageElement(element, this, attributeFilters, childFilters);
}
+ @Override
public ICStorageElement[] getChildren() {
return getChildren(XmlStorageElement.class);
}
@@ -141,6 +142,7 @@ public class XmlStorageElement implements ICStorageElement {
}
}
+ @Override
public ICStorageElement[] getChildrenByName(String name) {
synchronized (fLock) {
createChildren();
@@ -151,7 +153,8 @@ public class XmlStorageElement implements ICStorageElement {
return children.toArray(new ICStorageElement[children.size()]);
}
}
-
+
+ @Override
public boolean hasChildren() {
synchronized (fLock) {
createChildren();
@@ -159,10 +162,12 @@ public class XmlStorageElement implements ICStorageElement {
}
}
+ @Override
public ICStorageElement getParent() {
return fParent;
}
+ @Override
public String getAttribute(String name) {
synchronized (fLock) {
if(isPropertyAlowed(name) && fElement.hasAttribute(name))
@@ -170,13 +175,14 @@ public class XmlStorageElement implements ICStorageElement {
}
return null;
}
-
+
+ @Override
public boolean hasAttribute(String name) {
synchronized (fLock) {
return fElement.hasAttribute(name);
}
}
-
+
private boolean isPropertyAlowed(String name){
if(fAttributeFilters != null){
return checkString(name, fAttributeFilters);
@@ -201,6 +207,7 @@ public class XmlStorageElement implements ICStorageElement {
return true;
}
+ @Override
public void removeChild(ICStorageElement el) {
if(el instanceof XmlStorageElement){
ICStorageElement[] children = getChildren();
@@ -224,9 +231,10 @@ public class XmlStorageElement implements ICStorageElement {
}
}
}
-
+
}
+ @Override
public void removeAttribute(String name) {
synchronized (fLock) {
if(isPropertyAlowed(name))
@@ -234,13 +242,15 @@ public class XmlStorageElement implements ICStorageElement {
}
}
+ @Override
public void setAttribute(String name, String value) {
synchronized (fLock) {
if(isPropertyAlowed(name))
fElement.setAttribute(name, value);
}
}
-
+
+ @Override
public void clear(){
synchronized (fLock) {
createChildren();
@@ -268,7 +278,7 @@ public class XmlStorageElement implements ICStorageElement {
}
}
- public ICStorageElement createChild(String name,
+ public ICStorageElement createChild(String name,
boolean alowReferencingParent,
String[] attributeFilters,
String[] childFilters) {
@@ -281,16 +291,19 @@ public class XmlStorageElement implements ICStorageElement {
}
}
+ @Override
public String getName() {
synchronized (fLock) {
return fElement.getNodeName();
}
}
+ @Override
public ICStorageElement createChild(String name) {
return createChild(name, true, null, null);
}
+ @Override
public String getValue() {
Text text = getTextChild();
if(text != null)
@@ -298,6 +311,7 @@ public class XmlStorageElement implements ICStorageElement {
return null;
}
+ @Override
public void setValue(String value) {
Text text = getTextChild();
synchronized (fLock) {
@@ -315,7 +329,7 @@ public class XmlStorageElement implements ICStorageElement {
}
}
}
-
+
private Text getTextChild(){
synchronized (fLock) {
NodeList nodes = fElement.getChildNodes();
@@ -330,16 +344,17 @@ public class XmlStorageElement implements ICStorageElement {
return text;
}
}
-
+
+ @Override
public ICStorageElement importChild(ICStorageElement el) throws UnsupportedOperationException {
return addChild(el, true, null, null);
}
- public ICStorageElement addChild(ICStorageElement el,
+ public ICStorageElement addChild(ICStorageElement el,
boolean alowReferencingParent,
String[] attributeFilters,
String[] childFilters) throws UnsupportedOperationException {
-
+
if(!isChildAlowed(el.getName()))
return null;
@@ -362,7 +377,7 @@ public class XmlStorageElement implements ICStorageElement {
throw new UnsupportedOperationException();
}
}
-
+
public String[] getAttributeFilters(){
if(fAttributeFilters != null)
return fAttributeFilters.clone();
@@ -375,18 +390,19 @@ public class XmlStorageElement implements ICStorageElement {
return emptyStringList;
}
+ @Override
public boolean equals(ICStorageElement el){
if(!getName().equals(el.getName()))
return false;
-
+
if (!valuesMatch(getValue(), el.getValue()))
return false;
-
+
String[] attrs = getAttributeNames();
String[] otherAttrs = el.getAttributeNames();
if(attrs.length != otherAttrs.length)
return false;
-
+
if(attrs.length != 0){
Set set = new HashSet(Arrays.asList(attrs));
set.removeAll(Arrays.asList(otherAttrs));
@@ -399,21 +415,21 @@ public class XmlStorageElement implements ICStorageElement {
}
}
-
-
+
+
XmlStorageElement[] children = (XmlStorageElement[])getChildren();
ICStorageElement[] otherChildren = el.getChildren();
-
+
if(children.length != otherChildren.length)
return false;
-
+
if(children.length != 0){
for(int i = 0; i < children.length; i++){
if(!children[i].equals(otherChildren[i]))
return false;
}
}
-
+
return true;
}
@@ -427,6 +443,7 @@ public class XmlStorageElement implements ICStorageElement {
}
}
+ @Override
public String[] getAttributeNames() {
synchronized (fLock) {
NamedNodeMap nodeMap = fElement.getAttributes();
@@ -441,12 +458,13 @@ public class XmlStorageElement implements ICStorageElement {
return list.toArray(new String[list.size()]);
}
}
-
+
+ @Override
public ICStorageElement createCopy() throws UnsupportedOperationException, CoreException {
Element newEl = createXmlElementCopy();
return new XmlStorageElement(newEl, null, fAttributeFilters, fChildFilters);
}
-
+
protected Element createXmlElementCopy() throws CoreException {
try {
@@ -465,7 +483,7 @@ public class XmlStorageElement implements ICStorageElement {
newXmlEl = (Element)node;
}
}
-
+
} else {
newXmlEl = (Element)importAddNode(doc, fElement);
}
@@ -485,7 +503,7 @@ public class XmlStorageElement implements ICStorageElement {
} else {
node = doc.importNode(node, true);
}
-
+
return doc.appendChild(node);
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml2/XmlProjectDescriptionStorage2.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml2/XmlProjectDescriptionStorage2.java
index 09c487c4439..386d30609f4 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml2/XmlProjectDescriptionStorage2.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml2/XmlProjectDescriptionStorage2.java
@@ -89,6 +89,7 @@ public class XmlProjectDescriptionStorage2 extends XmlProjectDescriptionStorage
final boolean[] needReload = new boolean[] { false };
try {
project.getFolder(STORAGE_FOLDER_NAME).accept(new IResourceProxyVisitor() {
+ @Override
public boolean visit(IResourceProxy proxy) throws CoreException {
if (modificationMap.containsKey(proxy.getName())) {
long modStamp = getModificationStamp(proxy.requestResource());
@@ -136,7 +137,7 @@ public class XmlProjectDescriptionStorage2 extends XmlProjectDescriptionStorage
currEl.getAttribute(EXTERNAL_CELEMENT_KEY),
reCreate, createEmptyIfNotFound, readOnly);
// Update the modification stamp
- modificationMap.put(currEl.getAttribute(EXTERNAL_CELEMENT_KEY),
+ modificationMap.put(currEl.getAttribute(EXTERNAL_CELEMENT_KEY),
getModificationStamp(project.getFolder(STORAGE_FOLDER_NAME).getFile(currEl.getAttribute(EXTERNAL_CELEMENT_KEY))));
ICStorageElement currParent = currEl.getParent();
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml2/XmlProjectDescriptionStorage2Factory.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml2/XmlProjectDescriptionStorage2Factory.java
index 457fcd54482..29167aeae19 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml2/XmlProjectDescriptionStorage2Factory.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/xml2/XmlProjectDescriptionStorage2Factory.java
@@ -22,10 +22,12 @@ import org.osgi.framework.Version;
*/
public class XmlProjectDescriptionStorage2Factory implements ICProjectDescriptionStorageType {
+ @Override
public AbstractCProjectDescriptionStorage getProjectDescriptionStorage(CProjectDescriptionStorageTypeProxy type, IProject project, Version version) {
return new XmlProjectDescriptionStorage2(type, project, version);
}
+ @Override
public boolean createsCProjectXMLFile() {
return true;
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/LRUCacheEnumerator.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/LRUCacheEnumerator.java
index 3d9fc9e7aba..0e9073d47f4 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/LRUCacheEnumerator.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/LRUCacheEnumerator.java
@@ -13,16 +13,16 @@ package org.eclipse.cdt.internal.core.util;
import java.util.Enumeration;
/**
- * The LRUCacheEnumerator
returns its elements in
+ * The LRUCacheEnumerator
returns its elements in
* the order they are found in the LRUCache
, with the
* most recent elements first.
*
- * Once the enumerator is created, elements which are later added
+ * Once the enumerator is created, elements which are later added
* to the cache are not returned by the enumerator. However,
- * elements returned from the enumerator could have been closed
+ * elements returned from the enumerator could have been closed
* by the cache.
*
- * This class is similar to the JDT LRUCacheEnumerator class.
+ * This class is similar to the JDT LRUCacheEnumerator class.
*/
public class LRUCacheEnumerator implements Enumeration {
/**
@@ -35,7 +35,7 @@ public class LRUCacheEnumerator implements Enumeration {
* Value returned by nextElement()
;
*/
public T fValue;
-
+
/**
* Next element
*/
@@ -57,12 +57,14 @@ public class LRUCacheEnumerator implements Enumeration {
/**
* Returns true if more elements exist.
*/
+ @Override
public boolean hasMoreElements() {
return fElementQueue != null;
}
/**
* Returns the next element.
*/
+ @Override
public T nextElement() {
T temp = fElementQueue.fValue;
fElementQueue = fElementQueue.fNext;
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/AbstractCExtension.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/AbstractCExtension.java
index cb589465b3b..c797dae67a9 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/AbstractCExtension.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/AbstractCExtension.java
@@ -23,17 +23,19 @@ public abstract class AbstractCExtension extends PlatformObject implements ICExt
/**
* Returns the project for which this extension is defined.
- *
+ *
* @return the project
*/
+ @Override
public final IProject getProject() {
return fProject;
}
-
+
/**
* May return null
!
* @deprecated Use {@link #getConfigExtensionReference()} instead.
*/
+ @Override
@Deprecated
public final ICExtensionReference getExtensionReference() {
if (extensionRef == null) {
@@ -60,10 +62,11 @@ public abstract class AbstractCExtension extends PlatformObject implements ICExt
* Returns the extension reference this extension was created from.
* @since 5.2
*/
+ @Override
public final ICConfigExtensionReference getConfigExtensionReference() {
return fCfgExtensionRef;
}
-
+
// internal stuff
/**
* @noreference This method is not intended to be referenced by clients.
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java
index 344c406447f..cb10cbfe991 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java
@@ -88,7 +88,7 @@ import com.ibm.icu.text.MessageFormat;
/**
* CCorePlugin is the life-cycle owner of the core plug-in, and starting point for access to many core APIs.
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
*/
@@ -112,15 +112,15 @@ public class CCorePlugin extends Plugin {
public final static String DEFAULT_BINARY_PARSER_SIMPLE_ID = "ELF"; //$NON-NLS-1$
public final static String DEFAULT_BINARY_PARSER_UNIQ_ID = PLUGIN_ID + "." + DEFAULT_BINARY_PARSER_SIMPLE_ID; //$NON-NLS-1$
public final static String PREF_USE_STRUCTURAL_PARSE_MODE = "useStructualParseMode"; //$NON-NLS-1$
-
+
public static final String INDEX_SIMPLE_ID = "CIndex"; //$NON-NLS-1$
public static final String INDEX_UNIQ_ID = PLUGIN_ID + "." + INDEX_SIMPLE_ID; //$NON-NLS-1$
-
+
public static final String INDEXER_SIMPLE_ID = "CIndexer"; //$NON-NLS-1$
public static final String INDEXER_UNIQ_ID = PLUGIN_ID + "." + INDEXER_SIMPLE_ID; //$NON-NLS-1$
public static final String PREF_INDEXER = "indexer"; //$NON-NLS-1$
public static final String DEFAULT_INDEXER = IPDOMManager.ID_FAST_INDEXER;
-
+
/**
* Name of the extension point for contributing an error parser
*/
@@ -140,8 +140,8 @@ public class CCorePlugin extends Plugin {
public static final String DEFAULT_PROVIDER_ID = CCorePlugin.PLUGIN_ID + ".defaultConfigDataProvider"; //$NON-NLS-1$
private final static String SCANNER_INFO_PROVIDER2_NAME = "ScannerInfoProvider2"; //$NON-NLS-1$
- private final static String SCANNER_INFO_PROVIDER2 = PLUGIN_ID + "." + SCANNER_INFO_PROVIDER2_NAME; //$NON-NLS-1$
-
+ private final static String SCANNER_INFO_PROVIDER2 = PLUGIN_ID + "." + SCANNER_INFO_PROVIDER2_NAME; //$NON-NLS-1$
+
/**
* Name of the extension point for contributing a source code formatter
*/
@@ -152,7 +152,7 @@ public class CCorePlugin extends Plugin {
* @see #getDefaultOptions
*/
public static final String CORE_ENCODING = PLUGIN_ID + ".encoding"; //$NON-NLS-1$
-
+
/**
* IContentType id for C Source Unit
*/
@@ -177,7 +177,7 @@ public class CCorePlugin extends Plugin {
* IContentType id for Binary Files
*/
public final static String CONTENT_TYPE_BINARYFILE = "org.eclipse.cdt.core.binaryFile"; //$NON-NLS-1$
-
+
/**
* Possible configurable option value.
* @see #getDefaultOptions()
@@ -210,11 +210,11 @@ public class CCorePlugin extends Plugin {
private volatile CProjectDescriptionManager fNewCProjectDescriptionManager;
private CoreModel fCoreModel;
-
+
private PDOMManager pdomManager;
private CdtVarPathEntryVariableManager fPathEntryVariableManager;
-
+
private final class NullConsole implements IConsole {
private ConsoleOutputStream nullStream = new ConsoleOutputStream() {
@Override
@@ -227,14 +227,18 @@ public class CCorePlugin extends Plugin {
public void write(int c) throws IOException {
}
};
+ @Override
public void start(IProject project) {
}
+ @Override
public ConsoleOutputStream getOutputStream() {
return nullStream;
}
+ @Override
public ConsoleOutputStream getInfoStream() {
- return nullStream;
+ return nullStream;
}
+ @Override
public ConsoleOutputStream getErrorStream() {
return nullStream;
}
@@ -251,7 +255,7 @@ public class CCorePlugin extends Plugin {
}
/**
- * Returns the shared working copies currently registered for the default buffer factory.
+ * Returns the shared working copies currently registered for the default buffer factory.
* @since 5.1
*/
public static IWorkingCopy[] getSharedWorkingCopies() {
@@ -288,7 +292,7 @@ public class CCorePlugin extends Plugin {
public static IPositionTrackerManager getPositionTrackerManager() {
return PositionTrackerManager.getInstance();
}
-
+
public static CCorePlugin getDefault() {
return fgCPlugin;
}
@@ -301,17 +305,17 @@ public class CCorePlugin extends Plugin {
public void stop(BundleContext context) throws Exception {
try {
pdomManager.shutdown();
-
+
PositionTrackerManager.getInstance().uninstall();
-
+
// if (fDescriptorManager != null) {
// fDescriptorManager.shutdown();
// }
-
+
if (fCoreModel != null) {
fCoreModel.shutdown();
}
-
+
if (cdtLog != null) {
cdtLog.shutdown();
}
@@ -322,7 +326,7 @@ public class CCorePlugin extends Plugin {
fNewCProjectDescriptionManager.shutdown();
ResourceLookup.shutdown();
-
+
savePluginPreferences();
} finally {
super.stop(context);
@@ -341,7 +345,7 @@ public class CCorePlugin extends Plugin {
configurePluginDebugOptions();
PositionTrackerManager.getInstance().install();
ResourceLookup.startup();
-
+
// new project model needs to register the resource listener first.
CProjectDescriptionManager descManager = CProjectDescriptionManager.getInstance();
final Job post1 = descManager.startup();
@@ -355,7 +359,7 @@ public class CCorePlugin extends Plugin {
pdomManager = new PDOMManager();
final Job post2= pdomManager.startup();
-
+
// bug 186755, when started after the platform has been started the job manager
// is no longer suspended. So we have to start a job at the very end to make
// sure we don't trigger a concurrent plug-in activation from within the job.
@@ -369,14 +373,14 @@ public class CCorePlugin extends Plugin {
* These options allow to configure the behavior of the underlying components.
* The client may safely use the result as a template that they can modify and
* then pass to setOptions
.
- *
- * Helper constants have been defined on CCorePlugin for each of the option ID and
+ *
+ * Helper constants have been defined on CCorePlugin for each of the option ID and
* their possible constant values.
- *
+ *
* Note: more options might be added in further releases.
*
* RECOGNIZED OPTIONS:
- *
+ *
* CORE / Specify Default Source Encoding Format
* Get the encoding format for translated sources. This setting is read-only, it is equivalent
* to 'ResourcesPlugin.getEncoding()'.
@@ -384,7 +388,7 @@ public class CCorePlugin extends Plugin {
* - possible values: { any of the supported encoding names}.
* - default:
*
- *
+ *
* @return a mutable map containing the default settings of all known options
* (key type: String
; value type: String
)
* @see #setOptions
@@ -395,20 +399,20 @@ public class CCorePlugin extends Plugin {
// see #initializeDefaultPluginPreferences() for changing default settings
Preferences preferences = getDefault().getPluginPreferences();
HashSet optionNames = CModelManager.OptionNames;
-
+
// get preferences set to their default
for (String propertyName : preferences.defaultPropertyNames()){
if (optionNames.contains(propertyName))
defaultOptions.put(propertyName, preferences.getDefaultString(propertyName));
- }
+ }
// get preferences not set to their default
for (String propertyName : preferences.propertyNames()) {
- if (optionNames.contains(propertyName))
+ if (optionNames.contains(propertyName))
defaultOptions.put(propertyName, preferences.getDefaultString(propertyName));
- }
+ }
// get encoding through resource plugin
- defaultOptions.put(CORE_ENCODING, ResourcesPlugin.getEncoding());
-
+ defaultOptions.put(CORE_ENCODING, ResourcesPlugin.getEncoding());
+
return defaultOptions;
}
@@ -418,13 +422,13 @@ public class CCorePlugin extends Plugin {
*
* For a complete description of the configurable options, see getDefaultOptions
.
*
- *
+ *
* @param optionName the name of an option
* @return the String value of a given option
* @see CCorePlugin#getDefaultOptions
*/
public static String getOption(String optionName) {
-
+
if (CORE_ENCODING.equals(optionName)){
return ResourcesPlugin.getEncoding();
}
@@ -434,15 +438,15 @@ public class CCorePlugin extends Plugin {
}
return null;
}
-
+
/**
* Returns the table of the current options. Initially, all options have their default values,
* and this method returns a table that includes all known options.
*
* For a complete description of the configurable options, see getDefaultOptions
.
*
- *
- * @return table of current settings of all options
+ *
+ * @return table of current settings of all options
* (key type: String
; value type: String
)
* @see CCorePlugin#getDefaultOptions
*/
@@ -454,19 +458,19 @@ public class CCorePlugin extends Plugin {
if (plugin != null) {
Preferences preferences = plugin.getPluginPreferences();
HashSet optionNames = CModelManager.OptionNames;
-
+
// get preferences set to their default
for (String propertyName : preferences.defaultPropertyNames()){
if (optionNames.contains(propertyName)){
options.put(propertyName, preferences.getDefaultString(propertyName));
}
- }
+ }
// get preferences not set to their default
for (String propertyName : preferences.propertyNames()){
if (optionNames.contains(propertyName)){
options.put(propertyName, preferences.getString(propertyName).trim());
}
- }
+ }
// get encoding through resource plugin
options.put(CORE_ENCODING, ResourcesPlugin.getEncoding());
}
@@ -474,19 +478,19 @@ public class CCorePlugin extends Plugin {
}
/**
- * Sets the current table of options. All and only the options explicitly included in the given table
+ * Sets the current table of options. All and only the options explicitly included in the given table
* are remembered; all previous option settings are forgotten, including ones not explicitly
* mentioned.
*
* For a complete description of the configurable options, see getDefaultOptions
.
*
- *
+ *
* @param newOptions the new options (key type: String
; value type: String
),
* or null
to reset all options to their default values
* @see CCorePlugin#getDefaultOptions
*/
public static void setOptions(HashMap newOptions) {
-
+
// see #initializeDefaultPluginPreferences() for changing default settings
Preferences preferences = getDefault().getPluginPreferences();
@@ -499,11 +503,11 @@ public class CCorePlugin extends Plugin {
String value = newOptions.get(key);
preferences.setValue(key, value);
}
-
+
// persist options
getDefault().savePluginPreferences();
- }
-
+ }
+
/**
* Create CDT console adapter for build console defined as an extension.
@@ -511,7 +515,7 @@ public class CCorePlugin extends Plugin {
* If the console class is instance of {@link ICConsole} it is initialized
* with context id, name and icon to be shown in the list of consoles in the
* Console view.
- *
+ *
* @param extConsoleId - console id defined in the extension point.
* @param contextId - context menu id in the Console view. A caller needs to define
* a distinct one for own use.
@@ -523,7 +527,7 @@ public class CCorePlugin extends Plugin {
*
* URL iconUrl = CUIPlugin.getDefault().getBundle().getEntry("icons/obj16/flask.png");
*
- *
+ *
* @return CDT console adapter.
*/
private IConsole getConsole(String extConsoleId, String contextId, String name, URL iconUrl) {
@@ -555,7 +559,7 @@ public class CCorePlugin extends Plugin {
* Create CDT console adapter.
* The adapter serves as a bridge between core plugin and UI console API in a way that
* a user can create a UI console from plugins having no dependencies to UI.
- *
+ *
* @param id - id of the console specified in extension point to instantiate
* console adapter.
* @return CDT console adapter.
@@ -568,7 +572,7 @@ public class CCorePlugin extends Plugin {
* Create CDT console adapter for build console. A new instance of class
* {@code org.eclipse.cdt.internal.ui.buildconsole.CBuildConsole} is created
* and initialized with the parameters.
- *
+ *
* @param contextId - context menu id in the Console view. A caller needs to define
* a distinct one for own use.
* @param name - name of console to appear in the list of consoles in context menu
@@ -582,9 +586,9 @@ public class CCorePlugin extends Plugin {
*
* {@code iconUrl} can be null , in that case the default image is used.
* See {@code org.eclipse.cdt.internal.ui.buildconsole.BuildConsole(IBuildConsoleManager, String, String, URL)}
- *
+ *
* @return CDT console adapter.
- *
+ *
* @since 5.3
*/
public IConsole getBuildConsole(String contextId, String name, URL iconUrl) {
@@ -658,7 +662,7 @@ public class CCorePlugin extends Plugin {
log(e); // wrong binary parser definition ?
}
if (parser != null) {
- list.add(parser);
+ list.add(parser);
}
}
parsers = new IBinaryParser[list.size()];
@@ -707,7 +711,7 @@ public class CCorePlugin extends Plugin {
public static IIndexManager getIndexManager() {
return getDefault().pdomManager;
}
-
+
public IPathEntryVariableManager getPathEntryVariableManager() {
return fPathEntryVariableManager;
}
@@ -722,7 +726,7 @@ public class CCorePlugin extends Plugin {
/**
* Please use {@link #getProjectDescription(IProject, boolean)} to fetch the
- * ICProjectDescription for the project. And use {@link ICProjectDescription#getConfigurations()}
+ * ICProjectDescription for the project. And use {@link ICProjectDescription#getConfigurations()}
* to get an array of ICConfigurationDescriptions, which have similar API to ICDescriptor,
* allowing you to store settings and configure extensions at the Configuration level
* rather than at the project level.
@@ -752,9 +756,9 @@ public class CCorePlugin extends Plugin {
/**
* @deprecated Settings should be set per ICConfigurationDescription rather than
- * global to the project. Please use {@link #getProjectDescription(IProject, boolean)}
- * to fetch the ICProjectDescription for the project. And use
- * {@link ICProjectDescription#getConfigurations()} to get an array of
+ * global to the project. Please use {@link #getProjectDescription(IProject, boolean)}
+ * to fetch the ICProjectDescription for the project. And use
+ * {@link ICProjectDescription#getConfigurations()} to get an array of
* ICConfigurationDescriptions, which have similar API to ICDescriptor,
* allowing you to store settings and configure extensions at the Configuration level
* rather than at the project level.
@@ -783,6 +787,7 @@ public class CCorePlugin extends Plugin {
throws CoreException, OperationCanceledException {
getWorkspace().run(new IWorkspaceRunnable() {
+ @Override
public void run(IProgressMonitor monitor) throws CoreException {
try {
if (monitor == null) {
@@ -792,11 +797,11 @@ public class CCorePlugin extends Plugin {
if (!projectHandle.exists()) {
projectHandle.create(description, new SubProgressMonitor(monitor, 1));
}
-
+
if (monitor.isCanceled()) {
throw new OperationCanceledException();
}
-
+
// Open first.
projectHandle.open(IResource.BACKGROUND_REFRESH, new SubProgressMonitor(monitor, 1));
@@ -827,6 +832,7 @@ public class CCorePlugin extends Plugin {
throws CoreException, OperationCanceledException {
getWorkspace().run(new IWorkspaceRunnable() {
+ @Override
public void run(IProgressMonitor monitor) throws CoreException {
try {
if (monitor == null) {
@@ -836,11 +842,11 @@ public class CCorePlugin extends Plugin {
if (!projectHandle.exists()) {
projectHandle.create(description, new SubProgressMonitor(monitor, 1));
}
-
+
if (monitor.isCanceled()) {
throw new OperationCanceledException();
}
-
+
// Open first.
projectHandle.open(IResource.BACKGROUND_REFRESH, new SubProgressMonitor(monitor, 1));
@@ -848,7 +854,7 @@ public class CCorePlugin extends Plugin {
// Add C Nature ... does not add duplicates
CProjectNature.addCNature(projectHandle, new SubProgressMonitor(monitor, 1));
-
+
if(bsId != null){
ICProjectDescription projDes = createProjectDescription(projectHandle, true);
ICConfigurationDescription cfgs[] = projDes.getConfigurations();
@@ -859,14 +865,14 @@ public class CCorePlugin extends Plugin {
break;
}
}
-
+
if(cfg == null){
ICConfigurationDescription prefCfg = getPreferenceConfiguration(bsId);
if(prefCfg != null){
cfg = projDes.createConfiguration(CDataUtil.genId(prefCfg.getId()), prefCfg.getName(), prefCfg);
}
}
-
+
if(cfg != null){
setProjectDescription(projectHandle, projDes);
}
@@ -882,9 +888,9 @@ public class CCorePlugin extends Plugin {
/**
* Method convertProjectFromCtoCC converts
* a C Project to a C++ Project
- * The newProject MUST, not be null, already have a C Nature
+ * The newProject MUST, not be null, already have a C Nature
* && must NOT already have a C++ Nature
- *
+ *
* @param projectHandle
* @param monitor
* @throws CoreException
@@ -894,15 +900,15 @@ public class CCorePlugin extends Plugin {
if ((projectHandle != null)
&& projectHandle.hasNature(CProjectNature.C_NATURE_ID)
&& !projectHandle.hasNature(CCProjectNature.CC_NATURE_ID)) {
- // Add C++ Nature ... does not add duplicates
+ // Add C++ Nature ... does not add duplicates
CCProjectNature.addCCNature(projectHandle, monitor);
}
}
/**
- * Method to convert a project to a C nature
+ * Method to convert a project to a C nature
* All checks should have been done externally
- * (as in the Conversion Wizards).
+ * (as in the Conversion Wizards).
* This method blindly does the conversion.
*/
public void convertProjectToC(IProject projectHandle, IProgressMonitor monitor, String projectID)
@@ -928,7 +934,7 @@ public class CCorePlugin extends Plugin {
}
/**
- * Method to convert a project to a C++ nature
+ * Method to convert a project to a C++ nature
*/
public void convertProjectToCC(IProject projectHandle, IProgressMonitor monitor, String projectID)
throws CoreException {
@@ -975,14 +981,14 @@ public class CCorePlugin extends Plugin {
}
}
}
- if ( defaultContributor != null) {
+ if ( defaultContributor != null) {
return (IProcessList) defaultContributor.createExecutableExtension("class"); //$NON-NLS-1$
}
}
return null;
-
+
}
-
+
/**
* @deprecated since CDT 6.1. Use {@link ErrorParserManager#getErrorParserAvailableIds()} instead
* @return array of error parsers ids
@@ -992,7 +998,7 @@ public class CCorePlugin extends Plugin {
ErrorParserExtensionManager.loadErrorParserExtensions();
return ErrorParserExtensionManager.getErrorParserAvailableIds();
}
-
+
/**
* @deprecated since CDT 6.1. Use {@link ErrorParserManager#getErrorParserCopy(String)} instead
* @param id - id of error parser
@@ -1017,7 +1023,7 @@ public class CCorePlugin extends Plugin {
provider = (IScannerInfoProvider)project.getSessionProperty(scannerInfoProviderName);
if (provider != null)
return provider;
-
+
// Next search the extension registry to see if a provider is registered with a build command
IExtensionRegistry registry = Platform.getExtensionRegistry();
IExtensionPoint point = registry.getExtensionPoint(SCANNER_INFO_PROVIDER2);
@@ -1037,7 +1043,7 @@ public class CCorePlugin extends Plugin {
}
}
}
-
+
// Default to the proxy
if (provider == null)
provider = fNewCProjectDescriptionManager.getScannerInfoProviderProxy(project);
@@ -1046,13 +1052,13 @@ public class CCorePlugin extends Plugin {
// Bug 313725: When project is being closed, don't report an error.
if (!project.isOpen())
return null;
-
+
log(e);
}
-
+
return provider;
}
-
+
/**
* Helper function, returning the content type for a filename
* Same as:
@@ -1064,7 +1070,7 @@ public class CCorePlugin extends Plugin {
public static IContentType getContentType(String filename) {
return CContentTypes.getContentType(null, filename);
}
-
+
/**
* Returns the content type for a filename. The method respects
* project specific content type definitions. The lookup prefers case-
@@ -1076,7 +1082,7 @@ public class CCorePlugin extends Plugin {
public static IContentType getContentType(IProject project, String filename) {
return CContentTypes.getContentType(project, filename);
}
-
+
/**
* Tests whether the given project uses its project specific content types.
*/
@@ -1091,7 +1097,7 @@ public class CCorePlugin extends Plugin {
CContentTypes.setUseProjectSpecificContentTypes(project, val);
}
-
+
private static final String MODEL = CCorePlugin.PLUGIN_ID + "/debug/model" ; //$NON-NLS-1$
private static final String PARSER = CCorePlugin.PLUGIN_ID + "/debug/parser" ; //$NON-NLS-1$
@@ -1104,7 +1110,7 @@ public class CCorePlugin extends Plugin {
* Configure the plug-in with respect to option settings defined in ".options" file
*/
public void configurePluginDebugOptions() {
-
+
if(CCorePlugin.getDefault().isDebugging()) {
String option = Platform.getDebugOption(PARSER);
if(option != null) Util.VERBOSE_PARSER = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
@@ -1114,13 +1120,13 @@ public class CCorePlugin extends Plugin {
option = Platform.getDebugOption(SCANNER);
if( option != null ) Util.VERBOSE_SCANNER = option.equalsIgnoreCase("true"); //$NON-NLS-1$
-
+
option = Platform.getDebugOption(MODEL);
if(option != null) Util.VERBOSE_MODEL = option.equalsIgnoreCase("true") ; //$NON-NLS-1$
-
+
option = Platform.getDebugOption(DELTA);
if(option != null) Util.VERBOSE_DELTA= option.equalsIgnoreCase("true") ; //$NON-NLS-1$
-
+
}
}
@@ -1133,7 +1139,7 @@ public class CCorePlugin extends Plugin {
public boolean useStructuralParseMode() {
return getPluginPreferences().getBoolean(PREF_USE_STRUCTURAL_PARSE_MODE);
}
-
+
/**
* @deprecated use {@link ITranslationUnit} or {@link ILanguage} to construct ASTs, instead.
*/
@@ -1145,11 +1151,11 @@ public class CCorePlugin extends Plugin {
public ICdtVariableManager getCdtVariableManager(){
return CdtVariableManager.getDefault();
}
-
+
public IEnvironmentVariableManager getBuildEnvironmentManager(){
return EnvironmentVariableManager.getDefault();
}
-
+
public ICConfigurationDescription getPreferenceConfiguration(String buildSystemId) throws CoreException{
return fNewCProjectDescriptionManager.getPreferenceConfiguration(buildSystemId);
}
@@ -1157,14 +1163,14 @@ public class CCorePlugin extends Plugin {
public ICConfigurationDescription getPreferenceConfiguration(String buildSystemId, boolean write) throws CoreException{
return fNewCProjectDescriptionManager.getPreferenceConfiguration(buildSystemId, write);
}
-
+
public void setPreferenceConfiguration(String buildSystemId, ICConfigurationDescription des) throws CoreException {
fNewCProjectDescriptionManager.setPreferenceConfiguration(buildSystemId, des);
}
-
+
/**
* this method is a full equivalent to createProjectDescription(IProject, boolean, false)
.
- *
+ *
* @see #createProjectDescription(IProject, boolean, boolean)
*/
public ICProjectDescription createProjectDescription(IProject project, boolean loadIfExists) throws CoreException{
@@ -1173,7 +1179,7 @@ public class CCorePlugin extends Plugin {
/**
* the method creates and returns a writable project description
- *
+ *
* @param project project for which the project description is requested
* @param loadIfExists if true the method first tries to load and return the project description
* from the settings file (.cproject)
@@ -1181,42 +1187,42 @@ public class CCorePlugin extends Plugin {
* @param creating if true the created project description will be contain the true "isCdtProjectCreating" state.
* NOTE: in case the project already contains the project description AND its "isCdtProjectCreating" is false
* the resulting description will be created with the false "isCdtProjectCreating" state
- *
- * NOTE: changes made to the returned project description will not be applied until the {@link #setProjectDescription(IProject, ICProjectDescription)} is called
+ *
+ * NOTE: changes made to the returned project description will not be applied until the {@link #setProjectDescription(IProject, ICProjectDescription)} is called
* @return {@link ICProjectDescription}
* @throws CoreException
*/
public ICProjectDescription createProjectDescription(IProject project, boolean loadIfExists, boolean creating) throws CoreException{
return fNewCProjectDescriptionManager.createProjectDescription(project, loadIfExists, creating);
}
-
+
/**
* returns the project description associated with this project or null if the project does not contain the
- * CDT data associated with it.
- *
+ * CDT data associated with it.
+ *
* this is a convenience method fully equivalent to getProjectDescription(project, true)
* see {@link #getProjectDescription(IProject, boolean)} for more detail
* @param project
* @return a writable copy of the ICProjectDescription or null if the project does not contain the
- * CDT data associated with it.
+ * CDT data associated with it.
* Note: changes to the project description will not be reflected/used by the core
* until the {@link #setProjectDescription(IProject, ICProjectDescription)} is called
- *
+ *
* @see #getProjectDescription(IProject, boolean)
*/
public ICProjectDescription getProjectDescription(IProject project){
return fNewCProjectDescriptionManager.getProjectDescription(project);
}
-
+
/**
* this method is called to save/apply the project description
* the method should be called to apply changes made to the project description
- * returned by the {@link #getProjectDescription(IProject, boolean)} or {@link #createProjectDescription(IProject, boolean)}
- *
+ * returned by the {@link #getProjectDescription(IProject, boolean)} or {@link #createProjectDescription(IProject, boolean)}
+ *
* @param project
* @param des
* @throws CoreException
- *
+ *
* @see #getProjectDescription(IProject, boolean)
* @see #createProjectDescription(IProject, boolean)
*/
@@ -1230,30 +1236,30 @@ public class CCorePlugin extends Plugin {
/**
* returns the project description associated with this project or null if the project does not contain the
- * CDT data associated with it.
- *
+ * CDT data associated with it.
+ *
* @param project project for which the description is requested
- * @param write if true, the writable description copy is returned.
+ * @param write if true, the writable description copy is returned.
* If false the cached read-only description is returned.
- *
+ *
* CDT core maintains the cached project description settings. If only read access is needed to description,
* then the read-only project description should be obtained.
* This description always operates with cached data and thus it is better to use it for performance reasons
* All set* calls to the read-only description result in the {@link WriteAccessException}
- *
+ *
* When the writable description is requested, the description copy is created.
* Changes to this description will not be reflected/used by the core and Build System untill the
* {@link #setProjectDescription(IProject, ICProjectDescription)} is called
*
- * Each getProjectDescription(project, true) returns a new copy of the project description
- *
+ * Each getProjectDescription(project, true) returns a new copy of the project description
+ *
* The writable description uses the cached data untill the first set call
* after that the description communicates directly to the Build System
* i.e. the implementer of the org.eclipse.cdt.core.CConfigurationDataProvider extension
* This ensures the Core<->Build System settings integrity
- *
+ *
* @return {@link ICProjectDescription} or null if the project does not contain the
- * CDT data associated with it.
+ * CDT data associated with it.
*/
public ICProjectDescription getProjectDescription(IProject project, boolean write){
return fNewCProjectDescriptionManager.getProjectDescription(project, write);
@@ -1261,17 +1267,17 @@ public class CCorePlugin extends Plugin {
/**
* forces the cached data of the specified projects to be re-calculated.
- * if the projects
argument is null
al projects
+ * if the projects
argument is null
al projects
* within the workspace are updated
- *
+ *
* @param projects
* @param monitor
- * @throws CoreException
+ * @throws CoreException
*/
public void updateProjectDescriptions(IProject projects[], IProgressMonitor monitor) throws CoreException{
fNewCProjectDescriptionManager.updateProjectDescriptions(projects, monitor);
}
-
+
/**
* Answers whether the given project is a new-style project, i.e. CConfigurationDataProvider-driven
*/
@@ -1285,18 +1291,18 @@ public class CCorePlugin extends Plugin {
public boolean isNewStyleProject(ICProjectDescription des){
return fNewCProjectDescriptionManager.isNewStyleProject(des);
}
-
+
public ICProjectDescriptionManager getProjectDescriptionManager(){
return fNewCProjectDescriptionManager;
}
-
+
/**
- * @return editable User-variable's supplier
+ * @return editable User-variable's supplier
*/
public static IUserVarSupplier getUserVarSupplier() {
return UserVarSupplier.getInstance();
}
-
+
// NON-API
/**
@@ -1306,14 +1312,14 @@ public class CCorePlugin extends Plugin {
super();
fgCPlugin = this;
}
-
+
/**
* @noreference This method is not intended to be referenced by clients.
*/
public static void log(String e) {
log(createStatus(e));
}
-
+
/**
* @noreference This method is not intended to be referenced by clients.
*/
@@ -1325,13 +1331,13 @@ public class CCorePlugin extends Plugin {
log("Error: " + msg, e); //$NON-NLS-1$
}
}
-
+
/**
* @noreference This method is not intended to be referenced by clients.
*/
public static void log(String message, Throwable e) {
Throwable nestedException;
- if (e instanceof CModelException
+ if (e instanceof CModelException
&& (nestedException = ((CModelException)e).getException()) != null) {
e = nestedException;
}
@@ -1351,14 +1357,14 @@ public class CCorePlugin extends Plugin {
public static IStatus createStatus(String msg, Throwable e) {
return new Status(IStatus.ERROR, PLUGIN_ID, msg, e);
}
-
+
/**
* @noreference This method is not intended to be referenced by clients.
*/
public static void log(IStatus status) {
getDefault().getLog().log(status);
}
-
+
/**
* @deprecated use getIndexManager().
* @noreference This method is not intended to be referenced by clients.
@@ -1371,7 +1377,7 @@ public class CCorePlugin extends Plugin {
/**
* Returns preference controlling whether source roots are shown at the top of projects
* or embedded within the resource tree of projects when they are not top level folders.
- *
+ *
* @return boolean preference value
* @since 5.2
*/
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CProjectNature.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CProjectNature.java
index 53632d51c3c..980fe8a4124 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CProjectNature.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CProjectNature.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* QNX Software Systems - Initial API and implementation
* IBM Corporation
@@ -50,7 +50,7 @@ public class CProjectNature implements IProjectNature {
/**
* Utility method for adding a nature to a project.
- *
+ *
* @param project
* the project to add the nature
* @param natureId
@@ -58,7 +58,7 @@ public class CProjectNature implements IProjectNature {
* @param monitor
* a progress monitor to indicate the duration of the operation,
* or null
if progress reporting is not required.
- *
+ *
*/
public static void addNature(IProject project, String natureId, IProgressMonitor monitor) throws CoreException {
try {
@@ -77,11 +77,11 @@ public class CProjectNature implements IProjectNature {
description.setNatureIds(newNatures);
project.setDescription(description, monitor);
}
-
+
catch (CoreException e) {
CCorePlugin.log(e);
}
-
+
finally {
monitor.done();
}
@@ -89,7 +89,7 @@ public class CProjectNature implements IProjectNature {
/**
* Utility method for removing a project nature from a project.
- *
+ *
* @param project
* the project to remove the nature from
* @param natureId
@@ -110,18 +110,21 @@ public class CProjectNature implements IProjectNature {
/**
* @see IProjectNature#configure
*/
+ @Override
public void configure() throws CoreException {
}
/**
* @see IProjectNature#deconfigure
*/
+ @Override
public void deconfigure() throws CoreException {
}
/**
* @see IProjectNature#getProject
*/
+ @Override
public IProject getProject() {
return fProject;
}
@@ -129,6 +132,7 @@ public class CProjectNature implements IProjectNature {
/**
* @see IProjectNature#setProject
*/
+ @Override
public void setProject(IProject project) {
fProject = project;
}
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncher.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncher.java
index 40c43625fd2..a0f99e68736 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncher.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CommandLauncher.java
@@ -32,7 +32,7 @@ public class CommandLauncher implements ICommandLauncher {
public final static int ILLEGAL_COMMAND = ICommandLauncher.ILLEGAL_COMMAND;
public final static int OK = ICommandLauncher.OK;
-
+
protected Process fProcess;
protected boolean fShowCommand;
protected String[] fCommandArgs;
@@ -61,6 +61,7 @@ public class CommandLauncher implements ICommandLauncher {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.ICommandLauncher#showCommand(boolean)
*/
+ @Override
public void showCommand(boolean show) {
fShowCommand = show;
}
@@ -68,6 +69,7 @@ public class CommandLauncher implements ICommandLauncher {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.ICommandLauncher#getErrorMessage()
*/
+ @Override
public String getErrorMessage() {
return fErrorMessage;
}
@@ -75,6 +77,7 @@ public class CommandLauncher implements ICommandLauncher {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.ICommandLauncher#setErrorMessage(java.lang.String)
*/
+ @Override
public void setErrorMessage(String error) {
fErrorMessage = error;
}
@@ -82,6 +85,7 @@ public class CommandLauncher implements ICommandLauncher {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.ICommandLauncher#getCommandArgs()
*/
+ @Override
public String[] getCommandArgs() {
return fCommandArgs;
}
@@ -89,6 +93,7 @@ public class CommandLauncher implements ICommandLauncher {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.ICommandLauncher#getEnvironment()
*/
+ @Override
public Properties getEnvironment() {
return EnvironmentReader.getEnvVars();
}
@@ -96,6 +101,7 @@ public class CommandLauncher implements ICommandLauncher {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.ICommandLauncher#getCommandLine()
*/
+ @Override
public String getCommandLine() {
return getCommandLine(getCommandArgs());
}
@@ -119,12 +125,12 @@ public class CommandLauncher implements ICommandLauncher {
try {
// add platform specific arguments (shell invocation)
fCommandArgs = constructCommandArray(commandPath.toOSString(), args);
-
+
File file = null;
-
+
if(changeToDirectory != null)
file = changeToDirectory.toFile();
-
+
fProcess = ProcessFactory.getFactory().exec(fCommandArgs, env, file);
fErrorMessage = ""; //$NON-NLS-1$
} catch (IOException e) {
@@ -133,21 +139,22 @@ public class CommandLauncher implements ICommandLauncher {
}
return fProcess;
}
-
+
/**
* @since 5.1
* @see org.eclipse.cdt.core.ICommandLauncher#execute(IPath, String[], String[], IPath, IProgressMonitor)
*/
+ @Override
public Process execute(IPath commandPath, String[] args, String[] env, IPath changeToDirectory, IProgressMonitor monitor) throws CoreException {
try {
// add platform specific arguments (shell invocation)
fCommandArgs = constructCommandArray(commandPath.toOSString(), args);
-
+
File file = null;
-
+
if(changeToDirectory != null)
file = changeToDirectory.toFile();
-
+
fProcess = ProcessFactory.getFactory().exec(fCommandArgs, env, file);
fErrorMessage = ""; //$NON-NLS-1$
} catch (IOException e) {
@@ -160,6 +167,7 @@ public class CommandLauncher implements ICommandLauncher {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.ICommandLauncher#waitAndRead(java.io.OutputStream, java.io.OutputStream)
*/
+ @Override
public int waitAndRead(OutputStream out, OutputStream err) {
if (fShowCommand) {
printCommandLine(out);
@@ -177,6 +185,7 @@ public class CommandLauncher implements ICommandLauncher {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.ICommandLauncher#waitAndRead(java.io.OutputStream, java.io.OutputStream, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public int waitAndRead(OutputStream output, OutputStream err, IProgressMonitor monitor) {
if (fShowCommand) {
printCommandLine(output);
@@ -237,11 +246,12 @@ public class CommandLauncher implements ICommandLauncher {
return buf.toString();
}
-
+
/**
* @since 5.1
* @see org.eclipse.cdt.core.ICommandLauncher#getProject()
*/
+ @Override
public IProject getProject() {
return fProject;
}
@@ -250,6 +260,7 @@ public class CommandLauncher implements ICommandLauncher {
* @since 5.1
* @see org.eclipse.cdt.core.ICommandLauncher#setProject(org.eclipse.core.resources.IProject)
*/
+ @Override
public void setProject(IProject project) {
fProject = project;
}
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ErrorParserManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ErrorParserManager.java
index 862c790ea04..65ea2af5837 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ErrorParserManager.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/ErrorParserManager.java
@@ -4,13 +4,13 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Sergey Prigogin (Google)
* James Blackburn (Broadcom) - Bug 247838
* Andrew Gvozdev (Quoin Inc)
- * Dmitry Kozlov (CodeSourcery) - Build error highlighting and navigation
+ * Dmitry Kozlov (CodeSourcery) - Build error highlighting and navigation
*******************************************************************************/
package org.eclipse.cdt.core;
@@ -43,11 +43,11 @@ import org.eclipse.core.runtime.URIUtil;
import org.osgi.service.prefs.BackingStoreException;
/**
- * The purpose of ErrorParserManager is to delegate the work of error parsing
+ * The purpose of ErrorParserManager is to delegate the work of error parsing
* build output to {@link IErrorParser}s, assist in finding {@link IResource}s, and
* help create appropriate error/warning/info markers to be displayed
* by the Problems view.
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
*/
public class ErrorParserManager extends OutputStream {
@@ -58,7 +58,7 @@ public class ErrorParserManager extends OutputStream {
*/
@Deprecated
public final static String PREF_ERROR_PARSER = CCorePlugin.PLUGIN_ID + ".errorOutputParser"; //$NON-NLS-1$
-
+
/**
* Delimiter for error parsers presented in one string.
* @since 5.2
@@ -93,7 +93,7 @@ public class ErrorParserManager extends OutputStream {
/**
* Constructor.
- *
+ *
* @param builder - project builder.
*/
public ErrorParserManager(ACBuilder builder) {
@@ -102,7 +102,7 @@ public class ErrorParserManager extends OutputStream {
/**
* Constructor.
- *
+ *
* @param project - project being built.
* @param markerGenerator - marker generator able to create markers.
*/
@@ -112,7 +112,7 @@ public class ErrorParserManager extends OutputStream {
/**
* Constructor.
- *
+ *
* @param project - project being built.
* @param markerGenerator - marker generator able to create markers.
* @param parsersIDs - array of error parsers' IDs.
@@ -123,24 +123,24 @@ public class ErrorParserManager extends OutputStream {
/**
* Constructor.
- *
+ *
* @param project - project being built.
- * @param workingDirectory - IPath location of the working directory of where the build is performed.
+ * @param workingDirectory - IPath location of the working directory of where the build is performed.
* @param markerGenerator - marker generator able to create markers.
* @param parsersIDs - array of error parsers' IDs.
* @deprecated use {@link #ErrorParserManager(IProject, URI, IMarkerGenerator, String[])} instead
*/
@Deprecated
public ErrorParserManager(IProject project, IPath workingDirectory, IMarkerGenerator markerGenerator, String[] parsersIDs) {
- this(project, (workingDirectory == null || workingDirectory.isEmpty()) ? null : org.eclipse.core.filesystem.URIUtil.toURI(workingDirectory),
+ this(project, (workingDirectory == null || workingDirectory.isEmpty()) ? null : org.eclipse.core.filesystem.URIUtil.toURI(workingDirectory),
markerGenerator, parsersIDs);
}
/**
* URI based constructor.
- *
+ *
* @param project - project being built.
- * @param baseDirectoryURI - absolute location URI of working directory of where the build is performed.
+ * @param baseDirectoryURI - absolute location URI of working directory of where the build is performed.
* @param markerGenerator - marker generator able to create markers.
* @param parsersIDs - array of error parsers' IDs.
* @since 5.1
@@ -205,7 +205,7 @@ public class ErrorParserManager extends OutputStream {
* {@link #pushDirectory} and {@link #popDirectory} are used to change working directory
* from where file name is searched (see {@link #findFileInWorkspace}).
* The intention is to handle make output of commands "pushd dir" and "popd".
- *
+ *
* @param dir - another directory level to keep in stack -- corresponding to 'pushd'.
*/
public void pushDirectory(IPath dir) {
@@ -227,7 +227,7 @@ public class ErrorParserManager extends OutputStream {
* {@link #pushDirectoryURI} and {@link #popDirectoryURI} are used to change working directory
* from where file name is searched (see {@link #findFileInWorkspace}).
* The intention is to handle make output of commands "pushd dir" and "popd".
- *
+ *
* @param dir - another directory level to keep in stack -- corresponding to 'pushd'.
* @since 5.1
*/
@@ -244,7 +244,7 @@ public class ErrorParserManager extends OutputStream {
* {@link #pushDirectory} and {@link #popDirectory} are used to change working directory
* from where file name is searched (see {@link #findFileInWorkspace}).
* The intention is to handle make output of commands "pushd" and "popd".
- *
+ *
* @return previous build directory location corresponding 'popd' command.
* @deprecated use {@link #popDirectoryURI()} instead
*/
@@ -257,7 +257,7 @@ public class ErrorParserManager extends OutputStream {
* {@link #pushDirectoryURI(URI)} and {@link #popDirectoryURI()} are used to change working directory
* from where file name is searched (see {@link #findFileInWorkspace(IPath)}).
* The intention is to handle make output of commands "pushd" and "popd".
- *
+ *
* @return previous build directory location corresponding 'popd' command.
* @since 5.1
*/
@@ -284,13 +284,14 @@ public class ErrorParserManager extends OutputStream {
* kept by {@code ErrorParserManager}.
* @param parent - project.
* @param result - resulting collection of files.
- *
+ *
* @deprecated Use {@link #findFileName} for searches.
*/
@Deprecated
protected void collectFiles(IProject parent, final List result) {
try {
parent.accept(new IResourceProxyVisitor() {
+ @Override
public boolean visit(IResourceProxy proxy) {
if (proxy.getType() == IResource.FILE) {
result.add(proxy.requestResource());
@@ -312,7 +313,7 @@ public class ErrorParserManager extends OutputStream {
lineCounter++;
ProblemMarkerInfo marker=null;
-
+
outer:
for (IErrorParser[] parsers : fErrorParsers.values()) {
for (IErrorParser parser : parsers) {
@@ -363,21 +364,21 @@ outer:
}
outputLine(line, marker);
}
-
- /**
- * Conditionally output line to outputStream. If stream
+
+ /**
+ * Conditionally output line to outputStream. If stream
* supports error markers, use it, otherwise use conventional stream
*/
private void outputLine(String line, ProblemMarkerInfo marker) {
String l = line + "\n"; //$NON-NLS-1$
- if ( outputStream == null ) return;
+ if ( outputStream == null ) return;
try {
if ( marker != null && outputStream instanceof IErrorMarkeredOutputStream ) {
IErrorMarkeredOutputStream s = (IErrorMarkeredOutputStream) outputStream;
s.write(l, marker);
- } else {
+ } else {
byte[] b = l.getBytes();
- outputStream.write(b, 0, b.length);
+ outputStream.write(b, 0, b.length);
}
} catch (IOException e) {
CCorePlugin.log(e);
@@ -409,7 +410,7 @@ outer:
* @return - file in the workspace or {@code null}.
*/
public IFile findFileName(String partialLoc) {
- if (partialLoc.equals(cachedFileName) && cachedWorkingDirectory != null &&
+ if (partialLoc.equals(cachedFileName) && cachedWorkingDirectory != null &&
org.eclipse.core.filesystem.URIUtil.equals(getWorkingDirectoryURI(), cachedWorkingDirectory))
return cachedFile;
@@ -452,7 +453,7 @@ outer:
/**
* Find exact match in the workspace. If path is not absolute search is done in working directory.
- *
+ *
* @param path - file path.
* @return - file in the workspace or {@code null} if such a file doesn't exist
*/
@@ -472,7 +473,7 @@ outer:
/**
* Find exact match in the workspace. If path is not absolute search is done in the current working directory.
- *
+ *
* @param uri - absolute or relative URI to resolve.
* @return - file in the workspace or {@code null} if such a file doesn't exist
* @since 5.1
@@ -490,7 +491,7 @@ outer:
/**
* @param fileName - file name.
* @return {@code true} if the project contains more than one file with the given name.
- *
+ *
* @deprecated Use {@link #findFileName} for searches.
*/
@Deprecated
@@ -501,11 +502,11 @@ outer:
/**
* Called by the error parsers to find an IFile for a given
* external filesystem 'location'
- *
+ *
* @param filePath - file path.
- * @return IFile representing the external location, or null if one
+ * @return IFile representing the external location, or null if one
* couldn't be found.
- *
+ *
* @deprecated Use {@link #findFileName} for searches.
*/
@Deprecated
@@ -542,7 +543,7 @@ outer:
/**
* Add marker to the list of error markers.
- *
+ *
* @param file - resource to add the new marker.
* @param lineNumber - line number of the error.
* @param desc - description of the error.
@@ -555,7 +556,7 @@ outer:
/**
* Add marker to the list of error markers.
- *
+ *
* @param file - resource to add the new marker.
* @param lineNumber - line number of the error.
* @param desc - description of the error.
@@ -574,7 +575,7 @@ outer:
/**
* Add the given marker to the list of error markers.
- *
+ *
* @param problemMarkerInfo - The marker to be added.
* @since 5.4
*/
@@ -596,7 +597,7 @@ outer:
/**
* Method setOutputStream.
* Note: you have to close this stream explicitly
- * don't rely on ErrorParserManager.close().
+ * don't rely on ErrorParserManager.close().
* @param os - output stream
*/
public void setOutputStream(OutputStream os) {
@@ -604,9 +605,9 @@ outer:
}
/**
- * Method getOutputStream.
+ * Method getOutputStream.
* Note: you have to close this stream explicitly
- * don't rely on ErrorParserManager.close().
+ * don't rely on ErrorParserManager.close().
* @return OutputStream
*/
public OutputStream getOutputStream() {
@@ -616,8 +617,8 @@ outer:
/**
* @see java.io.OutputStream#close()
- * Note: don't rely on this method to close underlying OutputStream,
- * close it explicitly
+ * Note: don't rely on this method to close underlying OutputStream,
+ * close it explicitly
*/
@Override
public synchronized void close() throws IOException {
@@ -660,7 +661,7 @@ outer:
// This method examines contents of currentLine buffer
// if it contains whole line this line is checked by error
- // parsers (processLine method).
+ // parsers (processLine method).
// If flush is true rest of line is checked by error parsers.
private void checkLine(boolean flush) {
String buffer = currentLine.toString();
@@ -688,7 +689,7 @@ outer:
/**
* @deprecated as of 5.2. This method is no longer reporting problems.
* The problem markers are generated after processing each line.
- *
+ *
* @return {@code true} if detected a problem indicating that build failed.
* The semantics of the return code is inconsistent. As far as build is concerned
* there is no difference between errors
@@ -720,7 +721,7 @@ outer:
// On Windows "C:/folder/" -> "/C:/folder/"
if (path.isAbsolute() && uriString.charAt(0) != IPath.SEPARATOR)
uriString = IPath.SEPARATOR + uriString;
-
+
return EFSExtensionManager.getDefault().createNewURIFromPath(baseURI, uriString);
}
@@ -752,7 +753,7 @@ outer:
/**
* @return {@code true} if errors attributed to resources detected
- *
+ *
* @deprecated The semantics of this function is inconsistent. As far as build is concerned
* there is no difference between errors
* {@link IMarkerGenerator#SEVERITY_ERROR_RESOURCE} and
@@ -837,7 +838,7 @@ outer:
public static IErrorParserNamed getErrorParserExtensionCopy(String id) {
return ErrorParserExtensionManager.getErrorParserCopy(id, true);
}
-
+
/**
* @param ids - array of error parser IDs
* @return error parser IDs delimited with error parser delimiter ";"
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IAddress.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IAddress.java
index 52e9f972a77..13e94048c90 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IAddress.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/IAddress.java
@@ -14,35 +14,35 @@ package org.eclipse.cdt.core;
import java.math.BigInteger;
/**
- * Represents C/C++ address in CDT. All implementors of this interface should be
- * immutable, i.e. all methods should not modify objects, they should return
+ * Represents C/C++ address in CDT. All implementors of this interface should be
+ * immutable, i.e. all methods should not modify objects, they should return
* new object.
- *
- * Please see Addr32 and Addr64 classes to see how this interface should
+ *
+ * Please see Addr32 and Addr64 classes to see how this interface should
* be extended
*/
public interface IAddress extends Comparable {
/**
- * Adds offset to address and returns new address object
- * which is the result
+ * Adds offset to address and returns new address object
+ * which is the result
* @param offset to add
* @return the new address
*/
IAddress add(BigInteger offset);
-
+
/**
- * Adds offset to address and returns new address object
- * which is the result
- * Note: This method has an offset limit of Long.MAX and Long.MIN, which under some addressing schems
+ * Adds offset to address and returns new address object
+ * which is the result
+ * Note: This method has an offset limit of Long.MAX and Long.MIN, which under some addressing schems
* may impose an unnesseary limitation, see IAddressa.add(BigInteger offset)
to handle larger offsets.
* @param offset to add
* @return the new address
*/
IAddress add(long offset);
-
+
/**
- * Returns maximal offset possible for address. The offset
- * should be Identicall for all addresses of given class.
+ * Returns maximal offset possible for address. The offset
+ * should be Identicall for all addresses of given class.
* @return the max offset for this address class
*/
BigInteger getMaxOffset();
@@ -53,12 +53,12 @@ public interface IAddress extends Comparable {
* @return distance to address
*/
BigInteger distanceTo(IAddress other);
-
+
/**
* Returns the value of the address.
*/
BigInteger getValue();
-
+
/**
* Returns whether this address equals the given object.
*
@@ -66,8 +66,9 @@ public interface IAddress extends Comparable {
* @return true
if the addresses are equivalent,
* and false
if they are not
*/
+ @Override
boolean equals(Object addr);
-
+
/**
* Return true if address is zero, i.e. minimal possible
* @return true is address is zero
@@ -79,7 +80,7 @@ public interface IAddress extends Comparable {
* @return true if address is maximal
*/
boolean isMax();
-
+
/**
* Converts address to string as an unsigned number with given radix
* @param radix to use for strng conversion
@@ -91,38 +92,39 @@ public interface IAddress extends Comparable {
* Identical to toString(10)
* @return a string representation of address using a radix of 10
*/
+ @Override
String toString();
/**
- * Converts address to the hex representation with '0x' prefix and
- * with all leading zeros. The length of returned string should be
- * the same for all addresses of given class. I.e. 10 for 32-bit
+ * Converts address to the hex representation with '0x' prefix and
+ * with all leading zeros. The length of returned string should be
+ * the same for all addresses of given class. I.e. 10 for 32-bit
* addresses and 18 for 64-bit addresses
*/
String toHexAddressString();
/**
- * Converts address to the binary representation with '0b' prefix and
- * with all leading zeros. The length of returned string should be
- * the same for all addresses of given class. I.e. 34 for 32-bit
+ * Converts address to the binary representation with '0b' prefix and
+ * with all leading zeros. The length of returned string should be
+ * the same for all addresses of given class. I.e. 34 for 32-bit
* addresses and 66 for 64-bit addresses
*/
String toBinaryAddressString();
/**
- * Returns amount of symbols in hex representation. Is identical to
+ * Returns amount of symbols in hex representation. Is identical to
* toHexAddressString().length(). It is present for perfomance purpose.
- *
+ *
* @return the nmber os chararcter symbols to represent this address in hex.
*/
int getCharsNum();
-
+
/**
* Returns the address size in bytes.
- *
- * @return the number of bytes required to hold this address.
+ *
+ * @return the number of bytes required to hold this address.
*/
int getSize();
-
+
}
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/cdtvariables/CdtVariable.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/cdtvariables/CdtVariable.java
index 1c499322fe6..3249989761f 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/cdtvariables/CdtVariable.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/cdtvariables/CdtVariable.java
@@ -16,7 +16,7 @@ import org.eclipse.cdt.utils.cdtvariables.CdtVariableResolver;
/**
* This is the trivial implementation of the IBuildMacro used internaly by the MBS
- *
+ *
* @since 3.0
*/
public class CdtVariable implements ICdtVariable {
@@ -26,7 +26,7 @@ public class CdtVariable implements ICdtVariable {
protected String fStringListValue[];
protected CdtVariable(){
-
+
}
public CdtVariable(String name, int type, String value){
@@ -40,7 +40,7 @@ public class CdtVariable implements ICdtVariable {
fType = type;
fStringListValue = value;
}
-
+
public CdtVariable(ICdtVariable var){
fName = var.getName();
fType = var.getValueType();
@@ -56,6 +56,7 @@ public class CdtVariable implements ICdtVariable {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacro#getName()
*/
+ @Override
public String getName() {
return fName;
}
@@ -63,6 +64,7 @@ public class CdtVariable implements ICdtVariable {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacro#getMacroValueType()
*/
+ @Override
public int getValueType() {
return fType;
}
@@ -70,16 +72,18 @@ public class CdtVariable implements ICdtVariable {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacro#getStringValue()
*/
+ @Override
public String getStringValue() throws CdtVariableException {
if(CdtVariableResolver.isStringListVariable(fType))
throw new CdtVariableException(ICdtVariableStatus.TYPE_MACRO_NOT_STRING,fName,null,fName);
-
+
return fStringValue;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacro#getStringListValue()
*/
+ @Override
public String[] getStringListValue() throws CdtVariableException {
if(!CdtVariableResolver.isStringListVariable(fType))
throw new CdtVariableException(ICdtVariableStatus.TYPE_MACRO_NOT_STRINGLIST,fName,null,fName);
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/cdtvariables/CdtVariableStatus.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/cdtvariables/CdtVariableStatus.java
index 4fe7f5e0884..6b8e83af898 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/cdtvariables/CdtVariableStatus.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/cdtvariables/CdtVariableStatus.java
@@ -15,8 +15,8 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
/**
- * This class implements the IBuildMacroStatus interface
- *
+ * This class implements the IBuildMacroStatus interface
+ *
* @since 3.0
*/
public class CdtVariableStatus extends Status implements ICdtVariableStatus {
@@ -29,7 +29,7 @@ public class CdtVariableStatus extends Status implements ICdtVariableStatus {
// private static final String STATUS_MACRO_NOT_STRINGLIST = STATUS + ".macro.not.stringlist"; //$NON-NLS-1$
// private static final String STATUS_ERROR = STATUS + ".error"; //$NON-NLS-1$
// private static final String VALUE_UNDEFINED = PREFIX + ".value.undefined"; //$NON-NLS-1$
-
+
private String fMacroName;
private String fExpression;
private String fReferencedName;
@@ -38,23 +38,23 @@ public class CdtVariableStatus extends Status implements ICdtVariableStatus {
// private Object fContext;
/**
- *
+ *
* @param severity as documented in {@link IStatus}
* @param code as provided by {@link ICdtVariableStatus}.
* @param message message, can be null. In this case the default message will
* be generated base upon the other status info
* @param exception a low-level exception, or null
if not
- * applicable
+ * applicable
* @param macroName the name of the build macro whose resolution caused this status creation or null if none
* @param expression the string whose resolution caused this status creation or null if none
* @param referencedName the macro name referenced in the resolution string that caused this this status creation or null if none
*/
- public CdtVariableStatus(int severity,
- int code,
- String message,
- Throwable exception,
+ public CdtVariableStatus(int severity,
+ int code,
+ String message,
+ Throwable exception,
String macroName,
- String expression,
+ String expression,
String referencedName//,
// int contextType,
// Object contextData
@@ -73,22 +73,22 @@ public class CdtVariableStatus extends Status implements ICdtVariableStatus {
/**
* Creates status with the IStatus.ERROR severity
- *
+ *
* @param code one of the IBuildMacroStatus.TYPE_xxx statusses
* @param message message, can be null. In this case the default message will
* be generated base upon the other status info
* @param exception a low-level exception, or null
if not
- * applicable
+ * applicable
* @param macroName the name of the build macro whose resolution caused this status creation or null if none
* @param expression the string whose resolutinon caused caused this status creation or null if none
* @param referencedName the macro name referenced in the resolution string that caused this this status creation or null if none
*/
- public CdtVariableStatus(
- int code,
- String message,
- Throwable exception,
- String macroName,
- String expression,
+ public CdtVariableStatus(
+ int code,
+ String message,
+ Throwable exception,
+ String macroName,
+ String expression,
String referencedName//,
// int contextType,
// Object contextData
@@ -99,16 +99,16 @@ public class CdtVariableStatus extends Status implements ICdtVariableStatus {
/**
* Creates status with the IStatus.ERROR severity and with the default message
- *
+ *
* @param code one of the IBuildMacroStatus.TYPE_xxx statusses
* @param macroName the name of the build macro whose resolution caused this status creation or null if none
* @param expression the string whose resolutinon caused caused this status creation or null if none
* @param referencedName the macro name referenced in the resolution string that caused this this status creation or null if none
*/
- public CdtVariableStatus(
- int code,
- String macroName,
- String expression,
+ public CdtVariableStatus(
+ int code,
+ String macroName,
+ String expression,
String referencedName//,
// int contextType,
// Object contextData
@@ -118,7 +118,7 @@ public class CdtVariableStatus extends Status implements ICdtVariableStatus {
/**
* generates and returns the default status message based upon then status data
- *
+ *
* @return String
*/
protected String generateMessage(){
@@ -172,6 +172,7 @@ public class CdtVariableStatus extends Status implements ICdtVariableStatus {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacroStatus#getMacroName()
*/
+ @Override
public String getVariableName() {
return fMacroName;
}
@@ -179,6 +180,7 @@ public class CdtVariableStatus extends Status implements ICdtVariableStatus {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacroStatus#getExpression()
*/
+ @Override
public String getExpression() {
return fExpression;
}
@@ -186,6 +188,7 @@ public class CdtVariableStatus extends Status implements ICdtVariableStatus {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacroStatus#getReferencedName()
*/
+ @Override
public String getReferencedMacroName() {
return fReferencedName;
}
@@ -203,7 +206,7 @@ public class CdtVariableStatus extends Status implements ICdtVariableStatus {
// public Object getContextData() {
// return fContextData;
// }
-
-
+
+
}
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/dom/CDOM.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/dom/CDOM.java
index de52791e5c5..b12ab8d5661 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/dom/CDOM.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/dom/CDOM.java
@@ -22,10 +22,10 @@ import org.eclipse.core.resources.IStorage;
/**
* @author jcamelon
- *
+ *
* This class serves as the manager of the AST/DOM mechanisms for the CDT.
- * It should be eventually added to CCorePlugin for startup.
- *
+ * It should be eventually added to CCorePlugin for startup.
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
* @deprecated This class does not take into account language mappings. Use
@@ -33,19 +33,19 @@ import org.eclipse.core.resources.IStorage;
*/
@Deprecated
public class CDOM implements IASTServiceProvider {
-
+
/**
* Singleton - Constructor is private.
*/
- private CDOM()
+ private CDOM()
{
}
-
+
/**
* instance
is the singleton.
*/
private static CDOM instance = new CDOM();
-
+
/**
* accessor for singleton instance
* @return instance
@@ -54,34 +54,34 @@ public class CDOM implements IASTServiceProvider {
{
return instance;
}
-
- /**
- * Currently, only one AST Service is provided.
- */
- private IASTServiceProvider defaultService = new InternalASTServiceProvider();
-
+ /**
+ * Currently, only one AST Service is provided.
+ */
+ private IASTServiceProvider defaultService = new InternalASTServiceProvider();
+
+
/**
* @return IASTServiceProvider, the mechanism for obtaining an AST
*/
public IASTServiceProvider getASTService() {
- //CDOM itself is not so much "the" AST service as it acts as a proxy
+ //CDOM itself is not so much "the" AST service as it acts as a proxy
//to different AST services
//Should we see the need to provide an extension point for this
//rather than purely proxying the calls to IASTServiceProvider#*
- //we would have to do some discovery and co-ordination on behalf of the
+ //we would have to do some discovery and co-ordination on behalf of the
//client
return this;
}
-
+
/**
* Constant PARSE_SAVED_RESOURCES
- Parse saved resources in the workspace
*/
- public static final int PARSE_SAVED_RESOURCES = 0;
+ public static final int PARSE_SAVED_RESOURCES = 0;
/**
* Constant PARSE_WORKING_COPY_WITH_SAVED_INCLUSIONS
- Parse working copy for
- * translation unit, saved resources for all header files.
+ * translation unit, saved resources for all header files.
*/
public static final int PARSE_WORKING_COPY_WITH_SAVED_INCLUSIONS = 1;
/**
@@ -89,26 +89,26 @@ public class CDOM implements IASTServiceProvider {
* header files and the file in question as a translation unit.
*/
public static final int PARSE_WORKING_COPY_WHENEVER_POSSIBLE = 2;
-
-
+
+
/**
* provider
is registered by the UI as a IWorkingCopyProvider.
*/
private IWorkingCopyProvider provider;
-
+
/**
* This is the factory function that returns an ICodeReaderFactory instance based upon the key provided.
- *
+ *
* @param key one of PARSE_SAVED_RESOURCES, PARSE_WORKING_COPY_WITH_SAVED_INCLUSIONS, PARSE_WORKING_COPY_WHENEVER_POSSIBLE
* @return an implementation that works according to the key specified or null for an invalid key
*/
public ICodeReaderFactory getCodeReaderFactory( int key )
{
- //TODO - eventually these factories will need to hook into the
+ //TODO - eventually these factories will need to hook into the
//CodeReader caches
switch( key )
{
- case PARSE_SAVED_RESOURCES:
+ case PARSE_SAVED_RESOURCES:
return SavedCodeReaderFactory.getInstance();
case PARSE_WORKING_COPY_WITH_SAVED_INCLUSIONS:
return new PartialWorkingCopyCodeReaderFactory(provider, null);
@@ -121,65 +121,74 @@ public class CDOM implements IASTServiceProvider {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.IASTServiceProvider#getTranslationUnit(org.eclipse.core.resources.IFile)
*/
- public IASTTranslationUnit getTranslationUnit(IFile fileToParse) throws UnsupportedDialectException {
+ @Override
+ public IASTTranslationUnit getTranslationUnit(IFile fileToParse) throws UnsupportedDialectException {
//TODO - At this time, we purely delegate blindly
- //In the future, we may need to delegate based upon context provided
+ //In the future, we may need to delegate based upon context provided
return defaultService.getTranslationUnit(fileToParse);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.IASTServiceProvider#getTranslationUnit(org.eclipse.core.resources.IFile, org.eclipse.cdt.core.dom.ICodeReaderFactory)
*/
- public IASTTranslationUnit getTranslationUnit(IFile fileToParse, ICodeReaderFactory fileCreator) throws UnsupportedDialectException {
+ @Override
+ public IASTTranslationUnit getTranslationUnit(IFile fileToParse, ICodeReaderFactory fileCreator) throws UnsupportedDialectException {
//TODO - At this time, we purely delegate blindly
- //In the future, we may need to delegate based upon context provided
+ //In the future, we may need to delegate based upon context provided
return defaultService.getTranslationUnit(fileToParse, fileCreator );
}
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.IASTServiceProvider#getTranslationUnit(org.eclipse.core.resources.IFile, org.eclipse.cdt.core.dom.ICodeReaderFactory, org.eclipse.cdt.core.dom.IParserConfiguration)
*/
- public IASTTranslationUnit getTranslationUnit(IFile fileToParse, ICodeReaderFactory fileCreator, IParserConfiguration configuration) throws UnsupportedDialectException {
+ @Override
+ public IASTTranslationUnit getTranslationUnit(IFile fileToParse, ICodeReaderFactory fileCreator, IParserConfiguration configuration) throws UnsupportedDialectException {
//TODO - At this time, we purely delegate blindly
- //In the future, we may need to delegate based upon context provided
+ //In the future, we may need to delegate based upon context provided
return defaultService.getTranslationUnit(fileToParse, fileCreator, configuration );
}
-
- public IASTCompletionNode getCompletionNode(IFile fileToParse, int offset,
+
+ @Override
+ public IASTCompletionNode getCompletionNode(IFile fileToParse, int offset,
ICodeReaderFactory fileCreator) throws UnsupportedDialectException {
//TODO - At this time, we purely delegate blindly
- //In the future, we may need to delegate based upon context provided
+ //In the future, we may need to delegate based upon context provided
return defaultService.getCompletionNode(fileToParse, offset, fileCreator);
}
- public IASTCompletionNode getCompletionNode(IStorage fileToParse, IProject project, int offset,
+ @Override
+ public IASTCompletionNode getCompletionNode(IStorage fileToParse, IProject project, int offset,
ICodeReaderFactory fileCreator) throws UnsupportedDialectException {
//TODO - At this time, we purely delegate blindly
- //In the future, we may need to delegate based upon context provided
+ //In the future, we may need to delegate based upon context provided
return defaultService.getCompletionNode(fileToParse, project, offset, fileCreator);
}
/**
* This method allows a UI component to register its IWorkingCopyProvider to the CDOM.
- *
+ *
* @param workingCopyProvider - UI components buffer manager
*/
public void setWorkingCopyProvider(IWorkingCopyProvider workingCopyProvider) {
this.provider = workingCopyProvider;
}
- public IASTTranslationUnit getTranslationUnit(IStorage fileToParse, IProject project, ICodeReaderFactory fileCreator) throws UnsupportedDialectException {
+ @Override
+ public IASTTranslationUnit getTranslationUnit(IStorage fileToParse, IProject project, ICodeReaderFactory fileCreator) throws UnsupportedDialectException {
return defaultService.getTranslationUnit( fileToParse, project, fileCreator );
}
- public IASTTranslationUnit getTranslationUnit(IStorage fileToParse, IProject project) throws UnsupportedDialectException {
+ @Override
+ public IASTTranslationUnit getTranslationUnit(IStorage fileToParse, IProject project) throws UnsupportedDialectException {
return defaultService.getTranslationUnit( fileToParse, project );
}
+ @Override
public IASTTranslationUnit getTranslationUnit(IFile fileToParse, boolean parseComments) throws UnsupportedDialectException {
return defaultService.getTranslationUnit(fileToParse, parseComments);
}
+ @Override
public IASTTranslationUnit getTranslationUnit(IFile fileToParse, ICodeReaderFactory fileCreator, boolean parseComments) throws UnsupportedDialectException {
return defaultService.getTranslationUnit(fileToParse, fileCreator, parseComments);
}
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/envvar/EnvironmentVariable.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/envvar/EnvironmentVariable.java
index 1d60dd5944d..624a41602e5 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/envvar/EnvironmentVariable.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/envvar/EnvironmentVariable.java
@@ -19,7 +19,7 @@ import org.eclipse.cdt.internal.core.envvar.EnvironmentVariableManager;
/**
* A trivial implementation of {@link IEnvironmentVariable}
- *
+ *
* @since 3.0
*/
public class EnvironmentVariable implements IEnvironmentVariable, Cloneable {
@@ -27,7 +27,7 @@ public class EnvironmentVariable implements IEnvironmentVariable, Cloneable {
protected String fValue;
protected String fDelimiter;
protected int fOperation;
-
+
public EnvironmentVariable(String name, String value, int op, String delimiter) {
fName = SafeStringInterner.safeIntern(name);
fOperation = op;
@@ -45,31 +45,35 @@ public class EnvironmentVariable implements IEnvironmentVariable, Cloneable {
public EnvironmentVariable(String name){
this(name,null,ENVVAR_REPLACE,null);
}
-
+
public EnvironmentVariable(String name, String value){
- this(name,value,ENVVAR_REPLACE,null);
+ this(name,value,ENVVAR_REPLACE,null);
}
public EnvironmentVariable(String name, String value, String delimiter){
- this(name,value,ENVVAR_REPLACE,delimiter);
- }
-
- public EnvironmentVariable(IEnvironmentVariable var){
- this(var.getName(),var.getValue(),var.getOperation(),var.getDelimiter());
+ this(name,value,ENVVAR_REPLACE,delimiter);
}
+ public EnvironmentVariable(IEnvironmentVariable var){
+ this(var.getName(),var.getValue(),var.getOperation(),var.getDelimiter());
+ }
+
+ @Override
public String getName(){
return fName;
}
+ @Override
public String getValue(){
return fValue;
}
+ @Override
public int getOperation(){
return fOperation;
}
+ @Override
public String getDelimiter(){
return fDelimiter;
}
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/errorparsers/AbstractErrorParser.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/errorparsers/AbstractErrorParser.java
index 05fef4b509a..1e5c57799f9 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/errorparsers/AbstractErrorParser.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/errorparsers/AbstractErrorParser.java
@@ -20,16 +20,17 @@ import org.eclipse.cdt.core.IErrorParser;
*/
public class AbstractErrorParser implements IErrorParser {
private ErrorPattern[] patterns;
-
+
protected AbstractErrorParser(ErrorPattern[] patterns) {
this.patterns = patterns;
}
-
+
/**
* @param line - line of the input
* @param manager - error parsers manager
* @return true if error parser recognized and accepted line, false otherwise
*/
+ @Override
public boolean processLine(String line, ErrorParserManager manager) {
for (int i = 0; i < patterns.length; ++i) {
if (patterns[i].processLine(line, manager))
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/errorparsers/ErrorParserNamedWrapper.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/errorparsers/ErrorParserNamedWrapper.java
index bf43ffb47a6..57fb981e6b3 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/errorparsers/ErrorParserNamedWrapper.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/errorparsers/ErrorParserNamedWrapper.java
@@ -43,6 +43,7 @@ public class ErrorParserNamedWrapper implements IErrorParserNamed {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.IErrorParser#processLine(java.lang.String, org.eclipse.cdt.core.ErrorParserManager)
*/
+ @Override
public boolean processLine(String line, ErrorParserManager epm) {
return fErrorParser.processLine(line, epm);
}
@@ -50,6 +51,7 @@ public class ErrorParserNamedWrapper implements IErrorParserNamed {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.IErrorParserNamed#getId()
*/
+ @Override
public String getId() {
return fId;
}
@@ -57,6 +59,7 @@ public class ErrorParserNamedWrapper implements IErrorParserNamed {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.IErrorParserNamed#getName()
*/
+ @Override
public String getName() {
return fName;
}
@@ -71,6 +74,7 @@ public class ErrorParserNamedWrapper implements IErrorParserNamed {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.IErrorParserNamed#setId(java.lang.String)
*/
+ @Override
public void setId(String id) {
this.fId = id;
}
@@ -78,6 +82,7 @@ public class ErrorParserNamedWrapper implements IErrorParserNamed {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.IErrorParserNamed#setName(java.lang.String)
*/
+ @Override
public void setName(String name) {
this.fName = name;
}
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/errorparsers/RegexErrorParser.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/errorparsers/RegexErrorParser.java
index ed2841f6ad1..c4e125021db 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/errorparsers/RegexErrorParser.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/errorparsers/RegexErrorParser.java
@@ -61,6 +61,7 @@ public class RegexErrorParser implements IErrorParserNamed {
*
* @param id of error parser
*/
+ @Override
public void setId(String id) {
fId = id;
}
@@ -70,6 +71,7 @@ public class RegexErrorParser implements IErrorParserNamed {
*
* @param name of error parser
*/
+ @Override
public void setName(String name) {
fName = name;
}
@@ -110,6 +112,7 @@ public class RegexErrorParser implements IErrorParserNamed {
/**
* @return id of error parser
*/
+ @Override
public String getId() {
return fId;
}
@@ -117,6 +120,7 @@ public class RegexErrorParser implements IErrorParserNamed {
/**
* @return name of error parser
*/
+ @Override
public String getName() {
return fName;
}
@@ -137,6 +141,7 @@ public class RegexErrorParser implements IErrorParserNamed {
* @param epManager - error parsers manager
* @return true if error parser recognized and accepted line, false otherwise
*/
+ @Override
public boolean processLine(String line, ErrorParserManager epManager) {
for (RegexErrorPattern pattern : fPatterns)
try {
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/parser/CodeReaderCache.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/parser/CodeReaderCache.java
index 5a16eb8821d..fbdf808bca8 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/parser/CodeReaderCache.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/parser/CodeReaderCache.java
@@ -35,7 +35,7 @@ import org.eclipse.core.runtime.jobs.Job;
/**
* This is the CodeReaderBuffer used to cache CodeReaders for the ICodeReaderFactory
* when working with saved copies (primarily SavedCodeReaderFactory).
- *
+ *
* @author dsteffle
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
@@ -46,12 +46,12 @@ public class CodeReaderCache implements ICodeReaderCache {
* The string used to identify this CodeReaderCache. Mainly used for preferences.
*/
public static final String CODE_READER_BUFFER = CCorePlugin.PLUGIN_ID + ".codeReaderCache"; //$NON-NLS-1$
-
+
/**
* The default size of the cache in MB.
*/
public static final int DEFAULT_CACHE_SIZE_IN_MB = 64;
-
+
/**
* A String value of the default size of the cache.
*/
@@ -62,21 +62,21 @@ public class CodeReaderCache implements ICodeReaderCache {
private class UpdateCodeReaderCacheListener implements IResourceChangeListener {
ICodeReaderCache c = null;
-
+
/**
- * Create the UpdateCodeReaderCacheListener used to dispatch events to remove CodeReaders
+ * Create the UpdateCodeReaderCacheListener used to dispatch events to remove CodeReaders
* from the cache when a resource is changed and detected in Eclipse.
* @param cache
*/
public UpdateCodeReaderCacheListener(ICodeReaderCache cache) {
this.c = cache;
}
-
+
private class RemoveCacheJob extends Job {
private static final String REMOVE_CACHE = "Remove Cache"; //$NON-NLS-1$
ICodeReaderCache cache1 = null;
IResourceChangeEvent event = null;
-
+
/**
* Create a RemoveCacheJob used to run as a separate thread to remove a CodeReader from the cache.
*/
@@ -85,7 +85,7 @@ public class CodeReaderCache implements ICodeReaderCache {
this.cache1 = cache;
this.event = event;
}
-
+
@Override
protected IStatus run(IProgressMonitor monitor) {
if (event.getSource() instanceof IWorkspace && event.getDelta() != null) {
@@ -94,7 +94,7 @@ public class CodeReaderCache implements ICodeReaderCache {
event = null;
return Status.OK_STATUS;
}
-
+
private void removeKeys(IResourceDelta[] deltas) {
for (IResourceDelta delta : deltas) {
if (delta.getResource().getType() == IResource.PROJECT || delta.getResource().getType() == IResource.FOLDER) {
@@ -104,58 +104,60 @@ public class CodeReaderCache implements ICodeReaderCache {
}
}
}
-
+
private void removeKey(String key) {
if (key != null && cache1 != null)
cache1.remove(key);
}
-
+
}
-
+
/**
* Identifies when a resource was chaned and schedules a new RemoveCacheJob.
*/
+ @Override
public void resourceChanged(IResourceChangeEvent event) {
if (c instanceof CodeReaderCache)
new RemoveCacheJob(c, event).schedule();
}
}
-
+
/**
* Creates a CodeReaderCache and sets the size of the CodeReaderCache in MB. Creating a new
- * CodeReaderCache also adds an UpdateCodeReaderCacheListener to the workspace so that when
+ * CodeReaderCache also adds an UpdateCodeReaderCacheListener to the workspace so that when
* a resource is changed then the CodeReader for that resource is removed from this cache.
- *
+ *
* @param size initial size of the CodeReaderCache in terms of MB
*/
public CodeReaderCache(int size) {
cache = new CodeReaderLRUCache(size * MB_TO_KB_FACTOR);
}
-
+
@Override
protected void finalize() throws Throwable {
flush();
super.finalize();
}
-
+
/**
* Get a CodeReader from the cache. The key is the char[] filename of the CodeReader to retrieve.
* @param key the path of the CodeReader to retrieve
*/
+ @Override
public synchronized CodeReader get(String key) {
CodeReader result = null;
- if (cache.getSpaceLimit() > 0)
+ if (cache.getSpaceLimit() > 0)
result= cache.get(key);
-
+
if (result != null)
return result;
-
+
// for efficiency: check File.exists before ParserUtil#createReader()
// bug 100947 fix: don't want to attempt to create a code reader if there is no file for the key
final File jfile = new File(key);
if (!(jfile.exists()))
return null;
-
+
try {
IResource file = ParserUtil.getResourceForFilename(key);
if (file instanceof IFile) {
@@ -163,7 +165,7 @@ public class CodeReaderCache implements ICodeReaderCache {
result= InternalParserUtil.createWorkspaceFileReader(key, (IFile) file, cache);
}
result= InternalParserUtil.createExternalFileReader(key, cache);
- if (cache.getSpaceLimit() > 0)
+ if (cache.getSpaceLimit() > 0)
put(result);
return result;
@@ -173,29 +175,30 @@ public class CodeReaderCache implements ICodeReaderCache {
}
return null;
}
-
+
/**
- * @throws IOException
- * @throws CoreException
+ * @throws IOException
+ * @throws CoreException
* @since 5.1
*/
+ @Override
public CodeReader get(String key, IIndexFileLocation ifl) throws CoreException, IOException {
CodeReader result = null;
- if (cache.getSpaceLimit() > 0)
+ if (cache.getSpaceLimit() > 0)
result= cache.get(key);
-
+
if (result != null)
return result;
-
+
result= InternalParserUtil.createCodeReader(ifl, cache);
- if (cache.getSpaceLimit() > 0)
+ if (cache.getSpaceLimit() > 0)
put(result);
return result;
}
/**
- * Put a CodeReader into the Cache.
+ * Put a CodeReader into the Cache.
* @param key
* @param value
* @return
@@ -208,7 +211,7 @@ public class CodeReaderCache implements ICodeReaderCache {
}
return cache.put(String.valueOf(value.filename), value);
}
-
+
/**
* Sets the max cache size of this cache in terms of MB.
* @param size
@@ -216,13 +219,14 @@ public class CodeReaderCache implements ICodeReaderCache {
public void setCacheSize(int size) {
cache.setSpaceLimit(size * MB_TO_KB_FACTOR);
}
-
-
+
+
/**
- * Removes the CodeReader from the cache corresponding to the path specified by the key and
+ * Removes the CodeReader from the cache corresponding to the path specified by the key and
* returns the CodeReader that was removed. If no CodeReader is removed then null is returned.
- * @param key
+ * @param key
*/
+ @Override
public synchronized CodeReader remove(String key) {
CodeReader removed= cache.remove(key);
if (cache.isEmpty()) {
@@ -231,14 +235,16 @@ public class CodeReaderCache implements ICodeReaderCache {
}
return removed;
}
-
+
/**
* Returns the current size of the cache. For the CodeReaderCache this is in MB.
*/
+ @Override
public int getCurrentSpace() {
- return cache.getCurrentSpace();
+ return cache.getCurrentSpace();
}
+ @Override
public void flush() {
cache.flush();
if (ResourcesPlugin.getWorkspace() != null)
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/ACBuilder.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/ACBuilder.java
index 48e34fbf771..8c51de85ba6 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/ACBuilder.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/ACBuilder.java
@@ -50,6 +50,7 @@ public abstract class ACBuilder extends IncrementalProjectBuilder implements IMa
super();
}
+ @Override
public void addMarker(IResource file, int lineNumber, String errorDesc, int severity, String errorVar) {
ProblemMarkerInfo problemMarkerInfo = new ProblemMarkerInfo(file, lineNumber, errorDesc, severity, errorVar, null);
addMarker(problemMarkerInfo);
@@ -58,6 +59,7 @@ public abstract class ACBuilder extends IncrementalProjectBuilder implements IMa
/*
* callback from Output Parser
*/
+ @Override
public void addMarker(ProblemMarkerInfo problemMarkerInfo) {
try {
IResource markerResource = problemMarkerInfo.file ;
@@ -85,7 +87,7 @@ public abstract class ACBuilder extends IncrementalProjectBuilder implements IMa
}
}
}
-
+
String type = problemMarkerInfo.getType();
if (type == null)
type = ICModelMarker.C_MODEL_PROBLEM_MARKER;
@@ -137,19 +139,19 @@ public abstract class ACBuilder extends IncrementalProjectBuilder implements IMa
}
return IMarker.SEVERITY_ERROR;
}
-
+
public static boolean needAllConfigBuild() {
return prefs.getBoolean(CCorePreferenceConstants.PREF_BUILD_ALL_CONFIGS);
}
-
+
public static void setAllConfigBuild(boolean enable) {
- prefs.setValue(CCorePreferenceConstants.PREF_BUILD_ALL_CONFIGS, enable);
+ prefs.setValue(CCorePreferenceConstants.PREF_BUILD_ALL_CONFIGS, enable);
}
-
+
/**
* Preference for building configurations only when there are resource changes within Eclipse or
* when there are changes in its references.
- * @return true if configurations will be build when project resource changes within Eclipse
+ * @return true if configurations will be build when project resource changes within Eclipse
* false otherwise
* @since 5.1
*/
@@ -157,7 +159,7 @@ public abstract class ACBuilder extends IncrementalProjectBuilder implements IMa
//bug 219337
return prefs.getBoolean(CCorePreferenceConstants.PREF_BUILD_CONFIGS_RESOURCE_CHANGES);
}
-
+
/**
* Preference for building configurations only when there are resource changes within Eclipse or
* when there are changes in its references.
@@ -165,9 +167,9 @@ public abstract class ACBuilder extends IncrementalProjectBuilder implements IMa
* @since 5.1
*/
public static void setBuildConfigResourceChanges(boolean enable) {
- prefs.setValue(CCorePreferenceConstants.PREF_BUILD_CONFIGS_RESOURCE_CHANGES, enable);
+ prefs.setValue(CCorePreferenceConstants.PREF_BUILD_CONFIGS_RESOURCE_CHANGES, enable);
}
-
+
@SuppressWarnings("nls")
private static String kindToString(int kind) {
return (kind==IncrementalProjectBuilder.AUTO_BUILD ? "AUTO_BUILD"
@@ -176,17 +178,17 @@ public abstract class ACBuilder extends IncrementalProjectBuilder implements IMa
: kind==IncrementalProjectBuilder.INCREMENTAL_BUILD ? "INCREMENTAL_BUILD"
: "[unknown kind]")+"="+kind;
}
-
+
@SuppressWarnings("nls")
private String cfgIdToNames(String strIds) {
IProject project = getProject();
ICProjectDescription prjDesc = CoreModel.getDefault().getProjectDescription(project, false);
if (prjDesc==null)
return strIds;
-
+
if (strIds==null)
return "Active=" + prjDesc.getActiveConfiguration().getName();
-
+
String[] ids = strIds.split("\\|");
String names="";
for (String id : ids) {
@@ -196,7 +198,7 @@ public abstract class ACBuilder extends IncrementalProjectBuilder implements IMa
name = cfgDesc.getName();
else
name = id;
-
+
if (names.length()>0)
names=names+",";
names = names + name;
@@ -208,7 +210,7 @@ public abstract class ACBuilder extends IncrementalProjectBuilder implements IMa
/**
* For debugging purpose only. Prints events on the debug console.
- *
+ *
* @since 5.2
*/
@SuppressWarnings("nls")
@@ -223,7 +225,7 @@ public abstract class ACBuilder extends IncrementalProjectBuilder implements IMa
);
}
}
-
+
@Override
// This method is overridden with no purpose but to track events in debug mode
protected void clean(IProgressMonitor monitor) throws CoreException {
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/EFSFileStorage.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/EFSFileStorage.java
index 3c3a9b83d59..9b497dac7dc 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/EFSFileStorage.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/EFSFileStorage.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -25,7 +25,7 @@ import org.eclipse.core.runtime.PlatformObject;
/**
* A storage object which is backed by an EFS resource.
- *
+ *
* @author crecoskie
* @since 5.0
*
@@ -34,14 +34,15 @@ public class EFSFileStorage extends PlatformObject implements IStorage {
private URI locationURI;
private InputStream inputStream;
-
+
public EFSFileStorage(URI locationURI) {
this.locationURI = locationURI;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.core.resources.IStorage#getContents()
*/
+ @Override
public InputStream getContents() throws CoreException {
if (inputStream == null) {
@@ -59,6 +60,7 @@ public class EFSFileStorage extends PlatformObject implements IStorage {
/* (non-Javadoc)
* @see org.eclipse.core.resources.IStorage#getFullPath()
*/
+ @Override
public IPath getFullPath() {
return URIUtil.toPath(locationURI);
}
@@ -66,6 +68,7 @@ public class EFSFileStorage extends PlatformObject implements IStorage {
/* (non-Javadoc)
* @see org.eclipse.core.resources.IStorage#getName()
*/
+ @Override
public String getName() {
IFileStore fileStore = null;
try {
@@ -79,13 +82,14 @@ public class EFSFileStorage extends PlatformObject implements IStorage {
if (fileStore != null) {
return fileStore.getName();
}
-
+
return null;
}
/* (non-Javadoc)
* @see org.eclipse.core.resources.IStorage#isReadOnly()
*/
+ @Override
public boolean isReadOnly() {
IFileStore fileStore = null;
try {
@@ -97,18 +101,18 @@ public class EFSFileStorage extends PlatformObject implements IStorage {
if (fileStore != null) {
IFileInfo info = fileStore.fetchInfo();
-
+
if(info != null)
return info.getAttribute(EFS.ATTRIBUTE_READ_ONLY);
}
-
+
return false;
}
-
+
/**
* Returns the location URI corresponding to the EFS resource that
* backs this storage.
- *
+ *
* @return URI
*/
public URI getLocationURI() {
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/FileStorage.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/FileStorage.java
index 02db0cf968d..1ed47e4c26f 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/FileStorage.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/FileStorage.java
@@ -30,9 +30,10 @@ import org.eclipse.core.runtime.Status;
public class FileStorage extends PlatformObject implements IStorage {
IPath path;
InputStream in = null;
-
+
+ @Override
public InputStream getContents() throws CoreException {
- if (in == null) {
+ if (in == null) {
try {
return new FileInputStream(path.toFile());
} catch (FileNotFoundException e) {
@@ -46,6 +47,7 @@ public class FileStorage extends PlatformObject implements IStorage {
/**
* @see IStorage#getFullPath
*/
+ @Override
public IPath getFullPath() {
return this.path;
}
@@ -53,6 +55,7 @@ public class FileStorage extends PlatformObject implements IStorage {
/**
* @see IStorage#getName
*/
+ @Override
public String getName() {
return this.path.lastSegment();
}
@@ -60,6 +63,7 @@ public class FileStorage extends PlatformObject implements IStorage {
/**
* @see IStorage#isReadOnly()
*/
+ @Override
public boolean isReadOnly() {
return true;
}
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/RefreshScopeManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/RefreshScopeManager.java
index 723b8155a34..4297cc3f0e8 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/RefreshScopeManager.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/RefreshScopeManager.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -47,14 +47,14 @@ import org.eclipse.core.runtime.jobs.MultiRule;
* project may have a set of resources associated with it that are the set of resources to be refreshed. An
* exclusion mechanism exists that allows for one to specify arbitrarily complicated, nested logic that
* determines whether or not a given resource is refreshed according to previously specified rules.
- *
+ *
* EXPERIMENTAL . This class or interface has been added as part of a work in progress. There
* is no guarantee that this API will work or that it will remain the same. Please do not use this API without
* consulting with the CDT team.
- *
+ *
* @author crecoskie
* @since 5.3
- *
+ *
*/
public class RefreshScopeManager {
@@ -106,6 +106,7 @@ public class RefreshScopeManager {
ResourcesPlugin.getWorkspace().addResourceChangeListener(
new IResourceChangeListener() {
+ @Override
public void resourceChanged(IResourceChangeEvent event) {
if (event.getType() == IResourceChangeEvent.PRE_CLOSE
@@ -130,6 +131,7 @@ public class RefreshScopeManager {
try {
delta.accept(new IResourceDeltaVisitor() {
+ @Override
public boolean visit(IResourceDelta delta) throws CoreException {
if (delta.getResource() instanceof IProject) {
IProject project = (IProject) delta.getResource();
@@ -326,6 +328,7 @@ public class RefreshScopeManager {
}
}
+ @Override
public void run(IProgressMonitor monitor) throws CoreException {
List resourcesToRefresh = getResourcesToRefresh(project);
@@ -355,7 +358,7 @@ public class RefreshScopeManager {
/**
* Returns the set of resources that should be refreshed for a project. These resources might have
* associated exclusions.
- *
+ *
* @param project
* @return List
*/
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/ScannerInfo.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/ScannerInfo.java
index 37df57e7153..0b5fae7cfe4 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/ScannerInfo.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/ScannerInfo.java
@@ -20,7 +20,7 @@ import org.eclipse.cdt.core.parser.IExtendedScannerInfo;
* #@noinstantiate This class is not intended to be instantiated by clients. Note
* that protected constructor won't allow to instantiate this class
* outside the package anyway, so it is not really API.
- *
+ *
* @deprecated Since CDT 4.0 not used for the "new style" projects.
*/
@Deprecated
@@ -50,30 +50,35 @@ public class ScannerInfo implements IExtendedScannerInfo {
}
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.build.managed.IScannerInfo#getIncludePaths()
*/
+ @Override
public synchronized String[] getIncludePaths() {
return fSystemIncludePaths;
}
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.build.managed.IScannerInfo#getIncludePaths()
*/
+ @Override
public synchronized Map getDefinedSymbols() {
return fMacroMap;
}
+ @Override
public String[] getMacroFiles() {
return fMacroFiles;
}
+ @Override
public String[] getIncludeFiles() {
return fIncludeFiles;
}
+ @Override
public String[] getLocalIncludePath() {
return fLocalIncludePaths;
}
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/ScannerProvider.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/ScannerProvider.java
index 68dca092569..9295514553e 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/ScannerProvider.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/resources/ScannerProvider.java
@@ -37,10 +37,10 @@ import org.eclipse.core.runtime.IPath;
/**
* Provides scanner information from {@link PathEntryManager}.
- *
+ *
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
- *
+ *
* @deprecated Since CDT 4.0 replaced by {@link ScannerInfoProviderProxy}. Still
* used as a default for projects created by earlier CDT versions.
*/
@@ -51,9 +51,9 @@ public class ScannerProvider extends AbstractCExtension implements IScannerInfoP
private static Map> listeners;
private static ScannerProvider fProvider;
-
+
// Map of the cache scannerInfos
-
+
public static synchronized IScannerInfoProvider getInstance() {
if ( fProvider == null) {
fProvider = new ScannerProvider();
@@ -91,9 +91,10 @@ public class ScannerProvider extends AbstractCExtension implements IScannerInfoP
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.parser.IScannerInfoProvider#getScannerInformation(org.eclipse.core.resources.IResource)
*/
+ @Override
public IScannerInfo getScannerInformation(IResource resource) {
IPath resPath = resource.getFullPath();
@@ -109,10 +110,10 @@ public class ScannerProvider extends AbstractCExtension implements IScannerInfoP
}
}
String[] localIncludes = new String[localCount];
- String[] systemIncludes = new String[systemCount];
+ String[] systemIncludes = new String[systemCount];
for (int i = 0, j = 0, k = 0; i < includeEntries.length; ++i) {
if (includeEntries[i].isSystemInclude()) {
- systemIncludes[j++] = includeEntries[i].getFullIncludePath().toOSString();
+ systemIncludes[j++] = includeEntries[i].getFullIncludePath().toOSString();
} else {
localIncludes[k++] = includeEntries[i].getFullIncludePath().toOSString();
}
@@ -147,10 +148,11 @@ public class ScannerProvider extends AbstractCExtension implements IScannerInfoP
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.parser.IScannerInfoProvider#subscribe(org.eclipse.core.resources.IResource,
* org.eclipse.cdt.core.parser.IScannerInfoChangeListener)
*/
+ @Override
public synchronized void subscribe(IResource resource, IScannerInfoChangeListener listener) {
if (resource == null || listener == null) {
return;
@@ -172,10 +174,11 @@ public class ScannerProvider extends AbstractCExtension implements IScannerInfoP
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.cdt.core.parser.IScannerInfoProvider#unsubscribe(org.eclipse.core.resources.IResource,
* org.eclipse.cdt.core.parser.IScannerInfoChangeListener)
*/
+ @Override
public synchronized void unsubscribe(IResource resource, IScannerInfoChangeListener listener) {
if (resource == null || listener == null) {
return;
@@ -193,6 +196,7 @@ public class ScannerProvider extends AbstractCExtension implements IScannerInfoP
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IElementChangedListener#elementChanged(org.eclipse.cdt.core.model.ElementChangedEvent)
*/
+ @Override
public void elementChanged(ElementChangedEvent event) {
try {
processDelta(event.getDelta());
@@ -202,7 +206,7 @@ public class ScannerProvider extends AbstractCExtension implements IScannerInfoP
protected boolean isPathEntryChange(ICElementDelta delta) {
int flags= delta.getFlags();
- return (delta.getKind() == ICElementDelta.CHANGED &&
+ return (delta.getKind() == ICElementDelta.CHANGED &&
((flags & ICElementDelta.F_CHANGED_PATHENTRY_INCLUDE) != 0 ||
(flags & ICElementDelta.F_CHANGED_PATHENTRY_MACRO) != 0 ||
(flags & ICElementDelta.F_PATHENTRY_REORDER) !=0));
@@ -223,7 +227,7 @@ public class ScannerProvider extends AbstractCExtension implements IScannerInfoP
IScannerInfo info = getScannerInformation(res);
notifyInfoListeners(project, info);
}
-
+
ICElementDelta[] affectedChildren= delta.getAffectedChildren();
for (ICElementDelta element2 : affectedChildren) {
processDelta(element2);
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CConfigBasedDescriptor.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CConfigBasedDescriptor.java
index dfc73365cd6..e0749fefd6b 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CConfigBasedDescriptor.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CConfigBasedDescriptor.java
@@ -157,6 +157,7 @@ final public class CConfigBasedDescriptor implements ICDescriptor {
fCfgExtRef = cfgRef;
}
+ @Override
public ICExtension createExtension() throws CoreException {
AbstractCExtension cExtension = null;
IConfigurationElement el = CExtensionUtil.getFirstConfigurationElement(fCfgExtRef, CEXTENSION_NAME, false);
@@ -166,18 +167,22 @@ final public class CConfigBasedDescriptor implements ICDescriptor {
return cExtension;
}
+ @Override
public ICDescriptor getCDescriptor() {
return CConfigBasedDescriptor.this;
}
+ @Override
public String getExtension() {
return fCfgExtRef.getExtensionPoint();
}
+ @Override
public String getExtensionData(String key) {
return fCfgExtRef.getExtensionData(key);
}
+ @Override
public IConfigurationElement[] getExtensionElements()
throws CoreException {
IConfigurationElement el = CExtensionUtil.getFirstConfigurationElement(fCfgExtRef, CEXTENSION_NAME, false);
@@ -186,10 +191,12 @@ final public class CConfigBasedDescriptor implements ICDescriptor {
return new IConfigurationElement[0];
}
+ @Override
public String getID() {
return fCfgExtRef.getID();
}
+ @Override
public void setExtensionData(String key, String value)
throws CoreException {
if(!CDataUtil.objectsEqual(fCfgExtRef.getExtensionData(key), value)){
@@ -286,6 +293,7 @@ final public class CConfigBasedDescriptor implements ICDescriptor {
* (non-Javadoc)
* @see org.eclipse.cdt.core.ICDescriptor#create(java.lang.String, java.lang.String)
*/
+ @Override
public ICExtensionReference create(String extensionPoint, String id) throws CoreException {
try {
fLock.acquire();
@@ -356,6 +364,7 @@ final public class CConfigBasedDescriptor implements ICDescriptor {
* FIXME re-add caching (the current behaviour mirrors the previous behaviour -- just tidier)
* @return an array of ICExtenionReference
*/
+ @Override
public ICExtensionReference[] get(String extensionPoint) {
try {
fLock.acquire();
@@ -380,6 +389,7 @@ final public class CConfigBasedDescriptor implements ICDescriptor {
* (non-Javadoc)
* @see org.eclipse.cdt.core.ICDescriptor#get(java.lang.String, boolean)
*/
+ @Override
public ICExtensionReference[] get(String extensionPoint, boolean update) throws CoreException {
try {
fLock.acquire();
@@ -399,6 +409,7 @@ final public class CConfigBasedDescriptor implements ICDescriptor {
* (non-Javadoc)
* @see org.eclipse.cdt.core.ICDescriptor#getPlatform()
*/
+ @Override
public String getPlatform() {
try {
fLock.acquire();
@@ -412,6 +423,7 @@ final public class CConfigBasedDescriptor implements ICDescriptor {
* (non-Javadoc)
* @see org.eclipse.cdt.core.ICDescriptor#getProject()
*/
+ @Override
public IProject getProject() {
try {
fLock.acquire();
@@ -429,6 +441,7 @@ final public class CConfigBasedDescriptor implements ICDescriptor {
* returned ICStorageElement. We must allow this as this is how the existing implementation
* behaves.
*/
+ @Override
public ICStorageElement getProjectStorageElement(String id) throws CoreException {
try {
fLock.acquire();
@@ -460,6 +473,7 @@ final public class CConfigBasedDescriptor implements ICDescriptor {
* Currently relies on the fact that the only implementation if ICStorageElement
* in the core is XmlStorageElement.
*/
+ @Override
public Element getProjectData(String id) throws CoreException {
try {
fLock.acquire();
@@ -484,6 +498,7 @@ final public class CConfigBasedDescriptor implements ICDescriptor {
final Element xmlEl = ((XmlStorageElement)el).fElement;
// This proxy synchronizes the storage element's root XML Element
el = new XmlStorageElement((Element)Proxy.newProxyInstance(Element.class.getClassLoader(), new Class[]{Element.class}, new InvocationHandler(){
+ @Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
Method realMethod = xmlEl.getClass().getMethod(method.getName(), method.getParameterTypes());
// Now just execute the method
@@ -493,6 +508,7 @@ final public class CConfigBasedDescriptor implements ICDescriptor {
if (method.getName().equals("getParentNode")) { //$NON-NLS-1$
final Node parent = (Node)realMethod.invoke(xmlEl, args);
Node parentProxy = (Node)Proxy.newProxyInstance(Node.class.getClassLoader(), new Class[]{Node.class}, new InvocationHandler(){
+ @Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
Method realMethod = parent.getClass().getMethod(method.getName(), method.getParameterTypes());
synchronized (xmlEl) {
@@ -535,6 +551,7 @@ final public class CConfigBasedDescriptor implements ICDescriptor {
}
}
+ @Override
public ICStorageElement removeProjectStorageElement(String id) throws CoreException {
try {
fLock.acquire();
@@ -544,6 +561,7 @@ final public class CConfigBasedDescriptor implements ICDescriptor {
}
}
+ @Override
public ICOwnerInfo getProjectOwner() {
try {
fLock.acquire();
@@ -553,6 +571,7 @@ final public class CConfigBasedDescriptor implements ICDescriptor {
}
}
+ @Override
public void remove(ICExtensionReference extension) throws CoreException {
try {
fLock.acquire();
@@ -584,6 +603,7 @@ final public class CConfigBasedDescriptor implements ICDescriptor {
}
}
+ @Override
public void remove(String extensionPoint) throws CoreException {
try {
fLock.acquire();
@@ -611,6 +631,7 @@ final public class CConfigBasedDescriptor implements ICDescriptor {
* (non-Javadoc)
* @see org.eclipse.cdt.core.ICDescriptor#saveProjectData()
*/
+ @Override
public void saveProjectData() throws CoreException {
try {
fLock.acquire();
@@ -631,6 +652,7 @@ final public class CConfigBasedDescriptor implements ICDescriptor {
* (non-Javadoc)
* @see org.eclipse.cdt.core.ICDescriptor#getConfigurationDescription()
*/
+ @Override
public ICConfigurationDescription getConfigurationDescription() {
try {
fLock.acquire();
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CConfigBasedDescriptorManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CConfigBasedDescriptorManager.java
index b07af955b82..0e9094e9f0f 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CConfigBasedDescriptorManager.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CConfigBasedDescriptorManager.java
@@ -133,6 +133,7 @@ final public class CConfigBasedDescriptorManager implements ICDescriptorManager
* (non-Javadoc)
* @see org.eclipse.cdt.core.ICDescriptorManager#configure(org.eclipse.core.resources.IProject, java.lang.String)
*/
+ @Override
public void configure(IProject project, String id) throws CoreException {
if (id.equals(NULLCOwner.getOwnerID())) {
IStatus status = new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1,
@@ -206,6 +207,7 @@ final public class CConfigBasedDescriptorManager implements ICDescriptorManager
* (non-Javadoc)
* @see org.eclipse.cdt.core.ICDescriptorManager#convert(org.eclipse.core.resources.IProject, java.lang.String)
*/
+ @Override
public void convert(IProject project, String id) throws CoreException {
CConfigBasedDescriptor dr = findDescriptor(project, false);
if(dr == null)
@@ -225,6 +227,7 @@ final public class CConfigBasedDescriptorManager implements ICDescriptorManager
* (non-Javadoc)
* @see org.eclipse.cdt.core.ICDescriptorManager#getDescriptor(org.eclipse.core.resources.IProject)
*/
+ @Override
public ICDescriptor getDescriptor(IProject project) throws CoreException {
return getDescriptor(project, true);
}
@@ -233,6 +236,7 @@ final public class CConfigBasedDescriptorManager implements ICDescriptorManager
* (non-Javadoc)
* @see org.eclipse.cdt.core.ICDescriptorManager#getDescriptor(org.eclipse.core.resources.IProject, boolean)
*/
+ @Override
public ICDescriptor getDescriptor(IProject project, boolean create) throws CoreException {
return findDescriptor(project, create);
}
@@ -241,6 +245,7 @@ final public class CConfigBasedDescriptorManager implements ICDescriptorManager
* (non-Javadoc)
* @see org.eclipse.cdt.core.ICDescriptorManager#addDescriptorListener(org.eclipse.cdt.core.ICDescriptorListener)
*/
+ @Override
public void addDescriptorListener(ICDescriptorListener listener) {
fListeners.add(listener);
}
@@ -249,6 +254,7 @@ final public class CConfigBasedDescriptorManager implements ICDescriptorManager
* (non-Javadoc)
* @see org.eclipse.cdt.core.ICDescriptorManager#removeDescriptorListener(org.eclipse.cdt.core.ICDescriptorListener)
*/
+ @Override
public void removeDescriptorListener(ICDescriptorListener listener) {
fListeners.remove(listener);
}
@@ -258,6 +264,7 @@ final public class CConfigBasedDescriptorManager implements ICDescriptorManager
* (non-Javadoc)
* @see org.eclipse.cdt.core.ICDescriptorManager#runDescriptorOperation(org.eclipse.core.resources.IProject, org.eclipse.cdt.core.ICDescriptorOperation, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public void runDescriptorOperation(IProject project, ICDescriptorOperation op, IProgressMonitor monitor)
throws CoreException {
CConfigBasedDescriptor dr = findDescriptor(project, true);
@@ -287,6 +294,7 @@ final public class CConfigBasedDescriptorManager implements ICDescriptorManager
* (non-Javadoc)
* @see org.eclipse.cdt.core.ICDescriptorManager#runDescriptorOperation(org.eclipse.core.resources.IProject, org.eclipse.cdt.core.settings.model.ICProjectDescription, org.eclipse.cdt.core.ICDescriptorOperation, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public void runDescriptorOperation(IProject project, ICProjectDescription des, ICDescriptorOperation op, IProgressMonitor monitor)
throws CoreException {
// Ensure that only one of these is running on the project at any one time...
@@ -440,6 +448,7 @@ final public class CConfigBasedDescriptorManager implements ICDescriptorManager
if (fDescriptionListener != null)
return;
fDescriptionListener = new ICProjectDescriptionListener(){
+ @Override
public void handleEvent(CProjectDescriptionEvent event) {
doHandleEvent(event);
}
@@ -579,12 +588,14 @@ final public class CConfigBasedDescriptorManager implements ICDescriptorManager
for (final ICDescriptorListener listener : fListeners) {
SafeRunner.run(new ISafeRunnable() {
+ @Override
public void handleException(Throwable exception) {
IStatus status = new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1,
CCorePlugin.getResourceString("CDescriptorManager.exception.listenerError"), exception); //$NON-NLS-1$
CCorePlugin.log(status);
}
+ @Override
public void run() throws Exception {
listener.descriptorChanged(event);
}
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CExtensionDescriptor.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CExtensionDescriptor.java
index 0c025aa12c4..33388970aaa 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CExtensionDescriptor.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CExtensionDescriptor.java
@@ -22,14 +22,16 @@ public class CExtensionDescriptor implements ICExtensionDescriptor {
fElement = el;
}
+ @Override
public String getId() {
return fElement.getAttribute(ATTRIBUTE_ID);
}
+ @Override
public String getName() {
return fElement.getAttribute(ATTRIBUTE_NAME);
}
-
+
public IConfigurationElement getConfigurationElement(){
return fElement;
}
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/COwner.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/COwner.java
index eb56f14b26d..79d5bf4b3df 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/COwner.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/COwner.java
@@ -24,14 +24,17 @@ public class COwner implements ICOwnerInfo {
fConfig = config;
}
+ @Override
public String getID() {
return fConfig.getOwnerID();
}
+ @Override
public String getName() {
return fConfig.getName();
}
+ @Override
public String getPlatform() {
return fConfig.getPlatform();
}
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CdtVarPathEntryVariableManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CdtVarPathEntryVariableManager.java
index 6f30438be9e..d3472ae3cd4 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CdtVarPathEntryVariableManager.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/CdtVarPathEntryVariableManager.java
@@ -55,13 +55,15 @@ public class CdtVarPathEntryVariableManager implements
super(new VarContextInfo(), "", " "); //$NON-NLS-1$ //$NON-NLS-2$
}
}
-
+
private class VarContextInfo implements IVariableContextInfo {
+ @Override
public IVariableContextInfo getNext() {
return null;
}
+ @Override
public ICdtVariableSupplier[] getSuppliers() {
return new ICdtVariableSupplier[]{fVarSupplier};
}
@@ -70,17 +72,18 @@ public class CdtVarPathEntryVariableManager implements
public boolean equals(Object obj) {
if(obj == this)
return true;
-
+
if(!(obj instanceof VarContextInfo))
return false;
-
+
return true;
}
-
+
}
-
+
private class VarSupplier implements ICdtVariableSupplier {
+ @Override
public ICdtVariable getVariable(String macroName,
IVariableContextInfo context) {
ICdtVariable var = fUserVarSupplier.getMacro(macroName, ICoreVariableContextInfo.CONTEXT_WORKSPACE, null);
@@ -89,6 +92,7 @@ public class CdtVarPathEntryVariableManager implements
return null;
}
+ @Override
public ICdtVariable[] getVariables(IVariableContextInfo context) {
ICdtVariable vars[] = fUserVarSupplier.getMacros(ICoreVariableContextInfo.CONTEXT_WORKSPACE, null);
List list = new ArrayList();
@@ -98,21 +102,22 @@ public class CdtVarPathEntryVariableManager implements
}
return list.toArray(new ICdtVariable[list.size()]);
}
-
+
}
-
-
-
+
+
+
public CdtVarPathEntryVariableManager(){
fListeners = Collections.synchronizedSet(new HashSet());
fUserVarSupplier.addListener(this);
}
+ @Override
public IPath getValue(String name) {
ICdtVariable var = fUserVarSupplier.getMacro(name, ICoreVariableContextInfo.CONTEXT_WORKSPACE, null);
return getVariablePath(var);
}
-
+
public static IPath getVariablePath(ICdtVariable var){
if(var != null){
switch(var.getValueType()){
@@ -139,16 +144,17 @@ public class CdtVarPathEntryVariableManager implements
public static boolean isPathEntryVariable(ICdtVariable var, ICConfigurationDescription cfg, ICdtVariableManager mngr){
if(mngr.isUserVariable(var, cfg))
return false;
-
+
if(!mngr.isUserVariable(var, null))
return false;
-
+
if(getVariablePath(var) == null)
return false;
-
+
return true;
}
+ @Override
public String[] getVariableNames() {
ICdtVariable[] vars = fUserVarSupplier.getMacros(ICoreVariableContextInfo.CONTEXT_WORKSPACE, null);
ArrayList list = new ArrayList();
@@ -159,38 +165,41 @@ public class CdtVarPathEntryVariableManager implements
return list.toArray(new String[list.size()]);
}
+ @Override
public boolean isDefined(String name) {
return getValue(name) != null;
}
+ @Override
public IPath resolvePath(IPath path) {
if(path == null)
return null;
-
+
String str = path.toPortableString();
-
+
try {
str = CdtVariableResolver.resolveToString(str, fSubstitutor);
} catch (CdtVariableException e) {
CCorePlugin.log(e);
}
-
+
return new Path(str);
}
+ @Override
public void setValue(String name, IPath value) throws CoreException {
if(value != null)
fUserVarSupplier.createMacro(name, ICdtVariable.VALUE_PATH_ANY, value.toString(), ICoreVariableContextInfo.CONTEXT_WORKSPACE, null);
else
fUserVarSupplier.deleteMacro(name, ICoreVariableContextInfo.CONTEXT_WORKSPACE, null);
-
+
fUserVarSupplier.storeWorkspaceVariables(false);
}
-
+
/**
* Fires a property change event corresponding to a change to the
* current value of the variable with the given name.
- *
+ *
* @param name the name of the variable, to be used as the variable
* in the event object
* @param value the current value of the path variable or null
if
@@ -206,16 +215,18 @@ public class CdtVarPathEntryVariableManager implements
private void fireVariableChangeEvent(String name, IPath value, int type) {
if (this.fListeners.size() == 0)
return;
- // use a separate collection to avoid interference of simultaneous additions/removals
+ // use a separate collection to avoid interference of simultaneous additions/removals
Object[] listenerArray = this.fListeners.toArray();
final PathEntryVariableChangeEvent pve = new PathEntryVariableChangeEvent(this, name, value, type);
for (int i = 0; i < listenerArray.length; ++i) {
final IPathEntryVariableChangeListener l = (IPathEntryVariableChangeListener) listenerArray[i];
ISafeRunnable job = new ISafeRunnable() {
+ @Override
public void handleException(Throwable exception) {
// already being logged in Platform#run()
}
+ @Override
public void run() throws Exception {
l.pathVariableChanged(pve);
}
@@ -223,10 +234,11 @@ public class CdtVarPathEntryVariableManager implements
SafeRunner.run(job);
}
}
-
+
/**
* @see org.eclipse.cdt.core.resources.IPathEntryVariableManager#addChangeListener(IPathEntryVariableChangeListener)
*/
+ @Override
public void addChangeListener(IPathEntryVariableChangeListener listener) {
fListeners.add(listener);
}
@@ -235,37 +247,39 @@ public class CdtVarPathEntryVariableManager implements
* @see org.eclipse.cdt.core.resources.
* IPathEntryVariableManager#removeChangeListener(IPathEntryVariableChangeListener)
*/
+ @Override
public void removeChangeListener(IPathEntryVariableChangeListener listener) {
fListeners.remove(listener);
}
+ @Override
public void variablesChanged(VariableChangeEvent event) {
ICdtVariable[] added = event.getAddedVariables();
ICdtVariable[] removed = event.getRemovedVariables();
ICdtVariable[] changed = event.getChangedVariables();
-
+
if(added.length != 0){
fireEvent(added, PathEntryVariableChangeEvent.VARIABLE_CREATED);
}
-
+
if(removed.length != 0){
fireEvent(removed, PathEntryVariableChangeEvent.VARIABLE_DELETED);
}
-
+
if(changed.length != 0){
fireEvent(changed, PathEntryVariableChangeEvent.VARIABLE_CHANGED);
}
}
-
+
private void fireEvent(ICdtVariable vars[], int type){
for (ICdtVariable var : vars) {
IPath path = getVariablePath(var);
if(path != null)
fireVariableChangeEvent(var.getName(), path, type);
}
-
+
}
-
+
public void startup(){
}
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/LocalProjectScope.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/LocalProjectScope.java
index 12bb864c5ac..58baa74aa63 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/LocalProjectScope.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/LocalProjectScope.java
@@ -56,14 +56,17 @@ public class LocalProjectScope implements IScopeContext {
fContext= projectName;
}
+ @Override
public IPath getLocation() {
return null;
}
+ @Override
public String getName() {
return SCOPE;
}
+ @Override
public IEclipsePreferences getNode(String qualifier) {
return InstanceScope.INSTANCE.getNode(qualifier + QUALIFIER_EXT + fContext);
}
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PathEntryVariableManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PathEntryVariableManager.java
index 2c6da363a89..30ab3259a43 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PathEntryVariableManager.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PathEntryVariableManager.java
@@ -33,7 +33,7 @@ import org.eclipse.core.runtime.SafeRunner;
/**
- * Core's implementation of IPathEntryVariableManager.
+ * Core's implementation of IPathEntryVariableManager.
*/
public class PathEntryVariableManager implements IPathEntryVariableManager {
@@ -44,16 +44,16 @@ public class PathEntryVariableManager implements IPathEntryVariableManager {
/**
* Constructor for the class.
- *
+ *
* The current manager implementation is not used any more
* Instead the CdtVarPathEntryVariableManager is used that actually wraps the CdtVariables contributed at workspace level
- *
+ *
* NOTE: all PathEntryVariableManager functionality remains workable with the new
- * CdtVarPathEntryVariableManager. We could either remove this class or copy the contents of the
+ * CdtVarPathEntryVariableManager. We could either remove this class or copy the contents of the
* CdtVarPathEntryVariableManager to this class to preserve internal class name for better backward compatibility.
- *
- *
- */
+ *
+ *
+ */
private PathEntryVariableManager() {
this.listeners = Collections.synchronizedSet(new HashSet());
this.preferences = CCorePlugin.getDefault().getPluginPreferences();
@@ -64,9 +64,10 @@ public class PathEntryVariableManager implements IPathEntryVariableManager {
* and then calls #getValue using that key, they will get the value back for
* that. But then if they try and call #setValue using the same key it will throw
* an exception. We may want to revisit this behaviour in the future.
- *
+ *
* @see org.eclipse.cdt.core.resources.IPathEntryVariableManager#getValue(String)
*/
+ @Override
public IPath getValue(String varName) {
String key = getKeyForName(varName);
String value = preferences.getString(key);
@@ -76,13 +77,14 @@ public class PathEntryVariableManager implements IPathEntryVariableManager {
/**
* @see org.eclipse.cdt.core.resources.IPathEntryVariableManager#setValue(String, IPath)
*/
+ @Override
public void setValue(String varName, IPath newValue) throws CoreException {
//if the location doesn't have a device, see if the OS will assign one
if (newValue != null && newValue.isAbsolute() && newValue.getDevice() == null) {
newValue = new Path(newValue.toFile().getAbsolutePath());
}
int eventType;
- // read previous value and set new value atomically in order to generate the right event
+ // read previous value and set new value atomically in order to generate the right event
synchronized (this) {
IPath currentValue = getValue(varName);
boolean variableExists = currentValue != null;
@@ -115,6 +117,7 @@ public class PathEntryVariableManager implements IPathEntryVariableManager {
/**
* @see org.eclipse.cdt.core.resources.IPathEntryVariableManager#resolvePath(IPath)
*/
+ @Override
public IPath resolvePath(IPath path) {
if (path == null || path.segmentCount() == 0) {
return path;
@@ -130,7 +133,7 @@ public class PathEntryVariableManager implements IPathEntryVariableManager {
/**
* Fires a property change event corresponding to a change to the
* current value of the variable with the given name.
- *
+ *
* @param name the name of the variable, to be used as the variable
* in the event object
* @param value the current value of the path variable or null
if
@@ -146,16 +149,18 @@ public class PathEntryVariableManager implements IPathEntryVariableManager {
private void fireVariableChangeEvent(String name, IPath value, int type) {
if (this.listeners.size() == 0)
return;
- // use a separate collection to avoid interference of simultaneous additions/removals
+ // use a separate collection to avoid interference of simultaneous additions/removals
Object[] listenerArray = this.listeners.toArray();
final PathEntryVariableChangeEvent pve = new PathEntryVariableChangeEvent(this, name, value, type);
for (int i = 0; i < listenerArray.length; ++i) {
final IPathEntryVariableChangeListener l = (IPathEntryVariableChangeListener) listenerArray[i];
ISafeRunnable job = new ISafeRunnable() {
+ @Override
public void handleException(Throwable exception) {
// already being logged in Platform#run()
}
+ @Override
public void run() throws Exception {
l.pathVariableChanged(pve);
}
@@ -167,6 +172,7 @@ public class PathEntryVariableManager implements IPathEntryVariableManager {
/**
* @see org.eclipse.core.resources.IPathVariableManager#getPathVariableNames()
*/
+ @Override
public String[] getVariableNames() {
List result = new LinkedList();
String[] names = preferences.propertyNames();
@@ -183,6 +189,7 @@ public class PathEntryVariableManager implements IPathEntryVariableManager {
* @see org.eclipse.cdt.core.resources.
* IPathEntryVariableManager#addChangeListener(IPathEntryVariableChangeListener)
*/
+ @Override
public void addChangeListener(IPathEntryVariableChangeListener listener) {
listeners.add(listener);
}
@@ -191,6 +198,7 @@ public class PathEntryVariableManager implements IPathEntryVariableManager {
* @see org.eclipse.cdt.core.resources.
* IPathEntryVariableManager#removeChangeListener(IPathEntryVariableChangeListener)
*/
+ @Override
public void removeChangeListener(IPathEntryVariableChangeListener listener) {
listeners.remove(listener);
}
@@ -198,6 +206,7 @@ public class PathEntryVariableManager implements IPathEntryVariableManager {
/**
* @see org.eclipse.core.resources.IPathVariableManager#isDefined(String)
*/
+ @Override
public boolean isDefined(String varName) {
return getValue(varName) != null;
}
@@ -221,7 +230,7 @@ public class PathEntryVariableManager implements IPathEntryVariableManager {
char ch = prev;
boolean inMacro = false;
boolean inSingleQuote = false;
-
+
for (int i = 0; i < variable.length(); i++) {
ch = variable.charAt(i);
switch (ch) {
@@ -230,7 +239,7 @@ public class PathEntryVariableManager implements IPathEntryVariableManager {
inSingleQuote = !inSingleQuote;
}
break;
-
+
case '$' :
if (!inSingleQuote && prev != '\\') {
if (i < variable.length() && variable.indexOf('}', i) > 0) {
@@ -244,7 +253,7 @@ public class PathEntryVariableManager implements IPathEntryVariableManager {
}
}
break;
-
+
case '}' :
if (inMacro) {
inMacro = false;
@@ -263,7 +272,7 @@ public class PathEntryVariableManager implements IPathEntryVariableManager {
}
break;
} /* switch */
-
+
if (!inMacro) {
sb.append(ch);
} else {
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PathEntryVariableResolver.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PathEntryVariableResolver.java
index ed7c48f3d44..9608a151ec2 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PathEntryVariableResolver.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PathEntryVariableResolver.java
@@ -26,6 +26,7 @@ public class PathEntryVariableResolver implements IDynamicVariableResolver {
super();
}
+ @Override
public String resolveValue(IDynamicVariable variable, String argument) throws CoreException {
if (argument == null) {
throw new CoreException(new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, CCorePlugin.getResourceString("PathEntryVariableResolver.0"), null)); //$NON-NLS-1$
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PositionTracker.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PositionTracker.java
index feefb5b9815..bafff7faa3f 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PositionTracker.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PositionTracker.java
@@ -7,7 +7,7 @@
*
* Contributors:
* Markus Schorn - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/
package org.eclipse.cdt.internal.core;
@@ -28,7 +28,7 @@ public class PositionTracker implements IPositionConverter {
private Node fAboveRoot = new Node(0, 0, 0);
private PositionTracker fFollowedBy = null;
private long fTimeStamp;
-
+
/**
* Resets the tracker to a state reflecting no changes.
*/
@@ -45,7 +45,7 @@ public class PositionTracker implements IPositionConverter {
}
/**
- * Notifies the tracker of the insertion of characters.
+ * Notifies the tracker of the insertion of characters.
* It is assumed that character get inserted before the offset.
* @param offset offset of the character in front of which insertion occurs.
* @param count amount of characters inserted.
@@ -61,7 +61,7 @@ public class PositionTracker implements IPositionConverter {
/**
* Notifies the tracker of the removal of characters.
- * delete(0,1) removes the first character,
+ * delete(0,1) removes the first character,
* for convenience delete(1,-1) does the same.
* @param offset offset of the first character deleted.
* @param count amount of characters deleted.
@@ -88,7 +88,7 @@ public class PositionTracker implements IPositionConverter {
public synchronized int historicOffset(int currentOffset) {
return historicOffset(currentOffset, true);
}
-
+
private synchronized int historicOffset(int currentOffset, boolean nextOnDelete) {
int orig = currentOffset;
if (fFollowedBy != null) {
@@ -106,7 +106,7 @@ public class PositionTracker implements IPositionConverter {
public synchronized int currentOffset(int historicOffset) {
return currentOffset(historicOffset, true);
}
-
+
private synchronized int currentOffset(int historicOffset, boolean nextOnDelete) {
int current = fAboveRoot.calculateCurrentOffset(historicOffset, 0, nextOnDelete);
if (fFollowedBy != null) {
@@ -116,7 +116,7 @@ public class PositionTracker implements IPositionConverter {
}
/**
- * Makes this tracker final. Future changes are tracked by the tracker
+ * Makes this tracker final. Future changes are tracked by the tracker
* supplied and will be taken into acoount when converting positions.
* @param inFavourOf tracker that tracks changes from now on.
*/
@@ -142,7 +142,7 @@ public class PositionTracker implements IPositionConverter {
public synchronized boolean isModified() {
return fAboveRoot.fLeft != null || fAboveRoot.fRight!=null;
}
-
+
public synchronized long getTimeStamp() {
return fTimeStamp;
}
@@ -166,10 +166,11 @@ public class PositionTracker implements IPositionConverter {
return fAboveRoot.countNodes();
}
- public synchronized IRegion actualToHistoric(IRegion actualPosition) {
+ @Override
+ public synchronized IRegion actualToHistoric(IRegion actualPosition) {
int actual= actualPosition.getOffset();
int len= actualPosition.getLength();
-
+
int historic= historicOffset(actual, true);
if (len > 0) {
len= historicOffset(actual+len-1, false) - historic + 1;
@@ -178,10 +179,11 @@ public class PositionTracker implements IPositionConverter {
return new Region(historic, len);
}
- public synchronized IRegion historicToActual(IRegion historicPosition) {
+ @Override
+ public synchronized IRegion historicToActual(IRegion historicPosition) {
int historic= historicPosition.getOffset();
int len= historicPosition.getLength();
-
+
int actual= currentOffset(historic, true);
if (len > 0) {
len= currentOffset(historic+len-1, false) - actual + 1;
@@ -189,7 +191,7 @@ public class PositionTracker implements IPositionConverter {
assert len >= 0;
return new Region(actual, len);
}
-
+
/**
* Nodes implementing a red black binary tree.
* @author markus.schorn@windriver.com
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PositionTrackerChain.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PositionTrackerChain.java
index 654fcff0d43..da4d5a99383 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PositionTrackerChain.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PositionTrackerChain.java
@@ -7,7 +7,7 @@
*
* Contributors:
* Markus Schorn - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/
package org.eclipse.cdt.internal.core;
import java.util.Iterator;
@@ -19,13 +19,13 @@ import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IDocumentListener;
class PositionTrackerChain implements IDocumentListener {
- public static final int LINKED_LIST_SIZE = 64;
+ public static final int LINKED_LIST_SIZE = 64;
public static final int LINKED_LIST_ENTRY_SIZE = 32;
public static int MEMORY_SIZE= 32 + LINKED_LIST_SIZE;
-
+
private static final int MAX_DEPTH = 100; // 100 saves
private static final long MAX_AGE = 24 * 60 * 60 * 1000; // one day
-
+
private LinkedList fTrackers= new LinkedList();
private PositionTracker fActiveTracker;
private IDocument fDocument;
@@ -33,7 +33,7 @@ class PositionTrackerChain implements IDocumentListener {
public PositionTrackerChain(long timestamp) {
createCheckpoint(timestamp);
}
-
+
public int createCheckpoint(long timestamp) {
// travel in time
while (fActiveTracker != null && fActiveTracker.getTimeStamp() >= timestamp) {
@@ -51,7 +51,7 @@ class PositionTrackerChain implements IDocumentListener {
PositionTracker newTracker= new PositionTracker();
newTracker.setTimeStamp(timestamp);
fTrackers.add(newTracker);
-
+
if (fActiveTracker != null) {
fActiveTracker.retire(newTracker);
retiredMemsize= fActiveTracker.getMemorySize() + LINKED_LIST_ENTRY_SIZE;
@@ -60,7 +60,7 @@ class PositionTrackerChain implements IDocumentListener {
checkTrackerLimits();
return retiredMemsize;
}
-
+
private void checkTrackerLimits() {
while (fTrackers.size() >= MAX_DEPTH) {
fTrackers.removeFirst();
@@ -74,7 +74,7 @@ class PositionTrackerChain implements IDocumentListener {
iter.remove();
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.jface.text.IPositionUpdater#update(org.eclipse.jface.text.DocumentEvent)
*/
@@ -155,14 +155,16 @@ class PositionTrackerChain implements IDocumentListener {
}
}
- public void documentAboutToBeChanged(DocumentEvent event) {
+ @Override
+ public void documentAboutToBeChanged(DocumentEvent event) {
update(event);
}
- public void documentChanged(DocumentEvent event) {
+ @Override
+ public void documentChanged(DocumentEvent event) {
// react before updateing the document
}
-
+
public IDocument getCurrentDocument() {
return fDocument;
}
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PositionTrackerManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PositionTrackerManager.java
index 09f225562e8..653ecfd05b6 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PositionTrackerManager.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/PositionTrackerManager.java
@@ -7,7 +7,7 @@
*
* Contributors:
* Markus Schorn - initial API and implementation
- *******************************************************************************/
+ *******************************************************************************/
package org.eclipse.cdt.internal.core;
import java.net.URI;
@@ -34,7 +34,7 @@ public class PositionTrackerManager implements IPositionTrackerManager, IFileBuf
private static final int HASHMAP_ENTRY_SIZE = 56;
private static final int MAX_MEMORY= 1024*512; // 512 kbytes
private static final int MAX_MEMORY_AFTER_CLEANUP= (MAX_MEMORY * 7) / 10; // 70% of MAX_MEMORY
-
+
private static PositionTrackerManager sManager= new PositionTrackerManager();
public static PositionTrackerManager getInstance() {
return sManager;
@@ -49,7 +49,7 @@ public class PositionTrackerManager implements IPositionTrackerManager, IFileBuf
* the location as URI for non-local non-workspace files.
*/
private HashMap fPositionTrackerMap;
-
+
private PositionTrackerManager() {
fPositionTrackerMap= new HashMap();
}
@@ -60,7 +60,7 @@ public class PositionTrackerManager implements IPositionTrackerManager, IFileBuf
mgr.addFileBufferListener(this);
}
}
-
+
public synchronized void uninstall() {
if (--fInstalled == 0) {
FileBuffers.getTextFileBufferManager().removeFileBufferListener(this);
@@ -69,36 +69,46 @@ public class PositionTrackerManager implements IPositionTrackerManager, IFileBuf
}
}
- public void bufferCreated(IFileBuffer buffer) {
+ @Override
+ public void bufferCreated(IFileBuffer buffer) {
if (buffer instanceof ITextFileBuffer) {
createCheckpoint((ITextFileBuffer) buffer);
}
}
- public void bufferDisposed(IFileBuffer buffer) {
+ @Override
+ public void bufferDisposed(IFileBuffer buffer) {
if (buffer instanceof ITextFileBuffer) {
resetToLastCheckpoint((ITextFileBuffer) buffer);
}
}
- public void dirtyStateChanged(IFileBuffer buffer, boolean isDirty) {
+ @Override
+ public void dirtyStateChanged(IFileBuffer buffer, boolean isDirty) {
if (!isDirty && buffer instanceof ITextFileBuffer) {
createCheckpoint((ITextFileBuffer) buffer);
}
}
- public void stateValidationChanged(IFileBuffer buffer, boolean isStateValidated) {
+ @Override
+ public void stateValidationChanged(IFileBuffer buffer, boolean isStateValidated) {
if (isStateValidated && !buffer.isDirty()) {
bufferCreated(buffer);
}
}
-
- public void bufferContentAboutToBeReplaced(IFileBuffer buffer) {}
- public void bufferContentReplaced(IFileBuffer buffer) {}
- public void underlyingFileMoved(IFileBuffer buffer, IPath path) {}
- public void underlyingFileDeleted(IFileBuffer buffer) {}
- public void stateChangeFailed(IFileBuffer buffer) {}
- public void stateChanging(IFileBuffer buffer) {}
+
+ @Override
+ public void bufferContentAboutToBeReplaced(IFileBuffer buffer) {}
+ @Override
+ public void bufferContentReplaced(IFileBuffer buffer) {}
+ @Override
+ public void underlyingFileMoved(IFileBuffer buffer, IPath path) {}
+ @Override
+ public void underlyingFileDeleted(IFileBuffer buffer) {}
+ @Override
+ public void stateChangeFailed(IFileBuffer buffer) {}
+ @Override
+ public void stateChanging(IFileBuffer buffer) {}
private synchronized void createCheckpoint(ITextFileBuffer buffer) {
final Object bufferKey= getKey(buffer);
@@ -117,7 +127,7 @@ public class PositionTrackerManager implements IPositionTrackerManager, IFileBuf
runCleanup();
}
}
-
+
private Object getKey(ITextFileBuffer buffer) {
Object key= buffer.getLocation();
if (key == null) {
@@ -143,7 +153,7 @@ public class PositionTrackerManager implements IPositionTrackerManager, IFileBuf
}
}
}
-
+
private synchronized void runCleanup() {
fMemoryCounter= 0;
for (PositionTrackerChain chain : fPositionTrackerMap.values()) {
@@ -168,7 +178,7 @@ public class PositionTrackerManager implements IPositionTrackerManager, IFileBuf
break;
}
}
- }
+ }
}
private synchronized void addChain(SortedMap> map, PositionTrackerChain chain) {
@@ -187,18 +197,20 @@ public class PositionTrackerManager implements IPositionTrackerManager, IFileBuf
/**
* {@inheritDoc}
*/
- public synchronized IPositionConverter findPositionConverter(IFile file, long timestamp) {
+ @Override
+ public synchronized IPositionConverter findPositionConverter(IFile file, long timestamp) {
PositionTrackerChain chain= fPositionTrackerMap.get(file.getFullPath());
if (chain != null) {
return chain.findTrackerAt(timestamp);
}
return null;
}
-
+
/**
* {@inheritDoc}
*/
- public synchronized IPositionConverter findPositionConverter(IPath externalLocation, long timestamp) {
+ @Override
+ public synchronized IPositionConverter findPositionConverter(IPath externalLocation, long timestamp) {
PositionTrackerChain chain= fPositionTrackerMap.get(externalLocation);
if (chain != null) {
return chain.findTrackerAt(timestamp);
@@ -209,28 +221,30 @@ public class PositionTrackerManager implements IPositionTrackerManager, IFileBuf
/**
* {@inheritDoc}
*/
- public synchronized IPositionConverter findPositionConverter(ITranslationUnit tu, long timestamp) {
+ @Override
+ public synchronized IPositionConverter findPositionConverter(ITranslationUnit tu, long timestamp) {
IFile file= (IFile) tu.getResource();
if (file != null) {
return findPositionConverter(file, timestamp);
- }
+ }
IPath location= tu.getLocation();
if (location != null) {
return findPositionConverter(location, timestamp);
}
-
+
URI locationURI = tu.getLocationURI();
if (locationURI != null) {
return findPositionConverter(locationURI, timestamp);
}
-
+
return null;
}
-
+
/**
* {@inheritDoc}
*/
- public synchronized IPositionConverter findPositionConverter(URI locationURI, long timestamp) {
+ @Override
+ public synchronized IPositionConverter findPositionConverter(URI locationURI, long timestamp) {
PositionTrackerChain chain= fPositionTrackerMap.get(locationURI);
if (chain == null) {
IPath path= URIUtil.toPath(locationURI);
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/SystemBuildConsole.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/SystemBuildConsole.java
index 7ac9c1958cc..f1e2a46fc89 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/SystemBuildConsole.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/SystemBuildConsole.java
@@ -24,14 +24,14 @@ import org.eclipse.core.runtime.CoreException;
public class SystemBuildConsole implements IConsole {
final ConsoleOutputStream out;
final ConsoleOutputStream err;
-
+
public SystemBuildConsole() {
out = new ConsoleOutputStream() {
@Override
public synchronized void write(byte[] b, int off, int len) throws java.io.IOException {
System.out.write(b, off, len);
}
-
+
@Override
public synchronized void write(int c) throws java.io.IOException {
System.out.write(c);
@@ -42,7 +42,7 @@ public class SystemBuildConsole implements IConsole {
public synchronized void write(byte[] b, int off, int len) throws java.io.IOException {
System.err.write(b, off, len);
}
-
+
@Override
public synchronized void write(int c) throws java.io.IOException {
System.err.write(c);
@@ -50,17 +50,21 @@ public class SystemBuildConsole implements IConsole {
};
}
+ @Override
public void start(IProject project) {
}
+ @Override
public ConsoleOutputStream getOutputStream() throws CoreException {
return out;
}
+ @Override
public ConsoleOutputStream getInfoStream() throws CoreException {
return out;
}
+ @Override
public ConsoleOutputStream getErrorStream() throws CoreException {
return err;
}
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/CdtVariableManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/CdtVariableManager.java
index 133c6021a6b..e52dc31bc1b 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/CdtVariableManager.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/CdtVariableManager.java
@@ -32,25 +32,26 @@ import org.eclipse.core.variables.IStringVariable;
*/
public class CdtVariableManager implements ICdtVariableManager {
static private CdtVariableManager fDefault;
-
+
public static final UserDefinedVariableSupplier fUserDefinedMacroSupplier = UserDefinedVariableSupplier.getInstance();
public static final BuildSystemVariableSupplier fBuildSystemVariableSupplier = BuildSystemVariableSupplier.getInstance();
public static final EnvironmentVariableSupplier fEnvironmentMacroSupplier = EnvironmentVariableSupplier.getInstance();
public static final CdtMacroSupplier fCdtMacroSupplier = CdtMacroSupplier.getInstance();
public static final EclipseVariablesVariableSupplier fEclipseVariablesMacroSupplier = EclipseVariablesVariableSupplier.getInstance();
-
+
protected CdtVariableManager(){
-
+
}
-
+
public static CdtVariableManager getDefault(){
if(fDefault == null)
fDefault = new CdtVariableManager();
- return fDefault;
+ return fDefault;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider#getMacro(java.lang.String, int, java.lang.Object, boolean)
*/
+ @Override
public ICdtVariable getVariable(String macroName, ICConfigurationDescription cfg) {
if(cfg instanceof CConfigurationDescriptionCache){
StorableCdtVariables macros = ((CConfigurationDescriptionCache)cfg).getCachedVariables();
@@ -61,7 +62,7 @@ public class CdtVariableManager implements ICdtVariableManager {
return SupplierBasedCdtVariableManager.getVariable(macroName,
getMacroContextInfo(type,cfg),true);
}
-
+
private IVariableContextInfo getVariableContextInfo(ICConfigurationDescription cfg){
int type = getContextType(cfg);
return getMacroContextInfo(type,cfg);
@@ -70,6 +71,7 @@ public class CdtVariableManager implements ICdtVariableManager {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider#getMacros(int, java.lang.Object, boolean)
*/
+ @Override
public ICdtVariable[] getVariables(ICConfigurationDescription cfg) {
if(cfg instanceof CConfigurationDescriptionCache){
StorableCdtVariables macros = ((CConfigurationDescriptionCache)cfg).getCachedVariables();
@@ -91,7 +93,7 @@ public class CdtVariableManager implements ICdtVariableManager {
return info.getSuppliers();
return null;
}
-
+
public IVariableContextInfo getMacroContextInfo(
int contextType,
Object contextData){
@@ -104,6 +106,7 @@ public class CdtVariableManager implements ICdtVariableManager {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider#convertStringListToString(java.lang.String[], java.lang.String)
*/
+ @Override
public String convertStringListToString(String[] value, String listDelimiter) {
return CdtVariableResolver.convertStringListToString(value,listDelimiter);
}
@@ -111,33 +114,36 @@ public class CdtVariableManager implements ICdtVariableManager {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider#resolveValue(java.lang.String, java.lang.String, java.lang.String, int, java.lang.Object)
*/
+ @Override
public String resolveValue(String value, String nonexistentMacrosValue,
String listDelimiter, ICConfigurationDescription cfg)
throws CdtVariableException {
-
+
IVariableContextInfo info = getMacroContextInfo(getContextType(cfg),cfg);
if(info != null)
return CdtVariableResolver.resolveToString(value,
getMacroSubstitutor(info,nonexistentMacrosValue, listDelimiter));
return null;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider#resolveStringListValue(java.lang.String, java.lang.String, int, java.lang.Object)
*/
+ @Override
public String[] resolveStringListValue(String value,
String nonexistentMacrosValue, String listDelimiter,
ICConfigurationDescription cfg) throws CdtVariableException {
-
+
IVariableContextInfo info = getMacroContextInfo(getContextType(cfg),cfg);
if(info != null)
- return CdtVariableResolver.resolveToStringList(value,getMacroSubstitutor(info,nonexistentMacrosValue, listDelimiter));
+ return CdtVariableResolver.resolveToStringList(value,getMacroSubstitutor(info,nonexistentMacrosValue, listDelimiter));
return null;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider#isStringListValue(java.lang.String)
*/
+ @Override
public boolean isStringListValue(String value, ICConfigurationDescription cfg) throws CdtVariableException {
try {
CdtVariableResolver.resolveToStringList(value,getMacroSubstitutor(getMacroContextInfo(getContextType(cfg), cfg)," ",null)); //$NON-NLS-1$
@@ -151,6 +157,7 @@ public class CdtVariableManager implements ICdtVariableManager {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider#checkIntegrity(int, java.lang.Object)
*/
+ @Override
public void checkVariableIntegrity(ICConfigurationDescription cfg)
throws CdtVariableException {
@@ -167,7 +174,7 @@ public class CdtVariableManager implements ICdtVariableManager {
if(info != null)
CdtVariableResolver.checkIntegrity(info,subst);
}
-
+
private int getContextType(ICConfigurationDescription des){
if(des != null)
return ICoreVariableContextInfo.CONTEXT_CONFIGURATION;
@@ -181,6 +188,7 @@ public class CdtVariableManager implements ICdtVariableManager {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider#resolveStringListValues(java.lang.String[], java.lang.String, java.lang.String, int, java.lang.Object)
*/
+ @Override
public String[] resolveStringListValues(String[] value, String nonexistentMacrosValue, String listDelimiter, ICConfigurationDescription cfg) throws CdtVariableException {
IVariableContextInfo info = getMacroContextInfo(getContextType(cfg),cfg);
if(info != null)
@@ -189,32 +197,33 @@ public class CdtVariableManager implements ICdtVariableManager {
return null;
}
+ @Override
public boolean isEnvironmentVariable(ICdtVariable variable,
ICConfigurationDescription cfg) {
if(variable instanceof EnvironmentVariableSupplier.EnvVarMacro)
return true;
-
+
IVariableContextInfo info = getVariableContextInfo(cfg);
ICdtVariable var = fEnvironmentMacroSupplier.getVariable(variable.getName(), info);
if(var != null && variablesEqual(var, variable))
return true;
-
+
return false;
}
-
+
private static boolean variablesEqual(ICdtVariable var1, ICdtVariable var2){
if(CDataUtil.objectsEqual(var1, var2))
return true;
-
+
if(var1 == null || var2 == null)
return false;
-
+
if(var1.getValueType() != var2.getValueType())
return false;
-
+
if(!var1.getName().equals(var2.getName()))
return false;
-
+
try {
if(CdtVariableResolver.isStringListVariable(var1.getValueType())){
String[] v1 = var1.getStringListValue();
@@ -228,10 +237,11 @@ public class CdtVariableManager implements ICdtVariableManager {
} catch (CdtVariableException e){
return false;
}
-
+
return true;
}
+ @Override
public IStringVariable toEclipseVariable(ICdtVariable variable,
ICConfigurationDescription cfg) {
if(variable instanceof EclipseVariablesVariableSupplier.EclipseVarMacro){
@@ -240,14 +250,15 @@ public class CdtVariableManager implements ICdtVariableManager {
return null;
}
+ @Override
public boolean isUserVariable(ICdtVariable variable,
ICConfigurationDescription cfg) {
if(!(variable instanceof StorableCdtVariable))
return false;
-
+
if(cfg != null)
return UserDefinedVariableSupplier.getInstance().containsVariable(ICoreVariableContextInfo.CONTEXT_CONFIGURATION, cfg, variable);
-
+
return UserDefinedVariableSupplier.getInstance().containsVariable(ICoreVariableContextInfo.CONTEXT_WORKSPACE, null, variable);
}
}
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/CoreMacroSupplierBase.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/CoreMacroSupplierBase.java
index 78c5e7b32d8..193721e588a 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/CoreMacroSupplierBase.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/CoreMacroSupplierBase.java
@@ -16,6 +16,7 @@ import org.eclipse.cdt.utils.cdtvariables.IVariableContextInfo;
public abstract class CoreMacroSupplierBase implements ICdtVariableSupplier {
+ @Override
public ICdtVariable getVariable(String macroName, IVariableContextInfo context) {
if(context instanceof ICoreVariableContextInfo){
ICoreVariableContextInfo info = (ICoreVariableContextInfo)context;
@@ -23,9 +24,10 @@ public abstract class CoreMacroSupplierBase implements ICdtVariableSupplier {
}
return null;
}
-
+
protected abstract ICdtVariable getMacro(String name, int type, Object data);
+ @Override
public ICdtVariable[] getVariables(IVariableContextInfo context) {
if(context instanceof ICoreVariableContextInfo){
ICoreVariableContextInfo info = (ICoreVariableContextInfo)context;
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/DefaultVariableContextInfo.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/DefaultVariableContextInfo.java
index 61f02f18f56..504734d6309 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/DefaultVariableContextInfo.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/DefaultVariableContextInfo.java
@@ -18,7 +18,7 @@ import org.eclipse.core.resources.ResourcesPlugin;
/**
* This is the default implementation of the IMacroContextInfo
- *
+ *
* @since 3.0
*/
public class DefaultVariableContextInfo implements ICoreVariableContextInfo {
@@ -26,12 +26,12 @@ public class DefaultVariableContextInfo implements ICoreVariableContextInfo {
private ICdtVariableSupplier fSuppliers[];
private int fType;
private Object fData;
-
+
public DefaultVariableContextInfo(int type, Object data){
fType = type;
fData = data;
}
-
+
protected DefaultVariableContextInfo(int type, Object data, ICdtVariableSupplier suppliers[]){
fType = type;
fData = data;
@@ -63,7 +63,7 @@ public class DefaultVariableContextInfo implements ICoreVariableContextInfo {
case CONTEXT_INSTALLATIONS:
if(data == null){
return new ICdtVariableSupplier[]{
- CdtVariableManager.fCdtMacroSupplier
+ CdtVariableManager.fCdtMacroSupplier
};
}
break;
@@ -81,6 +81,7 @@ public class DefaultVariableContextInfo implements ICoreVariableContextInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.internal.macros.IMacroContextInfo#getContextType()
*/
+ @Override
public int getContextType() {
return fType;
}
@@ -88,6 +89,7 @@ public class DefaultVariableContextInfo implements ICoreVariableContextInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.internal.macros.IMacroContextInfo#getContextData()
*/
+ @Override
public Object getContextData() {
return fData;
}
@@ -95,6 +97,7 @@ public class DefaultVariableContextInfo implements ICoreVariableContextInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.internal.macros.IMacroContextInfo#getSuppliers()
*/
+ @Override
public ICdtVariableSupplier[] getSuppliers() {
if(fSuppliers == null)
fSuppliers = getSuppliers(fType, fData);
@@ -104,6 +107,7 @@ public class DefaultVariableContextInfo implements ICoreVariableContextInfo {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.internal.macros.IMacroContextInfo#getNext()
*/
+ @Override
public IVariableContextInfo getNext() {
switch(fType){
case CONTEXT_CONFIGURATION:
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/EclipseVariablesVariableSupplier.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/EclipseVariablesVariableSupplier.java
index a6f03c0824a..2ec40dc0bb8 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/EclipseVariablesVariableSupplier.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/EclipseVariablesVariableSupplier.java
@@ -32,7 +32,7 @@ import org.eclipse.osgi.util.NLS;
/**
* This supplier suplies the macros that represent the Eclipse variables
- *
+ *
* @since 3.0
*/
public class EclipseVariablesVariableSupplier implements ICdtVariableSupplier {
@@ -40,13 +40,13 @@ public class EclipseVariablesVariableSupplier implements ICdtVariableSupplier {
private static final Pattern RESOURCE_VARIABLE_PATTERN= Pattern.compile("(project|resource|container)_(loc|path|name)"); //$NON-NLS-1$
// private static final String VAR_PREFIX = "${"; //$NON-NLS-1$
-// private static final char VAR_SUFFIX = '}';
- private static final char COLON = ':';
-
+// private static final char VAR_SUFFIX = '}';
+ private static final char COLON = ':';
+
private static EclipseVariablesVariableSupplier fInstance;
-
+
private EclipseVariablesVariableSupplier(){
-
+
}
public static EclipseVariablesVariableSupplier getInstance(){
@@ -54,12 +54,12 @@ public class EclipseVariablesVariableSupplier implements ICdtVariableSupplier {
fInstance = new EclipseVariablesVariableSupplier();
return fInstance;
}
-
+
public class EclipseVarMacro extends CdtVariable {
private IStringVariable fVariable;
private String fArgument;
private boolean fInitialized;
-
+
private EclipseVarMacro(IStringVariable var){
this(var,null);
}
@@ -94,7 +94,7 @@ public class EclipseVariablesVariableSupplier implements ICdtVariableSupplier {
}
return fStringValue;
}
-
+
private void loadValue(IStringVariable var) throws CdtVariableException {
if(var instanceof IDynamicVariable){
IDynamicVariable dynamicVar = (IDynamicVariable)var;
@@ -106,16 +106,16 @@ public class EclipseVariablesVariableSupplier implements ICdtVariableSupplier {
}
}else
fStringValue = null;
-
+
}else if(var instanceof IValueVariable){
if(fArgument == null)
fStringValue = ((IValueVariable)var).getValue();
else
fStringValue = null;
}
-
+
}
-
+
public IStringVariable getVariable(){
return fVariable;
}
@@ -124,6 +124,7 @@ public class EclipseVariablesVariableSupplier implements ICdtVariableSupplier {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacroSupplier#getMacro(java.lang.String, int, java.lang.Object)
*/
+ @Override
public ICdtVariable getVariable(String macroName, IVariableContextInfo info) {
return getVariable(macroName);
}
@@ -134,7 +135,7 @@ public class EclipseVariablesVariableSupplier implements ICdtVariableSupplier {
// return null;
if(macroName == null || "".equals(macroName)) //$NON-NLS-1$
return null;
-
+
String varName = null;
String param = null;
IStringVariable var = null;
@@ -145,14 +146,14 @@ public class EclipseVariablesVariableSupplier implements ICdtVariableSupplier {
varName = macroName.substring(0,index);
param = macroName.substring(index+1);
}
-
+
if(varName != null){
IStringVariableManager mngr = VariablesPlugin.getDefault().getStringVariableManager();
var = mngr.getValueVariable(varName);
if(var == null)
var = mngr.getDynamicVariable(varName);
}
-
+
if(var != null)
return new EclipseVarMacro(var,param);
return null;
@@ -161,6 +162,7 @@ public class EclipseVariablesVariableSupplier implements ICdtVariableSupplier {
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.macros.IBuildMacroSupplier#getMacros(int, java.lang.Object)
*/
+ @Override
public ICdtVariable[] getVariables(IVariableContextInfo info) {
return getVariables();
}
@@ -178,7 +180,7 @@ public class EclipseVariablesVariableSupplier implements ICdtVariableSupplier {
map.put(name,var);
}
}
-
+
IValueVariable valVars[] = mngr.getValueVariables();
for (IValueVariable valVar : valVars)
map.put(valVar.getName(),valVar);
@@ -188,7 +190,7 @@ public class EclipseVariablesVariableSupplier implements ICdtVariableSupplier {
Iterator iter = collection.iterator();
for(int i = 0; i < macros.length ; i++)
macros[i] = new EclipseVarMacro(iter.next());
-
+
return macros;
}
@@ -202,7 +204,7 @@ public class EclipseVariablesVariableSupplier implements ICdtVariableSupplier {
|| name.endsWith("_prompt") //$NON-NLS-1$
|| name.equals("selected_text"); //$NON-NLS-1$
}
-
+
private static boolean canExpandVariable(String name, String argument) {
if (argument == null && RESOURCE_VARIABLE_PATTERN.matcher(name).matches()) {
return false;
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/StorableCdtVariables.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/StorableCdtVariables.java
index 72e7504d386..956f9f214b5 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/StorableCdtVariables.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/cdtvariables/StorableCdtVariables.java
@@ -25,7 +25,7 @@ import org.eclipse.cdt.utils.cdtvariables.CdtVariableResolver;
/**
* This class represents the set of Build Macros that could be loaded
* and stored in XML
- *
+ *
* @since 3.0
*
*/
@@ -35,13 +35,13 @@ public class StorableCdtVariables implements IStorableCdtVariables {
private boolean fIsDirty = false;
private boolean fIsChanged = false;
private boolean fIsReadOnly;
-
+
private HashMap getMap(){
if(fMacros == null)
fMacros = new HashMap