Program: 88638
Project: 88638
Buggy source:
public static Map<String,Set<String>> getJMSChanges(Project project){
  Map<String,Set<String>> changes=new HashMap<String,Set<String>>();
  Set<String> changedIds=new HashSet<String>();
  Set<String> deletedIds=new HashSet<String>();
  Set<String> addedIds=new HashSet<String>();
  changes.put("String_Node_Str",changedIds);
  changes.put("String_Node_Str",deletedIds);
  changes.put("String_Node_Str",addedIds);
  Map<String,Object> projectInstances=ProjectListenerMapping.getInstance().get(project);
  if (projectInstances.containsKey(CONNECTION) || projectInstances.containsKey(SESSION) || projectInstances.containsKey(CONSUMER)) {
    return null;
  }
  String projectID=ExportUtility.getProjectId(project);
  String wsID=ExportUtility.getWorkspace();
  String url=getJMSUrl();
  if (url == null) {
    Application.getInstance().getGUILog().log("String_Node_Str");
    return null;
  }
  if (wsID == null) {
    Application.getInstance().getGUILog().log("String_Node_Str");
    return null;
  }
  Connection connection=null;
  Session session=null;
  MessageConsumer consumer=null;
  try {
    ConnectionFactory connectionFactory=new ActiveMQConnectionFactory(url);
    String subscriberId=projectID + "String_Node_Str" + wsID;
    connection=connectionFactory.createConnection();
    connection.setClientID(subscriberId);
    session=connection.createSession(false,Session.CLIENT_ACKNOWLEDGE);
    Topic topic=session.createTopic("String_Node_Str");
    String messageSelector=constructSelectorString(projectID,wsID);
    consumer=session.createDurableSubscriber(topic,subscriberId,messageSelector,true);
    connection.start();
    Message m=consumer.receiveNoWait();
    while (m != null) {
      TextMessage message=(TextMessage)m;
      log.info("String_Node_Str" + message.getText());
      JSONObject ob=(JSONObject)JSONValue.parse(message.getText());
      if (ob.get("String_Node_Str") != null && ob.get("String_Node_Str").equals("String_Node_Str")) {
        m=consumer.receiveNoWait();
        continue;
      }
      JSONObject ws2=(JSONObject)ob.get("String_Node_Str");
      final JSONArray updated=(JSONArray)ws2.get("String_Node_Str");
      final JSONArray added=(JSONArray)ws2.get("String_Node_Str");
      final JSONArray deleted=(JSONArray)ws2.get("String_Node_Str");
      final JSONArray moved=(JSONArray)ws2.get("String_Node_Str");
      for (      Object e : updated) {
        String id=(String)((JSONObject)e).get("String_Node_Str");
        changedIds.add(id);
        deletedIds.remove(id);
      }
      for (      Object e : added) {
        String id=(String)((JSONObject)e).get("String_Node_Str");
        addedIds.add(id);
        deletedIds.remove(id);
      }
      for (      Object e : moved) {
        String id=(String)((JSONObject)e).get("String_Node_Str");
        changedIds.add(id);
        deletedIds.remove(id);
      }
      for (      Object e : deleted) {
        String id=(String)((JSONObject)e).get("String_Node_Str");
        deletedIds.add(id);
        addedIds.remove(id);
        changedIds.remove(id);
      }
      m.acknowledge();
      m=consumer.receiveNoWait();
    }
    return changes;
  }
 catch (  Exception e) {
    Application.getInstance().getGUILog().log("String_Node_Str" + e.getMessage());
    return null;
  }
 finally {
    try {
      if (consumer != null)       consumer.close();
      if (session != null)       session.close();
      if (connection != null)       connection.close();
    }
 catch (    JMSException e) {
    }
  }
}

Fixed version (ground truth):
public static Map<String,Set<String>> getJMSChanges(Project project){
  Map<String,Set<String>> changes=new HashMap<String,Set<String>>();
  Set<String> changedIds=new HashSet<String>();
  Set<String> deletedIds=new HashSet<String>();
  Set<String> addedIds=new HashSet<String>();
  changes.put("String_Node_Str",changedIds);
  changes.put("String_Node_Str",deletedIds);
  changes.put("String_Node_Str",addedIds);
  Map<String,Object> projectInstances=ProjectListenerMapping.getInstance().get(project);
  if (projectInstances.containsKey(CONNECTION) || projectInstances.containsKey(SESSION) || projectInstances.containsKey(CONSUMER)) {
    Application.getInstance().getGUILog().log("String_Node_Str");
    return null;
  }
  String projectID=ExportUtility.getProjectId(project);
  String wsID=ExportUtility.getWorkspace();
  String url=getJMSUrl();
  if (url == null) {
    Application.getInstance().getGUILog().log("String_Node_Str");
    return null;
  }
  if (wsID == null) {
    Application.getInstance().getGUILog().log("String_Node_Str");
    return null;
  }
  Connection connection=null;
  Session session=null;
  MessageConsumer consumer=null;
  try {
    ConnectionFactory connectionFactory=new ActiveMQConnectionFactory(url);
    String subscriberId=projectID + "String_Node_Str" + wsID;
    connection=connectionFactory.createConnection();
    connection.setClientID(subscriberId);
    session=connection.createSession(false,Session.CLIENT_ACKNOWLEDGE);
    Topic topic=session.createTopic("String_Node_Str");
    String messageSelector=constructSelectorString(projectID,wsID);
    consumer=session.createDurableSubscriber(topic,subscriberId,messageSelector,true);
    connection.start();
    Message m=consumer.receive(1000);
    while (m != null) {
      TextMessage message=(TextMessage)m;
      log.info("String_Node_Str" + message.getText());
      JSONObject ob=(JSONObject)JSONValue.parse(message.getText());
      if (ob.get("String_Node_Str") != null && ob.get("String_Node_Str").equals("String_Node_Str")) {
        m=consumer.receiveNoWait();
        continue;
      }
      JSONObject ws2=(JSONObject)ob.get("String_Node_Str");
      final JSONArray updated=(JSONArray)ws2.get("String_Node_Str");
      final JSONArray added=(JSONArray)ws2.get("String_Node_Str");
      final JSONArray deleted=(JSONArray)ws2.get("String_Node_Str");
      final JSONArray moved=(JSONArray)ws2.get("String_Node_Str");
      for (      Object e : updated) {
        String id=(String)((JSONObject)e).get("String_Node_Str");
        changedIds.add(id);
        deletedIds.remove(id);
      }
      for (      Object e : added) {
        String id=(String)((JSONObject)e).get("String_Node_Str");
        addedIds.add(id);
        deletedIds.remove(id);
      }
      for (      Object e : moved) {
        String id=(String)((JSONObject)e).get("String_Node_Str");
        changedIds.add(id);
        deletedIds.remove(id);
      }
      for (      Object e : deleted) {
        String id=(String)((JSONObject)e).get("String_Node_Str");
        deletedIds.add(id);
        addedIds.remove(id);
        changedIds.remove(id);
      }
      m.acknowledge();
      m=consumer.receive(1000);
    }
    return changes;
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
    Application.getInstance().getGUILog().log("String_Node_Str" + e.getMessage());
    return null;
  }
 finally {
    try {
      if (consumer != null)       consumer.close();
      if (session != null)       session.close();
      if (connection != null)       connection.close();
    }
 catch (    JMSException e) {
    }
  }
}