nus-yam/ex-repair huggingface dataset:
Program: 21250
Project: 21250
Buggy source:
@Override public void onBufferChanged(Executer exec,DynByteBuffer buffer,int latestNum){
  String lastLine=new String(buffer.getLast(buffer.position() - lastLinePosition));
  if (new Regex(lastLine,Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE)).matches()) {
    exec.writetoOutputStream(this.password);
  }
}

Fixed version (ground truth):
@Override public void onBufferChanged(Executer exec,DynByteBuffer buffer,int latestNum){
  String lastLine=new String(buffer.getLast(buffer.position() - lastLinePosition));
  if (new Regex(lastLine,Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE)).matches()) {
    exec.writetoOutputStream(this.password);
  }
  if (new Regex(lastLine,Pattern.compile("String_Node_Str",Pattern.CASE_INSENSITIVE)).matches()) {
    exec.interrupt();
  }
}
Program: 21251
Project: 21251
Buggy source:
@Override public void handleFree(DownloadLink downloadLink) throws Exception {
  br.setCookiesExclusive(true);
  br.clearCookies(getHost());
  br.getPage(downloadLink.getDownloadURL().replaceFirst("String_Node_Str","String_Node_Str"));
  Regex reg=br.getRegex("String_Node_Str");
  String url=reg.getMatches()[0][0];
  dl=new RAFDownload(this,downloadLink,br.createGetRequest(url));
  dl.startDownload();
}

Fixed version (ground truth):
@Override public void handleFree(DownloadLink downloadLink) throws Exception {
  br.setCookiesExclusive(true);
  br.clearCookies(getHost());
  br.getPage(downloadLink.getDownloadURL().replaceFirst("String_Node_Str","String_Node_Str"));
  Form download=br.getForm(0);
  download.put("String_Node_Str",(Math.random() * 160) + "String_Node_Str");
  download.put("String_Node_Str",(Math.random() * 60) + "String_Node_Str");
  download.put("String_Node_Str",null);
  br.submitForm(download);
  String fnc=br.getRegex("String_Node_Str").getMatch(0);
  String link=new jd.parser.JavaScript(fnc).runJavaScript();
  dl=br.openDownload(downloadLink,link,true,1);
  if (!dl.getConnection().isContentDisposition()) {
    dl.getConnection().disconnect();
    throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE,10 * 60 * 1000l);
  }
  dl.startDownload();
}
Program: 21252
Project: 21252
Buggy source:
@Override public boolean initAddon(){
  if (JDUtilities.getJavaVersion() >= 1.6) {
    try {
      JDUtilities.getController().addControlListener(this);
      if (SimpleGUI.CURRENTGUI != null && SimpleGUI.CURRENTGUI.getFrame() != null) {
        guiFrame=SimpleGUI.CURRENTGUI.getFrame();
        guiFrame.addWindowListener(this);
      }
      logger.info("String_Node_Str");
      initGUI();
    }
 catch (    Exception e) {
      return false;
    }
    return true;
  }
 else {
    logger.severe("String_Node_Str" + JDUtilities.getJavaVersion());
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean initAddon(){
  if (JDUtilities.getJavaVersion() < 1.6) {
    logger.severe("String_Node_Str" + JDUtilities.getJavaVersion());
    return false;
  }
  if (!SystemTray.isSupported()) {
    logger.severe("String_Node_Str");
    return false;
  }
  try {
    JDUtilities.getController().addControlListener(this);
    if (SimpleGUI.CURRENTGUI != null && SimpleGUI.CURRENTGUI.getFrame() != null) {
      guiFrame=SimpleGUI.CURRENTGUI.getFrame();
      guiFrame.addWindowListener(this);
    }
    logger.info("String_Node_Str");
    initGUI();
  }
 catch (  Exception e) {
    return false;
  }
  return true;
}
Program: 21253
Project: 21253
Buggy source:
public boolean initAddon(){
  if (JDUtilities.getJavaVersion() >= 1.6) {
    try {
      JDUtilities.getController().addControlListener(this);
      if (SimpleGUI.CURRENTGUI != null && SimpleGUI.CURRENTGUI.getFrame() != null) {
        guiFrame=SimpleGUI.CURRENTGUI.getFrame();
        guiFrame.addWindowListener(this);
      }
      logger.info("String_Node_Str");
      initGUI();
      return true;
    }
 catch (    Exception e) {
      e.printStackTrace();
      return false;
    }
  }
 else {
    logger.severe("String_Node_Str" + JDUtilities.getJavaVersion());
    return false;
  }
}

Fixed version (ground truth):
public boolean initAddon(){
  if (JDUtilities.getJavaVersion() < 1.6) {
    logger.severe("String_Node_Str" + JDUtilities.getJavaVersion());
    return false;
  }
  if (!SystemTray.isSupported()) {
    logger.severe("String_Node_Str");
    return false;
  }
  try {
    JDUtilities.getController().addControlListener(this);
    if (SimpleGUI.CURRENTGUI != null && SimpleGUI.CURRENTGUI.getFrame() != null) {
      guiFrame=SimpleGUI.CURRENTGUI.getFrame();
      guiFrame.addWindowListener(this);
    }
    logger.info("String_Node_Str");
    initGUI();
    return true;
  }
 catch (  Exception e) {
    e.printStackTrace();
    return false;
  }
}
Program: 21254
Project: 21254
Buggy source:
@Override public ArrayList<DownloadLink> decryptIt(CryptedLink param) throws Exception {
  ArrayList<DownloadLink> decryptedLinks=new ArrayList<DownloadLink>();
  String parameter=param.toString();
  String downloadId;
  String password=null;
  br.setFollowRedirects(false);
  if (new Regex(parameter,PATTEREN_SUPPORTED_MAIN).matches()) {
    String page=br.getPage(parameter);
    String links[]=new Regex(page,PATTERN_DL_LINK_PAGE).getColumn(0);
    for (    String link : links) {
      decryptedLinks.add(createDownloadlink("String_Node_Str" + link));
    }
    return decryptedLinks;
  }
 else   if (new Regex(parameter,PATTERN_SUPPORTED_CRYPT).matches()) {
    downloadId=new Regex(parameter,PATTERN_SUPPORTED_CRYPT).getMatch(0);
    String page=br.getPage("String_Node_Str" + downloadId + "String_Node_Str");
    password=new Regex(page,PATTERN_PASSWORD).getMatch(0);
    page=br.getPage(parameter);
    String links[]=new Regex(page,PATTERN_REDIRECT_LINKS).getColumn(0);
    for (    String link : links) {
      br.getPage(link);
      DownloadLink dlLink=createDownloadlink(br.getRedirectLocation());
      dlLink.addSourcePluginPassword(password);
      decryptedLinks.add(dlLink);
    }
    return decryptedLinks;
  }
 else   if (new Regex(parameter,PATTERN_SUPPORTED_REDIRECT).matches()) {
    String id=new Regex(parameter,PATTERN_SUPPORTED_REDIRECT).getMatch(0);
    decryptedLinks.add(createDownloadlink("String_Node_Str" + id + "String_Node_Str"));
    return decryptedLinks;
  }
  return null;
}

Fixed version (ground truth):
@Override public ArrayList<DownloadLink> decryptIt(CryptedLink param) throws Exception {
  ArrayList<DownloadLink> decryptedLinks=new ArrayList<DownloadLink>();
  String parameter=param.toString();
  String downloadId;
  String password=null;
  br.setFollowRedirects(false);
  if (new Regex(parameter,PATTEREN_SUPPORTED_MAIN).matches()) {
    String page=br.getPage(parameter);
    String links[]=new Regex(page,PATTERN_DL_LINK_PAGE).getColumn(0);
    for (    String link : links) {
      decryptedLinks.add(createDownloadlink("String_Node_Str" + link));
    }
    return decryptedLinks;
  }
 else   if (new Regex(parameter,PATTERN_SUPPORTED_CRYPT).matches()) {
    downloadId=new Regex(parameter,PATTERN_SUPPORTED_CRYPT).getMatch(0);
    String page=br.getPage("String_Node_Str" + downloadId + "String_Node_Str");
    password=new Regex(page,PATTERN_PASSWORD).getMatch(0);
    page=br.getPage(parameter);
    String links[]=new Regex(page,PATTERN_REDIRECT_LINKS).getColumn(0);
    for (    String link : links) {
      br.getPage(link);
      DownloadLink dlLink=createDownloadlink(br.getRedirectLocation());
      dlLink.addSourcePluginPassword(password);
      dlLink.setDecrypterPassword(password);
      decryptedLinks.add(dlLink);
    }
    return decryptedLinks;
  }
 else   if (new Regex(parameter,PATTERN_SUPPORTED_REDIRECT).matches()) {
    String id=new Regex(parameter,PATTERN_SUPPORTED_REDIRECT).getMatch(0);
    decryptedLinks.add(createDownloadlink("String_Node_Str" + id + "String_Node_Str"));
    return decryptedLinks;
  }
  return null;
}
Program: 21255
Project: 21255
Buggy source:
@Override protected void installDefaults(){
  EVEN_ROW_COLOR=JDTheme.C("String_Node_Str","String_Node_Str");
  ODD_ROW_COLOR=JDTheme.C("String_Node_Str","String_Node_Str");
  SELECTED_ROW_COLOR=JDTheme.C("String_Node_Str","String_Node_Str");
  GRID_COLOR=JDTheme.C("String_Node_Str","String_Node_Str");
  PACKAGE_ROW_COLOR=JDTheme.C("String_Node_Str","String_Node_Str");
  SELECTED_ROW_BORDER_COLOR=JDTheme.C("String_Node_Str","String_Node_Str");
  COLOR_DONE=JDTheme.C("String_Node_Str","String_Node_Str");
  COLOR_ERROR=JDTheme.C("String_Node_Str","String_Node_Str");
  COLOR_DISABLED=JDTheme.C("String_Node_Str","String_Node_Str");
  COLOR_WAIT=JDTheme.C("String_Node_Str","String_Node_Str");
  table.setShowGrid(false);
  table.setRowHeight(table.getFont().getSize() + 6);
  table.setGridColor(GRID_COLOR);
  table.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
    public void valueChanged(    ListSelectionEvent e){
      table.repaint();
    }
  }
);
  table.addFocusListener(new FocusListener(){
    public void focusGained(    FocusEvent e){
      table.repaint();
    }
    public void focusLost(    FocusEvent e){
      table.repaint();
    }
  }
);
}

