nus-yam/ex-repair huggingface dataset:
Program: 44341
Project: 44341
Buggy source:
public void onPlayerChat(PlayerChatEvent event){
  if (!event.isCancelled()) {
    boolean isin=Util.PlayerDatabase("String_Node_Str",event.getPlayer(),null,null);
    Language langfrom;
    if (isin) {
      langfrom=translation.GetPlayerLanguageHash(event.getPlayer());
    }
 else {
      langfrom=translation.GetLanguage(event.getPlayer(),"String_Node_Str");
    }
    if (Config.language_serverforced) {
      Language langto=Language.fromString(Config.language_default.toLowerCase());
      String NewMessage=translation.translate(event.getMessage(),langfrom,langto);
      event.setMessage(NewMessage);
    }
 else     if (Config.language_playerset) {
      int tempcounter=0;
      for (      Player player : Variables.server.getOnlinePlayers()) {
        boolean isin2=Util.PlayerDatabase("String_Node_Str",player,null,null);
        Language langto;
        if (isin2) {
          langto=translation.GetPlayerLanguageHash(player);
        }
 else {
          langto=translation.GetLanguage(player,"String_Node_Str");
        }
        String NewMessage=null;
        if (langfrom.equals(langto)) {
          NewMessage=event.getMessage();
          player.sendMessage(event.getPlayer().getName() + "String_Node_Str" + NewMessage);
        }
 else {
          NewMessage=translation.Translate(event.getMessage(),langfrom,langto);
          player.sendMessage(event.getPlayer().getName() + "String_Node_Str" + NewMessage);
        }
        if (tempcounter == 0) {
          logging.info(event.getPlayer().getName() + "String_Node_Str" + NewMessage);
          tempcounter++;
        }
      }
    }
  }
  event.setCancelled(true);
}

Fixed version (ground truth):
public void onPlayerChat(PlayerChatEvent event){
  if (event.isCancelled()) {
    return;
  }
  Language langfrom=playerManager.getLanguage(event.getPlayer());
  if (Config.language_serverforced) {
    Language langto=Language.fromString(Config.language_default.toLowerCase());
    String NewMessage=translation.translate(event.getMessage(),langfrom,langto);
    event.setMessage(NewMessage);
  }
 else   if (Config.language_playerset) {
    int tempcounter=0;
    for (    Player player : Variables.server.getOnlinePlayers()) {
      Language langto=playerManager.getLanguage(player);
      String NewMessage=null;
      if (langfrom.equals(langto)) {
        NewMessage=event.getMessage();
        player.sendMessage(event.getPlayer().getName() + "String_Node_Str" + NewMessage);
      }
 else {
        NewMessage=translation.translate(event.getMessage(),langfrom,langto);
        player.sendMessage(event.getPlayer().getName() + "String_Node_Str" + NewMessage);
      }
      if (tempcounter == 0) {
        logging.info(event.getPlayer().getName() + "String_Node_Str" + NewMessage);
        tempcounter++;
      }
    }
  }
}
Program: 44342
Project: 44342
Buggy source:
public BabelCraftPlayerListener(BabelCraft instance){
  this.plugin=instance;
  if (Variables.plugintag) {
    TempPrefix=Variables.plugin_prefix;
  }
 else {
    TempPrefix=Variables.nextline_tag;
  }
}

