nus-yam/ex-repair huggingface dataset:
Program: 81095
Project: 81095
Buggy source:
/** 
 * Displays a window clearly indicating something has gone wrong. This should be used only when the program encounters an error that impedes its function, not for notifications to the user.
 * @param windowTitle The title of the window (displayed on the taskbar)
 * @param title The title of the error message
 * @param message The error message to display to the user
 * @param t The error to display
 */
public static void showErrorWindow(String windowTitle,String title,String message,Throwable t){
  if (commandLine) {
    System.out.println(windowTitle + "String_Node_Str" + title+ "String_Node_Str"+ message);
    if (t != null) {
      t.printStackTrace();
    }
    return;
  }
  if (errorWindowCount > 10) {
    System.out.println("String_Node_Str");
    return;
  }
  errorWindow=new ErrorWindow();
  errorWindow.setTitle(windowTitle);
  errorWindow.JLTitle.setText(title);
  errorWindow.JTAError.setText(message);
  errorWindow.setVisible(true);
  if (t != null) {
    errorWindow.JBError.setEnabled(true);
    errorWindow.myError=t;
    t.printStackTrace();
  }
  errorWindowCount++;
}

Fixed version (ground truth):
/** 
 * Displays a window clearly indicating something has gone wrong. This should be used only when the program encounters an error that impedes its function, not for notifications to the user.
 * @param windowTitle The title of the window (displayed on the taskbar)
 * @param title The title of the error message
 * @param message The error message to display to the user
 * @param t The error to display
 */
public static synchronized ErrorWindow showErrorWindow(String windowTitle,String title,String message,Throwable t){
  ErrorWindow errorWindow;
  if (commandLine) {
    System.out.println(windowTitle + "String_Node_Str" + title+ "String_Node_Str"+ message);
    if (t != null) {
      t.printStackTrace();
    }
    return null;
  }
  if (errorWindowCount > 10) {
    System.out.println("String_Node_Str");
    return null;
  }
  errorWindow=new ErrorWindow();
  errorWindow.setTitleText(windowTitle);
  errorWindow.setErrorText(title);
  errorWindow.setInformationText(message);
  errorWindow.setVisible(true);
  if (t != null) {
    errorWindow.setExtraButtonEnabled(true);
    errorWindow.myError=t;
    t.printStackTrace();
  }
  errorWindowCount++;
  return errorWindow;
}
Program: 81096
Project: 81096
Buggy source:
public static void setCommandLine(boolean cl){
  commandLine=cl;
  System.out.println("String_Node_Str" + cl);
}

Fixed version (ground truth):
public static synchronized void setCommandLine(boolean cl){
  commandLine=cl;
  System.out.println("String_Node_Str" + cl);
}
Program: 81097
Project: 81097
Buggy source:
/** 
 * Shows the error information of t. It outputs all the information into an   {@link Error} window. This should only be accessible from a currentlyopen  {@link Error}.
 * @param t The error object
 */
public static void detailedReport(Throwable t){
  if (commandLine) {
    t.printStackTrace();
    return;
  }
  errorWindow=new ErrorWindow();
  errorWindow.setTitle("String_Node_Str");
  errorWindow.JLTitle.setText("String_Node_Str");
  errorWindow.JTAError.setLineWrap(false);
  errorWindow.setCopyClipboard();
  errorWindow.JBError.setText("String_Node_Str");
  errorWindow.JBError.setEnabled(true);
  String message=t.toString() + "String_Node_Str";
  StackTraceElement[] eE=t.getStackTrace();
  for (int a=0; a < eE.length; a++) {
    message+="String_Node_Str";
    message+=eE[a];
    message+="String_Node_Str";
  }
  errorWindow.JTAError.setText(message);
  errorWindow.JTAError.setCaretPosition(0);
  errorWindow.setVisible(true);
  errorWindowCount++;
  System.out.println(t.getMessage());
  t.printStackTrace();
}

Fixed version (ground truth):
/** 
 * Shows the error information of t. It outputs all the information into an   {@link Error} window. This should only be accessible from a currentlyopen  {@link Error}.
 * @param t The error object
 */
public static synchronized ErrorWindow detailedReport(Throwable t){
  ErrorWindow errorWindow;
  if (commandLine) {
    t.printStackTrace();
    return null;
  }
  errorWindow=new ErrorWindow();
  errorWindow.setTitleText("String_Node_Str");
  errorWindow.setErrorText("String_Node_Str");
  errorWindow.setLineWrap(false);
  errorWindow.setCopyClipboard();
  errorWindow.setExtraButtonText("String_Node_Str");
  errorWindow.setExtraButtonEnabled(true);
  String message=t.toString() + "String_Node_Str";
  StackTraceElement[] eE=t.getStackTrace();
  for (int a=0; a < eE.length; a++) {
    message+="String_Node_Str";
    message+=eE[a];
    message+="String_Node_Str";
  }
  errorWindow.setInformationText(message);
  errorWindow.setVisible(true);
  errorWindowCount++;
  System.out.println(t.getMessage());
  t.printStackTrace();
  return errorWindow;
}
Program: 81098
Project: 81098
Buggy source:
/** 
 * Unused.
 */
public static void errWindowClosed(){
}

Fixed version (ground truth):
/** 
 * Unused.
 */
public static synchronized void errWindowClosed(){
  errorWindowCount--;
}
Program: 81099
Project: 81099
Buggy source:
public static void fatalError(){
  fatalError=true;
  if (UpdateHandler.update != null) {
    UpdateHandler.update.dispose();
  }
}

Fixed version (ground truth):
public static void fatalError(){
  System.out.println("String_Node_Str");
}
Program: 81101
Project: 81101
Buggy source:
/** 
 * Finds the link of the Register Now button on the PAX website. This scans EVENT.paxsite.com/registration for the Register Now button link, and returns the ENTIRE line, HTML and all.
 * @return The line (HTML included) that the Register Now button link is on
 * @see #parseHRef(java.lang.String)
 */