Fixed version (ground truth):
@Override protected void installDefaults(){
  EVEN_ROW_COLOR=JDTheme.C("String_Node_Str","String_Node_Str");
  ODD_ROW_COLOR=JDTheme.C("String_Node_Str","String_Node_Str");
  SELECTED_ROW_COLOR=JDTheme.C("String_Node_Str","String_Node_Str");
  GRID_COLOR=JDTheme.C("String_Node_Str","String_Node_Str");
  PACKAGE_ROW_COLOR=JDTheme.C("String_Node_Str","String_Node_Str");
  SELECTED_ROW_BORDER_COLOR=JDTheme.C("String_Node_Str","String_Node_Str");
  COLOR_DONE=JDTheme.C("String_Node_Str","String_Node_Str");
  COLOR_DONE_Package=JDTheme.C("String_Node_Str","String_Node_Str");
  COLOR_Progress=JDTheme.C("String_Node_Str","String_Node_Str");
  COLOR_ERROR=JDTheme.C("String_Node_Str","String_Node_Str");
  COLOR_DISABLED=JDTheme.C("String_Node_Str","String_Node_Str");
  COLOR_WAIT=JDTheme.C("String_Node_Str","String_Node_Str");
  table.setShowGrid(false);
  table.setRowHeight(table.getFont().getSize() + 6);
  table.setGridColor(GRID_COLOR);
  table.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
    public void valueChanged(    ListSelectionEvent e){
      table.repaint();
    }
  }
);
  table.addFocusListener(new FocusListener(){
    public void focusGained(    FocusEvent e){
      table.repaint();
    }
    public void focusLost(    FocusEvent e){
      table.repaint();
    }
  }
);
}
Program: 21259
Project: 21259
Buggy source:
public boolean isFinished(){
  if (System.currentTimeMillis() - updateTime > UPDATE_INTERVAL) {
    updateTime=System.currentTimeMillis();
    boolean value=true;
synchronized (downloadLinks) {
      for (      DownloadLink lk : downloadLinks) {
        if (!lk.getLinkStatus().hasStatus(LinkStatus.FINISHED) && lk.isEnabled()) {
          value=false;
          break;
        }
      }
    }
    isFinished=value;
  }
  return isFinished;
}

