@SuppressWarnings("unchecked")
private void findDeclaration(org.eclipse.dltk.core.ISourceModule sm, final String name,
final List results, final Class type) {
try {
sm.accept(new IModelElementVisitor() {
public boolean visit(IModelElement element) {
Class e = element.getClass();
boolean classCheck = type.isAssignableFrom(e);
if (element.getElementName().equals(name) && classCheck) {
results.add(element);