nus-yam/ex-repair huggingface dataset:
Program: 53273
Project: 53273
Buggy source:
/** 
 * Constructor.
 * @param ln Logical Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSRegister(String ln,int sn){
  this(ObjectType.REGISTER,ln,0);
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param ln Logical Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSRegister(String ln,int sn){
  this(ObjectType.REGISTER,ln,sn);
}
Program: 53276
Project: 53276
Buggy source:
/** 
 * The window size in transmit. DefaultValue is 1.
 */
public final Object getWindowSizeTX(){
  return privateWindowSizeTX;
}

Fixed version (ground truth):
/** 
 * The window size in transmit. DefaultValue is 1.
 */
public final Object getWindowSizeTX(){
  return WindowSizeTX;
}
Program: 53277
Project: 53277
Buggy source:
public final void setMaxInfoRX(Object value){
  privateMaxInfoRX=value;
}

Fixed version (ground truth):
public final void setMaxInfoRX(Object value){
  MaxInfoRX=value;
}
Program: 53278
Project: 53278
Buggy source:
/** 
 * The window size in receive. DefaultValue is 1.
 */
public final Object getWindowSizeRX(){
  return privateWindowSizeRX;
}

Fixed version (ground truth):
/** 
 * The window size in receive. DefaultValue is 1.
 */
public final Object getWindowSizeRX(){
  return WindowSizeRX;
}
Program: 53279
Project: 53279
Buggy source:
public final void setMaxInfoTX(Object value){
  privateMaxInfoTX=value;
}

Fixed version (ground truth):
public final void setMaxInfoTX(Object value){
  MaxInfoTX=value;
}
Program: 53280
Project: 53280
Buggy source:
public final void setWindowSizeTX(Object value){
  privateWindowSizeTX=value;
}

Fixed version (ground truth):
public final void setWindowSizeTX(Object value){
  WindowSizeTX=value;
}
Program: 53281
Project: 53281
Buggy source:
GXDLMSLimits(){
  setMaxInfoTX((short)128);
  setMaxInfoRX((byte)128);
  setWindowSizeTX((byte)1);
  setWindowSizeRX(getWindowSizeTX());
}

Fixed version (ground truth):
GXDLMSLimits(){
  setMaxInfoTX((byte)128);
  setMaxInfoRX((byte)128);
  setWindowSizeTX((byte)1);
  setWindowSizeRX(getWindowSizeTX());
}
Program: 53282
Project: 53282
Buggy source:
public final void setWindowSizeRX(Object value){
  privateWindowSizeRX=value;
}

Fixed version (ground truth):
public final void setWindowSizeRX(Object value){
  WindowSizeRX=value;
}
Program: 53283
Project: 53283
Buggy source:
/** 
 * The maximum information field length in receive. DefaultValue is 62.
 */
public final Object getMaxInfoRX(){
  return privateMaxInfoRX;
}

Fixed version (ground truth):
/** 
 * The maximum information field length in receive. DefaultValue is 62.
 */
public final Object getMaxInfoRX(){
  return MaxInfoRX;
}
Program: 53284
Project: 53284
Buggy source:
/** 
 * The maximum information field length in transmit. 	  DefaultValue is 128.	 
 */
public final Object getMaxInfoTX(){
  return privateMaxInfoTX;
}

Fixed version (ground truth):
/** 
 * The maximum information field length in transmit. 	  DefaultValue is 128.	 
 */
public final Object getMaxInfoTX(){
  return MaxInfoTX;
}
Program: 53285
Project: 53285
Buggy source:
/** 
 * Generates a acknowledge message.
 */
public final byte[][] serverReportError(Command cmd,int serviceErrorCode){
  java.nio.ByteBuffer buff=java.nio.ByteBuffer.allocate(4);
switch (cmd) {
case ReadRequest:
    cmd=Command.ReadResponse;
  break;
case WriteRequest:
cmd=Command.WriteResponse;
break;
case GetRequest:
cmd=Command.GetResponse;
break;
case SetRequest:
cmd=Command.SetResponse;
break;
case MethodRequest:
cmd=Command.MethodResponse;
break;
default :
throw new RuntimeException("String_Node_Str");
}
if (!this.getUseLogicalNameReferencing()) {
buff.put((byte)0x00);
buff.put((byte)0x01);
}
buff.put((byte)serviceErrorCode);
int index[]=new int[1];
return m_Base.splitToFrames(buff,1,index,buff.position(),cmd,1);
}

Fixed version (ground truth):
/** 
 * Generates a acknowledge message.
 */
public final byte[][] serverReportError(Command cmd,int serviceErrorCode){
  java.nio.ByteBuffer buff=java.nio.ByteBuffer.allocate(4);
switch (cmd) {
case ReadRequest:
    cmd=Command.ReadResponse;
  break;
case WriteRequest:
cmd=Command.WriteResponse;
break;
case GetRequest:
cmd=Command.GetResponse;
break;
case SetRequest:
cmd=Command.SetResponse;
break;
case MethodRequest:
cmd=Command.MethodResponse;
break;
default :
throw new RuntimeException("String_Node_Str");
}
if (!this.getUseLogicalNameReferencing()) {
buff.put((byte)0x01);
buff.put((byte)0x01);
buff.put((byte)serviceErrorCode);
}
int index[]=new int[1];
return m_Base.splitToFrames(buff,1,index,buff.position(),cmd,serviceErrorCode);
}
Program: 53286
Project: 53286
Buggy source:
/** 
 * Generate disconnect request.
 */
private byte[] generateDisconnectRequest() throws Exception {
  if (this.getInterfaceType() == InterfaceType.NET) {
    java.nio.ByteBuffer buff=java.nio.ByteBuffer.allocate(2);
    buff.put((byte)0x63);
    buff.put((byte)0x0);
    return m_Base.addFrame((byte)0,false,buff,0,buff.position());
  }
  java.nio.ByteBuffer buff=java.nio.ByteBuffer.allocate(20);
  buff.put((byte)HDLCInfo.MaxInfoTX);
  setValue(buff,getLimits().getMaxInfoTX());
  buff.put((byte)HDLCInfo.MaxInfoRX);
  setValue(buff,getLimits().getMaxInfoRX());
  buff.put((byte)HDLCInfo.WindowSizeTX);
  setValue(buff,getLimits().getWindowSizeTX());
  buff.put((byte)HDLCInfo.WindowSizeRX);
  setValue(buff,getLimits().getWindowSizeRX());
  byte len=(byte)buff.position();
  buff.put(0,(byte)0x81);
  buff.put(1,(byte)0x80);
  buff.put(2,len);
  return m_Base.addFrame(FrameType.UA.getValue(),false,buff,0,buff.position());
}

