Program: 166505
Project: 166505
Buggy source:
@Test public void testTransformSql() throws DDFException {
  ddf.setMutable(true);
  ddf=ddf.Transform.transformUDF("String_Node_Str");
  Assert.assertEquals(31,ddf.getNumRows());
  Assert.assertEquals(9,ddf.getNumColumns());
  Assert.assertEquals("String_Node_Str",ddf.getColumnName(8));
  Assert.assertEquals(9,ddf.VIEWS.head(1).get(0).split("String_Node_Str").length);
  ddf.Transform.transformUDF("String_Node_Str");
  Assert.assertEquals(31,ddf.getNumRows());
  Assert.assertEquals(10,ddf.getNumColumns());
  Assert.assertEquals(10,ddf.getSummary().length);
  List<String> cols=Lists.newArrayList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  ddf=ddf.Transform.transformUDF("String_Node_Str",cols);
  Assert.assertEquals(31,ddf.getNumRows());
  Assert.assertEquals(5,ddf.getNumColumns());
  Assert.assertEquals("String_Node_Str",ddf.getColumnName(4));
  ddf.setMutable(false);
  List<String> expressions=new ArrayList<String>();
  expressions.add("String_Node_Str");
  expressions.add("String_Node_Str");
  DDF ddf3=ddf.Transform.transformUDF(expressions,cols);
  Assert.assertEquals(31,ddf3.getNumRows());
  Assert.assertEquals(6,ddf3.getNumColumns());
  Assert.assertEquals("String_Node_Str",ddf3.getColumnName(5));
  Assert.assertEquals(6,ddf3.getSummary().length);
  List<String> lcols=Lists.newArrayList("String_Node_Str","String_Node_Str","String_Node_Str");
  String s0="String_Node_Str";
  List<String> s1=new ArrayList<String>();
  s1.add("String_Node_Str");
  s1.add("String_Node_Str");
  s1.add("String_Node_Str");
  String s2="String_Node_Str";
  String s3="String_Node_Str";
  Assert.assertEquals("String_Node_Str",TransformationHandler.RToSqlUdf(s1));
  Assert.assertEquals("String_Node_Str",TransformationHandler.RToSqlUdf(s2));
  Assert.assertEquals("String_Node_Str",TransformationHandler.RToSqlUdf(s3));
  DDF ddf2=ddf.Transform.transformUDF(s1,lcols);
  Assert.assertEquals(31,ddf2.getNumRows());
  Assert.assertEquals(6,ddf2.getNumColumns());
  Assert.assertEquals("String_Node_Str",TransformationHandler.RToSqlUdf("String_Node_Str"));
  Assert.assertEquals("String_Node_Str",TransformationHandler.RToSqlUdf("String_Node_Str"));
  Assert.assertEquals("String_Node_Str",TransformationHandler.RToSqlUdf("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testTransformSql() throws DDFException {
  ddf.setMutable(true);
  ddf=ddf.Transform.transformUDF("String_Node_Str");
  Assert.assertEquals(31,ddf.getNumRows());
  Assert.assertEquals(9,ddf.getNumColumns());
  Assert.assertEquals("String_Node_Str",ddf.getColumnName(8));
  Assert.assertEquals(9,ddf.VIEWS.head(1).get(0).split("String_Node_Str").length);
  ddf.Transform.transformUDF("String_Node_Str");
  Assert.assertEquals(31,ddf.getNumRows());
  Assert.assertEquals(10,ddf.getNumColumns());
  Assert.assertEquals(10,ddf.getSummary().length);
  List<String> cols=Lists.newArrayList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  ddf=ddf.Transform.transformUDF("String_Node_Str",cols);
  Assert.assertEquals(31,ddf.getNumRows());
  Assert.assertEquals(5,ddf.getNumColumns());
  Assert.assertEquals("String_Node_Str",ddf.getColumnName(4));
  ddf.setMutable(false);
  List<String> expressions=new ArrayList<String>();
  expressions.add("String_Node_Str");
  expressions.add("String_Node_Str");
  DDF ddf3=ddf.Transform.transformUDF(expressions,cols);
  Assert.assertEquals(31,ddf3.getNumRows());
  Assert.assertEquals(6,ddf3.getNumColumns());
  Assert.assertEquals("String_Node_Str",ddf3.getColumnName(5));
  Assert.assertEquals(6,ddf3.getSummary().length);
  List<String> lcols=Lists.newArrayList("String_Node_Str","String_Node_Str","String_Node_Str");
  String s0="String_Node_Str";
  List<String> s1=new ArrayList<String>();
  s1.add("String_Node_Str");
  s1.add("String_Node_Str");
  s1.add("String_Node_Str");
  String s2="String_Node_Str";
  String s3="String_Node_Str";
  System.out.println("String_Node_Str" + TransformationHandler.RToSqlUdf(s1));
  Assert.assertEquals("String_Node_Str",TransformationHandler.RToSqlUdf(s1));
  Assert.assertEquals("String_Node_Str",TransformationHandler.RToSqlUdf(s2));
  System.out.println("String_Node_Str" + TransformationHandler.RToSqlUdf(s3));
  Assert.assertEquals("String_Node_Str",TransformationHandler.RToSqlUdf(s3));
  DDF ddf2=ddf.Transform.transformUDF(s1,lcols);
  Assert.assertEquals(31,ddf2.getNumRows());
  Assert.assertEquals(6,ddf2.getNumColumns());
  Assert.assertEquals("String_Node_Str",TransformationHandler.RToSqlUdf("String_Node_Str"));
  Assert.assertEquals("String_Node_Str",TransformationHandler.RToSqlUdf("String_Node_Str"));
  Assert.assertEquals("String_Node_Str",TransformationHandler.RToSqlUdf("String_Node_Str"));
}