nus-yam/ex-repair huggingface dataset:
Program: 25246
Project: 25246
Buggy source:
private void getColsForSelectTree(final CubeQueryContext cubeql) throws LensException {
  int exprInd=1;
  for (int i=0; i < cubeql.getSelectAST().getChildCount(); i++) {
    ASTNode selectExpr=(ASTNode)cubeql.getSelectAST().getChild(i);
    Set<String> cols=new HashSet<String>();
    addColumnsForSelectExpr(cubeql,selectExpr,cubeql.getSelectAST(),cols);
    ASTNode alias=HQLParser.findNodeByPath(selectExpr,Identifier);
    String selectAlias;
    String selectFinalAlias=null;
    if (alias != null) {
      cubeql.addExprToAlias(selectExpr,alias);
      if (HQLParser.hasSpaces(alias.getText())) {
        selectFinalAlias=alias.getText();
        selectAlias=SELECT_ALIAS_PREFIX + exprInd;
      }
 else {
        selectAlias=alias.getText().trim();
      }
    }
 else     if (cols.size() == 1) {
      selectAlias=cols.iterator().next().toLowerCase();
    }
 else {
      selectAlias=SELECT_ALIAS_PREFIX + exprInd;
    }
    exprInd++;
    cubeql.addSelectAlias(selectAlias,selectFinalAlias);
  }
}

Fixed version (ground truth):
private void getColsForSelectTree(final CubeQueryContext cubeql) throws LensException {
  int exprInd=1;
  for (int i=0; i < cubeql.getSelectAST().getChildCount(); i++) {
    ASTNode selectExpr=(ASTNode)cubeql.getSelectAST().getChild(i);
    ASTNode selectExprChild=(ASTNode)selectExpr.getChild(0);
    Set<String> cols=new HashSet<>();
    addColumnsForSelectExpr(cubeql,selectExpr,cubeql.getSelectAST(),cols);
    ASTNode alias=HQLParser.findNodeByPath(selectExpr,Identifier);
    String selectAlias;
    String selectFinalAlias=null;
    if (alias != null) {
      cubeql.addExprToAlias(selectExpr,alias);
      selectFinalAlias=alias.getText();
      selectAlias=SELECT_ALIAS_PREFIX + exprInd;
    }
 else     if (cols.size() == 1 && (selectExprChild.getToken().getType() == TOK_TABLE_OR_COL || selectExprChild.getToken().getType() == DOT)) {
      selectAlias=cols.iterator().next().toLowerCase();
    }
 else {
      selectAlias=SELECT_ALIAS_PREFIX + exprInd;
      selectFinalAlias=HQLParser.getString(selectExprChild);
    }
    exprInd++;
    cubeql.addSelectAlias(selectAlias,selectFinalAlias);
  }
}
Program: 25247
Project: 25247
Buggy source:
static void getColsForTree(final CubeQueryContext cubeql,ASTNode tree,final TrackQueriedColumns tqc) throws LensException {
  if (tree == null) {
    return;
  }
  HQLParser.bft(tree,new ASTNodeVisitor(){
    @Override public void visit(    TreeNode visited){
      ASTNode node=visited.getNode();
      ASTNode parent=null;
      if (visited.getParent() != null) {
        parent=visited.getParent().getNode();
      }
      if (node.getToken().getType() == TOK_TABLE_OR_COL && (parent != null && parent.getToken().getType() != DOT)) {
        ASTNode ident=(ASTNode)node.getChild(0);
        String column=ident.getText().toLowerCase();
        if (cubeql.getExprToAliasMap().values().contains(column)) {
          return;
        }
        tqc.addColumnsQueried(CubeQueryContext.DEFAULT_TABLE,column);
      }
 else       if (node.getToken().getType() == DOT) {
        ASTNode tabident=HQLParser.findNodeByPath(node,TOK_TABLE_OR_COL,Identifier);
        ASTNode colIdent=(ASTNode)node.getChild(1);
        String column=colIdent.getText().toLowerCase();
        String table=tabident.getText().toLowerCase();
        tqc.addColumnsQueried(table,column);
      }
    }
  }
);
}

Fixed version (ground truth):
static void getColsForTree(final CubeQueryContext cubeql,ASTNode tree,final TrackQueriedColumns tqc,final boolean skipAliases) throws LensException {
  if (tree == null) {
    return;
  }
  HQLParser.bft(tree,new ASTNodeVisitor(){
    @Override public void visit(    TreeNode visited){
      ASTNode node=visited.getNode();
      ASTNode parent=null;
      if (visited.getParent() != null) {
        parent=visited.getParent().getNode();
      }
      if (node.getToken().getType() == TOK_TABLE_OR_COL && (parent != null && parent.getToken().getType() != DOT)) {
        ASTNode ident=(ASTNode)node.getChild(0);
        String column=ident.getText().toLowerCase();
        if (skipAliases && cubeql.getExprToAliasMap().values().contains(column)) {
          return;
        }
        tqc.addColumnsQueried(CubeQueryContext.DEFAULT_TABLE,column);
      }
 else       if (node.getToken().getType() == DOT) {
        ASTNode tabident=HQLParser.findNodeByPath(node,TOK_TABLE_OR_COL,Identifier);
        ASTNode colIdent=(ASTNode)node.getChild(1);
        String column=colIdent.getText().toLowerCase();
        String table=tabident.getText().toLowerCase();
        tqc.addColumnsQueried(table,column);
      }
    }
  }
);
}
Program: 25248
Project: 25248
Buggy source:
void resolveColumns(CubeQueryContext cubeql) throws LensException {
  ColumnResolver.getColsForTree(cubeql,finalAST,this);
}

Fixed version (ground truth):
void resolveColumns(CubeQueryContext cubeql) throws LensException {
  ColumnResolver.getColsForTree(cubeql,finalAST,this,false);
}
Program: 25250
Project: 25250
Buggy source:
/** 
 * Returns the contents of this object in the form of a pretty formatted string.
 * @return
 */
String toPrettyString();

Fixed version (ground truth):
/** 
 * Returns the contents of this object in the form of a pretty formatted string.
 * @return contents as formatted String
 */
String toPrettyString();
Program: 25251
Project: 25251
Buggy source:
/** 
 * Converts the input path to appropriate File/URI path. Also removes erroneously appended prefix for URI's. Takes additional properties for special URI handling.
 * @param path
 * @param shouldBeDirectory
 * @param shouldExist
 * @return
 */
