Program: 133679
Project: 133679
Buggy source:
/** 
 * Refreshes the current plot category and type. <p> This method handles the proper JSON RPC to change the plot contents for the associated view. </p>
 * @param plotType The new plot type.
 * @param connection The current connection.
 * @throws Exception If the connection is invalid or the command could not be completed.
 */
private void refreshPlotType(String plotType,VtkWebClient connection) throws Exception {
  List<Object> args=new ArrayList<Object>();
  JSONObject object;
  JSONArray updatedProperties=new JSONArray();
  JSONObject pointStatusProperty=new JSONObject();
  pointStatusProperty.put("String_Node_Str",Integer.toString(fileId));
  pointStatusProperty.put("String_Node_Str","String_Node_Str");
  JSONArray pointArrays=new JSONArray();
  pointArrays.put(plotType);
  pointStatusProperty.put("String_Node_Str",pointArrays);
  updatedProperties.put(pointStatusProperty);
  args.add(updatedProperties);
  object=connection.call("String_Node_Str",args).get();
  if (!object.getBoolean("String_Node_Str")) {
    System.out.println("String_Node_Str");
    JSONArray array=object.getJSONArray("String_Node_Str");
    for (int i=0; i < array.length(); i++) {
      System.out.println(array.get(i));
    }
  }
  args.clear();
  args.add(Integer.toString(repId));
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  args.add(plotType);
  args.add("String_Node_Str");
  args.add(0);
  args.add(true);
  object=connection.call("String_Node_Str",args).get();
  args.clear();
  JSONObject legendVisibilities=new JSONObject();
  legendVisibilities.put(Integer.toString(fileId),true);
  args.add(legendVisibilities);
  object=connection.call("String_Node_Str",args).get();
  System.out.println(object.toString(4));
  args.clear();
  JSONObject scaleOptions=new JSONObject();
  scaleOptions.put("String_Node_Str","String_Node_Str");
  scaleOptions.put("String_Node_Str",fileId);
  args.add(scaleOptions);
  object=connection.call("String_Node_Str",args).get();
  System.out.println(object.toString(4));
  return;
}

Fixed version (ground truth):
/** 
 * Refreshes the current plot category and type. <p> This method handles the proper JSON RPC to change the plot contents for the associated view. </p>
 * @param plotType The new plot type.
 * @param connection The current connection.
 * @throws Exception If the connection is invalid or the command could not be completed.
 */
private void refreshPlotType(String plotCategory,String plotType,VtkWebClient connection) throws Exception {
  List<Object> args=new ArrayList<Object>();
  JSONObject object;
  JSONArray updatedProperties=new JSONArray();
  JSONObject statusProperty;
  JSONArray array;
  if (this.plotCategory != null) {
    statusProperty=new JSONObject();
    statusProperty.put("String_Node_Str",Integer.toString(fileId));
    statusProperty.put("String_Node_Str",plotTypeArrays.get(this.plotCategory));
    array=new JSONArray();
    statusProperty.put("String_Node_Str",array);
    updatedProperties.put(statusProperty);
  }
  statusProperty=new JSONObject();
  statusProperty.put("String_Node_Str",Integer.toString(fileId));
  statusProperty.put("String_Node_Str",plotTypeArrays.get(plotCategory));
  array=new JSONArray();
  array.put(plotType);
  statusProperty.put("String_Node_Str",array);
  updatedProperties.put(statusProperty);
  args.add(updatedProperties);
  object=connection.call("String_Node_Str",args).get();
  if (!object.getBoolean("String_Node_Str")) {
    System.out.println("String_Node_Str");
    array=object.getJSONArray("String_Node_Str");
    for (int i=0; i < array.length(); i++) {
      System.out.println(array.get(i));
    }
  }
  args.clear();
  args.add(Integer.toString(repId));
  args.add("String_Node_Str");
  args.add("String_Node_Str");
  args.add(plotType);
  args.add("String_Node_Str");
  args.add(0);
  args.add(true);
  object=connection.call("String_Node_Str",args).get();
  args.clear();
  args.add(viewId);
  connection.call("String_Node_Str",args).get();
  args.clear();
  JSONObject legendVisibilities=new JSONObject();
  legendVisibilities.put(Integer.toString(fileId),true);
  args.add(legendVisibilities);
  object=connection.call("String_Node_Str",args).get();
  System.out.println(object.toString(4));
  args.clear();
  JSONObject scaleOptions=new JSONObject();
  scaleOptions.put("String_Node_Str","String_Node_Str");
  scaleOptions.put("String_Node_Str",fileId);
  args.add(scaleOptions);
  object=connection.call("String_Node_Str",args).get();
  System.out.println(object.toString(4));
  return;
}