nus-yam/ex-repair huggingface dataset:
Program: 10880
Project: 10880
Buggy source:
@Override public void onContentRequest(HttpPlayerSession session) throws Exception {
  MediaPipelineFactory mpf=session.getMediaPipelineFactory();
  MediaPipeline mp=mpf.create();
  session.releaseOnTerminate(mp);
  PlayerEndpoint playerEndPoint=mp.newPlayerEndpoint("String_Node_Str").build();
  JackVaderFilter filter=mp.newJackVaderFilter().build();
  playerEndPoint.connect(filter);
  session.setAttribute("String_Node_Str",playerEndPoint);
  HttpEndpoint httpEndpoint=session.getMediaPipelineFactory().create().newHttpGetEndpoint().terminateOnEOS().build();
  filter.connect(httpEndpoint);
  session.start(httpEndpoint);
}

Fixed version (ground truth):
@Override public void onContentRequest(HttpPlayerSession session) throws Exception {
  MediaPipelineFactory mpf=session.getMediaPipelineFactory();
  MediaPipeline mp=mpf.create();
  session.releaseOnTerminate(mp);
  PlayerEndpoint playerEndPoint=mp.newPlayerEndpoint("String_Node_Str").build();
  JackVaderFilter filter=mp.newJackVaderFilter().build();
  playerEndPoint.connect(filter);
  session.setAttribute("String_Node_Str",playerEndPoint);
  HttpEndpoint httpEndpoint=mp.newHttpGetEndpoint().terminateOnEOS().build();
  filter.connect(httpEndpoint);
  session.start(httpEndpoint);
}
Program: 10881
Project: 10881
Buggy source:
@Override public void onContentRequest(HttpPlayerSession session) throws Exception {
  if (CpRtcRtpJackHandler.sharedFilterReference == null) {
    session.terminate(500,"String_Node_Str");
  }
 else {
    HttpEndpoint httpEndpoint=session.getMediaPipelineFactory().create().newHttpGetEndpoint().terminateOnEOS().build();
    CpRtcRtpJackHandler.sharedFilterReference.connect(httpEndpoint);
    session.start(httpEndpoint);
  }
}

Fixed version (ground truth):
@Override public void onContentRequest(HttpPlayerSession session) throws Exception {
  if (CpRtcRtpJackHandler.sharedFilterReference == null) {
    session.terminate(500,"String_Node_Str");
  }
 else {
    HttpEndpoint httpEndpoint=CpRtcRtpJackHandler.sharedFilterReference.getMediaPipeline().newHttpGetEndpoint().terminateOnEOS().build();
    CpRtcRtpJackHandler.sharedFilterReference.connect(httpEndpoint);
    session.start(httpEndpoint);
  }
}
Program: 10882
Project: 10882
Buggy source:
@Override public void onContentRequest(final HttpPlayerSession session) throws Exception {
  if (CpRtcRtpZbarHandler.sharedFilterReference == null) {
    session.terminate(500,"String_Node_Str");
    return;
  }
  CpRtcRtpZbarHandler.sharedFilterReference.addCodeFoundListener(new MediaEventListener<CodeFoundEvent>(){
    @Override public void onEvent(    CodeFoundEvent event){
      session.publishEvent(new ContentEvent(event.getType(),event.getValue()));
    }
  }
);
  HttpEndpoint httpEndpoint=session.getMediaPipelineFactory().create().newHttpGetEndpoint().terminateOnEOS().build();
  CpRtcRtpZbarHandler.sharedFilterReference.connect(httpEndpoint);
  session.start(httpEndpoint);
}

Fixed version (ground truth):
@Override public void onContentRequest(final HttpPlayerSession session) throws Exception {
  if (CpRtcRtpZbarHandler.sharedFilterReference == null) {
    session.terminate(500,"String_Node_Str");
    return;
  }
  CpRtcRtpZbarHandler.sharedFilterReference.addCodeFoundListener(new MediaEventListener<CodeFoundEvent>(){
    @Override public void onEvent(    CodeFoundEvent event){
      session.publishEvent(new ContentEvent(event.getType(),event.getValue()));
    }
  }
);
  HttpEndpoint httpEndpoint=CpRtcRtpZbarHandler.sharedFilterReference.getMediaPipeline().newHttpGetEndpoint().terminateOnEOS().build();
  CpRtcRtpZbarHandler.sharedFilterReference.connect(httpEndpoint);
  session.start(httpEndpoint);
}
Program: 10883
Project: 10883
Buggy source:
@Bean public ServletRegistrationBean repositoryServletRegistrationBean(){
  return new ServletRegistrationBean(new RepositoryHttpServlet(),"String_Node_Str");
}

Fixed version (ground truth):
@Bean public ServletRegistrationBean repositoryServletRegistrationBean(){
  ServletRegistrationBean servletRegistrationBean=new ServletRegistrationBean(new RepositoryHttpServlet(),"String_Node_Str");
  servletRegistrationBean.setLoadOnStartup(1);
  return servletRegistrationBean;
}
Program: 10884
Project: 10884
Buggy source:
public static Object[] extractEventParams(Annotation[][] parameterAnnotations,Props data){
  List<String> names=getParamNames(parameterAnnotations);
  Object[] params=new Object[names.size()];
  for (int i=0; i < names.size(); i++) {
    String name=names.get(i);
    if (name.equals("String_Node_Str")) {
      params[i]=data.getProp(name);
    }
  }
  return params;
}

Fixed version (ground truth):
public static Object[] extractEventParams(Annotation[][] parameterAnnotations,Props data){
  List<String> names=getParamNames(parameterAnnotations);
  Object[] params=new Object[names.size()];
  for (int i=0; i < names.size(); i++) {
    String name=names.get(i);
    params[i]=data.getProp(name);
  }
  return params;
}
Program: 10885
Project: 10885
Buggy source:
public static ResponseError newFromException(Exception e){
  StringWriter writer=new StringWriter();
  e.printStackTrace(new PrintWriter(writer));
  return new ResponseError(1,e.getClass().getSimpleName() + "String_Node_Str" + e.getMessage(),writer.toString());
}

