Program: 124647
Project: 124647
Buggy source:
private void initCluster(NoSQLConnection connection) throws NoSQLServerException {
  try {
    if (cluster != null) {
      boolean isClosed=(Boolean)NoSQLReflection.invokeMethod(cluster,"String_Node_Str");
      if (!isClosed) {
        return;
      }
    }
    ClassLoader classLoader=NoSQLClassLoaderFactory.getClassLoader(connection);
    ContextType contextType=null;
    String host=connection.getAttributes().get(ICassandraAttributies.HOST);
    if (connection.isContextMode()) {
      contextType=ConnectionContextHelper.getContextTypeForContextMode(connection);
    }
    if (contextType != null) {
      host=ContextParameterUtils.getOriginalValue(contextType,host);
    }
    cluster=NoSQLReflection.invokeStaticMethod("String_Node_Str","String_Node_Str",classLoader);
    cluster=NoSQLReflection.invokeMethod(cluster,"String_Node_Str",new Object[]{host});
    String requireAuthAttr=connection.getAttributes().get(ICassandraAttributies.REQUIRED_AUTHENTICATION);
    boolean requireAuth=requireAuthAttr == null ? false : Boolean.valueOf(requireAuthAttr);
    if (requireAuth) {
      String username=connection.getAttributes().get(ICassandraAttributies.USERNAME);
      String password=connection.getValue(connection.getAttributes().get(ICassandraAttributies.PASSWORD),false);
      if (contextType != null) {
        username=ContextParameterUtils.getOriginalValue(contextType,username);
        password=ContextParameterUtils.getOriginalValue(contextType,password);
      }
      cluster=NoSQLReflection.invokeMethod(cluster,"String_Node_Str",new Object[]{username,password});
    }
    cluster=NoSQLReflection.invokeMethod(cluster,"String_Node_Str");
  }
 catch (  Exception e) {
    throw new NoSQLServerException(e);
  }
}

Fixed version (ground truth):
private void initCluster(NoSQLConnection connection) throws NoSQLServerException {
  try {
    if (cluster != null) {
      boolean isClosed=(Boolean)NoSQLReflection.invokeMethod(cluster,"String_Node_Str");
      if (!isClosed) {
        return;
      }
    }
    ClassLoader classLoader=NoSQLClassLoaderFactory.getClassLoader(connection);
    ContextType contextType=null;
    String host=connection.getAttributes().get(ICassandraAttributies.HOST);
    String port=connection.getAttributes().get(ICassandraAttributies.PORT);
    if (connection.isContextMode()) {
      contextType=ConnectionContextHelper.getContextTypeForContextMode(connection);
    }
    if (contextType != null) {
      host=ContextParameterUtils.getOriginalValue(contextType,host);
      port=ContextParameterUtils.getOriginalValue(contextType,port);
    }
    cluster=NoSQLReflection.invokeStaticMethod("String_Node_Str","String_Node_Str",classLoader);
    cluster=NoSQLReflection.invokeMethod(cluster,"String_Node_Str",new Object[]{host});
    cluster=NoSQLReflection.invokeMethod(cluster,"String_Node_Str",new Object[]{Integer.valueOf(port)},int.class);
    String requireAuthAttr=connection.getAttributes().get(ICassandraAttributies.REQUIRED_AUTHENTICATION);
    boolean requireAuth=requireAuthAttr == null ? false : Boolean.valueOf(requireAuthAttr);
    if (requireAuth) {
      String username=connection.getAttributes().get(ICassandraAttributies.USERNAME);
      String password=connection.getValue(connection.getAttributes().get(ICassandraAttributies.PASSWORD),false);
      if (contextType != null) {
        username=ContextParameterUtils.getOriginalValue(contextType,username);
        password=ContextParameterUtils.getOriginalValue(contextType,password);
      }
      cluster=NoSQLReflection.invokeMethod(cluster,"String_Node_Str",new Object[]{username,password});
    }
    cluster=NoSQLReflection.invokeMethod(cluster,"String_Node_Str");
  }
 catch (  Exception e) {
    throw new NoSQLServerException(e);
  }
}