nus-yam/ex-repair huggingface dataset:
Program: 147132
Project: 147132
Buggy source:
public void exportAllModelsToJson(VisWebSocket socket){
  Object[] models=OpenSimDB.getInstance().getAllModels();
  for (int i=0; i < models.length; i++) {
    Model model=(Model)models[i];
    ModelVisualizationJson vizJson=null;
    if (getInstance().mapModelsToJsons.containsKey(model)) {
      vizJson=getInstance().mapModelsToJsons.get(model);
    }
 else {
      vizJson=new ModelVisualizationJson(jsondb,model);
      getInstance().addModelVisuals(model,vizJson);
    }
    exportModelJsonToVisualizer(vizJson,socket);
  }
}

Fixed version (ground truth):
public void exportAllModelsToJson(VisWebSocket socket){
  Object[] models=OpenSimDB.getInstance().getAllModels();
  for (int i=0; i < models.length; i++) {
    Model model=(Model)models[i];
    ModelVisualizationJson vizJson=null;
    if (debugLevel > 1)     System.out.println("String_Node_Str");
    if (getInstance().mapModelsToJsons.containsKey(model)) {
      vizJson=getInstance().mapModelsToJsons.get(model);
    }
 else {
      vizJson=createJsonFroModel(jsondb,model);
    }
    exportModelJsonToVisualizer(vizJson,socket);
  }
}
Program: 147134
Project: 147134
Buggy source:
public void updateIntegratorSettings(AbstractToolModel toolModel){
  maximumNumberOfSteps.setText(numFormat.format(toolModel.getMaximumNumberOfSteps()));
  maxDT.setText(numFormat.format(toolModel.getMaxDT()));
  minDT.setText(numFormat.format(toolModel.getMinDT()));
  errorTolerance.setText(numFormat.format(toolModel.getErrorTolerance()));
}

Fixed version (ground truth):
public void updateIntegratorSettings(AbstractToolModel toolModel){
  maximumNumberOfSteps.setText(numFormat.format(toolModel.getMaximumNumberOfSteps()));
  maxDT.setText(numFormat.format(toolModel.getMaxDT()));
  minDT.setText(numFormat.format(toolModel.getMinDT()));
  errorTolerance.setText(numFormat.format(toolModel.getErrorTolerance()));
  useSpecifiedDtActionPerformed(null);
}
Program: 147136
Project: 147136
Buggy source:
public String getDomainName(){
  if (domainName == null) {
    return "String_Node_Str";
  }
  if (builtinMuscleCurve) {
    Coordinate coord=currentModel.getCoordinateSet().get(domainName);
    return (coord.getRelativePathName(currentModel) + "String_Node_Str");
  }
  return domainName;
}

Fixed version (ground truth):
public String getDomainName(){
  if (domainName == null) {
    return "String_Node_Str";
  }
  if (builtinMuscleCurve && currentModel.getCoordinateSet().contains(domainName)) {
    Coordinate coord=currentModel.getCoordinateSet().get(domainName);
    return (coord.getRelativePathName(currentModel) + "String_Node_Str");
  }
  return domainName;
}
Program: 147137
Project: 147137
Buggy source:
Storage getStorage(String qName,Model model){
  AnalyzeTool tool=getAnalyzeTool(model);
  AnalysisSet analyses=model.getAnalysisSet();
  String[] qs=getBuiltinQuantities();
  for (int i=0; i < qs.length; i++) {
    if (qName.equalsIgnoreCase(qs[i])) {
      return analyses.get(builtinQuantitiesAnalysis[i]).getStorageList().get(builtinQuantitiesStorageName[i]);
    }
  }
  int numStorages=analyses.get("String_Node_Str").getStorageList().getSize();
  if (analyses.get("String_Node_Str").getStorageList().getIndex(qName) == -1) {
    MuscleAnalysis.safeDownCast(analyses.get("String_Node_Str")).allocateStorageObjects();
  }
  return analyses.get("String_Node_Str").getStorageList().get(qName);
}

Fixed version (ground truth):
Storage getStorage(String qName,Model model){
  AnalyzeTool tool=getAnalyzeTool(model);
  AnalysisSet analyses=model.getAnalysisSet();
  String[] qs=getBuiltinQuantities();
  for (int i=0; i < qs.length; i++) {
    if (qName.equalsIgnoreCase(qs[i])) {
      return analyses.get(builtinQuantitiesAnalysis[i]).getStorageList().get(builtinQuantitiesStorageName[i]);
    }
  }
  int numStorages=analyses.get("String_Node_Str").getStorageList().getSize();
  if (analyses.get("String_Node_Str").getStorageList().getIndex(qName) == -1) {
    MuscleAnalysis.safeDownCast(analyses.get("String_Node_Str")).setComputeMoments(true);
    MuscleAnalysis.safeDownCast(analyses.get("String_Node_Str")).allocateStorageObjects();
  }
  return analyses.get("String_Node_Str").getStorageList().get(qName);
}
Program: 147138
Project: 147138
Buggy source:
@Override public void implementLineGeometry(DecorativeLine arg0){
  Map<String,Object> dg_json=new LinkedHashMap<String,Object>();
  dg_json.put("String_Node_Str",geomID.toString());
  dg_json.put("String_Node_Str","String_Node_Str");
  String colorString=JSONUtilities.mapColorToRGBA(arg0.getColor());
  dg_json.put("String_Node_Str",colorString);
  JSONArray verts_array=new JSONArray();
  Map<String,Object> data_json=new LinkedHashMap<String,Object>();
  verts_array.add(arg0.getPoint1().get(0) * visualizerScaleFactor);
  verts_array.add(arg0.getPoint1().get(1) * visualizerScaleFactor);
  verts_array.add(arg0.getPoint1().get(2) * visualizerScaleFactor);
  verts_array.add(arg0.getPoint1().get(0) * visualizerScaleFactor);
  verts_array.add((arg0.getPoint1().get(1) + 0.5) * visualizerScaleFactor);
  verts_array.add(arg0.getPoint1().get(2) * visualizerScaleFactor);
  verts_array.add(arg0.getPoint2().get(0) * visualizerScaleFactor);
  verts_array.add(arg0.getPoint2().get(1) * visualizerScaleFactor);
  verts_array.add(arg0.getPoint2().get(2) * visualizerScaleFactor);
  data_json.put("String_Node_Str",3);
  data_json.put("String_Node_Str","String_Node_Str");
  data_json.put("String_Node_Str",verts_array);
  dg_json.put("String_Node_Str",data_json);
  jsonArr.add(dg_json);
  createMaterialJson(arg0,true);
}