Fixed version (ground truth):
public static ResponseError newFromException(Exception e){
  StringWriter writer=new StringWriter();
  e.printStackTrace(new PrintWriter(writer));
  return new ResponseError(-1,e.getClass().getSimpleName() + "String_Node_Str" + e.getMessage(),writer.toString());
}
Program: 10886
Project: 10886
Buggy source:
@Test public void test() throws IOException, InterruptedException {
  JsonRpcClient client=createJsonRpcClient("String_Node_Str");
  try {
    client.sendRequest("String_Node_Str");
    Assert.fail("String_Node_Str");
  }
 catch (  JsonRpcErrorException e) {
    Assert.assertEquals("String_Node_Str",e.getMessage());
    Assert.assertEquals("String_Node_Str",e.getData());
    Assert.assertEquals(-1,e.getCode());
  }
  try {
    client.sendRequest("String_Node_Str");
    Assert.fail("String_Node_Str");
  }
 catch (  JsonRpcErrorException e) {
    Assert.assertEquals("String_Node_Str",e.getMessage());
    Assert.assertEquals("String_Node_Str",e.getData());
    Assert.assertEquals(-1,e.getCode());
  }
  try {
    client.sendRequest("String_Node_Str");
    Assert.fail("String_Node_Str");
  }
 catch (  RuntimeException e) {
    String expected="String_Node_Str";
    Assert.assertEquals(expected,e.getMessage().substring(0,expected.length()));
  }
  client.close();
}

Fixed version (ground truth):
@Test public void test() throws IOException, InterruptedException {
  JsonRpcClient client=createJsonRpcClient("String_Node_Str");
  try {
    client.sendRequest("String_Node_Str");
    Assert.fail("String_Node_Str");
  }
 catch (  JsonRpcErrorException e) {
    checkException(e,"String_Node_Str","String_Node_Str");
  }
  try {
    client.sendRequest("String_Node_Str");
    Assert.fail("String_Node_Str");
  }
 catch (  JsonRpcErrorException e) {
    checkException(e,"String_Node_Str","String_Node_Str");
  }
  try {
    client.sendRequest("String_Node_Str");
    Assert.fail("String_Node_Str");
  }
 catch (  JsonRpcErrorException e) {
    checkException(e,"String_Node_Str","String_Node_Str");
  }
  client.close();
}
Program: 10887
Project: 10887
Buggy source:
@Override public void addWindow(PointerDetectorWindowMediaParam window,Continuation<Void> cont){
  Map<String,MediaParam> params=new HashMap<String,MediaParam>(4);
  PointerDetectorWindowMediaParam param=new PointerDetectorWindowMediaParamBuilder(window.getId(),window.getHeight(),window.getWidth(),window.getUpperRightX(),window.getUpperRightY()).build();
  params.put(ADD_NEW_WINDOW_PARAM_WINDOW,param);
  invoke(ADD_NEW_WINDOW,params,new VoidContinuationWrapper(cont));
}

Fixed version (ground truth):
@Override public void addWindow(PointerDetectorWindowMediaParam window,Continuation<Void> cont){
  Map<String,MediaParam> params=newHashMapWithExpectedSize(1);
  params.put(ADD_NEW_WINDOW_PARAM_WINDOW,window);
  invoke(ADD_NEW_WINDOW,params,new VoidContinuationWrapper(cont));
}
Program: 10888
Project: 10888
Buggy source:
@Override public void removeWindow(String windowId,Continuation<Void> cont){
  Map<String,MediaParam> params=new HashMap<String,MediaParam>(4);
  StringMediaParam param=new StringMediaParam();
  param.setString(windowId);
  params.put(REMOVE_WINDOW_PARAM_WINDOW_ID,param);
  invoke(REMOVE_WINDOW,params,new VoidContinuationWrapper(cont));
}

Fixed version (ground truth):
@Override public void removeWindow(String windowId,Continuation<Void> cont){
  Map<String,MediaParam> params=newHashMapWithExpectedSize(1);
  StringMediaParam param=new StringMediaParam();
  param.setString(windowId);
  params.put(REMOVE_WINDOW_PARAM_WINDOW_ID,param);
  invoke(REMOVE_WINDOW,params,new VoidContinuationWrapper(cont));
}
Program: 10889
Project: 10889
Buggy source:
/** 
 * Adds a new detector window, represented by a simple square or rectangle in the image.
 * @param id
 * @param height
 * @param width
 * @param upperRightX
 * @param upperRightY
 * @return an adder object to add created windows to the set of windows
 */
public void addDetectorWindow(PointerDetectorWindowMediaParam window){
  KmsMediaPointerDetectorWindow kmsWindow=new KmsMediaPointerDetectorWindow(window.getUpperRightX(),window.getUpperRightY(),window.getWidth(),window.getHeight(),window.getId());
  windows.add(kmsWindow);
}

Fixed version (ground truth):
/** 
 * Adds a new detector window, represented by a simple square or rectangle in the image.
 * @param id
 * @param height
 * @param width
 * @param upperRightX
 * @param upperRightY
 * @return an adder object to add created windows to the set of windows
 */
public void addDetectorWindow(PointerDetectorWindowMediaParam window){
  KmsMediaPointerDetectorWindow kmsWindow=new KmsMediaPointerDetectorWindow(window.getUpperRightX(),window.getUpperRightY(),window.getWidth(),window.getHeight(),window.getId());
  kmsWindow.setActiveOverlayImageUri(window.getActiveImageUri().toString());
  kmsWindow.setInactiveOverlayImageUri(window.getInactiveImageUri().toString());
  kmsWindow.setOverlayTransparency(window.getImageTransparency());
  windows.add(kmsWindow);
}
Program: 10890
Project: 10890
Buggy source:
/** 
 * Constructor for the builder, with the minimum set of attributes to build a window. If no further configuration is don, the window will appear outlined as a box.
 * @param id id of the window
 * @param height of the window
 * @param width of the window
 * @param upperRightX x coordinate of the upper right corner
 * @param upperRightY y coordinate of the upper right corner
 */
public PointerDetectorWindowMediaParamBuilder(final String id,final int height,final int width,final int upperRightX,final int upperRightY){
  window=new KmsMediaPointerDetectorWindow(height,height,width,height,id);
}

Fixed version (ground truth):
/** 
 * Constructor for the builder, with the minimum set of attributes to build a window. If no further configuration is don, the window will appear outlined as a box.
 * @param id id of the window
 * @param height of the window
 * @param width of the window
 * @param upperRightX x coordinate of the upper right corner
 * @param upperRightY y coordinate of the upper right corner
 */
public PointerDetectorWindowMediaParamBuilder(final String id,final int height,final int width,final int upperRightX,final int upperRightY){
  window=new KmsMediaPointerDetectorWindow(upperRightX,upperRightY,width,height,id);
}
Program: 10891
Project: 10891
Buggy source:
protected Map<String,KmsMediaParam> transformMediaParamsMap(Map<String,MediaParam> params){
  int mapSize=1 + (int)(params.size() / 0.75);
  Map<String,KmsMediaParam> kmsParams=new HashMap<String,KmsMediaParam>(mapSize);
  for (  Entry<String,MediaParam> entry : params.entrySet()) {
    kmsParams.put(entry.getKey(),((AbstractMediaParam)entry.getValue()).getThriftParams());
  }
  return kmsParams;
}