Fixed version (ground truth):
public boolean isFinished(){
  if (System.currentTimeMillis() - updateTime1 > UPDATE_INTERVAL) {
    updateTime1=System.currentTimeMillis();
    boolean value=true;
    if (linksFinished > 0) {
synchronized (downloadLinks) {
        for (        DownloadLink lk : downloadLinks) {
          if (!lk.getLinkStatus().hasStatus(LinkStatus.FINISHED) && lk.isEnabled()) {
            value=false;
            break;
          }
        }
      }
    }
 else {
      value=false;
    }
    isFinished=value;
  }
  return isFinished;
}
Program: 21260
Project: 21260
Buggy source:
public void updateCollectives(){
  updateTime=System.currentTimeMillis();
  totalEstimatedPackageSize=0;
  totalDownloadSpeed=0;
  linksFinished=0;
  linksInProgress=0;
  linksFailed=0;
  totalBytesLoaded=0;
  long avg=0;
  DownloadLink next;
  int i=0;
synchronized (downloadLinks) {
    for (Iterator<DownloadLink> it=downloadLinks.iterator(); it.hasNext(); ) {
      next=it.next();
      if (next.getDownloadSize() > 0) {
        if (next.isEnabled()) {
          totalEstimatedPackageSize+=next.getDownloadSize() / 1024;
        }
        avg=(i * avg + next.getDownloadSize() / 1024) / (i + 1);
        i++;
      }
 else {
        if (it.hasNext()) {
          if (next.isEnabled()) {
            totalEstimatedPackageSize+=avg;
          }
        }
 else {
          if (next.isEnabled()) {
            totalEstimatedPackageSize+=avg / 2;
          }
        }
      }
      totalDownloadSpeed+=Math.max(0,next.getDownloadSpeed());
      if (next.isEnabled()) {
        totalBytesLoaded+=next.getDownloadCurrent() / 1024;
      }
      linksInProgress+=next.getLinkStatus().isPluginActive() ? 1 : 0;
      linksFinished+=next.getLinkStatus().hasStatus(LinkStatus.FINISHED) ? 1 : 0;
      if (!next.getLinkStatus().hasStatus(LinkStatus.FINISHED | LinkStatus.DOWNLOADINTERFACE_IN_PROGRESS | LinkStatus.FINISHED)) {
        linksFailed++;
      }
    }
  }
}

Fixed version (ground truth):
public void updateCollectives(){
synchronized (downloadLinks) {
    totalEstimatedPackageSize=0;
    totalDownloadSpeed=0;
    linksFinished=0;
    linksInProgress=0;
    linksFailed=0;
    totalBytesLoaded=0;
    long avg=0;
    DownloadLink next;
    int i=0;
    for (Iterator<DownloadLink> it=downloadLinks.iterator(); it.hasNext(); ) {
      next=it.next();
      if (next.getDownloadSize() > 0) {
        if (next.isEnabled()) {
          totalEstimatedPackageSize+=next.getDownloadSize() / 1024;
        }
        avg=(i * avg + next.getDownloadSize() / 1024) / (i + 1);
        i++;
      }
 else {
        if (it.hasNext()) {
          if (next.isEnabled()) {
            totalEstimatedPackageSize+=avg;
          }
        }
 else {
          if (next.isEnabled()) {
            totalEstimatedPackageSize+=avg / 2;
          }
        }
      }
      totalDownloadSpeed+=Math.max(0,next.getDownloadSpeed());
      if (next.isEnabled()) {
        totalBytesLoaded+=next.getDownloadCurrent() / 1024;
      }
      linksInProgress+=next.getLinkStatus().isPluginActive() ? 1 : 0;
      linksFinished+=next.getLinkStatus().hasStatus(LinkStatus.FINISHED) ? 1 : 0;
      if (!next.getLinkStatus().hasStatus(LinkStatus.FINISHED | LinkStatus.DOWNLOADINTERFACE_IN_PROGRESS | LinkStatus.FINISHED)) {
        linksFailed++;
      }
    }
  }
  updateTime=System.currentTimeMillis();
}
Program: 21263
Project: 21263
Buggy source:
/** 
 * Setzt die anzahl der schon geladenen partbytes. Ist für resume wichtig.
 * @param loaded
 */
public void setLoaded(long loaded){
  totalPartBytes=loaded;
  addToTotalLinkBytesLoaded(loaded);
}

Fixed version (ground truth):
/** 
 * Setzt die anzahl der schon geladenen partbytes. Ist für resume wichtig.
 * @param loaded
 */
public void setLoaded(long loaded){
  loaded=Math.max(0,loaded);
  totalPartBytes=loaded;
  addToTotalLinkBytesLoaded(loaded);
}
Program: 21264
Project: 21264
Buggy source:
private void setupResume() throws FileNotFoundException {
  long parts=fileSize / getChunkNum();
  logger.info("String_Node_Str" + fileSize + "String_Node_Str"+ parts);
  Chunk chunk;
  this.createOutputChannel();
  addToChunksInProgress(getChunkNum());
  for (int i=0; i < getChunkNum(); i++) {
    if (i == getChunkNum() - 1) {
      chunk=new Chunk(downloadLink.getChunksProgress()[i] + 1,-1,connection);
      chunk.setLoaded((downloadLink.getChunksProgress()[i] - i * parts + 1));
    }
 else {
      chunk=new Chunk(downloadLink.getChunksProgress()[i] + 1,(i + 1) * parts - 1,connection);
      chunk.setLoaded((downloadLink.getChunksProgress()[i] - i * parts + 1));
    }
    addChunk(chunk);
  }
}

Fixed version (ground truth):
private void setupResume() throws FileNotFoundException {
  long parts=fileSize / getChunkNum();
  logger.info("String_Node_Str" + fileSize + "String_Node_Str"+ parts);
  Chunk chunk;
  this.createOutputChannel();
  addToChunksInProgress(getChunkNum());
  for (int i=0; i < getChunkNum(); i++) {
    if (i == getChunkNum() - 1) {
      chunk=new Chunk(downloadLink.getChunksProgress()[i] == 0 ? 0 : downloadLink.getChunksProgress()[i] + 1,-1,connection);
      chunk.setLoaded((downloadLink.getChunksProgress()[i] - i * parts + 1));
    }
 else {
      chunk=new Chunk(downloadLink.getChunksProgress()[i] == 0 ? 0 : downloadLink.getChunksProgress()[i] + 1,(i + 1) * parts - 1,connection);
      chunk.setLoaded((downloadLink.getChunksProgress()[i] - i * parts + 1));
    }
    addChunk(chunk);
  }
}
Program: 21271
Project: 21271
Buggy source:
public static String objectToXml(Serializable obj) throws IOException {
  ByteArrayOutputStream ba;
  DataOutputStream out=new DataOutputStream(ba=new ByteArrayOutputStream());
  XMLEncoder xmlEncoder=new XMLEncoder(out);
  xmlEncoder.writeObject(obj);
  xmlEncoder.close();
  out.close();
  return new String(ba.toByteArray());
}

Fixed version (ground truth):
public static String objectToXml(Object obj) throws IOException {
  ByteArrayOutputStream ba;
  DataOutputStream out=new DataOutputStream(ba=new ByteArrayOutputStream());
  XMLEncoder xmlEncoder=new XMLEncoder(out);
  xmlEncoder.writeObject(obj);
  xmlEncoder.close();
  out.close();
  return new String(ba.toByteArray());
}
Program: 21272
Project: 21272
Buggy source:
@Override public void run(){
  PluginForHost plugin;
  linkStatus.setStatusText(null);
  linkStatus.setErrorMessage(null);
  logger.info("String_Node_Str" + downloadLink.getName());
  currentPlugin=plugin=(PluginForHost)downloadLink.getPlugin();
  fireControlEvent(new ControlEvent(currentPlugin,ControlEvent.CONTROL_PLUGIN_ACTIVE,this));
  linkStatus.setInProgress(true);
  handlePlugin();
  linkStatus.setInProgress(false);
  fireControlEvent(new ControlEvent(currentPlugin,ControlEvent.CONTROL_PLUGIN_INACTIVE,this));
  plugin.clean();
  downloadLink.requestGuiUpdate();
}

