nus-yam/ex-repair huggingface dataset:
Program: 81998
Project: 81998
Buggy source:
/** 
 * {@inheritDoc} Receive the SCTP packets and parse into event string,then record them.
 */
@Override public void onSctpPacket(byte[] data,int sid,int ssn,int tsn,long ppid,int context,int flags){
  System.out.println("String_Node_Str" + ppid);
  for (  byte b : data) {
    System.out.printf("String_Node_Str",b);
  }
  System.out.println();
  if (ppid == WEB_RTC_PPID_CTRL) {
    try {
      onCtrlPacket(data,sid);
    }
 catch (    IOException e) {
      logger.error("String_Node_Str",e);
    }
  }
 else   if (ppid == WEB_RTC_PPID_STRING || ppid == WEB_RTC_PPID_BIN) {
    ByteBuffer buffer=ByteBuffer.wrap(data);
    int messageType=0xFF & buffer.get();
    System.out.println(messageType);
    try {
      String dataStr=new String(data,"String_Node_Str");
      JSONParser parser=new JSONParser();
      JSONObject json=(JSONObject)parser.parse(dataStr);
      String endpointId=json.get("String_Node_Str").toString();
      logger.debug("String_Node_Str" + endpointId);
      System.out.println("String_Node_Str" + endpointId);
      RecorderEvent event=new RecorderEvent();
      event.setMediaType(MediaType.AUDIO);
      event.setType(RecorderEvent.Type.SPEAKER_CHANGED);
      event.setEndpointId(endpointId);
      event.setAudioSsrc(getEndpointSsrc(endpointId,MediaType.AUDIO));
      eventHandler.handleEvent(event);
    }
 catch (    ParseException e) {
      e.printStackTrace();
    }
catch (    UnsupportedEncodingException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} Receive the SCTP packets and parse into event string,then record them.
 */
@Override public void onSctpPacket(byte[] data,int sid,int ssn,int tsn,long ppid,int context,int flags){
  if (ppid == WEB_RTC_PPID_CTRL) {
    try {
      onCtrlPacket(data,sid);
    }
 catch (    IOException e) {
      logger.error("String_Node_Str",e);
    }
  }
 else   if (ppid == WEB_RTC_PPID_STRING || ppid == WEB_RTC_PPID_BIN) {
    ByteBuffer buffer=ByteBuffer.wrap(data);
    int messageType=0xFF & buffer.get();
    System.out.println(messageType);
    try {
      String dataStr=new String(data,"String_Node_Str");
      JSONParser parser=new JSONParser();
      JSONObject json=(JSONObject)parser.parse(dataStr);
      String endpointId=json.get("String_Node_Str").toString();
      logger.debug("String_Node_Str" + endpointId);
      System.out.println("String_Node_Str" + dataStr);
      System.out.println("String_Node_Str" + endpointId);
      RecorderEvent event=new RecorderEvent();
      event.setMediaType(MediaType.AUDIO);
      event.setType(RecorderEvent.Type.SPEAKER_CHANGED);
      event.setEndpointId(endpointId);
      event.setAudioSsrc(getEndpointSsrc(endpointId,MediaType.AUDIO));
      event.setInstant(System.currentTimeMillis());
      eventHandler.handleEvent(event);
    }
 catch (    ParseException e) {
      e.printStackTrace();
    }
catch (    UnsupportedEncodingException e) {
      e.printStackTrace();
    }
  }
}
Program: 81999
Project: 81999
Buggy source:
/** 
 * Stop the RTP translators. <p> Actually we don't stop <tt>RTPTranslator</tt> manually, because it will be closed in recorder.
 */
private void stopTranslators(){
  for (  Entry<MediaType,RTPTranslator> e : rtpTranslators.entrySet()) {
    e.getValue().dispose();
  }
  rtpTranslators.clear();
}

Fixed version (ground truth):
/** 
 * Stop the RTP translators. <p> Actually we don't stop <tt>RTPTranslator</tt>s manually, because it will be closed automatically by recorders.
 */
private void stopTranslators(){
  for (  Entry<MediaType,RTPTranslator> e : rtpTranslators.entrySet()) {
    e.getValue().dispose();
  }
  rtpTranslators.clear();
}
Program: 82002
Project: 82002
Buggy source:
/** 
 * Make the <tt>JireconRecorderImpl</tt> ready to start recording media streams.
 * @throws OperationFailedException if some operation failed and thepreparation is aborted.
 */
private void prepareRecorders() throws OperationFailedException {
  logger.info("String_Node_Str");
  for (  Entry<MediaType,RTPTranslator> e : rtpTranslators.entrySet()) {
    Recorder recorder=new RecorderRtpImpl(e.getValue());
    recorders.put(e.getKey(),recorder);
  }
}

Fixed version (ground truth):
/** 
 * Make the <tt>JireconRecorderImpl</tt> ready to start recording media streams.
 * @throws OperationFailedException if some operation failed and thepreparation is aborted.
 */
private void prepareRecorders() throws OperationFailedException {
  logger.info("String_Node_Str");
  for (  Entry<MediaType,RTPTranslator> e : rtpTranslators.entrySet()) {
    Recorder recorder=mediaService.createRecorder(e.getValue());
    recorders.put(e.getKey(),recorder);
  }
}
Program: 82004
Project: 82004
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void handleEvent(JireconEvent evt){
  String mucJid=evt.getMucJid();
switch (evt.getType()) {
case TASK_ABORTED:
    stopJireconTask(mucJid,false);
  logger.info("String_Node_Str" + mucJid + "String_Node_Str");
fireEvent(evt);
break;
case TASK_FINISED:
stopJireconTask(mucJid,true);
logger.info("String_Node_Str" + mucJid + "String_Node_Str");
fireEvent(evt);
break;
default :
break;
}
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void handleEvent(JireconEvent evt){
  String mucJid=evt.getMucJid();
switch (evt.getType()) {
case TASK_ABORTED:
    stopJireconTask(mucJid,false);
  logger.info("String_Node_Str" + mucJid + "String_Node_Str");
fireEvent(evt);
break;
case TASK_FINISED:
stopJireconTask(mucJid,true);
logger.info("String_Node_Str" + mucJid + "String_Node_Str");
fireEvent(evt);
break;
case TASK_STARTED:
logger.info("String_Node_Str" + mucJid + "String_Node_Str");
fireEvent(evt);
break;
default :
break;
}
}
Program: 82005
Project: 82005
Buggy source:
private IQ createIqSet(RecordingSession session,String status,String rid){
  return createIqSet(session,status,rid,"String_Node_Str");
}

Fixed version (ground truth):
private IQ createIqSet(RecordingSession session,String status,String rid){
  return createIqSet(session,status,rid,null);
}
Program: 82006
Project: 82006
Buggy source:
@Override public void handleEvent(JireconEvent evt){
  System.out.println("String_Node_Str" + evt.getMucJid() + "String_Node_Str"+ evt.getType());
  final String mucJid=evt.getMucJid();
  RecordingSession session=null;
  for (  RecordingSession s : recordingSessions) {
    if (0 == mucJid.compareTo(s.getMucJid())) {
      session=s;
      break;
    }
  }
  if (null == session)   return;
  IQ notification=null;
  if (JireconEvent.Type.TASK_ABORTED == evt.getType()) {
    jirecon.stopJireconTask(evt.getMucJid(),false);
    recordingSessions.remove(session);
    notification=createIqSet(session,"String_Node_Str",session.getRid());
  }
 else   if (JireconEvent.Type.TASK_FINISED == evt.getType()) {
    jirecon.stopJireconTask(evt.getMucJid(),true);
    recordingSessions.remove(session);
    notification=createIqSet(session,"String_Node_Str",session.getRid());
  }
 else   if (JireconEvent.Type.TASK_STARTED == evt.getType()) {
    notification=createIqSet(session,"String_Node_Str",session.getRid(),session.getOutputPath());
  }
  if (null != notification) {
    send(notification);
  }
}

Fixed version (ground truth):
@Override public void handleEvent(JireconEvent evt){
  System.out.println("String_Node_Str" + evt.getMucJid() + "String_Node_Str"+ evt.getType());
  final String mucJid=evt.getMucJid();
  RecordingSession session=null;
synchronized (recordingSessions) {
    for (    RecordingSession s : recordingSessions) {
      if (0 == mucJid.compareTo(s.getMucJid())) {
        session=s;
        break;
      }
    }
    if (null == session)     return;
    IQ notification=null;
    if (JireconEvent.Type.TASK_ABORTED == evt.getType()) {
      jirecon.stopJireconTask(evt.getMucJid(),false);
      recordingSessions.remove(session);
      notification=createIqSet(session,"String_Node_Str",session.getRid());
    }
 else     if (JireconEvent.Type.TASK_FINISED == evt.getType()) {
      jirecon.stopJireconTask(evt.getMucJid(),true);
      recordingSessions.remove(session);
      notification=createIqSet(session,"String_Node_Str",session.getRid());
    }
 else     if (JireconEvent.Type.TASK_STARTED == evt.getType()) {
      notification=createIqSet(session,"String_Node_Str",session.getRid(),session.getOutputPath());
    }
    if (null != notification) {
      send(notification);
    }
  }
}
Program: 82007
Project: 82007
Buggy source:
@Override public void preComponentStart(){
  System.out.println("String_Node_Str");
  if (isStarted) {
    return;
  }
  jirecon.addEventListener(this);
  try {
    jirecon.init(CONFIURATION_PATH);
  }
 catch (  OperationFailedException e) {
    e.printStackTrace();
    isStarted=false;
  }
  isStarted=true;
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
@Override public void preComponentStart(){
  if (isStarted) {
    return;
  }
  System.out.println("String_Node_Str");
  jirecon.addEventListener(this);
  try {
    jirecon.init(CONFIURATION_PATH);
  }
 catch (  OperationFailedException e) {
    e.printStackTrace();
    isStarted=false;
  }
  isStarted=true;
  System.out.println("String_Node_Str");
}
Program: 82008
Project: 82008
Buggy source:
/** 
 * As for <tt>JireconComponent</tt>, there are two kinds of "result" IQ (action="notification"). The only difference between them is the attribute "status": <ol> <li> "initiating". Notify client the "start" command has been received.</li> <li> "stopping". Notify client the "stop" command has been received.</li> </ol> <p> <strong>Warning:</strong> These "result" IQs should be sent back to client immediately after receiving "set" IQ.
 * @param iq
 * @param status
 * @param rid
 * @return
 */
private IQ createIqResult(IQ iq,String status,String rid){
  Element record=docFactory.createElement(ELEMENT_NAME,NAMESPACE);
  docFactory.createAttribute(record,"String_Node_Str","String_Node_Str");
  docFactory.createAttribute(record,"String_Node_Str",status);
  docFactory.createAttribute(record,"String_Node_Str","String_Node_Str");
  docFactory.createAttribute(record,"String_Node_Str","String_Node_Str");
  docFactory.createAttribute(record,"String_Node_Str",rid);
  IQ result=IQ.createResultIQ(iq);
  result.addExtension(new PacketExtension(record));
  return result;
}

Fixed version (ground truth):
/** 
 * As for <tt>JireconComponent</tt>, there are two kinds of "result" IQ (action="notification"). The only difference between them is the attribute "status": <ol> <li> "initiating". Notify client the "start" command has been received.</li> <li> "stopping". Notify client the "stop" command has been received.</li> </ol> <p> <strong>Warning:</strong> These "result" IQs should be sent back to client immediately after receiving "set" IQ.
 * @param iq
 * @param status
 * @param rid
 * @return
 */
private IQ createIqResult(IQ iq,String status,String rid){
  IQ result=IQ.createResultIQ(iq);
  Element record=docFactory.createElement(ELEMENT_NAME,NAMESPACE);
  record.add(docFactory.createAttribute(record,"String_Node_Str",status));
  record.add(docFactory.createAttribute(record,"String_Node_Str",rid));
  result.setChildElement(record);
  return result;
}
Program: 82009
Project: 82009
Buggy source:
@Override protected IQ handleIQSet(IQ iq) throws Exception {
  System.out.println("String_Node_Str" + iq.toXML());
  Element element=iq.getChildElement();
  System.out.println("String_Node_Str" + element.getNamespace().getStringValue());
  System.out.println("String_Node_Str" + element.getName());
  for (int i=0; i < element.attributeCount(); i++) {
    final Attribute attr=element.attribute(i);
    System.out.println(attr.getName() + "String_Node_Str" + attr.getValue());
  }
  final String action=element.attribute("String_Node_Str").getValue();
  if (0 == "String_Node_Str".compareTo(action)) {
    startRecording(iq);
  }
 else   if (0 == "String_Node_Str".compareTo(action)) {
    stopRecording(iq);
  }
  return IQ.createResultIQ(iq);
}

Fixed version (ground truth):
@Override protected IQ handleIQSet(IQ iq) throws Exception {
  System.out.println("String_Node_Str" + iq.toXML());
  Element element=iq.getChildElement();
  final String action=element.attribute("String_Node_Str").getValue();
  IQ result=null;
  if (0 == "String_Node_Str".compareTo(action)) {
    result=startRecording(iq);
  }
 else   if (0 == "String_Node_Str".compareTo(action)) {
    result=stopRecording(iq);
  }
  return result;
}
Program: 82010
Project: 82010
Buggy source:
private void startRecording(IQ iq){
  final Element element=iq.getChildElement();
  String mucJid=element.attribute("String_Node_Str").getValue();
  mucJid=mucJid.split("String_Node_Str")[0];
  RecordingSession session=new RecordingSession(mucJid);
  recordingSessions.add(session);
  send(createIqResult(iq,"String_Node_Str",session.getRid()));
  jirecon.startJireconTask(mucJid);
}

Fixed version (ground truth):
private IQ startRecording(IQ iq){
  final Element element=iq.getChildElement();
  String mucJid=element.attribute("String_Node_Str").getValue();
  mucJid=mucJid.split("String_Node_Str")[0];
  RecordingSession session=new RecordingSession(mucJid,iq.getFrom().toString());
synchronized (recordingSessions) {
    recordingSessions.add(session);
  }
  jirecon.startJireconTask(mucJid);
  return createIqResult(iq,"String_Node_Str",session.getRid());
}
Program: 82011
Project: 82011
Buggy source:
public RecordingSession(String mucJid){
  this.rid=generateRid();
  this.mucJid=mucJid;
  this.outputPath=generateOutputPath();
}

Fixed version (ground truth):
public RecordingSession(String mucJid,String clientJid){
  this.rid=generateRid();
  this.mucJid=mucJid;
  this.clientJid=clientJid;
  this.outputPath=generateOutputPath();
}
Program: 82012
Project: 82012
Buggy source:
private void stopRecording(IQ iq){
  final Element element=iq.getChildElement();
  final String rid=element.attribute("String_Node_Str").getValue();
  RecordingSession session=null;
  for (  RecordingSession s : recordingSessions) {
    if (0 == rid.compareTo(s.getRid())) {
      session=s;
      break;
    }
  }
  if (null != session) {
    send(createIqResult(iq,"String_Node_Str",rid));
    jirecon.stopJireconTask(session.getMucJid(),true);
  }
}

Fixed version (ground truth):
private IQ stopRecording(IQ iq){
  final Element element=iq.getChildElement();
  final String rid=element.attribute("String_Node_Str").getValue();
  RecordingSession session=null;
synchronized (recordingSessions) {
    for (    RecordingSession s : recordingSessions) {
      if (0 == rid.compareTo(s.getRid())) {
        session=s;
        break;
      }
    }
  }
  if (null != session) {
    jirecon.stopJireconTask(session.getMucJid(),true);
  }
  return createIqResult(iq,"String_Node_Str",rid);
}
Program: 82013
Project: 82013
Buggy source:
/** 
 * Stop the <tt>JireconTask</tt>
 */
public void stop();

Fixed version (ground truth):
/** 
 * Stop the <tt>JireconTask</tt>.
 */
public void stop();
Program: 82014
Project: 82014
Buggy source:
/** 
 * Get local candidates
 * @return List of <tt>LocalCandidate</tt>
 */
private List<LocalCandidate> getLocalCandidates(){
  List<LocalCandidate> candidates=new ArrayList<LocalCandidate>();
  for (  MediaType mediaType : MediaType.values()) {
    if (MediaType.AUDIO != mediaType && MediaType.VIDEO != mediaType) {
      continue;
    }
    IceMediaStream stream=getIceMediaStream(mediaType);
    for (    Component com : stream.getComponents()) {
      candidates.addAll(com.getLocalCandidates());
    }
  }
  return candidates;
}

Fixed version (ground truth):
/** 
 * Get local candidates of specified <tt>MediaType</tt>
 * @param mediaType
 * @return List of <tt>LocalCandidate</tt>
 */
private List<LocalCandidate> getLocalCandidates(MediaType mediaType){
  List<LocalCandidate> candidates=new ArrayList<LocalCandidate>();
  IceMediaStream stream=getIceMediaStream(mediaType);
  for (  Component com : stream.getComponents()) {
    candidates.addAll(com.getLocalCandidates());
  }
  return candidates;
}
Program: 82015
Project: 82015
Buggy source:
/** 
 * Create list of <tt>CandidatePacketExtension</tt>.
 * @return List of <tt>CandidatePacketExtension</tt>
 */
private List<CandidatePacketExtension> getLocalCandidatePacketExts(){
  List<CandidatePacketExtension> candidatePEs=new ArrayList<CandidatePacketExtension>();
  int id=1;
  for (  LocalCandidate candidate : getLocalCandidates()) {
    CandidatePacketExtension candidatePE=new CandidatePacketExtension();
    candidatePE.setComponent(candidate.getParentComponent().getComponentID());
    candidatePE.setFoundation(candidate.getFoundation());
    candidatePE.setGeneration(iceAgent.getGeneration());
    candidatePE.setID(String.valueOf(id++));
    candidatePE.setNetwork(0);
    candidatePE.setIP(candidate.getTransportAddress().getHostAddress());
    candidatePE.setPort(candidate.getTransportAddress().getPort());
    candidatePE.setPriority(candidate.getPriority());
    candidatePE.setProtocol(candidate.getTransport().toString());
    candidatePE.setType(CandidateType.valueOf(candidate.getType().toString()));
    candidatePEs.add(candidatePE);
  }
  return candidatePEs;
}

Fixed version (ground truth):
/** 
 * Create list of <tt>CandidatePacketExtension</tt> with specified <tt>MediaType</tt>.
 * @param mediaType
 * @return List of <tt>CandidatePacketExtension</tt>
 */
private List<CandidatePacketExtension> getLocalCandidatePacketExts(MediaType mediaType){
  List<CandidatePacketExtension> candidatePEs=new ArrayList<CandidatePacketExtension>();
  int id=1;
  for (  LocalCandidate candidate : getLocalCandidates(mediaType)) {
    CandidatePacketExtension candidatePE=new CandidatePacketExtension();
    candidatePE.setComponent(candidate.getParentComponent().getComponentID());
    candidatePE.setFoundation(candidate.getFoundation());
    candidatePE.setGeneration(iceAgent.getGeneration());
    candidatePE.setID(String.valueOf(id++));
    candidatePE.setNetwork(0);
    candidatePE.setIP(candidate.getTransportAddress().getHostAddress());
    candidatePE.setPort(candidate.getTransportAddress().getPort());
    candidatePE.setPriority(candidate.getPriority());
    candidatePE.setProtocol(candidate.getTransport().toString());
    candidatePE.setType(CandidateType.valueOf(candidate.getType().toString()));
    candidatePEs.add(candidatePE);
  }
  return candidatePEs;
}
Program: 82017
Project: 82017
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public AbstractPacketExtension getTransportPacketExt(MediaType mediaType){
  logger.info("String_Node_Str");
  IceUdpTransportPacketExtension transportPE=new IceUdpTransportPacketExtension();
  transportPE.setPassword(iceAgent.getLocalPassword());
  transportPE.setUfrag(iceAgent.getLocalUfrag());
  for (  CandidatePacketExtension candidatePE : getLocalCandidatePacketExts()) {
    transportPE.addCandidate(candidatePE);
  }
  return transportPE;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public AbstractPacketExtension getTransportPacketExt(MediaType mediaType){
  logger.info("String_Node_Str");
  IceUdpTransportPacketExtension transportPE=new IceUdpTransportPacketExtension();
  transportPE.setPassword(iceAgent.getLocalPassword());
  transportPE.setUfrag(iceAgent.getLocalUfrag());
  for (  CandidatePacketExtension candidatePE : getLocalCandidatePacketExts(mediaType)) {
    transportPE.addCandidate(candidatePE);
  }
  return transportPE;
}
Program: 82018
Project: 82018
Buggy source:
@Override public void init(String conferenceJid,XMPPConnection connection,String savingDir){
  logger.setLevelAll();
  logger.debug(this.getClass() + "String_Node_Str");
  transport=new JireconIceUdpTransportManagerImpl();
  srtpControl=new JireconDtlsControlManagerImpl();
  session=new JireconSessionImpl(connection,conferenceJid,savingDir);
  recorder=new JireconRecorderImpl(savingDir);
  updateState(JireconTaskState.INITIATED);
}

Fixed version (ground truth):
@Override public void init(String conferenceJid,XMPPConnection connection,String savingDir){
  logger.setLevelAll();
  logger.debug(this.getClass() + "String_Node_Str");
  new File(savingDir).mkdir();
  transport=new JireconIceUdpTransportManagerImpl();
  srtpControl=new JireconDtlsControlManagerImpl();
  JireconSessionInfo sessionInfo=new JireconSessionInfo();
  JireconRecorderInfo recorderInfo=new JireconRecorderInfo();
  session=new JireconSessionImpl(connection,conferenceJid,savingDir,sessionInfo,recorderInfo);
  recorder=new JireconRecorderImpl(savingDir,recorderInfo,sessionInfo);
  updateState(JireconTaskState.INITIATED);
}
Program: 82020
Project: 82020
Buggy source:
private void startRecordingStreams() throws IOException, MediaException, OperationFailedException {
  logger.info("String_Node_Str");
  if (!recorderInfo.readyTo(JireconRecorderEvent.START_RECORDING_STREAM)) {
    throw new OperationFailedException("String_Node_Str",OperationFailedException.GENERAL_ERROR);
  }
  for (  Entry<MediaType,Recorder> e : recorders.entrySet()) {
    e.getValue().start("String_Node_Str",SAVING_DIR);
  }
  updateState(JireconRecorderEvent.START_RECORDING_STREAM);
}

Fixed version (ground truth):
private void startRecordingStreams() throws IOException, MediaException, OperationFailedException {
  logger.info("String_Node_Str");
  if (!recorderInfo.readyTo(JireconRecorderEvent.START_RECORDING_STREAM)) {
    throw new OperationFailedException("String_Node_Str",OperationFailedException.GENERAL_ERROR);
  }
  RecorderEventHandler eventHandler=new JireconRecorderEventHandler(SAVING_DIR + "String_Node_Str");
  for (  Entry<MediaType,Recorder> e : recorders.entrySet()) {
    e.getValue().setEventHandler(eventHandler);
    e.getValue().start(e.getKey().toString(),SAVING_DIR);
  }
  updateState(JireconRecorderEvent.START_RECORDING_STREAM);
}
Program: 82021
Project: 82021
Buggy source:
@Override public synchronized boolean handleEvent(RecorderEvent evt){
  System.out.println(evt + "String_Node_Str" + evt.getAudioSsrc()+ "String_Node_Str"+ evt.getSsrc()+ "String_Node_Str"+ evt.getFilename());
  MediaType mediaType=evt.getMediaType();
  RecorderEvent.Type type=evt.getType();
  long duration=evt.getDuration();
  long ssrc=evt.getSsrc();
  if (RecorderEvent.Type.RECORDING_STARTED.equals(type)) {
    saveRecorderEvent(evt);
    return true;
  }
  if (RecorderEvent.Type.RECORDING_ENDED.equals(type)) {
    if (evt.getInstant() == -1 && duration != -1) {
      List<RecorderEvent> events=recorderEvents.get(mediaType);
      RecorderEvent start=null;
      for (      RecorderEvent e : events) {
        if (RecorderEvent.Type.RECORDING_STARTED.equals(e.getType()) && e.getSsrc() == ssrc) {
          start=e;
          break;
        }
      }
      if (start != null)       evt.setInstant(start.getInstant() + duration);
    }
    try {
      writeMetaData(evt);
    }
 catch (    IOException e) {
      logger.warn("String_Node_Str",e);
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public synchronized boolean handleEvent(RecorderEvent event){
  System.out.println(event + "String_Node_Str" + event.getSsrc());
  RecorderEvent.Type type=event.getType();
  if (RecorderEvent.Type.SPEAKER_CHANGED.equals(type)) {
    System.out.println("String_Node_Str" + event.getAudioSsrc());
    long audioSsrc=event.getAudioSsrc();
    long videoSsrc=getAssociatedSsrc(audioSsrc,MediaType.AUDIO);
    if (videoSsrc < 0) {
      logger.fatal("String_Node_Str" + audioSsrc);
      return false;
    }
    event.setSsrc(videoSsrc);
  }
  return handler.handleEvent(event);
}
Program: 82022
Project: 82022
Buggy source:
public JireconRecorderImpl(String SAVING_DIR){
  this.mediaService=LibJitsi.getMediaService();
  this.SAVING_DIR=SAVING_DIR;
  createMediaStreams();
}

Fixed version (ground truth):
public JireconRecorderImpl(String SAVING_DIR,JireconRecorderInfo recorderInfo,JireconSessionInfo sessionInfo){
  this.mediaService=LibJitsi.getMediaService();
  this.SAVING_DIR=SAVING_DIR;
  this.recorderInfo=recorderInfo;
  this.sessionInfo=sessionInfo;
  createMediaStreams();
}
Program: 82023
Project: 82023
Buggy source:
public JireconRecorderEventHandler(String filename) throws IOException {
  metaFile=new File(filename);
  if (!metaFile.createNewFile())   throw new IOException("String_Node_Str" + metaFile);
  if (!metaFile.canWrite())   throw new IOException("String_Node_Str" + metaFile);
}

Fixed version (ground truth):
public JireconRecorderEventHandler(String filename) throws IOException {
  handler=new RecorderEventHandlerJSONImpl(filename);
}
Program: 82024
Project: 82024
Buggy source:
public JireconSessionImpl(XMPPConnection connection,String conferenceJid,String SAVING_DIR){
  logger.setLevelDebug();
  this.SAVING_DIR=SAVING_DIR;
  ConfigurationService configuration=LibJitsi.getConfigurationService();
  this.NICK=configuration.getString(NICK_KEY);
  this.connection=connection;
  this.sessionInfo.setMucJid(conferenceJid);
  addPacketSendingListener();
  addPacketReceivingListener();
  JireconSessionPacketListener packetListener=new JireconSessionPacketListener(){
    @Override public void handlePacket(    Packet packet){
      if (Presence.class == packet.getClass())       handlePresencePacket((Presence)packet);
    }
  }
;
  addPacketListener(packetListener);
}

Fixed version (ground truth):
public JireconSessionImpl(XMPPConnection connection,String conferenceJid,String SAVING_DIR,JireconSessionInfo sessionInfo,JireconRecorderInfo recorderInfo){
  logger.setLevelDebug();
  this.SAVING_DIR=SAVING_DIR;
  this.sessionInfo=sessionInfo;
  this.recorderInfo=recorderInfo;
  ConfigurationService configuration=LibJitsi.getConfigurationService();
  this.NICK=configuration.getString(NICK_KEY);
  this.connection=connection;
  this.sessionInfo.setMucJid(conferenceJid);
  addPacketSendingListener();
  addPacketReceivingListener();
  JireconSessionPacketListener packetListener=new JireconSessionPacketListener(){
    @Override public void handlePacket(    Packet packet){
      if (Presence.class == packet.getClass())       handlePresencePacket((Presence)packet);
    }
  }
;
  addPacketListener(packetListener);
}
Program: 82025
Project: 82025
Buggy source:
public void testSessionAndRecorder(){
  task.start();
  try {
    Thread.sleep(20000);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  task.stop();
}

Fixed version (ground truth):
public void testSessionAndRecorder(){
  task.start();
  try {
    Thread.sleep(60000);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  task.stop();
}
Program: 82026
Project: 82026
Buggy source:
@Override public void startJireconTask(String conferenceJid) throws XMPPException {
  logger.debug(this.getClass() + "String_Node_Str" + conferenceJid);
  if (jireconTasks.containsKey(conferenceJid)) {
    logger.info("String_Node_Str" + conferenceJid + "String_Node_Str");
    return;
  }
  JireconTask j=new JireconTaskImpl();
  jireconTasks.put(conferenceJid,j);
  j.addEventListener(this);
  j.init(configuration,conferenceJid,connection,mediaService);
  j.start();
}

Fixed version (ground truth):
@Override public void startJireconTask(String conferenceJid) throws XMPPException {
  logger.debug(this.getClass() + "String_Node_Str" + conferenceJid);
synchronized (jireconTasks) {
    if (jireconTasks.containsKey(conferenceJid)) {
      logger.info("String_Node_Str" + conferenceJid + "String_Node_Str");
      return;
    }
    JireconTask j=new JireconTaskImpl();
    jireconTasks.put(conferenceJid,j);
    j.addEventListener(this);
    j.init(configuration,conferenceJid,connection,mediaService);
    j.start();
  }
}
Program: 82028
Project: 82028
Buggy source:
@Override public void disconnect(Reason reason,String reasonText){
  try {
    sendByePacket(reason,reasonText);
  }
 catch (  OperationFailedException e) {
    e.printStackTrace();
  }
  try {
    leaveConference();
  }
 catch (  OperationFailedException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void disconnect(Reason reason,String reasonText){
  try {
    sendByePacket(reason,reasonText);
  }
 catch (  OperationFailedException e) {
    e.printStackTrace();
  }
  try {
    leaveMUC();
  }
 catch (  OperationFailedException e) {
    e.printStackTrace();
  }
}
Program: 82029
Project: 82029
Buggy source:
private void sendAccpetPacket(JireconSessionInfo sessionInfo,JireconRecorderInfo recorderInfo,JireconTransportManager transportManager,JireconSrtpControlManager srtpControlManager) throws OperationFailedException {
  logger.info("String_Node_Str");
  if (!sessionInfo.readyTo(JireconSessionEvent.SEND_SESSION_ACCEPT)) {
    throw new OperationFailedException("String_Node_Str",OperationFailedException.GENERAL_ERROR);
  }
  JingleIQ acceptPacket=createAcceptPacket(sessionInfo,recorderInfo,transportManager,srtpControlManager);
  connection.sendPacket(acceptPacket);
  updateState(JireconSessionEvent.SEND_SESSION_ACCEPT);
}

Fixed version (ground truth):
private void sendAccpetPacket(JingleIQ initIq,JireconSessionInfo sessionInfo,JireconRecorderInfo recorderInfo,JireconTransportManager transportManager,JireconSrtpControlManager srtpControlManager) throws OperationFailedException {
  logger.info("String_Node_Str");
  if (!sessionInfo.readyTo(JireconSessionEvent.SEND_SESSION_ACCEPT)) {
    throw new OperationFailedException("String_Node_Str",OperationFailedException.GENERAL_ERROR);
  }
  JingleIQ acceptPacket=createAcceptPacket(initIq,sessionInfo,recorderInfo,transportManager,srtpControlManager);
  connection.sendPacket(acceptPacket);
  updateState(JireconSessionEvent.SEND_SESSION_ACCEPT);
}
Program: 82030
Project: 82030
Buggy source:
private void handlePresencePacket(Presence p){
  PacketExtension packetExt=p.getExtension(MediaExtension.NAMESPACE);
  MUCUser userExt=(MUCUser)p.getExtension("String_Node_Str","String_Node_Str");
  String remoteJid=userExt.getItem().getJid();
  if (null != remoteJid && null != packetExt) {
    MediaExtension mediaExt=(MediaExtension)packetExt;
    for (    MediaType mediaType : MediaType.values()) {
      if (MediaType.AUDIO != mediaType && MediaType.VIDEO != mediaType) {
        continue;
      }
      MediaDirection direction=MediaDirection.parseString(mediaExt.getDirection(mediaType.toString()));
      String ssrc=mediaExt.getDirection(mediaType.toString());
      if (direction == MediaDirection.SENDONLY || direction == MediaDirection.SENDRECV) {
        sessionInfo.addRemoteSsrc(mediaType,remoteJid,ssrc);
      }
    }
  }
}

Fixed version (ground truth):
private void handlePresencePacket(Presence p){
  PacketExtension packetExt=p.getExtension(MediaExtension.NAMESPACE);
  MUCUser userExt=(MUCUser)p.getExtension("String_Node_Str","String_Node_Str");
  String remoteJid=userExt.getItem().getJid();
  if (null != remoteJid && null != packetExt) {
    MediaExtension mediaExt=(MediaExtension)packetExt;
    for (    MediaType mediaType : MediaType.values()) {
      if (MediaType.AUDIO != mediaType && MediaType.VIDEO != mediaType) {
        continue;
      }
      MediaDirection direction=MediaDirection.parseString(mediaExt.getDirection(mediaType.toString()));
      String ssrc=mediaExt.getSsrc(mediaType.toString());
      if (direction == MediaDirection.SENDONLY || direction == MediaDirection.SENDRECV) {
        sessionInfo.addRemoteSsrc(mediaType,remoteJid,ssrc);
      }
    }
  }
}
Program: 82031
Project: 82031
Buggy source:
private JingleIQ createAcceptPacket(JireconSessionInfo sessionInfo,JireconRecorderInfo recorderInfo,JireconTransportManager transportManager,JireconSrtpControlManager srtpControlManager){
  logger.info("String_Node_Str");
  final List<ContentPacketExtension> contents=new ArrayList<ContentPacketExtension>();
  for (  MediaType mediaType : MediaType.values()) {
    if (MediaType.AUDIO != mediaType && MediaType.VIDEO != mediaType) {
      continue;
    }
    contents.add(createContentPacketExtension(mediaType,sessionInfo,recorderInfo,transportManager,srtpControlManager));
  }
  JingleIQ acceptJiq=JinglePacketFactory.createSessionAccept(sessionInfo.getLocalJid(),sessionInfo.getRemoteJid(),sessionInfo.getSid(),contents);
  return acceptJiq;
}

Fixed version (ground truth):
private JingleIQ createAcceptPacket(JingleIQ initIq,JireconSessionInfo sessionInfo,JireconRecorderInfo recorderInfo,JireconTransportManager transportManager,JireconSrtpControlManager srtpControlManager){
  logger.info("String_Node_Str");
  final List<ContentPacketExtension> contents=new ArrayList<ContentPacketExtension>();
  for (  MediaType mediaType : MediaType.values()) {
    if (MediaType.AUDIO != mediaType && MediaType.VIDEO != mediaType) {
      continue;
    }
    ContentPacketExtension initIqContent=JinglePacketParser.getContentPacketExt(initIq,mediaType);
    contents.add(createContentPacketExtension(mediaType,initIqContent,sessionInfo,recorderInfo,transportManager,srtpControlManager));
  }
  JingleIQ acceptJiq=JinglePacketFactory.createSessionAccept(sessionInfo.getLocalJid(),sessionInfo.getRemoteJid(),sessionInfo.getSid(),contents);
  return acceptJiq;
}
Program: 82033
Project: 82033
Buggy source:
@Override public JingleIQ connect(JireconSessionInfo sessionInfo,JireconRecorderInfo recorderInfo,JireconTransportManager transportManager,JireconSrtpControlManager srtpControlManager) throws XMPPException, OperationFailedException {
  joinConference();
  JingleIQ initPacket=waitForInitPacket();
  recordSessionInfo(initPacket);
  sendAck(initPacket);
  sendAccpetPacket(sessionInfo,recorderInfo,transportManager,srtpControlManager);
  waitForAckPacket();
  return initPacket;
}

Fixed version (ground truth):
@Override public JingleIQ connect(JireconSessionInfo sessionInfo,JireconRecorderInfo recorderInfo,JireconTransportManager transportManager,JireconSrtpControlManager srtpControlManager) throws XMPPException, OperationFailedException {
  joinMUC();
  JingleIQ initIq=waitForInitPacket();
  recordSessionInfo(initIq);
  sendAck(initIq);
  sendAccpetPacket(initIq,sessionInfo,recorderInfo,transportManager,srtpControlManager);
  waitForAckPacket();
  return initIq;
}
Program: 82034
Project: 82034
Buggy source:
public void updateState(JireconSessionEvent evt){
switch (evt) {
case JOIN_CONFERENCE:
    state=JireconSessionState.IN_CONFERENCE;
  break;
case LEAVE_CONFERENCE:
state=JireconSessionState.INIT;
break;
case SEND_SESSION_ACCEPT:
state=JireconSessionState.SENT_SESSION_ACCEPT;
break;
case SEND_SESSION_TERMINATE:
state=JireconSessionState.IN_CONFERENCE;
break;
case WAIT_SESSION_ACK:
state=JireconSessionState.CONNECTED;
break;
case WAIT_SESSION_INIT:
state=JireconSessionState.GOT_SESSION_INIT;
break;
}
}

Fixed version (ground truth):
public void updateState(JireconSessionEvent evt){
switch (evt) {
case JOIN_MUC:
    state=JireconSessionState.IN_CONFERENCE;
  break;
case LEAVE_MUC:
state=JireconSessionState.INIT;
break;
case SEND_SESSION_ACCEPT:
state=JireconSessionState.SENT_SESSION_ACCEPT;
break;
case SEND_SESSION_TERMINATE:
state=JireconSessionState.IN_CONFERENCE;
break;
case WAIT_SESSION_ACK:
state=JireconSessionState.CONNECTED;
break;
case WAIT_SESSION_INIT:
state=JireconSessionState.GOT_SESSION_INIT;
break;
}
}
Program: 82035
Project: 82035
Buggy source:
public boolean readyTo(JireconSessionEvent evt){
switch (evt) {
case JOIN_CONFERENCE:
    if (JireconSessionState.INIT != state)     return false;
  break;
case LEAVE_CONFERENCE:
if (JireconSessionState.IN_CONFERENCE != state) return false;
break;
case SEND_SESSION_ACCEPT:
if (JireconSessionState.GOT_SESSION_INIT != state) return false;
break;
case SEND_SESSION_TERMINATE:
if (JireconSessionState.CONNECTED != state) return false;
break;
case WAIT_SESSION_ACK:
if (JireconSessionState.SENT_SESSION_ACCEPT != state) return false;
break;
case WAIT_SESSION_INIT:
if (JireconSessionState.IN_CONFERENCE != state) return false;
break;
}
return true;
}

Fixed version (ground truth):
public boolean readyTo(JireconSessionEvent evt){
switch (evt) {
case JOIN_MUC:
    if (JireconSessionState.INIT != state)     return false;
  break;
case LEAVE_MUC:
if (JireconSessionState.IN_CONFERENCE != state) return false;
break;
case SEND_SESSION_ACCEPT:
if (JireconSessionState.GOT_SESSION_INIT != state) return false;
break;
case SEND_SESSION_TERMINATE:
if (JireconSessionState.CONNECTED != state) return false;
break;
case WAIT_SESSION_ACK:
if (JireconSessionState.SENT_SESSION_ACCEPT != state) return false;
break;
case WAIT_SESSION_INIT:
if (JireconSessionState.IN_CONFERENCE != state) return false;
break;
}
return true;
}
Program: 82036
Project: 82036
Buggy source:
/** 
 * Join a JitsiMeet conference, prepare for building Jingle session.
 * @throws XMPPException
 */
@Override public void startSession(String conferenceJid) throws XMPPException {
  info.setConferenceJid(conferenceJid);
  LibJitsi.start();
  initiateIceAgent();
  joinConference();
}

Fixed version (ground truth):
/** 
 * Join a JitsiMeet conference, prepare for building Jingle session.
 * @throws XMPPException
 */
@Override public void startSession(String conferenceJid) throws XMPPException {
  info.setConferenceJid(conferenceJid);
  initiateIceAgent();
  joinConference();
}
Program: 82037
Project: 82037
Buggy source:
/** 
 * Leave this JitsiMeet conference
 */
@Override public void terminateSession(){
  closeSession();
  leaveConference();
  uninitiateIceAgent();
  LibJitsi.stop();
}

Fixed version (ground truth):
/** 
 * Leave this JitsiMeet conference
 */
@Override public void terminateSession(){
  closeSession();
  leaveConference();
  uninitiateIceAgent();
}
Program: 82038
Project: 82038
Buggy source:
/** 
 * Uninitialize JingleSessionManager, such as release some system resources. This method should be called at the end.
 * @return True if succeeded, false if failed.
 */
public boolean uninit();

Fixed version (ground truth):
/** 
 * Uninitialize JingleSessionManager, such as release some system resources. This method should be called at the end.
 * @return True if succeeded, false if failed.
 */
public void uninit();
Program: 82039
Project: 82039
Buggy source:
/** 
 * Initialize the manager. This method should be called before open any Jingle session.
 * @throws XMPPException Throws XMPPException if can't construct XMPPconnection.
 */
@Override public void init(JireconConfiguration configuration) throws XMPPException {
  final String xmppHost=configuration.getProperty(XMPP_HOST_KEY);
  final int xmppPort=Integer.valueOf(configuration.getProperty(XMPP_PORT_KEY));
  try {
    connect(xmppHost,xmppPort);
    login();
  }
 catch (  XMPPException e) {
    logger.fatal(e.getXMPPError() + "String_Node_Str");
    disconnect();
    throw e;
  }
  initiatePacketProviders();
  initiatePacketListeners();
}

Fixed version (ground truth):
/** 
 * Initialize the manager. This method should be called before open any Jingle session.
 * @throws XMPPException Throws XMPPException if can't construct XMPPconnection.
 */
@Override public void init(JireconConfiguration configuration) throws XMPPException {
  LibJitsi.start();
  final String xmppHost=configuration.getProperty(XMPP_HOST_KEY);
  final int xmppPort=Integer.valueOf(configuration.getProperty(XMPP_PORT_KEY));
  try {
    connect(xmppHost,xmppPort);
    login();
  }
 catch (  XMPPException e) {
    logger.fatal(e.getXMPPError() + "String_Node_Str");
    disconnect();
    throw e;
  }
  initiatePacketProviders();
  initiatePacketListeners();
}
Program: 82040
Project: 82040
Buggy source:
/** 
 * Uninitialize this Jingle session manager.
 */
@Override public boolean uninit(){
  if (sessions != null && sessions.isEmpty()) {
    for (    Map.Entry<String,JireconSession> e : sessions.entrySet()) {
      e.getValue().terminateSession();
    }
  }
  disconnect();
  return true;
}

Fixed version (ground truth):
/** 
 * Uninitialize this Jingle session manager.
 */
@Override public void uninit(){
  if (sessions != null && sessions.isEmpty()) {
    for (    Map.Entry<String,JireconSession> e : sessions.entrySet()) {
      e.getValue().terminateSession();
    }
  }
  disconnect();
  LibJitsi.stop();
}
Program: 82041
Project: 82041
Buggy source:
@Override public SessionInfo getSessionInfo(String conferenceJid){
  return sessions.get(conferenceJid).getSessionInfo();
}

Fixed version (ground truth):
@Override public SessionInfo getSessionInfo(String conferenceJid){
  final JireconSession session=sessions.get(conferenceJid);
  if (null != session) {
    return session.getSessionInfo();
  }
 else {
    return null;
  }
}
Program: 82042
Project: 82042
Buggy source:
/** 
 * Close an existed Jingle session with specified conference id.
 * @param conferenceJid
 * @return True if succeeded, false if failed.
 */
@Override public void closeJingleSession(String conferenceJid){
  if (null == sessions || !sessions.containsKey(conferenceJid))   return;
  JireconSession js=sessions.get(conferenceJid);
  sessions.remove(conferenceJid);
  js.terminateSession();
}

Fixed version (ground truth):
/** 
 * Close an existed Jingle session with specified conference id.
 * @param conferenceJid
 * @return True if succeeded, false if failed.
 */
@Override public void closeJingleSession(String conferenceJid){
  if (null == sessions || !sessions.containsKey(conferenceJid)) {
    return;
  }
  JireconSession js=sessions.remove(conferenceJid);
  if (null != js) {
    js.terminateSession();
  }
}
Program: 82044
Project: 82044
Buggy source:
@Override public SpearalDateTime readDateTime(int parameterizedType) throws IOException {
  boolean date=((parameterizedType & 0x08) != 0);
  boolean time=((parameterizedType & 0x04) != 0);
  int year=0;
  int month=0;
  int day=0;
  int hours=0;
  int minutes=0;
  int seconds=0;
  int nanoseconds=0;
  if (date) {
    ensureAvailable(2);
    month=(buffer[position++] & 0xff);
    day=(buffer[position++] & 0xff);
    int length0=((month >>> 4) & 0x03);
    boolean inverse=((month & 0x80) != 0);
    month&=0x0f;
    ensureAvailable(length0 + 1);
    year=readUnsignedIntegerValue(length0);
    if (inverse)     year=-year;
    year+=2000;
  }
  if (time) {
    ensureAvailable(3);
    hours=(buffer[position++] & 0xff);
    minutes=(buffer[position++] & 0xff);
    seconds=(buffer[position++] & 0xff);
switch (parameterizedType & 0x03) {
case 1:
      nanoseconds=readUnsignedIntegerValue(hours >>> 5);
    break;
case 2:
  nanoseconds=readUnsignedIntegerValue(hours >>> 5) * 1000;
break;
case 3:
nanoseconds=readUnsignedIntegerValue(hours >>> 5) * 1000000;
break;
}
hours&=0x1f;
}
return new SpearalDateTime(year,month,day,hours,minutes,seconds,nanoseconds,date,time);
}

Fixed version (ground truth):
@Override public SpearalDateTime readDateTime(int parameterizedType) throws IOException {
  boolean date=((parameterizedType & 0x08) != 0);
  boolean time=((parameterizedType & 0x04) != 0);
  int year=0;
  int month=0;
  int day=0;
  int hours=0;
  int minutes=0;
  int seconds=0;
  int nanoseconds=0;
  if (date) {
    ensureAvailable(2);
    month=(buffer[position++] & 0xff);
    day=(buffer[position++] & 0xff);
    int length0=((month >>> 4) & 0x03);
    boolean inverse=((month & 0x80) != 0);
    month&=0x0f;
    ensureAvailable(length0 + 1);
    year=readUnsignedIntegerValue(length0);
    if (inverse)     year=-year;
    year+=2000;
  }
  if (time) {
    ensureAvailable(3);
    hours=(buffer[position++] & 0xff);
    minutes=(buffer[position++] & 0xff);
    seconds=(buffer[position++] & 0xff);
    int subsecondsType=(parameterizedType & 0x03);
    if (subsecondsType != 0) {
      int length0=(hours >>> 5);
      ensureAvailable(length0 + 1);
      nanoseconds=readUnsignedIntegerValue(length0);
      if (subsecondsType == 2)       nanoseconds*=1000;
 else       if (subsecondsType == 3)       nanoseconds*=1000000;
    }
    hours&=0x1f;
  }
  return new SpearalDateTime(year,month,day,hours,minutes,seconds,nanoseconds,date,time);
}
Program: 82045
Project: 82045
Buggy source:
@Override public void write(ExtendedSpearalEncoder encoder,Object holder) throws IOException, IllegalAccessException, InvocationTargetException {
  encoder.writeCollection((Collection<?>)(field != null ? field.get(holder) : getter.invoke(holder)));
}

Fixed version (ground truth):
@Override public void write(ExtendedSpearalEncoder encoder,Object holder) throws IOException, IllegalAccessException, InvocationTargetException {
  Collection<?> value=(Collection<?>)(field != null ? field.get(holder) : getter.invoke(holder));
  if (value == null)   encoder.writeNull();
 else   encoder.writeCollection(value);
}
Program: 82046
Project: 82046
Buggy source:
@Override public void write(ExtendedSpearalEncoder encoder,Object holder) throws IOException, IllegalAccessException, InvocationTargetException {
  encoder.writeMap((Map<?,?>)(field != null ? field.get(holder) : getter.invoke(holder)));
}

Fixed version (ground truth):
@Override public void write(ExtendedSpearalEncoder encoder,Object holder) throws IOException, IllegalAccessException, InvocationTargetException {
  Map<?,?> value=(Map<?,?>)(field != null ? field.get(holder) : getter.invoke(holder));
  if (value == null)   encoder.writeNull();
 else   encoder.writeMap(value);
}
Program: 82047
Project: 82047
Buggy source:
@Test public void test() throws IOException {
  encodeDecode(new ChildBean(),-1);
  encodeDecode(new ChildBean(-3,"String_Node_Str",true,0.001),-1);
  ChildBean bean=new ChildBean(56,"String_Node_Str",false,3.001);
  bean.getSimpleBeans().add(new SimpleBean(true,3,5.09,"String_Node_Str"));
  bean.getSimpleBeans().add(new SimpleBean(false,-5,-10.09,"String_Node_Str"));
  encodeDecode(bean,-1);
}

Fixed version (ground truth):
@Test public void test() throws IOException {
  encodeDecode(new ChildBean(),-1);
  encodeDecode(new ChildBean(-3,"String_Node_Str",true,0.001),-1);
  ChildBean bean=new ChildBean(56,"String_Node_Str",false,3.001);
  bean.setSimpleBeans(new HashSet<SimpleBean>());
  bean.getSimpleBeans().add(new SimpleBean(true,3,5.09,"String_Node_Str"));
  bean.getSimpleBeans().add(new SimpleBean(false,-5,-10.09,"String_Node_Str"));
  encodeDecode(bean,-1);
}
Program: 82048
Project: 82048
Buggy source:
@Before public void setUp() throws Exception {
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  printStream=System.out;
}
Program: 82049
Project: 82049
Buggy source:
public ChildBean(int parentIntProperty,String parentStringProperty,boolean childBooleanProperty,double childDoubleProperty){
  super(parentIntProperty,parentStringProperty);
  this.childBooleanProperty=childBooleanProperty;
  this.childDoubleProperty=childDoubleProperty;
  this.simpleBeans=new HashSet<SimpleBean>();
}

Fixed version (ground truth):
public ChildBean(int parentIntProperty,String parentStringProperty,boolean childBooleanProperty,double childDoubleProperty){
  super(parentIntProperty,parentStringProperty);
  this.childBooleanProperty=childBooleanProperty;
  this.childDoubleProperty=childDoubleProperty;
}
Program: 82050
Project: 82050
Buggy source:
/** 
 * Returns true iff the config is valid. Checks if number of edges is integer and the beta control parameter is valid.
 * @return true if the parameter set is valid.
 */
public boolean isValid(){
  return !(edgesPerNewNode < 2 || edgesPerNewNode + 1 > getNumberOfNodes());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean isValid(){
  return super.isValid() && !(edgesPerNewNode < 2 || edgesPerNewNode + 1 > getNumberOfNodes());
}
Program: 82051
Project: 82051
Buggy source:
/** 
 * Tests if the config is valid
 * @return true if the configuration is valid.
 */
@Override public boolean isValid(){
  return super.isValid() && numberOfEdges <= 0.5 * getNumberOfNodes() * (getNumberOfNodes() - 1);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean isValid(){
  BigInteger maxNumberOfEdges=BigInteger.valueOf(getNumberOfNodes());
  maxNumberOfEdges=maxNumberOfEdges.multiply(maxNumberOfEdges.subtract(BigInteger.ONE));
  maxNumberOfEdges=maxNumberOfEdges.divide(BigInteger.valueOf(2));
  return super.isValid() && numberOfEdges > 0 && BigInteger.valueOf(numberOfEdges).compareTo(maxNumberOfEdges) < 1;
}
Program: 82052
Project: 82052
Buggy source:
/** 
 * Tests if the config is valid. TODO: Check if sufficient
 * @return true iff the config is valid.
 */
public boolean isValid(){
  return numberOfNodes >= 2;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean isValid(){
  return numberOfNodes >= 2;
}
Program: 82053
Project: 82053
Buggy source:
/** 
 * Create a node with labels and properties.
 * @param database to create the node in.
 * @return created node.
 */
Node createNode(GraphDatabaseService database);

Fixed version (ground truth):
/** 
 * Create a node with labels and properties.
 * @param batchInserter to create the node in.
 * @return created node ID.
 */
long createNode(BatchInserter batchInserter);