Fixed version (ground truth):
protected Map<String,KmsMediaParam> transformMediaParamsMap(Map<String,MediaParam> params){
  Map<String,KmsMediaParam> kmsParams=newHashMapWithExpectedSize(params.size());
  for (  Entry<String,MediaParam> entry : params.entrySet()) {
    kmsParams.put(entry.getKey(),((AbstractMediaParam)entry.getValue()).getThriftParams());
  }
  return kmsParams;
}
Program: 10892
Project: 10892
Buggy source:
@Override public T withWindow(PointerDetectorWindowMediaParam window){
  param.addDetectorWindow(window);
  return self();
}

Fixed version (ground truth):
@Override public T withWindow(PointerDetectorWindowMediaParam window){
  initialiseMediaParam();
  param.addDetectorWindow(window);
  return self();
}
Program: 10893
Project: 10893
Buggy source:
@Override public void addWindow(PointerDetectorWindowMediaParam window,Continuation<Void> cont){
}

Fixed version (ground truth):
@Override public void addWindow(PointerDetectorWindowMediaParam window,Continuation<Void> cont){
  Map<String,MediaParam> params=new HashMap<String,MediaParam>(4);
  PointerDetectorWindowMediaParam param=new PointerDetectorWindowMediaParamBuilder(window.getId(),window.getHeight(),window.getWidth(),window.getUpperRightX(),window.getUpperRightY()).build();
  params.put(ADD_NEW_WINDOW_PARAM_WINDOW,param);
  invoke(ADD_NEW_WINDOW,params,new VoidContinuationWrapper(cont));
}
Program: 10894
Project: 10894
Buggy source:
@Override public void removeWindow(String windowId,Continuation<Void> cont){
  Map<String,MediaParam> params=new HashMap<String,MediaParam>(4);
  StringMediaParam param=new StringMediaParam();
  param.setString(windowId);
  params.put(REMOVE_WINDOW_PARAM_WINDOW_ID,param);
  invoke(REMOVE_WINDOW,params);
}

Fixed version (ground truth):
@Override public void removeWindow(String windowId,Continuation<Void> cont){
  Map<String,MediaParam> params=new HashMap<String,MediaParam>(4);
  StringMediaParam param=new StringMediaParam();
  param.setString(windowId);
  params.put(REMOVE_WINDOW_PARAM_WINDOW_ID,param);
  invoke(REMOVE_WINDOW,params,new VoidContinuationWrapper(cont));
}
Program: 10895
Project: 10895
Buggy source:
/** 
 * Adds a new detector window, represented by a simple square or rectangle in the image.
 * @param id
 * @param height
 * @param width
 * @param upperRightX
 * @param upperRightY
 * @return an adder object to add created windows to the set of windows
 */
public void addDetectorWindow(PointerDetectorWindowMediaParam window){
}

Fixed version (ground truth):
/** 
 * Adds a new detector window, represented by a simple square or rectangle in the image.
 * @param id
 * @param height
 * @param width
 * @param upperRightX
 * @param upperRightY
 * @return an adder object to add created windows to the set of windows
 */
public void addDetectorWindow(PointerDetectorWindowMediaParam window){
  KmsMediaPointerDetectorWindow kmsWindow=new KmsMediaPointerDetectorWindow(window.getUpperRightX(),window.getUpperRightY(),window.getWidth(),window.getHeight(),window.getId());
  windows.add(kmsWindow);
}
Program: 10896
Project: 10896
Buggy source:
@Override public List<RepositoryItem> findRepositoryItemsByAttValue(String attributeName,String value){
  return createItemsForIds(metadata.findRepositoryItemsByAttValue(attributeName,value));
}

Fixed version (ground truth):
@Override public List<RepositoryItem> findRepositoryItemsByAttValue(String attributeName,String value){
  return createItemsForIds(metadata.findByAttValue(attributeName,value));
}
Program: 10897
Project: 10897
Buggy source:
@Override public List<RepositoryItem> findRepositoryItemsByAttRegex(String attributeName,String regex){
  return createItemsForIds(metadata.findRepositoryItemsByAttRegex(attributeName,regex));
}

Fixed version (ground truth):
@Override public List<RepositoryItem> findRepositoryItemsByAttRegex(String attributeName,String regex){
  return createItemsForIds(metadata.findByAttRegex(attributeName,regex));
}
Program: 10898
Project: 10898
Buggy source:
private String loadFileAsString() throws IOException {
  StringBuilder sb=new StringBuilder();
  BufferedReader br=new BufferedReader(new FileReader(itemsMetadataFile));
  String line;
  while ((line=br.readLine()) != null) {
    sb.append(line).append("String_Node_Str");
  }
  br.close();
  return sb.toString();
}