Fixed version (ground truth):
@Override public void implementLineGeometry(DecorativeLine arg0){
  Map<String,Object> dg_json=new LinkedHashMap<String,Object>();
  dg_json.put("String_Node_Str",geomID.toString());
  dg_json.put("String_Node_Str","String_Node_Str");
  String colorString=JSONUtilities.mapColorToRGBA(arg0.getColor());
  dg_json.put("String_Node_Str",colorString);
  JSONArray verts_array=new JSONArray();
  Map<String,Object> data_json=new LinkedHashMap<String,Object>();
  verts_array.add(arg0.getPoint1().get(0) * visualizerScaleFactor);
  verts_array.add(arg0.getPoint1().get(1) * visualizerScaleFactor);
  verts_array.add(arg0.getPoint1().get(2) * visualizerScaleFactor);
  verts_array.add(arg0.getPoint2().get(0) * visualizerScaleFactor);
  verts_array.add(arg0.getPoint2().get(1) * visualizerScaleFactor);
  verts_array.add(arg0.getPoint2().get(2) * visualizerScaleFactor);
  data_json.put("String_Node_Str",3);
  data_json.put("String_Node_Str","String_Node_Str");
  data_json.put("String_Node_Str",verts_array);
  dg_json.put("String_Node_Str",data_json);
  jsonArr.add(dg_json);
  createMaterialJson(arg0,true);
}
Program: 147140
Project: 147140
Buggy source:
private void applyOperationToNode(final OpenSimObjectNode objectNode){
  Children ch=objectNode.getChildren();
  if (ch.getNodesCount() > 0) {
    Node[] childNodes=ch.getNodes();
    for (int child=0; child < childNodes.length; child++) {
      if (!(childNodes[child] instanceof OpenSimObjectNode))       continue;
      OpenSimObjectNode childNode=(OpenSimObjectNode)childNodes[child];
      this.applyOperationToNode(childNode);
    }
  }
  OpenSimObject obj=objectNode.getOpenSimObject();
  boolean hasPreferenceProperty=obj.hasProperty("String_Node_Str");
  if (hasPreferenceProperty) {
    AbstractProperty apbn=obj.getPropertyByName("String_Node_Str");
    boolean iso=apbn.isObjectProperty();
    OpenSimObject ap=obj.getPropertyByName("String_Node_Str").getValueAsObject();
    Appearance apObj=Appearance.safeDownCast(ap);
    SurfaceAppearance surfApp=apObj.get_surface_appearance();
    PropertyEditorAdaptor pea=new PropertyEditorAdaptor(objectNode.getModelForNode(),surfApp,surfApp.getPropertyByName("String_Node_Str"),objectNode);
    pea.setValueInt(show ? 3 : 0);
  }
 else {
    ViewDB.getInstance().toggleObjectsDisplay(obj,show);
    objectNode.refreshNode();
  }
}

Fixed version (ground truth):
private void applyOperationToNode(final OpenSimObjectNode objectNode){
  Children ch=objectNode.getChildren();
  if (ch.getNodesCount() > 0) {
    Node[] childNodes=ch.getNodes();
    for (int child=0; child < childNodes.length; child++) {
      if (!(childNodes[child] instanceof OpenSimObjectNode))       continue;
      OpenSimObjectNode childNode=(OpenSimObjectNode)childNodes[child];
      this.applyOperationToNode(childNode);
    }
  }
  OpenSimObject obj=objectNode.getOpenSimObject();
  boolean hasPreferenceProperty=obj.hasProperty("String_Node_Str");
  if (hasPreferenceProperty) {
    AbstractProperty apbn=obj.getPropertyByName("String_Node_Str");
    boolean iso=apbn.isObjectProperty();
    OpenSimObject ap=obj.getPropertyByName("String_Node_Str").getValueAsObject();
    Appearance apObj=Appearance.safeDownCast(ap);
    SurfaceProperties surfApp=apObj.get_surface_properties();
    PropertyEditorAdaptor pea=new PropertyEditorAdaptor(objectNode.getModelForNode(),surfApp,surfApp.getPropertyByName("String_Node_Str"),objectNode);
    pea.setValueInt(show ? 3 : 0);
  }
 else {
    ViewDB.getInstance().toggleObjectsDisplay(obj,show);
    objectNode.refreshNode();
  }
}
Program: 147141
Project: 147141
Buggy source:
private void addAppearanceProperties(Appearance disp,Sheet sheet){
  try {
    sheet.remove("String_Node_Str");
    Sheet.Set appearanceSheet=createExpertSet();
    appearanceSheet.setDisplayName("String_Node_Str");
    sheet.put(appearanceSheet);
    PropertySupport.Reflection nextNodeProp4;
    nextNodeProp4=new PropertySupport.Reflection(this,Color.class,"String_Node_Str","String_Node_Str");
    nextNodeProp4.setName("String_Node_Str");
    appearanceSheet.put(nextNodeProp4);
    PropertySupport.Reflection nextNodeProp5;
    nextNodeProp5=new PropertySupport.Reflection(this,double.class,"String_Node_Str","String_Node_Str");
    nextNodeProp5.setName("String_Node_Str");
    appearanceSheet.put(nextNodeProp5);
    PropertySupport.Reflection nextNodePropRepresentation;
    SurfaceAppearance surfApp=disp.get_surface_appearance();
    nextNodePropRepresentation=new PropertySupport.Reflection(surfApp,int.class,"String_Node_Str","String_Node_Str");
    nextNodePropRepresentation.setName("String_Node_Str");
    appearanceSheet.put(nextNodePropRepresentation);
  }
 catch (  NoSuchMethodException ex) {
    ex.printStackTrace();
  }
}

Fixed version (ground truth):
private void addAppearanceProperties(Appearance disp,Sheet sheet){
  try {
    sheet.remove("String_Node_Str");
    Sheet.Set appearanceSheet=createExpertSet();
    appearanceSheet.setDisplayName("String_Node_Str");
    sheet.put(appearanceSheet);
    PropertySupport.Reflection nextNodeProp4;
    nextNodeProp4=new PropertySupport.Reflection(this,Color.class,"String_Node_Str","String_Node_Str");
    nextNodeProp4.setName("String_Node_Str");
    appearanceSheet.put(nextNodeProp4);
    PropertySupport.Reflection nextNodeProp5;
    nextNodeProp5=new PropertySupport.Reflection(this,double.class,"String_Node_Str","String_Node_Str");
    nextNodeProp5.setName("String_Node_Str");
    appearanceSheet.put(nextNodeProp5);
    PropertySupport.Reflection nextNodePropRepresentation;
    SurfaceProperties surfApp=disp.get_surface_properties();
    nextNodePropRepresentation=new PropertySupport.Reflection(surfApp,int.class,"String_Node_Str","String_Node_Str");
    nextNodePropRepresentation.setName("String_Node_Str");
    appearanceSheet.put(nextNodePropRepresentation);
  }
 catch (  NoSuchMethodException ex) {
    ex.printStackTrace();
  }
}
Program: 147142
Project: 147142
Buggy source:
@OnWebSocketMessage public void visMessage(String stringToParse){
  try {
    System.out.println("String_Node_Str" + stringToParse);
    JSONParser parser=new JSONParser();
    JSONObject jsonObj=(JSONObject)parser.parse(stringToParse);
    setChanged();
    notifyObservers(jsonObj);
  }
 catch (  ParseException ex) {
    Logger.getLogger(VisWebSocket.class.getName()).log(Level.SEVERE,null,ex);
  }
}