Fixed version (ground truth):
public BabelCraftPlayerListener(BabelCraft instance){
  if (Variables.plugintag) {
    TempPrefix=Variables.plugin_prefix;
  }
 else {
    TempPrefix=Variables.nextline_tag;
  }
}
Program: 44344
Project: 44344
Buggy source:
public void onPlayerJoin(PlayerJoinEvent event){
  if (Util.PlayerDatabase("String_Node_Str",event.getPlayer(),null,null)) {
    Language lang=translation.GetPlayerLanguageHash(event.getPlayer());
    event.getPlayer().sendMessage(Variables.plugin_prefix + "String_Node_Str" + translation.LanguageName("String_Node_Str" + lang)+ "String_Node_Str");
    event.getPlayer().sendMessage(TempPrefix + "String_Node_Str");
  }
 else {
    if (!Util.ToFile("String_Node_Str",event.getPlayer().getName().toLowerCase(),null)) {
      String CountryCode=Util.GetCountryCode(Util.GetIP(event.getPlayer()));
      if (CountryCode.equals("String_Node_Str")) {
        CountryCode="String_Node_Str";
      }
      Util.ToFile("String_Node_Str",event.getPlayer().getName().toLowerCase() + "String_Node_Str" + Util.LanguageCode(Config.language_default).toLowerCase(),null);
      Util.PlayerDatabase("String_Node_Str",event.getPlayer(),Config.language_default,CountryCode);
      event.getPlayer().sendMessage(Config.plugin_prefix + "String_Node_Str" + translation.LanguageName(Config.language_default)+ "String_Node_Str");
      event.getPlayer().sendMessage(TempPrefix + "String_Node_Str");
    }
 else {
      Language lang=translation.GetLanguage(event.getPlayer(),null);
      event.getPlayer().sendMessage(Variables.plugin_prefix + "String_Node_Str" + translation.LanguageName("String_Node_Str" + lang)+ "String_Node_Str");
      event.getPlayer().sendMessage(TempPrefix + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public void onPlayerJoin(PlayerJoinEvent event){
  event.getPlayer().sendMessage(Variables.plugin_prefix + "String_Node_Str" + playerManager.getLanguageString(event.getPlayer())+ "String_Node_Str");
  event.getPlayer().sendMessage(TempPrefix + "String_Node_Str");
}
Program: 44346
Project: 44346
Buggy source:
public static void setGlobal(Actor g){
  global=g;
}

Fixed version (ground truth):
public static void setGlobal(WyObject g){
  global=g;
}
Program: 44347
Project: 44347
Buggy source:
public static Actor Frame(String title){
  JFrame frame=new JFrame(title);
  c=new TetrisCanvas(name);
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.add(c,BorderLayout.CENTER);
  frame.setSize(285,690);
  frame.pack();
  frame.setVisible(true);
  grid=new char[10][22];
  c.setFocusable(true);
  frame.transferFocus();
  frame.setResizable(true);
  Actor a=new Actor(frame);
  a.start();
  return a;
}

Fixed version (ground truth):
public static WyObject Frame(String title){
  JFrame frame=new JFrame(title);
  c=new TetrisCanvas(name);
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.add(c,BorderLayout.CENTER);
  frame.setSize(285,690);
  frame.pack();
  frame.setVisible(true);
  grid=new char[10][22];
  c.setFocusable(true);
  frame.transferFocus();
  frame.setResizable(true);
  return new WyObject(frame);
}
Program: 44348
Project: 44348
Buggy source:
public static void setNext(Actor a,BigInteger i){
switch (i.intValue()) {
case 1:
    block=BLOCK_I;
  return;
case 2:
block=BLOCK_J;
return;
case 3:
block=BLOCK_L;
return;
case 4:
block=BLOCK_O;
return;
case 5:
block=BLOCK_S;
return;
case 6:
block=BLOCK_T;
return;
case 7:
block=BLOCK_Z;
return;
default :
block=BLOCK_I;
}
}

Fixed version (ground truth):
public static void setNext(WyObject a,BigInteger i){
switch (i.intValue()) {
case 1:
    block=BLOCK_I;
  return;
case 2:
block=BLOCK_J;
return;
case 3:
block=BLOCK_L;
return;
case 4:
block=BLOCK_O;
return;
case 5:
block=BLOCK_S;
return;
case 6:
block=BLOCK_T;
return;
case 7:
block=BLOCK_Z;
return;
default :
block=BLOCK_I;
}
}
Program: 44349
Project: 44349
Buggy source:
public static void render(Actor a,String str){
  int x=0;
  int y=20;
  for (int i=0; i < str.length(); i++) {
    if (y < 0) {
      y=20;
      x++;
    }
    if (str.charAt(i) == '\'') {
    }
 else {
      grid[x][y]=str.charAt(i);
      y--;
    }
  }
  c.repaint();
}

Fixed version (ground truth):
public static void render(WyObject a,String str){
  int x=0;
  int y=20;
  for (int i=0; i < str.length(); i++) {
    if (y < 0) {
      y=20;
      x++;
    }
    if (str.charAt(i) == '\'') {
    }
 else {
      grid[x][y]=str.charAt(i);
      y--;
    }
  }
  c.repaint();
}
Program: 44350
Project: 44350
Buggy source:
public static void updateStats(Actor a,BigInteger i,BigInteger sc,BigInteger lvl){
  filledRows=i.intValue();
  score=sc.intValue();
  level=lvl.intValue();
}

Fixed version (ground truth):
public static void updateStats(WyObject a,BigInteger i,BigInteger sc,BigInteger lvl){
  filledRows=i.intValue();
  score=sc.intValue();
  level=lvl.intValue();
}
Program: 44351
Project: 44351
Buggy source:
public static void main(String[] args){
  try {
    int[] data=readFile(args[0]);
    for (int i=0; i < data.length; ++i) {
      for (int j=i + 1; j < data.length; ++j) {
        System.out.println(gcd(i,j));
      }
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  try {
    int[] data=readFile(args[0]);
    for (int i=0; i < data.length; ++i) {
      for (int j=i + 1; j < data.length; ++j) {
        System.out.println(gcd(data[i],data[j]));
      }
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 44352
Project: 44352
Buggy source:
public boolean onCommand(CommandSender sender,Command commandArg,String commandLabel,String[] arg){
  Player player=(Player)sender;
  String command=commandArg.getName().toLowerCase();
  String response="String_Node_Str";
  if (command.equalsIgnoreCase("String_Node_Str")) {
    if (player.isOp() || StealthLogin.Permissions.has(player,"String_Node_Str") || (StealthLogin.Permissions.has(player,"String_Node_Str") || StealthLogin.Permissions.has(player,"String_Node_Str"))) {
      for (      Player p : getServer().getOnlinePlayers()) {
        if (StealthLogin.Permissions.has(p,"String_Node_Str")) {
          response+=p.toString() + "String_Node_Str";
        }
      }
      player.sendMessage(logPrefix + "String_Node_Str" + response);
    }
  }
  if (command.equalsIgnoreCase("String_Node_Str")) {
    if (player.isOp() || StealthLogin.Permissions.has(player,"String_Node_Str") || (StealthLogin.Permissions.has(player,"String_Node_Str") || StealthLogin.Permissions.has(player,"String_Node_Str"))) {
      for (      Player p : getServer().getOnlinePlayers()) {
        if (StealthLogin.Permissions.has(p,"String_Node_Str")) {
          response+=p.toString() + "String_Node_Str";
        }
      }
      player.sendMessage(logPrefix + "String_Node_Str" + response);
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean onCommand(CommandSender sender,Command commandArg,String commandLabel,String[] arg){
  Player player=(Player)sender;
  String command=commandArg.getName().toLowerCase();
  String response="String_Node_Str";
  if (command.equalsIgnoreCase("String_Node_Str")) {
    if (player.isOp() || StealthLogin.Permissions.has(player,"String_Node_Str") || (StealthLogin.Permissions.has(player,"String_Node_Str") || StealthLogin.Permissions.has(player,"String_Node_Str"))) {
      for (      Player p : getServer().getOnlinePlayers()) {
        if (StealthLogin.Permissions.has(p,"String_Node_Str")) {
          response+=p.toString() + "String_Node_Str";
        }
      }
      player.sendMessage(logPrefix + "String_Node_Str" + response);
      response="String_Node_Str";
    }
  }
  if (command.equalsIgnoreCase("String_Node_Str")) {
    if (player.isOp() || StealthLogin.Permissions.has(player,"String_Node_Str") || (StealthLogin.Permissions.has(player,"String_Node_Str") || StealthLogin.Permissions.has(player,"String_Node_Str"))) {
      for (      Player p : getServer().getOnlinePlayers()) {
        if (StealthLogin.Permissions.has(p,"String_Node_Str")) {
          response+=p.toString() + "String_Node_Str";
        }
      }
      player.sendMessage(logPrefix + "String_Node_Str" + response);
      response="String_Node_Str";
    }
  }
  return true;
}
Program: 44353
Project: 44353
Buggy source:
private void play(){
  boolean aux1=true;
  boolean aux2=true;
  if (System.currentTimeMillis() - playLoopStartTime > playLoopTime) {
    List<MoleSprite> moles=view.getMoles();
    if (System.currentTimeMillis() - levelStartTime > levelTimeDuration) {
      level++;
      levelStartTime=System.currentTimeMillis();
      levelTimeDuration=levelTimeDuration + 10000;
      playLoopTime=playLoopTime / 2;
    }
    if (level <= 7) {
      int chosenMole=(int)Math.floor(12 * Math.random() - 0.01);
      MoleSprite mole=moles.get(chosenMole);
      if (mole.getStatus() == 4) {
        mole.digUp();
        aux1=checkMoles.add(mole);
        waitStartTime=System.currentTimeMillis();
        Log.i("String_Node_Str",mole.toString());
        mole.setFullDigUpStartTime(System.currentTimeMillis());
      }
 else {
        playLoopStartTime=System.currentTimeMillis();
        play();
      }
      for (      MoleSprite moleCheck : checkMoles) {
        if (moleCheck.getStatus() == 0) {
          if (System.currentTimeMillis() - moleCheck.getFullDigUpStartTime() > 1500) {
            if (moleCheck.equals((checkMoles).peek())) {
              if (System.currentTimeMillis() - waitStartTime > waitTime) {
                moleCheck.digDown();
                aux2=checkMoles.remove(moleCheck);
                Log.i("String_Node_Str",moleCheck.toString());
                waitStartTime=System.currentTimeMillis();
              }
            }
          }
        }
      }
    }
    if (!aux1 || !aux2)     throw new IllegalArgumentException("String_Node_Str");
  }
}

Fixed version (ground truth):
private void play(){
  boolean aux1=true;
  boolean aux2=true;
  if (System.currentTimeMillis() - playLoopStartTime > playLoopTime) {
    List<MoleSprite> moles=view.getMoles();
    if (System.currentTimeMillis() - levelStartTime > levelTimeDuration) {
      level++;
      levelStartTime=System.currentTimeMillis();
      levelTimeDuration=levelTimeDuration + 10000;
      playLoopTime=playLoopTime / 2;
    }
    if (level <= 7) {
      int chosenMole=(int)Math.floor(12 * Math.random() - 0.01);
      MoleSprite mole=moles.get(chosenMole);
      if (mole.getStatus() == 4) {
        mole.digUp();
        aux1=checkMoles.add(mole);
        Log.i("String_Node_Str",mole.toString());
        mole.setFullDigUpStartTime(System.currentTimeMillis());
      }
 else {
        playLoopStartTime=System.currentTimeMillis();
        play();
      }
      Iterator<MoleSprite> it=checkMoles.iterator();
      MoleSprite moleCheck;
      while (it.hasNext()) {
        moleCheck=it.next();
        if (moleCheck.getStatus() == 0) {
          if (System.currentTimeMillis() - moleCheck.getFullDigUpStartTime() > 1500) {
            if (moleCheck.equals((checkMoles).peek())) {
              moleCheck.digDown();
              it.remove();
              Log.i("String_Node_Str",moleCheck.toString());
            }
          }
        }
      }
    }
    if (!aux1 || !aux2)     throw new IllegalArgumentException("String_Node_Str");
  }
}
Program: 44354
Project: 44354
Buggy source:
/** 
 * Get auth token from API for given creds
 * @param email of user
 * @param password of user
 * @return An ApiResponse with Credentials information containing the returned auth token
 */
public ApiResponse<Credentials> login(final String email,final String password){
  final String params=String.format("String_Node_Str",email,password);
  final String data=Api.encode(params);
  final String url=Constants.API_LOGIN_URL;
  final ApiResponse<String> response=Api.Post(userAgent,url,data);
  final ApiResponse<Credentials> result;
  if (response.status == HttpStatus.SC_OK) {
    result=new ApiResponse<Credentials>(response.status,new Credentials(response.payload,email),response.headers);
  }
 else {
    result=new ApiResponse<Credentials>(response.status,null,response.headers);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Get auth token from API for given creds
 * @param email of user
 * @param password of user
 * @return An ApiResponse with Credentials information containing the returned auth token
 */
public ApiResponse<Credentials> login(final String email,final String password){
  final String params=String.format("String_Node_Str",email,password);
  final String data=Api.encode(params);
  final String url=Constants.API_LOGIN_URL;
  final ApiResponse<String> response=Api.Post(userAgent,url,data);
  final ApiResponse<Credentials> result;
  if (response.status == HttpStatus.SC_OK) {
    result=new ApiResponse<Credentials>(response.status,new Credentials(response.payload,email),response.headers);
  }
 else {
    result=new ApiResponse<Credentials>(response.status,new Credentials(null,email,password),response.headers);
  }
  return result;
}
Program: 44355
Project: 44355
Buggy source:
/** 
 * Gibt das aktuelle Semester zurück
 * @return ein {@link String} ("WiSe XX/XX" oder "SoSe XX")
 */
private String getActualExamSem(){
  String semString="String_Node_Str";
  Date dt=new Date();
  int year=dt.getYear() - 100;
  int month=dt.getMonth() + 1;
  if (month > 9 && month < 3) {
    if (month != (1 | 2)) {
      year++;
    }
    semString="String_Node_Str" + (year - 1) + "String_Node_Str"+ year;
  }
 else {
    semString="String_Node_Str" + year;
  }
  return semString;
}

Fixed version (ground truth):
/** 
 * Gibt das aktuelle Semester zurück
 * @return ein {@link String} ("WiSe XX/XX" oder "SoSe XX")
 */
private String getActualExamSem(){
  String semString="String_Node_Str";
  Date dt=new Date();
  int year=dt.getYear() - 100;
  int month=dt.getMonth() + 1;
  if (month > 9 || month < 3) {
    if (month != (1 | 2)) {
      year++;
    }
    semString="String_Node_Str" + (year - 1) + "String_Node_Str"+ year;
  }
 else {
    semString="String_Node_Str" + year;
  }
  return semString;
}
Program: 44356
Project: 44356
Buggy source:
/** 
 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
 */
public void stop(BundleContext context) throws Exception {
  plugin=null;
  super.stop(context);
  IPath location=Platform.getStateLocation(context.getBundle());
  File store=location.append(STORE_NAME).toFile();
  if (store != null) {
    try {
      ObjectOutputStream stream=new ObjectOutputStream(new FileOutputStream(store));
      stream.writeObject(this.store);
    }
 catch (    IOException e) {
      getLog().log(new Status(IStatus.ERROR,PLUGIN_ID,"String_Node_Str",e));
    }
  }
  this.store.dispose();
}

Fixed version (ground truth):
/** 
 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
 */
public void stop(BundleContext context) throws Exception {
  plugin=null;
  super.stop(context);
  IPath location=Platform.getStateLocation(context.getBundle());
  File store=location.append(STORE_NAME).toFile();
  if (store != null) {
    ObjectOutputStream stream=null;
    try {
      stream=new ObjectOutputStream(new FileOutputStream(store));
      stream.writeObject(this.store);
    }
 catch (    IOException e) {
      log(Messages.AvatarPlugin_ExceptionSavingStore,e);
    }
 finally {
      if (stream != null) {
        try {
          stream.close();
        }
 catch (        IOException ignore) {
        }
      }
    }
  }
  this.store.dispose();
}
Program: 44357
Project: 44357
Buggy source:
/** 
 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
 */
public void start(BundleContext context) throws Exception {
  super.start(context);
  plugin=this;
  IPath location=Platform.getStateLocation(context.getBundle());
  File store=location.append(STORE_NAME).toFile();
  if (store != null && store.exists()) {
    try {
      ObjectInputStream stream=new ObjectInputStream(new FileInputStream(store));
      this.store=(AvatarStore)stream.readObject();
    }
 catch (    IOException e) {
      getLog().log(new Status(IStatus.ERROR,PLUGIN_ID,"String_Node_Str",e));
    }
catch (    ClassNotFoundException cnfe) {
      getLog().log(new Status(IStatus.ERROR,PLUGIN_ID,"String_Node_Str",cnfe));
    }
  }
  if (this.store == null) {
    this.store=new AvatarStore();
  }
}

Fixed version (ground truth):
/** 
 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
 */
public void start(BundleContext context) throws Exception {
  super.start(context);
  plugin=this;
  IPath location=Platform.getStateLocation(context.getBundle());
  File store=location.append(STORE_NAME).toFile();
  if (store != null && store.exists()) {
    ObjectInputStream stream=null;
    try {
      stream=new ObjectInputStream(new FileInputStream(store));
      this.store=(AvatarStore)stream.readObject();
    }
 catch (    IOException e) {
      log(Messages.AvatarPlugin_ExceptionLoadingStore,e);
    }
catch (    ClassNotFoundException cnfe) {
      log(Messages.AvatarPlugin_ExceptionLoadingStore,cnfe);
    }
 finally {
      if (stream != null) {
        try {
          stream.close();
        }
 catch (        IOException ignore) {
        }
      }
    }
  }
  if (this.store == null) {
    this.store=new AvatarStore();
  }
}
Program: 44358
Project: 44358
Buggy source:
private void createGplBreakpoint(IResource resource,String typeName,int lineNumber,int charStart,int charEnd) throws CoreException {
  this.gplBreakpoint=JDIDebugModel.createLineBreakpoint(resource,typeName,lineNumber,charStart,charEnd,0,true,null);
}

Fixed version (ground truth):
private void createGplBreakpoint(IResource resource,String typeName,int lineNumber,int charStart,int charEnd) throws CoreException {
  if (this.gplBreakpoint == null || !this.gplBreakpoint.isRegistered()) {
    this.gplBreakpoint=JDIDebugModel.createLineBreakpoint(resource,typeName,lineNumber,charStart,charEnd,0,true,null);
  }
}
Program: 44359
Project: 44359
Buggy source:
public void install(DSLDebugTarget debugTarget){
  this.debugTarget=debugTarget;
  SimpleMapping mapping=this.debugTarget.getMapping(this);
  if (mapping != null) {
    try {
      String typeName=mapping.getTarget().getFullPath().removeFileExtension().removeFirstSegments(2).toOSString().replace('/','.');
      int lineNumber=12;
      createGplBreakpoint(mapping.getTarget(),typeName,lineNumber,mapping.getTargetStartChar(),mapping.getTargetEndChar());
      IDebugTarget jDebugTarget=debugTarget.getJavaDebugTarget();
      if (jDebugTarget != null)       jDebugTarget.breakpointAdded(this.gplBreakpoint);
    }
 catch (    CoreException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public void install(DSLDebugTarget debugTarget){
  this.debugTarget=debugTarget;
  SimpleMapping mapping=this.debugTarget.getMapping(this);
  if (mapping != null) {
    try {
      String typeName=mapping.getTarget().getFullPath().removeFileExtension().removeFirstSegments(2).toOSString().replace('/','.');
      int lineNumber=mapping.getTargetStartLineNumber();
      createGplBreakpoint(mapping.getTarget(),typeName,lineNumber,mapping.getTargetStartChar(),mapping.getTargetEndChar());
      IDebugTarget jDebugTarget=debugTarget.getJavaDebugTarget();
      if (jDebugTarget != null)       jDebugTarget.breakpointAdded(this.gplBreakpoint);
    }
 catch (    CoreException e) {
      e.printStackTrace();
    }
  }
}
Program: 44360
Project: 44360
Buggy source:
@Override public boolean isTerminated(){
  return javaDebugTarget != null ? javaDebugTarget.isTerminated() : false;
}

Fixed version (ground truth):
@Override public boolean isTerminated(){
  return true;
}
Program: 44361
Project: 44361
Buggy source:
@Override public IStackFrame[] getStackFrames() throws DebugException {
  return null;
}

Fixed version (ground truth):
@Override public IStackFrame[] getStackFrames() throws DebugException {
  return stackFrames.toArray(new IStackFrame[stackFrames.size()]);
}
Program: 44362
Project: 44362
Buggy source:
public DSLThread(IDebugTarget target,IJavaThread javaThread){
  super(target);
  this.javaThread=javaThread;
}

Fixed version (ground truth):
public DSLThread(IDebugTarget target,IJavaThread javaThread){
  super(target);
  this.javaThread=javaThread;
  this.stackFrames=new ArrayList<DSLStackFrame>();
  this.stackFrames.add(new DSLStackFrame(target,this));
}
Program: 44363
Project: 44363
Buggy source:
@Override public boolean hasStackFrames() throws DebugException {
  return false;
}

Fixed version (ground truth):
@Override public boolean hasStackFrames() throws DebugException {
  return stackFrames.size() != 0;
}
Program: 44365
Project: 44365
Buggy source:
public DebugPanel(DebugMachine m,Program p){
  if (m == null)   throw new NullPointerException();
  machine=m;
  controller=new Controller(m);
  setLayout(new GridBagLayout());
  GridBagConstraints g=new GridBagConstraints();
  g.anchor=GridBagConstraints.CENTER;
  g.insets=new Insets(4,4,4,4);
  g.gridx=0;
  g.gridy=0;
  g.weightx=0;
  g.weighty=0;
  g.fill=GridBagConstraints.NONE;
  registerPanel=new RegisterPanel(this);
  add(registerPanel,g);
  g.gridx=1;
  g.gridy=0;
  g.weightx=0;
  g.weighty=0;
  g.fill=GridBagConstraints.NONE;
  add(new ControlPanel(this),g);
  g.gridx=2;
  g.gridy=0;
  g.weightx=1;
  g.weighty=0;
  g.fill=GridBagConstraints.HORIZONTAL;
  add(new JPanel(),g);
  g.gridx=0;
  g.gridy=1;
  g.gridwidth=3;
  g.weightx=1;
  g.weighty=1;
  g.fill=GridBagConstraints.BOTH;
  tableModel=new MachineTableModel(this,p);
  JTable table=new JTable(tableModel);
  table.setFont(monospacedFont);
  table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
  int[] columnWidths={30,100,80,400};
  for (int i=0; i < columnWidths.length; i++)   table.getColumnModel().getColumn(i).setPreferredWidth(columnWidths[i]);
  table.setColumnSelectionAllowed(true);
  JScrollPane scrollpane=new JScrollPane(table);
  add(scrollpane,g);
}

Fixed version (ground truth):
public DebugPanel(DebugMachine m,Program p){
  if (m == null)   throw new NullPointerException();
  controller=new Controller(m);
  setLayout(new GridBagLayout());
  GridBagConstraints g=new GridBagConstraints();
  g.anchor=GridBagConstraints.CENTER;
  g.insets=new Insets(4,4,4,4);
  g.gridx=0;
  g.gridy=0;
  g.weightx=0;
  g.weighty=0;
  g.fill=GridBagConstraints.NONE;
  registerPanel=new RegisterPanel(this);
  add(registerPanel,g);
  g.gridx=1;
  g.gridy=0;
  g.weightx=0;
  g.weighty=0;
  g.fill=GridBagConstraints.NONE;
  add(new ControlPanel(this),g);
  g.gridx=2;
  g.gridy=0;
  g.weightx=1;
  g.weighty=0;
  g.fill=GridBagConstraints.HORIZONTAL;
  add(new JPanel(),g);
  g.gridx=0;
  g.gridy=1;
  g.gridwidth=3;
  g.weightx=1;
  g.weighty=1;
  g.fill=GridBagConstraints.BOTH;
  tableModel=new MachineTableModel(this,p);
  JTable table=new JTable(tableModel);
  table.setFont(monospacedFont);
  table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
  int[] columnWidths={30,100,80,400};
  for (int i=0; i < columnWidths.length; i++)   table.getColumnModel().getColumn(i).setPreferredWidth(columnWidths[i]);
  table.setColumnSelectionAllowed(true);
  JScrollPane scrollpane=new JScrollPane(table);
  add(scrollpane,g);
}
Program: 44366
Project: 44366
Buggy source:
public void beginRun(){
  machine.removeListener(this);
  updateThread=new Thread("String_Node_Str"){
    public void run(){
      try {
        do {
          SwingUtilities.invokeAndWait(new Runnable(){
            public void run(){
              updateView();
            }
          }
);
        }
 while (!threadStopRequest.tryAcquire(1000,TimeUnit.MILLISECONDS));
      }
 catch (      InterruptedException e) {
      }
catch (      InvocationTargetException e) {
      }
    }
  }
;
  updateThread.start();
}

Fixed version (ground truth):
public void beginRun(){
  machine.removeListener(this);
  updateThread=new Thread("String_Node_Str"){
    public void run(){
      try {
        do {
          SwingUtilities.invokeAndWait(new Runnable(){
            public void run(){
              updateView();
            }
          }
);
        }
 while (!threadStopRequest.tryAcquire(1000,TimeUnit.MILLISECONDS));
        updateThread=null;
        machine.addListener(MachineTableModel.this);
        fireTableDataChanged();
      }
 catch (      InterruptedException e) {
      }
catch (      InvocationTargetException e) {
      }
    }
  }
;
  updateThread.start();
}
Program: 44367
Project: 44367
Buggy source:
public void endRun(){
  threadStopRequest.release();
  join(updateThread);
  updateThread=null;
  machine.addListener(this);
  fireTableDataChanged();
}

Fixed version (ground truth):
public void endRun(){
  threadStopRequest.release();
}
Program: 44368
Project: 44368
Buggy source:
public void beginRun(){
  oldAccumulator=machine.getAccumulator();
  oldConditionCode=machine.getConditionCode();
  updateThread=new Thread("String_Node_Str"){
    public void run(){
      try {
        do {
          SwingUtilities.invokeAndWait(new Runnable(){
            public void run(){
              updateView();
            }
          }
);
        }
 while (!threadStopRequest.tryAcquire(1000,TimeUnit.MILLISECONDS));
      }
 catch (      InterruptedException e) {
      }
catch (      InvocationTargetException e) {
      }
    }
  }
;
  updateThread.start();
}

Fixed version (ground truth):
public void beginRun(){
  oldAccumulator=machine.getAccumulator();
  oldConditionCode=machine.getConditionCode();
  updateThread=new Thread("String_Node_Str"){
    public void run(){
      try {
        do {
          SwingUtilities.invokeAndWait(new Runnable(){
            public void run(){
              updateView();
            }
          }
);
        }
 while (!threadStopRequest.tryAcquire(1000,TimeUnit.MILLISECONDS));
        updateThread=null;
        programCounterChanged(false);
        accumulatorChanged(false);
        conditionCodeChanged(false);
        stepCountChanged();
      }
 catch (      InterruptedException e) {
      }
catch (      InvocationTargetException e) {
      }
    }
  }
;
  updateThread.start();
}
Program: 44369
Project: 44369
Buggy source:
public void endRun(){
  threadStopRequest.release();
  join(updateThread);
  updateThread=null;
  programCounterChanged(false);
  accumulatorChanged(false);
  conditionCodeChanged(false);
  stepCountChanged();
}

Fixed version (ground truth):
public void endRun(){
  threadStopRequest.release();
}
Program: 44370
Project: 44370
Buggy source:
public static Program link(Set<Fragment> frags){
  Map<String,Integer> alllabels=new HashMap<String,Integer>();
  alllabels.put("String_Node_Str",Executor.OPSYS_ADDRESS);
  int offset=0;
  for (  Fragment f : frags) {
    Map<String,Integer> labels=f.getLabels();
    for (    String label : labels.keySet()) {
      if (alllabels.containsKey(label))       throw new IllegalArgumentException(String.format("String_Node_Str",label));
 else       alllabels.put(label,labels.get(label) + offset);
    }
    offset+=f.getImageLength();
  }
  IntBuffer allimage=new IntBuffer();
  for (  Fragment f : frags) {
    int[] image=resolveReferences(f,alllabels);
    allimage.append(image);
  }
  return new Program(allimage.toArray(),alllabels.get("String_Node_Str"),new HashMap<Integer,String>());
}

Fixed version (ground truth):
public static Program link(Set<Fragment> frags){
  Map<String,Integer> alllabels=new HashMap<String,Integer>();
  alllabels.put("String_Node_Str",Executor.OPSYS_ADDRESS);
  int offset=0;
  for (  Fragment f : frags) {
    Map<String,Integer> labels=f.getLabels();
    for (    String label : labels.keySet()) {
      if (alllabels.containsKey(label))       throw new IllegalArgumentException(String.format("String_Node_Str",label));
 else       alllabels.put(label,labels.get(label) + offset);
    }
    offset+=f.getImageLength();
  }
  IntBuffer allimage=new IntBuffer();
  for (  Fragment f : frags) {
    int[] image=resolveReferences(f,alllabels);
    allimage.append(image);
  }
  Map<Integer,String> imageSourceCode=new HashMap<Integer,String>();
  offset=0;
  for (  Fragment f : frags) {
    int imagelen=f.getImageLength();
    for (int i=0; i < imagelen; i++)     imageSourceCode.put(i + offset,f.getSourceLine(i));
    offset+=imagelen;
  }
  return new Program(allimage.toArray(),alllabels.get("String_Node_Str"),imageSourceCode);
}
Program: 44371
Project: 44371
Buggy source:
public static void main(String[] args) throws IOException {
  SourceCode s=SourceCode.readFile(new File(args[0]));
  Program p;
  try {
    p=Csc258Compiler.compile(s);
  }
 catch (  CompilationException e) {
    SortedMap<Integer,String> errorMessages=e.getErrorMessages();
    SourceCode sourceCode=e.getSourceCode();
    for (    int line : errorMessages.keySet()) {
      System.err.printf("String_Node_Str",line + 1,errorMessages.get(line));
      System.err.println(sourceCode.getLineAt(line));
      System.err.println();
    }
    System.err.printf("String_Node_Str",errorMessages.size(),errorMessages.size() == 1 ? "String_Node_Str" : "String_Node_Str");
    return;
  }
  ProbedMachine m=new ProbedMachine(System.in,System.out);
  StatePanel panel=new StatePanel(m);
  m.loadProgram(p);
  JFrame frame=new JFrame("String_Node_Str");
  frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  frame.add(panel);
  frame.pack();
  frame.setVisible(true);
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException {
  Set<Fragment> frags=new HashSet<Fragment>();
  for (  String arg : args) {
    try {
      File file=new File(arg);
      SourceCode sc=SourceCode.readFile(file);
      Fragment f=Csc258Compiler.compile(sc);
      frags.add(f);
    }
 catch (    CompilationException e) {
      printCompilerErrors(e.getErrorMessages(),e.getSourceCode());
      System.exit(1);
      return;
    }
  }
  Program p=Csc258Linker.link(frags);
  ProbedMachine m=new ProbedMachine(System.in,System.out);
  StatePanel panel=new StatePanel(m);
  m.loadProgram(p);
  JFrame frame=new JFrame("String_Node_Str");
  frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  frame.add(panel);
  frame.pack();
  frame.setVisible(true);
}
Program: 44372
Project: 44372
Buggy source:
public void write(OutputStream out) throws IOException {
  out.write(new byte[]{op});
  out.write(new byte[]{htype});
  out.write(new byte[]{hlen});
  out.write(new byte[]{hops});
  out.write(xid);
  out.write(secs);
  out.write(flags);
  out.write(ciaddr);
  out.write(yiaddr);
  out.write(siaddr);
  out.write(giaddr);
  out.write(chaddr);
  out.write(sname);
  out.write(file);
  int len=0;
  out.write(Constants.magicCookie);
  len+=4;
  for (  Option option : options) {
    out.write(new byte[]{option.code});
    out.write(new byte[]{option.len});
    out.write(option.data);
    len+=option.len + 2;
  }
  out.write(new byte[]{(byte)255});
  len+=1;
  while (len % 64 != 0) {
    out.write(new byte[]{0});
    len+=1;
  }
}

Fixed version (ground truth):
public void write(OutputStream out) throws IOException {
  out.write(new byte[]{op});
  out.write(new byte[]{htype});
  out.write(new byte[]{hlen});
  out.write(new byte[]{hops});
  out.write(xid);
  out.write(secs);
  out.write(flags);
  out.write(ciaddr);
  out.write(yiaddr);
  out.write(siaddr);
  out.write(giaddr);
  out.write(chaddr);
  out.write(sname);
  out.write(file);
  int len=0;
  out.write(Constants.MAGICCOOKIE);
  len+=4;
  for (  Option option : options) {
    out.write(new byte[]{option.code});
    out.write(new byte[]{option.len});
    out.write(option.data);
    len+=option.len + 2;
  }
  out.write(new byte[]{(byte)255});
  len+=1;
  while (len % 64 != 0) {
    out.write(new byte[]{0});
    len+=1;
  }
}
Program: 44373
Project: 44373
Buggy source:
public void read(InputStream in) throws IOException {
  byte[] temp=new byte[1];
  in.read(temp);
  op=temp[0];
  in.read(temp);
  htype=temp[0];
  in.read(temp);
  hlen=temp[0];
  in.read(temp);
  hops=temp[0];
  xid=new byte[4];
  in.read(xid);
  secs=new byte[2];
  in.read(secs);
  flags=new byte[2];
  in.read(flags);
  ciaddr=new byte[4];
  in.read(ciaddr);
  yiaddr=new byte[4];
  in.read(yiaddr);
  siaddr=new byte[4];
  in.read(siaddr);
  giaddr=new byte[4];
  in.read(giaddr);
  chaddr=new byte[16];
  in.read(chaddr);
  sname=new byte[64];
  in.read(sname);
  file=new byte[128];
  in.read(file);
  byte[] magiccookie=new byte[4];
  in.read(magiccookie);
  if (!Arrays.equals(magiccookie,Constants.magicCookie))   throw new Error("String_Node_Str");
  while (in.available() > 0) {
    in.read(temp);
    byte code=temp[0];
    if (code == -1)     break;
    in.read(temp);
    byte len=temp[0];
    byte[] data=new byte[len];
    in.read(data);
    options.add(new Option(code,len,data));
  }
  padding=0;
  while (in.available() > 0) {
    in.read(temp);
    if (temp[0] != 0)     throw new IOException("String_Node_Str");
    padding++;
  }
}

Fixed version (ground truth):
public void read(InputStream in) throws IOException {
  byte[] temp=new byte[1];
  in.read(temp);
  op=temp[0];
  in.read(temp);
  htype=temp[0];
  in.read(temp);
  hlen=temp[0];
  in.read(temp);
  hops=temp[0];
  xid=new byte[4];
  in.read(xid);
  secs=new byte[2];
  in.read(secs);
  flags=new byte[2];
  in.read(flags);
  ciaddr=new byte[4];
  in.read(ciaddr);
  yiaddr=new byte[4];
  in.read(yiaddr);
  siaddr=new byte[4];
  in.read(siaddr);
  giaddr=new byte[4];
  in.read(giaddr);
  chaddr=new byte[16];
  in.read(chaddr);
  sname=new byte[64];
  in.read(sname);
  file=new byte[128];
  in.read(file);
  byte[] magiccookie=new byte[4];
  in.read(magiccookie);
  if (!Arrays.equals(magiccookie,Constants.MAGICCOOKIE))   throw new Error("String_Node_Str");
  while (in.available() > 0) {
    in.read(temp);
    byte code=temp[0];
    if (code == -1)     break;
    in.read(temp);
    byte len=temp[0];
    byte[] data=new byte[len];
    in.read(data);
    options.add(new Option(code,len,data));
  }
  padding=0;
  while (in.available() > 0) {
    in.read(temp);
    if (temp[0] != 0)     throw new IOException("String_Node_Str");
    padding++;
  }
}
Program: 44374
Project: 44374
Buggy source:
public void start(){
  System.out.println("String_Node_Str");
  while (true) {
    byte[] temp=new byte[MAX_LEN];
    DatagramPacket packet=new DatagramPacket(temp,MAX_LEN);
    try {
      socket.receive(packet);
      ReplyThread reply=new ReplyThread(packet);
      Thread replyThread=new Thread(reply);
      replyThread.run();
      System.out.println("String_Node_Str" + Calendar.getInstance() + "String_Node_Str");
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public void start(){
  System.out.println("String_Node_Str");
  while (true) {
    byte[] temp=new byte[MAX_LEN];
    DatagramPacket packet=new DatagramPacket(temp,MAX_LEN);
    try {
      socket.receive(packet);
      ReplyThread reply=new ReplyThread(packet);
      Thread replyThread=new Thread(reply);
      replyThread.run();
      System.out.println("String_Node_Str" + Calendar.getInstance().getTime().toString() + "String_Node_Str");
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
}
Program: 44375
Project: 44375
Buggy source:
@Override public void run(){
  int len=requestPacket.getLength();
  byte[] requestdata=java.util.Arrays.copyOf(requestPacket.getData(),len);
  DHCPPacket request=new DHCPPacket();
  request.read(requestdata);
  DHCPPacket reply=new DHCPPacket();
  reply.setOp(Constants.BOOTREQUEST).setHtype((byte)1).setHlen((byte)6).setHops((byte)0).setXid(request.getXid()).setSecs(0).setBroadcastFlag(true).setCiaddr(0).setYiaddr(getNextAddress()).setSiaddr(requestPacket.getAddress().getAddress()).setGiaddr(0).setChaddr(request.getChaddr()).setSname(0).setFile(0);
  reply.addOption((byte)53,(byte)1,new byte[]{2}).addOption((byte)1,(byte)4,new byte[]{-1,-1,-1,0}).addOption((byte)3,(byte)4,new byte[]{(byte)192,(byte)168,(byte)1,(byte)1}).addOption((byte)6,(byte)4,new byte[]{(byte)192,(byte)168,(byte)1,(byte)1}).addOption((byte)58,(byte)4,new byte[]{(byte)0,(byte)1,(byte)0xfa,(byte)0x40}).addOption((byte)59,(byte)4,new byte[]{(byte)0,(byte)3,(byte)0x75,(byte)0xf0}).addOption((byte)51,(byte)4,new byte[]{(byte)0,(byte)3,(byte)0xf4,(byte)0x80}).addOption((byte)54,(byte)4,new byte[]{(byte)192,(byte)168,(byte)1,(byte)1});
  byte[] replydata=reply.array();
  DatagramPacket replyPacket=new DatagramPacket(replydata,replydata.length);
  DatagramSocket socket;
  try {
    socket=new DatagramSocket();
    replyPacket.setPort(68);
    replyPacket.setAddress(InetAddress.getByAddress(new byte[]{(byte)255,(byte)255,(byte)255,(byte)255}));
    socket.setBroadcast(true);
    socket.send(replyPacket);
  }
 catch (  SocketException e) {
    e.printStackTrace();
  }
catch (  UnknownHostException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void run(){
  int len=requestPacket.getLength();
  byte[] requestdata=java.util.Arrays.copyOf(requestPacket.getData(),len);
  DHCPPacket request=new DHCPPacket();
  request.read(requestdata);
  if (request.getOption((byte)53)[0] == Constants.DHCPDISCOVER)   sendOffer(request);
}
Program: 44376
Project: 44376
Buggy source:
protected Dollars charge(int usage,Date start,Date end){
  Dollars result=calculateSummerWinterRate(usage,start,end);
  result=result.plus(result.times(TAX_RATE));
  return result.plus(new Dollars(usage * FUEL).times(1 + TAX_RATE)).round(2);
}

Fixed version (ground truth):
protected Dollars charge(int usage,Date start,Date end){
  Dollars result=calculateSummerWinterRate(usage,start,end);
  result.times(1 + TAX_RATE);
  result.plus(new Dollars(usage * FUEL).times(1 + TAX_RATE));
  result.round(2);
  return result;
}
Program: 44377
Project: 44377
Buggy source:
@Test public void ResidentialSite4000WholeYear() throws NoReadingsException {
  Zone zoneB=new Zone("String_Node_Str",0.07,0.06,new Date(1997,6,5),new Date(1997,8,31));
  ResidentialSite subject=new ResidentialSite(zoneB);
  subject.addReading(new Reading(1000,new Date(1997,1,1)));
  subject.addReading(new Reading(5000,new Date(1997,12,31)));
  assertEquals(new Dollars(713.5).getAmount(),subject.charge().getAmount());
}

Fixed version (ground truth):
@Test public void ResidentialSite4000WholeYear() throws NoReadingsException {
  Zone zoneB=new Zone("String_Node_Str",0.07,0.06,new Date(1997,6,5),new Date(1997,8,31));
  ResidentialSite subject=new ResidentialSite(zoneB);
  subject.addReading(new Reading(1000,new Date(1997,1,1)));
  subject.addReading(new Reading(5000,new Date(1997,12,31)));
  assertEquals(new Dollars(6793.5).getAmount(),subject.charge().getAmount());
}
Program: 44378
Project: 44378
Buggy source:
@Test public void ResidentialSite199Summer() throws NoReadingsException {
  Zone zoneA=new Zone("String_Node_Str",0.06,0.07,new Date(1997,5,15),new Date(1997,9,10));
  ResidentialSite subject=new ResidentialSite(zoneA);
  subject.addReading(new Reading(300,new Date(1997,6,15)));
  subject.addReading(new Reading(499,new Date(1997,31,8)));
  assertEquals(new Dollars(4.32).getAmount(),subject.charge().getAmount());
}

Fixed version (ground truth):
@Test public void ResidentialSite199Summer() throws NoReadingsException {
  Zone zoneA=new Zone("String_Node_Str",0.06,0.07,new Date(1997,5,15),new Date(1997,9,10));
  ResidentialSite subject=new ResidentialSite(zoneA);
  subject.addReading(new Reading(300,new Date(1997,6,15)));
  subject.addReading(new Reading(499,new Date(1997,31,8)));
  assertEquals(new Dollars(10.7).getAmount(),subject.charge().getAmount());
}
Program: 44379
Project: 44379
Buggy source:
@Override public void onAsyncFacilityQueryCompleted(List<Facility> result){
  MyLog.i(TAG,"String_Node_Str" + result.size());
  final List<Overlay> overlays=mapView.getOverlays();
  overlays.clear();
  if (result.size() == 0) {
    MyLog.d(TAG,"String_Node_Str");
    overlays.add(locationOverlay);
  }
 else {
    overlays.add(new FaciltiesOverlayBuilder(drawableCache).buildOverlay(result,this));
    overlays.add(locationOverlay);
    if (state.routeInformation != null) {
      overlays.add(routeOverlayManager.getOrRestoreOverlay(state.routeInformation));
    }
  }
  MyLog.d(TAG,"String_Node_Str");
  mapView.invalidate();
  getSherlock().setProgressBarIndeterminateVisibility(false);
}

Fixed version (ground truth):
@Override public void onAsyncFacilityQueryCompleted(List<Facility> result){
  MyLog.i(TAG,"String_Node_Str" + result.size());
  final List<Overlay> overlays=mapView.getOverlays();
  overlays.clear();
  if (result.size() > 0) {
    overlays.add(new FaciltiesOverlayBuilder(drawableCache).buildOverlay(result,this));
  }
  overlays.add(locationOverlay);
  if (state.routeInformation != null) {
    overlays.add(routeOverlayManager.getOrRestoreOverlay(state.routeInformation));
  }
  MyLog.d(TAG,"String_Node_Str");
  mapView.invalidate();
  getSherlock().setProgressBarIndeterminateVisibility(false);
}
Program: 44380
Project: 44380
Buggy source:
/** 
 * Called when the activity is first created. 
 */
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_filter);
  receivedFilters=getIntent().getStringArrayExtra(INPUT_FILTER_ARRAY);
  currentDistance=getIntent().getIntExtra(INPUT_DISTANCE,DEFAULT_DISTANCE_IN_KILOMETERS);
  setListAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_multiple_choice,FilterManager.availableFilters));
  getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
  checkInputFilters();
  distanceSeekBar=(SeekBar)findViewById(R.id.distance_seekbar);
  distanceTextView=(TextView)findViewById(R.id.distance_textview);
  distanceSeekBar.setMax(MAX_DISTANCE_IN_KILOMETERS);
  distanceSeekBar.setOnSeekBarChangeListener(listener);
  updateUI();
}

Fixed version (ground truth):
/** 
 * Called when the activity is first created. 
 */
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_filter);
  receivedFilters=getIntent().getStringArrayExtra(INPUT_FILTER_ARRAY);
  currentDistance=getIntent().getIntExtra(INPUT_DISTANCE,DEFAULT_DISTANCE_IN_KILOMETERS);
  setListAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_multiple_choice,FilterManager.availableFilters));
  getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
  checkInputFilters();
  distanceSeekBar=(SeekBar)findViewById(R.id.distance_seekbar);
  distanceTextView=(TextView)findViewById(R.id.distance_textview);
  distanceSeekBar.setMax(MAX_DISTANCE_IN_KILOMETERS - 1);
  distanceSeekBar.setOnSeekBarChangeListener(listener);
  updateUI();
}
Program: 44381
Project: 44381
Buggy source:
public void onProgressChanged(SeekBar seekBar,int progress,boolean fromUser){
  currentDistance=seekBar.getProgress();
  updateUI();
}

Fixed version (ground truth):
public void onProgressChanged(SeekBar seekBar,int progress,boolean fromUser){
  currentDistance=seekBar.getProgress() + 1;
  updateUI();
}
Program: 44382
Project: 44382
Buggy source:
private void updateUI(){
  distanceSeekBar.setProgress(currentDistance);
  distanceTextView.setText(currentDistance + "String_Node_Str");
}

Fixed version (ground truth):
private void updateUI(){
  distanceSeekBar.setProgress(currentDistance - 1);
  distanceTextView.setText(currentDistance + "String_Node_Str");
}
Program: 44383
Project: 44383
Buggy source:
private void openFilterOptions(){
  final Intent intent=new Intent(this,ActivityFilter.class);
  intent.putExtra(ActivityFilter.INPUT_FILTER_ARRAY,filters);
  intent.putExtra(ActivityFilter.INPUT_DISTANCE,currentDistanceInKilometers);
  startActivityForResult(intent,ActivityFilter.FILTER_REQUEST_CODE);
}

Fixed version (ground truth):
private void openFilterOptions(){
  final Intent intent=new Intent(this,ActivityFilter.class);
  intent.putExtra(ActivityFilter.INPUT_FILTER_ARRAY,state.filters);
  intent.putExtra(ActivityFilter.INPUT_DISTANCE,currentDistanceInKilometers);
  startActivityForResult(intent,ActivityFilter.FILTER_REQUEST_CODE);
}
Program: 44384
Project: 44384
Buggy source:
private void setFilters(Intent intent){
  currentDistanceInKilometers=intent.getIntExtra(ActivityFilter.RESULT_DISTANCE,ActivityFilter.DEFAULT_DISTANCE_IN_KILOMETERS);
  filters=intent.getStringArrayExtra(ActivityFilter.RESULT_FILTER_ARRAY);
  ;
  Log.d(TAG,"String_Node_Str" + currentDistanceInKilometers + "String_Node_Str"+ Arrays.toString(filters));
}

Fixed version (ground truth):
private void setFilters(Intent intent){
  currentDistanceInKilometers=intent.getIntExtra(ActivityFilter.RESULT_DISTANCE,ActivityFilter.DEFAULT_DISTANCE_IN_KILOMETERS);
  state.filters=intent.getStringArrayExtra(ActivityFilter.RESULT_FILTER_ARRAY);
  Log.d(TAG,"String_Node_Str" + currentDistanceInKilometers + "String_Node_Str"+ Arrays.toString(state.filters));
}