From d1ae88ece1a9968215b0a369ddcd71d7467e0fbf Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Fri, 7 Oct 2016 14:15:21 +0200 Subject: Bug 505359 - [Minor] Reduce warnings in org.eclipse.equinox.registry Change-Id: I8b3b90f9a4c11eb8858e5ebfe67ea12f57f441c2 Signed-off-by: Lars Vogel --- .../core/internal/registry/BufferedRandomInputStream.java | 2 +- .../core/internal/registry/RegistryIndexElement.java | 14 +++++--------- .../core/internal/registry/RegistryObjectManager.java | 2 +- .../eclipse/core/internal/registry/RegistryProperties.java | 4 ++-- 4 files changed, 9 insertions(+), 13 deletions(-) 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 db0abec13..9f1df30a3 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 @@ -100,7 +100,7 @@ public class BufferedRandomInputStream extends InputStream { return available + skipped; } - public int available() throws IOException { + public int available() { return (buffer_size - buffer_pos); } 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 6daf40b8b..5050d54b6 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 @@ -24,7 +24,7 @@ public class RegistryIndexElement implements KeyedElement { public RegistryIndexElement(String key) { this.key = key; } - + public RegistryIndexElement(String key, int[] extensionPoints, int[] extensions) { this.key = key; this.extensionPoints = new RegistryIndexChildren(extensionPoints); @@ -49,8 +49,7 @@ public class RegistryIndexElement implements KeyedElement { if (add) return extensions.linkChild(id); - else - return extensions.unlinkChild(id); + return extensions.unlinkChild(id); } public boolean updateExtensions(int[] IDs, boolean add) { @@ -59,8 +58,7 @@ public class RegistryIndexElement implements KeyedElement { if (add) return extensions.linkChildren(IDs); - else - return extensions.unlinkChildren(IDs); + return extensions.unlinkChildren(IDs); } public boolean updateExtensionPoint(int id, boolean add) { @@ -69,8 +67,7 @@ public class RegistryIndexElement implements KeyedElement { if (add) return extensionPoints.linkChild(id); - else - return extensionPoints.unlinkChild(id); + return extensionPoints.unlinkChild(id); } public boolean updateExtensionPoints(int[] IDs, boolean add) { @@ -79,8 +76,7 @@ public class RegistryIndexElement implements KeyedElement { if (add) return extensionPoints.linkChildren(IDs); - else - return extensionPoints.unlinkChildren(IDs); + return extensionPoints.unlinkChildren(IDs); } //Implements the KeyedElement interface 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 552d42a5c..1d221337b 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 @@ -476,7 +476,7 @@ public class RegistryObjectManager implements IObjectManager { if (orphanExtensions == null && !fromCache) { result = new HashMap(); orphanExtensions = result; - } else if (orphanExtensions == null || (result = ((HashMap) ((orphanExtensions instanceof SoftReference) ? ((SoftReference) orphanExtensions).get() : orphanExtensions))) == null) { + } else if (orphanExtensions == null || (result = ((orphanExtensions instanceof SoftReference) ? ((SoftReference) orphanExtensions).get() : orphanExtensions)) == null) { result = registry.getTableReader().loadOrphans(); orphanExtensions = new SoftReference(result); } 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 08f168996..b2e302b4a 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 @@ -18,7 +18,7 @@ import org.eclipse.core.runtime.Status; * to BundleContext properties (if available) or System properties otherwise. */ public class RegistryProperties { - + public static final String empty = ""; //$NON-NLS-1$ private static Properties registryProperties = new Properties(); @@ -68,7 +68,7 @@ public class RegistryProperties { // is not present or non-standard. This should not happen, but let's give // the program a chance to continue - properties should have reasonable // default values. - IStatus status = new Status(Status.ERROR, IRegistryConstants.RUNTIME_NAME, 0, e.getMessage(), e); + IStatus status = new Status(IStatus.ERROR, IRegistryConstants.RUNTIME_NAME, 0, e.getMessage(), e); RuntimeLog.log(status); return null; } -- cgit v1.2.3