Program: 50187
Project: 50187
Buggy source:
private static JadeTree importTree(Map<String,JSONObject> otuMap,JSONArray nodeList,JSONArray edgeList,List<Object> studyMetaList,List<Object> treeMetaList,String treeID,Boolean verbose,MessageLogger msgLogger){
  msgLogger.indentMessageInt(1,"String_Node_Str","String_Node_Str",nodeList.size());
  msgLogger.indentMessageInt(1,"String_Node_Str","String_Node_Str",edgeList.size());
  Map<String,JadeNode> nodeMap=new HashMap<String,JadeNode>();
  JadeNode root=null;
  String ingroup=null;
  if (treeMetaList != null) {
    for (    Object meta : treeMetaList) {
      JSONObject j=(JSONObject)meta;
      if (((String)j.get("String_Node_Str")).compareTo("String_Node_Str") == 0) {
        if ((j.get("String_Node_Str")) != null) {
          ingroup=(String)j.get("String_Node_Str");
          msgLogger.indentMessageStr(1,"String_Node_Str","String_Node_Str",ingroup);
        }
 else {
          throw new RuntimeException("String_Node_Str" + j);
        }
      }
    }
  }
  JadeNode arbitraryNode=null;
  boolean deprecatedOttID=false;
  for (  Object node : nodeList) {
    JSONObject j=(JSONObject)node;
    JadeNode jn=new JadeNode();
    String id=(String)j.get("String_Node_Str");
    nodeMap.put(id,jn);
    arbitraryNode=jn;
    jn.assocObject("String_Node_Str",id);
    if (ingroup != null && id.compareTo(ingroup) == 0) {
      msgLogger.indentMessage(1,"String_Node_Str");
      root=jn;
    }
    String otuId=(String)j.get("String_Node_Str");
    if (otuId != null) {
      JSONObject otu=otuMap.get(otuId);
      if (otu == null) {
        msgLogger.indentMessageStr(2,"String_Node_Str","String_Node_Str",otuId);
        return null;
      }
      String label=(String)otu.get("String_Node_Str");
      jn.setName(label);
      List<Object> metaList2=getMetaList(otu);
      if (metaList2 != null) {
        for (        Object meta : metaList2) {
          JSONObject m=(JSONObject)meta;
          String propname=(String)m.get("String_Node_Str");
          Object value=m.get("String_Node_Str");
          if (propname.equals("String_Node_Str")) {
            propname="String_Node_Str";
            deprecatedOttID=true;
          }
          if (propname.equals("String_Node_Str")) {
            if (value instanceof String) {
              value=Long.parseLong((String)value);
            }
 else             if (value instanceof Long) {
              ;
            }
 else             if (value instanceof Integer) {
              value=new Long((((Integer)value).intValue()));
            }
 else             if (value == null) {
              msgLogger.indentMessageStr(1,"String_Node_Str","String_Node_Str",id);
            }
 else {
              System.err.println("String_Node_Str" + m);
              throw new RuntimeException("String_Node_Str" + value);
            }
          }
 else           if (propname.equals("String_Node_Str")) {
          }
 else           if (propname.equals("String_Node_Str")) {
          }
 else {
            msgLogger.indentMessageStrStr(1,"String_Node_Str","String_Node_Str",propname,"String_Node_Str",id);
          }
          jn.assocObject(propname,value);
        }
      }
    }
  }
  if (deprecatedOttID) {
    System.err.println("String_Node_Str" + treeID);
  }
  for (  Object edge : edgeList) {
    JSONObject j=(JSONObject)edge;
    JadeNode source=nodeMap.get(j.get("String_Node_Str"));
    if (source == null) {
      msgLogger.indentMessageStr(2,"String_Node_Str","String_Node_Str",(String)j.get("String_Node_Str"));
      return null;
    }
    JadeNode target=nodeMap.get(j.get("String_Node_Str"));
    if (target == null) {
      msgLogger.indentMessageStr(2,"String_Node_Str","String_Node_Str",(String)j.get("String_Node_Str"));
      return null;
    }
    Double length=(Double)j.get("String_Node_Str");
    if (length != null) {
      target.setBL(length);
    }
    source.addChild(target);
  }
  if (root == null) {
    for (JadeNode jn=arbitraryNode; jn != null; jn=jn.getParent()) {
      root=jn;
    }
  }
 else {
    root.setParent(null);
  }
  JadeTree tree=new JadeTree(root);
  int nc=tree.getExternalNodeCount();
  msgLogger.indentMessageInt(1,"String_Node_Str","String_Node_Str",nc);
  if (studyMetaList != null) {
    associateMetadata(tree,studyMetaList,(verbose ? msgLogger : null));
  }
  if (treeMetaList != null) {
    associateMetadata(tree,treeMetaList,(verbose ? msgLogger : null));
  }
  tree.assocObject("String_Node_Str",treeID);
  return tree;
}

