mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Warnings cleanup
This commit is contained in:
parent
8154839ead
commit
bbcd27276a
3 changed files with 12 additions and 27 deletions
|
@ -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
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* 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.
|
* 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> fPlugins = new HashMap<String, String>();
|
||||||
private HashMap<String, String[]> fLocations = new HashMap<String, String[]>();
|
private HashMap<String, String[]> fLocations = new HashMap<String, String[]>();
|
||||||
private URL fBaseUrl;
|
private URL fBaseUrl;
|
||||||
|
private final ImageRegistry fRegistry;
|
||||||
|
|
||||||
protected AbstractImageRegistry(Plugin plugin) {
|
protected AbstractImageRegistry(Plugin plugin) {
|
||||||
|
fRegistry = new ImageRegistry();
|
||||||
fBaseUrl = plugin.getBundle().getEntry("/"); //$NON-NLS-1$
|
fBaseUrl = plugin.getBundle().getEntry("/"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,33 +80,29 @@ public abstract class AbstractImageRegistry extends ImageRegistry {
|
||||||
fLocations.put(key, locations);
|
fLocations.put(key, locations);
|
||||||
}
|
}
|
||||||
|
|
||||||
// overrider
|
|
||||||
@Override
|
|
||||||
final public Image get(String key) {
|
final public Image get(String key) {
|
||||||
Image i = super.get(key);
|
Image i = fRegistry.get(key);
|
||||||
if (i != null) {
|
if (i != null) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageDescriptor d = createFileImageDescriptor(key);
|
ImageDescriptor d = createFileImageDescriptor(key);
|
||||||
if (d != null) {
|
if (d != null) {
|
||||||
put(key, d);
|
fRegistry.put(key, d);
|
||||||
return super.get(key);
|
return fRegistry.get(key);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// overrider
|
|
||||||
@Override
|
|
||||||
final public ImageDescriptor getDescriptor(String key) {
|
final public ImageDescriptor getDescriptor(String key) {
|
||||||
ImageDescriptor d = super.getDescriptor(key);
|
ImageDescriptor d = fRegistry.getDescriptor(key);
|
||||||
if (d != null) {
|
if (d != null) {
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
d = createFileImageDescriptor(key);
|
d = createFileImageDescriptor(key);
|
||||||
if (d != null) {
|
if (d != null) {
|
||||||
put(key, d);
|
fRegistry.put(key, d);
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -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
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -21,7 +21,6 @@ public final class REDFile {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* File cache object.
|
* File cache object.
|
||||||
* TLETODO Use CharBuffer?
|
|
||||||
* @invariant fSize <= fcBufSize
|
* @invariant fSize <= fcBufSize
|
||||||
* @invariant fSize >= 0
|
* @invariant fSize >= 0
|
||||||
* @invariant fOffset <= fFile.length()
|
* @invariant fOffset <= fFile.length()
|
||||||
|
@ -39,15 +38,6 @@ public final class REDFile {
|
||||||
Buffer() {
|
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.
|
* @return number of available characters.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -102,10 +102,7 @@ abstract public class StorageEditorInput implements IStorageEditorInput {
|
||||||
return getStorage().hashCode();
|
return getStorage().hashCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
@SuppressWarnings("rawtypes")
|
||||||
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public Object getAdapter(Class adapter) {
|
public Object getAdapter(Class adapter) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue