コード例 #1
0
  @Override
  public boolean isSameType(IType type) {
    if (type instanceof ITypedef) {
      return type.isSameType(this);
    }

    if (type instanceof PDOMNode) {
      PDOMNode node = (PDOMNode) type;
      if (node.getPDOM() == getPDOM()) {
        return node.getRecord() == getRecord();
      }
    }

    if (type instanceof IEnumeration) {
      IEnumeration etype = (IEnumeration) type;
      char[] nchars = etype.getNameCharArray();
      if (nchars.length == 0) {
        nchars = ASTTypeUtil.createNameForAnonymous(etype);
      }
      if (nchars == null || !CharArrayUtils.equals(nchars, getNameCharArray())) return false;

      return SemanticUtil.haveSameOwner(this, etype);
    }
    return false;
  }
コード例 #2
0
  @Override
  public boolean isSameType(IType type) {
    if (type == this) return true;

    if (type instanceof ITypedef) return type.isSameType(this);

    if (type instanceof PDOMNode) {
      PDOMNode node = (PDOMNode) type;
      if (node.getPDOM() == getPDOM()) {
        return node.getRecord() == getRecord();
      }
    }

    // require a class specialization
    if (!(type instanceof ICPPClassSpecialization)) return false;

    return CPPClassSpecialization.isSameClassSpecialization(this, (ICPPClassSpecialization) type);
  }