Program: 88618
Project: 88618
Buggy source:
@SuppressWarnings("String_Node_Str") 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();
  Map<String,String> urlInfo=new HashMap<String,String>();
  getJMSUrl(urlInfo);
  String url=urlInfo.get("String_Node_Str");
  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;
  JSONObject previousFailed=getUpdatesOrFailed(project,"String_Node_Str");
  if (previousFailed != null) {
    addedIds.addAll((List<String>)previousFailed.get("String_Node_Str"));
    deletedIds.addAll((List<String>)previousFailed.get("String_Node_Str"));
    changedIds.addAll((List<String>)previousFailed.get("String_Node_Str"));
  }
  JSONObject previousConflicts=getConflicts(project);
  if (previousConflicts != null) {
    changedIds.addAll((List<String>)previousConflicts.get("String_Node_Str"));
  }
  try {
    ConnectionFactory connectionFactory=createConnectionFactory(urlInfo);
    String subscriberId=projectID + "String_Node_Str" + wsID;
    connection=connectionFactory.createConnection();
    connection.setClientID(subscriberId);
    session=connection.createSession(false,Session.CLIENT_ACKNOWLEDGE);
    Topic topic;
    try {
      topic=(Topic)ctx.lookup(JMS_TOPIC);
    }
 catch (    NameNotFoundException nnfe) {
      topic=session.createTopic(JMS_TOPIC);
    }
    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());
      boolean magicdraw=false;
      if (ob.get("String_Node_Str") != null && ob.get("String_Node_Str").equals("String_Node_Str")) {
        magicdraw=true;
      }
      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");
        if (!magicdraw)         changedIds.add(id);
        deletedIds.remove(id);
      }
      for (      Object e : added) {
        String id=(String)((JSONObject)e).get("String_Node_Str");
        if (!magicdraw)         addedIds.add(id);
        deletedIds.remove(id);
      }
      for (      Object e : moved) {
        String id=(String)((JSONObject)e).get("String_Node_Str");
        if (!magicdraw)         changedIds.add(id);
        deletedIds.remove(id);
      }
      for (      Object e : deleted) {
        String id=(String)((JSONObject)e).get("String_Node_Str");
        if (!magicdraw)         deletedIds.add(id);
        addedIds.remove(id);
        changedIds.remove(id);
      }
      m.acknowledge();
      m=consumer.receive(1000);
    }
    SessionManager sm=SessionManager.getInstance();
    sm.createSession("String_Node_Str");
    try {
      setConflicts(project,null);
      sm.closeSession();
    }
 catch (    Exception e) {
      sm.cancelSession();
    }
    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) {
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") 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();
  Map<String,String> urlInfo=new HashMap<String,String>();
  getJMSUrl(urlInfo);
  String url=urlInfo.get("String_Node_Str");
  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;
  JSONObject previousFailed=getUpdatesOrFailed(project,"String_Node_Str");
  if (previousFailed != null) {
    addedIds.addAll((List<String>)previousFailed.get("String_Node_Str"));
    deletedIds.addAll((List<String>)previousFailed.get("String_Node_Str"));
    changedIds.addAll((List<String>)previousFailed.get("String_Node_Str"));
  }
  JSONObject previousConflicts=getConflicts(project);
  if (previousConflicts != null) {
    changedIds.addAll((List<String>)previousConflicts.get("String_Node_Str"));
  }
  try {
    ConnectionFactory connectionFactory=createConnectionFactory(urlInfo);
    String subscriberId=projectID + "String_Node_Str" + wsID;
    connection=connectionFactory.createConnection();
    connection.setClientID(subscriberId);
    session=connection.createSession(false,Session.CLIENT_ACKNOWLEDGE);
    Topic topic=null;
    try {
      if (ctx != null) {
        topic=(Topic)ctx.lookup(JMS_TOPIC);
      }
    }
 catch (    NameNotFoundException nnfe) {
    }
 finally {
      if (topic == null) {
        topic=session.createTopic(JMS_TOPIC);
      }
    }
    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());
      boolean magicdraw=false;
      if (ob.get("String_Node_Str") != null && ob.get("String_Node_Str").equals("String_Node_Str")) {
        magicdraw=true;
      }
      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");
        if (!magicdraw)         changedIds.add(id);
        deletedIds.remove(id);
      }
      for (      Object e : added) {
        String id=(String)((JSONObject)e).get("String_Node_Str");
        if (!magicdraw)         addedIds.add(id);
        deletedIds.remove(id);
      }
      for (      Object e : moved) {
        String id=(String)((JSONObject)e).get("String_Node_Str");
        if (!magicdraw)         changedIds.add(id);
        deletedIds.remove(id);
      }
      for (      Object e : deleted) {
        String id=(String)((JSONObject)e).get("String_Node_Str");
        if (!magicdraw)         deletedIds.add(id);
        addedIds.remove(id);
        changedIds.remove(id);
      }
      m.acknowledge();
      m=consumer.receive(1000);
    }
    SessionManager sm=SessionManager.getInstance();
    sm.createSession("String_Node_Str");
    try {
      setConflicts(project,null);
      sm.closeSession();
    }
 catch (    Exception e) {
      sm.cancelSession();
    }
    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) {
    }
  }
}