nus-yam/ex-repair huggingface dataset:
Program: 59299
Project: 59299
Buggy source:
public ClipwarnControl(){
  this.add(new LabeledItem("String_Node_Str",clipwarn));
  clipwarn.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      JCheckBox b=(JCheckBox)e.getSource();
      Transfer<?,?> old=target.transfer();
      if (b.isSelected() && !(old instanceof Advise.OverUnder)) {
        target.transfer(new Advise.OverUnder(Color.BLACK,Color.gray,old,10));
      }
 else       if (!b.isSelected() && (old instanceof Advise.OverUnder)) {
        target.transfer(((Advise.OverUnder)old).baseTransfer());
      }
    }
  }
);
}

Fixed version (ground truth):
public ClipwarnControl(){
  this.add(new LabeledItem("String_Node_Str",clipwarn));
  clipwarn.addActionListener(new ActionListener(){
    @SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void actionPerformed(    ActionEvent e){
      JCheckBox b=(JCheckBox)e.getSource();
      Transfer<?,?> old=target.transfer();
      if (b.isSelected() && !(old instanceof Advise.OverUnder)) {
        target.transfer(new Advise.OverUnder(Color.BLACK,Color.gray,old,10));
      }
 else       if (!b.isSelected() && (old instanceof Advise.OverUnder)) {
        target.transfer(((Advise.OverUnder)old).baseTransfer());
      }
    }
  }
);
}
Program: 59300
Project: 59300
Buggy source:
@SuppressWarnings("String_Node_Str") public LiftIf(double cutoff,Transfer<CategoricalCounts<Color>,Color> baseline){
  super(new Pred(cutoff),new General.Const(Color.black),baseline,baseline.emptyValue());
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public LiftIf(double cutoff,Transfer<CategoricalCounts<Color>,Color> baseline){
  super(new Pred(cutoff),new General.Const(Color.black),baseline,baseline.emptyValue());
}
Program: 59301
Project: 59301
Buggy source:
public void run(){
  long start=System.currentTimeMillis();
  try {
    Rectangle databounds=viewTransform().createTransformedShape(dataset.bounds()).getBounds();
    renderTransform=Util.zoomFit(dataset.bounds(),databounds.width,databounds.height);
    @SuppressWarnings({"String_Node_Str","String_Node_Str"}) Aggregates<?> a=renderer.aggregate(dataset,(Aggregator)aggregator,renderTransform.createInverse(),databounds.width,databounds.height);
    SubsetDisplay.this.aggregates(a,renderTransform);
    long end=System.currentTimeMillis();
    if (PERF_REP) {
      System.out.printf("String_Node_Str",(end - start),aggregates.highX() - aggregates.lowX(),aggregates.highY() - aggregates.lowY());
    }
  }
 catch (  Exception e) {
    renderError=true;
  }
  SubsetDisplay.this.repaint();
}

Fixed version (ground truth):
public void run(){
  long start=System.currentTimeMillis();
  try {
    Rectangle databounds=viewTransform().createTransformedShape(dataset.bounds()).getBounds();
    renderTransform=Util.zoomFit(dataset.bounds(),databounds.width,databounds.height);
    @SuppressWarnings({"String_Node_Str","String_Node_Str"}) Aggregates<?> a=renderer.aggregate(dataset,(Aggregator)aggregator,renderTransform.createInverse(),databounds.width,databounds.height);
    SubsetDisplay.this.aggregates(a,renderTransform);
    long end=System.currentTimeMillis();
    if (PERF_REP) {
      System.out.printf("String_Node_Str",(end - start),aggregates.highX() - aggregates.lowX(),aggregates.highY() - aggregates.lowY());
    }
  }
 catch (  Exception e) {
    renderError=true;
    System.err.println(e.getMessage());
  }
  SubsetDisplay.this.repaint();
}
Program: 59302
Project: 59302
Buggy source:
/** 
 * Set the target host control.
 */
public void host(EnhanceHost host){
  if (host != showOverlay.host()) {
    enhance.setSelected(false);
    showOverlay.host(host);
  }
}

Fixed version (ground truth):
/** 
 * Set the target host control.
 */
public void host(EnhanceHost host){
  if (host != showOverlay.host()) {
    showOverlay.clear();
    enhance.setSelected(false);
    showOverlay.host(host);
  }
}
Program: 59303
Project: 59303
Buggy source:
public void clear();

Fixed version (ground truth):
public void clear(){
  box.setSelected(false);
}
Program: 59304
Project: 59304
Buggy source:
@Override public Specialized specialize(Aggregates<? extends Number> aggregates){
  Transfer.Specialized<Number,Color> ts=basis.specialize(aggregates);
  return new Specialized(maxDV,maxDV,maxDV,maxDV,distance,ts,out);
}

Fixed version (ground truth):
@Override public Specialized specialize(Aggregates<? extends Number> aggregates){
  Transfer.Specialized<Number,Color> ts=basis.specialize(aggregates);
  return new Specialized(minV,maxV,minDV,maxDV,distance,ts,out);
}
Program: 59305
Project: 59305
Buggy source:
@Override public OUT at(int x,int y,Aggregates<? extends IN> rootAggregates){
synchronized (cacheGuard) {
    if (cacheKey == null) {
      Aggregates tempAggs=rootAggregates;
      for (      Transfer.Specialized ts : specialized) {
        tempAggs=renderer.transfer(tempAggs,ts);
      }
      cachedAggs=tempAggs;
    }
    cacheKey=rootAggregates;
  }
  return (OUT)cachedAggs.get(x,y);
}

Fixed version (ground truth):
@Override public OUT at(int x,int y,Aggregates<? extends IN> rootAggregates){
synchronized (cacheGuard) {
    if (cacheKey == null || cacheKey != rootAggregates) {
      Aggregates tempAggs=rootAggregates;
      for (      Transfer.Specialized ts : specialized) {
        tempAggs=renderer.transfer(tempAggs,ts);
      }
      cachedAggs=tempAggs;
    }
    cacheKey=rootAggregates;
  }
  return (OUT)cachedAggs.get(x,y);
}
Program: 59307
Project: 59307
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void run(){
  long start=System.currentTimeMillis();
  try {
    renderTransform=viewTransform();
    Aggregates<?> a=renderer.aggregate(dataset,(Aggregator)aggregator,inverseViewTransformRef,baseWidth,baseHeight);
    ARSubsetPanel.this.baseAggregates(a);
    long end=System.currentTimeMillis();
    if (PERF_REP) {
      System.out.printf("String_Node_Str",(end - start),baseAggregates.highX() - baseAggregates.lowX(),baseAggregates.highY() - baseAggregates.lowY());
    }
  }
 catch (  Exception e) {
    renderError=true;
  }
  ARSubsetPanel.this.repaint();
}

Fixed version (ground truth):
public void run(){
  long start=System.currentTimeMillis();
  try {
    Rectangle databounds=viewTransform().createTransformedShape(dataset.bounds()).getBounds();
    renderTransform=Util.zoomFit(dataset.bounds(),databounds.width,databounds.height);
    @SuppressWarnings({"String_Node_Str","String_Node_Str"}) Aggregates<?> a=renderer.aggregate(dataset,(Aggregator)aggregator,renderTransform.createInverse(),databounds.width,databounds.height);
    ARSubsetPanel.this.baseAggregates(a);
    long end=System.currentTimeMillis();
    if (PERF_REP) {
      System.out.printf("String_Node_Str",(end - start),baseAggregates.highX() - baseAggregates.lowX(),baseAggregates.highY() - baseAggregates.lowY());
    }
  }
 catch (  Exception e) {
    renderError=true;
  }
  ARSubsetPanel.this.repaint();
}
Program: 59308
Project: 59308
Buggy source:
public ARPanel withTransfer(Transfer<?,?> t){
  ARPanel p=new ARPanel(aggregator,t,dataset,renderer);
  p.viewTransformRef=this.viewTransformRef;
  p.inverseViewTransformRef=this.inverseViewTransformRef;
  p.aggregates=this.aggregates;
  return p;
}

Fixed version (ground truth):
public ARPanel withTransfer(Transfer<?,?> t){
  ARPanel p=new ARPanel(aggregator,t,dataset,renderer);
  p.viewTransformRef=this.viewTransformRef;
  p.inverseViewTransformRef=this.inverseViewTransformRef;
  p.aggregates(this.aggregates);
  return p;
}
Program: 59309
Project: 59309
Buggy source:
public void aggregates(Aggregates<?> aggregates){
  this.aggregates=aggregates;
}

Fixed version (ground truth):
public void aggregates(Aggregates<?> aggregates){
  this.aggregates=aggregates;
  this.display.setAggregates(aggregates);
}
Program: 59310
Project: 59310
Buggy source:
public static void main(String[] args) throws Exception {
  String[] rawRes=arg(args,"String_Node_Str","String_Node_Str").split("String_Node_Str");
  String source=arg(args,"String_Node_Str","String_Node_Str");
  String outPrefix=arg(args,"String_Node_Str","String_Node_Str");
  double size=Double.parseDouble(arg(args,"String_Node_Str","String_Node_Str"));
  Aggregator<Object,Integer> aggregator=new WrappedAggregator.Count().op();
  Renderer render=new ParallelGlyphs();
  Glyphset<Color> glyphs=new MemMapList<Color>(new File(source),new ToRect(size,size,false,0,1),new Constant<Indexed>(Color.red),Color.class);
  glyphs.bounds();
  try {
    for (    String rres : rawRes) {
      int res=Integer.parseInt(rres);
      System.out.printf("String_Node_Str",source,res);
      AffineTransform ivt=Util.zoomFit(glyphs.bounds(),res,res).createInverse();
      Aggregates<Integer> aggs=render.reduce(glyphs,aggregator,ivt,res,res);
      String filename=String.format("String_Node_Str",outPrefix,res);
      System.out.printf("String_Node_Str",filename);
      AggregatesToCSV.export(aggs,new File(filename));
      System.out.printf("String_Node_Str",filename);
    }
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str" + source);
    e.printStackTrace();
  }
  System.exit(0);
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  String[] rawRes=arg(args,"String_Node_Str","String_Node_Str").split("String_Node_Str");
  String source=arg(args,"String_Node_Str","String_Node_Str");
  String outPrefix=arg(args,"String_Node_Str","String_Node_Str");
  double size=Double.parseDouble(arg(args,"String_Node_Str","String_Node_Str"));
  Aggregator<Object,Integer> aggregator=new WrappedAggregator.Count().op();
  Renderer render=new ParallelGlyphs();
  Glyphset<Color> glyphs=new MemMapList<Color>(new File(source),new ToRect(size,size,false,0,1),new Constant<Indexed>(Color.red),Color.class);
  glyphs.bounds();
  try {
    for (    String rres : rawRes) {
      int res=Integer.parseInt(rres);
      System.out.printf("String_Node_Str",source,res);
      AffineTransform ivt=Util.zoomFit(glyphs.bounds(),res,res).createInverse();
      Aggregates<Integer> aggs=render.aggregate(glyphs,aggregator,ivt,res,res);
      String filename=String.format("String_Node_Str",outPrefix,res);
      System.out.printf("String_Node_Str",filename);
      AggregatesToCSV.export(aggs,new File(filename));
      System.out.printf("String_Node_Str",filename);
    }
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str" + source);
    e.printStackTrace();
  }
  System.exit(0);
}
Program: 59313
Project: 59313
Buggy source:
@Override public void paintComponent(Graphics g){
  boolean doRender=(image == null || differentSizes(image,ARDisplay.this)) && transfer != null && aggregates != null;
  if (doRender && !renderError) {
    renderThread=new Thread(new TransferRender(),"String_Node_Str");
    renderThread.setDaemon(true);
    renderThread.start();
  }
  if (image != null) {
    g.setColor(Color.WHITE);
    g.fillRect(0,0,this.getWidth(),this.getHeight());
    Graphics2D g2=(Graphics2D)g;
    g2.drawRenderedImage(image,g2.getTransform());
  }
 else {
    g.setColor(Color.WHITE);
    g.fillRect(0,0,this.getWidth(),this.getHeight());
  }
}

Fixed version (ground truth):
@Override public void paintComponent(Graphics g){
  boolean doRender=(renderAgain || image == null) && transfer != null && aggregates != null;
  if (doRender && !renderError) {
    renderThread=new Thread(new TransferRender(),"String_Node_Str");
    renderThread.setDaemon(true);
    renderThread.start();
  }
  if (image != null) {
    g.setColor(Color.WHITE);
    g.fillRect(0,0,this.getWidth(),this.getHeight());
    Graphics2D g2=(Graphics2D)g;
    g2.drawRenderedImage(image,g2.getTransform());
  }
 else {
    g.setColor(Color.WHITE);
    g.fillRect(0,0,this.getWidth(),this.getHeight());
  }
}
Program: 59314
Project: 59314
Buggy source:
public ARDisplay withTransfer(Transfer<?,?> t){
  return new ARDisplay(aggregates,t);
}

Fixed version (ground truth):
public void withTransfer(Transfer<?,?> transfer){
  this.transfer=transfer;
  renderAgain=true;
  renderError=false;
}
Program: 59315
Project: 59315
Buggy source:
public void run(){
  long start=System.currentTimeMillis();
  int width=ARDisplay.this.getWidth();
  int height=ARDisplay.this.getHeight();
  try {
    @SuppressWarnings({"String_Node_Str","String_Node_Str"}) Aggregates<Color> colors=renderer.transfer((Aggregates)aggregates,(Transfer)transfer);
    image=Util.asImage(colors,width,height,Util.CLEAR);
    long end=System.currentTimeMillis();
    if (PERF_REP) {
      System.out.printf("String_Node_Str",(end - start),image.getWidth(),image.getHeight());
    }
  }
 catch (  ClassCastException e) {
    renderError=true;
  }
  ARDisplay.this.repaint();
}

Fixed version (ground truth):
public void run(){
  try {
    long start=System.currentTimeMillis();
    @SuppressWarnings({"String_Node_Str","String_Node_Str"}) Aggregates<Color> colors=renderer.transfer((Aggregates)aggregates,(Transfer)transfer);
    image=Util.asImage(colors,ARDisplay.this.getWidth(),ARDisplay.this.getHeight(),Util.CLEAR);
    long end=System.currentTimeMillis();
    if (PERF_REP) {
      System.out.printf("String_Node_Str",(end - start),image.getWidth(),image.getHeight());
    }
  }
 catch (  ClassCastException e) {
    renderError=true;
  }
 finally {
    renderAgain=false;
  }
  ARDisplay.this.repaint();
}
Program: 59316
Project: 59316
Buggy source:
public ARDisplay(Aggregates<?> aggregates,Transfer<?,?> transfer){
  super();
  this.transfer=transfer;
  this.aggregates=aggregates;
}

Fixed version (ground truth):
public ARDisplay(Aggregates<?> aggregates,Transfer<?,?> transfer){
  super();
  this.transfer=transfer;
  this.aggregates=aggregates;
  this.addComponentListener(new ComponentListener(){
    public void componentResized(    ComponentEvent e){
      ARDisplay.this.renderAgain=true;
    }
    public void componentMoved(    ComponentEvent e){
    }
    public void componentShown(    ComponentEvent e){
    }
    public void componentHidden(    ComponentEvent e){
    }
  }
);
}
Program: 59317
Project: 59317
Buggy source:
public void run(){
  long start=System.currentTimeMillis();
  int width=ARPanel.this.getWidth();
  int height=ARPanel.this.getHeight();
  try {
    @SuppressWarnings("String_Node_Str") Aggregates<Color> colors=renderer.transfer(aggregates,transfer);
    image=Util.asImage(colors,width,height,Util.CLEAR);
    long end=System.currentTimeMillis();
    if (PERF_REP) {
      System.out.printf("String_Node_Str",(end - start),image.getWidth(),image.getHeight());
    }
  }
 catch (  ClassCastException e) {
    renderError=true;
  }
  ARPanel.this.repaint();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void run(){
  int width=ARPanel.this.getWidth();
  int height=ARPanel.this.getHeight();
  long start=System.currentTimeMillis();
  AffineTransform ivt=inverseViewTransform();
  try {
    aggregates=renderer.aggregate(dataset,aggregator,ivt,width,height);
    display.setAggregates(aggregates);
    long end=System.currentTimeMillis();
    if (PERF_REP) {
      System.out.printf("String_Node_Str",(end - start),aggregates.highX() - aggregates.lowX(),aggregates.highY() - aggregates.lowY());
    }
  }
 catch (  ClassCastException e) {
    renderError=true;
  }
  ARPanel.this.repaint();
}
Program: 59318
Project: 59318
Buggy source:
public ARPanel(Aggregator<?,?> reduction,Transfer<?,?> transfer,Glyphset<?> glyphs,Renderer renderer){
  super();
  this.reduction=reduction;
  this.transfer=transfer;
  this.dataset=glyphs;
  this.renderer=renderer;
  ZoomPanHandler h=new ZoomPanHandler();
  super.addMouseListener(h);
  super.addMouseMotionListener(h);
}

Fixed version (ground truth):
public ARPanel(Aggregator<?,?> reduction,Transfer<?,?> transfer,Glyphset<?> glyphs,Renderer renderer){
  super();
  display=new ARDisplay(null,transfer);
  ARDisplay.PERF_REP=PERF_REP;
  this.setLayout(new BorderLayout());
  this.add(display,BorderLayout.CENTER);
  this.invalidate();
  this.aggregator=reduction;
  this.dataset=glyphs;
  this.renderer=renderer;
  ZoomPanHandler h=new ZoomPanHandler();
  super.addMouseListener(h);
  super.addMouseMotionListener(h);
}
Program: 59319
Project: 59319
Buggy source:
public ARPanel withReduction(Aggregator<?,?> r){
  ARPanel p=new ARPanel(r,transfer,dataset,renderer);
  p.viewTransformRef=this.viewTransformRef;
  p.inverseViewTransformRef=this.inverseViewTransformRef;
  return p;
}

Fixed version (ground truth):
public ARPanel withReduction(Aggregator<?,?> r){
  ARPanel p=new ARPanel(r,display.transfer(),dataset,renderer);
  p.viewTransformRef=this.viewTransformRef;
  p.inverseViewTransformRef=this.inverseViewTransformRef;
  return p;
}
Program: 59320
Project: 59320
Buggy source:
public ARPanel withRenderer(Renderer r){
  ARPanel p=new ARPanel(reduction,transfer,dataset,r);
  return p;
}

Fixed version (ground truth):
public ARPanel withRenderer(Renderer r){
  ARPanel p=new ARPanel(aggregator,display.transfer(),dataset,r);
  return p;
}
Program: 59321
Project: 59321
Buggy source:
public ARPanel withTransfer(Transfer<?,?> t){
  ARPanel p=new ARPanel(reduction,t,dataset,renderer);
  p.viewTransformRef=this.viewTransformRef;
  p.inverseViewTransformRef=this.inverseViewTransformRef;
  p.aggregates=this.aggregates;
  return p;
}

Fixed version (ground truth):
public ARPanel withTransfer(Transfer<?,?> t){
  ARPanel p=new ARPanel(aggregator,t,dataset,renderer);
  p.viewTransformRef=this.viewTransformRef;
  p.inverseViewTransformRef=this.inverseViewTransformRef;
  p.aggregates=this.aggregates;
  return p;
}
Program: 59322
Project: 59322
Buggy source:
public String toString(){
  return String.format("String_Node_Str",dataset,transfer,reduction);
}

Fixed version (ground truth):
public String toString(){
  return String.format("String_Node_Str",dataset,display.transfer(),aggregator);
}
Program: 59323
Project: 59323
Buggy source:
public ARPanel withDataset(Glyphset<?> data){
  return new ARPanel(reduction,transfer,data,renderer);
}

Fixed version (ground truth):
public ARPanel withDataset(Glyphset<?> data){
  return new ARPanel(aggregator,display.transfer(),data,renderer);
}
Program: 59324
Project: 59324
Buggy source:
public Aggregator<?,?> reduction(){
  return reduction;
}

Fixed version (ground truth):
public Aggregator<?,?> reduction(){
  return aggregator;
}
Program: 59325
Project: 59325
Buggy source:
public static void main(String[] args) throws Exception {
  String[] rawRes=arg(args,"String_Node_Str","String_Node_Str").split("String_Node_Str");
  String source=arg(args,"String_Node_Str","String_Node_Str");
  String outPrefix=arg(args,"String_Node_Str","String_Node_Str");
  double size=Double.parseDouble(arg(args,"String_Node_Str","String_Node_Str"));
  Aggregator<Object,Integer> aggregator=new WrappedAggregator.Count().op();
  Renderer render=new ParallelGlyphs();
  Glyphset<Color> glyphs=new MemMapList<Color>(new File(source),new ToRect(size,size,false,0,1),new Constant<Indexed>(Color.red),Color.class);
  glyphs.bounds();
  try {
    for (    String rres : rawRes) {
      int res=Integer.parseInt(rres);
      System.out.printf("String_Node_Str",source,res);
      AffineTransform ivt=Util.zoomFit(glyphs.bounds(),res,res).createInverse();
      Aggregates aggs=render.reduce(glyphs,aggregator,ivt,res,res);
      String filename=String.format("String_Node_Str",outPrefix,res);
      System.out.printf("String_Node_Str",filename);
      AggregatesToCSV.export(aggs,new File(filename));
      System.out.printf("String_Node_Str",filename);
    }
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str" + source);
    e.printStackTrace();
  }
  System.exit(0);
}

Fixed version (ground truth):
public static void main(String[] args) throws Exception {
  String[] rawRes=arg(args,"String_Node_Str","String_Node_Str").split("String_Node_Str");
  String source=arg(args,"String_Node_Str","String_Node_Str");
  String outPrefix=arg(args,"String_Node_Str","String_Node_Str");
  double size=Double.parseDouble(arg(args,"String_Node_Str","String_Node_Str"));
  Aggregator<Object,Integer> aggregator=new WrappedAggregator.Count().op();
  Renderer render=new ParallelGlyphs();
  Glyphset<Color> glyphs=new MemMapList<Color>(new File(source),new ToRect(size,size,false,0,1),new Constant<Indexed>(Color.red),Color.class);
  glyphs.bounds();
  try {
    for (    String rres : rawRes) {
      int res=Integer.parseInt(rres);
      System.out.printf("String_Node_Str",source,res);
      AffineTransform ivt=Util.zoomFit(glyphs.bounds(),res,res).createInverse();
      Aggregates<Integer> aggs=render.reduce(glyphs,aggregator,ivt,res,res);
      String filename=String.format("String_Node_Str",outPrefix,res);
      System.out.printf("String_Node_Str",filename);
      AggregatesToCSV.export(aggs,new File(filename));
      System.out.printf("String_Node_Str",filename);
    }
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str" + source);
    e.printStackTrace();
  }
  System.exit(0);
}
Program: 59327
Project: 59327
Buggy source:
/** 
 * @param args
 * @throws Exception 
 */
@SuppressWarnings("String_Node_Str") public static void main(String[] args) throws Exception {
  if (args.length > 0 && args[0].toUpperCase().equals("String_Node_Str")) {
    new ARApp();
  }
 else {
    System.out.println("String_Node_Str");
    new ARDemoApp();
  }
}

Fixed version (ground truth):
/** 
 * @param args
 * @throws Exception 
 */
@SuppressWarnings("String_Node_Str") public static void main(String[] args) throws Exception {
  ARPanel.PERF_REP=true;
  if (args.length > 0 && args[0].toUpperCase().equals("String_Node_Str")) {
    new ARApp();
  }
 else {
    System.out.println("String_Node_Str");
    new ARDemoApp();
  }
}
Program: 59328
Project: 59328
Buggy source:
public void run(){
  long start=System.currentTimeMillis();
  int width=ARPanel.this.getWidth();
  int height=ARPanel.this.getHeight();
  @SuppressWarnings("String_Node_Str") Aggregates<Color> colors=renderer.transfer(aggregates,transfer);
  image=Util.asImage(colors,width,height,Util.CLEAR);
  long end=System.currentTimeMillis();
  if (!PERF_MON) {
    System.out.printf("String_Node_Str",(end - start),image.getWidth(),image.getHeight());
  }
  ARPanel.this.repaint();
}

Fixed version (ground truth):
public void run(){
  long start=System.currentTimeMillis();
  int width=ARPanel.this.getWidth();
  int height=ARPanel.this.getHeight();
  @SuppressWarnings("String_Node_Str") Aggregates<Color> colors=renderer.transfer(aggregates,transfer);
  image=Util.asImage(colors,width,height,Util.CLEAR);
  long end=System.currentTimeMillis();
  if (PERF_REP) {
    System.out.printf("String_Node_Str",(end - start),image.getWidth(),image.getHeight());
  }
  ARPanel.this.repaint();
}
Program: 59329
Project: 59329
Buggy source:
@Override public void paintComponent(Graphics g){
  Runnable action=null;
  if (renderer == null || dataset == null || dataset.isEmpty() || transfer == null || reduction == null || !transfer.input().isAssignableFrom(reduction.output())) {
    g.setColor(Color.GRAY);
    g.fillRect(0,0,this.getWidth(),this.getHeight());
  }
 else   if (renderAgain || aggregates == null || differentSizes(image,ARPanel.this)) {
    action=new FullRender();
  }
 else   if (image == null) {
    action=new TransferRender();
  }
  if (action != null && (renderThread == null || !renderThread.isAlive())) {
    renderAgain=false;
    renderThread=new Thread(action,"String_Node_Str");
    renderThread.setDaemon(true);
    renderThread.start();
  }
  if (image != null) {
    g.setColor(Color.WHITE);
    g.fillRect(0,0,this.getWidth(),this.getHeight());
    Graphics2D g2=(Graphics2D)g;
    g2.drawRenderedImage(image,g2.getTransform());
    if (PERF_MON) {
synchronized (this) {
        this.notifyAll();
      }
    }
  }
 else {
    g.setColor(Color.WHITE);
    g.fillRect(0,0,this.getWidth(),this.getHeight());
  }
}

Fixed version (ground truth):
@Override public void paintComponent(Graphics g){
  Runnable action=null;
  if (renderer == null || dataset == null || dataset.isEmpty() || transfer == null || reduction == null || !transfer.input().isAssignableFrom(reduction.output())) {
    g.setColor(Color.GRAY);
    g.fillRect(0,0,this.getWidth(),this.getHeight());
  }
 else   if (renderAgain || aggregates == null || differentSizes(image,ARPanel.this)) {
    action=new FullRender();
  }
 else   if (image == null) {
    action=new TransferRender();
  }
  if (action != null && (renderThread == null || !renderThread.isAlive())) {
    renderAgain=false;
    renderThread=new Thread(action,"String_Node_Str");
    renderThread.setDaemon(true);
    renderThread.start();
  }
  if (image != null) {
    g.setColor(Color.WHITE);
    g.fillRect(0,0,this.getWidth(),this.getHeight());
    Graphics2D g2=(Graphics2D)g;
    g2.drawRenderedImage(image,g2.getTransform());
  }
 else {
    g.setColor(Color.WHITE);
    g.fillRect(0,0,this.getWidth(),this.getHeight());
  }
}
Program: 59330
Project: 59330
Buggy source:
/** 
 * Calculate the affine transform to fit a box of the given size/location onto a 0,0,width,height space.
 */
public static AffineTransform zoomFit(Rectangle2D content,int width,int height){
  if (content == null) {
    return new AffineTransform();
  }
  double ws=width / content.getWidth();
  double hs=height / content.getHeight();
  double scale=Math.min(ws,hs);
  double tx=content.getCenterX();
  double ty=content.getCenterY();
  AffineTransform t=AffineTransform.getScaleInstance(scale,scale);
  t.translate(tx,ty);
  return t;
}

Fixed version (ground truth):
/** 
 * Calculate the affine transform to fit a box of the given size/location onto a 0,0,width,height space.
 */
public static AffineTransform zoomFit(Rectangle2D content,int width,int height){
  if (content == null) {
    return new AffineTransform();
  }
  double ws=width / content.getWidth();
  double hs=height / content.getHeight();
  double scale=Math.min(ws,hs);
  double tx=content.getMinX();
  double ty=content.getMinY();
  AffineTransform t=AffineTransform.getScaleInstance(scale,scale);
  t.translate(-tx,-ty);
  return t;
}
Program: 59331
Project: 59331
Buggy source:
public void zoomFit(){
  try {
    Rectangle2D bounds=dataset().bounds();
    AffineTransform t=Util.zoomFit(bounds,getWidth(),getHeight());
    Point2D center=new Point2D.Double(bounds.getCenterX(),bounds.getCenterY());
    this.zoomAbs(center,t.getScaleX());
    this.panToAbs(center);
  }
 catch (  Exception e) {
  }
}

Fixed version (ground truth):
public void zoomFit(){
  try {
    Rectangle2D content=dataset().bounds();
    if (content == null) {
      return;
    }
    double w=getWidth() / content.getWidth();
    double h=getHeight() / content.getHeight();
    double scale=Math.min(w,h);
    scale=scale / getScale();
    Point2D center=new Point2D.Double(content.getCenterX(),content.getCenterY());
    zoomAbs(center,scale);
    panToAbs(center);
  }
 catch (  Exception e) {
  }
}
Program: 59332
Project: 59332
Buggy source:
public ConstantAggregates(int lowX,int lowY,int highX,int highY,A value){
  this.val=value;
  this.lowX=lowX;
  this.lowY=lowY;
  this.highX=highX;
  this.highY=highY;
}

Fixed version (ground truth):
public ConstantAggregates(int lowX,int lowY,int highX,int highY,A value){
  if (lowX > highX) {
    throw new IllegalArgumentException(String.format("String_Node_Str",lowX,highX));
  }
  if (lowY > highY) {
    throw new IllegalArgumentException(String.format("String_Node_Str",lowY,highY));
  }
  this.val=value;
  this.lowX=lowX;
  this.lowY=lowY;
  this.highX=highX;
  this.highY=highY;
}
Program: 59333
Project: 59333
Buggy source:
public int lowX(){
  return 0;
}

Fixed version (ground truth):
public int lowX(){
  return lowX;
}
Program: 59334
Project: 59334
Buggy source:
public int lowY(){
  return 0;
}

Fixed version (ground truth):
public int lowY(){
  return lowY;
}
Program: 59335
Project: 59335
Buggy source:
public int highX(){
  return 0;
}

Fixed version (ground truth):
public int highX(){
  return highX;
}
Program: 59336
Project: 59336
Buggy source:
public int highY(){
  return 0;
}

Fixed version (ground truth):
public int highY(){
  return highY;
}
Program: 59337
Project: 59337
Buggy source:
/** 
 * Create a regional set of aggregates. Though any integer-pair may be used as an index, the default value will be returned for any point outside of the region defined by (lowX, lowY) and (highX, highY). This class treats row of highX and the column highY as the outside of the  region of interest (much like length is used in arrays).
 * @param lowX Lowest valid x
 * @param lowY Lowest valid y 
 * @param highX Lowest invalid x > lowX 
 * @param highY Lowest invalid y > highX
 * @param defaultVal 
 */
@SuppressWarnings("String_Node_Str") public FlatAggregates(final int lowX,final int lowY,final int highX,final int highY,A defaultVal){
  if (lowX >= highX) {
    throw new IllegalArgumentException(String.format("String_Node_Str",lowX,highX));
  }
  if (lowY >= highY) {
    throw new IllegalArgumentException(String.format("String_Node_Str",lowY,highY));
  }
  this.lowX=lowX;
  this.lowY=lowY;
  this.highX=highX;
  this.highY=highY;
  this.defaultVal=defaultVal;
  int size=(highX - lowX) * (highY - lowY);
  size=Math.max(0,size);
  values=(A[])new Object[size];
  Arrays.fill(values,defaultVal);
}

Fixed version (ground truth):
/** 
 * Create a regional set of aggregates. Though any integer-pair may be used as an index, the default value will be returned for any point outside of the region defined by (lowX, lowY) and (highX, highY). This class treats row of highX and the column highY as the outside of the  region of interest (much like length is used in arrays).
 * @param lowX Lowest valid x
 * @param lowY Lowest valid y 
 * @param highX Lowest invalid x > lowX 
 * @param highY Lowest invalid y > highX
 * @param defaultVal 
 */
@SuppressWarnings("String_Node_Str") public FlatAggregates(final int lowX,final int lowY,final int highX,final int highY,A defaultVal){
  if (lowX > highX) {
    throw new IllegalArgumentException(String.format("String_Node_Str",lowX,highX));
  }
  if (lowY > highY) {
    throw new IllegalArgumentException(String.format("String_Node_Str",lowY,highY));
  }
  this.lowX=lowX;
  this.lowY=lowY;
  this.highX=highX;
  this.highY=highY;
  this.defaultVal=defaultVal;
  int size=(highX - lowX) * (highY - lowY);
  size=Math.max(0,size);
  values=(A[])new Object[size];
  Arrays.fill(values,defaultVal);
}
Program: 59338
Project: 59338
Buggy source:
private final Aggregates<A> local(){
  Glyphset.RandomAccess<G> subset=new GlyphSubset<G>(glyphs,low,high);
  Rectangle bounds=view.createTransformedShape(Util.bounds(subset)).getBounds();
  bounds=bounds.intersection(new Rectangle(0,0,width,height));
  if (bounds.isEmpty()) {
    return new ConstantAggregates<>(bounds.x,bounds.y,bounds.x + bounds.width,bounds.y + bounds.height,op.identity());
  }
  Aggregates<A> aggregates=new FlatAggregates<>(bounds.x,bounds.y,bounds.x + bounds.width,bounds.y + bounds.height,op.identity());
  Point2D lowP=new Point2D.Double();
  Point2D highP=new Point2D.Double();
  for (  Glyph<G> g : subset) {
    Rectangle2D b=g.shape().getBounds2D();
    lowP.setLocation(b.getMinX(),b.getMinY());
    highP.setLocation(b.getMaxX(),b.getMaxY());
    view.transform(lowP,lowP);
    view.transform(highP,highP);
    int lowx=(int)Math.floor(lowP.getX());
    int lowy=(int)Math.floor(lowP.getY());
    int highx=(int)Math.ceil(highP.getX());
    int highy=(int)Math.ceil(highP.getY());
    Rectangle pixel=new Rectangle(lowx,lowy,1,1);
    A v=op.at(pixel,new GlyphSingleton<G>(g,subset.valueType()),inverseView);
    for (int x=Math.max(0,lowx); x < highx && x < width; x++) {
      for (int y=Math.max(0,lowy); y < highy && y < height; y++) {
        aggregates.set(x,y,reducer.combine(aggregates.at(x,y),v));
      }
    }
  }
  recorder.update(high - low);
  return aggregates;
}

Fixed version (ground truth):
private final Aggregates<A> local(){
  Glyphset.RandomAccess<G> subset=new GlyphSubset<G>(glyphs,low,high);
  Rectangle bounds=view.createTransformedShape(Util.bounds(subset)).getBounds();
  bounds=bounds.intersection(new Rectangle(0,0,width,height));
  if (bounds.isEmpty()) {
    int x2=bounds.x + bounds.width;
    int y2=bounds.y + bounds.height;
    return new ConstantAggregates<>(Math.min(x2,bounds.x),Math.min(y2,bounds.y),Math.max(x2,bounds.x),Math.min(y2,bounds.y),op.identity());
  }
  Aggregates<A> aggregates=new FlatAggregates<>(bounds.x,bounds.y,bounds.x + bounds.width,bounds.y + bounds.height,op.identity());
  Point2D lowP=new Point2D.Double();
  Point2D highP=new Point2D.Double();
  for (  Glyph<G> g : subset) {
    Rectangle2D b=g.shape().getBounds2D();
    lowP.setLocation(b.getMinX(),b.getMinY());
    highP.setLocation(b.getMaxX(),b.getMaxY());
    view.transform(lowP,lowP);
    view.transform(highP,highP);
    int lowx=(int)Math.floor(lowP.getX());
    int lowy=(int)Math.floor(lowP.getY());
    int highx=(int)Math.ceil(highP.getX());
    int highy=(int)Math.ceil(highP.getY());
    Rectangle pixel=new Rectangle(lowx,lowy,1,1);
    A v=op.at(pixel,new GlyphSingleton<G>(g,subset.valueType()),inverseView);
    for (int x=Math.max(0,lowx); x < highx && x < width; x++) {
      for (int y=Math.max(0,lowy); y < highy && y < height; y++) {
        aggregates.set(x,y,reducer.combine(aggregates.at(x,y),v));
      }
    }
  }
  recorder.update(high - low);
  return aggregates;
}
Program: 59340
Project: 59340
Buggy source:
public void get(byte[] target,long offset,int length){
  ensure(offset,length);
  buffer.get(target);
}

Fixed version (ground truth):
public void get(byte[] target,long offset,int length){
  ensure(offset,length);
  this.position(offset);
  buffer.get(target);
}
Program: 59341
Project: 59341
Buggy source:
public void zoomFit(){
  try {
    Rectangle2D content=dataset().bounds();
    if (content == null) {
      return;
    }
    double w=image.getWidth() / content.getWidth();
    double h=image.getHeight() / content.getHeight();
    double scale=Math.min(w,h);
    scale=scale / getScale();
    Point2D center=new Point2D.Double(content.getCenterX(),content.getCenterY());
    zoomAbs(center,scale);
    panToAbs(center);
  }
 catch (  Exception e) {
  }
}

Fixed version (ground truth):
public void zoomFit(){
  try {
    Rectangle2D content=dataset().bounds();
    if (content == null) {
      return;
    }
    double w=getWidth() / content.getWidth();
    double h=getHeight() / content.getHeight();
    double scale=Math.min(w,h);
    scale=scale / getScale();
    Point2D center=new Point2D.Double(content.getCenterX(),content.getCenterY());
    zoomAbs(center,scale);
    panToAbs(center);
  }
 catch (  Exception e) {
  }
}
Program: 59342
Project: 59342
Buggy source:
public void actionPerformed(ActionEvent e){
  int rc=fc.showOpenDialog(panel);
  if (rc == JFileChooser.APPROVE_OPTION) {
    inputFile=fc.getSelectedFile();
  }
  panel.fireActionListeners();
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  int rc=fc.showOpenDialog(panel);
  if (rc == JFileChooser.APPROVE_OPTION) {
    inputFile=fc.getSelectedFile();
    panel.fireActionListeners();
  }
}
Program: 59343
Project: 59343
Buggy source:
public FileOptions(ARApp parnt){
  export=new ExportAggregates(parnt);
  this.add(chooseFile);
  this.add(export);
  fc.setFileFilter(CSV_HBIN);
  final CompoundPanel panel=this;
  chooseFile.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      int rc=fc.showOpenDialog(panel);
      if (rc == JFileChooser.APPROVE_OPTION) {
        inputFile=fc.getSelectedFile();
      }
      panel.fireActionListeners();
    }
  }
);
}

