IMethod found= findInHierarchy(method.getDeclaringType().newSupertypeHierarchy(new SubProgressMonitor(pm, 1)), method); return (found != null && (! Flags.isStatic(found.getFlags())) && (! Flags.isPrivate(found.getFlags())));
boolean overrides= (found != null && (! Flags.isStatic(found.getFlags())) && (! Flags.isPrivate(found.getFlags()))); if (overrides) return found; else return null;
	public static boolean overridesAnotherMethod(IMethod method, IProgressMonitor pm) throws JavaModelException {		pm.beginTask("", 1); //$NON-NLS-1$		//XXX: use the commented code once this is fixed: 1GCZZS1: ITPJCORE:WINNT - inconsistent search for method declarations		//XXX: and delete findMethod		//		IType declaringType= getMethod().getDeclaringType();	//		ITypeHierarchy superTypes= declaringType.newSupertypeHierarchy(new SubProgressMonitor(pm, 1));//		pm.worked(1);//		IJavaSearchScope scope= SearchEngine.createHierarchyScope(declaringType);//		ISearchPattern pattern= SearchEngine.createSearchPattern(getMethod(), IJavaSearchConstants.DECLARATIONS);//		SearchResultCollector collector= new SearchResultCollector(new SubProgressMonitor(pm, 1));//		new SearchEngine().search(ResourcesPlugin.getWorkspace(), pattern, scope, collector);//		pm.done();//		for (Iterator iter= collector.getResults().iterator(); iter.hasNext(); ){//			SearchResult result= (SearchResult)iter.next();//			IType t= ((IMethod)result.getEnclosingElement()).getDeclaringType();//			if ((!t.equals(declaringType)) && superTypes.contains(t))//				return true;//		}//		return false;		IMethod found= findInHierarchy(method.getDeclaringType().newSupertypeHierarchy(new SubProgressMonitor(pm, 1)), method);		return (found != null && (! Flags.isStatic(found.getFlags())) && (! Flags.isPrivate(found.getFlags())));		}