nus-yam/ex-repair huggingface dataset:
Program: 53058
Project: 53058
Buggy source:
public void endLoad() throws DaoException {
  if (dialect == SQLDialect.H2) {
    loadH2();
  }
 else {
    loadGeneric();
  }
}

Fixed version (ground truth):
public void endLoad() throws DaoException {
  try {
    writer.close();
  }
 catch (  IOException e) {
    throw new DaoException(e);
  }
  if (dialect == SQLDialect.H2) {
    loadH2();
  }
 else {
    loadGeneric();
  }
}
Program: 53060
Project: 53060
Buggy source:
@Override public SRResult similarity(String phrase1,String phrase2,Language language,boolean explanations){
  return null;
}

Fixed version (ground truth):
@Override public SRResult similarity(LocalPage page1,LocalPage page2,boolean explanations) throws DaoException {
  if (page1.getLanguage() != page2.getLanguage()) {
    return new SRResult(Double.NaN);
  }
  TIntSet A=getLinks(new LocalId(page1.getLanguage(),page1.getLocalId()));
  TIntSet B=getLinks(new LocalId(page2.getLanguage(),page2.getLocalId()));
  if (A == null || B == null) {
    return new SRResult(Double.NaN);
  }
  TIntSet I=new TIntHashSet(A);
  I.retainAll(B);
  DaoFilter pageFilter=new DaoFilter().setLanguages(page1.getLanguage());
  Iterable<LocalPage> allPages=pageHelper.get(pageFilter);
  int numArticles=0;
  for (  LocalPage page : allPages) {
    numArticles++;
  }
  if (I.size() == 0) {
    return new SRResult(0.0);
  }
  SRResult result=new SRResult(1.0 - ((Math.log(Math.max(A.size(),B.size())) - Math.log(I.size())) / (Math.log(numArticles) - Math.log(Math.min(A.size(),B.size())))));
  if (explanations) {
    if (outLinks) {
      for (      int id : I.toArray()) {
        String format="String_Node_Str";
        LocalPage intersectionPage=pageHelper.getById(page1.getLanguage(),id);
        if (intersectionPage == null) {
          continue;
        }
        List<LocalPage> formatPages=new ArrayList<LocalPage>();
        formatPages.add(page1);
        formatPages.add(page2);
        formatPages.add(intersectionPage);
        Explanation explanation=new Explanation(format,formatPages);
        result.addExplanation(explanation);
      }
    }
 else {
      for (      int id : I.toArray()) {
        String format="String_Node_Str";
        LocalPage intersectionPage=pageHelper.getById(page1.getLanguage(),id);
        if (intersectionPage == null) {
          continue;
        }
        List<LocalPage> formatPages=new ArrayList<LocalPage>();
        formatPages.add(intersectionPage);
        formatPages.add(page1);
        formatPages.add(page2);
        Explanation explanation=new Explanation(format,formatPages);
        result.addExplanation(explanation);
      }
    }
  }
  return result;
}
Program: 53063
Project: 53063
Buggy source:
public int getIdByTitle(String title,Language language,NameSpace nameSpace) throws DaoException {
  if (titlesToIds == null) {
    titlesToIds=buildTitlesToIds();
  }
  return titlesToIds.get(hashTitle(title,language.getId(),nameSpace.ordinal()));
}

Fixed version (ground truth):
public int getIdByTitle(String title,Language language,NameSpace nameSpace) throws DaoException {
  if (titlesToIds == null) {
    titlesToIds=buildTitlesToIds();
  }
  long i=hashTitle(title,language.getId(),nameSpace.getArbitraryId());
  return titlesToIds.get(hashTitle(title,language.getId(),nameSpace.getArbitraryId()));
}
Program: 53064
Project: 53064
Buggy source:
@Override public Iterator<E> iterator(){
  if (usedUp) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str");
  }
  usedUp=true;
  return new Iterator<E>(){
    Iterator<Record> recordIterator=result.iterator();
    boolean finished=false;
    @Override public boolean hasNext(){
      if (!finished) {
        finished=recordIterator.hasNext();
        if (!finished) {
          result.close();
        }
      }
      return finished;
    }
    @Override public E next(){
      if (finished) {
        return null;
      }
      Record r=recordIterator.next();
      if (r == null) {
        finished=true;
        result.close();
        return null;
      }
      return transform(r);
    }
    @Override public void remove(){
      throw new UnsupportedOperationException();
    }
  }
;
}

Fixed version (ground truth):
@Override public Iterator<E> iterator(){
  if (usedUp) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str");
  }
  usedUp=true;
  return new Iterator<E>(){
    Iterator<Record> recordIterator=result.iterator();
    boolean finished=false;
    @Override public boolean hasNext(){
      if (!finished) {
        finished=!recordIterator.hasNext();
        if (finished) {
          result.close();
        }
      }
      return !finished;
    }
    @Override public E next(){
      if (finished) {
        return null;
      }
      Record r=recordIterator.next();
      if (r == null) {
        finished=true;
        result.close();
        return null;
      }
      return transform(r);
    }
    @Override public void remove(){
      throw new UnsupportedOperationException();
    }
  }
;
}
Program: 53065
Project: 53065
Buggy source:
@Override public boolean hasNext(){
  if (!finished) {
    finished=recordIterator.hasNext();
    if (!finished) {
      result.close();
    }
  }
  return finished;
}

