From bbcd27276affc476a3011bf50f7d58abbd8ed09f Mon Sep 17 00:00:00 2001 From: Anton Leherbauer Date: Fri, 12 Nov 2010 10:21:07 +0000 Subject: [PATCH] Warnings cleanup --- .../ui/disassembly/AbstractImageRegistry.java | 20 +++++++++---------- .../internal/ui/disassembly/text/REDFile.java | 12 +---------- .../disassembly/util/StorageEditorInput.java | 7 ++----- 3 files changed, 12 insertions(+), 27 deletions(-) diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/AbstractImageRegistry.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/AbstractImageRegistry.java index 5f544ff6888..a0bf5df2263 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/AbstractImageRegistry.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/AbstractImageRegistry.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 Wind River Systems and others. + * Copyright (c) 2007, 2010 Wind River Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -29,12 +29,14 @@ import org.osgi.framework.Bundle; /** * Abstract image registry that allows for defining fallback paths for images. */ -public abstract class AbstractImageRegistry extends ImageRegistry { +public abstract class AbstractImageRegistry { private HashMap fPlugins = new HashMap(); private HashMap fLocations = new HashMap(); private URL fBaseUrl; + private final ImageRegistry fRegistry; protected AbstractImageRegistry(Plugin plugin) { + fRegistry = new ImageRegistry(); fBaseUrl = plugin.getBundle().getEntry("/"); //$NON-NLS-1$ } @@ -78,33 +80,29 @@ public abstract class AbstractImageRegistry extends ImageRegistry { fLocations.put(key, locations); } - // overrider - @Override final public Image get(String key) { - Image i = super.get(key); + Image i = fRegistry.get(key); if (i != null) { return i; } ImageDescriptor d = createFileImageDescriptor(key); if (d != null) { - put(key, d); - return super.get(key); + fRegistry.put(key, d); + return fRegistry.get(key); } return null; } - // overrider - @Override final public ImageDescriptor getDescriptor(String key) { - ImageDescriptor d = super.getDescriptor(key); + ImageDescriptor d = fRegistry.getDescriptor(key); if (d != null) { return d; } d = createFileImageDescriptor(key); if (d != null) { - put(key, d); + fRegistry.put(key, d); return d; } return null; diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/text/REDFile.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/text/REDFile.java index 183302b2586..f1abecf42ca 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/text/REDFile.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/text/REDFile.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 Wind River Systems and others. + * Copyright (c) 2007, 2010 Wind River Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -21,7 +21,6 @@ public final class REDFile { /** * File cache object. - * TLETODO Use CharBuffer? * @invariant fSize <= fcBufSize * @invariant fSize >= 0 * @invariant fOffset <= fFile.length() @@ -39,15 +38,6 @@ public final class REDFile { Buffer() { } - /** - * Check if the file offset is contained in this buffer. - * @param pos - * @return - */ - boolean containsOffset(int pos) { - return fOffset < pos || fOffset + fSize <= pos; - } - /** * @return number of available characters. */ diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/util/StorageEditorInput.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/util/StorageEditorInput.java index 58c10fdd4b5..e2e424d12fb 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/util/StorageEditorInput.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/util/StorageEditorInput.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 Wind River Systems and others. + * Copyright (c) 2007, 2010 Wind River Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -102,10 +102,7 @@ abstract public class StorageEditorInput implements IStorageEditorInput { return getStorage().hashCode(); } - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) - */ - @SuppressWarnings("unchecked") + @SuppressWarnings("rawtypes") public Object getAdapter(Class adapter) { return null; }