Fixed version (ground truth):
@Override public void run(){
  PluginForHost plugin;
  linkStatus.setStatusText(null);
  linkStatus.setErrorMessage(null);
  linkStatus.resetWaitTime();
  logger.info("String_Node_Str" + downloadLink.getName());
  currentPlugin=plugin=(PluginForHost)downloadLink.getPlugin();
  fireControlEvent(new ControlEvent(currentPlugin,ControlEvent.CONTROL_PLUGIN_ACTIVE,this));
  linkStatus.setInProgress(true);
  handlePlugin();
  linkStatus.setInProgress(false);
  fireControlEvent(new ControlEvent(currentPlugin,ControlEvent.CONTROL_PLUGIN_INACTIVE,this));
  plugin.clean();
  downloadLink.requestGuiUpdate();
}
Program: 21273
Project: 21273
Buggy source:
private void retry(DownloadLink downloadLink,PluginForHost plugin){
  int r;
  if (downloadLink.getLinkStatus().getValue() > 0) {
    downloadLink.getLinkStatus().setStatusText(null);
  }
  if ((r=downloadLink.getLinkStatus().getRetryCount()) <= plugin.getMaxRetries()) {
    downloadLink.getLinkStatus().reset();
    downloadLink.getLinkStatus().setRetryCount(r + 1);
    downloadLink.getLinkStatus().setErrorMessage(null);
    try {
      plugin.sleep(Math.max((int)downloadLink.getLinkStatus().getValue(),2000),downloadLink);
    }
 catch (    InterruptedException e) {
      downloadLink.getLinkStatus().setStatusText(null);
      return;
    }
  }
 else {
  }
}

Fixed version (ground truth):
private void retry(DownloadLink downloadLink,PluginForHost plugin){
  int r;
  if (downloadLink.getLinkStatus().getValue() > 0) {
    downloadLink.getLinkStatus().setStatusText(null);
  }
  if ((r=downloadLink.getLinkStatus().getRetryCount()) <= plugin.getMaxRetries()) {
    downloadLink.getLinkStatus().reset();
    downloadLink.getLinkStatus().setRetryCount(r + 1);
    downloadLink.getLinkStatus().setErrorMessage(null);
    try {
      plugin.sleep(Math.max((int)downloadLink.getLinkStatus().getValue(),2000),downloadLink);
    }
 catch (    InterruptedException e) {
      downloadLink.getLinkStatus().setStatusText(null);
      return;
    }
  }
 else {
    downloadLink.getLinkStatus().addStatus(LinkStatus.ERROR_FATAL);
  }
}
Program: 21275
Project: 21275
Buggy source:
/** 
 * Setzt den Linkstatus. Es dürfen nur LInkStatus.*STATUS ids verwendet werden
 * @param status
 */
public void setStatus(int status){
  this.status=status;
  lastestStatus=status;
}

Fixed version (ground truth):
/** 
 * Setzt den Linkstatus. Es dürfen nur LInkStatus.*STATUS ids verwendet werden
 * @param status
 */
public void setStatus(int status){
  if (status == FINISHED) {
    resetWaitTime();
  }
  this.status=status;
  lastestStatus=status;
}
Program: 21276
Project: 21276
Buggy source:
public void reset(){
  setStatus(TODO);
  statusText=null;
  retryCount=0;
  totalWaitTime=0;
  value=0;
  resetWaitTime();
}

Fixed version (ground truth):
public void reset(){
  setStatus(TODO);
  statusText=null;
  retryCount=0;
  value=0;
  resetWaitTime();
}
Program: 21278
Project: 21278
Buggy source:
@Override public boolean getFileInformation(DownloadLink downloadLink) throws IOException {
  if (downloadLink.getDownloadURL().matches("String_Node_Str"))   return true;
  downloadLink.setUrlDownload(downloadLink.getDownloadURL().replaceAll("String_Node_Str","String_Node_Str"));
  downloadLink.setUrlDownload(downloadLink.getDownloadURL().replaceAll("String_Node_Str","String_Node_Str"));
  br.setFollowRedirects(true);
  br.getPage(downloadLink.getDownloadURL());
  if (br.containsHTML(NOT_AVAILABLE)) {
    br.setFollowRedirects(false);
    return false;
  }
 else   if (br.containsHTML(SERVER_DOWN)) {
    br.setFollowRedirects(false);
    return false;
  }
 else {
    String fileName=Encoding.htmlDecode(new Regex(br.toString().replaceAll("String_Node_Str","String_Node_Str"),FILENAME).getMatch(0));
    String fileSize=new Regex(br.toString(),FILESIZE).getMatch(-1);
    downloadLink.setName(fileName);
    downloadLink.setDownloadSize(Regex.getSize(fileSize));
  }
  br.setFollowRedirects(false);
  return true;
}

Fixed version (ground truth):
@Override public boolean getFileInformation(DownloadLink downloadLink) throws IOException {
  if (downloadLink.getDownloadURL().matches("String_Node_Str"))   return true;
  downloadLink.setUrlDownload(downloadLink.getDownloadURL().replaceAll("String_Node_Str","String_Node_Str"));
  downloadLink.setUrlDownload(downloadLink.getDownloadURL().replaceAll("String_Node_Str","String_Node_Str"));
  br.setFollowRedirects(true);
  br.getPage(downloadLink.getDownloadURL());
  if (br.containsHTML(NOT_AVAILABLE) && !br.containsHTML("String_Node_Str")) {
    br.setFollowRedirects(false);
    return false;
  }
 else   if (br.containsHTML(SERVER_DOWN)) {
    br.setFollowRedirects(false);
    return false;
  }
 else {
    if (br.containsHTML("String_Node_Str")) {
      downloadLink.getLinkStatus().setErrorMessage("String_Node_Str");
      downloadLink.getLinkStatus().setStatusText("String_Node_Str");
    }
 else {
      String fileName=Encoding.htmlDecode(new Regex(br.toString().replaceAll("String_Node_Str","String_Node_Str"),FILENAME).getMatch(0));
      String fileSize=new Regex(br.toString(),FILESIZE).getMatch(-1);
      downloadLink.setName(fileName);
      downloadLink.setDownloadSize(Regex.getSize(fileSize));
    }
  }
  br.setFollowRedirects(false);
  return true;
}
Program: 21281
Project: 21281
Buggy source:
private void getSourceEntries(){
  sourceEntries.clear();
  sourcePatterns.clear();
  Vector<String> keys=new Vector<String>();
  String[][] matches;
  for (  File file : getSourceFiles(sourceFolder)) {
    matches=new Regex(JDUtilities.getLocalFile(file),Pattern.compile("String_Node_Str")).getMatches();
    for (    String[] match : matches) {
      match[0]=match[0].trim();
      if (keys.contains(match[0]))       continue;
      if (match[0].indexOf("String_Node_Str") == -1) {
        match[0]=Encoding.UTF8Decode(match[0]);
        match[1]=Encoding.UTF8Decode(match[1]);
        keys.add(match[0]);
        sourceEntries.add(new String[]{match[0],match[1]});
      }
 else {
        if (match[0].contains("String_Node_Str"))         match[0]=match[0].substring(0,match[0].indexOf("String_Node_Str") + 1);
        match[0]=match[0].replaceAll("String_Node_Str","String_Node_Str");
        match[0]=match[0].replaceAll("String_Node_Str","String_Node_Str");
        if (keys.contains(match[0]))         continue;
        keys.add(Encoding.UTF8Decode(match[0]));
        sourcePatterns.add(Pattern.compile(match[0],Pattern.CASE_INSENSITIVE));
      }
    }
  }
}