Fixed version (ground truth):
@Override public boolean hasNext(){
  if (!finished) {
    finished=!recordIterator.hasNext();
    if (finished) {
      result.close();
    }
  }
  return !finished;
}
Program: 53066
Project: 53066
Buggy source:
private void loadRedirectIdsIntoMemory(Language language) throws DaoException {
  RedirectParser redirectParser=new RedirectParser(language);
  redirectIdsToPageIds=new TIntIntHashMap(Constants.DEFAULT_CAPACITY,Constants.DEFAULT_LOAD_FACTOR,-1,-1);
  SqlDaoIterable<RawPage> redirectPages=rawPages.getAllRedirects(language);
  int i=0;
  System.out.println("String_Node_Str");
  for (  RawPage p : redirectPages) {
    Title pTitle=new Title(p.getRedirectTitle(),LanguageInfo.getByLanguage(language));
    redirectIdsToPageIds.put(p.getPageId(),localPages.getIdByTitle(pTitle.getCanonicalTitle(),language,pTitle.getNamespace()));
    if (i % 1000 == 0)     System.out.println("String_Node_Str" + i);
    i++;
  }
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
private void loadRedirectIdsIntoMemory(Language language) throws DaoException {
  RedirectParser redirectParser=new RedirectParser(language);
  redirectIdsToPageIds=new TIntIntHashMap(Constants.DEFAULT_CAPACITY,Constants.DEFAULT_LOAD_FACTOR,-1,-1);
  int i=0;
  System.out.println("String_Node_Str");
  for (  RawPage p : rawPages.getAllRedirects(language)) {
    if (p == null) {
    }
    Title pTitle=new Title(p.getRedirectTitle(),LanguageInfo.getByLanguage(language));
    redirectIdsToPageIds.put(p.getPageId(),localPages.getIdByTitle(pTitle.getCanonicalTitle(),language,pTitle.getNamespace()));
    if (i % 1000 == 0)     System.out.println("String_Node_Str" + i);
    i++;
  }
  System.out.println("String_Node_Str");
}
Program: 53071
Project: 53071
Buggy source:
/** 
 * Creates a configuration using
 * @param file
 */
public Configuration(File file){
  this.config=ConfigFactory.load(file.getAbsolutePath());
}

Fixed version (ground truth):
/** 
 * Creates a configuration using
 * @param file
 */
public Configuration(File file){
  this.config=(file == null) ? ConfigFactory.load() : ConfigFactory.load(file.getAbsolutePath());
}
Program: 53072
Project: 53072
Buggy source:
/** 
 * Constructs a new configuration object with the specified configuration.
 * @param conf
 */
public Configurator(Configuration conf) throws ConfigurationException {
  this.conf=conf;
  this.registerProviders();
}

Fixed version (ground truth):
/** 
 * Constructs a new configuration object with the specified configuration.
 * @param conf
 */
public Configurator(Configuration conf) throws ConfigurationException {
  this.conf=conf;
  searchForProviders(null);
}
Program: 53073
Project: 53073
Buggy source:
/** 
 * Get a specific named instance of the component with the specified class.
 * @param klass The generic interface or superclass, not the specific implementation.
 * @param name The name of the class as it appears in the config file.
 * @return The requested component.
 */
public Object get(Class klass,String name) throws ConfigurationException {
  if (providers.containsKey(klass)) {
    throw new ConfigurationException("String_Node_Str" + klass);
  }
  ProviderSet pset=providers.get(klass);
  String path=pset.path + "String_Node_Str" + name;
  if (conf.get().hasPath(path)) {
    throw new ConfigurationException("String_Node_Str" + path + "String_Node_Str");
  }
  Config config=conf.get().getConfig(path);
  Map<String,Object> cache=components.get(klass);
synchronized (cache) {
    if (cache.containsKey(name)) {
      return cache.get(name);
    }
    for (    Provider p : pset.providers) {
      Object o=p.get(name,klass,config);
      if (o != null) {
        cache.put(name,o);
        return o;
      }
    }
  }
  throw new ConfigurationException("String_Node_Str" + pset.providers.size() + "String_Node_Str"+ "String_Node_Str"+ klass+ "String_Node_Str"+ name+ "String_Node_Str"+ path+ "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Get a specific named instance of the component with the specified class.
 * @param klass The generic interface or superclass, not the specific implementation.
 * @param name The name of the class as it appears in the config file.
 * @return The requested component.
 */
public Object get(Class klass,String name) throws ConfigurationException {
  if (!providers.containsKey(klass)) {
    throw new ConfigurationException("String_Node_Str" + klass);
  }
  ProviderSet pset=providers.get(klass);
  String path=pset.path + "String_Node_Str" + name;
  if (!conf.get().hasPath(path)) {
    throw new ConfigurationException("String_Node_Str" + path + "String_Node_Str");
  }
  Config config=conf.get().getConfig(path);
  Map<String,Object> cache=components.get(klass);
synchronized (cache) {
    if (cache.containsKey(name)) {
      return cache.get(name);
    }
    for (    Provider p : pset.providers) {
      Object o=p.get(name,klass,config);
      if (o != null) {
        cache.put(name,o);
        return o;
      }
    }
  }
  throw new ConfigurationException("String_Node_Str" + pset.providers.size() + "String_Node_Str"+ "String_Node_Str"+ klass+ "String_Node_Str"+ name+ "String_Node_Str"+ path+ "String_Node_Str");
}
Program: 53075
Project: 53075
Buggy source:
/** 
 * Should return a configured instance of the requested class, or null if it cannot be created by this provider.
 */
public abstract T get(String name,Class klass,Config config);

Fixed version (ground truth):
/** 
 * Should return a configured instance of the requested class, or null if it cannot be created by this provider.
 */
public abstract T get(String name,Class klass,Config config) throws ConfigurationException ;
Program: 53076
Project: 53076
Buggy source:
/** 
 * Creates a new provider instance. Concrete implementations must only use this two-argument constructor.
 * @param configurator
 * @param config
 */
public Provider(Configurator configurator,Configuration config){
  this.configurator=configurator;
  this.config=config;
}

Fixed version (ground truth):
/** 
 * Creates a new provider instance. Concrete implementations must only use this two-argument constructor.
 * @param configurator
 * @param config
 */
public Provider(Configurator configurator,Configuration config) throws ConfigurationException {
  this.configurator=configurator;
  this.config=config;
}
Program: 53077
Project: 53077
Buggy source:
public String string(){
  String s="String_Node_Str";
  for (int i=0; i < 10; i++) {
    s+=chars.charAt(random.nextInt(chars.length()));
  }
  return s;
}

Fixed version (ground truth):
public String string(int min,int max){
  String s="String_Node_Str";
  int length=random.nextInt(max);
  length+=min;
  for (int i=0; i < length; i++) {
    s+=chars.charAt(random.nextInt(chars.length()));
  }
  return s;
}
Program: 53078
Project: 53078
Buggy source:
public void buildArticleDb(ArticleDao ad) throws IOException, SQLException {
  long time=0, start, stop;
  RandomHelper rh=new RandomHelper();
  for (int i=0; i < numArticles; i++) {
    Article a=new Article(i,rh.string(),rh.ns(),rh.type());
    start=System.currentTimeMillis();
    ad.save(a);
    stop=System.currentTimeMillis();
    time+=stop - start;
  }
  System.out.println("String_Node_Str" + (time / 60000) + "String_Node_Str");
}

Fixed version (ground truth):
public void buildArticleDb(ArticleDao ad) throws IOException, SQLException {
  long time=0, start, stop;
  RandomHelper rh=new RandomHelper();
  for (int i=0; i < numArticles; i++) {
    Article a=new Article(i,rh.string(titleLength),rh.ns(),rh.type(),rh.string(textMinLength,textMaxLength));
    start=System.currentTimeMillis();
    ad.save(a);
    stop=System.currentTimeMillis();
    time+=stop - start;
  }
  System.out.println("String_Node_Str" + (time / 60000) + "String_Node_Str"+ ((time / 1000) / (long)numArticles)+ "String_Node_Str");
}
Program: 53079
Project: 53079
Buggy source:
private ArrayList<Article> buildArticles(Result<Record> result){
  ArrayList<Article> articles=new ArrayList<Article>();
  for (  Record record : result) {
    Article a=new Article(record.getValue(Tables.ARTICLE.ID),record.getValue(Tables.ARTICLE.TITLE),Article.NameSpace.intToNS(record.getValue(Tables.ARTICLE.NS)),Article.PageType.values()[record.getValue(Tables.ARTICLE.PTYPE)],record.getValue(Tables.ARTICLE.TEXT));
    articles.add(a);
  }
  return articles;
}

Fixed version (ground truth):
private WikapidiaIterable<Article> buildArticles(Cursor<Record> result){
  return new WikapidiaIterable<Article>(result,new DaoTransformer<Article>(){
    @Override public Article transform(    Record r){
      return buildArticle(r);
    }
  }
);
}
Program: 53080
Project: 53080
Buggy source:
public List<Article> query(String title,Article.NameSpace ns) throws SQLException {
  Connection conn=ds.getConnection();
  DSLContext context=DSL.using(conn,SQLDialect.H2);
  Result<Record> result=context.select().from(Tables.ARTICLE).where(Tables.ARTICLE.TITLE.likeIgnoreCase(title)).and(Tables.ARTICLE.NS.equal(ns.getValue())).fetch();
  conn.close();
  return buildArticles(result);
}

Fixed version (ground truth):
public WikapidiaIterable<Article> query(String title,Article.NameSpace ns) throws SQLException {
  Connection conn=ds.getConnection();
  DSLContext context=DSL.using(conn,SQLDialect.H2);
  Cursor<Record> result=context.select().from(Tables.ARTICLE).where(Tables.ARTICLE.TITLE.likeIgnoreCase(title)).and(Tables.ARTICLE.NS.equal(ns.getValue())).fetchLazy();
  conn.close();
  return buildArticles(result);
}
Program: 53081
Project: 53081
Buggy source:
@Override public Iterator<E> iterator(){
  return null;
}

Fixed version (ground truth):
@Override public Iterator<E> iterator(){
  return new Iterator<E>(){
    Iterator<Record> recordIterator=result.iterator();
    @Override public boolean hasNext(){
      return recordIterator.hasNext();
    }
    @Override public E next(){
      return func.transform(recordIterator.next());
    }
    @Override public void remove(){
      throw new UnsupportedOperationException();
    }
  }
;
}
Program: 53082
Project: 53082
Buggy source:
private ArrayList<Article> buildArticles(Result<Record> result){
  ArrayList<Article> articles=new ArrayList<Article>();
  for (  Record record : result) {
    Article a=new Article(record.getValue(Tables.ARTICLE.ID),record.getValue(Tables.ARTICLE.TITLE),Article.NameSpace.intToNS(record.getValue(Tables.ARTICLE.NS)),Article.PageType.values()[record.getValue(Tables.ARTICLE.PTYPE)],record.getValue(Tables.ARTICLE.TEXT));
    articles.add(a);
  }
  return articles;
}

Fixed version (ground truth):
private WikapidiaIterable<Article> buildArticles(Cursor<Record> result){
  return new WikapidiaIterable<Article>(result,new DaoTransformer<Article>(){
    @Override public Article transform(    Record r){
      return buildArticle(r);
    }
  }
);
}
Program: 53083
Project: 53083
Buggy source:
public List<Article> query(String title,Article.NameSpace ns) throws SQLException {
  Connection conn=ds.getConnection();
  DSLContext context=DSL.using(conn,SQLDialect.H2);
  Result<Record> result=context.select().from(Tables.ARTICLE).where(Tables.ARTICLE.TITLE.likeIgnoreCase(title)).and(Tables.ARTICLE.NS.equal(ns.getValue())).fetch();
  conn.close();
  return buildArticles(result);
}

Fixed version (ground truth):
public WikapidiaIterable<Article> query(String title,Article.NameSpace ns) throws SQLException {
  Connection conn=ds.getConnection();
  DSLContext context=DSL.using(conn,SQLDialect.H2);
  Cursor<Record> result=context.select().from(Tables.ARTICLE).where(Tables.ARTICLE.TITLE.likeIgnoreCase(title)).and(Tables.ARTICLE.NS.equal(ns.getValue())).fetchLazy();
  conn.close();
  return buildArticles(result);
}
Program: 53084
Project: 53084
Buggy source:
@Override public Iterator<E> iterator(){
  return null;
}

Fixed version (ground truth):
@Override public Iterator<E> iterator(){
  return new Iterator<E>(){
    Iterator<Record> recordIterator=result.iterator();
    @Override public boolean hasNext(){
      return recordIterator.hasNext();
    }
    @Override public E next(){
      return func.transform(recordIterator.next());
    }
    @Override public void remove(){
      throw new UnsupportedOperationException();
    }
  }
;
}
Program: 53085
Project: 53085
Buggy source:
public String string(){
  String s="String_Node_Str";
  for (int i=0; i < 10; i++) {
    s+=chars.charAt(random.nextInt(chars.length()));
  }
  return s;
}

Fixed version (ground truth):
public String string(int min,int max){
  String s="String_Node_Str";
  int length=random.nextInt(max);
  length+=min;
  for (int i=0; i < length; i++) {
    s+=chars.charAt(random.nextInt(chars.length()));
  }
  return s;
}
Program: 53086
Project: 53086
Buggy source:
public void buildArticleDb(ArticleDao ad) throws IOException, SQLException {
  long time=0, start, stop;
  RandomHelper rh=new RandomHelper();
  for (int i=0; i < numArticles; i++) {
    Article a=new Article(i,rh.string(),rh.ns(),rh.type());
    start=System.currentTimeMillis();
    ad.save(a);
    stop=System.currentTimeMillis();
    time+=stop - start;
  }
  System.out.println("String_Node_Str" + (time / 60000) + "String_Node_Str");
}

Fixed version (ground truth):
public void buildArticleDb(ArticleDao ad) throws IOException, SQLException {
  long time=0, start, stop;
  RandomHelper rh=new RandomHelper();
  for (int i=0; i < numArticles; i++) {
    Article a=new Article(i,rh.string(titleLength),rh.ns(),rh.type(),rh.string(textMinLength,textMaxLength));
    start=System.currentTimeMillis();
    ad.save(a);
    stop=System.currentTimeMillis();
    time+=stop - start;
  }
  System.out.println("String_Node_Str" + (time / 60000) + "String_Node_Str"+ ((time / 1000) / (long)numArticles)+ "String_Node_Str");
}
Program: 53087
Project: 53087
Buggy source:
public Article get(int wpId){
  try {
    Connection conn=bds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    Record record=context.select().from(Tables.ARTICLE).where(Tables.ARTICLE.ID.equal(wpId)).fetchOne();
    Article a=new Article(record.getValue(Tables.ARTICLE.ID),record.getValue(Tables.ARTICLE.TITLE),Article.NameSpace.intToNS(record.getValue(Tables.ARTICLE.NS)),Article.PageType.values()[record.getValue(Tables.ARTICLE.PTYPE)]);
    conn.close();
    return a;
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
}

Fixed version (ground truth):
public Article get(int wpId){
  try {
    Connection conn=ds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    Record record=context.select().from(Tables.ARTICLE).where(Tables.ARTICLE.ID.equal(wpId)).fetchOne();
    Article a=new Article(record.getValue(Tables.ARTICLE.ID),record.getValue(Tables.ARTICLE.TITLE),Article.NameSpace.intToNS(record.getValue(Tables.ARTICLE.NS)),Article.PageType.values()[record.getValue(Tables.ARTICLE.PTYPE)]);
    conn.close();
    return a;
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
}
Program: 53088
Project: 53088
Buggy source:
public ArrayList<Article> query(String title,Article.NameSpace ns){
  try {
    Connection conn=bds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    Result<Record> result=context.select().from(Tables.ARTICLE).where(Tables.ARTICLE.TITLE.likeIgnoreCase(title)).and(Tables.ARTICLE.NS.equal(ns.getValue())).fetch();
    return buildArticles(result);
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
}

Fixed version (ground truth):
public List<Article> query(String title,Article.NameSpace ns){
  try {
    Connection conn=ds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    Result<Record> result=context.select().from(Tables.ARTICLE).where(Tables.ARTICLE.TITLE.likeIgnoreCase(title)).and(Tables.ARTICLE.NS.equal(ns.getValue())).fetch();
    conn.close();
    return buildArticles(result);
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
}
Program: 53089
Project: 53089
Buggy source:
public void save(Article article){
  try {
    Connection conn=bds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    context.insertInto(Tables.ARTICLE).values(article.getId(),article.getTitle(),article.getNs().getValue(),article.getType().getValue());
    conn.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void save(Article article){
  try {
    Connection conn=ds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    context.insertInto(Tables.ARTICLE).values(article.getId(),article.getTitle(),article.getNs().getValue(),article.getType().getValue());
    conn.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 53090
Project: 53090
Buggy source:
public ArticleDao(BoneCPDataSource dataSource) throws Exception {
  bds=dataSource;
}

Fixed version (ground truth):
public ArticleDao(DataSource dataSource) throws Exception {
  ds=dataSource;
}
Program: 53091
Project: 53091
Buggy source:
public ConceptDao(BoneCPDataSource dataSource) throws Exception {
  bds=dataSource;
}

Fixed version (ground truth):
public ConceptDao(DataSource dataSource) throws Exception {
  ds=dataSource;
}
Program: 53092
Project: 53092
Buggy source:
public Concept get(long cID){
  try {
    Connection conn=bds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    Record record=context.select().from(Tables.CONCEPT).where(Tables.CONCEPT.ID.equal(cID)).fetchOne();
    Concept c=new Concept(record.getValue(Tables.CONCEPT.ID),null);
    conn.close();
    return c;
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
}

Fixed version (ground truth):
public Concept get(long cId){
  try {
    Connection conn=ds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    Record record=context.select().from(Tables.CONCEPT).where(Tables.CONCEPT.ID.equal(cId)).fetchOne();
    Concept c=new Concept(record.getValue(Tables.CONCEPT.ID),null);
    conn.close();
    return c;
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
}
Program: 53093
Project: 53093
Buggy source:
public void save(Concept c){
  try {
    Connection conn=bds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    context.insertInto(Tables.CONCEPT,Tables.CONCEPT.ID).values(c.getId());
    conn.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void save(Concept c){
  try {
    Connection conn=ds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    context.insertInto(Tables.CONCEPT,Tables.CONCEPT.ID).values(c.getId());
    conn.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 53094
Project: 53094
Buggy source:
public Link get(int lId){
  try {
    Connection conn=bds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    Record record=context.select().from(Tables.LINK).where(Tables.LINK.ARTICLE_ID.equal(lId)).fetchOne();
    Link l=new Link(record.getValue(Tables.LINK.TEXT),record.getValue(Tables.LINK.ARTICLE_ID),false);
    conn.close();
    return l;
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
public Link get(int lId){
  try {
    Connection conn=ds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    Record record=context.select().from(Tables.LINK).where(Tables.LINK.ARTICLE_ID.equal(lId)).fetchOne();
    Link l=new Link(record.getValue(Tables.LINK.TEXT),record.getValue(Tables.LINK.ARTICLE_ID),false);
    conn.close();
    return l;
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}
Program: 53095
Project: 53095
Buggy source:
public List<Link> query(String lText){
  try {
    Connection conn=bds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    Result<Record> result=context.select().from(Tables.LINK).where(Tables.LINK.TEXT.likeIgnoreCase(lText)).fetch();
    conn.close();
    return buildLinks(result);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
public List<Link> query(String lText){
  try {
    Connection conn=ds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    Result<Record> result=context.select().from(Tables.LINK).where(Tables.LINK.TEXT.likeIgnoreCase(lText)).fetch();
    conn.close();
    return buildLinks(result);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}
Program: 53096
Project: 53096
Buggy source:
public void save(Link link){
  try {
    Connection conn=bds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    context.insertInto(Tables.LINK,Tables.LINK.ARTICLE_ID,Tables.LINK.TEXT).values(link.getId(),link.getText());
    conn.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void save(Link link){
  try {
    Connection conn=ds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    context.insertInto(Tables.LINK,Tables.LINK.ARTICLE_ID,Tables.LINK.TEXT).values(link.getId(),link.getText());
    conn.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 53097
Project: 53097
Buggy source:
public LinkDao(BoneCPDataSource bds){
  this.bds=bds;
}

Fixed version (ground truth):
public LinkDao(DataSource ds){
  this.ds=ds;
}
Program: 53098
Project: 53098
Buggy source:
public Article get(int wpId){
  try {
    Connection conn=bds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    Record record=context.select().from(Tables.ARTICLE).where(Tables.ARTICLE.ID.equal(wpId)).fetchOne();
    Article a=new Article(record.getValue(Tables.ARTICLE.ID),record.getValue(Tables.ARTICLE.TITLE),Article.NameSpace.intToNS(record.getValue(Tables.ARTICLE.NS)),Article.PageType.values()[record.getValue(Tables.ARTICLE.PTYPE)]);
    conn.close();
    return a;
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
}

Fixed version (ground truth):
public Article get(int wpId){
  try {
    Connection conn=ds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    Record record=context.select().from(Tables.ARTICLE).where(Tables.ARTICLE.ID.equal(wpId)).fetchOne();
    Article a=new Article(record.getValue(Tables.ARTICLE.ID),record.getValue(Tables.ARTICLE.TITLE),Article.NameSpace.intToNS(record.getValue(Tables.ARTICLE.NS)),Article.PageType.values()[record.getValue(Tables.ARTICLE.PTYPE)]);
    conn.close();
    return a;
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
}
Program: 53099
Project: 53099
Buggy source:
public ArrayList<Article> query(String title,Article.NameSpace ns){
  try {
    Connection conn=bds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    Result<Record> result=context.select().from(Tables.ARTICLE).where(Tables.ARTICLE.TITLE.likeIgnoreCase(title)).and(Tables.ARTICLE.NS.equal(ns.getValue())).fetch();
    return buildArticles(result);
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
}

Fixed version (ground truth):
public List<Article> query(String title,Article.NameSpace ns){
  try {
    Connection conn=ds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    Result<Record> result=context.select().from(Tables.ARTICLE).where(Tables.ARTICLE.TITLE.likeIgnoreCase(title)).and(Tables.ARTICLE.NS.equal(ns.getValue())).fetch();
    conn.close();
    return buildArticles(result);
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
}
Program: 53100
Project: 53100
Buggy source:
public void save(Article article){
  try {
    Connection conn=bds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    context.insertInto(Tables.ARTICLE).values(article.getId(),article.getTitle(),article.getNs().getValue(),article.getType().getValue());
    conn.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void save(Article article){
  try {
    Connection conn=ds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    context.insertInto(Tables.ARTICLE).values(article.getId(),article.getTitle(),article.getNs().getValue(),article.getType().getValue());
    conn.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 53101
Project: 53101
Buggy source:
public ArticleDao(BoneCPDataSource dataSource) throws Exception {
  bds=dataSource;
}

Fixed version (ground truth):
public ArticleDao(DataSource dataSource) throws Exception {
  ds=dataSource;
}
Program: 53102
Project: 53102
Buggy source:
public ConceptDao(BoneCPDataSource dataSource) throws Exception {
  bds=dataSource;
}

Fixed version (ground truth):
public ConceptDao(DataSource dataSource) throws Exception {
  ds=dataSource;
}
Program: 53103
Project: 53103
Buggy source:
public Concept get(long cID){
  try {
    Connection conn=bds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    Record record=context.select().from(Tables.CONCEPT).where(Tables.CONCEPT.ID.equal(cID)).fetchOne();
    Concept c=new Concept(record.getValue(Tables.CONCEPT.ID),null);
    conn.close();
    return c;
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
}

Fixed version (ground truth):
public Concept get(long cId){
  try {
    Connection conn=ds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    Record record=context.select().from(Tables.CONCEPT).where(Tables.CONCEPT.ID.equal(cId)).fetchOne();
    Concept c=new Concept(record.getValue(Tables.CONCEPT.ID),null);
    conn.close();
    return c;
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
}
Program: 53104
Project: 53104
Buggy source:
public void save(Concept c){
  try {
    Connection conn=bds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    context.insertInto(Tables.CONCEPT,Tables.CONCEPT.ID).values(c.getId());
    conn.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void save(Concept c){
  try {
    Connection conn=ds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    context.insertInto(Tables.CONCEPT,Tables.CONCEPT.ID).values(c.getId());
    conn.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 53105
Project: 53105
Buggy source:
public Link get(int lId){
  try {
    Connection conn=bds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    Record record=context.select().from(Tables.LINK).where(Tables.LINK.ARTICLE_ID.equal(lId)).fetchOne();
    Link l=new Link(record.getValue(Tables.LINK.TEXT),record.getValue(Tables.LINK.ARTICLE_ID),false);
    conn.close();
    return l;
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
public Link get(int lId){
  try {
    Connection conn=ds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    Record record=context.select().from(Tables.LINK).where(Tables.LINK.ARTICLE_ID.equal(lId)).fetchOne();
    Link l=new Link(record.getValue(Tables.LINK.TEXT),record.getValue(Tables.LINK.ARTICLE_ID),false);
    conn.close();
    return l;
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}
Program: 53106
Project: 53106
Buggy source:
public List<Link> query(String lText){
  try {
    Connection conn=bds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    Result<Record> result=context.select().from(Tables.LINK).where(Tables.LINK.TEXT.likeIgnoreCase(lText)).fetch();
    conn.close();
    return buildLinks(result);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
public List<Link> query(String lText){
  try {
    Connection conn=ds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    Result<Record> result=context.select().from(Tables.LINK).where(Tables.LINK.TEXT.likeIgnoreCase(lText)).fetch();
    conn.close();
    return buildLinks(result);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return null;
}
Program: 53107
Project: 53107
Buggy source:
public void save(Link link){
  try {
    Connection conn=bds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    context.insertInto(Tables.LINK,Tables.LINK.ARTICLE_ID,Tables.LINK.TEXT).values(link.getId(),link.getText());
    conn.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void save(Link link){
  try {
    Connection conn=ds.getConnection();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    context.insertInto(Tables.LINK,Tables.LINK.ARTICLE_ID,Tables.LINK.TEXT).values(link.getId(),link.getText());
    conn.close();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 53108
Project: 53108
Buggy source:
public LinkDao(BoneCPDataSource bds){
  this.bds=bds;
}

Fixed version (ground truth):
public LinkDao(DataSource ds){
  this.ds=ds;
}
Program: 53109
Project: 53109
Buggy source:
public Article get(int wpId){
  try {
    Connection conn=connect();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    Record record=context.select().from(Tables.ARTICLE).where(Tables.ARTICLE.ID.equal(wpId)).fetchOne();
    Article a=new Article(record.getValue(Tables.ARTICLE.ID),record.getValue(Tables.ARTICLE.TITLE),Article.NameSpace.intToNS(record.getValue(Tables.ARTICLE.NS)),Article.PageType.values()[record.getValue(Tables.ARTICLE.PTYPE)]);
    return null;
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
}

Fixed version (ground truth):
public Article get(int wpId){
  try {
    Connection conn=connect();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    Record record=context.select().from(Tables.ARTICLE).where(Tables.ARTICLE.ID.equal(wpId)).fetchOne();
    Article a=new Article(record.getValue(Tables.ARTICLE.ID),record.getValue(Tables.ARTICLE.TITLE),Article.NameSpace.intToNS(record.getValue(Tables.ARTICLE.NS)),Article.PageType.values()[record.getValue(Tables.ARTICLE.PTYPE)]);
    conn.close();
    return a;
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
}
Program: 53110
Project: 53110
Buggy source:
public Article get(int wpId){
  try {
    Connection conn=connect();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    Record record=context.select().from(Tables.ARTICLE).where(Tables.ARTICLE.ID.equal(wpId)).fetchOne();
    Article a=new Article(record.getValue(Tables.ARTICLE.ID),record.getValue(Tables.ARTICLE.TITLE),Article.NameSpace.intToNS(record.getValue(Tables.ARTICLE.NS)),Article.PageType.values()[record.getValue(Tables.ARTICLE.PTYPE)]);
    return null;
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
}

Fixed version (ground truth):
public Article get(int wpId){
  try {
    Connection conn=connect();
    DSLContext context=DSL.using(conn,SQLDialect.H2);
    Record record=context.select().from(Tables.ARTICLE).where(Tables.ARTICLE.ID.equal(wpId)).fetchOne();
    Article a=new Article(record.getValue(Tables.ARTICLE.ID),record.getValue(Tables.ARTICLE.TITLE),Article.NameSpace.intToNS(record.getValue(Tables.ARTICLE.NS)),Article.PageType.values()[record.getValue(Tables.ARTICLE.PTYPE)]);
    conn.close();
    return a;
  }
 catch (  Exception e) {
    e.printStackTrace();
    return null;
  }
}
Program: 53111
Project: 53111
Buggy source:
/** 
 * Returns the timezone offset in an integer For more information refer to the API Docs: <a href="https://developer.forecast.io">https://developer.forecast.io</a>
 * @return integer with the offset
 */
public int offsetValue(){
  return this.forecast.get("String_Node_Str").asInt();
}

Fixed version (ground truth):
/** 
 * Returns the timezone offset in an double For more information refer to the API Docs: <a href="https://developer.forecast.io">https://developer.forecast.io</a>
 * @return double with the offset
 */
public double offsetValue(){
  return this.forecast.get("String_Node_Str").asDouble();
}
Program: 53112
Project: 53112
Buggy source:
private void updateHexValue(int color){
  mHexInternalTextChange=true;
  if (getAlphaSliderVisible())   mHexVal.setText(ColorPickerPreference.convertToARGB(color));
 else   mHexVal.setText(ColorPickerPreference.convertToRGB(color));
  mHexInternalTextChange=false;
}

Fixed version (ground truth):
private void updateHexValue(int color){
  if (mHexInternalTextChange)   return;
  mHexInternalTextChange=true;
  if (getAlphaSliderVisible())   mHexVal.setText(ColorPickerPreference.convertToARGB(color));
 else   mHexVal.setText(ColorPickerPreference.convertToRGB(color));
  mHexInternalTextChange=false;
}
Program: 53113
Project: 53113
Buggy source:
@Override public void afterTextChanged(Editable s){
  if (mHexValueEnabled) {
    if (mHexInternalTextChange)     return;
    if (s.length() > 5 || s.length() < 10) {
      try {
        int c=ColorPickerPreference.convertToColorInt(s.toString());
        mColorPicker.setColor(c,true);
        mHexVal.setTextColor(mHexDefaultTextColor);
      }
 catch (      NumberFormatException e) {
        mHexVal.setTextColor(Color.RED);
      }
    }
 else     mHexVal.setTextColor(Color.RED);
  }
}

Fixed version (ground truth):
@Override public void afterTextChanged(Editable s){
  if (mHexValueEnabled) {
    if (mHexInternalTextChange)     return;
    if (s.length() > 5 || s.length() < 10) {
      try {
        int c=ColorPickerPreference.convertToColorInt(s.toString());
        mHexInternalTextChange=true;
        mColorPicker.setColor(c,true);
        mHexInternalTextChange=false;
        mHexVal.setTextColor(mHexDefaultTextColor);
      }
 catch (      NumberFormatException e) {
        mHexVal.setTextColor(Color.RED);
      }
    }
 else     mHexVal.setTextColor(Color.RED);
  }
}
Program: 53115
Project: 53115
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  final String action=intent.getAction();
  if (action.equals(LocationManager.PROVIDERS_CHANGED_ACTION)) {
    mGpsEnabled=Settings.Secure.isLocationProviderEnabled(mContext.getContentResolver(),LocationManager.GPS_PROVIDER);
    mGpsFixed&=mGpsEnabled;
  }
 else   if (action.equals(GPS_FIX_CHANGE_ACTION)) {
    mGpsFixed=intent.getBooleanExtra(EXTRA_GPS_ENABLED,false);
  }
  if (DEBUG)   log("String_Node_Str" + mGpsEnabled + "String_Node_Str"+ mGpsFixed);
  updateResources();
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  final String action=intent.getAction();
  if (action.equals(LocationManager.PROVIDERS_CHANGED_ACTION)) {
    mGpsEnabled=Settings.Secure.isLocationProviderEnabled(mContext.getContentResolver(),LocationManager.GPS_PROVIDER);
    mGpsFixed=false;
  }
 else   if (action.equals(GPS_FIX_CHANGE_ACTION)) {
    mGpsFixed=intent.getBooleanExtra(EXTRA_GPS_ENABLED,false);
  }
  if (DEBUG)   log("String_Node_Str" + mGpsEnabled + "String_Node_Str"+ mGpsFixed);
  updateResources();
}
Program: 53122
Project: 53122
Buggy source:
private void setChartColors(){
  if (dataset.getSeriesCount() > 0) {
    for (int i=0; i < activeProcessors.size(); i++) {
      for (      Map.Entry<String,Integer> entry : seriesIndex.get(i).entrySet()) {
        ProcessorPreset processorPreset=activeProcessors.get(i);
        ((AbstractRenderer)jFreeChart.getXYPlot().getRendererForDataset(dataset)).setSeriesPaint(entry.getValue(),processorPreset.getColors().get(entry.getKey()),false);
      }
    }
  }
}

Fixed version (ground truth):
private void setChartColors(){
  if (dataset.getSeriesCount() > 0) {
    for (int i=0; i < activeProcessors.size(); i++) {
      for (      Map.Entry<String,Integer> entry : seriesIndex.get(i).entrySet()) {
        ProcessorPreset processorPreset=activeProcessors.get(i);
        AbstractRenderer renderer=(AbstractRenderer)jFreeChart.getXYPlot().getRendererForDataset(dataset);
        renderer.setSeriesPaint(entry.getValue(),processorPreset.getColors().get(entry.getKey()),true);
      }
    }
  }
}
Program: 53123
Project: 53123
Buggy source:
private void loadPreset(Preset preset){
  processorsListModel.setRowCount(0);
  for (  ProcessorPreset pp : preset.getProcessorPresets()) {
    updatePresetParameters(pp,null);
    processorsListModel.addRow(new Object[]{true,pp});
  }
  updateUsedColors();
}

Fixed version (ground truth):
private void loadPreset(Preset preset){
  processorsListModel.setRowCount(0);
  for (  ProcessorPreset pp : preset.getProcessorPresets()) {
    updatePresetParameters(pp,null);
    processorsListModel.addRow(new Object[]{true,pp.clone()});
  }
  updateUsedColors();
}
Program: 53125
Project: 53125
Buggy source:
private void openLog(String logFileName){
  String logFileNameLower=logFileName.toLowerCase();
  LogReader logReaderNew=null;
  try {
    if (logFileNameLower.endsWith("String_Node_Str") || logFileNameLower.endsWith("String_Node_Str")) {
      logReaderNew=new PX4LogReader(logFileName);
    }
 else     if (logFileNameLower.endsWith("String_Node_Str")) {
      logReaderNew=new ULogReader(logFileName);
    }
 else {
      setStatus("String_Node_Str" + logFileName);
      return;
    }
  }
 catch (  Exception e) {
    setStatus("String_Node_Str" + e);
    e.printStackTrace();
    return;
  }
  mainFrame.setTitle(appNameAndVersion + "String_Node_Str" + logFileName);
  if (logReader != null) {
    try {
      logReader.close();
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
    logReader=null;
  }
  logReader=logReaderNew;
  logInfo.updateInfo(logReader);
  fieldsListDialog.setFieldsList(logReader.getFields());
  onTimeModeChanged();
  jFreeChart.getXYPlot().getDomainAxis().setAutoRange(true);
  jFreeChart.getXYPlot().getRangeAxis().setAutoRange(true);
  processFile();
}

Fixed version (ground truth):
private void openLog(String logFileName){
  String logFileNameLower=logFileName.toLowerCase();
  LogReader logReaderNew;
  try {
    if (logFileNameLower.endsWith("String_Node_Str") || logFileNameLower.endsWith("String_Node_Str")) {
      logReaderNew=new PX4LogReader(logFileName);
    }
 else     if (logFileNameLower.endsWith("String_Node_Str")) {
      logReaderNew=new ULogReader(logFileName);
    }
 else {
      setStatus("String_Node_Str" + logFileName);
      return;
    }
  }
 catch (  Exception e) {
    setStatus("String_Node_Str" + e);
    e.printStackTrace();
    return;
  }
  mainFrame.setTitle(appNameAndVersion + "String_Node_Str" + logFileName);
  if (logReader != null) {
    try {
      logReader.close();
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
    logReader=null;
  }
  logReader=logReaderNew;
  logInfo.updateInfo(logReader);
  fieldsListDialog.setFieldsList(logReader.getFields());
  onTimeModeChanged();
  jFreeChart.getXYPlot().getDomainAxis().setAutoRange(true);
  jFreeChart.getXYPlot().getRangeAxis().setAutoRange(true);
  processFile();
}
Program: 53126
Project: 53126
Buggy source:
@Override public void tableChanged(TableModelEvent e){
  if (e.getType() == TableModelEvent.UPDATE) {
    int row=e.getFirstRow();
    onParameterChanged(row);
  }
}

Fixed version (ground truth):
@Override public void tableChanged(TableModelEvent e){
  if (e.getType() == TableModelEvent.UPDATE) {
    int row=e.getFirstRow();
    onParameterChanged(row);
    editingProcessor=null;
  }
}
Program: 53127
Project: 53127
Buggy source:
private void onParameterChanged(int row){
  if (editingProcessor != null) {
    String key=parametersTableModel.getValueAt(row,0).toString();
    Object value=parametersTableModel.getValueAt(row,1);
    if (value instanceof Color) {
      editingProcessor.getColors().put(key.substring(colorParamPrefix.length(),key.length()),(Color)value);
      setChartColors();
    }
 else {
      try {
        updatePresetParameters(editingProcessor,Collections.<String,Object>singletonMap(key,value.toString()));
        updatePresetEdited(true);
      }
 catch (      Exception e) {
        e.printStackTrace();
        setStatus("String_Node_Str" + e);
      }
      parametersTableModel.removeTableModelListener(parameterChangedListener);
      showProcessorParameters();
      parametersTableModel.addTableModelListener(parameterChangedListener);
      parametersTable.addRowSelectionInterval(row,row);
      processFile();
    }
  }
}

Fixed version (ground truth):
private void onParameterChanged(int row){
  if (editingProcessor != null && editingProcessor == getSelectedProcessor()) {
    String key=parametersTableModel.getValueAt(row,0).toString();
    Object value=parametersTableModel.getValueAt(row,1);
    if (value instanceof Color) {
      editingProcessor.getColors().put(key.substring(colorParamPrefix.length(),key.length()),(Color)value);
      setChartColors();
    }
    try {
      updatePresetParameters(editingProcessor,Collections.<String,Object>singletonMap(key,value.toString()));
      updatePresetEdited(true);
    }
 catch (    Exception e) {
      e.printStackTrace();
      setStatus("String_Node_Str" + e);
    }
    if (!(value instanceof Color)) {
      parametersTableModel.removeTableModelListener(parameterChangedListener);
      showProcessorParameters();
      parametersTableModel.addTableModelListener(parameterChangedListener);
      parametersTable.addRowSelectionInterval(row,row);
      processFile();
    }
  }
}
Program: 53128
Project: 53128
Buggy source:
private Preset formatPreset(String title){
  List<ProcessorPreset> processorPresets=new ArrayList<ProcessorPreset>();
  for (int i=0; i < processorsListModel.getRowCount(); i++) {
    processorPresets.add((ProcessorPreset)processorsListModel.getValueAt(i,1));
  }
  return new Preset(title,processorPresets);
}

Fixed version (ground truth):
private Preset formatPreset(String title){
  List<ProcessorPreset> processorPresets=new ArrayList<ProcessorPreset>();
  for (int i=0; i < processorsListModel.getRowCount(); i++) {
    processorPresets.add(((ProcessorPreset)processorsListModel.getValueAt(i,1)).clone());
  }
  return new Preset(title,processorPresets);
}
Program: 53130
Project: 53130
Buggy source:
@Override public void valueChanged(ListSelectionEvent listSelectionEvent){
  showProcessorParameters();
}

Fixed version (ground truth):
@Override public void valueChanged(ListSelectionEvent listSelectionEvent){
  if (editingProcessor == null) {
    showProcessorParameters();
  }
}