Fixed version (ground truth):
public FileOptions(ARApp parnt){
  export=new ExportAggregates(parnt);
  this.add(chooseFile);
  this.add(export);
  fc.setFileFilter(CSV_HBIN);
  final CompoundPanel panel=this;
  chooseFile.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      int rc=fc.showOpenDialog(panel);
      if (rc == JFileChooser.APPROVE_OPTION) {
        inputFile=fc.getSelectedFile();
        panel.fireActionListeners();
      }
    }
  }
);
}
Program: 59344
Project: 59344
Buggy source:
public RLE combine(RLE left,RLE right){
  if (left == null || left.size() == 0) {
    return right;
  }
  if (right == null || left.size() == 0) {
    return left;
  }
  HashSet<Object> categories=new HashSet<Object>();
  categories.addAll(left.keys);
  categories.addAll(right.keys);
  for (  Object category : categories) {
    int v1=left.val(category);
    int v2=right.val(category);
    left.add(category,v1 + v2);
  }
  return left;
}

Fixed version (ground truth):
public RLE combine(RLE left,RLE right){
  if (left == null || left.size() == 0) {
    return right;
  }
  if (right == null || left.size() == 0) {
    return left;
  }
  HashSet<Object> categories=new HashSet<Object>();
  categories.addAll(left.keys);
  categories.addAll(right.keys);
  RLE total=new RLE();
  for (  Object category : categories) {
    int v1=left.val(category);
    int v2=right.val(category);
    total.add(category,v1 + v2);
  }
  return total;
}
Program: 59345
Project: 59345
Buggy source:
private ByteBuffer ensure(long position,int bytes){
  if ((buffer.limit() - buffer.position()) < bytes) {
    filePos=buffer.position() + filePos;
    try {
      buffer=inputStream.getChannel().map(FileChannel.MapMode.READ_ONLY,filePos,Math.min(bufferSize,(fileSize - filePos)));
    }
 catch (    IOException e) {
      throw new RuntimeException("String_Node_Str",e);
    }
  }
 else   if (filePos > position) {
    filePos=position;
    try {
      buffer=inputStream.getChannel().map(FileChannel.MapMode.READ_ONLY,filePos,Math.min(bufferSize,(fileSize - filePos)));
    }
 catch (    IOException e) {
      throw new RuntimeException("String_Node_Str",e);
    }
  }
  return buffer;
}