Fixed version (ground truth):
private static JadeTree importTree(Map<String,JSONObject> otuMap,JSONArray nodeList,JSONArray edgeList,List<Object> studyMetaList,List<Object> treeMetaList,String treeID,Boolean verbose,MessageLogger msgLogger){
  msgLogger.indentMessageInt(1,"String_Node_Str","String_Node_Str",nodeList.size());
  msgLogger.indentMessageInt(1,"String_Node_Str","String_Node_Str",edgeList.size());
  Map<String,JadeNode> nodeMap=new HashMap<String,JadeNode>();
  JadeNode root=null;
  String ingroup=null;
  if (treeMetaList != null) {
    for (    Object meta : treeMetaList) {
      JSONObject j=(JSONObject)meta;
      if (((String)j.get("String_Node_Str")).compareTo("String_Node_Str") == 0) {
        if ((j.get("String_Node_Str")) != null) {
          ingroup=(String)j.get("String_Node_Str");
          msgLogger.indentMessageStr(1,"String_Node_Str","String_Node_Str",ingroup);
        }
 else {
          throw new RuntimeException("String_Node_Str" + j);
        }
      }
    }
  }
  JadeNode arbitraryNode=null;
  boolean deprecatedOttID=false;
  for (  Object node : nodeList) {
    JSONObject j=(JSONObject)node;
    JadeNode jn=new JadeNode();
    String id=(String)j.get("String_Node_Str");
    nodeMap.put(id,jn);
    arbitraryNode=jn;
    jn.assocObject("String_Node_Str",id);
    if (ingroup != null && id.compareTo(ingroup) == 0) {
      msgLogger.indentMessage(1,"String_Node_Str");
      root=jn;
    }
    String otuId=(String)j.get("String_Node_Str");
    if (otuId != null) {
      JSONObject otu=otuMap.get(otuId);
      if (otu == null) {
        msgLogger.indentMessageStr(2,"String_Node_Str","String_Node_Str",otuId);
        return null;
      }
      String label=(String)otu.get("String_Node_Str");
      jn.setName(label);
      List<Object> metaList2=getMetaList(otu);
      if (metaList2 != null) {
        for (        Object meta : metaList2) {
          JSONObject m=(JSONObject)meta;
          String propname=(String)m.get("String_Node_Str");
          Object value=m.get("String_Node_Str");
          if (propname.equals("String_Node_Str")) {
            propname="String_Node_Str";
            deprecatedOttID=true;
          }
          if (propname.equals("String_Node_Str")) {
            if (value instanceof String) {
              value=Long.parseLong((String)value);
            }
 else             if (value instanceof Long) {
              ;
            }
 else             if (value instanceof Integer) {
              value=new Long((((Integer)value).intValue()));
            }
 else             if (value == null) {
              msgLogger.indentMessageStr(1,"String_Node_Str","String_Node_Str",id);
            }
 else {
              System.err.println("String_Node_Str" + m);
              throw new RuntimeException("String_Node_Str" + value);
            }
          }
 else           if (propname.equals("String_Node_Str")) {
          }
 else           if (propname.equals("String_Node_Str")) {
          }
 else           if (propname.equals("String_Node_Str")) {
          }
 else {
            msgLogger.indentMessageStrStr(1,"String_Node_Str","String_Node_Str",propname,"String_Node_Str",id);
          }
          jn.assocObject(propname,value);
        }
      }
    }
  }
  if (deprecatedOttID) {
    System.err.println("String_Node_Str" + treeID);
  }
  for (  Object edge : edgeList) {
    JSONObject j=(JSONObject)edge;
    JadeNode source=nodeMap.get(j.get("String_Node_Str"));
    if (source == null) {
      msgLogger.indentMessageStr(2,"String_Node_Str","String_Node_Str",(String)j.get("String_Node_Str"));
      return null;
    }
    JadeNode target=nodeMap.get(j.get("String_Node_Str"));
    if (target == null) {
      msgLogger.indentMessageStr(2,"String_Node_Str","String_Node_Str",(String)j.get("String_Node_Str"));
      return null;
    }
    Double length=(Double)j.get("String_Node_Str");
    if (length != null) {
      target.setBL(length);
    }
    source.addChild(target);
  }
  if (root == null) {
    for (JadeNode jn=arbitraryNode; jn != null; jn=jn.getParent()) {
      root=jn;
    }
  }
 else {
    root.setParent(null);
  }
  JadeTree tree=new JadeTree(root);
  int nc=tree.getExternalNodeCount();
  msgLogger.indentMessageInt(1,"String_Node_Str","String_Node_Str",nc);
  if (studyMetaList != null) {
    associateMetadata(tree,studyMetaList,(verbose ? msgLogger : null));
  }
  if (treeMetaList != null) {
    associateMetadata(tree,treeMetaList,(verbose ? msgLogger : null));
  }
  tree.assocObject("String_Node_Str",treeID);
  return tree;
}