Fixed version (ground truth):
/** 
 * Generate disconnect request.
 */
private byte[] generateDisconnectRequest() throws Exception {
  if (this.getInterfaceType() == InterfaceType.NET) {
    java.nio.ByteBuffer buff=java.nio.ByteBuffer.allocate(2);
    buff.put((byte)0x63);
    buff.put((byte)0x0);
    return m_Base.addFrame((byte)0,false,buff,0,buff.position());
  }
  java.nio.ByteBuffer buff=java.nio.ByteBuffer.allocate(20);
  buff.put((byte)0x81);
  buff.put((byte)0x80);
  buff.put((byte)0);
  buff.put((byte)HDLCInfo.MaxInfoTX);
  setValue(buff,getLimits().getMaxInfoTX());
  buff.put((byte)HDLCInfo.MaxInfoRX);
  setValue(buff,getLimits().getMaxInfoRX());
  buff.put((byte)HDLCInfo.WindowSizeTX);
  setValue(buff,getLimits().getWindowSizeTX());
  buff.put((byte)HDLCInfo.WindowSizeRX);
  setValue(buff,getLimits().getWindowSizeRX());
  byte len=(byte)(buff.position() - 3);
  buff.put(2,len);
  return m_Base.addFrame(FrameType.UA.getValue(),false,buff,0,buff.position());
}
Program: 53287
Project: 53287
Buggy source:
private byte[] getValue(Object name,GXDLMSObject item,int index,int selector,Object parameters) throws RuntimeException, UnsupportedEncodingException, ParseException, IOException {
  Object value;
  IGXDLMSBase base=(IGXDLMSBase)item;
  if (base != null) {
    value=item.getValue(index,selector,parameters);
    DataType tp=item.getDataType(index);
    if (tp == DataType.NONE) {
      tp=GXCommon.getValueType(value);
    }
    if (tp != DataType.NONE || (value == null && tp == DataType.NONE)) {
      SendData.addAll(Arrays.asList(readReply(name,item.getObjectType(),index,value,tp)));
      return SendData.get(FrameIndex);
    }
  }
 else {
    Object[] values=item.getValues();
    if (index <= values.length) {
      value=values[index - 1];
      DataType tp=item.getDataType(index);
      if (tp == DataType.NONE) {
        throw new IllegalArgumentException("String_Node_Str");
      }
      if (tp != DataType.NONE || (value == null && tp == DataType.NONE)) {
        SendData.addAll(Arrays.asList(readReply(name,item.getObjectType(),index,value,tp)));
        return SendData.get(FrameIndex);
      }
    }
  }
  throw new RuntimeException("String_Node_Str");
}