public String getValidPath(File path,boolean shouldBeDirectory,boolean shouldExist){
  if (path.getPath().indexOf("String_Node_Str") > 0) {
    return removePrefixBeforeURI(path.getPath());
  }
  if (shouldExist && !path.exists()) {
    throw new RuntimeException("String_Node_Str" + path + "String_Node_Str");
  }
  if (shouldBeDirectory && !path.isDirectory()) {
    throw new RuntimeException("String_Node_Str" + path + "String_Node_Str");
  }
  if (!shouldBeDirectory && path.isDirectory()) {
    throw new RuntimeException("String_Node_Str" + path + "String_Node_Str");
  }
  return path.getAbsolutePath();
}

Fixed version (ground truth):
/** 
 * Converts the input path to appropriate File/URI path. Also removes erroneously appended prefix for URI's. Takes additional properties for special URI handling.
 * @param path input path
 * @param shouldBeDirectory should be a directory
 * @param shouldExist should exist
 * @return converted path
 */
public String getValidPath(File path,boolean shouldBeDirectory,boolean shouldExist){
  if (path.getPath().indexOf("String_Node_Str") > 0) {
    return removePrefixBeforeURI(path.getPath());
  }
  if (shouldExist && !path.exists()) {
    throw new RuntimeException("String_Node_Str" + path + "String_Node_Str");
  }
  if (shouldBeDirectory && !path.isDirectory()) {
    throw new RuntimeException("String_Node_Str" + path + "String_Node_Str");
  }
  if (!shouldBeDirectory && path.isDirectory()) {
    throw new RuntimeException("String_Node_Str" + path + "String_Node_Str");
  }
  return path.getAbsolutePath();
}
Program: 25253
Project: 25253
Buggy source:
/** 
 * Explain query.
 * @param sql      the sql
 * @param location the location
 * @return the string
 * @throws LensAPIException
 * @throws UnsupportedEncodingException the unsupported encoding exception
 */
@CliCommand(value="String_Node_Str",help="String_Node_Str" + "String_Node_Str") public String explainQuery(@CliOption(key={"String_Node_Str","String_Node_Str"},mandatory=true,help="String_Node_Str") String sql,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final File path) throws IOException, LensAPIException {
  PrettyPrintable cliOutput;
  try {
    QueryPlan plan=getClient().getQueryPlan(sql).getData();
    if (path != null && StringUtils.isNotBlank(path.getPath())) {
      String validPath=getValidPath(path,false,false);
      try (OutputStreamWriter osw=new OutputStreamWriter(new FileOutputStream(validPath),Charset.defaultCharset())){
        osw.write(plan.getPlanString());
      }
       return "String_Node_Str" + validPath;
    }
    return plan.getPlanString();
  }
 catch (  final LensAPIException e) {
    BriefError briefError=new BriefError(e.getLensAPIErrorCode(),e.getLensAPIErrorMessage());
    cliOutput=new IdBriefErrorTemplate(IdBriefErrorTemplateKey.REQUEST_ID,e.getLensAPIRequestId(),briefError);
  }
catch (  final LensBriefErrorException e) {
    cliOutput=e.getIdBriefErrorTemplate();
  }
  return cliOutput.toPrettyString();
}

Fixed version (ground truth):
/** 
 * Explain query.
 * @param sql      the sql
 * @return the string
 * @throws LensAPIException
 * @throws UnsupportedEncodingException the unsupported encoding exception
 */
@CliCommand(value="String_Node_Str",help="String_Node_Str" + "String_Node_Str") public String explainQuery(@CliOption(key={"String_Node_Str","String_Node_Str"},mandatory=true,help="String_Node_Str") String sql,@CliOption(key={"String_Node_Str"},mandatory=false,help="String_Node_Str") final File path) throws IOException, LensAPIException {
  PrettyPrintable cliOutput;
  try {
    QueryPlan plan=getClient().getQueryPlan(sql).getData();
    if (path != null && StringUtils.isNotBlank(path.getPath())) {
      String validPath=getValidPath(path,false,false);
      try (OutputStreamWriter osw=new OutputStreamWriter(new FileOutputStream(validPath),Charset.defaultCharset())){
        osw.write(plan.getPlanString());
      }
       return "String_Node_Str" + validPath;
    }
    return plan.getPlanString();
  }
 catch (  final LensAPIException e) {
    BriefError briefError=new BriefError(e.getLensAPIErrorCode(),e.getLensAPIErrorMessage());
    cliOutput=new IdBriefErrorTemplate(IdBriefErrorTemplateKey.REQUEST_ID,e.getLensAPIRequestId(),briefError);
  }
catch (  final LensBriefErrorException e) {
    cliOutput=e.getIdBriefErrorTemplate();
  }
  return cliOutput.toPrettyString();
}
Program: 25254
Project: 25254
Buggy source:
/** 
 * @inheritDoc
 */