Fixed version (ground truth):
@OnWebSocketMessage public void visMessage(String stringToParse){
  try {
    JSONParser parser=new JSONParser();
    JSONObject jsonObj=(JSONObject)parser.parse(stringToParse);
    setChanged();
    notifyObservers(jsonObj);
  }
 catch (  ParseException ex) {
    Logger.getLogger(VisWebSocket.class.getName()).log(Level.SEVERE,null,ex);
  }
}
Program: 147143
Project: 147143
Buggy source:
private void updateVariableDecorations(Component mc){
  ArrayDecorativeGeometry adg=new ArrayDecorativeGeometry();
  mc.generateDecorations(false,modelDisplayHints,model.getWorkingState(),adg);
  currentVariableGeometryDisplayers=mapComponentsToVariableVisuals.get(mc);
  int oldSize=(currentVariableGeometryDisplayers == null) ? 0 : currentVariableGeometryDisplayers.size();
  int newSize=(int)adg.size();
  if (oldSize != newSize) {
    if (oldSize != 0)     removeDisplayersFromScene(currentVariableGeometryDisplayers);
    updateMode=false;
  }
  for (int i=0; i < adg.size(); i++) {
    adg.getElt(i).implementGeometry(this);
  }
}

Fixed version (ground truth):
private void updateVariableDecorations(Component mc){
  ArrayDecorativeGeometry adg=new ArrayDecorativeGeometry();
  mc.generateDecorations(false,modelDisplayHints,model.getWorkingState(),adg);
  currentVariableGeometryDisplayers=mapComponentsToVariableVisuals.get(mc);
  int oldSize=(currentVariableGeometryDisplayers == null) ? 0 : currentVariableGeometryDisplayers.size();
  int newSize=(int)adg.size();
  if (oldSize != newSize) {
    if (oldSize != 0)     removeDisplayersFromScene(currentVariableGeometryDisplayers);
    updateMode=false;
  }
  for (int i=0; i < newSize; i++) {
    adg.getElt(i).implementGeometry(this);
  }
}
Program: 147144
Project: 147144
Buggy source:
/** 
 * Displayer for Wrap Geometry
 * @param ag
 * @param object 
 */
DecorativeLineDisplayer(DecorativeLine ag){
  point1=new Vec3(ag.getPoint1());
  point2=new Vec3(ag.getPoint2());
  agLocal=ag.clone();
}

Fixed version (ground truth):
/** 
 * Displayer for Wrap Geometry
 * @param ag
 * @param object 
 */
DecorativeLineDisplayer(DecorativeLine ag){
  agLocal=ag.clone();
}
Program: 147145
Project: 147145
Buggy source:
/** 
 * Convert DecorativeGeometry object passed in to the corresponding vtk polyhedral representation. Transform is passed in as well since the way it applies to PolyData depends on source
 */
private vtkPolyData getPolyData(){
  if (line == null) {
    line=new vtkLineSource();
    line.SetPoint1(getPoint1().get(0),getPoint1().get(1),getPoint1().get(2));
    line.SetPoint2(getPoint2().get(0),getPoint2().get(1),getPoint2().get(2));
    dFilter.SetInput(line.GetOutput());
    dFilter.SetRadius(.005);
  }
  return dFilter.GetOutput();
}

Fixed version (ground truth):
/** 
 * Convert DecorativeGeometry object passed in to the corresponding vtk polyhedral representation. Transform is passed in as well since the way it applies to PolyData depends on source
 */
private vtkPolyData getPolyData(){
  Vec3 p1=agLocal.getPoint1();
  Vec3 p2=agLocal.getPoint2();
  line.SetPoint1(p1.get(0),p1.get(1),p1.get(2));
  line.SetPoint2(p2.get(0),p2.get(1),p2.get(2));
  line.Modified();
  dFilter.SetInput(line.GetOutput());
  dFilter.SetRadius(.005);
  return dFilter.GetOutput();
}
Program: 147146
Project: 147146
Buggy source:
@Override void updateGeometry(DecorativeGeometry arg){
  DecorativeLine arg0=(DecorativeLine)arg;
  agLocal.setPoint1(arg0.getPoint1());
  agLocal.setPoint2(arg0.getPoint2());
  updateDisplayFromDecorativeGeometry();
}

Fixed version (ground truth):
@Override void updateGeometry(DecorativeGeometry arg){
  DecorativeLine arg0=(DecorativeLine)arg;
  agLocal.setPoint1(new Vec3(arg0.getPoint1()));
  agLocal.setPoint2(new Vec3(arg0.getPoint2()));
  updateDisplayFromDecorativeGeometry();
}
Program: 147147
Project: 147147
Buggy source:
void applyColorsFromModel(){
  VisibleObject bodyVisibleObject=body.getDisplayer();
  GeometrySet gSet=bodyVisibleObject.getGeometrySet();
  for (int k=0; k < gSet.getSize(); ++k) {
    Geometry gPiece=gSet.get(k);
    double[] colorOnFile=new double[3];
    gPiece.getColor(colorOnFile);
    DisplayGeometryDisplayer gd=(DisplayGeometryDisplayer)mapGeometryToVtkObjects.get(gPiece);
    if (gd == null)     continue;
    gd.GetProperty().SetColor(colorOnFile);
    gd.Modified();
  }
}

Fixed version (ground truth):
void applyColorsFromModel(){
}
Program: 147148
Project: 147148
Buggy source:
/** 
 * Cycle thru geometry and apply preferences including vis of joint frames, colors, COM
 */
public void applyDisplayPreferences(){
  VisibleObject bodyVisibleObject=body.getDisplayer();
  GeometrySet gSet=bodyVisibleObject.getGeometrySet();
  for (int i=0; i < gSet.getSize(); i++) {
    Geometry gPiece=gSet.get(i);
    DisplayGeometryDisplayer gActor=(DisplayGeometryDisplayer)mapGeometryToVtkObjects.get(gPiece);
    if (gActor == null)     continue;
    gActor.applyDisplayPreferenceToActor();
  }
}

Fixed version (ground truth):
/** 
 * Cycle thru geometry and apply preferences including vis of joint frames, colors, COM
 */
public void applyDisplayPreferences(){
}
Program: 147149
Project: 147149
Buggy source:
private void updateMapsToSupportPicking(final Body body,Hashtable<OpenSimObject,vtkProp3D> mapObject2VtkObjects,Hashtable<vtkProp3D,OpenSimObject> mapVtkObjects2Objects){
  mapObject2VtkObjects.put(body,this);
  vtkProp3DCollection props=displayGeometryAssembly.GetParts();
  props.InitTraversal();
  ArrayList<vtkActor> actors=new ArrayList<vtkActor>();
  int idx=0;
  GeometrySet gSet=body.getDisplayer().getGeometrySet();
  for (int act=0; act < props.GetNumberOfItems(); act++) {
    vtkProp3D nextActor=props.GetNextProp3D();
    mapVtkObjects2Objects.put(nextActor,body);
    if (nextActor instanceof vtkActor)     actors.add((vtkActor)nextActor);
    if (nextActor instanceof FrameActor || nextActor == centerOfMassActor)     continue;
    mapObject2VtkObjects.put(gSet.get(idx),nextActor);
    idx++;
  }
}

