1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 22:22:11 +02:00

Warnings cleanup

This commit is contained in:
Anton Leherbauer 2010-11-12 10:21:07 +00:00
parent 8154839ead
commit bbcd27276a
3 changed files with 12 additions and 27 deletions

View file

@ -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<String, String> fPlugins = new HashMap<String, String>();
private HashMap<String, String[]> fLocations = new HashMap<String, String[]>();
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;

View file

@ -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.
*/

View file

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