for (int i= 0; i < elements.length; i++) { if (!(isInferTypeArgumentsAvailable(elements[i]))) return false;
} else if (element instanceof IJavaProject) { IJavaProject project= (IJavaProject) element; IClasspathEntry[] classpathEntries= project.getRawClasspath(); for (int i= 0; i < classpathEntries.length; i++) { if (classpathEntries[i].getEntryKind() == IClasspathEntry.CPE_SOURCE) return true; } return false; } else if (element instanceof IPackageFragmentRoot) { return ((IPackageFragmentRoot) element).getKind() == IPackageFragmentRoot.K_SOURCE; } else if (element instanceof IPackageFragment) { return ((IPackageFragment) element).getKind() == IPackageFragmentRoot.K_SOURCE; } else if (element instanceof ICompilationUnit) { return true; } else if (element.getAncestor(IJavaElement.COMPILATION_UNIT) != null) { return true; } else { return false;
	public static boolean isInferTypeArgumentsAvailable(final IJavaElement[] elements) throws JavaModelException {		if (elements.length == 0)			return false;		for (int i= 0; i < elements.length; i++) {			if (!(isInferTypeArgumentsAvailable(elements[i])))				return false;		}		return true;	}