Fixed version (ground truth):
private byte[] getValue(Object name,GXDLMSObject item,int index,int selector,Object parameters) throws RuntimeException, UnsupportedEncodingException, ParseException, IOException {
  Object value;
  IGXDLMSBase base=(IGXDLMSBase)item;
  if (base != null) {
    value=item.getValue(index,selector,parameters);
    DataType tp=item.getDataType(index);
    if (tp == DataType.NONE) {
      tp=GXCommon.getValueType(value);
    }
    if (tp == DataType.OCTET_STRING && value instanceof String && item.getUIDataType(index) == DataType.STRING) {
      value=((String)value).getBytes("String_Node_Str");
    }
    if (tp != DataType.NONE || (value == null && tp == DataType.NONE)) {
      SendData.addAll(Arrays.asList(readReply(name,item.getObjectType(),index,value,tp)));
      return SendData.get(FrameIndex);
    }
  }
 else {
    Object[] values=item.getValues();
    if (index <= values.length) {
      value=values[index - 1];
      DataType tp=item.getDataType(index);
      if (tp == DataType.NONE) {
        throw new IllegalArgumentException("String_Node_Str");
      }
      if (tp != DataType.NONE || (value == null && tp == DataType.NONE)) {
        SendData.addAll(Arrays.asList(readReply(name,item.getObjectType(),index,value,tp)));
        return SendData.get(FrameIndex);
      }
    }
  }
  throw new RuntimeException("String_Node_Str");
}
Program: 53293
Project: 53293
Buggy source:
/** 
 * Constructor.
 * @param ln Logican Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSClock(String ln,int sn){
  super(ObjectType.CLOCK,ln,sn);
  Status=ClockStatus.OK;
  Deviation=0;
  java.util.Set<DateTimeSkips> value=EnumSet.of(DateTimeSkips.MONTH);
  value.add(DateTimeSkips.DAY);
  Begin.setSkip(value);
  End.setSkip(Begin.getSkip());
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param ln Logican Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSClock(String ln,int sn){
  super(ObjectType.CLOCK,ln,sn);
  Status=ClockStatus.OK;
  Deviation=0;
  java.util.Set<DateTimeSkips> value=EnumSet.of(DateTimeSkips.MONTH);
  value.add(DateTimeSkips.DAY);
  Begin.setSkip(value);
  End.setSkip(Begin.getSkip());
  m_ClockBase=ClockBase.None;
}
Program: 53294
Project: 53294
Buggy source:
@Override public Object getValue(int index,int selector,Object parameters){
  if (index == 1) {
    return getLogicalName();
  }
  if (index == 2) {
    return getTime();
  }
  if (index == 3) {
    return getTimeZone();
  }
  if (index == 4) {
    return getStatus().getValue();
  }
  if (index == 5) {
    return getBegin();
  }
  if (index == 6) {
    return getEnd();
  }
  if (index == 7) {
    return getDeviation();
  }
  if (index == 8) {
    return getEnabled();
  }
  if (index == 9) {
    return getClockBase();
  }
  throw new IllegalArgumentException("String_Node_Str");
}

Fixed version (ground truth):
@Override public Object getValue(int index,int selector,Object parameters){
  if (index == 1) {
    return getLogicalName();
  }
  if (index == 2) {
    return getTime();
  }
  if (index == 3) {
    return getTimeZone();
  }
  if (index == 4) {
    return getStatus().getValue();
  }
  if (index == 5) {
    return getBegin();
  }
  if (index == 6) {
    return getEnd();
  }
  if (index == 7) {
    return getDeviation();
  }
  if (index == 8) {
    return getEnabled();
  }
  if (index == 9) {
    return getClockBase().ordinal();
  }
  throw new IllegalArgumentException("String_Node_Str");
}
Program: 53295
Project: 53295
Buggy source:
@Override public Object getValue(int index,int selector,Object parameters){
  if (index == 1) {
    return getLogicalName();
  }
  if (index == 2) {
    return this.CommunicationSpeed;
  }
  if (index == 3) {
    return this.WindowSizeTransmit;
  }
  if (index == 4) {
    return this.WindowSizeReceive;
  }
  if (index == 5) {
    return this.MaximumInfoLengthTransmit;
  }
  if (index == 6) {
    return this.MaximumInfoLengthReceive;
  }
  if (index == 7) {
    return InterCharachterTimeout;
  }
  if (index == 8) {
    return InactivityTimeout;
  }
  if (index == 9) {
    return DeviceAddress;
  }
  throw new IllegalArgumentException("String_Node_Str");
}

Fixed version (ground truth):
@Override public Object getValue(int index,int selector,Object parameters){
  if (index == 1) {
    return getLogicalName();
  }
  if (index == 2) {
    return this.CommunicationSpeed.ordinal();
  }
  if (index == 3) {
    return this.WindowSizeTransmit;
  }
  if (index == 4) {
    return this.WindowSizeReceive;
  }
  if (index == 5) {
    return this.MaximumInfoLengthTransmit;
  }
  if (index == 6) {
    return this.MaximumInfoLengthReceive;
  }
  if (index == 7) {
    return InterCharachterTimeout;
  }
  if (index == 8) {
    return InactivityTimeout;
  }
  if (index == 9) {
    return DeviceAddress;
  }
  throw new IllegalArgumentException("String_Node_Str");
}
Program: 53296
Project: 53296
Buggy source:
public byte[][] imageTransferInitiate(GXDLMSClient client,String imageIdentifier,long imageSize){
  if (ImageBlockSize == 0) {
    throw new RuntimeException("String_Node_Str");
  }
  ByteArrayOutputStream data=new ByteArrayOutputStream();
  data.write((byte)DataType.STRUCTURE.getValue());
  data.write(2);
  try {
    GXCommon.setData(data,DataType.OCTET_STRING,imageIdentifier.getBytes("String_Node_Str"));
    GXCommon.setData(data,DataType.UINT32,imageSize);
  }
 catch (  Exception ex) {
    throw new RuntimeException(ex.getMessage());
  }
  return client.method(this,1,data.toByteArray(),DataType.ARRAY);
}

Fixed version (ground truth):
public byte[][] imageTransferInitiate(GXDLMSClient client,String imageIdentifier,long imageSize){
  if (ImageBlockSize == 0) {
    throw new RuntimeException("String_Node_Str");
  }
  ByteArrayOutputStream data=new ByteArrayOutputStream();
  data.write((byte)DataType.STRUCTURE.getValue());
  data.write(2);
  try {
    GXCommon.setData(data,DataType.OCTET_STRING,GXCommon.getBytes(imageIdentifier));
    GXCommon.setData(data,DataType.UINT32,imageSize);
  }
 catch (  Exception ex) {
    throw new RuntimeException(ex.getMessage());
  }
  return client.method(this,1,data.toByteArray(),DataType.ARRAY);
}
Program: 53297
Project: 53297
Buggy source:
/** 
 * Constructor.
 * @param ln Logican Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSImageTransfer(String ln,int sn){
  super(ObjectType.IMAGE_TRANSFER,ln,sn);
  ImageBlockSize=200;
  ImageFirstNotTransferredBlockNumber=0;
  ImageTransferEnabled=true;
  GXDLMSImageActivateInfo info=new GXDLMSImageActivateInfo();
  info.Size=0;
  info.Signature="String_Node_Str";
  info.Identification="String_Node_Str";
  ImageActivateInfo=new GXDLMSImageActivateInfo[]{info};
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param ln Logican Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSImageTransfer(String ln,int sn){
  super(ObjectType.IMAGE_TRANSFER,ln,sn);
  ImageBlockSize=200;
  ImageFirstNotTransferredBlockNumber=0;
  ImageTransferEnabled=true;
  GXDLMSImageActivateInfo info=new GXDLMSImageActivateInfo();
  info.Size=0;
  info.Signature="String_Node_Str";
  info.Identification="String_Node_Str";
  ImageActivateInfo=new GXDLMSImageActivateInfo[]{info};
  ImageTransferStatus=ImageTransferStatus.IMAGE_TRANSFER_NOT_INITIATED;
}
Program: 53298
Project: 53298
Buggy source:
@Override public Object getValue(int index,int selector,Object parameters){
  if (index == 1) {
    return getLogicalName();
  }
  if (index == 2) {
    return getImageBlockSize();
  }
  if (index == 3) {
    return ImageTransferredBlocksStatus;
  }
  if (index == 4) {
    return getImageFirstNotTransferredBlockNumber();
  }
  if (index == 5) {
    return getImageTransferEnabled();
  }
  if (index == 6) {
    return getImageTransferStatus().ordinal();
  }
  if (index == 7) {
    ByteArrayOutputStream data=new ByteArrayOutputStream();
    data.write((byte)DataType.ARRAY.getValue());
    data.write((byte)ImageActivateInfo.length);
    try {
      for (      GXDLMSImageActivateInfo it : ImageActivateInfo) {
        data.write((byte)DataType.STRUCTURE.getValue());
        data.write((byte)3);
        GXCommon.setData(data,DataType.UINT32,it.getSize());
        GXCommon.setData(data,DataType.OCTET_STRING,it.getIdentification().getBytes("String_Node_Str"));
        String tmp=it.getSignature();
        if (tmp != null) {
          GXCommon.setData(data,DataType.OCTET_STRING,it.getSignature().getBytes("String_Node_Str"));
        }
 else {
          GXCommon.setData(data,DataType.OCTET_STRING,null);
        }
      }
    }
 catch (    Exception ex) {
      throw new RuntimeException(ex.getMessage());
    }
    return data.toByteArray();
  }
  throw new IllegalArgumentException("String_Node_Str");
}

Fixed version (ground truth):
@Override public Object getValue(int index,int selector,Object parameters){
  if (index == 1) {
    return getLogicalName();
  }
  if (index == 2) {
    return getImageBlockSize();
  }
  if (index == 3) {
    return ImageTransferredBlocksStatus;
  }
  if (index == 4) {
    return getImageFirstNotTransferredBlockNumber();
  }
  if (index == 5) {
    return getImageTransferEnabled();
  }
  if (index == 6) {
    return getImageTransferStatus().ordinal();
  }
  if (index == 7) {
    ByteArrayOutputStream data=new ByteArrayOutputStream();
    data.write((byte)DataType.ARRAY.getValue());
    data.write((byte)ImageActivateInfo.length);
    try {
      for (      GXDLMSImageActivateInfo it : ImageActivateInfo) {
        data.write((byte)DataType.STRUCTURE.getValue());
        data.write((byte)3);
        GXCommon.setData(data,DataType.UINT32,it.getSize());
        GXCommon.setData(data,DataType.OCTET_STRING,GXCommon.getBytes(it.getIdentification()));
        String tmp=it.getSignature();
        if (tmp != null) {
          GXCommon.setData(data,DataType.OCTET_STRING,GXCommon.getBytes(it.getSignature()));
        }
 else {
          GXCommon.setData(data,DataType.OCTET_STRING,null);
        }
      }
    }
 catch (    Exception ex) {
      throw new RuntimeException(ex.getMessage());
    }
    return data.toByteArray();
  }
  throw new IllegalArgumentException("String_Node_Str");
}
Program: 53301
Project: 53301
Buggy source:
/** 
 * Read rows by range. Use this method to read Profile Generic table between dates.
 * @param name object name.
 * @param sortedLn The logical name of the sorted object.
 * @param sortedObjectType The ObjectType of the sorted object.
 * @param sortedVersion The version of the sorted object.
 * @param start Start time.
 * @param end End time.
 */
