Program: 145577
Project: 145577
Buggy source:
/** 
 * Gets information about JDBC drivers supported by Platypus Platform.
 * @return Dictionary where the key is database dialect and value is JDBC driver class name
 * @throws Exception if something goes wrong
 */
public static Map<String,String> readDrivers() throws Exception {
  InputStream is=DbConnectionSettings.class.getResourceAsStream(DbConnectionSettings.DB_DRIVERS_FILE_NAME);
  Map<String,String> drivers=new HashMap<>();
  if (is.available() > 0) {
    try {
      String driversDataString=new String(BinaryUtils.readStream(is,-1),SettingsConstants.COMMON_ENCODING);
      Document driversDoc=Source2XmlDom.transform(driversDataString);
      Node jdbcNode=driversDoc.getFirstChild();
      if (jdbcNode != null && "String_Node_Str".equals(jdbcNode.getNodeName())) {
        NodeList driversNodes=jdbcNode.getChildNodes();
        drivers.clear();
        for (int i=0; i < driversNodes.getLength(); i++) {
          Node driverNode=driversNodes.item(i);
          if (driverNode instanceof Element && DB_DRIVER_TAG_NAME.equals(driverNode.getNodeName())) {
            Element element=(Element)driverNode;
            String dialect=element.getAttribute(DB_DRIVER_DIALECT_ATTR_NAME);
            String driverClassName=element.getTextContent();
            if (dialect != null && !dialect.isEmpty() && driverClassName != null && !driverClassName.isEmpty()) {
              drivers.put(dialect,driverClassName.replaceAll("String_Node_Str","String_Node_Str"));
            }
          }
        }
      }
 else {
        throw new Exception("String_Node_Str");
      }
    }
  finally {
      is.close();
    }
  }
 else {
    is.close();
    throw new Exception("String_Node_Str");
  }
  return drivers;
}

Fixed version (ground truth):
/** 
 * Gets information about JDBC drivers supported by Platypus Platform.
 * @return Dictionary where the key is database dialect and value is JDBCdriver class name
 * @throws Exception if something goes wrong
 */
public static Map<String,String> readDrivers() throws Exception {
  Map<String,String> drivers=new HashMap<>();
  try (InputStream is=DbConnectionSettings.class.getResourceAsStream(DbConnectionSettings.DB_DRIVERS_FILE_NAME)){
    if (is.available() > 0) {
      String driversDataString=new String(BinaryUtils.readStream(is,-1),SettingsConstants.COMMON_ENCODING);
      Document driversDoc=Source2XmlDom.transform(driversDataString);
      Node jdbcNode=driversDoc.getFirstChild();
      if (jdbcNode != null && "String_Node_Str".equals(jdbcNode.getNodeName())) {
        NodeList driversNodes=jdbcNode.getChildNodes();
        drivers.clear();
        for (int i=0; i < driversNodes.getLength(); i++) {
          Node driverNode=driversNodes.item(i);
          if (driverNode instanceof Element && DB_DRIVER_TAG_NAME.equals(driverNode.getNodeName())) {
            Element element=(Element)driverNode;
            String dialect=element.getAttribute(DB_DRIVER_DIALECT_ATTR_NAME);
            String driverClassName=element.getTextContent();
            if (dialect != null && !dialect.isEmpty() && driverClassName != null && !driverClassName.isEmpty()) {
              drivers.put(dialect,driverClassName.replaceAll("String_Node_Str","String_Node_Str"));
            }
          }
        }
      }
 else {
        throw new Exception("String_Node_Str");
      }
    }
 else {
      throw new Exception("String_Node_Str");
    }
    return drivers;
  }
 }