nus-yam/ex-repair huggingface dataset:
Program: 117618
Project: 117618
Buggy source:
@SuppressWarnings("String_Node_Str") @GetMany(LanguageStrings.class) public CloseableIterator<LanguageStrings> getManyLanguageStrings(final Map<String,Object> query,final PipelineContext context){
  final Platform platform=(Platform)query.get("String_Node_Str");
  final Iterable<String> locales=(Iterable<String>)query.get("String_Node_Str");
  Utilities.checkNotNull(platform,"String_Node_Str",locales,"String_Node_Str");
  final String version=query.get("String_Node_Str") == null ? getCurrentVersion(platform,context) : (String)query.get("String_Node_Str");
  final Iterator<String> iterator=locales.iterator();
  return CloseableIterators.from(new Iterator<LanguageStrings>(){
    @Override public boolean hasNext(){
      return iterator.hasNext();
    }
    @Override public LanguageStrings next(){
      final String locale=iterator.next();
      final String content=get("String_Node_Str",version,locale);
      final LanguageStrings data=DataObject.fromJSON(LanguageStrings.class,content);
      data.setPlatform(platform.getTag());
      data.setLocale(locale);
      return data;
    }
    @Override public void remove(){
      throw new UnsupportedOperationException();
    }
  }
);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @GetMany(LanguageStrings.class) public CloseableIterator<LanguageStrings> getManyLanguageStrings(final Map<String,Object> query,final PipelineContext context){
  final Platform platform=(Platform)query.get("String_Node_Str");
  final Iterable<String> locales=(Iterable<String>)query.get("String_Node_Str");
  Utilities.checkNotNull(platform,"String_Node_Str",locales,"String_Node_Str");
  final String version=query.get("String_Node_Str") == null ? getCurrentVersion(platform,context) : (String)query.get("String_Node_Str");
  final Iterator<String> iterator=locales.iterator();
  return CloseableIterators.from(new Iterator<LanguageStrings>(){
    @Override public boolean hasNext(){
      return iterator.hasNext();
    }
    @Override public LanguageStrings next(){
      final String locale=iterator.next();
      final String content=get("String_Node_Str",version,locale);
      final LanguageStrings data=DataObject.fromJSON(LanguageStrings.class,content);
      if (data == null) {
        return null;
      }
      data.setPlatform(platform.getTag());
      data.setLocale(locale);
      return data;
    }
    @Override public void remove(){
      throw new UnsupportedOperationException();
    }
  }
);
}
Program: 117619
Project: 117619
Buggy source:
@Get(Versions.class) public Versions getVersions(final Map<String,Object> query,final PipelineContext context){
  final Platform platform=(Platform)query.get("String_Node_Str");
  Utilities.checkNotNull(platform,"String_Node_Str");
  final String content=get("String_Node_Str",null,null);
  final Versions data=DataObject.fromJSON(Versions.class,content);
  data.setPlatform(platform.getTag());
  return data;
}

Fixed version (ground truth):
@Get(Versions.class) public Versions getVersions(final Map<String,Object> query,final PipelineContext context){
  final Platform platform=(Platform)query.get("String_Node_Str");
  Utilities.checkNotNull(platform,"String_Node_Str");
  final String content=get("String_Node_Str",null,null);
  final Versions data=DataObject.fromJSON(Versions.class,content);
  if (data == null) {
    return null;
  }
  data.setPlatform(platform.getTag());
  return data;
}
Program: 117620
Project: 117620
Buggy source:
@Get(LanguageStrings.class) public LanguageStrings getLanguageStrings(final Map<String,Object> query,final PipelineContext context){
  final Platform platform=(Platform)query.get("String_Node_Str");
  Utilities.checkNotNull(platform,"String_Node_Str");
  final String version=query.get("String_Node_Str") == null ? getCurrentVersion(platform,context) : (String)query.get("String_Node_Str");
  final String locale=query.get("String_Node_Str") == null ? platform.getDefaultLocale() : (String)query.get("String_Node_Str");
  final String content=get("String_Node_Str",version,locale);
  final LanguageStrings data=DataObject.fromJSON(LanguageStrings.class,content);
  data.setPlatform(platform.getTag());
  data.setLocale(locale);
  return data;
}

Fixed version (ground truth):
@Get(LanguageStrings.class) public LanguageStrings getLanguageStrings(final Map<String,Object> query,final PipelineContext context){
  final Platform platform=(Platform)query.get("String_Node_Str");
  Utilities.checkNotNull(platform,"String_Node_Str");
  final String version=query.get("String_Node_Str") == null ? getCurrentVersion(platform,context) : (String)query.get("String_Node_Str");
  final String locale=query.get("String_Node_Str") == null ? platform.getDefaultLocale() : (String)query.get("String_Node_Str");
  final String content=get("String_Node_Str",version,locale);
  final LanguageStrings data=DataObject.fromJSON(LanguageStrings.class,content);
  if (data == null) {
    return null;
  }
  data.setPlatform(platform.getTag());
  data.setLocale(locale);
  return data;
}
Program: 117621
Project: 117621
Buggy source:
@SuppressWarnings("String_Node_Str") @GetMany(Languages.class) public CloseableIterator<Languages> getManyLanguages(final Map<String,Object> query,final PipelineContext context){
  final Iterable<Platform> platforms=(Iterable<Platform>)query.get("String_Node_Str");
  Utilities.checkNotNull(platforms,"String_Node_Str");
  final Iterator<Platform> iterator=platforms.iterator();
  return CloseableIterators.from(new Iterator<Languages>(){
    @Override public boolean hasNext(){
      return iterator.hasNext();
    }
    @Override public Languages next(){
      final Platform platform=iterator.next();
      final String content=get("String_Node_Str",null,null);
      final Languages data=DataObject.fromJSON(Languages.class,content);
      data.setPlatform(platform.getTag());
      return data;
    }
    @Override public void remove(){
      throw new UnsupportedOperationException();
    }
  }
);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @GetMany(Languages.class) public CloseableIterator<Languages> getManyLanguages(final Map<String,Object> query,final PipelineContext context){
  final Iterable<Platform> platforms=(Iterable<Platform>)query.get("String_Node_Str");
  Utilities.checkNotNull(platforms,"String_Node_Str");
  final Iterator<Platform> iterator=platforms.iterator();
  return CloseableIterators.from(new Iterator<Languages>(){
    @Override public boolean hasNext(){
      return iterator.hasNext();
    }
    @Override public Languages next(){
      final Platform platform=iterator.next();
      final String content=get("String_Node_Str",null,null);
      final Languages data=DataObject.fromJSON(Languages.class,content);
      if (data == null) {
        return null;
      }
      data.setPlatform(platform.getTag());
      return data;
    }
    @Override public void remove(){
      throw new UnsupportedOperationException();
    }
  }
);
}
Program: 117623
Project: 117623
Buggy source:
@SuppressWarnings("String_Node_Str") @GetMany(MapData.class) public CloseableIterator<MapData> getManyMapData(final Map<String,Object> query,final PipelineContext context){
  final Platform platform=(Platform)query.get("String_Node_Str");
  final Iterable<String> versions=(Iterable<String>)query.get("String_Node_Str");
  Utilities.checkNotNull(platform,"String_Node_Str",versions,"String_Node_Str");
  final String locale=query.get("String_Node_Str") == null ? platform.getDefaultLocale() : (String)query.get("String_Node_Str");
  final Iterator<String> iterator=versions.iterator();
  return CloseableIterators.from(new Iterator<MapData>(){
    @Override public boolean hasNext(){
      return iterator.hasNext();
    }
    @Override public MapData next(){
      final String version=iterator.next();
      final String content=get("String_Node_Str",version,locale);
      final MapData data=DataObject.fromJSON(MapData.class,content);
      data.setPlatform(platform.getTag());
      data.setLocale(locale);
      for (      final MapDetails map : data.getData().values()) {
        map.setPlatform(platform.getTag());
        map.setVersion(data.getVersion());
        map.setLocale(locale);
      }
      return data;
    }
    @Override public void remove(){
      throw new UnsupportedOperationException();
    }
  }
);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @GetMany(MapData.class) public CloseableIterator<MapData> getManyMapData(final Map<String,Object> query,final PipelineContext context){
  final Platform platform=(Platform)query.get("String_Node_Str");
  final Iterable<String> versions=(Iterable<String>)query.get("String_Node_Str");
  Utilities.checkNotNull(platform,"String_Node_Str",versions,"String_Node_Str");
  final String locale=query.get("String_Node_Str") == null ? platform.getDefaultLocale() : (String)query.get("String_Node_Str");
  final Iterator<String> iterator=versions.iterator();
  return CloseableIterators.from(new Iterator<MapData>(){
    @Override public boolean hasNext(){
      return iterator.hasNext();
    }
    @Override public MapData next(){
      final String version=iterator.next();
      final String content=get("String_Node_Str",version,locale);
      final MapData data=DataObject.fromJSON(MapData.class,content);
      if (data == null) {
        return null;
      }
      data.setPlatform(platform.getTag());
      data.setLocale(locale);
      for (      final MapDetails map : data.getData().values()) {
        map.setPlatform(platform.getTag());
        map.setVersion(data.getVersion());
        map.setLocale(locale);
      }
      return data;
    }
    @Override public void remove(){
      throw new UnsupportedOperationException();
    }
  }
);
}
Program: 117634
Project: 117634
Buggy source:
@SuppressWarnings("String_Node_Str") @GetMany(Versions.class) public CloseableIterator<Versions> getManyVersions(final Map<String,Object> query,final PipelineContext context){
  final Iterable<Platform> platforms=(Iterable<Platform>)query.get("String_Node_Str");
  Utilities.checkNotNull(platforms,"String_Node_Str");
  final Iterator<Platform> iterator=platforms.iterator();
  return CloseableIterators.from(new Iterator<Versions>(){
    @Override public boolean hasNext(){
      return iterator.hasNext();
    }
    @Override public Versions next(){
      final Platform platform=iterator.next();
      Utilities.checkNotNull(platform,"String_Node_Str");
      final String content=get("String_Node_Str",null,null);
      final Versions data=DataObject.fromJSON(Versions.class,content);
      data.setPlatform(platform.getTag());
      return data;
    }
    @Override public void remove(){
      throw new UnsupportedOperationException();
    }
  }
);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @GetMany(Versions.class) public CloseableIterator<Versions> getManyVersions(final Map<String,Object> query,final PipelineContext context){
  final Iterable<Platform> platforms=(Iterable<Platform>)query.get("String_Node_Str");
  Utilities.checkNotNull(platforms,"String_Node_Str");
  final Iterator<Platform> iterator=platforms.iterator();
  return CloseableIterators.from(new Iterator<Versions>(){
    @Override public boolean hasNext(){
      return iterator.hasNext();
    }
    @Override public Versions next(){
      final Platform platform=iterator.next();
      Utilities.checkNotNull(platform,"String_Node_Str");
      final String content=get("String_Node_Str",null,null);
      final Versions data=DataObject.fromJSON(Versions.class,content);
      if (data == null) {
        return null;
      }
      data.setPlatform(platform.getTag());
      return data;
    }
    @Override public void remove(){
      throw new UnsupportedOperationException();
    }
  }
);
}
Program: 117636
Project: 117636
Buggy source:
@Override public void call(){
  putChampion(champion,null);
}

Fixed version (ground truth):
@Override public void call(){
  putItem(item,null);
}
Program: 117637
Project: 117637
Buggy source:
@SuppressWarnings("String_Node_Str") @Get(Champion.class) public Champion getChampion(final Map<String,Object> query,final PipelineContext context){
  final Platform platform=(Platform)query.get("String_Node_Str");
  Utilities.checkNotNull(platform,"String_Node_Str");
  final Integer id=(Integer)query.get("String_Node_Str");
  final String name=(String)query.get("String_Node_Str");
  Utilities.checkAtLeastOneNotNull(id,"String_Node_Str",name,"String_Node_Str");
  final String version=query.get("String_Node_Str") == null ? getCurrentVersion(platform,context) : (String)query.get("String_Node_Str");
  final String locale=query.get("String_Node_Str") == null ? platform.getDefaultLocale() : (String)query.get("String_Node_Str");
  final Set<String> includedData=query.get("String_Node_Str") == null ? ImmutableSet.of("String_Node_Str") : (Set<String>)query.get("String_Node_Str");
  final ChampionData data=new ChampionData(id == null ? 0 : id.intValue(),name,platform,version,locale,includedData);
  return new Champion(data);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Get(Champion.class) public Champion getChampion(final Map<String,Object> query,final PipelineContext context){
  final Platform platform=(Platform)query.get("String_Node_Str");
  Utilities.checkNotNull(platform,"String_Node_Str");
  final Integer id=(Integer)query.get("String_Node_Str");
  final String name=(String)query.get("String_Node_Str");
  Utilities.checkAtLeastOneNotNull(id,"String_Node_Str",name,"String_Node_Str");
  final String version=query.get("String_Node_Str") == null ? getCurrentVersion(platform,context) : (String)query.get("String_Node_Str");
  final String locale=query.get("String_Node_Str") == null ? platform.getDefaultLocale() : (String)query.get("String_Node_Str");
  final Set<String> includedData=query.get("String_Node_Str") == null ? ImmutableSet.of("String_Node_Str") : (Set<String>)query.get("String_Node_Str");
  final ChampionData data=new ChampionData();
  data.getChampion().setId(id == null ? 0 : id.intValue());
  data.getStatus().setId(id == null ? 0 : id.intValue());
  data.getChampion().setName(name);
  data.getChampion().setPlatform(platform);
  data.getStatus().setPlatform(platform);
  data.getChampion().setVersion(version);
  data.getChampion().setLocale(locale);
  data.getChampion().setIncludedData(includedData);
  return new Champion(data);
}
Program: 117638
Project: 117638
Buggy source:
@SuppressWarnings("String_Node_Str") @GetMany(Realm.class) public CloseableIterator<Realm> getManyRealm(final Map<String,Object> query,final PipelineContext context){
  final Iterable<Platform> platforms=(Iterable<Platform>)query.get("String_Node_Str");
  Utilities.checkNotNull(platforms,"String_Node_Str");
  final Iterator<Platform> iterator=platforms.iterator();
  return CloseableIterators.from(new Iterator<Realm>(){
    @Override public boolean hasNext(){
      return iterator.hasNext();
    }
    @Override public Realm next(){
      final Platform platform=iterator.next();
      final String content=get("String_Node_Str" + platform.getRegion().getTag(),null,null);
      final Realm data=DataObject.fromJSON(Realm.class,content);
      data.setPlatform(platform.getTag());
      return data;
    }
    @Override public void remove(){
      throw new UnsupportedOperationException();
    }
  }
);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @GetMany(Realm.class) public CloseableIterator<Realm> getManyRealm(final Map<String,Object> query,final PipelineContext context){
  final Iterable<Platform> platforms=(Iterable<Platform>)query.get("String_Node_Str");
  Utilities.checkNotNull(platforms,"String_Node_Str");
  final Iterator<Platform> iterator=platforms.iterator();
  return CloseableIterators.from(new Iterator<Realm>(){
    @Override public boolean hasNext(){
      return iterator.hasNext();
    }
    @Override public Realm next(){
      final Platform platform=iterator.next();
      final String content=get("String_Node_Str" + platform.getRegion().getTag().toLowerCase(),null,null);
      final Realm data=DataObject.fromJSON(Realm.class,content);
      data.setPlatform(platform.getTag());
      return data;
    }
    @Override public void remove(){
      throw new UnsupportedOperationException();
    }
  }
);
}
Program: 117639
Project: 117639
Buggy source:
@Get(Realm.class) public Realm getRealm(final Map<String,Object> query,final PipelineContext context){
  final Platform platform=(Platform)query.get("String_Node_Str");
  Utilities.checkNotNull(platform,"String_Node_Str");
  final String content=get("String_Node_Str" + platform.getRegion().getTag(),null,null);
  final Realm data=DataObject.fromJSON(Realm.class,content);
  data.setPlatform(platform.getTag());
  return data;
}

Fixed version (ground truth):
@Get(Realm.class) public Realm getRealm(final Map<String,Object> query,final PipelineContext context){
  final Platform platform=(Platform)query.get("String_Node_Str");
  Utilities.checkNotNull(platform,"String_Node_Str");
  final String content=get("String_Node_Str" + platform.getRegion().getTag().toLowerCase(),null,null);
  final Realm data=DataObject.fromJSON(Realm.class,content);
  data.setPlatform(platform.getTag());
  return data;
}
Program: 117640
Project: 117640
Buggy source:
@Get(Champion.class) public Champion getChampion(final Map<String,Object> query,final PipelineContext context){
  final Platform platform=(Platform)query.get("String_Node_Str");
  Utilities.checkNotNull(platform,"String_Node_Str");
  final Integer id=(Integer)query.get("String_Node_Str");
  final String name=(String)query.get("String_Node_Str");
  Utilities.checkAtLeastOneNotNull(id,"String_Node_Str",name,"String_Node_Str");
  final String version=query.get("String_Node_Str") == null ? getCurrentVersion(platform,context) : (String)query.get("String_Node_Str");
  final String locale=query.get("String_Node_Str") == null ? platform.getDefaultLocale() : (String)query.get("String_Node_Str");
  final ChampionData data=new ChampionData(id == null ? 0 : id.intValue(),name,platform,version,locale);
  return new Champion(data);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Get(Champion.class) public Champion getChampion(final Map<String,Object> query,final PipelineContext context){
  final Platform platform=(Platform)query.get("String_Node_Str");
  Utilities.checkNotNull(platform,"String_Node_Str");
  final Integer id=(Integer)query.get("String_Node_Str");
  final String name=(String)query.get("String_Node_Str");
  Utilities.checkAtLeastOneNotNull(id,"String_Node_Str",name,"String_Node_Str");
  final String version=query.get("String_Node_Str") == null ? getCurrentVersion(platform,context) : (String)query.get("String_Node_Str");
  final String locale=query.get("String_Node_Str") == null ? platform.getDefaultLocale() : (String)query.get("String_Node_Str");
  final Set<String> includedData=query.get("String_Node_Str") == null ? ImmutableSet.of("String_Node_Str") : (Set<String>)query.get("String_Node_Str");
  final ChampionData data=new ChampionData(id == null ? 0 : id.intValue(),name,platform,version,locale,includedData);
  return new Champion(data);
}
Program: 117642
Project: 117642
Buggy source:
protected void load(final String group){
  Boolean loaded=groups.get(group);
  if (loaded == null || !loaded) {
    Object lock=groupLocks.get(group);
    if (lock == null) {
synchronized (groupLocks) {
        lock=groupLocks.get(group);
        if (lock == null) {
          lock=new Object();
          groupLocks.put(group,lock);
        }
      }
    }
    boolean callHooks=false;
synchronized (lock) {
      loaded=groups.get(group);
      if (loaded == null || !loaded) {
        loadCoreData(group);
        groups.put(group,Boolean.TRUE);
        callHooks=true;
      }
    }
    if (callHooks) {
synchronized (loadHookLock) {
        for (        final LoadHook hook : loadHooks.get(group)) {
          hook.call();
        }
        loadHooks.remove(group);
        if (loadHooks.isEmpty()) {
          loadHooks=null;
        }
      }
    }
  }
}

Fixed version (ground truth):
protected void load(final String group){
  Boolean loaded=groups.get(group);
  if (loaded == null || !loaded) {
    Object lock=groupLocks.get(group);
    if (lock == null) {
synchronized (groupLocks) {
        lock=groupLocks.get(group);
        if (lock == null) {
          lock=new Object();
          groupLocks.put(group,lock);
        }
      }
    }
    boolean callHooks=false;
synchronized (lock) {
      loaded=groups.get(group);
      if (loaded == null || !loaded) {
        loadCoreData(group);
        groups.put(group,Boolean.TRUE);
        callHooks=true;
      }
    }
    if (callHooks) {
synchronized (loadHookLock) {
        if (loadHooks != null) {
          for (          final LoadHook hook : loadHooks.get(group)) {
            hook.call();
          }
          loadHooks.remove(group);
          if (loadHooks.isEmpty()) {
            loadHooks=null;
          }
        }
      }
    }
  }
}
Program: 117643
Project: 117643
Buggy source:
public Champion(final String name,final Platform platform,final String version,final String locale){
  super(new ChampionData(name,platform,version,locale),2);
}

Fixed version (ground truth):
public Champion(final ChampionData coreData){
  super(coreData,2);
}
Program: 117644
Project: 117644
Buggy source:
public ChampionData(final String name,final Platform platform,final String version,final String locale){
  this(0,name,platform,version,locale);
}

Fixed version (ground truth):
public ChampionData(final int id,final String name,final Platform platform,final String version,final String locale,final Set<String> includedData){
  champion=new com.merakianalytics.orianna.types.data.staticdata.Champion();
  champion.setId(id);
  champion.setName(name);
  champion.setPlatform(platform);
  champion.setVersion(version);
  champion.setLocale(locale);
  champion.setIncludedData(ImmutableSet.copyOf(includedData));
  status=new ChampionStatus();
  status.setId(id);
  status.setPlatform(platform);
}
Program: 117645
Project: 117645
Buggy source:
/** 
 * @param < T > the type to iterate
 * @param iterator the non-closeable iterator to wrap
 * @return a wrapped version of the iterator
 */
public static <T>CloseableIterator<T> fromIterator(final Iterator<T> iterator){
  return new CloseableIterator<T>(){
    @Override public void close() throws Exception {
    }
    @Override public boolean hasNext(){
      return iterator.hasNext();
    }
    @Override public T next(){
      return iterator.next();
    }
  }
;
}

Fixed version (ground truth):
/** 
 * @param < T > the type to iterate
 * @param iterator the non-closeable iterator to wrap
 * @return a wrapped version of the iterator
 */
public static <T>CloseableIterator<T> fromIterator(final Iterator<T> iterator){
  return new CloseableIterator<T>(){
    @Override public void close() throws Exception {
    }
    @Override public boolean hasNext(){
      return iterator.hasNext();
    }
    @Override public T next(){
      return iterator.next();
    }
    @Override public void remove(){
      iterator.remove();
    }
  }
;
}
Program: 117646
Project: 117646
Buggy source:
@Override public void waitForCall(){
  semaphore.acquireUninterruptibly();
}

Fixed version (ground truth):
@Override public void waitForCall(){
  semaphore.acquireUninterruptibly();
  current++;
}
Program: 117647
Project: 117647
Buggy source:
@Override public void run(){
  try {
    Thread.sleep(millisPerEpoch);
    semaphore.drainPermits();
    semaphore.release(limit);
    needToWait=true;
  }
 catch (  final InterruptedException e) {
    throw new OriannaException("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void run(){
  semaphore.drainPermits();
  resetRunning=false;
  semaphore.release(limit - current);
}
Program: 117648
Project: 117648
Buggy source:
@Override public synchronized void registerCall(){
  if (needToWait) {
    needToWait=false;
    final Thread t=new Thread(new ResetThread());
    t.setDaemon(true);
    t.start();
  }
}

Fixed version (ground truth):
@Override public synchronized void registerCall(){
  if (!resetRunning) {
    timer.schedule(new ResetTask(),millisPerEpoch);
    resetRunning=true;
  }
  current--;
}
Program: 117649
Project: 117649
Buggy source:
/** 
 * Total damate taken
 * @return total damate taken
 */
public int getTotalDamageTaken(){
  return super.getInteger(data.getTotalDamageTaken());
}

Fixed version (ground truth):
/** 
 * Total damage taken
 * @return total damage taken
 */
public int getTotalDamageTaken(){
  return super.getInteger(data.getTotalDamageTaken());
}
Program: 117650
Project: 117650
Buggy source:
/** 
 * Gets all stored team IDs for batch lookup
 * @return the team IDs
 */
public Set<String> getTeamIDs(){
  final Set<String> set=new HashSet<>();
  if (participantId != null) {
    try {
      Long.parseLong(participantId);
    }
 catch (    final NumberFormatException e) {
      set.add(participantId);
    }
    for (    final LeagueEntry entry : entries) {
      try {
        Long.parseLong(entry.getPlayerOrTeamId());
      }
 catch (      final NumberFormatException e) {
        set.add(participantId);
      }
    }
  }
  return set;
}

Fixed version (ground truth):
/** 
 * Gets all stored team IDs for batch lookup
 * @return the team IDs
 */
public Set<String> getTeamIDs(){
  final Set<String> set=new HashSet<>();
  if (participantId != null) {
    try {
      Long.parseLong(participantId);
    }
 catch (    final NumberFormatException e) {
      set.add(participantId);
    }
  }
  for (  final LeagueEntry entry : entries) {
    try {
      Long.parseLong(entry.getPlayerOrTeamId());
    }
 catch (    final NumberFormatException e) {
      set.add(participantId);
    }
  }
  return set;
}
Program: 117651
Project: 117651
Buggy source:
/** 
 * Gets all stored summoner IDs for batch lookup
 * @return the summoner IDs
 */
public Set<Long> getSummonerIDs(){
  final Set<Long> set=new HashSet<>();
  if (participantId != null) {
    Long ID;
    try {
      ID=Long.parseLong(participantId);
      set.add(ID);
    }
 catch (    final NumberFormatException e) {
    }
    for (    final LeagueEntry entry : entries) {
      try {
        ID=Long.parseLong(entry.getPlayerOrTeamId());
        set.add(ID);
      }
 catch (      final NumberFormatException e) {
      }
    }
  }
  return set;
}

Fixed version (ground truth):
/** 
 * Gets all stored summoner IDs for batch lookup
 * @return the summoner IDs
 */
public Set<Long> getSummonerIDs(){
  final Set<Long> set=new HashSet<>();
  long ID;
  if (participantId != null) {
    try {
      ID=Long.parseLong(participantId);
      set.add(ID);
    }
 catch (    final NumberFormatException e) {
    }
  }
  for (  final LeagueEntry entry : entries) {
    try {
      ID=Long.parseLong(entry.getPlayerOrTeamId());
      set.add(ID);
    }
 catch (    final NumberFormatException e) {
    }
  }
  return set;
}
Program: 117652
Project: 117652
Buggy source:
/** 
 * Gets all stored team IDs for batch lookup
 * @return the team IDs
 */
public Set<String> getTeamIDs(){
  final Set<String> set=new HashSet<>();
  if (participantId != null) {
    try {
      Long.parseLong(participantId);
    }
 catch (    final NumberFormatException e) {
      set.add(participantId);
    }
  }
  for (  final LeagueEntry entry : entries) {
    try {
      Long.parseLong(entry.getPlayerOrTeamId());
    }
 catch (    final NumberFormatException e) {
      set.add(participantId);
    }
  }
  return set;
}

Fixed version (ground truth):
/** 
 * Gets all stored team IDs for batch lookup
 * @return the team IDs
 */
public Set<String> getTeamIDs(){
  final Set<String> set=new HashSet<>();
  if (participantId != null) {
    try {
      Long.parseLong(participantId);
    }
 catch (    final NumberFormatException e) {
      set.add(participantId);
    }
  }
  for (  final LeagueEntry entry : entries) {
    if (entry.getPlayerOrTeamId() != null) {
      try {
        Long.parseLong(entry.getPlayerOrTeamId());
      }
 catch (      final NumberFormatException e) {
        set.add(entry.getPlayerOrTeamId());
      }
    }
  }
  return set;
}
Program: 117653
Project: 117653
Buggy source:
/** 
 * Gets all stored summoner IDs for batch lookup
 * @return the summoner IDs
 */
public Set<Long> getSummonerIDs(){
  final Set<Long> set=new HashSet<>();
  long ID;
  if (participantId != null) {
    try {
      ID=Long.parseLong(participantId);
      set.add(ID);
    }
 catch (    final NumberFormatException e) {
    }
  }
  for (  final LeagueEntry entry : entries) {
    try {
      ID=Long.parseLong(entry.getPlayerOrTeamId());
      set.add(ID);
    }
 catch (    final NumberFormatException e) {
    }
  }
  return set;
}

Fixed version (ground truth):
/** 
 * Gets all stored summoner IDs for batch lookup
 * @return the summoner IDs
 */
public Set<Long> getSummonerIDs(){
  final Set<Long> set=new HashSet<>();
  long ID;
  if (participantId != null) {
    try {
      ID=Long.parseLong(participantId);
      set.add(ID);
    }
 catch (    final NumberFormatException e) {
    }
  }
  for (  final LeagueEntry entry : entries) {
    if (entry.getPlayerOrTeamId() != null) {
      try {
        ID=Long.parseLong(entry.getPlayerOrTeamId());
        set.add(ID);
      }
 catch (      final NumberFormatException e) {
      }
    }
  }
  return set;
}
Program: 117654
Project: 117654
Buggy source:
/** 
 * @param API the API to get the data with
 * @param champions which champions to limit this search to
 * @param rankedQueues which queues to limit this search to. Any queues other than RANKED_SOLO_5x5, RANKED_TEAM_5x5, and RANKED_TEAM_3x3 will be ignored.
 * @param beginIndex the begin index to use for fetching games. No more than 15 games will be fetched.
 * @param endIndex the end index to use for fetching games. No more than 15 games will be fetched.
 * @return the summoner's match history
 * @see <a href="https://developer.riotgames.com/api/methods#!/805/2847">LoL
     *      API Specification</a>
 */
public List<MatchSummary> getMatchHistory(final RiotAPI API,final List<Champion> champions,final List<QueueType> rankedQueues,final Integer beginIndex,final Integer endIndex){
  return getMatchHistory(API,champions,rankedQueues,beginIndex,endIndex);
}

Fixed version (ground truth):
/** 
 * @param API the API to get the data with
 * @param champions which champions to limit this search to
 * @param rankedQueues which queues to limit this search to. Any queues other than RANKED_SOLO_5x5, RANKED_TEAM_5x5, and RANKED_TEAM_3x3 will be ignored.
 * @param beginIndex the begin index to use for fetching games. No more than 15 games will be fetched.
 * @param endIndex the end index to use for fetching games. No more than 15 games will be fetched.
 * @return the summoner's match history
 * @see <a href="https://developer.riotgames.com/api/methods#!/805/2847">LoL
     *      API Specification</a>
 */
public List<MatchSummary> getMatchHistory(final RiotAPI API,final List<Champion> champions,final List<QueueType> rankedQueues,final Integer beginIndex,final Integer endIndex){
  return API.getMatchHistory(this,champions,rankedQueues,beginIndex,endIndex);
}
Program: 117655
Project: 117655
Buggy source:
@Override public boolean onLongClick(View v){
  String url=mPreferences.getString(PreferenceConstants.SAVE_URL,null);
  if (url != null) {
    newTab(true,url);
    Toast.makeText(mContext,R.string.deleted_tab,Toast.LENGTH_SHORT).show();
  }
  mEditPrefs.putString(PreferenceConstants.SAVE_URL,null);
  return false;
}

Fixed version (ground truth):
@Override public boolean onLongClick(View v){
  String url=mPreferences.getString(PreferenceConstants.SAVE_URL,null);
  if (url != null) {
    newTab(true,url);
    Toast.makeText(mContext,R.string.deleted_tab,Toast.LENGTH_SHORT).show();
  }
  mEditPrefs.putString(PreferenceConstants.SAVE_URL,null).apply();
  return true;
}
Program: 117658
Project: 117658
Buggy source:
private synchronized void animateTabRemoval(final TextView view,final int position,final LightningView reference,final boolean isShown){
  mRemoveTab.setAnimationListener(new AnimationListener(){
    @Override public void onAnimationEnd(    Animation animation){
      new Handler().post(new Runnable(){
        @Override public void run(){
          mTabLayout.removeView(view);
          mWebViewList.remove(position);
          mIdList.remove(position);
          reference.onDestroy();
          if (mIsNewIntent && isShown) {
            mIsNewIntent=false;
            moveTaskToBack(true);
          }
        }
      }
);
    }
    @Override public void onAnimationRepeat(    Animation animation){
    }
    @Override public void onAnimationStart(    Animation animation){
    }
  }
);
  view.post(new Runnable(){
    @Override public void run(){
      view.startAnimation(mRemoveTab);
    }
  }
);
}

Fixed version (ground truth):
private synchronized void animateTabRemoval(final TextView view,final int position,final LightningView reference,final boolean isShown){
  mRemoveTab.setAnimationListener(new AnimationListener(){
    @Override public void onAnimationEnd(    Animation animation){
      mTabLayout.post(new Runnable(){
        public void run(){
          mActivity.runOnUiThread(new Runnable(){
            public void run(){
              mTabLayout.removeView(view);
              viewIsAnimating=false;
            }
          }
);
        }
      }
);
      if (mIsNewIntent && isShown) {
        mIsNewIntent=false;
        moveTaskToBack(true);
      }
    }
    @Override public void onAnimationRepeat(    Animation animation){
    }
    @Override public void onAnimationStart(    Animation animation){
      viewIsAnimating=true;
    }
  }
);
  view.startAnimation(mRemoveTab);
}
Program: 117659
Project: 117659
Buggy source:
public synchronized void initializeTabs(){
  mIdGenerator=0;
  String url=null;
  if (getIntent() != null) {
    url=getIntent().getDataString();
    if (url != null) {
      if (url.startsWith(Constants.FILE)) {
        Utils.showToast(this,getResources().getString(R.string.message_blocked_local));
        url=null;
      }
    }
  }
  if (mPreferences.getBoolean(PreferenceConstants.RESTORE_LOST_TABS,true)) {
    String mem=mPreferences.getString(PreferenceConstants.URL_MEMORY,"String_Node_Str");
    mEditPrefs.putString(PreferenceConstants.URL_MEMORY,"String_Node_Str");
    String[] array=getArray(mem);
    int count=0;
    for (int n=0; n < array.length; n++) {
      if (array[n].length() > 0) {
        newTab(true,array[n]);
        count++;
      }
    }
    if (url != null) {
      newTab(true,url);
    }
 else     if (count == 0) {
      newTab(true,null);
    }
  }
 else {
    newTab(true,url);
  }
}

Fixed version (ground truth):
public synchronized void initializeTabs(){
  String url=null;
  if (getIntent() != null) {
    url=getIntent().getDataString();
    if (url != null) {
      if (url.startsWith(Constants.FILE)) {
        Utils.showToast(this,getResources().getString(R.string.message_blocked_local));
        url=null;
      }
    }
  }
  if (mPreferences.getBoolean(PreferenceConstants.RESTORE_LOST_TABS,true)) {
    String mem=mPreferences.getString(PreferenceConstants.URL_MEMORY,"String_Node_Str");
    mEditPrefs.putString(PreferenceConstants.URL_MEMORY,"String_Node_Str");
    String[] array=getArray(mem);
    int count=0;
    for (int n=0; n < array.length; n++) {
      if (array[n].length() > 0) {
        newTab(true,array[n]);
        count++;
      }
    }
    if (url != null) {
      newTab(true,url);
    }
 else     if (count == 0) {
      newTab(true,null);
    }
  }
 else {
    newTab(true,url);
  }
}
Program: 117660
Project: 117660
Buggy source:
@Override public synchronized void onBackPressed(){
  mTabLayout.clearDisappearingChildren();
  showActionBar();
  if (mCurrentView.canGoBack()) {
    if (!mCurrentView.isShown()) {
      onHideCustomView();
    }
 else {
      mCurrentView.goBack();
    }
  }
 else {
    deleteTab(mCurrentView.getId());
  }
}

Fixed version (ground truth):
@Override public synchronized void onBackPressed(){
  showActionBar();
  if (mCurrentView.canGoBack()) {
    if (!mCurrentView.isShown()) {
      onHideCustomView();
    }
 else {
      mCurrentView.goBack();
    }
  }
 else {
    if (!mCurrentView.isDestroyed())     deleteTab(mCurrentView.getId());
  }
}
Program: 117661
Project: 117661
Buggy source:
@Override public void showSelectedTab(int id){
  mIsNewIntent=false;
  int index=mIdList.indexOf(id);
  showTab(mWebViewList.get(index));
}

Fixed version (ground truth):
@Override public synchronized void showSelectedTab(int id){
  mIsNewIntent=false;
  int index=mIdList.indexOf(id);
  if (index == -1) {
    return;
  }
  showTab(mWebViewList.get(index));
}
Program: 117663
Project: 117663
Buggy source:
@Override public void onClick(DialogInterface dialog,int id){
  callback.invoke(origin,false,remember);
}

Fixed version (ground truth):
@Override public void onClick(View v){
  if (!isShown() && !isDestroyed())   mBrowserController.showSelectedTab(mId);
}
Program: 117664
Project: 117664
Buggy source:
public synchronized void onDestroy(){
  if (mWebView != null) {
    mWebView.stopLoading();
    mWebView.onPause();
    mWebView.clearHistory();
    mWebView.setVisibility(View.GONE);
    mWebView.removeAllViews();
    mWebView.destroyDrawingCache();
    mWebView=null;
  }
}

Fixed version (ground truth):
public synchronized void onDestroy(){
  isDestroyed=true;
  if (mWebView != null) {
    mWebView.stopLoading();
    mWebView.onPause();
    mWebView.clearHistory();
    mWebView.setVisibility(View.GONE);
    mWebView.removeAllViews();
    mWebView.destroyDrawingCache();
    mWebView=null;
  }
}
Program: 117666
Project: 117666
Buggy source:
@Override public boolean onTouch(View view,MotionEvent event){
  if (mTitleView.getCompoundDrawables()[2] != null) {
    boolean tappedX=event.getX() > (mTitleView.getWidth() - mTitleView.getPaddingRight() - mCloseIcon.getIntrinsicWidth());
    if (tappedX) {
      if (event.getAction() == MotionEvent.ACTION_UP) {
        mBrowserController.deleteTab(mId);
      }
      return true;
    }
 else {
      if (event.getAction() == MotionEvent.ACTION_UP) {
        Log.i("String_Node_Str","String_Node_Str");
        if (!isShown())         mBrowserController.showSelectedTab(mId);
      }
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onTouch(View view,MotionEvent event){
  if (mTitleView.getCompoundDrawables()[2] != null) {
    boolean tappedX=event.getX() > (mTitleView.getWidth() - mTitleView.getPaddingRight() - mCloseIcon.getIntrinsicWidth());
    if (tappedX) {
      if (event.getAction() == MotionEvent.ACTION_UP) {
        mBrowserController.deleteTab(mId);
      }
      return true;
    }
 else {
      if (event.getAction() == MotionEvent.ACTION_UP) {
        Log.i("String_Node_Str","String_Node_Str");
        view.performClick();
      }
      return true;
    }
  }
  return false;
}
Program: 117670
Project: 117670
Buggy source:
public void info(Object arg0,Throwable arg1){
  if (logLevel >= LOG_INFO)   log.info(prefix + arg0,arg1);
}

Fixed version (ground truth):
public void info(Object arg0,Throwable arg1){
  if (logLevel <= LOG_INFO)   log.info(prefix + arg0,arg1);
}
Program: 117671
Project: 117671
Buggy source:
/** 
 * Creates new form InfoDialog
 */
public InfoDialog(Wandora wandora){
  super(wandora,true);
  this.history=new StringBuilder();
  this.wandora=wandora;
  initComponents();
  this.setSize(600,300);
  wandora.centerWindow(this);
  textArea.addMouseListener(this);
  textArea.setComponentPopupMenu(getCopyMenu());
  textArea.setText("String_Node_Str");
  textArea.setText("String_Node_Str");
  iconLabel.setIcon(UIBox.getIcon("String_Node_Str"));
  setState(EXECUTE);
}

Fixed version (ground truth):
/** 
 * Creates new form InfoDialog
 */
public InfoDialog(Wandora wandora){
  super(wandora,true);
  this.history=new StringBuilder();
  this.wandora=wandora;
  initComponents();
  this.setSize(600,300);
  wandora.centerWindow(this);
  textArea.addMouseListener(this);
  textArea.setComponentPopupMenu(getCopyMenu());
  textArea.setText("String_Node_Str");
  textArea.setText("String_Node_Str");
  iconLabel.setIcon(UIBox.getIcon("String_Node_Str"));
}
Program: 117672
Project: 117672
Buggy source:
public void waitUntilVisible(){
  int c=0;
  do {
    c++;
    try {
      Thread.sleep(40);
    }
 catch (    Exception e) {
    }
    ;
  }
 while (!isVisible() && c < 100);
}

Fixed version (ground truth):
private void waitUntilVisible(){
  int c=0;
  do {
    c++;
    try {
      Thread.sleep(200);
    }
 catch (    Exception e) {
    }
    ;
  }
 while (!isVisible() && c < 20);
}
Program: 117674
Project: 117674
Buggy source:
public void open(){
  SwingUtilities.invokeLater(new Runnable(){
    @Override public void run(){
      setVisible(true);
    }
  }
);
}

Fixed version (ground truth):
private void open(){
  if (!isVisible()) {
    dialogThread=new Thread(){
      @Override public void run(){
        setVisible(true);
      }
    }
;
    dialogThread.start();
  }
}
Program: 117675
Project: 117675
Buggy source:
public WandoraToolLogger getDefaultLogger(){
  if (logger != null)   return logger;
  if (runAdmin != null)   return new InfoDialog(runAdmin);
  return null;
}

Fixed version (ground truth):
public WandoraToolLogger getDefaultLogger(){
  if (logger != null)   return logger;
  if (runAdmin != null) {
    InfoDialog infoDialog=new InfoDialog(runAdmin);
    infoDialog.setState(InfoDialog.EXECUTE);
    return infoDialog;
  }
  return null;
}
Program: 117676
Project: 117676
Buggy source:
public void stop(){
  if (currentPanel != null)   currentPanel.stop();
}

Fixed version (ground truth):
public void stop(){
  if (currentPanel != null) {
    System.out.println("String_Node_Str");
    currentPanel.stop();
  }
}
Program: 117677
Project: 117677
Buggy source:
public static PreviewWrapper getPreviewWrapper(Wandora wandora){
  return new PreviewWrapper(wandora);
}

Fixed version (ground truth):
public static PreviewWrapper getPreviewWrapper(){
  return new PreviewWrapper();
}
Program: 117678
Project: 117678
Buggy source:
/** 
 * Creates a new instance of PreviewWrapper
 */
public PreviewWrapper(Wandora admin){
  this.admin=admin;
  this.setLayout(new BorderLayout());
}

Fixed version (ground truth):
/** 
 * Creates a new instance of PreviewWrapper
 */
public PreviewWrapper(){
  this.wandora=Wandora.getWandora();
  this.setLayout(new BorderLayout());
}
Program: 117679
Project: 117679
Buggy source:
public static boolean canView(String url){
  boolean answer=false;
  if (url != null) {
    if (DataURL.isDataURL(url)) {
      try {
        DataURL dataURL=new DataURL(url);
        String mimeType=dataURL.getMimetype();
        if (mimeType != null) {
          String lowercaseMimeType=mimeType.toLowerCase();
          if (lowercaseMimeType.startsWith("String_Node_Str") || lowercaseMimeType.startsWith("String_Node_Str") || lowercaseMimeType.startsWith("String_Node_Str")|| lowercaseMimeType.startsWith("String_Node_Str")|| lowercaseMimeType.startsWith("String_Node_Str")|| lowercaseMimeType.startsWith("String_Node_Str")|| lowercaseMimeType.startsWith("String_Node_Str")|| lowercaseMimeType.startsWith("String_Node_Str")|| lowercaseMimeType.startsWith("String_Node_Str")|| lowercaseMimeType.startsWith("String_Node_Str")|| lowercaseMimeType.startsWith("String_Node_Str")) {
            answer=true;
          }
        }
      }
 catch (      Exception e) {
      }
    }
 else {
      if (endsWithAny(url.toLowerCase(),"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str")) {
        answer=true;
      }
    }
  }
  return answer && hasJavaFX();
}

Fixed version (ground truth):
public static boolean canView(String url){
  boolean answer=false;
  if (url != null) {
    if (DataURL.isDataURL(url)) {
      try {
        DataURL dataURL=new DataURL(url);
        String mimeType=dataURL.getMimetype();
        if (mimeType != null) {
          String lowercaseMimeType=mimeType.toLowerCase();
          if (lowercaseMimeType.startsWith("String_Node_Str") || lowercaseMimeType.startsWith("String_Node_Str") || lowercaseMimeType.startsWith("String_Node_Str")|| lowercaseMimeType.startsWith("String_Node_Str")|| lowercaseMimeType.startsWith("String_Node_Str")|| lowercaseMimeType.startsWith("String_Node_Str")|| lowercaseMimeType.startsWith("String_Node_Str")) {
            answer=true;
          }
        }
      }
 catch (      Exception e) {
      }
    }
 else {
      if (endsWithAny(url.toLowerCase(),"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str")) {
        answer=true;
      }
    }
  }
  return answer && hasJavaFX();
}
Program: 117680
Project: 117680
Buggy source:
@Override public void stop(){
  if (player != null)   player.stop();
}

Fixed version (ground truth):
@Override public void stop(){
  if (player != null) {
    Platform.runLater(new Runnable(){
      @Override public void run(){
        player.stop();
      }
    }
);
  }
}
Program: 117681
Project: 117681
Buggy source:
public void run(){
}

Fixed version (ground truth):
@Override public void run(){
  player.stop();
}
Program: 117682
Project: 117682
Buggy source:
@Override public void finish(){
  if (player != null)   player.stop();
}

Fixed version (ground truth):
@Override public void finish(){
  if (player != null) {
    Platform.runLater(new Runnable(){
      @Override public void run(){
        player.stop();
      }
    }
);
  }
}
Program: 117683
Project: 117683
Buggy source:
private void initialize(){
  fxPanel=new JFXPanel();
  this.setLayout(new BorderLayout());
  this.add(fxPanel,BorderLayout.CENTER);
  Platform.runLater(new Runnable(){
    @Override public void run(){
      Group root=new Group();
      scene=new Scene(root);
      scene.setCursor(Cursor.HAND);
      scene.setFill(Color.rgb(255,255,255,0.0));
      Media media=getMediaFor(mediaUrlString);
      player=getMediaPlayerFor(media);
      if (player != null) {
        slider=new Slider();
        slider.valueChangingProperty().addListener(new ChangeListener<Boolean>(){
          @Override public void changed(          ObservableValue<? extends Boolean> obs,          Boolean wasChanging,          Boolean isNowChanging){
            if (!isNowChanging) {
              player.seek(Duration.seconds(slider.getValue()));
            }
          }
        }
);
        sliderBox=new VBox();
        sliderBox.visibleProperty().set(false);
        sliderBox.getChildren().add(slider);
        mediaView=new MediaView(player);
        root.getChildren().add(mediaView);
        root.getChildren().add(sliderBox);
      }
      fxPanel.setScene(scene);
    }
  }
);
}

Fixed version (ground truth):
private void initialize(){
  fxPanel=new JFXPanel();
  this.setLayout(new BorderLayout());
  this.add(fxPanel,BorderLayout.CENTER);
  Platform.runLater(new Runnable(){
    @Override public void run(){
      Group root=new Group();
      scene=new Scene(root);
      scene.setCursor(Cursor.HAND);
      scene.setFill(Color.rgb(255,255,255,0.0));
      Media media=getMediaFor(mediaUrlString);
      player=getMediaPlayerFor(media);
      if (player != null) {
        slider=new Slider();
        slider.valueChangingProperty().addListener(new ChangeListener<Boolean>(){
          @Override public void changed(          ObservableValue<? extends Boolean> obs,          Boolean wasChanging,          final Boolean isNowChanging){
            if (!isNowChanging) {
              player.seek(Duration.seconds(slider.getValue()));
            }
          }
        }
);
        sliderBox=new VBox();
        sliderBox.visibleProperty().set(false);
        sliderBox.getChildren().add(slider);
        mediaView=new MediaView(player);
        root.getChildren().add(mediaView);
        root.getChildren().add(sliderBox);
      }
      fxPanel.setScene(scene);
    }
  }
);
}
Program: 117684
Project: 117684
Buggy source:
public FXMediaPlayer(String mediaUrlString){
  this.mediaUrlString=mediaUrlString;
  initialize();
}

Fixed version (ground truth):
public FXMediaPlayer(String mediaUrlString){
  Platform.setImplicitExit(false);
  this.mediaUrlString=mediaUrlString;
  initialize();
}