private void addDependency(PsiType type) {
    if (type == null) {
      return;
    }
    final PsiType baseType = type.getDeepComponentType();

    if (ClassUtils.isPrimitive(type)) {
      return;
    }
    final String qualifiedName = m_class.getQualifiedName();
    if (qualifiedName == null) {
      return;
    }
    if (baseType.equalsToText(qualifiedName)) {
      return;
    }
    final String baseTypeName = baseType.getCanonicalText();
    @NonNls final String javaPrefix = "java.";
    @NonNls final String javaxPrefix = "javax.";
    if (!m_includeJavaClasses &&
        (baseTypeName.startsWith(javaPrefix) ||
         baseTypeName.startsWith(javaxPrefix))) {
      return;
    }
    if (!m_includeLibraryClasses) {
      final Project project = m_class.getProject();
      final GlobalSearchScope searchScope = GlobalSearchScope.allScope(project);
      final PsiClass aClass = JavaPsiFacade.getInstance(project).findClass(baseTypeName, searchScope);
      if (aClass == null) {
        return;
      }
      if (LibraryUtil.classIsInLibrary(aClass)) {
        return;
      }
    }
    if (StringUtil.startsWithConcatenation(baseTypeName, qualifiedName, ".")) {
      return;
    }
    m_dependencies.add(baseTypeName);
  }
private void addDependency(PsiType type)