Fixed version (ground truth):
private void updateMapsToSupportPicking(final Body body,Hashtable<OpenSimObject,vtkProp3D> mapObject2VtkObjects,Hashtable<vtkProp3D,OpenSimObject> mapVtkObjects2Objects){
  mapObject2VtkObjects.put(body,this);
  vtkProp3DCollection props=displayGeometryAssembly.GetParts();
  props.InitTraversal();
  ArrayList<vtkActor> actors=new ArrayList<vtkActor>();
  int idx=0;
}
Program: 147150
Project: 147150
Buggy source:
public double[] GetColorOrReturnNull(){
  double[] colorOfAllPiecesOrNullIfColorOfPiecesDiffer=null;
  VisibleObject bodyVisibleObject=body.getDisplayer();
  GeometrySet bodyDisplayerGeometrySet=bodyVisibleObject.getGeometrySet();
  int numberOfPieces=bodyDisplayerGeometrySet == null ? 0 : bodyDisplayerGeometrySet.getSize();
  for (int i=0; i < numberOfPieces; i++) {
    Geometry gi=bodyDisplayerGeometrySet.get(i);
    double[] colorOfCurrentPiece={-1,-1,-1};
    gi.getColor(colorOfCurrentPiece);
    for (int j=0; j < 3; j++) {
      if (colorOfCurrentPiece[i] < 0 || colorOfCurrentPiece[i] > 1)       return null;
    }
    if (colorOfAllPiecesOrNullIfColorOfPiecesDiffer == null)     colorOfAllPiecesOrNullIfColorOfPiecesDiffer=colorOfCurrentPiece;
 else     for (int k=0; k < 3; k++) {
      if (colorOfCurrentPiece[i] != colorOfAllPiecesOrNullIfColorOfPiecesDiffer[i])       return null;
    }
  }
  return colorOfAllPiecesOrNullIfColorOfPiecesDiffer;
}

Fixed version (ground truth):
public double[] GetColorOrReturnNull(){
  double[] colorOfAllPiecesOrNullIfColorOfPiecesDiffer=null;
  return colorOfAllPiecesOrNullIfColorOfPiecesDiffer;
}
Program: 147151
Project: 147151
Buggy source:
/** 
 * Update display of Body to correspond to latest Properties
 */
void updateFromProperties(){
  applyVisibleObjectScaleAndTransform(body.getDisplayer(),displayGeometryAssembly);
  applyColorsFromModel();
  applyDisplayPreferences();
  Enumeration<Body> childBodies=mapChildren2Frames.keys();
  while (childBodies.hasMoreElements()) {
    Body child=childBodies.nextElement();
    if (mapChildren2Frames.containsKey(child)) {
      setShowJointPFrame(child,false);
      setShowJointPFrame(child,true);
    }
  }
  SetCMLocationFromPropertyTable(true);
}

Fixed version (ground truth):
/** 
 * Update display of Body to correspond to latest Properties
 */
void updateFromProperties(){
  applyColorsFromModel();
  applyDisplayPreferences();
  Enumeration<Body> childBodies=mapChildren2Frames.keys();
  while (childBodies.hasMoreElements()) {
    Body child=childBodies.nextElement();
    if (mapChildren2Frames.containsKey(child)) {
    }
  }
  SetCMLocationFromPropertyTable(true);
}
Program: 147152
Project: 147152
Buggy source:
public void setColor(double[] colorComponents){
  VisibleObject bodyVisibleObject=body.getDisplayer();
  GeometrySet gSet=bodyVisibleObject.getGeometrySet();
  for (int k=0; k < gSet.getSize(); ++k) {
    Geometry gPiece=gSet.get(k);
    gPiece.setColor(colorComponents);
  }
}

Fixed version (ground truth):
public void setColor(double[] colorComponents){
}
Program: 147153
Project: 147153
Buggy source:
public void SetCMLocationFromPropertyTable(boolean updateView){
  double[] cmLocationToFill=new double[3];
  body.getCenterOfMass(cmLocationToFill);
  myCMSphereSourceVTK.SetCenter(cmLocationToFill);
  if (updateView) {
    super.Modified();
    ViewDB.getInstance().repaintAll();
  }
}

Fixed version (ground truth):
public void SetCMLocationFromPropertyTable(boolean updateView){
  Vec3 cmLocationToFill=body.getMassCenter();
  myCMSphereSourceVTK.SetCenter(cmLocationToFill.get(0),cmLocationToFill.get(1),cmLocationToFill.get(2));
  if (updateView) {
    super.Modified();
    ViewDB.getInstance().repaintAll();
  }
}
Program: 147154
Project: 147154
Buggy source:
public void setDisplayPreference(Geometry.Representation newPref){
  body.getDisplayer().setDisplayPreference(newPref);
}

Fixed version (ground truth):
public void setDisplayPreference(Geometry.Representation newPref){
}
Program: 147155
Project: 147155
Buggy source:
public Geometry.Representation getDisplayPreference(){
  return body.getDisplayer().getDisplayPreference();
}

Fixed version (ground truth):
public Geometry.Representation getDisplayPreference(){
  return Geometry.Representation.DrawSurface;
}
Program: 147156
Project: 147156
Buggy source:
public void setOpacity(double newOpacity){
  VisibleObject bodyVisibleObject=body.getDisplayer();
  GeometrySet gSet=bodyVisibleObject.getGeometrySet();
  for (int k=0; k < gSet.getSize(); ++k) {
    Geometry gPiece=gSet.get(k);
    gPiece.setOpacity(newOpacity);
  }
}

Fixed version (ground truth):
public void setOpacity(double newOpacity){
}
Program: 147157
Project: 147157
Buggy source:
@Override void updateDisplayFromDecorativeGeometry(){
  vtkPolyData polyData=getPolyData(ag);
  createAndConnectMapper(polyData);
  setXformAndAttributesFromDecorativeGeometry(ag);
}

Fixed version (ground truth):
@Override void updateDisplayFromDecorativeGeometry(){
  vtkPolyData polyData=getPolyData(ag);
  createAndConnectMapper(polyData);
}
Program: 147158
Project: 147158
Buggy source:
@Override void updateDisplayFromDecorativeGeometry(){
  vtkPolyData polyData=getPolyData(ag);
  createAndConnectMapper(polyData);
  setXformAndAttributesFromDecorativeGeometry(ag);
}

Fixed version (ground truth):
@Override void updateDisplayFromDecorativeGeometry(){
  vtkPolyData polyData=getPolyData(ag);
  createAndConnectMapper(polyData);
}
Program: 147159
Project: 147159
Buggy source:
@Override void updateDisplayFromDecorativeGeometry(){
  vtkPolyData polyData=getPolyData(ag);
  createAndConnectMapper(polyData);
  setXformAndAttributesFromDecorativeGeometry(ag);
}

Fixed version (ground truth):
@Override void updateDisplayFromDecorativeGeometry(){
  vtkPolyData polyData=getPolyData(ag);
  createAndConnectMapper(polyData);
}
Program: 147160
Project: 147160
Buggy source:
@Override void updateDisplayFromDecorativeGeometry(){
  vtkPolyData polyData=getPolyData(ag);
  createAndConnectMapper(polyData);
  setXformAndAttributesFromDecorativeGeometry(ag);
}