Fixed version (ground truth):
private ByteBuffer ensure(long position,int bytes){
  if ((position < filePos) || (position + bytes) > (buffer.limit() + filePos)) {
    filePos=position;
    try {
      buffer=inputStream.getChannel().map(FileChannel.MapMode.READ_ONLY,filePos,Math.min(bufferSize,(fileSize - filePos)));
    }
 catch (    IOException e) {
      throw new RuntimeException(String.format("String_Node_Str",position,bytes),e);
    }
  }
  return buffer;
}
Program: 59346
Project: 59346
Buggy source:
public void position(long at){
  ensure(at,margin);
}

Fixed version (ground truth):
public void position(long at){
  ensure(at,margin).position((int)(at - filePos));
}
Program: 59347
Project: 59347
Buggy source:
public BigFileByteBuffer(File source,int margin,int bufferSize) throws IOException {
  inputStream=new FileInputStream(source);
  FileChannel channel=inputStream.getChannel();
  fileSize=channel.size();
  filePos=0;
  buffer=channel.map(FileChannel.MapMode.READ_ONLY,filePos,Math.min(bufferSize,(fileSize - filePos)));
  this.margin=margin;
  this.bufferSize=bufferSize;
}

Fixed version (ground truth):
public BigFileByteBuffer(File source,int margin,int bufferSize) throws IOException {
  inputStream=new FileInputStream(source);
  FileChannel channel=inputStream.getChannel();
  fileSize=channel.size();
  filePos=0;
  buffer=channel.map(FileChannel.MapMode.READ_ONLY,filePos,Math.min(bufferSize,fileSize));
  this.margin=margin;
  this.bufferSize=bufferSize;
}
Program: 59348
Project: 59348
Buggy source:
public Status(){
  setLayout(new GridLayout(2,1));
  this.add(new LabeledItem("String_Node_Str",progress));
  progress.setMaximum(100);
  progress.setMinimum(0);
  progress.setStringPainted(true);
}

