Program: 147087
Project: 147087
Buggy source:
public JSONObject createPathUpdateJson(GeometryPath path,int typeOfEdit,int atIndex){
  JSONObject topJson=new JSONObject();
  UUID pathUuid=pathList.get(path);
  topJson.put("String_Node_Str","String_Node_Str");
  topJson.put("String_Node_Str",pathUuid.toString());
  if (typeOfEdit == 2) {
    JSONArray pathpoint_jsonArr=new JSONArray();
    for (int i=0; i < path.getPathPointSet().getSize(); i++) {
      AbstractPathPoint pathPoint=path.getPathPointSet().get(i);
      UUID pathpoint_uuid=mapComponentToUUID.get(pathPoint).get(0);
      pathpoint_jsonArr.add(pathpoint_uuid.toString());
    }
    topJson.put("String_Node_Str",pathpoint_jsonArr);
    topJson.put("String_Node_Str","String_Node_Str");
  }
 else   if (typeOfEdit == 1) {
    topJson.put("String_Node_Str","String_Node_Str");
    AbstractPathPoint newPoint=path.getPathPointSet().get(atIndex);
    JSONObject newPointJson=createPathPointObjectJson(newPoint,newPoint.getName(),true,null);
    newPointJson.put("String_Node_Str",mapComponentToUUID.get(newPoint.getBody()).get(0).toString());
    topJson.put("String_Node_Str",newPointJson);
    ArrayList<UUID> vis_uuidList=new ArrayList<UUID>(1);
    UUID newPointMeshUUID=UUID.fromString((String)newPointJson.get("String_Node_Str"));
    vis_uuidList.add(newPointMeshUUID);
    mapComponentToUUID.put(newPoint,vis_uuidList);
    mapUUIDToComponent.put(newPointMeshUUID,newPoint);
    JSONArray pathpoint_jsonArr=new JSONArray();
    for (int i=0; i < path.getPathPointSet().getSize(); i++) {
      AbstractPathPoint pathPoint=path.getPathPointSet().get(i);
      UUID pathpoint_uuid=mapComponentToUUID.get(pathPoint).get(0);
      pathpoint_jsonArr.add(pathpoint_uuid.toString());
    }
    topJson.put("String_Node_Str",pathpoint_jsonArr);
  }
 else {
    topJson.put("String_Node_Str","String_Node_Str");
    JSONArray pathpoint_jsonArr=new JSONArray();
    for (int i=0; i < path.getPathPointSet().getSize(); i++) {
      AbstractPathPoint pathPoint=path.getPathPointSet().get(i);
      JSONObject pathpointupdateJson=new JSONObject();
      UUID pathpoint_uuid=mapComponentToUUID.get(pathPoint).get(0);
      pathpointupdateJson.put("String_Node_Str",pathpoint_uuid.toString());
      Transform localTransform=new Transform();
      Vec3 location=null;
      if (true)       location=pathPoint.getLocation(state);
 else {
      }
      localTransform.setP(location);
      pathpointupdateJson.put("String_Node_Str",JSONUtilities.createMatrixFromTransform(localTransform,new Vec3(1.0),visScaleFactor));
      pathpoint_jsonArr.add(pathpointupdateJson);
    }
    topJson.put("String_Node_Str",pathpoint_jsonArr);
  }
  return topJson;
}

Fixed version (ground truth):
public JSONObject createPathUpdateJson(GeometryPath path,int typeOfEdit,int atIndex){
  JSONObject topJson=new JSONObject();
  UUID pathUuid=pathList.get(path);
  topJson.put("String_Node_Str","String_Node_Str");
  topJson.put("String_Node_Str",pathUuid.toString());
  if (typeOfEdit == 2) {
    JSONArray pathpoint_jsonArr=new JSONArray();
    for (int i=0; i < path.getPathPointSet().getSize(); i++) {
      AbstractPathPoint pathPoint=path.getPathPointSet().get(i);
      ArrayList<UUID> vis_uuidList=mapComponentToUUID.get(pathPoint);
      if (vis_uuidList != null) {
        UUID pathpoint_uuid=mapComponentToUUID.get(pathPoint).get(0);
        pathpoint_jsonArr.add(pathpoint_uuid.toString());
      }
    }
    topJson.put("String_Node_Str",pathpoint_jsonArr);
    topJson.put("String_Node_Str","String_Node_Str");
  }
 else   if (typeOfEdit == 1) {
    topJson.put("String_Node_Str","String_Node_Str");
    AbstractPathPoint newPoint=path.getPathPointSet().get(atIndex);
    JSONObject newPointJson=createPathPointObjectJson(newPoint,newPoint.getName(),true,null);
    newPointJson.put("String_Node_Str",mapComponentToUUID.get(newPoint.getBody()).get(0).toString());
    topJson.put("String_Node_Str",newPointJson);
    ArrayList<UUID> vis_uuidList=new ArrayList<UUID>(1);
    UUID newPointMeshUUID=UUID.fromString((String)newPointJson.get("String_Node_Str"));
    vis_uuidList.add(newPointMeshUUID);
    mapComponentToUUID.put(newPoint,vis_uuidList);
    mapUUIDToComponent.put(newPointMeshUUID,newPoint);
    JSONArray pathpoint_jsonArr=new JSONArray();
    for (int i=0; i < path.getPathPointSet().getSize(); i++) {
      AbstractPathPoint pathPoint=path.getPathPointSet().get(i);
      UUID pathpoint_uuid=mapComponentToUUID.get(pathPoint).get(0);
      pathpoint_jsonArr.add(pathpoint_uuid.toString());
    }
    topJson.put("String_Node_Str",pathpoint_jsonArr);
  }
 else {
    topJson.put("String_Node_Str","String_Node_Str");
    JSONArray pathpoint_jsonArr=new JSONArray();
    for (int i=0; i < path.getPathPointSet().getSize(); i++) {
      AbstractPathPoint pathPoint=path.getPathPointSet().get(i);
      JSONObject pathpointupdateJson=new JSONObject();
      UUID pathpoint_uuid=mapComponentToUUID.get(pathPoint).get(0);
      pathpointupdateJson.put("String_Node_Str",pathpoint_uuid.toString());
      Transform localTransform=new Transform();
      Vec3 location=null;
      if (true)       location=pathPoint.getLocation(state);
 else {
      }
      localTransform.setP(location);
      pathpointupdateJson.put("String_Node_Str",JSONUtilities.createMatrixFromTransform(localTransform,new Vec3(1.0),visScaleFactor));
      pathpoint_jsonArr.add(pathpointupdateJson);
    }
    topJson.put("String_Node_Str",pathpoint_jsonArr);
  }
  return topJson;
}