Program: 176589
Project: 176589
Buggy source:
/** 
 * Find persistence meta data. Loads configured persistence.xml and load all provided configurations within persistence meta data as per @see JPA 2.0 specifications.
 * @return the list configure persistence unit meta data.
 */
private Map<String,PersistenceUnitMetadata> findPersistenceMetadatas() throws InvalidConfigurationException {
  Enumeration<URL> xmls=null;
  try {
    xmls=Thread.currentThread().getContextClassLoader().getResources("String_Node_Str");
  }
 catch (  IOException ioex) {
    log.warn("String_Node_Str" + ioex.getMessage());
  }
  if (xmls == null || !xmls.hasMoreElements()) {
    log.info("String_Node_Str" + "String_Node_Str");
    throw new InvalidConfigurationException("String_Node_Str" + "String_Node_Str");
  }
  Set<String> persistenceUnitNames=new HashSet<String>();
  Map<String,PersistenceUnitMetadata> persistenceUnitMap=new HashMap<String,PersistenceUnitMetadata>();
  while (xmls.hasMoreElements()) {
    URL url=xmls.nextElement();
    log.trace("String_Node_Str" + url);
    List<PersistenceUnitMetadata> metadataFiles=PersistenceXMLLoader.findPersistenceUnits(url,PersistenceUnitTransactionType.RESOURCE_LOCAL);
    for (    PersistenceUnitMetadata metadata : metadataFiles) {
      if (persistenceUnitNames.contains(metadata.getPersistenceUnitName())) {
        throw new InvalidConfigurationException("String_Node_Str" + metadata.getPersistenceUnitName() + "String_Node_Str");
      }
      if (metadata.getPersistenceProviderClassName() == null || PROVIDER_IMPLEMENTATION_NAME.equalsIgnoreCase(metadata.getPersistenceProviderClassName())) {
        persistenceUnitMap.put(metadata.getPersistenceUnitName(),metadata);
      }
      persistenceUnitNames.add(metadata.getPersistenceUnitName());
    }
  }
  return persistenceUnitMap;
}

Fixed version (ground truth):
/** 
 * Find persistence meta data. Loads configured persistence.xml and load all provided configurations within persistence meta data as per @see JPA 2.0 specifications.
 * @return the list configure persistence unit meta data.
 */
private Map<String,PersistenceUnitMetadata> findPersistenceMetadatas() throws InvalidConfigurationException {
  Enumeration<URL> xmls=null;
  try {
    xmls=Thread.currentThread().getContextClassLoader().getResources("String_Node_Str");
  }
 catch (  IOException ioex) {
    log.warn("String_Node_Str" + ioex.getMessage());
  }
  if (xmls == null || !xmls.hasMoreElements()) {
    log.info("String_Node_Str" + "String_Node_Str");
    throw new InvalidConfigurationException("String_Node_Str" + "String_Node_Str");
  }
  Set<String> persistenceUnitNames=new HashSet<String>();
  Map<String,PersistenceUnitMetadata> persistenceUnitMap=new HashMap<String,PersistenceUnitMetadata>();
  while (xmls.hasMoreElements()) {
    URL url=xmls.nextElement();
    log.trace("String_Node_Str" + url);
    List<PersistenceUnitMetadata> metadataFiles=PersistenceXMLLoader.findPersistenceUnits(url,PersistenceUnitTransactionType.RESOURCE_LOCAL);
    for (    PersistenceUnitMetadata metadata : metadataFiles) {
      if (persistenceUnitNames.contains(metadata.getPersistenceUnitName())) {
        if (log.isWarnEnabled()) {
          log.warn("String_Node_Str" + metadata.getPersistenceUnitName() + "String_Node_Str");
        }
      }
      if (metadata.getPersistenceProviderClassName() == null || PROVIDER_IMPLEMENTATION_NAME.equalsIgnoreCase(metadata.getPersistenceProviderClassName())) {
        persistenceUnitMap.put(metadata.getPersistenceUnitName(),metadata);
      }
      persistenceUnitNames.add(metadata.getPersistenceUnitName());
    }
  }
  return persistenceUnitMap;
}