Fixed version (ground truth):
@Override void updateDisplayFromDecorativeGeometry(){
  vtkPolyData polyData=getPolyData(ag);
  createAndConnectMapper(polyData);
}
Program: 147161
Project: 147161
Buggy source:
@Override public void implementCylinderGeometry(DecorativeCylinder arg0){
  if (updateMode) {
    System.out.println("String_Node_Str");
    ListIterator<DecorativeGeometryDisplayer> listIterator=getCurrentGeometryDisplayers();
    boolean found=false;
    while (listIterator.hasNext() && !found) {
      DecorativeGeometryDisplayer nextDisplayer=listIterator.next();
      if (nextDisplayer instanceof DecorativeCylinderDisplayer) {
        DecorativeCylinderDisplayer displayer=(DecorativeCylinderDisplayer)nextDisplayer;
        if (displayer.getBodyId() == arg0.getBodyId() && displayer.getIndexOnBody() == arg0.getIndexOnBody()) {
          displayer.copyAttributesFromDecorativeGeometry(arg0);
          found=true;
          displayer.Modified();
        }
      }
    }
  }
 else {
    BodyDisplayer bd=mapBodyIndicesToDisplayers.get(arg0.getBodyId());
    DecorativeCylinderDisplayer cylDisplayer=new DecorativeCylinderDisplayer(arg0);
    bd.AddPart(cylDisplayer.computeVisuals());
    addDisplayerToCurrentList(cylDisplayer);
    mapVisualsToObjects.put(cylDisplayer.computeVisuals(),currentModelComponent);
  }
}

Fixed version (ground truth):
@Override public void implementCylinderGeometry(DecorativeCylinder arg0){
  if (updateMode) {
    System.out.println("String_Node_Str");
    ListIterator<DecorativeGeometryDisplayer> listIterator=getCurrentGeometryDisplayers();
    boolean found=false;
    while (listIterator.hasNext() && !found) {
      DecorativeGeometryDisplayer nextDisplayer=listIterator.next();
      if (nextDisplayer instanceof DecorativeCylinderDisplayer) {
        DecorativeCylinderDisplayer displayer=(DecorativeCylinderDisplayer)nextDisplayer;
        if (displayer.getBodyId() == arg0.getBodyId() && displayer.getIndexOnBody() == arg0.getIndexOnBody()) {
          found=true;
          displayer.Modified();
        }
      }
    }
  }
 else {
    BodyDisplayer bd=mapBodyIndicesToDisplayers.get(arg0.getBodyId());
    DecorativeCylinderDisplayer cylDisplayer=new DecorativeCylinderDisplayer(arg0);
    bd.AddPart(cylDisplayer.computeVisuals());
    addDisplayerToCurrentList(cylDisplayer);
    mapVisualsToObjects.put(cylDisplayer.computeVisuals(),currentModelComponent);
  }
}
Program: 147162
Project: 147162
Buggy source:
@Override public void implementSphereGeometry(DecorativeSphere arg0){
  System.out.println("String_Node_Str" + arg0.getRadius() + "String_Node_Str"+ arg0.getTransform().T().toString()+ "String_Node_Str"+ arg0.getBodyId()+ "String_Node_Str"+ arg0.getIndexOnBody());
  if (updateMode) {
    System.out.println("String_Node_Str");
    ListIterator<DecorativeGeometryDisplayer> listIterator=getCurrentGeometryDisplayers();
    boolean found=false;
    while (listIterator.hasNext() && !found) {
      DecorativeGeometryDisplayer nextDisplayer=listIterator.next();
      if (nextDisplayer instanceof DecorativeSphereDisplayer) {
        DecorativeSphereDisplayer displayer=(DecorativeSphereDisplayer)nextDisplayer;
        if (displayer.getBodyId() == arg0.getBodyId() && displayer.getIndexOnBody() == arg0.getIndexOnBody()) {
          displayer.copyAttributesFromDecorativeGeometry(arg0);
          found=true;
          displayer.Modified();
        }
      }
    }
  }
 else {
    BodyDisplayer bd=mapBodyIndicesToDisplayers.get(arg0.getBodyId());
    DecorativeSphereDisplayer sphereDisplayer=new DecorativeSphereDisplayer(arg0);
    bd.AddPart(sphereDisplayer.computeVisuals());
    addDisplayerToCurrentList(sphereDisplayer);
    mapVisualsToObjects.put(sphereDisplayer.computeVisuals(),currentModelComponent);
  }
}

Fixed version (ground truth):
@Override public void implementSphereGeometry(DecorativeSphere arg0){
  System.out.println("String_Node_Str" + arg0.getRadius() + "String_Node_Str"+ arg0.getTransform().T().toString()+ "String_Node_Str"+ arg0.getBodyId()+ "String_Node_Str"+ arg0.getIndexOnBody());
  if (updateMode) {
    System.out.println("String_Node_Str");
    ListIterator<DecorativeGeometryDisplayer> listIterator=getCurrentGeometryDisplayers();
    boolean found=false;
    while (listIterator.hasNext() && !found) {
      DecorativeGeometryDisplayer nextDisplayer=listIterator.next();
      if (nextDisplayer instanceof DecorativeSphereDisplayer) {
        DecorativeSphereDisplayer displayer=(DecorativeSphereDisplayer)nextDisplayer;
        if (displayer.getBodyId() == arg0.getBodyId() && displayer.getIndexOnBody() == arg0.getIndexOnBody()) {
          found=true;
          displayer.Modified();
        }
      }
    }
  }
 else {
    BodyDisplayer bd=mapBodyIndicesToDisplayers.get(arg0.getBodyId());
    DecorativeSphereDisplayer sphereDisplayer=new DecorativeSphereDisplayer(arg0);
    bd.AddPart(sphereDisplayer.computeVisuals());
    addDisplayerToCurrentList(sphereDisplayer);
    mapVisualsToObjects.put(sphereDisplayer.computeVisuals(),currentModelComponent);
  }
}
Program: 147163
Project: 147163
Buggy source:
private void updateFixedDecorations(ModelComponent mc){
  ArrayDecorativeGeometry adg=new ArrayDecorativeGeometry();
  mc.generateDecorations(true,modelDisplayHints,model.getWorkingState(),adg);
  currentFixedGeometryDisplayers=mapComponentsToFixedVisuals.get(mc);
  for (int i=0; i < adg.size(); i++) {
    adg.getElt(i).implementGeometry(this);
  }
}

