mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-30 20:35: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,
|
||||
* a declaration is returned if <code>allowDeclaration</code> is set, otherwise an
|
||||
* arbitrary binding is returned if available.
|
||||
* @param index
|
||||
* @param binding
|
||||
* @return
|
||||
* @param binding the binding to find a representative for
|
||||
* @param allowDeclaration whether declarations should be considered when a definition is
|
||||
* unavailable
|
||||
* @return the representative binding as defined above
|
||||
*/
|
||||
protected IIndexFragmentBinding findOneBinding(IBinding binding, boolean allowDeclaration) {
|
||||
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.index.ArrayTypeClone;
|
||||
|
||||
public class CompositeArrayType extends CompositeTypeContainer implements IArrayType, ITypeContainer {
|
||||
public class CompositeArrayType extends CompositeTypeContainer implements IArrayType {
|
||||
public CompositeArrayType(IArrayType arrayType, ICompositesFactory 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.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) {
|
||||
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.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 {
|
||||
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.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 {
|
||||
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
|
||||
* process them by run-time type. This method processes a single binding accordingly.
|
||||
* @param binding
|
||||
* @return
|
||||
* @param binding a binding from the fragment layer
|
||||
* @return a suitable binding at the composite layer
|
||||
*/
|
||||
protected final IBinding processUncertainBinding(IBinding binding) {
|
||||
if(binding instanceof IIndexFragmentBinding) {
|
||||
|
@ -100,11 +100,13 @@ public abstract class CompositeScope implements IIndexScope {
|
|||
* @return a non-null IBinding[]
|
||||
*/
|
||||
protected final IBinding[] processUncertainBindings(IBinding[] frgBindings) {
|
||||
IBinding[] result= new IBinding[frgBindings==null ? 0 : frgBindings.length];
|
||||
for(int i=0; i<result.length; i++) {
|
||||
result[i]= processUncertainBinding(frgBindings[i]);
|
||||
if(frgBindings != null) {
|
||||
IBinding[] result= new IBinding[frgBindings.length];
|
||||
for(int i=0; i<result.length; i++) {
|
||||
result[i]= processUncertainBinding(frgBindings[i]);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return IBinding.EMPTY_BINDING_ARRAY;
|
||||
}
|
||||
|
||||
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.CompositeQualifierType;
|
||||
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) {
|
||||
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)
|
||||
*/
|
||||
public IIndexScope getCompositeScope(IIndexScope rscope) {
|
||||
|
@ -66,7 +65,7 @@ public class CCompositesFactory extends AbstractCompositeFactory implements ICom
|
|||
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)
|
||||
*/
|
||||
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)
|
||||
*/
|
||||
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.IEnumerator;
|
||||
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.IIndexType;
|
||||
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) {
|
||||
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.IScope;
|
||||
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.IIndexType;
|
||||
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) {
|
||||
super(cf, rbinding);
|
||||
|
|
|
@ -14,12 +14,10 @@ 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.ICPPSpecialization;
|
||||
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;
|
||||
|
||||
public class CompositeCPPClassSpecialization extends CompositeCPPClassType implements
|
||||
IIndexType, ICPPSpecialization {
|
||||
|
||||
public class CompositeCPPClassSpecialization extends CompositeCPPClassType implements ICPPSpecialization {
|
||||
|
||||
public CompositeCPPClassSpecialization(ICompositesFactory cf, ICPPClassType 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.internal.core.index.composite.ICompositesFactory;
|
||||
|
||||
public class CompositeCPPFunctionSpecialization extends CompositeCPPFunction
|
||||
implements ICPPFunction, ICPPSpecialization {
|
||||
public class CompositeCPPFunctionSpecialization extends CompositeCPPFunction implements ICPPSpecialization {
|
||||
|
||||
public CompositeCPPFunctionSpecialization(ICompositesFactory cf, ICPPFunction 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.ICPPPointerToMemberType;
|
||||
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.ICompositesFactory;
|
||||
|
||||
class CompositeCPPPointerToMemberType extends CompositePointerType implements IIndexType, ICPPPointerToMemberType {
|
||||
class CompositeCPPPointerToMemberType extends CompositePointerType implements ICPPPointerToMemberType {
|
||||
|
||||
CompositeCPPPointerToMemberType(ICompositesFactory cf, ICPPPointerToMemberType pointerToMemberType) throws DOMException {
|
||||
super(pointerToMemberType, cf);
|
||||
}
|
||||
|
||||
public ICPPClassType getMemberOfClass() {
|
||||
IIndexFragmentBinding rbinding = (IIndexFragmentBinding) ((ICPPPointerToMemberType) type).getMemberOfClass();
|
||||
return (ICPPClassType) cf.getCompositeBinding(rbinding);
|
||||
|
|
Loading…
Add table
Reference in a new issue