nus-yam/ex-repair huggingface dataset:
Program: 179703
Project: 179703
Buggy source:
@Test public void testUpdate() throws SQLException {
  String oldString=datamanager.getStringField(wrtable,"String_Node_Str","String_Node_Str");
  String testString="String_Node_Str" + (randomInt + 2);
  Map<String,Object> data=new HashMap<String,Object>();
  data.put("String_Node_Str",testString);
  datamanager.updateFields(data,wrtable,"String_Node_Str");
  assertEquals(testString,datamanager.getStringField(wrtable,"String_Node_Str","String_Node_Str"));
  datamanager.updateField(wrtable,"String_Node_Str",oldString,"String_Node_Str");
  assertEquals(oldString,datamanager.getStringField(wrtable,"String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testUpdate() throws SQLException {
  String oldString=datamanager.getStringField(wrtable,"String_Node_Str","String_Node_Str");
  String testString="String_Node_Str" + (randomInt + 2);
  Date oldDate=datamanager.getDateField(wrtable,"String_Node_Str","String_Node_Str");
  Map<String,Object> data=new HashMap<String,Object>();
  data.put("String_Node_Str",testString);
  data.put("String_Node_Str",null);
  datamanager.updateFields(data,wrtable,"String_Node_Str");
  assertEquals(testString,datamanager.getStringField(wrtable,"String_Node_Str","String_Node_Str"));
  assertNull(datamanager.getDateField(wrtable,"String_Node_Str","String_Node_Str"));
  datamanager.updateField(wrtable,"String_Node_Str",oldString,"String_Node_Str");
  datamanager.updateField(wrtable,"String_Node_Str",oldDate,"String_Node_Str");
  assertEquals(oldString,datamanager.getStringField(wrtable,"String_Node_Str","String_Node_Str"));
  assertEquals(oldDate,datamanager.getDateField(wrtable,"String_Node_Str","String_Node_Str"));
}
Program: 179704
Project: 179704
Buggy source:
@Test public void testInsert() throws SQLException {
  int prevId=datamanager.getLastID("String_Node_Str",wrtable);
  Map<String,Object> data=new HashMap<String,Object>();
  data.put("String_Node_Str","String_Node_Str" + randomInt);
  data.put("String_Node_Str",randomInt + 1);
  datamanager.insertFields(data,wrtable);
  int id=datamanager.getLastID("String_Node_Str",wrtable);
  assertTrue(id > prevId);
  assertEquals(randomInt + 1,datamanager.getIntegerField(wrtable,"String_Node_Str","String_Node_Str" + id + "String_Node_Str"));
  assertEquals("String_Node_Str" + randomInt,datamanager.getStringField(wrtable,"String_Node_Str","String_Node_Str" + id + "String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testInsert() throws SQLException {
  int prevId=datamanager.getLastID("String_Node_Str",wrtable);
  Date now=new Date();
  Map<String,Object> data=new HashMap<String,Object>();
  data.put("String_Node_Str","String_Node_Str" + randomInt);
  data.put("String_Node_Str",randomInt + 1);
  data.put("String_Node_Str",now);
  data.put("String_Node_Str",null);
  datamanager.insertFields(data,wrtable);
  int id=datamanager.getLastID("String_Node_Str",wrtable);
  assertTrue(id > prevId);
  assertEquals(randomInt + 1,datamanager.getIntegerField(wrtable,"String_Node_Str","String_Node_Str" + id + "String_Node_Str"));
  assertEquals("String_Node_Str" + randomInt,datamanager.getStringField(wrtable,"String_Node_Str","String_Node_Str" + id + "String_Node_Str"));
  assertEquals(now.getTime(),datamanager.getDateField(wrtable,"String_Node_Str","String_Node_Str" + id + "String_Node_Str").getTime());
  assertNull(datamanager.getBlobField(wrtable,"String_Node_Str","String_Node_Str" + id + "String_Node_Str"));
}
Program: 179705
Project: 179705
Buggy source:
@Override public InetAddress getInetAddress(){
  try {
    return InetAddress.getByName(toString());
  }
 catch (  UnknownHostException ignore) {
  }
  return null;
}

Fixed version (ground truth):
@Override public Inet6Address getInetAddress(){
  try {
    InetAddress address=InetAddress.getByAddress(getBytes());
    if (address instanceof Inet6Address) {
      return (Inet6Address)address;
    }
  }
 catch (  UnknownHostException ignore) {
  }
  return null;
}
Program: 179706
Project: 179706
Buggy source:
@Override public IPv4Address toIPv4(){
  if (this.data[0] == (short)0x2002 || this.data[0] == (short)0xfe80) {
    ByteBuffer buffer=ByteBuffer.allocate(4);
    buffer.putShort(this.data[6]).putShort(this.data[7]);
    return new IPv4Address(buffer.array());
  }
  return null;
}

Fixed version (ground truth):
@Override public IPv4Address toIPv4(){
  InetAddress inet=getInetAddress();
  if (inet.isLoopbackAddress()) {
    return new IPv4Address(127,0,0,1);
  }
 else   if (inet.isAnyLocalAddress()) {
    return new IPv4Address(0,0,0,0);
  }
 else   if (this.data[0] == (short)0x2002 || this.data[0] == (short)0xfe80) {
    ByteBuffer buffer=ByteBuffer.allocate(4);
    buffer.putShort(this.data[6]).putShort(this.data[7]);
    return new IPv4Address(buffer.array());
  }
  return null;
}
Program: 179707
Project: 179707
Buggy source:
public void debug(String line){
  if (isDebug()) {
    this.logger.info(this.prefix + "String_Node_Str" + line);
    toFile(Type.debug,line);
  }
}

Fixed version (ground truth):
public void debug(String line){
  if (isDebug()) {
    this.logger.info("String_Node_Str" + this.prefix + line);
    toFile(Type.debug,line);
  }
}
Program: 179708
Project: 179708
Buggy source:
public void connect(){
  if (this.url == null) {
    this.setURL();
  }
  if (this.con != null && this.isConnected()) {
    return;
  }
  try {
switch (this.datatype) {
case MYSQL:
      if (getClassLoader() != null) {
        getLogging().debug("String_Node_Str" + getClassLoader().toString());
        Class.forName("String_Node_Str",true,getClassLoader());
      }
 else {
        getLogging().debug("String_Node_Str");
        Class.forName("String_Node_Str");
      }
    this.con=DriverManager.getConnection(this.url,this.username,this.password);
  break;
case H2:
if (getClassLoader() != null) {
  getLogging().debug("String_Node_Str" + getClassLoader().toString());
  Class.forName("String_Node_Str",true,getClassLoader()).newInstance();
}
 else {
  getLogging().debug("String_Node_Str");
  Class.forName("String_Node_Str");
}
this.con=DriverManager.getConnection(this.url,this.username,this.password);
break;
}
if (getLogging().isDebug()) {
getLogging().debug("String_Node_Str");
Enumeration driverList=DriverManager.getDrivers();
int count=0;
while (driverList.hasMoreElements()) {
Driver driverClass=(Driver)driverList.nextElement();
getLogging().debug("String_Node_Str" + count + "String_Node_Str"+ driverClass.getClass().getName());
count++;
}
getLogging().debug("String_Node_Str" + count + "String_Node_Str");
}
}
 catch (ClassNotFoundException e) {
getLogging().stackTrace(e);
}
catch (SQLException e) {
getLogging().stackTrace(e);
}
catch (InstantiationException e) {
e.printStackTrace();
}
catch (IllegalAccessException e) {
e.printStackTrace();
}
}

Fixed version (ground truth):
public void connect(){
  if (this.url == null) {
    this.setURL();
  }
  if (this.con != null && this.isConnected()) {
    return;
  }
  try {
switch (this.datatype) {
case MYSQL:
      if (getClassLoader() != null) {
        getLogging().debug("String_Node_Str" + getClassLoader().toString());
        Class.forName("String_Node_Str",true,getClassLoader());
      }
 else {
        getLogging().debug("String_Node_Str");
        Class.forName("String_Node_Str");
      }
    outputDrivers();
  this.con=DriverManager.getConnection(this.url,this.username,this.password);
break;
case H2:
if (getClassLoader() != null) {
getLogging().debug("String_Node_Str" + getClassLoader().toString());
Class.forName("String_Node_Str",true,getClassLoader()).newInstance();
}
 else {
getLogging().debug("String_Node_Str");
Class.forName("String_Node_Str");
}
outputDrivers();
this.con=DriverManager.getConnection(this.url,this.username,this.password);
break;
}
}
 catch (ClassNotFoundException e) {
getLogging().stackTrace(e);
}
catch (SQLException e) {
getLogging().stackTrace(e);
}
catch (InstantiationException e) {
e.printStackTrace();
}
catch (IllegalAccessException e) {
e.printStackTrace();
}
}
Program: 179709
Project: 179709
Buggy source:
public void debug(String line){
  if (this.debug) {
    this.logger.info(this.prefix + "String_Node_Str" + line);
    toFile(Type.debug,line);
  }
}

Fixed version (ground truth):
public void debug(String line){
  if (isDebug()) {
    this.logger.info(this.prefix + "String_Node_Str" + line);
    toFile(Type.debug,line);
  }
}
Program: 179710
Project: 179710
Buggy source:
public void debug(String line){
  if (isDebug()) {
    this.logger.log(debugLevel,this.prefix + line);
    toFile(Type.debug,line);
  }
}

Fixed version (ground truth):
public void debug(String line){
  if (isDebug()) {
    this.logger.log(debugLevel,this.prefix + "String_Node_Str" + line);
    toFile(Type.debug,line);
  }
}
Program: 179711
Project: 179711
Buggy source:
private String updateFieldsString(HashMap<String,Object> data){
  String query="String_Node_Str", suffix="String_Node_Str";
  int i=1;
  Iterator<Entry<String,Object>> it=data.entrySet().iterator();
  while (it.hasNext()) {
    Map.Entry<String,Object> pairs=it.next();
    if (i == data.size()) {
      suffix="String_Node_Str";
    }
    query+="String_Node_Str" + pairs.getKey() + "String_Node_Str"+ String.valueOf(pairs.getValue()).replaceAll("String_Node_Str","String_Node_Str")+ "String_Node_Str"+ suffix;
    i++;
  }
  return query;
}

Fixed version (ground truth):
private String updateFieldsString(HashMap<String,Object> data){
  String query="String_Node_Str", suffix="String_Node_Str";
  int i=1;
  Iterator<Entry<String,Object>> it=data.entrySet().iterator();
  while (it.hasNext()) {
    Map.Entry<String,Object> pairs=it.next();
    if (i == data.size()) {
      suffix="String_Node_Str";
    }
    Object val=pairs.getValue();
    String valstr=null;
    if (val instanceof Date) {
      val=new Timestamp(((Date)val).getTime());
    }
    if (val == null) {
      valstr="String_Node_Str";
    }
 else {
      valstr="String_Node_Str" + val.toString().replaceAll("String_Node_Str","String_Node_Str") + "String_Node_Str";
    }
    query+="String_Node_Str" + pairs.getKey() + "String_Node_Str"+ valstr+ suffix;
    i++;
  }
  return query;
}
Program: 179712
Project: 179712
Buggy source:
/** 
 * Detect object type and serialize it.
 * @param value - object to serialize
 * @return value serialized to string, or value.toString serialized tostring if unknown type.
 */
public String serialize(Object value){
  if (value == null) {
    return "String_Node_Str";
  }
 else   if (value instanceof Integer) {
    return this.serialize(((Integer)value).intValue());
  }
 else   if (value instanceof Number) {
    return this.serialize(((Number)value).doubleValue());
  }
 else   if (value instanceof Boolean) {
    return this.serialize(((Boolean)value).booleanValue());
  }
 else   if (value instanceof List<?>) {
    return this.serialize(value);
  }
 else   if (value instanceof Map<?,?>) {
    return this.serialize(value);
  }
 else   if (value instanceof SerializedPhpParser.PhpObject) {
    return this.serialize((SerializedPhpParser.PhpObject)value);
  }
  return this.serialize(value.toString());
}

Fixed version (ground truth):
/** 
 * Detect object type and serialize it.
 * @param value - object to serialize
 * @return value serialized to string, or value.toString serialized tostring if unknown type.
 */
public String serialize(Object value){
  if (value == null) {
    return "String_Node_Str";
  }
 else   if (value instanceof Integer) {
    return this.serialize(((Integer)value).intValue());
  }
 else   if (value instanceof Number) {
    return this.serialize(((Number)value).doubleValue());
  }
 else   if (value instanceof Boolean) {
    return this.serialize(((Boolean)value).booleanValue());
  }
 else   if (value instanceof List<?>) {
    return this.serialize((List<?>)value);
  }
 else   if (value instanceof Map<?,?>) {
    return this.serialize((Map<?,?>)value);
  }
 else   if (value instanceof SerializedPhpParser.PhpObject) {
    return this.serialize((SerializedPhpParser.PhpObject)value);
  }
  return this.serialize(value.toString());
}
Program: 179713
Project: 179713
Buggy source:
public BigDecimal getDecimal(){
  try {
    if (this.sqltype == Types.DECIMAL) {
      return (BigDecimal)data;
    }
 else     if (getFieldType().equals(FieldType.BOOLEAN)) {
      return ((Boolean)data).booleanValue() ? BigDecimal.ONE : BigDecimal.ZERO;
    }
 else     if (getFieldType().equals(FieldType.STRING)) {
      return new BigDecimal(data.toString());
    }
 else     if (getFieldType().equals(FieldType.INTEGER) || getFieldType().equals(FieldType.REAL)) {
      return new BigDecimal(((Number)data).doubleValue());
    }
 else     if (getFieldType().equals(FieldType.DATE)) {
      return new BigDecimal(((Date)data).getTime());
    }
  }
 catch (  NumberFormatException e) {
  }
  return BigDecimal.ZERO;
}

Fixed version (ground truth):
public BigDecimal getDecimal(){
  try {
    if (data instanceof BigDecimal) {
      return (BigDecimal)data;
    }
 else     if (getFieldType().equals(FieldType.BOOLEAN)) {
      return ((Boolean)data).booleanValue() ? BigDecimal.ONE : BigDecimal.ZERO;
    }
 else     if (getFieldType().equals(FieldType.STRING)) {
      return new BigDecimal(data.toString());
    }
 else     if (getFieldType().equals(FieldType.INTEGER) || getFieldType().equals(FieldType.REAL)) {
      return new BigDecimal(((Number)data).doubleValue());
    }
 else     if (getFieldType().equals(FieldType.DATE)) {
      return new BigDecimal(((Date)data).getTime());
    }
  }
 catch (  NumberFormatException e) {
  }
  return null;
}
Program: 179714
Project: 179714
Buggy source:
public double getDouble(){
  if (getFieldType().equals(FieldType.INTEGER) || getFieldType().equals(FieldType.REAL)) {
    return ((Number)data).doubleValue();
  }
 else   if (getFieldType().equals(FieldType.BOOLEAN)) {
    return ((Boolean)data).booleanValue() ? 1 : 0;
  }
 else   if (getFieldType().equals(FieldType.DATE)) {
    return new Long(((Date)data).getTime()).doubleValue();
  }
 else   if (getFieldType().equals(FieldType.BINARY)) {
    byte[] bytes={0,0,0,0,0,0,0,0};
    System.arraycopy(data,0,bytes,0,((byte[])data).length);
    InputStream stream=new ByteArrayInputStream(bytes);
    try {
      return new DataInputStream(stream).readDouble();
    }
 catch (    IOException e) {
    }
  }
 else   if (getFieldType().equals(FieldType.STRING)) {
    try {
      return Double.parseDouble((String)data);
    }
 catch (    NumberFormatException e) {
    }
  }
  return 0;
}

Fixed version (ground truth):
public double getDouble(){
  if (getFieldType().equals(FieldType.INTEGER) || getFieldType().equals(FieldType.REAL)) {
    return ((Number)data).doubleValue();
  }
 else   if (getFieldType().equals(FieldType.BOOLEAN)) {
    return ((Boolean)data).booleanValue() ? 1 : 0;
  }
 else   if (getFieldType().equals(FieldType.DATE)) {
    return new Long(((Date)data).getTime()).doubleValue();
  }
 else   if (getFieldType().equals(FieldType.BINARY)) {
    byte[] bytes={0,0,0,0,0,0,0,0};
    if (((byte[])data).length >= 8) {
      System.arraycopy(data,0,bytes,0,8);
    }
 else {
      System.arraycopy(data,0,bytes,8 - ((byte[])data).length,((byte[])data).length);
    }
    return ByteBuffer.wrap(bytes).getLong();
  }
 else   if (getFieldType().equals(FieldType.STRING)) {
    try {
      return Double.parseDouble((String)data);
    }
 catch (    NumberFormatException e) {
    }
    try {
      return Long.parseLong(((String)data).replace(',','.'));
    }
 catch (    NumberFormatException e) {
    }
  }
  return 0;
}
Program: 179715
Project: 179715
Buggy source:
public String getString(){
  if (getFieldType().equals(FieldType.STRING)) {
    return (String)this.data;
  }
  return data.toString();
}

Fixed version (ground truth):
public String getString(){
  if (getFieldType().equals(FieldType.STRING)) {
    return (String)this.data;
  }
 else   if (getFieldType().equals(FieldType.BINARY) || getFieldType().equals(FieldType.BLOB)) {
    return new String(getBytes());
  }
  return data.toString();
}
Program: 179716
Project: 179716
Buggy source:
public BigInteger getBigInt(){
  try {
    if (this.sqltype == Types.BIGINT) {
      return (BigInteger)data;
    }
 else     if (getFieldType().equals(FieldType.BOOLEAN)) {
      return ((Boolean)data).booleanValue() ? BigInteger.ONE : BigInteger.ZERO;
    }
 else     if (getFieldType().equals(FieldType.BINARY)) {
      return new BigInteger((byte[])data);
    }
 else     if (getFieldType().equals(FieldType.STRING)) {
      return new BigInteger(data.toString());
    }
 else {
      long l=0;
      if (getFieldType().equals(FieldType.INTEGER) || getFieldType().equals(FieldType.REAL)) {
        l=((Number)data).longValue();
      }
 else       if (getFieldType().equals(FieldType.DATE)) {
        l=((Date)data).getTime();
      }
      return new BigInteger(String.valueOf(l));
    }
  }
 catch (  NumberFormatException e) {
  }
  return BigInteger.ZERO;
}

Fixed version (ground truth):
public BigInteger getBigInt(){
  try {
    if (data instanceof BigInteger) {
      return (BigInteger)data;
    }
 else     if (getFieldType().equals(FieldType.BOOLEAN)) {
      return ((Boolean)data).booleanValue() ? BigInteger.ONE : BigInteger.ZERO;
    }
 else     if (getFieldType().equals(FieldType.BINARY)) {
      return new BigInteger((byte[])data);
    }
 else     if (getFieldType().equals(FieldType.STRING)) {
      return new BigInteger(data.toString());
    }
 else {
      long l=0;
      if (getFieldType().equals(FieldType.INTEGER) || getFieldType().equals(FieldType.REAL)) {
        l=((Number)data).longValue();
      }
 else       if (getFieldType().equals(FieldType.DATE)) {
        l=((Date)data).getTime();
      }
      return new BigInteger(String.valueOf(l));
    }
  }
 catch (  NumberFormatException e) {
  }
  return null;
}
Program: 179717
Project: 179717
Buggy source:
public byte[] getBytes(){
  if (getFieldType().equals(FieldType.BINARY)) {
    return (byte[])data;
  }
 else   if (getFieldType().equals(FieldType.BLOB)) {
    try {
      return ((Blob)data).getBytes(0,(int)((Blob)data).length());
    }
 catch (    SQLException e) {
    }
  }
 else   if (getFieldType().equals(FieldType.BOOLEAN)) {
    return ByteBuffer.allocate(1).put((byte)(((Boolean)data).booleanValue() ? 1 : 0)).array();
  }
 else   if (getFieldType().equals(FieldType.INTEGER)) {
    return ByteBuffer.allocate(8).putLong(getLong()).array();
  }
 else   if (getFieldType().equals(FieldType.REAL)) {
    return ByteBuffer.allocate(8).putDouble(getDouble()).array();
  }
 else   if (getFieldType().equals(FieldType.STRING)) {
    return data.toString().getBytes();
  }
  return null;
}

Fixed version (ground truth):
public byte[] getBytes(){
  if (getFieldType().equals(FieldType.BINARY)) {
    return (byte[])data;
  }
 else   if (getFieldType().equals(FieldType.BLOB)) {
    try {
      return ((Blob)data).getBytes(1,(int)((Blob)data).length());
    }
 catch (    SQLException e) {
      e.getClass();
    }
  }
 else   if (getFieldType().equals(FieldType.BOOLEAN)) {
    return ByteBuffer.allocate(1).put((byte)(((Boolean)data).booleanValue() ? 1 : 0)).array();
  }
 else   if (getFieldType().equals(FieldType.INTEGER)) {
    return ByteBuffer.allocate(8).putLong(getLong()).array();
  }
 else   if (getFieldType().equals(FieldType.REAL)) {
    return ByteBuffer.allocate(8).putDouble(getDouble()).array();
  }
 else   if (getFieldType().equals(FieldType.STRING)) {
    return data.toString().getBytes();
  }
  return null;
}
Program: 179718
Project: 179718
Buggy source:
public DataField(int i,int columnType,String columnLabel,String table,int columnDisplaySize,Object data) throws SQLException {
  this.name=columnLabel;
  this.table=table;
  this.size=columnDisplaySize;
  this.data=data;
  if (data == null) {
    this.sqltype=Types.NULL;
  }
 else {
    this.sqltype=columnType;
  }
switch (sqltype) {
case Types.CHAR:
case Types.VARCHAR:
    this.ftype=FieldType.STRING;
  break;
case Types.BLOB:
case Types.LONGVARBINARY:
this.ftype=FieldType.BLOB;
break;
case Types.BIT:
if (size <= 1) {
this.ftype=FieldType.BOOLEAN;
break;
}
case Types.BINARY:
case Types.VARBINARY:
this.ftype=FieldType.BINARY;
break;
case Types.TINYINT:
if (size <= 1) {
this.ftype=FieldType.BOOLEAN;
break;
}
case Types.SMALLINT:
case Types.INTEGER:
case Types.BIGINT:
this.ftype=FieldType.INTEGER;
break;
case Types.FLOAT:
case Types.DOUBLE:
case Types.REAL:
case Types.DECIMAL:
this.ftype=FieldType.REAL;
break;
case Types.DATE:
case Types.TIMESTAMP:
case Types.TIME:
this.ftype=FieldType.DATE;
break;
case Types.NULL:
this.ftype=FieldType.NULL;
break;
default :
this.ftype=FieldType.UNKNOWN;
break;
}
}

Fixed version (ground truth):
public DataField(int i,ResultSet resultset) throws SQLException {
  ResultSetMetaData metaData=resultset.getMetaData();
  this.name=metaData.getCatalogName(i);
  this.table=metaData.getTableName(i);
  this.size=metaData.getColumnDisplaySize(i);
  this.data=resultset.getObject(i);
  if (data == null) {
    this.sqltype=Types.NULL;
  }
 else {
    this.sqltype=metaData.getColumnType(i);
  }
  this.unsigned=metaData.getColumnTypeName(i).contains("String_Node_Str");
switch (sqltype) {
case Types.CHAR:
case Types.VARCHAR:
case Types.LONGVARCHAR:
    this.ftype=FieldType.STRING;
  break;
case Types.BLOB:
case Types.LONGVARBINARY:
this.ftype=FieldType.BLOB;
break;
case Types.BIT:
if (size <= 1) {
this.ftype=FieldType.BOOLEAN;
break;
}
case Types.BINARY:
case Types.VARBINARY:
this.ftype=FieldType.BINARY;
break;
case Types.TINYINT:
if (size <= 1) {
this.ftype=FieldType.BOOLEAN;
break;
}
case Types.SMALLINT:
case Types.INTEGER:
case Types.BIGINT:
this.ftype=FieldType.INTEGER;
break;
case Types.FLOAT:
case Types.DOUBLE:
case Types.REAL:
case Types.DECIMAL:
this.ftype=FieldType.REAL;
break;
case Types.DATE:
case Types.TIMESTAMP:
case Types.TIME:
this.ftype=FieldType.DATE;
break;
case Types.NULL:
this.ftype=FieldType.NULL;
break;
default :
this.ftype=FieldType.UNKNOWN;
break;
}
}
Program: 179719
Project: 179719
Buggy source:
public Date getDate(){
  if (getFieldType().equals(FieldType.DATE)) {
    return (Date)this.data;
  }
 else   if (getFieldType().equals(FieldType.INTEGER)) {
    return new Date(((Number)data).longValue());
  }
 else   if (getFieldType().equals(FieldType.STRING)) {
    return new Date(data.toString());
  }
  return null;
}

Fixed version (ground truth):
public Date getDate(){
  if (getFieldType().equals(FieldType.DATE)) {
    return (Date)this.data;
  }
 else   if (getFieldType().equals(FieldType.INTEGER) || getFieldType().equals(FieldType.BINARY)) {
    return new Date(getLong());
  }
 else   if (getFieldType().equals(FieldType.STRING)) {
    try {
      return DateFormat.getDateInstance().parse((String)data);
    }
 catch (    ParseException e) {
    }
    try {
      return DateFormat.getDateTimeInstance().parse((String)data);
    }
 catch (    ParseException e) {
    }
    try {
      return DateFormat.getTimeInstance().parse((String)data);
    }
 catch (    ParseException e) {
    }
    try {
      return DateFormat.getInstance().parse((String)data);
    }
 catch (    ParseException e) {
    }
  }
  return null;
}
Program: 179720
Project: 179720
Buggy source:
public boolean getBool(){
  if (getFieldType().equals(FieldType.BOOLEAN)) {
    return (Boolean)data;
  }
 else   if (getFieldType().equals(FieldType.INTEGER) || getFieldType().equals(FieldType.REAL) || getFieldType().equals(FieldType.DATE)) {
    return getInt() != 0;
  }
 else   if (getFieldType().equals(FieldType.BINARY) || getFieldType().equals(FieldType.STRING)) {
    String s=getString();
    return (s != null) && !s.isEmpty();
  }
  return false;
}

Fixed version (ground truth):
public boolean getBool(){
  if (getFieldType().equals(FieldType.BOOLEAN)) {
    return (Boolean)data;
  }
 else   if (getFieldType().equals(FieldType.INTEGER) || getFieldType().equals(FieldType.REAL) || getFieldType().equals(FieldType.DATE)) {
    return getInt() != 0;
  }
 else   if (getFieldType().equals(FieldType.BINARY) || getFieldType().equals(FieldType.BLOB) || getFieldType().equals(FieldType.STRING)) {
    String s=getString();
    return (s != null) && !s.isEmpty();
  }
  return false;
}
Program: 179721
Project: 179721
Buggy source:
/** 
 * java.util.Date 포맷의 날짜 차이 레이블
 * @param d1
 * @param d2
 * @return
 */
public static String getTimeDiffLabel(Date d1,Date d2){
  long diff=d2.getTime() - d1.getTime();
  int sec=(int)(diff / 1000);
  if (sec < 5)   return getString("String_Node_Str");
  if (sec < 60)   return getString(sec,"String_Node_Str");
  int min=(int)(sec / 60);
  if (min < 60)   return getString(min,"String_Node_Str");
  int hour=(int)(min / 60);
  if (hour < 24)   return getString(hour,"String_Node_Str");
  Calendar c1=Calendar.getInstance();
  Calendar c2=(Calendar)c1.clone();
  c1.setTime(d1);
  c2.setTime(d2);
  int day=c2.get(Calendar.DATE) - c1.get(Calendar.DATE);
  if (day < 0) {
    day=hour / 24;
  }
  if (hour / 24 < 30) {
    if (day == 1)     return getString("String_Node_Str");
    if (day == 2)     return getString("String_Node_Str");
    return getString(day,"String_Node_Str");
  }
  int month=hour / 24 / 30;
  if (month == 1)   return getString("String_Node_Str");
  if (month == 2)   return getString("String_Node_Str");
  if (month < 12)   return getString(month,"String_Node_Str");
  int year=month / 12;
  if (year == 1)   return getString("String_Node_Str");
  return getString(year,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * java.util.Date 포맷의 날짜 차이 레이블
 * @param d1
 * @param d2
 * @return
 */
public static String getTimeDiffLabel(Date d1,Date d2){
  long diff=d2.getTime() - d1.getTime();
  int sec=(int)(diff / 1000);
  if (sec < 5)   return getString("String_Node_Str");
  if (sec < 60)   return getString(sec,"String_Node_Str");
  int min=(int)(sec / 60);
  if (min < 60)   return getString(min,"String_Node_Str");
  int hour=(int)(min / 60);
  if (hour < 24)   return getString(hour,"String_Node_Str");
  Calendar c1=Calendar.getInstance();
  Calendar c2=(Calendar)c1.clone();
  c1.setTime(d1);
  c2.setTime(d2);
  int day=c2.get(Calendar.DATE) - c1.get(Calendar.DATE);
  if (day <= 0) {
    day=hour / 24;
  }
  if (hour / 24 < 30) {
    if (day == 1)     return getString("String_Node_Str");
    if (day == 2)     return getString("String_Node_Str");
    return getString(day,"String_Node_Str");
  }
  int month=hour / 24 / 30;
  if (month == 1)   return getString("String_Node_Str");
  if (month == 2)   return getString("String_Node_Str");
  if (month < 12)   return getString(month,"String_Node_Str");
  int year=month / 12;
  if (year == 1)   return getString("String_Node_Str");
  return getString(year,"String_Node_Str");
}
Program: 179722
Project: 179722
Buggy source:
private boolean onBegin(){
  if (inProcess) {
    receiveRequested=true;
    return false;
  }
  inProcess=true;
  receiveRequested=false;
  return true;
}

Fixed version (ground truth):
private boolean onBegin(boolean update_when_possible){
  if (inProcess) {
    receiveRequested=update_when_possible;
    return false;
  }
  pb.holdCurrent();
  inProcess=true;
  receiveRequested=false;
  return true;
}
Program: 179723
Project: 179723
Buggy source:
private void queryInit(final ComplexPanelI base){
  Log.trace("String_Node_Str");
  onBegin();
  greetingService.getInitialContent(pb.getCurrent(),new AsyncCallback<DiffPatcher>(){
    @Override public void onSuccess(    DiffPatcher result){
      root=result.createNew(0);
      base.add(root);
      requestSucceeded(result,pb.getCurrent().getId());
    }
    @Override public void onFailure(    Throwable caught){
      requestFailed(caught,"String_Node_Str" + pb.getCurrent().getId());
    }
  }
);
  Log.trace("String_Node_Str" + pb.getCurrent().getId() + "String_Node_Str");
}

Fixed version (ground truth):
public void queryInit(final IStreak base){
  Log.debug("String_Node_Str" + base.getId());
  final Parameters param=pb.getCurrent();
  param.setId(base.getId());
  if (!onBegin(true))   return;
  greetingService.getInitialContent(param,new AsyncCallback<DiffPatcher>(){
    @Override public void onSuccess(    DiffPatcher result){
      base.alterContent(result.createNew(param.getId()));
      if (param.getId().equals(0))       root=base.getContent();
      requestSucceeded(result,pb.getCurrent().getId());
    }
    @Override public void onFailure(    Throwable caught){
      requestFailed(caught,"String_Node_Str" + pb.getCurrent().getId());
    }
  }
);
  Log.debug("String_Node_Str" + pb.getCurrent().getId() + "String_Node_Str");
}
Program: 179724
Project: 179724
Buggy source:
public void init(ComplexPanel base){
  inProcess=false;
  receiveRequested=false;
  ParamsUrl.getInstance().getFromHistory(pb.getCurrent());
  IVerticalPanel container=new IVerticalPanel(0);
  base.add(container);
  base.add(new HTML("String_Node_Str"));
  diff=new VerticalPanel();
  diff.setStylePrimaryName("String_Node_Str");
  base.add(diff);
  queryInit(container);
}

Fixed version (ground truth):
public void init(ComplexPanel base){
  inProcess=false;
  receiveRequested=false;
  ParamsUrl.getInstance().getFromHistory(pb.getCurrent());
  IStreak container=new IStreak(new IVoid(0));
  base.add(container);
  base.add(new HTML("String_Node_Str"));
  diff=new VerticalPanel();
  diff.setStylePrimaryName("String_Node_Str");
  base.add(diff);
  queryInit(container);
}
Program: 179725
Project: 179725
Buggy source:
private void requestSucceeded(DiffPatcher result,Integer id){
  diff.clear();
  if (null != result)   diff.add(new HTML(result.toString()));
 else   diff.add(new HTML("String_Node_Str"));
  Log.debug("String_Node_Str" + id + "String_Node_Str");
  pb.requestSucceeded();
  onEnd();
}

Fixed version (ground truth):
private void requestSucceeded(DiffPatcher result,Integer id){
  diff.clear();
  if (null != result)   diff.add(new HTML(result.toString()));
 else   diff.add(new HTML("String_Node_Str"));
  pb.requestSucceeded();
  onEnd();
}
Program: 179726
Project: 179726
Buggy source:
public void queryPage(){
  Log.trace("String_Node_Str");
  if (onBegin())   return;
  final Parameters param=pb.getCurrent();
  greetingService.getDifference(param,pb.getPrev(),new AsyncCallback<DiffPatcher>(){
    @Override public void onSuccess(    DiffPatcher result){
      if (null == result) {
        requestSucceeded(result,param.getId());
        return;
      }
      result.applay(root);
      requestSucceeded(result,param.getId());
    }
    @Override public void onFailure(    Throwable caught){
      requestFailed(caught,param.getVal("String_Node_Str") + "String_Node_Str" + param.getId());
    }
  }
);
  Log.trace("String_Node_Str" + param.getVal("String_Node_Str") + "String_Node_Str");
}

Fixed version (ground truth):
public void queryPage(){
  final Parameters param=pb.getCurrent();
  param.setId(0);
  Log.debug("String_Node_Str" + param.toString());
  if (!onBegin(true))   return;
  greetingService.getDifference(param,pb.getPrev(),new AsyncCallback<DiffPatcher>(){
    @Override public void onSuccess(    DiffPatcher result){
      if (null != result)       result.applay(root);
      requestSucceeded(result,param.getId());
    }
    @Override public void onFailure(    Throwable caught){
      requestFailed(caught,param.getVal("String_Node_Str") + "String_Node_Str" + param.getId());
    }
  }
);
  Log.debug("String_Node_Str" + param.getVal("String_Node_Str") + "String_Node_Str");
}
Program: 179727
Project: 179727
Buggy source:
@Override public void onSuccess(DiffPatcher result){
  root=result.createNew(0);
  base.add(root);
  requestSucceeded(result,pb.getCurrent().getId());
}

Fixed version (ground truth):
@Override public void onSuccess(DiffPatcher result){
  base.alterContent(result.createNew(param.getId()));
  if (param.getId().equals(0))   root=base.getContent();
  requestSucceeded(result,pb.getCurrent().getId());
}
Program: 179728
Project: 179728
Buggy source:
public void requestSucceeded(){
  ParamsUrl.getInstance().putIntoHistory(current);
  last=current.copy();
}

Fixed version (ground truth):
public void requestSucceeded(){
  Log.debug("String_Node_Str" + sent);
  ParamsUrl.getInstance().putIntoHistory(sent);
  last=sent.copy();
}
Program: 179729
Project: 179729
Buggy source:
@Override public void add(IWidget w){
  ((ComplexPanel)getWidget()).add(w);
}

Fixed version (ground truth):
@Override public void add(IWidget w){
  ((ComplexPanel)getWidget()).add(new IStreak(w));
}
Program: 179730
Project: 179730
Buggy source:
@Override public abstract void insert(IWidget w,int beforeIndex);

Fixed version (ground truth):
@Override public final void insert(IWidget w,int beforeIndex){
  insertInt(new IStreak(w),beforeIndex);
}
Program: 179731
Project: 179731
Buggy source:
public void alterContent(IWidget w){
  if (!w.getId().equals(getId()))   throw new RuntimeException("String_Node_Str");
  ((SimplePanel)getWidget()).clear();
  ((SimplePanel)getWidget()).add(w);
}

Fixed version (ground truth):
public final void alterContent(IWidget w){
  if (!w.getId().equals(getId()))   throw new RuntimeException("String_Node_Str");
  ((SimplePanel)getWidget()).clear();
  ((SimplePanel)getWidget()).add(w);
}
Program: 179732
Project: 179732
Buggy source:
@Override public void onKeyUp(KeyUpEvent event){
  ParamsBuilder.getCurrent().setVal(targetName,((TextBox)getWidget()).getText());
  if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER)   ElementReceiver.get().queryPage();
}

Fixed version (ground truth):
@Override public void onKeyUp(KeyUpEvent event){
  ParamsBuilder.getCurrent().setVal(targetName,((TextBox)getWidget()).getText());
  ElementReceiver.get().queryPage();
}
Program: 179733
Project: 179733
Buggy source:
private void queryInit(final ComplexPanel base){
  greetingService.getInitialContent(pb.getCurrent(),new AsyncCallback<DiffPatcher>(){
    @Override public void onSuccess(    DiffPatcher result){
      root=result.createNew(0);
      base.add(root);
      base.add(new HTML("String_Node_Str"));
      diff=new VerticalPanel();
      diff.setStylePrimaryName("String_Node_Str");
      base.add(diff);
      diff.clear();
      diff.add(new HTML(result.toString()));
      pb.requestSucceeded();
    }
    @Override public void onFailure(    Throwable caught){
      base.add(new HTML("String_Node_Str" + "String_Node_Str" + caught.getMessage()));
    }
  }
);
}

Fixed version (ground truth):
private void queryInit(final ComplexPanel base){
  onBegin();
  greetingService.getInitialContent(pb.getCurrent(),new AsyncCallback<DiffPatcher>(){
    @Override public void onSuccess(    DiffPatcher result){
      root=result.createNew(0);
      base.add(root);
      logp=new VerticalPanel();
      logp.setStylePrimaryName("String_Node_Str");
      base.add(logp);
      base.add(new HTML("String_Node_Str"));
      diff=new VerticalPanel();
      diff.setStylePrimaryName("String_Node_Str");
      base.add(diff);
      diff.clear();
      diff.add(new HTML(result.toString()));
      requestSucceeded();
    }
    @Override public void onFailure(    Throwable caught){
      requestFailed("String_Node_Str" + "String_Node_Str" + caught.getMessage() + "String_Node_Str");
    }
  }
);
}
Program: 179734
Project: 179734
Buggy source:
public void init(ComplexPanel base){
  ParamsUrl.getInstance().getFromHistory(pb.getCurrent());
  queryInit(base);
}

Fixed version (ground truth):
public void init(ComplexPanel base){
  inProcess=false;
  receiveRequested=false;
  ParamsUrl.getInstance().getFromHistory(pb.getCurrent());
  queryInit(base);
}
Program: 179735
Project: 179735
Buggy source:
@Override public void onFailure(Throwable caught){
  base.add(new HTML("String_Node_Str" + "String_Node_Str" + caught.getMessage()));
}

Fixed version (ground truth):
@Override public void onFailure(Throwable caught){
  requestFailed("String_Node_Str" + "String_Node_Str" + caught.getMessage() + "String_Node_Str");
}
Program: 179736
Project: 179736
Buggy source:
@Override public void onSuccess(DiffPatcher result){
  root=result.createNew(0);
  base.add(root);
  base.add(new HTML("String_Node_Str"));
  diff=new VerticalPanel();
  diff.setStylePrimaryName("String_Node_Str");
  base.add(diff);
  diff.clear();
  diff.add(new HTML(result.toString()));
  pb.requestSucceeded();
}

Fixed version (ground truth):
@Override public void onSuccess(DiffPatcher result){
  root=result.createNew(0);
  base.add(root);
  logp=new VerticalPanel();
  logp.setStylePrimaryName("String_Node_Str");
  base.add(logp);
  base.add(new HTML("String_Node_Str"));
  diff=new VerticalPanel();
  diff.setStylePrimaryName("String_Node_Str");
  base.add(diff);
  diff.clear();
  diff.add(new HTML(result.toString()));
  requestSucceeded();
}
Program: 179737
Project: 179737
Buggy source:
@Override public void onModuleLoad(){
  RootPanel.get().clear();
  ParamsBuilder.getCurrent().setId(0);
  ElementReceiver.get().init(RootPanel.get());
  Label lb=new Label("String_Node_Str");
  RootPanel.get().add(lb);
}

Fixed version (ground truth):
@Override public void onModuleLoad(){
  RootPanel.get().clear();
  ParamsBuilder.getCurrent().setId(0);
  ElementReceiver.get().init(RootPanel.get());
}
Program: 179738
Project: 179738
Buggy source:
public abstract DiffPatcher getDifference(Parameters p,Parameters prevP);

Fixed version (ground truth):
public abstract DiffPatcher getDifference(Parameters p,Parameters prevP) throws IllegalArgumentException, ServerException ;
Program: 179739
Project: 179739
Buggy source:
public abstract DiffPatcher getInitialContent(Parameters p);

Fixed version (ground truth):
public abstract DiffPatcher getInitialContent(Parameters p) throws IllegalArgumentException, ServerException ;
Program: 179740
Project: 179740
Buggy source:
@Override public void onClick(ClickEvent event){
  ElementReceiver.get().queryElement();
}

Fixed version (ground truth):
@Override public void onClick(ClickEvent event){
  ElementReceiver.get().queryPage();
}
Program: 179741
Project: 179741
Buggy source:
public IBasicButton(Integer id,String label){
  super(id,new Button(label));
  ((Button)getWidget()).addClickHandler(new ClickHandler(){
    @Override public void onClick(    ClickEvent event){
      ElementReceiver.get().queryElement();
    }
  }
);
}

Fixed version (ground truth):
public IBasicButton(Integer id,String label){
  super(id,new Button(label));
  ((Button)getWidget()).addClickHandler(new ClickHandler(){
    @Override public void onClick(    ClickEvent event){
      ElementReceiver.get().queryPage();
    }
  }
);
}
Program: 179742
Project: 179742
Buggy source:
public void setNewUrl(final String nUrl){
  url.setText("String_Node_Str" + nUrl);
  final SoundManager sm=SoundManager.getInstance();
  if (snd_playing) {
    sm.stop(SOUND_ID);
    sm.destroySound(SOUND_ID);
    snd_playing=false;
  }
  sm.createSound(SOUND_ID,nUrl);
  sm.play(SOUND_ID);
}

Fixed version (ground truth):
public void setNewUrl(final String nUrl){
  url.setText("String_Node_Str" + nUrl);
  final SoundManager sm=SoundManager.getInstance();
  if (snd_playing) {
    sm.stop(SOUND_ID);
    sm.destroySound(SOUND_ID);
    snd_playing=false;
  }
  sm.createSound(SOUND_ID,URL.encode(nUrl));
  sm.play(SOUND_ID);
}
Program: 179743
Project: 179743
Buggy source:
@Override public void onSelection(final SelectionEvent<Integer> event){
  if (!queryAllowed)   return;
  final IStreak sp=(IStreak)ITabPanel.this.tp.getWidget(event.getSelectedItem());
  ParamsBuilder.getCurrent().setId(sp.getId());
  ElementReceiver.get().queryElement();
}

Fixed version (ground truth):
@Override public void onSelection(final SelectionEvent<Integer> event){
  if (!queryAllowed)   return;
  final IStreak sp=(IStreak)ITabPanel.this.tp.getWidget(event.getSelectedItem());
  ParamsBuilder.getCurrent().setId(sp.getId());
  ElementReceiver.get().queryPage();
}
Program: 179744
Project: 179744
Buggy source:
@Override public void onKeyUp(KeyUpEvent event){
  ParamsBuilder.getCurrent().setVal("String_Node_Str",((TextBox)getWidget()).getText());
  if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER)   ElementReceiver.get().queryElement();
}

Fixed version (ground truth):
@Override public void onKeyUp(KeyUpEvent event){
  ParamsBuilder.getCurrent().setVal(targetName,((TextBox)getWidget()).getText());
  if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER)   ElementReceiver.get().queryPage();
}
Program: 179745
Project: 179745
Buggy source:
public ITextBox(Integer id,String text){
  super(id,new TextBox());
  setText(text);
  ((TextBox)getWidget()).addKeyUpHandler(new KeyUpHandler(){
    @Override public void onKeyUp(    KeyUpEvent event){
      ParamsBuilder.getCurrent().setVal("String_Node_Str",((TextBox)getWidget()).getText());
      if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER)       ElementReceiver.get().queryElement();
    }
  }
);
}

Fixed version (ground truth):
public ITextBox(Integer id,final String name,String text){
  super(id,new TextBox());
  setText(text);
  myHandler=new OnKeyUp(name);
  ((TextBox)getWidget()).addKeyUpHandler(myHandler);
}
Program: 179746
Project: 179746
Buggy source:
final public void setText(String nStr){
  ((TextBox)getWidget()).setText(nStr);
}

Fixed version (ground truth):
final private void setText(String nStr){
  ((TextBox)getWidget()).setText(nStr);
}
Program: 179747
Project: 179747
Buggy source:
public ITextCellList(final Integer id,final String name){
  super(id,new VerticalPanel());
  panel=(VerticalPanel)getWidget();
  backB=new Button("String_Node_Str");
  list=new CellList(new ICell());
  nextB=new Button("String_Node_Str");
  panel.add(backB);
  panel.add(list);
  panel.add(nextB);
  this.name=name;
  ListDataProvider<IText> ldp=new ListDataProvider<IText>();
  items=ldp.getList();
  ldp.addDataDisplay(list);
  ssm=new SingleSelectionModel<IText>();
  list.setSelectionModel(ssm);
  ssm.addSelectionChangeHandler(new SelectionChangeEvent.Handler(){
    @Override public void onSelectionChange(    SelectionChangeEvent event){
      if (!reactToSelChange)       return;
      ParamsBuilder.getCurrent().setVal(name,ssm.getSelectedObject().getId().toString());
      ElementReceiver.get().queryElement();
    }
  }
);
  nextB.addClickHandler(new ClickHandler(){
    @Override public void onClick(    ClickEvent event){
      setStart(getStart() + list.getRowCount());
      ElementReceiver.get().queryElement();
    }
  }
);
  backB.addClickHandler(new ClickHandler(){
    @Override public void onClick(    ClickEvent event){
      Integer start=getStart() - MAXIMUM_ITEMS;
      if (start < 0)       start=0;
      setStart(start);
      ElementReceiver.get().queryElement();
    }
  }
);
}

Fixed version (ground truth):
public ITextCellList(final Integer id,final String name){
  super(id,new VerticalPanel());
  panel=(VerticalPanel)getWidget();
  batPanel=new FlowPanel();
  backB=new Button("String_Node_Str");
  list=new CellList(new ICell());
  nextB=new Button("String_Node_Str");
  panel.add(batPanel);
  batPanel.add(backB);
  panel.add(batPanel);
  panel.add(list);
  panel.add(nextB);
  this.name=name;
  ListDataProvider<IText> ldp=new ListDataProvider<IText>();
  items=ldp.getList();
  ldp.addDataDisplay(list);
  ssm=new SingleSelectionModel<IText>();
  list.setSelectionModel(ssm);
  ssm.addSelectionChangeHandler(new SelectionChangeEvent.Handler(){
    @Override public void onSelectionChange(    SelectionChangeEvent event){
      if (!reactToSelChange)       return;
      ParamsBuilder.getCurrent().setVal(name,ssm.getSelectedObject().getId().toString());
      ElementReceiver.get().queryPage();
    }
  }
);
  nextB.addClickHandler(new ClickHandler(){
    @Override public void onClick(    ClickEvent event){
      setStart(getStart() + list.getRowCount());
      ElementReceiver.get().queryPage();
    }
  }
);
  backB.addClickHandler(new ClickHandler(){
    @Override public void onClick(    ClickEvent event){
      Integer start=getStart() - MAXIMUM_ITEMS;
      if (start < 0)       start=0;
      setStart(start);
      ElementReceiver.get().queryPage();
    }
  }
);
}
Program: 179748
Project: 179748
Buggy source:
@Override public void onClick(ClickEvent event){
  Integer start=getStart() - MAXIMUM_ITEMS;
  if (start < 0)   start=0;
  setStart(start);
  ElementReceiver.get().queryElement();
}

Fixed version (ground truth):
@Override public void onClick(ClickEvent event){
  Integer start=getStart() - MAXIMUM_ITEMS;
  if (start < 0)   start=0;
  setStart(start);
  ElementReceiver.get().queryPage();
}
Program: 179749
Project: 179749
Buggy source:
@Override public void onSelectionChange(SelectionChangeEvent event){
  if (!reactToSelChange)   return;
  ParamsBuilder.getCurrent().setVal(name,ssm.getSelectedObject().getId().toString());
  ElementReceiver.get().queryElement();
}

Fixed version (ground truth):
@Override public void onSelectionChange(SelectionChangeEvent event){
  if (!reactToSelChange)   return;
  ParamsBuilder.getCurrent().setVal(name,ssm.getSelectedObject().getId().toString());
  ElementReceiver.get().queryPage();
}
Program: 179750
Project: 179750
Buggy source:
public void startTransaction(){
  finishTransaction();
  emf=Persistence.createEntityManagerFactory("String_Node_Str");
  em=emf.createEntityManager();
  em.getTransaction().begin();
}

Fixed version (ground truth):
public void startTransaction(){
  finishTransaction();
  if (null == emf)   emf=Persistence.createEntityManagerFactory("String_Node_Str");
  if (null == em)   em=emf.createEntityManager();
  em.getTransaction().begin();
}
Program: 179751
Project: 179751
Buggy source:
public void finishTransaction(){
  if (null != em) {
    em.getTransaction().commit();
    em.close();
  }
  em=null;
}

Fixed version (ground truth):
public void finishTransaction(){
  if (null != em && em.getTransaction().isActive()) {
    em.getTransaction().rollback();
    em.close();
  }
  em=null;
}
Program: 179752
Project: 179752
Buggy source:
@Override public DiffPatcher getDifference(Parameters p,Parameters prevP){
  WContent content=gen.createContentBranch(p);
  WContent prev=gen.createContentBranch(prevP);
  DiffPatcher ret=content.getDifference(prev,true);
  return ret;
}

Fixed version (ground truth):
@Override public DiffPatcher getDifference(Parameters p,Parameters prevP) throws IllegalArgumentException, ServerException {
  WContent content=gen.createContentBranch(p);
  WContent prev=gen.createContentBranch(prevP);
  DiffPatcher ret=content.getDifference(prev,true);
  return ret;
}
Program: 179753
Project: 179753
Buggy source:
@Override public DiffPatcher getInitialContent(Parameters p){
  return gen.createContentBranch(p).getAllContent();
}

Fixed version (ground truth):
@Override public DiffPatcher getInitialContent(Parameters p) throws IllegalArgumentException, ServerException {
  return gen.createContentBranch(p).getAllContent();
}
Program: 179754
Project: 179754
Buggy source:
public static void main(String[] args) throws SmbException, IOException {
  LogManager.getLogManager().readConfiguration();
  LocalParser musicController=new LocalParser();
  musicController.parse("String_Node_Str");
  musicController.close();
}

Fixed version (ground truth):
public static void main(String[] args) throws SmbException, IOException {
  LogManager.getLogManager().readConfiguration();
  LocalParser musicController=new LocalParser();
  musicController.parse("String_Node_Str","String_Node_Str");
  musicController.parse("String_Node_Str","String_Node_Str");
  musicController.parse("String_Node_Str","String_Node_Str");
  musicController.parse("String_Node_Str","String_Node_Str");
  musicController.parse("String_Node_Str","String_Node_Str");
  musicController.parse("String_Node_Str","String_Node_Str");
  musicController.parse("String_Node_Str","String_Node_Str");
  musicController.parse("String_Node_Str","String_Node_Str");
  musicController.parse("String_Node_Str","String_Node_Str");
  musicController.parse("String_Node_Str","String_Node_Str");
  musicController.parse("String_Node_Str","String_Node_Str");
  musicController.parse("String_Node_Str","String_Node_Str");
  musicController.parse("String_Node_Str","String_Node_Str");
  musicController.parse("String_Node_Str","String_Node_Str");
  musicController.parse("String_Node_Str","String_Node_Str");
  musicController.parse("String_Node_Str","String_Node_Str");
  musicController.parse("String_Node_Str","String_Node_Str");
  musicController.parse("String_Node_Str","String_Node_Str");
  musicController.close();
}