1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Reducing compiler warnings.

This commit is contained in:
Markus Schorn 2012-01-02 13:38:43 +01:00
parent 1b67403176
commit 934ea4b7b8
5 changed files with 17 additions and 9 deletions

View file

@ -20,7 +20,7 @@ import java.util.List;
* @author Doug Schaefer
*/
public class CharArrayObjectMap <T> extends CharTable {
public static final CharArrayObjectMap<Object> EMPTY_MAP = new CharArrayObjectMap<Object>(0) {
public static final CharArrayObjectMap<?> EMPTY_MAP = new CharArrayObjectMap<Object>(0) {
@Override
public Object clone() { return this; }
@Override

View file

@ -77,6 +77,7 @@ public class CPPClassScope extends CPPScope implements ICPPClassScope {
super(physicalNode);
}
@Override
public EScopeKind getKind() {
return EScopeKind.eClassType;
}
@ -270,6 +271,7 @@ public class CPPClassScope extends CPPScope implements ICPPClassScope {
return true;
}
@Override
public ICPPConstructor[] getConstructors() {
return getConstructors(null, true);
}
@ -277,7 +279,7 @@ public class CPPClassScope extends CPPScope implements ICPPClassScope {
private ICPPConstructor[] getConstructors(IASTName forName, boolean forceResolve) {
populateCache();
final CharArrayObjectMap nameMap = bindings;
final CharArrayObjectMap<Object> nameMap = bindings;
if (nameMap == null)
return ICPPConstructor.EMPTY_CONSTRUCTOR_ARRAY;
@ -365,6 +367,7 @@ public class CPPClassScope extends CPPScope implements ICPPClassScope {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope#getClassType()
*/
@Override
public ICPPClassType getClassType() {
ICPPASTCompositeTypeSpecifier compSpec = (ICPPASTCompositeTypeSpecifier) getPhysicalNode();
final IASTName name = compSpec.getName();
@ -378,6 +381,7 @@ public class CPPClassScope extends CPPScope implements ICPPClassScope {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPClassScope#getImplicitMethods()
*/
@Override
public ICPPMethod[] getImplicitMethods() {
if (implicits == null)
return ICPPMethod.EMPTY_CPPMETHOD_ARRAY;

View file

@ -38,7 +38,7 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
*/
public class CPPFunctionScope extends CPPScope implements ICPPFunctionScope {
private CharArrayObjectMap labels = CharArrayObjectMap.EMPTY_MAP;
private CharArrayObjectMap<IBinding> labels = CharArrayObjectMap.emptyMap();
/**
* @param physicalNode
@ -47,6 +47,7 @@ public class CPPFunctionScope extends CPPScope implements ICPPFunctionScope {
super(physicalNode);
}
@Override
public EScopeKind getKind() {
return EScopeKind.eLocal;
}
@ -61,7 +62,7 @@ public class CPPFunctionScope extends CPPScope implements ICPPFunctionScope {
return;
if (labels == CharArrayObjectMap.EMPTY_MAP)
labels = new CharArrayObjectMap(2);
labels = new CharArrayObjectMap<IBinding>(2);
labels.put(binding.getNameCharArray(), binding);
}
@ -70,7 +71,7 @@ public class CPPFunctionScope extends CPPScope implements ICPPFunctionScope {
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPScope#getBinding(int, char[])
*/
public IBinding getBinding(IASTName name) {
return (IBinding) labels.get(name.getLookupKey());
return labels.get(name.getLookupKey());
}
/* (non-Javadoc)
@ -84,7 +85,7 @@ public class CPPFunctionScope extends CPPScope implements ICPPFunctionScope {
for (int i = 0; i < labels.size(); i++) {
char[] key = labels.keyAt(i);
if (CharArrayUtils.equals(key, n)) {
bindings.add((IBinding) labels.get(key));
bindings.add(labels.get(key));
}
}
@ -108,6 +109,7 @@ public class CPPFunctionScope extends CPPScope implements ICPPFunctionScope {
/* (non-Javadoc)
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPFunctionScope#getBodyScope()
*/
@Override
public IScope getBodyScope() {
IASTFunctionDeclarator fnDtor = (IASTFunctionDeclarator) getPhysicalNode();
IASTNode parent = fnDtor.getParent();

View file

@ -320,7 +320,9 @@ class BaseClassLookup {
return;
fCollected= true;
data.foundItems = CPPSemantics.mergePrefixResults((CharArrayObjectMap) data.foundItems, fBindings, true);
@SuppressWarnings("unchecked")
final CharArrayObjectMap<Object> resultMap = (CharArrayObjectMap<Object>) data.foundItems;
data.foundItems = CPPSemantics.mergePrefixResults(resultMap, fBindings, true);
for (int i= 0; i < fChildren.size(); i++) {
BaseClassLookup child = fChildren.get(i);
child.collectResultForContentAssist(data);

View file

@ -341,7 +341,7 @@ public class LookupData {
if (foundItems instanceof Object[])
return ((Object[]) foundItems).length != 0;
if (foundItems instanceof CharArrayObjectMap)
return ((CharArrayObjectMap) foundItems).size() != 0;
return ((CharArrayObjectMap<?>) foundItems).size() != 0;
return false;
}