Fixed version (ground truth):
public Status(){
  setLayout(new GridLayout(2,1));
  this.add(new LabeledItem("String_Node_Str",progress));
  progress.setMaximum(100);
  progress.setMinimum(0);
  progress.setStringPainted(true);
  t.setDaemon(true);
  t.start();
}
Program: 59349
Project: 59349
Buggy source:
public UpdateTask(Status target,int id,double status,String message){
  this.target=target;
  this.id=id;
  this.status=status;
  this.message=message;
}

Fixed version (ground truth):
public UpdateTask(double status,String message){
  this.status=status;
  this.message=message;
}
Program: 59350
Project: 59350
Buggy source:
public void startMonitoring(Renderer renderer){
  stopMonitoring();
  progress.setString("String_Node_Str");
  Thread t=new Thread(new Monitor(this,++current,renderer),"String_Node_Str");
  t.setDaemon(true);
  t.start();
}

Fixed version (ground truth):
public void startMonitoring(Renderer renderer){
  progress.setString("String_Node_Str");
  this.watching=renderer;
}
Program: 59351
Project: 59351
Buggy source:
public void run(){
  target.setStatus(id,status,message);
}

Fixed version (ground truth):
public void run(){
  Status.this.setStatus(status,message);
}
Program: 59352
Project: 59352
Buggy source:
public void setStatus(int id,double status,String message){
  if (id != this.current) {
    return;
  }
  status=Math.max(status,0);
  progress.setValue((int)(status * 100));
  progress.setString(message);
}

