1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 18:26:01 +02:00

Improves method names.

This commit is contained in:
Markus Schorn 2008-04-21 08:25:27 +00:00
parent a3f5e0f30b
commit cb728b7643

View file

@ -241,7 +241,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
if (binding == null) if (binding == null)
return null; return null;
final PDOMNode parent= getAdaptedParent(binding, true); final PDOMNode parent= adaptOrAddParent(true, binding);
if (parent == null) if (parent == null)
return null; return null;
@ -601,7 +601,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
*/ */
@Override @Override
public PDOMBinding doAdaptBinding(IBinding binding) throws CoreException { public PDOMBinding doAdaptBinding(IBinding binding) throws CoreException {
PDOMNode parent = getAdaptedParent(binding, false); PDOMNode parent = adaptOrAddParent(false, binding);
if (parent == this) { if (parent == this) {
int localToFileRec= getLocalToFileRec(null, binding); int localToFileRec= getLocalToFileRec(null, binding);
return CPPFindBinding.findBinding(getIndex(), this, binding, localToFileRec); return CPPFindBinding.findBinding(getIndex(), this, binding, localToFileRec);
@ -638,7 +638,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
* </ul> * </ul>
* @throws CoreException * @throws CoreException
*/ */
private final PDOMNode getAdaptedParent(IBinding binding, boolean addParent) throws CoreException { private final PDOMNode adaptOrAddParent(boolean add, IBinding binding) throws CoreException {
try { try {
IBinding scopeBinding = null; IBinding scopeBinding = null;
if (binding instanceof ICPPTemplateInstance) { if (binding instanceof ICPPTemplateInstance) {
@ -653,9 +653,9 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
} }
if (scope == null) { if (scope == null) {
if (binding instanceof ICPPInternalUnknownClassType) { if (binding instanceof ICPPInternalUnknownClassType) {
if (binding instanceof PDOMBinding) if (binding instanceof PDOMBinding) {
return addaptOrAddBinding(addParent, ((PDOMBinding) binding).getParentBinding()); return adaptOrAddBinding(add, ((PDOMBinding) binding).getParentBinding());
}
// what if we have a composite binding?? // what if we have a composite binding??
return null; return null;
} }
@ -675,9 +675,9 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
if (scope instanceof IIndexScope) { if (scope instanceof IIndexScope) {
if (scope instanceof CompositeScope) { // we special case for performance if (scope instanceof CompositeScope) { // we special case for performance
return addaptOrAddBinding(addParent, ((CompositeScope) scope).getRawScopeBinding()); return adaptOrAddBinding(add, ((CompositeScope) scope).getRawScopeBinding());
} }
return addaptOrAddBinding(addParent, ((IIndexScope) scope).getScopeBinding()); return adaptOrAddBinding(add, ((IIndexScope) scope).getScopeBinding());
} }
// the scope is from the ast // the scope is from the ast
@ -718,7 +718,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
} }
} }
if (scopeBinding != null && scopeBinding != binding) { if (scopeBinding != null && scopeBinding != binding) {
return addaptOrAddBinding(addParent, scopeBinding); return adaptOrAddBinding(add, scopeBinding);
} }
} catch (DOMException e) { } catch (DOMException e) {
throw new CoreException(Util.createStatus(e)); throw new CoreException(Util.createStatus(e));
@ -726,10 +726,10 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
return null; return null;
} }
private PDOMBinding addaptOrAddBinding(boolean add, IBinding binding) throws CoreException { private PDOMBinding adaptOrAddBinding(boolean add, IBinding binding) throws CoreException {
if (add) if (add) {
return addBinding(binding, null); return addBinding(binding, null);
}
return adaptBinding(binding); return adaptBinding(binding);
} }