@Override public HealthStatus getHealthStatus(){
  boolean isHealthy=true;
  StringBuilder details=new StringBuilder();
  try {
    Hive.get(LensServerConf.getHiveConf()).getAllDatabases();
  }
 catch (  HiveException e) {
    isHealthy=false;
    details.append("String_Node_Str");
    log.error("String_Node_Str",e);
  }
  if (!this.getServiceState().equals(STATE.STARTED)) {
    isHealthy=false;
    details.append("String_Node_Str");
    log.error("String_Node_Str");
  }
  return isHealthy ? new HealthStatus(isHealthy,"String_Node_Str") : new HealthStatus(isHealthy,details.toString());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public HealthStatus getHealthStatus(){
  boolean isHealthy=true;
  StringBuilder details=new StringBuilder();
  try {
    Hive.get(LensServerConf.getHiveConf()).getAllDatabases();
  }
 catch (  HiveException e) {
    isHealthy=false;
    details.append("String_Node_Str");
    log.error("String_Node_Str",e);
  }
  if (!this.getServiceState().equals(STATE.STARTED)) {
    isHealthy=false;
    details.append("String_Node_Str");
    log.error("String_Node_Str");
  }
  return isHealthy ? new HealthStatus(isHealthy,"String_Node_Str") : new HealthStatus(isHealthy,details.toString());
}
Program: 25255
Project: 25255
Buggy source:
/** 
 * @inheritDoc
 */
@Override public HealthStatus getHealthStatus(){
  boolean isHealthy=true;
  StringBuilder details=new StringBuilder();
  if (!this.getServiceState().equals(STATE.STARTED)) {
    isHealthy=false;
    details.append("String_Node_Str");
  }
  if (!this.statusPoller.isAlive()) {
    isHealthy=false;
    details.append("String_Node_Str");
  }
  if (!this.prepareQueryPurger.isAlive()) {
    isHealthy=false;
    details.append("String_Node_Str");
  }
  if (!this.queryPurger.isAlive()) {
    isHealthy=false;
    details.append("String_Node_Str");
  }
  if (!this.querySubmitter.isAlive()) {
    isHealthy=false;
    details.append("String_Node_Str");
  }
  if (this.estimatePool.isShutdown() || this.estimatePool.isTerminated()) {
    isHealthy=false;
    details.append("String_Node_Str");
  }
  if (querySubmitterRunnable.pausedForTest) {
    isHealthy=false;
    details.append("String_Node_Str");
  }
  if (null != this.queryResultPurger && !this.queryResultPurger.isHealthy()) {
    isHealthy=false;
    details.append("String_Node_Str");
  }
  if (!isHealthy) {
    log.error(details.toString());
  }
  return isHealthy ? new HealthStatus(isHealthy,"String_Node_Str") : new HealthStatus(isHealthy,details.toString());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public HealthStatus getHealthStatus(){
  boolean isHealthy=true;
  StringBuilder details=new StringBuilder();
  if (!this.getServiceState().equals(STATE.STARTED)) {
    isHealthy=false;
    details.append("String_Node_Str");
  }
  if (!this.statusPoller.isAlive()) {
    isHealthy=false;
    details.append("String_Node_Str");
  }
  if (!this.prepareQueryPurger.isAlive()) {
    isHealthy=false;
    details.append("String_Node_Str");
  }
  if (!this.queryPurger.isAlive()) {
    isHealthy=false;
    details.append("String_Node_Str");
  }
  if (!this.querySubmitter.isAlive()) {
    isHealthy=false;
    details.append("String_Node_Str");
  }
  if (this.estimatePool.isShutdown() || this.estimatePool.isTerminated()) {
    isHealthy=false;
    details.append("String_Node_Str");
  }
  if (querySubmitterRunnable.pausedForTest) {
    isHealthy=false;
    details.append("String_Node_Str");
  }
  if (null != this.queryResultPurger && !this.queryResultPurger.isHealthy()) {
    isHealthy=false;
    details.append("String_Node_Str");
  }
  if (!isHealthy) {
    log.error(details.toString());
  }
  return isHealthy ? new HealthStatus(isHealthy,"String_Node_Str") : new HealthStatus(isHealthy,details.toString());
}
Program: 25256
Project: 25256
Buggy source:
/** 
 * Creates the saved query table
 * @throws LensException
 */
public void createSavedQueryTableIfNotExists() throws LensException {
  try {
    runner.update(dialect.getCreateTableSyntax());
  }
 catch (  SQLException e) {
    throw new LensException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Creates the saved query table
 * @throws LensException cannot create saved query table
 */
public void createSavedQueryTableIfNotExists() throws LensException {
  try {
    runner.update(dialect.getCreateTableSyntax());
  }
 catch (  SQLException e) {
    throw new LensException("String_Node_Str",e);
  }
}
Program: 25257
Project: 25257
Buggy source:
/** 
 * Saves the query passed
 * @param savedQuery
 * @return
 * @throws LensException
 */
public long saveQuery(SavedQuery savedQuery) throws LensException {
  try {
    final ECMAEscapedSavedQuery ecmaEscaped=ECMAEscapedSavedQuery.getFor(savedQuery);
    runner.update("String_Node_Str" + SAVED_QUERY_TABLE_NAME + "String_Node_Str"+ dialect.getAutoIncrementId(runner)+ "String_Node_Str"+ "String_Node_Str"+ ecmaEscaped.getName()+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ ecmaEscaped.getDescription()+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ ecmaEscaped.getQuery()+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ ecmaEscaped.getParameters()+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    return dialect.getLastInsertedID(runner);
  }
 catch (  SQLException e) {
    throw new LensException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Saves the query passed
 * @param savedQuery
 * @return insert id
 * @throws LensException
 */
public long saveQuery(SavedQuery savedQuery) throws LensException {
  try {
    final ECMAEscapedSavedQuery ecmaEscaped=ECMAEscapedSavedQuery.getFor(savedQuery);
    runner.update("String_Node_Str" + SAVED_QUERY_TABLE_NAME + "String_Node_Str"+ dialect.getAutoIncrementId(runner)+ "String_Node_Str"+ "String_Node_Str"+ ecmaEscaped.getName()+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ ecmaEscaped.getDescription()+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ ecmaEscaped.getQuery()+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ ecmaEscaped.getParameters()+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    return dialect.getLastInsertedID(runner);
  }
 catch (  SQLException e) {
    throw new LensException("String_Node_Str",e);
  }
}
Program: 25258
Project: 25258
Buggy source:
/** 
 * @inheritDoc
 */
@Override public HealthStatus getHealthStatus(){
  return this.getServiceState().equals(STATE.STARTED) ? new HealthStatus(true,"String_Node_Str") : new HealthStatus(false,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public HealthStatus getHealthStatus(){
  return this.getServiceState().equals(STATE.STARTED) ? new HealthStatus(true,"String_Node_Str") : new HealthStatus(false,"String_Node_Str");
}
Program: 25259
Project: 25259
Buggy source:
/** 
 * @inheritDoc
 */
@Override public HealthStatus getHealthStatus(){
  return this.getServiceState().equals(STATE.STARTED) ? new HealthStatus(true,"String_Node_Str") : new HealthStatus(false,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public HealthStatus getHealthStatus(){
  return this.getServiceState().equals(STATE.STARTED) ? new HealthStatus(true,"String_Node_Str") : new HealthStatus(false,"String_Node_Str");
}
Program: 25260
Project: 25260
Buggy source:
/** 
 * @inheritDoc
 */
@Override public HealthStatus getHealthStatus(){
  return this.getServiceState().equals(STATE.STARTED) ? new HealthStatus(true,"String_Node_Str") : new HealthStatus(false,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public HealthStatus getHealthStatus(){
  return this.getServiceState().equals(STATE.STARTED) ? new HealthStatus(true,"String_Node_Str") : new HealthStatus(false,"String_Node_Str");
}
Program: 25261
Project: 25261
Buggy source:
private void createContinuousFactData() throws Exception {
  Class.forName("String_Node_Str");
  Connection con=DriverManager.getConnection("String_Node_Str","String_Node_Str","String_Node_Str");
  con.setAutoCommit(true);
  Statement statement=con.createStatement();
  try {
    Date date=new Date(System.currentTimeMillis());
    SimpleDateFormat format=new SimpleDateFormat("String_Node_Str");
    String nowTime=format.format(date);
    statement.execute("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str" + nowTime + "String_Node_Str"+ nowTime+ "String_Node_Str");
  }
  finally {
    statement.close();
    con.close();
  }
}

Fixed version (ground truth):
private void createContinuousFactData() throws Exception {
  Class.forName("String_Node_Str");
  Connection con=DriverManager.getConnection("String_Node_Str","String_Node_Str","String_Node_Str");
  con.setAutoCommit(true);
  Statement statement=con.createStatement();
  try {
    statement.execute(INSERT_QUERY);
  }
  finally {
    statement.close();
    con.close();
  }
}
Program: 25262
Project: 25262
Buggy source:
public void testScannedPathsRecursive() throws Exception {
  ScannedPaths sc;
  Iterator<String> iter=null;
  String tempPath="String_Node_Str";
  String fileRegex=tempPath + "String_Node_Str";
  try {
    createTempDirStructure2(tempPath);
    sc=new ScannedPaths(fileRegex,"String_Node_Str");
    Assert.assertEquals(Iterators.size(sc.iterator()),6,"String_Node_Str");
    iter=sc.iterator();
    Assert.assertTrue(iter.next().contains("String_Node_Str"));
    Assert.assertTrue(iter.next().contains("String_Node_Str"));
    Assert.assertTrue(iter.next().contains("String_Node_Str"));
    Assert.assertTrue(iter.next().contains("String_Node_Str"));
    Assert.assertTrue(iter.next().contains("String_Node_Str"));
    Assert.assertTrue(iter.next().contains("String_Node_Str"));
    File orderFile=createNewPath(tempPath,"String_Node_Str");
    PrintWriter writer=new PrintWriter(orderFile,"String_Node_Str");
    writer.println("String_Node_Str");
    writer.println("String_Node_Str");
    writer.close();
    sc=new ScannedPaths(fileRegex,"String_Node_Str");
    Assert.assertEquals(Iterators.size(sc.iterator()),6,"String_Node_Str");
    iter=sc.iterator();
    Assert.assertTrue(iter.next().contains("String_Node_Str"));
    Assert.assertTrue(iter.next().contains("String_Node_Str"));
    Assert.assertTrue(iter.next().contains("String_Node_Str"));
    Assert.assertTrue(iter.next().contains("String_Node_Str"));
    Assert.assertTrue(iter.next().contains("String_Node_Str"));
    Assert.assertTrue(iter.next().contains("String_Node_Str"));
  }
 catch (  Exception e) {
    Assert.fail("String_Node_Str" + e.getMessage());
  }
 finally {
    FileUtils.deleteQuietly(new File(tempPath));
  }
}

Fixed version (ground truth):
public void testScannedPathsRecursive() throws Exception {
  ScannedPaths sc;
  String tempPath="String_Node_Str";
  String fileRegex=tempPath + "String_Node_Str";
  try {
    createTempDirStructure2(tempPath);
    sc=new ScannedPaths(fileRegex,"String_Node_Str");
    assertUnOrdered(sc,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
    File orderFile=createNewPath(tempPath,"String_Node_Str");
    PrintWriter writer=new PrintWriter(orderFile,"String_Node_Str");
    writer.println("String_Node_Str");
    writer.println("String_Node_Str");
    writer.close();
    sc=new ScannedPaths(fileRegex,"String_Node_Str");
    assertUnOrdered(sc,"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  }
 catch (  Exception e) {
    Assert.fail("String_Node_Str" + e.getMessage());
  }
 finally {
    FileUtils.deleteQuietly(new File(tempPath));
  }
}
Program: 25266
Project: 25266
Buggy source:
public void testScannedPaths() throws Exception {
  File fileA=null, fileB=null;
  String filenameA, filenameB, fileRegex;
  String tempPath="String_Node_Str";
  ScannedPaths sc;
  Iterator<String> iter=null;
  try {
    filenameA="String_Node_Str";
    filenameB="String_Node_Str";
    fileRegex=tempPath + "String_Node_Str";
    fileA=createNewPath(tempPath + filenameA);
    fileB=createNewPath(tempPath + filenameB);
    sc=new ScannedPaths(fileRegex,"String_Node_Str");
    Assert.assertEquals(Iterators.size(sc.iterator()),2,"String_Node_Str");
    iter=sc.iterator();
    Assert.assertTrue(iter.next().contains(filenameA));
    Assert.assertTrue(iter.next().contains(filenameB));
    fileRegex=tempPath + "String_Node_Str";
    sc=new ScannedPaths(fileRegex,"String_Node_Str");
    Assert.assertFalse(sc.iterator().hasNext(),"String_Node_Str");
  }
 catch (  Exception e) {
    Assert.fail("String_Node_Str" + e.getMessage());
  }
 finally {
    FileUtils.deleteQuietly(new File(tempPath));
  }
}

Fixed version (ground truth):
public void testScannedPaths() throws Exception {
  String filenameA, filenameB, fileRegex;
  String tempPath="String_Node_Str";
  ScannedPaths sc;
  try {
    filenameA="String_Node_Str";
    filenameB="String_Node_Str";
    fileRegex=tempPath + "String_Node_Str";
    createNewPath(tempPath + filenameA);
    createNewPath(tempPath + filenameB);
    sc=new ScannedPaths(fileRegex,"String_Node_Str");
    assertUnOrdered(sc,filenameA,filenameB);
    fileRegex=tempPath + "String_Node_Str";
    sc=new ScannedPaths(fileRegex,"String_Node_Str");
    Assert.assertFalse(sc.iterator().hasNext(),"String_Node_Str");
  }
 catch (  Exception e) {
    Assert.fail("String_Node_Str" + e.getMessage());
  }
 finally {
    FileUtils.deleteQuietly(new File(tempPath));
  }
}
Program: 25268
Project: 25268
Buggy source:
@Override protected DateFormat initialValue(){
  DateFormat dateFormat=DateFormat.getDateTimeInstance(DateFormat.FULL,DateFormat.FULL);
  dateFormat.setTimeZone(TimeZone.getTimeZone("String_Node_Str"));
  return dateFormat;
}

Fixed version (ground truth):
@Override protected DateFormat initialValue(){
  DateFormat dateFormat=DateFormat.getDateTimeInstance(DateFormat.FULL,DateFormat.FULL,Locale.US);
  dateFormat.setTimeZone(TimeZone.getTimeZone("String_Node_Str"));
  return dateFormat;
}
Program: 25271
Project: 25271
Buggy source:
private String getFromString() throws SemanticException {
  StringBuilder fromBuilder=new StringBuilder();
  int aliasCount=1;
  Iterator<CandidateFact> iter=facts.iterator();
  while (iter.hasNext()) {
    CandidateFact fact=iter.next();
    FactHQLContext facthql=new FactHQLContext(fact,dimsToQuery,factDimMap.get(fact),query);
    fromBuilder.append("String_Node_Str");
    fromBuilder.append(facthql.toHQL());
    fromBuilder.append("String_Node_Str");
    fromBuilder.append("String_Node_Str" + aliasCount);
    aliasCount++;
    if (iter.hasNext()) {
      fromBuilder.append("String_Node_Str");
    }
  }
  fromBuilder.append("String_Node_Str");
  CandidateFact firstFact=facts.iterator().next();
  for (int i=2; i <= facts.size(); i++) {
    Iterator<Integer> dimIter=firstFact.getDimFieldIndices().iterator();
    while (dimIter.hasNext()) {
      String dim=query.getSelectAlias(dimIter.next());
      fromBuilder.append("String_Node_Str").append("String_Node_Str").append(dim).append("String_Node_Str").append("String_Node_Str").append(i).append("String_Node_Str").append(dim);
      if (dimIter.hasNext()) {
        fromBuilder.append("String_Node_Str");
      }
    }
    if (i != facts.size()) {
      fromBuilder.append("String_Node_Str");
    }
  }
  return fromBuilder.toString();
}

Fixed version (ground truth):
private String getFromString() throws SemanticException {
  StringBuilder fromBuilder=new StringBuilder();
  int aliasCount=1;
  Iterator<CandidateFact> iter=facts.iterator();
  while (iter.hasNext()) {
    CandidateFact fact=iter.next();
    FactHQLContext facthql=new FactHQLContext(fact,dimsToQuery,factDimMap.get(fact),query);
    fromBuilder.append("String_Node_Str");
    fromBuilder.append(facthql.toHQL());
    fromBuilder.append("String_Node_Str");
    fromBuilder.append("String_Node_Str" + aliasCount);
    aliasCount++;
    if (iter.hasNext()) {
      fromBuilder.append("String_Node_Str");
    }
  }
  CandidateFact firstFact=facts.iterator().next();
  if (!firstFact.getDimFieldIndices().isEmpty()) {
    fromBuilder.append("String_Node_Str");
  }
  for (int i=2; i <= facts.size(); i++) {
    Iterator<Integer> dimIter=firstFact.getDimFieldIndices().iterator();
    while (dimIter.hasNext()) {
      String dim=query.getSelectAlias(dimIter.next());
      fromBuilder.append("String_Node_Str").append("String_Node_Str").append(dim).append("String_Node_Str").append("String_Node_Str").append(i).append("String_Node_Str").append(dim);
      if (dimIter.hasNext()) {
        fromBuilder.append("String_Node_Str");
      }
    }
    if (i != facts.size()) {
      fromBuilder.append("String_Node_Str");
    }
  }
  return fromBuilder.toString();
}
Program: 25272
Project: 25272
Buggy source:
private String getSelectString() throws SemanticException {
  Map<Integer,Integer> selectToFactIndex=new HashMap<Integer,Integer>(query.getSelectAST().getChildCount());
  int fi=1;
  for (  CandidateFact fact : facts) {
    for (    int ind : fact.getSelectIndices()) {
      if (!selectToFactIndex.containsKey(ind)) {
        selectToFactIndex.put(ind,fi);
      }
    }
    fi++;
  }
  StringBuilder select=new StringBuilder();
  for (int i=0; i < query.getSelectAST().getChildCount(); i++) {
    if (selectToFactIndex.get(i) == null) {
      throw new SemanticException(ErrorMsg.EXPRESSION_NOT_IN_ANY_FACT,HQLParser.getString((ASTNode)query.getSelectAST().getChild(i)));
    }
    select.append("String_Node_Str").append(selectToFactIndex.get(i)).append("String_Node_Str").append(query.getSelectAlias(i)).append("String_Node_Str").append(query.getSelectFinalAlias(i));
    if (i != query.getSelectAST().getChildCount() - 1) {
      select.append("String_Node_Str");
    }
  }
  return select.toString();
}

Fixed version (ground truth):
private String getSelectString() throws SemanticException {
  Map<Integer,List<Integer>> selectToFactIndex=new HashMap<Integer,List<Integer>>(query.getSelectAST().getChildCount());
  int fi=1;
  for (  CandidateFact fact : facts) {
    for (    int ind : fact.getSelectIndices()) {
      if (!selectToFactIndex.containsKey(ind)) {
        selectToFactIndex.put(ind,Lists.<Integer>newArrayList());
      }
      selectToFactIndex.get(ind).add(fi);
    }
    fi++;
  }
  StringBuilder select=new StringBuilder();
  for (int i=0; i < query.getSelectAST().getChildCount(); i++) {
    if (selectToFactIndex.get(i) == null) {
      throw new SemanticException(ErrorMsg.EXPRESSION_NOT_IN_ANY_FACT,HQLParser.getString((ASTNode)query.getSelectAST().getChild(i)));
    }
    if (selectToFactIndex.get(i).size() == 1) {
      select.append("String_Node_Str").append(selectToFactIndex.get(i).get(0)).append("String_Node_Str").append(query.getSelectAlias(i)).append("String_Node_Str");
    }
 else {
      select.append("String_Node_Str");
      String sep="String_Node_Str";
      for (      Integer factIndex : selectToFactIndex.get(i)) {
        select.append(sep).append("String_Node_Str").append(factIndex).append("String_Node_Str").append(query.getSelectAlias(i));
        sep="String_Node_Str";
      }
      select.append("String_Node_Str");
    }
    select.append(query.getSelectFinalAlias(i));
    if (i != query.getSelectAST().getChildCount() - 1) {
      select.append("String_Node_Str");
    }
  }
  return select.toString();
}
Program: 25273
Project: 25273
Buggy source:
/** 
 * Adds the dim1 table.
 * @param tableName   the table name
 * @param specName    the spec name
 * @param storageName the storage name
 * @throws IOException
 */
public static synchronized void addDim1Table(String tableName,String specName,String storageName) throws IOException {
  LensDimensionTableCommands command=getCommand();
  String dimList=command.showDimensionTables(null);
  Assert.assertEquals(command.showDimensionTables("String_Node_Str"),dimList);
  TestLensStorageCommands.addLocalStorage(storageName);
  URL dimSpec=TestLensDimensionTableCommands.class.getClassLoader().getResource(specName);
  try {
    command.createDimensionTable(new File(dimSpec.toURI()).getAbsolutePath());
  }
 catch (  Exception e) {
    e.printStackTrace();
    Assert.fail("String_Node_Str" + e.getMessage());
  }
  dimList=command.showDimensionTables(null);
  Assert.assertEquals(command.showDimensionTables("String_Node_Str"),dimList);
  try {
    Assert.assertEquals(command.showDimensionTables("String_Node_Str"),dimList);
    Assert.fail();
  }
 catch (  NotFoundException e) {
  }
  try {
    Assert.assertEquals(command.showDimensionTables("String_Node_Str"),dimList);
    Assert.fail();
  }
 catch (  NotFoundException e) {
  }
  Assert.assertTrue(dimList.contains(tableName),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Adds the dim1 table.
 * @param tableName   the table name
 * @param specName    the spec name
 * @param storageName the storage name
 * @throws IOException
 */
public static synchronized void addDim1Table(String tableName,String specName,String storageName) throws IOException {
  LensDimensionTableCommands command=getCommand();
  String dimList=command.showDimensionTables(null);
  Assert.assertEquals(command.showDimensionTables("String_Node_Str"),dimList);
  TestLensStorageCommands.addLocalStorage(storageName);
  URL dimSpec=TestLensDimensionTableCommands.class.getClassLoader().getResource(specName);
  try {
    command.createDimensionTable(new File(dimSpec.toURI()).getAbsolutePath());
  }
 catch (  Exception e) {
    e.printStackTrace();
    Assert.fail("String_Node_Str" + e.getMessage());
  }
  dimList=command.showDimensionTables(null);
  Assert.assertEquals(command.showDimensionTables("String_Node_Str"),dimList);
  try {
    Assert.assertEquals(command.showDimensionTables("String_Node_Str"),dimList);
    Assert.fail();
  }
 catch (  NotFoundException e) {
    LOG.info("String_Node_Str",e);
  }
  try {
    Assert.assertEquals(command.showDimensionTables("String_Node_Str"),dimList);
    Assert.fail();
  }
 catch (  NotFoundException e) {
    LOG.info("String_Node_Str",e);
  }
  Assert.assertTrue(dimList.contains(tableName),"String_Node_Str");
}
Program: 25274
Project: 25274
Buggy source:
/** 
 * Adds the fact1 table.
 * @throws IOException
 */
public static void addFact1Table() throws IOException {
  LensFactCommands command=getCommand();
  String factList=command.showFacts(null);
  Assert.assertEquals(command.showFacts("String_Node_Str"),factList);
  Assert.assertEquals("String_Node_Str",factList,"String_Node_Str");
  TestLensStorageCommands.addLocalStorage(FACT_LOCAL);
  URL factSpec=TestLensFactCommands.class.getClassLoader().getResource("String_Node_Str");
  try {
    command.createFact(new File(factSpec.toURI()).getAbsolutePath());
  }
 catch (  Exception e) {
    Assert.fail("String_Node_Str" + e.getMessage());
  }
  factList=command.showFacts(null);
  Assert.assertEquals(command.showFacts("String_Node_Str"),factList);
  try {
    Assert.assertEquals(command.showFacts("String_Node_Str"),factList);
    Assert.fail();
  }
 catch (  NotFoundException e) {
  }
  try {
    Assert.assertEquals(command.showFacts("String_Node_Str"),factList);
    Assert.fail();
  }
 catch (  NotFoundException e) {
  }
  Assert.assertEquals("String_Node_Str",factList,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Adds the fact1 table.
 * @throws IOException
 */
public static void addFact1Table() throws IOException {
  LensFactCommands command=getCommand();
  String factList=command.showFacts(null);
  Assert.assertEquals(command.showFacts("String_Node_Str"),factList);
  Assert.assertEquals("String_Node_Str",factList,"String_Node_Str");
  TestLensStorageCommands.addLocalStorage(FACT_LOCAL);
  URL factSpec=TestLensFactCommands.class.getClassLoader().getResource("String_Node_Str");
  try {
    command.createFact(new File(factSpec.toURI()).getAbsolutePath());
  }
 catch (  Exception e) {
    Assert.fail("String_Node_Str" + e.getMessage());
  }
  factList=command.showFacts(null);
  Assert.assertEquals(command.showFacts("String_Node_Str"),factList);
  try {
    Assert.assertEquals(command.showFacts("String_Node_Str"),factList);
    Assert.fail();
  }
 catch (  NotFoundException e) {
    LOG.info("String_Node_Str",e);
  }
  try {
    Assert.assertEquals(command.showFacts("String_Node_Str"),factList);
    Assert.fail();
  }
 catch (  NotFoundException e) {
    LOG.info("String_Node_Str",e);
  }
  Assert.assertEquals("String_Node_Str",factList,"String_Node_Str");
}
Program: 25275
Project: 25275
Buggy source:
public static Properties getPropertiesObj(String filename){
  try {
    if (properties == null) {
      properties=new Properties();
      LOGGER.info("String_Node_Str" + filename);
      InputStream confStream=Util.class.getResourceAsStream("String_Node_Str" + filename);
      properties.load(confStream);
      confStream.close();
    }
    return properties;
  }
 catch (  IOException e) {
    LOGGER.info(e.getStackTrace());
  }
  return null;
}

Fixed version (ground truth):
public static synchronized Properties getPropertiesObj(String filename){
  try {
    if (properties == null) {
      properties=new Properties();
      LOGGER.info("String_Node_Str" + filename);
      InputStream confStream=Util.class.getResourceAsStream("String_Node_Str" + filename);
      properties.load(confStream);
      confStream.close();
    }
    return properties;
  }
 catch (  IOException e) {
    LOGGER.info(e.getStackTrace());
  }
  return null;
}
Program: 25276
Project: 25276
Buggy source:
public static void writeFile(String fileName,String str){
  try {
    PrintWriter out=new PrintWriter(new BufferedWriter(new FileWriter(fileName)));
    out.println(str);
    out.close();
  }
 catch (  IOException e) {
    LOGGER.info("String_Node_Str" + e);
  }
}

Fixed version (ground truth):
public static void writeFile(String fileName,String str){
  try {
    PrintWriter out=new PrintWriter(fileName,"String_Node_Str");
    out.println(str);
    out.close();
  }
 catch (  IOException e) {
    LOGGER.info("String_Node_Str" + e);
  }
}
Program: 25277
Project: 25277
Buggy source:
/** 
 * Get the max update period for the given range and available update periods
 * @param from
 * @param to
 * @param updatePeriods
 * @return
 */
public static UpdatePeriod maxIntervalInRange(Date from,Date to,Set<UpdatePeriod> updatePeriods){
  UpdatePeriod max=null;
  long diff=to.getTime() - from.getTime();
  if (diff < UpdatePeriod.MIN_INTERVAL) {
    return null;
  }
  UpdatePeriodComparator cmp=new UpdatePeriodComparator();
  for (  UpdatePeriod i : updatePeriods) {
    if (UpdatePeriod.YEARLY == i || UpdatePeriod.QUARTERLY == i || UpdatePeriod.MONTHLY == i || UpdatePeriod.WEEKLY == i) {
      int intervals=0;
switch (i) {
case YEARLY:
        intervals=DateUtil.getYearsBetween(from,to);
      break;
case QUARTERLY:
    intervals=DateUtil.getQuartersBetween(from,to);
  break;
case MONTHLY:
intervals=DateUtil.getMonthsBetween(from,to);
break;
case WEEKLY:
intervals=DateUtil.getWeeksBetween(from,to);
break;
}
if (intervals > 0) {
if (cmp.compare(i,max) > 0) {
max=i;
}
}
}
 else {
if (diff < i.weight()) {
continue;
}
if (cmp.compare(i,max) > 0) {
max=i;
}
}
}
return max;
}

Fixed version (ground truth):
/** 
 * Get the max update period for the given range and available update periods
 * @param from
 * @param to
 * @param updatePeriods
 * @return
 */
public static UpdatePeriod maxIntervalInRange(Date from,Date to,Set<UpdatePeriod> updatePeriods){
  UpdatePeriod max=null;
  long diff=to.getTime() - from.getTime();
  if (diff < UpdatePeriod.MIN_INTERVAL) {
    return null;
  }
  UpdatePeriodComparator cmp=new UpdatePeriodComparator();
  for (  UpdatePeriod i : updatePeriods) {
    if (UpdatePeriod.YEARLY == i || UpdatePeriod.QUARTERLY == i || UpdatePeriod.MONTHLY == i || UpdatePeriod.WEEKLY == i) {
      int intervals=DateUtil.getTimeDiff(from,to,i);
      if (intervals > 0) {
        if (cmp.compare(i,max) > 0) {
          max=i;
        }
      }
    }
 else {
      if (diff < i.weight()) {
        continue;
      }
      if (cmp.compare(i,max) > 0) {
        max=i;
      }
    }
  }
  return max;
}
Program: 25278
Project: 25278
Buggy source:
static long getTimeDiff(Date from,Date to,UpdatePeriod interval){
  long diff=to.getTime() - from.getTime();
switch (interval) {
case SECONDLY:
    return diff / 1000;
case MINUTELY:
  return diff / (1000 * 60);
case HOURLY:
return diff / (1000 * 60 * 60);
case DAILY:
return diff / (1000 * 60 * 60* 24);
case WEEKLY:
return getWeeksBetween(from,to);
case MONTHLY:
return getMonthsBetween(from,to);
case QUARTERLY:
return getQuartersBetween(from,to);
case YEARLY:
return getYearsBetween(from,to);
default :
return -1;
}
}

Fixed version (ground truth):
public static int getTimeDiff(Date fromDate,Date toDate,UpdatePeriod updatePeriod){
  return getCoveringInfo(fromDate,toDate,updatePeriod).getCountBetween();
}
Program: 25281
Project: 25281
Buggy source:
public Table getTable(String tableName) throws HiveException {
  Table tbl;
  try {
    tableName=tableName.trim().toLowerCase();
    tbl=allHiveTables.get(tableName);
    if (tbl == null) {
synchronized (allHiveTables) {
        if (!allHiveTables.containsKey(tableName)) {
          tbl=getClient().getTable(tableName);
          if (enableCaching) {
            allHiveTables.put(tableName,tbl);
          }
        }
      }
    }
  }
 catch (  HiveException e) {
    throw new HiveException("String_Node_Str" + tableName,e);
  }
  return tbl;
}

Fixed version (ground truth):
public Table getTable(String tableName) throws HiveException {
  Table tbl;
  try {
    tableName=tableName.trim().toLowerCase();
    tbl=allHiveTables.get(tableName);
    if (tbl == null) {
synchronized (allHiveTables) {
        if (!allHiveTables.containsKey(tableName)) {
          tbl=getClient().getTable(tableName);
          if (enableCaching) {
            allHiveTables.put(tableName,tbl);
          }
        }
 else {
          tbl=allHiveTables.get(tableName);
        }
      }
    }
  }
 catch (  HiveException e) {
    throw new HiveException("String_Node_Str" + tableName,e);
  }
  return tbl;
}
Program: 25282
Project: 25282
Buggy source:
/** 
 * Get   {@link Cube} object corresponding to the name
 * @param tableName The cube name
 * @return Returns cube is table name passed is a cube, null otherwise
 * @throws HiveException
 */
public CubeFactTable getCubeFact(String tableName) throws HiveException {
  tableName=tableName.trim().toLowerCase();
  CubeFactTable fact=allFactTables.get(tableName);
  if (fact == null) {
synchronized (allFactTables) {
      if (!allFactTables.containsKey(tableName)) {
        fact=getFactTable(tableName);
        if (enableCaching && fact != null) {
          allFactTables.put(tableName,fact);
        }
      }
    }
  }
  return fact;
}

Fixed version (ground truth):
/** 
 * Get   {@link Cube} object corresponding to the name
 * @param tableName The cube name
 * @return Returns cube is table name passed is a cube, null otherwise
 * @throws HiveException
 */
public CubeFactTable getCubeFact(String tableName) throws HiveException {
  tableName=tableName.trim().toLowerCase();
  CubeFactTable fact=allFactTables.get(tableName);
  if (fact == null) {
synchronized (allFactTables) {
      if (!allFactTables.containsKey(tableName)) {
        fact=getFactTable(tableName);
        if (enableCaching && fact != null) {
          allFactTables.put(tableName,fact);
        }
      }
 else {
        fact=allFactTables.get(tableName);
      }
    }
  }
  return fact;
}
Program: 25285
Project: 25285
Buggy source:
/** 
 * Adds the dim1 table.
 * @param tableName the table name
 * @param specName the spec name
 * @param storageSpecName the storage spec name
 * @param storageName the storage name
 */
public static void addDim1Table(String tableName,String specName,String storageSpecName,String storageName){
  LensDimensionTableCommands command=getCommand();
  String dimList=command.showDimensionTables();
  Assert.assertEquals("String_Node_Str",dimList,"String_Node_Str");
  TestLensStorageCommands.addLocalStorage(storageName);
  URL dimSpec=TestLensDimensionTableCommands.class.getClassLoader().getResource(specName);
  URL factStorageSpec=TestLensDimensionTableCommands.class.getClassLoader().getResource(storageSpecName);
  try {
    command.createDimensionTable(new File(dimSpec.toURI()).getAbsolutePath() + "String_Node_Str" + new File(factStorageSpec.toURI()).getAbsolutePath());
  }
 catch (  Exception e) {
    e.printStackTrace();
    Assert.fail("String_Node_Str" + e.getMessage());
  }
  dimList=command.showDimensionTables();
  Assert.assertEquals(tableName,dimList,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Adds the dim1 table.
 * @param tableName the table name
 * @param specName the spec name
 * @param storageSpecName the storage spec name
 * @param storageName the storage name
 */
public synchronized static void addDim1Table(String tableName,String specName,String storageSpecName,String storageName){
  LensDimensionTableCommands command=getCommand();
  String dimList=command.showDimensionTables();
  TestLensStorageCommands.addLocalStorage(storageName);
  URL dimSpec=TestLensDimensionTableCommands.class.getClassLoader().getResource(specName);
  URL factStorageSpec=TestLensDimensionTableCommands.class.getClassLoader().getResource(storageSpecName);
  try {
    command.createDimensionTable(new File(dimSpec.toURI()).getAbsolutePath() + "String_Node_Str" + new File(factStorageSpec.toURI()).getAbsolutePath());
  }
 catch (  Exception e) {
    e.printStackTrace();
    Assert.fail("String_Node_Str" + e.getMessage());
  }
  dimList=command.showDimensionTables();
  Assert.assertTrue(dimList.contains(tableName),"String_Node_Str");
}
Program: 25287
Project: 25287
Buggy source:
private XStorageTableElement createStorageTblElement(String storageName,String table,String... updatePeriod){
  XStorageTableElement tbl=cubeObjectFactory.createXStorageTableElement();
  tbl.setStorageName(storageName);
  if (updatePeriod != null) {
    for (    String p : updatePeriod) {
      tbl.getUpdatePeriods().add(p);
    }
  }
  tbl.setTableDesc(createStorageTableDesc(table));
  return tbl;
}

Fixed version (ground truth):
private XStorageTableElement createStorageTblElement(String storageName,String table,final String[] timePartColNames,String... updatePeriod){
  XStorageTableElement tbl=cubeObjectFactory.createXStorageTableElement();
  tbl.setStorageName(storageName);
  if (updatePeriod != null) {
    for (    String p : updatePeriod) {
      tbl.getUpdatePeriods().add(p);
    }
  }
  tbl.setTableDesc(createStorageTableDesc(table,timePartColNames));
  return tbl;
}
Program: 25288
Project: 25288
Buggy source:
private XStorageTableDesc createStorageTableDesc(String name){
  XStorageTableDesc xs1=cubeObjectFactory.createXStorageTableDesc();
  xs1.setCollectionDelimiter("String_Node_Str");
  xs1.setEscapeChar("String_Node_Str");
  xs1.setFieldDelimiter("String_Node_Str");
  xs1.setFieldDelimiter("String_Node_Str");
  xs1.setLineDelimiter("String_Node_Str");
  xs1.setMapKeyDelimiter("String_Node_Str");
  xs1.setTableLocation("String_Node_Str" + name);
  xs1.setExternal(true);
  Columns partCols=cubeObjectFactory.createColumns();
  Column dt=cubeObjectFactory.createColumn();
  dt.setName("String_Node_Str");
  dt.setType("String_Node_Str");
  dt.setComment("String_Node_Str");
  partCols.getColumns().add(dt);
  xs1.getTimePartCols().add("String_Node_Str");
  xs1.setPartCols(partCols);
  return xs1;
}

Fixed version (ground truth):
private XStorageTableDesc createStorageTableDesc(String name,final String[] timePartColNames){
  XStorageTableDesc xs1=cubeObjectFactory.createXStorageTableDesc();
  xs1.setCollectionDelimiter("String_Node_Str");
  xs1.setEscapeChar("String_Node_Str");
  xs1.setFieldDelimiter("String_Node_Str");
  xs1.setFieldDelimiter("String_Node_Str");
  xs1.setLineDelimiter("String_Node_Str");
  xs1.setMapKeyDelimiter("String_Node_Str");
  xs1.setTableLocation("String_Node_Str" + name);
  xs1.setExternal(true);
  Columns timePartCols=cubeObjectFactory.createColumns();
  for (  String timePartColName : timePartColNames) {
    Column partCol=cubeObjectFactory.createColumn();
    partCol.setName(timePartColName);
    partCol.setType("String_Node_Str");
    partCol.setComment("String_Node_Str");
    timePartCols.getColumns().add(partCol);
    xs1.getTimePartCols().add(timePartColName);
  }
  xs1.setPartCols(timePartCols);
  return xs1;
}
Program: 25289
Project: 25289
Buggy source:
private XPartition createPartition(String cubeTableName,Date partDate){
  XPartition xp=cubeObjectFactory.createXPartition();
  xp.setLocation("String_Node_Str");
  xp.setCubeTableName(cubeTableName);
  XTimePartSpec timeSpec=cubeObjectFactory.createXTimePartSpec();
  XTimePartSpecElement timePart=cubeObjectFactory.createXTimePartSpecElement();
  timePart.setKey("String_Node_Str");
  timePart.setValue(JAXBUtils.getXMLGregorianCalendar(partDate));
  timeSpec.getPartSpecElement().add(timePart);
  xp.setTimePartitionSpec(timeSpec);
  xp.setUpdatePeriod("String_Node_Str");
  return xp;
}

Fixed version (ground truth):
private XPartition createPartition(String cubeTableName,final List<XTimePartSpecElement> timePartSpecs){
  XPartition xp=cubeObjectFactory.createXPartition();
  xp.setLocation("String_Node_Str");
  xp.setCubeTableName(cubeTableName);
  XTimePartSpec timeSpec=cubeObjectFactory.createXTimePartSpec();
  for (  XTimePartSpecElement timePartSpec : timePartSpecs) {
    timeSpec.getPartSpecElement().add(timePartSpec);
  }
  xp.setTimePartitionSpec(timeSpec);
  xp.setUpdatePeriod("String_Node_Str");
  return xp;
}