Exemplo n.º 1
0
  protected Map getExtImpMap(ASTClassOrInterfaceDeclaration coid, Class extImpClass) {
    Map map = new HashMap();
    SimpleNode list = SimpleNodeUtil.findChild(coid, extImpClass);

    if (list == null) {
      // tr.Ace.log("no list");
    } else {
      ASTClassOrInterfaceType[] types =
          (ASTClassOrInterfaceType[])
              SimpleNodeUtil.findChildren(list, ASTClassOrInterfaceType.class);

      for (int ti = 0; ti < types.length; ++ti) {
        ASTClassOrInterfaceType type = types[ti];
        String typeName = SimpleNodeUtil.toString(type);
        map.put(typeName, type);
      }
    }

    return map;
  }
Exemplo n.º 2
0
  public void compare(ASTClassOrInterfaceDeclaration at, ASTClassOrInterfaceDeclaration bt) {
    // SimpleNodeUtil.dump(at, "a");
    // SimpleNodeUtil.dump(bt, "b");

    if (at.isInterface() == bt.isInterface()) {
      dubaj.tr.Ace.log("no change in types");
    } else if (bt.isInterface()) {
      addChanged(
          TYPE_CHANGED_FROM_CLASS_TO_INTERFACE,
          null,
          at,
          bt,
          Relatorio.TipoDeclaracao.DeclaracaoClasse);
    } else {
      addChanged(
          TYPE_CHANGED_FROM_INTERFACE_TO_CLASS,
          null,
          at,
          bt,
          Relatorio.TipoDeclaracao.DeclaracaoClasse);
    }

    SimpleNode atParent = SimpleNodeUtil.getParent(at);
    SimpleNode btParent = SimpleNodeUtil.getParent(bt);

    if (compararAcessoMetodo(atParent, btParent, Relatorio.TipoDeclaracao.Classe)) {
      Relatorio.getMudancaClasse().incrementarMudancasClasse();
    }

    if (compararModificadorMetodo(
        atParent, btParent, VALID_TYPE_MODIFIERS, Relatorio.TipoDeclaracao.Classe)) {
      Relatorio.getMudancaClasse().incrementarMudancasClasse();
    }

    compareExtends(at, bt);
    compareImplements(at, bt);

    compareDeclarations(at, bt);
  }