diff options
author | Andrey Loskutov | 2017-07-12 12:52:33 +0000 |
---|---|---|
committer | Andrey Loskutov | 2017-07-12 12:52:33 +0000 |
commit | 55836b9a5120fd36bc1021c36a5fdb361401ed55 (patch) | |
tree | f751119dce848ab75919825aadf67134b069bf3f /bundles | |
parent | 525117f2c35f71a4efd48fe8a91e245ac5f19872 (diff) | |
download | rt.equinox.bundles-55836b9a5120fd36bc1021c36a5fdb361401ed55.tar.gz rt.equinox.bundles-55836b9a5120fd36bc1021c36a5fdb361401ed55.tar.xz rt.equinox.bundles-55836b9a5120fd36bc1021c36a5fdb361401ed55.zip |
Bug 519547 - add @Override annotations
Change-Id: I0ef962f4286bc91228683508855adac00cd9b4fb
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
Diffstat (limited to 'bundles')
42 files changed, 208 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.registry/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.registry/.settings/org.eclipse.jdt.core.prefs index 6bbc65563..5c75b2c73 100644 --- a/bundles/org.eclipse.equinox.registry/.settings/org.eclipse.jdt.core.prefs +++ b/bundles/org.eclipse.equinox.registry/.settings/org.eclipse.jdt.core.prefs @@ -62,7 +62,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/adapter/AdapterFactoryProxy.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/adapter/AdapterFactoryProxy.java index 6ba89e753..f5c766313 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/adapter/AdapterFactoryProxy.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/adapter/AdapterFactoryProxy.java @@ -76,18 +76,21 @@ class AdapterFactoryProxy implements IAdapterFactory, IAdapterFactoryExt { return ""; //$NON-NLS-1$ } + @Override public Object getAdapter(Object adaptableObject, Class adapterType) { if (!factoryLoaded) loadFactory(false); return factory == null ? null : factory.getAdapter(adaptableObject, adapterType); } + @Override public Class[] getAdapterList() { if (!factoryLoaded) loadFactory(false); return factory == null ? null : factory.getAdapterList(); } + @Override public String[] getAdapterNames() { IConfigurationElement[] children = element.getChildren(); ArrayList adapters = new ArrayList(children.length); @@ -115,6 +118,7 @@ class AdapterFactoryProxy implements IAdapterFactory, IAdapterFactoryExt { * factory will be loaded if necessary, otherwise no plugin activations * will occur. */ + @Override public synchronized IAdapterFactory loadFactory(boolean force) { if (factory != null || factoryLoaded) return factory; @@ -152,6 +156,7 @@ class AdapterFactoryProxy implements IAdapterFactory, IAdapterFactoryExt { RuntimeLog.log(new Status(IStatus.ERROR, RegistryMessages.OWNER_NAME, 0, msg, null)); } + @Override public String toString() { StringBuffer sb = new StringBuffer(); sb.append("AdapterFactoryProxy [contributor: "); //$NON-NLS-1$ diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/adapter/AdapterManagerListener.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/adapter/AdapterManagerListener.java index 7f08f2d9c..80c65b599 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/adapter/AdapterManagerListener.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/adapter/AdapterManagerListener.java @@ -38,6 +38,7 @@ public final class AdapterManagerListener implements IRegistryEventListener, IAd * the plug-in registry. Note that the actual factory implementations * are loaded lazily as they are needed. */ + @Override public boolean addFactories(AdapterManager adapterManager) { IExtensionPoint point = RegistryFactory.getRegistry().getExtensionPoint(ADAPTER_POINT_ID); if (point == null) @@ -68,12 +69,14 @@ public final class AdapterManagerListener implements IRegistryEventListener, IAd } } + @Override public synchronized void added(IExtension[] extensions) { for (int i = 0; i < extensions.length; i++) registerExtension(extensions[i]); theAdapterManager.flushLookup(); } + @Override public synchronized void removed(IExtension[] extensions) { theAdapterManager.flushLookup(); for (int i = 0; i < extensions.length; i++) { @@ -89,10 +92,12 @@ public final class AdapterManagerListener implements IRegistryEventListener, IAd } } + @Override public synchronized void added(IExtensionPoint[] extensionPoints) { // nothing to do } + @Override public synchronized void removed(IExtensionPoint[] extensionPoints) { // all extensions should have been removed by this point by #removed(IExtension[] extensions) // nothing to do diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/BaseExtensionHandle.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/BaseExtensionHandle.java index c6034a427..14b4e1941 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/BaseExtensionHandle.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/BaseExtensionHandle.java @@ -35,14 +35,17 @@ public class BaseExtensionHandle extends Handle implements IExtension { } // Method left for backward compatiblity only + @Override public String getNamespace() { return getContributor().getName(); } + @Override public String getNamespaceIdentifier() { return getExtension().getNamespaceIdentifier(); } + @Override public IContributor getContributor() { return getExtension().getContributor(); } @@ -51,10 +54,12 @@ public class BaseExtensionHandle extends Handle implements IExtension { return getExtension().getContributorId(); } + @Override public String getExtensionPointUniqueIdentifier() { return getExtension().getExtensionPointIdentifier(); } + @Override public String getLabel() { return getExtension().getLabel(); } @@ -63,26 +68,32 @@ public class BaseExtensionHandle extends Handle implements IExtension { return getExtension().getLabelAsIs(); } + @Override public String getLabel(String locale) { return getExtension().getLabel(locale); } + @Override public String getSimpleIdentifier() { return getExtension().getSimpleIdentifier(); } + @Override public String getUniqueIdentifier() { return getExtension().getUniqueIdentifier(); } + @Override public IConfigurationElement[] getConfigurationElements() { return (IConfigurationElement[]) objectManager.getHandles(getExtension().getRawChildren(), RegistryObjectManager.CONFIGURATION_ELEMENT); } + @Override RegistryObject getObject() { return getExtension(); } + @Override public boolean isValid() { try { getExtension(); diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/BaseExtensionPointHandle.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/BaseExtensionPointHandle.java index c4bfcd441..6080aba72 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/BaseExtensionPointHandle.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/BaseExtensionPointHandle.java @@ -28,19 +28,23 @@ public class BaseExtensionPointHandle extends Handle implements IExtensionPoint super(objectManager, id); } + @Override public IExtension[] getExtensions() { return (IExtension[]) objectManager.getHandles(getExtensionPoint().getRawChildren(), RegistryObjectManager.EXTENSION); } // This method is left for backward compatibility only + @Override public String getNamespace() { return getContributor().getName(); } + @Override public String getNamespaceIdentifier() { return getExtensionPoint().getNamespace(); } + @Override public IContributor getContributor() { return getExtensionPoint().getContributor(); } @@ -49,6 +53,7 @@ public class BaseExtensionPointHandle extends Handle implements IExtensionPoint return getExtensionPoint().shouldPersist(); } + @Override public IExtension getExtension(String extensionId) { if (extensionId == null) return null; @@ -61,6 +66,7 @@ public class BaseExtensionPointHandle extends Handle implements IExtensionPoint return null; } + @Override public IConfigurationElement[] getConfigurationElements() { //get the actual extension objects since we'll need to get the configuration elements information. Extension[] tmpExtensions = (Extension[]) objectManager.getObjects(getExtensionPoint().getRawChildren(), RegistryObjectManager.EXTENSION); @@ -78,26 +84,32 @@ public class BaseExtensionPointHandle extends Handle implements IExtensionPoint return getExtensionPoint().getLabelAsIs(); } + @Override public String getLabel() { return getExtensionPoint().getLabel(); } + @Override public String getLabel(String locale) { return getExtensionPoint().getLabel(locale); } + @Override public String getSchemaReference() { return getExtensionPoint().getSchemaReference(); } + @Override public String getSimpleIdentifier() { return getExtensionPoint().getSimpleIdentifier(); } + @Override public String getUniqueIdentifier() { return getExtensionPoint().getUniqueIdentifier(); } + @Override RegistryObject getObject() { return getExtensionPoint(); } @@ -106,6 +118,7 @@ public class BaseExtensionPointHandle extends Handle implements IExtensionPoint return (ExtensionPoint) objectManager.getObject(getId(), RegistryObjectManager.EXTENSION_POINT); } + @Override public boolean isValid() { try { getExtensionPoint(); diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/BufferedRandomInputStream.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/BufferedRandomInputStream.java index 9f1df30a3..c712a260e 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/BufferedRandomInputStream.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/BufferedRandomInputStream.java @@ -59,6 +59,7 @@ public class BufferedRandomInputStream extends InputStream { return buffer_size; } + @Override public int read() throws IOException { if (buffer_pos >= buffer_size) { if (fillBuffer() <= 0) @@ -67,6 +68,7 @@ public class BufferedRandomInputStream extends InputStream { return buffer[buffer_pos++] & 0xFF; } + @Override public int read(byte b[], int off, int len) throws IOException { int available = buffer_size - buffer_pos; if (available < 0) @@ -85,6 +87,7 @@ public class BufferedRandomInputStream extends InputStream { return available + read(b, off + available, len - available); } + @Override public long skip(long n) throws IOException { if (n <= 0) return 0; @@ -100,16 +103,19 @@ public class BufferedRandomInputStream extends InputStream { return available + skipped; } + @Override public int available() { return (buffer_size - buffer_pos); } + @Override public void close() throws IOException { inputFile.close(); inputFile = null; buffer = null; } + @Override public String toString() { return filePath; } diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ConfigurationElementHandle.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ConfigurationElementHandle.java index ca996489a..aa487b582 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ConfigurationElementHandle.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ConfigurationElementHandle.java @@ -30,18 +30,22 @@ public class ConfigurationElementHandle extends Handle implements IConfiguration return getConfigurationElement().shouldPersist(); } + @Override public String getAttribute(String propertyName) { return getConfigurationElement().getAttribute(propertyName); } + @Override public String getAttribute(String attrName, String locale) { return getConfigurationElement().getAttribute(attrName, locale); } + @Override public String[] getAttributeNames() { return getConfigurationElement().getAttributeNames(); } + @Override public IConfigurationElement[] getChildren() { ConfigurationElement actualCe = getConfigurationElement(); if (actualCe.noExtraData()) { @@ -50,6 +54,7 @@ public class ConfigurationElementHandle extends Handle implements IConfiguration return (IConfigurationElement[]) objectManager.getHandles(actualCe.getRawChildren(), RegistryObjectManager.THIRDLEVEL_CONFIGURATION_ELEMENT); } + @Override public Object createExecutableExtension(String propertyName) throws CoreException { try { return getConfigurationElement().createExecutableExtension(propertyName); @@ -61,10 +66,12 @@ public class ConfigurationElementHandle extends Handle implements IConfiguration } } + @Override public String getAttributeAsIs(String name) { return getConfigurationElement().getAttributeAsIs(name); } + @Override public IConfigurationElement[] getChildren(String name) { ConfigurationElement actualCE = getConfigurationElement(); ConfigurationElement[] children = (ConfigurationElement[]) objectManager.getObjects(actualCE.getRawChildren(), actualCE.noExtraData() ? RegistryObjectManager.CONFIGURATION_ELEMENT : RegistryObjectManager.THIRDLEVEL_CONFIGURATION_ELEMENT); @@ -88,6 +95,7 @@ public class ConfigurationElementHandle extends Handle implements IConfiguration return result; } + @Override public IExtension getDeclaringExtension() { Object result = this; while (!((result = ((ConfigurationElementHandle) result).getParent()) instanceof ExtensionHandle)) { /*do nothing*/ @@ -95,45 +103,55 @@ public class ConfigurationElementHandle extends Handle implements IConfiguration return (IExtension) result; } + @Override public String getName() { return getConfigurationElement().getName(); } + @Override public Object getParent() { ConfigurationElement actualCe = getConfigurationElement(); return objectManager.getHandle(actualCe.parentId, actualCe.parentType); } + @Override public String getValue() { return getConfigurationElement().getValue(); } + @Override public String getValue(String locale) { return getConfigurationElement().getValue(locale); } + @Override public String getValueAsIs() { return getConfigurationElement().getValueAsIs(); } + @Override RegistryObject getObject() { return getConfigurationElement(); } // Method left for backward compatibility only + @Override public String getNamespace() { return getContributor().getName(); } + @Override public String getNamespaceIdentifier() { // namespace name is determined by the contributing extension return getDeclaringExtension().getNamespaceIdentifier(); } + @Override public IContributor getContributor() { return getConfigurationElement().getContributor(); } + @Override public boolean isValid() { try { getConfigurationElement(); diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ConfigurationElementMulti.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ConfigurationElementMulti.java index f2f748e77..60fc219ad 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ConfigurationElementMulti.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ConfigurationElementMulti.java @@ -29,6 +29,7 @@ public class ConfigurationElementMulti extends ConfigurationElement { super(self, contributorId, name, propertiesAndValue, children, extraDataOffset, parent, parentType, registry, persist); } + @Override String getAttribute(String attrName, String locale) { if (propertiesAndValue.length <= 1) return null; @@ -50,6 +51,7 @@ public class ConfigurationElementMulti extends ConfigurationElement { return propertiesAndValue[index * 2 + 1]; // return non-translated value } + @Override String getValue(String locale) { if (propertiesAndValue.length == 0 || propertiesAndValue.length % 2 == 0) return null; @@ -107,10 +109,12 @@ public class ConfigurationElementMulti extends ConfigurationElement { /////////////////////////////////////////////////////////////////////////////////// // "Default" locale + @Override public String getAttribute(String attrName) { return getAttribute(attrName, getLocale()); } + @Override public String getValue() { return getValue(getLocale()); } diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/Contribution.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/Contribution.java index 7d1a8ca3e..10dda2e8c 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/Contribution.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/Contribution.java @@ -106,19 +106,23 @@ public class Contribution implements KeyedElement { return defaultNamespace; } + @Override public String toString() { return "Contribution: " + contributorId + " in namespace" + getDefaultNamespace(); //$NON-NLS-1$ //$NON-NLS-2$ } //Implements the KeyedElement interface + @Override public int getKeyHashCode() { return getKey().hashCode(); } + @Override public Object getKey() { return contributorId; } + @Override public boolean compare(KeyedElement other) { return contributorId.equals(((Contribution) other).contributorId); } diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/Extension.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/Extension.java index 62943ac18..1b34c6b17 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/Extension.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/Extension.java @@ -125,6 +125,7 @@ public class Extension extends RegistryObject { namespaceIdentifier = value; } + @Override public String toString() { return getUniqueIdentifier() + " -> " + getExtensionPointIdentifier(); //$NON-NLS-1$ } diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionDelta.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionDelta.java index 29d6b787b..ea8b43788 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionDelta.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionDelta.java @@ -30,6 +30,7 @@ public class ExtensionDelta implements IExtensionDelta { return extensionPoint; } + @Override public IExtensionPoint getExtensionPoint() { return new ExtensionPointHandle(containingDelta.getObjectManager(), extensionPoint); } @@ -38,10 +39,12 @@ public class ExtensionDelta implements IExtensionDelta { this.extensionPoint = extensionPoint; } + @Override public int getKind() { return kind; } + @Override public IExtension getExtension() { return new ExtensionHandle(containingDelta.getObjectManager(), extension); } @@ -54,6 +57,7 @@ public class ExtensionDelta implements IExtensionDelta { this.kind = kind; } + @Override public String toString() { return "\n\t\t" + getExtensionPoint().getUniqueIdentifier() + " - " + getExtension().getNamespaceIdentifier() + '.' + getExtension().getSimpleIdentifier() + " (" + getKindString(this.getKind()) + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ } diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionMulti.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionMulti.java index 7e090c193..316d23bad 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionMulti.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionMulti.java @@ -23,12 +23,14 @@ public class ExtensionMulti extends Extension { super(self, simpleId, namespace, children, extraData, registry, persist); } + @Override protected String getLabel(String locale) { // this method call should be fairly rare, so no caching to save on memory String[] translated = registry.translate(new String[] {getLabelAsIs()}, getContributor(), locale); return translated[0]; } + @Override protected String getLabel() { return getLabel(getLocale()); } diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionPoint.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionPoint.java index 3dd569eba..05adf5bda 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionPoint.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionPoint.java @@ -128,6 +128,7 @@ public class ExtensionPoint extends RegistryObject { ((String[]) extraInformation)[CONTRIBUTOR_ID] = id; } + @Override public String toString() { return getUniqueIdentifier(); } diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionPointMulti.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionPointMulti.java index 940904ddc..75baeafa7 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionPointMulti.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionPointMulti.java @@ -23,12 +23,14 @@ public class ExtensionPointMulti extends ExtensionPoint { super(self, children, dataOffset, registry, persist); } + @Override protected String getLabel(String locale) { // this method call should be fairly rare, so no caching to save on memory String[] translated = registry.translate(new String[] {getLabelAsIs()}, getContributor(), locale); return translated[0]; } + @Override protected String getLabel() { return getLabel(getLocale()); } diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionRegistry.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionRegistry.java index d044ebe07..734bf19ef 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionRegistry.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionRegistry.java @@ -41,6 +41,7 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR /** * Used by ListenerList to ensure uniqueness. */ + @Override public boolean equals(Object another) { return another instanceof ListenerInfo && ((ListenerInfo) another).listener == this.listener; } @@ -48,6 +49,7 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR /* (non-Javadoc) * @see java.lang.Object#hashCode() */ + @Override public int hashCode() { return listener == null ? 0 : listener.hashCode(); } @@ -197,10 +199,12 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR return affectedNamespaces; } + @Override public void addListener(IRegistryEventListener listener) { addListenerInternal(listener, null); } + @Override public void addListener(IRegistryEventListener listener, String extensionPointId) { addListenerInternal(listener, extensionPointId); } @@ -211,11 +215,13 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR } } + @Override public void addRegistryChangeListener(IRegistryChangeListener listener) { // this is just a convenience API - no need to do any sync'ing here addListenerInternal(listener, null); } + @Override public void addRegistryChangeListener(IRegistryChangeListener listener, String filter) { addListenerInternal(listener, filter); } @@ -282,6 +288,7 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR * (non-Javadoc) * @see org.eclipse.core.runtime.IExtensionRegistry#getConfigurationElementsFor(java.lang.String) */ + @Override public IConfigurationElement[] getConfigurationElementsFor(String extensionPointId) { // this is just a convenience API - no need to do any sync'ing here int lastdot = extensionPointId.lastIndexOf('.'); @@ -294,6 +301,7 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR * (non-Javadoc) * @see org.eclipse.core.runtime.IExtensionRegistry#getConfigurationElementsFor(java.lang.String, java.lang.String) */ + @Override public IConfigurationElement[] getConfigurationElementsFor(String pluginId, String extensionPointSimpleId) { // this is just a convenience API - no need to do any sync'ing here IExtensionPoint extPoint = this.getExtensionPoint(pluginId, extensionPointSimpleId); @@ -306,6 +314,7 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR * (non-Javadoc) * @see org.eclipse.core.runtime.IExtensionRegistry#getConfigurationElementsFor(java.lang.String, java.lang.String, java.lang.String) */ + @Override public IConfigurationElement[] getConfigurationElementsFor(String pluginId, String extensionPointName, String extensionId) { // this is just a convenience API - no need to do any sync'ing here IExtension extension = this.getExtension(pluginId, extensionPointName, extensionId); @@ -330,6 +339,7 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR * (non-Javadoc) * @see org.eclipse.core.runtime.IExtensionRegistry#getExtension(java.lang.String) */ + @Override public IExtension getExtension(String extensionId) { if (extensionId == null) return null; @@ -357,6 +367,7 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR * (non-Javadoc) * @see org.eclipse.core.runtime.IExtensionRegistry#getExtension(java.lang.String, java.lang.String) */ + @Override public IExtension getExtension(String extensionPointId, String extensionId) { // this is just a convenience API - no need to do any sync'ing here int lastdot = extensionPointId.lastIndexOf('.'); @@ -369,6 +380,7 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR * (non-Javadoc) * @see org.eclipse.core.runtime.IExtensionRegistry#getExtension(java.lang.String, java.lang.String, java.lang.String) */ + @Override public IExtension getExtension(String pluginId, String extensionPointName, String extensionId) { // this is just a convenience API - no need to do any sync'ing here IExtensionPoint extPoint = getExtensionPoint(pluginId, extensionPointName); @@ -381,6 +393,7 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR * (non-Javadoc) * @see org.eclipse.core.runtime.IExtensionRegistry#getExtensionPoint(java.lang.String) */ + @Override public IExtensionPoint getExtensionPoint(String xptUniqueId) { access.enterRead(); try { @@ -394,6 +407,7 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR * (non-Javadoc) * @see org.eclipse.core.runtime.IExtensionRegistry#getExtensionPoint(java.lang.String, java.lang.String) */ + @Override public IExtensionPoint getExtensionPoint(String elementName, String xpt) { access.enterRead(); try { @@ -407,6 +421,7 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR * (non-Javadoc) * @see org.eclipse.core.runtime.IExtensionRegistry#getExtensionPoints() */ + @Override public IExtensionPoint[] getExtensionPoints() { access.enterRead(); try { @@ -420,6 +435,7 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR * (non-Javadoc) * @see org.eclipse.core.runtime.IExtensionRegistry#getExtensionPoints(java.lang.String) */ + @Override public IExtensionPoint[] getExtensionPoints(String namespaceName) { access.enterRead(); try { @@ -433,6 +449,7 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR * (non-Javadoc) * @see org.eclipse.core.runtime.IExtensionRegistry#getExtensions(java.lang.String) */ + @Override public IExtension[] getExtensions(String namespaceName) { access.enterRead(); try { @@ -442,6 +459,7 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR } } + @Override public IExtension[] getExtensions(IContributor contributor) { if (!(contributor instanceof RegistryContributor)) throw new IllegalArgumentException(); // should never happen @@ -454,6 +472,7 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR } } + @Override public IExtensionPoint[] getExtensionPoints(IContributor contributor) { if (!(contributor instanceof RegistryContributor)) throw new IllegalArgumentException(); // should never happen @@ -470,6 +489,7 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR * (non-Javadoc) * @see org.eclipse.core.runtime.IExtensionRegistry#getNamespaces() */ + @Override public String[] getNamespaces() { access.enterRead(); try { @@ -484,6 +504,7 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR } } + @Override public boolean hasContributor(IContributor contributor) { if (!(contributor instanceof RegistryContributor)) throw new IllegalArgumentException(); // should never happen @@ -546,6 +567,7 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR aggregatedTimestamp.remove(timestamp); } + @Override public void removeContributor(IContributor contributor, Object key) { if (!(contributor instanceof RegistryContributor)) throw new IllegalArgumentException(); // should never happen @@ -637,12 +659,14 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR return affectedNamespaces; } + @Override public void removeRegistryChangeListener(IRegistryChangeListener listener) { synchronized (listeners) { listeners.remove(new ListenerInfo(listener, null)); } } + @Override public void removeListener(IRegistryEventListener listener) { synchronized (listeners) { listeners.remove(new ListenerInfo(listener, null)); @@ -715,6 +739,7 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR if (debugEvents()) addRegistryChangeListener(new IRegistryChangeListener() { + @Override public void registryChanged(IRegistryChangeEvent event) { System.out.println(event); } @@ -730,6 +755,7 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR * close cache and dispose of listeners. * @param key - key token for this registry */ + @Override public void stop(Object key) { // If the registry creator specified a key token, check that the key mathches it // (it is assumed that registry owner keeps the key to prevent unautorized accesss). @@ -918,10 +944,12 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR if ((listenerInfo.listener instanceof IRegistryChangeListener) && scheduledDeltas.size() != 0) { if (listenerInfo.filter == null || scheduledDeltas.containsKey(listenerInfo.filter)) { SafeRunner.run(new ISafeRunnable() { + @Override public void run() throws Exception { ((IRegistryChangeListener) listenerInfo.listener).registryChanged(new RegistryChangeEvent(scheduledDeltas, listenerInfo.filter)); } + @Override public void handleException(Throwable exception) { result.add(new Status(IStatus.ERROR, RegistryMessages.OWNER_NAME, RegistryMessages.plugin_eventListenerError, exception)); } @@ -993,6 +1021,7 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR this.registry = registry; } + @Override public void run() { while (true) { QueueElement element; @@ -1043,6 +1072,7 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR return result; } + @Override public boolean addContribution(InputStream is, IContributor contributor, boolean persist, String contributionName, ResourceBundle translationBundle, Object key) { if (!checkReadWriteAccess(key, persist)) throw new IllegalArgumentException("Unauthorized access to the ExtensionRegistry.addContribution() method. Check if proper access token is supplied."); //$NON-NLS-1$ @@ -1306,12 +1336,14 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR currentConfigurationElement.setParentType(parent instanceof ConfigurationElement ? RegistryObjectManager.CONFIGURATION_ELEMENT : RegistryObjectManager.EXTENSION); } + @Override public boolean removeExtension(IExtension extension, Object token) throws IllegalArgumentException { if (!(extension instanceof ExtensionHandle)) return false; return removeObject(((ExtensionHandle) extension).getObject(), false, token); } + @Override public boolean removeExtensionPoint(IExtensionPoint extensionPoint, Object token) throws IllegalArgumentException { if (!(extensionPoint instanceof ExtensionPointHandle)) return false; @@ -1352,6 +1384,7 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR return true; } + @Override public IContributor[] getAllContributors() { access.enterRead(); try { @@ -1370,6 +1403,7 @@ public class ExtensionRegistry implements IExtensionRegistry, IDynamicExtensionR return userToken; } + @Override public boolean isMultiLanguage() { return isMultiLanguage; } diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionsParser.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionsParser.java index 3be12fba3..50ff4bb66 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionsParser.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ExtensionsParser.java @@ -154,6 +154,7 @@ public class ExtensionsParser extends DefaultHandler { /* (non-Javadoc) * @see org.xml.sax.helpers.DefaultHandler#setDocumentLocator(org.xml.sax.Locator) */ + @Override public void setDocumentLocator(Locator locator) { this.locator = locator; } @@ -161,6 +162,7 @@ public class ExtensionsParser extends DefaultHandler { /* (non-Javadoc) * @see org.xml.sax.helpers.DefaultHandler#characters(char[], int, int) */ + @Override public void characters(char[] ch, int start, int length) { int state = ((Integer) stateStack.peek()).intValue(); if (state != CONFIGURATION_ELEMENT_STATE) @@ -185,6 +187,7 @@ public class ExtensionsParser extends DefaultHandler { /* (non-Javadoc) * @see org.xml.sax.helpers.DefaultHandler#endDocument() */ + @Override public void endDocument() { // do nothing } @@ -192,6 +195,7 @@ public class ExtensionsParser extends DefaultHandler { /* (non-Javadoc) * @see org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String, java.lang.String, java.lang.String) */ + @Override public void endElement(String uri, String elementName, String qName) { switch (((Integer) stateStack.peek()).intValue()) { case IGNORED_ELEMENT_STATE : @@ -275,6 +279,7 @@ public class ExtensionsParser extends DefaultHandler { /* (non-Javadoc) * @see org.xml.sax.helpers.DefaultHandler#error(org.xml.sax.SAXParseException) */ + @Override public void error(SAXParseException ex) { logStatus(ex); } @@ -282,6 +287,7 @@ public class ExtensionsParser extends DefaultHandler { /* (non-Javadoc) * @see org.xml.sax.helpers.DefaultHandler#fatalError(org.xml.sax.SAXParseException) */ + @Override public void fatalError(SAXParseException ex) throws SAXException { cleanup(); logStatus(ex); @@ -587,6 +593,7 @@ public class ExtensionsParser extends DefaultHandler { /* (non-Javadoc) * @see org.xml.sax.helpers.DefaultHandler#startDocument() */ + @Override public void startDocument() { stateStack.push(new Integer(INITIAL_STATE)); for (int i = 0; i <= LAST_INDEX; i++) { @@ -597,6 +604,7 @@ public class ExtensionsParser extends DefaultHandler { /* (non-Javadoc) * @see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes) */ + @Override public void startElement(String uri, String elementName, String qName, Attributes attributes) { switch (((Integer) stateStack.peek()).intValue()) { case INITIAL_STATE : @@ -622,6 +630,7 @@ public class ExtensionsParser extends DefaultHandler { /* (non-Javadoc) * @see org.xml.sax.helpers.DefaultHandler#warning(org.xml.sax.SAXParseException) */ + @Override public void warning(SAXParseException ex) { logStatus(ex); } @@ -634,6 +643,7 @@ public class ExtensionsParser extends DefaultHandler { * @see org.xml.sax.ContentHandler#processingInstruction * @since 3.0 */ + @Override public void processingInstruction(String target, String data) { // Since 3.0, a processing instruction of the form <?eclipse version="3.0"?> at // the start of the manifest file is used to indicate the plug-in manifest diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/Handle.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/Handle.java index 59c8c1443..bb66e3a9c 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/Handle.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/Handle.java @@ -38,6 +38,7 @@ public abstract class Handle { */ abstract RegistryObject getObject(); + @Override public boolean equals(Object object) { if (object instanceof Handle) { return objectId == ((Handle) object).objectId; @@ -45,6 +46,7 @@ public abstract class Handle { return false; } + @Override public int hashCode() { return objectId; } diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/HashtableOfStringAndInt.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/HashtableOfStringAndInt.java index d0e4f7af6..2422efdd5 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/HashtableOfStringAndInt.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/HashtableOfStringAndInt.java @@ -40,6 +40,7 @@ public final class HashtableOfStringAndInt implements Cloneable { this.valueTable = new int[extraRoom]; } + @Override public Object clone() throws CloneNotSupportedException { throw new CloneNotSupportedException(); // HashtableOfStringAndInt result = (HashtableOfStringAndInt) super.clone(); @@ -132,6 +133,7 @@ public final class HashtableOfStringAndInt implements Cloneable { return elementSize; } + @Override public String toString() { String s = ""; //$NON-NLS-1$ int object; diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/KeyedHashSet.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/KeyedHashSet.java index 0e0c57988..e339984e6 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/KeyedHashSet.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/KeyedHashSet.java @@ -297,6 +297,7 @@ public class KeyedHashSet { return elementCount; } + @Override public String toString() { StringBuffer result = new StringBuffer(100); result.append("{"); //$NON-NLS-1$ diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ReadWriteMonitor.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ReadWriteMonitor.java index 6d21bee62..7bdcaf137 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ReadWriteMonitor.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ReadWriteMonitor.java @@ -87,6 +87,7 @@ public class ReadWriteMonitor { } } + @Override public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append(this.hashCode()); diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ReferenceMap.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ReferenceMap.java index cf5c9865a..9a9efa96e 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ReferenceMap.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ReferenceMap.java @@ -71,22 +71,27 @@ public class ReferenceMap { this.next = next; } + @Override public int getKey() { return key; } + @Override public IEntry getNext() { return next; } + @Override public Object getValue() { return value; } + @Override public void setNext(IEntry next) { this.next = next; } + @Override public String toString() { return "HardRef(" + key + ',' + value + ')'; //$NON-NLS-1$ } @@ -143,18 +148,22 @@ public class ReferenceMap { this.next = next; } + @Override public int getKey() { return key; } + @Override public IEntry getNext() { return next; } + @Override public Object getValue() { return super.get(); } + @Override public void setNext(IEntry next) { this.next = next; } diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryChangeEvent.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryChangeEvent.java index e03ca1398..e2b8e479a 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryChangeEvent.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryChangeEvent.java @@ -44,6 +44,7 @@ public final class RegistryChangeEvent implements IRegistryChangeEvent { return (RegistryDelta) deltas.get(pluginId); } + @Override public IExtensionDelta[] getExtensionDeltas() { RegistryDelta[] hostDeltas = getHostDeltas(); if (hostDeltas.length == 0) @@ -60,6 +61,7 @@ public final class RegistryChangeEvent implements IRegistryChangeEvent { return extensionDeltas; } + @Override public IExtensionDelta[] getExtensionDeltas(String hostName) { RegistryDelta hostDelta = getHostDelta(hostName); if (hostDelta == null) @@ -67,6 +69,7 @@ public final class RegistryChangeEvent implements IRegistryChangeEvent { return hostDelta.getExtensionDeltas(); } + @Override public IExtensionDelta[] getExtensionDeltas(String hostName, String extensionPoint) { RegistryDelta hostDelta = getHostDelta(hostName); if (hostDelta == null) @@ -74,6 +77,7 @@ public final class RegistryChangeEvent implements IRegistryChangeEvent { return hostDelta.getExtensionDeltas(hostName + '.' + extensionPoint); } + @Override public IExtensionDelta getExtensionDelta(String hostName, String extensionPoint, String extension) { RegistryDelta hostDelta = getHostDelta(hostName); if (hostDelta == null) @@ -81,6 +85,7 @@ public final class RegistryChangeEvent implements IRegistryChangeEvent { return hostDelta.getExtensionDelta(hostName + '.' + extensionPoint, extension); } + @Override public String toString() { return "RegistryChangeEvent: " + Arrays.asList(getHostDeltas()); //$NON-NLS-1$ } diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryDelta.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryDelta.java index eb52ebe5b..bb6d03562 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryDelta.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryDelta.java @@ -62,6 +62,7 @@ public class RegistryDelta { ((ExtensionDelta) extensionDelta).setContainingDelta(this); } + @Override public String toString() { return "\n\tHost " + ": " + extensionDeltas; //$NON-NLS-1$//$NON-NLS-2$ } diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryIndexElement.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryIndexElement.java index 5050d54b6..16e0c2a48 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryIndexElement.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryIndexElement.java @@ -80,14 +80,17 @@ public class RegistryIndexElement implements KeyedElement { } //Implements the KeyedElement interface + @Override public int getKeyHashCode() { return getKey().hashCode(); } + @Override public Object getKey() { return key; } + @Override public boolean compare(KeyedElement other) { return key.equals(((RegistryIndexElement) other).key); } diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryObject.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryObject.java index 89865c879..ae9c879c0 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryObject.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryObject.java @@ -58,14 +58,17 @@ public abstract class RegistryObject implements KeyedElement { } //Implementation of the KeyedElement interface + @Override public int getKeyHashCode() { return objectId; } + @Override public Object getKey() { return new Integer(objectId); } + @Override public boolean compare(KeyedElement other) { return objectId == ((RegistryObject) other).objectId; } diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryObjectFactoryMulti.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryObjectFactoryMulti.java index 3c6d51da5..c6869ca46 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryObjectFactoryMulti.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryObjectFactoryMulti.java @@ -20,26 +20,32 @@ public class RegistryObjectFactoryMulti extends RegistryObjectFactory { super(registry); } + @Override public ExtensionPoint createExtensionPoint(boolean persist) { return new ExtensionPointMulti(registry, persist); } + @Override public ExtensionPoint createExtensionPoint(int self, int[] children, int dataOffset, boolean persist) { return new ExtensionPointMulti(self, children, dataOffset, registry, persist); } + @Override public Extension createExtension(boolean persist) { return new ExtensionMulti(registry, persist); } + @Override public Extension createExtension(int self, String simpleId, String namespace, int[] children, int extraData, boolean persist) { return new ExtensionMulti(self, simpleId, namespace, children, extraData, registry, persist); } + @Override public ConfigurationElement createConfigurationElement(boolean persist) { return new ConfigurationElementMulti(registry, persist); } + @Override public ConfigurationElement createConfigurationElement(int self, String contributorId, String name, String[] propertiesAndValue, int[] children, int extraDataOffset, int parent, byte parentType, boolean persist) { return new ConfigurationElementMulti(self, contributorId, name, propertiesAndValue, children, extraDataOffset, parent, parentType, registry, persist); } diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryObjectManager.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryObjectManager.java index 1d221337b..52dca508f 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryObjectManager.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryObjectManager.java @@ -259,6 +259,7 @@ public class RegistryObjectManager implements IObjectManager { heldObjects.remove(toRelease); } + @Override public synchronized Object getObject(int id, byte type) { return basicGetObject(id, type); } @@ -290,6 +291,7 @@ public class RegistryObjectManager implements IObjectManager { return true; } + @Override public synchronized RegistryObject[] getObjects(int[] values, byte type) { if (values.length == 0) { switch (type) { @@ -329,6 +331,7 @@ public class RegistryObjectManager implements IObjectManager { return (ExtensionPoint) getObject(id, EXTENSION_POINT); } + @Override public Handle getHandle(int id, byte type) { switch (type) { case EXTENSION_POINT : @@ -346,6 +349,7 @@ public class RegistryObjectManager implements IObjectManager { } } + @Override public Handle[] getHandles(int[] ids, byte type) { Handle[] results = null; int nbrId = ids.length; @@ -748,6 +752,7 @@ public class RegistryObjectManager implements IObjectManager { } } + @Override public void close() { //do nothing. } diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryProperties.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryProperties.java index b2e302b4a..daeea3a3d 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryProperties.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/RegistryProperties.java @@ -57,6 +57,7 @@ public class RegistryProperties { // Wrap BundleContext into an inner class to make sure it will only get loaded // if OSGi layer is present. Runnable innerClass = new Runnable() { + @Override public void run() { org.osgi.framework.BundleContext bundleContext = (org.osgi.framework.BundleContext) context; result[0] = bundleContext.getProperty(propertyName); diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/TemporaryObjectManager.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/TemporaryObjectManager.java index 8af033054..c2f432f6a 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/TemporaryObjectManager.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/TemporaryObjectManager.java @@ -25,6 +25,7 @@ public class TemporaryObjectManager implements IObjectManager { this.parent = parent; } + @Override public Handle getHandle(int id, byte type) { switch (type) { case RegistryObjectManager.EXTENSION_POINT : @@ -42,6 +43,7 @@ public class TemporaryObjectManager implements IObjectManager { } } + @Override public Handle[] getHandles(int[] ids, byte type) { Handle[] results = null; int nbrId = ids.length; @@ -85,6 +87,7 @@ public class TemporaryObjectManager implements IObjectManager { return results; } + @Override synchronized public Object getObject(int id, byte type) { Object result = null; try { @@ -99,6 +102,7 @@ public class TemporaryObjectManager implements IObjectManager { return result; } + @Override synchronized public RegistryObject[] getObjects(int[] values, byte type) { if (values.length == 0) { switch (type) { @@ -131,6 +135,7 @@ public class TemporaryObjectManager implements IObjectManager { return results; } + @Override public synchronized void close() { actualObjects = null; } diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ThirdLevelConfigurationElementHandle.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ThirdLevelConfigurationElementHandle.java index db255be50..859333838 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ThirdLevelConfigurationElementHandle.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/ThirdLevelConfigurationElementHandle.java @@ -21,10 +21,12 @@ public class ThirdLevelConfigurationElementHandle extends ConfigurationElementHa super(objectManager, id); } + @Override protected ConfigurationElement getConfigurationElement() { return (ConfigurationElement) objectManager.getObject(getId(), RegistryObjectManager.THIRDLEVEL_CONFIGURATION_ELEMENT); } + @Override public IConfigurationElement[] getChildren() { return (IConfigurationElement[]) objectManager.getHandles(getConfigurationElement().getRawChildren(), RegistryObjectManager.THIRDLEVEL_CONFIGURATION_ELEMENT); } diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/Activator.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/Activator.java index d5dfee14d..7e5494767 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/Activator.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/Activator.java @@ -49,6 +49,7 @@ public class Activator implements BundleActivator { /** * This method is called upon plug-in activation */ + @Override public void start(BundleContext context) throws Exception { bundleContext = context; RegistryProperties.setContext(bundleContext); @@ -60,6 +61,7 @@ public class Activator implements BundleActivator { /** * This method is called when the plug-in is stopped */ + @Override public void stop(BundleContext context) throws Exception { if (adapterManagerListener != null) adapterManagerListener.stop(); // before extension registry diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/EclipseBundleListener.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/EclipseBundleListener.java index dc6521b52..fd24bd6c9 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/EclipseBundleListener.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/EclipseBundleListener.java @@ -47,6 +47,7 @@ public class EclipseBundleListener implements SynchronousBundleListener { this.strategy = strategy; } + @Override public void bundleChanged(BundleEvent event) { /* Only should listen for RESOLVED and UNRESOLVED events. * diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/EquinoxRegistryStrategy.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/EquinoxRegistryStrategy.java index 1f8ec1522..adaa1c08b 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/EquinoxRegistryStrategy.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/EquinoxRegistryStrategy.java @@ -46,18 +46,22 @@ public class EquinoxRegistryStrategy extends RegistryStrategyOSGI { super(theStorageDir, cacheReadOnly, key); } + @Override public boolean debug() { return DEBUG_ECLIPSE_REGISTRY; } + @Override public boolean debugRegistryEvents() { return DEBUG_ECLIPSE_EVENTS; } + @Override public final void log(IStatus status) { RuntimeLog.log(status); } + @Override public long getContainerTimestamp() { BundleContext context = Activator.getContext(); if (context == null) { @@ -80,6 +84,7 @@ public class EquinoxRegistryStrategy extends RegistryStrategyOSGI { * will be made (until registry bundle is restarted). Avoiding repeated checks in this scenario will ensure that * most users see no performance degradation and that order of registry events remains consistent. */ + @Override public final void scheduleChangeEvent(Object[] listeners, Map deltas, Object registry) { if (useJobs) { try { diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/ExtensionEventDispatcherJob.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/ExtensionEventDispatcherJob.java index cd829346f..33eadd583 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/ExtensionEventDispatcherJob.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/ExtensionEventDispatcherJob.java @@ -23,10 +23,12 @@ import org.eclipse.core.runtime.spi.RegistryStrategy; final public class ExtensionEventDispatcherJob extends Job { // an "identy rule" that forces extension events to be queued private final static ISchedulingRule EXTENSION_EVENT_RULE = new ISchedulingRule() { + @Override public boolean contains(ISchedulingRule rule) { return rule == this; } + @Override public boolean isConflicting(ISchedulingRule rule) { return rule == this; } @@ -46,6 +48,7 @@ final public class ExtensionEventDispatcherJob extends Job { setRule(EXTENSION_EVENT_RULE); } + @Override public IStatus run(IProgressMonitor monitor) { return RegistryStrategy.processChangeEvent(listenerInfos, deltas, registry); } diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/RegistryCommandProvider.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/RegistryCommandProvider.java index b93472f55..d1fd3bcc1 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/RegistryCommandProvider.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/RegistryCommandProvider.java @@ -24,6 +24,7 @@ public class RegistryCommandProvider implements CommandProvider { private boolean verbose = false; // is command run in a "verbose" mode? + @Override public String getHelp() { return getHelp(null); } diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/RegistryProviderOSGI.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/RegistryProviderOSGI.java index 780d6a4f0..1bbd1e1c5 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/RegistryProviderOSGI.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/RegistryProviderOSGI.java @@ -24,6 +24,7 @@ public final class RegistryProviderOSGI implements IRegistryProvider { /* (non-Javadoc) * @see org.eclipse.equinox.registry.IRegistryProvider#getRegistry() */ + @Override public IExtensionRegistry getRegistry() { return registry; } diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/RegistryStrategyOSGI.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/RegistryStrategyOSGI.java index 6dfae41a0..beb3ca8b6 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/RegistryStrategyOSGI.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/RegistryStrategyOSGI.java @@ -95,6 +95,7 @@ public class RegistryStrategyOSGI extends RegistryStrategy { /* (non-Javadoc) * @see org.eclipse.core.runtime.spi.RegistryStrategy#translate(java.lang.String, java.util.ResourceBundle) */ + @Override public final String translate(String key, ResourceBundle resources) { return ResourceTranslator.getResourceString(null, key, resources); } @@ -102,6 +103,7 @@ public class RegistryStrategyOSGI extends RegistryStrategy { /* (non-Javadoc) * @see org.eclipse.core.runtime.spi.RegistryStrategy#translate(java.lang.String[], org.eclipse.core.runtime.IContributor, java.lang.String) */ + @Override public String[] translate(String[] nonTranslated, IContributor contributor, String locale) { return ResourceTranslator.getResourceString(ContributorFactoryOSGi.resolve(contributor), nonTranslated, locale); } @@ -158,6 +160,7 @@ public class RegistryStrategyOSGI extends RegistryStrategy { /* (non-Javadoc) * @see org.eclipse.core.runtime.spi.RegistryStrategy#createExecutableExtension(org.eclipse.core.runtime.spi.RegistryContributor, java.lang.String, java.lang.String) */ + @Override public Object createExecutableExtension(RegistryContributor contributor, String className, String overridenContributorName) throws CoreException { Bundle contributingBundle; if (overridenContributorName != null && !overridenContributorName.equals("")) //$NON-NLS-1$ @@ -205,6 +208,7 @@ public class RegistryStrategyOSGI extends RegistryStrategy { /* (non-Javadoc) * @see org.eclipse.core.runtime.spi.RegistryStrategy#onStart(org.eclipse.core.runtime.IExtensionRegistry, boolean) */ + @Override public void onStart(IExtensionRegistry registry, boolean loadedFromCache) { super.onStart(registry, loadedFromCache); @@ -227,6 +231,7 @@ public class RegistryStrategyOSGI extends RegistryStrategy { /* (non-Javadoc) * @see org.eclipse.core.runtime.spi.RegistryStrategy#onStop(org.eclipse.core.runtime.IExtensionRegistry) */ + @Override public void onStop(IExtensionRegistry registry) { if (pluginBundleListener != null) Activator.getContext().removeBundleListener(pluginBundleListener); @@ -247,6 +252,7 @@ public class RegistryStrategyOSGI extends RegistryStrategy { /* (non-Javadoc) * @see org.eclipse.core.runtime.spi.RegistryStrategy#cacheUse() */ + @Override public boolean cacheUse() { return !"true".equals(RegistryProperties.getProperty(IRegistryConstants.PROP_NO_REGISTRY_CACHE)); //$NON-NLS-1$ } @@ -254,6 +260,7 @@ public class RegistryStrategyOSGI extends RegistryStrategy { /* (non-Javadoc) * @see org.eclipse.core.runtime.spi.RegistryStrategy#cacheLazyLoading() */ + @Override public boolean cacheLazyLoading() { return !("true".equalsIgnoreCase(RegistryProperties.getProperty(IRegistryConstants.PROP_NO_LAZY_CACHE_LOADING))); //$NON-NLS-1$ } @@ -261,6 +268,7 @@ public class RegistryStrategyOSGI extends RegistryStrategy { /* (non-Javadoc) * @see org.eclipse.core.runtime.spi.RegistryStrategy#getContributionsTimestamp() */ + @Override public long getContributionsTimestamp() { if (!checkContributionsTimestamp()) return 0; @@ -298,6 +306,7 @@ public class RegistryStrategyOSGI extends RegistryStrategy { /* (non-Javadoc) * @see org.eclipse.core.runtime.spi.RegistryStrategy#getXMLParser() */ + @Override public SAXParserFactory getXMLParser() { if (xmlTracker == null) { xmlTracker = new ServiceTracker(Activator.getContext(), SAXParserFactory.class.getName(), null); @@ -309,6 +318,7 @@ public class RegistryStrategyOSGI extends RegistryStrategy { /* (non-Javadoc) * @see org.eclipse.core.runtime.spi.RegistryStrategy#getLocale() */ + @Override public String getLocale() { if (localeTracker == null) { localeTracker = new ServiceTracker(Activator.getContext(), LocaleProvider.class.getName(), null); diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/runtime/IConfigurationElement.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/runtime/IConfigurationElement.java index e9c6c2bef..068b7481d 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/runtime/IConfigurationElement.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/runtime/IConfigurationElement.java @@ -376,6 +376,7 @@ public interface IConfigurationElement { /* (non-javadoc) * @see Object#equals(java.lang.Object) */ + @Override public boolean equals(Object o); /** diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/runtime/IExtension.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/runtime/IExtension.java index 67d746fc3..9c6337829 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/runtime/IExtension.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/runtime/IExtension.java @@ -188,6 +188,7 @@ public interface IExtension { /* (non-javadoc) * @see Object#equals(java.lang.Object) */ + @Override public boolean equals(Object o); /** diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/runtime/IExtensionPoint.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/runtime/IExtensionPoint.java index d34e6e6f2..4eb6cb64b 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/runtime/IExtensionPoint.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/runtime/IExtensionPoint.java @@ -213,6 +213,7 @@ public interface IExtensionPoint { /* (non-javadoc) * @see Object#equals(java.lang.Object) */ + @Override public boolean equals(Object o); /** diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/runtime/dynamichelpers/ExtensionTracker.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/runtime/dynamichelpers/ExtensionTracker.java index 1bb3c6913..4f29b1901 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/runtime/dynamichelpers/ExtensionTracker.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/runtime/dynamichelpers/ExtensionTracker.java @@ -61,6 +61,7 @@ public class ExtensionTracker implements IExtensionTracker, IRegistryChangeListe /* (non-Javadoc) * @see org.eclipse.core.runtime.dynamichelpers.IExtensionTracker#registerHandler(org.eclipse.core.runtime.dynamichelpers.IExtensionChangeHandler, org.eclipse.core.runtime.dynamichelpers.IFilter) */ + @Override public void registerHandler(IExtensionChangeHandler handler, IFilter filter) { synchronized (lock) { if (closed) @@ -73,6 +74,7 @@ public class ExtensionTracker implements IExtensionTracker, IRegistryChangeListe /* (non-Javadoc) * @see IExtensionTracker@unregisterHandler(IExtensionChangeHandler) */ + @Override public void unregisterHandler(IExtensionChangeHandler handler) { synchronized (lock) { if (closed) @@ -84,6 +86,7 @@ public class ExtensionTracker implements IExtensionTracker, IRegistryChangeListe /* (non-Javadoc) * @see IExtensionTracker@registerObject(IExtension, Object, int) */ + @Override public void registerObject(IExtension element, Object object, int referenceType) { if (element == null || object == null) return; @@ -107,6 +110,7 @@ public class ExtensionTracker implements IExtensionTracker, IRegistryChangeListe * <em>This method must not be called by clients.</em> * </p> */ + @Override public void registryChanged(IRegistryChangeEvent event) { IExtensionDelta delta[] = event.getExtensionDeltas(); int len = delta.length; @@ -186,6 +190,7 @@ public class ExtensionTracker implements IExtensionTracker, IRegistryChangeListe /* (non-Javadoc) * @see IExtensionTracker@getObjects(IExtension) */ + @Override public Object[] getObjects(IExtension element) { synchronized (lock) { if (closed) @@ -201,6 +206,7 @@ public class ExtensionTracker implements IExtensionTracker, IRegistryChangeListe /* (non-Javadoc) * @see IExtensionTracker@close() */ + @Override public void close() { synchronized (lock) { if (closed) @@ -217,6 +223,7 @@ public class ExtensionTracker implements IExtensionTracker, IRegistryChangeListe /* (non-Javadoc) * @see IExtensionTracker@unregisterObject(IExtension, Object) */ + @Override public void unregisterObject(IExtension extension, Object object) { synchronized (lock) { if (closed) @@ -230,6 +237,7 @@ public class ExtensionTracker implements IExtensionTracker, IRegistryChangeListe /* (non-Javadoc) * @see IExtensionTracker@unregisterObject(IExtension) */ + @Override public Object[] unregisterObject(IExtension extension) { synchronized (lock) { if (closed) @@ -249,6 +257,7 @@ public class ExtensionTracker implements IExtensionTracker, IRegistryChangeListe */ public static IFilter createExtensionPointFilter(final IExtensionPoint xpt) { return new IFilter() { + @Override public boolean matches(IExtensionPoint target) { return xpt.equals(target); } @@ -263,6 +272,7 @@ public class ExtensionTracker implements IExtensionTracker, IRegistryChangeListe */ public static IFilter createExtensionPointFilter(final IExtensionPoint[] xpts) { return new IFilter() { + @Override public boolean matches(IExtensionPoint target) { for (int i = 0; i < xpts.length; i++) if (xpts[i].equals(target)) @@ -280,6 +290,7 @@ public class ExtensionTracker implements IExtensionTracker, IRegistryChangeListe */ public static IFilter createNamespaceFilter(final String id) { return new IFilter() { + @Override public boolean matches(IExtensionPoint target) { return id.equals(target.getNamespaceIdentifier()); } @@ -295,10 +306,12 @@ public class ExtensionTracker implements IExtensionTracker, IRegistryChangeListe this.filter = filter; } + @Override public boolean equals(Object target) { return handler.equals(((HandlerWrapper) target).handler); } + @Override public int hashCode() { return handler.hashCode(); } diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/runtime/spi/RegistryContributor.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/runtime/spi/RegistryContributor.java index ad54d50dd..31f3426ca 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/runtime/spi/RegistryContributor.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/runtime/spi/RegistryContributor.java @@ -130,6 +130,7 @@ public final class RegistryContributor implements IContributor { * * @return name of the registry contributor */ + @Override public String getName() { return hostName; } @@ -137,6 +138,7 @@ public final class RegistryContributor implements IContributor { /* (non-Javadoc) * @see java.lang.Object#toString() */ + @Override public String toString() { return actualContributorName + "[" + actualContributorId + "]"; //$NON-NLS-1$ //$NON-NLS-2$ } |