private String getVariableSubstitution(IMember context, String variableName) throws JavaModelException { IType type; if (context instanceof IMethod) { String subst= getMethodSubstitions((IMethod) context).getSubstitution(variableName); if (subst != null) { return subst; } type= context.getDeclaringType(); } else { type= (IType) context; } String subst= getTypeSubstitions(type).getSubstitution(variableName); if (subst != null) { return subst; } IJavaElement parent= type.getParent(); if (parent instanceof IMethod) { return getVariableSubstitution((IMethod) parent, variableName); } else if (type.getDeclaringType() != null) { return getVariableSubstitution(type.getDeclaringType(), variableName); } return variableName; // not a type variable }
private String getVariableSubstitution(IMember context, String variableName) throws JavaModelException { IType type; if (context instanceof IMethod) { String subst= getMethodSubstitions((IMethod) context).getSubstitution(variableName); if (subst != null) { return subst; } type= context.getDeclaringType(); } else { type= (IType) context; } String subst= getTypeSubstitions(type).getSubstitution(variableName); if (subst != null) { return subst; } IJavaElement parent= type.getParent(); if (parent instanceof IMethod) { return getVariableSubstitution((IMethod) parent, variableName); } else if (type.getDeclaringType() != null) { return getVariableSubstitution(type.getDeclaringType(), variableName); } return variableName; // not a type variable }
private String getVariableSubstitution(IMember context, String variableName) throws JavaModelException { IType type; if (context instanceof IMethod) { String subst= getMethodSubstitions((IMethod) context).getSubstitution(variableName); if (subst != null) { return subst; } type= context.getDeclaringType(); } else { type= (IType) context; } String subst= getTypeSubstitions(type).getSubstitution(variableName); if (subst != null) { return subst; } return variableName; // not a type variable }