Fixed version (ground truth):
private void updateFixedDecorations(ModelComponent mc){
  ArrayDecorativeGeometry adg=new ArrayDecorativeGeometry();
  currentFixedGeometryDisplayers=mapComponentsToFixedVisuals.get(mc);
  for (int i=0; i < adg.size(); i++) {
    adg.getElt(i).implementGeometry(this);
  }
}
Program: 147164
Project: 147164
Buggy source:
@Override public void implementEllipsoidGeometry(DecorativeEllipsoid arg0){
  if (updateMode) {
    System.out.println("String_Node_Str");
    ListIterator<DecorativeGeometryDisplayer> listIterator=getCurrentGeometryDisplayers();
    boolean found=false;
    while (listIterator.hasNext() && !found) {
      DecorativeGeometryDisplayer nextDisplayer=listIterator.next();
      if (nextDisplayer instanceof DecorativeEllipsoidDisplayer) {
        DecorativeEllipsoidDisplayer ellipsoidDisplayer=(DecorativeEllipsoidDisplayer)nextDisplayer;
        if (ellipsoidDisplayer.getBodyId() == arg0.getBodyId() && ellipsoidDisplayer.getIndexOnBody() == arg0.getIndexOnBody()) {
          ellipsoidDisplayer.copyAttributesFromDecorativeGeometry(arg0);
          found=true;
          ellipsoidDisplayer.Modified();
        }
      }
    }
  }
 else {
    BodyDisplayer bd=mapBodyIndicesToDisplayers.get(arg0.getBodyId());
    DecorativeEllipsoidDisplayer ellipsoidDisplayer=new DecorativeEllipsoidDisplayer(arg0);
    bd.AddPart(ellipsoidDisplayer.computeVisuals());
    addDisplayerToCurrentList(ellipsoidDisplayer);
    mapVisualsToObjects.put(ellipsoidDisplayer.computeVisuals(),currentModelComponent);
  }
}

Fixed version (ground truth):
@Override public void implementEllipsoidGeometry(DecorativeEllipsoid arg0){
  if (updateMode) {
    System.out.println("String_Node_Str");
    ListIterator<DecorativeGeometryDisplayer> listIterator=getCurrentGeometryDisplayers();
    boolean found=false;
    while (listIterator.hasNext() && !found) {
      DecorativeGeometryDisplayer nextDisplayer=listIterator.next();
      if (nextDisplayer instanceof DecorativeEllipsoidDisplayer) {
        DecorativeEllipsoidDisplayer ellipsoidDisplayer=(DecorativeEllipsoidDisplayer)nextDisplayer;
        if (ellipsoidDisplayer.getBodyId() == arg0.getBodyId() && ellipsoidDisplayer.getIndexOnBody() == arg0.getIndexOnBody()) {
          found=true;
          ellipsoidDisplayer.Modified();
        }
      }
    }
  }
 else {
    BodyDisplayer bd=mapBodyIndicesToDisplayers.get(arg0.getBodyId());
    DecorativeEllipsoidDisplayer ellipsoidDisplayer=new DecorativeEllipsoidDisplayer(arg0);
    bd.AddPart(ellipsoidDisplayer.computeVisuals());
    addDisplayerToCurrentList(ellipsoidDisplayer);
    mapVisualsToObjects.put(ellipsoidDisplayer.computeVisuals(),currentModelComponent);
  }
}
Program: 147165
Project: 147165
Buggy source:
private void updateVariableDecorations(ModelComponent mc){
  ArrayDecorativeGeometry adg=new ArrayDecorativeGeometry();
  mc.generateDecorations(false,modelDisplayHints,model.getWorkingState(),adg);
  currentVariableGeometryDisplayers=mapComponentsToVariableVisuals.get(mc);
  int oldSize=(currentVariableGeometryDisplayers == null) ? 0 : currentVariableGeometryDisplayers.size();
  int newSize=(int)adg.size();
  if (oldSize != newSize) {
    if (oldSize != 0)     removeDisplayersFromScene(currentVariableGeometryDisplayers);
    updateMode=false;
  }
  for (int i=0; i < adg.size(); i++) {
    adg.getElt(i).implementGeometry(this);
  }
}

Fixed version (ground truth):
private void updateVariableDecorations(ModelComponent mc){
  ArrayDecorativeGeometry adg=new ArrayDecorativeGeometry();
  currentVariableGeometryDisplayers=mapComponentsToVariableVisuals.get(mc);
  int oldSize=(currentVariableGeometryDisplayers == null) ? 0 : currentVariableGeometryDisplayers.size();
  int newSize=(int)adg.size();
  if (oldSize != newSize) {
    if (oldSize != 0)     removeDisplayersFromScene(currentVariableGeometryDisplayers);
    updateMode=false;
  }
  for (int i=0; i < adg.size(); i++) {
    adg.getElt(i).implementGeometry(this);
  }
}
Program: 147166
Project: 147166
Buggy source:
@Override public void implementLineGeometry(DecorativeLine arg0){
  System.out.println("String_Node_Str" + arg0.getPoint1().toString() + arg0.getPoint2().toString()+ "String_Node_Str"+ arg0.getTransform().T().toString()+ "String_Node_Str"+ arg0.getColor());
  if (updateMode) {
    System.out.println("String_Node_Str");
    ListIterator<DecorativeGeometryDisplayer> listIterator=getCurrentGeometryDisplayers();
    boolean found=false;
    while (listIterator.hasNext() && !found) {
      DecorativeGeometryDisplayer nextDisplayer=listIterator.next();
      if (nextDisplayer instanceof DecorativeLineDisplayer) {
        DecorativeLineDisplayer displayer=(DecorativeLineDisplayer)nextDisplayer;
        if (displayer.getBodyId() == arg0.getBodyId() && displayer.getIndexOnBody() == arg0.getIndexOnBody()) {
          displayer.copyAttributesFromDecorativeGeometry(arg0);
          found=true;
          displayer.Modified();
        }
      }
    }
  }
 else {
    BodyDisplayer bd=mapBodyIndicesToDisplayers.get(arg0.getBodyId());
    DecorativeLineDisplayer lineDisplayer=new DecorativeLineDisplayer(arg0);
    bd.AddPart(lineDisplayer.computeVisuals());
    addDisplayerToCurrentList(lineDisplayer);
    mapVisualsToObjects.put(lineDisplayer.computeVisuals(),currentModelComponent);
  }
}