public static String getCurrentButtonLinkLine(){
  URL url;
  InputStream is=null;
  BufferedReader br;
  String line;
  try {
    url=new URL(websiteLink + "String_Node_Str");
    HttpURLConnection httpCon1=(HttpURLConnection)url.openConnection();
    httpCon1.addRequestProperty("String_Node_Str","String_Node_Str");
    is=httpCon1.getInputStream();
    br=new BufferedReader(new InputStreamReader(is));
    while ((line=br.readLine()) != null) {
      DataTracker.addDataUsed(line.length());
      line=line.trim();
      if (line.contains("String_Node_Str") && line.contains("String_Node_Str")) {
        return line;
      }
    }
  }
 catch (  UnknownHostException|MalformedURLException uhe) {
    return "String_Node_Str";
  }
catch (  IOException ioe) {
    return "String_Node_Str";
  }
catch (  Exception e) {
    ErrorHandler.showErrorWindow("String_Node_Str","String_Node_Str",e);
    System.out.println("String_Node_Str");
    return null;
  }
 finally {
    try {
      if (is != null) {
        is.close();
      }
    }
 catch (    IOException ioe) {
      System.out.println("String_Node_Str");
      ioe.printStackTrace();
    }
  }
  System.out.println("String_Node_Str");
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Finds the link of the Register Now button on the PAX website. This scans EVENT.paxsite.com/registration for the Register Now button link, and returns the ENTIRE line, HTML and all.
 * @return The line (HTML included) that the Register Now button link is on
 * @see #parseHRef(java.lang.String)
 */
public static String getCurrentButtonLinkLine(){
  URL url;
  InputStream is=null;
  BufferedReader br;
  String line;
  try {
    url=new URL(websiteLink + "String_Node_Str");
    HttpURLConnection httpCon1=(HttpURLConnection)url.openConnection();
    httpCon1.addRequestProperty("String_Node_Str","String_Node_Str");
    httpCon1.setConnectTimeout(Math.min(Checker.getRefreshTime() * 1000,10000));
    is=httpCon1.getInputStream();
    br=new BufferedReader(new InputStreamReader(is));
    while ((line=br.readLine()) != null) {
      DataTracker.addDataUsed(line.length());
      line=line.trim();
      if (line.contains("String_Node_Str") && line.contains("String_Node_Str")) {
        return line;
      }
    }
  }
 catch (  UnknownHostException|MalformedURLException uhe) {
    return "String_Node_Str";
  }
catch (  IOException ioe) {
    return "String_Node_Str";
  }
catch (  Exception e) {
    ErrorHandler.showErrorWindow("String_Node_Str","String_Node_Str",e);
    System.out.println("String_Node_Str");
    return null;
  }
 finally {
    try {
      if (is != null) {
        is.close();
      }
    }
 catch (    IOException ioe) {
      System.out.println("String_Node_Str");
      ioe.printStackTrace();
    }
  }
  return "String_Node_Str";
}
Program: 81102
Project: 81102
Buggy source:
/** 
 * Gets the latest Showclix ID for a specific PAX event. This uses the Showclix API to find all of the events listed under a specific seller. In this case, each PAX event (Prime, East, etc) has a separate Showclix seller account associated with it. This uses the fact that every new Showclix event has a larger ID than before, and simply returns the largest Event ID for the specific expo given.
 * @param expo The expo to check
 * @return The most recent Showclix ID
 */
public static int getLatestShowclixID(String expo){
  try {
    URL url=new URL(getShowclixAPILink(expo));
    HttpURLConnection httpCon=(HttpURLConnection)url.openConnection();
    httpCon.addRequestProperty("String_Node_Str","String_Node_Str");
    BufferedReader reader=new BufferedReader(new InputStreamReader(httpCon.getInputStream()));
    String jsonText="String_Node_Str";
    String line;
    while ((line=reader.readLine()) != null) {
      DataTracker.addDataUsed(line.length());
      jsonText+=line;
    }
    reader.close();
    JSONParser mP=new JSONParser();
    JSONObject obj=(JSONObject)mP.parse(jsonText);
    int maxId=0;
    for (    String s : (Iterable<String>)obj.keySet()) {
      maxId=Math.max(maxId,Integer.parseInt((String)s));
    }
    return maxId;
  }
 catch (  Exception e) {
    e.printStackTrace();
    return -1;
  }
}

Fixed version (ground truth):
/** 
 * Gets the latest Showclix ID for a specific PAX event. This uses the Showclix API to find all of the events listed under a specific seller. In this case, each PAX event (Prime, East, etc) has a separate Showclix seller account associated with it. This uses the fact that every new Showclix event has a larger ID than before, and simply returns the largest Event ID for the specific expo given.
 * @param expo The expo to check
 * @return The most recent Showclix ID
 */
public static int getLatestShowclixID(String expo){
  try {
    URL url=new URL(getShowclixAPILink(expo));
    HttpURLConnection httpCon=(HttpURLConnection)url.openConnection();
    httpCon.addRequestProperty("String_Node_Str","String_Node_Str");
    httpCon.setConnectTimeout(Math.min(Checker.getRefreshTime() * 1000,10000));
    BufferedReader reader=new BufferedReader(new InputStreamReader(httpCon.getInputStream()));
    String jsonText="String_Node_Str";
    String line;
    while ((line=reader.readLine()) != null) {
      DataTracker.addDataUsed(line.length());
      jsonText+=line;
    }
    reader.close();
    JSONParser mP=new JSONParser();
    JSONObject obj=(JSONObject)mP.parse(jsonText);
    int maxId=0;
    for (    String s : (Iterable<String>)obj.keySet()) {
      maxId=Math.max(maxId,Integer.parseInt((String)s));
    }
    return maxId;
  }
 catch (  Exception e) {
    e.printStackTrace();
    return -1;
  }
}
Program: 81104
Project: 81104
Buggy source:
/** 
 * Initialize the class Sets the lastStatusID to the latest tweet. The assumption is that tickets aren't already on sale. In case of false alarms (instances where the twitter uses one of the keywords, but tickets aren't on sale yet), after restarting the app it will not trigger on that tweet.
 */
public static void init(){
  if (consumerKey == null) {
    System.out.println("String_Node_Str");
    return;
  }
  ConfigurationBuilder cb=new ConfigurationBuilder();
  try {
    cb.setDebugEnabled(true).setOAuthConsumerKey(Encryption.decrypt(consumerKey)).setOAuthConsumerSecret(Encryption.decrypt(consumerSecret)).setOAuthAccessToken(Encryption.decrypt(accessToken)).setOAuthAccessTokenSecret(Encryption.decrypt(accessSecret));
  }
 catch (  GeneralSecurityException|IOException generalSecurityException) {
  }
  TwitterFactory tf=new TwitterFactory(cb.build());
  twitter=tf.getInstance();
  try {
    List<Status> statuses=twitter.getUserTimeline(TWITTERHANDLE);
    officialPAXTwitterID=statuses.get(0).getUser().getId();
  }
 catch (  Exception ex) {
    System.out.println("String_Node_Str");
  }
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Initialize the class Sets the lastStatusID to the latest tweet. The assumption is that tickets aren't already on sale. In case of false alarms (instances where the twitter uses one of the keywords, but tickets aren't on sale yet), after restarting the app it will not trigger on that tweet.
 */
public static void init(){
  if (consumerKey == null || consumerSecret == null || accessToken == null || accessSecret == null) {
    System.out.println("String_Node_Str");
    return;
  }
  ConfigurationBuilder cb=new ConfigurationBuilder();
  try {
    cb.setDebugEnabled(true).setOAuthConsumerKey(Encryption.decrypt(consumerKey)).setOAuthConsumerSecret(Encryption.decrypt(consumerSecret)).setOAuthAccessToken(Encryption.decrypt(accessToken)).setOAuthAccessTokenSecret(Encryption.decrypt(accessSecret));
  }
 catch (  GeneralSecurityException|IOException generalSecurityException) {
  }
  TwitterFactory tf=new TwitterFactory(cb.build());
  twitter=tf.getInstance();
  try {
    List<Status> statuses=twitter.getUserTimeline(TWITTERHANDLE);
    officialPAXTwitterID=statuses.get(0).getUser().getId();
  }
 catch (  Exception ex) {
    System.out.println("String_Node_Str");
  }
  System.out.println("String_Node_Str");
}
Program: 81105
Project: 81105
Buggy source:
public static void setKeys(String CK,String CS,String AT,String AS){
  try {
    consumerKey=Encryption.encrypt(CK);
    consumerSecret=Encryption.encrypt(CS);
    accessToken=Encryption.encrypt(AT);
    accessSecret=Encryption.encrypt(AS);
  }
 catch (  GeneralSecurityException|UnsupportedEncodingException generalSecurityException) {
  }
}

Fixed version (ground truth):
public static void setKeys(String CK,String CS,String AT,String AS){
  if (CK == null || CS == null || AT == null || AS == null) {
    return;
  }
  try {
    consumerKey=Encryption.encrypt(CK);
    consumerSecret=Encryption.encrypt(CS);
    accessToken=Encryption.encrypt(AT);
    accessSecret=Encryption.encrypt(AS);
  }
 catch (  GeneralSecurityException|UnsupportedEncodingException generalSecurityException) {
  }
}
Program: 81106
Project: 81106
Buggy source:
/** 
 * Opens the URL given in the computer's default browser. Note that this will NOT work if the desktop environment isn't supported (generally a non-issue). Also note that this will simply open the URL -- it will not parse through it to make sure it is valid!
 * @param url The URL to open in the computer's default browser
 */
public static void openLinkInBrowser(URL url){
  Desktop desktop=Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;
  if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) {
    try {
      desktop.browse(url.toURI());
    }
 catch (    Exception e) {
      ErrorHandler.showErrorWindow("String_Node_Str","String_Node_Str",e);
    }
  }
 else {
    System.out.println("String_Node_Str");
    ErrorHandler.showErrorWindow("String_Node_Str","String_Node_Str",null);
  }
}