public final byte[] readRowsByRange(Object name,String sortedLn,ObjectType sortedObjectType,int sortedVersion,java.util.Date start,java.util.Date end) throws RuntimeException, UnsupportedEncodingException, ParseException {
  m_Base.clearProgress();
  java.nio.ByteBuffer buff=java.nio.ByteBuffer.allocate(100);
  buff.put((byte)0x01);
  buff.put((byte)DataType.STRUCTURE.getValue());
  buff.put((byte)0x04);
  buff.put((byte)0x02);
  buff.put((byte)0x04);
  GXCommon.setData(buff,DataType.UINT16,(short)8);
  GXCommon.setData(buff,DataType.OCTET_STRING,sortedLn);
  GXCommon.setData(buff,DataType.INT8,2);
  GXCommon.setData(buff,DataType.UINT16,sortedVersion);
  GXCommon.setData(buff,DataType.DATETIME,start);
  GXCommon.setData(buff,DataType.DATETIME,end);
  buff.put((byte)0x01);
  buff.put((byte)0x00);
  byte[] tmp=new byte[buff.position()];
  buff.position(0);
  buff.get(tmp);
  return m_Base.generateMessage(name,1,tmp,ObjectType.PROFILE_GENERIC,2,this.getUseLogicalNameReferencing() ? Command.GetRequest : Command.ReadRequest)[0];
}

Fixed version (ground truth):
/** 
 * Read rows by range. Use this method to read Profile Generic table between dates.
 * @param name object name.
 * @param sortedLn The logical name of the sorted object.
 * @param sortedObjectType The ObjectType of the sorted object.
 * @param sortedVersion The version of the sorted object.
 * @param start Start time.
 * @param end End time.
 */
public final byte[] readRowsByRange(Object name,String sortedLn,ObjectType sortedObjectType,int sortedVersion,java.util.Date start,java.util.Date end) throws RuntimeException, UnsupportedEncodingException, ParseException {
  m_Base.clearProgress();
  java.nio.ByteBuffer buff=java.nio.ByteBuffer.allocate(100);
  buff.put((byte)0x01);
  buff.put((byte)DataType.STRUCTURE.getValue());
  buff.put((byte)0x04);
  buff.put((byte)0x02);
  buff.put((byte)0x04);
  GXCommon.setData(buff,DataType.UINT16,(short)8);
  GXCommon.setData(buff,DataType.OCTET_STRING,sortedLn);
  GXCommon.setData(buff,DataType.INT8,2);
  GXCommon.setData(buff,DataType.UINT16,sortedVersion);
  GXCommon.setData(buff,DataType.DATETIME,start);
  GXCommon.setData(buff,DataType.DATETIME,end);
  buff.put((byte)0x01);
  buff.put((byte)0x00);
  byte[] tmp=new byte[buff.position()];
  buff.position(0);
  buff.get(tmp);
  return m_Base.generateMessage(name,4,tmp,ObjectType.PROFILE_GENERIC,2,this.getUseLogicalNameReferencing() ? Command.GetRequest : Command.ReadRequest)[0];
}
Program: 53302
Project: 53302
Buggy source:
/** 
 * Read rows by entry.
 * @param name object name.
 * @param index Zero bases start index.
 * @param count Rows count to read.
 * @return Read message as byte array.
 */
public final byte[] readRowsByEntry(Object name,int index,int count) throws RuntimeException, UnsupportedEncodingException, ParseException {
  m_Base.clearProgress();
  java.nio.ByteBuffer buff=java.nio.ByteBuffer.allocate(19);
  buff.put((byte)0x02);
  buff.put((byte)DataType.STRUCTURE.getValue());
  buff.put((byte)0x04);
  GXCommon.setData(buff,DataType.UINT32,index);
  GXCommon.setData(buff,DataType.UINT32,count);
  GXCommon.setData(buff,DataType.UINT16,0);
  GXCommon.setData(buff,DataType.UINT16,0);
  return m_Base.generateMessage(name,1,buff.array(),ObjectType.PROFILE_GENERIC,2,this.getUseLogicalNameReferencing() ? Command.GetRequest : Command.ReadRequest)[0];
}

Fixed version (ground truth):
/** 
 * Read rows by entry.
 * @param name object name.
 * @param index Zero bases start index.
 * @param count Rows count to read.
 * @return Read message as byte array.
 */
public final byte[] readRowsByEntry(Object name,int index,int count) throws RuntimeException, UnsupportedEncodingException, ParseException {
  m_Base.clearProgress();
  java.nio.ByteBuffer buff=java.nio.ByteBuffer.allocate(19);
  buff.put((byte)0x02);
  buff.put((byte)DataType.STRUCTURE.getValue());
  buff.put((byte)0x04);
  GXCommon.setData(buff,DataType.UINT32,index);
  GXCommon.setData(buff,DataType.UINT32,count);
  GXCommon.setData(buff,DataType.UINT16,0);
  GXCommon.setData(buff,DataType.UINT16,0);
  return m_Base.generateMessage(name,4,buff.array(),ObjectType.PROFILE_GENERIC,2,this.getUseLogicalNameReferencing() ? Command.GetRequest : Command.ReadRequest)[0];
}
Program: 53303
Project: 53303
Buggy source:
/** 
 * Constructor.
 */