Fixed version (ground truth):
public void setStatus(double status,String message){
  status=Math.max(status,0);
  progress.setValue((int)(status * 100));
  progress.setString(message);
}
Program: 59353
Project: 59353
Buggy source:
public boolean isEmpty(){
  return buffer == null || buffer.get().limit() <= 0;
}

Fixed version (ground truth):
public boolean isEmpty(){
  return buffer.get() == null || buffer.get().limit() <= 0;
}
Program: 59354
Project: 59354
Buggy source:
public MemMapList(File source,double glyphSize,Painter<Double> painter,TYPE[] types){
  this.glyphSize=glyphSize;
  this.source=source;
  this.painter=painter;
  if (types == null) {
    int length=0;
    while (true) {
      if (buffer.get().getInt() == 30) {
        break;
      }
      length++;
    }
    recordEntries=length;
    types=new TYPE[recordEntries];
    for (int i=0; i < recordEntries; i++) {
      int t=buffer.get().getInt();
      if (t == 105) {
        types[i]=TYPE.INT;
      }
 else       if (t == 100) {
        types[i]=TYPE.DOUBLE;
      }
 else {
        throw new RuntimeException("String_Node_Str" + i);
      }
    }
    this.types=types;
    headerOffset=(1 + types.length) * 4;
  }
 else {
    recordEntries=0;
    headerOffset=0;
    this.types=types;
  }
  int acc=0;
  for (  TYPE t : types) {
    acc+=t.bytes;
  }
  this.recordSize=acc;
}

