Program: 20973
Project: 20973
Buggy source:
private void load(){
  String line;
  BufferedReader in=null;
  File file=new File(fileFullPath);
  if (!file.exists()) {
    version=1;
    created=Util.getTime();
    updated=Util.getTime();
  }
 else {
    try {
      in=new BufferedReader(new FileReader(file));
      StringBuilder sb=new StringBuilder();
      while ((line=in.readLine()) != null) {
        sb.append(line);
      }
      in.close();
      deviceStore=new JSONObject(sb.toString());
      JSONArray deviceList=deviceStore.getJSONArray("String_Node_Str");
      for (int i=0; i < deviceList.length(); i++) {
        JSONObject device=deviceList.getJSONObject(i);
        ConnectableDevice d=new ConnectableDevice();
        d.setIpAddress(device.optString(IP_ADDRESS));
        d.setFriendlyName(device.optString(FRIENDLY_NAME));
        d.setModelName(device.optString(MODEL_NAME));
        d.setModelNumber(device.optString(MODEL_NUMBER));
        JSONArray jsonServices=device.optJSONArray(SERVICES);
        if (jsonServices != null) {
          for (int j=0; j < jsonServices.length(); j++) {
            JSONObject jsonService=(JSONObject)jsonServices.optJSONObject(j);
            ServiceDescription sd=createServiceDescription(jsonService.optJSONObject(DESCRIPTION));
            ServiceConfig sc=createServiceConfig(jsonService.optJSONObject(CONFIG));
            DeviceService myService=new DeviceService(sd,sc,this);
            d.addService(myService);
          }
        }
        storedDevices.add(d);
      }
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
catch (    JSONException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
private void load(){
  String line;
  BufferedReader in=null;
  File file=new File(fileFullPath);
  if (!file.exists()) {
    version=1;
    created=Util.getTime();
    updated=Util.getTime();
  }
 else {
    try {
      in=new BufferedReader(new FileReader(file));
      StringBuilder sb=new StringBuilder();
      while ((line=in.readLine()) != null) {
        sb.append(line);
      }
      in.close();
      deviceStore=new JSONObject(sb.toString());
      JSONArray deviceList=deviceStore.getJSONArray("String_Node_Str");
      for (int i=0; i < deviceList.length(); i++) {
        JSONObject device=deviceList.getJSONObject(i);
        ConnectableDevice d=new ConnectableDevice();
        d.setIpAddress(device.optString(IP_ADDRESS));
        d.setFriendlyName(device.optString(FRIENDLY_NAME));
        d.setModelName(device.optString(MODEL_NAME));
        d.setModelNumber(device.optString(MODEL_NUMBER));
        JSONObject jsonServices=device.optJSONObject(SERVICES);
        if (jsonServices != null) {
          Iterator<String> iterator=jsonServices.keys();
          while (iterator.hasNext()) {
            String key=iterator.next();
            JSONObject jsonService=jsonServices.optJSONObject(key);
            ServiceDescription sd=createServiceDescription(jsonService.optJSONObject(DESCRIPTION));
            ServiceConfig sc=createServiceConfig(jsonService.optJSONObject(CONFIG));
            DeviceService myService=new DeviceService(sd,sc,this);
            d.addService(myService);
          }
        }
        storedDevices.add(d);
      }
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
catch (    JSONException e) {
      e.printStackTrace();
    }
  }
}