Fixed version (ground truth):
private String loadFileAsString() throws IOException {
  if (!itemsMetadataFile.exists()) {
    return "String_Node_Str";
  }
  StringBuilder sb=new StringBuilder();
  FileReader metadataFile=new FileReader(itemsMetadataFile);
  BufferedReader br=new BufferedReader(metadataFile);
  String line;
  while ((line=br.readLine()) != null) {
    sb.append(line).append("String_Node_Str");
  }
  br.close();
  return sb.toString();
}
Program: 10899
Project: 10899
Buggy source:
public void save(){
  try {
    PrintWriter writer=new PrintWriter(itemsMetadataFile);
    String content=JSON.serialize(itemsMetadata);
    writer.print(content);
    writer.close();
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void save(){
  try {
    if (!itemsMetadataFile.exists()) {
      itemsMetadataFile.getParentFile().mkdirs();
      itemsMetadataFile.createNewFile();
    }
    PrintWriter writer=new PrintWriter(itemsMetadataFile);
    String content=JSON.serialize(itemsMetadata);
    writer.print(content);
    writer.close();
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
  }
}
Program: 10900
Project: 10900
Buggy source:
private void loadItemsMetadata() throws IOException {
  DBObject contents=(DBObject)JSON.parse(loadFileAsString());
  itemsMetadata=new ConcurrentHashMap<String,Map<String,String>>();
  for (  String key : contents.keySet()) {
    try {
      DBObject metadata=(DBObject)contents.get(key);
      Map<String,String> map=new HashMap<String,String>();
      for (      String metadataKey : metadata.keySet()) {
        map.put(key,metadata.get(metadataKey).toString());
      }
    }
 catch (    ClassCastException e) {
      log.warn("String_Node_Str" + key + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private void loadItemsMetadata() throws IOException {
  itemsMetadata=new ConcurrentHashMap<String,Map<String,String>>();
  DBObject contents=(DBObject)JSON.parse(loadFileAsString());
  if (contents != null) {
    for (    String key : contents.keySet()) {
      try {
        DBObject metadata=(DBObject)contents.get(key);
        Map<String,String> map=new HashMap<String,String>();
        for (        String metadataKey : metadata.keySet()) {
          map.put(metadataKey,metadata.get(metadataKey).toString());
        }
        itemsMetadata.put(key,map);
      }
 catch (      ClassCastException e) {
        log.warn("String_Node_Str" + key + "String_Node_Str");
      }
    }
  }
}
Program: 10901
Project: 10901
Buggy source:
private SdpEndPoint buildAndConnectSdpEndPoint(MediaElement sourceElement,MediaElement[] sinkElements){
  getLogger().info("String_Node_Str");
  if (sinkElements != null && sinkElements.length > 0) {
    for (    MediaElement e : sinkElements) {
      Assert.notNull(e,"String_Node_Str",10023);
    }
  }
  MediaElement candidate=null;
  if (sinkElements == null || sinkElements.length == 0) {
    candidate=sourceElement;
  }
 else {
    candidate=sinkElements[0];
  }
  getLogger().info("String_Node_Str" + candidate);
  MediaPipeline mediaPipeline=null;
  if (candidate != null) {
    mediaPipeline=candidate.getMediaPipeline();
  }
 else {
    mediaPipeline=mediaPipelineFactory.create();
    releaseOnTerminate(mediaPipeline);
  }
  getLogger().info("String_Node_Str");
  SdpEndPoint sdpEndPoint=buildSdpEndPoint(mediaPipeline);
  releaseOnTerminate(sdpEndPoint);
  if (sourceElement == null) {
    sourceElement=sdpEndPoint;
  }
  getLogger().info("String_Node_Str");
  if (sinkElements != null) {
    connect(sdpEndPoint,sinkElements);
  }
  if (sourceElement != null) {
    sourceElement.connect(sdpEndPoint);
  }
  return sdpEndPoint;
}

Fixed version (ground truth):
private SdpEndPoint buildAndConnectSdpEndPoint(MediaElement sourceElement,MediaElement[] sinkElements){
  getLogger().info("String_Node_Str");
  if (sinkElements != null && sinkElements.length > 0) {
    for (    MediaElement e : sinkElements) {
      Assert.notNull(e,"String_Node_Str",10023);
    }
  }
  MediaElement candidate=null;
  if (sinkElements == null || sinkElements.length == 0) {
    candidate=sourceElement;
  }
 else {
    candidate=sinkElements[0];
  }
  getLogger().info("String_Node_Str" + candidate);
  MediaPipeline mediaPipeline=null;
  if (candidate != null) {
    mediaPipeline=candidate.getMediaPipeline();
  }
 else {
    mediaPipeline=mediaPipelineFactory.create();
    releaseOnTerminate(mediaPipeline);
  }
  getLogger().info("String_Node_Str");
  SdpEndPoint sdpEndPoint=buildSdpEndPoint(mediaPipeline);
  releaseOnTerminate(sdpEndPoint);
  if (sourceElement == null) {
    sourceElement=sdpEndPoint;
  }
  getLogger().info("String_Node_Str");
  if (sinkElements != null && sinkElements.length > 0) {
    connect(sdpEndPoint,sinkElements);
  }
  if (sourceElement != null) {
    sourceElement.connect(sdpEndPoint);
  }
  return sdpEndPoint;
}
Program: 10902
Project: 10902
Buggy source:
public void testCampusPartySimulatedPipeline() throws InterruptedException, KurentoMediaFrameworkException {
  log.info("String_Node_Str");
  RtpEndPoint rtpEndPoint=mediaPipeline.createRtpEndPoint();
  String requestSdp="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  log.info("String_Node_Str" + requestSdp);
  String answerSdp=rtpEndPoint.processOffer(requestSdp);
  log.info("String_Node_Str");
  rtpEndPoint.getMediaSrcs(KmsMediaType.VIDEO).iterator().next().connect(rtpEndPoint.getMediaSinks(KmsMediaType.VIDEO).iterator().next());
  Thread.sleep(1000);
  log.info("String_Node_Str");
  HttpEndPoint httpEndPoint=mediaPipeline.createHttpEndPoint(0,0);
  log.info("String_Node_Str");
  rtpEndPoint.getMediaSrcs(KmsMediaType.VIDEO).iterator().next().connect(httpEndPoint.getMediaSinks(KmsMediaType.VIDEO).iterator().next());
  log.info("String_Node_Str" + httpEndPoint.getUrl());
}

Fixed version (ground truth):
public void testCampusPartySimulatedPipeline() throws InterruptedException, KurentoMediaFrameworkException {
  log.info("String_Node_Str");
  RtpEndPoint rtpEndPoint=mediaPipeline.createRtpEndPoint();
  String requestSdp="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  log.info("String_Node_Str" + requestSdp);
  String answerSdp=rtpEndPoint.processOffer(requestSdp);
  log.info("String_Node_Str" + answerSdp);
  log.info("String_Node_Str");
  rtpEndPoint.getMediaSrcs(KmsMediaType.VIDEO).iterator().next().connect(rtpEndPoint.getMediaSinks(KmsMediaType.VIDEO).iterator().next());
  Thread.sleep(1000);
  log.info("String_Node_Str");
  HttpEndPoint httpEndPoint=mediaPipeline.createHttpEndPoint(0,0);
  log.info("String_Node_Str");
  rtpEndPoint.getMediaSrcs(KmsMediaType.VIDEO).iterator().next().connect(httpEndPoint.getMediaSinks(KmsMediaType.VIDEO).iterator().next());
  log.info("String_Node_Str" + httpEndPoint.getUrl());
}
Program: 10903
Project: 10903
Buggy source:
@Override public void processOffer(String offer,final Continuation<String> cont){
  Map<String,MediaParam> params=new HashMap<String,MediaParam>(4);
  StringMediaParam param=new StringMediaParam();
  param.setString(offer);
  params.put(PROCESS_SDP_OFFER_PARAM_OFFER_STR,param);
  invoke(PROCESS_SDP_OFFER,new StringContinuationWrapper(cont));
}

Fixed version (ground truth):
@Override public void processOffer(String offer,final Continuation<String> cont){
  Map<String,MediaParam> params=new HashMap<String,MediaParam>(4);
  StringMediaParam param=new StringMediaParam();
  param.setString(offer);
  params.put(PROCESS_SDP_OFFER_PARAM_OFFER_STR,param);
  invoke(PROCESS_SDP_OFFER,params,new StringContinuationWrapper(cont));
}
Program: 10904
Project: 10904
Buggy source:
@Override public void processAnswer(String answer,final Continuation<String> cont){
  Map<String,MediaParam> params=new HashMap<String,MediaParam>(4);
  StringMediaParam param=new StringMediaParam();
  param.setString(answer);
  params.put(PROCESS_SDP_ANSWER_PARAM_ANSWER_STR,param);
  invoke(PROCESS_SDP_ANSWER,new StringContinuationWrapper(cont));
}

Fixed version (ground truth):
@Override public void processAnswer(String answer,final Continuation<String> cont){
  Map<String,MediaParam> params=new HashMap<String,MediaParam>(4);
  StringMediaParam param=new StringMediaParam();
  param.setString(answer);
  params.put(PROCESS_SDP_ANSWER_PARAM_ANSWER_STR,param);
  invoke(PROCESS_SDP_ANSWER,params,new StringContinuationWrapper(cont));
}
Program: 10906
Project: 10906
Buggy source:
@Test public void testMixer() throws KurentoMediaFrameworkException {
  MainMixer mixer=(MainMixer)mediaPipeline.createMediaMixer(MainMixerImpl.TYPE);
  mixer.release();
}

Fixed version (ground truth):
@Ignore @Test public void testMixer() throws KurentoMediaFrameworkException {
  MainMixer mixer=(MainMixer)mediaPipeline.createMediaMixer(MainMixerImpl.TYPE);
  mixer.release();
}
Program: 10907
Project: 10907
Buggy source:
@Test public void testRtpEndPointSimulatingAndroidSdp() throws KurentoMediaFrameworkException, InterruptedException {
  log.info("String_Node_Str");
  PlayerEndPoint player=mediaPipeline.createPlayerEndPoint("String_Node_Str");
  log.info("String_Node_Str");
  RtpEndPoint rtpEndPoint=mediaPipeline.createRtpEndPoint();
  String requestSdp="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  log.info("String_Node_Str" + requestSdp);
  String answerSdp=rtpEndPoint.processOffer(requestSdp);
  log.info("String_Node_Str" + answerSdp);
  log.info("String_Node_Str");
  MediaSink videoSink=rtpEndPoint.getMediaSinks(KmsMediaType.VIDEO).iterator().next();
  player.getMediaSrcs(KmsMediaType.VIDEO).iterator().next().connect(videoSink);
  log.info("String_Node_Str");
  player.play();
  Thread.sleep(2000);
}

Fixed version (ground truth):
@Test public void testRtpEndPointSimulatingAndroidSdp() throws KurentoMediaFrameworkException, InterruptedException {
  log.info("String_Node_Str");
  PlayerEndPoint player=mediaPipeline.createPlayerEndPoint("String_Node_Str");
  log.info("String_Node_Str");
  RtpEndPoint rtpEndPoint=mediaPipeline.createRtpEndPoint();
  String requestSdp="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  log.info("String_Node_Str" + requestSdp);
  String answerSdp=rtpEndPoint.processOffer(requestSdp);
  log.info("String_Node_Str" + answerSdp);
  log.info("String_Node_Str");
  player.connect(rtpEndPoint,KmsMediaType.VIDEO);
  log.info("String_Node_Str");
  Thread.sleep(2000);
}
Program: 10908
Project: 10908
Buggy source:
@Test public void testHttpEndPoint() throws KurentoMediaFrameworkException, InterruptedException {
  final PlayerEndPoint player=mediaPipeline.createPlayerEndPoint("String_Node_Str");
  HttpEndPoint httpEndPoint=mediaPipeline.createHttpEndPoint(0,0);
  MediaSink videoSink=httpEndPoint.getMediaSinks(KmsMediaType.VIDEO).iterator().next();
  MediaSource videoSrc=player.getMediaSrcs(KmsMediaType.VIDEO).iterator().next();
  videoSrc.connect(videoSink);
  final Semaphore sem=new Semaphore(0);
  player.addEndOfStreamListener(new AbstractEndOfStreamEventListener(){
    @Override public void onEvent(    EndOfStreamEvent event){
      sem.release();
    }
  }
);
  httpEndPoint.addMediaSessionStartListener(new AbstractMediaSessionStartedEventListener(){
    @Override public void onEvent(    MediaSessionStartedEvent event){
      log.info("String_Node_Str" + event);
      player.play();
    }
  }
);
  log.info("String_Node_Str" + httpEndPoint.getUrl());
  DefaultHttpClient httpclient=new DefaultHttpClient();
  try {
    httpclient.execute(new HttpGet(httpEndPoint.getUrl()));
  }
 catch (  ClientProtocolException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  sem.acquire();
  player.release();
  httpEndPoint.release();
}

Fixed version (ground truth):
@Test public void testHttpEndPoint() throws KurentoMediaFrameworkException, InterruptedException {
  final PlayerEndPoint player=mediaPipeline.createPlayerEndPoint("String_Node_Str");
  HttpEndPoint httpEndPoint=mediaPipeline.createHttpEndPoint(0,0);
  player.connect(httpEndPoint,KmsMediaType.VIDEO);
  final Semaphore sem=new Semaphore(0);
  player.addEndOfStreamListener(new AbstractEndOfStreamEventListener(){
    @Override public void onEvent(    EndOfStreamEvent event){
      sem.release();
    }
  }
);
  httpEndPoint.addMediaSessionStartListener(new AbstractMediaSessionStartedEventListener(){
    @Override public void onEvent(    MediaSessionStartedEvent event){
      log.info("String_Node_Str" + event);
      player.play();
    }
  }
);
  log.info("String_Node_Str" + httpEndPoint.getUrl());
  DefaultHttpClient httpclient=new DefaultHttpClient();
  try {
    httpclient.execute(new HttpGet(httpEndPoint.getUrl()));
  }
 catch (  ClientProtocolException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  sem.acquire();
  player.release();
  httpEndPoint.release();
}
Program: 10909
Project: 10909
Buggy source:
@Test public void testZBar() throws KurentoMediaFrameworkException, InterruptedException {
  PlayerEndPoint player=mediaPipeline.createPlayerEndPoint("String_Node_Str");
  ZBarFilter zbar=mediaPipeline.createZBarFilter();
  MediaSink videoSink=zbar.getMediaSinks(KmsMediaType.VIDEO).iterator().next();
  MediaSource videoSrc=player.getMediaSrcs(KmsMediaType.VIDEO).iterator().next();
  videoSrc.connect(videoSink);
  final Semaphore sem=new Semaphore(0);
  zbar.addCodeFoundDataListener(new AbstractCodeFoundEventListener(){
    @Override public void onEvent(    CodeFoundEvent event){
      log.info("String_Node_Str" + event);
      sem.release();
    }
  }
);
  player.play();
  Assert.assertTrue(sem.tryAcquire(10,TimeUnit.SECONDS));
  player.stop();
  zbar.release();
  player.release();
}

Fixed version (ground truth):
@Test public void testZBar() throws KurentoMediaFrameworkException, InterruptedException {
  PlayerEndPoint player=mediaPipeline.createPlayerEndPoint("String_Node_Str");
  ZBarFilter zbar=mediaPipeline.createZBarFilter();
  player.connect(zbar,KmsMediaType.VIDEO);
  final Semaphore sem=new Semaphore(0);
  zbar.addCodeFoundDataListener(new AbstractCodeFoundEventListener(){
    @Override public void onEvent(    CodeFoundEvent event){
      log.info("String_Node_Str" + event);
      sem.release();
    }
  }
);
  player.play();
  Assert.assertTrue(sem.tryAcquire(10,TimeUnit.SECONDS));
  player.stop();
  zbar.release();
  player.release();
}
Program: 10910
Project: 10910
Buggy source:
/** 
 * Serialize Java object to JSON (as String).
 * @param obj Java Object representing a JSON message to be serialized
 * @return Serialized JSON message (as String)
 */
public static String toString(Object obj){
  return gson.toJson(obj);
}

Fixed version (ground truth):
/** 
 * Serialize Java object to JSON (as String).
 * @param obj Java Object representing a JSON message to be serialized
 * @return Serialized JSON message (as String)
 */
public static String toString(Object obj){
  return GsonUtils.getGson().toJson(obj);
}
Program: 10912
Project: 10912
Buggy source:
@Override protected void sendOnTerminateErrorMessageInInitialContext(int code,String description) throws IOException {
  if (useControlProtocol) {
    protocolManager.sendJsonError(initialAsyncCtx,JsonRpcResponse.newError(code,description,initialJsonRequest.getId()));
  }
 else {
    ((HttpServletResponse)initialAsyncCtx.getResponse()).sendError(code,description);
  }
}

Fixed version (ground truth):
@Override protected void sendOnTerminateErrorMessageInInitialContext(int code,String description) throws IOException {
  if (useControlProtocol) {
    protocolManager.sendJsonError(initialAsyncCtx,JsonRpcResponse.newError(code,description,initialJsonRequest.getId()));
  }
 else {
    ((HttpServletResponse)initialAsyncCtx.getResponse()).sendError(500,description);
  }
}
Program: 10913
Project: 10913
Buggy source:
/** 
 * Terminates this object, completing initialAsyncCtx if necessary and sending an answer to the initial request if necessary.
 * @param code
 * @param description
 */
protected void terminate(int code,String description){
  STATE localState;
synchronized (this) {
    if (state == STATE.TERMINATED)     return;
    localState=state;
    state=STATE.TERMINATED;
  }
  try {
    if (localState == STATE.IDLE || state == STATE.HANDLING || state == STATE.STARTING) {
      sendOnTerminateErrorMessageInInitialContext(code,description);
    }
 else     if (localState == STATE.ACTIVE) {
      cancelMediaTransmission();
    }
  }
 catch (  Throwable t) {
    getLogger().error(t.getMessage(),t);
  }
 finally {
    destroy();
  }
}

Fixed version (ground truth):
/** 
 * Terminates this object, completing initialAsyncCtx if necessary and sending an answer to the initial request if necessary.
 * @param code
 * @param description
 */
protected void terminate(int code,String description){
  STATE localState;
synchronized (this) {
    if (state == STATE.TERMINATED)     return;
    localState=state;
    state=STATE.TERMINATED;
  }
  try {
    if (localState == STATE.IDLE || localState == STATE.HANDLING || localState == STATE.STARTING) {
      sendOnTerminateErrorMessageInInitialContext(code,description);
    }
 else     if (localState == STATE.ACTIVE) {
      cancelMediaTransmission();
    }
  }
 catch (  Throwable t) {
    getLogger().error(t.getMessage(),t);
  }
 finally {
    destroy();
  }
}
Program: 10914
Project: 10914
Buggy source:
public static void registerKurentoServletContextListener(ServletContext ctx){
  if (ctx.getAttribute(KURENTO_SERVLET_CONTEXT_LISTENER_ATTRIBUTE_NAME) == null) {
    return;
  }
  ctx.setAttribute(KURENTO_SERVLET_CONTEXT_LISTENER_ATTRIBUTE_NAME,"String_Node_Str");
  ctx.addListener(KurentoServletContextListener.class);
}

Fixed version (ground truth):
public static void registerKurentoServletContextListener(ServletContext ctx){
  if (ctx.getAttribute(KURENTO_SERVLET_CONTEXT_LISTENER_ATTRIBUTE_NAME) != null) {
    log.info("String_Node_Str");
    return;
  }
  log.info("String_Node_Str");
  ctx.setAttribute(KURENTO_SERVLET_CONTEXT_LISTENER_ATTRIBUTE_NAME,"String_Node_Str");
  ctx.addListener(KurentoServletContextListener.class);
}
Program: 10915
Project: 10915
Buggy source:
public static void closeAllKurentoApplicationContexts(ServletContext ctx){
  Assert.notNull(ctx,"String_Node_Str");
  if (childContexts != null) {
    for (    AnnotationConfigApplicationContext childContext : childContexts.values()) {
      childContext.close();
    }
  }
  childContexts=null;
  if (kurentoApplicationContextInternalReference != null) {
    kurentoApplicationContextInternalReference.close();
  }
  kurentoApplicationContextInternalReference=null;
}

Fixed version (ground truth):
public static void closeAllKurentoApplicationContexts(ServletContext ctx){
  Assert.notNull(ctx,"String_Node_Str");
  if (childContexts != null) {
    for (    AnnotationConfigApplicationContext childContext : childContexts.values()) {
      log.info("String_Node_Str" + childContext);
      childContext.close();
    }
  }
  childContexts=null;
  if (kurentoApplicationContextInternalReference != null) {
    log.info("String_Node_Str" + kurentoApplicationContextInternalReference);
    kurentoApplicationContextInternalReference.close();
  }
  kurentoApplicationContextInternalReference=null;
}
Program: 10916
Project: 10916
Buggy source:
void startMedia(MediaElement upStream,MediaElement downStream) throws ContentException ;

Fixed version (ground truth):
void startMedia(MediaElement sinkElement,MediaElement sourceElement) throws ContentException ;
Program: 10917
Project: 10917
Buggy source:
void startMedia(MediaElement upStream,MediaElement downStream) throws ContentException ;

Fixed version (ground truth):
void startMedia(MediaElement sinkElement,MediaElement sourceElement) throws ContentException ;
Program: 10918
Project: 10918
Buggy source:
public JsonRpcRequest receiveJsonRequest(AsyncContext asyncCtx) throws IOException {
  HttpServletRequest request=(HttpServletRequest)asyncCtx.getRequest();
  InputStream inputStream=request.getInputStream();
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  byte[] buffer=new byte[BUFF];
  int len;
  while ((len=inputStream.read(buffer)) > -1) {
    baos.write(buffer,0,len);
  }
  baos.flush();
  String encoding=detectJsonEncoding(new ByteArrayInputStream(baos.toByteArray()));
  log.debug("String_Node_Str" + encoding);
  if (encoding == null || !encoding.equalsIgnoreCase(UTF8)) {
    throw new IOException("String_Node_Str");
  }
  InputStreamReader isr=new InputStreamReader(new ByteArrayInputStream(baos.toByteArray()),UTF8);
  JsonRpcRequest jsonRequest=gson.fromJson(isr,JsonRpcRequest.class);
  Assert.notNull(jsonRequest.getMethod());
  return jsonRequest;
}

Fixed version (ground truth):
public JsonRpcRequest receiveJsonRequest(AsyncContext asyncCtx) throws IOException {
  HttpServletRequest request=(HttpServletRequest)asyncCtx.getRequest();
  InputStream inputStream=request.getInputStream();
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  byte[] buffer=new byte[BUFF];
  int len;
  while ((len=inputStream.read(buffer)) > -1) {
    baos.write(buffer,0,len);
  }
  baos.flush();
  String encoding=detectJsonEncoding(new ByteArrayInputStream(baos.toByteArray()));
  log.debug("String_Node_Str" + encoding);
  if (encoding == null || !encoding.equalsIgnoreCase(UTF8)) {
    throw new IOException("String_Node_Str");
  }
  InputStreamReader isr=new InputStreamReader(new ByteArrayInputStream(baos.toByteArray()),UTF8);
  JsonRpcRequest jsonRequest=gson.fromJson(isr,JsonRpcRequest.class);
  Assert.notNull(jsonRequest.getMethod());
  log.info("String_Node_Str" + jsonRequest.toString());
  return jsonRequest;
}
Program: 10919
Project: 10919
Buggy source:
private void internalSendJsonAnswer(AsyncContext asyncCtx,JsonRpcResponse message) throws IOException {
  if (asyncCtx == null) {
    throw new IOException("String_Node_Str");
  }
  if (!asyncCtx.getRequest().isAsyncStarted()) {
    return;
  }
synchronized (asyncCtx) {
    HttpServletResponse response=(HttpServletResponse)asyncCtx.getResponse();
    response.setContentType("String_Node_Str");
    OutputStreamWriter osw=new OutputStreamWriter(response.getOutputStream(),UTF8);
    osw.write(gson.toJson(message));
    osw.flush();
    asyncCtx.complete();
  }
}

Fixed version (ground truth):
private void internalSendJsonAnswer(AsyncContext asyncCtx,JsonRpcResponse message) throws IOException {
  if (asyncCtx == null) {
    throw new IOException("String_Node_Str");
  }
  if (!asyncCtx.getRequest().isAsyncStarted()) {
    return;
  }
synchronized (asyncCtx) {
    HttpServletResponse response=(HttpServletResponse)asyncCtx.getResponse();
    response.setContentType("String_Node_Str");
    OutputStreamWriter osw=new OutputStreamWriter(response.getOutputStream(),UTF8);
    osw.write(gson.toJson(message));
    osw.flush();
    log.info("String_Node_Str" + message);
    asyncCtx.complete();
  }
}
Program: 10921
Project: 10921
Buggy source:
@Override protected final void doGet(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  if (useControlProtocol) {
    resp.sendError(HttpServletResponse.SC_NOT_IMPLEMENTED,"String_Node_Str" + "String_Node_Str");
    return;
  }
  getLogger().debug("String_Node_Str" + req.getRequestURI());
  if (!req.isAsyncSupported()) {
    resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,"String_Node_Str" + this.getClass().getName() + "String_Node_Str");
    return;
  }
  if (isHandlerNull()) {
    resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,getHandlerSimpleClassName() + "String_Node_Str" + "String_Node_Str"+ getHandlerSimpleClassName());
    return;
  }
  String contentId=req.getPathInfo();
  if (contentId != null) {
    contentId=contentId.substring(1);
  }
  AsyncContext asyncCtx=req.startAsync();
  asyncCtx.addListener(new ContentAsyncListener());
  AbstractContentRequest contentRequest=createContentRequest(asyncCtx,contentId);
  Future<?> future=executor.getExecutor().submit(createAsyncRequestProcessor(contentRequest,null,asyncCtx));
  req.setAttribute(ContentAsyncListener.FUTURE_REQUEST_PROCESSOR_ATT_NAME,future);
  req.setAttribute(ContentAsyncListener.CONTENT_REQUEST_ATT_NAME,contentRequest);
}

Fixed version (ground truth):
@Override protected final void doGet(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  if (useControlProtocol) {
    resp.sendError(HttpServletResponse.SC_NOT_IMPLEMENTED,"String_Node_Str" + "String_Node_Str");
    return;
  }
  getLogger().debug("String_Node_Str" + req.getRequestURI());
  if (!req.isAsyncSupported()) {
    resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,"String_Node_Str" + this.getClass().getName() + "String_Node_Str");
    return;
  }
  if (isHandlerNull()) {
    resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,getHandlerSimpleClassName() + "String_Node_Str" + "String_Node_Str"+ getHandlerSimpleClassName());
    return;
  }
  String contentId=req.getPathInfo();
  if (contentId != null) {
    contentId=contentId.substring(1);
  }
  AsyncContext asyncCtx=req.startAsync();
  asyncCtx.addListener(new ContentAsyncListener());
}
Program: 10922
Project: 10922
Buggy source:
@Override public boolean equals(Object obj){
  if (obj.getClass().equals(this.getClass())) {
    return false;
  }
 else {
    MediaObject mo=(MediaObject)obj;
    return mo.mediaObjectId.getId() == this.mediaObjectId.getId();
  }
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (!obj.getClass().equals(this.getClass())) {
    return false;
  }
 else {
    MediaObject mo=(MediaObject)obj;
    return mo.mediaObjectId.getId() == this.mediaObjectId.getId();
  }
}
Program: 10923
Project: 10923
Buggy source:
void onEvent(KmsEvent event){
  if (event.getSource() instanceof MediaPipeline) {
    fireEvent(mediaPipelineMap.get(event.getSource()),event);
  }
 else   if (event.getSource() instanceof MediaElement) {
    fireEvent(mediaPipelineMap.get(event.getSource()),event);
  }
 else {
    IllegalArgumentException iae=new IllegalArgumentException("String_Node_Str" + event.getSource().getClass());
    log.error(iae.getMessage());
    throw iae;
  }
}

Fixed version (ground truth):
void onEvent(KmsEvent event){
  if (event.getSource() instanceof MediaPipeline) {
    fireEvent(mediaPipelineMap.get(event.getSource()),event);
  }
 else   if (event.getSource() instanceof MediaElement) {
    fireEvent(mediaElementMap.get(event.getSource()),event);
  }
 else {
    IllegalArgumentException iae=new IllegalArgumentException("String_Node_Str" + event.getSource().getClass());
    log.error(iae.getMessage());
    throw iae;
  }
}
Program: 10925
Project: 10925
Buggy source:
public static void processInjectionBasedOnApplicationContext(Object bean,AnnotationConfigApplicationContext appContext){
  AutowiredAnnotationBeanPostProcessor bpp=new AutowiredAnnotationBeanPostProcessor();
  bpp.setBeanFactory(appContext.getAutowireCapableBeanFactory());
  bpp.processInjection(bean);
}

Fixed version (ground truth):
public static void processInjectionBasedOnApplicationContext(Object bean,AnnotationConfigApplicationContext appContext){
  Assert.notNull(appContext,"String_Node_Str");
  Assert.notNull(bean,"String_Node_Str");
  AutowiredAnnotationBeanPostProcessor bpp=new AutowiredAnnotationBeanPostProcessor();
  bpp.setBeanFactory(appContext.getAutowireCapableBeanFactory());
  bpp.processInjection(bean);
}
Program: 10926
Project: 10926
Buggy source:
public static void processInjectionBasedOnKurentoApplicationContext(Object bean){
  AutowiredAnnotationBeanPostProcessor bpp=new AutowiredAnnotationBeanPostProcessor();
  bpp.setBeanFactory(kurentoApplicationContextInternalReference.getAutowireCapableBeanFactory());
  bpp.processInjection(bean);
}

Fixed version (ground truth):
public static void processInjectionBasedOnKurentoApplicationContext(Object bean){
  Assert.notNull(kurentoApplicationContextInternalReference,"String_Node_Str");
  Assert.notNull(bean,"String_Node_Str");
  AutowiredAnnotationBeanPostProcessor bpp=new AutowiredAnnotationBeanPostProcessor();
  bpp.setBeanFactory(kurentoApplicationContextInternalReference.getAutowireCapableBeanFactory());
  bpp.processInjection(bean);
}
Program: 10927
Project: 10927
Buggy source:
public byte[] isIdentify(Tx tx){
  HashSet<String> result=new HashSet<String>();
  for (  In in : tx.getIns()) {
    String queryPrevTxHashSql="String_Node_Str";
    final HashSet<String> each=new HashSet<String>();
    this.execQueryOneRecord(this.getReadDb(),queryPrevTxHashSql,new String[]{Base58.encode(in.getPrevTxHash()),Integer.toString(in.getInSn())},new Function<ICursor,Void>(){
      @Nullable @Override public Void apply(      @Nullable ICursor c){
        each.add(c.getString(0));
        return null;
      }
    }
);
    each.remove(Base58.encode(tx.getTxHash()));
    result.retainAll(each);
    if (result.size() == 0) {
      break;
    }
  }
  if (result.size() == 0) {
    return new byte[0];
  }
 else {
    try {
      return Base58.decode((String)result.toArray()[0]);
    }
 catch (    AddressFormatException e) {
      e.printStackTrace();
      return new byte[0];
    }
  }
}

Fixed version (ground truth):
public byte[] isIdentify(Tx tx){
  HashSet<String> result=new HashSet<String>();
  for (  In in : tx.getIns()) {
    String queryPrevTxHashSql="String_Node_Str";
    final HashSet<String> each=new HashSet<String>();
    this.execQueryOneRecord(this.getReadDb(),queryPrevTxHashSql,new String[]{Base58.encode(in.getPrevTxHash()),Integer.toString(in.getPrevOutSn())},new Function<ICursor,Void>(){
      @Nullable @Override public Void apply(      @Nullable ICursor c){
        each.add(c.getString(0));
        return null;
      }
    }
);
    each.remove(Base58.encode(tx.getTxHash()));
    result.retainAll(each);
    if (result.size() == 0) {
      break;
    }
  }
  if (result.size() == 0) {
    return new byte[0];
  }
 else {
    try {
      return Base58.decode((String)result.toArray()[0]);
    }
 catch (    AddressFormatException e) {
      e.printStackTrace();
      return new byte[0];
    }
  }
}
Program: 10928
Project: 10928
Buggy source:
public void addElementsForBloomFilter(BloomFilter filter){
  List<byte[]> pubs=AbstractDb.hdAccountAddressProvider.getPubs(this.hdSeedId,AbstractHD.PathType.EXTERNAL_ROOT_PATH);
  for (  byte[] pub : pubs) {
    filter.insert(pub);
    filter.insert(Utils.sha256hash160(pub));
  }
  List<Out> outs=AbstractDb.hdAccountAddressProvider.getUnspendOutByHDAccountWithPath(getHdSeedId(),AbstractHD.PathType.INTERNAL_ROOT_PATH);
  for (  Out out : outs) {
    filter.insert(out.getOutpointData());
  }
}

Fixed version (ground truth):
public void addElementsForBloomFilter(BloomFilter filter){
  List<byte[]> pubs=AbstractDb.hdAccountAddressProvider.getPubs(this.hdSeedId,AbstractHD.PathType.EXTERNAL_ROOT_PATH);
  for (  byte[] pub : pubs) {
    filter.insert(pub);
    filter.insert(Utils.sha256hash160(pub));
  }
  List<Out> outs=AbstractDb.hdAccountAddressProvider.getUnspendOutByHDAccountWithPath(getHdSeedId(),AbstractHD.PathType.INTERNAL_ROOT_PATH);
  for (  Out out : outs) {
    filter.insert(out.getOutpointData());
  }
  outs=AbstractDb.hdAccountAddressProvider.getUnconfirmedSpentOutByHDAccountWithPath(getHdSeedId(),AbstractHD.PathType.INTERNAL_ROOT_PATH);
  for (  Out out : outs) {
    filter.insert(out.getOutpointData());
  }
}
Program: 10929
Project: 10929
Buggy source:
public int elementCountForBloomFilter(){
  return allGeneratedExternalAddressCount() * 2 + AbstractDb.hdAccountAddressProvider.getUnspendOutCountByHDAccountWithPath(getHdSeedId(),AbstractHD.PathType.INTERNAL_ROOT_PATH);
}

Fixed version (ground truth):
public int elementCountForBloomFilter(){
  return allGeneratedExternalAddressCount() * 2 + AbstractDb.hdAccountAddressProvider.getUnspendOutCountByHDAccountWithPath(getHdSeedId(),AbstractHD.PathType.INTERNAL_ROOT_PATH) + AbstractDb.hdAccountAddressProvider.getUnconfirmedSpentOutCountByHDAccountWithPath(getHdSeedId(),AbstractHD.PathType.INTERNAL_ROOT_PATH);
}