Fixed version (ground truth):
public MemMapList(File source,double glyphSize,Painter<Double> painter,TYPE[] types){
  this.glyphSize=glyphSize;
  this.source=source;
  this.painter=painter;
  if (source != null && types == null) {
    int length=0;
    while (true) {
      char c=(char)buffer.get().get();
      if (c == 0x1E) {
        break;
      }
      length++;
    }
    recordEntries=length;
    types=new TYPE[recordEntries];
    buffer.get().position(0);
    for (int i=0; i < recordEntries; i++) {
      char t=(char)buffer.get().get();
      if (t == 'i') {
        types[i]=TYPE.INT;
      }
 else       if (t == 'l') {
        types[i]=TYPE.LONG;
      }
 else       if (t == 's') {
        types[i]=TYPE.SHORT;
      }
 else       if (t == 'd') {
        types[i]=TYPE.DOUBLE;
      }
 else       if (t == 'f') {
        types[i]=TYPE.FLOAT;
      }
 else       if (t == 'b') {
        types[i]=TYPE.BYTE;
      }
 else {
        throw new RuntimeException("String_Node_Str" + i);
      }
    }
    this.types=types;
    headerOffset=(1 + types.length);
    int acc=0;
    for (    TYPE t : this.types) {
      acc+=t.bytes;
    }
    this.recordSize=acc;
  }
 else {
    recordEntries=0;
    headerOffset=0;
    this.types=null;
    this.recordSize=-1;
  }
}
Program: 59355
Project: 59355
Buggy source:
public int size(){
  return buffer == null ? 0 : buffer.get().limit() / ENTRY_SIZE;
}