Fixed version (ground truth):
@Override public void implementLineGeometry(DecorativeLine arg0){
  System.out.println("String_Node_Str" + arg0.getPoint1().toString() + arg0.getPoint2().toString()+ "String_Node_Str"+ arg0.getTransform().T().toString()+ "String_Node_Str"+ arg0.getColor());
  if (updateMode) {
    System.out.println("String_Node_Str");
    ListIterator<DecorativeGeometryDisplayer> listIterator=getCurrentGeometryDisplayers();
    boolean found=false;
    while (listIterator.hasNext() && !found) {
      DecorativeGeometryDisplayer nextDisplayer=listIterator.next();
      if (nextDisplayer instanceof DecorativeLineDisplayer) {
        DecorativeLineDisplayer displayer=(DecorativeLineDisplayer)nextDisplayer;
        if (displayer.getBodyId() == arg0.getBodyId() && displayer.getIndexOnBody() == arg0.getIndexOnBody()) {
          found=true;
          displayer.Modified();
        }
      }
    }
  }
 else {
    BodyDisplayer bd=mapBodyIndicesToDisplayers.get(arg0.getBodyId());
    DecorativeLineDisplayer lineDisplayer=new DecorativeLineDisplayer(arg0);
    bd.AddPart(lineDisplayer.computeVisuals());
    addDisplayerToCurrentList(lineDisplayer);
    mapVisualsToObjects.put(lineDisplayer.computeVisuals(),currentModelComponent);
  }
}
Program: 147167
Project: 147167
Buggy source:
@Override public void implementMeshFileGeometry(DecorativeMeshFile arg0){
  if (updateMode) {
    System.out.println("String_Node_Str");
    ListIterator<DecorativeGeometryDisplayer> listIterator=getCurrentGeometryDisplayers();
    boolean found=false;
    while (listIterator.hasNext() && !found) {
      DecorativeGeometryDisplayer nextDisplayer=listIterator.next();
      if (nextDisplayer instanceof DecorativeMeshFileDisplayer) {
        DecorativeMeshFileDisplayer displayer=(DecorativeMeshFileDisplayer)nextDisplayer;
        if (displayer.getBodyId() == arg0.getBodyId() && displayer.getIndexOnBody() == arg0.getIndexOnBody()) {
          displayer.copyAttributesFromDecorativeGeometry(arg0);
          found=true;
          displayer.Modified();
        }
      }
    }
  }
 else {
    BodyDisplayer bd=mapBodyIndicesToDisplayers.get(arg0.getBodyId());
    String fullFileName=GeometryFileLocator.getInstance().getFullname(modelFilePath,arg0.getMeshFile(),false);
    if (fullFileName == null)     return;
    DecorativeMeshFileDisplayer meshDisplayer=new DecorativeMeshFileDisplayer(arg0,modelFilePath);
    bd.AddPart(meshDisplayer.computeVisuals());
    addDisplayerToCurrentList(meshDisplayer);
    mapVisualsToObjects.put(meshDisplayer.computeVisuals(),currentModelComponent);
  }
}

Fixed version (ground truth):
@Override public void implementMeshFileGeometry(DecorativeMeshFile arg0){
  if (updateMode) {
    System.out.println("String_Node_Str");
    ListIterator<DecorativeGeometryDisplayer> listIterator=getCurrentGeometryDisplayers();
    boolean found=false;
    while (listIterator.hasNext() && !found) {
      DecorativeGeometryDisplayer nextDisplayer=listIterator.next();
      if (nextDisplayer instanceof DecorativeMeshFileDisplayer) {
        DecorativeMeshFileDisplayer displayer=(DecorativeMeshFileDisplayer)nextDisplayer;
        if (displayer.getBodyId() == arg0.getBodyId() && displayer.getIndexOnBody() == arg0.getIndexOnBody()) {
          found=true;
          displayer.Modified();
        }
      }
    }
  }
 else {
    BodyDisplayer bd=mapBodyIndicesToDisplayers.get(arg0.getBodyId());
    String fullFileName=GeometryFileLocator.getInstance().getFullname(modelFilePath,arg0.getMeshFile(),false);
    if (fullFileName == null)     return;
    DecorativeMeshFileDisplayer meshDisplayer=new DecorativeMeshFileDisplayer(arg0,modelFilePath);
    bd.AddPart(meshDisplayer.computeVisuals());
    addDisplayerToCurrentList(meshDisplayer);
    mapVisualsToObjects.put(meshDisplayer.computeVisuals(),currentModelComponent);
  }
}
Program: 147168
Project: 147168
Buggy source:
@Override void updateDisplayFromDecorativeGeometry(){
  vtkPolyData polyData=getPolyData();
  createAndConnectMapper(polyData);
  setXformAndAttributesFromDecorativeGeometry(agLocal);
}

Fixed version (ground truth):
@Override void updateDisplayFromDecorativeGeometry(){
  vtkPolyData polyData=getPolyData();
  createAndConnectMapper(polyData);
}
Program: 147169
Project: 147169
Buggy source:
@Override void copyAttributesFromDecorativeGeometry(DecorativeGeometry arg0){
  DecorativeLine newLine=(DecorativeLine)arg0;
  setPoint1(newLine.getPoint1());
  setPoint2(newLine.getPoint2());
  line.SetPoint1(getPoint1().get(0),getPoint1().get(1),getPoint1().get(2));
  line.SetPoint2(getPoint2().get(0),getPoint2().get(1),getPoint2().get(2));
  line.Modified();
  super.copyAttributesFromDecorativeGeometry(arg0);
}

Fixed version (ground truth):
void copyAttributesFromDecorativeGeometry(DecorativeGeometry arg0){
  DecorativeLine newLine=(DecorativeLine)arg0;
  setPoint1(newLine.getPoint1());
  setPoint2(newLine.getPoint2());
  line.SetPoint1(getPoint1().get(0),getPoint1().get(1),getPoint1().get(2));
  line.SetPoint2(getPoint2().get(0),getPoint2().get(1),getPoint2().get(2));
  line.Modified();
}
Program: 147170
Project: 147170
Buggy source:
@Override void updateDisplayFromDecorativeGeometry(){
  setXformAndAttributesFromDecorativeGeometry(ag);
}

Fixed version (ground truth):
@Override void updateDisplayFromDecorativeGeometry(){
}
Program: 147171
Project: 147171
Buggy source:
@Override void updateDisplayFromDecorativeGeometry(){
  vtkPolyData polyData=getPolyData();
  createAndConnectMapper(polyData);
  setXformAndAttributesFromDecorativeGeometry(agLocal);
}

Fixed version (ground truth):
@Override void updateDisplayFromDecorativeGeometry(){
  vtkPolyData polyData=getPolyData();
  createAndConnectMapper(polyData);
}
Program: 147172
Project: 147172
Buggy source:
public ScriptingShellTopComponent(){
  initComponents();
  setName(NbBundle.getMessage(ScriptingShellTopComponent.class,"String_Node_Str"));
  setToolTipText(NbBundle.getMessage(ScriptingShellTopComponent.class,"String_Node_Str"));
  putClientProperty(TopComponent.PROP_MAXIMIZATION_DISABLED,Boolean.TRUE);
  putClientProperty(TopComponent.PROP_SLIDING_DISABLED,Boolean.TRUE);
  jPopupMenu1.removeAll();
  addPopupCommands();
  jConsole2=new JConsole();
  jConsole2.setColumns(20);
  jConsole2.setRows(5);
  jScrollPane2.setViewportView(jConsole2);
  historyArea=(MessagePanel)jTextArea1;
  historyArea.setComponentPopupMenu(jPopupMenu1);
  jConsole2.registerConsoleListener(historyArea);
  jScrollPane1.setBorder(new TitledBorder("String_Node_Str"));
  historyArea.setEditable(false);
}