public GXDateTime(int year,int month,int day,int hour,int minute,int second,int millisecond){
  Skip=EnumSet.noneOf(DateTimeSkips.class);
  if (year == -1) {
    Skip.add(DateTimeSkips.YEAR);
    year=1;
  }
  if (month == -1) {
    Skip.add(DateTimeSkips.MONTH);
    month=0;
  }
 else {
    month-=1;
  }
  if (day == -1) {
    Skip.add(DateTimeSkips.DAY);
    day=1;
  }
  if (hour == -1) {
    Skip.add(DateTimeSkips.HOUR);
    hour=0;
  }
  if (minute == -1) {
    Skip.add(DateTimeSkips.MINUTE);
    minute=0;
  }
  if (second == -1) {
    Skip.add(DateTimeSkips.SECOND);
    second=0;
  }
  if (millisecond == -1) {
    Skip.add(DateTimeSkips.MILLISECOND);
    millisecond=0;
  }
  java.util.Calendar tm=java.util.Calendar.getInstance();
  tm.set(year,month,day,hour,minute,second);
  if (millisecond != 0) {
    tm.set(Calendar.MILLISECOND,millisecond);
  }
  setValue(tm.getTime());
}

Fixed version (ground truth):
/** 
 * Constructor.
 */
public GXDateTime(int year,int month,int day,int hour,int minute,int second,int millisecond){
  Skip=EnumSet.noneOf(DateTimeSkips.class);
  if (year == -1) {
    Skip.add(DateTimeSkips.YEAR);
    year=1;
  }
  if (month == -1) {
    Skip.add(DateTimeSkips.MONTH);
    month=0;
  }
 else {
    month-=1;
  }
  if (day == -1) {
    Skip.add(DateTimeSkips.DAY);
    day=1;
  }
  if (hour == -1) {
    Skip.add(DateTimeSkips.HOUR);
    hour=0;
  }
  if (minute == -1) {
    Skip.add(DateTimeSkips.MINUTE);
    minute=0;
  }
  if (second == -1) {
    Skip.add(DateTimeSkips.SECOND);
    second=0;
  }
  if (millisecond == -1) {
    Skip.add(DateTimeSkips.MILLISECOND);
    millisecond=0;
  }
  java.util.Calendar tm=java.util.Calendar.getInstance(java.util.TimeZone.getTimeZone("String_Node_Str"));
  tm.set(year,month,day,hour,minute,second);
  if (millisecond != 0) {
    tm.set(Calendar.MILLISECOND,millisecond);
  }
  setValue(tm.getTime());
}
Program: 53307
Project: 53307
Buggy source:
public byte[][] presetAdjustingTime(GXDLMSClient client,Date presetTime,Date validityIntervalStart,Date validityIntervalEnd){
  ByteArrayOutputStream stream=new ByteArrayOutputStream();
  stream.write((byte)DataType.STRUCTURE.getValue());
  stream.write((byte)3);
  try {
    GXCommon.setData(stream,DataType.DATETIME,presetTime);
    GXCommon.setData(stream,DataType.DATETIME,validityIntervalStart);
    GXCommon.setData(stream,DataType.DATETIME,validityIntervalEnd);
  }
 catch (  Exception ex) {
    Logger.getLogger(GXDLMSClock.class.getName()).log(Level.SEVERE,null,ex);
    throw new RuntimeException(ex.getMessage());
  }
  byte[] ret=client.method(getName(),getObjectType(),5,stream.toByteArray(),DataType.ARRAY);
  return new byte[][]{ret};
}

Fixed version (ground truth):
public byte[][] presetAdjustingTime(GXDLMSClient client,Date presetTime,Date validityIntervalStart,Date validityIntervalEnd){
  ByteArrayOutputStream stream=new ByteArrayOutputStream();
  stream.write((byte)DataType.STRUCTURE.getValue());
  stream.write((byte)3);
  try {
    GXCommon.setData(stream,DataType.DATETIME,presetTime);
    GXCommon.setData(stream,DataType.DATETIME,validityIntervalStart);
    GXCommon.setData(stream,DataType.DATETIME,validityIntervalEnd);
  }
 catch (  Exception ex) {
    throw new RuntimeException(ex.getMessage());
  }
  byte[] ret=client.method(getName(),getObjectType(),5,stream.toByteArray(),DataType.ARRAY);
  return new byte[][]{ret};
}
Program: 53309
Project: 53309
Buggy source:
/** 
 * Reserved for internal use.
 * @param objectType
 * @param version
 * @param baseName
 * @param logicalName
 * @param accessRights
 * @param attributeIndex
 * @param dataIndex
 */
final void updateObjectData(GXDLMSObject obj,ObjectType objectType,Object version,Object baseName,byte[] logicalName,Object accessRights){
  obj.setObjectType(objectType);
  if (accessRights != null && accessRights.getClass().isArray()) {
    Object[] access=(Object[])accessRights;
    for (    Object attributeAccess : (Object[])access[0]) {
      int id=((Number)((Object[])attributeAccess)[0]).intValue();
      int tmp=((Number)((Object[])attributeAccess)[1]).intValue();
      AccessMode mode=AccessMode.forValue(tmp);
      obj.setAccess(id,mode);
    }
    for (    Object methodAccess : (Object[])access[1]) {
      int id=((Number)((Object[])methodAccess)[0]).intValue();
      int tmp;
      if (((Object[])methodAccess)[1] instanceof Boolean) {
        if ((boolean)((Object[])methodAccess)[1]) {
          tmp=1;
        }
 else {
          tmp=0;
        }
      }
 else {
        tmp=((Number)((Object[])methodAccess)[1]).intValue();
      }
      MethodAccessMode mode=MethodAccessMode.forValue(tmp);
      obj.setMethodAccess(id,mode);
    }
  }
  if (baseName != null) {
    obj.setShortName(((Number)baseName).intValue());
  }
  if (version != null) {
    obj.setVersion(((Number)version).intValue());
  }
  obj.setLogicalName(GXDLMSObject.toLogicalName(logicalName));
}

Fixed version (ground truth):
/** 
 * Reserved for internal use.
 * @param objectType
 * @param version
 * @param baseName
 * @param logicalName
 * @param accessRights
 * @param attributeIndex
 * @param dataIndex
 */