Fixed version (ground truth):
/** 
 * Opens the URL given in the computer's default browser. Note that this will NOT work if the desktop environment isn't supported (generally a non-issue). Also note that this will simply open the URL -- it will not parse through it to make sure it is valid!
 * @param url The URL to open in the computer's default browser
 */
public static void openLinkInBrowser(URL url){
  if (url == null) {
    ErrorHandler.showErrorWindow("String_Node_Str","String_Node_Str",null);
    return;
  }
  Desktop desktop=Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;
  if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) {
    try {
      desktop.browse(url.toURI());
    }
 catch (    URISyntaxException|IOException e) {
      ErrorHandler.showErrorWindow("String_Node_Str","String_Node_Str",e);
    }
  }
 else {
    ErrorHandler.showErrorWindow("String_Node_Str","String_Node_Str",null);
  }
}
Program: 81110
Project: 81110
Buggy source:
/** 
 * @param args the command line arguments
 */
public static void main(String[] args){
  System.out.println("String_Node_Str");
  javax.swing.ToolTipManager.sharedInstance().setDismissDelay(600000);
  Email.init();
  KeyboardHandler.init();
  System.out.println("String_Node_Str");
  UpdateHandler.loadVersionNotes();
  startProgram(args);
}

Fixed version (ground truth):
/** 
 * @param args the command line arguments
 */
public static void main(String[] args){
  System.out.println("String_Node_Str");
  javax.swing.ToolTipManager.sharedInstance().setDismissDelay(600000);
  Email.init();
  KeyboardHandler.init();
  startProgram(args);
}
Program: 81112
Project: 81112
Buggy source:
/** 
 * Checks whether or not an update to the program is available. Note that this compares the file sizes between the current file and the file on the Dropbox server. This means that if ANY modification is made to the JAR file, it's likely to trigger an update. This THEORETICALLY works well. We'll find out whether or not it will actually work in practice.
 * @return True if an update is available, false if not.
 */