Fixed version (ground truth):
public ScriptingShellTopComponent(){
  initComponents();
  setName(NbBundle.getMessage(ScriptingShellTopComponent.class,"String_Node_Str"));
  setToolTipText(NbBundle.getMessage(ScriptingShellTopComponent.class,"String_Node_Str"));
  putClientProperty(TopComponent.PROP_MAXIMIZATION_DISABLED,Boolean.TRUE);
  putClientProperty(TopComponent.PROP_SLIDING_DISABLED,Boolean.TRUE);
  jPopupMenu1.removeAll();
  addPopupCommands();
  jConsole2=new JConsole();
  jConsole2.setColumns(20);
  jConsole2.setRows(5);
  jScrollPane2.setViewportView(jConsole2);
  historyArea=(MessagePanel)jTextArea1;
  historyArea.setComponentPopupMenu(jPopupMenu1);
  jConsole2.registerConsoleListener(historyArea);
  jScrollPane1.setBorder(new TitledBorder("String_Node_Str"));
  historyArea.setEditable(false);
  instance=this;
}
Program: 147174
Project: 147174
Buggy source:
public PlotCurve showMotionCurve(String qName,String muscleName,PlotterSourceMotion dataSource){
  PlotCurve plotCurve=null;
  openSimContext=OpenSimDB.getInstance().getContext(currentModel);
  if (qName.toLowerCase().startsWith("String_Node_Str")) {
    String coordName=qName.substring(qName.indexOf("String_Node_Str") + 1);
    useMuscles(true);
    if (!currentModel.getCoordinateSet().contains(coordName)) {
      ErrorDialog.showMessageDialog("String_Node_Str" + coordName + "String_Node_Str");
      return null;
    }
    if (qName.toLowerCase().startsWith("String_Node_Str")) {
      sourceY=(new PlotterSourceAnalysis(currentModel,plotterModel.getStorage("String_Node_Str" + coordName,currentModel),"String_Node_Str"));
    }
 else {
      sourceY=(new PlotterSourceAnalysis(currentModel,plotterModel.getStorage("String_Node_Str" + coordName,currentModel),"String_Node_Str"));
    }
    if (!currentModel.getMuscles().contains(muscleName)) {
      ErrorDialog.showMessageDialog("String_Node_Str" + muscleName + "String_Node_Str");
      return null;
    }
  }
 else   if (currentModel.getMuscles().contains(qName))   populateYQty(qName);
 else {
    ErrorDialog.showMessageDialog("String_Node_Str" + qName + "String_Node_Str"+ muscleName+ "String_Node_Str");
    return null;
  }
  sourceX=dataSource;
  domainName=dataSource.getDisplayName();
  rangeNames=new String[]{muscleName};
  jPlotterAddCurveButtonActionPerformed(null);
  plotCurve=currentCurve;
  refreshPanel(plotCurve,muscleName);
  return plotCurve;
}

Fixed version (ground truth):
public PlotCurve showMotionCurve(String qName,String muscleName,PlotterSourceMotion dataSource){
  PlotCurve plotCurve=null;
  openSimContext=OpenSimDB.getInstance().getContext(currentModel);
  if (qName.toLowerCase().startsWith("String_Node_Str")) {
    String coordName=qName.substring(qName.indexOf("String_Node_Str") + 1);
    useMuscles(true);
    if (!currentModel.getCoordinateSet().contains(coordName)) {
      ErrorDialog.showMessageDialog("String_Node_Str" + coordName + "String_Node_Str");
      return null;
    }
    if (qName.toLowerCase().startsWith("String_Node_Str")) {
      sourceY=(new PlotterSourceAnalysis(currentModel,plotterModel.getStorage("String_Node_Str" + coordName,currentModel),"String_Node_Str"));
    }
 else {
      sourceY=(new PlotterSourceAnalysis(currentModel,plotterModel.getStorage("String_Node_Str" + coordName,currentModel),"String_Node_Str"));
    }
    if (!currentModel.getMuscles().contains(muscleName)) {
      ErrorDialog.showMessageDialog("String_Node_Str" + muscleName + "String_Node_Str");
      return null;
    }
  }
 else   if (currentModel.getMuscles().contains(qName) || qNameSet.contains(qName.toLowerCase()))   populateYQty(qName);
 else {
    ErrorDialog.showMessageDialog("String_Node_Str" + qName + "String_Node_Str"+ muscleName+ "String_Node_Str");
    return null;
  }
  sourceX=dataSource;
  domainName=dataSource.getDisplayName();
  rangeNames=new String[]{muscleName};
  jPlotterAddCurveButtonActionPerformed(null);
  plotCurve=currentCurve;
  refreshPanel(plotCurve,muscleName);
  return plotCurve;
}
Program: 147175
Project: 147175
Buggy source:
double getMinX(){
  return ((Double)jDomainStartTextField.getValue()).doubleValue();
}

Fixed version (ground truth):
/** 
 * Retrieve domain min bound
 * @return domain min bound
 */
public double getMinX(){
  return ((Double)jDomainStartTextField.getValue()).doubleValue();
}
Program: 147176
Project: 147176
Buggy source:
double getMaxX(){
  return ((Double)jDomainEndTextField.getValue()).doubleValue();
}

Fixed version (ground truth):
/** 
 * Retrieve domain max bound
 * @return domain max bound
 */
public double getMaxX(){
  return ((Double)jDomainEndTextField.getValue()).doubleValue();
}
Program: 147177
Project: 147177
Buggy source:
void setMinX(double minX){
  jDomainStartTextField.setValue(minX);
}

Fixed version (ground truth):
/** 
 * Specify domain min bound
 * @param minX 
 */
public void setMinX(double minX){
  jDomainStartTextField.setValue(minX);
}
Program: 147178
Project: 147178
Buggy source:
void setMaxX(double maxX){
  jDomainEndTextField.setValue(maxX);
}

Fixed version (ground truth):
/** 
 * Specify domain max bound
 * @param maxX 
 */
public void setMaxX(double maxX){
  jDomainEndTextField.setValue(maxX);
}
Program: 147179
Project: 147179
Buggy source:
public PlotCurve plotDataFromSource(PlotterSourceInterface source,String domain,String range){
  sourceX=source;
  sourceY=sourceX;
  setDomainName(domain);
  PlotCurveSettings settings=getSettings();
  PlotCurve plotCurve=null;
  settings.setName(range);
  plotCurve=plotterModel.addCurveSingleRangeName("String_Node_Str",settings,sourceX,getDomainName(),sourceY,range);
  makeCurveCurrent(plotCurve);
  return plotCurve;
}

Fixed version (ground truth):
public PlotCurve plotDataFromSource(PlotterSourceInterface source,String domain,String range){
  sourceX=source;
  sourceY=sourceX;
  setDomainName(domain);
  PlotCurveSettings settings=getSettings();
  settings.setXMin(source.getStorage().getFirstTime());
  settings.setXMax(source.getStorage().getLastTime());
  PlotCurve plotCurve=null;
  settings.setName(range);
  plotCurve=plotterModel.addCurveSingleRangeName("String_Node_Str",settings,sourceX,getDomainName(),sourceY,range);
  makeCurveCurrent(plotCurve);
  return plotCurve;
}
Program: 147180
Project: 147180
Buggy source:
public void adoptAndAppend(Function aFunction){
  aFunction.markAdopted();
  adoptAndAppendImpl(aFunction);
}

Fixed version (ground truth):
public boolean adoptAndAppend(Function aFunction){
  aFunction.markAdopted();
  return super.adoptAndAppend(aFunction);
}