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

auto-clean: @Override annotations + organize imports + unnecessary

casts/$NON-NLS + trailing white spaces
This commit is contained in:
Andrew Gvozdev 2011-11-17 18:14:36 -05:00
parent 2a1cddd716
commit 5c1a981cd7
311 changed files with 6186 additions and 4412 deletions

View file

@ -57,6 +57,7 @@ public interface IMethodDeclaration extends IMember, IFunctionDeclaration {
* Returns if this method is static or not
* @return boolean
*/
@Override
public boolean isStatic() throws CModelException;
/**

View file

@ -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();

View file

@ -164,10 +164,12 @@ public class LanguageManager {
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);
}
@ -325,10 +327,12 @@ public class LanguageManager {
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);
}}
@ -364,10 +368,12 @@ public class LanguageManager {
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);
}

View file

@ -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,6 +51,7 @@ 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
@ -84,6 +87,7 @@ public class LanguageMappingChangeEvent implements ILanguageMappingChangeEvent {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ILanguageMappingsChangeEvent#getPath()
*/
@Override
public IPath getPath() {
if(fPath != null)
@ -103,6 +107,7 @@ public class LanguageMappingChangeEvent implements ILanguageMappingChangeEvent {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ILanguageMappingsChangeEvent#getProject()
*/
@Override
public IProject getProject() {
if(fProject != null)
@ -121,6 +126,7 @@ public class LanguageMappingChangeEvent implements ILanguageMappingChangeEvent {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ILanguageMappingsChangeEvent#getType()
*/
@Override
public int getType() {
return fType;
}

View file

@ -25,6 +25,7 @@ public class CDTListComparator implements Comparator<Object> {
comparator = new CDTListComparator();
return comparator;
}
@Override
public int compare(Object a, Object b) {
if (a == null || b == null)
return 0;

View file

@ -45,6 +45,7 @@ public abstract class ACExclusionFilterEntry extends ACPathEntry implements ICEx
* 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;

View file

@ -47,6 +47,7 @@ public abstract class ACPathEntry extends ACSettingEntry
// fLocation = path;
}
@Override
public IPath getFullPath() {
if(isValueWorkspacePath())
return new Path(getValue());
@ -69,6 +70,7 @@ public abstract class ACPathEntry extends ACSettingEntry
protected abstract boolean isFile();
@Override
public IPath getLocation() {
if(!isValueWorkspacePath())
return new Path(getValue());
@ -81,6 +83,7 @@ public abstract class ACPathEntry extends ACSettingEntry
return null;
}
@Override
public boolean isValueWorkspacePath() {
return checkFlags(VALUE_WORKSPACE_PATH);
}

View file

@ -24,10 +24,12 @@ public abstract class ACSettingEntry implements ICSettingEntry {
fFlags = flags;
}
@Override
public boolean isBuiltIn() {
return checkFlags(BUILTIN);
}
@Override
public boolean isReadOnly() {
return checkFlags(READONLY);
}
@ -36,16 +38,19 @@ public abstract class ACSettingEntry implements ICSettingEntry {
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
//for all other entries
return fName;
}
@Override
public boolean isResolved() {
return checkFlags(RESOLVED);
}
@ -77,10 +82,12 @@ public abstract class ACSettingEntry implements ICSettingEntry {
return getKind() + fFlags + fName.hashCode();
}
@Override
public int getFlags() {
return fFlags;
}
@Override
public boolean equalsByContents(ICSettingEntry entry) {
return equalsByName(entry);
}
@ -89,6 +96,7 @@ public abstract class ACSettingEntry implements ICSettingEntry {
return (fFlags & (~ (BUILTIN | READONLY | RESOLVED)));
}
@Override
public final boolean equalsByName(ICSettingEntry entry) {
if(entry == this)
return true;

View file

@ -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<ICSettingEntry> result = new ArrayList<ICSettingEntry>();
int kinds[] = KindBasedStore.getAllEntryKinds();

View file

@ -28,6 +28,7 @@ public final class CIncludeFileEntry extends ACPathEntry implements
super(rc, flags);
}
@Override
public final int getKind() {
return INCLUDE_FILE;
}

View file

@ -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;
}

View file

@ -71,6 +71,7 @@ public final class CLibraryFileEntry extends ACPathEntry implements
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;
}

View file

@ -28,6 +28,7 @@ public final class CLibraryPathEntry extends ACPathEntry implements
super(rc, flags);
}
@Override
public final int getKind() {
return LIBRARY_PATH;
}

View file

@ -29,6 +29,7 @@ public final class CMacroEntry extends ACSettingEntry implements ICMacroEntry{
return fValue;
}
@Override
public final int getKind() {
return MACRO;
}

View file

@ -28,6 +28,7 @@ public final class CMacroFileEntry extends ACPathEntry implements
super(rc, flags);
}
@Override
public final int getKind() {
return MACRO_FILE;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -175,6 +175,7 @@ public interface ICConfigurationDescription extends ICSettingContainer, ICSettin
/**
* Returns whether or not the configuration description was modified
*/
@Override
boolean isModified();
/**

View file

@ -19,5 +19,6 @@ public interface ICMacroEntry extends ICLanguageSettingEntry {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICSettingEntry#getValue()
*/
@Override
String getValue();
}

View file

@ -114,6 +114,7 @@ public interface ICProjectDescription extends ICSettingContainer,
/**
* @return true if the project description was modified, false otherwise
*/
@Override
boolean isModified();
/**

View file

@ -25,6 +25,7 @@ public abstract class MultiItemsHolder implements ICMultiItemsHolder {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICMultiItemsHolder#getItems()
*/
@Override
public abstract Object[] getItems();
/* (non-Javadoc)

View file

@ -30,6 +30,7 @@ public class MultiLanguageSetting extends MultiItemsHolder implements ICLanguage
/* (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<ICLanguageSettingEntry> 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<ICLanguageSettingEntry> 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<items.length; i++)
if (! items[i].isReadOnly())
@ -187,6 +202,7 @@ public class MultiLanguageSetting extends MultiItemsHolder implements ICLanguage
/* (non-Javadoc)
* @see org.eclipse.cdt.core.settings.model.ICSettingObject#isValid()
*/
@Override
public boolean isValid() {
for (int i=0; i<items.length; i++)
if (! items[i].isValid())
@ -199,19 +215,23 @@ public class MultiLanguageSetting extends MultiItemsHolder implements ICLanguage
return items;
}
@Override
public ICLanguageSettingEntry[] getResolvedSettingEntries(int kind) {
return null;
}
@Override
public ICLanguageSettingEntry[] getSettingEntries(int kind) {
ICLanguageSettingEntry[][] ses = getSettingEntriesM(kind);
return ses[0];
}
@Override
public String[] getSourceContentTypeIds() {
return null;
}
@Override
public String[] getSourceExtensions() {
return null;
}

View file

@ -70,6 +70,7 @@ public class CResourceDataContainer {
final List<CResourceData> list = new ArrayList<CResourceData>();
fRcDataContainer.accept(new IPathSettingsContainerVisitor(){
@Override
public boolean visit(PathSettingsContainer container) {
if(fIncludeCurrent || container != fRcDataContainer){
CResourceData data = (CResourceData)container.getValue();

View file

@ -177,16 +177,19 @@ public class KindBasedStore<T> implements Cloneable {
}
}
@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];

View file

@ -990,6 +990,7 @@ public class PathEntryTranslator {
final Set<PathEntryComposer> set = new HashSet<PathEntryComposer>();
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) {

View file

@ -181,6 +181,7 @@ public final class PathSettingsContainer {
final List<PathSettingsContainer> list = new ArrayList<PathSettingsContainer>();
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<Object> list = new ArrayList<Object>();
accept(new IPathSettingsContainerVisitor(){
@Override
public boolean visit(PathSettingsContainer container) {
if(container != PathSettingsContainer.this || includeThis)
list.add(container.getValue());

View file

@ -17,8 +17,8 @@ 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;
@ -70,14 +70,17 @@ public class PatternNameMap {
private class EmptyIterator implements Iterator<PathSettingsContainer>{
@Override
public boolean hasNext() {
return false;
}
@Override
public PathSettingsContainer next() {
throw new NoSuchElementException();
}
@Override
public void remove() {
throw new IllegalStateException();
}
@ -93,15 +96,18 @@ public class PatternNameMap {
Iter (Iterator<Entry<String, PathSettingsContainer>> 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();

View file

@ -89,6 +89,7 @@ public abstract class ResourceChangeHandlerBase implements IResourceChangeListen
return true;
}
@Override
public boolean visit(IResourceDelta delta) throws CoreException {
IResource dResource = delta.getResource();
@ -142,6 +143,7 @@ public abstract class ResourceChangeHandlerBase implements IResourceChangeListen
*
* @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);

View file

@ -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,10 +137,12 @@ 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);
@ -182,6 +185,7 @@ public class XmlStorageElement implements ICStorageElement {
}
@Override
public void removeChild(ICStorageElement el) {
if(el instanceof XmlStorageElement){
ICStorageElement[] children = getChildren();
@ -205,16 +209,19 @@ 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();
@ -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){
@ -294,6 +305,7 @@ public class XmlStorageElement implements ICStorageElement {
return text;
}
@Override
public ICStorageElement importChild(ICStorageElement el) throws UnsupportedOperationException {
return addChild(el, true, null, null);
}
@ -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;

View file

@ -334,6 +334,7 @@ public class ASTCache {
final IASTTranslationUnit root[]= new IASTTranslationUnit[1];
SafeRunner.run(new ISafeRunnable() {
@Override
public void run() throws CoreException {
try {
if (progressMonitor != null && progressMonitor.isCanceled()) {
@ -345,6 +346,7 @@ 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);

View file

@ -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];

View file

@ -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();

View file

@ -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;
}

View file

@ -22,8 +22,8 @@ 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.
@ -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) {
}
}
@ -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) {

View file

@ -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;
@ -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()) {
@ -534,6 +546,7 @@ public class Binary extends Openable implements IBinary {
super.closing(info);
}
@Override
public boolean showInBinaryContainer() {
return showInBinaryContainer;
}

View file

@ -38,6 +38,7 @@ public class BinaryContainer extends Openable implements IBinaryContainer {
}
}
@Override
public IBinary[] getBinaries() throws CModelException {
sync();
ICElement[] e = getChildren();

View file

@ -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,6 +105,7 @@ 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(),
@ -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;
}

View file

@ -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;

View file

@ -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,6 +52,7 @@ 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;
}
@ -58,6 +60,7 @@ public class BinaryModule extends Parent implements IBinaryModule {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.IBinaryElement#getBinary()
*/
@Override
public IBinary getBinary() {
return (IBinary)getParent();
}

View file

@ -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;

View file

@ -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,6 +70,7 @@ 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;

View file

@ -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<IBufferChangedListener>(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;
@ -284,6 +302,7 @@ public class Buffer implements IBuffer {
/**
* @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,6 +310,7 @@ 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
@ -340,6 +360,7 @@ 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
// after creation by buffer factory
@ -368,6 +389,7 @@ 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());
}

View file

@ -92,6 +92,7 @@ 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;

View file

@ -53,6 +53,7 @@ public class CContainer extends Openable implements ICContainer {
*
* @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);
@ -81,6 +83,7 @@ public class CContainer extends Openable implements ICContainer {
*
* @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()];
@ -119,6 +124,7 @@ public class CContainer extends Openable implements ICContainer {
*
* @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);
@ -134,6 +140,7 @@ public class CContainer extends Openable implements ICContainer {
*
* @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()];
@ -146,6 +153,7 @@ public class CContainer extends Openable implements ICContainer {
*
* @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);
@ -198,6 +206,7 @@ public class CContainer extends Openable implements ICContainer {
*
* @see org.eclipse.cdt.core.model.ICContainer#getNonCResources()
*/
@Override
public Object[] getNonCResources() throws CModelException {
return ((CContainerInfo) getElementInfo()).getNonCResources(getResource());
}

View file

@ -97,18 +97,22 @@ public abstract class CElement extends PlatformObject implements ICElement {
// 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)
@ -116,6 +120,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
return new Path(getElementName());
}
@Override
public URI getLocationURI() {
IResource res = getUnderlyingResource();
@ -128,6 +133,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
}
}
@Override
public boolean exists() {
try {
return getElementInfo() != null;
@ -202,6 +208,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
return new ICElement[]{this};
}
@Override
public boolean isReadOnly () {
IResource r = getUnderlyingResource();
if (r != null) {
@ -213,10 +220,12 @@ public abstract class CElement extends PlatformObject implements ICElement {
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();
@ -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) {
@ -517,6 +530,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
/* (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,6 +547,7 @@ public abstract class CElement extends PlatformObject implements ICElement {
/*
* @see org.eclipse.cdt.core.model.ICElement#getHandleIdentifier()
*/
@Override
public String getHandleIdentifier() {
return getHandleMemento();
}

View file

@ -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;

View file

@ -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,6 +59,7 @@ 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);
@ -102,10 +104,12 @@ 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();
}

View file

@ -118,6 +118,7 @@ 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);
@ -229,6 +230,7 @@ public class CModelBuilder2 implements IContributedModelBuilder {
// sort by offset
final List<ICElement> children= getElementInfo(fTranslationUnit).internalGetChildren();
Collections.sort(children, new Comparator<ICElement>() {
@Override
public int compare(ICElement o1, ICElement o2) {
final SourceManipulationInfo info1= getSourceManipulationInfo((SourceManipulation) o1);
final SourceManipulationInfo info2= getSourceManipulationInfo((SourceManipulation) o2);

View file

@ -854,6 +854,7 @@ public class CModelManager implements IResourceChangeListener, IContentTypeChang
* @see IResourceDelta
* @see IResource
*/
@Override
public void resourceChanged(IResourceChangeEvent event) {
if (event.getSource() instanceof IWorkspace) {
IResourceDelta delta = event.getDelta();
@ -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 });
}
@ -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);
}

View file

@ -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();
@ -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();
@ -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);

View file

@ -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;
}

View file

@ -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()) {
@ -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<String, String> getOptions(boolean inheritCCoreOptions) {
// initialize to the defaults from CCorePlugin options pool
Map<String, String> options= inheritCCoreOptions ? CCorePlugin.getOptions() : new HashMap<String, String>(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
@ -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<String, String> 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();
@ -476,6 +493,7 @@ public class CProject extends Openable implements ICProject {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.model.ICProject#getSourceRoots()
*/
@Override
public ISourceRoot[] getSourceRoots() throws CModelException {
Object[] children = getChildren();
ArrayList<ISourceRoot> result = new ArrayList<ISourceRoot>(children.length);
@ -493,6 +511,7 @@ public class CProject extends Openable implements ICProject {
* @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;
@ -545,6 +565,7 @@ public class CProject extends Openable implements ICProject {
/**
*
*/
@Override
public boolean isOnOutputEntry(IResource resource) {
IPath path = resource.getFullPath();
@ -668,6 +689,7 @@ public class CProject extends Openable implements ICProject {
/*
* @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());
}

View file

@ -49,6 +49,7 @@ public class CShiftData implements ICElementDelta {
/* (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;
}

View file

@ -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) {
@ -98,6 +99,7 @@ public class DefaultPathEntryStore implements IPathEntryStore, ICDescriptorListe
return NO_PATHENTRIES;
}
@Override
public void setRawPathEntries(IPathEntry[] newRawEntries) throws CoreException {
if (Arrays.equals(newRawEntries, getRawPathEntries())) {
return;
@ -359,6 +361,7 @@ public class DefaultPathEntryStore implements IPathEntryStore, ICDescriptorListe
*
* @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,6 +376,7 @@ public class DefaultPathEntryStore implements IPathEntryStore, ICDescriptorListe
/* (non-Javadoc)
* @see org.eclipse.cdt.core.resources.IPathEntryStore#addPathEntryStoreListener(org.eclipse.cdt.core.resources.IPathEntryStoreListener)
*/
@Override
public void addPathEntryStoreListener(IPathEntryStoreListener listener) {
listeners.add(listener);
}
@ -380,6 +384,7 @@ public class DefaultPathEntryStore implements IPathEntryStore, ICDescriptorListe
/* (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;
}

View file

@ -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();
}

View file

@ -29,6 +29,7 @@ public class Enumerator extends SourceManipulation implements IEnumerator{
/**
* @see org.eclipse.cdt.core.model.IEnumerator#getConstantExpression()
*/
@Override
public String getConstantExpression() {
return constantExpression;
}

View file

@ -22,6 +22,7 @@ public class Field extends VariableDeclaration implements IField {
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();
}

View file

@ -31,6 +31,7 @@ public class FunctionDeclaration extends SourceManipulation implements IFunction
fParameterTypes= fgEmptyStrings;
}
@Override
public String getReturnType(){
if (returnType != null) {
return returnType;
@ -42,10 +43,12 @@ 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;
}
@ -54,6 +57,7 @@ public class FunctionDeclaration extends SourceManipulation implements IFunction
fParameterTypes = parameterTypes;
}
@Override
public String getSignature() throws CModelException{
return getSignature(this);
}
@ -95,10 +99,12 @@ public class FunctionDeclaration extends SourceManipulation implements IFunction
return sig.toString();
}
@Override
public String getParameterInitializer(int pos) {
return ""; //$NON-NLS-1$
}
@Override
public String[] getExceptions(){
return new String[] {};
}
@ -130,6 +136,7 @@ public class FunctionDeclaration extends SourceManipulation implements IFunction
* 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();
}

View file

@ -29,10 +29,12 @@ public class FunctionTemplate extends Function implements IFunctionTemplate {
* @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();
}
@ -62,6 +65,7 @@ public class FunctionTemplate extends Function implements IFunctionTemplate {
* 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());

View file

@ -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());
@ -48,6 +51,7 @@ public class FunctionTemplateDeclaration extends FunctionDeclaration implements
return sig.toString();
}
@Override
public int getNumberOfTemplateParameters() {
return fTemplate.getNumberOfTemplateParameters();
}

View file

@ -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;
}

View file

@ -36,6 +36,7 @@ public class IncludeEntry extends APathEntry implements IIncludeEntry {
*
* @return IPath
*/
@Override
public IPath getIncludePath() {
return includePath;
}
@ -45,6 +46,7 @@ public class IncludeEntry extends APathEntry implements IIncludeEntry {
*
* @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()) {

View file

@ -36,6 +36,7 @@ public class IncludeFileEntry extends APathEntry implements IIncludeFileEntry {
*
* @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()) {

View file

@ -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();
}
@ -175,6 +177,7 @@ 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)
&& !CoreModelUtil.isExcluded(path, fIncludeEntry.fullExclusionPatternChars())) {

View file

@ -37,13 +37,16 @@ public class LanguageDescriptor extends CExtensionDescriptor implements
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,6 +55,7 @@ public class LanguageDescriptor extends CExtensionDescriptor implements
return fLanguage;
}
@Override
public String[] getContentTypeIds() {
if(fContentTypeIds == null){
fContentTypeIds = calculateCintentTypeIds();
@ -91,6 +95,7 @@ public class LanguageDescriptor extends CExtensionDescriptor implements
return fId;
}
@Override
public IContentType[] getContentTypes() {
if(fContentTypes == null){
fContentTypes = calculateContentTypes(getContentTypeIds());

View file

@ -58,6 +58,7 @@ public class LibraryEntry extends APathEntry implements ILibraryEntry {
*
* @return the path to the source archive or folder, or <code>null</code> if none
*/
@Override
public IPath getSourceAttachmentPath() {
return sourceAttachmentPath;
}
@ -72,6 +73,7 @@ public class LibraryEntry extends APathEntry implements ILibraryEntry {
* @return the path within the source archive or folder, or <code>null</code> if
* not applicable
*/
@Override
public IPath getSourceAttachmentRootPath() {
return sourceAttachmentRootPath;
}
@ -86,6 +88,7 @@ public class LibraryEntry extends APathEntry implements ILibraryEntry {
* @return the path mapping within the source archive or folder, or <code>null</code> 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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -35,6 +35,7 @@ public class MacroFileEntry extends APathEntry implements IMacroFileEntry {
*
* @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();

View file

@ -32,10 +32,12 @@ public class MethodDeclaration extends FunctionDeclaration implements IMethodDec
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,6 +101,7 @@ public class MethodDeclaration extends FunctionDeclaration implements IMethodDec
this.isConst = isConst;
}
@Override
public ASTAccessVisibility getVisibility() throws CModelException{
return getMethodInfo().getVisibility();
}

View file

@ -29,10 +29,12 @@ public class MethodTemplate extends Method implements IMethodTemplate {
* @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,6 +50,7 @@ public class MethodTemplate extends Method implements IMethodTemplate {
/**
* @see org.eclipse.cdt.core.model.ITemplate#getNumberOfTemplateParameters()
*/
@Override
public int getNumberOfTemplateParameters() {
return fTemplate.getNumberOfTemplateParameters();
}
@ -64,6 +67,7 @@ public class MethodTemplate extends Method implements IMethodTemplate {
* return type.
*/
@Override
public String getTemplateSignature() throws CModelException {
StringBuffer sig = new StringBuffer(fTemplate.getTemplateSignature());
sig.append(this.getParameterClause());

View file

@ -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());
@ -49,6 +52,7 @@ public class MethodTemplateDeclaration extends MethodDeclaration implements IMet
}
@Override
public int getNumberOfTemplateParameters() {
return fTemplate.getNumberOfTemplateParameters();
}

View file

@ -27,6 +27,7 @@ public class Namespace extends SourceManipulation implements INamespace{
* Returns the typeName.
* @return String
*/
@Override
public String getTypeName() {
return typeName;
}

View file

@ -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;
}

View file

@ -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);
@ -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
@ -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;
@ -174,6 +177,7 @@ public abstract class Openable extends Parent implements IOpenable {
*
* @see org.eclipse.cdt.core.model.IOpenable#isConsistent()
*/
@Override
public boolean isConsistent() throws CModelException {
return true;
}
@ -181,6 +185,7 @@ public abstract class Openable extends Parent implements IOpenable {
/**
* @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);
}
@ -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) {

View file

@ -31,6 +31,7 @@ public class PathEntry implements IPathEntry {
*
* @see org.eclipse.cdt.core.IPathEntry#getEntryKind()
*/
@Override
public IPath getPath() {
return path;
}
@ -40,6 +41,7 @@ public class PathEntry implements IPathEntry {
*
* @see org.eclipse.cdt.core.IPathEntry#getEntryKind()
*/
@Override
public int getEntryKind() {
return entryKind;
}
@ -49,6 +51,7 @@ public class PathEntry implements IPathEntry {
*
* @see org.eclipse.cdt.core.IPathEntry#isExported()
*/
@Override
public boolean isExported() {
return isExported;
}

View file

@ -156,6 +156,7 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
*
* @see org.eclipse.cdt.core.model.IPathEntryContainer#getPathEntries()
*/
@Override
public IPathEntry[] getPathEntries() {
return NO_PATHENTRIES;
}
@ -165,6 +166,7 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
*
* @see org.eclipse.cdt.core.model.IPathEntryContainer#getDescription()
*/
@Override
public String getDescription() {
return new String("Lock container"); //$NON-NLS-1$
}
@ -174,6 +176,7 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
*
* @see org.eclipse.cdt.core.model.IPathEntryContainer#getPath()
*/
@Override
public IPath getPath() {
return Path.EMPTY;
}
@ -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,
"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;
@ -1299,6 +1304,7 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
*
* @see org.eclipse.cdt.core.resources.IPathEntryStoreListener#pathEntryStoreChanged(org.eclipse.cdt.core.resources.PathEntryChangedEvent)
*/
@Override
public void pathEntryStoreChanged(PathEntryStoreChangedEvent event) {
IProject project = event.getProject();
@ -1332,6 +1338,7 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange
*
* @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) {

View file

@ -43,6 +43,7 @@ public class PathEntryStoreProxy extends AbstractCExtensionProxy implements IPat
/* (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);
}
@ -50,6 +51,7 @@ public class PathEntryStoreProxy extends AbstractCExtensionProxy implements IPat
/* (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);
}
@ -86,26 +88,31 @@ 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);
}

View file

@ -23,6 +23,7 @@ public class ProgressMonitorAndCanceler extends NullProgressMonitor implements I
private ICancelable fCancelable;
@Override
public void setCancelable(ICancelable cancelable) {
fCancelable= cancelable;
checkCanceled();

View file

@ -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();
@ -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);

View file

@ -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();
}
@ -362,10 +369,12 @@ public class SourceManipulation extends Parent implements ISourceManipulation, I
return CElement.CEM_SOURCEELEMENT;
}
@Override
public boolean isActive() {
return fIsActive;
}
@Override
public int getIndex() {
return fIndex;
}

View file

@ -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;
}

View file

@ -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,11 +59,13 @@ 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)
&& !CoreModelUtil.isExcluded(path, sourceEntry.fullExclusionPatternChars())) {

View file

@ -31,12 +31,14 @@ public class Structure extends StructureDeclaration implements IStructure {
super(parent, name, kind);
}
@Override
public IField[] getFields() throws CModelException {
List<ICElement> fields = new ArrayList<ICElement>();
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<ICElement> methods = new ArrayList<ICElement>();
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,10 +84,12 @@ 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);
}

View file

@ -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();
}

View file

@ -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,6 +48,7 @@ public class StructureTemplate extends Structure implements IStructureTemplate {
/**
* @see org.eclipse.cdt.core.model.ITemplate#getNumberOfTemplateParameters()
*/
@Override
public int getNumberOfTemplateParameters() {
return fTemplate.getNumberOfTemplateParameters();
}
@ -53,6 +56,7 @@ public class StructureTemplate extends Structure implements IStructureTemplate {
/**
* @see org.eclipse.cdt.core.model.ITemplate#getTemplateSignature()
*/
@Override
public String getTemplateSignature() {
return fTemplate.getTemplateSignature();
}

View file

@ -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();
}

View file

@ -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,6 +50,7 @@ public class Template implements ITemplate {
}
}
@Override
public int getNumberOfTemplateParameters() {
return fTemplateParameterTypes == null ? 0 : fTemplateParameterTypes.length;
}
@ -55,6 +58,7 @@ public class Template implements ITemplate {
/**
* @see org.eclipse.cdt.core.model.ITemplate#getTemplateSignature()
*/
@Override
public String getTemplateSignature() {
StringBuffer sig = new StringBuffer(fName);
if(getNumberOfTemplateParameters() > 0){

View file

@ -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<ICElement> aList = new ArrayList<ICElement>();
@ -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<ICElement> aList = new ArrayList<ICElement>();
@ -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<ICElement> elementList = new ArrayList<ICElement>();
@ -313,6 +327,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
location = loc;
}
@Override
public IPath getLocation() {
if (location == null) {
IFile file = getFile();
@ -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();
}
@ -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();
@ -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);
}
@ -710,6 +744,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
return false;
}
@Override
public ILanguage getLanguage() throws CoreException {
ILanguage language = null;
@ -738,6 +773,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
return language;
}
@Override
public String getContentTypeId() {
return contentTypeId;
}
@ -762,6 +798,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
*
* @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);
}
@ -921,6 +960,7 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
return this;
}
@Override
public IASTCompletionNode getCompletionNode(IIndex index, int style, int offset) throws CoreException {
IIndexFile[] contextToHeader = getContextToHeader(index, style);
ITranslationUnit configureWith = getConfigureWith(contextToHeader);
@ -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();
@ -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();
@ -1165,24 +1207,29 @@ public class TranslationUnit extends Openable implements ITranslationUnit {
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);

View file

@ -24,6 +24,7 @@ public class TypeDef extends SourceManipulation implements ITypeDef {
* Returns the typeName.
* @return String
*/
@Override
public String getTypeName() {
return typeName;
}

View file

@ -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;
}

View file

@ -24,6 +24,7 @@ public class Variable extends VariableDeclaration implements IVariable {
super(parent, name, kind);
}
@Override
public String getInitializer() {
return ""; //$NON-NLS-1$
}

View file

@ -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();
}

View file

@ -26,6 +26,7 @@ public class VariableTemplate extends Variable implements ITemplate {
/* (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){

View file

@ -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()) {
@ -114,6 +115,7 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy {
/**
* @see org.eclipse.cdt.core.model.IWorkingCopy#destroy()
*/
@Override
public void destroy() {
if (--this.useCount > 0) {
return;
@ -162,6 +164,7 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy {
* @return the original element the specified working copy element was created from,
* or <code>null</code> 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) {
@ -211,6 +214,7 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy {
/**
* @see org.eclipse.cdt.core.model.IWorkingCopy#getOriginalElement()
*/
@Override
public ITranslationUnit getOriginalElement() {
IFile file= getFile();
if (file != null) {
@ -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;
@ -339,6 +344,7 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy {
/**
* @see org.eclipse.cdt.core.model.IWorkingCopy#reconcile()
*/
@Override
public IMarker[] reconcile() throws CModelException {
reconcile(false, null);
return null;
@ -347,6 +353,7 @@ public class WorkingCopy extends TranslationUnit implements IWorkingCopy {
/**
* @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
@ -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)

View file

@ -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 {
@ -119,57 +123,71 @@ abstract class CElementHandle implements ICElementHandle, ISourceReference {
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;
}
@ -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;
}

View file

@ -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;
}

Some files were not shown because too many files have changed in this diff Show more