final void updateObjectData(GXDLMSObject obj,ObjectType objectType,Object version,Object baseName,byte[] logicalName,Object accessRights){
  obj.setObjectType(objectType);
  if (accessRights != null && accessRights.getClass().isArray()) {
    Object[] access=(Object[])accessRights;
    for (    Object attributeAccess : (Object[])access[0]) {
      int id=((Number)((Object[])attributeAccess)[0]).intValue();
      int tmp=((Number)((Object[])attributeAccess)[1]).intValue();
      AccessMode mode=AccessMode.forValue(tmp);
      obj.setAccess(id,mode);
    }
    for (    Object methodAccess : (Object[])access[1]) {
      int id=((Number)((Object[])methodAccess)[0]).intValue();
      int tmp;
      if (((Object[])methodAccess)[1] instanceof Boolean) {
        if ((Boolean)((Object[])methodAccess)[1]) {
          tmp=1;
        }
 else {
          tmp=0;
        }
      }
 else {
        tmp=((Number)((Object[])methodAccess)[1]).intValue();
      }
      MethodAccessMode mode=MethodAccessMode.forValue(tmp);
      obj.setMethodAccess(id,mode);
    }
  }
  if (baseName != null) {
    obj.setShortName(((Number)baseName).intValue());
  }
  if (version != null) {
    obj.setVersion(((Number)version).intValue());
  }
  obj.setLogicalName(GXDLMSObject.toLogicalName(logicalName));
}
Program: 53311
Project: 53311
Buggy source:
/** 
 * Constructor.
 * @param ln Logican Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSActionSchedule(String ln,int sn){
  super(ObjectType.ACTION_SCHEDULE,ln,sn);
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param ln Logical Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSActionSchedule(String ln,int sn){
  super(ObjectType.ACTION_SCHEDULE,ln,sn);
}
Program: 53312
Project: 53312
Buggy source:
/** 
 * Constructor.
 * @param ln Logican Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSActivityCalendar(String ln,int sn){
  super(ObjectType.ACTIVITY_CALENDAR,ln,sn);
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param ln Logical Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSActivityCalendar(String ln,int sn){
  super(ObjectType.ACTIVITY_CALENDAR,ln,sn);
}
Program: 53313
Project: 53313
Buggy source:
/** 
 * Constructor.
 * @param ln Logican Name of the object.
 */