Fixed version (ground truth):
private void getSourceEntries(){
  sourceEntries.clear();
  sourcePatterns.clear();
  Vector<String> keys=new Vector<String>();
  String[][] matches;
  for (  File file : getSourceFiles(sourceFolder)) {
    matches=new Regex(JDUtilities.getLocalFile(file),Pattern.compile("String_Node_Str")).getMatches();
    for (    String[] match : matches) {
      match[0]=match[0].trim();
      if (keys.contains(match[0]))       continue;
      if (match[0].indexOf("String_Node_Str") == -1) {
        match[0]=Encoding.UTF8Decode(match[0]);
        match[1]=Encoding.UTF8Decode(match[1].substring(1,match[1].length() - 1));
        keys.add(match[0]);
        sourceEntries.add(new String[]{match[0],match[1]});
      }
 else {
        if (match[0].contains("String_Node_Str"))         match[0]=match[0].substring(0,match[0].indexOf("String_Node_Str") + 1);
        match[0]=match[0].replaceAll("String_Node_Str","String_Node_Str");
        match[0]=match[0].replaceAll("String_Node_Str","String_Node_Str");
        if (keys.contains(match[0]))         continue;
        keys.add(Encoding.UTF8Decode(match[0]));
        sourcePatterns.add(Pattern.compile(match[0],Pattern.CASE_INSENSITIVE));
      }
    }
  }
}
Program: 21282
Project: 21282
Buggy source:
public static String getJDTitle(){
  String ret=JDUtilities.JD_TITLE + "String_Node_Str" + JDUtilities.JD_VERSION+ JDUtilities.getRevision();
  if (JDUtilities.getController() != null && JDUtilities.getController().getWaitingUpdates() != null && JDUtilities.getController().getWaitingUpdates().size() > 0) {
    ret+="String_Node_Str" + JDLocale.L("String_Node_Str","String_Node_Str") + JDUtilities.getController().getWaitingUpdates().size();
  }
  return ret;
}

Fixed version (ground truth):
public static String getJDTitle(){
  String ret=JDUtilities.JD_TITLE + "String_Node_Str" + JDUtilities.JD_VERSION+ JDUtilities.getRevision();
  if (JDUtilities.getController() != null && JDUtilities.getController().getWaitingUpdates() != null && JDUtilities.getController().getWaitingUpdates().size() > 0) {
    ret+="String_Node_Str" + JDLocale.L("String_Node_Str","String_Node_Str") + "String_Node_Str"+ JDUtilities.getController().getWaitingUpdates().size();
  }
  return ret;
}
Program: 21283
Project: 21283
Buggy source:
/** 
 * Erzeugt einen neuen DownloadLink
 * @param plugin Das Plugins, das für diesen Download zuständig ist
 * @param name Bezeichnung des Downloads
 * @param host Anbieter, von dem dieser Download gestartet wird
 * @param urlDownload Die Download URL (Entschlüsselt)
 * @param isEnabled Markiert diesen DownloadLink als aktiviert oder deaktiviert
 */
public DownloadLink(PluginForHost plugin,String name,String host,String urlDownload,boolean isEnabled){
  this.plugin=plugin;
  setName(name);
  sourcePluginPasswords=new Vector<String>();
  downloadMax=0;
  this.host=host == null ? null : host.toLowerCase();
  this.isEnabled=isEnabled;
  speedMeter=new SpeedMeter();
  if (urlDownload != null) {
    this.urlDownload=urlDownload.trim();
  }
 else {
    this.urlDownload=null;
  }
  if (name == null && urlDownload != null) {
    this.name=Plugin.extractFileNameFromURL(getDownloadURL());
  }
}

Fixed version (ground truth):
/** 
 * Erzeugt einen neuen DownloadLink
 * @param plugin Das Plugins, das für diesen Download zuständig ist
 * @param name Bezeichnung des Downloads
 * @param host Anbieter, von dem dieser Download gestartet wird
 * @param urlDownload Die Download URL (Entschlüsselt)
 * @param isEnabled Markiert diesen DownloadLink als aktiviert oder deaktiviert
 */
