Program: 161584
Project: 161584
Buggy source:
/** 
 * Constructor by parsing the JSONObject
 * @param jsonObject the JSONObject
 */
public MoodleCourseModule(JSONObject jsonObject){
  this.id=null;
  this.instance=null;
  this.modicon=null;
  this.modname=null;
  this.modplural=null;
  this.name=null;
  this.url=null;
  this.visible=null;
  this.contents=null;
  if (jsonObject != null) {
    if (!jsonObject.has("String_Node_Str")) {
      this.instance=jsonObject.optInt("String_Node_Str");
      this.id=jsonObject.optInt("String_Node_Str");
      this.modicon=jsonObject.optString("String_Node_Str");
      this.modname=jsonObject.optString("String_Node_Str");
      this.name=jsonObject.optString("String_Node_Str");
      this.modplural=jsonObject.optString("String_Node_Str");
      this.visible=jsonObject.optDouble("String_Node_Str");
      try {
        this.url=new URL(jsonObject.optString("String_Node_Str"));
      }
 catch (      MalformedURLException m) {
        this.url=null;
        this.message=m.getMessage();
        this.exception="String_Node_Str";
        this.errorCode="String_Node_Str";
      }
      MoodleCourseContent content;
      try {
        JSONArray jsonArray=jsonObject.getJSONArray("String_Node_Str");
        for (int i=0; i < jsonArray.length(); i++) {
          JSONObject c=jsonArray.getJSONObject(i);
          content=new MoodleCourseContent(c);
          contents.add(content);
        }
      }
 catch (      JSONException e) {
        this.contents=null;
        this.message="String_Node_Str";
        this.exception="String_Node_Str";
        this.errorCode="String_Node_Str";
        this.isValid=false;
      }
    }
 else {
      this.exception=jsonObject.optString("String_Node_Str");
      this.errorCode=jsonObject.optString("String_Node_Str");
      this.message=jsonObject.optString("String_Node_Str");
      this.isValid=false;
    }
  }
 else {
    this.exception="String_Node_Str";
    this.message="String_Node_Str";
    this.errorCode="String_Node_Str";
    this.isValid=false;
  }
}

Fixed version (ground truth):
/** 
 * Constructor by parsing the JSONObject
 * @param jsonObject the JSONObject
 */
public MoodleCourseModule(JSONObject jsonObject){
  this.id=null;
  this.instance=null;
  this.modicon=null;
  this.modname=null;
  this.modplural=null;
  this.name=null;
  this.url=null;
  this.visible=null;
  this.contents=null;
  if (jsonObject != null) {
    if (!jsonObject.has("String_Node_Str")) {
      this.instance=jsonObject.optInt("String_Node_Str");
      this.id=jsonObject.optInt("String_Node_Str");
      this.modicon=jsonObject.optString("String_Node_Str");
      this.modname=jsonObject.optString("String_Node_Str");
      this.name=jsonObject.optString("String_Node_Str");
      this.modplural=jsonObject.optString("String_Node_Str");
      this.visible=jsonObject.optDouble("String_Node_Str");
      try {
        this.url=new URL(jsonObject.optString("String_Node_Str"));
      }
 catch (      MalformedURLException m) {
        this.url=null;
        this.message=m.getMessage();
        this.exception="String_Node_Str";
        this.errorCode="String_Node_Str";
      }
      MoodleCourseContent content;
      try {
        JSONArray jsonArray=jsonObject.getJSONArray("String_Node_Str");
        this.contents=new ArrayList<MoodleCourseContent>();
        for (int i=0; i < jsonArray.length(); i++) {
          JSONObject c=jsonArray.getJSONObject(i);
          content=new MoodleCourseContent(c);
          contents.add(content);
        }
      }
 catch (      JSONException e) {
        this.contents=null;
        this.message="String_Node_Str";
        this.exception="String_Node_Str";
        this.errorCode="String_Node_Str";
        this.isValid=false;
      }
    }
 else {
      this.exception=jsonObject.optString("String_Node_Str");
      this.errorCode=jsonObject.optString("String_Node_Str");
      this.message=jsonObject.optString("String_Node_Str");
      this.isValid=false;
    }
  }
 else {
    this.exception="String_Node_Str";
    this.message="String_Node_Str";
    this.errorCode="String_Node_Str";
    this.isValid=false;
  }
}