public GXDLMSAssociationLogicalName(String ln){
  super(ObjectType.ASSOCIATION_LOGICAL_NAME,ln,0);
  setLogicalName(ln);
  m_ObjectList=new GXDLMSObjectCollection(this);
  ApplicationContextName=new GXApplicationContextName();
  XDLMSContextInfo=new GXxDLMSContextType();
  AuthenticationMechanismMame=new GXAuthenticationMechanismName();
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param ln Logical Name of the object.
 */
public GXDLMSAssociationLogicalName(String ln){
  super(ObjectType.ASSOCIATION_LOGICAL_NAME,ln,0);
  setLogicalName(ln);
  m_ObjectList=new GXDLMSObjectCollection(this);
  ApplicationContextName=new GXApplicationContextName();
  XDLMSContextInfo=new GXxDLMSContextType();
  AuthenticationMechanismMame=new GXAuthenticationMechanismName();
}
Program: 53314
Project: 53314
Buggy source:
/** 
 * Constructor.
 * @param ln Logican Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSAssociationShortName(String ln,int sn){
  super(ObjectType.ASSOCIATION_SHORT_NAME,ln,sn);
  m_ObjectList=new GXDLMSObjectCollection(this);
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param ln Logical Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSAssociationShortName(String ln,int sn){
  super(ObjectType.ASSOCIATION_SHORT_NAME,ln,sn);
  m_ObjectList=new GXDLMSObjectCollection(this);
}
Program: 53315
Project: 53315
Buggy source:
/** 
 * Constructor.
 * @param ln Logican Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSAutoAnswer(String ln,int sn){
  super(ObjectType.AUTO_ANSWER,ln,sn);
  m_ListeningWindow=new ArrayList<AbstractMap.SimpleEntry<GXDateTime,GXDateTime>>();
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param ln Logical Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSAutoAnswer(String ln,int sn){
  super(ObjectType.AUTO_ANSWER,ln,sn);
  m_ListeningWindow=new ArrayList<AbstractMap.SimpleEntry<GXDateTime,GXDateTime>>();
}
Program: 53316
Project: 53316
Buggy source:
@Override public void setValue(int index,Object value){
  if (index == 1) {
    super.setValue(index,value);
  }
 else   if (index == 2) {
    setMode(AutoConnectMode.forValue(((Number)value).byteValue() & 0xFF));
  }
 else   if (index == 3) {
    getListeningWindow().clear();
    if (value != null) {
      for (      Object item : (Object[])value) {
        GXDateTime start=(GXDateTime)GXDLMSClient.changeType((byte[])Array.get(item,0),DataType.DATETIME);
        GXDateTime end=(GXDateTime)GXDLMSClient.changeType((byte[])Array.get(item,1),DataType.DATETIME);
        getListeningWindow().add(new AbstractMap.SimpleEntry(start,end));
      }
    }
  }
 else   if (index == 4) {
    setStatus(AutoAnswerStatus.forValue(((Number)value).intValue()));
  }
 else   if (index == 5) {
    setNumberOfCalls(((Number)value).intValue());
  }
 else   if (index == 6) {
    m_NumberOfRingsInListeningWindow=m_NumberOfRingsOutListeningWindow=0;
    if (value != null) {
      m_NumberOfRingsInListeningWindow=((Number)Array.get(value,0)).intValue();
      m_NumberOfRingsOutListeningWindow=((Number)Array.get(value,1)).intValue();
    }
  }
 else {
    throw new IllegalArgumentException("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void setValue(int index,Object value){
  if (index == 1) {
    super.setValue(index,value);
  }
 else   if (index == 2) {
    setMode(AutoConnectMode.forValue(((Number)value).byteValue() & 0xFF));
  }
 else   if (index == 3) {
    getListeningWindow().clear();
    if (value != null) {
      for (      Object item : (Object[])value) {
        GXDateTime start=(GXDateTime)GXDLMSClient.changeType((byte[])Array.get(item,0),DataType.DATETIME);
        GXDateTime end=(GXDateTime)GXDLMSClient.changeType((byte[])Array.get(item,1),DataType.DATETIME);
        getListeningWindow().add(new SimpleEntry<GXDateTime,GXDateTime>(start,end));
      }
    }
  }
 else   if (index == 4) {
    setStatus(AutoAnswerStatus.forValue(((Number)value).intValue()));
  }
 else   if (index == 5) {
    setNumberOfCalls(((Number)value).intValue());
  }
 else   if (index == 6) {
    m_NumberOfRingsInListeningWindow=m_NumberOfRingsOutListeningWindow=0;
    if (value != null) {
      m_NumberOfRingsInListeningWindow=((Number)Array.get(value,0)).intValue();
      m_NumberOfRingsOutListeningWindow=((Number)Array.get(value,1)).intValue();
    }
  }
 else {
    throw new IllegalArgumentException("String_Node_Str");
  }
}
Program: 53317
Project: 53317
Buggy source:
/** 
 * Constructor.
 * @param ln Logican Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSAutoConnect(String ln,int sn){
  super(ObjectType.AUTO_CONNECT,ln,sn);
  m_CallingWindow=new java.util.ArrayList<AbstractMap.SimpleEntry<GXDateTime,GXDateTime>>();
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param ln Logical Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSAutoConnect(String ln,int sn){
  super(ObjectType.AUTO_CONNECT,ln,sn);
  m_CallingWindow=new java.util.ArrayList<AbstractMap.SimpleEntry<GXDateTime,GXDateTime>>();
}
Program: 53318
Project: 53318
Buggy source:
/** 
 * Constructor.
 * @param ln Logican Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSClock(String ln,int sn){
  super(ObjectType.CLOCK,ln,sn);
  Status=ClockStatus.OK;
  Deviation=0;
  java.util.Set<DateTimeSkips> value=EnumSet.of(DateTimeSkips.MONTH);
  value.add(DateTimeSkips.DAY);
  Begin.setSkip(value);
  End.setSkip(Begin.getSkip());
  m_ClockBase=ClockBase.None;
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param ln Logical Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSClock(String ln,int sn){
  super(ObjectType.CLOCK,ln,sn);
  Status=ClockStatus.OK;
  Deviation=0;
  java.util.Set<DateTimeSkips> value=EnumSet.of(DateTimeSkips.MONTH);
  value.add(DateTimeSkips.DAY);
  Begin.setSkip(value);
  End.setSkip(Begin.getSkip());
  m_ClockBase=ClockBase.None;
}
Program: 53319
Project: 53319
Buggy source:
/** 
 * Constructor.
 * @param ln Logican Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSData(String ln,int sn){
  super(ObjectType.DATA,ln,sn);
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param ln Logical Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSData(String ln,int sn){
  super(ObjectType.DATA,ln,sn);
}
Program: 53320
Project: 53320
Buggy source:
/** 
 * Constructor.
 * @param ln Logican Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSDemandRegister(String ln,int sn){
  super(ObjectType.DEMAND_REGISTER,ln,sn);
  setScaler(1);
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param ln Logical Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSDemandRegister(String ln,int sn){
  super(ObjectType.DEMAND_REGISTER,ln,sn);
  setScaler(1);
}
Program: 53321
Project: 53321
Buggy source:
/** 
 * Constructor.
 * @param ln Logican Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSDisconnectControl(String ln,int sn){
  super(ObjectType.DISCONNECT_CONTROL,ln,sn);
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param ln Logical Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSDisconnectControl(String ln,int sn){
  super(ObjectType.DISCONNECT_CONTROL,ln,sn);
}
Program: 53322
Project: 53322
Buggy source:
/** 
 * Constructor.
 * @param ln Logican Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSExtendedRegister(String ln,int sn){
  super(ObjectType.EXTENDED_REGISTER,ln,sn);
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param ln Logical Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSExtendedRegister(String ln,int sn){
  super(ObjectType.EXTENDED_REGISTER,ln,sn);
}
Program: 53323
Project: 53323
Buggy source:
/** 
 * Constructor.
 * @param ln Logican Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSGprsSetup(String ln,int sn){
  super(ObjectType.GPRS_SETUP,ln,sn);
  DefaultQualityOfService=new GXDLMSQualityOfService();
  RequestedQualityOfService=new GXDLMSQualityOfService();
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param ln Logical Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSGprsSetup(String ln,int sn){
  super(ObjectType.GPRS_SETUP,ln,sn);
  DefaultQualityOfService=new GXDLMSQualityOfService();
  RequestedQualityOfService=new GXDLMSQualityOfService();
}
Program: 53324
Project: 53324
Buggy source:
/** 
 * Constructor.
 * @param ln Logican Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSHdlcSetup(String ln,int sn){
  super(ObjectType.IEC_HDLC_SETUP,ln,0);
  setCommunicationSpeed(BaudRate.BAUDRATE_9600);
  setWindowSizeTransmit(1);
  setWindowSizeReceive(getWindowSizeTransmit());
  setMaximumInfoLengthReceive(128);
  setMaximumInfoLengthTransmit(getMaximumInfoLengthReceive());
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param ln Logical Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSHdlcSetup(String ln,int sn){
  super(ObjectType.IEC_HDLC_SETUP,ln,0);
  setCommunicationSpeed(BaudRate.BAUDRATE_9600);
  setWindowSizeTransmit(1);
  setWindowSizeReceive(getWindowSizeTransmit());
  setMaximumInfoLengthReceive(128);
  setMaximumInfoLengthTransmit(getMaximumInfoLengthReceive());
}
Program: 53325
Project: 53325
Buggy source:
/** 
 * Constructor.
 * @param ln Logican Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSIECOpticalPortSetup(String ln,int sn){
  super(ObjectType.IEC_LOCAL_PORT_SETUP,ln,sn);
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param ln Logical Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSIECOpticalPortSetup(String ln,int sn){
  super(ObjectType.IEC_LOCAL_PORT_SETUP,ln,sn);
}
Program: 53326
Project: 53326
Buggy source:
/** 
 * Constructor.
 * @param ln Logican Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSImageTransfer(String ln,int sn){
  super(ObjectType.IMAGE_TRANSFER,ln,sn);
  ImageBlockSize=200;
  ImageFirstNotTransferredBlockNumber=0;
  ImageTransferEnabled=true;
  GXDLMSImageActivateInfo info=new GXDLMSImageActivateInfo();
  info.Size=0;
  info.Signature="String_Node_Str";
  info.Identification="String_Node_Str";
  ImageActivateInfo=new GXDLMSImageActivateInfo[]{info};
  ImageTransferStatus=ImageTransferStatus.IMAGE_TRANSFER_NOT_INITIATED;
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param ln Logical Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSImageTransfer(String ln,int sn){
  super(ObjectType.IMAGE_TRANSFER,ln,sn);
  ImageBlockSize=200;
  ImageFirstNotTransferredBlockNumber=0;
  ImageTransferEnabled=true;
  GXDLMSImageActivateInfo info=new GXDLMSImageActivateInfo();
  info.Size=0;
  info.Signature="String_Node_Str";
  info.Identification="String_Node_Str";
  ImageActivateInfo=new GXDLMSImageActivateInfo[]{info};
  ImageTransferStatus=ImageTransferStatus.IMAGE_TRANSFER_NOT_INITIATED;
}
Program: 53327
Project: 53327
Buggy source:
/** 
 * Constructor.
 * @param ln Logican Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSIp4Setup(String ln,int sn){
  super(ObjectType.IP4_SETUP,ln,sn);
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param ln Logical Name of the object.
 * @param sn Short Name of the object.
 */
public GXDLMSIp4Setup(String ln,int sn){
  super(ObjectType.IP4_SETUP,ln,sn);
}
Program: 53328
Project: 53328
Buggy source:
public void compareAndUpdate(){
  FluidStack current=tank.getFluid();
  if (current != null) {
    if (lastBeforeUpdate != null) {
      if (Math.abs(current.amount - lastBeforeUpdate.amount) >= 500) {
        worldObj.addBlockEvent(xCoord,yCoord,zCoord,getBlockType().blockID,current.fluidID,current.amount);
        lastBeforeUpdate=current.copy();
      }
 else {
        if (lastBeforeUpdate.amount < tank.getCapacity() && current.amount == tank.getCapacity() || lastBeforeUpdate.amount == tank.getCapacity() && current.amount < tank.getCapacity()) {
          worldObj.addBlockEvent(xCoord,yCoord,zCoord,getBlockType().blockID,current.fluidID,current.amount);
          lastBeforeUpdate=current.copy();
        }
      }
    }
 else {
      worldObj.addBlockEvent(xCoord,yCoord,zCoord,getBlockType().blockID,current.fluidID,current.amount);
      lastBeforeUpdate=current.copy();
    }
  }
 else {
    if (lastBeforeUpdate != null) {
      worldObj.addBlockEvent(xCoord,yCoord,zCoord,getBlockType().blockID,-1,-1);
      lastBeforeUpdate=null;
    }
  }
}

Fixed version (ground truth):
public void compareAndUpdate(){
  FluidStack current=tank.getFluid();
  if (current != null) {
    if (lastBeforeUpdate != null) {
      if (Math.abs(current.amount - lastBeforeUpdate.amount) >= 500) {
        worldObj.markBlockForUpdate(this.xCoord,this.yCoord,this.zCoord);
        lastBeforeUpdate=current.copy();
      }
 else {
        if (lastBeforeUpdate.amount < tank.getCapacity() && current.amount == tank.getCapacity() || lastBeforeUpdate.amount == tank.getCapacity() && current.amount < tank.getCapacity()) {
          worldObj.markBlockForUpdate(this.xCoord,this.yCoord,this.zCoord);
          lastBeforeUpdate=current.copy();
        }
      }
    }
 else {
      worldObj.markBlockForUpdate(this.xCoord,this.yCoord,this.zCoord);
      lastBeforeUpdate=current.copy();
    }
  }
 else {
    if (lastBeforeUpdate != null) {
      worldObj.markBlockForUpdate(this.xCoord,this.yCoord,this.zCoord);
      lastBeforeUpdate=null;
    }
  }
}
Program: 53329
Project: 53329
Buggy source:
@Override public void updateEntity(){
  storingPower=this.worldObj.isBlockIndirectlyGettingPowered(xCoord,yCoord,zCoord) || this.worldObj.isBlockIndirectlyGettingPowered(xCoord,yCoord + 1,zCoord);
  if (getGrid() != null) {
    IMEPowerStorage controller=(IMEPowerStorage)getGrid().getController();
    if (storingPower) {
      energy=controller.addMEPower(energy);
    }
 else {
      for (int i=0; i < 5; i++) {
        if (energy + takeEnergy <= maxEnergy && controller.useMEEnergy(takeEnergy,StatCollector.translateToLocal("String_Node_Str"))) {
          energy+=takeEnergy;
        }
 else {
          break;
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void updateEntity(){
  if (getGrid() != null) {
    if (rechargeNetwork == null) {
      updateRechargeNetwork();
    }
    IMEPowerStorage controller=(IMEPowerStorage)getGrid().getController();
    if (rechargeNetwork) {
      if (controller.getMECurrentPower() < controller.getMEMaxPower()) {
        energy=controller.addMEPower(energy);
      }
    }
 else {
      for (int i=0; i < 5; i++) {
        if (energy + takeEnergy <= maxEnergy && controller.useMEEnergy(takeEnergy,StatCollector.translateToLocal("String_Node_Str"))) {
          energy+=takeEnergy;
        }
 else {
          break;
        }
      }
    }
  }
}
Program: 53330
Project: 53330
Buggy source:
/** 
 * How many does it drop when broken...
 */
@Override public int quantityDropped(Random par1Random){
  return 1;
}

Fixed version (ground truth):
@Override public int quantityDropped(Random par1Random){
  return 1;
}
Program: 53331
Project: 53331
Buggy source:
/** 
 * Creates a new TileEntity instance.
 */
@Override public TileEntity createNewTileEntity(World world){
  return new TileEntitySolderingStation();
}

Fixed version (ground truth):
@Override public TileEntity createNewTileEntity(World world){
  return new TileEntitySolderingStation();
}
Program: 53332
Project: 53332
Buggy source:
/** 
 * Block does not render as Normal blocks it has a Model...
 */
@Override public boolean renderAsNormalBlock(){
  return false;
}

Fixed version (ground truth):
@Override public boolean renderAsNormalBlock(){
  return false;
}
Program: 53333
Project: 53333
Buggy source:
/** 
 * So that the texture does show up correct.
 */
@Override public int getRenderType(){
  return -1;
}

Fixed version (ground truth):
@Override public int getRenderType(){
  return -1;
}
Program: 53334
Project: 53334
Buggy source:
/** 
 * Obviously it's not an opaque cube.
 */
@Override public boolean isOpaqueCube(){
  return false;
}

Fixed version (ground truth):
@Override public boolean isOpaqueCube(){
  return false;
}
Program: 53338
Project: 53338
Buggy source:
@Override public void showInterstitial(){
  if (loadedAd != null) {
    final AppLovinSdk sdk=AppLovinSdk.getInstance(context);
    final AppLovinInterstitialAdDialog interstitialAd=AppLovinInterstitialAd.create(sdk,context);
    interstitialAd.setAdDisplayListener(this);
    interstitialAd.setAdClickListener(this);
    interstitialAd.setAdVideoPlaybackListener(this);
    interstitialAd.showAndRender(loadedAd);
  }
 else {
    log(ERROR,"String_Node_Str");
    listener.onAdFailedToLoad(AdRequest.ERROR_CODE_INTERNAL_ERROR);
  }
}

Fixed version (ground truth):
@Override public void showInterstitial(){
  if (loadedAd != null) {
    final AppLovinSdk sdk=AppLovinSdk.getInstance(context);
    final AppLovinInterstitialAdDialog interstitialAd=createInterstitial(context,sdk);
    interstitialAd.setAdDisplayListener(this);
    interstitialAd.setAdClickListener(this);
    interstitialAd.setAdVideoPlaybackListener(this);
    interstitialAd.showAndRender(loadedAd);
  }
 else {
    log(ERROR,"String_Node_Str");
    listener.onAdFailedToLoad(AdRequest.ERROR_CODE_INTERNAL_ERROR);
  }
}