public List<@NlsSafe String> getTypeLoadingErrors(AntDomTypeDef typedef) {
    final String generalError = myTypeDefErrors.get(typedef);
    if (generalError != null) {
      return Collections.singletonList(generalError);
    }
    List<String> errors = null;
    for (Map.Entry<XmlName, AntDomNamedElement> entry : myDeclarations.entrySet()) {
      if (typedef.equals(entry.getValue())) {
        final String err = lookupError(entry.getKey());
        if (err != null)  {
          if (errors == null) {
            errors = new ArrayList<>();
          }
          errors.add(err);
        }
      }
    }
    return errors == null ? Collections.emptyList() : errors;
  }
public List<@NlsSafe String> getTypeLoadingErrors(AntDomTypeDef typedef)