Program: 136456
Project: 136456
Buggy source:
/** 
 * @param catalogName (can be null)
 * @param connection
 * @param queryStmt
 * @return
 * @throws SQLException
 */
protected List<Object[]> executeQuery(String catalogName,Connection connection,String queryStmt) throws SQLException {
  ClassLoader currClassLoader=Thread.currentThread().getContextClassLoader();
  org.talend.core.model.metadata.builder.connection.Connection dbConn=this.getAnalysisDataProvider(cachedAnalysis);
  IMetadataConnection metadataBean=ConvertionHelper.convert(dbConn);
  if (EDatabaseTypeName.HIVE.getXmlName().equalsIgnoreCase(metadataBean.getDbType())) {
    ClassLoader hiveClassLoader=HiveClassLoaderFactory.getInstance().getClassLoader(metadataBean);
    Thread.currentThread().setContextClassLoader(hiveClassLoader);
  }
  List<Object[]> myResultSet=new ArrayList<Object[]>();
  Statement statement=null;
  try {
    if (catalogName != null) {
      changeCatalog(catalogName,connection);
    }
    if (continueRun()) {
      statement=connection.createStatement();
      statement.execute(queryStmt);
      ResultSet resultSet=statement.getResultSet();
      if (resultSet == null) {
        String mess=Messages.getString("String_Node_Str") + queryStmt;
        log.warn(mess);
        return null;
      }
      ResultSetMetaData metaData=resultSet.getMetaData();
      int columnCount=metaData.getColumnCount();
      while (resultSet.next()) {
        Object[] result=new Object[columnCount];
        for (int i=0; i < columnCount; i++) {
          result[i]=resultSet.getObject(i + 1);
        }
        myResultSet.add(result);
      }
      resultSet.close();
    }
  }
 catch (  NullPointerException nullExc) {
    if (getMonitor() != null && getMonitor().isCanceled()) {
      log.error(nullExc);
    }
 else {
      throw nullExc;
    }
  }
 finally {
    if (statement != null) {
      statement.close();
    }
    Thread.currentThread().setContextClassLoader(currClassLoader);
  }
  return myResultSet;
}

Fixed version (ground truth):
/** 
 * @param catalogName (can be null)
 * @param connection
 * @param queryStmt
 * @return
 * @throws SQLException
 */
protected List<Object[]> executeQuery(String catalogName,Connection connection,String queryStmt) throws SQLException {
  ClassLoader currClassLoader=Thread.currentThread().getContextClassLoader();
  org.talend.core.model.metadata.builder.connection.Connection dbConn=this.getAnalysisDataProvider(cachedAnalysis);
  IMetadataConnection metadataBean=ConvertionHelper.convert(dbConn);
  if (EDatabaseTypeName.HIVE.getXmlName().equalsIgnoreCase(metadataBean.getDbType())) {
    ClassLoader hiveClassLoader=HiveClassLoaderFactory.getInstance().getClassLoader(metadataBean);
    Thread.currentThread().setContextClassLoader(hiveClassLoader);
  }
  List<Object[]> myResultSet=new ArrayList<Object[]>();
  Statement statement=null;
  try {
    if (catalogName != null) {
      changeCatalog(catalogName,connection);
    }
    if (continueRun()) {
      statement=connection.createStatement();
      statement.execute(queryStmt);
      ResultSet resultSet=statement.getResultSet();
      if (resultSet == null) {
        String mess=Messages.getString("String_Node_Str") + queryStmt;
        log.warn(mess);
        return null;
      }
      ResultSetMetaData metaData=resultSet.getMetaData();
      int columnCount=metaData.getColumnCount();
      while (resultSet.next()) {
        Object[] result=new Object[columnCount];
        for (int i=0; i < columnCount; i++) {
          result[i]=ResultSetUtils.getBigObject(resultSet,i + 1);
        }
        myResultSet.add(result);
      }
      resultSet.close();
    }
  }
 catch (  NullPointerException nullExc) {
    if (getMonitor() != null && getMonitor().isCanceled()) {
      log.error(nullExc);
    }
 else {
      throw nullExc;
    }
  }
 finally {
    if (statement != null) {
      statement.close();
    }
    Thread.currentThread().setContextClassLoader(currClassLoader);
  }
  return myResultSet;
}