code: public void setTypeInternal(final OType iType) {
      getDatabase().checkSecurity(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_UPDATE);
      if (iType == type)
        // NO CHANGES
        return;
  
      boolean ok = false;
      switch (type) {
      case LINKLIST:
        ok = iType == OType.LINKSET;
        break;
  
      case LINKSET:
        ok = iType == OType.LINKLIST;
        break;
      }
  
      if (!ok)
        throw new IllegalArgumentException("Cannot change property type from " + type + " to " + iType);
  
      type = iType;
    }
docs: Change the type. It checks for compatibility between the change of type.
  
  @param iType