Program: 65482
Project: 65482
Buggy source:
protected List addExtraNamespacesToNamespaceResolver(XMLDescriptor desc,XMLRecord marshalRecord,AbstractSession session,boolean allowOverride){
  if (((XMLLogin)session.getDatasourceLogin()).hasEqualNamespaceResolvers()) {
    return null;
  }
  NamespaceResolver descriptorNamespaceResolver=desc.getNamespaceResolver();
  if (null == descriptorNamespaceResolver || !descriptorNamespaceResolver.hasPrefixesToNamespaces()) {
    return null;
  }
  Map<String,String> prefixesToNamespaces=descriptorNamespaceResolver.getPrefixesToNamespaces();
  if (prefixesToNamespaces.size() == 0) {
    return null;
  }
  List returnList=new ArrayList(prefixesToNamespaces.size());
  NamespaceResolver marshalRecordNamespaceResolver=marshalRecord.getNamespaceResolver();
  for (  Entry<String,String> entry : prefixesToNamespaces.entrySet()) {
    String prefix=marshalRecordNamespaceResolver.resolveNamespaceURI(entry.getValue());
    if (prefix == null || prefix.length() == 0) {
      prefix=entry.getKey();
      String uri=marshalRecordNamespaceResolver.resolveNamespacePrefix(prefix);
      if (allowOverride || uri == null || uri.length() == 0) {
        marshalRecordNamespaceResolver.put(entry.getKey(),entry.getValue());
        returnList.add(new Namespace(entry.getKey(),entry.getValue()));
      }
    }
 else     if (allowOverride) {
      if (!prefix.equals(entry.getKey())) {
        marshalRecordNamespaceResolver.put(entry.getKey(),entry.getValue());
        returnList.add(new Namespace(entry.getKey(),entry.getValue()));
      }
    }
  }
  return returnList;
}

Fixed version (ground truth):
protected List addExtraNamespacesToNamespaceResolver(XMLDescriptor desc,XMLRecord marshalRecord,AbstractSession session,boolean allowOverride,boolean ignoreEqualResolvers){
  if (((XMLLogin)session.getDatasourceLogin()).hasEqualNamespaceResolvers() && !ignoreEqualResolvers) {
    return null;
  }
  NamespaceResolver descriptorNamespaceResolver=desc.getNamespaceResolver();
  if (null == descriptorNamespaceResolver || !descriptorNamespaceResolver.hasPrefixesToNamespaces()) {
    return null;
  }
  Map<String,String> prefixesToNamespaces=descriptorNamespaceResolver.getPrefixesToNamespaces();
  if (prefixesToNamespaces.size() == 0) {
    return null;
  }
  List returnList=new ArrayList(prefixesToNamespaces.size());
  NamespaceResolver marshalRecordNamespaceResolver=marshalRecord.getNamespaceResolver();
  for (  Entry<String,String> entry : prefixesToNamespaces.entrySet()) {
    String prefix=marshalRecordNamespaceResolver.resolveNamespaceURI(entry.getValue());
    if (prefix == null || prefix.length() == 0) {
      prefix=entry.getKey();
      if (marshalRecord.hasCustomNamespaceMapper()) {
        String newPrefix=marshalRecord.getMarshaller().getNamespacePrefixMapper().getPreferredPrefix(entry.getValue(),prefix,true);
        if (newPrefix != null && !(newPrefix.length() == 0)) {
          prefix=newPrefix;
        }
      }
      String uri=marshalRecordNamespaceResolver.resolveNamespacePrefix(prefix);
      if (marshalRecord.hasCustomNamespaceMapper() || allowOverride || uri == null || uri.length() == 0) {
        marshalRecordNamespaceResolver.put(entry.getKey(),entry.getValue());
        returnList.add(new Namespace(prefix,entry.getValue()));
      }
    }
 else     if (allowOverride) {
      if (!prefix.equals(entry.getKey()) && !(marshalRecord.hasCustomNamespaceMapper())) {
        marshalRecordNamespaceResolver.put(entry.getKey(),entry.getValue());
        returnList.add(new Namespace(entry.getKey(),entry.getValue()));
      }
    }
  }
  return returnList;
}