Fixed version (ground truth):
public int size(){
  return buffer.get() == null ? 0 : (buffer.get().limit() - headerOffset) / recordSize;
}
Program: 59356
Project: 59356
Buggy source:
private double value(ByteBuffer buffer,int offset){
  if (types[offset] == TYPE.INT) {
    return buffer.getInt();
  }
  if (types[offset] == TYPE.DOUBLE) {
    return buffer.getDouble();
  }
  throw new RuntimeException("String_Node_Str" + offset);
}

Fixed version (ground truth):
private double value(ByteBuffer buffer,int offset){
  TYPE t=types[offset];
switch (t) {
case INT:
    return buffer.getInt();
case SHORT:
  return buffer.getShort();
case LONG:
return buffer.getLong();
case DOUBLE:
return buffer.getDouble();
case FLOAT:
return buffer.getFloat();
case BYTE:
return buffer.get();
}
throw new RuntimeException("String_Node_Str" + offset);
}
Program: 59357
Project: 59357
Buggy source:
public void playPauseToggle(){
  if (currentLyrics == null && trackList.size() > 0 && getCurrentPosition() >= 0) {
    play();
  }
 else {
    Intent intent=new Intent(application,MusicPlayerService.class);
    Bundle bundle=new Bundle();
    bundle.putString("String_Node_Str","String_Node_Str");
    intent.putExtras(bundle);
    application.startService(intent);
  }
}

