Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Schorn2008-04-25 14:24:53 +0000
committerMarkus Schorn2008-04-25 14:24:53 +0000
commit0b1b9a60929018699f16d555de7cbd6aab4f8234 (patch)
tree87c7cc0a04e05dc90e5748ddb70784130a8fc8fe /core/org.eclipse.cdt.core/model
parent73c405bc381a5fcf9e18d9e1ad199e0a9ba0cf96 (diff)
downloadorg.eclipse.cdt-0b1b9a60929018699f16d555de7cbd6aab4f8234.tar.gz
org.eclipse.cdt-0b1b9a60929018699f16d555de7cbd6aab4f8234.tar.xz
org.eclipse.cdt-0b1b9a60929018699f16d555de7cbd6aab4f8234.zip
Fix warnings.
Diffstat (limited to 'core/org.eclipse.cdt.core/model')
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/CElementHandle.java5
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/CElementHandleFactory.java2
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/EnumerationHandle.java2
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/ICacheEnumeration.java42
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/LRUCache.java28
5 files changed, 6 insertions, 73 deletions
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/CElementHandle.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/CElementHandle.java
index 3d5ad0e5473..bcacedf9661 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/CElementHandle.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/CElementHandle.java
@@ -80,6 +80,7 @@ abstract class CElementHandle implements ICElementHandle, ISourceReference {
}
+ @SuppressWarnings("unchecked")
public Object getAdapter(Class adapter) {
return null;
}
@@ -197,8 +198,8 @@ abstract class CElementHandle implements ICElementHandle, ISourceReference {
return NO_CHILDREN;
}
- public List getChildrenOfType(int type) throws CModelException {
- return Collections.EMPTY_LIST;
+ public List<ICElement> getChildrenOfType(int type) throws CModelException {
+ return Collections.emptyList();
}
public boolean hasChildren() {
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/CElementHandleFactory.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/CElementHandleFactory.java
index 7536f6f33bc..0a10e840773 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/CElementHandleFactory.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/CElementHandleFactory.java
@@ -59,7 +59,7 @@ public class CElementHandleFactory {
public static ICElementHandle create(ITranslationUnit tu, IIndexMacro macro,
IRegion region, long timestamp) throws CoreException {
CElementHandle element= new MacroHandle(tu, macro);
- if (element != null && region != null) {
+ if (region != null) {
element.setRangeOfID(region, timestamp);
}
return element;
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/EnumerationHandle.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/EnumerationHandle.java
index 6ed3c3329cb..6ae1d5214f6 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/EnumerationHandle.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/ext/EnumerationHandle.java
@@ -15,7 +15,7 @@ import org.eclipse.cdt.core.dom.ast.IEnumeration;
import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.ICElement;
-public class EnumerationHandle extends CElementHandle implements org.eclipse.cdt.core.model.IEnumeration, ICElementHandle {
+public class EnumerationHandle extends CElementHandle implements org.eclipse.cdt.core.model.IEnumeration {
public EnumerationHandle(ICElement parent, IEnumeration enumeration) {
super(parent, ICElement.C_ENUMERATION, enumeration.getName());
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/ICacheEnumeration.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/ICacheEnumeration.java
deleted file mode 100644
index d8eb262aab0..00000000000
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/ICacheEnumeration.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002, 2006 IBM Corporation 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Rational Software - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.internal.core.util;
-
-
-import java.util.Enumeration;
-
-/**
- * The <code>ICacheEnumeration</code> is used to iterate over both the keys
- * and values in an LRUCache. The <code>getValue()</code> method returns the
- * value of the last key to be retrieved using <code>nextElement()</code>.
- * The <code>nextElement()</code> method must be called before the
- * <code>getValue()</code> method.
- *
- * <p>The iteration can be made efficient by making use of the fact that values in
- * the cache (instances of <code>LRUCacheEntry</code>), know their key. For this reason,
- * Hashtable lookups don't have to be made at each step of the iteration.
- *
- * <p>Modifications to the cache must not be performed while using the
- * enumeration. Doing so will lead to an illegal state.
- *
- * @see LRUCache
- *
- * This interface is similar to the JDT ICacheEnumeration interface.
- */
-public interface ICacheEnumeration extends Enumeration {
- /**
- * Returns the value of the previously accessed key in the enumeration.
- * Must be called after a call to nextElement().
- *
- * @return Value of current cache entry
- */
- public Object getValue();
-}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/LRUCache.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/LRUCache.java
index 03857bbab71..d4a05654f1a 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/LRUCache.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/util/LRUCache.java
@@ -239,33 +239,7 @@ public class LRUCache<K,T> implements Cloneable {
public boolean isEmpty() {
return fEntryTable.isEmpty();
}
- /**
- * Returns an enumeration that iterates over all the keys and values
- * currently in the cache.
- */
- public ICacheEnumeration keysAndValues() {
- return new ICacheEnumeration() {
-
- Enumeration<LRUCacheEntry<K,T>> fValues = fEntryTable.elements();
- LRUCacheEntry<K,T> fEntry;
-
- public boolean hasMoreElements() {
- return fValues.hasMoreElements();
- }
-
- public K nextElement() {
- fEntry = fValues.nextElement();
- return fEntry._fKey;
- }
-
- public T getValue() {
- if (fEntry == null) {
- throw new java.util.NoSuchElementException();
- }
- return fEntry._fValue;
- }
- };
- }
+
/**
* Ensures there is the specified amount of free space in the receiver,
* by removing old entries if necessary. Returns true if the requested space was

Back to the top