mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-08 16:55:38 +02:00
fix warnings
This commit is contained in:
parent
9faad7775e
commit
e40d216b91
12 changed files with 28 additions and 30 deletions
|
@ -77,9 +77,10 @@ public abstract class AbstractCompositeFactory implements ICompositesFactory {
|
||||||
* context) which is equivalent to the specified binding. If no definition is found,
|
* context) which is equivalent to the specified binding. If no definition is found,
|
||||||
* a declaration is returned if <code>allowDeclaration</code> is set, otherwise an
|
* a declaration is returned if <code>allowDeclaration</code> is set, otherwise an
|
||||||
* arbitrary binding is returned if available.
|
* arbitrary binding is returned if available.
|
||||||
* @param index
|
* @param binding the binding to find a representative for
|
||||||
* @param binding
|
* @param allowDeclaration whether declarations should be considered when a definition is
|
||||||
* @return
|
* unavailable
|
||||||
|
* @return the representative binding as defined above
|
||||||
*/
|
*/
|
||||||
protected IIndexFragmentBinding findOneBinding(IBinding binding, boolean allowDeclaration) {
|
protected IIndexFragmentBinding findOneBinding(IBinding binding, boolean allowDeclaration) {
|
||||||
try{
|
try{
|
||||||
|
|
|
@ -16,7 +16,7 @@ import org.eclipse.cdt.core.dom.ast.IArrayType;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer;
|
import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer;
|
||||||
import org.eclipse.cdt.internal.core.index.ArrayTypeClone;
|
import org.eclipse.cdt.internal.core.index.ArrayTypeClone;
|
||||||
|
|
||||||
public class CompositeArrayType extends CompositeTypeContainer implements IArrayType, ITypeContainer {
|
public class CompositeArrayType extends CompositeTypeContainer implements IArrayType {
|
||||||
public CompositeArrayType(IArrayType arrayType, ICompositesFactory cf) {
|
public CompositeArrayType(IArrayType arrayType, ICompositesFactory cf) {
|
||||||
super((ITypeContainer) arrayType, cf);
|
super((ITypeContainer) arrayType, cf);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ import org.eclipse.cdt.core.dom.ast.IFunctionType;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexType;
|
import org.eclipse.cdt.internal.core.index.IIndexType;
|
||||||
|
|
||||||
public class CompositeFunctionType extends CompositeType implements IFunctionType, IIndexType {
|
public class CompositeFunctionType extends CompositeType implements IFunctionType {
|
||||||
|
|
||||||
public CompositeFunctionType(IFunctionType rtype, ICompositesFactory cf) {
|
public CompositeFunctionType(IFunctionType rtype, ICompositesFactory cf) {
|
||||||
super(rtype, cf);
|
super(rtype, cf);
|
||||||
|
|
|
@ -16,7 +16,7 @@ import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer;
|
import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer;
|
||||||
import org.eclipse.cdt.internal.core.index.PointerTypeClone;
|
import org.eclipse.cdt.internal.core.index.PointerTypeClone;
|
||||||
|
|
||||||
public class CompositePointerType extends CompositeTypeContainer implements IPointerType, ITypeContainer {
|
public class CompositePointerType extends CompositeTypeContainer implements IPointerType {
|
||||||
public CompositePointerType(IPointerType pointerType, ICompositesFactory cf) throws DOMException {
|
public CompositePointerType(IPointerType pointerType, ICompositesFactory cf) throws DOMException {
|
||||||
super((ITypeContainer) pointerType, cf);
|
super((ITypeContainer) pointerType, cf);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer;
|
import org.eclipse.cdt.internal.core.dom.parser.ITypeContainer;
|
||||||
import org.eclipse.cdt.internal.core.index.QualifierTypeClone;
|
import org.eclipse.cdt.internal.core.index.QualifierTypeClone;
|
||||||
|
|
||||||
public class CompositeQualifierType extends CompositeTypeContainer implements IQualifierType, ITypeContainer {
|
public class CompositeQualifierType extends CompositeTypeContainer implements IQualifierType {
|
||||||
public CompositeQualifierType(IQualifierType qualifierType, ICompositesFactory cf) throws DOMException {
|
public CompositeQualifierType(IQualifierType qualifierType, ICompositesFactory cf) throws DOMException {
|
||||||
super((ITypeContainer) qualifierType, cf);
|
super((ITypeContainer) qualifierType, cf);
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,8 +70,8 @@ public abstract class CompositeScope implements IIndexScope {
|
||||||
/**
|
/**
|
||||||
* For bindings that are not known statically to be index bindings, we must decide how to
|
* For bindings that are not known statically to be index bindings, we must decide how to
|
||||||
* process them by run-time type. This method processes a single binding accordingly.
|
* process them by run-time type. This method processes a single binding accordingly.
|
||||||
* @param binding
|
* @param binding a binding from the fragment layer
|
||||||
* @return
|
* @return a suitable binding at the composite layer
|
||||||
*/
|
*/
|
||||||
protected final IBinding processUncertainBinding(IBinding binding) {
|
protected final IBinding processUncertainBinding(IBinding binding) {
|
||||||
if(binding instanceof IIndexFragmentBinding) {
|
if(binding instanceof IIndexFragmentBinding) {
|
||||||
|
@ -100,11 +100,13 @@ public abstract class CompositeScope implements IIndexScope {
|
||||||
* @return a non-null IBinding[]
|
* @return a non-null IBinding[]
|
||||||
*/
|
*/
|
||||||
protected final IBinding[] processUncertainBindings(IBinding[] frgBindings) {
|
protected final IBinding[] processUncertainBindings(IBinding[] frgBindings) {
|
||||||
IBinding[] result= new IBinding[frgBindings==null ? 0 : frgBindings.length];
|
if(frgBindings != null) {
|
||||||
|
IBinding[] result= new IBinding[frgBindings.length];
|
||||||
for(int i=0; i<result.length; i++) {
|
for(int i=0; i<result.length; i++) {
|
||||||
result[i]= processUncertainBinding(frgBindings[i]);
|
result[i]= processUncertainBinding(frgBindings[i]);
|
||||||
}
|
}
|
||||||
return result;
|
}
|
||||||
|
return IBinding.EMPTY_BINDING_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final IBinding getBinding(IASTName name, boolean resolve) throws DOMException {
|
public final IBinding getBinding(IASTName name, boolean resolve) throws DOMException {
|
||||||
|
|
|
@ -40,15 +40,14 @@ import org.eclipse.cdt.internal.core.index.composite.CompositeMacroContainer;
|
||||||
import org.eclipse.cdt.internal.core.index.composite.CompositePointerType;
|
import org.eclipse.cdt.internal.core.index.composite.CompositePointerType;
|
||||||
import org.eclipse.cdt.internal.core.index.composite.CompositeQualifierType;
|
import org.eclipse.cdt.internal.core.index.composite.CompositeQualifierType;
|
||||||
import org.eclipse.cdt.internal.core.index.composite.CompositingNotImplementedError;
|
import org.eclipse.cdt.internal.core.index.composite.CompositingNotImplementedError;
|
||||||
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
|
||||||
|
|
||||||
public class CCompositesFactory extends AbstractCompositeFactory implements ICompositesFactory {
|
public class CCompositesFactory extends AbstractCompositeFactory {
|
||||||
|
|
||||||
public CCompositesFactory(IIndex index) {
|
public CCompositesFactory(IIndex index) {
|
||||||
super(index);
|
super(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
* @see org.eclipse.cdt.internal.core.index.composite.cpp.ICompositesFactory#getCompositeScope(org.eclipse.cdt.core.index.IIndex, org.eclipse.cdt.core.dom.ast.IScope)
|
* @see org.eclipse.cdt.internal.core.index.composite.cpp.ICompositesFactory#getCompositeScope(org.eclipse.cdt.core.index.IIndex, org.eclipse.cdt.core.dom.ast.IScope)
|
||||||
*/
|
*/
|
||||||
public IIndexScope getCompositeScope(IIndexScope rscope) {
|
public IIndexScope getCompositeScope(IIndexScope rscope) {
|
||||||
|
@ -66,7 +65,7 @@ public class CCompositesFactory extends AbstractCompositeFactory implements ICom
|
||||||
throw new CompositingNotImplementedError();
|
throw new CompositingNotImplementedError();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
* @see org.eclipse.cdt.internal.core.index.composite.cpp.ICompositesFactory#getCompositeType(org.eclipse.cdt.core.index.IIndex, org.eclipse.cdt.core.dom.ast.IType)
|
* @see org.eclipse.cdt.internal.core.index.composite.cpp.ICompositesFactory#getCompositeType(org.eclipse.cdt.core.index.IIndex, org.eclipse.cdt.core.dom.ast.IType)
|
||||||
*/
|
*/
|
||||||
public IType getCompositeType(IIndexType rtype) throws DOMException {
|
public IType getCompositeType(IIndexType rtype) throws DOMException {
|
||||||
|
@ -98,7 +97,7 @@ public class CCompositesFactory extends AbstractCompositeFactory implements ICom
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
* @see org.eclipse.cdt.internal.core.index.composite.cpp.ICompositesFactory#getCompositeBinding(org.eclipse.cdt.core.index.IIndex, org.eclipse.cdt.core.dom.ast.IBinding)
|
* @see org.eclipse.cdt.internal.core.index.composite.cpp.ICompositesFactory#getCompositeBinding(org.eclipse.cdt.core.index.IIndex, org.eclipse.cdt.core.dom.ast.IBinding)
|
||||||
*/
|
*/
|
||||||
public IIndexBinding getCompositeBinding(IIndexFragmentBinding rbinding) {
|
public IIndexBinding getCompositeBinding(IIndexFragmentBinding rbinding) {
|
||||||
|
|
|
@ -14,12 +14,11 @@ import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||||
import org.eclipse.cdt.core.dom.ast.IEnumeration;
|
import org.eclipse.cdt.core.dom.ast.IEnumeration;
|
||||||
import org.eclipse.cdt.core.dom.ast.IEnumerator;
|
import org.eclipse.cdt.core.dom.ast.IEnumerator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.index.IIndexBinding;
|
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexType;
|
import org.eclipse.cdt.internal.core.index.IIndexType;
|
||||||
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
||||||
|
|
||||||
class CompositeCEnumeration extends CompositeCBinding implements IIndexBinding, IEnumeration, IIndexType {
|
class CompositeCEnumeration extends CompositeCBinding implements IEnumeration, IIndexType {
|
||||||
public CompositeCEnumeration(ICompositesFactory cf, IIndexFragmentBinding rbinding) {
|
public CompositeCEnumeration(ICompositesFactory cf, IIndexFragmentBinding rbinding) {
|
||||||
super(cf, rbinding);
|
super(cf, rbinding);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,12 +15,11 @@ import org.eclipse.cdt.core.dom.ast.ICompositeType;
|
||||||
import org.eclipse.cdt.core.dom.ast.IField;
|
import org.eclipse.cdt.core.dom.ast.IField;
|
||||||
import org.eclipse.cdt.core.dom.ast.IScope;
|
import org.eclipse.cdt.core.dom.ast.IScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.index.IIndexBinding;
|
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexType;
|
import org.eclipse.cdt.internal.core.index.IIndexType;
|
||||||
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
||||||
|
|
||||||
class CompositeCStructure extends CompositeCBinding implements IIndexBinding, ICompositeType, IIndexType {
|
class CompositeCStructure extends CompositeCBinding implements ICompositeType, IIndexType {
|
||||||
|
|
||||||
public CompositeCStructure(ICompositesFactory cf, IIndexFragmentBinding rbinding) {
|
public CompositeCStructure(ICompositesFactory cf, IIndexFragmentBinding rbinding) {
|
||||||
super(cf, rbinding);
|
super(cf, rbinding);
|
||||||
|
|
|
@ -14,11 +14,9 @@ import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
||||||
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexType;
|
|
||||||
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
||||||
|
|
||||||
public class CompositeCPPClassSpecialization extends CompositeCPPClassType implements
|
public class CompositeCPPClassSpecialization extends CompositeCPPClassType implements ICPPSpecialization {
|
||||||
IIndexType, ICPPSpecialization {
|
|
||||||
|
|
||||||
public CompositeCPPClassSpecialization(ICompositesFactory cf, ICPPClassType rbinding) {
|
public CompositeCPPClassSpecialization(ICompositesFactory cf, ICPPClassType rbinding) {
|
||||||
super(cf, rbinding);
|
super(cf, rbinding);
|
||||||
|
|
|
@ -18,8 +18,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
||||||
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
||||||
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
||||||
|
|
||||||
public class CompositeCPPFunctionSpecialization extends CompositeCPPFunction
|
public class CompositeCPPFunctionSpecialization extends CompositeCPPFunction implements ICPPSpecialization {
|
||||||
implements ICPPFunction, ICPPSpecialization {
|
|
||||||
|
|
||||||
public CompositeCPPFunctionSpecialization(ICompositesFactory cf, ICPPFunction ft) {
|
public CompositeCPPFunctionSpecialization(ICompositesFactory cf, ICPPFunction ft) {
|
||||||
super(cf, ft);
|
super(cf, ft);
|
||||||
|
|
|
@ -14,14 +14,15 @@ import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPPointerToMemberType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPPointerToMemberType;
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
|
||||||
import org.eclipse.cdt.internal.core.index.IIndexType;
|
|
||||||
import org.eclipse.cdt.internal.core.index.composite.CompositePointerType;
|
import org.eclipse.cdt.internal.core.index.composite.CompositePointerType;
|
||||||
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
import org.eclipse.cdt.internal.core.index.composite.ICompositesFactory;
|
||||||
|
|
||||||
class CompositeCPPPointerToMemberType extends CompositePointerType implements IIndexType, ICPPPointerToMemberType {
|
class CompositeCPPPointerToMemberType extends CompositePointerType implements ICPPPointerToMemberType {
|
||||||
|
|
||||||
CompositeCPPPointerToMemberType(ICompositesFactory cf, ICPPPointerToMemberType pointerToMemberType) throws DOMException {
|
CompositeCPPPointerToMemberType(ICompositesFactory cf, ICPPPointerToMemberType pointerToMemberType) throws DOMException {
|
||||||
super(pointerToMemberType, cf);
|
super(pointerToMemberType, cf);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICPPClassType getMemberOfClass() {
|
public ICPPClassType getMemberOfClass() {
|
||||||
IIndexFragmentBinding rbinding = (IIndexFragmentBinding) ((ICPPPointerToMemberType) type).getMemberOfClass();
|
IIndexFragmentBinding rbinding = (IIndexFragmentBinding) ((ICPPPointerToMemberType) type).getMemberOfClass();
|
||||||
return (ICPPClassType) cf.getCompositeBinding(rbinding);
|
return (ICPPClassType) cf.getCompositeBinding(rbinding);
|
||||||
|
|
Loading…
Add table
Reference in a new issue