Fixed version (ground truth):
public void playPauseToggle(){
  try {
    Intent intent=new Intent(application,MusicPlayerService.class);
    Bundle bundle=new Bundle();
    bundle.putString("String_Node_Str","String_Node_Str");
    Track track=trackList.get(getCurrentPosition());
    bundle.putString("String_Node_Str",track.getTrackTitle());
    bundle.putString("String_Node_Str",track.getArtistName());
    bundle.putString("String_Node_Str",track.getThumbnailUrl());
    intent.putExtras(bundle);
    application.startService(intent);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 59358
Project: 59358
Buggy source:
@Override public int onStartCommand(Intent intent,int flags,int startId){
  Bundle bundle=intent.getExtras();
  String type=bundle.getString("String_Node_Str");
  String trackTitle=bundle.getString("String_Node_Str");
  String artistName=bundle.getString("String_Node_Str");
  String thumbnailUrl=bundle.getString("String_Node_Str");
  if (type.equals("String_Node_Str")) {
    play(trackTitle,artistName,thumbnailUrl);
  }
 else   if (type.equals("String_Node_Str")) {
    mediaPlayer.pause();
  }
 else   if (type.equals("String_Node_Str")) {
    isLoaded=false;
    mediaPlayer.stop();
    mediaPlayer.reset();
  }
 else   if (type.equals("String_Node_Str")) {
    if (mediaPlayer.isPlaying()) {
      mediaPlayer.pause();
    }
 else {
      try {
        mediaPlayer.start();
      }
 catch (      Exception e) {
        play(trackTitle,artistName,thumbnailUrl);
      }
    }
  }
  playlistAdapter.notifyDataSetChanged();
  return Service.START_NOT_STICKY;
}

Fixed version (ground truth):
@Override public int onStartCommand(Intent intent,int flags,int startId){
  Bundle bundle=intent.getExtras();
  String type=bundle.getString("String_Node_Str");
  String trackTitle=bundle.getString("String_Node_Str");
  String artistName=bundle.getString("String_Node_Str");
  String thumbnailUrl=bundle.getString("String_Node_Str");
  if (type.equals("String_Node_Str")) {
    play(trackTitle,artistName,thumbnailUrl);
  }
 else   if (type.equals("String_Node_Str")) {
    mediaPlayer.pause();
  }
 else   if (type.equals("String_Node_Str")) {
    isLoaded=false;
    mediaPlayer.stop();
    mediaPlayer.reset();
  }
 else   if (type.equals("String_Node_Str")) {
    if (mediaPlayer.isPlaying()) {
      mediaPlayer.pause();
    }
 else {
      if (!(isLoading() || isLoaded())) {
        play(trackTitle,artistName,thumbnailUrl);
      }
 else {
        try {
          mediaPlayer.start();
        }
 catch (        Exception e) {
          play(trackTitle,artistName,thumbnailUrl);
        }
      }
    }
  }
  playlistAdapter.notifyDataSetChanged();
  return Service.START_NOT_STICKY;
}
Program: 59359
Project: 59359
Buggy source:
ReaderWriterProcess createProcess() throws GMServiceException {
  try {
    return factory.getProcess(gmCommand);
  }
 catch (  IOException e) {
    throw new GMServiceException(e.getMessage(),e);
  }
}

Fixed version (ground truth):
ReaderWriterProcess createProcess() throws GMServiceException {
  try {
    return gmFactory.getProcess();
  }
 catch (  IOException e) {
    throw new GMServiceException(e.getMessage(),e);
  }
}