public static boolean updateAvailable(){
  try {
    if (getUpdateLevel() == -1) {
      ErrorHandler.showErrorWindow("String_Node_Str","String_Node_Str",null);
      return false;
    }
 else     if (getUpdateLevel() == 0) {
      System.out.println("String_Node_Str");
      return false;
    }
    URL updateURL;
    if (getUpdateLevel() == 1) {
      if (!SettingsHandler.getUseBetaVersion()) {
        System.out.println("String_Node_Str");
        return false;
      }
      updateURL=new URL(BETA_UPDATE_LINK);
    }
 else {
      updateURL=new URL(UPDATE_LINK);
    }
    URLConnection conn=updateURL.openConnection();
    updateSize=conn.getContentLengthLong();
    System.out.println("String_Node_Str" + updateSize);
    if (updateSize == -1) {
      ErrorHandler.showErrorWindow("String_Node_Str","String_Node_Str",null);
      return false;
    }
    return true;
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str");
    ErrorHandler.showErrorWindow("String_Node_Str","String_Node_Str",e);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks whether or not an update to the program is available. Note that this compares the file sizes between the current file and the file on the Dropbox server. This means that if ANY modification is made to the JAR file, it's likely to trigger an update. This THEORETICALLY works well. We'll find out whether or not it will actually work in practice.
 * @return True if an update is available, false if not.
 */
public static boolean updateAvailable(){
  try {
    if (getUpdateLevel() == -1) {
      ErrorHandler.showErrorWindow("String_Node_Str","String_Node_Str",null);
      return false;
    }
 else     if (getUpdateLevel() == 0) {
      System.out.println("String_Node_Str");
      return false;
    }
 else     if (getUpdateLevel() == 4) {
      ErrorHandler.showErrorWindow("String_Node_Str","String_Node_Str",null);
      return false;
    }
    URL updateURL;
    if (getUpdateLevel() == 1) {
      if (!SettingsHandler.getUseBetaVersion()) {
        System.out.println("String_Node_Str");
        return false;
      }
      updateURL=new URL(BETA_UPDATE_LINK);
    }
 else {
      updateURL=new URL(UPDATE_LINK);
    }
    URLConnection conn=updateURL.openConnection();
    updateSize=conn.getContentLengthLong();
    System.out.println("String_Node_Str" + updateSize);
    if (updateSize == -1) {
      ErrorHandler.showErrorWindow("String_Node_Str","String_Node_Str",null);
      return false;
    }
    return true;
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str");
    ErrorHandler.showErrorWindow("String_Node_Str","String_Node_Str",e);
  }
  return false;
}
Program: 81113
Project: 81113
Buggy source:
public void setEmailAddress(String address){
  if (address == null) {
    System.out.println("String_Node_Str");
    return;
  }
 else   if (address.length() < 5) {
    System.out.println("String_Node_Str");
    return;
  }
 else   if (!address.contains("String_Node_Str")) {
    System.out.println("String_Node_Str" + address + "String_Node_Str");
    address+="String_Node_Str";
  }
  System.out.println("String_Node_Str" + address);
  address=address.trim();
  String temp=address.substring(0,address.indexOf("String_Node_Str"));
  temp=temp.replace("String_Node_Str","String_Node_Str");
  temp=temp.replace("String_Node_Str","String_Node_Str");
  temp=temp.replace("String_Node_Str","String_Node_Str");
  address=temp + address.substring(address.indexOf("String_Node_Str"));
  System.out.println("String_Node_Str" + address);
  completeAddress=address;
}

Fixed version (ground truth):
public void setEmailAddress(String address){
  if (address == null) {
    System.out.println("String_Node_Str");
    return;
  }
 else   if (address.length() < 5) {
    System.out.println("String_Node_Str");
    return;
  }
 else   if (!address.contains("String_Node_Str")) {
    System.out.println("String_Node_Str" + address + "String_Node_Str");
    address+=getCarrierExtension("String_Node_Str");
  }
  System.out.println("String_Node_Str" + address);
  address=address.trim();
  String temp=address.substring(0,address.indexOf("String_Node_Str"));
  temp=temp.replace("String_Node_Str","String_Node_Str");
  temp=temp.replace("String_Node_Str","String_Node_Str");
  temp=temp.replace("String_Node_Str","String_Node_Str");
  address=temp + address.substring(address.indexOf("String_Node_Str"));
  System.out.println("String_Node_Str" + address);
  completeAddress=address;
}
Program: 81118
Project: 81118
Buggy source:
/** 
 * Sets the   {@link #props} settings for the the current email address being used. Call every time the email provider (Yahoo, GMail) changes.
 */
public static void emailSettings(){
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str",port);
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Sets the   {@link #props} settings for the the current email address being used. Call every time the email provider (Yahoo, GMail) changes.
 */
public static void emailSettings(){
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str",port);
}
Program: 81119
Project: 81119
Buggy source:
public static void setHost(String h){
  host=h;
}

Fixed version (ground truth):
public static void setHost(String h){
  host=h;
  props.put("String_Node_Str",h);
}
Program: 81121
Project: 81121
Buggy source:
/** 
 * Starts a new non-daemon Thread that checks the websites for updates. This Thread also updates the Status GUI.
 */
public static void startCheckingWebsites(){
  PAXChecker.continueProgram(new Runnable(){
    @Override public void run(){
      SettingsHandler.saveAllPrefs();
      if (!Browser.checkShowclixLink(SettingsHandler.getLastEvent())) {
        SettingsHandler.saveLastEvent(Browser.getShowclixLink());
        System.out.println("String_Node_Str");
      }
      status=new Status();
      setStatusIconInBackground(getIconName(Browser.getExpo()));
      long startMS;
      int seconds=getRefreshTime();
      do {
        startMS=System.currentTimeMillis();
        if (Browser.isShowclixUpdated() || Browser.isPAXWebsiteUpdated()) {
          final String link=Browser.parseHRef(Browser.getCurrentButtonLinkLine());
          linkFound(link);
          break;
        }
        status.setDataUsageText(DataTracker.getDataUsedMB());
        while (System.currentTimeMillis() - startMS < (seconds * 1000)) {
          if (forceRefresh) {
            forceRefresh=false;
            break;
          }
          try {
            Thread.sleep(100);
          }
 catch (          InterruptedException interruptedException) {
          }
          status.setLastCheckedText(seconds - (int)((System.currentTimeMillis() - startMS) / 1000));
        }
      }
 while (status.isDisplayable());
      System.out.println("String_Node_Str");
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Starts a new non-daemon Thread that checks the websites for updates. This Thread also updates the Status GUI.
 */
public static void startCheckingWebsites(){
  PAXChecker.continueProgram(new Runnable(){
    @Override public void run(){
      SettingsHandler.saveAllPrefs();
      if (!Browser.checkShowclixLink(SettingsHandler.getLastEvent())) {
        SettingsHandler.saveLastEvent(Browser.getShowclixLink());
        System.out.println("String_Node_Str");
      }
      status=new Status();
      setStatusIconInBackground(getIconName(Browser.getExpo()));
      long startMS;
      int seconds=getRefreshTime();
      do {
        status.setLastCheckedText("String_Node_Str");
        startMS=System.currentTimeMillis();
        if (Browser.isShowclixUpdated() || Browser.isPAXWebsiteUpdated()) {
          final String link=Browser.parseHRef(Browser.getCurrentButtonLinkLine());
          linkFound(link);
          break;
        }
        status.setDataUsageText(DataTracker.getDataUsedMB());
        while (System.currentTimeMillis() - startMS < (seconds * 1000)) {
          if (forceRefresh) {
            forceRefresh=false;
            break;
          }
          try {
            Thread.sleep(100);
          }
 catch (          InterruptedException interruptedException) {
          }
          status.setLastCheckedText(seconds - (int)((System.currentTimeMillis() - startMS) / 1000));
        }
      }
 while (status.isDisplayable());
      System.out.println("String_Node_Str");
    }
  }
);
}
Program: 81122
Project: 81122
Buggy source:
public static void setStatusShowclixLink(String s){
  if (status != null) {
    status.setShowclixLink("String_Node_Str");
  }
}

Fixed version (ground truth):
public static void setStatusShowclixLink(String s){
  if (status != null) {
    status.setShowclixLink(s);
  }
}
Program: 81123
Project: 81123
Buggy source:
/** 
 * Returns the expo currently set. This generally adheres to the format of "PAX [expo]" or just "[expo]".
 * @return The expo currently set
 * @see #setExpo(java.lang.String)
 */
public static String getExpo(){
  return Expo;
}

Fixed version (ground truth):
/** 
 * Returns the expo currently set. This should adhere to the format of "PAX [expo]" or just "[expo]".
 * @return The expo currently set
 * @see #setExpo(java.lang.String)
 */
public static String getExpo(){
  return Expo;
}
Program: 81124
Project: 81124
Buggy source:
/** 
 * Initializes the Browser class. This should be run before any other method is run in the Browser.
 */
public static void init(){
  try {
    updateURL=new URL(UDATE_LINK);
    patchNotesURL=new URL(PATCH_NOTES_LINK);
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str");
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Initializes the Browser class. This should be run before any other method is run in the Browser.
 */
public static void init(){
  try {
    updateURL=new URL(UDATE_LINK);
    patchNotesURL=new URL(PATCH_NOTES_LINK);
  }
 catch (  MalformedURLException e) {
    System.out.println("String_Node_Str");
    e.printStackTrace();
  }
}
Program: 81126
Project: 81126
Buggy source:
/** 
 * Checks whether the program should send an email. If the username OR the email to send to is null (no valid address/number was given), it returns false. If both are valid, it returns true.
 * @return True if should send email, false if not.
 */
public static boolean shouldSendEmail(){
  return getUsername() != null && !getUsername().equals("String_Node_Str") && !addressList.isEmpty();
}

Fixed version (ground truth):
/** 
 * Checks whether the program should send an email. If the username OR the email to send to is null (no valid address/number was given), it returns false. If both are valid, it returns true.
 * @return True if should send email, false if not.
 */
public static boolean shouldSendEmail(){
  return getUsername() != null && !getUsername().equals("String_Node_Str") && !getAddressList().isEmpty();
}
Program: 81127
Project: 81127
Buggy source:
/** 
 * Sets the   {@link #props} settings for the the current email address being used. Call every time the email provider (Yahoo, GMail) changes.
 */
public static void emailSettings(){
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str",port);
  props.put("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Sets the   {@link #props} settings for the the current email address being used. Call every time the email provider (Yahoo, GMail) changes.
 */
public static void emailSettings(){
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str",port);
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str","String_Node_Str");
}
Program: 81129
Project: 81129
Buggy source:
/** 
 * Sends a test email to every number put into the program and prints whether it was successful or not to the Status window.
 */
public static void testEmail(){
  if (sendMessage("String_Node_Str","String_Node_Str")) {
    if (PAXChecker.status != null) {
      PAXChecker.status.setButtonStatusText("String_Node_Str");
    }
  }
 else {
    if (PAXChecker.status != null) {
      PAXChecker.status.setButtonStatusText("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Sends a test email to every number put into the program and prints whether it was successful or not to the Status window.
 */
public static boolean testEmail(){
  if (sendMessage("String_Node_Str","String_Node_Str")) {
    if (PAXChecker.status != null) {
      PAXChecker.status.setButtonStatusText("String_Node_Str");
      return true;
    }
  }
 else {
    if (PAXChecker.status != null) {
      PAXChecker.status.setButtonStatusText("String_Node_Str");
    }
  }
  return false;
}
Program: 81130
Project: 81130
Buggy source:
private static boolean canExit(){
  if (errorWindowCount == 0) {
    if (fatalError) {
      return true;
    }
    int validCount=0;
    if (PAXChecker.setup != null) {
      if (!PAXChecker.setup.isVisible()) {
        validCount++;
      }
    }
 else {
      validCount++;
    }
    if (PAXChecker.tickets != null) {
      if (!PAXChecker.tickets.isVisible()) {
        validCount++;
      }
    }
 else {
      validCount++;
    }
    if (PAXChecker.update != null) {
      if (!PAXChecker.update.isVisible()) {
        validCount++;
      }
    }
 else {
      validCount++;
    }
    if (PAXChecker.status != null) {
      if (!PAXChecker.status.isVisible()) {
        validCount++;
      }
    }
 else {
      validCount++;
    }
    if (validCount == 4) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private static boolean canExit(){
  if (errorWindowCount == 0) {
    if (fatalError) {
      return true;
    }
    int validCount=0;
    if (PAXChecker.setup != null) {
      if (!PAXChecker.setup.isVisible()) {
        validCount++;
      }
    }
 else {
      validCount++;
    }
    if (PAXChecker.tickets != null) {
      if (!PAXChecker.tickets.isVisible()) {
        validCount++;
      }
    }
 else {
      validCount++;
    }
    if (PAXChecker.update != null) {
      if (!PAXChecker.update.isVisible()) {
        validCount++;
      }
    }
 else {
      validCount++;
    }
    if (PAXChecker.status != null) {
      if (!PAXChecker.status.isDisplayable()) {
        validCount++;
      }
    }
 else {
      validCount++;
    }
    if (validCount == 4) {
      return true;
    }
  }
  return false;
}
Program: 81131
Project: 81131
Buggy source:
@Override public void run(){
  try {
    status.setTextButtonState(false);
    status.setTextButtonText("String_Node_Str");
    Email.testEmail();
    long timeStarted=System.currentTimeMillis();
    while (System.currentTimeMillis() - timeStarted < 60000) {
      status.setTextButtonText((60 - (int)((System.currentTimeMillis() - timeStarted) / 1000)) + "String_Node_Str");
      Thread.sleep(200);
    }
    status.setTextButtonText("String_Node_Str");
    status.setTextButtonState(true);
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str");
    e.printStackTrace();
    status.setTextButtonText("String_Node_Str");
    status.setTextButtonState(true);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    status.setTextButtonState(false);
    status.setTextButtonText("String_Node_Str");
    if (!Email.testEmail()) {
      status.setTextButtonText("String_Node_Str");
      status.setTextButtonState(true);
      return;
    }
    long timeStarted=System.currentTimeMillis();
    while (System.currentTimeMillis() - timeStarted < 60000) {
      status.setTextButtonText((60 - (int)((System.currentTimeMillis() - timeStarted) / 1000)) + "String_Node_Str");
      Thread.sleep(200);
    }
    status.setTextButtonText("String_Node_Str");
    status.setTextButtonState(true);
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str");
    e.printStackTrace();
    status.setTextButtonText("String_Node_Str");
    status.setTextButtonState(true);
  }
}
Program: 81132
Project: 81132
Buggy source:
public static void sendBackgroundTestEmail(){
  if (status == null) {
    return;
  }
  startBackgroundThread(new Runnable(){
    @Override public void run(){
      try {
        status.setTextButtonState(false);
        status.setTextButtonText("String_Node_Str");
        Email.testEmail();
        long timeStarted=System.currentTimeMillis();
        while (System.currentTimeMillis() - timeStarted < 60000) {
          status.setTextButtonText((60 - (int)((System.currentTimeMillis() - timeStarted) / 1000)) + "String_Node_Str");
          Thread.sleep(200);
        }
        status.setTextButtonText("String_Node_Str");
        status.setTextButtonState(true);
      }
 catch (      Exception e) {
        System.out.println("String_Node_Str");
        e.printStackTrace();
        status.setTextButtonText("String_Node_Str");
        status.setTextButtonState(true);
      }
    }
  }
);
}

Fixed version (ground truth):
public static void sendBackgroundTestEmail(){
  if (status == null) {
    return;
  }
  startBackgroundThread(new Runnable(){
    @Override public void run(){
      try {
        status.setTextButtonState(false);
        status.setTextButtonText("String_Node_Str");
        if (!Email.testEmail()) {
          status.setTextButtonText("String_Node_Str");
          status.setTextButtonState(true);
          return;
        }
        long timeStarted=System.currentTimeMillis();
        while (System.currentTimeMillis() - timeStarted < 60000) {
          status.setTextButtonText((60 - (int)((System.currentTimeMillis() - timeStarted) / 1000)) + "String_Node_Str");
          Thread.sleep(200);
        }
        status.setTextButtonText("String_Node_Str");
        status.setTextButtonState(true);
      }
 catch (      Exception e) {
        System.out.println("String_Node_Str");
        e.printStackTrace();
        status.setTextButtonText("String_Node_Str");
        status.setTextButtonState(true);
      }
    }
  }
);
}
Program: 81133
Project: 81133
Buggy source:
/** 
 * <HTML>Sets   {@link #textEmail} to the specified email address. If no [AT] symbol is in {@link num},  {@link carrier} is used to add the correct carrier email ending to the number. If an invalidcarrier is specified, the method defaults to AT&T.<br> Note that this sets  {@link #emailList} to null.</HTML>
 * @param num
 * @param carrier 
 */
public static void setCellNum(String num,String carrier){
  if (num == null) {
    textEmail=null;
    return;
  }
 else   if (num.length() == 0) {
    textEmail=null;
    return;
  }
  if (!num.contains("String_Node_Str")) {
switch (carrier) {
case "String_Node_Str":
      num+="String_Node_Str";
    break;
case "String_Node_Str":
  num+="String_Node_Str";
break;
case "String_Node_Str":
num+="String_Node_Str";
break;
case "String_Node_Str":
num+="String_Node_Str";
break;
case "String_Node_Str":
num+="String_Node_Str";
break;
default :
System.out.println("String_Node_Str");
setCellNum(num,"String_Node_Str");
return;
}
}
textEmail=num;
System.out.println("String_Node_Str" + textEmail);
emailList=null;
}

Fixed version (ground truth):
/** 
 * <HTML>Sets   {@link #textEmail} to the specified email address. If no [AT] symbol is in {@link num},  {@link carrier} is used to add the correct carrier email ending to the number. If an invalidcarrier is specified, the method defaults to AT&T.<br> Note that this sets  {@link #emailList} to null.</HTML>
 * @param num
 * @param carrier
 */
public static void setCellNum(String num,String carrier){
  if (num == null) {
    textEmail=null;
    return;
  }
 else   if (num.length() == 0) {
    textEmail=null;
    return;
  }
  if (!num.contains("String_Node_Str")) {
    num+=getCarrierExtension(carrier);
  }
  textEmail=num;
  System.out.println("String_Node_Str" + textEmail);
  emailList=null;
}
Program: 81134
Project: 81134
Buggy source:
/** 
 * <HTML>Sets the current email list to the String specified. This parses every email address by splitting the String by ; (semicolons).<br> Example String: 1234567890[AT]mms.att.net;2345678901[AT]vtext.net;3456789012[AT]carr.ier.com><br> Note that [AT] should be one character. Javadocs are fun.<br> Also note that this sets   {@link #textEmail} to null.</HTML>
 * @param parseList
 */
public static void setCellList(String parseList){
  emailList=new ArrayList<String>();
  try {
    String[] parsed=parseList.split("String_Node_Str");
    for (int a=0; a < parsed.length; a++) {
      emailList.add(parsed[a]);
    }
  }
 catch (  Exception e) {
    emailList=null;
    ErrorManagement.showErrorWindow("String_Node_Str","String_Node_Str" + parseList,e);
  }
  textEmail=null;
}

Fixed version (ground truth):
/** 
 * <HTML>Sets the current email list to the String specified. This parses every email address by splitting the String by ; (semicolons).<br> Example String: 1234567890[AT]mms.att.net;2345678901[AT]vtext.net;3456789012[AT]carr.ier.com><br> Note that [AT] should be one character. Javadocs are fun.<br> Also note that this sets   {@link #textEmail} to null.</HTML>
 * @param parseList      The list of numbers to read through
 * @param defaultCarrier The default carrier to email to, if none is specified
 */
public static void setCellList(String parseList,String defaultCarrier){
  emailList=new ArrayList<>();
  try {
    String[] parsed=parseList.split("String_Node_Str");
    for (int a=0; a < parsed.length; a++) {
      parsed[a]=parsed[a].trim();
      if (!parsed[a].contains("String_Node_Str")) {
        parsed[a]+=getCarrierExtension(defaultCarrier);
      }
      emailList.add(parsed[a]);
    }
  }
 catch (  Exception e) {
    emailList=null;
    ErrorManagement.showErrorWindow("String_Node_Str","String_Node_Str" + parseList,e);
  }
  textEmail=null;
}
Program: 81135
Project: 81135
Buggy source:
private static boolean canExit(){
  if ((PAXChecker.setup == null && PAXChecker.status == null && PAXChecker.tickets == null && PAXChecker.update == null) || fatalError) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
private static boolean canExit(){
  if (errorWindowCount == 0) {
    if (fatalError) {
      return true;
    }
    int validCount=0;
    if (PAXChecker.setup != null) {
      if (!PAXChecker.setup.isVisible()) {
        validCount++;
      }
    }
 else {
      validCount++;
    }
    if (PAXChecker.tickets != null) {
      if (!PAXChecker.tickets.isVisible()) {
        validCount++;
      }
    }
 else {
      validCount++;
    }
    if (PAXChecker.update != null) {
      if (!PAXChecker.update.isVisible()) {
        validCount++;
      }
    }
 else {
      validCount++;
    }
    if (PAXChecker.status != null) {
      if (!PAXChecker.status.isVisible()) {
        validCount++;
      }
    }
 else {
      validCount++;
    }
    if (validCount == 4) {
      return true;
    }
  }
  return false;
}
Program: 81136
Project: 81136
Buggy source:
/** 
 * Set the updateProgram flag to true. This will start the program updating process. This should only be called by the Update GUI when the main() method is waiti ng for the prompt.
 */
public static void startUpdatingProgram(){
  updateProgram=true;
}

Fixed version (ground truth):
/** 
 * Set the updateProgram flag to true. This will start the program updating process. This should only be called by the Update GUI when the main() method is waiting for the prompt.
 */
public static void startUpdatingProgram(){
  updateProgram=true;
}
Program: 81137
Project: 81137
Buggy source:
/** 
 * Creates the Tickets window and makes it visible. This should really only be called once, as subsequent calls will rewrite   {@link #status} and lose the object reference to the previouslyopened tickets window.
 */
public static void showTicketsWindow(){
  tickets=new Tickets();
  tickets.setAlwaysOnTop(true);
  try {
    tickets.setIconImage(javax.imageio.ImageIO.read(PAXChecker.class.getResourceAsStream("String_Node_Str")));
    tickets.setBackground(Color.RED);
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str");
    e.printStackTrace();
  }
  tickets.setVisible(true);
  tickets.toFront();
  tickets.requestFocus();
}

Fixed version (ground truth):
/** 
 * Creates the Tickets window and makes it visible. This should really only be called once, as subsequent calls will rewrite   {@link #tickets} and lose the object reference to the previouslyopened tickets window.
 */
public static void showTicketsWindow(){
  tickets=new Tickets();
  tickets.setAlwaysOnTop(true);
  try {
    tickets.setIconImage(javax.imageio.ImageIO.read(PAXChecker.class.getResourceAsStream("String_Node_Str")));
    tickets.setBackground(Color.RED);
  }
 catch (  Exception e) {
    System.out.println("String_Node_Str");
    e.printStackTrace();
  }
  tickets.setVisible(true);
  tickets.toFront();
  tickets.requestFocus();
}
Program: 81139
Project: 81139
Buggy source:
@PUT @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @RolesAllowed(ADMIN) public Catalog modify(Catalog catalog){
  Catalog originalCatalog=entityManager.find(Catalog.class,catalog.getId());
  checkNotNull(originalCatalog);
  if (catalog.getRootCategoriesIds() != null) {
    List<Category> newCategories=new ArrayList<>();
    catalog.getRootCategoriesIds().forEach(categoryId -> newCategories.add(entityManager.find(Category.class,categoryId)));
    catalog.setRootCategories(newCategories);
  }
 else {
    catalog.setRootCategories(originalCatalog.getRootCategories());
  }
  return entityManager.merge(catalog);
}

Fixed version (ground truth):
@PUT @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @RolesAllowed(ADMIN) public Catalog modify(Catalog catalog){
  Catalog originalCatalog=entityManager.find(Catalog.class,catalog.getId());
  checkNotNull(originalCatalog);
  if (catalog.getRootCategoriesIds() != null) {
    List<Category> newCategories=new ArrayList<>();
    catalog.getRootCategoriesIds().forEach(categoryId -> newCategories.add(entityManager.find(Category.class,categoryId)));
    catalog.setRootCategories(newCategories);
  }
 else {
    catalog.setRootCategories(originalCatalog.getRootCategories());
  }
  catalog.setPresentationByLocale(originalCatalog.getPresentationByLocale());
  return entityManager.merge(catalog);
}
Program: 81140
Project: 81140
Buggy source:
@PUT @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @RolesAllowed(JeeshopRoles.ADMIN) public Category modify(Category category){
  Category originalCategory=entityManager.find(Category.class,category.getId());
  checkNotNull(originalCategory);
  if (category.getChildCategoriesIds() != null) {
    List<Category> newCategories=new ArrayList<>();
    category.getChildCategoriesIds().forEach(categoryId -> newCategories.add(entityManager.find(Category.class,categoryId)));
    category.setChildCategories(newCategories);
  }
 else {
    category.setChildCategories(originalCategory.getChildCategories());
  }
  if (category.getChildProductsIds() != null) {
    List<Product> newProducts=new ArrayList<>();
    category.getChildProductsIds().forEach(productId -> newProducts.add(entityManager.find(Product.class,productId)));
    category.setChildProducts(newProducts);
  }
 else {
    category.setChildProducts(originalCategory.getChildProducts());
  }
  return entityManager.merge(category);
}

Fixed version (ground truth):
@PUT @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @RolesAllowed(JeeshopRoles.ADMIN) public Category modify(Category category){
  Category originalCategory=entityManager.find(Category.class,category.getId());
  checkNotNull(originalCategory);
  if (category.getChildCategoriesIds() != null) {
    List<Category> newCategories=new ArrayList<>();
    category.getChildCategoriesIds().forEach(categoryId -> newCategories.add(entityManager.find(Category.class,categoryId)));
    category.setChildCategories(newCategories);
  }
 else {
    category.setChildCategories(originalCategory.getChildCategories());
  }
  if (category.getChildProductsIds() != null) {
    List<Product> newProducts=new ArrayList<>();
    category.getChildProductsIds().forEach(productId -> newProducts.add(entityManager.find(Product.class,productId)));
    category.setChildProducts(newProducts);
  }
 else {
    category.setChildProducts(originalCategory.getChildProducts());
  }
  category.setPresentationByLocale(originalCategory.getPresentationByLocale());
  return entityManager.merge(category);
}
Program: 81141
Project: 81141
Buggy source:
@PUT @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @RolesAllowed(JeeshopRoles.ADMIN) public Product modify(Product product){
  Product originalProduct=entityManager.find(Product.class,product.getId());
  checkNotNull(originalProduct);
  if (product.getChildSKUsIds() != null) {
    List<SKU> newSkus=new ArrayList<>();
    product.getChildSKUsIds().forEach(skuId -> newSkus.add(entityManager.find(SKU.class,skuId)));
    product.setChildSKUs(newSkus);
  }
 else {
    product.setChildSKUs(originalProduct.getChildSKUs());
  }
  if (product.getDiscountsIds() != null) {
    List<Discount> newDiscounts=new ArrayList<>();
    product.getDiscountsIds().forEach(discountId -> newDiscounts.add(entityManager.find(Discount.class,discountId)));
    product.setDiscounts(newDiscounts);
  }
 else {
    product.setDiscounts(originalProduct.getDiscounts());
  }
  return entityManager.merge(product);
}

Fixed version (ground truth):
@PUT @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @RolesAllowed(JeeshopRoles.ADMIN) public Product modify(Product product){
  Product originalProduct=entityManager.find(Product.class,product.getId());
  checkNotNull(originalProduct);
  if (product.getChildSKUsIds() != null) {
    List<SKU> newSkus=new ArrayList<>();
    product.getChildSKUsIds().forEach(skuId -> newSkus.add(entityManager.find(SKU.class,skuId)));
    product.setChildSKUs(newSkus);
  }
 else {
    product.setChildSKUs(originalProduct.getChildSKUs());
  }
  if (product.getDiscountsIds() != null) {
    List<Discount> newDiscounts=new ArrayList<>();
    product.getDiscountsIds().forEach(discountId -> newDiscounts.add(entityManager.find(Discount.class,discountId)));
    product.setDiscounts(newDiscounts);
  }
 else {
    product.setDiscounts(originalProduct.getDiscounts());
  }
  product.setPresentationByLocale(originalProduct.getPresentationByLocale());
  return entityManager.merge(product);
}