public DownloadLink(PluginForHost plugin,String name,String host,String urlDownload,boolean isEnabled){
  this.plugin=plugin;
  setName(name);
  sourcePluginPasswords=new Vector<String>();
  downloadMax=0;
  this.host=host == null ? null : host.toLowerCase();
  this.isEnabled=isEnabled;
  speedMeter=new SpeedMeter();
  this.setUrlDownload(urlDownload);
  if (name == null && urlDownload != null) {
    this.name=Plugin.extractFileNameFromURL(getDownloadURL());
  }
}
Program: 21284
Project: 21284
Buggy source:
private boolean checkResumabled(){
  if (!isResume() || downloadLink.getChunksProgress() == null) {
    return false;
  }
  long loaded=0;
  long fileSize=getFileSize();
  int chunks=downloadLink.getChunksProgress().length;
  long part=fileSize / chunks;
  for (int i=0; i < chunks; i++) {
    loaded+=downloadLink.getChunksProgress()[i] - i * part;
  }
  if (chunks > 0) {
    setChunkNum(chunks);
    logger.info("String_Node_Str" + chunks + "String_Node_Str");
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean checkResumabled(){
  if (!isResume() || downloadLink.getChunksProgress() == null) {
    return false;
  }
  long loaded=0;
  long fileSize=getFileSize();
  int chunks=downloadLink.getChunksProgress().length;
  long part=fileSize / chunks;
  long dif;
  long last=-1;
  for (int i=0; i < chunks; i++) {
    dif=downloadLink.getChunksProgress()[i] - i * part;
    if (dif < 0)     return false;
    if (downloadLink.getChunksProgress()[i] <= last)     return false;
    last=downloadLink.getChunksProgress()[i];
    loaded+=dif;
  }
  if (chunks > 0) {
    setChunkNum(chunks);
    logger.info("String_Node_Str" + chunks + "String_Node_Str");
    return true;
  }
  return false;
}
Program: 21286
Project: 21286
Buggy source:
public AccountInfo getAccountInformation(Account account) throws Exception {
  AccountInfo ai=new AccountInfo(this,account);
  Browser br=new Browser();
  br.postPage("String_Node_Str" + getHost() + "String_Node_Str","String_Node_Str" + account.getUser() + "String_Node_Str"+ account.getPass()+ "String_Node_Str");
  if (br.getRedirectLocation() == null) {
    ai.setValid(false);
    return ai;
  }
  br.getPage("String_Node_Str");
  String validUntil=br.getRegex("String_Node_Str").getMatch(0).trim();
  String days=new Regex(validUntil,"String_Node_Str").getMatch(0);
  String hours=new Regex(validUntil,"String_Node_Str").getMatch(0);
  long res=0;
  if (days != null)   res+=Long.parseLong(days.trim()) * 24 * 60* 60* 1000;
  if (hours != null)   res+=Long.parseLong(hours.trim()) * 60 * 60* 1000;
  res+=new Date().getTime();
  logger.info(new Date(res) + "String_Node_Str");
  ai.setValidUntil(res);
  return ai;
}

Fixed version (ground truth):
public AccountInfo getAccountInformation(Account account) throws Exception {
  AccountInfo ai=new AccountInfo(this,account);
  Browser br=new Browser();
  br.postPage("String_Node_Str" + getHost() + "String_Node_Str","String_Node_Str" + account.getUser() + "String_Node_Str"+ account.getPass()+ "String_Node_Str");
  if (br.getRedirectLocation() == null || !br.getRedirectLocation().trim().equalsIgnoreCase("String_Node_Str")) {
    ai.setValid(false);
    return ai;
  }
  br.getPage("String_Node_Str");
  String validUntil=br.getRegex("String_Node_Str").getMatch(0).trim();
  String days=new Regex(validUntil,"String_Node_Str").getMatch(0);
  String hours=new Regex(validUntil,"String_Node_Str").getMatch(0);
  long res=0;
  if (days != null)   res+=Long.parseLong(days.trim()) * 24 * 60* 60* 1000;
  if (hours != null)   res+=Long.parseLong(hours.trim()) * 60 * 60* 1000;
  res+=new Date().getTime();
  logger.info(new Date(res) + "String_Node_Str");
  ai.setValidUntil(res);
  return ai;
}
Program: 21292
Project: 21292
Buggy source:
private DownloadLink createdl(String parameter,String[] info){
  int size=100;
  String name=null, linkName=null, title=null;
  String[] mirrors=null;
  if (info != null) {
    name=Encoding.htmlDecode(info[1]);
    if (info[0] != null)     size=Integer.parseInt(info[0]);
    title=Encoding.htmlDecode(info[3]);
    mirrors=getMirrors(parameter,info[2]);
  }
  if (title == null)   title="String_Node_Str";
  try {
    linkName=((title.length() > 10 ? title.substring(0,10) : title) + "String_Node_Str" + name).replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").trim() + "String_Node_Str";
  }
 catch (  Exception e) {
  }
  if (linkName == null || parameter.matches("String_Node_Str") || parameter.matches("String_Node_Str")) {
    size=100;
    linkName=parameter.replaceFirst("String_Node_Str","String_Node_Str").replaceFirst("String_Node_Str","String_Node_Str");
  }
  String hostname=getHostname(parameter);
  DownloadLink dlink=new DownloadLink(null,name,getHost(),"String_Node_Str" + hostname + "String_Node_Str"+ linkName,true);
  dlink.setName(linkName);
  dlink.setProperty("String_Node_Str",parameter);
  dlink.setProperty("String_Node_Str",mirrors);
  dlink.addSourcePluginPasswords(passwords);
  if (name != null) {
    dlink.setDownloadSize(size * 1024 * 1024);
  }
  dlink.getLinkStatus().setStatusText("String_Node_Str");
  return dlink;
}

Fixed version (ground truth):
private DownloadLink createdl(String parameter,String[] info){
  int size=100;
  String name=null, linkName=null, title=null;
  String[] mirrors=null;
  if (info != null) {
    name=Encoding.htmlDecode(info[1]);
    if (info[0] != null)     size=Integer.parseInt(info[0]);
    title=Encoding.htmlDecode(info[3]);
    mirrors=getMirrors(parameter,info[2]);
  }
  if (title == null)   title="String_Node_Str";
  try {
    linkName=((title.length() > 10 ? title.substring(0,10) : title) + "String_Node_Str" + name).replaceAll("String_Node_Str","String_Node_Str").replaceAll("String_Node_Str","String_Node_Str").trim() + "String_Node_Str";
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  if (linkName == null || parameter.matches("String_Node_Str") || parameter.matches("String_Node_Str")) {
    size=100;
    linkName=parameter.replaceFirst("String_Node_Str","String_Node_Str").replaceFirst("String_Node_Str","String_Node_Str");
  }
  String hostname=getHostname(parameter);
  DownloadLink dlink=new DownloadLink(null,name,getHost(),"String_Node_Str" + hostname + "String_Node_Str"+ linkName,true);
  dlink.setName(linkName);
  dlink.setProperty("String_Node_Str",parameter);
  dlink.setProperty("String_Node_Str",mirrors);
  dlink.addSourcePluginPasswords(passwords);
  if (name != null) {
    dlink.setDownloadSize(size * 1024 * 1024);
  }
  dlink.getLinkStatus().setStatusText("String_Node_Str");
  return dlink;
}
Program: 21294
Project: 21294
Buggy source:
private String[] getLinkName(String link){
  String[] titles=lastHtmlCode.replaceFirst("String_Node_Str","String_Node_Str").split("String_Node_Str");
  for (  String element : titles) {
    String title=new Regex(element,"String_Node_Str").getMatch(0);
    String[] sp=element.split("String_Node_Str");
    for (    String element2 : sp) {
      String size=new Regex(element2,"String_Node_Str").getMatch(0);
      String[][] links=new Regex(element2.replaceAll("String_Node_Str","String_Node_Str"),"String_Node_Str").getMatches();
      for (      String[] element3 : links) {
        try {
          if (element3[1].contains(link)) {
            return new String[]{size,element3[0],element3[1],title};
          }
        }
 catch (        Exception e) {
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
private String[] getLinkName(String link){
  String[] titles=lastHtmlCode.replaceFirst("String_Node_Str","String_Node_Str").split("String_Node_Str");
  for (  String element : titles) {
    String title=new Regex(element,"String_Node_Str").getMatch(0);
    String[] sp=element.split("String_Node_Str");
    for (    String element2 : sp) {
      String size=new Regex(element2,"String_Node_Str").getMatch(0);
      String[][] links=new Regex(element2.replaceAll("String_Node_Str","String_Node_Str"),"String_Node_Str").getMatches();
      for (      String[] element3 : links) {
        try {
          if (element3[1].toLowerCase().contains(Encoding.UTF8Decode(link).toLowerCase())) {
            return new String[]{size,element3[0],element3[1],title};
          }
        }
 catch (        Exception e) {
          e.printStackTrace();
        }
      }
    }
  }
  return null;
}
Program: 21295
Project: 21295
Buggy source:
public void setAGBChecked(Boolean value){
  getPluginConfig().setProperty(AGB_CHECKED,value);
  getPluginConfig().save();
}

Fixed version (ground truth):
public void setAGBChecked(Boolean value){
  super.getPluginConfig().setProperty(AGB_CHECKED,value);
  super.getPluginConfig().save();
}
Program: 21296
Project: 21296
Buggy source:
public boolean isAGBChecked(){
  return getPluginConfig().getBooleanProperty(AGB_CHECKED,false);
}

Fixed version (ground truth):
public boolean isAGBChecked(){
  return super.getPluginConfig().getBooleanProperty(AGB_CHECKED,false);
}
Program: 21303
Project: 21303
Buggy source:
/** 
 * gibt das interne properties objekt zurück indem die Plugineinstellungen gespeichert werden
 * @return internes property objekt
 */
public SubConfiguration getPluginConfig(){
  if (!JDUtilities.getResourceFile("String_Node_Str" + getPluginName() + "String_Node_Str").exists()) {
    SubConfiguration cfg=JDUtilities.getSubConfig(getPluginName());
    if (JDUtilities.getConfiguration().getProperty("String_Node_Str" + getPluginName()) != null) {
      cfg.setProperties(((Property)JDUtilities.getConfiguration().getProperty("String_Node_Str" + getPluginName())).getProperties());
      cfg.save();
      return cfg;
    }
    return JDUtilities.getSubConfig(getPluginName());
  }
 else {
    return JDUtilities.getSubConfig(getPluginName());
  }
}

Fixed version (ground truth):
/** 
 * p gibt das interne properties objekt zurück indem die Plugineinstellungen gespeichert werden
 * @return internes property objekt
 */
public SubConfiguration getPluginConfig(){
  SubConfiguration cfg=JDUtilities.getSubConfig(getPluginName());
  if (cfg.getCount() <= 1) {
    if (JDUtilities.getConfiguration().getProperty("String_Node_Str" + getPluginName()) != null) {
      cfg.setProperties(((Property)JDUtilities.getConfiguration().getProperty("String_Node_Str" + getPluginName())).getProperties());
      cfg.save();
      return cfg;
    }
  }
  return cfg;
}
Program: 21307
Project: 21307
Buggy source:
private void checkNewInstalled(){
  boolean ch=false;
  String links="String_Node_Str";
  for (  PackageData pa : getPackageData()) {
    if (pa.isInstalled()) {
      pa.setInstalled(false);
      ch=true;
      links+=JDLocale.LF("String_Node_Str","String_Node_Str",pa.getStringProperty("String_Node_Str"),pa.getStringProperty("String_Node_Str"),pa.getStringProperty("String_Node_Str"));
    }
  }
  if (!ch)   return;
  JDUtilities.getGUI().showCountdownConfirmDialog(JDLocale.LF("String_Node_Str","String_Node_Str",links),15);
}

Fixed version (ground truth):
private void checkNewInstalled(){
  String links="String_Node_Str";
  String error="String_Node_Str";
  for (  PackageData pa : getPackageData()) {
    if (pa.isInstalled()) {
      if (pa.getInstalledVersion() != Integer.parseInt(pa.getStringProperty("String_Node_Str"))) {
        error+=JDLocale.LF("String_Node_Str","String_Node_Str",pa.getStringProperty("String_Node_Str"),pa.getStringProperty("String_Node_Str"),pa.getStringProperty("String_Node_Str"));
      }
 else {
        links+=JDLocale.LF("String_Node_Str","String_Node_Str",pa.getStringProperty("String_Node_Str"),pa.getStringProperty("String_Node_Str"),pa.getStringProperty("String_Node_Str"));
      }
      pa.setInstalled(false);
    }
  }
  if (!links.equals("String_Node_Str"))   JDUtilities.getGUI().showCountdownConfirmDialog(JDLocale.LF("String_Node_Str","String_Node_Str",links),15);
  if (!error.equals("String_Node_Str"))   JDUtilities.getGUI().showCountdownConfirmDialog(JDLocale.LF("String_Node_Str","String_Node_Str",links),15);
}
Program: 21309
Project: 21309
Buggy source:
public void addRow(String[] value){
  tableData.add(value);
  this.fireTableRowsInserted(tableData.size() - 1,tableData.size() - 1);
}

Fixed version (ground truth):
public void addRow(String[] value){
  tableData.add(value);
  this.fireTableRowsInserted(tableData.size() - 1,tableData.size() - 1);
  setInfoLabels();
}
Program: 21310
Project: 21310
Buggy source:
public void setValueAt(String value,int row,int col){
  tableData.get(row)[col]=value;
  this.fireTableCellUpdated(row,col);
}

Fixed version (ground truth):
public void setValueAt(Object value,int row,int col){
  tableData.get(row)[col]=(String)value;
  this.fireTableCellUpdated(row,col);
  setInfoLabels();
}
Program: 21311
Project: 21311
Buggy source:
public void deleteRow(int index){
  tableData.remove(index);
  this.fireTableRowsDeleted(index,index);
}

Fixed version (ground truth):
public void deleteRow(int index){
  oldEntries.remove(tableData.remove(index)[0]);
  this.fireTableRowsDeleted(index,index);
  setInfoLabels();
}
Program: 21312
Project: 21312
Buggy source:
private void initList(){
  Vector<String[]> source=new Vector<String[]>();
  if (sourceFolder != null)   source=getSourceEntries(sourceFolder);
  Vector<String[]> file=new Vector<String[]>();
  if (languageFile != null)   file=getLanguageFileEntries(languageFile);
  tableModel.setData(getData(source,file));
  mnuEntries.setEnabled(true);
  mnuKey.setEnabled(true);
  mnuReload.setEnabled(true);
  mnuSave.setEnabled(true);
  mnuSaveAs.setEnabled(true);
  setInfoLabels();
}

Fixed version (ground truth):
private void initList(){
  Vector<String[]> source=new Vector<String[]>();
  if (sourceFolder != null)   source=getSourceEntries(sourceFolder);
  Vector<String[]> file=new Vector<String[]>();
  if (languageFile != null)   file=getLanguageFileEntries(languageFile);
  tableModel.setData(getData(source,file));
  mnuEntries.setEnabled(true);
  mnuKey.setEnabled(true);
  mnuReload.setEnabled(true);
  mnuSave.setEnabled(true);
  mnuSaveAs.setEnabled(true);
}
Program: 21313
Project: 21313
Buggy source:
/** 
 * setzt den Statischen Dateinamen. Ist dieser wert != null, sow ird er zum Speichern der Datei verwendet. ist er ==null, so wird der dateiName im Plugin automatisch ermittelt. ACHTUNG: Diese Funktion sollte nicht ! von den Plugins verwendet werden. Sie dient dazu der Gui die Möglichkeit zu geben unabhängig von den Plugins einen Downloadnamen festzulegen. userinputs>automatische erkenung Plugins solten setName(String) verwenden um den Speichernamen anzugeben.
 */
public void setStaticFileName(String staticFileName){
  if (staticFileName != null && staticFileName.length() > 3) {
    this.staticFileName=JDUtilities.validateFileandPathName(staticFileName);
    updatePartID();
  }
 else   this.staticFileName=null;
}

Fixed version (ground truth):
/** 
 * setzt den Statischen Dateinamen. Ist dieser wert != null, sow ird er zum Speichern der Datei verwendet. ist er ==null, so wird der dateiName im Plugin automatisch ermittelt. ACHTUNG: Diese Funktion sollte nicht ! von den Plugins verwendet werden. Sie dient dazu der Gui die Möglichkeit zu geben unabhängig von den Plugins einen Downloadnamen festzulegen. userinputs>automatische erkenung Plugins solten setName(String) verwenden um den Speichernamen anzugeben.
 */
public void setStaticFileName(String staticFileName){
  if (staticFileName != null && staticFileName.length() > 3) {
    this.staticFileName=JDUtilities.removeEndingPoints(JDUtilities.validateFileandPathName(staticFileName));
    updatePartID();
  }
 else   this.staticFileName=null;
}
Program: 21314
Project: 21314
Buggy source:
/** 
 * Setzt den Namen des Downloads neu
 * @param name Neuer Name des Downloads
 */
public void setName(String name){
  if (name != null && name.length() > 3) {
    this.name=JDUtilities.validateFileandPathName(name);
    updatePartID();
  }
}

Fixed version (ground truth):
/** 
 * Setzt den Namen des Downloads neu
 * @param name Neuer Name des Downloads
 */
public void setName(String name){
  if (name != null && name.length() > 3) {
    this.name=JDUtilities.removeEndingPoints(JDUtilities.validateFileandPathName(name));
    updatePartID();
  }
}
Program: 21315
Project: 21315
Buggy source:
/** 
 * Setzt ein Subdirectory für den DeonloadLink neu
 * @param downloadPath der neue downloadPfad
 */
public void setSubdirectory(String subdir){
  if (subdir != null && name.length() > 0) {
    this.subdirectory=JDUtilities.validateFileandPathName(subdir);
  }
 else   this.subdirectory=null;
}

Fixed version (ground truth):
/** 
 * Setzt ein Subdirectory für den DeonloadLink neu
 * @param downloadPath der neue downloadPfad
 */
public void setSubdirectory(String subdir){
  if (subdir != null && name.length() > 0) {
    this.subdirectory=JDUtilities.removeEndingPoints(JDUtilities.validateFileandPathName(subdir));
  }
 else   this.subdirectory=null;
}
Program: 21316
Project: 21316
Buggy source:
public void setName(String name){
  this.name=name;
}

Fixed version (ground truth):
public void setName(String name){
  this.name=JDUtilities.removeEndingPoints(name);
}
Program: 21317
Project: 21317
Buggy source:
public void setDownloadDirectory(String subFolder){
  downloadDirectory=subFolder;
}

Fixed version (ground truth):
public void setDownloadDirectory(String subFolder){
  downloadDirectory=JDUtilities.removeEndingPoints(subFolder);
}
Program: 21318
Project: 21318
Buggy source:
/** 
 * GIbt den Integer der sich in src befindet zurück. alle nicht integerzeichen werden ausgefiltert
 * @param src 
 * @return Integer in src
 */
public static int filterInt(String src){
  try {
    return Integer.parseInt(JDUtilities.filterString(src,"String_Node_Str"));
  }
 catch (  NumberFormatException e) {
    return 0;
  }
}

Fixed version (ground truth):
/** 
 * GIbt den Integer der sich in src befindet zurück. alle nicht integerzeichen werden ausgefiltert
 * @param src
 * @return Integer in src
 */
public static int filterInt(String src){
  try {
    return Integer.parseInt(JDUtilities.filterString(src,"String_Node_Str"));
  }
 catch (  NumberFormatException e) {
    return 0;
  }
}
Program: 21319
Project: 21319
Buggy source:
public static String validateFileandPathName(String name){
  return name.replaceAll("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public static String validateFileandPathName(String name){
  if (name == null)   return null;
  return name.replaceAll("String_Node_Str","String_Node_Str");
}
Program: 21320
Project: 21320
Buggy source:
/** 
 * Minimiert die GUI. als ID können die GUI_STATUS_IDS aus UIInterface,* verwendet werden
 */
public void setGUIStatus(int id);

Fixed version (ground truth):
/** 
 * Minimiert die GUI. als ID können die GUI_STATUS_IDS aus UIInterface, verwendet werden
 */
public void setGUIStatus(int id);
Program: 21321
Project: 21321
Buggy source:
/** 
 * Zeigt einen Eingabe Dialog an
 * @param string Die Nachricht, die angezeigt werden soll
 * @return Der vom Benutzer eingegebene Text
 */
public String showUserInputDialog(String string);

Fixed version (ground truth):
/** 
 * Zeigt einen Eingabe Dialog an
 * @param string Die Nachricht, die angezeigt werden soll
 * @param def default Wert
 * @return Der vom Benutzer eingegebene Text
 */
public String showUserInputDialog(String string,String def);
Program: 21322
Project: 21322
Buggy source:
public String showUserInputDialog(String string){
  logger.info("String_Node_Str");
  return JOptionPane.showInputDialog(frame,string);
}

Fixed version (ground truth):
public String showUserInputDialog(String string,String def){
  logger.info("String_Node_Str");
  return JOptionPane.showInputDialog(frame,string,def);
}
Program: 21325
Project: 21325
Buggy source:
public boolean canImport(TreeTableTransferHandler.TransferSupport info){
  if (draggingPathes == null || draggingPathes.length <= 0)   return false;
  int row=((JTable.DropLocation)info.getDropLocation()).getRow();
  TreePath current=treeTable.getPathForRow(row);
  for (  TreePath path : draggingPathes) {
    if (path.getLastPathComponent() == current.getLastPathComponent())     return false;
  }
  if (draggingPathes[0].getLastPathComponent() instanceof FilePackage) {
    if (current.getLastPathComponent() instanceof FilePackage)     return true;
    return false;
  }
 else {
    return true;
  }
}

Fixed version (ground truth):
public boolean canImport(TreeTableTransferHandler.TransferSupport info){
  if (draggingPathes == null || draggingPathes.length <= 0)   return false;
  int row=((JTable.DropLocation)info.getDropLocation()).getRow();
  TreePath current=treeTable.getPathForRow(row);
  if (current == null)   return false;
  for (  TreePath path : draggingPathes) {
    if (path.getLastPathComponent() == current.getLastPathComponent())     return false;
  }
  if (draggingPathes[0].getLastPathComponent() instanceof FilePackage) {
    if (current.getLastPathComponent() instanceof FilePackage)     return true;
    return false;
  }
 else {
    return true;
  }
}