Пример #1
0
  public static boolean areUnRelated(TypeDeclaration typeA, TypeDeclaration typeB) {
    if ((typeA == null) || (typeB == null)) {
      return false;
    }

    // same type
    if (typeA.equals(typeB)) {
      return false;
    }

    // both are defined in same compilation unit
    if (ASTHelper.isInSameCompilationUnit(typeA, typeB)) {
      return false;
    }

    // typeA is child of typeB or vice versa
    if (InheritanceAnalyzer.areRelated(typeA, typeB)) {
      return false;
    }

    return true;
  }