nus-yam/ex-repair huggingface dataset:
Program: 11175
Project: 11175
Buggy source:
/** 
 * Generate the Lucene options schema that corresponds with the selected column.
 * @return The JSON representation of the Lucene schema.
 */
protected String generateLuceneSchema(){
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  for (  Map.Entry<ColumnName,ColumnMetadata> entry : targetColumns.entrySet()) {
    sb.append(Utils.toCaseSensitive(entry.getValue().getName().getName()));
    sb.append("String_Node_Str");
    sb.append(luceneTypes.get(entry.getValue().getColumnType().getDataType()));
    sb.append("String_Node_Str");
  }
  sb.append("String_Node_Str");
  return sb.toString().replace("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Generate the Lucene options schema that corresponds with the selected column.
 * @return The JSON representation of the Lucene schema.
 */
protected String generateLuceneSchema(){
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append("String_Node_Str");
  for (  Map.Entry<ColumnName,ColumnMetadata> entry : targetColumns.entrySet()) {
    sb.append(Utils.toCaseSensitive(entry.getValue().getName().getName()));
    sb.append("String_Node_Str");
    if (entry.getValue().getColumnType().getDataType() == com.stratio.crossdata.common.metadata.DataType.NATIVE) {
      if (entry.getValue().getColumnType().getDbType().equals("String_Node_Str")) {
        sb.append("String_Node_Str");
      }
 else {
        sb.append("String_Node_Str").append(entry.getValue().getColumnType().getDbType()).append("String_Node_Str");
      }
    }
 else {
      sb.append(luceneTypes.get(entry.getValue().getColumnType().getDataType()));
    }
    sb.append("String_Node_Str");
  }
  sb.append("String_Node_Str");
  return sb.toString().replace("String_Node_Str","String_Node_Str");
}
Program: 11179
Project: 11179
Buggy source:
/** 
 * Initialize the connection to the underlying database.
 * @param config The {@link com.stratio.connector.cassandra.engine.EngineConfig}.
 * @return A new Session.
 */
private Session initializeDB(EngineConfig config) throws ConnectionException {
  Cluster cluster=Cluster.builder().addContactPoints(config.getCassandraHosts()).withPort(config.getCassandraPort()).build();
  LOG.info("String_Node_Str" + Arrays.toString(config.getCassandraHosts()) + "String_Node_Str"+ config.getCassandraPort());
  Session result;
  try {
    result=cluster.connect();
  }
 catch (  NoHostAvailableException nhae) {
    throw new ConnectionException(nhae);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Initialize the connection to the underlying database.
 * @param config The {@link com.stratio.connector.cassandra.engine.EngineConfig}.
 * @return A new Session.
 */
private Session initializeDB(EngineConfig config) throws ConnectionException {
  Cluster cluster=Cluster.builder().addContactPoints(config.getCassandraHosts()).withPort(config.getCassandraPort()).build();
  LOG.info("String_Node_Str" + Arrays.toString(config.getCassandraHosts()) + "String_Node_Str"+ config.getCassandraPort());
  Session result;
  try {
    result=cluster.connect();
  }
 catch (  NoHostAvailableException nhae) {
    throw new ConnectionException(nhae.getMessage(),nhae.getCause());
  }
  return result;
}
Program: 11180
Project: 11180
Buggy source:
/** 
 * Constructor.
 */
public CassandraConnector(){
  sessions=new HashMap<>();
  try {
    InputStream inputStream=getClass().getResourceAsStream("String_Node_Str");
    Document d=DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(inputStream);
    XPathFactory xFactory=XPathFactory.newInstance();
    XPath xpath=xFactory.newXPath();
    Object result;
    XPathExpression expr;
    try {
      expr=xpath.compile("String_Node_Str");
      result=expr.evaluate(d,XPathConstants.NODESET);
      this.connectorName=((NodeList)result).item(0).getNodeValue();
    }
 catch (    XPathExpressionException e) {
      this.connectorName="String_Node_Str";
    }
    try {
      expr=xpath.compile("String_Node_Str");
      result=expr.evaluate(d,XPathConstants.NODESET);
      datastoreName=new String[((NodeList)result).getLength()];
      for (int i=0; i < ((NodeList)result).getLength(); i++) {
        this.datastoreName[i]=((NodeList)result).item(i).getNodeValue();
      }
    }
 catch (    XPathExpressionException e) {
      datastoreName=new String[1];
      this.datastoreName[0]="String_Node_Str";
    }
  }
 catch (  SAXException e) {
    LOG.trace("String_Node_Str");
  }
catch (  IOException e) {
    LOG.trace("String_Node_Str");
  }
catch (  ParserConfigurationException e) {
    LOG.trace("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Constructor.
 */
public CassandraConnector(){
  sessions=new HashMap<>();
  XPathFactory xFactory=null;
  Document d=null;
  try {
    InputStream inputStream=getClass().getResourceAsStream("String_Node_Str");
    d=DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(inputStream);
    xFactory=XPathFactory.newInstance();
  }
 catch (  SAXException e) {
    LOG.trace("String_Node_Str");
  }
catch (  IOException e) {
    LOG.trace("String_Node_Str");
  }
catch (  ParserConfigurationException e) {
    LOG.trace("String_Node_Str");
  }
  XPath xpath=xFactory.newXPath();
  Object result;
  XPathExpression expr;
  try {
    expr=xpath.compile("String_Node_Str");
    result=expr.evaluate(d,XPathConstants.NODESET);
    this.connectorName=((NodeList)result).item(0).getNodeValue();
  }
 catch (  XPathExpressionException e) {
    this.connectorName="String_Node_Str";
  }
  try {
    expr=xpath.compile("String_Node_Str");
    result=expr.evaluate(d,XPathConstants.NODESET);
    datastoreName=new String[((NodeList)result).getLength()];
    for (int i=0; i < ((NodeList)result).getLength(); i++) {
      this.datastoreName[i]=((NodeList)result).item(i).getNodeValue();
    }
  }
 catch (  XPathExpressionException e) {
    datastoreName=new String[1];
    this.datastoreName[0]="String_Node_Str";
  }
}
Program: 11181
Project: 11181
Buggy source:
/** 
 * Connect Method: Enabled the connector with his own configuration.
 * @param credentials The credentials.
 * @param config The cluster config
 * @throws ConnectionException
 */
@Override public void connect(ICredentials credentials,ConnectorClusterConfig config) throws ConnectionException {
  ClusterName clusterName=config.getName();
  Map<String,String> clusterOptions=config.getClusterOptions();
  Map<String,String> connectorOptions=config.getConnectorOptions();
  EngineConfig engineConfig=new EngineConfig();
  engineConfig.setCassandraHosts(clusterOptions.get("String_Node_Str").substring(1,clusterOptions.get("String_Node_Str").length() - 1).split("String_Node_Str"));
  engineConfig.setCassandraPort(Integer.parseInt(clusterOptions.get("String_Node_Str")));
  engineConfig.setCredentials(credentials);
  if (connectorOptions.get("String_Node_Str") == null) {
    defaultLimit=DEFAULT_LIMIT;
  }
 else {
    defaultLimit=Integer.parseInt(connectorOptions.get("String_Node_Str"));
  }
  Engine engine=new Engine(engineConfig);
  LOG.info("String_Node_Str");
  sessions.put(clusterName.getName(),engine.getSession());
}

Fixed version (ground truth):
/** 
 * Connect Method: Enabled the connector with his own configuration.
 * @param credentials The credentials.
 * @param config      The cluster config
 * @throws ConnectionException
 */
@Override public void connect(ICredentials credentials,ConnectorClusterConfig config) throws ConnectionException {
  ClusterName clusterName=config.getName();
  Map<String,String> clusterOptions=config.getClusterOptions();
  Map<String,String> connectorOptions=config.getConnectorOptions();
  EngineConfig engineConfig=new EngineConfig();
  engineConfig.setCassandraHosts(clusterOptions.get("String_Node_Str").substring(1,clusterOptions.get("String_Node_Str").length() - 1).split("String_Node_Str"));
  engineConfig.setCassandraPort(Integer.parseInt(clusterOptions.get("String_Node_Str")));
  engineConfig.setCredentials(credentials);
  if (connectorOptions.get("String_Node_Str") == null) {
    defaultLimit=DEFAULT_LIMIT;
  }
 else {
    defaultLimit=Integer.parseInt(connectorOptions.get("String_Node_Str"));
  }
  Engine engine=new Engine(engineConfig);
  LOG.info("String_Node_Str");
  sessions.put(clusterName.getName(),engine.getSession());
}
Program: 11182
Project: 11182
Buggy source:
/** 
 * Executes a query from a String and add the alias in the Result for Selects .
 * @param query        The query in a String.
 * @param aliasColumns The Map with the alias
 * @param session      Cassandra datastax java driver session.
 * @return a {@link com.stratio.crossdata.common.result.Result}.
 */
public static com.stratio.crossdata.common.result.Result execute(String query,Map<Selector,String> aliasColumns,Session session) throws ConnectorException {
  try {
    ResultSet resultSet=session.execute(query);
    return com.stratio.crossdata.common.result.QueryResult.createQueryResult(utils.transformToMetaResultSet(resultSet,aliasColumns));
  }
 catch (  UnsupportedOperationException unSupportException) {
    throw new UnsupportedException(unSupportException);
  }
catch (  DriverException dex) {
    throw new CriticalExecutionException(dex);
  }
catch (  Exception ex) {
    throw new ExecutionException(ex);
  }
}

Fixed version (ground truth):
/** 
 * Executes a query from a String and add the alias in the Result for Selects .
 * @param query        The query in a String.
 * @param aliasColumns The Map with the alias
 * @param session      Cassandra datastax java driver session.
 * @return a {@link com.stratio.crossdata.common.result.Result}.
 */
public static com.stratio.crossdata.common.result.Result execute(String query,Map<Selector,String> aliasColumns,Session session) throws ConnectorException {
  try {
    ResultSet resultSet=session.execute(query);
    return com.stratio.crossdata.common.result.QueryResult.createQueryResult(utils.transformToMetaResultSet(resultSet,aliasColumns));
  }
 catch (  UnsupportedOperationException unSupportException) {
    throw new UnsupportedException(unSupportException.getMessage());
  }
catch (  DriverException dex) {
    throw new CriticalExecutionException(dex.getMessage());
  }
catch (  Exception ex) {
    throw new ExecutionException(ex.getMessage());
  }
}
Program: 11183
Project: 11183
Buggy source:
/** 
 * Constructor.
 */
public CassandraConnector(){
  sessions=new HashMap<>();
  try {
    InputStream inputStream=getClass().getResourceAsStream("String_Node_Str");
    Document d=DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(inputStream);
    XPathFactory xFactory=XPathFactory.newInstance();
    XPath xpath=xFactory.newXPath();
    Object result;
    XPathExpression expr;
    try {
      expr=xpath.compile("String_Node_Str");
      result=expr.evaluate(d,XPathConstants.NODESET);
      this.connectorName=((NodeList)result).item(0).getNodeValue();
    }
 catch (    XPathExpressionException e) {
      this.connectorName="String_Node_Str";
    }
    try {
      expr=xpath.compile("String_Node_Str");
      result=expr.evaluate(d,XPathConstants.NODESET);
      datastoreName=new String[((NodeList)result).getLength()];
      for (int i=0; i < ((NodeList)result).getLength(); i++) {
        this.datastoreName[i]=((NodeList)result).item(i).getNodeValue();
      }
    }
 catch (    XPathExpressionException e) {
      datastoreName=new String[1];
      this.datastoreName[0]="String_Node_Str";
    }
  }
 catch (  SAXException e) {
    LOG.trace("String_Node_Str");
  }
catch (  IOException e) {
    LOG.trace("String_Node_Str");
  }
catch (  ParserConfigurationException e) {
    LOG.trace("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Constructor.
 */
public CassandraConnector(){
  sessions=new HashMap<>();
  XPathFactory xFactory=null;
  Document d=null;
  try {
    InputStream inputStream=getClass().getResourceAsStream("String_Node_Str");
    d=DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(inputStream);
    xFactory=XPathFactory.newInstance();
  }
 catch (  SAXException e) {
    LOG.trace("String_Node_Str");
  }
catch (  IOException e) {
    LOG.trace("String_Node_Str");
  }
catch (  ParserConfigurationException e) {
    LOG.trace("String_Node_Str");
  }
  XPath xpath=xFactory.newXPath();
  Object result;
  XPathExpression expr;
  try {
    expr=xpath.compile("String_Node_Str");
    result=expr.evaluate(d,XPathConstants.NODESET);
    this.connectorName=((NodeList)result).item(0).getNodeValue();
  }
 catch (  XPathExpressionException e) {
    this.connectorName="String_Node_Str";
  }
  try {
    expr=xpath.compile("String_Node_Str");
    result=expr.evaluate(d,XPathConstants.NODESET);
    datastoreName=new String[((NodeList)result).getLength()];
    for (int i=0; i < ((NodeList)result).getLength(); i++) {
      this.datastoreName[i]=((NodeList)result).item(i).getNodeValue();
    }
  }
 catch (  XPathExpressionException e) {
    datastoreName=new String[1];
    this.datastoreName[0]="String_Node_Str";
  }
}
Program: 11184
Project: 11184
Buggy source:
/** 
 * Connect Method: Enabled the connector with his own configuration.
 * @param credentials The credentials.
 * @param config The cluster config
 * @throws ConnectionException
 */
@Override public void connect(ICredentials credentials,ConnectorClusterConfig config) throws ConnectionException {
  ClusterName clusterName=config.getName();
  Map<String,String> clusterOptions=config.getClusterOptions();
  Map<String,String> connectorOptions=config.getConnectorOptions();
  EngineConfig engineConfig=new EngineConfig();
  engineConfig.setCassandraHosts(clusterOptions.get("String_Node_Str").substring(1,clusterOptions.get("String_Node_Str").length() - 1).split("String_Node_Str"));
  engineConfig.setCassandraPort(Integer.parseInt(clusterOptions.get("String_Node_Str")));
  engineConfig.setCredentials(credentials);
  if (connectorOptions.get("String_Node_Str") == null) {
    defaultLimit=DEFAULT_LIMIT;
  }
 else {
    defaultLimit=Integer.parseInt(connectorOptions.get("String_Node_Str"));
  }
  Engine engine=new Engine(engineConfig);
  LOG.info("String_Node_Str");
  sessions.put(clusterName.getName(),engine.getSession());
}

Fixed version (ground truth):
/** 
 * Connect Method: Enabled the connector with his own configuration.
 * @param credentials The credentials.
 * @param config      The cluster config
 * @throws ConnectionException
 */
@Override public void connect(ICredentials credentials,ConnectorClusterConfig config) throws ConnectionException {
  ClusterName clusterName=config.getName();
  Map<String,String> clusterOptions=config.getClusterOptions();
  Map<String,String> connectorOptions=config.getConnectorOptions();
  EngineConfig engineConfig=new EngineConfig();
  engineConfig.setCassandraHosts(clusterOptions.get("String_Node_Str").substring(1,clusterOptions.get("String_Node_Str").length() - 1).split("String_Node_Str"));
  engineConfig.setCassandraPort(Integer.parseInt(clusterOptions.get("String_Node_Str")));
  engineConfig.setCredentials(credentials);
  if (connectorOptions.get("String_Node_Str") == null) {
    defaultLimit=DEFAULT_LIMIT;
  }
 else {
    defaultLimit=Integer.parseInt(connectorOptions.get("String_Node_Str"));
  }
  Engine engine=new Engine(engineConfig);
  LOG.info("String_Node_Str");
  sessions.put(clusterName.getName(),engine.getSession());
}
Program: 11185
Project: 11185
Buggy source:
/** 
 * Executes a query from a String and add the alias in the Result for Selects .
 * @param query        The query in a String.
 * @param aliasColumns The Map with the alias
 * @param session      Cassandra datastax java driver session.
 * @return a {@link com.stratio.crossdata.common.result.Result}.
 */
public static com.stratio.crossdata.common.result.Result execute(String query,Map<Selector,String> aliasColumns,Session session) throws ConnectorException {
  try {
    ResultSet resultSet=session.execute(query);
    return com.stratio.crossdata.common.result.QueryResult.createQueryResult(utils.transformToMetaResultSet(resultSet,aliasColumns));
  }
 catch (  UnsupportedOperationException unSupportException) {
    throw new UnsupportedException(unSupportException);
  }
catch (  DriverException dex) {
    throw new CriticalExecutionException(dex);
  }
catch (  Exception ex) {
    throw new ExecutionException(ex);
  }
}

Fixed version (ground truth):
/** 
 * Executes a query from a String and add the alias in the Result for Selects .
 * @param query        The query in a String.
 * @param aliasColumns The Map with the alias
 * @param session      Cassandra datastax java driver session.
 * @return a {@link com.stratio.crossdata.common.result.Result}.
 */
public static com.stratio.crossdata.common.result.Result execute(String query,Map<Selector,String> aliasColumns,Session session) throws ConnectorException {
  try {
    ResultSet resultSet=session.execute(query);
    return com.stratio.crossdata.common.result.QueryResult.createQueryResult(utils.transformToMetaResultSet(resultSet,aliasColumns));
  }
 catch (  UnsupportedOperationException unSupportException) {
    throw new UnsupportedException(unSupportException.getMessage());
  }
catch (  DriverException dex) {
    throw new CriticalExecutionException(dex.getMessage());
  }
catch (  Exception ex) {
    throw new ExecutionException(ex.getMessage());
  }
}
Program: 11186
Project: 11186
Buggy source:
private String getFunctionString(FunctionSelector selectorFunction){
  String result="String_Node_Str";
  StringBuffer sb=new StringBuffer();
switch (selectorFunction.getFunctionName().toUpperCase()) {
case "String_Node_Str":
    result="String_Node_Str";
  break;
case "String_Node_Str":
result="String_Node_Str";
break;
default :
List<Selector> columns=selectorFunction.getFunctionColumns();
sb.append(selectorFunction.getFunctionName()).append("String_Node_Str");
for (Selector s : columns) {
if (s instanceof ColumnSelector) {
ColumnSelector columnSelector=(ColumnSelector)s;
sb.append(columnSelector.getColumnName().getName());
sb.append("String_Node_Str");
}
 else if (s instanceof FunctionSelector) {
FunctionSelector functionSelector=(FunctionSelector)s;
String subFunction=getFunctionString(functionSelector);
sb.append(subFunction);
}
}
if (sb.toString().endsWith("String_Node_Str")) {
sb.deleteCharAt(sb.lastIndexOf("String_Node_Str"));
}
sb.append("String_Node_Str");
result=sb.toString();
}
return result;
}

Fixed version (ground truth):
private String getFunctionString(FunctionSelector selectorFunction){
  String result="String_Node_Str";
  StringBuffer sb=new StringBuffer();
switch (selectorFunction.getFunctionName().toUpperCase()) {
case "String_Node_Str":
    result=selectorFunction.getFunctionName() + "String_Node_Str";
  break;
case "String_Node_Str":
result=selectorFunction.getFunctionName() + "String_Node_Str";
break;
default :
List<Selector> columns=selectorFunction.getFunctionColumns();
sb.append(selectorFunction.getFunctionName()).append("String_Node_Str");
for (Selector s : columns) {
if (s instanceof ColumnSelector) {
ColumnSelector columnSelector=(ColumnSelector)s;
sb.append(columnSelector.getColumnName().getName());
sb.append("String_Node_Str");
}
 else if (s instanceof FunctionSelector) {
FunctionSelector functionSelector=(FunctionSelector)s;
String subFunction=getFunctionString(functionSelector);
sb.append(subFunction);
}
}
if (sb.toString().endsWith("String_Node_Str")) {
sb.deleteCharAt(sb.lastIndexOf("String_Node_Str"));
}
sb.append("String_Node_Str");
result=sb.toString();
}
return result;
}
Program: 11187
Project: 11187
Buggy source:
/** 
 * Constructor.
 */
public CassandraConnector(){
  sessions=new HashMap<>();
  XPathFactory xFactory=null;
  Document d=null;
  try {
    InputStream inputStream=getClass().getResourceAsStream("String_Node_Str");
    d=DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(inputStream);
    xFactory=XPathFactory.newInstance();
  }
 catch (  SAXException e) {
    LOG.trace("String_Node_Str");
  }
catch (  IOException e) {
    LOG.trace("String_Node_Str");
  }
catch (  ParserConfigurationException e) {
    LOG.trace("String_Node_Str");
  }
  XPath xpath=xFactory.newXPath();
  Object result;
  XPathExpression expr;
  try {
    expr=xpath.compile("String_Node_Str");
    result=expr.evaluate(d,XPathConstants.NODESET);
    this.connectorName=((NodeList)result).item(0).getNodeValue();
  }
 catch (  XPathExpressionException e) {
    this.connectorName="String_Node_Str";
  }
  try {
    expr=xpath.compile("String_Node_Str");
    result=expr.evaluate(d,XPathConstants.NODESET);
    datastoreName=new String[((NodeList)result).getLength()];
    for (int i=0; i < ((NodeList)result).getLength(); i++) {
      this.datastoreName[i]=((NodeList)result).item(i).getNodeValue();
    }
  }
 catch (  XPathExpressionException e) {
    datastoreName=new String[1];
    this.datastoreName[0]="String_Node_Str";
  }
}

Fixed version (ground truth):
/** 
 * Constructor.
 */
public CassandraConnector(){
  sessions=new HashMap<>();
  XPathFactory xFactory=XPathFactory.newInstance();
  Document d=null;
  try {
    InputStream inputStream=getClass().getResourceAsStream("String_Node_Str");
    d=DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(inputStream);
  }
 catch (  SAXException e) {
    LOG.trace("String_Node_Str");
  }
catch (  IOException e) {
    LOG.trace("String_Node_Str");
  }
catch (  ParserConfigurationException e) {
    LOG.trace("String_Node_Str");
  }
  XPath xpath=xFactory.newXPath();
  Object result;
  XPathExpression expr;
  try {
    expr=xpath.compile("String_Node_Str");
    result=expr.evaluate(d,XPathConstants.NODESET);
    this.connectorName=((NodeList)result).item(0).getNodeValue();
  }
 catch (  XPathExpressionException e) {
    this.connectorName="String_Node_Str";
  }
  try {
    expr=xpath.compile("String_Node_Str");
    result=expr.evaluate(d,XPathConstants.NODESET);
    datastoreName=new String[((NodeList)result).getLength()];
    for (int i=0; i < ((NodeList)result).getLength(); i++) {
      this.datastoreName[i]=((NodeList)result).item(i).getNodeValue();
    }
  }
 catch (  XPathExpressionException e) {
    datastoreName=new String[1];
    this.datastoreName[0]="String_Node_Str";
  }
}
Program: 11188
Project: 11188
Buggy source:
/** 
 * Constructor.
 */
public CassandraConnector(){
  sessions=new HashMap<>();
  XPathFactory xFactory=null;
  Document d=null;
  try {
    InputStream inputStream=getClass().getResourceAsStream("String_Node_Str");
    d=DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(inputStream);
    xFactory=XPathFactory.newInstance();
  }
 catch (  SAXException e) {
    LOG.trace("String_Node_Str");
  }
catch (  IOException e) {
    LOG.trace("String_Node_Str");
  }
catch (  ParserConfigurationException e) {
    LOG.trace("String_Node_Str");
  }
  XPath xpath=xFactory.newXPath();
  Object result;
  XPathExpression expr;
  try {
    expr=xpath.compile("String_Node_Str");
    result=expr.evaluate(d,XPathConstants.NODESET);
    this.connectorName=((NodeList)result).item(0).getNodeValue();
  }
 catch (  XPathExpressionException e) {
    this.connectorName="String_Node_Str";
  }
  try {
    expr=xpath.compile("String_Node_Str");
    result=expr.evaluate(d,XPathConstants.NODESET);
    datastoreName=new String[((NodeList)result).getLength()];
    for (int i=0; i < ((NodeList)result).getLength(); i++) {
      this.datastoreName[i]=((NodeList)result).item(i).getNodeValue();
    }
  }
 catch (  XPathExpressionException e) {
    datastoreName=new String[1];
    this.datastoreName[0]="String_Node_Str";
  }
}

Fixed version (ground truth):
/** 
 * Constructor.
 */
public CassandraConnector(){
  sessions=new HashMap<>();
  XPathFactory xFactory=XPathFactory.newInstance();
  Document d=null;
  try {
    InputStream inputStream=getClass().getResourceAsStream("String_Node_Str");
    d=DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(inputStream);
  }
 catch (  SAXException e) {
    LOG.trace("String_Node_Str");
  }
catch (  IOException e) {
    LOG.trace("String_Node_Str");
  }
catch (  ParserConfigurationException e) {
    LOG.trace("String_Node_Str");
  }
  XPath xpath=xFactory.newXPath();
  Object result;
  XPathExpression expr;
  try {
    expr=xpath.compile("String_Node_Str");
    result=expr.evaluate(d,XPathConstants.NODESET);
    this.connectorName=((NodeList)result).item(0).getNodeValue();
  }
 catch (  XPathExpressionException e) {
    this.connectorName="String_Node_Str";
  }
  try {
    expr=xpath.compile("String_Node_Str");
    result=expr.evaluate(d,XPathConstants.NODESET);
    datastoreName=new String[((NodeList)result).getLength()];
    for (int i=0; i < ((NodeList)result).getLength(); i++) {
      this.datastoreName[i]=((NodeList)result).item(i).getNodeValue();
    }
  }
 catch (  XPathExpressionException e) {
    datastoreName=new String[1];
    this.datastoreName[0]="String_Node_Str";
  }
}
Program: 11190
Project: 11190
Buggy source:
/** 
 * Constructor.
 */
public CassandraConnector(){
  sessions=new HashMap<>();
  try {
    InputStream inputStream=getClass().getResourceAsStream("String_Node_Str");
    Document d=DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(inputStream);
    XPathFactory xFactory=XPathFactory.newInstance();
    XPath xpath=xFactory.newXPath();
    Object result;
    XPathExpression expr;
    try {
      expr=xpath.compile("String_Node_Str");
      result=expr.evaluate(d,XPathConstants.NODESET);
      this.connectorName=((NodeList)result).item(0).getNodeValue();
    }
 catch (    XPathExpressionException e) {
      this.connectorName="String_Node_Str";
    }
    try {
      expr=xpath.compile("String_Node_Str");
      result=expr.evaluate(d,XPathConstants.NODESET);
      datastoreName=new String[((NodeList)result).getLength()];
      for (int i=0; i < ((NodeList)result).getLength(); i++) {
        this.datastoreName[i]=((NodeList)result).item(i).getNodeValue();
      }
    }
 catch (    XPathExpressionException e) {
      datastoreName=new String[1];
      this.datastoreName[0]="String_Node_Str";
    }
  }
 catch (  SAXException e) {
    LOG.trace("String_Node_Str");
  }
catch (  IOException e) {
    LOG.trace("String_Node_Str");
  }
catch (  ParserConfigurationException e) {
    LOG.trace("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Constructor.
 */
public CassandraConnector(){
  sessions=new HashMap<>();
  XPathFactory xFactory=null;
  Document d=null;
  try {
    InputStream inputStream=getClass().getResourceAsStream("String_Node_Str");
    d=DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(inputStream);
    xFactory=XPathFactory.newInstance();
  }
 catch (  SAXException e) {
    LOG.trace("String_Node_Str");
  }
catch (  IOException e) {
    LOG.trace("String_Node_Str");
  }
catch (  ParserConfigurationException e) {
    LOG.trace("String_Node_Str");
  }
  XPath xpath=xFactory.newXPath();
  Object result;
  XPathExpression expr;
  try {
    expr=xpath.compile("String_Node_Str");
    result=expr.evaluate(d,XPathConstants.NODESET);
    this.connectorName=((NodeList)result).item(0).getNodeValue();
  }
 catch (  XPathExpressionException e) {
    this.connectorName="String_Node_Str";
  }
  try {
    expr=xpath.compile("String_Node_Str");
    result=expr.evaluate(d,XPathConstants.NODESET);
    datastoreName=new String[((NodeList)result).getLength()];
    for (int i=0; i < ((NodeList)result).getLength(); i++) {
      this.datastoreName[i]=((NodeList)result).item(i).getNodeValue();
    }
  }
 catch (  XPathExpressionException e) {
    datastoreName=new String[1];
    this.datastoreName[0]="String_Node_Str";
  }
}
Program: 11191
Project: 11191
Buggy source:
/** 
 * Connect Method: Enabled the connector with his own configuration.
 * @param credentials The credentials.
 * @param config The cluster config
 * @throws ConnectionException
 */
@Override public void connect(ICredentials credentials,ConnectorClusterConfig config) throws ConnectionException {
  ClusterName clusterName=config.getName();
  Map<String,String> clusterOptions=config.getClusterOptions();
  Map<String,String> connectorOptions=config.getConnectorOptions();
  EngineConfig engineConfig=new EngineConfig();
  engineConfig.setCassandraHosts(clusterOptions.get("String_Node_Str").substring(1,clusterOptions.get("String_Node_Str").length() - 1).split("String_Node_Str"));
  engineConfig.setCassandraPort(Integer.parseInt(clusterOptions.get("String_Node_Str")));
  engineConfig.setCredentials(credentials);
  if (connectorOptions.get("String_Node_Str") == null) {
    defaultLimit=DEFAULT_LIMIT;
  }
 else {
    defaultLimit=Integer.parseInt(connectorOptions.get("String_Node_Str"));
  }
  Engine engine=new Engine(engineConfig);
  LOG.info("String_Node_Str");
  sessions.put(clusterName.getName(),engine.getSession());
}

Fixed version (ground truth):
/** 
 * Connect Method: Enabled the connector with his own configuration.
 * @param credentials The credentials.
 * @param config      The cluster config
 * @throws ConnectionException
 */
@Override public void connect(ICredentials credentials,ConnectorClusterConfig config) throws ConnectionException {
  ClusterName clusterName=config.getName();
  Map<String,String> clusterOptions=config.getClusterOptions();
  Map<String,String> connectorOptions=config.getConnectorOptions();
  EngineConfig engineConfig=new EngineConfig();
  engineConfig.setCassandraHosts(clusterOptions.get("String_Node_Str").substring(1,clusterOptions.get("String_Node_Str").length() - 1).split("String_Node_Str"));
  engineConfig.setCassandraPort(Integer.parseInt(clusterOptions.get("String_Node_Str")));
  engineConfig.setCredentials(credentials);
  if (connectorOptions.get("String_Node_Str") == null) {
    defaultLimit=DEFAULT_LIMIT;
  }
 else {
    defaultLimit=Integer.parseInt(connectorOptions.get("String_Node_Str"));
  }
  Engine engine=new Engine(engineConfig);
  LOG.info("String_Node_Str");
  sessions.put(clusterName.getName(),engine.getSession());
}
Program: 11192
Project: 11192
Buggy source:
/** 
 * Executes a query from a String and add the alias in the Result for Selects .
 * @param query        The query in a String.
 * @param aliasColumns The Map with the alias
 * @param session      Cassandra datastax java driver session.
 * @return a {@link com.stratio.crossdata.common.result.Result}.
 */
public static com.stratio.crossdata.common.result.Result execute(String query,Map<Selector,String> aliasColumns,Session session) throws ConnectorException {
  try {
    ResultSet resultSet=session.execute(query);
    return com.stratio.crossdata.common.result.QueryResult.createQueryResult(utils.transformToMetaResultSet(resultSet,aliasColumns));
  }
 catch (  UnsupportedOperationException unSupportException) {
    throw new UnsupportedException(unSupportException);
  }
catch (  DriverException dex) {
    throw new CriticalExecutionException(dex);
  }
catch (  Exception ex) {
    throw new ExecutionException(ex);
  }
}

Fixed version (ground truth):
/** 
 * Executes a query from a String and add the alias in the Result for Selects .
 * @param query        The query in a String.
 * @param aliasColumns The Map with the alias
 * @param session      Cassandra datastax java driver session.
 * @return a {@link com.stratio.crossdata.common.result.Result}.
 */
public static com.stratio.crossdata.common.result.Result execute(String query,Map<Selector,String> aliasColumns,Session session) throws ConnectorException {
  try {
    ResultSet resultSet=session.execute(query);
    return com.stratio.crossdata.common.result.QueryResult.createQueryResult(utils.transformToMetaResultSet(resultSet,aliasColumns));
  }
 catch (  UnsupportedOperationException unSupportException) {
    throw new UnsupportedException(unSupportException.getMessage());
  }
catch (  DriverException dex) {
    throw new CriticalExecutionException(dex.getMessage());
  }
catch (  Exception ex) {
    throw new ExecutionException(ex.getMessage());
  }
}
Program: 11193
Project: 11193
Buggy source:
/** 
 * Basic Constructor.
 * @param indexMetadata  Index metadata information .
 * @param createIfNotExists Condition of creation of the index.
 * @param session Session that the Index affect.
 * @throws ExecutionException
 */
public CreateIndexStatement(IndexMetadata indexMetadata,boolean createIfNotExists,Session session) throws ExecutionException {
  this.targetColumns=indexMetadata.getColumns();
  this.createIfNotExists=createIfNotExists;
  this.type=indexMetadata.getType();
  this.tableName=indexMetadata.getName().getTableName().getName();
  this.keyspace=indexMetadata.getName().getTableName().getCatalogName().getName();
  if (keyspace != null) {
    this.keyspaceIncluded=true;
  }
  this.name=indexMetadata.getName().getName();
  if (type == IndexType.FULL_TEXT) {
    usingClass="String_Node_Str";
    try {
      session.execute("String_Node_Str" + indexMetadata.getName().getTableName().getQualifiedName() + "String_Node_Str"+ getIndexName()+ "String_Node_Str");
    }
 catch (    Exception e) {
      throw new ExecutionException("String_Node_Str" + e.getMessage(),e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Basic Constructor.
 * @param indexMetadata     Index metadata information .
 * @param createIfNotExists Condition of creation of the index.
 * @param session           Session that the Index affect.
 * @throws ExecutionException
 */
public CreateIndexStatement(IndexMetadata indexMetadata,boolean createIfNotExists,Session session) throws ExecutionException {
  this.targetColumns=indexMetadata.getColumns();
  this.createIfNotExists=createIfNotExists;
  this.type=indexMetadata.getType();
  this.tableName=indexMetadata.getName().getTableName().getName();
  this.keyspace=indexMetadata.getName().getTableName().getCatalogName().getName();
  if (keyspace != null) {
    this.keyspaceIncluded=true;
  }
  this.name=indexMetadata.getName().getName();
  if (type == IndexType.FULL_TEXT) {
    usingClass="String_Node_Str";
    try {
      columnForIndex=getIndexName();
      session.execute("String_Node_Str" + indexMetadata.getName().getTableName().getQualifiedName() + "String_Node_Str"+ columnForIndex+ "String_Node_Str");
    }
 catch (    Exception e) {
      throw new ExecutionException("String_Node_Str" + e.getMessage(),e);
    }
  }
}
Program: 11194
Project: 11194
Buggy source:
/** 
 * Get the query in a String in CQL language.
 * @return String with the query
 */
public String toString(){
  StringBuilder sb=new StringBuilder("String_Node_Str");
  if (type == (IndexType.FULL_TEXT)) {
    options=generateLuceneOptions();
    sb.append("String_Node_Str");
  }
  sb.append("String_Node_Str");
  if (createIfNotExists) {
    sb.append("String_Node_Str");
  }
  if (name != null) {
    sb.append(getIndexName()).append("String_Node_Str");
  }
  sb.append("String_Node_Str");
  if (keyspaceIncluded) {
    sb.append(keyspace).append("String_Node_Str");
  }
  sb.append(tableName);
  sb.append("String_Node_Str");
  int i=0;
  for (  Map.Entry<ColumnName,ColumnMetadata> entry : targetColumns.entrySet()) {
    if (i != 0) {
      sb.append("String_Node_Str");
    }
    sb.append(entry.getValue().getName().getName());
    i=1;
  }
  sb.append("String_Node_Str");
  if (usingClass != null) {
    sb.append("String_Node_Str");
    sb.append(usingClass);
  }
  if (!options.isEmpty()) {
    sb.append(getOptionsString());
  }
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * Get the query in a String in CQL language.
 * @return String with the query
 */
public String toString(){
  StringBuilder sb=new StringBuilder("String_Node_Str");
  if (type == (IndexType.FULL_TEXT)) {
    options=generateLuceneOptions();
    sb.append("String_Node_Str");
  }
  sb.append("String_Node_Str");
  if (createIfNotExists) {
    sb.append("String_Node_Str");
  }
  if (name != null) {
    sb.append(getIndexName()).append("String_Node_Str");
  }
  sb.append("String_Node_Str");
  if (keyspaceIncluded) {
    sb.append(keyspace).append("String_Node_Str");
  }
  sb.append(tableName);
  sb.append("String_Node_Str");
  if (type != IndexType.FULL_TEXT) {
    int i=0;
    for (    Map.Entry<ColumnName,ColumnMetadata> entry : targetColumns.entrySet()) {
      if (i != 0) {
        sb.append("String_Node_Str");
      }
      sb.append(entry.getValue().getName().getName());
      i=1;
    }
  }
 else {
    sb.append(columnForIndex);
  }
  sb.append("String_Node_Str");
  if (usingClass != null) {
    sb.append("String_Node_Str");
    sb.append(usingClass);
  }
  if (!options.isEmpty()) {
    sb.append(getOptionsString());
  }
  return sb.toString();
}
Program: 11195
Project: 11195
Buggy source:
@Override public String toString(){
  StringBuilder sb=new StringBuilder("String_Node_Str");
  sb.append(tableName.getQualifiedName());
  sb.append("String_Node_Str").append("String_Node_Str");
  for (  Relation relation : assignations) {
    String leftTerm=relation.getLeftTerm().getStringValue().substring(relation.getLeftTerm().getStringValue().lastIndexOf('.') + 1,relation.getLeftTerm().getStringValue().length());
    sb.append(leftTerm).append(relation.getOperator().toString()).append(relation.getRightTerm().toString()).append("String_Node_Str");
  }
  sb.delete(sb.lastIndexOf("String_Node_Str"),sb.length());
  sb.append("String_Node_Str");
  if ((whereClauses != null) && (!whereClauses.isEmpty())) {
    for (    Filter filter : whereClauses) {
      Relation relation=filter.getRelation();
      String leftTerm=relation.getLeftTerm().getStringValue().substring(relation.getLeftTerm().getStringValue().lastIndexOf('.') + 1,relation.getLeftTerm().getStringValue().length());
      sb.append(leftTerm).append(relation.getOperator().toString()).append(relation.getRightTerm().toString()).append("String_Node_Str");
    }
    sb.delete(sb.lastIndexOf("String_Node_Str"),sb.length());
  }
  return sb.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuilder sb=new StringBuilder("String_Node_Str");
  sb.append(tableName.getQualifiedName());
  sb.append("String_Node_Str").append("String_Node_Str");
  for (  Relation relation : assignations) {
    String leftTerm=getLeftTerm(relation);
    sb.append(leftTerm).append(relation.getOperator().toString()).append(relation.getRightTerm().toString()).append("String_Node_Str");
  }
  sb.delete(sb.lastIndexOf("String_Node_Str"),sb.length());
  sb.append("String_Node_Str");
  if ((whereClauses != null) && (!whereClauses.isEmpty())) {
    for (    Filter filter : whereClauses) {
      Relation relation=filter.getRelation();
      String leftTerm=getLeftTerm(relation);
      sb.append(leftTerm).append(relation.getOperator().toString()).append(relation.getRightTerm().toString()).append("String_Node_Str");
    }
    sb.delete(sb.lastIndexOf("String_Node_Str"),sb.length());
  }
  return sb.toString();
}
Program: 11198
Project: 11198
Buggy source:
@Test public void LuceneSelectTest(){
  ClusterName targetCluster=new ClusterName("String_Node_Str");
  List<LogicalStep> logicalSteps=new ArrayList<>();
  TableName tableName=new TableName("String_Node_Str","String_Node_Str");
  List<ColumnName> columnList=new ArrayList<>();
  ColumnName columnName=new ColumnName(tableName,"String_Node_Str");
  columnList.add(columnName);
  Project project=new Project(Operations.PROJECT,tableName,targetCluster,columnList);
  Selector selector=new ColumnSelector(new ColumnName("String_Node_Str","String_Node_Str","String_Node_Str"));
  Selector rightTerm=new StringSelector("String_Node_Str");
  Relation relation=new Relation(selector,Operator.MATCH,rightTerm);
  Filter filter=new Filter(Operations.SELECT_LIMIT,relation);
  project.setNextStep(filter);
  logicalSteps.add(project);
  LogicalWorkflow workflow=new LogicalWorkflow(logicalSteps);
  Map<String,Session> sessions=new HashMap<>();
  sessions.put("String_Node_Str",this._session);
  CassandraQueryEngine cqe=new CassandraQueryEngine(sessions,100);
  QueryResult qr=null;
  try {
    qr=cqe.execute(workflow);
  }
 catch (  ConnectorException e) {
    Assert.fail(e.getMessage());
  }
  String value="String_Node_Str";
  for (  Row row : qr.getResultSet()) {
    Cell cell=row.getCell("String_Node_Str");
    value=cell.getValue().toString();
  }
  if (value != null && !value.equals("String_Node_Str")) {
    assertEquals(true,true);
  }
}

Fixed version (ground truth):
@Test public void LuceneSelectTest(){
  ClusterName targetCluster=new ClusterName("String_Node_Str");
  List<LogicalStep> logicalSteps=new ArrayList<>();
  TableName tableName=new TableName("String_Node_Str","String_Node_Str");
  List<ColumnName> columnList=new ArrayList<>();
  ColumnName columnName=new ColumnName(tableName,"String_Node_Str");
  columnList.add(columnName);
  Project project=new Project(Operations.PROJECT,tableName,targetCluster,columnList);
  Selector selector=new ColumnSelector(new ColumnName("String_Node_Str","String_Node_Str","String_Node_Str"));
  Selector rightTerm=new StringSelector("String_Node_Str");
  Relation relation=new Relation(selector,Operator.MATCH,rightTerm);
  Filter filter=new Filter(Operations.SELECT_LIMIT,relation);
  project.setNextStep(filter);
  logicalSteps.add(project);
  LogicalWorkflow workflow=new LogicalWorkflow(logicalSteps);
  Map<String,Session> sessions=new HashMap<>();
  sessions.put("String_Node_Str",this._session);
  CassandraQueryEngine cqe=new CassandraQueryEngine(sessions,100);
  QueryResult qr=null;
  try {
    qr=cqe.execute(workflow);
  }
 catch (  ConnectorException e) {
    Assert.fail(e.getMessage());
  }
  String value="String_Node_Str";
  for (  Row row : qr.getResultSet()) {
    Cell cell=row.getCell("String_Node_Str");
    value=cell.getValue().toString();
  }
  assertNotEquals(value,null,"String_Node_Str");
}
Program: 11200
Project: 11200
Buggy source:
/** 
 * Executes a query from a String and add the alias in the Result for Selects .
 * @param query        The query in a String.
 * @param aliasColumns The Map with the alias
 * @param session      Cassandra datastax java driver session.
 * @return a {@link com.stratio.crossdata.common.result.Result}.
 */
public static com.stratio.crossdata.common.result.Result execute(String query,Map<ColumnName,String> aliasColumns,Session session) throws ConnectorException {
  try {
    ResultSet resultSet=session.execute(query);
    return com.stratio.crossdata.common.result.QueryResult.createQueryResult(utils.transformToMetaResultSet(resultSet,aliasColumns));
  }
 catch (  UnsupportedOperationException unSupportException) {
    LOG.error("String_Node_Str",unSupportException);
    throw new UnsupportedException(unSupportException.getMessage());
  }
catch (  DriverException dex) {
    LOG.error("String_Node_Str",dex);
    throw new CriticalExecutionException(dex.getMessage());
  }
catch (  Exception ex) {
    LOG.error("String_Node_Str",ex);
    throw new ExecutionException(ex.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Executes a query from a String and add the alias in the Result for Selects .
 * @param query        The query in a String.
 * @param aliasColumns The Map with the alias
 * @param session      Cassandra datastax java driver session.
 * @return a {@link com.stratio.crossdata.common.result.Result}.
 */
public static com.stratio.crossdata.common.result.Result execute(String query,Map<Selector,String> aliasColumns,Session session) throws ConnectorException {
  try {
    ResultSet resultSet=session.execute(query);
    return com.stratio.crossdata.common.result.QueryResult.createQueryResult(utils.transformToMetaResultSet(resultSet,aliasColumns));
  }
 catch (  UnsupportedOperationException unSupportException) {
    LOG.error("String_Node_Str",unSupportException);
    throw new UnsupportedException(unSupportException.getMessage());
  }
catch (  DriverException dex) {
    LOG.error("String_Node_Str",dex);
    throw new CriticalExecutionException(dex.getMessage());
  }
catch (  Exception ex) {
    LOG.error("String_Node_Str",ex);
    throw new ExecutionException(ex.getMessage());
  }
}
Program: 11201
Project: 11201
Buggy source:
private String getAliasClause(){
  StringBuilder sb=new StringBuilder();
  int i=0;
  for (  Map.Entry<ColumnName,String> entry : aliasColumns.entrySet()) {
    if (i != 0) {
      sb.append("String_Node_Str");
    }
    i=1;
    sb.append(entry.getKey().getName());
  }
  return sb.toString();
}

Fixed version (ground truth):
private String getAliasClause(){
  StringBuilder sb=new StringBuilder();
  int i=0;
  for (  Map.Entry<Selector,String> entry : aliasColumns.entrySet()) {
    if (i != 0) {
      sb.append("String_Node_Str");
    }
    i=1;
    sb.append(entry.getKey().getColumnName().getName());
  }
  return sb.toString();
}
Program: 11204
Project: 11204
Buggy source:
/** 
 * Controls if there is a session started for a cluster name.
 * @param name: cluster name.
 * @return if the connector is connected to the cluster.
 */
@Override public boolean isConnected(ClusterName name){
  boolean connected;
  if (sessions.get(name.getName()) != null) {
    if (sessions.get(name.getName()).getCluster() != null) {
      connected=true;
    }
 else {
      connected=false;
    }
  }
 else {
    connected=false;
  }
  return connected;
}

Fixed version (ground truth):
/** 
 * Controls if there is a session started for a cluster name.
 * @param name cluster name.
 * @return if the connector is connected to the cluster.
 */
@Override public boolean isConnected(ClusterName name){
  boolean connected;
  if (sessions.get(name.getName()) != null) {
    if (sessions.get(name.getName()).getCluster() != null) {
      connected=true;
    }
 else {
      connected=false;
    }
  }
 else {
    connected=false;
  }
  return connected;
}
Program: 11205
Project: 11205
Buggy source:
/** 
 * Main method that start the connector and controls the unexpected shutdowns
 * @param args
 */
public static void main(String[] args){
  CassandraConnector cassandraConnector=new CassandraConnector();
  ConnectorApp connectorApp=new ConnectorApp();
  connectorApp.startup(cassandraConnector);
  cassandraConnector.attachShutDownHook();
}

Fixed version (ground truth):
/** 
 * Main method that start the connector and controls the unexpected shutdowns.
 * @param args
 */
public static void main(String[] args){
  CassandraConnector cassandraConnector=new CassandraConnector();
  ConnectorApp connectorApp=new ConnectorApp();
  connectorApp.startup(cassandraConnector);
  cassandraConnector.attachShutDownHook();
}
Program: 11206
Project: 11206
Buggy source:
/** 
 * Close at the moment all the sessions of the connector
 */
public void uncontrolledShutdown(){
  for (  Session s : sessions.values()) {
    s.close();
  }
  sessions=new HashMap<>();
}

Fixed version (ground truth):
/** 
 * Close at the moment all the sessions of the connector.
 */
public void uncontrolledShutdown(){
  for (  Session s : sessions.values()) {
    s.close();
  }
  sessions=new HashMap<>();
}
Program: 11207
Project: 11207
Buggy source:
/** 
 * Close the session of the cluster name specified.
 * @param name: Name of the cluster.
 * @throws ConnectionException
 */
@Override public void close(ClusterName name) throws ConnectionException {
  sessions.get(name.getName()).close();
  sessions.remove(name.getName());
}

Fixed version (ground truth):
/** 
 * Close the session of the cluster name specified.
 * @param name Name of the cluster.
 * @throws ConnectionException
 */
@Override public void close(ClusterName name) throws ConnectionException {
  sessions.get(name.getName()).close();
  sessions.remove(name.getName());
}